9
3

Ferink.lua 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/Ferink.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.05.21 09:05:53
  5. Script Purpose :
  6. :
  7. --]]
  8. local ARatDivided = 447
  9. local CantWeAllJustGetAlong = 448
  10. local TheLoverbirdsRoost = 449
  11. local AHardManToPlease = 450
  12. function spawn(NPC)
  13. SetPlayerProximityFunction(NPC, 10, "InRange")
  14. end
  15. function InRange(NPC, Spawn)
  16. if not HasQuest(Spawn, ARatDivided) and not HasCompletedQuest(Spawn, ARatDivided) then
  17. ProvidesQuest(NPC, ARatDivided)
  18. SetInfoFlag(NPC)
  19. SetVisualFlag(NPC)
  20. elseif HasCompletedQuest(Spawn, ARatDivided) then
  21. ProvidesQuest(NPC, CantWeAllJustGetAlong)
  22. SetInfoFlag(NPC)
  23. SetVisualFlag(NPC)
  24. elseif HasCompletedQuest(Spawn, CantWeAllJustGetAlong) then
  25. ProvidesQuest(NPC, TheLoverbirdsRoost)
  26. SetInfoFlag(NPC)
  27. SetVisualFlag(NPC)
  28. elseif HasCompletedQuest(Spawn, TheLoverbirdsRoost) then
  29. ProvidesQuest(NPC, AHardManToPlease)
  30. SetInfoFlag(NPC)
  31. SetVisualFlag(NPC)
  32. end
  33. end
  34. function hailed(NPC, Spawn)
  35. FaceTarget(NPC, Spawn)
  36. if not HasQuest(Spawn, ARatDivided) and not HasCompletedQuest(Spawn, ARatDivided) then
  37. local conversation = CreateConversation()
  38. AddConversationOption(conversation, "What's wrong, Ferink?", "Option1")
  39. AddConversationOption(conversation, "I must be going.")
  40. StartConversation(conversation, NPC, Spawn, "Oh whys oh whys can't we be together? Oh whys oh whys. My true love, the loves of my life is locked away on the other sides of the river and I can't be with her. Oh whys does it has to be this ways? It's not fair, not fair at all. Something must be done!")
  41. elseif GetQuestStep(Spawn, ARatDivided) == 1 or GetQuestStep(Spawn, CantWeAllJustGetAlong) == 1 or GetQuestStep(Spawn, CantWeAllJustGetAlong) == 2 or GetQuestStep(Spawn, TheLoverbirdsRoost) == 1 or GetQuestStep(Spawn, TheLoverbirdsRoost) == 2 or GetQuestStep(Spawn, AHardManToPlease) == 1 or GetQuestStep(Spawn, AHardManToPlease) == 2 then
  42. QuestProgress(NPC, Spawn)
  43. elseif HasCompletedQuest(Spawn, ARatDivided) and not HasQuest(Spawn, CantWeAllJustGetAlong ) and not HasCompletedQuest(Spawn, CantWeAllJustGetAlong) then
  44. Option5(NPC, Spawn)
  45. elseif GetQuestStep(Spawn, ARatDivided) == 2 or GetQuestStep(Spawn, CantWeAllJustGetAlong) == 3 or GetQuestStep(Spawn, TheLoverbirdsRoost) == 3 or GetQuestStep(Spawn, AHardManToPlease) == 3 then
  46. QuestFinish(NPC, Spawn)
  47. elseif HasCompletedQuest(Spawn, CantWeAllJustGetAlong) and not HasQuest(Spawn, TheLoverbirdsRoost) and not HasCompletedQuest(Spawn, TheLoverbirdsRoost) then
  48. Option10(NPC, Spawn)
  49. elseif HasCompletedQuest(Spawn,TheLoverbirdsRoost) and not HasQuest(Spawn, AHardManToPlease) and not HasCompletedQuest(Spawn, AHardManToPlease) then
  50. Option14(NPC, Spawn)
  51. elseif HasCompletedQuest(Spawn,TheLoverbirdsRoost) and HasCompletedQuest(Spawn, CantWeAllJustGetAlong) and HasCompletedQuest(Spawn, AHardManToPlease) and HasCompletedQuest(Spawn, ARatDivided) then
  52. PlayFlavor(NPC, "", "Hello again! Amoora and I are doing wonderful, thanks again.", "", 0, 0, Spawn)
  53. end
  54. end
  55. function Option1(NPC, Spawn)
  56. FaceTarget(NPC, Spawn)
  57. local conversation = CreateConversation()
  58. AddConversationOption(conversation, "You poor thing, what can I do to help?", "Option2")
  59. AddConversationOption(conversation, "A love struck ratonga... bye!")
  60. StartConversation(conversation, NPC, Spawn, "Amoora, my love. She is the love of my life, the shining beacon of my heart, my passion, my preciouses Amoora has my heart and holds it captive. I aches so when I can't be nears her, when I can't smell her sweet smelling fur.")
  61. end
  62. function Option2(NPC, Spawn)
  63. FaceTarget(NPC, Spawn)
  64. local conversation = CreateConversation()
  65. AddConversationOption(conversation, "Nice. Kinda stinky, but still nice.", "Option3")
  66. AddConversationOption(conversation, "I am not really in the mood for a sob story.")
  67. StartConversation(conversation, NPC, Spawn, "Oh, just because I'm a ratonga doesn't means I can't be with the loves of my life. No, it does not! This is just not right! I should go to her now! But I can't; her parents don't like me. I don't know why... I'm a nice person, right? Oh, my Amoora.")
  68. end
  69. function Option3(NPC, Spawn)
  70. FaceTarget(NPC, Spawn)
  71. local conversation = CreateConversation()
  72. AddConversationOption(conversation, "I'll go find her.", "offer")
  73. AddConversationOption(conversation, "Sorry, I'm not interested.")
  74. StartConversation(conversation, NPC, Spawn, "Go to her! Tell her I loves her! Tell her I'll give anything to be with her! Tell her... just tell her I loves her for me. My Amoora.")
  75. end
  76. function Option4(NPC, Spawn)
  77. SetStepComplete(Spawn, ARatDivided, 2)
  78. FaceTarget(NPC, Spawn)
  79. local conversation = CreateConversation()
  80. AddConversationOption(conversation, "Cheer up, Ferink.")
  81. StartConversation(conversation, NPC, Spawn, "She was? Oh my Amoora! I am lost without her.")
  82. end
  83. function Option5(NPC, Spawn)
  84. FaceTarget(NPC, Spawn)
  85. local conversation = CreateConversation()
  86. AddConversationOption(conversation, "Yes, I told you that I talked to her. Calm down, Ferink.", "Option6")
  87. AddConversationOption(conversation, "Yes I did, but I don't have time for this.")
  88. StartConversation(conversation, NPC, Spawn, "I must gets her back! Did you see her? Did you... did you tell her I loves her? Did you? Answer me! ")
  89. end
  90. function Option6(NPC, Spawn)
  91. FaceTarget(NPC, Spawn)
  92. local conversation = CreateConversation()
  93. AddConversationOption(conversation, "She is beautiful.", "Option7")
  94. AddConversationOption(conversation, "And the flowers too, good bye!")
  95. StartConversation(conversation, NPC, Spawn, "How was she? What did she say to you? You must tells me. You see why I loves her so... her voice, her beauty, even the day seems brighter when she's nearby. ")
  96. end
  97. function Option7(NPC, Spawn)
  98. FaceTarget(NPC, Spawn)
  99. local conversation = CreateConversation()
  100. AddConversationOption(conversation, "Yes, of course.", "Option8")
  101. AddConversationOption(conversation, "No I don't have time for this. Bye!")
  102. StartConversation(conversation, NPC, Spawn, "More beautiful than anyone! I has an idea... maybe if you talks to her father and my mother... If you talks to them they might agree to let us be together. Yes, will you do this for me? My Amoora!")
  103. end
  104. function Option8(NPC, Spawn)
  105. FaceTarget(NPC, Spawn)
  106. local conversation = CreateConversation()
  107. AddConversationOption(conversation, "Okay, I will give it a shot.", "offer2")
  108. StartConversation(conversation, NPC, Spawn, "Oh good... You will need to go to the ratongas and talks to my mother. You will needs to go to the kerra and talk to her father. Yes, you tells them we love each other and wants to spend our lives together for ever and always. You go tell them, all right?")
  109. end
  110. function Option9(NPC, Spawn)
  111. SetStepComplete(Spawn, CantWeAllJustGetAlong, 3)
  112. FaceTarget(NPC, Spawn)
  113. local conversation = CreateConversation()
  114. AddConversationOption(conversation, "Alright.")
  115. StartConversation(conversation, NPC, Spawn, "I know! It's awful! I haves to think of something.")
  116. end
  117. function Option10(NPC, Spawn)
  118. FaceTarget(NPC, Spawn)
  119. local conversation = CreateConversation()
  120. AddConversationOption(conversation, "What favor?", "Option11")
  121. AddConversationOption(conversation, "No, I don't have time.")
  122. StartConversation(conversation, NPC, Spawn, "Oh my heart aches, I needs my Amoora. Our parents are set in the old ways. It seems like there is nothing that will change their minds about us. Wait, I haves an idea! Will you do me a favor?")
  123. end
  124. function Option11(NPC, Spawn)
  125. FaceTarget(NPC, Spawn)
  126. local conversation = CreateConversation()
  127. AddConversationOption(conversation, "Where is he?", "Option12")
  128. AddConversationOption(conversation, "I can't right now... maybe later.")
  129. StartConversation(conversation, NPC, Spawn, "You go find my friend. My friend's name is Jojo. He'll knows what to do. He always knows what to do.")
  130. end
  131. function Option12(NPC, Spawn)
  132. FaceTarget(NPC, Spawn)
  133. local conversation = CreateConversation()
  134. AddConversationOption(conversation, "I can do that for you.", "offer3")
  135. AddConversationOption(conversation, "It's too far out of my way, sorry.")
  136. StartConversation(conversation, NPC, Spawn, "My friend Jojo Karanja rests in the Seafarer's Roost in the City of Freeport. Jojo is very smart. Yes, he knows what to do. He help Amoora and mes. He knows!")
  137. end
  138. function Option13(NPC, Spawn)
  139. SetStepComplete(Spawn, TheLoverbirdsRoost, 3)
  140. FaceTarget(NPC, Spawn)
  141. local conversation = CreateConversation()
  142. AddConversationOption(conversation, "He doesn't seem to like you much, that's for sure.")
  143. StartConversation(conversation, NPC, Spawn, "Wonderful! I knews you could do it. Now, if somehow we can convice Jaharin.")
  144. end
  145. function Option14(NPC, Spawn)
  146. FaceTarget(NPC, Spawn)
  147. local conversation = CreateConversation()
  148. AddConversationOption(conversation, "Defend her from what?", "Option15")
  149. AddConversationOption(conversation, "I can't right now.")
  150. StartConversation(conversation, NPC, Spawn, "Danger! There is much danger now. You came just in time to help me! She is in danger! You must helps me defend my Amoora.")
  151. end
  152. function Option15(NPC, Spawn)
  153. FaceTarget(NPC, Spawn)
  154. local conversation = CreateConversation()
  155. AddConversationOption(conversation, "What do you want me to do?", "Option16")
  156. AddConversationOption(conversation, "No, I have to go.")
  157. StartConversation(conversation, NPC, Spawn, "The orcses! They're coming to hurts my Amoora. Oh, I couldn't let anything happens to my Amoora, my love, the passions of my life. No I would just die inside if anything were to happens to my Amoora. You will help me, yes?")
  158. end
  159. function Option16(NPC, Spawn)
  160. FaceTarget(NPC, Spawn)
  161. local conversation = CreateConversation()
  162. AddConversationOption(conversation, "Okay.", "offer4")
  163. AddConversationOption(conversation, "No, Good luck.")
  164. StartConversation(conversation, NPC, Spawn, "When the orcses come, you fight them away. The orcses are coming to hurts Amoora and her family! We must not let them! We keep the orcses away!")
  165. end
  166. function Option17(NPC, Spawn)
  167. SetStepComplete(Spawn, AHardManToPlease, 3)
  168. FaceTarget(NPC, Spawn)
  169. local conversation = CreateConversation()
  170. AddConversationOption(conversation, "You are welcome, Ferink.")
  171. StartConversation(conversation, NPC, Spawn, "Well, I was right behind you... I was about to charge into the battle, but then I thoughts of Amoora and how upset she would be if I got hurt... Anyways, you were amazing! Thank you so much! Now I can be with my Amoora again! Here, takes this as a small token of my appreciation.")
  172. end
  173. function QuestProgress(NPC, Spawn)
  174. FaceTarget(NPC, Spawn)
  175. local conversation = CreateConversation()
  176. AddConversationOption(conversation, "I'll leave you alone.")
  177. StartConversation(conversation, NPC, Spawn, "Oh, my Amoora, I misses you so... I wish I could be at her sides. Her beautiful smile, her sweet purr... To be able to holds her hand again.")
  178. end
  179. function QuestFinish(NPC, Spawn)
  180. FaceTarget(NPC, Spawn)
  181. local conversation = CreateConversation()
  182. if GetQuestStep(Spawn, ARatDivided) == 2 then
  183. AddConversationOption(conversation, "I spoke to Amoora, Ferink. She seems as upset as you are over this whole thing.", "Option4")
  184. elseif GetQuestStep(Spawn, CantWeAllJustGetAlong) == 3 then
  185. AddConversationOption(conversation, "I spoke with Riki and Jaharin. I'm afraid they are not very happy about you and Amoora.", "Option9")
  186. elseif GetQuestStep(Spawn, TheLoverbirdsRoost) == 3 then
  187. AddConversationOption(conversation, "Great news, Ferink! You were right. Jojo helped me convince Riki to give Amoora a chance.", "Option13")
  188. elseif GetQuestStep(Spawn, AHardManToPlease) == 3 then
  189. AddConversationOption(conversation, "We did it, Ferink! Jaharin is not only going to give you a chance; he wants you to come to dinner with his family tonight. By the way, where were you during the fight?", "Option17")
  190. end
  191. AddConversationOption(conversation, "I'm a little tired of you sobbing all the time.")
  192. StartConversation(conversation, NPC, Spawn, "Sob!... Sniffle! ...")
  193. end
  194. function offer(NPC, Spawn)
  195. OfferQuest(NPC, Spawn, ARatDivided)
  196. end
  197. function offer2(NPC, Spawn)
  198. OfferQuest(NPC, Spawn, CantWeAllJustGetAlong)
  199. end
  200. function offer3(NPC, Spawn)
  201. OfferQuest(NPC, Spawn, TheLoverbirdsRoost)
  202. end
  203. function offer4(NPC, Spawn)
  204. OfferQuest(NPC, Spawn, AHardManToPlease)
  205. end
  206. function respawn(NPC)
  207. spawn(NPC)
  208. end