9
3

GerunPontian.lua 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/GerunPontian.lua
  3. Script Purpose : Gerun Pontian
  4. Script Author : vo1d
  5. Script Date : 2019.10.28
  6. Script Notes : n/a
  7. --]]
  8. local InHisName = 5228
  9. local SpeckledRattlerVenom = 375
  10. local BeetleShells = 398
  11. local ArmadilloHides = 399
  12. local OrcsAndGhosts = 400
  13. local Rainus = 401
  14. local ReturningToCaptainFeralis = 5221
  15. function spawn(NPC)
  16. SetPlayerProximityFunction(NPC, 10, "InRange")
  17. end
  18. function respawn(NPC)
  19. spawn(NPC)
  20. end
  21. function InRange(NPC, Spawn)
  22. if GetDeity(Spawn) ~= 1 then
  23. if not HasCompletedQuest(Spawn, SpeckledRattlerVenom) then
  24. ProvidesQuest(NPC, SpeckledRattlerVenom)
  25. SetInfoFlag(NPC)
  26. SetVisualFlag(NPC)
  27. elseif HasCompletedQuest(Spawn, SpeckledRattlerVenom) then
  28. ProvidesQuest(NPC, BeetleShells)
  29. SetInfoFlag(NPC)
  30. SetVisualFlag(NPC)
  31. elseif HasCompletedQuest(Spawn, BeetleShells) then
  32. ProvidesQuest(NPC, ArmadilloHides)
  33. SetInfoFlag(NPC)
  34. SetVisualFlag(NPC)
  35. elseif HasCompletedQuest(Spawn, ArmadilloHides) then
  36. ProvidesQuest(NPC, OrcsAndGhosts)
  37. SetInfoFlag(NPC)
  38. SetVisualFlag(NPC)
  39. elseif HasCompletedQuest(Spawn, OrcsAndGhosts) then
  40. ProvidesQuest(NPC, Rainus)
  41. SetInfoFlag(NPC)
  42. SetVisualFlag(NPC)
  43. end
  44. end
  45. end
  46. function hailed(NPC, Spawn)
  47. if GetDeity(Spawn) ~= 1 then
  48. if HasCompletedQuest(Spawn, SpeckledRattlerVenom) and not HasQuest(Spawn, BeetleShells) and not HasCompletedQuest(Spawn, BeetleShells) then
  49. Option2(NPC, Spawn)
  50. elseif GetQuestStep(Spawn, SpeckledRattlerVenom) == 1 then
  51. HaventGotTheVenom(NPC, Spawn)
  52. elseif GetQuestStep(Spawn, SpeckledRattlerVenom) == 2 then
  53. HasGotTheVenom(NPC, Spawn)
  54. elseif HasCompletedQuest(Spawn, SpeckledRattlerVenom) and not HasCompletedQuest(Spawn, BeetleShells) and not HasQuest(Spawn, BeetleShells) and not HasCompletedQuest(Spawn, ArmadilloHides) and not HasQuest(Spawn, ArmadilloHides) then
  55. Option3(NPC, Spawn)
  56. elseif HasCompletedQuest(Spawn, SpeckledRattlerVenom) and HasCompletedQuest(Spawn, BeetleShells) and HasCompletedQuest(Spawn, ArmadilloHides) and not HasCompletedQuest(Spawn, OrcsAndGhosts) and not HasQuest(Spawn, OrcsAndGhosts) then
  57. Option5(NPC, Spawn)
  58. elseif HasCompletedQuest(Spawn, SpeckledRattlerVenom) and HasCompletedQuest(Spawn, BeetleShells) and HasCompletedQuest(Spawn, ArmadilloHides) and HasCompletedQuest(Spawn, OrcsAndGhosts) and not HasCompletedQuest(Spawn, Rainus) and not HasQuest(Spawn, Rainus) then
  59. orcscomplete(NPC, Spawn)
  60. elseif HasCompletedQuest(Spawn, SpeckledRattlerVenom) and HasCompletedQuest(Spawn, BeetleShells) and HasCompletedQuest(Spawn, ArmadilloHides) and HasCompletedQuest(Spawn, OrcsAndGhosts) and HasQuest(Spawn, Rainus) or HasCompletedQuest(Spawn, Rainus) then
  61. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "Thanks for the help", "", 0, 0, Spawn)
  62. elseif HasCompletedQuest(Spawn, SpeckledRattlerVenom) and HasCompletedQuest(Spawn, BeetleShells) and not HasQuest(Spawn, ArmadilloHides) and not HasCompletedQuest(Spawn, ArmadilloHides) and not HasQuest(Spawn, ArmadilloHides) then
  63. Option11(NPC, Spawn)
  64. elseif GetQuestStep(Spawn, BeetleShells) == 1 then
  65. HaventGotTheShells(NPC, Spawn)
  66. elseif GetQuestStep(Spawn, BeetleShells) == 2 then
  67. HasGotTheShells(NPC, Spawn)
  68. elseif GetQuestStep(Spawn, ArmadilloHides) == 1 then
  69. HaventGotTheHides(NPC, Spawn)
  70. elseif GetQuestStep(Spawn, ArmadilloHides) == 2 then
  71. HasGotTheHides(NPC, Spawn)
  72. elseif GetQuestStep(Spawn, OrcsAndGhosts) == 1 then
  73. OrcsNotKilled(NPC, Spawn)
  74. elseif GetQuestStep(Spawn, OrcsAndGhosts) == 2 then
  75. OrcsKilled(NPC, Spawn)
  76. elseif not HasQuest(Spawn, SpeckledRattlerVenom) and not HasCompletedQuest(Spawn, SpeckledRattlerVenom) then
  77. FirstTimeSpeaking(NPC, Spawn)
  78. elseif HasCompletedQuest(Spawn, ReturningToCaptainFeralis) then
  79. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "Well done. I have heard much about your expoits", "hail", 0, 0, Spawn)
  80. elseif HasQuest(Spawn, InHisName) then
  81. SetStepComplete(Spawn, InHisName, 1)
  82. end
  83. elseif GetDeity(Spawn) == 1 then
  84. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1022.mp3", "You are less then welcome here.", "", 0, 0, Spawn)
  85. end
  86. end
  87. function dlg_2(NPC, Spawn)
  88. FaceTarget(NPC, Spawn)
  89. Conversation = CreateConversation()
  90. AddConversationOption(Conversation, "How does this post turn profit?", "dlg_3")
  91. StartConversation(Conversation, NPC, Spawn, "Who attacks the gates of Freeport? Orcs? Dervish Cutthroats? Qeynosians? Hah! The only good thing about this post is it gives me a lot of time. And even the most daft of fools knows that time equals money.")
  92. end
  93. function dlg_3(NPC, Spawn)
  94. FaceTarget(NPC, Spawn)
  95. Conversation = CreateConversation()
  96. AddConversationOption(Conversation, "What do you need?", "dlg_4")
  97. AddConversationOption(Conversation, "No thanks.")
  98. StartConversation(Conversation, NPC, Spawn, "Like I said, I've got free time. So while I'm out here I can acquire commodities that I can then sell to the merchants of Freeport. If I can't be out there earning glory, I'll stay back here and earn coin. Care to help?")
  99. end
  100. function dlg_4(NPC, Spawn)
  101. FaceTarget(NPC, Spawn)
  102. Conversation = CreateConversation()
  103. AddConversationOption(Conversation, "Sure.", "OfferSpeckledRattlerVenom")
  104. StartConversation(Conversation, NPC, Spawn, "Venom has been selling quite nicely. There are quite a few speckled rattlers around here. They're a great source of venom. If you bring me back the venom from eight of them I'll give you a portion of what the profit will be. Sound good?")
  105. end
  106. function FirstTimeSpeaking(NPC, Spawn)
  107. FaceTarget(NPC, Spawn)
  108. Conversation = CreateConversation()
  109. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "", "", 0, 0, Spawn)
  110. AddConversationOption(Conversation, "What makes it so dreary?", "dlg_2")
  111. AddConversationOption(Conversation, "I have to go.")
  112. StartConversation(Conversation, NPC, Spawn, "Gerun Pontian of the Militia. I watch the gates. I assure you a more dreary job does not exist in all of D'Lere.")
  113. end
  114. function OfferSpeckledRattlerVenom(NPC, Spawn)
  115. OfferQuest(NPC, Spawn, SpeckledRattlerVenom)
  116. FaceTarget(NPC, Spawn)
  117. Conversation = CreateConversation()
  118. AddConversationOption(Conversation, "I'll be back.")
  119. StartConversation(Conversation, NPC, Spawn, "Great! I'll be here, of course.")
  120. end
  121. function HaventGotTheVenom(NPC, Spawn)
  122. FaceTarget(NPC, Spawn)
  123. Conversation = CreateConversation()
  124. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "", "", 0, 0, Spawn)
  125. AddConversationOption(Conversation, "Not yet.")
  126. StartConversation(Conversation, NPC, Spawn, "Did you get the venom?")
  127. end
  128. function HasGotTheVenom(NPC, Spawn)
  129. FaceTarget(NPC, Spawn)
  130. local conversation = CreateConversation()
  131. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "", "", 0, 0, Spawn)
  132. AddConversationOption(conversation, "Yes, here it is.", "CompleteSpeckledRattlerVenom")
  133. StartConversation(conversation, NPC, Spawn, "Did you get the venom?")
  134. end
  135. function HaventGotTheHides(NPC, Spawn)
  136. FaceTarget(NPC, Spawn)
  137. local conversation = CreateConversation()
  138. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "", "", 0, 0, Spawn)
  139. AddConversationOption(conversation, "Not yet.")
  140. StartConversation(conversation, NPC, Spawn, "Did you get the hides?")
  141. end
  142. function HasGotTheHides(NPC, Spawn)
  143. FaceTarget(NPC, Spawn)
  144. local conversation = CreateConversation()
  145. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "", "", 0, 0, Spawn)
  146. AddConversationOption(conversation, "Yes.", "Option4")
  147. StartConversation(conversation, NPC, Spawn, "Did you get the hides?")
  148. end
  149. function OrcsKilled(NPC, Spawn)
  150. FaceTarget(NPC, Spawn)
  151. local conversation = CreateConversation()
  152. AddConversationOption(conversation, "Yes, they are dead.", "orcscomplete")
  153. StartConversation(conversation, NPC, Spawn, "Are the orcs dead?")
  154. end
  155. function OrcsNotKilled(NPC, Spawn)
  156. FaceTarget(NPC, Spawn)
  157. Conversation = CreateConversation()
  158. AddConversationOption(Conversation, "Not yet.")
  159. StartConversation(Conversation, NPC, Spawn, "Are the orcs dead?")
  160. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "", "", 0, 0, Spawn)
  161. end
  162. function CompleteSpeckledRattlerVenom(NPC, Spawn)
  163. SetStepComplete(Spawn, SpeckledRattlerVenom, 2)
  164. FaceTarget(NPC, Spawn)
  165. Conversation = CreateConversation()
  166. AddConversationOption(Conversation, "What is it?", "Option2")
  167. AddConversationOption(Conversation, "No thanks.")
  168. StartConversation(Conversation, NPC, Spawn, "Good work. You've made us both quite a bit of coin. Thanks for the help. I'm sorry that my tasks have been so dull, it's hard to pull the important missions when you're a lowly gate patrol. I do have something a bit more exciting if you're interested.")
  169. end
  170. function Option2(NPC, Spawn)
  171. FaceTarget(NPC, Spawn)
  172. local conversation = CreateConversation()
  173. AddConversationOption(conversation, "More venom?", "Option9")
  174. StartConversation(conversation, NPC, Spawn, "Great! This will fetch a nice amount. There's more where that came from if you're interested.")
  175. end
  176. function HaventGotTheShells(NPC, Spawn)
  177. FaceTarget(NPC, Spawn)
  178. local conversation = CreateConversation()
  179. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "", "", 0, 0, Spawn)
  180. AddConversationOption(conversation, "Not yet.")
  181. StartConversation(conversation, NPC, Spawn, "Do you have the shells?")
  182. end
  183. function Option5(NPC, Spawn)
  184. FaceTarget(NPC, Spawn)
  185. local conversation = CreateConversation()
  186. AddConversationOption(conversation, "What is it?", "offer4")
  187. AddConversationOption(conversation, "No thanks.")
  188. StartConversation(conversation, NPC, Spawn, "I do have something a bit more exciting if you're interested.")
  189. end
  190. function orcscomplete(NPC, Spawn)
  191. FaceTarget(NPC, Spawn)
  192. if GetQuestStep(Spawn, OrcsAndGhosts) == 2 then
  193. SetStepComplete(Spawn, OrcsAndGhosts, 2)
  194. end
  195. FaceTarget(NPC, Spawn)
  196. local conversation = CreateConversation()
  197. AddConversationOption(conversation, "Yeah, I'm interested.", "Option16")
  198. StartConversation(conversation, NPC, Spawn, "Ah, most excellent. Thank you very much. Listen... they sent you to me to see if you were able to get things done. I know I've been sending you around doing menial stuff, but you seem to follow orders quite well. If you're interested in working for us, and increasing your exposure--even to the Overlord himself--I have someone I can put you in contact with. Interested?")
  199. end
  200. function Option16(NPC, Spawn)
  201. FaceTarget(NPC, Spawn)
  202. local conversation = CreateConversation()
  203. AddConversationOption(conversation, "I will find him.", "offer5")
  204. StartConversation(conversation, NPC, Spawn, "I thought you might be. He won't be sending you after any armadillos either! Go south of here, past the Turmoil Cemetery. There is an old, ruined tower where you can find Rainus Canton. He will have tasks for you, without a doubt.")
  205. end
  206. function HasGotTheShells(NPC, Spawn)
  207. FaceTarget(NPC, Spawn)
  208. local conversation = CreateConversation()
  209. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "", "", 0, 0, Spawn)
  210. AddConversationOption(conversation, "Yes.", "Option3")
  211. StartConversation(conversation, NPC, Spawn, "Do you have the shells?")
  212. end
  213. function Option3(NPC, Spawn)
  214. FaceTarget(NPC, Spawn)
  215. SetStepComplete(Spawn, BeetleShells, 2)
  216. local conversation = CreateConversation()
  217. AddConversationOption(conversation, "Yeah, I can do more.", "Option11")
  218. AddConversationOption(conversation, "Sorry, not interested right now.")
  219. StartConversation(conversation, NPC, Spawn, "Great! Are you tired yet or can you do more?")
  220. end
  221. function Option11(NPC, Spawn)
  222. FaceTarget(NPC, Spawn)
  223. local conversation = CreateConversation()
  224. AddConversationOption(conversation, "I can get them.", "offer3")
  225. AddConversationOption(conversation, "Not interested.")
  226. StartConversation(conversation, NPC, Spawn, "All right. I've got some buyers lined up for some armadillo hides. You can find some if you follow the road west and along the wall that stretches to the north. I need ten of their hides.")
  227. end
  228. function Option4(NPC, Spawn)
  229. FaceTarget(NPC, Spawn)
  230. local conversation = CreateConversation()
  231. SetStepComplete(Spawn, ArmadilloHides, 2)
  232. AddConversationOption(conversation, "No problem. Glad I could help.", "Option13")
  233. StartConversation(conversation, NPC, Spawn, "Good work. You've made us both quite a bit of coin. Thanks for the help. I'm sorry that my tasks have been so dull. It's hard to pull the important missions when you're a lowly gate patrol.")
  234. end
  235. function Option17(NPC, Spawn)
  236. FaceTarget(NPC, Spawn)
  237. local conversation = CreateConversation()
  238. AddConversationOption(conversation, "Thank you.")
  239. StartConversation(conversation, NPC, Spawn, "May the Overlord hasten your path, " .. GetName(Spawn) .. ".")
  240. end
  241. function Option9(NPC, Spawn)
  242. FaceTarget(NPC, Spawn)
  243. local conversation = CreateConversation()
  244. AddConversationOption(conversation, "Sure, I'll get the shells.", "offer2")
  245. StartConversation(conversation, NPC, Spawn, "Nah, this will take a while to sell. If I have more venom I risk driving down my own price. But there's plenty of wildlife around here that is willing to be exploited for our benefit! The shells of the small emerald beetles around here are very commonly used in jewelry. If you collect six of their shells I'll have enough to make a bulk sale. What do you say?")
  246. end
  247. function offer2(NPC, Spawn)
  248. OfferQuest(NPC, Spawn, BeetleShells)
  249. end
  250. function offer3(NPC, Spawn)
  251. OfferQuest(NPC, Spawn, ArmadilloHides)
  252. end
  253. function offer4(NPC, Spawn)
  254. OfferQuest(NPC, Spawn, OrcsAndGhosts)
  255. end
  256. function offer5(NPC, Spawn)
  257. OfferQuest(NPC, Spawn, Rainus)
  258. end