Ok here it is, the wall of fire. Remember Zul'Aman? those firewalls are untargettable creatures with an aura called Fire Wall.
For this im going to make the boss spawn the wall and it will slowly close in on you. And ofcourse will despawn after a few seconds, ill make it immune to all spells and physical attacks aswell.
Code:
function FireWall_Create(Unit, Event)
Unit:StopMovement(7000) < Halt Movement for 7 Seconds
local faction = 45 < Same Faction as Boss to Aggro on Spawn
x = Unit:GetX();
y = Unit:GetY();
z = Unit:GetZ();
o = Unit:GetO();
Unit:SpawnCreature(99311, x, y, z, o, faction, 13000) < Spawn Fire Wall
Unit:SendChatMessage(8, 0, ".,-='Flame Wave'=-,.") < Whisper Player
function Firewall_OnSpawn(Unit, Event)
Unit:CastSpell(40282) < Immune to Everything
Unit:CastSpell(43113) < Fire Wall
end
RegisterUnitEvent(99311, 1, "Firewall_OnSpawn")
I've already broken down most of it in code.
The boss spawns the NPC which then casts spell 40282 and 43113 on itself, the first one making it immune to everything, the second one giving it the fire wall aura. I've made the spawn time for the npc 13 seconds because around that time the fire wall aura finishes, but of course you could keep the fire wall up for the whole fight if you want, you just have to keep calling the event to cast it, just like what I did when the dragon changed faction to 35 and its health held at 50%!