BraksanSteelforge.lua 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. --[[
  2. Script Name : SpawnScripts/IsleRefuge1/BraksanSteelforge.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.09.04 02:09:38
  5. Script Purpose :
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/ClassSkillCheck.lua")
  9. require "SpawnScripts/Generic/DialogModule"
  10. local Fighter2 = 5731
  11. local Fighter3 = 5735
  12. local Fighter4 = 5739
  13. local Fighter5 = 5743
  14. local Fighter6 = 5751
  15. function spawn(NPC)
  16. SetPlayerProximityFunction(NPC, 14, "InRange", "LeaveRange")
  17. ProvidesQuest(NPC, Fighter3)
  18. ProvidesQuest(NPC, Fighter4)
  19. ProvidesQuest(NPC, Fighter5)
  20. ProvidesQuest(NPC, Fighter6)
  21. SetInfoStructString(NPC, "action_state", "metalworking_idle")
  22. end
  23. function InRange(NPC,Spawn)
  24. if GetClass(Spawn)== 0 then
  25. FaceTarget(NPC, Spawn)
  26. PlayFlavor(NPC,"","You there! You look like a fighter, but I can't be helping someone who isn't properly registered with Garven. Go back to the beach, find him, and register at once.","no",0,0, Spawn)
  27. else
  28. if HasQuest(Spawn,Fighter2)then
  29. FaceTarget(NPC, Spawn)
  30. PlayFlavor(NPC,"voiceover/english/braksan_steelforge/tutorial_island02_fvo_fighterintro.mp3","You there! You look like someone who can destroy those little green monsters. I need your help.","hello",3168609453,3358176897, Spawn)
  31. elseif not HasQuest(Spawn, Fighter4) and HasCompletedQuest(Spawn,Fighter3) and not HasCompletedQuest(Spawn,Fighter4) then
  32. FaceTarget(NPC, Spawn)
  33. PlayFlavor(NPC,"voiceover/english/braksan_steelforge/tutorial_island02_fvo_fighterq2.mp3","Ahh, there you are! I can use your help.","beckon",2456679786,1937248917, Spawn)
  34. elseif not HasQuest(Spawn, Fighter6) and HasCompletedQuest(Spawn,Fighter5) and not HasCompletedQuest(Spawn,Fighter6) then
  35. FaceTarget(NPC, Spawn)
  36. PlayFlavor(NPC,"","Nice to see you're still alive and well!","hello",0,0, Spawn)
  37. end
  38. end
  39. end
  40. function hailed(NPC, Spawn)
  41. if HasQuest(Spawn, Fighter2) or not HasQuest(Spawn, Fighter3) and not HasCompletedQuest(Spawn, Fighter3) and HasCompletedQuest(Spawn,Fighter2) then
  42. Dialog2(NPC,Spawn)
  43. else
  44. FaceTarget(NPC, Spawn)
  45. Dialog.New(NPC, Spawn)
  46. Dialog.AddDialog("I wish I could chit-chat but I must work. The goblins don't care how many times I fix these things, they just keep breaking them.")
  47. Dialog.AddVoiceover("voiceover/english/braksan_steelforge/tutorial_island02/braksansteelforge001.mp3", 3328433629, 3720216759)
  48. if GetQuestStep(Spawn,Fighter3)==2 then
  49. Dialog.AddOption("There are four less goblins to worry about.","Quest3Turnin")
  50. end
  51. if not HasQuest(Spawn, Fighter4) and HasCompletedQuest(Spawn,Fighter3) and not HasCompletedQuest(Spawn,Fighter4) then
  52. Dialog.AddOption("I am interested in helping out. Do you have any work for me?","Quest4Start")
  53. end
  54. if not HasQuest(Spawn, Fighter5) and HasCompletedQuest(Spawn,Fighter4) and not HasCompletedQuest(Spawn,Fighter5) then
  55. Dialog.AddOption("What other work did you want to talk about?","Quest5Start")
  56. end
  57. if not HasQuest(Spawn, Fighter6) and HasCompletedQuest(Spawn,Fighter5) and not HasCompletedQuest(Spawn,Fighter6) then
  58. Dialog.AddOption("I am interested in helping out. Do you have any work for me?","Quest6Start")
  59. end
  60. if GetQuestStep(Spawn,Fighter4)==2 then
  61. Dialog.AddOption("I killed five of the goblin aggressors.","Quest4Turnin")
  62. end
  63. if GetQuestStep(Spawn,Fighter5)==2 then
  64. Dialog.AddOption("I have four flint head spears for you.","Quest5Turnin")
  65. end
  66. if GetQuestStep(Spawn,Fighter6)==3 then
  67. Dialog.AddOption("Grimgash won't be organizing any more goblin raids.","Quest6Turnin")
  68. end
  69. if HasCompletedQuest(Spawn,Fighter6) then
  70. Dialog.AddOption("Greetings Braksan. I hope your work has slowed down some.","Thanks")
  71. end
  72. Dialog.AddOption("I will leave you to your work.")
  73. if GetClass(Spawn)==1 then
  74. Dialog.AddOption("Can you make sure my skills are in order?","Skills")
  75. end Dialog.Start()
  76. end
  77. end
  78. function Skills(NPC,Spawn)
  79. SkillCheck(NPC,Spawn)
  80. PlayFlavor(NPC,"","","nod",0,0,Spawn)
  81. end
  82. function Thanks(NPC,Spawn)
  83. FaceTarget(NPC, Spawn)
  84. PlayFlavor(NPC,"","Nice to see you're still alive and well!","hello",0,0, Spawn)
  85. end
  86. function respawn(NPC)
  87. spawn(NPC)
  88. end
  89. --------------------------------------------------------------------------------------------------------------------------------
  90. -- QUEST 3
  91. --------------------------------------------------------------------------------------------------------------------------------
  92. function Dialog2(NPC,Spawn)
  93. FaceTarget(NPC, Spawn)
  94. Dialog.New(NPC, Spawn)
  95. Dialog.AddDialog("I heard you smacked around a few goblins at the gate. Good work! Those nasty critters need a whooping to knock some sense into their thick skulls. If you are lookin for work, I could use some help. Are you interested?")
  96. Dialog.AddVoiceover("voiceover/english/braksan_steelforge/tutorial_island02/braksansteelforge002.mp3", 1509886457, 290634781)
  97. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn)
  98. Dialog.AddOption("I am interested. What is it?","Interested")
  99. Dialog.AddOption("Not right now.")
  100. Dialog.Start()
  101. if HasQuest(Spawn, Fighter2) then
  102. SetStepComplete(Spawn,Fighter2,1)
  103. end
  104. end
  105. function Interested(NPC,Spawn)
  106. FaceTarget(NPC, Spawn)
  107. Dialog.New(NPC, Spawn)
  108. Dialog.AddDialog("The duke has charged me with rounding up a few brave warriors and you fit the bill. Goblins are staging attacks from a forward supply camp in the west. We've charged a few finger wagglin' mages to destroy the supplies, but in their fancy robes they're not much use. We need help with the supply runners guarding the camp. Would you help us, adventurer?")
  109. Dialog.AddVoiceover("voiceover/english/braksan_steelforge/tutorial_island02/braksansteelforge003.mp3", 3096036841, 3817796616)
  110. Dialog.AddOption("It'd be my pleasure to bust a few more goblin skulls.","Quest3Start")
  111. Dialog.Start()
  112. end
  113. function Quest3Start(NPC,Spawn)
  114. OfferQuest(NPC,Spawn,Fighter3)
  115. FaceTarget(NPC, Spawn)
  116. end
  117. function Quest3Turnin(NPC,Spawn)
  118. FaceTarget(NPC, Spawn)
  119. Dialog.New(NPC, Spawn)
  120. Dialog.AddDialog("Nice job! I knew you'd do well. As payment I placed a fine pair of boots in your bank. Talk to Banker Vertbridge and he'll get the boots for you.")
  121. Dialog.AddVoiceover("voiceover/english/braksan_steelforge/tutorial_island02/braksansteelforge005.mp3", 856327109, 3223978873)
  122. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  123. Dialog.AddOption("I will go check the bank.")
  124. Dialog.Start()
  125. if not HasItem(Spawn,152754) then
  126. SummonItem (Spawn, 152754, 1, "bank", 1)
  127. end
  128. SetStepComplete(Spawn,Fighter3,2)
  129. end
  130. --------------------------------------------------------------------------------------------------------------------------------
  131. -- QUEST 4
  132. --------------------------------------------------------------------------------------------------------------------------------
  133. function Quest4Start(NPC,Spawn)
  134. FaceTarget(NPC, Spawn)
  135. Dialog.New(NPC, Spawn)
  136. Dialog.AddDialog("I must organize a search party for some refugees who wandered into the wilderness. Unfortunately, because our guards are watching over the barricades, I've been unable to organize a party. I'm afraid those goblin buggers are holding the refugees in an alcove west of here. Will you be willing to crack a few goblin skulls for us?")
  137. Dialog.AddVoiceover("voiceover/english/braksan_steelforge/tutorial_island02/braksansteelforge006.mp3", 2676048621, 3798941591)
  138. PlayFlavor(NPC, "", "", "tapfoot", 0, 0, Spawn)
  139. Dialog.AddOption("I can handle a few goblins.","Quest4Offer")
  140. Dialog.AddOption("No, thanks. I'm busy.")
  141. Dialog.Start()
  142. end
  143. function Quest4Offer(NPC,Player)
  144. OfferQuest(NPC,Player,Fighter4)
  145. FaceTarget(NPC, Spawn)
  146. end
  147. function Quest4Turnin(NPC,Spawn)
  148. FaceTarget(NPC, Spawn)
  149. Dialog.New(NPC, Spawn)
  150. Dialog.AddDialog("Excellent work adventurer! The refugees are safe. Hopefully now they will know better than to wander off into the woods. As promised here is your reward. These leggings will protect you, and trust me, you'll need them. I have another job for you. The scouts discovered more useful information. Curious to know what they found?")
  151. Dialog.AddVoiceover("voiceover/english/braksan_steelforge/tutorial_island02/braksansteelforge008.mp3", 2823482933, 2765578198)
  152. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn)
  153. Dialog.AddOption("Perhaps, what is it?","Quest5Start")
  154. Dialog.AddOption("Not right now. Let me deal with other things first.")
  155. Dialog.Start()
  156. SetStepComplete(Spawn,Fighter4,2)
  157. end
  158. --------------------------------------------------------------------------------------------------------------------------------
  159. -- QUEST 5
  160. --------------------------------------------------------------------------------------------------------------------------------
  161. function Quest5Start(NPC,Spawn)
  162. FaceTarget(NPC, Spawn)
  163. Dialog.New(NPC, Spawn)
  164. Dialog.AddDialog("I knew you'd help! It's time for those green beasties to get what's coming to them! Our scouts located the goblins' main encampment in the northwest! Other adventurers are setting out to give those goblins a good arse kicking! They'll need your help. No one serves up a whoopin' like a fighter. Am I right?")
  165. Dialog.AddVoiceover("voiceover/english/braksan_steelforge/tutorial_island02/braksansteelforge009.mp3", 3901042740, 207303651)
  166. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  167. Dialog.AddOption("Of course you are!","Quest5Offer")
  168. Dialog.AddOption("Actually, I have some other buisness to attend to.")
  169. Dialog.Start()
  170. end
  171. function Quest5Offer(NPC,Player)
  172. OfferQuest(NPC,Player,Fighter5)
  173. FaceTarget(NPC, Spawn)
  174. end
  175. function Quest5Turnin(NPC,Spawn)
  176. FaceTarget(NPC, Spawn)
  177. Dialog.New(NPC, Spawn)
  178. Dialog.AddDialog("Ah, yes. The spears will do just fine. Thank you for your hard work, friend. I knew you were a brave fighter. Please accept this hand-made tunic for your hard work in the outpost. Now I hate to ask you, knowing how much fighting you have already done, but I thought you might be curious about what's causing the goblin attacks.")
  179. Dialog.AddVoiceover("voiceover/english/braksan_steelforge/tutorial_island02/braksansteelforge011.mp3", 2911283846, 1300227614)
  180. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn)
  181. Dialog.AddOption("I am interested in helping out. Do you have any work for me?","Quest6Start")
  182. Dialog.AddOption("No, I want to get off this island.")
  183. Dialog.Start()
  184. SetStepComplete(Spawn,Fighter5,2)
  185. end
  186. --------------------------------------------------------------------------------------------------------------------------------
  187. -- QUEST 6
  188. --------------------------------------------------------------------------------------------------------------------------------
  189. function Quest6Start(NPC,Spawn)
  190. FaceTarget(NPC, Spawn)
  191. Dialog.New(NPC, Spawn)
  192. Dialog.AddDialog("An orc was spotted in the northeast part of the island. Rumor is that it's the infamous Grimgash the Black, a fearsome orc pirate. If this is true, it explains why the goblins are attacking our outpost. Grimgash may have taken control of the local goblin tribe and turned them into his private army.")
  193. Dialog.AddVoiceover("voiceover/english/braksan_steelforge/tutorial_island02/braksansteelforge012.mp3", 1342121038, 4256806125)
  194. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  195. Dialog.AddOption("Okay, I'll take care of that for you. An orc leader won't be a problem.","Quest6Offer")
  196. Dialog.AddOption("No, thanks. I'm busy.")
  197. Dialog.Start()
  198. end
  199. function Quest6Offer(NPC,Player)
  200. OfferQuest(NPC,Player,Fighter6)
  201. FaceTarget(NPC, Spawn)
  202. end
  203. function Quest6Turnin(NPC,Spawn)
  204. FaceTarget(NPC, Spawn)
  205. Dialog.New(NPC, Spawn)
  206. Dialog.AddDialog("HA! Look at that would you! I knew you'd take care of that nasty orc! Now that Grimgash is slain the goblin attacks should slow down. You've served the outpost well, friend. As thanks, please accept this buckler, I know you'll use it well. Be careful and don't get your bell rung too often. Old Braksan hates funerals!")
  207. Dialog.AddVoiceover("voiceover/english/braksan_steelforge/tutorial_island02/braksansteelforge014.mp3", 3277683994, 3720991068)
  208. PlayFlavor(NPC, "", "", "chuckle", 0, 0, Spawn)
  209. Dialog.AddOption("Glad I could be of assistance. Take care Braksan.")
  210. Dialog.Start()
  211. SetStepComplete(Spawn,Fighter6,3)
  212. end