fix(Scripts/AhnQiraj): Spawn 3 crystals at start. (#12804)
* fix(Scripts/AhnQiraj): Spawn 3 crystals at start. Fixes #12762 * Update.
This commit is contained in:
@@ -65,9 +65,10 @@ enum Events
|
|||||||
EVENT_SPEEDUP = 4
|
EVENT_SPEEDUP = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
uint8 const NUM_CRYSTALS = 11;
|
uint8 const NUM_CRYSTALS = 12;
|
||||||
Position CrystalCoordinates[NUM_CRYSTALS] =
|
Position CrystalCoordinates[NUM_CRYSTALS] =
|
||||||
{
|
{
|
||||||
|
{ -9407.7197265625f, 1960.20996093750f, 85.6390991210937f, 1.11700999736786f },
|
||||||
{ -9388.4404296875f, 1940.20996093750f, 85.6390991210937f, 3.17650008201599f },
|
{ -9388.4404296875f, 1940.20996093750f, 85.6390991210937f, 3.17650008201599f },
|
||||||
{ -9357.8603515625f, 1929.07995605469f, 85.6390991210937f, 1.06465005874634f },
|
{ -9357.8603515625f, 1929.07995605469f, 85.6390991210937f, 1.06465005874634f },
|
||||||
{ -9383.2900390625f, 2012.68005371094f, 85.6511001586914f, 2.93214988708496f },
|
{ -9383.2900390625f, 2012.68005371094f, 85.6511001586914f, 2.93214988708496f },
|
||||||
@@ -81,8 +82,6 @@ Position CrystalCoordinates[NUM_CRYSTALS] =
|
|||||||
{ -9367.1699218750f, 1780.89001464844f, 85.6390991210937f, 1.90241003036499f }
|
{ -9367.1699218750f, 1780.89001464844f, 85.6390991210937f, 1.90241003036499f }
|
||||||
};
|
};
|
||||||
|
|
||||||
Position initialCrystalPosition = { -9407.7197265625f, 1960.2099609375f, 85.6390991210937f, 1.11700999736786f };
|
|
||||||
|
|
||||||
uint8 const NUM_WEAKNESS = 5;
|
uint8 const NUM_WEAKNESS = 5;
|
||||||
uint32 const spellWeakness[NUM_WEAKNESS] =
|
uint32 const spellWeakness[NUM_WEAKNESS] =
|
||||||
{ SPELL_FIRE_WEAKNESS, SPELL_FROST_WEAKNESS, SPELL_NATURE_WEAKNESS, SPELL_ARCANE_WEAKNESS, SPELL_SHADOW_WEAKNESS };
|
{ SPELL_FIRE_WEAKNESS, SPELL_FROST_WEAKNESS, SPELL_NATURE_WEAKNESS, SPELL_ARCANE_WEAKNESS, SPELL_SHADOW_WEAKNESS };
|
||||||
@@ -98,13 +97,13 @@ struct boss_ossirian : public BossAI
|
|||||||
{
|
{
|
||||||
Reset();
|
Reset();
|
||||||
|
|
||||||
if (Creature* trigger = me->GetMap()->SummonCreature(NPC_OSSIRIAN_TRIGGER, initialCrystalPosition))
|
if (Creature* trigger = me->GetMap()->SummonCreature(NPC_OSSIRIAN_TRIGGER, CrystalCoordinates[0]))
|
||||||
{
|
{
|
||||||
_triggerGUID[0] = trigger->GetGUID();
|
_triggerGUID[0] = trigger->GetGUID();
|
||||||
if (GameObject* crystal = trigger->SummonGameObject(GO_OSSIRIAN_CRYSTAL,
|
if (GameObject* crystal = trigger->SummonGameObject(GO_OSSIRIAN_CRYSTAL,
|
||||||
initialCrystalPosition.GetPositionX(),
|
CrystalCoordinates[0].GetPositionX(),
|
||||||
initialCrystalPosition.GetPositionY(),
|
CrystalCoordinates[0].GetPositionY(),
|
||||||
initialCrystalPosition.GetPositionZ(),
|
CrystalCoordinates[0].GetPositionZ(),
|
||||||
0, 0, 0, 0, 0, uint32(-1)))
|
0, 0, 0, 0, 0, uint32(-1)))
|
||||||
{
|
{
|
||||||
_crystalGUID[0] = crystal->GetGUID();
|
_crystalGUID[0] = crystal->GetGUID();
|
||||||
@@ -118,9 +117,13 @@ struct boss_ossirian : public BossAI
|
|||||||
{
|
{
|
||||||
BossAI::Reset();
|
BossAI::Reset();
|
||||||
|
|
||||||
_crystalIterator = urand(0, NUM_CRYSTALS - 1);
|
_crystalIterator = urand(1, NUM_CRYSTALS - 1);
|
||||||
_triggerGUID[1].Clear();
|
|
||||||
_crystalGUID[1].Clear();
|
for (uint8 i = 1; i < NUM_CRYSTALS; ++i)
|
||||||
|
{
|
||||||
|
_triggerGUID[i].Clear();
|
||||||
|
_crystalGUID[i].Clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustReachedHome() override
|
void JustReachedHome() override
|
||||||
@@ -135,14 +138,14 @@ struct boss_ossirian : public BossAI
|
|||||||
crystal->Delete();
|
crystal->Delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger = me->GetMap()->SummonCreature(NPC_OSSIRIAN_TRIGGER, initialCrystalPosition);
|
trigger = me->GetMap()->SummonCreature(NPC_OSSIRIAN_TRIGGER, CrystalCoordinates[0]);
|
||||||
if (trigger)
|
if (trigger)
|
||||||
{
|
{
|
||||||
_triggerGUID[0] = trigger->GetGUID();
|
_triggerGUID[0] = trigger->GetGUID();
|
||||||
if (GameObject* crystal = trigger->SummonGameObject(GO_OSSIRIAN_CRYSTAL,
|
if (GameObject* crystal = trigger->SummonGameObject(GO_OSSIRIAN_CRYSTAL,
|
||||||
initialCrystalPosition.GetPositionX(),
|
CrystalCoordinates[0].GetPositionX(),
|
||||||
initialCrystalPosition.GetPositionY(),
|
CrystalCoordinates[0].GetPositionY(),
|
||||||
initialCrystalPosition.GetPositionZ(),
|
CrystalCoordinates[0].GetPositionZ(),
|
||||||
0, 0, 0, 0, 0, uint32(-1)))
|
0, 0, 0, 0, 0, uint32(-1)))
|
||||||
{
|
{
|
||||||
_crystalGUID[0] = crystal->GetGUID();
|
_crystalGUID[0] = crystal->GetGUID();
|
||||||
@@ -161,11 +164,16 @@ struct boss_ossirian : public BossAI
|
|||||||
{
|
{
|
||||||
me->RemoveAurasDueToSpell(SPELL_STRENGHT_OF_OSSIRIAN);
|
me->RemoveAurasDueToSpell(SPELL_STRENGHT_OF_OSSIRIAN);
|
||||||
|
|
||||||
if (caster->GetGUID() == _triggerGUID[1])
|
for (uint8 i = 1; i < NUM_CRYSTALS; ++i)
|
||||||
{
|
{
|
||||||
if (Creature* creatureCaster = caster->ToCreature())
|
if (caster->GetGUID() == _triggerGUID[i])
|
||||||
{
|
{
|
||||||
creatureCaster->DespawnOrUnsummon();
|
if (Creature* creatureCaster = caster->ToCreature())
|
||||||
|
{
|
||||||
|
creatureCaster->DespawnOrUnsummon();
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -176,7 +184,7 @@ struct boss_ossirian : public BossAI
|
|||||||
{
|
{
|
||||||
if (action == ACTION_TRIGGER_WEAKNESS)
|
if (action == ACTION_TRIGGER_WEAKNESS)
|
||||||
{
|
{
|
||||||
for (uint8 i = 0; i < 2; ++i)
|
for (uint8 i = 0; i < NUM_CRYSTALS; ++i)
|
||||||
{
|
{
|
||||||
if (_crystalGUID[i] == guid)
|
if (_crystalGUID[i] == guid)
|
||||||
{
|
{
|
||||||
@@ -215,7 +223,7 @@ struct boss_ossirian : public BossAI
|
|||||||
WorldPackets::Misc::Weather weather(WEATHER_STATE_HEAVY_SANDSTORM, 1.0f);
|
WorldPackets::Misc::Weather weather(WEATHER_STATE_HEAVY_SANDSTORM, 1.0f);
|
||||||
map->SendToPlayers(weather.Write());
|
map->SendToPlayers(weather.Write());
|
||||||
|
|
||||||
SpawnNextCrystal();
|
SpawnNextCrystal(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SummonedCreatureDespawn(Creature* summon) override
|
void SummonedCreatureDespawn(Creature* summon) override
|
||||||
@@ -233,24 +241,27 @@ struct boss_ossirian : public BossAI
|
|||||||
Talk(SAY_SLAY);
|
Talk(SAY_SLAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpawnNextCrystal()
|
void SpawnNextCrystal(uint8 count = 1)
|
||||||
{
|
{
|
||||||
if (_crystalIterator == NUM_CRYSTALS)
|
for (uint8 i = 0; i < count; ++i)
|
||||||
_crystalIterator = 0;
|
|
||||||
|
|
||||||
if (Creature* trigger = me->SummonCreature(NPC_OSSIRIAN_TRIGGER, CrystalCoordinates[_crystalIterator]))
|
|
||||||
{
|
{
|
||||||
_triggerGUID[1] = trigger->GetGUID();
|
if (_crystalIterator == NUM_CRYSTALS)
|
||||||
if (GameObject* crystal = trigger->SummonGameObject(GO_OSSIRIAN_CRYSTAL,
|
_crystalIterator = 1;
|
||||||
CrystalCoordinates[_crystalIterator].GetPositionX(),
|
|
||||||
CrystalCoordinates[_crystalIterator].GetPositionY(),
|
if (Creature* trigger = me->SummonCreature(NPC_OSSIRIAN_TRIGGER, CrystalCoordinates[_crystalIterator]))
|
||||||
CrystalCoordinates[_crystalIterator].GetPositionZ(),
|
|
||||||
0, 0, 0, 0, 0, uint32(-1)))
|
|
||||||
{
|
{
|
||||||
_crystalGUID[1] = crystal->GetGUID();
|
_triggerGUID[i] = trigger->GetGUID();
|
||||||
++_crystalIterator;
|
if (GameObject* crystal = trigger->SummonGameObject(GO_OSSIRIAN_CRYSTAL,
|
||||||
crystal->SetOwnerGUID(ObjectGuid::Empty);
|
CrystalCoordinates[_crystalIterator].GetPositionX(),
|
||||||
crystal->RemoveGameObjectFlag(GO_FLAG_IN_USE);
|
CrystalCoordinates[_crystalIterator].GetPositionY(),
|
||||||
|
CrystalCoordinates[_crystalIterator].GetPositionZ(),
|
||||||
|
0, 0, 0, 0, 0, uint32(-1)))
|
||||||
|
{
|
||||||
|
_crystalGUID[i] = crystal->GetGUID();
|
||||||
|
++_crystalIterator;
|
||||||
|
crystal->SetOwnerGUID(ObjectGuid::Empty);
|
||||||
|
crystal->RemoveGameObjectFlag(GO_FLAG_IN_USE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -322,8 +333,8 @@ struct boss_ossirian : public BossAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::array<ObjectGuid, 2> _triggerGUID;
|
std::array<ObjectGuid, NUM_CRYSTALS> _triggerGUID;
|
||||||
std::array<ObjectGuid, 2> _crystalGUID;
|
std::array<ObjectGuid, NUM_CRYSTALS> _crystalGUID;
|
||||||
uint8 _crystalIterator;
|
uint8 _crystalIterator;
|
||||||
bool _saidIntro;
|
bool _saidIntro;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user