EntertainerFaeadaen.lua 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  9. local Quest = 238
  10. local Book = 5468
  11. local Timer = false
  12. function spawn(NPC)
  13. ProvidesQuest(NPC, Quest)
  14. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function InRange (NPC,Spawn)
  20. if GetFactionAmount(Spawn,11) <0 then
  21. FactionChecking(NPC, Spawn, faction)
  22. else
  23. if math.random(1, 100) <= 66 then
  24. local choice = math.random(1,4)
  25. if choice == 1 then
  26. 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)
  27. elseif choice == 2 then
  28. 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)
  29. elseif choice ==3 then
  30. PlayFlavor(NPC, "", "", "dance", 0, 0, Spawn)
  31. else
  32. 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)
  33. end
  34. end
  35. end
  36. end
  37. function hailed(NPC, Spawn)
  38. if GetFactionAmount(Spawn,11) <0 then
  39. FactionChecking(NPC, Spawn, faction)
  40. else
  41. local con = CreateConversation()
  42. if Timer == false then
  43. FaceTarget(NPC, Spawn)
  44. PlayFlavor(NPC, "voiceover/english/entertainer_faeadaen/qey_village04/entertainerfaeadaen.mp3", "", "orate", 2289708399, 1034577130, Spawn)
  45. AddConversationOption(con, "I would love a performance. [ 2 Silver ]", "Perforamnce")
  46. else
  47. PlayFlavor(NPC, "voiceover/english/entertainer_faeadaen/qey_village04/entertainerfaeadaen.mp3", "", "", 2289708399, 1034577130, Spawn)
  48. end
  49. if not HasQuest (Spawn, Quest) and not HasCompletedQuest (Spawn, Quest) then
  50. AddConversationOption(con, "You must be quite the entertainer. Need any help?", "NeedHelp")
  51. end
  52. if GetQuestStep(Spawn, Quest)==2 then
  53. AddConversationOption(con, "I told Valean you wouldn't be able to make it to dinner tonight.", "NoDinner")
  54. end
  55. if GetQuestStep(Spawn, Book)==1 then
  56. AddConversationOption(con, "Bleemeb tasked me with retrieving the book you borrowed.", "NoBook")
  57. end
  58. AddConversationOption(con, "I'll keep my coins, thank you.")
  59. StartConversation(con, NPC, Spawn, "Come closer and watch as I make lights dance and coins disapear into thin air! ")
  60. end
  61. end
  62. function NoBook(NPC,Spawn)
  63. FaceTarget(NPC, Spawn)
  64. PlayFlavor(NPC, "voiceover/english/entertainer_faeadaen/qey_village04/entertainerfaeadaen002.mp3", "", "ponder", 386324181, 1757469505, Spawn)
  65. local con = CreateConversation()
  66. AddConversationOption(con, "Alright, I'll check at the inn. Thank you.", "BookUpdate")
  67. StartConversation(con, NPC, Spawn, "The book on the great tree, Arbos? I'm afraid I left the book somewhere at the local inn. You'll have to search for it there.")
  68. end
  69. function NeedHelp(NPC,Spawn)
  70. FaceTarget(NPC, Spawn)
  71. PlayFlavor(NPC, "voiceover/english/entertainer_faeadaen/qey_village04/entertainerfaeadaen000.mp3", "", "agree", 3630263809, 612433831, Spawn)
  72. local con = CreateConversation()
  73. AddConversationOption(con, "I'll deliver the message for you.", "GiveQuest")
  74. AddConversationOption(con, "I'm busy. Sorry.")
  75. StartConversation(con, NPC, Spawn, "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.")
  76. end
  77. function NoDinner(NPC,Spawn)
  78. FaceTarget(NPC, Spawn)
  79. PlayFlavor(NPC, "voiceover/english/entertainer_faeadaen/qey_village04/entertainerfaeadaen001.mp3", "", "thank", 1133009328, 1111624722, Spawn)
  80. SetStepComplete(Spawn, Quest, 2)
  81. local con = CreateConversation()
  82. AddConversationOption(con, "I just might.")
  83. StartConversation(con, NPC, Spawn, "Thank you for telling him. If you have a moment, step inside and try one of Bulurg's special brews.")
  84. end
  85. function BookUpdate(NPC,Spawn)
  86. SetStepComplete(Spawn, Book, 1)
  87. end
  88. function ResetTimer(NPC,Spawn)
  89. Timer = false
  90. end
  91. function Perforamnce(NPC,Spawn)
  92. if Timer == false then
  93. Timer = true
  94. RemoveCoin(Spawn, 200)
  95. FaceTarget(NPC, Spawn)
  96. PlayFlavor(NPC, "", "With pleasure.", "nod", 0, 0, Spawn)
  97. AddTimer(NPC, 900, "Shine",1)
  98. AddTimer(NPC, 1100, "Flourish",1)
  99. AddTimer(NPC, 10000, "Shimmy",1)
  100. AddTimer(NPC, 12000,"Kiss",1)
  101. AddTimer(NPC, 15500,"Finale",1)
  102. AddTimer(NPC, 16000,"ResetTimer",1)
  103. end
  104. end
  105. function Flourish(NPC,Spawn)
  106. FaceTarget(NPC,Spawn)
  107. PlayFlavor(NPC, "", "", "flourish", 0, 0, Spawn)
  108. end
  109. function Finale(NPC,Spawn)
  110. PlayFlavor(NPC, "", "", "result_fireworks_flare_coins_burst", 0, 0, Spawn)
  111. end
  112. --function Glow(NPC,Spawn) --a bit much, but timing is right
  113. -- FaceTarget(NPC,Spawn)
  114. -- PlayFlavor(NPC, "", "", "result_sparkles_clinging_soft", 0, 0, Spawn)
  115. --end
  116. function Shimmy(NPC,Spawn)
  117. FaceTarget(NPC,Spawn)
  118. PlayFlavor(NPC, "", "", "shimmy", 0, 0, Spawn)
  119. end
  120. function Shine(NPC,Spawn)
  121. PlayFlavor(NPC, "", "", "result_coins_falling", 0, 0, Spawn)
  122. end
  123. function Kiss(NPC,Spawn)
  124. FaceTarget(NPC,Spawn)
  125. PlayFlavor(NPC, "", "", "kiss", 0, 0, Spawn)
  126. end
  127. function GiveQuest(NPC, Spawn)
  128. OfferQuest(NPC, Spawn, Quest)
  129. end
  130. function AcceptedQuest(NPC, Spawn)
  131. FaceTarget(NPC, Spawn)
  132. PlayFlavor(NPC, "", "", "thank", 0, 0, Spawn)
  133. local con = CreateConversation()
  134. AddConversationOption(con, "My pleasure.")
  135. StartConversation(con, NPC, Spawn, "Oh, thank you! I just can't break away to deliver it myself.")
  136. end