fix(CORE/Naxxramas): Portals and Teleports (#12696)

This fixes overlapping portals inside and outside Naxxramas. Their
rotation is also corrected (from CCW to CW). The post-boss
Naxxramas portals now teleport to the blue hub portal and activate only
when all wings are cleared. This requirement can be bypassed with the
orbs, which are now correctly
casting their respective sapphiron entry/exit spells in addition to having the
correct position.
This commit is contained in:
SoglaHash
2022-09-21 19:06:34 +02:00
committed by GitHub
parent 62674c73a8
commit e3f9ad1e6b
2 changed files with 110 additions and 0 deletions

View File

@@ -640,6 +640,27 @@ public:
return 0;
}
bool AreAllWingsCleared() const
{
return (GetBossState(BOSS_MAEXXNA) == DONE) && (GetBossState(BOSS_LOATHEB) == DONE) && (GetBossState(BOSS_THADDIUS) == DONE) && (GetBossState(BOSS_HORSEMAN) == DONE);
}
bool CheckRequiredBosses(uint32 bossId, Player const* /* player */) const override
{
switch (bossId)
{
case BOSS_SAPPHIRON:
if (!AreAllWingsCleared())
{
return false;
}
break;
default:
break;
}
return true;
}
bool SetBossState(uint32 bossId, EncounterState state) override
{
// pull all the trash if not killed
@@ -1221,8 +1242,33 @@ public:
};
};
const Position sapphironEntryTP = { 3498.300049f, -5349.490234f, 144.968002f, 1.3698910f };
class at_naxxramas_hub_portal : public AreaTriggerScript
{
public:
at_naxxramas_hub_portal() : AreaTriggerScript("at_naxxramas_hub_portal") { }
bool OnTrigger(Player* player, AreaTrigger const* /*trigger*/) override
{
if (player->IsAlive() && !player->IsInCombat())
{
if (InstanceScript *instance = player->GetInstanceScript())
{
if (instance->CheckRequiredBosses(BOSS_SAPPHIRON))
{
player->TeleportTo(533, sapphironEntryTP.m_positionX, sapphironEntryTP.m_positionY, sapphironEntryTP.m_positionZ, sapphironEntryTP.m_orientation);
return true;
}
}
}
return false;
}
};
void AddSC_instance_naxxramas()
{
new instance_naxxramas();
new boss_naxxramas_misc();
new at_naxxramas_hub_portal();
}