toqeycitizenshiptrial.lua 2.4 KB

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