WillowWood.lua 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --[[
  2. Script Name : ZoneScripts/WillowWood.lua
  3. Script Purpose : Willow Wood
  4. Script Author : Scatman
  5. Script Date : 2009.09.26
  6. Script Notes : Updated by Jabantiz (4/22/2017)
  7. --]]
  8. local WOODELF_MENTOR_QUEST_3 = 215
  9. local A_RABID_WOLF = 2370107
  10. function init_zone_script(Zone)
  11. SetLocationProximityFunction(Zone, 798.53, -15.94, -602.98, 10, "InRange")
  12. SetLocationProximityFunction(Zone, 840.94, -20.50, -617.89, 4, "SpiritOfTheFaydwer","LeaveLocation")
  13. SetLocationProximityFunction(Zone, 826.18, -21.43, -662.40, 5, "WillowWoodMemorial","LeaveLocation")
  14. end
  15. function player_entry(Zone, Player)
  16. SendPopUpMessage(Player, "The Willow Wood", 255, 255, 255)
  17. end
  18. function InRange(Zone, Spawn)
  19. if HasQuest(Spawn, WOODELF_MENTOR_QUEST_3) and GetQuestStep(Spawn, WOODELF_MENTOR_QUEST_3) == 4 then
  20. local wolf = GetSpawn(Spawn, A_RABID_WOLF)
  21. if wolf == nil then
  22. SpawnWolfForQuest(Zone, Spawn)
  23. elseif not IsInCombat(wolf) then
  24. Despawn(wolf)
  25. SpawnWolfForQuest(Zone, Spawn)
  26. end
  27. end
  28. end
  29. function SpawnWolfForQuest(Zone, Spawn)
  30. local wolf = SpawnMob(Zone, A_RABID_WOLF, 0, 770.647, 0.814391, -611.79, 258.078)
  31. local wolfattack = GetSpawnID(Zone,A_RABID_WOLF)
  32. AddHate(Spawn, wolfattack, 100)
  33. Attack(wolf, Spawn)
  34. SendMessage(Spawn, "You hear a growling in the hills to the east.")
  35. end
  36. function enter_location(zone, spawn, grid)
  37. SetLocationProximityFunction(Zone, 841.22, -20.52, -618.14, 5, "SpiritOfTheFaydwer")
  38. SetLocationProximityFunction(Zone, 826.18, -21.43, -662.40, 4, "WillowWoodMemorial")
  39. end
  40. function SpiritOfTheFaydwer(Zone,Player)
  41. SendPopUpMessage(Player, "Spirit of Faydark Park", 255, 255, 0)
  42. end
  43. function WillowWoodMemorial(Zone,Player)
  44. SendPopUpMessage(Player, "The Willow Wood Memorial", 255, 255, 0)
  45. end