mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Merge pull request #9228 from gigatotem/BWLv2
Scripts/Blackwing Lair: Broodlord Lashlayer clean-up.
This commit is contained in:
@@ -32,12 +32,20 @@ enum Say
|
||||
SAY_LEASH = 1,
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_CLEAVE = 1,
|
||||
EVENT_MORTAL_STRIKE = 2,
|
||||
EVENT_BLAST_WAVE = 3,
|
||||
EVENT_KNOCK_BACK = 4,
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_CLEAVE = 26350,
|
||||
SPELL_BLASTWAVE = 23331,
|
||||
SPELL_MORTALSTRIKE = 24573,
|
||||
SPELL_KNOCKBACK = 25778
|
||||
SPELL_BLAST_WAVE = 23331,
|
||||
SPELL_MORTAL_STRIKE = 24573,
|
||||
SPELL_KNOCK_BACK = 25778
|
||||
};
|
||||
|
||||
class boss_broodlord : public CreatureScript
|
||||
@@ -54,17 +62,13 @@ public:
|
||||
{
|
||||
boss_broodlordAI(Creature* creature) : ScriptedAI(creature) {}
|
||||
|
||||
uint32 Cleave_Timer;
|
||||
uint32 BlastWave_Timer;
|
||||
uint32 MortalStrike_Timer;
|
||||
uint32 KnockBack_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Cleave_Timer = 8000; // These times are probably wrong
|
||||
BlastWave_Timer = 12000;
|
||||
MortalStrike_Timer = 20000;
|
||||
KnockBack_Timer = 30000;
|
||||
// These timers are probably wrong
|
||||
events.ScheduleEvent(EVENT_CLEAVE, 8000);
|
||||
events.ScheduleEvent(EVENT_BLAST_WAVE, 12000);
|
||||
events.ScheduleEvent(EVENT_MORTAL_STRIKE, 20000);
|
||||
events.ScheduleEvent(EVENT_KNOCK_BACK, 30000);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
@@ -78,43 +82,43 @@ public:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 7000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
// BlastWave
|
||||
if (BlastWave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_BLASTWAVE);
|
||||
BlastWave_Timer = urand(8000, 16000);
|
||||
} else BlastWave_Timer -= diff;
|
||||
|
||||
//MortalStrike_Timer
|
||||
if (MortalStrike_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
|
||||
MortalStrike_Timer = urand(25000, 35000);
|
||||
} else MortalStrike_Timer -= diff;
|
||||
|
||||
if (KnockBack_Timer <= diff)
|
||||
{
|
||||
if (Unit* target = me->getVictim())
|
||||
{
|
||||
DoCast(target, SPELL_KNOCKBACK);
|
||||
// Drop 50% aggro
|
||||
if (DoGetThreat(target))
|
||||
DoModifyThreatPercent(target, -50);
|
||||
}
|
||||
|
||||
KnockBack_Timer = urand(15000, 30000);
|
||||
} else KnockBack_Timer -= diff;
|
||||
|
||||
if (EnterEvadeIfOutOfCombatArea(diff))
|
||||
Talk(SAY_LEASH);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_CLEAVE:
|
||||
DoCastVictim(SPELL_CLEAVE);
|
||||
events.ScheduleEvent(EVENT_CLEAVE, 8000);
|
||||
break;
|
||||
case EVENT_MORTAL_STRIKE:
|
||||
DoCastVictim(SPELL_MORTAL_STRIKE);
|
||||
events.ScheduleEvent(EVENT_MORTAL_STRIKE, 20000);
|
||||
break;
|
||||
case EVENT_BLAST_WAVE:
|
||||
DoCastVictim(SPELL_BLAST_WAVE);
|
||||
events.ScheduleEvent(EVENT_BLAST_WAVE, 12000);
|
||||
break;
|
||||
case EVENT_KNOCK_BACK:
|
||||
DoCastVictim(SPELL_BLAST_WAVE);
|
||||
// Drop 50% of threat
|
||||
if (DoGetThreat(target))
|
||||
DoModifyThreatPercent(target, -50);
|
||||
events.ScheduleEvent(EVENT_KNOCK_BACK, 30000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (EnterEvadeIfOutOfCombatArea(diff))
|
||||
Talk(SAY_LEASH);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user