PkzwkTzkr.lua 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --[[
  2. Script Name : SpawnScripts/MeetingOfTheMinds/PkzwkTzkr.lua
  3. Script Author : Neveruary
  4. Script Date : 2021.10.05 01:10:57
  5. Script Purpose : Governs behavior of Pkzwk Tzkr in Meeting of the Minds.
  6. Boss Mechanics : Spawns with 10 strange guardians linked.
  7. --]]
  8. spells = {40173, 40155, 40183, 40083}
  9. function spawn(NPC)
  10. end
  11. function attacked(NPC, Spawn)
  12. Say(NPC, "Reinforcement forces: notified.")
  13. AddTimer(NPC, 100, "spellLoop")
  14. end
  15. function spellLoop(NPC, Spawn) -- referred from aggro. Loopback function for spellcasts.
  16. AddTimer(NPC, math.random(1500, 2500), "spellChoice", Spawn) -- add timer to refer to spellchoice.
  17. end
  18. function spellChoice(NPC, Spawn) -- select a spell from table.
  19. local hated = GetMostHated(NPC)
  20. if hated ~= nil then
  21. FaceTarget(NPC, hated)
  22. CastSpell(hated, spells[math.random(#spells)], 3, NPC)
  23. end
  24. AddTimer(NPC, math.random(1500, 2500), "spellLoop") -- refer to loopback
  25. end
  26. function hailed(NPC, Spawn)
  27. end
  28. function death(NPC, Spawn)
  29. end
  30. function respawn(NPC)
  31. spawn(NPC)
  32. end