EntertainerFaeadaen.lua 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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 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. PlayFlavor(NPC, "", "", "ponder", 0,0 , Spawn)
  70. Dialog.AddOption( "Alright, I'll check at the inn. Thank you.", "BookUpdate")
  71. Dialog.Start()
  72. end
  73. function NeedHelp(NPC,Spawn)
  74. FaceTarget(NPC, Spawn)
  75. Dialog.New(NPC, Spawn)
  76. Dialog.AddDialog("Customers love my magic tricks! Actually, a little too much. Bulurg asked me to work late tonight. Could you ask Valean at the inn and let me know I can't dine with him tonight? I appreciate your help.")
  77. Dialog.AddVoiceover("voiceover/english/entertainer_faeadaen/qey_village04/entertainerfaeadaen000.mp3", 3630263809, 612433831)
  78. PlayFlavor(NPC, "", "", "agree", 0,0 , Spawn)
  79. Dialog.AddOption( "I will let Valean know that you can't make it.", "GiveQuest")
  80. Dialog.Start()
  81. end
  82. function NoDinner(NPC,Spawn)
  83. SetStepComplete(Spawn, Quest, 2)
  84. FaceTarget(NPC, Spawn)
  85. Dialog.New(NPC, Spawn)
  86. Dialog.AddDialog("Thank you for telling him. If you have a moment, step inside and try one of Bulurg's special brews.")
  87. Dialog.AddVoiceover("voiceover/english/entertainer_faeadaen/qey_village04/entertainerfaeadaen001.mp3", 1133009328, 1111624722)
  88. PlayFlavor(NPC, "", "", "curtsey", 0,0 , Spawn)
  89. Dialog.AddOption( "Yes, I think I'll try one of her drinks.")
  90. Dialog.Start()
  91. end
  92. function BookUpdate(NPC,Spawn)
  93. SetStepComplete(Spawn, Book, 1)
  94. end
  95. function ResetTimer(NPC,Spawn)
  96. Timer = false
  97. end
  98. function Perforamnce(NPC,Spawn)
  99. if Timer == false then
  100. Timer = true
  101. RemoveCoin(Spawn, 200)
  102. SendMessage(Spawn,"You give Entertainer Faeadaen 2 silver.")
  103. FaceTarget(NPC, Spawn)
  104. PlayFlavor(NPC, "", "With pleasure.", "nod", 0, 0, Spawn)
  105. AddTimer(NPC, 900, "Shine",1)
  106. AddTimer(NPC, 1100, "Flourish",1)
  107. AddTimer(NPC, 10000, "Shimmy",1)
  108. AddTimer(NPC, 12000,"Kiss",1)
  109. AddTimer(NPC, 15500,"Finale",1)
  110. AddTimer(NPC, 16000,"ResetTimer",1)
  111. end
  112. end
  113. function Flourish(NPC,Spawn)
  114. FaceTarget(NPC,Spawn)
  115. PlayFlavor(NPC, "", "", "flourish", 0, 0, Spawn)
  116. end
  117. function Finale(NPC,Spawn)
  118. PlayFlavor(NPC, "", "", "result_fireworks_flare_coins_burst", 0, 0, Spawn)
  119. end
  120. --function Glow(NPC,Spawn) --a bit much, but timing is right
  121. -- FaceTarget(NPC,Spawn)
  122. -- PlayFlavor(NPC, "", "", "result_sparkles_clinging_soft", 0, 0, Spawn)
  123. --end
  124. function Shimmy(NPC,Spawn)
  125. FaceTarget(NPC,Spawn)
  126. PlayFlavor(NPC, "", "", "shimmy", 0, 0, Spawn)
  127. end
  128. function Shine(NPC,Spawn)
  129. PlayFlavor(NPC, "", "", "result_coins_falling", 0, 0, Spawn)
  130. end
  131. function Kiss(NPC,Spawn)
  132. FaceTarget(NPC,Spawn)
  133. PlayFlavor(NPC, "", "", "kiss", 0, 0, Spawn)
  134. end
  135. function GiveQuest(NPC, Spawn)
  136. OfferQuest(NPC, Spawn, Quest)
  137. end