9
3

ilgar.lua 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. --[[
  2. Script Name : ilgar.lua
  3. Script Purpose : Waypoint Path for ilgar.lua
  4. Script Author : Dorbin
  5. Script Date : 05.16.2022
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local Fairies = 5558
  10. local Quest2 = 5788 --Fighter Quest pt2
  11. dofile("SpawnScripts/Generic/ExpelNonCitizen.lua")
  12. dofile("SpawnScripts/Generic/GenericGuardVoiceOvers.lua")
  13. function spawn(NPC)
  14. waypoints(NPC)
  15. ProvidesQuest(NPC,Fairies)
  16. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  17. end
  18. function InRange(NPC, Spawn)
  19. NonCitizen(NPC,Spawn)
  20. end
  21. function hailed(NPC, Spawn)
  22. if GetFactionAmount(Spawn,11) <0 then
  23. FaceTarget(NPC, Spawn)
  24. choice = math.random(1,2)
  25. if choice == 1 then
  26. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  27. elseif choice == 2 then
  28. PlayFlavor(NPC, "", "", "heckno", 1584866727, 581589457, Spawn)
  29. end
  30. else
  31. FaceTarget(NPC, Spawn)
  32. Dialog.New(NPC, Spawn)
  33. PlayFlavor(NPC, "","", "no", 0, 0,Spawn)
  34. Dialog.AddDialog("Move along citizen. I'm extremely busy.")
  35. Dialog.AddVoiceover("voiceover/english/knight-lieutenant_ilgar/qey_south/lieutenantilgar.mp3", 1779980030, 2184277232)
  36. if not HasQuest(Spawn,Fairies) and not HasCompletedQuest(Spawn, Fairies) then
  37. Dialog.AddOption("Busy you say? I'm available to assist if you need.", "Busy")
  38. end
  39. if GetQuestStep(Spawn, Fairies)==2 then
  40. Dialog.AddOption("I've reduced the fairy population in the Peat Bog as you asked.", "BusyFinished")
  41. end
  42. if HasQuest(Spawn,Quest2) and GetQuestStep(Spawn,Quest2)>=1 and GetQuestStep(Spawn,Quest2)<=3 and not QuestStepIsComplete(Spawn,Quest2,2) then
  43. Dialog.AddOption("I just wanted to give my thanks for everything the Qeynos Guard does for the city.","FighterQuest")
  44. end
  45. Dialog.AddOption("Alright. As you were.")
  46. Dialog.Start()
  47. end
  48. end
  49. function Busy(NPC,Spawn)
  50. FaceTarget(NPC, Spawn)
  51. Dialog.New(NPC, Spawn)
  52. PlayFlavor(NPC, "","", "", 0, 0,Spawn)
  53. Dialog.AddDialog("It would be a great help if you can. I need someone to head to the nearby Peat Bog and put a sizable dent in the fairy population. It seems they have been sneaking into Nettleville and Starcrest and playing pranks on the good folks of the villages.")
  54. Dialog.AddVoiceover("voiceover/english/lieutenant_ilgar/qey_south/lieutenantilgar000.mp3",1212038397, 2389104068)
  55. Dialog.AddOption("Sounds fair enough. Would I be paid for my service?","OfferFairyQuest")
  56. Dialog.AddOption("Err, I meant I'm 'not' available. Sorry.")
  57. Dialog.Start()
  58. end
  59. function OfferFairyQuest(NPC, Spawn)
  60. PlayFlavor(NPC, "", "", "salute",0 , 0, Spawn)
  61. FaceTarget(NPC, Spawn)
  62. OfferQuest(NPC, Spawn,Fairies)
  63. end
  64. function BusyFinished(NPC,Spawn)
  65. FaceTarget(NPC, Spawn)
  66. Dialog.New(NPC, Spawn)
  67. PlayFlavor(NPC, "","", "", 0, 0,Spawn)
  68. Dialog.AddDialog("Hmm, yes it looks like you did your job. Reports of the mischeivious fayfolk interfering in the villages have lessened considerably. Here is your payment for a job well done.")
  69. Dialog.AddVoiceover("voiceover/english/lieutenant_ilgar/qey_south/lieutenantilgar002.mp3",1911360769, 3372915409)
  70. Dialog.AddOption("Grateful I could be of assistance.", "QuestDone")
  71. Dialog.Start()
  72. end
  73. function QuestDone(NPC,Spawn)
  74. FaceTarget(NPC, Spawn)
  75. SetStepComplete(Spawn,Fairies, 2)
  76. PlayFlavor(NPC, "", "", "salute",0 , 0)
  77. PlayFlavor(Spawn, "", "", "salute",0 , 0)
  78. end
  79. function respawn(NPC)
  80. spawn(NPC)
  81. end
  82. function BusyFinished(NPC,Spawn)
  83. FaceTarget(NPC, Spawn)
  84. Dialog.New(NPC, Spawn)
  85. PlayFlavor(NPC, "","", "", 0, 0,Spawn)
  86. Dialog.AddDialog("Hmm, yes it looks like you did your job. Reports of the mischeivious fayfolk interfering in the villages have lessened considerably. Here is your payment for a job well done.")
  87. Dialog.AddVoiceover("voiceover/english/lieutenant_ilgar/qey_south/lieutenantilgar002.mp3",1911360769, 3372915409)
  88. Dialog.AddOption("Greatful I could be of assistance.", "QuestDone")
  89. Dialog.Start()
  90. end
  91. function FighterQuest(NPC,Spawn) --NO VO available, but actual text!
  92. FaceTarget(NPC, Spawn)
  93. Dialog.New(NPC, Spawn)
  94. PlayFlavor(NPC, "","", "confused", 0, 0,Spawn)
  95. Dialog.AddDialog("Really? Oh. Well, you know how it is ... you gotta do what you gotta do, you know? It's not as hard as it looks, all things considered. I figure I can do my part by keeping an eye out for any gnolls or threats to the city. Well, hey... thanks for saying something.")
  96. --Dialog.AddVoiceover("voiceover/english/lieutenant_ilgar/qey_south/lieutenantilgar003.mp3",1911360769, 3372915409)
  97. Dialog.AddOption("Keep it up!","FighterQuest2")
  98. Dialog.Start()
  99. end
  100. function FighterQuest2(NPC,Spawn)
  101. FaceTarget(NPC, Spawn)
  102. PlayFlavor(NPC, "", "", "salute", 0, 0)
  103. SetStepComplete(Spawn,Quest2,2)
  104. end
  105. function waypoints(NPC)
  106. MovementLoopAddLocation(NPC, 469.14, -20.96, 194.86, 2, 0)
  107. MovementLoopAddLocation(NPC, 406.76, -20.87, 145.25, 2, 8)
  108. MovementLoopAddLocation(NPC, 421.86, -20.93, 168.96, 2, 0)
  109. MovementLoopAddLocation(NPC, 436.36, -20.26, 209.37, 2, 0)
  110. MovementLoopAddLocation(NPC, 452.7, -21.95, 242.39, 2, 0)
  111. MovementLoopAddLocation(NPC, 455.55, -21.92, 244.74, 2, 6)
  112. MovementLoopAddLocation(NPC, 469.7, -21.06, 196.34, 2, 0)
  113. MovementLoopAddLocation(NPC, 455.55, -21.92, 244.74, 2, 0)
  114. MovementLoopAddLocation(NPC, 441.84, -21.92, 263.49, 2, 0)
  115. MovementLoopAddLocation(NPC, 452.7, -21.95, 242.39, 2, 0)
  116. MovementLoopAddLocation(NPC, 436.36, -20.26, 209.37, 2, 0)
  117. MovementLoopAddLocation(NPC, 421.86, -20.93, 168.96, 2, 0)
  118. MovementLoopAddLocation(NPC, 406.76, -20.87, 145.25, 2, 0)
  119. MovementLoopAddLocation(NPC, 469.14, -20.96, 194.86, 2, 0)
  120. end