mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 05:06:24 +00:00
fix(Core/Creatures): Properly reset encounter if boss despawns on evade. (#11251)
Fixes #8167
This commit is contained in:
@@ -219,6 +219,12 @@ void CreatureAI::EnterEvadeMode()
|
||||
}
|
||||
}
|
||||
|
||||
Reset();
|
||||
if (me->IsVehicle()) // use the same sequence of addtoworld, aireset may remove all summons!
|
||||
{
|
||||
me->GetVehicleKit()->Reset(true);
|
||||
}
|
||||
|
||||
// despawn bosses at reset - only verified tbc/woltk bosses with this reset type - add bosses in last line respectively (dungeon/raid) and increase array limit
|
||||
CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(me->GetEntry());
|
||||
if (cInfo && cInfo->HasFlagsExtra(CREATURE_FLAG_EXTRA_HARD_RESET))
|
||||
@@ -226,14 +232,6 @@ void CreatureAI::EnterEvadeMode()
|
||||
me->DespawnOnEvade();
|
||||
me->m_Events.AddEvent(new PhasedRespawn(*me), me->m_Events.CalculateTime(20000));
|
||||
}
|
||||
else // bosses will run back to the spawnpoint at reset
|
||||
{
|
||||
Reset();
|
||||
if (me->IsVehicle()) // use the same sequence of addtoworld, aireset may remove all summons!
|
||||
{
|
||||
me->GetVehicleKit()->Reset(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*void CreatureAI::AttackedBy(Unit* attacker)
|
||||
|
||||
@@ -2012,18 +2012,6 @@ void Creature::DespawnOnEvade()
|
||||
{
|
||||
SetVisible(false);
|
||||
AI()->SummonedCreatureDespawnAll();
|
||||
RemoveEvadeAuras();
|
||||
|
||||
float x, y, z, o;
|
||||
GetRespawnPosition(x, y, z, &o);
|
||||
SetHomePosition(x, y, z, o);
|
||||
SetPosition(x, y, z, o);
|
||||
|
||||
if (IsFalling())
|
||||
{
|
||||
RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING);
|
||||
}
|
||||
StopMoving();
|
||||
}
|
||||
|
||||
void Creature::RespawnOnEvade()
|
||||
|
||||
Reference in New Issue
Block a user