9
3

KnightCaptainSantis.lua 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. require "SpawnScripts/Generic/NPCModule"
  10. require "SpawnScripts/Generic/NPCModule"
  11. function spawn(NPC, Spawn)
  12. NPCModule(NPC, Spawn)
  13. SetPlayerProximityFunction(NPC, 9, "InRange", "LeaveRange")
  14. ProvidesQuest(NPC, 240)
  15. AddTimer(NPC, 6000, "waypoints")
  16. end
  17. function hailed(NPC, Spawn)
  18. FaceTarget(NPC, Spawn)
  19. if GetFactionAmount(Spawn,11)<0 then --Faction Check
  20. PlayFlavor(NPC, "", "", "glare", 0, 0, Spawn)
  21. else
  22. Dialog.New(NPC, Spawn)
  23. 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.")
  24. Dialog.AddVoiceover("voiceover/english/knight-captain_santis/qey_village02/captainsantis000.mp3", 284995589, 2677019457)
  25. if not HasQuest(Spawn,240) and not HasCompletedQuest(Spawn,240)then
  26. Dialog.AddOption("What kind of trouble is out in the bog?", "Option4")
  27. end
  28. if GetQuestStep(Spawn, 5596)==1 then
  29. Dialog.AddOption("I bring you an urgent message from the Nettleville Garrison.", "Delivered")
  30. end
  31. if GetQuestStep(Spawn, 240)==2 then
  32. Dialog.AddOption("I am happy to report that I have eliminated several Bog Sludges at your request.","Killed")
  33. end
  34. Dialog.AddOption("Sorry, I can't help right now.")
  35. Dialog.Start()
  36. end
  37. end
  38. function InRange(NPC,Spawn)
  39. if GetFactionAmount(Spawn,11)<0 then --Faction Check
  40. FaceTarget(NPC, Spawn)
  41. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  42. else
  43. if math.random(1,100)<=70 then
  44. if not HasQuest(Spawn,240) and not HasCompletedQuest(Spawn,240)then
  45. FaceTarget(NPC, Spawn)
  46. 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)
  47. end
  48. end
  49. end
  50. end
  51. function Killed(NPC, Spawn)
  52. FaceTarget(NPC, Spawn)
  53. Dialog.New(NPC, Spawn)
  54. 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.")
  55. Dialog.AddVoiceover("voiceover/english/knight-captain_santis/qey_village02/captainsantis003.mp3", 3636963969, 2486393631)
  56. Dialog.AddOption("It feels good to make the area a little bit safer.","GetReward")
  57. Dialog.Start()
  58. end
  59. function GetReward(NPC, Spawn)
  60. SetStepComplete(Spawn, 240, 2)
  61. PlayFlavor(NPC, "", "", "salute", 0, 0, Spawn)
  62. FaceTarget(NPC, Spawn)
  63. end
  64. function Option4(NPC, Spawn)
  65. FaceTarget(NPC, Spawn)
  66. Dialog.New(NPC, Spawn)
  67. 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.")
  68. Dialog.AddVoiceover("voiceover/english/knight-captain_santis/qey_village02/captainsantis001.mp3", 1552831304, 2969481054)
  69. Dialog.AddOption("A few sludges shouldn't be a problem for me.", "Offer")
  70. Dialog.AddOption("I have NO desire to step foot in that bog. Sorry.")
  71. Dialog.Start()
  72. end
  73. function Delivered(NPC, Spawn)
  74. FaceTarget(NPC, Spawn)
  75. Dialog.New(NPC, Spawn)
  76. PlayFlavor(NPC, "", "", "chuckle", 0, 0, Spawn)
  77. SetStepComplete(Spawn, 5596, 1)
  78. 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.")
  79. Dialog.AddVoiceover("voiceover/english/knight-captain_santis/qey_village02/captainsantis004.mp3", 2733227835, 642461041)
  80. Dialog.AddOption("A phalanx match! I will tell let him know.")
  81. if not HasQuest(Spawn,240) and not HasCompletedQuest(Spawn,240)then
  82. Dialog.AddOption("I will let him know. You mentioned some trouble out in the bog?", "Option4")
  83. end
  84. Dialog.Start()
  85. end
  86. function Offer(NPC,Spawn)
  87. OfferQuest(NPC, Spawn, 240)
  88. end
  89. function waypoints(NPC)
  90. MovementLoopAddLocation(NPC, 759, -24.95, 336.52, 2, 46)
  91. MovementLoopAddLocation(NPC, 757.86, -24.92, 337.34, 2, 0)
  92. MovementLoopAddLocation(NPC, 752.96, -24.79, 337.18, 2, 0)
  93. MovementLoopAddLocation(NPC, 740.19, -24.59, 339.85, 2, 15)
  94. MovementLoopAddLocation(NPC, 742.11, -24.63, 338.84, 2, 0)
  95. MovementLoopAddLocation(NPC, 752.35, -24.78, 337.77, 2, 0)
  96. MovementLoopAddLocation(NPC, 759.54, -24.97, 337.31, 2, 0)
  97. MovementLoopAddLocation(NPC, 766.69, -25.1, 334.76, 2, 0)
  98. MovementLoopAddLocation(NPC, 784.29, -24.99, 328.35, 2, 0)
  99. MovementLoopAddLocation(NPC, 791.44, -25.16, 332.77, 2, 15)
  100. MovementLoopAddLocation(NPC, 790.74, -25.17, 332.02, 2, 0)
  101. MovementLoopAddLocation(NPC, 787.45, -25.1, 329.04, 2, 0)
  102. MovementLoopAddLocation(NPC, 773.01, -25.02, 333.16, 2, 0)
  103. MovementLoopAddLocation(NPC, 759.05, -24.92, 335.15, 2, 0)
  104. MovementLoopAddLocation(NPC, 773.01, -25.02, 333.16, 2, 0)
  105. MovementLoopAddLocation(NPC, 787.45, -25.1, 329.04, 2, 0)
  106. MovementLoopAddLocation(NPC, 790.74, -25.17, 332.02, 2, 0)
  107. MovementLoopAddLocation(NPC, 791.44, -25.16, 332.77, 2, 15)
  108. MovementLoopAddLocation(NPC, 784.29, -24.99, 328.35, 2, 0)
  109. MovementLoopAddLocation(NPC, 766.69, -25.1, 334.76, 2, 0)
  110. MovementLoopAddLocation(NPC, 759.54, -24.97, 337.31, 2, 0)
  111. MovementLoopAddLocation(NPC, 752.35, -24.78, 337.77, 2, 0)
  112. MovementLoopAddLocation(NPC, 742.11, -24.63, 338.84, 2, 0)
  113. MovementLoopAddLocation(NPC, 740.19, -24.59, 339.85, 2, 15)
  114. MovementLoopAddLocation(NPC, 752.96, -24.79, 337.18, 2, 0)
  115. MovementLoopAddLocation(NPC, 757.86, -24.92, 337.34, 2, 0)
  116. end