Hey guys,
I’m wanting to make these adds despawn off the first boss in Sethekk Halls.
Here is the add script:
class npc_syth_fire : public CreatureScript
{
public:
npc_syth_fire() : CreatureScript(“npc_syth_fire”) { }
struct npc_syth_fireAI : public ScriptedAI
{
npc_syth_fireAI(Creature* creature) : ScriptedAI(creature)
{
}
uint32 flameshock_timer;
uint32 flamebuffet_timer;
void Reset() OVERRIDE
{
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
flameshock_timer = 2500;
flamebuffet_timer = 5000;
}
void EnterCombat(Unit* /*who*/) OVERRIDE { }
void UpdateAI(uint32 diff) OVERRIDE
{
if (!UpdateVictim())
return;
if (flameshock_timer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_FLAME_SHOCK);
flameshock_timer = 5000;
} else flameshock_timer -= diff;
if (flamebuffet_timer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_FLAME_BUFFET);
flamebuffet_timer = 5000;
} else flamebuffet_timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_syth_fireAI(creature);
}
};
There are 4 adds but I was just wondering how to despawn them after X seconds of being out of combat. There is a problem right now on the build that causes them to remain after a wipe making it very difficult to do the boss.
Thanks!