mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Scripts/RuinsOfAhnQiraj): Improve Ossirian (#12138)
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
-- Ossirian immune to Taunt
|
||||||
|
UPDATE `creature_template` SET `flags_extra`=`flags_extra`|256 WHERE `entry`=15339;
|
||||||
|
|
||||||
|
-- Sand Vortex UNIT_FLAG_NOT_SELECTABLE
|
||||||
|
UPDATE `creature_template` SET `unit_flags`=`unit_flags`|33554432 WHERE `entry`=15428;
|
||||||
@@ -25,41 +25,36 @@
|
|||||||
|
|
||||||
enum Texts
|
enum Texts
|
||||||
{
|
{
|
||||||
SAY_SUPREME = 0,
|
SAY_SUPREME = 0,
|
||||||
SAY_INTRO = 1,
|
SAY_INTRO = 1,
|
||||||
SAY_AGGRO = 2,
|
SAY_AGGRO = 2,
|
||||||
SAY_SLAY = 3,
|
SAY_SLAY = 3,
|
||||||
SAY_DEATH = 4
|
SAY_DEATH = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Spells
|
enum Spells
|
||||||
{
|
{
|
||||||
SPELL_SILENCE = 25195,
|
SPELL_CURSE_OF_TONGUES = 25195,
|
||||||
SPELL_CYCLONE = 25189,
|
SPELL_ENVELOPING_WINDS = 25189,
|
||||||
SPELL_STOMP = 25188,
|
SPELL_WAR_STOMP = 25188,
|
||||||
SPELL_SUPREME = 25176,
|
SPELL_STRENGHT_OF_OSSIRIAN = 25176,
|
||||||
SPELL_SUMMON = 20477,
|
SPELL_SAND_STORM = 25160,
|
||||||
SPELL_SAND_STORM = 25160,
|
SPELL_SUMMON_CRYSTAL = 25192
|
||||||
SPELL_SUMMON_CRYSTAL = 25192
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Actions
|
enum Actions
|
||||||
{
|
{
|
||||||
ACTION_TRIGGER_WEAKNESS = 1
|
ACTION_TRIGGER_WEAKNESS = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Events
|
enum Events
|
||||||
{
|
{
|
||||||
EVENT_SILENCE = 1,
|
EVENT_SILENCE = 1,
|
||||||
EVENT_CYCLONE = 2,
|
EVENT_CYCLONE = 2,
|
||||||
EVENT_STOMP = 3
|
EVENT_STOMP = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
uint8 const NUM_CRYSTALS = 9;
|
uint8 const NUM_CRYSTALS = 9;
|
||||||
|
|
||||||
// You spin me right round, baby
|
|
||||||
// right round like a record, baby
|
|
||||||
// right round round round
|
|
||||||
Position CrystalCoordinates[NUM_CRYSTALS] =
|
Position CrystalCoordinates[NUM_CRYSTALS] =
|
||||||
{
|
{
|
||||||
{ -9394.230469f, 1951.808594f, 85.97733f, 0.0f },
|
{ -9394.230469f, 1951.808594f, 85.97733f, 0.0f },
|
||||||
@@ -73,9 +68,9 @@ Position CrystalCoordinates[NUM_CRYSTALS] =
|
|||||||
{ -9406.73f, 1863.13f, 85.5558f, 0.0f }
|
{ -9406.73f, 1863.13f, 85.5558f, 0.0f }
|
||||||
};
|
};
|
||||||
|
|
||||||
float RoomRadius = 165.0f;
|
float RoomRadius = 165.0f;
|
||||||
uint8 const NUM_TORNADOS = 5; /// @todo This number is completly random!
|
uint8 const NUM_TORNADOS = 2;
|
||||||
uint8 const NUM_WEAKNESS = 5;
|
uint8 const NUM_WEAKNESS = 5;
|
||||||
uint32 const SpellWeakness[NUM_WEAKNESS] = { 25177, 25178, 25180, 25181, 25183 };
|
uint32 const SpellWeakness[NUM_WEAKNESS] = { 25177, 25178, 25180, 25181, 25183 };
|
||||||
Position const RoomCenter = { -9343.041992f, 1923.278198f, 85.555984f, 0.0 };
|
Position const RoomCenter = { -9343.041992f, 1923.278198f, 85.555984f, 0.0 };
|
||||||
|
|
||||||
@@ -110,7 +105,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (spell->Id == SpellWeakness[i])
|
if (spell->Id == SpellWeakness[i])
|
||||||
{
|
{
|
||||||
me->RemoveAurasDueToSpell(SPELL_SUPREME);
|
me->RemoveAurasDueToSpell(SPELL_STRENGHT_OF_OSSIRIAN);
|
||||||
((TempSummon*)caster)->UnSummon();
|
((TempSummon*)caster)->UnSummon();
|
||||||
SpawnNextCrystal();
|
SpawnNextCrystal();
|
||||||
}
|
}
|
||||||
@@ -120,9 +115,15 @@ public:
|
|||||||
void DoAction(int32 action) override
|
void DoAction(int32 action) override
|
||||||
{
|
{
|
||||||
if (action == ACTION_TRIGGER_WEAKNESS)
|
if (action == ACTION_TRIGGER_WEAKNESS)
|
||||||
|
{
|
||||||
if (Creature* Trigger = me->GetMap()->GetCreature(TriggerGUID))
|
if (Creature* Trigger = me->GetMap()->GetCreature(TriggerGUID))
|
||||||
|
{
|
||||||
if (!Trigger->HasUnitState(UNIT_STATE_CASTING))
|
if (!Trigger->HasUnitState(UNIT_STATE_CASTING))
|
||||||
|
{
|
||||||
Trigger->CastSpell(Trigger, SpellWeakness[urand(0, 4)], false);
|
Trigger->CastSpell(Trigger, SpellWeakness[urand(0, 4)], false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnterCombat(Unit* /*who*/) override
|
void EnterCombat(Unit* /*who*/) override
|
||||||
@@ -132,8 +133,7 @@ public:
|
|||||||
events.ScheduleEvent(EVENT_SILENCE, 30000);
|
events.ScheduleEvent(EVENT_SILENCE, 30000);
|
||||||
events.ScheduleEvent(EVENT_CYCLONE, 20000);
|
events.ScheduleEvent(EVENT_CYCLONE, 20000);
|
||||||
events.ScheduleEvent(EVENT_STOMP, 30000);
|
events.ScheduleEvent(EVENT_STOMP, 30000);
|
||||||
|
DoCastSelf(SPELL_STRENGHT_OF_OSSIRIAN);
|
||||||
DoCast(me, SPELL_SUPREME);
|
|
||||||
Talk(SAY_AGGRO);
|
Talk(SAY_AGGRO);
|
||||||
|
|
||||||
Map* map = me->GetMap();
|
Map* map = me->GetMap();
|
||||||
@@ -142,14 +142,14 @@ public:
|
|||||||
|
|
||||||
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());
|
||||||
|
|
||||||
for (uint8 i = 0; i < NUM_TORNADOS; ++i)
|
for (uint8 i = 0; i < NUM_TORNADOS; ++i)
|
||||||
{
|
{
|
||||||
Position Point = me->GetRandomPoint(RoomCenter, RoomRadius);
|
Position Point = me->GetRandomPoint(RoomCenter, RoomRadius);
|
||||||
if (Creature* Tornado = me->GetMap()->SummonCreature(NPC_SAND_VORTEX, Point))
|
if (Creature* Tornado = me->GetMap()->SummonCreature(NPC_SAND_VORTEX, Point))
|
||||||
|
{
|
||||||
Tornado->CastSpell(Tornado, SPELL_SAND_STORM, true);
|
Tornado->CastSpell(Tornado, SPELL_SAND_STORM, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SpawnNextCrystal();
|
SpawnNextCrystal();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,7 +174,9 @@ public:
|
|||||||
void Cleanup()
|
void Cleanup()
|
||||||
{
|
{
|
||||||
if (GameObject* Crystal = me->GetMap()->GetGameObject(CrystalGUID))
|
if (GameObject* Crystal = me->GetMap()->GetGameObject(CrystalGUID))
|
||||||
|
{
|
||||||
Crystal->Use(me);
|
Crystal->Use(me);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpawnNextCrystal()
|
void SpawnNextCrystal()
|
||||||
@@ -215,15 +217,11 @@ public:
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
events.Update(diff);
|
events.Update(diff);
|
||||||
|
|
||||||
// No kiting!
|
|
||||||
if (me->GetDistance(me->GetVictim()) > 60.00f && me->GetDistance(me->GetVictim()) < 120.00f)
|
|
||||||
DoCastVictim(SPELL_SUMMON);
|
|
||||||
|
|
||||||
bool ApplySupreme = true;
|
bool ApplySupreme = true;
|
||||||
|
if (me->HasAura(SPELL_STRENGHT_OF_OSSIRIAN))
|
||||||
if (me->HasAura(SPELL_SUPREME))
|
{
|
||||||
ApplySupreme = false;
|
ApplySupreme = false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (uint8 i = 0; i < NUM_WEAKNESS; ++i)
|
for (uint8 i = 0; i < NUM_WEAKNESS; ++i)
|
||||||
@@ -238,7 +236,7 @@ public:
|
|||||||
|
|
||||||
if (ApplySupreme)
|
if (ApplySupreme)
|
||||||
{
|
{
|
||||||
DoCast(me, SPELL_SUPREME);
|
DoCastSelf(SPELL_STRENGHT_OF_OSSIRIAN);
|
||||||
Talk(SAY_SUPREME);
|
Talk(SAY_SUPREME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,22 +245,21 @@ public:
|
|||||||
switch (eventId)
|
switch (eventId)
|
||||||
{
|
{
|
||||||
case EVENT_SILENCE:
|
case EVENT_SILENCE:
|
||||||
DoCast(me, SPELL_SILENCE);
|
DoCastAOE(SPELL_CURSE_OF_TONGUES);
|
||||||
events.ScheduleEvent(EVENT_SILENCE, urand(20000, 30000));
|
events.ScheduleEvent(EVENT_SILENCE, urand(20000, 30000));
|
||||||
break;
|
break;
|
||||||
case EVENT_CYCLONE:
|
case EVENT_CYCLONE:
|
||||||
DoCastVictim(SPELL_CYCLONE);
|
DoCastVictim(SPELL_ENVELOPING_WINDS);
|
||||||
events.ScheduleEvent(EVENT_CYCLONE, 20000);
|
events.ScheduleEvent(EVENT_CYCLONE, 20000);
|
||||||
break;
|
break;
|
||||||
case EVENT_STOMP:
|
case EVENT_STOMP:
|
||||||
DoCast(me, SPELL_STOMP);
|
DoCastAOE(SPELL_WAR_STOMP);
|
||||||
events.ScheduleEvent(EVENT_STOMP, 30000);
|
events.ScheduleEvent(EVENT_STOMP, 30000);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user