RognogtheAnglerx4.lua 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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(x4) in Cove of Decay: Epic Angler.
  6. Script Notes : Spell IDs still need to be collected.
  7. --]]
  8. spells = {1, 2, 3, 4, 5} -- need to get spell IDs/names
  9. function spawn(NPC)
  10. end
  11. function aggro(NPC, Spawn)
  12. AddTimer(NPC, 1000, "spellLoop")
  13. end
  14. function spellLoop(NPC, Spawn) -- Loopback function for spellcasts.
  15. AddTimer(NPC, math.random(1500,2500), "spellChoice")
  16. end
  17. function spellChoice(NPC, Spawn) -- select a spell from table.
  18. local hated = GetMostHated(NPC)
  19. if hated ~= nil then
  20. FaceTarget(NPC, hated)
  21. -- CastSpell(hated, spells[math.random(#spells)], 3, NPC)
  22. end
  23. AddTimer(NPC, math.random(1500, 2500), "spellLoop")
  24. end
  25. function respawn(NPC)
  26. spawn(NPC)
  27. end
  28. function despawnx2(NPC, Spawn)
  29. local rognogx2 = GetSpawn(NPC, 3110002)
  30. if rognogx2 ~= nil then
  31. Despawn(rognogx2)
  32. end
  33. end