adisgruntledrefugee.lua 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. --[[
  2. Script Name : SpawnScripts/QeynosCitizenshipTrialChamber/adisgruntledrefugee.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.08.31 06:08:19
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local BQCitizen = 5718
  10. local CVQCitizen = 5719
  11. local GQCitizen = 5720
  12. local NQCitizen = 5721
  13. local SCQCitizen = 5722
  14. local WWQCitizen = 5723
  15. function spawn(NPC)
  16. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  17. end
  18. function InRange(NPC, Spawn)
  19. PlayFlavor(NPC, "","I'm so sorry... I didn't mean to do it!", "cry", 0,0, Spawn)
  20. end
  21. function hailed(NPC, Spawn)
  22. Dialog1(NPC, Spawn)
  23. end
  24. function Dialog1(NPC, Spawn)
  25. FaceTarget(NPC, Spawn)
  26. Dialog.New(NPC, Spawn)
  27. PlayFlavor(NPC,"","","wince",0,0,Spawn)
  28. Dialog.AddDialog("I promise I'll be better if you find it in your heart to spare me")
  29. Dialog.AddOption("Why would I do that?", "Dialog2")
  30. Dialog.AddOption("You must be punished for your crimes!", "AttackTimer")
  31. Dialog.Start()
  32. end
  33. function Dialog2(NPC, Spawn)
  34. FaceTarget(NPC, Spawn)
  35. Dialog.New(NPC, Spawn)
  36. Dialog.AddDialog("I made one mistake ... I cast my lot with these scoundrels, and yet, I've regretted it ever since. Can you not spare me? I wish only to go back to my former life and make amends to the Ironforges.")
  37. Dialog.AddOption("Perhaps. I need to think upon this further.")
  38. Dialog.AddOption("I'm listening...", "Dialog3")
  39. Dialog.AddOption("You must be punished for your crimes!", "AttackTimer")
  40. Dialog.AddOption("All traitors to Qeynos must die!", "AttackTimer")
  41. Dialog.Start()
  42. end
  43. function Dialog3(NPC, Spawn)
  44. FaceTarget(NPC, Spawn)
  45. Dialog.New(NPC, Spawn)
  46. Dialog.AddDialog("I'll do anything! I betrayed all who I loved by my actions, and I cannot bring myself to face the consequences.")
  47. PlayFlavor(NPC,"","","beg",0,0,Spawn)
  48. Dialog.AddOption("You will have to face those consequences... but you will not face death. Begone.","ThankYou")
  49. Dialog.AddOption("You can and will face the consequences. For treason, this means death.", "AttackTimer")
  50. Dialog.Start()
  51. end
  52. function ThankYou(NPC,Spawn)
  53. AddTimer(NPC,6400,"Runaway",1)
  54. Update(NPC,Spawn)
  55. PlayFlavor(NPC,"","","notworthy",0,0,Spawn)
  56. end
  57. function Runaway(NPC,Spawn)
  58. Despawn(NPC)
  59. MoveToLocation(NPC, -10.91, -0.39, 1.64, 4)
  60. -- MoveToLocation(NPC, -9.65, -0.39, -8.53, 4)
  61. -- MoveToLocation(NPC, 16.44, -0.39, -9.29, 4)
  62. -- MoveToLocation(NPC, 19.30, 1.17, -0.86, 4)
  63. -- MoveToLocation(NPC, -10.94, 0.99, 8.04 , 4,"Leave")
  64. end
  65. function death(NPC,Spawn)
  66. Update(NPC,Spawn)
  67. end
  68. function Update(NPC,Spawn)
  69. if HasQuest(Spawn,BQCitizen) then
  70. SetStepComplete(Spawn,BQCitizen,5)
  71. elseif HasQuest(Spawn,CVQCitizen) then
  72. SetStepComplete(Spawn,CVQCitizen,5)
  73. elseif HasQuest(Spawn,GQCitizen) then
  74. SetStepComplete(Spawn,GQCitizen,5)
  75. elseif HasQuest(Spawn,NQCitizen) then
  76. SetStepComplete(Spawn,NQCitizen,5)
  77. elseif HasQuest(Spawn,SCQCitizen) then
  78. SetStepComplete(Spawn,SCQCitizen,5)
  79. elseif HasQuest(Spawn,WWQCitizen) then
  80. SetStepComplete(Spawn,WWQCitizen,5)
  81. end
  82. end
  83. function Leave(NPC)
  84. Despawn(NPC)
  85. end
  86. function AttackTimer(NPC,Spawn)
  87. AddTimer(NPC,1200,"Attacking",1,Spawn)
  88. end
  89. function Attacking(NPC,Spawn)
  90. SpawnSet(NPC,"attackable",1)
  91. SpawnSet(NPC,"show_level",1)
  92. SpawnSet(NPC,"command_primary",11)
  93. Attack(NPC,Spawn)
  94. end
  95. function aggro(NPC,Spawn)
  96. SpawnSet(NPC,"attackable",1)
  97. SpawnSet(NPC,"show_level",1)
  98. SpawnSet(NPC,"command_primary",11)
  99. end