KnightCaptainSantis.lua 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. --[[
  2. Script Name : SpawnScripts/StarcrestCommune/KnightCaptainSantis.lua
  3. Script Purpose : Knight-Captain Santis
  4. Script Author : Ememjr
  5. Script Date : 2017.10.28
  6. Script Notes : Added Nettleville Quest, restructured entire script to simplify dialog flow, used updated format, added patrol, and applied lost voiceovers. - Dorbin 06.24.2022
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 9, "InRange", "LeaveRange")
  11. ProvidesQuest(NPC, 240)
  12. waypoints(NPC)
  13. end
  14. function hailed(NPC, Spawn)
  15. FaceTarget(NPC, Spawn)
  16. if GetFactionAmount(Spawn,11)<0 then --Faction Check
  17. PlayFlavor(NPC, "", "", "glare", 0, 0, Spawn)
  18. else
  19. Dialog.New(NPC, Spawn)
  20. Dialog.AddDialog("Good day to you. I've been hearing reports that the Peat Bog isn't safe right now. I hope you didn't have any trouble if you came in that way.")
  21. Dialog.AddVoiceover("voiceover/english/knight-captain_santis/qey_village02/captainsantis000.mp3", 284995589, 2677019457)
  22. if not HasQuest(Spawn,240) and not HasCompletedQuest(Spawn,240)then
  23. Dialog.AddOption("What kind of trouble is out in the bog?", "Option4")
  24. end
  25. if GetQuestStep(Spawn, 5596)==1 then
  26. Dialog.AddOption("I bring you an urgent message from the Nettleville Garrison.", "Delivered")
  27. end
  28. if GetQuestStep(Spawn, 240)==2 then
  29. Dialog.AddOption("I am happy to report that I have eliminated several Bog Sludges at your request.","Killed")
  30. end
  31. Dialog.AddOption("Sorry, I can't help right now.")
  32. Dialog.Start()
  33. end
  34. end
  35. function InRange(NPC,Spawn)
  36. if GetFactionAmount(Spawn,11)<0 then --Faction Check
  37. FaceTarget(NPC, Spawn)
  38. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  39. else
  40. if math.random(1,100)<=70 then
  41. if not HasQuest(Spawn,240) and not HasCompletedQuest(Spawn,240)then
  42. FaceTarget(NPC, Spawn)
  43. PlayFlavor(NPC, "voiceover/english/knight-captain_santis/qey_village02/100_captain_santis_callout1_19a89b99.mp3", "Have you a moment? We guards could use your assistance!", "beckon", 1556357717, 1654370636, Spawn)
  44. end
  45. end
  46. end
  47. end
  48. function Killed(NPC, Spawn)
  49. FaceTarget(NPC, Spawn)
  50. Dialog.New(NPC, Spawn)
  51. Dialog.AddDialog("You are truly valuable to Qeynos. I'm already receiving optimistic reports that the Bog Sludge are finally under control. Please accept this reward for a job well done.")
  52. Dialog.AddVoiceover("voiceover/english/knight-captain_santis/qey_village02/captainsantis003.mp3", 3636963969, 2486393631)
  53. Dialog.AddOption("It feels good to make the area a little bit safer.","GetReward")
  54. Dialog.Start()
  55. end
  56. function GetReward(NPC, Spawn)
  57. SetStepComplete(Spawn, 240, 2)
  58. PlayFlavor(NPC, "", "", "salute", 0, 0, Spawn)
  59. FaceTarget(NPC, Spawn)
  60. end
  61. function Option4(NPC, Spawn)
  62. FaceTarget(NPC, Spawn)
  63. Dialog.New(NPC, Spawn)
  64. Dialog.AddDialog("The Bog Sludges have swelled in number, spreading like pestilence. This vermin has become a serious menace to the refugees in that region. The Sludges must be exterminated for the safety of the people. I hope you're not too squeamish for such a job.")
  65. Dialog.AddVoiceover("voiceover/english/knight-captain_santis/qey_village02/captainsantis001.mp3", 1552831304, 2969481054)
  66. Dialog.AddOption("A few sludges shouldn't be a problem for me.", "Offer")
  67. Dialog.AddOption("I have NO desire to step foot in that bog. Sorry.")
  68. Dialog.Start()
  69. end
  70. function Delivered(NPC, Spawn)
  71. FaceTarget(NPC, Spawn)
  72. Dialog.New(NPC, Spawn)
  73. PlayFlavor(NPC, "", "", "chuckle", 0, 0, Spawn)
  74. SetStepComplete(Spawn, 5596, 1)
  75. Dialog.AddDialog("Let me read that... Ho- HuahaHa! Captain Hastings and his team wish to challenge the Starcrest Garrison to a Phalanx match? We shall squash them! Tell him I accept.")
  76. Dialog.AddVoiceover("voiceover/english/knight-captain_santis/qey_village02/captainsantis004.mp3", 2733227835, 642461041)
  77. Dialog.AddOption("A phalanx match! I will tell let him know.")
  78. if not HasQuest(Spawn,240) and not HasCompletedQuest(Spawn,240)then
  79. Dialog.AddOption("I will let him know. You mentioned some trouble out in the bog?", "Option4")
  80. end
  81. Dialog.Start()
  82. end
  83. function Offer(NPC,Spawn)
  84. OfferQuest(NPC, Spawn, 240)
  85. end
  86. function waypoints(NPC)
  87. MovementLoopAddLocation(NPC, 759, -24.95, 336.52, 2, 46)
  88. MovementLoopAddLocation(NPC, 757.86, -24.92, 337.34, 2, 0)
  89. MovementLoopAddLocation(NPC, 752.96, -24.79, 337.18, 2, 0)
  90. MovementLoopAddLocation(NPC, 740.19, -24.59, 339.85, 2, 15)
  91. MovementLoopAddLocation(NPC, 742.11, -24.63, 338.84, 2, 0)
  92. MovementLoopAddLocation(NPC, 752.35, -24.78, 337.77, 2, 0)
  93. MovementLoopAddLocation(NPC, 759.54, -24.97, 337.31, 2, 0)
  94. MovementLoopAddLocation(NPC, 766.69, -25.1, 334.76, 2, 0)
  95. MovementLoopAddLocation(NPC, 784.29, -24.99, 328.35, 2, 0)
  96. MovementLoopAddLocation(NPC, 791.44, -25.16, 332.77, 2, 15)
  97. MovementLoopAddLocation(NPC, 790.74, -25.17, 332.02, 2, 0)
  98. MovementLoopAddLocation(NPC, 787.45, -25.1, 329.04, 2, 0)
  99. MovementLoopAddLocation(NPC, 773.01, -25.02, 333.16, 2, 0)
  100. MovementLoopAddLocation(NPC, 759.05, -24.92, 335.15, 2, 0)
  101. MovementLoopAddLocation(NPC, 773.01, -25.02, 333.16, 2, 0)
  102. MovementLoopAddLocation(NPC, 787.45, -25.1, 329.04, 2, 0)
  103. MovementLoopAddLocation(NPC, 790.74, -25.17, 332.02, 2, 0)
  104. MovementLoopAddLocation(NPC, 791.44, -25.16, 332.77, 2, 15)
  105. MovementLoopAddLocation(NPC, 784.29, -24.99, 328.35, 2, 0)
  106. MovementLoopAddLocation(NPC, 766.69, -25.1, 334.76, 2, 0)
  107. MovementLoopAddLocation(NPC, 759.54, -24.97, 337.31, 2, 0)
  108. MovementLoopAddLocation(NPC, 752.35, -24.78, 337.77, 2, 0)
  109. MovementLoopAddLocation(NPC, 742.11, -24.63, 338.84, 2, 0)
  110. MovementLoopAddLocation(NPC, 740.19, -24.59, 339.85, 2, 15)
  111. MovementLoopAddLocation(NPC, 752.96, -24.79, 337.18, 2, 0)
  112. MovementLoopAddLocation(NPC, 757.86, -24.92, 337.34, 2, 0)
  113. end