tofprtcitizenshiptrial.lua 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. --[[
  2. Script Name : SpawnScripts/Stonestair/tofprtcitizenshiptrial.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.06.29 04:06:33
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. SetRequiredQuest(NPC, 5859, 13)
  10. SetRequiredQuest(NPC, 5870, 2)
  11. SetRequiredQuest(NPC, 5870, 3)
  12. SetRequiredQuest(NPC, 5870, 4)
  13. SetRequiredQuest(NPC, 5870, 5)
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. local TaskSheet = 13398
  19. local WelcomeQuest = 5859
  20. local TaskQuest = 5870
  21. function casted_on(NPC, Spawn,SpellName)
  22. if SpellName == 'Use citizenship sign' then
  23. if HasQuest(Spawn,WelcomeQuest) and not HasCompletedQuest(Spawn,TaskQuest) and not HasItem(Spawn, TaskSheet,1) then
  24. Quest = GetQuest(Spawn,WelcomeQuest)
  25. SendMessage(Spawn, "You pull an application for citizenship from the wall.")
  26. GiveQuestItem(Quest, Spawn, "I must complete this task to become a Citizen of Freeport.", TaskSheet)
  27. elseif not HasQuest(Spawn, TaskQuest) and HasItem(Spawn, TaskSheet,1) or GetQuestStep(Spawn,TaskQuest)==1 and HasItem(Spawn, TaskSheet,1) then
  28. SendMessage(Spawn, "I must complete my citizenship task before performing the Citizenship Trial.")
  29. SendPopUpMessage(Spawn, "I must complete my citizenship task before performing the Citizenship Trial.", 200, 200, 200)
  30. elseif HasQuest(Spawn, TaskQuest) and GetQuestStep(Spawn,TaskQuest)>=2 and GetQuestStep(Spawn,TaskQuest)<=5 then
  31. local con = CreateConversation()
  32. AddConversationOption(con, "Yes", "Leave")
  33. AddConversationOption(con, "No","CloseConversation")
  34. StartDialogConversation(con, 1, NPC, Spawn, "You have all the tokens required to enter the Trial Chamber. Do you wish to begin the trial?")
  35. end
  36. end
  37. end
  38. function Leave(NPC,Spawn)
  39. CloseConversation(NPC,Spawn)
  40. if GetQuestStep(Spawn,TaskQuest)==2 then
  41. SetStepComplete(Spawn,TaskQuest,2)
  42. end
  43. ZoneRef = GetZone("FreeportCitizenshipTrialChamber")
  44. Zone(ZoneRef,Spawn)
  45. end
  46. function respawn(NPC)
  47. spawn(NPC)
  48. end