9
3

KualdinSwoonsong.lua 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. --[[
  2. Script Name : SpawnScripts/Baubbleshire/GanlaDindlenod.lua
  3. Script Purpose : Kualdin Swoonsong
  4. Script Author : Dorbin
  5. Script Date : 2022.02.13
  6. Script Notes :
  7. --]]
  8. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  9. require "SpawnScripts/Generic/DialogModule"
  10. local Delivery = 5471
  11. function spawn(NPC)
  12. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  13. ProvidesQuest(NPC, Delivery)
  14. SetTempVariable(NPC, "CalloutTimer", "false")
  15. SetTempVariable(NPC, "CalloutTimer1", "false")
  16. SetTempVariable(NPC, "CalloutTimer2", "false")
  17. end
  18. function InRange(NPC, Spawn) --Quest Callout
  19. if GetFactionAmount(Spawn,11)<0 then
  20. FactionChecking(NPC, Spawn, faction)
  21. else
  22. if CanReceiveQuest (Spawn, Delivery) then
  23. if GetTempVariable(NPC, "CalloutTimer")== "false"then
  24. SetTempVariable(NPC, "CalloutTimer", "true")
  25. AddTimer(NPC,10000,"ResetTimer",1,Spawn)
  26. FaceTarget(NPC, Spawn)
  27. if GetTempVariable(NPC, "CalloutTimer1")== "false"then
  28. PlayFlavor(NPC, "voiceover/english/kualdin_swoonsong/qey_village05/100_kualdin_swoonsong_callout_47db249c.mp3", "Gather around people ... gather around. I'll be warming up my voice in a few minutes.", "orate", 1269733907, 434806140, Spawn)
  29. SetTempVariable(NPC, "CalloutTimer1", "true")
  30. elseif GetTempVariable(NPC, "CalloutTimer2")== "false"then
  31. PlayFlavor(NPC, "voiceover/english/kualdin_swoonsong/qey_village05/100_kualdin_swoonsong_multhail2_1c41a7b8.mp3", "Hail, fair adventurer. If you can spare some time, my devotees are gathering to hear the latest masterpiece by yours truely.", "royalwave", 2123310145, 515687997, Spawn)
  32. SetTempVariable(NPC, "CalloutTimer2", "true")
  33. else
  34. SetTempVariable(NPC, "CalloutTimer1", "false")
  35. SetTempVariable(NPC, "CalloutTimer2", "false")
  36. PlayFlavor(NPC, "voiceover/english/kualdin_swoonsong/qey_village05/100_kualdin_swoonsong_multhail1_7f060d18.mp3", "Hail fair, adventurer. Please be on your way. I've no time for chatting with commoners. I must warm up my voice. My fans await me...", "smirk", 2685665398, 3421389957, Spawn)
  37. end
  38. end
  39. else
  40. if MakeRandomInt(1, 100) <= 50 then
  41. choice = MakeRandomInt(1,2)
  42. FaceTarget(NPC, Spawn)
  43. if choice ==1 then
  44. PlayFlavor(NPC, "", "", "royalwave", 0, 0, Spawn)
  45. else
  46. PlayFlavor(NPC, "", "", "smirk", 0, 0, Spawn)
  47. end
  48. end
  49. end
  50. end
  51. end
  52. function ResetTimer(NPC) -- 7 SECOND PAUSE BETWEEN VOs
  53. SetTempVariable(NPC, "CalloutTimer", "false")
  54. end
  55. function respawn(NPC)
  56. spawn(NPC)
  57. end
  58. function hailed(NPC, Spawn)
  59. if GetFactionAmount(Spawn,11)<0 then
  60. FaceTarget(NPC, Spawn)
  61. FactionChecking(NPC, Spawn, faction)
  62. else
  63. if not HasQuest(Spawn, Delivery) and not HasCompletedQuest(Spawn, Delivery) then
  64. Dialog1(NPC,Spawn)
  65. elseif HasQuest(Spawn, Delivery) and not HasCompletedQuest(Spawn, Delivery) then
  66. Dialog2(NPC,Spawn)
  67. else
  68. PlayFlavor(NPC, "voiceover/english/kualdin_swoonsong/qey_village05/100_kualdin_swoonsong_callout_47db249c.mp3", "Gather around people ... gather around. I'll be warming up my voice in a few minutes.", "smirk", 1269733907, 434806140, Spawn)
  69. end
  70. end
  71. end
  72. function Dialog1(NPC, Spawn)
  73. FaceTarget(NPC, Spawn)
  74. Dialog.New(NPC, Spawn)
  75. Dialog.AddDialog("Hail to you, fair adventurer. If you want to wait around a bit, my devotees will be gathering soon to hear my latest masterpiece sung by yours truly.")
  76. Dialog.AddVoiceover("voiceover/english/kualdin_swoonsong/qey_village05/kualdinswoonsong000.mp3", 4042301311, 2032672217)
  77. PlayFlavor(NPC, "", "", "royalwave", 0, 0, Spawn)
  78. Dialog.AddOption("Are you preparing for a concert?", "Book")
  79. Dialog.AddOption("Not right now.")
  80. Dialog.Start()
  81. end
  82. function Dialog2(NPC, Spawn)
  83. FaceTarget(NPC, Spawn)
  84. conversation = CreateConversation()
  85. PlayFlavor(NPC,"voiceover/english/voice_emotes/greetings/greetings_3_1008.mp3","","nod",0,0,Spawn)
  86. if GetQuestStep (Spawn, Delivery) == 2 then
  87. AddConversationOption(conversation, "Bupipa agreed to join you as long as she can have her own solo performance.", "Delivered")
  88. end
  89. AddConversationOption(conversation, "I'm still heading that way.")
  90. StartConversation(conversation, NPC, Spawn, "Did you find Bupipa! You must find her! She'll be elated to sing at my concert.")
  91. end
  92. function Book(NPC, Spawn)
  93. FaceTarget(NPC, Spawn)
  94. Dialog.New(NPC, Spawn)
  95. Dialog.AddDialog("A concert? Oh, no! Concerts are held in lavish auditoriums and feature many different songs. Unfortunately, right now, I don't have access to a concert hall. But I'm holding an event soon! I even have a partner for duets ... Well, I haven't actually asked the singer I have in mind ... Would you do me a favor and ask if she'll accompany me?")
  96. Dialog.AddVoiceover("voiceover/english/kualdin_swoonsong/qey_village05/kualdinswoonsong001.mp3", 1787982830, 1127515675)
  97. PlayFlavor(NPC, "", "", "no", 0, 0, Spawn)
  98. Dialog.AddOption("Who do you want to ask?", "QuestBegin")
  99. Dialog.AddOption("I'm a bit preoccupied. Sorry.")
  100. Dialog.Start()
  101. end
  102. function QuestBegin (NPC, Spawn)
  103. FaceTarget(NPC, Spawn)
  104. OfferQuest(NPC, Spawn, Delivery)
  105. end
  106. function Delivered(NPC, Spawn)
  107. FaceTarget(NPC, Spawn)
  108. Dialog.New(NPC, Spawn)
  109. Dialog.AddDialog("Wonderful! I'll add Bupipa to my concert plans. I'll fit her in somewhere between my second and fifth solo. Thanks for your help. Take this coin for your time. You MUST save it and buy a concert ticket!")
  110. Dialog.AddVoiceover("voiceover/english/kualdin_swoonsong/qey_village05/kualdinswoonsong003.mp3", 2468409303, 338695465)
  111. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  112. Dialog.AddOption("I'll consider it. Glad I could help.", "Reward")
  113. Dialog.Start()
  114. end
  115. function Reward(NPC, Spawn)
  116. SetStepComplete(Spawn, Delivery, 2)
  117. end