fix(Scripts/RuinsOfAhnQiraj): Sand Vortexes should move (#12655)

Co-authored-by: Gultask <gultask@users.noreply.github.com>
This commit is contained in:
UltraNix
2022-08-08 20:05:38 +02:00
committed by GitHub
parent c1257b3628
commit 4165dc4195
3 changed files with 93 additions and 11 deletions

View File

@@ -77,12 +77,9 @@ Position CrystalCoordinates[NUM_CRYSTALS] =
{ -9406.73f, 1863.13f, 85.5558f, 0.0f }
};
float roomRadius = 165.0f;
uint8 const NUM_TORNADOS = 2;
uint8 const NUM_WEAKNESS = 5;
uint32 const spellWeakness[NUM_WEAKNESS] =
{ SPELL_FIRE_WEAKNESS, SPELL_FROST_WEAKNESS, SPELL_NATURE_WEAKNESS, SPELL_ARCANE_WEAKNESS, SPELL_SHADOW_WEAKNESS };
Position const RoomCenter = { -9343.041992f, 1923.278198f, 85.555984f, 0.0 };
struct boss_ossirian : public BossAI
{
@@ -142,14 +139,7 @@ struct boss_ossirian : public BossAI
WorldPackets::Misc::Weather weather(WEATHER_STATE_HEAVY_SANDSTORM, 1.0f);
map->SendToPlayers(weather.Write());
for (uint8 i = 0; i < NUM_TORNADOS; ++i)
{
Position Point = me->GetRandomPoint(RoomCenter, roomRadius);
if (Creature* Tornado = me->GetMap()->SummonCreature(NPC_SAND_VORTEX, Point))
{
Tornado->CastSpell(Tornado, SPELL_SAND_STORM, true);
}
}
SpawnNextCrystal();
}

View File

@@ -97,6 +97,10 @@ public:
case NPC_OSSIRIAN:
_ossirianGUID = creature->GetGUID();
break;
case NPC_SAND_VORTEX:
_sandVortexes.push_back(creature->GetGUID());
creature->SetVisible(false);
break;
}
}
@@ -189,6 +193,31 @@ public:
_paralyzedGUID = data;
}
bool SetBossState(uint32 type, EncounterState state) override
{
if (!InstanceScript::SetBossState(type, state))
return false;
switch (type)
{
case DATA_OSSIRIAN:
{
for (ObjectGuid const& guid : _sandVortexes)
{
if (Creature* sandVortex = instance->GetCreature(guid))
{
sandVortex->SetVisible(state == IN_PROGRESS);
}
}
break;
default:
break;
}
}
return true;
}
ObjectGuid GetGuidData(uint32 type) const override
{
switch (type)
@@ -304,6 +333,7 @@ public:
ObjectGuid _buruGUID;
ObjectGuid _ossirianGUID;
ObjectGuid _paralyzedGUID;
GuidVector _sandVortexes;
uint32 _rajaxWaveCounter;
TaskScheduler _scheduler;
};