SaliniaBrooklily.lua 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. dofile("SpawnScripts/Generic/UnknownLanguage.lua")
  9. require "SpawnScripts/Generic/DialogModule"
  10. local Rats = 5478
  11. function spawn(NPC)
  12. ProvidesQuest(NPC,Rats)
  13. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  14. SetInfoStructString(NPC, "action_state", "ponder")
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function InRange(NPC, Spawn)
  20. if math.random(1, 100) <= 75 then
  21. if not HasLanguage(Spawn, 16) then
  22. Garbled(NPC,Spawn)
  23. end
  24. elseif not HasCompletedQuest (Spawn, Rats) and not HasQuest (Spawn, Rats) then
  25. if math.random(1, 100) <= 60 then
  26. PlayFlavor(NPC, "", "The balance of nature is delicate, but all these newcomers...", "ponder", 0, 0, Spawn, 16)
  27. elseif HasCompletedQuest (Spawn, Rats) and math.random(1, 100) <= 30 then
  28. FaceTarget(NPC,Spawn)
  29. 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)
  30. end
  31. end
  32. end
  33. function hailed(NPC, Spawn)
  34. if not HasLanguage(Spawn, 16) then
  35. Garbled(NPC,Spawn)
  36. else
  37. Dialog1(NPC, Spawn)
  38. end
  39. end
  40. function Dialog1(NPC, Spawn)
  41. FaceTarget(NPC, Spawn)
  42. Dialog.New(NPC, Spawn)
  43. Dialog.AddDialog("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.")
  44. Dialog.AddVoiceover("voiceover/english/salinia_brooklily/qey_village05/saliniabrooklily_x000.mp3", 1124223156, 142078310)
  45. PlayFlavor(NPC, "", "","hello", 0, 0, Spawn)
  46. if not HasQuest(Spawn, Rats) and not HasCompletedQuest(Spawn,Rats) then
  47. Dialog.AddOption("I am interested in the power of nature.", "WhatRats")
  48. elseif GetQuestStep(Spawn, Rats)==2 then
  49. Dialog.AddOption("I've reduced the number of scavengers like you asked.", "DoneRats")
  50. end
  51. Dialog.AddOption("Just browsing. Thank you.")
  52. Dialog.Start()
  53. end
  54. function WhatRats(NPC, Spawn)
  55. FaceTarget(NPC, Spawn)
  56. Dialog.New(NPC, Spawn)
  57. Dialog.AddDialog("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.")
  58. PlayFlavor(NPC, "", "", "ponder", 0,0 , Spawn)
  59. Dialog.AddOption("What problems do you mean?", "WhatMean")
  60. Dialog.AddOption("Well, people have to go somewhere. I don't have time for this.")
  61. Dialog.Start()
  62. end
  63. function WhatMean(NPC, Spawn)
  64. FaceTarget(NPC, Spawn)
  65. Dialog.New(NPC, Spawn)
  66. Dialog.AddDialog("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. Dialog.AddOption("I suppose I could help you with this.", "Helpping")
  69. Dialog.AddOption("Rats? You'll need to find someone else. I don't do rats.")
  70. Dialog.Start()
  71. end
  72. function Helpping(NPC, Spawn)
  73. FaceTarget(NPC, Spawn)
  74. OfferQuest(NPC, Spawn, Rats)
  75. end
  76. function DoneRats(NPC, Spawn)
  77. SetStepComplete(Spawn, Rats, 2)
  78. FaceTarget(NPC, Spawn)
  79. Dialog.New(NPC, Spawn)
  80. Dialog.AddDialog("Your actions, even though small, carry great weight in helping restore the balance of nature in our beloved city. Thank you for your help.")
  81. PlayFlavor(NPC, "", "", "agree", 0,0 , Spawn)
  82. Dialog.AddOption("I'm glad I could help.")
  83. Dialog.Start()
  84. end