fix(Core/Grids): Grid improvements (#20955)

This commit is contained in:
Takenbacon
2025-02-14 13:11:27 -08:00
committed by GitHub
parent 10183efd51
commit ee69a569c4
67 changed files with 1955 additions and 2026 deletions
@@ -67,8 +67,6 @@ public:
if (instance->GetPlayersCountExceptGMs() == 1)
SetData(DATA_ARTHAS_REPOSITION, 2);
EnsureGridLoaded();
if (plr->getRace() != RACE_HUMAN && plr->getRace() != RACE_DWARF && plr->getRace() != RACE_GNOME)
plr->CastSpell(plr, ((plr->getGender() == GENDER_MALE) ? SPELL_HUMAN_MALE : SPELL_HUMAN_FEMALE), true);
}
@@ -224,7 +222,6 @@ public:
{
if (!arthas->IsAlive())
{
EnsureGridLoaded();
arthas->setDeathState(DeathState::Dead);
arthas->Respawn();
}
@@ -352,16 +349,6 @@ public:
}
}
void EnsureGridLoaded()
{
instance->LoadGrid(LeaderIntroPos1.GetPositionX(), LeaderIntroPos1.GetPositionY());
instance->LoadGrid(LeaderIntroPos2.GetPositionX(), LeaderIntroPos2.GetPositionY());
instance->LoadGrid(LeaderIntroPos3.GetPositionX(), LeaderIntroPos3.GetPositionY());
instance->LoadGrid(LeaderIntroPos4.GetPositionX(), LeaderIntroPos4.GetPositionY());
instance->LoadGrid(LeaderIntroPos5.GetPositionX(), LeaderIntroPos5.GetPositionY());
instance->LoadGrid(LeaderIntroPos6.GetPositionX(), LeaderIntroPos6.GetPositionY());
}
std::string GetSaveData() override
{
OUT_SAVE_INST_DATA;
@@ -69,8 +69,6 @@ public:
if (instance->GetPlayersCountExceptGMs() <= 1)
CleanupInstance();
EnsureGridLoaded();
if (_encounterProgress < ENCOUNTER_PROGRESS_BARRELS)
player->SendUpdateWorldState(WORLD_STATE_BARRELS_PLANTED, _barrelCount);
}
@@ -197,9 +195,6 @@ public:
{
case EVENT_INITIAL_BARRELS_FLAME:
{
instance->LoadGrid(instancePositions[0].GetPositionX(), instancePositions[0].GetPositionY());
instance->LoadGrid(instancePositions[1].GetPositionX(), instancePositions[1].GetPositionY());
for (ObjectGuid const& guid : _prisonersSet)
if (Creature* orc = instance->GetCreature(guid))
{
@@ -220,9 +215,6 @@ public:
}
case EVENT_FINAL_BARRELS_FLAME:
{
instance->LoadGrid(instancePositions[0].GetPositionX(), instancePositions[0].GetPositionY());
instance->LoadGrid(instancePositions[1].GetPositionX(), instancePositions[1].GetPositionY());
if (_encounterProgress == ENCOUNTER_PROGRESS_NONE)
{
Map::PlayerList const& players = instance->GetPlayers();
@@ -250,7 +242,6 @@ public:
}
case EVENT_SUMMON_LIEUTENANT:
{
instance->LoadGrid(instancePositions[2].GetPositionX(), instancePositions[2].GetPositionY());
instance->SummonCreature(NPC_LIEUTENANT_DRAKE, instancePositions[2]);
break;
}
@@ -261,7 +252,6 @@ public:
if (!thrall->IsAlive())
{
++_attemptsCount;
EnsureGridLoaded();
thrall->SetVisible(false);
Reposition(thrall);
thrall->setDeathState(DeathState::Dead);
@@ -293,12 +283,6 @@ public:
}
}
void EnsureGridLoaded()
{
for (uint8 i = 0; i < THRALL_POSITIONS_COUNT; ++i)
instance->LoadGrid(thrallPositions[i].GetPositionX(), thrallPositions[i].GetPositionY());
}
void ReadSaveDataMore(std::istringstream& data) override
{
data >> _encounterProgress;
@@ -74,7 +74,6 @@ public:
// prevent getting stuck if event fails during boss break
_noBossSpawnDelay = true;
instance->LoadGrid(-2023.0f, 7121.0f);
if (Creature* medivh = GetCreature(DATA_MEDIVH))
{
medivh->Respawn();
@@ -95,11 +95,9 @@ public:
{
case TYPE_EAST_WING_PROGRESS:
_eastWingProgress = data;
instance->LoadGrid(-56.59f, -269.12f);
break;
case TYPE_WEST_WING_PROGRESS:
_westWingProgress = data;
instance->LoadGrid(132.626f, 625.913f);
break;
case TYPE_NORTH_WING_PROGRESS:
_northWingProgress = data;
@@ -113,7 +111,6 @@ public:
_pylonsState |= data;
if (_pylonsState == ALL_PYLONS_OFF) // all five active, 31
{
instance->LoadGrid(-38.08f, 812.44f);
if (Creature* immol = instance->GetCreature(_immoltharGUID))
{
immol->setActive(true);
@@ -82,9 +82,6 @@ struct boss_kurinnaxx : public BossAI
{
if (killer)
{
killer->GetMap()->LoadGrid(-9502.80f, 2042.65f); // Ossirian grid
killer->GetMap()->LoadGrid(-8538.17f, 1486.09f); // Andorov run path grid
if (Player* player = killer->GetCharmerOrOwnerPlayerOrPlayerItself())
{
if (Creature* creature = player->SummonCreature(NPC_ANDOROV, -8538.177f, 1486.0956f, 32.39054f, 3.7638654f, TEMPSUMMON_CORPSE_DESPAWN, 0))
@@ -87,7 +87,6 @@ public:
_rajaxWaveCounter == 0 && // if non-zero, encounter is in progress
!_andorovGUID) // cleared if he is dead
{
instance->LoadGrid(-8538.17f, 1486.09f); // Andorov run path grid
if (Creature* creature = player->SummonCreature(NPC_ANDOROV, -8538.177f, 1486.0956f, 32.39054f, 3.7638654f, TEMPSUMMON_CORPSE_DESPAWN, 0))
{
creature->setActive(true);
@@ -64,7 +64,6 @@ public:
if (type == TYPE_LORD_COBRAHN && _encounters[TYPE_LORD_SERPENTIS] != DONE)
{
instance->LoadGrid(-120.163f, -24.624f);
if (Creature* serpentis = instance->GetCreature(SerpentisGUID))
serpentis->AI()->Talk(SAY_SERPENTIS);
}
@@ -72,7 +71,6 @@ public:
if (type != TYPE_MUTANUS && _encounters[TYPE_LORD_COBRAHN] == DONE && _encounters[TYPE_LORD_PYTHAS] == DONE &&
_encounters[TYPE_LADY_ANACONDRA] == DONE && _encounters[TYPE_LORD_SERPENTIS] == DONE)
{
instance->LoadGrid(-134.97f, 125.402f);
if (Creature* disciple = instance->GetCreature(DiscipleOfNaralexGUID))
disciple->AI()->Talk(SAY_DISCIPLE);
}