9
3

SaliniaBrooklily.lua 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. local Rats = 5478
  10. function spawn(NPC)
  11. ProvidesQuest(NPC,Rats)
  12. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function InRange(NPC, Spawn)
  18. if math.random(1, 100) <= 75 then
  19. if not HasLanguage(Spawn, 16) then
  20. Garbled(NPC,Spawn)
  21. end
  22. elseif not HasCompletedQuest (Spawn, Rats) and not HasQuest (Spawn, Rats) then
  23. if math.random(1, 100) <= 60 then
  24. PlayFlavor(NPC, "", "The balance of nature is delecate, but all these newcomers...", "ponder", 0, 0, Spawn, 16)
  25. elseif HasCompletedQuest (Spawn, Rats) and math.random(1, 100) <= 30 then
  26. FaceTarget(NPC,Spawn)
  27. 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)
  28. end
  29. end
  30. end
  31. function hailed(NPC, Spawn)
  32. if not HasLanguage(Spawn, 16) then
  33. Garbled(NPC,Spawn)
  34. else
  35. FaceTarget(NPC, Spawn)
  36. PlayFlavor(NPC, "voiceover/english/salinia_brooklily/qey_village05/saliniabrooklily_x000.mp3", "","hello", 1124223156, 142078310, Spawn)
  37. conversation = CreateConversation()
  38. if not HasQuest(Spawn, Rats) and not HasCompletedQuest(Spawn,Rats) then
  39. AddConversationOption(conversation, "I am interested in the power of nature.", "WhatRats")
  40. end
  41. if GetQuestStep(Spawn, Rats)==2 then
  42. conversation = CreateConversation()
  43. AddConversationOption(conversation, "I've reduced the number of scavengers like you asked.", "DoneRats")
  44. end
  45. AddConversationOption(conversation, "Just browsing. Thank you.")
  46. 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.")
  47. end
  48. end
  49. function WhatRats(NPC, Spawn)
  50. FaceTarget(NPC, Spawn)
  51. conversation = CreateConversation()
  52. AddConversationOption(conversation, "What problems do you mean?", "WhatMean")
  53. AddConversationOption(conversation, "Well, people have to go somewhere. I don't have time for this.")
  54. 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.")
  55. PlayFlavor(NPC, "", "", "ponder", 0,0 , Spawn)
  56. end
  57. function WhatMean(NPC, Spawn)
  58. FaceTarget(NPC, Spawn)
  59. conversation = CreateConversation()
  60. AddConversationOption(conversation, "I suppose I could help you with this.", "Helpping")
  61. AddConversationOption(conversation, "Well, people have to go somewhere. I don't have time for this.")
  62. 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?")
  63. PlayFlavor(NPC, "", "", "nod", 0,0 , Spawn)
  64. end
  65. function Helpping(NPC, Spawn)
  66. FaceTarget(NPC, Spawn)
  67. OfferQuest(NPC, Spawn, Rats)
  68. end
  69. function DoneRats(NPC, Spawn)
  70. FaceTarget(NPC, Spawn)
  71. conversation = CreateConversation()
  72. AddConversationOption(conversation, "I'm glad I could help.", "QuestDone")
  73. 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.")
  74. PlayFlavor(NPC, "", "", "agree", 0,0 , Spawn)
  75. end
  76. function QuestDone(NPC, Spawn)
  77. SetStepComplete(Spawn, Rats, 2)
  78. end