9
3

TheSarge.lua 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. --[[
  2. Script Name : SpawnScripts/FallenGate/TheSarge.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.09 08:07:41
  5. Script Purpose :
  6. :
  7. --]]
  8. local ChargeOfTheLeatherfootBrigade_Tippytoe = 5308
  9. local ChargeOfTheLeatherfootBrigade_Doopy = 5309
  10. local ChargeOfTheLeatherfootBrigade_Frambert = 5310
  11. local ChargeOfTheLeatherfootBrigade_TheSarge = 5311
  12. function spawn(NPC)
  13. SetPlayerProximityFunction(NPC, 10, "InRange")
  14. end
  15. function InRange(NPC, Spawn)
  16. if not HasQuest(Spawn, ChargeOfTheLeatherfootBrigade_Tippytoe) and not HasCompletedQuest(Spawn, ChargeOfTheLeatherfootBrigade_Tippytoe) then
  17. ProvidesQuest(NPC, ChargeOfTheLeatherfootBrigade_Tippytoe)
  18. SetInfoFlag(NPC)
  19. SetVisualFlag(NPC)
  20. elseif HasCompletedQuest(Spawn, ChargeOfTheLeatherfootBrigade_Tippytoe) then
  21. ProvidesQuest(NPC, ChargeOfTheLeatherfootBrigade_Doopy)
  22. SetInfoFlag(NPC)
  23. SetVisualFlag(NPC)
  24. elseif HasCompletedQuest(Spawn, ChargeOfTheLeatherfootBrigade_Doopy) then
  25. ProvidesQuest(NPC, ChargeOfTheLeatherfootBrigade_Frambert)
  26. SetInfoFlag(NPC)
  27. SetVisualFlag(NPC)
  28. elseif HasCompletedQuest(Spawn, ChargeOfTheLeatherfootBrigade_Doopy) then
  29. ProvidesQuest(NPC, ChargeOfTheLeatherfootBrigade_TheSarge)
  30. SetInfoFlag(NPC)
  31. SetVisualFlag(NPC)
  32. end
  33. end
  34. function hailed(NPC, Spawn)
  35. FaceTarget(NPC, Spawn)
  36. if not HasQuest(Spawn, ChargeOfTheLeatherfootBrigade_Tippytoe) and not HasCompletedQuest(Spawn, ChargeOfTheLeatherfootBrigade_Tippytoe) then
  37. local conversation = CreateConversation()
  38. PlayFlavor(NPC, "voiceover/english/the_sarge/fallengate/qst_the_sarge001.mp3", "", "", 3416054820, 2332283165, Spawn)
  39. AddConversationOption(conversation, "What on Norrath are you talking about, ghost?", "offer_quest1")
  40. AddConversationOption(conversation, "I've got better things to do than talk with some crazy old ghost.")
  41. StartConversation(conversation, NPC, Spawn, "Listen up, men! We gotta remember why we're here, got it!? This ain't a game of smack the brownie! And if I see any more of you cryin' for yer mommas, well ... I'll yell louder, understand! Lumpy Rumblebelly here's gonna do the scoutin'. Whassat? Ugh ... fine! Special Agent Tippytoes gonna do the scoutin' before we do the deed.")
  42. elseif GetQuestStep(Spawn, ChargeOfTheLeatherfootBrigade_Tippytoe) <= 3 or GetQuestStep(Spawn, ChargeOfTheLeatherfootBrigade_Doopy) <= 3 or GetQuestStep(Spawn, ChargeOfTheLeatherfootBrigade_Frambert) <= 2 or GetQuestStep(Spawn, ChargeOfTheLeatherfootBrigade_TheSarge) <= 2 then
  43. QuestProgress(NPC, Spawn)
  44. elseif GetQuestStep(Spawn, ChargeOfTheLeatherfootBrigade_Tippytoe) == 4 then
  45. Option1(NPC, Spawn)
  46. elseif HasCompletedQuest(Spawn, ChargeOfTheLeatherfootBrigade_Tippytoe) and not HasQuest(Spawn, ChargeOfTheLeatherfootBrigade_Doopy) then
  47. Option2(NPC, Spawn)
  48. elseif GetQuestStep(Spawn, ChargeOfTheLeatherfootBrigade_Doopy) == 4 then
  49. Option3(NPC, Spawn)
  50. elseif HasCompletedQuest(Spawn, ChargeOfTheLeatherfootBrigade_Tippytoe) and HasCompletedQuest(Spawn, ChargeOfTheLeatherfootBrigade_Doopy) and not HasQuest(Spawn, ChargeOfTheLeatherfootBrigade_Frambert) then
  51. Option4(NPC, Spawn)
  52. elseif GetQuestStep(Spawn, ChargeOfTheLeatherfootBrigade_Frambert) == 3 then
  53. Option5(NPC, Spawn)
  54. elseif HasCompletedQuest(Spawn, ChargeOfTheLeatherfootBrigade_Tippytoe) and HasCompletedQuest(Spawn, ChargeOfTheLeatherfootBrigade_Doopy) and HasCompletedQuest(Spawn, ChargeOfTheLeatherfootBrigade_Frambert) and not HasQuest(Spawn, ChargeOfTheLeatherfootBrigade_TheSarge) then
  55. Option6(NPC, Spawn)
  56. elseif GetQuestStep(Spawn, ChargeOfTheLeatherfootBrigade_TheSarge) == 3 then
  57. Option7(NPC, Spawn)
  58. elseif HasCompletedQuest(Spawn, ChargeOfTheLeatherfootBrigade_Tippytoe) and HasCompletedQuest(Spawn, ChargeOfTheLeatherfootBrigade_Doopy) and HasCompletedQuest(Spawn, ChargeOfTheLeatherfootBrigade_Frambert) and HasCompletedQuest(Spawn, ChargeOfTheLeatherfootBrigade_TheSarge) then
  59. QuestFinish(NPC, Spawn)
  60. end
  61. end
  62. function offer_quest1(NPC, Spawn)
  63. OfferQuest(NPC, Spawn, ChargeOfTheLeatherfootBrigade_Tippytoe)
  64. end
  65. function offer_quest2(NPC, Spawn)
  66. OfferQuest(NPC, Spawn, ChargeOfTheLeatherfootBrigade_Doopy)
  67. end
  68. function offer_quest3(NPC, Spawn)
  69. OfferQuest(NPC, Spawn, ChargeOfTheLeatherfootBrigade_Frambert)
  70. end
  71. function offer_quest4(NPC, Spawn)
  72. OfferQuest(NPC, Spawn, ChargeOfTheLeatherfootBrigade_TheSarge)
  73. end
  74. function Option1(NPC, Spawn)
  75. SetStepComplete(Spawn, ChargeOfTheLeatherfootBrigade_Tippytoe, 4)
  76. local conversation = CreateConversation()
  77. PlayFlavor(NPC, "voiceover/english/the_sarge/fallengate/qst_the_sarge003.mp3", "", "", 89231092, 838705811, Spawn)
  78. AddConversationOption(conversation, "I'm not Doopy! I'm Tippytoe, remember? Err... I'm " .. GetName(Spawn) .."!", "Option2")
  79. AddConversationOption(conversation, "I'm not taking any more orders from a ghost! Bye!")
  80. StartConversation(conversation, NPC, Spawn, "Where is that dagnabbin' Lump--Tippytoe? He should've been back hours ago. If his ma finds out we lost him... arrgh... he's better be all right! He's gotta! I guess we gotta move onto Plan B. Listen up, Private Doopy: You're goin' in next! Here! Take this scoutin' emblem so people know you're the new scout.")
  81. end
  82. function Option2(NPC, Spawn)
  83. local conversation = CreateConversation()
  84. PlayFlavor(NPC, "voiceover/english/the_sarge/fallengate/qst_the_sarge004.mp3", "", "", 2774218544, 2883461267, Spawn)
  85. AddConversationOption(conversation, "Will you just tell me what's going on here?", "offer_quest2")
  86. AddConversationOption(conversation, "I'm not taking any more orders from a ghost! Bye!")
  87. StartConversation(conversation, NPC, Spawn, "Listen up! We're onto Plan B, so start payin' attention! Doopy here ... ugh... are you sure none of you men want to do this? Anyone? Fine! Doopy here's gonna be the one to sneak us all into the Gate itself. Umm ... the person who does this gets to put the dohickey in place. .. still no one? Won't you do it for your Sarge? FINE! Then Doopy it is!")
  88. end
  89. function Option3(NPC, Spawn)
  90. SetStepComplete(Spawn, ChargeOfTheLeatherfootBrigade_Doopy, 4)
  91. local conversation = CreateConversation()
  92. PlayFlavor(NPC, "voiceover/english/the_sarge/fallengate/qst_the_sarge006.mp3", "", "", 1387772538, 1323696724, Spawn)
  93. AddConversationOption(conversation, "You don't even know I'm here, do you? I guess I'll listen to some more...", "Option4")
  94. AddConversationOption(conversation, "I'm not taking any more orders from a ghost! Bye!")
  95. StartConversation(conversation, NPC, Spawn, "I knew sending that kid in there was a mistake! How is it POSSIBLE to trip over your own ears?! Ugh ... He'll just have to guard the gizmo until we're ready. That's where you come in, Frambert... you gotta carry out Plan C, you do. Take these... you're gonna need them.")
  96. end
  97. function Option4(NPC, Spawn)
  98. local conversation = CreateConversation()
  99. PlayFlavor(NPC, "voiceover/english/the_sarge/fallengate/qst_the_sarge007.mp3", "", "", 859059056, 357496779, Spawn)
  100. AddConversationOption(conversation, "What the heck is jum-jum?", "offer_quest3")
  101. AddConversationOption(conversation, "I'm not taking any more orders from a ghost! Bye!")
  102. StartConversation(conversation, NPC, Spawn, "You're our last hope, Frambert. It's taken years of training and planning to get us Leatherfoots to this point. We're not gonna let those dark elves push us around anymore! Do it for Rivervale, kid! Do it for Felwithe, Kelethin, Kaladim, and even Ak'Anon if you have to! Aha! Do it for the Jum-Jum! Now that's more like it, Frambert!")
  103. end
  104. function Option5(NPC, Spawn)
  105. SetStepComplete(Spawn, ChargeOfTheLeatherfootBrigade_Frambert, 3)
  106. local conversation = CreateConversation()
  107. PlayFlavor(NPC, "voiceover/english/the_sarge/fallengate/qst_the_sarge009.mp3", "", "", 4134821718, 2521054154, Spawn)
  108. AddConversationOption(conversation, "But you're all dead! Dark Elves AND Halflings!! YOU ALL DIED, UNDERSTAND!?", "Option6")
  109. AddConversationOption(conversation, "I'm not taking any more orders from a ghost! Bye!")
  110. StartConversation(conversation, NPC, Spawn, "This is horrible! It's not supposed to happen like this! That stupid kid lit the fuse! He was supposed to guard the gizmo, and he done lit the dagnabbin fuse! We gotta get outta here before it does what it's supposed to do! But I ain't leavin' my men behind, you hear?! Lumpy is still out there... and we gotta get him! You're gonna need this, 'cause you're the only one who can save him!")
  111. end
  112. function Option6(NPC, Spawn)
  113. FaceTarget(NPC, Spawn)
  114. local conversation = CreateConversation()
  115. PlayFlavor(NPC, "voiceover/english/the_sarge/fallengate/qst_the_sarge010.mp3", "", "", 3239757026, 2103887381, Spawn)
  116. AddConversationOption(conversation, "This is the same Tippytoe who went scouting, right? Just making sure I got this straight.", "offer_quest4")
  117. AddConversationOption(conversation, "I'm not taking any more orders from a ghost! Bye!")
  118. StartConversation(conversation, NPC, Spawn, "That boy's momma will never forgive me if I come back home and tell her the dark elves got him! She's already lost two of her sons to those elves! Heck, they even took her father, her dog, and twelve bushels of jum-jum, too! You gotta save him before this place crumbles around our head! He's the only one who has the de-active-maker-codes!")
  119. end
  120. function Option7(NPC, Spawn)
  121. SetStepComplete(Spawn, ChargeOfTheLeatherfootBrigade_TheSarge, 3)
  122. FaceTarget(NPC, Spawn)
  123. local conversation = CreateConversation()
  124. PlayFlavor(NPC, "voiceover/english/the_sarge/fallengate/qst_the_sarge012.mp3", "", "", 3347501993, 118609776, Spawn)
  125. AddConversationOption(conversation, "Goodbye, Sarge. No matter what anyone says... you died a brave halfling.")
  126. StartConversation(conversation, NPC, Spawn, "Well, it's just you and me, doohickey. We were gonna make a difference, weren't we? Gonna help out those poor elves and dwarves... gonna come back as heroes. Well, now you and I are gonna run as far into this blasted city as we can, aren't we? And then you're gonna do your thing ... and we'll still make a difference, won't we? Let's do it! LEATHERFOOT FOREEEEEVEEEERRRRR!")
  127. end
  128. function QuestFinish(NPC, Spawn)
  129. PlayFlavor(NPC, "voiceover/english/the_sarge/fallengate/qst_the_sarge_donequest_ecc0e564.mp3", "... Leatherfoot.... foreeeeeveerrrrrrr....", "", 3256430416, 811737211, Spawn)
  130. end
  131. function QuestProgress(NPC, Spawn)
  132. if HasQuest(Spawn, ChargeOfTheLeatherfootBrigade_Tippytoe) then
  133. PlayFlavor(NPC, "voiceover/english/the_sarge/fallengate/qst_the_sarge_onquest1_2f41d3d9.mp3", "What're you still doing here, Lumpy? Get to yer scoutin', or I'll tell your ma you didn't follow orders!", "", 3168706528, 3554672655, Spawn)
  134. elseif HasQuest(Spawn, ChargeOfTheLeatherfootBrigade_Doopy) then
  135. PlayFlavor(NPC, "voiceover/english/the_sarge/fallengate/qst_the_sarge_onquest2_6ccc65de.mp3", "We don't have all day, Doopy! Them elves might find us any moment! Now follow yer orders!!", "", 3719340683, 7854538, Spawn)
  136. elseif HasQuest(Spawn, ChargeOfTheLeatherfootBrigade_Frambert) then
  137. PlayFlavor(NPC, "voiceover/english/the_sarge/fallengate/qst_the_sarge_onquest3_ac623281.mp3", "Ya gotta find those alarms, Frambert!", "", "", 2825059938, 2570883923, Spawn)
  138. elseif HasQuest(Spawn, ChargeOfTheLeatherfootBrigade_TheSarge) then
  139. PlayFlavor(NPC, "voiceover/english/the_sarge/fallengate/qst_the_sarge_onquest4_be1d04.mp3", "You gotta find him!", "", 1647681125, 1288455302, Spawn)
  140. end
  141. end
  142. function respawn(NPC)
  143. spawn(NPC)
  144. end