toqeycitizenshiptrial.lua 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. --[[
  2. Script Name : SpawnScripts/Castleview/toqeycitizenshiptrial.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.09.01 06:09:26
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. SetRequiredQuest(NPC, 5765, 13)
  10. SetRequiredQuest(NPC, 5719, 2)
  11. SetRequiredQuest(NPC, 5719, 3)
  12. SetRequiredQuest(NPC, 5719, 4)
  13. SetRequiredQuest(NPC, 5719, 5)
  14. SetRequiredQuest(NPC, 5719, 6)
  15. SetRequiredQuest(NPC, 5719, 7)
  16. SetRequiredQuest(NPC, 5719, 8)
  17. end
  18. function casted_on(NPC, Spawn,SpellName)
  19. if SpellName == 'Enter the Trial' then
  20. if GetQuestStep(Spawn,5719)>=2 or GetQuestStep(Spawn,5719)<=8 then
  21. SetStepComplete(Spawn,5719,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,5765) and not HasCompletedQuest(Spawn,5719) and not HasItem(Spawn, 4865,1) then
  33. SendMessage(Spawn, "You pull an application for citizenship from the wall.")
  34. Quest = GetQuest(Spawn,5765)
  35. GiveQuestItem(Quest, Spawn, "I must complete this task to become a Citizen of Qeynos.", 4865)
  36. elseif not HasQuest(Spawn, 5719) and HasItem(Spawn, 4865,1) or GetQuestStep(Spawn,5719)==1 and HasItem(Spawn, 4865,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, 5719) and GetQuestStep(Spawn,5719)>=2 or HasQuest(Spawn, 5719) and GetQuestStep(Spawn,5719)<=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,5719)==2 then
  50. SetStepComplete(Spawn,5719,2)
  51. end
  52. ZoneRef = GetZone("QeynosCitizenshipTrialChamber")
  53. Zone(ZoneRef,Spawn)
  54. end
  55. function respawn(NPC)
  56. spawn(NPC)
  57. end