Hanif.lua 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/Hanif.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.02.20 07:02:00
  5. Script Purpose :
  6. :
  7. --]]
  8. local PlainOleDisease = 454
  9. function EmoteLoop (NPC)
  10. local choice = math.random(1,2)
  11. local timer = math.random(2500,3500)
  12. if choice == 1 then
  13. PlayAnimation(NPC, 12030)
  14. AddTimer(NPC, timer, "EmoteLoop")
  15. elseif choice == 2 then
  16. PlayAnimation(NPC, 13056)
  17. AddTimer(NPC, timer, "EmoteLoop")
  18. end
  19. end
  20. function spawn(NPC)
  21. ProvidesQuest(NPC, PlainOleDisease)
  22. EmoteLoop(NPC)
  23. end
  24. function hailed(NPC, Spawn)
  25. FaceTarget(NPC, Spawn)
  26. local choice = math.random(1, 3)
  27. if choice == 1 then
  28. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1052.mp3", "", "", 0, 0, Spawn)
  29. elseif choice == 2 then
  30. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1052.mp3", "", "", 0, 0, Spawn)
  31. else
  32. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1052.mp3", "", "", 0, 0, Spawn)
  33. end
  34. conversation = CreateConversation()
  35. if not HasQuest(Spawn, PlainOleDisease) and not HasCompletedQuest(Spawn, PlainOleDisease) then
  36. AddConversationOption(conversation, "I tend to care only for my misery.", "option1")
  37. AddConversationOption(conversation, "I do... for the right amount.", "option1")
  38. AddConversationOption(conversation, "I couldn't agree more!", "option2")
  39. AddConversationOption(conversation, "Never.")
  40. StartConversation(conversation, NPC, Spawn, "Those spared personal pain feel themselves called to assist the pain of others. We must all carry our share of the misery which lies upon the world. Wouldn't you agree?")
  41. elseif GetQuestStep(Spawn, PlainOleDisease) == 1 or GetQuestStep(Spawn, PlainOleDisease) == 2 or GetQuestStep(Spawn, PlainOleDisease) == 3 or GetQuestStep(Spawn, PlainOleDisease) == 5 or GetQuestStep(Spawn, PlainOleDisease) == 8 then
  42. AddConversationOption(conversation, "Oh, right. I'll be back.")
  43. StartConversation(conversation, NPC, Spawn, "I am glad that you are eager to assist me, but please do as I asked.")
  44. elseif GetQuestStep(Spawn, PlainOleDisease) == 4 then
  45. SetStepComplete(Spawn, PlainOleDisease, 4)
  46. AddConversationOption(conversation, "Which ones?", "dlg3")
  47. AddConversationOption(conversation, "Do I have to wait?", "dlg3")
  48. StartConversation(conversation, NPC, Spawn, "Just in time, mighty one! I shall mix these, and then they will need to be administered to two of the victims here.")
  49. elseif GetQuestStep(Spawn, PlainOleDisease) == 7 then
  50. SetStepComplete(Spawn, PlainOleDisease, 7)
  51. PlayAnimation(NPC, 121)
  52. AddConversationOption(conversation, "They spoke of visions when I gave them the medicine.", "dlg4")
  53. StartConversation(conversation, NPC, Spawn, "Delightful! You have once again, proven that each one of us can do a little to bring some portion of misery to an end.")
  54. elseif GetQuestStep(Spawn, PlainOleDisease) == 11 and HasItem(Spawn, 14012) and HasItem(Spawn, 11167) then
  55. RemoveItem(Spawn, 14012)
  56. RemoveItem(Spawn, 11167)
  57. AddConversationOption(conversation, "Ahem. My reward?", "dlg9")
  58. AddConversationOption(conversation, "I seem to recall you mentioning some ''crude rewards'' for my help.", "dlg9")
  59. AddConversationOption(conversation, "I am glad to have been able to help. It is so rewarding to me!", "dlg10")
  60. StartConversation(conversation, NPC, Spawn, "You're back! And with the scroll and flesh. This is delightful! I must get started in testing this, right away.")
  61. elseif HasCompletedQuest(Spawn, PlainOleDisease) then
  62. AddConversationOption(conversation, "Don't mention it.")
  63. StartConversation(conversation, NPC, Spawn, "Your help was invaluable to me. Thank you for your services, once again!")
  64. end
  65. end
  66. function option1(NPC, Spawn)
  67. FaceTarget(NPC, Spawn)
  68. conversation = CreateConversation()
  69. AddConversationOption(conversation, "So you are a healer of some sort?", "dlg1")
  70. AddConversationOption(conversation, "You have chosen to care for lepers?", "dlg1")
  71. StartConversation(conversation, NPC, Spawn, "That is a narrow outlook, but expected in this day. I myself, have felt a calling to tend to the suffering of these unfortunate souls.")
  72. end
  73. function option2(NPC, Spawn)
  74. FaceTarget(NPC, Spawn)
  75. conversation = CreateConversation()
  76. AddConversationOption(conversation, "So you are a healer of some sort?", "dlg1")
  77. AddConversationOption(conversation, "You have chosen to care for lepers?", "dlg1")
  78. StartConversation(conversation, NPC, Spawn, "I am glad to hear that! It is too often that citizens here hold a narrower outlook. I myself, have felt a calling to tend to the suffering of these unfortunate souls.")
  79. end
  80. function dlg1(NPC, Spawn)
  81. FaceTarget(NPC, Spawn)
  82. conversation = CreateConversation()
  83. AddConversationOption(conversation, "Is there a way I can help to ease their pain?", "dlg2")
  84. StartConversation(conversation, NPC, Spawn, "Indeed. I follow the doctrines of the ancient Springview Healers. A grand house of healers that felt themselves called to help attend to the pain of others.")
  85. PlayAnimation(NPC, 11882)
  86. end
  87. function dlg2(NPC, Spawn)
  88. FaceTarget(NPC, Spawn)
  89. conversation = CreateConversation()
  90. AddConversationOption(conversation, "I can do that. What do you need?", "offer")
  91. AddConversationOption(conversation, "I think I'll pass.")
  92. StartConversation(conversation, NPC, Spawn, "Get me some medicinal aids to alleviate some of their discomfort. The medicine can help alleviate the pain, as well as lengthen the patient's life.")
  93. end
  94. function dlg3(NPC, Spawn)
  95. FaceTarget(NPC, Spawn)
  96. conversation = CreateConversation()
  97. AddConversationOption(conversation, "Hmmph.")
  98. AddConversationOption(conversation, "Yeah, yeah. I get it.")
  99. StartConversation(conversation, NPC, Spawn, "There we go! Takes no time at all. Now give this to Durio Caepio and Galla Lentula, as I make further notes.")
  100. end
  101. function dlg4(NPC, Spawn)
  102. FaceTarget(NPC, Spawn)
  103. conversation = CreateConversation()
  104. AddConversationOption(conversation, "The fear in their eyes cannot be denied.", "dlg5")
  105. StartConversation(conversation, NPC, Spawn, "Do you give it more credence than just the ravings of dying and fevered souls?")
  106. end
  107. function dlg5(NPC, Spawn)
  108. FaceTarget(NPC, Spawn)
  109. PlayAnimation(NPC, 10745)
  110. conversation = CreateConversation()
  111. AddConversationOption(conversation, "This disease is something of a curse from another plane?", "dlg6")
  112. StartConversation(conversation, NPC, Spawn, "I admit that talk of such visions has reached my ears, too. I was quite skeptical that there was an unnatural connection with the affliction at first, but more tests and reported visions are convincing me otherwise. Perhaps it is connected with an ancient pox from the Plaguebringer.")
  113. end
  114. function dlg6(NPC, Spawn)
  115. FaceTarget(NPC, Spawn)
  116. PlayAnimation(NPC, 12030)
  117. conversation = CreateConversation()
  118. AddConversationOption(conversation, "Where will I find her?", "dlg8")
  119. AddConversationOption(conversation, "A person around here has such items?", "dlg7")
  120. StartConversation(conversation, NPC, Spawn, "That is something very worth my study! I need to run some tests to be sure. We need some solid information to go by, and some flesh or fluid of the long closed plane. Lucretias Domna should have what we require.")
  121. end
  122. function dlg7(NPC, Spawn)
  123. FaceTarget(NPC, Spawn)
  124. conversation = CreateConversation()
  125. AddConversationOption(conversation, "Where will I find her?", "dlg8")
  126. StartConversation(conversation, NPC, Spawn, "She is a member of the Dismal Rage sect that are very interested in the magic and influences of the Plane of Disease. If anyone should have such items for use, it will be her.")
  127. end
  128. function dlg8(NPC, Spawn)
  129. FaceTarget(NPC, Spawn)
  130. PlayFlavor(NPC, "hanif/commonlands/quests/springview_healer_hanif/healerhanif017.mp3", "", "", 1739849644, 856240092, Spawn)
  131. conversation = CreateConversation()
  132. AddConversationOption(conversation, "Understood.")
  133. StartConversation(conversation, NPC, Spawn, "Her interests in disease and undeath have taken her to studying the undead amongst The Commonlands graves near the Ulteran Spires. Take this note to her. Do hurry, as this may be an important breakthrough!")
  134. end
  135. function dlg9(NPC, Spawn)
  136. FaceTarget(NPC, Spawn)
  137. PlayAnimation(NPC, 13061)
  138. conversation = CreateConversation()
  139. AddConversationOption(conversation, "Thank you.", "complete")
  140. StartConversation(conversation, NPC, Spawn, "And you are so deserving of it. I am just so excited about this breakthrough. Forgive my one track mind. You have been an invaluable help to me! Such help is rather difficult to find these days. Here are the rewards you have earned.")
  141. end
  142. function dlg10(NPC, Spawn)
  143. FaceTarget(NPC, Spawn)
  144. conversation = CreateConversation()
  145. AddConversationOption(conversation, "Thank you.", "complete")
  146. StartConversation(conversation, NPC, Spawn, "A good deed is its own reward, but I can think of none more deserving of some physical rewards than you. You have been an invaluable help to me! Such help is rather difficult to find these days. Here are the rewards you have earned.")
  147. end
  148. function complete(NPC, Spawn)
  149. SetStepComplete(Spawn, PlainOleDisease, 11)
  150. end
  151. function offer(NPC, Spawn)
  152. FaceTarget(NPC, Spawn)
  153. OfferQuest(NPC, Spawn, PlainOleDisease)
  154. end
  155. function mushrooms(NPC, Spawn)
  156. FaceTarget(NPC, Spawn)
  157. conversation = CreateConversation()
  158. AddConversationOption(conversation, "Thank you.")
  159. StartConversation(conversation, NPC, Spawn, "The mushrooms tend to grow on the banks of dog trapper lake. The stone beetles and scourge rats have been seen congregating near Wasp Hill.")
  160. end
  161. function respawn(NPC)
  162. spawn(NPC)
  163. EmoteLoop(NPC)
  164. end