KualdinSwoonsong.lua 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. end
  15. function InRange(NPC, Spawn) --Quest Callout
  16. if GetFactionAmount(Spawn,11)<0 then
  17. FactionChecking(NPC, Spawn, faction)
  18. else
  19. if not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) then
  20. if math.random(1, 100) <= 80 then
  21. choice = math.random(1,3)
  22. FaceTarget(NPC, Spawn)
  23. if choice ==1 then
  24. 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)
  25. elseif choice ==2 then
  26. 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)
  27. elseif choice ==3 then
  28. 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)
  29. end
  30. end
  31. else
  32. if math.random(1, 100) <= 50 then
  33. choice = math.random(1,2)
  34. if choice ==1 then
  35. FaceTarget(NPC, Spawn)
  36. PlayFlavor(NPC, "", "", "royalwave", 0, 0, Spawn)
  37. else
  38. FaceTarget(NPC, Spawn)
  39. PlayFlavor(NPC, "", "", "smirk", 0, 0, Spawn)
  40. end
  41. end
  42. end
  43. end
  44. end
  45. function respawn(NPC)
  46. spawn(NPC)
  47. end
  48. function hailed(NPC, Spawn)
  49. if GetFactionAmount(Spawn,11)<0 then
  50. FaceTarget(NPC, Spawn)
  51. FactionChecking(NPC, Spawn, faction)
  52. else
  53. if not HasQuest(Spawn, Delivery) and not HasCompletedQuest(Spawn, Delivery) then
  54. Dialog1(NPC,Spawn)
  55. elseif HasQuest(Spawn, Delivery) and not HasCompletedQuest(Spawn, Delivery) then
  56. Dialog2(NPC,Spawn)
  57. else
  58. 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)
  59. end
  60. end
  61. end
  62. function Dialog1(NPC, Spawn)
  63. FaceTarget(NPC, Spawn)
  64. Dialog.New(NPC, Spawn)
  65. 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.")
  66. Dialog.AddVoiceover("voiceover/english/kualdin_swoonsong/qey_village05/kualdinswoonsong000.mp3", 4042301311, 2032672217)
  67. PlayFlavor(NPC, "", "", "royalwave", 0, 0, Spawn)
  68. Dialog.AddOption("Are you preparing for a concert?", "Book")
  69. Dialog.AddOption("Not right now.")
  70. Dialog.Start()
  71. end
  72. function Dialog2(NPC, Spawn)
  73. FaceTarget(NPC, Spawn)
  74. conversation = CreateConversation()
  75. PlayFlavor(NPC,"voiceover/english/voice_emotes/greetings/greetings_3_1008.mp3","","nod",0,0,Spawn)
  76. if GetQuestStep (Spawn, Delivery) == 2 then
  77. AddConversationOption(conversation, "Bupipa agreed to join you as long as she can have her own solo performance.", "Delivered")
  78. end
  79. AddConversationOption(conversation, "I'm still heading that way.")
  80. StartConversation(conversation, NPC, Spawn, "Did you find Bupipa! You must find her! She'll be elated to sing at my concert.")
  81. end
  82. function Book(NPC, Spawn)
  83. FaceTarget(NPC, Spawn)
  84. Dialog.New(NPC, Spawn)
  85. 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?")
  86. Dialog.AddVoiceover("voiceover/english/kualdin_swoonsong/qey_village05/kualdinswoonsong001.mp3", 1787982830, 1127515675)
  87. PlayFlavor(NPC, "", "", "no", 0, 0, Spawn)
  88. Dialog.AddOption("Who do you want to ask?", "QuestBegin")
  89. Dialog.AddOption("I'm a bit preoccupied. Sorry.")
  90. Dialog.Start()
  91. end
  92. function QuestBegin (NPC, Spawn)
  93. FaceTarget(NPC, Spawn)
  94. OfferQuest(NPC, Spawn, Delivery)
  95. end
  96. function Delivered(NPC, Spawn)
  97. FaceTarget(NPC, Spawn)
  98. Dialog.New(NPC, Spawn)
  99. Dialog.AddDialog("Wonderful! I'll add Buipia 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!")
  100. Dialog.AddVoiceover("voiceover/english/kualdin_swoonsong/qey_village05/kualdinswoonsong003.mp3", 2468409303, 338695465)
  101. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  102. Dialog.AddOption("I'll concider it. Glad I could help.", "Reward")
  103. Dialog.Start()
  104. end
  105. function Reward(NPC, Spawn)
  106. SetStepComplete(Spawn, Delivery, 2)
  107. end