MarshalSurefoot.lua 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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 Updated: 2022.08.01 Dorbin
  8. Script Update Notes: Included callout, waypoints, Action animations.
  9. --]]
  10. -- Quest ID's
  11. local FIGHT_THE_FORGOTTEN_GUARDIANS = 334 -- was 59
  12. function spawn(NPC)
  13. ProvidesQuest(NPC, FIGHT_THE_FORGOTTEN_GUARDIANS)
  14. waypoints(NPC)
  15. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  16. Action(NPC)
  17. end
  18. function respawn(NPC)
  19. spawn(NPC)
  20. end
  21. function LeaveRange(NPC)
  22. end
  23. function Action(NPC)
  24. local choice = MakeRandomInt(1, 4)
  25. if choice == 1 then
  26. PlayFlavor(NPC, "", "", "peer", 0, 0, Spawn)
  27. elseif choice == 2 then
  28. PlayFlavor(NPC, "", "", "stretch", 0, 0, Spawn)
  29. elseif choice == 3 then
  30. PlayFlavor(NPC, "", "", "yawn", 0, 0, Spawn)
  31. elseif choice == 4 then
  32. PlayFlavor(NPC, "", "", "attention", 0, 0, Spawn)
  33. end
  34. end
  35. function InRange(NPC, Spawn)
  36. if math.random(1, 100) <= 70 then
  37. local randomCall = MakeRandomInt(1, 2)
  38. if randomCall == 1 then
  39. if not HasCompletedQuest(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS) then
  40. FaceTarget(NPC, Spawn)
  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. elseif randomCall == 2 then
  43. FaceTarget(NPC, Spawn)
  44. PlayFlavor(NPC, "", "", "salute", 0, 0, Spawn)
  45. end
  46. end
  47. end
  48. end
  49. function waypoints(NPC)
  50. MovementLoopAddLocation(NPC, 879.49, -17.11, -511.61, 2, math.random(1))
  51. MovementLoopAddLocation(NPC, 879.49, -17.11, -511.61, 2, math.random(10, 15),"Action")
  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, math.random(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. conversation = CreateConversation()
  87. PlayFlavor(NPC, "voiceover/english/marshal_surefoot/qey_village06/marshalsurefoot000.mp3", "", "salute", 3898086374, 2053590783, Spawn)
  88. Begin(NPC, Spawn, conversation)
  89. end
  90. function Begin(NPC, Spawn, conversation)
  91. if not HasQuest(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS) and not HasCompletedQuest(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS) and GetLevel(Spawn) >= 5 then
  92. AddConversationOption(conversation, "Do deputies get paid well?", "PaidWell")
  93. elseif HasQuest(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS) and GetQuestStep(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS) == 2 then
  94. AddConversationOption(conversation, "It was amazing! I defeated five forgotten guardians.", "KilledGuardians")
  95. end
  96. AddConversationOption(conversation, "Sorry to hear that. I must be going.")
  97. StartConversation(conversation, NPC, Spawn, "Stand stout! You'd make a fine deputy. Unfortunately, we can't handle new recruits. Please move along adventurer.")
  98. end
  99. function PaidWell(NPC, Spawn)
  100. FaceTarget(NPC, Spawn)
  101. conversation = CreateConversation()
  102. PlayFlavor(NPC, "voiceover/english/marshal_surefoot/qey_village06/marshalsurefoot001.mp3", "", "agree", 1754420815, 722332586, Spawn)
  103. AddConversationOption(conversation, "I can face the titans of the forest.", "CanFaceTitans")
  104. AddConversationOption(conversation, "I'm not facing any titans today.")
  105. StartConversation(conversation, NPC, Spawn, "Aha! A mercenary! I can use your mettle for testing the strengths of the enemy. Can you overcome the titants of the forest? What do ya say, soldier?")
  106. end
  107. function CanFaceTitans(NPC, Spawn)
  108. FaceTarget(NPC, Spawn)
  109. conversation = CreateConversation()
  110. PlayFlavor(NPC, "voiceover/english/marshal_surefoot/qey_village06/marshalsurefoot002.mp3", "", "", 2844840663, 963541700, Spawn)
  111. AddConversationOption(conversation, "I will face the titans.", "OfferQuest1")
  112. StartConversation(conversation, NPC, Spawn, "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!")
  113. end
  114. function OfferQuest1(NPC, Spawn)
  115. FaceTarget(NPC, Spawn)
  116. OfferQuest(NPC, Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS)
  117. end
  118. function KilledGuardians(NPC, Spawn)
  119. SetStepComplete(Spawn, FIGHT_THE_FORGOTTEN_GUARDIANS, 2)
  120. FaceTarget(NPC, Spawn)
  121. conversation = CreateConversation()
  122. PlayFlavor(NPC, "voiceover/english/marshal_surefoot/qey_village06/marshalsurefoot003.mp3", "", "salute", 137631615, 420589820, Spawn)
  123. AddConversationOption(conversation, "Farewell Marshal Surefoot.")
  124. StartConversation(conversation, NPC, Spawn, "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.")
  125. end