9
3

toqeycitizenshiptrial.lua 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --[[
  2. Script Name : SpawnScripts/Baubbleshire/toqeycitizenshiptrial.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.08.30 08:08:36
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. SetRequiredQuest(NPC, 5760, 13)
  10. SetRequiredQuest(NPC, 5718, 2)
  11. SetRequiredQuest(NPC, 5718, 3)
  12. SetRequiredQuest(NPC, 5718, 4)
  13. SetRequiredQuest(NPC, 5718, 5)
  14. SetRequiredQuest(NPC, 5718, 6)
  15. SetRequiredQuest(NPC, 5718, 7)
  16. SetRequiredQuest(NPC, 5718, 8)
  17. end
  18. function casted_on(NPC, Spawn,SpellName)
  19. if SpellName == 'Use citizenship sign' then
  20. if HasQuest(Spawn,5760) and GetQuestStep(Spawn,5760)==13 and not HasItem(Spawn, 13942,1) and not HasCompletedQuest(Spawn,5718) and not HasItem(Spawn, 13942,1) then
  21. SendMessage(Spawn, "You pull an application for citizenship from the wall.")
  22. Quest = GetQuest(Spawn,5760)
  23. GiveQuestItem(Quest, Spawn, "I must complete this task to become a Citizen of Qeynos.", 13942)
  24. elseif not HasQuest(Spawn, 5718) and HasItem(Spawn, 13942,1) or GetQuestStep(Spawn,5718)==1 and HasItem(Spawn, 13942,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, 5718) and GetQuestStep(Spawn,5718)>=2 or HasQuest(Spawn, 5718) and GetQuestStep(Spawn,5718)<=8 then
  28. local con = CreateConversation()
  29. AddConversationOption(con, "Yes", "Leave")
  30. AddConversationOption(con, "No","CloseConversation")
  31. StartDialogConversation(con, 1, NPC, Player, "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,Player)
  37. if GetQuestStep(Spawn,5718)==2 then
  38. SetStepComplete(Spawn,5718,2)
  39. end
  40. ZoneRef = GetZone("QeynosCitizenshipTrialChamber")
  41. Zone(ZoneRef,Spawn)
  42. end
  43. function respawn(NPC)
  44. spawn(NPC)
  45. end