SaliniaBrooklily.lua 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. --[[
  2. Script Name : SpawnScripts/WillowWood/SaliniaBrooklily.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.02.15 06:02:39
  5. Script Purpose : Quest Scavenging Rats w/ Woodelf language check
  6. :
  7. --]]
  8. local Rats = 5478
  9. function spawn(NPC)
  10. ProvidesQuest(NPC,Rats)
  11. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function InRange(NPC, Spawn)
  17. if not HasLanguage(Spawn, 16) then
  18. if math.random(1, 100) <= 60 then
  19. local choice = math.random(1,2)
  20. if choice == 1 then
  21. PlayFlavor(NPC, "voiceover/english/woodelf_forrest_wardens/ft/woodelf/woodelf_forrest_wardens_1_garbled_gm_87567d71.mp3", "Nature's balance begins with the words here.", "ponder", 2241066225, 3802156744, Spawn, 16)
  22. elseif choice == 2 then
  23. PlayFlavor(NPC, "", "", "no", 0, 0, Spawn, 16)
  24. end
  25. end
  26. elseif not HasCompletedQuest (Spawn, Rats) and not HasQuest (Spawn, Rats) then
  27. if math.random(1, 100) <= 60 then
  28. PlayFlavor(NPC, "", "The balance of nature is delecate, but all these newcomer...", "ponder", 0, 0, Spawn, 16)
  29. elseif HasCompletedQuest (Spawn, Rats) and math.random(1, 100) <= 30 then
  30. FaceTarget(NPC,Spawn)
  31. PlayFlavor(NPC, "voiceover/english/salinia_brooklily/qey_village05/100_salinia_brooklily_callout_b524f5d0.mp3", "Hello friend! Please, take your time and browse at your leisure.", "hello", 996096760, 49604074, Spawn, 16)
  32. end
  33. end
  34. end
  35. function hailed(NPC, Spawn)
  36. if not HasLanguage(Spawn, 16) then
  37. PlayFlavor(NPC, "voiceover/english/woodelf_forrest_wardens/ft/woodelf/woodelf_forrest_wardens_1_garbled_gm_87567d71.mp3", "Nature's balance begins with the words here.", "ponder", 2241066225, 3802156744, Spawn, 16)
  38. else
  39. FaceTarget(NPC, Spawn)
  40. PlayFlavor(NPC, "voiceover/english/salinia_brooklily/qey_village05/saliniabrooklily_x000.mp3", "","hello", 1124223156, 142078310, Spawn)
  41. conversation = CreateConversation()
  42. if not HasQuest(Spawn, Rats) and not HasCompletedQuest(Spawn,Rats) then
  43. AddConversationOption(conversation, "I am interested in the power of nature.", "WhatRats")
  44. end
  45. if GetQuestStep(Spawn, Rats)==2 then
  46. conversation = CreateConversation()
  47. AddConversationOption(conversation, "I've reduced the number of scavengers like you asked.", "DoneRats")
  48. end
  49. AddConversationOption(conversation, "Just browsing. Thank you.")
  50. StartConversation(conversation, NPC, Spawn, "Welcome to my little scribe shop, adventurer. Are you interested in the wondrous magic of nature per chance? I may have something here that would be of use to you.")
  51. end
  52. end
  53. function WhatRats(NPC, Spawn)
  54. FaceTarget(NPC, Spawn)
  55. conversation = CreateConversation()
  56. AddConversationOption(conversation, "What problems do you mean?", "WhatMean")
  57. AddConversationOption(conversation, "Well, people have to go somewhere. I don't have time for this.")
  58. StartConversation(conversation, NPC, Spawn, "The amazing thing about nature is its ability to balance life with no assistance. Unfortunately, the influx of people to this city is disrupting this balance.")
  59. PlayFlavor(NPC, "", "", "ponder", 0,0 , Spawn)
  60. end
  61. function WhatMean(NPC, Spawn)
  62. FaceTarget(NPC, Spawn)
  63. conversation = CreateConversation()
  64. AddConversationOption(conversation, "I suppose I could help you with this.", "Helpping")
  65. AddConversationOption(conversation, "Well, people have to go somewhere. I don't have time for this.")
  66. StartConversation(conversation, NPC, Spawn, "Take those scavenger rats in the Peat Bog; those vermin overpower the other creatures that live there. Normally, hawks or cats would prey on the rats, but they shy away from the ever-growing city. I know it may take time, but would you slay some rats and help restore the balance of nature?")
  67. PlayFlavor(NPC, "", "", "nod", 0,0 , Spawn)
  68. end
  69. function Helpping(NPC, Spawn)
  70. FaceTarget(NPC, Spawn)
  71. OfferQuest(NPC, Spawn, Rats)
  72. end
  73. function DoneRats(NPC, Spawn)
  74. FaceTarget(NPC, Spawn)
  75. conversation = CreateConversation()
  76. AddConversationOption(conversation, "I'm glad I could help.", "QuestDone")
  77. StartConversation(conversation, NPC, Spawn, "Your actions, even though small, carry great weight in helping restore the balance of nature in our beloved city. Thank you for your help.")
  78. PlayFlavor(NPC, "", "", "agree", 0,0 , Spawn)
  79. end
  80. function QuestDone(NPC, Spawn)
  81. SetStepComplete(Spawn, Rats, 2)
  82. end