9
3

KualdinSwoonsong.lua 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. local Delivery = 5471
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  12. ProvidesQuest(NPC, Delivery)
  13. end
  14. function InRange(NPC, Spawn) --Quest Callout
  15. if GetFactionAmount(Spawn,11)<0 then
  16. FactionChecking(NPC, Spawn, faction)
  17. else
  18. if not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) and GetLevel(Spawn) >=6 then
  19. if math.random(1, 100) <= 70 then
  20. choice = math.random(1,3)
  21. FaceTarget(NPC, Spawn)
  22. if choice ==1 then
  23. 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)
  24. elseif choice ==2 then
  25. 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)
  26. elseif choice ==3 then
  27. 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)
  28. end
  29. end
  30. else
  31. if math.random(1, 100) <= 50 then
  32. choice = math.random(1,2)
  33. if choice ==1 then
  34. FaceTarget(NPC, Spawn)
  35. PlayFlavor(NPC, "", "", "royalwave", 0, 0, Spawn)
  36. else
  37. FaceTarget(NPC, Spawn)
  38. PlayFlavor(NPC, "", "", "smirk", 0, 0, Spawn)
  39. end
  40. end
  41. end
  42. end
  43. end
  44. function respawn(NPC)
  45. spawn(NPC)
  46. end
  47. function hailed(NPC, Spawn)
  48. if GetFactionAmount(Spawn,11)<0 then
  49. FaceTarget(NPC, Spawn)
  50. FactionChecking(NPC, Spawn, faction)
  51. else
  52. FaceTarget(NPC, Spawn)
  53. conversation = CreateConversation()
  54. PlayFlavor(NPC, "voiceover/english/kualdin_swoonsong/qey_village05/100_kualdin_swoonsong_multhail2_1c41a7b8.mp3", "", "royalwave", 2123310145, 515687997, Spawn)
  55. if not HasQuest(Spawn, Delivery) and not HasCompletedQuest(Spawn, Delivery) then
  56. AddConversationOption(conversation, "Are you preparing for a concert?", "Book")
  57. end
  58. if GetQuestStep (Spawn, Delivery) == 2 then
  59. AddConversationOption(conversation, "Bupipa agreed to join you as long as she can have her own solo performance.", "Delivered")
  60. end
  61. AddConversationOption(conversation, "Not right now. Goodbye.")
  62. StartConversation(conversation, NPC, Spawn, "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 truely.")
  63. end
  64. end
  65. function Book(NPC, Spawn)
  66. FaceTarget(NPC, Spawn)
  67. conversation = CreateConversation()
  68. PlayFlavor(NPC, "voiceover/english/kualdin_swoonsong/qey_village05/kualdinswoonsong001.mp3", "", "no", 1787982830, 1127515675, Spawn)
  69. AddConversationOption(conversation, "Who do you want to ask?", "PieBook")
  70. AddConversationOption(conversation, "I don't have time. Sorry.")
  71. StartConversation(conversation, NPC, Spawn, "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 am holding an event soon! I even have a partner for duets!... Well, I haven't actually asked the singer I had in mind. Would you do me a favor and ask if she would accompany me?")
  72. end
  73. function PieBook(NPC, Spawn)
  74. FaceTarget(NPC, Spawn)
  75. conversation = CreateConversation()
  76. PlayFlavor(NPC, "voiceover/english/kualdin_swoonsong/qey_village05/kualdinswoonsong002.mp3", "", "", 23545717, 1052293137, Spawn)
  77. AddConversationOption(conversation, "I will go ask her for you.", "QuestBegin")
  78. StartConversation(conversation, NPC, Spawn, "Her name is Bupipa Guryup and she resides in Castleview. I would ask her, but I hate denying my fans a daily seranade. Please, let me know if she accepts my offer.")
  79. end
  80. function QuestBegin (NPC, Spawn)
  81. FaceTarget(NPC, Spawn)
  82. OfferQuest(NPC, Spawn, Delivery)
  83. end
  84. function Delivered(NPC, Spawn)
  85. FaceTarget(NPC, Spawn)
  86. conversation = CreateConversation()
  87. PlayFlavor(NPC, "voiceover/english/kualdin_swoonsong/qey_village05/kualdinswoonsong003.mp3", "", "thank", 2468409303, 338695465, Spawn)
  88. AddConversationOption(conversation, "I'll concider it. Glad I could help.", "Reward")
  89. StartConversation(conversation, NPC, Spawn, "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!")
  90. end
  91. function Reward(NPC, Spawn)
  92. SetStepComplete(Spawn, Delivery, 2)
  93. end