9
3

RotweedThistle.lua 759 B

12345678910111213141516171819202122232425262728293031
  1. --[[
  2. Script Name : SpawnScripts/Oakmyst_Classic/RotweedThistle.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.10.21 01:10:13
  5. Script Purpose : Part of the Rotweed encounter in Oakmyst Forest
  6. :
  7. --]]
  8. function spawn(NPC)
  9. end
  10. function aggro(NPC, Spawn)
  11. aggrotimer(NPC)
  12. end
  13. function aggrotimer(NPC)
  14. local distance = GetRunbackDistance(NPC)
  15. if IsInCombat(NPC) and distance <=25 then
  16. AddTimer(NPC,8000,"aggrotimer") -- Check is Thistles and Cube are up
  17. else
  18. Despawn(NPC) --Despawns Thistles and Cube, which disables update
  19. zone = GetZone(NPC)
  20. local Cube = GetSpawnByLocationID(zone,133779141)
  21. Despawn(Cube)
  22. end
  23. end
  24. function respawn(NPC)
  25. spawn(NPC)
  26. end