CommandantTychus.lua 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. --[[
  2. Script Name : SpawnScripts/NorthFreeport/CommandantTychus.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.10.03 04:10:40
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local Quest1 = 5898
  10. local Crusader = 5900
  11. local Brawler = 5899
  12. local Warrior = 5901
  13. function spawn(NPC)
  14. ProvidesQuest(NPC, Quest1)
  15. ProvidesQuest(NPC, Crusader)
  16. ProvidesQuest(NPC, Brawler)
  17. ProvidesQuest(NPC, Warrior)
  18. end
  19. function hailed(NPC, Spawn)
  20. local int = MakeRandomInt(1,3)
  21. FaceTarget(NPC, Spawn)
  22. Dialog.New(NPC, Spawn)
  23. Dialog.AddDialog("You dare address me in a casual manner, worm! Who do you think you are, you pathetic excuse for a dung beetle's lunch? From now on you will refer to me as \"sir,\" understand?")
  24. Dialog.AddVoiceover("voiceover/english/voice_emotes/greetings/greetings_"..int.."_1043.mp3", 0, 0)
  25. if GetClass(Spawn)== 1 and GetLevel(Spawn)>=7 and not HasQuest(Spawn,Quest1) and not HasCompletedQuest(Spawn,Quest1) then
  26. Dialog.AddOption("Sir, I want to increase my fighting skills, sir!","Dialog1")
  27. end
  28. if HasQuest(Spawn,Quest1) and GetQuestStep(Spawn,Quest1)==2 then
  29. Dialog.AddOption("Sir, the Guttersnipe Crooks are dead, sir!","Dialog2")
  30. end
  31. if HasQuest(Spawn,Quest1) and GetQuestStep(Spawn,Quest1)==6 then
  32. Dialog.AddOption("Sir, the tavern owners have a new appreciation of the law, sir.","Dialog3")
  33. end
  34. if HasQuest(Spawn,Quest1) and GetQuestStep(Spawn,Quest1)==10 then
  35. Dialog.AddOption(" I've convinced the people in the districts to no longer associate with the Guttersnipes.","Dialog4")
  36. end
  37. if HasCompletedQuest(Spawn,Quest1) and not HasQuest(Spawn,Crusader) and not HasQuest(Spawn,Brawler) and not HasQuest(Spawn,Warrior) and GetClass(Spawn)==1 and GetLevel(Spawn) >=9 then
  38. Dialog.AddOption("I've proven myself. I'm ready for my final task.","Dialog4")
  39. end
  40. Dialog.AddOption("I was just leaving... Sir!")
  41. if not HasQuest(Spawn,Quest1) and not HasCompletedQuest(Spawn, Quest1) then
  42. Dialog.AddOption("No one is telling ME what to do, fool!","Uhoh1")
  43. end
  44. Dialog.Start()
  45. end
  46. function Uhoh1(NPC,Spawn)
  47. FaceTarget(NPC, Spawn)
  48. Dialog.New(NPC, Spawn)
  49. Dialog.AddDialog("...")
  50. PlayFlavor(NPC, "", "", "stare", 0, 0, Spawn)
  51. Dialog.AddOption("Your puny head probably can't understand what I'm saying anyway!","Uhoh2")
  52. Dialog.AddOption("...I'm sorry. I don't know what came over me, Sir.")
  53. Dialog.Start()
  54. end
  55. function Uhoh2 (NPC,Spawn)
  56. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  57. SendPopUpMessage(Spawn,"Commandant Tychus eyes the guards and nods in your direction.",200,200,200)
  58. SendMessage(Spawn,"Commandant Tychus eyes the guards and nods in your direction.","white")
  59. AddTimer(NPC,2000,"Uhoh3",1,Spawn)
  60. local zone = GetZone(NPC)
  61. local Guard1 = GetSpawnByLocationID(zone,391337)
  62. local Guard2 = GetSpawnByLocationID(zone,391545)
  63. if Guard1 == nil then
  64. SpawnByLocationID(zone,391337)
  65. end
  66. if Guard2 == nil then
  67. SpawnByLocationID(zone,391545)
  68. end
  69. end
  70. function Uhoh3 (NPC,Spawn)
  71. local zone = GetZone(NPC)
  72. local Guard1 = GetSpawnByLocationID(zone,391337)
  73. local Guard2 = GetSpawnByLocationID(zone,391545)
  74. if Guard1 ~= nil then
  75. Attack(Guard1,Spawn)
  76. end
  77. if Guard2 ~= nil then
  78. Attack(Guard2,Spawn)
  79. end
  80. end
  81. function respawn(NPC)
  82. spawn(NPC)
  83. end
  84. function Dialog1(NPC,Spawn)
  85. FaceTarget(NPC, Spawn)
  86. Dialog.New(NPC, Spawn)
  87. Dialog.AddDialog("Just looking at you I can tell you don't know the first thing about fighting. Look at those pitiful arms, those knobby knees, and that stupid look on your face. You're a complete waste of time. Get out of my face!")
  88. PlayFlavor(NPC, "", "", "no", 0, 0, Spawn)
  89. Dialog.AddOption("Sir, I didn't ask for your opinion, sir. I was telling you I wanted training. Sir!","Quest1Offer")
  90. Dialog.AddOption("I suppose I meant something else. Good luck on those bounties.")
  91. Dialog.Start()
  92. end
  93. function Dialog1b(NPC,Spawn)
  94. FaceTarget(NPC, Spawn)
  95. Dialog.New(NPC, Spawn)
  96. Dialog.AddDialog("You'll find trash called the Dervishes living there. Find the ones called the Crooks, and slaughter a few of them. If you make it back alive, I might continue your training...")
  97. Dialog.AddOption("Yes sir!")
  98. Dialog.Start()
  99. end
  100. function Quest1Offer(NPC,Spawn)
  101. FaceTarget(NPC, Spawn)
  102. OfferQuest(NPC,Spawn,Quest1)
  103. end
  104. function Dialog2(NPC,Spawn)
  105. FaceTarget(NPC, Spawn)
  106. Dialog.New(NPC, Spawn)
  107. Dialog.AddDialog("Oh, really. I'm surprised you didn't run back to your momma the moment you saw the Guttersnipes. But you do look a bit scratched up, so maybe you did kill them. Okay, I'll continue your training. Those Guttersnipes are not only robbing the people, but more importantly, they're violating the laws of Freeport by visiting our fine city's taverns.")
  108. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  109. Dialog.AddOption("It is only a scratch, sir!","Dialog2a")
  110. Dialog.Start()
  111. end
  112. function Dialog2a(NPC,Spawn)
  113. FaceTarget(NPC, Spawn)
  114. Dialog.New(NPC, Spawn)
  115. Dialog.AddDialog("Well, you're still alive, so I guess my training helped. You taught those Guttersnipe crooks a lesson, but now those goons are getting sympathy from the trash living in the districts. If you want to continue your training, you must sharpen your words as you sharpen your sword.")
  116. Dialog.AddOption("Understood, sir! Who should I speak with, sir?","Dialog2b")
  117. Dialog.Start()
  118. end
  119. function Dialog2b(NPC,Spawn)
  120. FaceTarget(NPC, Spawn)
  121. Dialog.New(NPC, Spawn)
  122. SetStepComplete(Spawn,Quest1,2)
  123. Dialog.AddDialog("That won't stop them from breaking the law, fool! I want you to take care of the problem the way a brawler would. Go visit the tavern owners of the Seafarer's Roost, the Back Alley Brewhouse, and the Jade Tiger. Beat them up and let them know that the Overlord can give as much as he can take.")
  124. PlayFlavor(NPC, "", "", "threaten", 0, 0, Spawn)
  125. Dialog.AddOption("Sir, yes, sir!")
  126. Dialog.Start()
  127. end
  128. function Dialog3(NPC,Spawn)
  129. FaceTarget(NPC, Spawn)
  130. Dialog.New(NPC, Spawn)
  131. Dialog.AddDialog("So it WAS you who instigated these guard reports. You may be puny... but let's see how you handle being a more calculated in your fury.")
  132. PlayFlavor(NPC, "", "", "ponder", 0, 0, Spawn)
  133. Dialog.AddOption("What must I do, sir?","Dialog3a")
  134. Dialog.Start()
  135. end
  136. function Dialog3a(NPC,Spawn)
  137. FaceTarget(NPC, Spawn)
  138. Dialog.New(NPC, Spawn)
  139. Dialog.AddDialog("Though all warriors fight for a cause, none have as strong a conviction as a crusader. Crusaders live to fight another day ... and another ... and another... They never stop, for they know their next opponent waits to take everything they've earned.")
  140. Dialog.AddOption("I can do that, sir!","Dialog3b")
  141. Dialog.Start()
  142. end
  143. --
  144. function Dialog3b(NPC,Spawn)
  145. FaceTarget(NPC, Spawn)
  146. Dialog.New(NPC, Spawn)
  147. Dialog.AddDialog("We'll see about that, whelp. In the districts, a few people have gained respect from the rest of the rubbish living there. I want you to tell these people that if they allow Guttersnipes into the slums the Lucanic Knights will be on them faster than they can blink. Show them a velvet glove, but make them fear your concealed steel gauntlet. Understand?")
  148. PlayFlavor(NPC, "", "", "stare", 0, 0, Spawn)
  149. Dialog.AddOption("Understood, sir! Who needs handling, sir?","Dialog3c")
  150. Dialog.Start()
  151. end
  152. function Dialog3c(NPC,Spawn)
  153. FaceTarget(NPC, Spawn)
  154. Dialog.New(NPC, Spawn)
  155. SetStepComplete(Spawn,Quest1,6)
  156. Dialog.AddDialog("Let's see ... A human in Beggar's Court leads a gang of three hoodlums, speak with him. In Scale Yard, find the iksar who starves his servants and straighten him out. Finally, talk to the dark elf who runs the impromptu tavern in Longshadow Alley; she can spread the message from there.")
  157. Dialog.AddOption("It will be done, sir!")
  158. Dialog.Start()
  159. end
  160. function Dialog4(NPC,Spawn)
  161. FaceTarget(NPC, Spawn)
  162. Dialog.New(NPC, Spawn)
  163. Dialog.AddDialog("You didn't refer to me as sir, soldier. Next time, show some respect! Hmmm ... By the solid look in your eyes, I'd say it worked. Now the Guttersnipes won't find it as easy to -- quit looking at me like that, maggot! As I was saying, you learned the skills of a warrior, brawler, and a crusader. Now it's time to test your knowledge.")
  164. PlayFlavor(NPC, "", "", "stare", 0, 0, Spawn)
  165. if GetLevel(Spawn) >=9 then
  166. Dialog.AddOption("I'm glad to have had the chance to prove myself, Sir.","Decide")
  167. else
  168. Dialog.AddOption("I hate to admit it, but I need a rest after that. I'll return once I'm ready, sir.")
  169. end
  170. Dialog.Start()
  171. if HasQuest(Spawn,Quest1) and GetQuestStep(Spawn,Quest1) ==10 then
  172. SetStepComplete(Spawn,Quest1,10)
  173. end
  174. end
  175. --CLASS SELECTION
  176. function Decide(NPC,Spawn)
  177. if HasQuest(Spawn,Quest1) and GetQuestStep(Spawn,Quest1) ==10 then
  178. SetStepComplete(Spawn,Quest1,10)
  179. end
  180. FaceTarget(NPC, Spawn)
  181. Dialog.New(NPC, Spawn)
  182. Dialog.AddDialog("I mean, what do you want to do with your life? Eventually you must choose a path, and now is as good a time as any. I taught you three different fighting skills, so make up your mind -- what type of fighter do you want to be?")
  183. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  184. Dialog.AddOption("I like the intense fury of battle. I want to be a warrior.","Warrior1")
  185. Dialog.AddOption("I like relying on my fists in battle. I want to be a brawler.","Brawler1")
  186. Dialog.AddOption("I like having a commanding presence in battle. I want to be a crusader.","Crusader1")
  187. Dialog.Start()
  188. end
  189. --WARRIOR
  190. function Warrior1(NPC,Spawn)
  191. FaceTarget(NPC, Spawn)
  192. Dialog.New(NPC, Spawn)
  193. Dialog.AddDialog("A warrior, are ya? You're sayin' that the best way to fix a problem is with a bit of hammered steel? Aye, I agree with that! When you got a slaverin' gnoll runnin' at you, hard bent for leather, well, you'd be a ninny not to draw steel. So, the life of the warrior is your path in life, is it?")
  194. PlayFlavor(NPC, "", "", "happy", 0, 0, Spawn)
  195. Dialog.AddOption("Yes. I prefer to take care of a problem, rather than let it take care of me. I am a warrior!","WarriorOffer")
  196. Dialog.AddOption("On second thought, what were my options again?","Decide")
  197. Dialog.Start()
  198. end
  199. function WarriorOffer(NPC,Spawn)
  200. FaceTarget(NPC, Spawn)
  201. OfferQuest(NPC,Spawn,Warrior)
  202. end
  203. --BRAWLER
  204. function Brawler1(NPC,Spawn)
  205. FaceTarget(NPC, Spawn)
  206. Dialog.New(NPC, Spawn)
  207. Dialog.AddDialog("Brawlers use their brains, they do. They don't need armor if their enemies can't hit 'em. They also know they can't be disarmed if they have built-in weapons. Well, they can, but that' messy business that we don't need to discuss. So, are ya willin' to push yourself to the limit as a brawler?")
  208. PlayFlavor(NPC, "", "", "no", 0, 0, Spawn)
  209. Dialog.AddOption("Yes. I will train everyday to master the art of pugilism. I am a brawler.","BrawlerOffer")
  210. Dialog.AddOption("On second thought, what were my options again?","Decide")
  211. Dialog.Start()
  212. end
  213. function BrawlerOffer(NPC,Spawn)
  214. FaceTarget(NPC, Spawn)
  215. OfferQuest(NPC,Spawn,Brawler)
  216. end
  217. --CRUSADER
  218. function Crusader1(NPC,Spawn)
  219. FaceTarget(NPC, Spawn)
  220. Dialog.New(NPC, Spawn)
  221. Dialog.AddDialog("It's not as easy as that, youngin'. You don't just declare yourself a crusader, or did you learn nothing from my previous lessons? No, crusader is a title earned by those with enough heart to consider the fair city of Qeynos and its inhabitants first and themselves a distant second.")
  222. PlayFlavor(NPC, "", "", "no", 0, 0, Spawn)
  223. Dialog.AddOption("I like having a commanding presence in battle. I want to be a crusader.","CrusaderOffer")
  224. Dialog.AddOption("On second thought, what were my options again?","Decide")
  225. Dialog.Start()
  226. end
  227. function CrusaderOffer(NPC,Spawn)
  228. FaceTarget(NPC, Spawn)
  229. OfferQuest(NPC,Spawn,Crusader)
  230. end
  231. --[[
  232. Brawlers use their brains, they do. They don't need armor if their enemies can't hit 'em. They also know they can't be disarmed if they have built-in weapons. Well, they can, but that' messy business that we don't need to discuss. So, are ya willin' to push yourself to the limit as a brawler?
  233. Warriors run to the front line in battle and care only about slaughtering the enemy and oiling their weapons with their foe's blood. Warriors know might makes right. Do you choose this path?
  234. None matches the conviction of a crusader. Crusaders fight for a cause. This cause gives them the strength to crush their opponents beneath their feet. The last thing that people see when they fight a crusader is a cold, dead look -- their own reflection in the crusader's eyes. Do you choose this path?
  235. ]]--
  236. --[FINAL SELECTION]
  237. --You have to make a choice! You got potential, you do, and it would be a sore shame to see you waste it! But you can't be a fighter your entire life. You gotta focus on one of the styles I showed you, if you wanna go places. So what will it be, eh?
  238. --Brawlers use their brains, they do. They don't need armor if their enemies can't hit 'em. They also know they can't be disarmed if they have built-in weapons. Well, they can, but that' messy business that we don't need to discuss. So, are ya willin' to push yourself to the limit as a brawler?
  239. --Brawlers don't waste their time strapping on bulky armor. Sometimes the only weapons they use are their fists, and they dodge their opponent's blows with the swiftness of a hawk. Do you choose this path?
  240. --If you're a true brawler, you need to undergo a challenge. In order to join the ranks of the brawlers here in Qeynos, you gotta prove your skills. Enter the dojo and go fist to fist against another brawler. If you manage to defeat 'em, you'll become that which you seek.
  241. --Thank you, Dagorel. I won't forget your lessons.
  242. --Aye, aye. The watchmen informed me. They say you held your own. That's what I want to hear! You had to prove your fightin' skills--I don't want anyone accusing ol' Dagorel of sending ill-equipped kids off to their deaths. You proved you got what it takes, kid. Good work.
  243. --Yes. I will train everyday to master the art of pugilism. I am a brawler.
  244. --I like relying on my fists in battle. I want to be a brawler.
  245. --
  246. --Understand one more thing as well ... when you defeat your last opponent, meditate at the altar in the dojo. A brawler is not only strong of body but also of mind. Strengthening both is mandatory. Once you do this, you'll have proven yourself.
  247. --BRAWLER ALTAR A cool breeze swirls around you, sending a tingle up the back of your spine. You arise from the altar and know in your soul that you are a brawler.
  248. --CRUSADER START It's not as easy as that, youngin'. You don't just declare yourself a crusader, or did you learn nothing from my previous lessons? No, crusader is a title earned by those with enough heart to consider the fair city of Qeynos and its inhabitants first and themselves a distant second.
  249. --
  250. --A warrior, are ya? You're sayin' that the best way to fix a problem is with a bit of hammered steel? Aye, I agree with that! When you got a slaverin' gnoll runnin' at you, hard bent for leather, well, you'd be a ninny not to draw steel. So, the life of the warrior is your path in life, is it?
  251. --I like having a commanding presence in battle. I want to be a crusader.
  252. --
  253. --Though all warriors fight for a cause, none have as strong a conviction as a crusader. Crusaders live to fight another day ... and another ... and another... They never stop, for they know their next opponent waits to take everything they've earned.
  254. --It's not as easy as that, youngin'. You don't just declare yourself a crusader, or did you learn nothing from my previous lessons? No, crusader is a title earned by those with enough heart to consider the fair city of Qeynos and its inhabitants first and themselves a distant second.
  255. --Yes. I prefer to take care of a problem, rather than let it take care of me. I am a warrior!
  256. --Whoa, now! Not yet, you're not! You have to prove you can last in the fray. You didn't think I'd wave a magic wand and make you a warrior, did you? No, no, we got a make shift arena set up in the warehouse, where you'll prove yourself, a true warrior of Qeynos. No need to return to me, I've taught you all I can.