strangeguardian.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --[[
  2. Script Name : SpawnScripts/MeetingOfTheMinds/strangeguardian.lua
  3. Script Author : Neveruary
  4. Script Date : 2021.10.05 01:10:31
  5. Script Purpose : Governs behavior for a strange guardian in Meeting of the Minds.
  6. :
  7. --]]
  8. spells = {30159, 30011, 30121, 30153}
  9. function spawn(NPC)
  10. end
  11. function attacked(NPC, Spawn)
  12. AddTimer(NPC, 100, "spellLoop")
  13. end
  14. function spellLoop(NPC, Spawn) -- referred from aggro. Loopback function for spellcasts.
  15. AddTimer(NPC, math.random(1500, 2500), "spellChoice", Spawn) -- add timer to refer to spellchoice.
  16. end
  17. function spellChoice(NPC, Spawn) -- select a spell from table. Zalak is a shadowknight, so only casts on highest hate target.
  18. local hated = GetMostHated(NPC) -- get pointer for whoever has threat.
  19. if hated ~= nil then -- if pointer isn't blank, proceed.
  20. FaceTarget(NPC, hated) -- face the NPC toward threat target if they aren't already.
  21. -- CastSpell(hated, spells[math.random(#spells)], 3, NPC) -- get random spell from table, cast on target.
  22. end
  23. AddTimer(NPC, math.random(1500, 2500), "spellLoop") -- refer to loopback
  24. end
  25. function hailed(NPC, Spawn)
  26. end
  27. function death(NPC, Spawn)
  28. end
  29. function respawn(NPC)
  30. spawn(NPC)
  31. end