9
3

YanariCyellann.lua 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. --[[
  2. Script Name : SpawnScripts/Castleview/YanariCyellann.lua
  3. Script Purpose : Yanari Cyellann
  4. Script Author : Dorbin
  5. Script Date : 2022.01.28
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  10. local Badgers = 5465
  11. local Slime = 5466
  12. local Mage1 = 5767
  13. function spawn(NPC)
  14. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  15. ProvidesQuest(NPC, Badgers)
  16. ProvidesQuest(NPC, Slime)
  17. SetInfoStructString(NPC, "action_state", "alchemy_idle")
  18. end
  19. function respawn(NPC)
  20. spawn(NPC)
  21. end
  22. function InRange(NPC, Spawn) --Quest Callout
  23. if GetFactionAmount(Spawn,11) <0 then
  24. PlayFlavor(NPC, "voiceover/english/yanari_cyellann/qey_village04/100_researcher_yanari_multhail1_ba125732.mp3", "I'm very busy and don't want you getting hurt. Please leave me to my work.", "shakefist", 2153034813, 3927600348, Spawn)
  25. else
  26. if math.random(1, 100) <= 70 then
  27. if not HasCompletedQuest (Spawn, Badgers) and not HasCompletedQuest (Spawn, Slime) then
  28. choice = math.random(1,3)
  29. FaceTarget(NPC, Spawn)
  30. if choice ==1 then
  31. PlayFlavor(NPC, "voiceover/english/yanari_cyellann/qey_village04/100_researcher_yanari_multhail1_ba125732.mp3", "I'm very busy and don't want you getting hurt. Please leave me to my work.", "no", 2153034813, 3927600348, Spawn)
  32. elseif choice ==2 then
  33. PlayFlavor(NPC, "voiceover/english/yanari_cyellann/qey_village04/100_researcher_yanari_callout2_3cf87337.mp3", "Let's see... Two vials of gunk extract mixed with... Oh, dear! I'm out of extract! You, adventurer, interested in making some coin?", "confused", 812719323, 2645014610, Spawn)
  34. else
  35. PlayFlavor(NPC, "voiceover/english/yanari_cyellann/qey_village04/100_researcher_yanari_callout1_306f718b.mp3", "Hmmm... All out of badger claws. This will never do!", "ponder", 1224876034, 2351112322, Spawn)
  36. end
  37. end
  38. elseif HasCompletedQuest (Spawn, Badgers) and HasCompletedQuest (Spawn, Slime) then
  39. choice = math.random(1,3)
  40. if choice ==1 then
  41. FaceTarget(NPC, Spawn)
  42. PlayFlavor(NPC, "voiceover/english/yanari_cyellann/qey_village04/100_researcher_yanari_multhail1_ba125732.mp3", "I'm very busy and don't want you getting hurt. Please leave me to my work.", "no", 2153034813, 3927600348, Spawn)
  43. elseif choice ==2 then
  44. FaceTarget(NPC, Spawn)
  45. PlayFlavor(NPC, "voiceover/english/yanari_cyellann/qey_village04/100_researcher_yanari_multhail5_d4faf799.mp3", "Don't touch anything! You could turn yourself into a goo or destroy the entire building! I'm very busy and don't want you getting hurt. On your way, now!", "frustrated", 3857840792, 1030063822, Spawn)
  46. else
  47. PlayFlavor(NPC, "", "", "ponder", 0, 0, Spawn)
  48. end
  49. end
  50. end
  51. end
  52. function hailed(NPC, Spawn)
  53. if GetFactionAmount(Spawn,11) <0 then
  54. FaceTarget(NPC, Spawn)
  55. FactionChecking(NPC, Spawn, faction)
  56. else
  57. FaceTarget(NPC, Spawn)
  58. Dialog.New(NPC, Spawn)
  59. Dialog.AddDialog("Do not touch anything! You could turn yourself into a goo or destroy the entire building. What do you need?")
  60. Dialog.AddVoiceover("voiceover/english/yanari_cyellann/qey_village04/yanaricyellan.mp3", 3613336528, 1736617695)
  61. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  62. if not HasQuest(Spawn, Badgers) and not HasCompletedQuest (Spawn, Badgers) then
  63. Dialog.AddOption("Don't worry, I'm not going to touch anything. I'm just interested in your work.", "BadgerStart")
  64. end
  65. if not HasQuest(Spawn, Slime) and not HasCompletedQuest (Spawn, Slime) then
  66. Dialog.AddOption("I do not care to be a goo.", "SlimeStart")
  67. end
  68. if GetQuestStep(Spawn, Badgers)==2 then
  69. Dialog.AddOption("I brought the claws that you asked for.", "DoneBadger")
  70. end
  71. if GetQuestStep(Spawn, Slime)==2 then
  72. Dialog.AddOption("I have collected your substance extract.", "DoneSlime")
  73. end
  74. if HasQuest(Spawn,Mage1) and GetQuestStepProgress(Spawn,Mage1,3) == 0 then
  75. Dialog.AddOption("The Magister suggested I asked you about what you use your sorcery for.", "MageTraining1")
  76. end
  77. Dialog.AddOption("You seem to be a bit busy at the moment. I'll leave you alone.")
  78. Dialog.Start()
  79. end
  80. end
  81. function BadgerStart(NPC, Spawn)
  82. FaceTarget(NPC, Spawn)
  83. Dialog.New(NPC, Spawn)
  84. Dialog.AddDialog("Interested, are you? Well, I am trying to make my spells and items more potent. Unfortunately I ran out of volatility components. Would you do me a favor and collect some vicious badger claws?")
  85. Dialog.AddVoiceover("voiceover/english/yanari_cyellann/qey_village04/yanaricyellan000.mp3",913747199,2909702718)
  86. PlayFlavor(NPC, "", "", "sniff", 0,0 , Spawn)
  87. Dialog.AddOption("I can do that for you. A few badgers shouldn`t be a problem for me.", "BadgerStarting")
  88. Dialog.AddOption("I wouldn't even touch a regular badger, let alone a vicious one!")
  89. Dialog.Start()
  90. end
  91. function DoneBadger(NPC, Spawn)
  92. FaceTarget(NPC, Spawn)
  93. Dialog.New(NPC, Spawn)
  94. Dialog.AddDialog("Marvelous! I shall use one of the claws to imbue a wand for you. Um ... just take a few steps back, safety and all.")
  95. Dialog.AddVoiceover("voiceover/english/yanari_cyellann/qey_village04/yanaricyellan002.mp3",3385634498, 2633500192)
  96. PlayFlavor(NPC, "", "", "happy", 0,0 , Spawn)
  97. Dialog.AddOption("I'll just be under this very thick table.","BadgerFinish")
  98. Dialog.Start()
  99. end
  100. function BadgerFinish(NPC, Spawn)
  101. SetStepComplete(Spawn, Badgers, 2)
  102. FaceTarget(NPC, Spawn)
  103. Dialog.New(NPC, Spawn)
  104. Dialog.AddDialog("It worked! I mean ... here is a wand for you. Use it well.")
  105. Dialog.AddVoiceover("voiceover/english/yanari_cyellann/qey_village04/yanaricyellan003.mp3", 3490869984, 2394433819)
  106. PlayFlavor(NPC, "", "", "boggle", 0,0 , Spawn)
  107. Dialog.AddOption("I plan to be very careful with it.")
  108. Dialog.AddOption("...I could have been blown up! Thanks, but I'm getting out of here.")
  109. Dialog.Start()
  110. end
  111. function SlimeStart(NPC, Spawn)
  112. FaceTarget(NPC, Spawn)
  113. Dialog.New(NPC, Spawn)
  114. Dialog.AddDialog("Then keep your hands away from my experiments! Since you've wasted my precious time with your incessant babbling, I believe you owe me a bit of your own time. I need your help with a task.")
  115. Dialog.AddVoiceover("voiceover/english/yanari_cyellann/qey_village04/yanaricyellan004.mp3", 2138601896,740497069)
  116. PlayFlavor(NPC, "", "", "no", 0,0 , Spawn)
  117. Dialog.AddOption("I can do your task.", "QuestBegin2")
  118. Dialog.AddOption("...I must be going!")
  119. Dialog.Start()
  120. end
  121. function DoneSlime(NPC, Spawn)
  122. FaceTarget(NPC, Spawn)
  123. Dialog.New(NPC, Spawn)
  124. Dialog.AddDialog("Its about time! I almost sent Bleemeb up to go get my extract. I thought the gunks made a meal out of you. Take this pay for your task and leave me with my research.")
  125. Dialog.AddVoiceover("voiceover/english/yanari_cyellann/qey_village04/yanaricyellan006.mp3", 3747403661,785681662)
  126. PlayFlavor(NPC, "", "", "tapfoot", 0,0 , Spawn)
  127. Dialog.AddOption("Have fun with that gunk.", "RewardSlime")
  128. Dialog.AddOption("Yeesh, okay. I'm going now.", "RewardSlime")
  129. Dialog.Start()
  130. end
  131. function BadgerStarting (NPC, Spawn)
  132. FaceTarget(NPC, Spawn)
  133. OfferQuest(NPC, Spawn, Badgers)
  134. end
  135. function QuestBegin2 (NPC, Spawn)
  136. FaceTarget(NPC, Spawn)
  137. OfferQuest(NPC, Spawn, Slime)
  138. end
  139. function RewardSlime(NPC, Spawn)
  140. SetStepComplete(Spawn, Slime, 2)
  141. end
  142. --[[ CLASS Quest material
  143. PlayFlavor(NPC, "voiceover/english/yanari_cyellann/qey_village04/yanaricyellan007.mp3", "If Niksel sent you to me, then that's another story. I have done well by his teachings. What do you want to know about sorcery?", "ponder", 1398879355, 1149892616, Spawn)
  144. PlayFlavor(NPC, "voiceover/english/yanari_cyellann/qey_village04/yanaricyellan008.mp3", "I draw from unstable ether and turn it into different types of fire. Igniting a brazier with a simple incantation is easier than rubbing two sticks together.", "ponder", 3056968266, 3365736320, Spawn)
  145. PlayFlavor(NPC, "voiceover/english/yanari_cyellann/qey_village04/yanaricyellan009.mp3", "Oh, of course ... Back in the day, I was quite the Fire Magi ... firestorms here, explosions there, that kind of thing. I retired from the battlefield before it was too late. You know what they say about playing with fire and all. I hope this helps you.", "ponder", 1034698890, 3446841302, Spawn)
  146. ]]--
  147. function MageTraining1(NPC, Spawn)
  148. FaceTarget(NPC, Spawn)
  149. Dialog.New(NPC, Spawn)
  150. Dialog.AddDialog("If Niksel sent you to me, then that's another story. I have done well by his teachings. What do you want to know about sorcery?")
  151. Dialog.AddVoiceover("voiceover/english/yanari_cyellann/qey_village04/yanaricyellan007.mp3", 1398879355, 1149892616)
  152. PlayFlavor(NPC, "", "", "ponder", 0,0 , Spawn)
  153. Dialog.AddOption("How do you use the elements in your magic?", "MageTraining1a")
  154. Dialog.Start()
  155. end
  156. function MageTraining1a(NPC, Spawn)
  157. FaceTarget(NPC, Spawn)
  158. Dialog.New(NPC, Spawn)
  159. Dialog.AddDialog("I draw from unstable ether and turn it into different types of fire. Igniting a brazier with a simple incantation is easier than rubbing two sticks together.")
  160. Dialog.AddVoiceover("voiceover/english/yanari_cyellann/qey_village04/yanaricyellan008.mp3", 3056968266, 3365736320)
  161. CastSpell(NPC,19)
  162. Dialog.AddOption("No doubt you've used your magic for other purposes outside of your laboratory?", "MageTraining1b")
  163. Dialog.Start()
  164. end
  165. function MageTraining1b(NPC, Spawn)
  166. SetStepComplete(Spawn,Mage1,3)
  167. FaceTarget(NPC, Spawn)
  168. Dialog.New(NPC, Spawn)
  169. Dialog.AddDialog("Oh, of course ... Back in the day, I was quite the Fire Magi ... firestorms here, explosions there, that kind of thing. I retired from the battlefield before it was too late. You know what they say about playing with fire and all. I hope this helps you.")
  170. Dialog.AddVoiceover("voiceover/english/yanari_cyellann/qey_village04/yanaricyellan009.mp3", 1034698890, 3446841302)
  171. PlayFlavor(NPC, "", "", "ponder", 0,0 , Spawn)
  172. Dialog.AddOption("Thank you. It was most helpful.")
  173. Dialog.Start()
  174. end