9
3

RognogtheAngler.lua 1.3 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. spells = {1, 2, 3, 4, 5} -- need to get spell IDs/names
  11. -- basic inclusions for mob behavior here
  12. function spawn(NPC)
  13. SpawnSet(NPC, "attackable", "0")
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function healthchanged(NPC, Spawn) -- at 50%, begin spawning the x4 version of this mob.
  19. if GetHP(NPC) <= GetMaxHP(NPC) * 0.5 then
  20. SpawnSet(NPC, "attackable", "0")
  21. ClearHate(NPC)
  22. AddTimer(NPC, 500, "spawnx4", 1, Spawn)
  23. end
  24. end
  25. function spawnx4(NPC, Spawn) -- spawns x4 by location ID. x4 despawns this mob.
  26. local zone = GetZone(NPC)
  27. local rognogx4 = SpawnByLocationID(zone, 133772888)
  28. if rognogx4 ~= nil then
  29. AddTimer(rognogx4, 500, "despawnx2")
  30. Attack(rognogx4, Spawn)
  31. end
  32. end