mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-31 01:23:47 +00:00
fix(Creature/Core): Boss phased reset (#7828)
Co-authored-by: Si1ker <Si1ker@users.noreply.github.com> Co-authored-by: lineagedr <lineagedr@users.noreply.github.com> Co-authored-by: Footman <footman@hotmail.de>
This commit is contained in:
@@ -1921,6 +1921,36 @@ void Creature::DespawnOrUnsummon(uint32 msTimeToDespawn /*= 0*/)
|
||||
ForcedDespawn(msTimeToDespawn);
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
SetVisible(true);
|
||||
UpdateMovementFlags();
|
||||
AI()->Reset();
|
||||
AI()->JustReachedHome();
|
||||
if (IsVehicle()) // use the same sequence of addtoworld, aireset may remove all summons!
|
||||
{
|
||||
GetVehicleKit()->Reset(true);
|
||||
}
|
||||
}
|
||||
|
||||
void Creature::InitializeReactState()
|
||||
{
|
||||
if ((IsTotem() || IsTrigger() || IsCritter() || IsSpiritService()) && GetAIName() != "SmartAI" && !GetScriptId())
|
||||
|
||||
@@ -257,6 +257,8 @@ public:
|
||||
void RemoveCorpse(bool setSpawnTime = true, bool skipVisibility = false);
|
||||
|
||||
void DespawnOrUnsummon(uint32 msTimeToDespawn = 0);
|
||||
void DespawnOnEvade();
|
||||
void RespawnOnEvade();
|
||||
|
||||
[[nodiscard]] time_t const& GetRespawnTime() const { return m_respawnTime; }
|
||||
[[nodiscard]] time_t GetRespawnTimeEx() const;
|
||||
|
||||
Reference in New Issue
Block a user