mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +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();
|
pInstance = me->GetInstanceScript();
|
||||||
me->SetReactState(REACT_PASSIVE);
|
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);
|
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||||
events.Reset();
|
events.Reset();
|
||||||
if (me->HasReactState(REACT_AGGRESSIVE)) // Reset() called by EnterEvadeMode()
|
pInstance->SetData(DATA_TYRANNUS, NOT_STARTED);
|
||||||
{
|
}
|
||||||
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();
|
|
||||||
|
|
||||||
c->RemoveAllAuras();
|
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||||
c->UpdatePosition(1017.3f, 168.974f, 642.926f, 5.2709f, true);
|
{
|
||||||
c->StopMovingOnCurrentPos();
|
if (!pInstance)
|
||||||
if (Vehicle* v = c->GetVehicleKit())
|
return;
|
||||||
v->InstallAllAccessories(false);
|
|
||||||
}
|
if (Creature* creature = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_MARTIN_OR_GORKUN_GUID)))
|
||||||
pInstance->SetData(DATA_TYRANNUS, NOT_STARTED);
|
{
|
||||||
|
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
|
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)
|
if (TSDistCheckPos.GetExactDist(x, y, z) > 100.0f || z > TSDistCheckPos.GetPositionZ() + 20.0f || z < TSDistCheckPos.GetPositionZ() - 20.0f)
|
||||||
{
|
{
|
||||||
me->SetHealth(me->GetMaxHealth());
|
me->SetHealth(me->GetMaxHealth());
|
||||||
EnterEvadeMode();
|
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user