MarshalSurefoot.lua 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. --[[
  2. Script Name : SpawnScripts/Baubbleshire/MarshalSurefoot.lua
  3. Script Purpose : Marshal Surefoot
  4. Script Author : John Adams
  5. Script Date : 2008.09.23
  6. Script Notes : Auto-Generated Conversation from PacketParser Data
  7. Script Update Notes: Included callout, waypoints, Action animations. 2022.08.01 Dorbin
  8. Script Update Notes: New Dialog Format 2022.18.08 Dorbin
  9. --]]
  10. require "SpawnScripts/Generic/DialogModule"
  11. -- Quest ID's
  12. local FIGHT_THE_FORGOTTEN_GUARDIANS = 334 -- was 59
  13. function spawn(NPC)
  14. ProvidesQuest(NPC, FIGHT_THE_FORGOTTEN_GUARDIANS)
  15. waypoints(NPC)
  16. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  17. Action(NPC)
  18. end
  19. function respawn(NPC)
  20. spawn(NPC)
  21. end
  22. function LeaveRange(NPC)
  23. end
  24. function Action(NPC)
  25. local choice = MakeRandomInt(1, 4)
  26. if choice == 1 then
  27. PlayFlavor(NPC, "", "", "peer", 0, 0, Spawn)
  28. elseif choice == 2 then
  29. PlayFlavor(NPC, "", "", "stretch", 0, 0, Spawn)
  30. elseif choice == 3 then
  31. PlayFlavor(NPC, "", "", "yawn", 0, 0, Spawn)
  32. elseif choice == 4 then
  33. PlayFlavor(NPC, "", "", "attention", 0, 0, Spawn)
  34. end
  35. end
  36. function InRange(NPC, Spawn)
  37. if GetFactionAmount(Spawn,11)>0 then
  38. if math.random(1, 100) <= 80 and not HasQuest(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS) and not HasCompletedQuest(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS) and GetLevel(Spawn) >= 5 then
  39. FaceTarget(NPC, Spawn)
  40. if not HasCompletedQuest(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS) then
  41. PlayFlavor(NPC, "voiceover/english/marshal_surefoot/qey_village06/100_marshal_shortfoot_callout_21d33319.mp3", "Forgotten guardians are no match for a Leatherfoot, Ha! Greetings adventurer. I can tell you're a fearless warrior!", "salute", 3286953341, 3627183103, Spawn)
  42. else
  43. PlayFlavor(NPC, "", "", "salute", 0, 0, Spawn)
  44. end
  45. end
  46. end
  47. end
  48. function waypoints(NPC)
  49. MovementLoopAddLocation(NPC, 879.49, -17.11, -511.61, 2, 1,"Heading")
  50. MovementLoopAddLocation(NPC, 879.49, -17.11, -511.61, 2, math.random(10, 15),"Action")
  51. MovementLoopAddLocation(NPC, 879.49, -17.11, -511.61, 2, 0)
  52. MovementLoopAddLocation(NPC, 878.04, -16.77, -515.6, 2, 0)
  53. MovementLoopAddLocation(NPC, 880.47, -16.46, -518.44, 2, 0)
  54. MovementLoopAddLocation(NPC, 885.54, -16.3, -516.52, 2, 0)
  55. MovementLoopAddLocation(NPC, 889.43, -16.6, -509.34, 2, 0)
  56. MovementLoopAddLocation(NPC, 892.83, -17.27, -500.62, 2, 0)
  57. MovementLoopAddLocation(NPC, 891.64, -17.67, -494.35, 2, 0)
  58. MovementLoopAddLocation(NPC, 888.19, -18.03, -488.68, 2, 0)
  59. MovementLoopAddLocation(NPC, 884.46, -18.41, -481.88, 2, 0)
  60. MovementLoopAddLocation(NPC, 882.67, -18.88, -477.27, 2, 0)
  61. MovementLoopAddLocation(NPC, 882.85, -19.17, -470.55, 2, 0)
  62. MovementLoopAddLocation(NPC, 885.66, -19.24, -467.3, 2, 0)
  63. MovementLoopAddLocation(NPC, 889.61, -19.18, -463.69, 2, 0)
  64. MovementLoopAddLocation(NPC, 892.35, -19.01, -459.51, 2, 0)
  65. MovementLoopAddLocation(NPC, 891.78, -18.75, -457.06, 2, 0)
  66. MovementLoopAddLocation(NPC, 888.81, -18.36, -454.83, 2, 1)
  67. MovementLoopAddLocation(NPC, 888.81, -18.36, -454.83, 2, math.random(10, 20),"Action")
  68. MovementLoopAddLocation(NPC, 886.47, -18.48, -453.4, 2, 0)
  69. MovementLoopAddLocation(NPC, 887.14, -18.74, -455.05, 2, 0)
  70. MovementLoopAddLocation(NPC, 891.28, -18.76, -457.08, 2, 0)
  71. MovementLoopAddLocation(NPC, 892.92, -19.01, -460.27, 2, 0)
  72. MovementLoopAddLocation(NPC, 889.95, -19.18, -463.44, 2, 0)
  73. MovementLoopAddLocation(NPC, 883.6, -19.25, -469.01, 2, 0)
  74. MovementLoopAddLocation(NPC, 882.26, -19, -475.72, 2, 0)
  75. MovementLoopAddLocation(NPC, 884.8, -18.4, -482.67, 2, 0)
  76. MovementLoopAddLocation(NPC, 890.52, -17.81, -492.32, 2, 0)
  77. MovementLoopAddLocation(NPC, 893.26, -17.43, -499.55, 2, 0)
  78. MovementLoopAddLocation(NPC, 890.16, -16.83, -506, 2, 0)
  79. MovementLoopAddLocation(NPC, 886.35, -16.56, -510.25, 2, 0)
  80. MovementLoopAddLocation(NPC, 884.02, -16.59, -512.14, 2, 0)
  81. MovementLoopAddLocation(NPC, 881.66, -16.94, -510.51, 2, 0)
  82. MovementLoopAddLocation(NPC, 879.27, -17.13, -511.52, 2, 0)
  83. end
  84. function hailed(NPC, Spawn)
  85. FaceTarget(NPC, Spawn)
  86. if GetFactionAmount(Spawn,11)<0 then
  87. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  88. else
  89. Begin(NPC, Spawn)
  90. end
  91. end
  92. function Heading(NPC)
  93. SetHeading(NPC,166)
  94. end
  95. function Begin(NPC, Spawn)
  96. FaceTarget(NPC, Spawn)
  97. Dialog.New(NPC, Spawn)
  98. Dialog.AddDialog("Stand stout! You'd make a fine deputy.")
  99. Dialog.AddVoiceover("voiceover/english/marshal_surefoot/qey_village06/marshalsurefoot000.mp3", 3898086374, 2053590783)
  100. PlayFlavor(NPC, "", "", "salute", 0, 0, Spawn)
  101. if GetLevel(Spawn) <= 4 then
  102. Dialog.AddOption("Perhaps I'll be better off getting more experience first.")
  103. end
  104. if not HasQuest(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS) and not HasCompletedQuest(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS) and GetLevel(Spawn) >= 5 then
  105. Dialog.AddOption("Do deputies get paid well?", "PaidWell")
  106. end
  107. if HasQuest(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS) and GetQuestStep(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS) == 2 then
  108. Dialog.AddOption("It was amazing! I defeated five forgotten guardians.", "KilledGuardians")
  109. end
  110. Dialog.AddOption("Sorry to hear that. I must be going.")
  111. Dialog.Start()
  112. end
  113. function PaidWell(NPC, Spawn)
  114. FaceTarget(NPC, Spawn)
  115. Dialog.New(NPC, Spawn)
  116. Dialog.AddDialog("Aha! A mercenary! I can use your mettle for testing the strengths of the enemy. Can you overcome the titans of the forest? What do ya say, soldier?")
  117. Dialog.AddVoiceover("voiceover/english/marshal_surefoot/qey_village06/marshalsurefoot001.mp3", 1754420815, 722332586)
  118. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  119. Dialog.AddOption("I can face the titans of the forest.", "CanFaceTitans")
  120. Dialog.AddOption("I am not facing any titans today.")
  121. Dialog.Start()
  122. end
  123. function CanFaceTitans(NPC, Spawn)
  124. FaceTarget(NPC, Spawn)
  125. Dialog.New(NPC, Spawn)
  126. Dialog.AddDialog("Then stand firm and venture to the Forest Ruins. The foes act as Forgotten Guardians. They prey upon the people ... stand tall, soldier! Crush a few and return with a tale of victory!")
  127. Dialog.AddVoiceover("voiceover/english/marshal_surefoot/qey_village06/marshalsurefoot002.mp3", 2844840663, 963541700)
  128. Dialog.AddOption("I will face the titans. ", "OfferQuest1")
  129. Dialog.Start()
  130. end
  131. function OfferQuest1(NPC, Spawn)
  132. FaceTarget(NPC, Spawn)
  133. OfferQuest(NPC, Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS)
  134. end
  135. function KilledGuardians(NPC, Spawn)
  136. SetStepComplete(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS, 2)
  137. FaceTarget(NPC, Spawn)
  138. Dialog.New(NPC, Spawn)
  139. Dialog.AddDialog("What bravery! You laughed in the face of death! You are a true protector of the forest realms. I shall seek you out when I recruit my force of Leatherfoot deputies. You are relieved for now.")
  140. Dialog.AddVoiceover("voiceover/english/marshal_surefoot/qey_village06/marshalsurefoot003.mp3", 137631615, 420589820)
  141. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn)
  142. Dialog.AddOption("Farewell Marshal Surefoot.")
  143. Dialog.Start()
  144. end