9
3

toqeycitizenshiptrial.lua 2.0 KB

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