mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Scripts/Ulduar): Phase 1 of Thorim (#22037)
This commit is contained in:
@@ -187,17 +187,20 @@ enum ThorimEvents
|
|||||||
EVENT_THORIM_CHARGE_ORB = 3,
|
EVENT_THORIM_CHARGE_ORB = 3,
|
||||||
EVENT_THORIM_LIGHTNING_ORB = 4,
|
EVENT_THORIM_LIGHTNING_ORB = 4,
|
||||||
EVENT_THORIM_NOT_REACH_IN_TIME = 5,
|
EVENT_THORIM_NOT_REACH_IN_TIME = 5,
|
||||||
EVENT_THORIM_FILL_ARENA = 6,
|
EVENT_THORIM_ARENA_SPAWN_WARBRINGER = 6,
|
||||||
EVENT_THORIM_UNBALANCING_STRIKE = 7,
|
EVENT_THORIM_ARENA_SPAWN_EVOKER = 7,
|
||||||
EVENT_THORIM_LIGHTNING_CHARGE = 8,
|
EVENT_THORIM_ARENA_SPAWN_COMMONER = 8,
|
||||||
EVENT_THORIM_CHAIN_LIGHTNING = 9,
|
EVENT_THORIM_ARENA_SPAWN_CHAMPION = 9,
|
||||||
EVENT_THORIM_BERSERK = 10,
|
EVENT_THORIM_UNBALANCING_STRIKE = 10,
|
||||||
EVENT_THORIM_AGGRO = 11,
|
EVENT_THORIM_LIGHTNING_CHARGE = 11,
|
||||||
EVENT_THORIM_AGGRO2 = 12,
|
EVENT_THORIM_CHAIN_LIGHTNING = 12,
|
||||||
EVENT_THORIM_OUTRO1 = 13,
|
EVENT_THORIM_BERSERK = 13,
|
||||||
EVENT_THORIM_OUTRO2 = 14,
|
EVENT_THORIM_AGGRO = 14,
|
||||||
EVENT_THORIM_OUTRO3 = 15,
|
EVENT_THORIM_AGGRO2 = 15,
|
||||||
EVENT_THORIM_OUTRO4 = 16,
|
EVENT_THORIM_OUTRO1 = 16,
|
||||||
|
EVENT_THORIM_OUTRO2 = 17,
|
||||||
|
EVENT_THORIM_OUTRO3 = 18,
|
||||||
|
EVENT_THORIM_OUTRO4 = 19,
|
||||||
|
|
||||||
EVENT_DR_ACOLYTE_GH = 20,
|
EVENT_DR_ACOLYTE_GH = 20,
|
||||||
EVENT_DR_ACOLYTE_HS = 21,
|
EVENT_DR_ACOLYTE_HS = 21,
|
||||||
@@ -323,8 +326,6 @@ enum Misc
|
|||||||
|
|
||||||
const Position Middle = {2134.68f, -263.13f, 419.44f, M_PI * 1.5f};
|
const Position Middle = {2134.68f, -263.13f, 419.44f, M_PI * 1.5f};
|
||||||
|
|
||||||
const uint32 RollTable[3] = { 32877, 32878, 32876 };
|
|
||||||
|
|
||||||
class boss_thorim : public CreatureScript
|
class boss_thorim : public CreatureScript
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -561,7 +562,7 @@ public:
|
|||||||
me->AddThreat(player, 1000.0f);
|
me->AddThreat(player, 1000.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (damage >= me->GetHealth())
|
if (damage >= me->GetHealth()|| me->GetHealth()<2)
|
||||||
{
|
{
|
||||||
damage = 0;
|
damage = 0;
|
||||||
if (!_encounterFinished)
|
if (!_encounterFinished)
|
||||||
@@ -604,22 +605,22 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpawnArenaNPCs()
|
void SpawnAnArenaNPC(uint32 arenaNpc)
|
||||||
{
|
{
|
||||||
Creature* cr;
|
Creature* cr;
|
||||||
uint8 rnd;
|
uint8 rnd = urand(0,13);
|
||||||
if (_spawnCommoners || urand(0, 2))
|
if ((cr = me->SummonCreature(arenaNpc, ArenaNPCs[rnd], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000)))
|
||||||
_spawnCommoners = !_spawnCommoners;
|
cr->GetMotionMaster()->MoveJump(
|
||||||
|
Middle.GetPositionX() + urand(19, 24) * cos(Middle.GetAngle(cr)),
|
||||||
|
Middle.GetPositionY() + urand(19, 24) * std::sin(Middle.GetAngle(cr)),
|
||||||
|
Middle.GetPositionZ(), 20, 20);
|
||||||
|
}
|
||||||
|
|
||||||
for (uint8 i = 0; i < (_spawnCommoners ? 7 : 2); ++i)
|
void SpawnCommoners()
|
||||||
{
|
{
|
||||||
rnd = urand(0, 13);
|
uint8 rnd = urand(6,7);
|
||||||
if ((cr = me->SummonCreature((_spawnCommoners ? NPC_DARK_RUNE_COMMONER : RollTable[urand(0, 2)]), ArenaNPCs[rnd], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000)))
|
for (uint8 i = 0; i < rnd; ++i)
|
||||||
cr->GetMotionMaster()->MoveJump(
|
SpawnAnArenaNPC(NPC_DARK_RUNE_COMMONER);
|
||||||
Middle.GetPositionX() + urand(19, 24) * cos(Middle.GetAngle(cr)),
|
|
||||||
Middle.GetPositionY() + urand(19, 24) * std::sin(Middle.GetAngle(cr)),
|
|
||||||
Middle.GetPositionZ(), 20, 20);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpellHit(Unit* caster, SpellInfo const* spellInfo) override
|
void SpellHit(Unit* caster, SpellInfo const* spellInfo) override
|
||||||
@@ -685,10 +686,12 @@ public:
|
|||||||
{
|
{
|
||||||
events.ScheduleEvent(EVENT_THORIM_STORMHAMMER, 8s, 0, EVENT_PHASE_START);
|
events.ScheduleEvent(EVENT_THORIM_STORMHAMMER, 8s, 0, EVENT_PHASE_START);
|
||||||
events.ScheduleEvent(EVENT_THORIM_CHARGE_ORB, 14s, 0, EVENT_PHASE_START);
|
events.ScheduleEvent(EVENT_THORIM_CHARGE_ORB, 14s, 0, EVENT_PHASE_START);
|
||||||
events.ScheduleEvent(EVENT_THORIM_FILL_ARENA, 0ms, 0, EVENT_PHASE_START);
|
events.ScheduleEvent(EVENT_THORIM_ARENA_SPAWN_WARBRINGER, 0ms, 0, EVENT_PHASE_START);
|
||||||
|
events.ScheduleEvent(EVENT_THORIM_ARENA_SPAWN_EVOKER, 5s, 0, EVENT_PHASE_START);
|
||||||
|
events.ScheduleEvent(EVENT_THORIM_ARENA_SPAWN_COMMONER, 7s, 0, EVENT_PHASE_START);
|
||||||
|
events.ScheduleEvent(EVENT_THORIM_ARENA_SPAWN_CHAMPION, 10s, 0, EVENT_PHASE_START);
|
||||||
events.ScheduleEvent(EVENT_THORIM_LIGHTNING_ORB, 5s, 0, EVENT_PHASE_START); // checked every 5 secs if there are players on arena
|
events.ScheduleEvent(EVENT_THORIM_LIGHTNING_ORB, 5s, 0, EVENT_PHASE_START); // checked every 5 secs if there are players on arena
|
||||||
events.ScheduleEvent(EVENT_THORIM_NOT_REACH_IN_TIME, 5min, 0, EVENT_PHASE_START);
|
events.ScheduleEvent(EVENT_THORIM_NOT_REACH_IN_TIME, 5min, 0, EVENT_PHASE_START);
|
||||||
|
|
||||||
EntryCheckPredicate pred(NPC_SIF);
|
EntryCheckPredicate pred(NPC_SIF);
|
||||||
summons.DoAction(ACTION_SIF_START_DOMINION, pred);
|
summons.DoAction(ACTION_SIF_START_DOMINION, pred);
|
||||||
break;
|
break;
|
||||||
@@ -724,9 +727,21 @@ public:
|
|||||||
me->CastSpell(me, SPELL_BERSERK_FRIENDS, true);
|
me->CastSpell(me, SPELL_BERSERK_FRIENDS, true);
|
||||||
me->SummonCreature(NPC_LIGHTNING_ORB, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
|
me->SummonCreature(NPC_LIGHTNING_ORB, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
|
||||||
break;
|
break;
|
||||||
case EVENT_THORIM_FILL_ARENA:
|
case EVENT_THORIM_ARENA_SPAWN_WARBRINGER:
|
||||||
SpawnArenaNPCs();
|
SpawnAnArenaNPC(NPC_DARK_RUNE_WARBRINGER);
|
||||||
events.Repeat(10s);
|
events.Repeat(15s);
|
||||||
|
break;
|
||||||
|
case EVENT_THORIM_ARENA_SPAWN_EVOKER:
|
||||||
|
SpawnAnArenaNPC(NPC_DARK_RUNE_EVOKER);
|
||||||
|
events.Repeat(20s);
|
||||||
|
break;
|
||||||
|
case EVENT_THORIM_ARENA_SPAWN_COMMONER:
|
||||||
|
SpawnCommoners();
|
||||||
|
events.Repeat(21s);
|
||||||
|
break;
|
||||||
|
case EVENT_THORIM_ARENA_SPAWN_CHAMPION:
|
||||||
|
SpawnAnArenaNPC(NPC_DARK_RUNE_CHAMPION);
|
||||||
|
events.Repeat(25s);
|
||||||
break;
|
break;
|
||||||
case EVENT_THORIM_UNBALANCING_STRIKE:
|
case EVENT_THORIM_UNBALANCING_STRIKE:
|
||||||
me->CastSpell(me->GetVictim(), SPELL_UNBALANCING_STRIKE, false);
|
me->CastSpell(me->GetVictim(), SPELL_UNBALANCING_STRIKE, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user