Core/Scripts: Fixed Baltharus the Warborn clones

*Clones not working after wipe
*Changed Clone Action for a event (to check casting)

(cherry picked from commit 6b8c4fb74f)
This commit is contained in:
Keader
2017-04-02 11:08:29 -03:00
committed by funjoker
parent 2ff501d15f
commit 287ed04c8b

View File

@@ -51,7 +51,8 @@ enum Events
EVENT_CLEAVE,
EVENT_ENERVATING_BRAND,
EVENT_INTRO_TALK,
EVENT_SUMMONS_ATTACK
EVENT_SUMMONS_ATTACK,
EVENT_CLONE
};
enum Actions
@@ -73,10 +74,8 @@ class boss_baltharus_the_warborn : public CreatureScript
struct boss_baltharus_the_warbornAI : public BossAI
{
boss_baltharus_the_warbornAI(Creature* creature) : BossAI(creature, DATA_BALTHARUS_THE_WARBORN), _introDone(false)
{
_cloneCount = RAID_MODE<uint8>(1, 2, 2, 2);
}
boss_baltharus_the_warbornAI(Creature* creature) : BossAI(creature, DATA_BALTHARUS_THE_WARBORN),
_introDone(false), _cloneCount(RAID_MODE<uint8>(1, 2, 2, 2)) { }
void Reset() override
{
@@ -85,6 +84,7 @@ class boss_baltharus_the_warborn : public CreatureScript
instance->SetData(DATA_BALTHARUS_SHARED_HEALTH, me->GetMaxHealth());
if (Creature* channelTarget = instance->GetCreature(DATA_CRYSTAL_CHANNEL_TARGET))
DoCast(channelTarget, SPELL_BARRIER_CHANNEL);
_cloneCount = RAID_MODE<uint8>(1, 2, 2, 2);
}
void DoAction(int32 action) override
@@ -100,8 +100,8 @@ class boss_baltharus_the_warborn : public CreatureScript
break;
case ACTION_CLONE:
{
DoCastSelf(SPELL_CLEAR_DEBUFFS);
DoCastSelf(SPELL_CLONE);
DoCastSelf(SPELL_CLEAR_DEBUFFS, true);
DoCastSelf(SPELL_CLONE, true);
DoCastSelf(SPELL_REPELLING_WAVE);
Talk(SAY_CLONE);
--_cloneCount;
@@ -150,14 +150,14 @@ class boss_baltharus_the_warborn : public CreatureScript
if (GetDifficulty() == DIFFICULTY_10_N)
{
if (me->HealthBelowPctDamaged(50, damage) && _cloneCount == 1)
DoAction(ACTION_CLONE);
events.ScheduleEvent(EVENT_CLONE, Milliseconds(1));
}
else
{
if (me->HealthBelowPctDamaged(66, damage) && _cloneCount == 2)
DoAction(ACTION_CLONE);
events.ScheduleEvent(EVENT_CLONE, Milliseconds(1));
else if (me->HealthBelowPctDamaged(33, damage) && _cloneCount == 1)
DoAction(ACTION_CLONE);
events.ScheduleEvent(EVENT_CLONE, Milliseconds(1));
}
if (me->GetHealth() > damage)
@@ -173,19 +173,18 @@ class boss_baltharus_the_warborn : public CreatureScript
void UpdateAI(uint32 diff) override
{
bool introPhase = events.IsInPhase(PHASE_INTRO);
if (!introPhase && !UpdateVictim())
if (!events.IsInPhase(PHASE_INTRO) && !UpdateVictim())
return;
if (!introPhase)
if (!events.IsInPhase(PHASE_INTRO))
me->SetHealth(instance->GetData(DATA_BALTHARUS_SHARED_HEALTH));
events.Update(diff);
if (!introPhase && me->HasUnitState(UNIT_STATE_CASTING))
if (!events.IsInPhase(PHASE_INTRO) && me->HasUnitState(UNIT_STATE_CASTING))
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
@@ -210,6 +209,9 @@ class boss_baltharus_the_warborn : public CreatureScript
case EVENT_SUMMONS_ATTACK:
summons.DoZoneInCombat(NPC_BALTHARUS_THE_WARBORN_CLONE);
break;
case EVENT_CLONE:
DoAction(ACTION_CLONE);
break;
default:
break;
}