EntertainerFaeadaen.lua 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. --[[
  2. Script Name : SpawnScripts/Castleview/EntertainerFaeadaen.lua
  3. Script Purpose : Entertainer Faeadaen
  4. Script Author : Dorbin
  5. Script Date : 2022.01.20
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  10. local Quest = 238
  11. local Book = 5468
  12. local Timer = false
  13. function spawn(NPC)
  14. ProvidesQuest(NPC, Quest)
  15. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  16. end
  17. function respawn(NPC)
  18. spawn(NPC)
  19. end
  20. function InRange (NPC,Spawn)
  21. if GetFactionAmount(Spawn,11) <0 then
  22. FactionChecking(NPC, Spawn, faction)
  23. else
  24. if math.random(1, 100) <= 66 then
  25. local choice = math.random(1,4)
  26. if choice == 1 then
  27. PlayFlavor(NPC, "voiceover/english/entertainer_faeadaen/qey_village04/100_entertainer_faeadaen_callout_7bbafc74.mp3", "Don't let your eyes wander or you'll miss the magic! Come closer, traveler. You must see to believe.", "shimmy", 250974815, 3465292886, Spawn)
  28. elseif choice == 2 then
  29. PlayFlavor(NPC, "voiceover/english/entertainer_faeadaen/qey_village04/100_entertainer_faeadaen_multhail1_4c72e751.mp3", "Please, come back for my next show - I've no room for more onlookers. Why don't you belly up to the bar and try one of Bulurg's brews?", "no", 3560057212, 3299104389, Spawn)
  30. elseif choice ==3 then
  31. PlayFlavor(NPC, "", "", "dance", 0, 0, Spawn)
  32. else
  33. PlayFlavor(NPC, "voiceover/english/entertainer_faeadaen/qey_village04/100_entertainer_faeadaen_multhail2_2d3351bb.mp3", "Step up and watch as I make lights dance and coins disappear into thin air!", "", 3189499038, 1784304503, Spawn)
  34. end
  35. end
  36. end
  37. end
  38. function hailed(NPC, Spawn)
  39. if GetFactionAmount(Spawn,11) <0 then
  40. FactionChecking(NPC, Spawn, faction)
  41. else
  42. FaceTarget(NPC, Spawn)
  43. Dialog.New(NPC, Spawn)
  44. Dialog.AddDialog("Come closer and watch as I make lights dance and coins disapear into thin air!")
  45. Dialog.AddVoiceover("voiceover/english/entertainer_faeadaen/qey_village04/entertainerfaeadaen.mp3", 2289708399, 1034577130)
  46. if Timer == false and HasCoin(Spawn,200) then
  47. PlayFlavor(NPC, "", "", "orate",0,0, Spawn)
  48. Dialog.AddOption("I would love a performance. [ 2 Silver ]", "Perforamnce")
  49. else
  50. end
  51. if not HasQuest (Spawn, Quest) and not HasCompletedQuest (Spawn, Quest) then
  52. Dialog.AddOption("That's a pretty good trick. Does it work to attract customers?", "GiveQuest")
  53. end
  54. if GetQuestStep(Spawn, Quest)==2 then
  55. Dialog.AddOption("I let Valean know you won't be able to make it. He took it well.", "NoDinner")
  56. end
  57. if GetQuestStep(Spawn, Book)==1 then
  58. Dialog.AddOption("I was sent to get the Book of Arbos.", "NoBook")
  59. end
  60. Dialog.AddOption("I hope the drinks inside are as good as the entertainment.")
  61. Dialog.Start()
  62. end
  63. end
  64. function NoBook(NPC,Spawn)
  65. FaceTarget(NPC, Spawn)
  66. Dialog.New(NPC, Spawn)
  67. Dialog.AddDialog("The book on the great tree Arbos? I am afraid I left the book somewhere in the local inn. You will have to search for it there.")
  68. Dialog.AddVoiceover("voiceover/english/entertainer_faeadaen/qey_village04/entertainerfaeadaen002.mp3", 386324181, 1757469505)
  69. if Timer == false then
  70. PlayFlavor(NPC, "", "", "ponder", 0,0 , Spawn)
  71. end
  72. Dialog.AddOption( "Alright, I'll check at the inn. Thank you.", "BookUpdate")
  73. Dialog.Start()
  74. end
  75. function NeedHelp(NPC,Spawn)
  76. FaceTarget(NPC, Spawn)
  77. Dialog.New(NPC, Spawn)
  78. Dialog.AddDialog("Customers love my magic tricks...actually, a little too much...Bulurg asked me to work late tonight. Could you find Valean at the inn and let him know I can't dine with him tonight? I appreciate your help!")
  79. Dialog.AddVoiceover("voiceover/english/entertainer_faeadaen/qey_village04/entertainerfaeadaen000.mp3", 3630263809, 612433831)
  80. if Timer == false then
  81. PlayFlavor(NPC, "", "", "agree", 0,0 , Spawn)
  82. end
  83. Dialog.AddOption( "I will let Valean know that you can't make it.", "GiveQuest")
  84. Dialog.Start()
  85. end
  86. function NoDinner(NPC,Spawn)
  87. SetStepComplete(Spawn, Quest, 2)
  88. FaceTarget(NPC, Spawn)
  89. Dialog.New(NPC, Spawn)
  90. Dialog.AddDialog("Thank you for telling him. If you can spare a moment, please step inside and try one of Bulurg's special brews.")
  91. Dialog.AddVoiceover("voiceover/english/entertainer_faeadaen/qey_village04/entertainerfaeadaen001.mp3", 1133009328, 1111624722)
  92. if Timer == false then
  93. PlayFlavor(NPC, "", "", "curtsey", 0,0 , Spawn)
  94. end
  95. Dialog.AddOption( "Yes, I think I'll try one of her drinks.")
  96. Dialog.Start()
  97. end
  98. function BookUpdate(NPC,Spawn)
  99. SetStepComplete(Spawn, Book, 1)
  100. end
  101. function ResetTimer(NPC,Spawn)
  102. Timer = false
  103. end
  104. function Perforamnce(NPC,Spawn)
  105. if Timer == false then
  106. Timer = true
  107. RemoveCoin(Spawn, 200)
  108. SendMessage(Spawn,"You give Entertainer Faeadaen 2 silver.")
  109. FaceTarget(NPC, Spawn)
  110. PlayFlavor(NPC, "", "With pleasure.", "nod", 0, 0, Spawn)
  111. AddTimer(NPC, 900, "Shine",1)
  112. AddTimer(NPC, 1100, "Flourish",1)
  113. AddTimer(NPC, 4000, "Glow",1)
  114. AddTimer(NPC, 10000, "Shimmy",1)
  115. AddTimer(NPC, 12000,"Kiss",1)
  116. AddTimer(NPC, 15500,"Finale",1)
  117. AddTimer(NPC, 16000,"ResetTimer",1)
  118. end
  119. end
  120. function Shine(NPC,Spawn)
  121. PlayFlavor(NPC, "", "", "result_coins_falling", 0, 0, Spawn)
  122. end
  123. function Flourish(NPC,Spawn)
  124. FaceTarget(NPC,Spawn)
  125. PlayFlavor(NPC, "", "", "flourish", 0, 0, Spawn)
  126. end
  127. function Glow(NPC,Spawn)
  128. SpawnSet(NPC,"visual_state",1800)
  129. end
  130. function Shimmy(NPC,Spawn)
  131. FaceTarget(NPC,Spawn)
  132. PlayFlavor(NPC, "", "", "shimmy", 0, 0, Spawn)
  133. end
  134. function Kiss(NPC,Spawn)
  135. FaceTarget(NPC,Spawn)
  136. PlayFlavor(NPC, "", "", "kiss", 0, 0, Spawn)
  137. end
  138. function Finale(NPC,Spawn)
  139. PlayFlavor(NPC, "", "", "result_fireworks_flare_coins_burst", 0, 0, Spawn)
  140. SpawnSet(NPC,"visual_state",0)
  141. end
  142. function GiveQuest(NPC, Spawn)
  143. OfferQuest(NPC, Spawn, Quest)
  144. end