GerunPontian.lua 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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. local Eleventh_AJourneyOutsideTheCity = 5658
  16. function spawn(NPC)
  17. SetPlayerProximityFunction(NPC, 10, "InRange")
  18. end
  19. function respawn(NPC)
  20. spawn(NPC)
  21. end
  22. function InRange(NPC, Spawn)
  23. if GetDeity(Spawn) ~= 1 then
  24. if not HasCompletedQuest(Spawn, SpeckledRattlerVenom) then
  25. ProvidesQuest(NPC, SpeckledRattlerVenom)
  26. SetInfoFlag(NPC)
  27. SetVisualFlag(NPC)
  28. elseif HasCompletedQuest(Spawn, SpeckledRattlerVenom) then
  29. ProvidesQuest(NPC, BeetleShells)
  30. SetInfoFlag(NPC)
  31. SetVisualFlag(NPC)
  32. elseif HasCompletedQuest(Spawn, BeetleShells) then
  33. ProvidesQuest(NPC, ArmadilloHides)
  34. SetInfoFlag(NPC)
  35. SetVisualFlag(NPC)
  36. elseif HasCompletedQuest(Spawn, ArmadilloHides) then
  37. ProvidesQuest(NPC, OrcsAndGhosts)
  38. SetInfoFlag(NPC)
  39. SetVisualFlag(NPC)
  40. elseif HasCompletedQuest(Spawn, OrcsAndGhosts) then
  41. ProvidesQuest(NPC, Rainus)
  42. SetInfoFlag(NPC)
  43. SetVisualFlag(NPC)
  44. end
  45. end
  46. end
  47. function hailed(NPC, Spawn)
  48. if GetDeity(Spawn) ~= 1 then
  49. if HasCompletedQuest(Spawn, SpeckledRattlerVenom) and not HasQuest(Spawn, BeetleShells) and not HasCompletedQuest(Spawn, BeetleShells) then
  50. Option2(NPC, Spawn)
  51. elseif GetQuestStep(Spawn, SpeckledRattlerVenom) == 1 then
  52. HaventGotTheVenom(NPC, Spawn)
  53. elseif GetQuestStep(Spawn, SpeckledRattlerVenom) == 2 then
  54. HasGotTheVenom(NPC, Spawn)
  55. 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
  56. Option3(NPC, Spawn)
  57. elseif HasCompletedQuest(Spawn, SpeckledRattlerVenom) and HasCompletedQuest(Spawn, BeetleShells) and HasCompletedQuest(Spawn, ArmadilloHides) and not HasCompletedQuest(Spawn, OrcsAndGhosts) and not HasQuest(Spawn, OrcsAndGhosts) then
  58. Option5(NPC, Spawn)
  59. 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
  60. orcscomplete(NPC, Spawn)
  61. 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
  62. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "Thanks for the help", "", 0, 0, Spawn)
  63. elseif HasCompletedQuest(Spawn, SpeckledRattlerVenom) and HasCompletedQuest(Spawn, BeetleShells) and not HasQuest(Spawn, ArmadilloHides) and not HasCompletedQuest(Spawn, ArmadilloHides) and not HasQuest(Spawn, ArmadilloHides) then
  64. Option11(NPC, Spawn)
  65. elseif GetQuestStep(Spawn, BeetleShells) == 1 then
  66. HaventGotTheShells(NPC, Spawn)
  67. elseif GetQuestStep(Spawn, BeetleShells) == 2 then
  68. HasGotTheShells(NPC, Spawn)
  69. elseif GetQuestStep(Spawn, ArmadilloHides) == 1 then
  70. HaventGotTheHides(NPC, Spawn)
  71. elseif GetQuestStep(Spawn, ArmadilloHides) == 2 then
  72. HasGotTheHides(NPC, Spawn)
  73. elseif GetQuestStep(Spawn, OrcsAndGhosts) == 1 then
  74. OrcsNotKilled(NPC, Spawn)
  75. elseif GetQuestStep(Spawn, OrcsAndGhosts) == 2 then
  76. OrcsKilled(NPC, Spawn)
  77. elseif not HasQuest(Spawn, SpeckledRattlerVenom) and not HasCompletedQuest(Spawn, SpeckledRattlerVenom) then
  78. FirstTimeSpeaking(NPC, Spawn)
  79. elseif HasCompletedQuest(Spawn, ReturningToCaptainFeralis) then
  80. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "Well done. I have heard much about your expoits", "hail", 0, 0, Spawn)
  81. elseif HasQuest(Spawn, InHisName) then
  82. SetStepComplete(Spawn, InHisName, 1)
  83. end
  84. elseif GetDeity(Spawn) == 1 then
  85. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1022.mp3", "You are less then welcome here.", "", 0, 0, Spawn)
  86. end
  87. if GetQuestStep(Spawn, Eleventh_AJourneyOutsideTheCity) == 2 then
  88. SetStepComplete(Spawn, Eleventh_AJourneyOutsideTheCity, 2)
  89. end
  90. end
  91. function dlg_2(NPC, Spawn)
  92. FaceTarget(NPC, Spawn)
  93. Conversation = CreateConversation()
  94. AddConversationOption(Conversation, "How does this post turn profit?", "dlg_3")
  95. 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.")
  96. end
  97. function dlg_3(NPC, Spawn)
  98. FaceTarget(NPC, Spawn)
  99. Conversation = CreateConversation()
  100. AddConversationOption(Conversation, "What do you need?", "dlg_4")
  101. AddConversationOption(Conversation, "No thanks.")
  102. 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?")
  103. end
  104. function dlg_4(NPC, Spawn)
  105. FaceTarget(NPC, Spawn)
  106. Conversation = CreateConversation()
  107. AddConversationOption(Conversation, "Sure.", "OfferSpeckledRattlerVenom")
  108. 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?")
  109. end
  110. function FirstTimeSpeaking(NPC, Spawn)
  111. FaceTarget(NPC, Spawn)
  112. Conversation = CreateConversation()
  113. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "", "", 0, 0, Spawn)
  114. AddConversationOption(Conversation, "What makes it so dreary?", "dlg_2")
  115. AddConversationOption(Conversation, "I have to go.")
  116. 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.")
  117. end
  118. function OfferSpeckledRattlerVenom(NPC, Spawn)
  119. OfferQuest(NPC, Spawn, SpeckledRattlerVenom)
  120. FaceTarget(NPC, Spawn)
  121. Conversation = CreateConversation()
  122. AddConversationOption(Conversation, "I'll be back.")
  123. StartConversation(Conversation, NPC, Spawn, "Great! I'll be here, of course.")
  124. end
  125. function HaventGotTheVenom(NPC, Spawn)
  126. FaceTarget(NPC, Spawn)
  127. Conversation = CreateConversation()
  128. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "", "", 0, 0, Spawn)
  129. AddConversationOption(Conversation, "Not yet.")
  130. StartConversation(Conversation, NPC, Spawn, "Did you get the venom?")
  131. end
  132. function HasGotTheVenom(NPC, Spawn)
  133. FaceTarget(NPC, Spawn)
  134. local conversation = CreateConversation()
  135. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "", "", 0, 0, Spawn)
  136. AddConversationOption(conversation, "Yes, here it is.", "CompleteSpeckledRattlerVenom")
  137. StartConversation(conversation, NPC, Spawn, "Did you get the venom?")
  138. end
  139. function HaventGotTheHides(NPC, Spawn)
  140. FaceTarget(NPC, Spawn)
  141. local conversation = CreateConversation()
  142. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "", "", 0, 0, Spawn)
  143. AddConversationOption(conversation, "Not yet.")
  144. StartConversation(conversation, NPC, Spawn, "Did you get the hides?")
  145. end
  146. function HasGotTheHides(NPC, Spawn)
  147. FaceTarget(NPC, Spawn)
  148. local conversation = CreateConversation()
  149. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "", "", 0, 0, Spawn)
  150. AddConversationOption(conversation, "Yes.", "Option4")
  151. StartConversation(conversation, NPC, Spawn, "Did you get the hides?")
  152. end
  153. function OrcsKilled(NPC, Spawn)
  154. FaceTarget(NPC, Spawn)
  155. local conversation = CreateConversation()
  156. AddConversationOption(conversation, "Yes, they are dead.", "orcscomplete")
  157. StartConversation(conversation, NPC, Spawn, "Are the orcs dead?")
  158. end
  159. function OrcsNotKilled(NPC, Spawn)
  160. FaceTarget(NPC, Spawn)
  161. Conversation = CreateConversation()
  162. AddConversationOption(Conversation, "Not yet.")
  163. StartConversation(Conversation, NPC, Spawn, "Are the orcs dead?")
  164. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "", "", 0, 0, Spawn)
  165. end
  166. function CompleteSpeckledRattlerVenom(NPC, Spawn)
  167. SetStepComplete(Spawn, SpeckledRattlerVenom, 2)
  168. FaceTarget(NPC, Spawn)
  169. Conversation = CreateConversation()
  170. AddConversationOption(Conversation, "What is it?", "Option2")
  171. AddConversationOption(Conversation, "No thanks.")
  172. 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.")
  173. end
  174. function Option2(NPC, Spawn)
  175. FaceTarget(NPC, Spawn)
  176. local conversation = CreateConversation()
  177. AddConversationOption(conversation, "More venom?", "Option9")
  178. StartConversation(conversation, NPC, Spawn, "Great! This will fetch a nice amount. There's more where that came from if you're interested.")
  179. end
  180. function HaventGotTheShells(NPC, Spawn)
  181. FaceTarget(NPC, Spawn)
  182. local conversation = CreateConversation()
  183. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "", "", 0, 0, Spawn)
  184. AddConversationOption(conversation, "Not yet.")
  185. StartConversation(conversation, NPC, Spawn, "Do you have the shells?")
  186. end
  187. function Option5(NPC, Spawn)
  188. FaceTarget(NPC, Spawn)
  189. local conversation = CreateConversation()
  190. AddConversationOption(conversation, "What is it?", "offer4")
  191. AddConversationOption(conversation, "No thanks.")
  192. StartConversation(conversation, NPC, Spawn, "I do have something a bit more exciting if you're interested.")
  193. end
  194. function orcscomplete(NPC, Spawn)
  195. FaceTarget(NPC, Spawn)
  196. if GetQuestStep(Spawn, OrcsAndGhosts) == 2 then
  197. SetStepComplete(Spawn, OrcsAndGhosts, 2)
  198. end
  199. FaceTarget(NPC, Spawn)
  200. local conversation = CreateConversation()
  201. AddConversationOption(conversation, "Yeah, I'm interested.", "Option16")
  202. 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?")
  203. end
  204. function Option16(NPC, Spawn)
  205. FaceTarget(NPC, Spawn)
  206. local conversation = CreateConversation()
  207. AddConversationOption(conversation, "I will find him.", "offer5")
  208. 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.")
  209. end
  210. function HasGotTheShells(NPC, Spawn)
  211. FaceTarget(NPC, Spawn)
  212. local conversation = CreateConversation()
  213. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", "", "", 0, 0, Spawn)
  214. AddConversationOption(conversation, "Yes.", "Option3")
  215. StartConversation(conversation, NPC, Spawn, "Do you have the shells?")
  216. end
  217. function Option3(NPC, Spawn)
  218. FaceTarget(NPC, Spawn)
  219. SetStepComplete(Spawn, BeetleShells, 2)
  220. local conversation = CreateConversation()
  221. AddConversationOption(conversation, "Yeah, I can do more.", "Option11")
  222. AddConversationOption(conversation, "Sorry, not interested right now.")
  223. StartConversation(conversation, NPC, Spawn, "Great! Are you tired yet or can you do more?")
  224. end
  225. function Option11(NPC, Spawn)
  226. FaceTarget(NPC, Spawn)
  227. local conversation = CreateConversation()
  228. AddConversationOption(conversation, "I can get them.", "offer3")
  229. AddConversationOption(conversation, "Not interested.")
  230. 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.")
  231. end
  232. function Option4(NPC, Spawn)
  233. FaceTarget(NPC, Spawn)
  234. local conversation = CreateConversation()
  235. SetStepComplete(Spawn, ArmadilloHides, 2)
  236. AddConversationOption(conversation, "No problem. Glad I could help.", "Option13")
  237. 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.")
  238. end
  239. function Option17(NPC, Spawn)
  240. FaceTarget(NPC, Spawn)
  241. local conversation = CreateConversation()
  242. AddConversationOption(conversation, "Thank you.")
  243. StartConversation(conversation, NPC, Spawn, "May the Overlord hasten your path, " .. GetName(Spawn) .. ".")
  244. end
  245. function Option9(NPC, Spawn)
  246. FaceTarget(NPC, Spawn)
  247. local conversation = CreateConversation()
  248. AddConversationOption(conversation, "Sure, I'll get the shells.", "offer2")
  249. 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?")
  250. end
  251. function offer2(NPC, Spawn)
  252. OfferQuest(NPC, Spawn, BeetleShells)
  253. end
  254. function offer3(NPC, Spawn)
  255. OfferQuest(NPC, Spawn, ArmadilloHides)
  256. end
  257. function offer4(NPC, Spawn)
  258. OfferQuest(NPC, Spawn, OrcsAndGhosts)
  259. end
  260. function offer5(NPC, Spawn)
  261. OfferQuest(NPC, Spawn, Rainus)
  262. end