9
3

toqeycitizenshiptrial.lua 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --[[
  2. Script Name : SpawnScripts/Starcrest/toqeycitizenshiptrial.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.09.01 06:09:25
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. SetRequiredQuest(NPC, 5762, 13)
  10. SetRequiredQuest(NPC, 5722, 2)
  11. SetRequiredQuest(NPC, 5722, 3)
  12. SetRequiredQuest(NPC, 5722, 4)
  13. SetRequiredQuest(NPC, 5722, 5)
  14. SetRequiredQuest(NPC, 5722, 6)
  15. SetRequiredQuest(NPC, 5722, 7)
  16. SetRequiredQuest(NPC, 5722, 8)
  17. end
  18. function casted_on(NPC, Spawn,SpellName)
  19. if SpellName == 'Use citizenship sign' then
  20. if HasQuest(Spawn,5762) and not HasCompletedQuest(Spawn,5722) and not HasItem(Spawn, 13322,1) then
  21. SendMessage(Spawn, "You pull an application for citizenship from the wall.")
  22. Quest = GetQuest(Spawn,5762)
  23. GiveQuestItem(Quest, Spawn, "I must complete this task to become a Citizen of Qeynos.", 13322)
  24. elseif not HasQuest(Spawn, 5722) and HasItem(Spawn, 13322,1) or GetQuestStep(Spawn,5722)==1 and HasItem(Spawn, 13322,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, 5722) and GetQuestStep(Spawn,5722)>=2 or HasQuest(Spawn, 5722) and GetQuestStep(Spawn,5722)<=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,5722)==2 then
  38. SetStepComplete(Spawn,5722,2)
  39. end
  40. ZoneRef = GetZone("QeynosCitizenshipTrialChamber")
  41. Zone(ZoneRef,Spawn)
  42. end
  43. function respawn(NPC)
  44. spawn(NPC)
  45. end