mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 15:16:24 +00:00
fix(Core/AI): Fix bosses being stuck IN_PROGRESS if despawnonevade fl… (#19070)
fix(Core/AI): Fix bosses being stuck IN_PROGRESS if despawnonevade flag is used
This commit is contained in:
@@ -223,14 +223,14 @@ void CreatureAI::EnterEvadeMode(EvadeReason why)
|
||||
me->GetVehicleKit()->Reset(true);
|
||||
}
|
||||
|
||||
sScriptMgr->OnUnitEnterEvadeMode(me, why);
|
||||
|
||||
// despawn bosses at reset - only verified tbc/woltk bosses with this reset type
|
||||
CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(me->GetEntry());
|
||||
if (cInfo && cInfo->HasFlagsExtra(CREATURE_FLAG_EXTRA_HARD_RESET))
|
||||
{
|
||||
me->DespawnOnEvade();
|
||||
}
|
||||
|
||||
sScriptMgr->OnUnitEnterEvadeMode(me, why);
|
||||
}
|
||||
|
||||
/*void CreatureAI::AttackedBy(Unit* attacker)
|
||||
|
||||
@@ -650,6 +650,16 @@ void BossAI::_JustEngagedWith()
|
||||
}
|
||||
}
|
||||
|
||||
void BossAI::_EnterEvadeMode(EvadeReason why)
|
||||
{
|
||||
CreatureAI::EnterEvadeMode(why);
|
||||
if (instance)
|
||||
{
|
||||
instance->SetBossState(_bossId, NOT_STARTED);
|
||||
instance->SaveToDB();
|
||||
}
|
||||
}
|
||||
|
||||
void BossAI::TeleportCheaters()
|
||||
{
|
||||
float x, y, z;
|
||||
|
||||
@@ -488,6 +488,7 @@ public:
|
||||
|
||||
void Reset() override { _Reset(); }
|
||||
void JustEngagedWith(Unit* /*who*/) override { _JustEngagedWith(); }
|
||||
void EnterEvadeMode(EvadeReason why = EVADE_REASON_OTHER) override { _EnterEvadeMode(why); }
|
||||
void JustDied(Unit* /*killer*/) override { _JustDied(); }
|
||||
void JustReachedHome() override { _JustReachedHome(); }
|
||||
|
||||
@@ -496,6 +497,7 @@ protected:
|
||||
void _JustEngagedWith();
|
||||
void _JustDied();
|
||||
void _JustReachedHome() { me->setActive(false); }
|
||||
void _EnterEvadeMode(EvadeReason why = EVADE_REASON_OTHER);
|
||||
[[nodiscard]] bool _ProccessHealthCheckEvent(uint8 healthPct, uint32 damage, std::function<void()> exec) const;
|
||||
|
||||
void TeleportCheaters();
|
||||
|
||||
@@ -94,7 +94,7 @@ struct boss_jindo : public BossAI
|
||||
|
||||
void EnterEvadeMode(EvadeReason evadeReason) override
|
||||
{
|
||||
if (_EnterEvadeMode(evadeReason))
|
||||
if (CreatureAI::_EnterEvadeMode(evadeReason))
|
||||
{
|
||||
Reset();
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DANCE);
|
||||
|
||||
Reference in New Issue
Block a user