FawnStarstone.lua 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. --[[
  2. Script Name : SpawnScripts/Starcrest/FawnStarstone.lua
  3. Script Purpose : Fawn Starstone
  4. Script Author : John Adams
  5. Script Date : 2008.09.23
  6. Script Notes : Recreated dialog / movement loop - 07.04.2022
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. function spawn(NPC)
  10. ProvidesQuest(NPC,241)
  11. waypoints(NPC)
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function hailed(NPC, Spawn)
  17. if GetFactionAmount(Spawn,11)<0 then
  18. FaceTarget(NPC, Spawn)
  19. PlayFlavor(NPC, "", "", "glare", 0, 0, Spawn)
  20. else
  21. Dialog2(NPC, Spawn)
  22. end
  23. end
  24. function Dialog1(NPC, Spawn)
  25. FaceTarget(NPC, Spawn)
  26. Dialog.New(NPC, Spawn)
  27. Dialog.AddDialog("Wonderful! Thank you so much.")
  28. Dialog.AddOption("I'll be back.")
  29. Dialog.Start()
  30. end
  31. function Dialog2(NPC, Spawn)
  32. FaceTarget(NPC, Spawn)
  33. Dialog.New(NPC, Spawn)
  34. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  35. Dialog.AddDialog("Welcome to the village! I hope you find everything you need. I wish I had!")
  36. Dialog.AddVoiceover("voiceover/english/voice_emotes/greetings/greetings_3_1051.mp3", 0, 0)
  37. if not HasQuest(Spawn,241) and not HasCompletedQuest(Spawn,241) and GetLevel(Spawn) >= 8 then
  38. Dialog.AddOption("What do you mean, you wish you had?", "Dialog4")
  39. end
  40. if GetQuestStep(Spawn,241)==4 then
  41. Dialog.AddOption("I've managed to gather all the components you needed to start your garden.","Turnin")
  42. end
  43. Dialog.AddOption("Thanks for the welcome! See you around!")
  44. Dialog.Start()
  45. end
  46. function Dialog3(NPC, Spawn)
  47. FaceTarget(NPC, Spawn)
  48. Dialog.New(NPC, Spawn)
  49. PlayFlavor(NPC, "", "", "ponder", 0, 0, Spawn)
  50. Dialog.AddDialog("Oh I suppose I'll need some seeds too. And I don't just need soil, I need things to enrich the soil I already have. I'd like to get some diatomaceous sand from the crabs of Antonica. I believe fish eggs would help with that too, so I'd like some of those as well. As for seeds, I'm sure you can collect some stuck to the fur of some of the mammals that wander around Antonica. If you could bring me all of these items it would help me greatly!")
  51. Dialog.AddOption("I can get them.", "QuestOffer")
  52. Dialog.Start()
  53. end
  54. function QuestOffer(NPC, Spawn)
  55. OfferQuest(NPC, Spawn, 241)
  56. end
  57. function Dialog4(NPC, Spawn)
  58. FaceTarget(NPC, Spawn)
  59. Dialog.New(NPC, Spawn)
  60. PlayFlavor(NPC, "", "", "sigh", 0, 0, Spawn)
  61. Dialog.AddDialog("Well ... I hate to complain, but I thought the village would have more trees. Yes, I know ... I could move elsewhere, but I've come to love my new home. Hmm... I wonder... would you help me bring a little more greenery to the area?")
  62. Dialog.AddOption("What do you have in mind?", "Dialog5")
  63. Dialog.AddOption("I'm sorry, I haven't time right now.")
  64. Dialog.Start()
  65. end
  66. function Dialog5(NPC, Spawn)
  67. FaceTarget(NPC, Spawn)
  68. Dialog.New(NPC, Spawn)
  69. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  70. Dialog.AddDialog("It would be nice to have more trees, but that's not practical. I'm building a garden behind my house, so I can look at it and imagine the whole village is verdant. The first thing I need is soil.")
  71. Dialog.AddOption("Where can I find some?", "Dialog3")
  72. Dialog.Start()
  73. end
  74. function Turnin(NPC, Spawn)
  75. FaceTarget(NPC, Spawn)
  76. Dialog.New(NPC, Spawn)
  77. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  78. SetStepComplete(Spawn, 241,4)
  79. Dialog.AddDialog("[NOTE: Not Accurate] Marvelous! These are just what I needed. Please, take one of these hunting tools as a token of my thanks.")
  80. Dialog.AddOption("[I will report on Discord to EmemJR that you need your final dialog.]")
  81. Dialog.Start()
  82. end
  83. function waypoints(NPC)
  84. MovementLoopAddLocation(NPC, 790.03, -24.51, 319.99, 2, 15,"InitialPause")
  85. MovementLoopAddLocation(NPC, 787.37, -24.37, 319.13, 2, 0)
  86. MovementLoopAddLocation(NPC, 786.44, -24.37, 319.93, 2, 15,"InitialPause")
  87. MovementLoopAddLocation(NPC, 786.18, -24.39, 320.32, 2, 0)
  88. MovementLoopAddLocation(NPC, 786.67, -24.41, 320.92, 2, 15,"InitialPause")
  89. MovementLoopAddLocation(NPC, 789.61, -24.48, 319.66, 2, 15,"InitialPause")
  90. MovementLoopAddLocation(NPC, 788.61, -24.49, 321.21, 2, 0)
  91. MovementLoopAddLocation(NPC, 787.63, -24.45, 321.31, 2, 15,"InitialPause")
  92. MovementLoopAddLocation(NPC, 788.55, -24.43, 319.33, 2, 15,"InitialPause")
  93. MovementLoopAddLocation(NPC, 787.63, -24.45, 321.31, 2, 15,"InitialPause")
  94. MovementLoopAddLocation(NPC, 788.61, -24.49, 321.21, 2, 0)
  95. MovementLoopAddLocation(NPC, 789.61, -24.48, 319.66, 2, 15,"InitialPause")
  96. MovementLoopAddLocation(NPC, 786.67, -24.41, 320.92, 2, 15,"InitialPause")
  97. MovementLoopAddLocation(NPC, 786.18, -24.39, 320.32, 2, 0)
  98. MovementLoopAddLocation(NPC, 786.44, -24.37, 319.93, 2, 15,"InitialPause")
  99. MovementLoopAddLocation(NPC, 787.37, -24.37, 319.13, 2, 0)
  100. MovementLoopAddLocation(NPC, 790.03, -24.51, 319.99, 2, 15,"InitialPause")
  101. end
  102. function InitialPause(NPC)
  103. local GatherSpawn = GetSpawn(NPC, 2340032) -- Get Paula Marx
  104. math.randomseed(os.time())
  105. local pause = math.random (1, 4)
  106. if pause == 1 then
  107. AddTimer(NPC, 100, "stop_gathering")
  108. else
  109. AddTimer(NPC, 1000, "Gather")
  110. end
  111. end
  112. function Gather(NPC)
  113. local GatherSpawn = GetSpawn(NPC, 2340032) -- Get Paula Marx
  114. SpawnSet(NPC, "visual_state", "2809") -- Start gathering
  115. AddTimer(NPC, 5000, "Collect") -- for 5 seconds, then stop
  116. end
  117. function Collect(NPC)
  118. local GatherSpawn = GetSpawn(NPC, 2340032) -- Get Paula Marx
  119. SpawnSet(NPC, "visual_state", "2810") -- Start gathering
  120. AddTimer(NPC, 2000, "stop_gathering") -- for 5 seconds, then stop
  121. end
  122. function stop_gathering(NPC)
  123. local GatherSpawn = GetSpawn(NPC, 2340032) -- get Paula Marx
  124. SpawnSet(NPC, "visual_state", "0") -- Stop her from gathering
  125. end