Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: sql/base/auth_database.sql src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
This commit is contained in:
commit
f5fd7bad69
18 files changed
+129
-145
No files matched your search
@@ -339,14 +339,14 @@ public:
|
||||
waveTimer -= uiDiff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
uint8 wave;
|
||||
uint32 waveTimer;
|
||||
uint64 valrothGUID;
|
||||
|
||||
};
|
||||
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_koltira_deathweaverAI(creature);
|
||||
|
||||
+5
-6
@@ -61,9 +61,7 @@ enum Phases
|
||||
{
|
||||
PHASE_ALL = 0,
|
||||
PHASE_INTRO = 1,
|
||||
PHASE_COMBAT = 2,
|
||||
|
||||
PHASE_INTRO_MASK = 1 << PHASE_INTRO,
|
||||
PHASE_COMBAT = 2
|
||||
};
|
||||
|
||||
class boss_baltharus_the_warborn : public CreatureScript
|
||||
@@ -166,15 +164,16 @@ class boss_baltharus_the_warborn : public CreatureScript
|
||||
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
if (!UpdateVictim() && !(events.GetPhaseMask() & PHASE_INTRO_MASK))
|
||||
bool introPhase = events.IsInPhase(PHASE_INTRO);
|
||||
if (!UpdateVictim() && !introPhase)
|
||||
return;
|
||||
|
||||
if (!(events.GetPhaseMask() & PHASE_INTRO_MASK))
|
||||
if (!introPhase)
|
||||
me->SetHealth(instance->GetData(DATA_BALTHARUS_SHARED_HEALTH));
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) && !introPhase)
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -164,12 +164,7 @@ enum Phases
|
||||
PHASE_INTRO = 1,
|
||||
PHASE_ONE = 2,
|
||||
PHASE_TWO = 3,
|
||||
PHASE_THREE = 4,
|
||||
|
||||
PHASE_INTRO_MASK = 1 << PHASE_INTRO,
|
||||
PHASE_ONE_MASK = 1 << PHASE_ONE,
|
||||
PHASE_TWO_MASK = 1 << PHASE_TWO,
|
||||
PHASE_THREE_MASK = 1 << PHASE_THREE
|
||||
PHASE_THREE = 4
|
||||
};
|
||||
|
||||
enum Misc
|
||||
@@ -324,7 +319,7 @@ class boss_halion : public CreatureScript
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
// Phase 1: We always can evade. Phase 2 & 3: We can evade if and only if the controller tells us to.
|
||||
if ((events.GetPhaseMask() & PHASE_ONE_MASK) || _canEvade)
|
||||
if (events.IsInPhase(PHASE_ONE) || _canEvade)
|
||||
generic_halionAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
@@ -368,7 +363,7 @@ class boss_halion : public CreatureScript
|
||||
|
||||
void DamageTaken(Unit* attacker, uint32& damage)
|
||||
{
|
||||
if (me->HealthBelowPctDamaged(75, damage) && (events.GetPhaseMask() & PHASE_ONE_MASK))
|
||||
if (me->HealthBelowPctDamaged(75, damage) && events.IsInPhase(PHASE_ONE))
|
||||
{
|
||||
events.SetPhase(PHASE_TWO);
|
||||
Talk(SAY_PHASE_TWO);
|
||||
@@ -382,7 +377,7 @@ class boss_halion : public CreatureScript
|
||||
return;
|
||||
}
|
||||
|
||||
if (events.GetPhaseMask() & PHASE_THREE_MASK)
|
||||
if (events.IsInPhase(PHASE_THREE))
|
||||
{
|
||||
// Don't consider copied damage.
|
||||
if (!me->InSamePhase(attacker))
|
||||
@@ -395,7 +390,7 @@ class boss_halion : public CreatureScript
|
||||
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
if (events.GetPhaseMask() & PHASE_TWO_MASK)
|
||||
if (events.IsInPhase(PHASE_TWO))
|
||||
return;
|
||||
|
||||
generic_halionAI::UpdateAI(diff);
|
||||
@@ -527,7 +522,7 @@ class boss_twilight_halion : public CreatureScript
|
||||
|
||||
void DamageTaken(Unit* attacker, uint32& damage)
|
||||
{
|
||||
if (me->HealthBelowPctDamaged(50, damage) && (events.GetPhaseMask() & PHASE_TWO_MASK))
|
||||
if (me->HealthBelowPctDamaged(50, damage) && events.IsInPhase(PHASE_TWO))
|
||||
{
|
||||
events.SetPhase(PHASE_THREE);
|
||||
me->CastStop();
|
||||
@@ -536,7 +531,7 @@ class boss_twilight_halion : public CreatureScript
|
||||
return;
|
||||
}
|
||||
|
||||
if (events.GetPhaseMask() & PHASE_THREE_MASK)
|
||||
if (events.IsInPhase(PHASE_THREE))
|
||||
{
|
||||
// Don't consider copied damage.
|
||||
if (!me->InSamePhase(attacker))
|
||||
@@ -692,7 +687,7 @@ class npc_halion_controller : public CreatureScript
|
||||
// The isInCombat() check is needed because that check should be false when Halion is
|
||||
// not engaged, while it would return true without as UpdateVictim() checks for
|
||||
// combat state.
|
||||
if (!(_events.GetPhaseMask() & PHASE_INTRO_MASK) && me->isInCombat() && !UpdateVictim())
|
||||
if (!(_events.IsInPhase(PHASE_INTRO)) && me->isInCombat() && !UpdateVictim())
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
|
||||
+3
-5
@@ -154,9 +154,7 @@ enum Phases
|
||||
{
|
||||
// Anub'arak
|
||||
PHASE_MELEE = 1,
|
||||
PHASE_SUBMERGED = 2,
|
||||
|
||||
PHASE_MASK_MELEE = 1 << PHASE_MELEE
|
||||
PHASE_SUBMERGED = 2
|
||||
};
|
||||
|
||||
class boss_anubarak_trial : public CreatureScript
|
||||
@@ -403,7 +401,7 @@ class boss_anubarak_trial : public CreatureScript
|
||||
|
||||
}
|
||||
|
||||
if (HealthBelowPct(30) && events.GetPhaseMask() & PHASE_MASK_MELEE && !_reachedPhase3)
|
||||
if (HealthBelowPct(30) && events.IsInPhase(PHASE_MELEE) && !_reachedPhase3)
|
||||
{
|
||||
_reachedPhase3 = true;
|
||||
DoCastAOE(SPELL_LEECHING_SWARM);
|
||||
@@ -411,7 +409,7 @@ class boss_anubarak_trial : public CreatureScript
|
||||
Talk(SAY_LEECHING_SWARM);
|
||||
}
|
||||
|
||||
if (events.GetPhaseMask() & PHASE_MASK_MELEE)
|
||||
if (events.IsInPhase(PHASE_MELEE))
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
|
||||
+28
-30
@@ -18,8 +18,9 @@
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "trial_of_the_crusader.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Player.h"
|
||||
#include "trial_of_the_crusader.h"
|
||||
|
||||
enum Yells
|
||||
{
|
||||
@@ -69,7 +70,6 @@ enum BossSpells
|
||||
SPELL_FEL_INFERNO = 67047,
|
||||
SPELL_FEL_STREAK = 66494,
|
||||
SPELL_LORD_HITTIN = 66326, // special effect preventing more specific spells be cast on the same player within 10 seconds
|
||||
SPELL_MISTRESS_KISS_DEBUFF = 66334,
|
||||
SPELL_MISTRESS_KISS_DAMAGE_SILENCE = 66359
|
||||
};
|
||||
|
||||
@@ -533,6 +533,21 @@ class spell_mistress_kiss : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class MistressKissTargetSelector
|
||||
{
|
||||
public:
|
||||
MistressKissTargetSelector() { }
|
||||
|
||||
bool operator()(WorldObject* unit) const
|
||||
{
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
if (unit->ToPlayer()->getPowerType() == POWER_MANA)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mistress_kiss_area : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -542,44 +557,27 @@ class spell_mistress_kiss_area : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_mistress_kiss_area_SpellScript)
|
||||
|
||||
bool Load()
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (GetCaster())
|
||||
if (sSpellMgr->GetSpellIdForDifficulty(SPELL_MISTRESS_KISS_DEBUFF, GetCaster()))
|
||||
return true;
|
||||
return false;
|
||||
// get a list of players with mana
|
||||
targets.remove_if(MistressKissTargetSelector());
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets);
|
||||
targets.clear();
|
||||
targets.push_back(target);
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
Unit* target = GetHitUnit();
|
||||
if (caster && target)
|
||||
caster->CastSpell(target, SPELL_MISTRESS_KISS_DEBUFF, true);
|
||||
}
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
// get a list of players with mana
|
||||
std::list<WorldObject*> _targets;
|
||||
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
|
||||
if ((*itr)->ToUnit()->getPowerType() == POWER_MANA)
|
||||
_targets.push_back(*itr);
|
||||
|
||||
// pick a random target and kiss him
|
||||
if (WorldObject* _target = Trinity::Containers::SelectRandomContainerElement(_targets))
|
||||
{
|
||||
// correctly fill "targets" for the visual effect
|
||||
targets.clear();
|
||||
targets.push_back(_target);
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(_target->ToUnit(), SPELL_MISTRESS_KISS_DEBUFF, true);
|
||||
}
|
||||
GetCaster()->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mistress_kiss_area_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_mistress_kiss_area_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+3
-6
@@ -146,10 +146,7 @@ enum Phases
|
||||
{
|
||||
PHASE_MOBILE = 1,
|
||||
PHASE_STATIONARY = 2,
|
||||
PHASE_SUBMERGED = 3,
|
||||
|
||||
PHASE_MASK_MOBILE = 1 << PHASE_MOBILE,
|
||||
PHASE_MASK_STATIONARY = 1 << PHASE_STATIONARY
|
||||
PHASE_SUBMERGED = 3
|
||||
};
|
||||
|
||||
class boss_gormok : public CreatureScript
|
||||
@@ -624,9 +621,9 @@ struct boss_jormungarAI : public BossAI
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (events.GetPhaseMask() & PHASE_MASK_MOBILE)
|
||||
if (events.IsInPhase(PHASE_MOBILE))
|
||||
DoMeleeAttackIfReady();
|
||||
if (events.GetPhaseMask() & PHASE_MASK_STATIONARY)
|
||||
if (events.IsInPhase(PHASE_STATIONARY))
|
||||
DoSpellAttackIfReady(SpitSpell);
|
||||
}
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ class boss_bronjahm : public CreatureScript
|
||||
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/)
|
||||
{
|
||||
if (events.GetPhaseMask() & (1 << PHASE_1) && !HealthAbovePct(30))
|
||||
if (events.IsInPhase(PHASE_1) && !HealthAbovePct(30))
|
||||
{
|
||||
events.SetPhase(PHASE_2);
|
||||
DoCast(me, SPELL_TELEPORT);
|
||||
|
||||
@@ -52,11 +52,7 @@ enum Phases
|
||||
{
|
||||
PHASE_ONE = 1,
|
||||
PHASE_TWO = 2,
|
||||
PHASE_THREE = 3,
|
||||
|
||||
PHASE_ONE_MASK = 1 << PHASE_ONE,
|
||||
PHASE_TWO_MASK = 1 << PHASE_TWO,
|
||||
PHASE_THREE_MASK = 1 << PHASE_THREE,
|
||||
PHASE_THREE = 3
|
||||
};
|
||||
|
||||
enum MiscData
|
||||
@@ -136,7 +132,7 @@ enum Events
|
||||
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& /*uiDamage*/)
|
||||
{
|
||||
if (events.GetPhaseMask() & PHASE_ONE_MASK && !HealthAbovePct(66))
|
||||
if (events.IsInPhase(PHASE_ONE) && !HealthAbovePct(66))
|
||||
{
|
||||
events.SetPhase(PHASE_TWO);
|
||||
Talk(SAY_PHASE2);
|
||||
@@ -146,7 +142,7 @@ enum Events
|
||||
return;
|
||||
}
|
||||
|
||||
if (events.GetPhaseMask() & PHASE_TWO_MASK && !HealthAbovePct(33))
|
||||
if (events.IsInPhase(PHASE_TWO) && !HealthAbovePct(33))
|
||||
{
|
||||
events.SetPhase(PHASE_THREE);
|
||||
Talk(SAY_PHASE3);
|
||||
@@ -162,12 +158,12 @@ enum Events
|
||||
if (type != EFFECT_MOTION_TYPE || id != POINT_FORGE)
|
||||
return;
|
||||
|
||||
if (events.GetPhaseMask() & PHASE_TWO_MASK)
|
||||
if (events.IsInPhase(PHASE_TWO))
|
||||
{
|
||||
DoCast(me, SPELL_FORGE_BLADE);
|
||||
SetEquipmentSlots(false, EQUIP_ID_SWORD);
|
||||
}
|
||||
if (events.GetPhaseMask() & PHASE_THREE_MASK)
|
||||
if (events.IsInPhase(PHASE_THREE))
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_FORGE_BLADE_HELPER);
|
||||
DoCast(me, SPELL_FORGE_MACE);
|
||||
@@ -226,15 +222,15 @@ enum Events
|
||||
break;
|
||||
case EVENT_JUMP:
|
||||
me->AttackStop();
|
||||
if (events.GetPhaseMask() & PHASE_TWO_MASK)
|
||||
if (events.IsInPhase(PHASE_TWO))
|
||||
me->GetMotionMaster()->MoveJump(northForgePos.GetPositionX(), northForgePos.GetPositionY(), northForgePos.GetPositionZ(), 25.0f, 15.0f);
|
||||
else if (events.GetPhaseMask() & PHASE_THREE_MASK)
|
||||
else if (events.IsInPhase(PHASE_THREE))
|
||||
me->GetMotionMaster()->MoveJump(southForgePos.GetPositionX(), southForgePos.GetPositionY(), southForgePos.GetPositionZ(), 25.0f, 15.0f);
|
||||
break;
|
||||
case EVENT_RESUME_ATTACK:
|
||||
if (events.GetPhaseMask() & PHASE_TWO_MASK)
|
||||
if (events.IsInPhase(PHASE_THREE))
|
||||
events.ScheduleEvent(EVENT_CHILLING_WAVE, 5000, 0, PHASE_TWO);
|
||||
else if (events.GetPhaseMask() & PHASE_THREE_MASK)
|
||||
else if (events.IsInPhase(PHASE_THREE))
|
||||
events.ScheduleEvent(EVENT_DEEP_FREEZE, 10000, 0, PHASE_THREE);
|
||||
AttackStart(me->getVictim());
|
||||
break;
|
||||
|
||||
@@ -94,7 +94,7 @@ enum Phases
|
||||
PHASE_NONE = 0,
|
||||
PHASE_INTRO = 1,
|
||||
PHASE_COMBAT = 2,
|
||||
PHASE_OUTRO = 3,
|
||||
PHASE_OUTRO = 3
|
||||
};
|
||||
|
||||
enum Actions
|
||||
@@ -168,7 +168,7 @@ class boss_tyrannus : public CreatureScript
|
||||
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
|
||||
if (victim && me->Attack(victim, true) && !(events.GetPhaseMask() & (1 << PHASE_INTRO)))
|
||||
if (victim && me->Attack(victim, true) && !events.IsInPhase(PHASE_INTRO))
|
||||
me->GetMotionMaster()->MoveChase(victim);
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ class boss_tyrannus : public CreatureScript
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim() && !(events.GetPhaseMask() & (1 << PHASE_INTRO)))
|
||||
if (!UpdateVictim() && !events.IsInPhase(PHASE_INTRO))
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
@@ -337,7 +337,7 @@ class boss_rimefang : public CreatureScript
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim() && !(_events.GetPhaseMask() & (1 << PHASE_COMBAT)))
|
||||
if (!UpdateVictim() && !_events.IsInPhase(PHASE_COMBAT))
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
@@ -185,9 +185,7 @@ enum Phases
|
||||
{
|
||||
PHASE_INTRO_A = 1,
|
||||
PHASE_INTRO_H = 2,
|
||||
PHASE_COMBAT = 3,
|
||||
|
||||
PHASE_INTRO_MASK = (1 << PHASE_INTRO_A) | (1 << PHASE_INTRO_H),
|
||||
PHASE_COMBAT = 3
|
||||
};
|
||||
|
||||
enum Actions
|
||||
@@ -424,7 +422,7 @@ class boss_deathbringer_saurfang : public CreatureScript
|
||||
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
if (!UpdateVictim() && !(events.GetPhaseMask() & PHASE_INTRO_MASK))
|
||||
if (!UpdateVictim() && (!events.IsInPhase(PHASE_INTRO_A) || events.IsInPhase(PHASE_INTRO_H)))
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
@@ -612,7 +610,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
|
||||
case ACTION_START_EVENT:
|
||||
{
|
||||
// Prevent crashes
|
||||
if (_events.GetPhaseMask() & PHASE_INTRO_MASK)
|
||||
if (_events.IsInPhase(PHASE_INTRO_A) || _events.IsInPhase(PHASE_INTRO_H))
|
||||
return;
|
||||
|
||||
GetCreatureListWithEntryInGrid(_guardList, me, NPC_SE_KOR_KRON_REAVER, 20.0f);
|
||||
@@ -821,7 +819,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript
|
||||
case ACTION_START_EVENT:
|
||||
{
|
||||
// Prevent crashes
|
||||
if (_events.GetPhaseMask() & PHASE_INTRO_MASK)
|
||||
if (_events.IsInPhase(PHASE_INTRO_A) || _events.IsInPhase(PHASE_INTRO_H))
|
||||
return;
|
||||
|
||||
_events.SetPhase(PHASE_INTRO_A);
|
||||
|
||||
@@ -160,10 +160,7 @@ enum Phases
|
||||
PHASE_ALL = 0,
|
||||
PHASE_INTRO = 1,
|
||||
PHASE_ONE = 2,
|
||||
PHASE_TWO = 3,
|
||||
|
||||
PHASE_INTRO_MASK = 1 << PHASE_INTRO,
|
||||
PHASE_ONE_MASK = 1 << PHASE_ONE,
|
||||
PHASE_TWO = 3
|
||||
};
|
||||
|
||||
enum DeprogrammingData
|
||||
@@ -259,7 +256,7 @@ class boss_lady_deathwhisper : public CreatureScript
|
||||
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
|
||||
if (victim && me->Attack(victim, true) && !(events.GetPhaseMask() & PHASE_ONE_MASK))
|
||||
if (victim && me->Attack(victim, true) && !events.IsInPhase(PHASE_ONE))
|
||||
me->GetMotionMaster()->MoveChase(victim);
|
||||
}
|
||||
|
||||
@@ -358,7 +355,7 @@ class boss_lady_deathwhisper : public CreatureScript
|
||||
void DamageTaken(Unit* /*damageDealer*/, uint32& damage)
|
||||
{
|
||||
// phase transition
|
||||
if (events.GetPhaseMask() & PHASE_ONE_MASK && damage > (uint32)me->GetPower(POWER_MANA))
|
||||
if (events.IsInPhase(PHASE_ONE) && damage > uint32(me->GetPower(POWER_MANA)))
|
||||
{
|
||||
Talk(SAY_PHASE_2);
|
||||
Talk(EMOTE_PHASE_2);
|
||||
@@ -406,12 +403,12 @@ class boss_lady_deathwhisper : public CreatureScript
|
||||
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
if ((!UpdateVictim() && !(events.GetPhaseMask() & PHASE_INTRO_MASK)) || !CheckInRoom())
|
||||
if ((!UpdateVictim() && !events.IsInPhase(PHASE_INTRO)) || !CheckInRoom())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) && !events.IsInPhase(PHASE_INTRO))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -145,10 +145,7 @@ enum Phases
|
||||
PHASE_ROTFACE = 2,
|
||||
PHASE_COMBAT_1 = 4,
|
||||
PHASE_COMBAT_2 = 5,
|
||||
PHASE_COMBAT_3 = 6,
|
||||
|
||||
PHASE_MASK_COMBAT = (1 << PHASE_COMBAT_1) | (1 << PHASE_COMBAT_2) | (1 << PHASE_COMBAT_3),
|
||||
PHASE_MASK_NOT_SELF = (1 << PHASE_FESTERGUT) | (1 << PHASE_ROTFACE)
|
||||
PHASE_COMBAT_3 = 6
|
||||
};
|
||||
|
||||
enum Points
|
||||
@@ -233,7 +230,7 @@ class boss_professor_putricide : public CreatureScript
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (!(events.GetPhaseMask() & PHASE_MASK_NOT_SELF))
|
||||
if (!(events.IsInPhase(PHASE_ROTFACE) || events.IsInPhase(PHASE_FESTERGUT)))
|
||||
instance->SetBossState(DATA_PROFESSOR_PUTRICIDE, NOT_STARTED);
|
||||
instance->SetData(DATA_NAUSEA_ACHIEVEMENT, uint32(true));
|
||||
|
||||
@@ -252,7 +249,7 @@ class boss_professor_putricide : public CreatureScript
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (events.GetPhaseMask() & PHASE_MASK_NOT_SELF)
|
||||
if (events.IsInPhase(PHASE_ROTFACE) || events.IsInPhase(PHASE_FESTERGUT))
|
||||
return;
|
||||
|
||||
if (!instance->CheckRequiredBosses(DATA_PROFESSOR_PUTRICIDE, who->ToPlayer()))
|
||||
@@ -282,7 +279,7 @@ class boss_professor_putricide : public CreatureScript
|
||||
{
|
||||
_JustReachedHome();
|
||||
me->SetWalk(false);
|
||||
if (events.GetPhaseMask() & PHASE_MASK_COMBAT)
|
||||
if (events.IsInPhase(PHASE_COMBAT_1) || events.IsInPhase(PHASE_COMBAT_2) || events.IsInPhase(PHASE_COMBAT_3))
|
||||
instance->SetBossState(DATA_PROFESSOR_PUTRICIDE, FAIL);
|
||||
}
|
||||
|
||||
@@ -568,7 +565,7 @@ class boss_professor_putricide : public CreatureScript
|
||||
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
if ((!(events.GetPhaseMask() & PHASE_MASK_NOT_SELF) && !UpdateVictim()) || !CheckInRoom())
|
||||
if ((!(events.IsInPhase(PHASE_ROTFACE) || events.IsInPhase(PHASE_FESTERGUT)) && !UpdateVictim()) || !CheckInRoom())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
@@ -279,20 +279,10 @@ enum Phases
|
||||
PHASE_THREE = 4,
|
||||
PHASE_TRANSITION = 5,
|
||||
PHASE_FROSTMOURNE = 6, // only set on heroic mode when all players are sent into frostmourne
|
||||
PHASE_OUTRO = 7,
|
||||
|
||||
PHASE_MASK_INTRO = 1 << PHASE_INTRO,
|
||||
PHASE_MASK_ONE = 1 << PHASE_ONE,
|
||||
PHASE_MASK_TWO = 1 << PHASE_TWO,
|
||||
PHASE_MASK_THREE = 1 << PHASE_THREE,
|
||||
PHASE_MASK_TRANSITION = 1 << PHASE_TRANSITION,
|
||||
PHASE_MASK_NO_CAST_CHECK = (1 << PHASE_TRANSITION) | (1 << PHASE_FROSTMOURNE) | (1 << PHASE_OUTRO),
|
||||
PHASE_MASK_FROSTMOURNE = 1 << PHASE_FROSTMOURNE,
|
||||
PHASE_MASK_OUTRO = 1 << PHASE_OUTRO,
|
||||
PHASE_MASK_NO_VICTIM = (1 << PHASE_INTRO) | (1 << PHASE_OUTRO) | (1 << PHASE_FROSTMOURNE),
|
||||
PHASE_OUTRO = 7
|
||||
};
|
||||
|
||||
#define PHASE_TWO_THREE (events.GetPhaseMask() & PHASE_MASK_TWO ? PHASE_TWO : PHASE_THREE)
|
||||
#define PHASE_TWO_THREE (events.IsInPhase(PHASE_TWO) ? PHASE_TWO : PHASE_THREE)
|
||||
|
||||
Position const CenterPosition = {503.6282f, -2124.655f, 840.8569f, 0.0f};
|
||||
Position const TirionIntro = {489.2970f, -2124.840f, 840.8569f, 0.0f};
|
||||
@@ -570,7 +560,7 @@ class boss_the_lich_king : public CreatureScript
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && !me->IsInEvadeMode() && !(events.GetPhaseMask() & PHASE_MASK_OUTRO))
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && !me->IsInEvadeMode() && !events.IsInPhase(PHASE_OUTRO))
|
||||
Talk(SAY_LK_KILL);
|
||||
}
|
||||
|
||||
@@ -650,7 +640,7 @@ class boss_the_lich_king : public CreatureScript
|
||||
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/)
|
||||
{
|
||||
if (events.GetPhaseMask() & PHASE_MASK_ONE && !HealthAbovePct(70))
|
||||
if (events.IsInPhase(PHASE_ONE) && !HealthAbovePct(70))
|
||||
{
|
||||
events.SetPhase(PHASE_TRANSITION);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
@@ -659,7 +649,7 @@ class boss_the_lich_king : public CreatureScript
|
||||
return;
|
||||
}
|
||||
|
||||
if (events.GetPhaseMask() & PHASE_MASK_TWO && !HealthAbovePct(40))
|
||||
if (events.IsInPhase(PHASE_TWO) && !HealthAbovePct(40))
|
||||
{
|
||||
events.SetPhase(PHASE_TRANSITION);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
@@ -668,7 +658,7 @@ class boss_the_lich_king : public CreatureScript
|
||||
return;
|
||||
}
|
||||
|
||||
if (events.GetPhaseMask() & PHASE_MASK_THREE && !HealthAbovePct(10))
|
||||
if (events.IsInPhase(PHASE_THREE) && !HealthAbovePct(10))
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->AttackStop();
|
||||
@@ -739,7 +729,7 @@ class boss_the_lich_king : public CreatureScript
|
||||
summon->SetReactState(REACT_PASSIVE);
|
||||
summon->SetSpeed(MOVE_FLIGHT, 0.5f);
|
||||
summon->GetMotionMaster()->MoveRandom(10.0f);
|
||||
if (!(events.GetPhaseMask() & PHASE_MASK_FROSTMOURNE))
|
||||
if (!events.IsInPhase(PHASE_FROSTMOURNE))
|
||||
summon->m_Events.AddEvent(new VileSpiritActivateEvent(summon), summon->m_Events.CalculateTime(15000));
|
||||
return;
|
||||
}
|
||||
@@ -854,14 +844,14 @@ class boss_the_lich_king : public CreatureScript
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
// check phase first to prevent updating victim and entering evade mode when not wanted
|
||||
if (!(events.GetPhaseMask() & PHASE_MASK_NO_VICTIM))
|
||||
if (!(events.IsInPhase(PHASE_OUTRO) || events.IsInPhase(PHASE_INTRO) || events.IsInPhase(PHASE_FROSTMOURNE)))
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
// during Remorseless Winter phases The Lich King is channeling a spell, but we must continue casting other spells
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) && !(events.GetPhaseMask() & PHASE_MASK_NO_CAST_CHECK))
|
||||
if ((me->HasUnitState(UNIT_STATE_CASTING) && !events.IsInPhase(PHASE_TRANSITION)) || events.IsInPhase(PHASE_OUTRO) || events.IsInPhase(PHASE_FROSTMOURNE))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -917,7 +907,7 @@ class boss_the_lich_king : public CreatureScript
|
||||
break;
|
||||
case EVENT_INFEST:
|
||||
DoCast(me, SPELL_INFEST);
|
||||
events.ScheduleEvent(EVENT_INFEST, urand(21000, 24000), 0, (events.GetPhaseMask() & PHASE_MASK_ONE) ? PHASE_ONE : PHASE_TWO);
|
||||
events.ScheduleEvent(EVENT_INFEST, urand(21000, 24000), 0, events.IsInPhase(PHASE_ONE) ? PHASE_ONE : PHASE_TWO);
|
||||
break;
|
||||
case EVENT_NECROTIC_PLAGUE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, NecroticPlagueTargetCheck(me, NECROTIC_PLAGUE_LK, NECROTIC_PLAGUE_PLR)))
|
||||
@@ -986,7 +976,7 @@ class boss_the_lich_king : public CreatureScript
|
||||
break;
|
||||
case EVENT_START_ATTACK:
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
if (events.GetPhaseMask() & PHASE_MASK_FROSTMOURNE)
|
||||
if (events.IsInPhase(PHASE_FROSTMOURNE))
|
||||
events.SetPhase(PHASE_THREE);
|
||||
break;
|
||||
case EVENT_VILE_SPIRITS:
|
||||
@@ -1234,7 +1224,7 @@ class npc_tirion_fordring_tft : public CreatureScript
|
||||
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
if (!UpdateVictim() && !(_events.GetPhaseMask() & (PHASE_MASK_INTRO | PHASE_MASK_OUTRO)))
|
||||
if (!UpdateVictim() && !(_events.IsInPhase(PHASE_OUTRO) || _events.IsInPhase(PHASE_INTRO)))
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
@@ -176,10 +176,7 @@ enum EncounterPhases
|
||||
{
|
||||
PHASE_NORMAL = 0,
|
||||
PHASE_ROLE_PLAY = 1,
|
||||
PHASE_BIG_BANG = 2,
|
||||
|
||||
PHASE_MASK_NO_UPDATE = (1 << PHASE_ROLE_PLAY) | (1 << PHASE_BIG_BANG),
|
||||
PHASE_MASK_NO_CAST_CHECK = 1 << PHASE_ROLE_PLAY,
|
||||
PHASE_BIG_BANG = 2
|
||||
};
|
||||
|
||||
enum AchievmentInfo
|
||||
@@ -542,12 +539,12 @@ class boss_algalon_the_observer : public CreatureScript
|
||||
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
if ((!(events.GetPhaseMask() & PHASE_MASK_NO_UPDATE) && !UpdateVictim()) || !CheckInRoom())
|
||||
if ((!(events.IsInPhase(PHASE_ROLE_PLAY) || events.IsInPhase(PHASE_BIG_BANG)) && !UpdateVictim()) || !CheckInRoom())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (!(events.GetPhaseMask() & PHASE_MASK_NO_CAST_CHECK))
|
||||
if (!events.IsInPhase(PHASE_ROLE_PLAY))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
@@ -772,7 +769,7 @@ class npc_living_constellation : public CreatureScript
|
||||
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
if (!(_events.GetPhaseMask() & PHASE_MASK_NO_UPDATE) && !UpdateVictim())
|
||||
if (!(_events.IsInPhase(PHASE_ROLE_PLAY) || _events.IsInPhase(PHASE_BIG_BANG)) && !UpdateVictim())
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
@@ -154,7 +154,7 @@ public:
|
||||
Talk(YELL_DEAD_1);
|
||||
}
|
||||
|
||||
if (events.GetPhaseMask() & (1 << PHASE_EVENT))
|
||||
if (events.IsInPhase(PHASE_EVENT))
|
||||
damage = 0;
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ public:
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim() && !(events.GetPhaseMask() & (1 << PHASE_EVENT)))
|
||||
if (!UpdateVictim() && !events.IsInPhase(PHASE_EVENT))
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
Reference in new issue
Block a user