When i have this problem on my server, and i do one of two things. 1; setting the respawn time of the Adds to 0 in the database. so they never respawn. 2nd thing i tried was;
Code:
local SpawnCount = 0
function Mate_OnSpawn(Unit, Event)
if (SpawnCount == x) then
Unit:RemoveFromWorld()
else
SpawnCount = SpawnCount + 1
end
replacing x with the amount of 'mates' your boss spawns throughout the fight. If he spawns and un-set amount of 'mates' and you do not know the exact number, you could have a second variable when the boss dies that will store the amount of spawns by the time the fight ends. and still have the code do pretty much the same thing.
Code:
local intSpawnCount = 0
function Mate_OnSpawn(Unit, Event)
if (intSpawnCount == intSpawnCountOnDeath) then
Unit:RemoveFromWorld()
else
SpawnCount = SpawnCount + 1
end
end
function BossThree_OnDeath(Unit, Event)
intSpawnCountOnDeath = intSpawnCount
end
function BossThree_OnLeaveCombat(Unit, Event)
intSpawnCountOnDeath = intSpawnCount
end
If you use the code above, do not declare intSpawnCountOnDeath(with a value at least) or else you run the risk of having no more npc's spawning if the two variable are the same value. By not declaring it stays nil, and the 'else' part of the statement will always get executed, until its declared when your boss dies. when your boss enters combat again, you can reset the counter to 0.
If your using the npc with the id of '55194' in your code, your going to have to script them with at least On_Spawn.
Using Unit:RemoveFromWorld(), will remove a creature from the world, If you spawned it yourself and it has a unique sqlID then it will come back on a server restart, but if a scripted creature spawns it and its sqlID is 0. then it won't come back. (Beware though, using RemoveFromWorld() when a unit is dead has always crashed my servers.)