ArchLichUdalan.lua 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. --[[
  2. Script Name : SpawnScripts/ShatteredStillness/ArchLichUdalan.lua
  3. Script Author : Neveruary
  4. Script Date : 2021.10.04 01:10:53
  5. Script Purpose : Governs behavior of Arch Lich Udalan in Shattered Stillness: Epic.
  6. Script Notes : Withering Soulscream, Suffocating Cloud, and chaotic elemental summoning spell need implementation.
  7. Boss Mechanics : Every minute, Udalan summons a chaotic elemental. This channeling can be interrupted by stunning him. The elemental has a few spells
  8. : the most dangerous of which is stunning shards.
  9. --]]
  10. spells = {240107, 240003, 240049} -- Withering Soulscream, Suffocating Cloud
  11. function spawn(NPC)
  12. end
  13. function aggro(NPC, Spawn)
  14. AddTimer(NPC, math.random(1500,2500), "spellLoop")
  15. AddTimer(NPC, 1000, "eleLoop")
  16. end
  17. function spellLoop(NPC, Spawn) -- Loopback function for spellcasts.
  18. AddTimer(NPC, 3000, "spellChoice")
  19. end
  20. function eleLoop(NPC, Spawn)
  21. Shout(NPC, "eleLoop firing.")
  22. AddTimer(NPC, 57000, "eleSpawns")
  23. end
  24. function eleSpawns(NPC, Spawn) -- spawns elementals on a timer. timer starts on aggro.
  25. AddTimer(NPC, 1000, "eleLoop")
  26. -- CastSpell(NPC, summon chaotic elemental, 3, NPC)
  27. end
  28. function spellChoice(NPC, Spawn) -- select a spell from table.
  29. local hated = GetMostHated(NPC)
  30. if hated ~= nil then
  31. FaceTarget(NPC, hated)
  32. CastSpell(hated, spells[math.random(#spells)], 3, NPC)
  33. end
  34. AddTimer(NPC, math.random(1500, 2500), "spellLoop")
  35. end
  36. function hailed(NPC, Spawn)
  37. FaceTarget(NPC, Spawn)
  38. end
  39. function respawn(NPC)
  40. spawn(NPC)
  41. end