CaptainFeralis.lua 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/CaptainFeralis.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.02.18 08:02:10
  5. Script Purpose :
  6. Script Notes : Offer Quests "Filling the Coffers", "Ventar T'Kal", "Tesera Valnos".
  7. --]]
  8. local CaptainFeralis = 405
  9. local QUEST = 406 -- Filling the Coffers quest
  10. local QUEST2 = 407 -- Ventar T'Kal quest
  11. local QUEST3 = 412 -- Returning to Captain Feralis quest (Ventar)
  12. local QUEST4 = 414 -- Tesera Valnos quest
  13. local QUEST5 = 5221 -- Returning to Captain Feralis quest ( Tecera)
  14. function spawn(NPC)
  15. SetPlayerProximityFunction(NPC, 10, "InRange")
  16. end
  17. function InRange(NPC, Spawn)
  18. if GetDeity(Spawn) ~= 1 then
  19. if HasCompletedQuest(Spawn, CaptainFeralis) then
  20. ProvidesQuest(NPC, QUEST)
  21. SetInfoFlag(NPC)
  22. SetVisualFlag(NPC)
  23. elseif HasCompletedQuest(Spawn, QUEST) then
  24. ProvidesQuest(NPC, QUEST2)
  25. SetInfoFlag(NPC)
  26. SetVisualFlag(NPC)
  27. elseif HasCompletedQuest(Spawn, QUEST3) then
  28. ProvidesQuest(NPC, QUEST4)
  29. SetInfoFlag(NPC)
  30. SetVisualFlag(NPC)
  31. end
  32. end
  33. end
  34. function hailed(NPC, Spawn)
  35. FaceTarget(NPC, Spawn)
  36. if GetDeity(Spawn) ~= 1 then
  37. local choice = MakeRandomInt(1, 3)
  38. if HasQuest(Spawn, QUEST2) or HasCompletedQuest(Spawn, QUEST2) and not HasCompletedQuest(Spawn, QUEST3) or HasCompletedQuest(Spawn, QUEST4) or HasQuest(Spawn, QUEST4) then
  39. if choice == 1 then
  40. PlayFlavor(NPC, "", "Loyalty first!", "", 0, 0, Spawn)
  41. elseif choice == 2 then
  42. PlayFlavor(NPC, "", "Orcs, Undead... I'm more worried about what the Dervish Cutthroaths are up to.", "", 0, 0, Spawn)
  43. else
  44. PlayFlavor(NPC, "", "There is little to limit one's potential when they know how to exploit others...except others exploiting them, of course.", "", 0, 0, Spawn)
  45. end
  46. end
  47. if HasQuest(Spawn, CaptainFeralis) or HasCompletedQuest(Spawn, CaptainFeralis) and not HasQuest(Spawn, QUEST) then
  48. local conversation = CreateConversation()
  49. AddConversationOption(conversation, "I am "..GetName(Spawn)..". Rainus asked me to deliver these root samples to you.", "Option1")
  50. StartConversation(conversation, NPC, Spawn, "Yes?")
  51. elseif HasQuest(Spawn, QUEST) and GetQuestStep(Spawn, QUEST) <= 7 then
  52. QUEST_PROGRESS(NPC, Spawn)
  53. elseif HasQuest(Spawn, QUEST) and GetQuestStep(Spawn, QUEST) == 8 then
  54. QUEST_COMPLETE(NPC, Spawn)
  55. elseif HasCompletedQuest(Spawn, QUEST) and not HasQuest(Spawn, QUEST2) and not HasCompletedQuest(Spawn, QUEST2) then
  56. Option4(NPC, Spawn)
  57. elseif HasQuest(Spawn, QUEST3) or HasCompletedQuest(Spawn, QUEST3) and not HasQuest(Spawn, QUEST4) then
  58. Option6(NPC, Spawn)
  59. elseif HasQuest(Spawn, QUEST5) then
  60. QUEST5_COMPLETE(NPC, Spawn)
  61. elseif HasCompletedQuest(Spawn, QUEST5) then
  62. PlayFlavor(NPC, "", "Good work. The Overlord will hear of you.", "", 0, 0, Spawn)
  63. end
  64. elseif GetDeity(Spawn) == 1 or not HasQuest(Spawn, CaptainFeralis) and not HasCompletedQuest(Spawn, CaptainFeralis) then
  65. PlayFlavor(NPC, "", "I see no need to speak to you.", "", 0, 0, Spawn)
  66. end
  67. end
  68. function Option1(NPC, Spawn)
  69. FaceTarget(NPC, Spawn)
  70. local conversation = CreateConversation()
  71. if HasQuest(Spawn, CaptainFeralis) then
  72. SetStepComplete(Spawn, CaptainFeralis, 1)
  73. end
  74. AddConversationOption(conversation, "Rainus said you might have work to give me.", "Option2")
  75. AddConversationOption(conversation, "Uh, you're welcome.")
  76. StartConversation(conversation, NPC, Spawn, "Of course. Rainus mentioned you. Somehow I guessed you would be bigger. No matter. Thank you for acting courier, that will be all.")
  77. end
  78. function Option2(NPC, Spawn)
  79. FaceTarget(NPC, Spawn)
  80. local conversation = CreateConversation()
  81. AddConversationOption(conversation, "What is it?", "Option3")
  82. StartConversation(conversation, NPC, Spawn, "Oh... so that's your angle. I know your type. I got enough of you in the city before I was transferred out here. Still, I suppose you serve a purpose. Sure, I've got something you can do.")
  83. end
  84. function Option3(NPC, Spawn)
  85. FaceTarget(NPC, Spawn)
  86. local conversation = CreateConversation()
  87. AddConversationOption(conversation, "I understand.", "offer")
  88. StartConversation(conversation, NPC, Spawn, "Head down to that small ratonga and kerran community south west of here and collect their taxes. You'll need to collect from every house owner. Normally they place the money in their mailbox, on the front of their houses. Sometimes they forget... when that happens you remind them, understood?")
  89. end
  90. function Option4(NPC, Spawn)
  91. if GetQuestStep(Spawn, QUEST) == 8 then
  92. SetStepComplete(Spawn, QUEST, 8)
  93. end
  94. FaceTarget(NPC, Spawn)
  95. local conversation = CreateConversation()
  96. AddConversationOption(conversation, "Sure.", "Option5")
  97. AddConversationOption(conversation, "No thanks.")
  98. StartConversation(conversation, NPC, Spawn, "Nice work, here's your cut. While you were out another job came up, interested?")
  99. end
  100. function Option5(NPC, Spawn)
  101. FaceTarget(NPC, Spawn)
  102. local conversation = CreateConversation()
  103. AddConversationOption(conversation, "All right, I will go speak with him.", "offer2")
  104. StartConversation(conversation, NPC, Spawn, "Yeah, that's what I thought. Ventar T'Kal is a man of mine. You can find him north west of here, in the company of nomads. I need you to deliver these Bloodskull Frenzy Root samples to him. They've already been treated... so don't eat them.")
  105. end
  106. function Option6(NPC, Spawn)
  107. FaceTarget(NPC, Spawn)
  108. local conversation = CreateConversation()
  109. AddConversationOption(conversation, "Ventar didn't tell me you wanted to see me until just recently.", "Option7")
  110. StartConversation(conversation, NPC, Spawn, "Gee, were you stuck under a house or something?")
  111. end
  112. function Option7(NPC, Spawn)
  113. if GetQuestStep(Spawn, QUEST3) == 1 then
  114. SetStepComplete(Spawn, QUEST3, 1)
  115. end
  116. FaceTarget(NPC, Spawn)
  117. local conversation = CreateConversation()
  118. AddConversationOption(conversation, "I will go find her.", "offer3")
  119. StartConversation(conversation, NPC, Spawn, "I don't care about Ventar and I don't have time to be angry with you. Tecera Valnos has been working from the outpost south of the Ruins of Val'marr. Originally I had planned on her helping deal with the orcs, but as of late she has had her hands full. I need you to report to her and give her whatever assistance you can.")
  120. end
  121. function Option8(NPC, Spawn)
  122. SetStepComplete(Spawn, QUEST5, 1)
  123. FaceTarget(NPC, Spawn)
  124. local conversation = CreateConversation()
  125. AddConversationOption(conversation, "Thank you.")
  126. StartConversation(conversation, NPC, Spawn, "Better than you know. Please, take this, the city of Freeport thanks you.")
  127. end
  128. function offer(NPC, Spawn)
  129. FaceTarget(NPC, Spawn)
  130. OfferQuest(NPC, Spawn, QUEST)
  131. end
  132. function offer2(NPC, Spawn)
  133. FaceTarget(NPC, Spawn)
  134. OfferQuest(NPC, Spawn, QUEST2)
  135. end
  136. function offer3(NPC, Spawn)
  137. FaceTarget(NPC, Spawn)
  138. OfferQuest(NPC, Spawn, QUEST4)
  139. end
  140. function QUEST_PROGRESS(NPC, Spawn)
  141. FaceTarget(NPC, Spawn)
  142. local conversation = CreateConversation()
  143. AddConversationOption(conversation, "I'll be back.")
  144. StartConversation(conversation, NPC, Spawn, "Well?")
  145. end
  146. function QUEST_COMPLETE(NPC, Spawn)
  147. FaceTarget(NPC, Spawn)
  148. local conversation = CreateConversation()
  149. AddConversationOption(conversation, "Here's the money.", "Option4")
  150. StartConversation(conversation, NPC, Spawn, "Well?")
  151. end
  152. function QUEST5_COMPLETE(NPC, Spawn)
  153. FaceTarget(NPC, Spawn)
  154. local conversation = CreateConversation()
  155. AddConversationOption(conversation, "That is good to hear.", "Option2")
  156. StartConversation(conversation, NPC, Spawn, "Tecera sent word. I am very pleased with your work, "..GetName(Spawn)..". You've been a great asset, right when we needed it, too. The Overlord will be glad to hear it as well.")
  157. end
  158. function respawn(NPC)
  159. end