9
3

RognogtheAngler.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. --[[
  2. Script Name : SpawnScripts/CoveofDecay/RognogtheAngler.lua
  3. Script Author : Neveruary
  4. Script Date : 2022.03.01 05:03:34
  5. Script Purpose : Governs the behavior of Rognog the Angler(x2) in Cove of Decay: Epic Angler.
  6. Script Notes : Spell IDs still need to be collected. Rognog starts on spawn as not attackable.
  7. : After all "a catch" mobs are dead, he attacks the player who killed his last fish.
  8. : The crabs in the zone also attack the player.
  9. --]]
  10. -- basic inclusions for mob behavior here
  11. function spawn(NPC)
  12. SpawnSet(NPC, "attackable", "0")
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function healthchanged(NPC, Spawn) -- at 50%, begin spawning the x4 version of this mob.
  18. if GetHP(NPC) <= GetMaxHP(NPC) * 0.5 then
  19. SpawnSet(NPC, "attackable", "0")
  20. ClearHate(NPC)
  21. AddTimer(NPC, 500, "spawnx4", 1, Spawn)
  22. end
  23. end
  24. function spawnx4(NPC, Spawn) -- spawns x4 by location ID. x4 despawns this mob.
  25. local zone = GetZone(NPC)
  26. local rognogx4 = SpawnByLocationID(zone, 133772888)
  27. if rognogx4 ~= nil then
  28. AddTimer(rognogx4, 500, "despawnx2")
  29. Attack(rognogx4, Spawn)
  30. end
  31. end