MarshalSurefoot.lua 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. FaceTarget(NPC, Spawn)
  90. AddTimer(NPC,500,"Begin",1,Spawn)
  91. end
  92. end
  93. function Heading(NPC)
  94. SetHeading(NPC,166)
  95. end
  96. function Begin(NPC, Spawn)
  97. FaceTarget(NPC, Spawn)
  98. Dialog.New(NPC, Spawn)
  99. Dialog.AddDialog("Stand stout! You'd make a fine deputy. Unfortunately, we can't handle new recruits. Please move along, adventurer.")
  100. Dialog.AddVoiceover("voiceover/english/marshal_surefoot/qey_village06/marshalsurefoot000.mp3", 3898086374, 2053590783)
  101. PlayFlavor(NPC, "", "", "salute", 0, 0, Spawn)
  102. if GetLevel(Spawn) <= 4 then
  103. Dialog.AddOption("Perhaps I'll be better off getting more experience first.")
  104. end
  105. if CanReceiveQuest(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS) and GetLevel(Spawn) >= 5 then
  106. Dialog.AddOption("Do deputies get paid well?", "PaidWell")
  107. end
  108. if HasQuest(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS) and GetQuestStep(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS) == 2 then
  109. Dialog.AddOption("It was amazing! I defeated five forgotten guardians.", "KilledGuardians")
  110. end
  111. Dialog.AddOption("Sorry to hear that. I must be going.")
  112. Dialog.Start()
  113. end
  114. function PaidWell(NPC, Spawn)
  115. FaceTarget(NPC, Spawn)
  116. Dialog.New(NPC, Spawn)
  117. 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?")
  118. Dialog.AddVoiceover("voiceover/english/marshal_surefoot/qey_village06/marshalsurefoot001.mp3", 1754420815, 722332586)
  119. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  120. Dialog.AddOption("I can face the titans of the forest.", "CanFaceTitans")
  121. Dialog.AddOption("I am not facing any titans today.")
  122. Dialog.Start()
  123. end
  124. function CanFaceTitans(NPC, Spawn)
  125. FaceTarget(NPC, Spawn)
  126. Dialog.New(NPC, Spawn)
  127. 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!")
  128. Dialog.AddVoiceover("voiceover/english/marshal_surefoot/qey_village06/marshalsurefoot002.mp3", 2844840663, 963541700)
  129. Dialog.AddOption("I will face the titans. ", "OfferQuest1")
  130. Dialog.Start()
  131. end
  132. function OfferQuest1(NPC, Spawn)
  133. FaceTarget(NPC, Spawn)
  134. OfferQuest(NPC, Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS)
  135. end
  136. function KilledGuardians(NPC, Spawn)
  137. SetStepComplete(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS, 2)
  138. FaceTarget(NPC, Spawn)
  139. Dialog.New(NPC, Spawn)
  140. 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.")
  141. Dialog.AddVoiceover("voiceover/english/marshal_surefoot/qey_village06/marshalsurefoot003.mp3", 137631615, 420589820)
  142. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn)
  143. Dialog.AddOption("Farewell Marshal Surefoot.")
  144. Dialog.Start()
  145. end