ThirinVeliumdelver_(spine).lua 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. --[[
  2. Script Name : SpawnScripts/FrostfangSea/ThirinVeliumdelver_(spine).lua
  3. Script Purpose : Thirin Veliumdelver
  4. Script Author : theFoof
  5. Script Date : 2013.06.09
  6. Script Notes :
  7. --]]
  8. local NothingWaste = 56
  9. local RoughingReinforcements = 57
  10. local ThroughEyes = 58
  11. local BelowWaves = 59
  12. local RyGorrOperations = 60
  13. local NapEvigis = 64
  14. function spawn(NPC)
  15. AddSpawnAccess(NPC, NPC)
  16. SetPlayerProximityFunction(NPC, 50, "SpawnAccess", "SpawnAccess")
  17. ProvidesQuest(NPC, NothingWaste)
  18. ProvidesQuest(NPC, RoughingReinforcements)
  19. ProvidesQuest(NPC, ThroughEyes)
  20. ProvidesQuest(NPC, BelowWaves)
  21. end
  22. function respawn(NPC)
  23. spawn(NPC)
  24. end
  25. function SpawnAccess(NPC, Spawn)
  26. if HasCompletedQuest(Spawn, NapEvigis) then
  27. AddSpawnAccess(NPC, Spawn)
  28. elseif not HasCompletedQuest(Spawn, RyGorrOperations) and not HasQuest(Spawn, RyGorrOperations) then
  29. AddSpawnAccess(NPC, Spawn)
  30. end
  31. end
  32. function hailed(NPC, Spawn)
  33. FaceTarget(NPC, Spawn)
  34. conversation = CreateConversation()
  35. if not HasCompletedQuest(Spawn, NothingWaste) and not HasQuest(Spawn, NothingWaste) then
  36. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver001.mp3", "", "", 3958889097, 419690768, Spawn)
  37. AddConversationOption(conversation, "Would you happen to be Thirin? I heard you might need help here.", "Quest1Chat_1")
  38. StartConversation(conversation, NPC, Spawn, "What do ye want, whelp? Can't you see I'm a bit busy with defending the Cragged Spine!?")
  39. elseif GetQuestStep(Spawn, NothingWaste) == 1 or GetQuestStep(Spawn, ThroughEyes) == 1 or GetQuestStep(Spawn, BelowWaves) == 1 or GetQuestStep(Spawn, BelowWaves) == 2 then
  40. BrellConvo(NPC, Spawn)
  41. elseif GetQuestStep(Spawn, NothingWaste) == 4 then
  42. SetStepComplete(Spawn, NothingWaste, 4)
  43. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver008.mp3", "", "", 2278681822, 876133756, Spawn)
  44. AddConversationOption(conversation, "I'm glad I could be of some use.", "Quest2Chat_1")
  45. StartConversation(conversation, NPC, Spawn, "Ah, you've succeeded. Perhaps ye're not all that useless after all, adventurer. These will do nicely. I'll have one of my men take a look at these, fix them up, and have them distributed among the forces.")
  46. elseif HasCompletedQuest(Spawn, NothingWaste) and not HasCompletedQuest(Spawn, RoughingReinforcements) and not HasQuest(Spawn, RoughingReinforcements) then
  47. Quest2Chat_2(NPC, Spawn)
  48. elseif HasQuest(Spawn, RoughingReinforcements) and GetQuestStep(Spawn, RoughingReinforcements) ~= 6 then
  49. BrellConvo(NPC, Spawn)
  50. elseif GetQuestStep(Spawn, RoughingReinforcements) == 6 then
  51. SetStepComplete(Spawn, RoughingReinforcements, 6)
  52. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver013.mp3", "", "", 1378985878, 3460156375, Spawn)
  53. AddConversationOption(conversation, "Yes, and I found this scrying eye off of one of the war shamans. I thought it might be useful.", "Quest3Chat_1")
  54. StartConversation(conversation, NPC, Spawn, "You return. What news? Were yer skirmishes with the enemy successful?")
  55. elseif HasCompletedQuest(Spawn, RoughingReinforcements) and not HasCompletedQuest(Spawn, ThroughEyes) and not HasQuest(Spawn, ThroughEyes) then
  56. Quest3Chat_1(NPC, Spawn)
  57. elseif GetQuestStep(Spawn, ThroughEyes) == 2 then
  58. SetStepComplete(Spawn, ThroughEyes, 2)
  59. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver017.mp3", "", "", 4179496210, 3494173244, Spawn)
  60. AddConversationOption(conversation, "I was. I saw through an orc who swam beneath the waves. He entered an underwater tunnel leading to the center of Erollis. Beyond that I do not know. It seems the spell is restricted by distance.", "Quest4Chat_1")
  61. StartConversation(conversation, NPC, Spawn, "You've survived? I had heard reports that an adventurer fell to the Ry'Gorr not long ago. I'm glad to see my spy survived to tell what he's found. Were you successful in using the eye?")
  62. elseif HasCompletedQuest(Spawn, ThroughEyes) and not HasCompletedQuest(Spawn, BelowWaves) and not HasQuest(Spawn, BelowWaves) then
  63. Quest4Chat_1(NPC, Spawn)
  64. elseif GetQuestStep(Spawn, BelowWaves) == 3 then
  65. SetStepComplete(Spawn, BelowWaves, 3)
  66. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver021.mp3", "", "", 3523614178, 2692776069, Spawn)
  67. AddConversationOption(conversation, "They have dug a series of mining tunnels throughout the interior of Erollis, many in the direction of New Halas. I fear they mean to attack from below.", "Quest5Chat_1")
  68. StartConversation(conversation, NPC, Spawn, "What have you found? What are they doing below my lands?")
  69. elseif HasCompletedQuest(Spawn, BelowWaves) and not HasCompletedQuest(Spawn, NapEvigis) then
  70. Quest5Chat_1(NPC, Spawn)
  71. else
  72. PlayFlavor(NPC, "", "Hello my friend. It is good to see you.", "hello", 0, 0, Spawn)
  73. end
  74. end
  75. function BrellConvo(NPC, Spawn)
  76. PlayFlavor(NPC, "", "May Brell protect you and ensure your return.", "", 1689589577, 4560189, Spawn)
  77. end
  78. function Quest1Chat_1(NPC, Spawn)
  79. FaceTarget(NPC, Spawn)
  80. conversation = CreateConversation()
  81. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver002.mp3", "", "", 1122391828, 935093555, Spawn)
  82. AddConversationOption(conversation, "Do you have work for me or not?", "Quest1Chat_2")
  83. StartConversation(conversation, NPC, Spawn, "Oh, you want to help, do ye? Want to be some great hero now, huh? Well isn't that just grand.")
  84. end
  85. function Quest1Chat_2(NPC, Spawn)
  86. FaceTarget(NPC, Spawn)
  87. conversation = CreateConversation()
  88. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver003.mp3", "", "", 1628251409, 1305821623, Spawn)
  89. AddConversationOption(conversation, "Good, just tell me what needs to be done.", "Quest1Chat_3")
  90. StartConversation(conversation, NPC, Spawn, "Fine, fine, I can come up with something for ye to help with.")
  91. end
  92. function Quest1Chat_3(NPC, Spawn)
  93. FaceTarget(NPC, Spawn)
  94. conversation = CreateConversation()
  95. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver004.mp3", "", "", 1710386030, 2555471318, Spawn)
  96. AddConversationOption(conversation, "So I am to return to The Great Shelf for weapons and armor?", "Quest1Chat_4")
  97. StartConversation(conversation, NPC, Spawn, "Well, we've been holding the Cragged Spine for some time now. So long in fact our equipment is starting to wear, rust or break. Broken bows, snapped swords, destroyed chainmail, it's getting worse by the hour.")
  98. end
  99. function Quest1Chat_4(NPC, Spawn)
  100. FaceTarget(NPC, Spawn)
  101. conversation = CreateConversation()
  102. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver006.mp3", "", "", 807741417, 1254276267, Spawn)
  103. AddConversationOption(conversation, "Alright, Thirin. I'll help you.", "OfferNothingWaste")
  104. AddConversationOption(conversation, "I'm sorry, but there are more important things I could be doing.")
  105. StartConversation(conversation, NPC, Spawn, "No, you won't be returning. That would take too long. We will be taking the armor off the backs of those we've slain. It sounds crude, but it will be effective. I hate to have my men wearing orcish armor, but no battle was ever won by looking fancy or wearing equipment that fit you.")
  106. end
  107. function Quest2Chat_1(NPC, Spawn)
  108. FaceTarget(NPC, Spawn)
  109. conversation = CreateConversation()
  110. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver009.mp3", "", "", 3384327104, 2564907110, Spawn)
  111. AddConversationOption(conversation, "Surely you can hold them here, now that you are better equipped.", "Quest2Chat_2")
  112. StartConversation(conversation, NPC, Spawn, "Watching those orcs realize we are using their equipment in our defenses will be entertaining. For that I thank ye adventurer. With my troops now reinforced I can turn my eyes to the larger threat. The Ry'Gorr, as they call themselves, have been attacking from the Jagged Daggers Isle, across the waves to the south. I fear their re-enforcements will arrive swiftly and with renewed purpose.")
  113. end
  114. function Quest2Chat_2(NPC, Spawn)
  115. FaceTarget(NPC, Spawn)
  116. conversation = CreateConversation()
  117. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver010.mp3", "", "", 684443689, 2994100029, Spawn)
  118. AddConversationOption(conversation, "Thirin, your troops need you here. Morale is often frail, supported by a strong foundation. You are that foundation. ", "Quest2Chat_3")
  119. StartConversation(conversation, NPC, Spawn, "I think not. What we've seen thus far is only a small part of their forces. They underestimated us, but now they know to send more orcs if they are to take the beach. No, in this situation there is only one thing we can do. Take the fight to them. Come, we leave at once for the Jagged Daggers Isle. I'm tired of sitting about in waiting. I was never one for defense.")
  120. end
  121. function Quest2Chat_3(NPC, Spawn)
  122. FaceTarget(NPC, Spawn)
  123. conversation = CreateConversation()
  124. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver011.mp3", "", "", 4204960887, 1557606971, Spawn)
  125. AddConversationOption(conversation, "I will leave at once for the isle. I won't let them take the beach.", "OfferRoughingReinforcements")
  126. AddConversationOption(conversation, "I am sorry, but there is something more important I must take care of first.")
  127. StartConversation(conversation, NPC, Spawn, "Hmm, well said, adventurer. Very well, I shall send you in my stead, as you've proven you can be somewhat dependable. Travel to the Jagged Daggers Isle, across the waves to the south and show them we are not to be underestimated. Destroy what forces and equipment you can and keep an eye out for their war shamans. They have the ability to scry our encampment. If you happen to combat them it will help conceal our positioning.")
  128. end
  129. function Quest3Chat_1(NPC, Spawn)
  130. FaceTarget(NPC, Spawn)
  131. conversation = CreateConversation()
  132. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver014.mp3", "", "", 6970253, 3066757715, Spawn)
  133. AddConversationOption(conversation, "There you are, I hope it will be useful.", "Quest3Chat_2")
  134. StartConversation(conversation, NPC, Spawn, "A scrying eye you say. That's what they use to spy on our forces. I can't believe you were able to get one. Let me have a look. If we're lucky it will have already been imbued with their scrying magics.")
  135. end
  136. function Quest3Chat_2(NPC, Spawn)
  137. FaceTarget(NPC, Spawn)
  138. conversation = CreateConversation()
  139. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver015.mp3", "", "", 3051702043, 2201190917, Spawn)
  140. AddConversationOption(conversation, "It's good we are in possession of this then. I am sure I can find a Ry'Gorr to use this on.", "OfferThroughEyes")
  141. AddConversationOption(conversation, "Spying and magic aren't really my thing.")
  142. StartConversation(conversation, NPC, Spawn, "Hmm. We are in luck adventurer. This has already been imbued with the magics that allow the Ry'Gorr to spy on us. Meaning we can use it against them and maybe learn something new to aid us. All ye need do is find a Ry'Gorr to use the eye on and you'll be able to see what he sees. That's how it works, you see? It allows you to see through the eyes of another, just by pressing the eye against the skin.")
  143. end
  144. function Quest4Chat_1(NPC, Spawn)
  145. FaceTarget(NPC, Spawn)
  146. conversation = CreateConversation()
  147. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver018.mp3", "", "", 3389054723, 425793469, Spawn)
  148. AddConversationOption(conversation, "I haven't a clue, but I intend to find out.", "Quest4Chat_2")
  149. StartConversation(conversation, NPC, Spawn, "They are below us? This is quite unexpected. What are they doing down there? What are they planning?")
  150. end
  151. function Quest4Chat_2(NPC, Spawn)
  152. FaceTarget(NPC, Spawn)
  153. conversation = CreateConversation()
  154. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver020.mp3", "", "", 3456248509, 1625770921, Spawn)
  155. AddConversationOption(conversation, "That's awesome!", "OfferBelowWaves")
  156. StartConversation(conversation, NPC, Spawn, "Don't go just yet, " .. GetName(Spawn) .. ". I have something to help ye! It's a Totem of the Iceclad Manta. It will grant ye the shape of an Iceclad manta and the gills and vision of one, to boot!")
  157. end
  158. function Quest5Chat_1(NPC, Spawn)
  159. FaceTarget(NPC, Spawn)
  160. conversation = CreateConversation()
  161. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver022.mp3", "", "", 4095447714, 560323533, Spawn)
  162. AddConversationOption(conversation, "Before we travel below, know I have found some sort of cave-in. It looks to have been recently built by the orcs, though I know not for what purpose. It's very strange.", "Quest5Chat_2")
  163. StartConversation(conversation, NPC, Spawn, "Confound it! This is what I was afraid of. There may not be enough time to warn the city before they attack, we're going to have to go down there and stop the Ry'Gorr ourselves. ")
  164. end
  165. function Quest5Chat_2(NPC, Spawn)
  166. FaceTarget(NPC, Spawn)
  167. conversation = CreateConversation()
  168. PlayFlavor(NPC, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver023.mp3", "", "", 1522066613, 3536237484, Spawn)
  169. AddConversationOption(conversation, "See you below then.")
  170. StartConversation(conversation, NPC, Spawn, "A cave-in you say? I'll take a look once I've reached the inside. This time I go; my men will be able to handle things here, thanks to ye. Meet me at the cave's entrance, adventurer. I'll have inspected this cave-in ye speak of by then.")
  171. end
  172. function OfferNothingWaste(NPC, Spawn)
  173. OfferQuest(NPC, Spawn, NothingWaste)
  174. end
  175. function OfferRoughingReinforcements(NPC, Spawn)
  176. OfferQuest(NPC, Spawn, RoughingReinforcements)
  177. end
  178. function OfferThroughEyes(NPC, Spawn)
  179. OfferQuest(NPC, Spawn, ThroughEyes)
  180. end
  181. function OfferBelowWaves(NPC, Spawn)
  182. OfferQuest(NPC, Spawn, BelowWaves)
  183. end