Oakmyst.lua 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. --[[
  2. Script Name : ZoneScripts/Oakmyst.lua
  3. Script Purpose : Zone script for Oakmyst Forest
  4. Script Author : Scatman
  5. Script Date : 2009.10.02
  6. Script Notes :
  7. --]]
  8. -- Rotweed Script needs some love. Spawns everything at once. 2022.01.17
  9. local QUEST_FROM_CHARLIN_4 = 207
  10. local QUEST_FROM_ADALIN = 294
  11. local QUEST_FROM_EMPRESS = 230
  12. local ThistleSpawn = 0 --Indicates if Rotweed Thistles are active. 0 = inactive. 1 = active.
  13. function init_zone_script(Zone)
  14. SetLocationProximityFunction(Zone, 964.13, 8.67, -292.63, 40, "InRange")
  15. SetLocationProximityFunction(Zone, 906.62, 3.33, -209.46, 50, "InRangeAdalinTree1")
  16. SetLocationProximityFunction(Zone, 934.61, 8.11, -195.52, 50, "InRangeAdalinTree2")
  17. SetLocationProximityFunction(Zone, 921.71, 3.93, -357.12, 50, "InRangeAdalinTree3")
  18. SetLocationProximityFunction(Zone, 934.09, 12.28, -171.64, 6, "InRangeRotweed")
  19. end
  20. function LeaveRange(Zone)
  21. end
  22. function InRange(Zone, Spawn)
  23. if HasQuest(Spawn, QUEST_FROM_CHARLIN_4) and GetQuestStep(Spawn, QUEST_FROM_CHARLIN_4) == 1 then
  24. Fulkoir = GetSpawn(Spawn, 1950083)
  25. if Fulkoir == nil then
  26. Fulkoir = SpawnMob(Zone, 1950083, false, 998.26, 14.15, -239.86, 133)
  27. Despawn(Fulkoir, 60000)
  28. end
  29. end
  30. end
  31. function InRangeAdalinTree1(Zone, Spawn)
  32. if HasQuest(Spawn, QUEST_FROM_ADALIN) and not QuestStepIsComplete(Spawn, QUEST_FROM_ADALIN, 1) then
  33. SetStepComplete(Spawn, QUEST_FROM_ADALIN, 1)
  34. end
  35. end
  36. function InRangeAdalinTree2(Zone, Spawn)
  37. if HasQuest(Spawn, QUEST_FROM_ADALIN) and not QuestStepIsComplete(Spawn, QUEST_FROM_ADALIN, 2) then
  38. SetStepComplete(Spawn, QUEST_FROM_ADALIN, 2)
  39. end
  40. end
  41. function InRangeAdalinTree3(Zone, Spawn)
  42. if HasQuest(Spawn, QUEST_FROM_ADALIN) and not QuestStepIsComplete(Spawn, QUEST_FROM_ADALIN, 3) then
  43. SetStepComplete(Spawn, QUEST_FROM_ADALIN, 3)
  44. end
  45. end
  46. function InRangeRotweed(Zone, Spawn) --Appears to trigger only once.
  47. if HasQuest(Spawn, QUEST_FROM_EMPRESS) and GetQuestStep(Spawn, QUEST_FROM_EMPRESS) == 1 and ThistleSpawn == 0 then
  48. local rotweed_thistle = GetSpawn(Zone, 1950028)
  49. -- local rotweed = GetSpawn(Zone, 1950029)
  50. if rotweed_thistle == nil and rotweed == nil then
  51. ThistleSpawn = 1
  52. SpawnByLocationID(Zone, 422456)
  53. SpawnByLocationID(Zone, 422457)
  54. SpawnByLocationID(Zone, 422458)
  55. Attack(rotweed_thistle, Spawn)
  56. AddTimer(NPC, 10000, "ThistleReset", 1, Spawn)
  57. end
  58. end
  59. end
  60. function ThistleReset(Zone,Spawn)
  61. ThistleSpawn = 0
  62. end
  63. --RotweedSpawn (Zone, Spawn) --Trigger needs assistance.