fix(Scripts/BlackTemple): Shade of Akama should despawn on evade and Akama despawns before dying (#19894)
* fix(Scripts/BlackTemple): Shade of Akama should despawn on evade and Akama despawns before dying * Create rev_1725714358950337100.sql * Update boss_shade_of_akama.cpp
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
--
|
||||||
|
UPDATE `creature_template` SET `flags_extra` = `flags_extra` |2147483648 WHERE `entry` = 22841;
|
||||||
@@ -220,6 +220,7 @@ struct npc_akama_shade : public ScriptedAI
|
|||||||
DoCastSelf(SPELL_STEALTH, true);
|
DoCastSelf(SPELL_STEALTH, true);
|
||||||
me->SetWalk(true);
|
me->SetWalk(true);
|
||||||
_sayLowHealth = false;
|
_sayLowHealth = false;
|
||||||
|
_died = false;
|
||||||
scheduler.CancelAll();
|
scheduler.CancelAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,14 +233,14 @@ struct npc_akama_shade : public ScriptedAI
|
|||||||
case POINT_ENGAGE:
|
case POINT_ENGAGE:
|
||||||
me->SetHomePosition(me->GetPosition());
|
me->SetHomePosition(me->GetPosition());
|
||||||
me->SetFaction(FACTION_ENGAGE);
|
me->SetFaction(FACTION_ENGAGE);
|
||||||
DoCast(me, SPELL_AKAMA_SOUL_CHANNEL, true);
|
DoCastSelf(SPELL_AKAMA_SOUL_CHANNEL, true);
|
||||||
break;
|
break;
|
||||||
case POINT_OUTRO:
|
case POINT_OUTRO:
|
||||||
DoCastSelf(SPELL_AKAMA_SOUL_RETRIEVE, true);
|
DoCastSelf(SPELL_AKAMA_SOUL_RETRIEVE, true);
|
||||||
ScheduleUniqueTimedEvent(15600ms, [&]
|
ScheduleUniqueTimedEvent(15600ms, [&]
|
||||||
{
|
{
|
||||||
Talk(SAY_BROKEN_FREE_0);
|
Talk(SAY_BROKEN_FREE_0);
|
||||||
me->SummonCreatureGroup(SUMMON_GROUP_BROKENS);
|
me->SummonCreatureGroup(SUMMON_GROUP_BROKENS);
|
||||||
}, 1);
|
}, 1);
|
||||||
ScheduleUniqueTimedEvent(26550ms, [&]
|
ScheduleUniqueTimedEvent(26550ms, [&]
|
||||||
{
|
{
|
||||||
@@ -275,6 +276,19 @@ struct npc_akama_shade : public ScriptedAI
|
|||||||
_sayLowHealth = true;
|
_sayLowHealth = true;
|
||||||
Talk(SAY_LOW_HEALTH);
|
Talk(SAY_LOW_HEALTH);
|
||||||
}
|
}
|
||||||
|
else if (damage >= me->GetHealth() && !_died)
|
||||||
|
{
|
||||||
|
damage = me->GetHealth() - 1;
|
||||||
|
Talk(SAY_DEATH);
|
||||||
|
if (Creature* shade = instance->GetCreature(DATA_SHADE_OF_AKAMA))
|
||||||
|
{
|
||||||
|
shade->SetHomePosition(shade->GetHomePosition());
|
||||||
|
shade->AI()->EnterEvadeMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
me->DespawnOrUnsummon();
|
||||||
|
ScriptedAI::EnterEvadeMode(EvadeReason::EVADE_REASON_OTHER);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoAction(int32 param) override
|
void DoAction(int32 param) override
|
||||||
@@ -298,18 +312,6 @@ struct npc_akama_shade : public ScriptedAI
|
|||||||
|
|
||||||
void EnterEvadeMode(EvadeReason /*why*/) override { }
|
void EnterEvadeMode(EvadeReason /*why*/) override { }
|
||||||
|
|
||||||
void JustDied(Unit* /*killer*/) override
|
|
||||||
{
|
|
||||||
Talk(SAY_DEATH);
|
|
||||||
if (Creature* shade = instance->GetCreature(DATA_SHADE_OF_AKAMA))
|
|
||||||
{
|
|
||||||
shade->SetHomePosition(shade->GetHomePosition());
|
|
||||||
shade->AI()->EnterEvadeMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
me->DespawnOrUnsummon();
|
|
||||||
}
|
|
||||||
|
|
||||||
void JustEngagedWith(Unit* /*who*/) override
|
void JustEngagedWith(Unit* /*who*/) override
|
||||||
{
|
{
|
||||||
ScheduleTimedEvent(2s, [&]
|
ScheduleTimedEvent(2s, [&]
|
||||||
@@ -338,6 +340,7 @@ struct npc_akama_shade : public ScriptedAI
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool _sayLowHealth;
|
bool _sayLowHealth;
|
||||||
|
bool _died;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct npc_creature_generator_akama : public ScriptedAI
|
struct npc_creature_generator_akama : public ScriptedAI
|
||||||
@@ -445,27 +448,18 @@ private:
|
|||||||
|
|
||||||
struct npc_ashtongue_sorcerer : public NullCreatureAI
|
struct npc_ashtongue_sorcerer : public NullCreatureAI
|
||||||
{
|
{
|
||||||
npc_ashtongue_sorcerer(Creature* creature) : NullCreatureAI(creature)
|
npc_ashtongue_sorcerer(Creature* creature) : NullCreatureAI(creature) { }
|
||||||
{
|
|
||||||
instance = creature->GetInstanceScript();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MovementInform(uint32 type, uint32 point) override
|
void MovementInform(uint32 type, uint32 point) override
|
||||||
{
|
{
|
||||||
if (type == POINT_MOTION_TYPE && point == POINT_ENGAGE)
|
if (type == POINT_MOTION_TYPE && point == POINT_ENGAGE)
|
||||||
me->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL, true);
|
me->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
InstanceScript* instance;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct npc_ashtongue_channeler : public NullCreatureAI
|
struct npc_ashtongue_channeler : public NullCreatureAI
|
||||||
{
|
{
|
||||||
npc_ashtongue_channeler(Creature* creature) : NullCreatureAI(creature)
|
npc_ashtongue_channeler(Creature* creature) : NullCreatureAI(creature) { }
|
||||||
{
|
|
||||||
instance = creature->GetInstanceScript();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Reset() override
|
void Reset() override
|
||||||
{
|
{
|
||||||
@@ -484,7 +478,6 @@ struct npc_ashtongue_channeler : public NullCreatureAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
InstanceScript* instance;
|
|
||||||
TaskScheduler scheduler;
|
TaskScheduler scheduler;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user