mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
fix(Scripts/PitOfSaron): Fix Scourgelord Tyrannus not respawning afte… (#21070)
This commit is contained in:
@@ -63,9 +63,9 @@ public:
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
if (Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_RIMEFANG_GUID)))
|
||||
if (Creature* rimefang = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_RIMEFANG_GUID)))
|
||||
{
|
||||
c->SetCanFly(true);
|
||||
rimefang->SetCanFly(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,29 +76,27 @@ public:
|
||||
{
|
||||
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
events.Reset();
|
||||
if (me->HasReactState(REACT_AGGRESSIVE)) // Reset() called by EnterEvadeMode()
|
||||
{
|
||||
if (!pInstance)
|
||||
return;
|
||||
if (Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_MARTIN_OR_GORKUN_GUID)))
|
||||
{
|
||||
c->AI()->DoAction(1);
|
||||
c->DespawnOrUnsummon();
|
||||
pInstance->SetGuidData(DATA_MARTIN_OR_GORKUN_GUID, ObjectGuid::Empty);
|
||||
}
|
||||
if (Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_RIMEFANG_GUID)))
|
||||
{
|
||||
c->GetMotionMaster()->Clear();
|
||||
c->GetMotionMaster()->MoveIdle();
|
||||
pInstance->SetData(DATA_TYRANNUS, NOT_STARTED);
|
||||
}
|
||||
|
||||
c->RemoveAllAuras();
|
||||
c->UpdatePosition(1017.3f, 168.974f, 642.926f, 5.2709f, true);
|
||||
c->StopMovingOnCurrentPos();
|
||||
if (Vehicle* v = c->GetVehicleKit())
|
||||
v->InstallAllAccessories(false);
|
||||
}
|
||||
pInstance->SetData(DATA_TYRANNUS, NOT_STARTED);
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
if (Creature* creature = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_MARTIN_OR_GORKUN_GUID)))
|
||||
{
|
||||
creature->AI()->DoAction(1);
|
||||
creature->DespawnOrUnsummon();
|
||||
pInstance->SetGuidData(DATA_MARTIN_OR_GORKUN_GUID, ObjectGuid::Empty);
|
||||
}
|
||||
|
||||
// Tyrannus is temporarily spawned as Rimefang's rider. If he evades, despawn Rimefang.
|
||||
// Tyrannus will be respawned once Rimefang respawns.
|
||||
if (Creature* rimefang = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_RIMEFANG_GUID)))
|
||||
rimefang->DespawnOnEvade();
|
||||
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void DoAction(int32 param) override
|
||||
@@ -141,7 +139,7 @@ public:
|
||||
if (TSDistCheckPos.GetExactDist(x, y, z) > 100.0f || z > TSDistCheckPos.GetPositionZ() + 20.0f || z < TSDistCheckPos.GetPositionZ() - 20.0f)
|
||||
{
|
||||
me->SetHealth(me->GetMaxHealth());
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user