chore(Core/Misc): Some cleanup (#19970)

* remove weird blanks

* update if

* ) ) to ))

* missed some ) )

* now switch

* .
This commit is contained in:
Kitzunu 2024-09-21 19:34:31 +02:00 committed by GitHub
parent 0ba59c0053
commit 386aea03ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
157 changed files with 1606 additions and 1616 deletions

View file

@ -194,7 +194,7 @@ public:
_events.Update(diff);
switch(_events.ExecuteEvent())
switch (_events.ExecuteEvent())
{
case EVENT_SPELL_FIREBLAST:
DoCastVictim(SPELL_FIREBLAST);

View file

@ -218,7 +218,7 @@ public:
_events.Update(diff);
switch(_events.ExecuteEvent())
switch (_events.ExecuteEvent())
{
case EVENT_SPELL_SHADOWBOLTVOLLEY:
DoCastVictim(SPELL_SHADOWBOLTVOLLEY);

View file

@ -456,7 +456,7 @@ public:
{
case TYPE_RING_OF_LAW:
encounter[0] = data;
switch(data)
switch (data)
{
case IN_PROGRESS:
TempSummonGrimstone = instance->SummonCreature(NPC_GRIMSTONE, GrimstonePositon);

View file

@ -358,7 +358,7 @@ public:
}
break;
case DATA_SOLAKAR_FLAMEWREATH:
switch(data)
switch (data)
{
case IN_PROGRESS:
if (SolakarState == NOT_STARTED)

View file

@ -242,7 +242,7 @@ struct boss_nightbane : public BossAI
_skeletonscheduler.Schedule(50ms, [this](TaskContext context)
{
//spawns skeletons every 2 seconds until skeletonCount is reached
if(_skeletonSpawnCounter < _skeletonCount)
if (_skeletonSpawnCounter < _skeletonCount)
{
me->CastSpell(_skeletonSpawnPos.GetPositionX(), _skeletonSpawnPos.GetPositionY(), _skeletonSpawnPos.GetPositionZ(), SPELL_SUMMON_SKELETON, true);
_skeletonSpawnCounter++;

View file

@ -941,7 +941,7 @@ struct boss_julianne : public ScriptedAI
void DoAction(int32 action) override
{
switch(action)
switch (action)
{
case ACTION_FAKING_DEATH:
isFakingDeath = false;
@ -1138,7 +1138,7 @@ struct boss_romulo : public ScriptedAI
void DoAction(int32 action) override
{
switch(action)
switch (action)
{
case ACTION_FAKING_DEATH:
isFakingDeath = false;

View file

@ -456,7 +456,7 @@ public:
uint32 NextStep(uint32 nextStep)
{
switch(nextStep)
switch (nextStep)
{
case 1:
Talk(SAY_DIALOG_MEDIVH_1);

View file

@ -140,7 +140,7 @@ public:
void SetData(uint32 type, uint32 data) override
{
switch(type)
switch (type)
{
case TYPE_MOGRAINE_AND_WHITE_EVENT:
if (data == IN_PROGRESS)
@ -317,7 +317,7 @@ public:
mograine->Kill(me, me, true);
return 0;
default:
if(mograine)
if (mograine)
mograine->DespawnOrUnsummon(0);
return 0;
}
@ -468,7 +468,7 @@ public:
while (uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
switch (eventId)
{
case EVENT_SPELL_CRUSADER_STRIKE:
me->CastSpell(me->GetVictim(), SPELL_CRUSADER_STRIKE, true);

View file

@ -417,7 +417,7 @@ public:
return;
}
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 1:
me->CastSpell(me, BONE_ARMOR_SPELL, false);

View file

@ -281,7 +281,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case EVENT_RESTORE_COMBAT:
me->SetReactState(REACT_AGGRESSIVE);

View file

@ -193,7 +193,7 @@ public:
{
me->RemoveAurasDueToSpell(67541);
me->GetMotionMaster()->MoveCharge(11779.30f, -7065.43f, 24.92f, me->GetSpeed(MOVE_RUN), EVENT_CHARGE);
switch(summon->GetEntry())
switch (summon->GetEntry())
{
case NPC_SCOURGE_ZOMBIE:
events.ScheduleEvent(EVENT_SPAWN_WAVE_2, 3000);

View file

@ -517,7 +517,7 @@ public:
void WaypointReached(uint32 uiPointId) override
{
switch(uiPointId)
switch (uiPointId)
{
// Starting waypoint, After reaching uther and jaina
case 0:

View file

@ -97,7 +97,7 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
case ACHIEV_CRITERIA_MANY_WHELPS_10_PLAYER:
case ACHIEV_CRITERIA_MANY_WHELPS_25_PLAYER:

View file

@ -330,12 +330,12 @@ public:
instance->SetData(DATA_PYRAMID, PYRAMID_CAGES_OPEN);
//setting gossip option as soon as the cages open
if(Creature* bly = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_BLY)))
if (Creature* bly = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_BLY)))
{
bly->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
}
if(Creature* weegli = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_WEEGLI)))
if (Creature* weegli = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_WEEGLI)))
{
weegli->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
}

View file

@ -256,7 +256,7 @@ public:
void JustSummoned(Creature* summon) override
{
if(summon->GetEntry() != me->GetEntry())
if (summon->GetEntry() != me->GetEntry())
{
summon->GetMotionMaster()->MovePoint(0, *me, false);
summon->GetMotionMaster()->MoveFollow(me, 0.1f, 0.0f + M_PI * 0.3f * summons.size());

View file

@ -48,7 +48,7 @@ public:
void OnCreatureCreate(Creature* pCreature) override
{
switch(pCreature->GetEntry())
switch (pCreature->GetEntry())
{
case NPC_SARTHARION:
m_uiSartharionGUID = pCreature->GetGUID();
@ -67,7 +67,7 @@ public:
ObjectGuid GetGuidData(uint32 uiData) const override
{
switch(uiData)
switch (uiData)
{
case DATA_SARTHARION:
return m_uiSartharionGUID;
@ -84,7 +84,7 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* source, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
// Gonna Go When the Volcano Blows (10 player) (2047)
case 7326:

View file

@ -104,19 +104,19 @@ public:
{
events.Reset();
me->SetReactState(REACT_PASSIVE);
if( pInstance )
if (pInstance)
pInstance->SetData(BOSS_ARGENT_CHALLENGE, NOT_STARTED);
}
void MovementInform(uint32 type, uint32 id) override
{
if( type == POINT_MOTION_TYPE && id == 1 )
if (type == POINT_MOTION_TYPE && id == 1)
me->SetFacingTo(3 * M_PI / 2);
}
void KilledUnit(Unit* who) override
{
if( who->IsPlayer() )
if (who->IsPlayer())
{
Talk(SAY_EADRIC_KILL_PLAYER);
}
@ -129,7 +129,7 @@ public:
events.ScheduleEvent(EVENT_SPELL_HAMMER_RIGHTEOUS, 25000);
Talk(SAY_EADRIC_AGGRO);
me->CastSpell(me, SPELL_VENGEANCE, false);
if( pInstance )
if (pInstance)
pInstance->SetData(BOSS_ARGENT_CHALLENGE, IN_PROGRESS);
}
@ -141,7 +141,7 @@ public:
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
if( damage >= me->GetHealth() )
if (damage >= me->GetHealth())
{
damage = me->GetHealth() - 1;
if (me->GetFaction() != FACTION_FRIENDLY)
@ -156,7 +156,7 @@ public:
_EnterEvadeMode();
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(true);
if( pInstance )
if (pInstance)
pInstance->SetData(BOSS_ARGENT_CHALLENGE, DONE);
}
}
@ -164,15 +164,15 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -182,7 +182,7 @@ public:
events.Repeat(16s);
break;
case EVENT_SPELL_HAMMER_RIGHTEOUS:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 55.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 55.0f, true))
{
Talk(SAY_EADRIC_EMOTE_HAMMER_RIGHTEOUS, target);
Talk(SAY_EADRIC_HAMMER_RIGHTEOUS);
@ -224,26 +224,26 @@ public:
{
events.Reset();
summoned = false;
if( MemoryGUID )
if (MemoryGUID)
{
if( Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID) )
if (Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID))
memory->DespawnOrUnsummon();
MemoryGUID.Clear();
}
me->SetReactState(REACT_PASSIVE);
if( pInstance )
if (pInstance)
pInstance->SetData(BOSS_ARGENT_CHALLENGE, NOT_STARTED);
}
void MovementInform(uint32 type, uint32 id) override
{
if( type == POINT_MOTION_TYPE && id == 1 )
if (type == POINT_MOTION_TYPE && id == 1)
me->SetFacingTo(3 * M_PI / 2);
}
void KilledUnit(Unit* who) override
{
if( who->IsPlayer() )
if (who->IsPlayer())
{
Talk(SAY_PALETRESS_KILL_PLAYER);
}
@ -256,22 +256,22 @@ public:
events.ScheduleEvent(EVENT_SPELL_SMITE, 2s, 3s);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
Talk(SAY_PALETRESS_AGGRO);
if( pInstance )
if (pInstance)
pInstance->SetData(BOSS_ARGENT_CHALLENGE, IN_PROGRESS);
}
void DoAction(int32 param) override
{
if( param == 1 )
if (param == 1)
{
MemoryGUID.Clear();
me->RemoveAura(SPELL_SHIELD);
Talk(SAY_PALETRESS_MEMORY_DEATH);
}
else if( param == (-1) )
else if (param == (-1))
{
if( MemoryGUID )
if( Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID) )
if (MemoryGUID)
if (Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID))
{
memory->DespawnOrUnsummon();
MemoryGUID.Clear();
@ -281,10 +281,10 @@ public:
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
//if( me->HasAura(SPELL_SHIELD) )
//if (me->HasAura(SPELL_SHIELD))
// return;
if( damage >= me->GetHealth() )
if (damage >= me->GetHealth())
{
damage = me->GetHealth() - 1;
@ -299,7 +299,7 @@ public:
_EnterEvadeMode();
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(true);
if( pInstance )
if (pInstance)
{
pInstance->SetData(BOSS_ARGENT_CHALLENGE, DONE);
pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 68206);
@ -310,7 +310,7 @@ public:
void JustSummoned(Creature* summon) override
{
if( pInstance )
if (pInstance)
pInstance->SetData(DATA_MEMORY_ENTRY, summon->GetEntry());
MemoryGUID = summon->GetGUID();
}
@ -324,12 +324,12 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( !summoned && HealthBelowPct(25) )
if (!summoned && HealthBelowPct(25))
{
me->InterruptNonMeleeSpells(true);
Talk(SAY_PALETRESS_MEMORY_SUMMON);
@ -343,32 +343,32 @@ public:
return;
}
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_SMITE:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
me->CastSpell(target, SPELL_SMITE, false);
events.Repeat(3s, 4s);
break;
case EVENT_SPELL_HOLY_FIRE:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
me->CastSpell(target, SPELL_HOLY_FIRE, false);
events.Repeat(9s, 12s);
break;
case EVENT_SPELL_RENEW:
if( !MemoryGUID )
if (!MemoryGUID)
{
break;
}
if( urand(0, 1) )
if (urand(0, 1))
me->CastSpell(me, SPELL_RENEW, false);
else if( Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID) )
if( memory->IsAlive() )
else if (Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID))
if (memory->IsAlive())
me->CastSpell(memory, SPELL_RENEW, false);
events.Repeat(15s, 17s);
break;
@ -410,8 +410,8 @@ public:
void JustDied(Unit* /*killer*/) override
{
me->DespawnOrUnsummon(20000);
if( pInstance )
if( Creature* paletress = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(DATA_PALETRESS)) )
if (pInstance)
if (Creature* paletress = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(DATA_PALETRESS)))
paletress->AI()->DoAction(1);
}
@ -421,10 +421,10 @@ public:
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -436,7 +436,7 @@ public:
case EVENT_MEMORY_START_ATTACK:
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(false);
if( Unit* target = me->SelectNearestTarget(200.0f) )
if (Unit* target = me->SelectNearestTarget(200.0f))
{
AttackStart(target);
DoZoneInCombat();
@ -447,12 +447,12 @@ public:
events.ScheduleEvent(EVENT_SPELL_WAKING_NIGHTMARE, 20s, 30s);
break;
case EVENT_SPELL_OLD_WOUNDS:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 10.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 10.0f, true))
me->CastSpell(target, SPELL_OLD_WOUNDS, true);
events.Repeat(12s);
break;
case EVENT_SPELL_SHADOWS_PAST:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
me->CastSpell(target, SPELL_SHADOWS_PAST, false);
events.Repeat(15s, 20s);
break;
@ -541,9 +541,9 @@ public:
void WaypointReached(uint32 uiPoint) override
{
if( uiPoint == 1 )
if (uiPoint == 1)
{
switch( uiWaypoint )
switch (uiWaypoint)
{
case 0:
me->SetFacingTo(5.4f);
@ -561,10 +561,10 @@ public:
void SetData(uint32 uiType, uint32 /*uiData*/) override
{
AddWaypoint(0, me->GetPositionX(), 660.0f, 411.80f);
switch( me->GetEntry() )
switch (me->GetEntry())
{
case NPC_ARGENT_LIGHTWIELDER:
switch( uiType )
switch (uiType)
{
case 0:
AddWaypoint(1, 716.321f, 647.047f, 411.93f);
@ -578,7 +578,7 @@ public:
}
break;
case NPC_ARGENT_MONK:
switch( uiType )
switch (uiType)
{
case 0:
AddWaypoint(1, 717.86f, 649.0f, 411.923f);
@ -592,7 +592,7 @@ public:
}
break;
case NPC_PRIESTESS:
switch( uiType )
switch (uiType)
{
case 0:
AddWaypoint(1, 719.872f, 650.94f, 411.93f);
@ -613,7 +613,7 @@ public:
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
if( bCheck && damage >= me->GetHealth() )
if (bCheck && damage >= me->GetHealth())
{
bCheck = false;
damage = me->GetHealth() - 1;
@ -625,25 +625,25 @@ public:
void JustEngagedWith(Unit* /*who*/) override
{
switch( me->GetEntry() )
switch (me->GetEntry())
{
case NPC_ARGENT_MONK:
events.RescheduleEvent(EVENT_MONK_SPELL_FLURRY_OF_BLOWS, 5s);
events.RescheduleEvent(EVENT_MONK_SPELL_PUMMEL, 7s);
if( IsHeroic() )
if (IsHeroic())
bCheck = true;
break;
case NPC_PRIESTESS:
events.RescheduleEvent(EVENT_PRIESTESS_SPELL_HOLY_SMITE, 5s, 8s);
events.RescheduleEvent(EVENT_PRIESTESS_SPELL_SHADOW_WORD_PAIN, 3s, 6s);
events.RescheduleEvent(EVENT_PRIESTESS_SPELL_FOUNTAIN_OF_LIGHT, 8s, 15s);
if( IsHeroic() )
if (IsHeroic())
events.RescheduleEvent(EVENT_PRIESTESS_SPELL_MIND_CONTROL_H, 12s);
break;
case NPC_ARGENT_LIGHTWIELDER:
events.RescheduleEvent(EVENT_LIGHTWIELDER_SPELL_BLAZING_LIGHT, 12s, 15s);
events.RescheduleEvent(EVENT_LIGHTWIELDER_SPELL_CLEAVE, 3s, 5s);
if( IsHeroic() )
if (IsHeroic())
events.RescheduleEvent(EVENT_LIGHTWIELDER_SPELL_UNBALANCING_STRIKE_H, 8s, 12s);
break;
}
@ -653,15 +653,15 @@ public:
{
npc_escortAI::UpdateAI(diff);
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -671,18 +671,18 @@ public:
events.Repeat(12s, 18s);
break;
case EVENT_MONK_SPELL_PUMMEL:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_PUMMEL, false);
events.Repeat(8s, 11s);
break;
case EVENT_PRIESTESS_SPELL_HOLY_SMITE:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_HOLY_SMITE, false);
events.Repeat(6s, 8s);
break;
case EVENT_PRIESTESS_SPELL_SHADOW_WORD_PAIN:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_SHADOW_WORD_PAIN, false);
events.Repeat(12s, 15s);
break;
@ -691,7 +691,7 @@ public:
events.Repeat(35s, 45s);
break;
case EVENT_PRIESTESS_SPELL_MIND_CONTROL_H:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
me->CastSpell(target, SPELL_MIND_CONTROL_H, false);
events.Repeat(22s, 30s);
break;
@ -699,19 +699,19 @@ public:
case EVENT_LIGHTWIELDER_SPELL_BLAZING_LIGHT:
{
Unit* target = DoSelectLowestHpFriendly(40.0f);
if( !target )
if (!target)
target = me;
me->CastSpell(target, SPELL_BLAZING_LIGHT, false);
events.Repeat(8s, 12s);
}
break;
case EVENT_LIGHTWIELDER_SPELL_CLEAVE:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_CLEAVE, false);
events.Repeat(6s, 8s);
break;
case EVENT_LIGHTWIELDER_SPELL_UNBALANCING_STRIKE_H:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_UNBALANCING_STRIKE_H, false);
events.Repeat(12s, 15s);
break;
@ -723,7 +723,7 @@ public:
void JustDied(Unit* /*pKiller*/) override
{
me->DespawnOrUnsummon(10000);
if( pInstance )
if (pInstance)
pInstance->SetData(DATA_ARGENT_SOLDIER_DEFEATED, 0);
}
};
@ -742,7 +742,7 @@ class spell_eadric_radiance : public SpellScript
{
std::list<WorldObject*> tmplist;
for( std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
if( (*itr)->ToUnit()->HasInArc(M_PI, GetCaster()) )
if ((*itr)->ToUnit()->HasInArc(M_PI, GetCaster()))
tmplist.push_back(*itr);
targets.clear();
@ -798,8 +798,8 @@ class spell_reflective_shield_aura : public AuraScript
void HandleAfterEffectAbsorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
{
if( Unit* attacker = dmgInfo.GetAttacker() )
if( GetOwner() && attacker->GetGUID() != GetOwner()->GetGUID() )
if (Unit* attacker = dmgInfo.GetAttacker())
if (GetOwner() && attacker->GetGUID() != GetOwner()->GetGUID())
{
int32 damage = (int32)(absorbAmount * 0.25f);
GetOwner()->ToUnit()->CastCustomSpell(attacker, SPELL_REFLECTIVE_SHIELD_DAMAGE, &damage, nullptr, nullptr, true);

View file

@ -123,7 +123,7 @@ public:
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(true);
me->SetReactState(REACT_PASSIVE);
if( pInstance )
if (pInstance)
pInstance->SetData(BOSS_BLACK_KNIGHT, NOT_STARTED);
//me->SetLootMode(0); // [LOOT]
@ -143,7 +143,7 @@ public:
return;
}
if( Phase < 3 && damage >= me->GetHealth() )
if (Phase < 3 && damage >= me->GetHealth())
{
damage = 0;
me->SetHealth(me->GetMaxHealth());
@ -164,19 +164,19 @@ public:
void DoAction(int32 param) override
{
if( param == -1 )
if (param == -1)
{
summons.DespawnAll();
}
else if( param == 1 )
else if (param == 1)
{
if( !pInstance )
if (!pInstance)
return;
pInstance->SetData(BOSS_BLACK_KNIGHT, IN_PROGRESS);
Talk(SAY_BK_AGGRO);
me->CastSpell((Unit*)nullptr, (pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? SPELL_RAISE_DEAD_JAEREN : SPELL_RAISE_DEAD_ARELAS), false);
if( Creature* announcer = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_ANNOUNCER)) )
if (Creature* announcer = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_ANNOUNCER)))
announcer->DespawnOrUnsummon();
events.Reset();
@ -190,7 +190,7 @@ public:
void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) override
{
switch( spell->Id )
switch (spell->Id)
{
case SPELL_BLACK_KNIGHT_RES:
me->SetHealth(me->GetMaxHealth());
@ -205,7 +205,7 @@ public:
++Phase;
switch( Phase )
switch (Phase)
{
case 2:
me->SetDisplayId(MODEL_SKELETON);
@ -236,46 +236,46 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_ANNOUNCER_SAY_ZOMBIE:
if( pInstance && !summons.empty() )
if( Creature* ghoul = pInstance->instance->GetCreature(*summons.begin()) )
if (pInstance && !summons.empty())
if (Creature* ghoul = pInstance->instance->GetCreature(*summons.begin()))
if (urand(0, 1))
ghoul->Yell("[Zombie] .... . Brains ....", LANG_UNIVERSAL); /// @todo: Multiple variations + not always happening, from video sources, needs sniff to transition from DB.
break;
case EVENT_SPELL_PLAGUE_STRIKE:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_PLAGUE_STRIKE, false);
events.Repeat(10s, 12s);
break;
case EVENT_SPELL_ICY_TOUCH:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_ICY_TOUCH, false);
events.Repeat(5s, 6s);
break;
case EVENT_SPELL_DEATH_RESPITE:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
me->CastSpell(target, SPELL_DEATH_RESPITE, false);
events.Repeat(13s, 15s);
break;
case EVENT_SPELL_OBLITERATE:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_OBLITERATE, false);
events.Repeat(15s, 17s);
break;
case EVENT_SPELL_DESECRATION:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
me->CastSpell(target, SPELL_DESECRATION, false);
events.Repeat(14s, 17s);
break;
@ -284,7 +284,7 @@ public:
events.Repeat(2s, 4s);
break;
case EVENT_SPELL_MARKED_DEATH:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.000000f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.000000f, true))
me->CastSpell(target, SPELL_MARKED_DEATH, false);
events.Repeat(9s);
break;
@ -296,7 +296,7 @@ public:
void JustSummoned(Creature* summon) override
{
summons.Summon(summon);
if( Unit* target = summon->SelectNearestTarget(200.0f) )
if (Unit* target = summon->SelectNearestTarget(200.0f))
{
summon->AI()->AttackStart(target);
DoZoneInCombat(summon);
@ -305,7 +305,7 @@ public:
void KilledUnit(Unit* victim) override
{
if( victim->IsPlayer() )
if (victim->IsPlayer())
{
Talk(SAY_BK_KILL_PLAYER);
}
@ -315,9 +315,9 @@ public:
{
me->CastSpell((Unit*)nullptr, SPELL_BK_KILL_CREDIT, true);
Talk(SAY_BK_DEATH);
if( pInstance )
if (pInstance)
pInstance->SetData(BOSS_BLACK_KNIGHT, DONE);
if( me->ToTempSummon() )
if (me->ToTempSummon())
me->ToTempSummon()->SetTempSummonType(TEMPSUMMON_MANUAL_DESPAWN);
}
};
@ -347,7 +347,7 @@ public:
void DoAction(int32 param) override
{
if( param == 1 )
if (param == 1)
{
me->SetControlled(false, UNIT_STATE_ROOT);
me->DisableRotate(false);
@ -358,7 +358,7 @@ public:
void WaypointReached(uint32 i) override
{
if( i == 12 )
if (i == 12)
{
SetEscortPaused(true);
me->SetOrientation(3.62f);
@ -366,7 +366,7 @@ public:
me->DisableRotate(true);
me->SetFacingTo(3.62f);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_MOUNT_SPECIAL);
if( InstanceScript* pInstance = me->GetInstanceScript() )
if (InstanceScript* pInstance = me->GetInstanceScript())
pInstance->SetData(DATA_SKELETAL_GRYPHON_LANDED, 0);
}
}
@ -422,7 +422,7 @@ public:
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
switch(spell->Id)
switch (spell->Id)
{
case SPELL_CLAW_N:
case SPELL_CLAW_H:
@ -443,15 +443,15 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -173,7 +173,7 @@ public:
if (me->IsDuringRemoveFromWorld())
return;
if( apply )
if (apply)
{
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetSpeed(MOVE_RUN, 2.0f, false);
@ -193,7 +193,7 @@ public:
if (me->IsDuringRemoveFromWorld())
return;
if( !apply )
if (!apply)
{
me->RemoveAura(SPELL_PLAYER_VEHICLE_DEFEND);
who->RemoveAura(SPELL_PLAYER_VEHICLE_DEFEND);
@ -260,7 +260,7 @@ public:
void UpdateAI(uint32 diff) override
{
if( ShieldTimer <= (int32)diff )
if (ShieldTimer <= (int32)diff )
{
me->CastSpell(me, SPELL_MINIONS_DEFEND, true);
ShieldTimer = 5000;
@ -268,15 +268,15 @@ public:
else
ShieldTimer -= diff;
if ( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -285,22 +285,22 @@ public:
GuidVector LIST;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if( Player* plr = itr->GetSource() )
if (Player* plr = itr->GetSource())
{
if( me->GetExactDist(plr) < 8.0f || me->GetExactDist(plr) > 25.0f || plr->isDead() )
if (me->GetExactDist(plr) < 8.0f || me->GetExactDist(plr) > 25.0f || plr->isDead())
continue;
if( !plr->GetVehicle() )
if (!plr->GetVehicle())
LIST.push_back(plr->GetGUID());
else if( Vehicle* v = plr->GetVehicle() )
else if (Vehicle* v = plr->GetVehicle())
{
if( Unit* mount = v->GetBase() )
if (Unit* mount = v->GetBase())
LIST.push_back(mount->GetGUID());
}
}
if( !LIST.empty() )
if (!LIST.empty())
{
uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
if( Unit* target = ObjectAccessor::GetUnit(*me, LIST.at(rnd)) )
if (Unit* target = ObjectAccessor::GetUnit(*me, LIST.at(rnd)))
{
me->GetThreatMgr().ResetAllThreat();
me->AddThreat(target, 10000.0f);
@ -316,25 +316,25 @@ public:
GuidVector LIST;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if( Player* plr = itr->GetSource() )
if (Player* plr = itr->GetSource())
{
if( me->GetExactDist(plr) < 10.0f || me->GetExactDist(plr) > 30.0f )
if (me->GetExactDist(plr) < 10.0f || me->GetExactDist(plr) > 30.0f )
continue;
if( Vehicle* v = plr->GetVehicle() )
if( Unit* mount = v->GetBase() )
if (Vehicle* v = plr->GetVehicle())
if (Unit* mount = v->GetBase())
LIST.push_back(mount->GetGUID());
}
if( !LIST.empty() )
if (!LIST.empty())
{
uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
if( Unit* target = ObjectAccessor::GetCreature(*me, LIST.at(rnd)) )
if (Unit* target = ObjectAccessor::GetCreature(*me, LIST.at(rnd)))
me->CastSpell(target, SPELL_NPC_SHIELD_BREAKER, false);
}
events.Repeat(6s, 8s);
}
break;
case EVENT_THRUST:
if( me->GetVictim() && me->GetExactDist(me->GetVictim()) <= 5.5f )
if (me->GetVictim() && me->GetExactDist(me->GetVictim()) <= 5.5f )
me->CastSpell(me->GetVictim(), SPELL_PLAYER_VEHICLE_THRUST, false);
events.Repeat(3s, 5s);
break;
@ -345,7 +345,7 @@ public:
{
me->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0);
me->DespawnOrUnsummon(10000);
if( pInstance )
if (pInstance)
pInstance->SetData(DATA_MOUNT_DIED, 0);
}
};
@ -402,7 +402,7 @@ public:
void Reset() override
{
if( pInstance && pInstance->GetData(DATA_INSTANCE_PROGRESS) == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED )
if (pInstance && pInstance->GetData(DATA_INSTANCE_PROGRESS) == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED )
{
DoAction(1);
DoAction(2);
@ -415,7 +415,7 @@ public:
void JustEngagedWith(Unit* /*who*/) override
{
if( pInstance && pInstance->GetData(DATA_INSTANCE_PROGRESS) == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED )
if (pInstance && pInstance->GetData(DATA_INSTANCE_PROGRESS) == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED )
me->CallForHelp(100.0f);
}
@ -423,7 +423,7 @@ public:
{
me->m_spellImmune[IMMUNITY_MECHANIC].clear();
events.Reset();
switch( me->GetEntry() )
switch (me->GetEntry())
{
case NPC_AMBROSE: // Ambrose Boltspark
case NPC_ERESSEA: // Eressea Dawnsinger
@ -485,7 +485,7 @@ public:
void DoAction(int32 param) override
{
if( param == 1 )
if (param == 1)
{
MountPhase = false;
NewMountGUID.Clear();
@ -500,16 +500,16 @@ public:
AddCreatureAddonAuras();
events.Reset();
}
else if( param == 2 )
else if (param == 2)
ScheduleAbilitiesEvents();
}
void SetData(uint32 uiType, uint32 uiData) override
{
BossOrder = uiType;
if( uiData > 1 )
if (uiData > 1)
return;
switch( BossOrder )
switch (BossOrder)
{
case 0:
if (uiData == 0) // 1 == short version
@ -545,11 +545,11 @@ public:
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
if( MountPhase )
if (MountPhase)
{
if( me->GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID) == 0 )
if (me->GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID) == 0 )
damage = 0;
else if( damage >= me->GetHealth() )
else if (damage >= me->GetHealth())
{
events.Reset();
damage = me->GetHealth() - 1;
@ -565,10 +565,10 @@ public:
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(true);
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
if( pInstance )
if (pInstance)
{
pInstance->SetData(DATA_MOUNT_DIED, BossOrder);
if( Creature* mount = me->FindNearestCreature( pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_WARHORSE : VEHICLE_ARGENT_BATTLEWORG, 100.0f, true ) )
if (Creature* mount = me->FindNearestCreature( pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_WARHORSE : VEHICLE_ARGENT_BATTLEWORG, 100.0f, true ))
{
NewMountGUID = mount->GetGUID();
me->GetMotionMaster()->MovePoint(7, *mount);
@ -579,7 +579,7 @@ public:
}
else
{
if( damage >= me->GetHealth() )
if (damage >= me->GetHealth())
{
MountPhase = true;
events.Reset();
@ -593,7 +593,7 @@ public:
me->SetRegeneratingHealth(false);
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(true);
if( pInstance )
if (pInstance)
pInstance->SetData(DATA_GRAND_CHAMPION_DIED, BossOrder);
}
}
@ -603,26 +603,26 @@ public:
void WaypointReached(uint32 i) override
{
if( !pInstance )
if (!pInstance)
return;
if( (i == 2 && (BossOrder == 1 || BossOrder == 2)) || (i == 3 && BossOrder == 0) )
if ((i == 2 && (BossOrder == 1 || BossOrder == 2)) || (i == 3 && BossOrder == 0))
pInstance->SetData(DATA_GRAND_CHAMPION_REACHED_DEST, BossOrder);
}
void MovementInform(uint32 type, uint32 id) override
{
if( id < 4 )
if (id < 4)
npc_escortAI::MovementInform(type, id);
if( type == POINT_MOTION_TYPE )
if (type == POINT_MOTION_TYPE)
{
if( id == 5 )
if (id == 5)
me->SetFacingTo(3 * M_PI / 2);
else if( id == 7 ) // reached new mount!
else if (id == 7) // reached new mount!
{
if( NewMountGUID )
if( Creature* mount = ObjectAccessor::GetCreature(*me, NewMountGUID) )
if (NewMountGUID)
if (Creature* mount = ObjectAccessor::GetCreature(*me, NewMountGUID))
{
mount->DespawnOrUnsummon();
me->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, mount->GetDisplayId());
@ -637,16 +637,16 @@ public:
me->SetReactState(REACT_AGGRESSIVE);
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(false);
if( Unit* target = me->SelectNearestTarget(200.0f) )
if (Unit* target = me->SelectNearestTarget(200.0f))
AttackStart(target);
DoZoneInCombat();
me->CastSpell(me, SPELL_TRAMPLE_AURA, true);
if( pInstance )
if (pInstance)
pInstance->SetData(DATA_REACHED_NEW_MOUNT, 0);
NewMountGUID.Clear();
}
}
else if( id == 9 )
else if (id == 9)
me->DespawnOrUnsummon();
}
}
@ -661,37 +661,37 @@ public:
{
npc_escortAI::UpdateAI(diff);
if ( !UpdateVictim() && !NewMountGUID )
if (!UpdateVictim() && !NewMountGUID )
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) || ((me->GetEntry() == NPC_JACOB || me->GetEntry() == NPC_MOKRA) && me->HasAura(SPELL_BLADESTORM)) )
if (me->HasUnitState(UNIT_STATE_CASTING) || ((me->GetEntry() == NPC_JACOB || me->GetEntry() == NPC_MOKRA) && me->HasAura(SPELL_BLADESTORM)))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_FIND_NEW_MOUNT:
{
if( me->HasAura(SPELL_TRAMPLE_STUN) )
if (me->HasAura(SPELL_TRAMPLE_STUN))
{
events.Repeat(200ms);
break;
}
// hackfix, trample won't hit grand champions because of UNIT_FLAG_NON_ATTACKABLE
if( pInstance )
if (pInstance)
{
bool trample = false;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if( Player* plr = itr->GetSource() )
if( me->GetExactDist(plr) <= 5.0f )
if( Vehicle* v = plr->GetVehicle() )
if( Unit* c = v->GetBase() )
if( c->IsCreature() && c->ToCreature()->GetEntry() == (pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_BATTLEWORG : VEHICLE_ARGENT_WARHORSE) )
if (Player* plr = itr->GetSource())
if (me->GetExactDist(plr) <= 5.0f )
if (Vehicle* v = plr->GetVehicle())
if (Unit* c = v->GetBase())
if (c->IsCreature() && c->ToCreature()->GetEntry() == (pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_BATTLEWORG : VEHICLE_ARGENT_WARHORSE))
{
me->GetMotionMaster()->MovementExpired();
me->GetMotionMaster()->MoveIdle();
@ -701,23 +701,23 @@ public:
break;
}
if( trample )
if (trample)
{
events.Repeat(15s);
break;
}
}
if( Creature* mount = ObjectAccessor::GetCreature(*me, NewMountGUID) )
if( mount->IsAlive() )
if (Creature* mount = ObjectAccessor::GetCreature(*me, NewMountGUID))
if (mount->IsAlive())
{
if( me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE )
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE )
me->GetMotionMaster()->MovePoint(7, *mount);
events.Repeat(200ms);
break;
}
if( Creature* mount = me->FindNearestCreature( pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_WARHORSE : VEHICLE_ARGENT_BATTLEWORG, 100.0f, true ) )
if (Creature* mount = me->FindNearestCreature( pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_WARHORSE : VEHICLE_ARGENT_BATTLEWORG, 100.0f, true ))
{
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
NewMountGUID = mount->GetGUID();
@ -734,22 +734,22 @@ public:
GuidVector LIST;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if( Player* plr = itr->GetSource() )
if (Player* plr = itr->GetSource())
{
if( me->GetExactDist(plr) < 8.0f || me->GetExactDist(plr) > 25.0f || plr->isDead() )
if (me->GetExactDist(plr) < 8.0f || me->GetExactDist(plr) > 25.0f || plr->isDead())
continue;
if( !plr->GetVehicle() )
if (!plr->GetVehicle())
LIST.push_back(plr->GetGUID());
else if( Vehicle* v = plr->GetVehicle() )
else if (Vehicle* v = plr->GetVehicle())
{
if( Unit* mount = v->GetBase() )
if (Unit* mount = v->GetBase())
LIST.push_back(mount->GetGUID());
}
}
if( !LIST.empty() )
if (!LIST.empty())
{
uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
if( Unit* target = ObjectAccessor::GetUnit(*me, LIST.at(rnd)) )
if (Unit* target = ObjectAccessor::GetUnit(*me, LIST.at(rnd)))
{
me->GetThreatMgr().ResetAllThreat();
me->AddThreat(target, 10000.0f);
@ -765,33 +765,33 @@ public:
GuidVector LIST;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if( Player* plr = itr->GetSource() )
if (Player* plr = itr->GetSource())
{
if( me->GetExactDist(plr) < 10.0f || me->GetExactDist(plr) > 30.0f )
if (me->GetExactDist(plr) < 10.0f || me->GetExactDist(plr) > 30.0f )
continue;
if( Vehicle* v = plr->GetVehicle() )
if( Unit* mount = v->GetBase() )
if (Vehicle* v = plr->GetVehicle())
if (Unit* mount = v->GetBase())
LIST.push_back(mount->GetGUID());
}
if( !LIST.empty() )
if (!LIST.empty())
{
uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
if( Unit* target = ObjectAccessor::GetCreature(*me, LIST.at(rnd)) )
if (Unit* target = ObjectAccessor::GetCreature(*me, LIST.at(rnd)))
me->CastSpell(target, SPELL_NPC_SHIELD_BREAKER, false);
}
events.Repeat(6s, 8s);
}
break;
case EVENT_THRUST:
if( Unit* victim = me->GetVictim() )
if( me->GetExactDist(victim) <= 6.0f )
if (Unit* victim = me->GetVictim())
if (me->GetExactDist(victim) <= 6.0f )
me->CastSpell(victim, SPELL_PLAYER_VEHICLE_THRUST, false);
events.Repeat(3s, 5s);
break;
/******************* MAGE *******************/
case EVEMT_MAGE_SPELL_FIREBALL:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_FIREBALL, false);
events.Repeat(5s);
break;
@ -804,7 +804,7 @@ public:
events.Repeat(22s);
break;
case EVEMT_MAGE_SPELL_POLYMORPH:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
me->CastSpell(target, SPELL_POLYMORPH, false);
events.Repeat(8s);
break;
@ -812,7 +812,7 @@ public:
/****************** SHAMAN ******************/
case EVENT_SHAMAN_SPELL_CHAIN_LIGHTNING:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
me->CastSpell(target, SPELL_CHAIN_LIGHTNING, false);
events.Repeat(16s);
break;
@ -823,10 +823,10 @@ public:
case EVENT_SHAMAN_SPELL_HEALING_WAVE:
{
Unit* target = nullptr;
if( urand(0, 1) )
if (urand(0, 1))
{
target = DoSelectLowestHpFriendly(40.0f);
if( !target )
if (!target)
target = me;
}
else
@ -836,7 +836,7 @@ public:
}
break;
case EVENT_SHAMAN_SPELL_HEX_OF_MENDING:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_HEX_OF_MENDING, false);
events.Repeat(20s, 25s);
break;
@ -852,9 +852,9 @@ public:
break;
case EVENT_HUNTER_SPELL_MULTI_SHOT:
{
if( !UnitTargetGUID )
if (!UnitTargetGUID)
{
if( Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, 30.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, 30.0f, true))
{
me->CastSpell(target, SPELL_SHOOT, false);
UnitTargetGUID = target->GetGUID();
@ -865,7 +865,7 @@ public:
else
{
Unit* target = ObjectAccessor::GetUnit(*me, UnitTargetGUID);
if( target && me->IsInRange(target, 5.0f, 30.0f, false) )
if (target && me->IsInRange(target, 5.0f, 30.0f, false))
me->CastSpell(target, SPELL_MULTI_SHOT, false);
else
{
@ -873,7 +873,7 @@ public:
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
{
Player* player = itr->GetSource();
if( player && me->IsInRange(player, 5.0f, 30.0f, false) )
if (player && me->IsInRange(player, 5.0f, 30.0f, false))
{
me->CastSpell(player, SPELL_MULTI_SHOT, false);
break;
@ -889,7 +889,7 @@ public:
/****************** ROGUE *******************/
case EVENT_ROGUE_SPELL_EVISCERATE:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_EVISCERATE, false);
events.Repeat(8s);
break;
@ -898,7 +898,7 @@ public:
events.Repeat(14s);
break;
case EVENT_ROGUE_SPELL_POISON_BOTTLE:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
me->CastSpell(target, SPELL_POISON_BOTTLE, false);
events.Repeat(19s);
break;
@ -906,12 +906,12 @@ public:
/***************** WARRIOR ******************/
case EVENT_WARRIOR_SPELL_MORTAL_STRIKE:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_MORTAL_STRIKE, false);
events.Repeat(8s, 12s);
break;
case EVENT_WARRIOR_SPELL_BLADESTORM:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_BLADESTORM, false);
events.Repeat(15s, 20s);
break;
@ -921,7 +921,7 @@ public:
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
{
Player* player = itr->GetSource();
if( player && me->IsInRange(player, 8.0f, 25.0f, false) )
if (player && me->IsInRange(player, 8.0f, 25.0f, false))
{
DoResetThreatList();
me->AddThreat(player, 5.0f);

View file

@ -101,7 +101,7 @@ public:
bool IsEncounterInProgress() const override
{
for( uint8 i = 0; i < MAX_ENCOUNTER; ++i )
if( m_auiEncounter[i] == IN_PROGRESS )
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
@ -112,54 +112,54 @@ public:
if (TeamIdInInstance == TEAM_NEUTRAL)
{
Map::PlayerList const& players = instance->GetPlayers();
if( !players.IsEmpty() )
if( Player* pPlayer = players.begin()->GetSource() )
if (!players.IsEmpty())
if (Player* pPlayer = players.begin()->GetSource())
TeamIdInInstance = pPlayer->GetTeamId();
}
switch( creature->GetEntry() )
switch (creature->GetEntry())
{
// Grand Champions:
case NPC_MOKRA:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_JACOB);
break;
case NPC_ERESSEA:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_AMBROSE);
break;
case NPC_RUNOK:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_COLOSOS);
break;
case NPC_ZULTORE:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_JAELYNE);
break;
case NPC_VISCERI:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_LANA);
break;
// Grand Champion Minions:
case NPC_ORGRIMMAR_MINION:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_STORMWIND_MINION);
break;
case NPC_SILVERMOON_MINION:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_GNOMEREGAN_MINION);
break;
case NPC_THUNDER_BLUFF_MINION:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_EXODAR_MINION);
break;
case NPC_SENJIN_MINION:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_DARNASSUS_MINION);
break;
case NPC_UNDERCITY_MINION:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_IRONFORGE_MINION);
break;
@ -173,7 +173,7 @@ public:
case NPC_JAEREN:
case NPC_ARELAS:
NPC_AnnouncerGUID = creature->GetGUID();
//if( TeamIdInInstance == TEAM_ALLIANCE )
//if (TeamIdInInstance == TEAM_ALLIANCE)
// creature->UpdateEntry(NPC_ARELAS);
creature->SetReactState(REACT_PASSIVE);
break;
@ -186,7 +186,7 @@ public:
// Beginning vehicles:
case VEHICLE_ARGENT_WARHORSE:
case VEHICLE_ARGENT_BATTLEWORG:
if( InstanceProgress < INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED && m_auiEncounter[0] == NOT_STARTED )
if (InstanceProgress < INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED && m_auiEncounter[0] == NOT_STARTED)
{
creature->DespawnOrUnsummon();
creature->SetRespawnTime(3);
@ -204,7 +204,7 @@ public:
void OnGameObjectCreate(GameObject* go) override
{
switch( go->GetEntry() )
switch (go->GetEntry())
{
case GO_MAIN_GATE:
GO_MainGateGUID = go->GetGUID();
@ -237,7 +237,7 @@ public:
events.Reset();
events.RescheduleEvent(EVENT_CHECK_PLAYERS, 0ms);
if( !in )
if (!in)
{
OUT_LOAD_INST_DATA_FAIL;
return;
@ -250,17 +250,17 @@ public:
std::istringstream loadStream(in);
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3;
if( dataHead1 == 'T' && dataHead2 == 'C' )
if (dataHead1 == 'T' && dataHead2 == 'C')
{
m_auiEncounter[0] = data0;
m_auiEncounter[1] = data1;
m_auiEncounter[2] = data2;
InstanceProgress = data3;
if( InstanceProgress == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED )
if (InstanceProgress == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED)
InstanceProgress = INSTANCE_PROGRESS_INITIAL;
for( uint8 i = 0; i < MAX_ENCOUNTER; ++i )
if( m_auiEncounter[i] == IN_PROGRESS )
if (m_auiEncounter[i] == IN_PROGRESS)
m_auiEncounter[i] = NOT_STARTED;
}
else
@ -306,10 +306,10 @@ public:
void InstanceCleanup()
{
if( CLEANED )
if (CLEANED)
return;
switch( InstanceProgress )
switch (InstanceProgress)
{
case INSTANCE_PROGRESS_INITIAL:
case INSTANCE_PROGRESS_GRAND_CHAMPIONS_REACHED_DEST:
@ -328,15 +328,15 @@ public:
{
for( uint8 j = 0; j < 3; ++j )
{
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[i][j]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[i][j]))
c->DespawnOrUnsummon();
NPC_GrandChampionMinionsGUID[i][j].Clear();
}
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
c->DespawnOrUnsummon();
NPC_GrandChampionGUID[i].Clear();
}
if( Creature* c = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID))
{
c->DespawnOrUnsummon();
c->SetHomePosition(748.309f, 619.488f, 411.172f, 4.71239f);
@ -349,7 +349,7 @@ public:
break;
case INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED:
{
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
announcer->DespawnOrUnsummon();
announcer->SetHomePosition(735.81f, 661.92f, 412.39f, 4.714f);
@ -358,28 +358,28 @@ public:
announcer->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
{
uint32 entry = c->GetEntry();
c->DespawnOrUnsummon();
switch( i )
switch (i)
{
case 0:
if( Creature* pBoss = announcer->SummonCreature(entry, 736.695f, 650.02f, 412.4f, 3 * M_PI / 2) )
if (Creature* pBoss = announcer->SummonCreature(entry, 736.695f, 650.02f, 412.4f, 3 * M_PI / 2))
{
NPC_GrandChampionGUID[0] = pBoss->GetGUID();
pBoss->AI()->SetData(0, 2);
}
break;
case 1:
if( Creature* pBoss = announcer->SummonCreature(entry, 756.32f, 650.05f, 412.4f, 3 * M_PI / 2) )
if (Creature* pBoss = announcer->SummonCreature(entry, 756.32f, 650.05f, 412.4f, 3 * M_PI / 2))
{
NPC_GrandChampionGUID[1] = pBoss->GetGUID();
pBoss->AI()->SetData(1, 2);
}
break;
case 2:
if( Creature* pBoss = announcer->SummonCreature(entry, 746.5f, 650.65f, 411.7f, 3 * M_PI / 2) )
if (Creature* pBoss = announcer->SummonCreature(entry, 746.5f, 650.65f, 411.7f, 3 * M_PI / 2))
{
NPC_GrandChampionGUID[2] = pBoss->GetGUID();
pBoss->AI()->SetData(2, 2);
@ -397,17 +397,17 @@ public:
for( uint8 i = 0; i < 3; ++i )
for( uint8 j = 0; j < 3; ++j )
{
if( Creature* c = instance->GetCreature(NPC_ArgentSoldierGUID[i][j]) )
if (Creature* c = instance->GetCreature(NPC_ArgentSoldierGUID[i][j]))
c->DespawnOrUnsummon();
NPC_ArgentSoldierGUID[i][j].Clear();
}
if( Creature* c = instance->GetCreature(NPC_ArgentChampionGUID) )
if (Creature* c = instance->GetCreature(NPC_ArgentChampionGUID))
{
c->AI()->DoAction(-1); // paletress despawn memory
c->DespawnOrUnsummon();
}
NPC_ArgentChampionGUID.Clear();
if( Creature* c = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID))
{
c->DespawnOrUnsummon();
c->SetHomePosition(743.14f, 628.77f, 411.2f, 4.71239f);
@ -422,16 +422,16 @@ public:
case INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED:
// revert to INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED
{
if( Creature* c = instance->GetCreature(NPC_BlackKnightVehicleGUID) )
if (Creature* c = instance->GetCreature(NPC_BlackKnightVehicleGUID))
c->DespawnOrUnsummon();
NPC_BlackKnightVehicleGUID.Clear();
if( Creature* c = instance->GetCreature(NPC_BlackKnightGUID) )
if (Creature* c = instance->GetCreature(NPC_BlackKnightGUID))
{
c->AI()->DoAction(-1);
c->DespawnOrUnsummon();
}
NPC_BlackKnightGUID.Clear();
if( Creature* c = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID))
{
c->DespawnOrUnsummon();
c->SetHomePosition(743.14f, 628.77f, 411.2f, 4.71239f);
@ -443,7 +443,7 @@ public:
}
break;
case INSTANCE_PROGRESS_FINISHED:
if( Creature* c = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID))
c->DespawnOrUnsummon();
break;
}
@ -460,7 +460,7 @@ public:
uint32 GetData(uint32 uiData) const override
{
switch( uiData )
switch (uiData)
{
case DATA_INSTANCE_PROGRESS:
return InstanceProgress;
@ -473,7 +473,7 @@ public:
ObjectGuid GetGuidData(uint32 uiData) const override
{
switch( uiData )
switch (uiData)
{
case DATA_ANNOUNCER:
return NPC_AnnouncerGUID;
@ -486,21 +486,21 @@ public:
void SetData(uint32 uiType, uint32 uiData) override
{
switch( uiType )
switch (uiType)
{
case DATA_ANNOUNCER_GOSSIP_SELECT:
switch( InstanceProgress )
switch (InstanceProgress)
{
case INSTANCE_PROGRESS_INITIAL:
if (uiData == 0) // normal intro
{
shortver = false;
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
if( GameObject* gate = instance->GetGameObject(GO_MainGateGUID) )
if (GameObject* gate = instance->GetGameObject(GO_MainGateGUID))
announcer->SetFacingToObject(gate);
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
tirion->AI()->Talk(TEXT_WELCOME);
}
events.RescheduleEvent(EVENT_YELL_WELCOME_2, 8s);
@ -521,7 +521,7 @@ public:
InstanceProgress = INSTANCE_PROGRESS_GRAND_CHAMPIONS_REACHED_DEST;
uiData = DONE; // save to db
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
announcer->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
announcer->GetMotionMaster()->MovePoint(1, 735.81f, 661.92f, 412.39f);
@ -530,10 +530,10 @@ public:
}
break;
case INSTANCE_PROGRESS_CHAMPIONS_DEAD:
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
Counter = urand(0, 1);
if( Counter )
if (Counter)
announcer->AI()->Talk(SAY_EADRIC_INTRO_ANNOUNCER);
else
announcer->AI()->Talk(SAY_JAEREN_PALETRESS_INTRO);
@ -542,7 +542,7 @@ public:
events.RescheduleEvent(EVENT_START_ARGENT_CHALLENGE_INTRO, 0ms);
break;
case INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED:
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
tirion->AI()->Talk(TEXT_BK_INTRO);
events.RescheduleEvent(EVENT_SUMMON_BLACK_KNIGHT, 3s);
break;
@ -551,7 +551,7 @@ public:
case DATA_GRAND_CHAMPION_REACHED_DEST:
if (shortver)
break;
switch( uiData )
switch (uiData)
{
case 0:
events.ScheduleEvent(EVENT_SUMMON_GRAND_CHAMPION_2, 0ms);
@ -560,7 +560,7 @@ public:
events.ScheduleEvent(EVENT_SUMMON_GRAND_CHAMPION_3, 0ms);
break;
case 2:
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
InstanceProgress = INSTANCE_PROGRESS_GRAND_CHAMPIONS_REACHED_DEST;
uiData = DONE; // save to db
@ -572,10 +572,10 @@ public:
}
break;
case DATA_MOUNT_DIED:
switch( InstanceProgress )
switch (InstanceProgress)
{
case INSTANCE_PROGRESS_GRAND_CHAMPIONS_REACHED_DEST: // fighting group 1/3
if( ++Counter >= 3 )
if (++Counter >= 3)
{
Counter = 0;
InstanceProgress = INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_1;
@ -584,7 +584,7 @@ public:
}
break;
case INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_1: // fighting group 2/3
if( ++Counter >= 3 )
if (++Counter >= 3)
{
Counter = 0;
InstanceProgress = INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_2;
@ -593,7 +593,7 @@ public:
}
break;
case INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_2: // fighting group 3/3
if( ++Counter >= 3 )
if (++Counter >= 3)
{
Counter = 0;
InstanceProgress = INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_3;
@ -602,7 +602,7 @@ public:
}
break;
case INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_3: // fighting grand champions (on vehicles)
if( ++Counter >= 3 )
if (++Counter >= 3)
{
Counter = 0;
InstanceProgress = INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED;
@ -618,7 +618,7 @@ public:
--Counter;
break;
case DATA_GRAND_CHAMPION_DIED:
if( ++Counter >= 3 )
if (++Counter >= 3)
{
Counter = 0;
VehicleList.clear();
@ -627,7 +627,7 @@ public:
m_auiEncounter[0] = DONE;
bool creditCasted = false;
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
{
c->GetMotionMaster()->MovePoint(9, 747.36f, 670.07f, 411.9f);
if (!creditCasted)
@ -636,7 +636,7 @@ public:
creditCasted = true;
}
}
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
announcer->GetMotionMaster()->MovePoint(0, 743.14f, 628.77f, 411.2f);
announcer->SummonGameObject(instance->IsHeroic() ? GO_CHAMPIONS_LOOT_H : GO_CHAMPIONS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0, 90000000); // [LOOT]
@ -645,12 +645,12 @@ public:
}
// bind players to instance
if( instance->IsHeroic() )
if (instance->IsHeroic())
instance->ToInstanceMap()->PermBindAllPlayers();
}
break;
case DATA_ARGENT_SOLDIER_DEFEATED:
if( ++Counter >= 9 )
if (++Counter >= 9)
{
Counter = 0;
InstanceProgress = INSTANCE_PROGRESS_ARGENT_SOLDIERS_DIED;
@ -661,7 +661,7 @@ public:
case BOSS_ARGENT_CHALLENGE:
{
m_auiEncounter[1] = uiData;
if( uiData == DONE )
if (uiData == DONE)
{
HandleGameObject(GO_EnterGateGUID, true);
InstanceProgress = INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED;
@ -685,7 +685,7 @@ public:
HandleGameObject(GO_EnterGateGUID, false);
bAchievIveHadWorse = true;
}
else if( uiData == DONE )
else if (uiData == DONE)
{
HandleGameObject(GO_EnterGateGUID, true);
InstanceProgress = INSTANCE_PROGRESS_FINISHED;
@ -698,7 +698,7 @@ public:
break;
}
if( uiData == DONE )
if (uiData == DONE)
SaveToDB();
}
@ -708,7 +708,7 @@ public:
uint32 MINION_TO_SUMMON = 0;
int32 TEXT_ID = 0;
switch( BossNumber )
switch (BossNumber)
{
case 0:
CHAMPION_TO_SUMMON = NPC_MOKRA;
@ -754,7 +754,7 @@ public:
break;
}
if( Creature* pBoss = instance->SummonCreature(CHAMPION_TO_SUMMON, SpawnPos) )
if (Creature* pBoss = instance->SummonCreature(CHAMPION_TO_SUMMON, SpawnPos))
{
NPC_GrandChampionGUID[BossOrder] = pBoss->GetGUID();
pBoss->ToCreature()->SetReactState(REACT_PASSIVE);
@ -764,7 +764,7 @@ public:
pBoss->AI()->SetData(BossOrder, (shortver ? 1 : 0));
for( uint8 i = 0; i < 3; ++i )
if( Creature* pAdd = instance->SummonCreature(MINION_TO_SUMMON, SpawnPos) )
if (Creature* pAdd = instance->SummonCreature(MINION_TO_SUMMON, SpawnPos))
{
NPC_GrandChampionMinionsGUID[BossOrder][i] = pAdd->GetGUID();
pAdd->SetReactState(REACT_PASSIVE);
@ -776,7 +776,7 @@ public:
}
if (!shortver)
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
announcer->AI()->Talk(TEXT_ID); /// @todo: Missing Argent Raid Spectator cheers.
}
@ -785,7 +785,7 @@ public:
void Update(uint32 diff) override
{
events.Update(diff);
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case EVENT_NULL:
break;
@ -842,15 +842,15 @@ public:
}
case EVENT_GRAND_GROUP_1_MOVE_MIDDLE:
{
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
announcer->SetFacingTo(4.714f);
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
tirion->AI()->Talk(TEXT_BEGIN);
HandleGameObject(GO_EnterGateGUID, false);
}
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]))
{
float angle = rand_norm() * 2 * M_PI;
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
@ -862,12 +862,12 @@ public:
case EVENT_GRAND_GROUP_1_ATTACK:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]))
{
c->SetReactState(REACT_AGGRESSIVE);
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
c->SetImmuneToAll(false);
if( Unit* target = c->SelectNearestTarget(200.0f) )
if (Unit* target = c->SelectNearestTarget(200.0f))
c->AI()->AttackStart(target);
c->AI()->DoZoneInCombat();
}
@ -877,7 +877,7 @@ public:
case EVENT_GRAND_GROUP_2_MOVE_MIDDLE:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[0][i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[0][i]))
{
float angle = rand_norm() * 2 * M_PI;
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
@ -889,12 +889,12 @@ public:
case EVENT_GRAND_GROUP_2_ATTACK:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[0][i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[0][i]))
{
c->SetReactState(REACT_AGGRESSIVE);
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
c->SetImmuneToAll(false);
if( Unit* target = c->SelectNearestTarget(200.0f) )
if (Unit* target = c->SelectNearestTarget(200.0f))
c->AI()->AttackStart(target);
c->AI()->DoZoneInCombat();
}
@ -903,7 +903,7 @@ public:
case EVENT_GRAND_GROUP_3_MOVE_MIDDLE:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[2][i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[2][i]))
{
float angle = rand_norm() * 2 * M_PI;
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
@ -915,12 +915,12 @@ public:
case EVENT_GRAND_GROUP_3_ATTACK:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[2][i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[2][i]))
{
c->SetReactState(REACT_AGGRESSIVE);
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
c->SetImmuneToAll(false);
if( Unit* target = c->SelectNearestTarget(200.0f) )
if (Unit* target = c->SelectNearestTarget(200.0f))
c->AI()->AttackStart(target);
c->AI()->DoZoneInCombat();
}
@ -929,7 +929,7 @@ public:
case EVENT_GRAND_CHAMPIONS_MOVE_MIDDLE:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
{
float angle = rand_norm() * 2 * M_PI;
c->GetMotionMaster()->MovePoint(4, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
@ -941,12 +941,12 @@ public:
case EVENT_GRAND_CHAMPIONS_MOUNTS_ATTACK:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
{
c->SetReactState(REACT_AGGRESSIVE);
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
c->SetImmuneToAll(false);
if( Unit* target = c->SelectNearestTarget(200.0f) )
if (Unit* target = c->SelectNearestTarget(200.0f))
c->AI()->AttackStart(target);
c->AI()->DoZoneInCombat();
c->CastSpell(c, 67865, true); // SPELL_TRAMPLE_AURA
@ -956,10 +956,10 @@ public:
case EVENT_GRAND_CHAMPIONS_MOVE_SIDE:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
{
c->AI()->DoAction(1);
switch( i )
switch (i)
{
case 0:
c->GetMotionMaster()->MovePoint(5, 736.695f, 650.02f, 412.4f);
@ -979,12 +979,12 @@ public:
case EVENT_GRAND_CHAMPIONS_ATTACK:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
{
c->SetReactState(REACT_AGGRESSIVE);
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
c->SetImmuneToAll(false);
if( Unit* target = c->SelectNearestTarget(200.0f) )
if (Unit* target = c->SelectNearestTarget(200.0f))
c->AI()->AttackStart(target);
c->AI()->DoZoneInCombat();
c->AI()->DoAction(2);
@ -993,7 +993,7 @@ public:
break;
case EVENT_GRATZ_SLAIN_CHAMPIONS:
{
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
tirion->AI()->Talk(TEXT_GRATZ_SLAIN_CHAMPIONS);
HandleGameObject(GO_EnterGateGUID, true);
@ -1001,15 +1001,15 @@ public:
break;
case EVENT_RESTORE_ANNOUNCER_GOSSIP:
{
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
announcer->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
}
break;
case EVENT_START_ARGENT_CHALLENGE_INTRO:
{
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
if( GameObject* gate = instance->GetGameObject(GO_MainGateGUID) )
if (GameObject* gate = instance->GetGameObject(GO_MainGateGUID))
{
announcer->SetFacingToObject(gate);
HandleGameObject(GO_MainGateGUID, true, gate);
@ -1023,19 +1023,19 @@ public:
float x = pos.GetPositionX();
pos.m_positionX = x - 2.0f + (i - 1) * 10.0f;
if( Creature* pTrash = instance->SummonCreature(NPC_ARGENT_LIGHTWIELDER, pos) )
if (Creature* pTrash = instance->SummonCreature(NPC_ARGENT_LIGHTWIELDER, pos))
{
pTrash->AI()->SetData(i, 0);
NPC_ArgentSoldierGUID[i][0] = pTrash->GetGUID();
}
pos.m_positionX = x + (i - 1) * 10.0f;
if( Creature* pTrash = instance->SummonCreature(NPC_ARGENT_MONK, pos) )
if (Creature* pTrash = instance->SummonCreature(NPC_ARGENT_MONK, pos))
{
pTrash->AI()->SetData(i, 0);
NPC_ArgentSoldierGUID[i][1] = pTrash->GetGUID();
}
pos.m_positionX = x + 2.0f + (i - 1) * 10.0f;
if( Creature* pTrash = instance->SummonCreature(NPC_PRIESTESS, pos) )
if (Creature* pTrash = instance->SummonCreature(NPC_PRIESTESS, pos))
{
pTrash->AI()->SetData(i, 0);
NPC_ArgentSoldierGUID[i][2] = pTrash->GetGUID();
@ -1046,7 +1046,7 @@ public:
break;
case EVENT_SUMMON_ARGENT_CHALLENGE:
{
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
announcer->GetMotionMaster()->MovePoint(0, 735.81f, 661.92f, 412.39f);
if (Creature* boss = instance->SummonCreature(Counter ? NPC_EADRIC : NPC_PALETRESS, SpawnPosition))
boss->GetMotionMaster()->MovePoint(0, 746.881f, 660.263f, 411.7f);
@ -1057,15 +1057,15 @@ public:
break;
case EVENT_ARGENT_CHALLENGE_SAY_1:
{
if( Creature* ac = instance->GetCreature(NPC_ArgentChampionGUID) )
if (Creature* ac = instance->GetCreature(NPC_ArgentChampionGUID))
ac->AI()->Talk(Counter ? SAY_EADRIC_INTRO : SAY_PALETRESS_INTRO_1);
if( !Counter )
if (!Counter)
events.ScheduleEvent(EVENT_ARGENT_CHALLENGE_SAY_2, 6s);
}
break;
case EVENT_ARGENT_CHALLENGE_SAY_2:
{
if( Creature* ac = instance->GetCreature(NPC_ArgentChampionGUID) )
if (Creature* ac = instance->GetCreature(NPC_ArgentChampionGUID))
ac->AI()->Talk(SAY_PALETRESS_INTRO_2);
}
break;
@ -1074,14 +1074,14 @@ public:
Counter = 0;
for( uint8 i = 0; i < 3; ++i )
for( uint8 j = 0; j < 3; ++j )
if( Creature* c = instance->GetCreature(NPC_ArgentSoldierGUID[i][j]) )
if (Creature* c = instance->GetCreature(NPC_ArgentSoldierGUID[i][j]))
{
c->SetReactState(REACT_AGGRESSIVE);
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
c->SetImmuneToAll(false);
//c->AI()->DoZoneInCombat();
}
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
tirion->AI()->Talk(TEXT_YOU_MAY_BEGIN);
}
break;
@ -1096,12 +1096,12 @@ public:
break;
case EVENT_ARGENT_CHALLENGE_ATTACK:
{
if( Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID) )
if (Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID))
{
boss->SetReactState(REACT_AGGRESSIVE);
boss->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
boss->SetImmuneToAll(false);
if( Unit* target = boss->SelectNearestTarget(200.0f) )
if (Unit* target = boss->SelectNearestTarget(200.0f))
boss->AI()->AttackStart(target);
boss->AI()->DoZoneInCombat();
}
@ -1109,7 +1109,7 @@ public:
break;
case EVENT_ARGENT_CHALLENGE_RUN_MIDDLE:
{
if( Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID) )
if (Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID))
{
boss->GetMotionMaster()->MovePoint(1, 747.13f, 628.037f, 411.2f);
events.ScheduleEvent(EVENT_ARGENT_CHALLENGE_LEAVE_CHEST, 6s);
@ -1118,12 +1118,12 @@ public:
break;
case EVENT_ARGENT_CHALLENGE_LEAVE_CHEST:
{
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if( Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
if (Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID))
{
announcer->GetMotionMaster()->MovePoint(0, 743.14f, 628.77f, 411.2f);
uint32 chest = 0;
if( instance->IsHeroic() )
if (instance->IsHeroic())
chest = (boss->GetEntry() == NPC_EADRIC || boss->GetEntry() == NPC_EADRIC_H) ? GO_EADRIC_LOOT_H : GO_PALETRESS_LOOT_H;
else
chest = (boss->GetEntry() == NPC_EADRIC || boss->GetEntry() == NPC_EADRIC_H) ? GO_EADRIC_LOOT : GO_PALETRESS_LOOT;
@ -1136,7 +1136,7 @@ public:
break;
case EVENT_ARGENT_CHALLENGE_DISAPPEAR:
{
if( Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID) )
if (Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID))
{
boss->GetMotionMaster()->MovePoint(0, SpawnPosition);
boss->DespawnOrUnsummon(3000);
@ -1145,18 +1145,18 @@ public:
break;
case EVENT_SUMMON_BLACK_KNIGHT:
{
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if( Creature* bk_vehicle = announcer->SummonCreature(VEHICLE_BLACK_KNIGHT, 769.834f, 651.915f, 447.035f, 0.0f) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
if (Creature* bk_vehicle = announcer->SummonCreature(VEHICLE_BLACK_KNIGHT, 769.834f, 651.915f, 447.035f, 0.0f))
{
NPC_BlackKnightVehicleGUID = bk_vehicle->GetGUID();
bk_vehicle->SetReactState(REACT_PASSIVE);
bk_vehicle->SetFacingTo(M_PI);
if( Vehicle* v = bk_vehicle->GetVehicleKit() )
if( Unit* bk = v->GetPassenger(0) )
if (Vehicle* v = bk_vehicle->GetVehicleKit())
if (Unit* bk = v->GetPassenger(0))
{
NPC_BlackKnightGUID = bk->GetGUID();
bk->SendMovementFlagUpdate(); // put him on vehicle visually
if( bk->IsCreature() )
if (bk->IsCreature())
bk->ToCreature()->SetReactState(REACT_PASSIVE);
}
@ -1167,7 +1167,7 @@ public:
break;
case EVENT_START_BLACK_KNIGHT_SCENE:
{
if( Creature* bk = instance->GetCreature(NPC_BlackKnightGUID) )
if (Creature* bk = instance->GetCreature(NPC_BlackKnightGUID))
{
Position exitPos = { 751.003357f, 638.145508f, 411.570129f, M_PI };
bk->ExitVehicle(/*&exitPos*/);
@ -1179,9 +1179,9 @@ public:
break;
case EVENT_BLACK_KNIGHT_CAST_ANNOUNCER:
{
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
if( Creature* bk = instance->GetCreature(NPC_BlackKnightGUID) )
if (Creature* bk = instance->GetCreature(NPC_BlackKnightGUID))
{
bk->SetPosition(745.016f, 631.506f, 411.575f, bk->GetAngle(announcer));
bk->SetHomePosition(*bk);
@ -1189,7 +1189,7 @@ public:
announcer->SetFacingToObject(bk);
announcer->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
bk->AddAura(68306, announcer); // spell has attribute player only
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
tirion->AI()->Talk(TEXT_BK_MEANING);
}
}
@ -1198,7 +1198,7 @@ public:
break;
case EVENT_BLACK_KNIGHT_KILL_ANNOUNCER:
{
if( Creature* bk_vehicle = instance->GetCreature(NPC_BlackKnightVehicleGUID) )
if (Creature* bk_vehicle = instance->GetCreature(NPC_BlackKnightVehicleGUID))
bk_vehicle->AI()->DoAction(1);
events.ScheduleEvent(EVENT_BLACK_KNIGHT_MOVE_FORWARD, 4s);
@ -1206,13 +1206,13 @@ public:
break;
case EVENT_BLACK_KNIGHT_MOVE_FORWARD:
{
if( Creature* bk = instance->GetCreature(NPC_BlackKnightGUID) )
if (Creature* bk = instance->GetCreature(NPC_BlackKnightGUID))
{
bk->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
bk->GetMotionMaster()->MovePoint(0, 746.81f, 623.15f, 411.42f);
bk->AI()->Talk(SAY_BK_INTRO_2);
}
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
if (announcer->IsAlive())
Unit::Kill(announcer, announcer);
events.ScheduleEvent(EVENT_BLACK_KNIGHT_SAY_TASK, 14s);
@ -1220,7 +1220,7 @@ public:
break;
case EVENT_BLACK_KNIGHT_SAY_TASK:
{
if( Creature* bk = instance->GetCreature(NPC_BlackKnightGUID) )
if (Creature* bk = instance->GetCreature(NPC_BlackKnightGUID))
{
bk->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
bk->AI()->Talk(SAY_BK_INTRO_3);
@ -1230,11 +1230,11 @@ public:
break;
case EVENT_BLACK_KNIGHT_ATTACK:
{
if( Creature* bk = instance->GetCreature(NPC_BlackKnightGUID) )
if (Creature* bk = instance->GetCreature(NPC_BlackKnightGUID))
{
bk->SetReactState(REACT_AGGRESSIVE);
bk->ReplaceAllUnitFlags(UNIT_FLAG_NONE);
if( Unit* target = bk->SelectNearestTarget(200.0f) )
if (Unit* target = bk->SelectNearestTarget(200.0f))
bk->AI()->AttackStart(target);
bk->AI()->DoZoneInCombat();
bk->AI()->DoAction(1);
@ -1246,7 +1246,7 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
case 11789: // I've Had Worse criteria id
return bAchievIveHadWorse;

View file

@ -88,14 +88,14 @@ public:
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) override
{
if(!creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
if (!creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
return true;
InstanceScript* pInstance = creature->GetInstanceScript();
if(!pInstance)
if (!pInstance)
return true;
if(uiAction == GOSSIP_ACTION_INFO_DEF + 1 || uiAction == GOSSIP_ACTION_INFO_DEF + 2 || uiAction == GOSSIP_ACTION_INFO_DEF + 3 || uiAction == GOSSIP_ACTION_INFO_DEF + 4)
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1 || uiAction == GOSSIP_ACTION_INFO_DEF + 2 || uiAction == GOSSIP_ACTION_INFO_DEF + 3 || uiAction == GOSSIP_ACTION_INFO_DEF + 4)
{
pInstance->SetData(DATA_ANNOUNCER_GOSSIP_SELECT, (uiAction == GOSSIP_ACTION_INFO_DEF + 2 ? 1 : 0));
creature->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
@ -117,9 +117,9 @@ public:
void Reset() override
{
InstanceScript* pInstance = me->GetInstanceScript();
if( !pInstance )
if (!pInstance)
return;
if( pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_ALLIANCE )
if (pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_ALLIANCE )
me->UpdateEntry(NPC_ARELAS);
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); // removed during black knight scene
}
@ -135,7 +135,7 @@ public:
if (type != EFFECT_MOTION_TYPE)
return;
InstanceScript* pInstance = me->GetInstanceScript();
if( !pInstance )
if (!pInstance)
return;
if (pInstance->GetData(DATA_INSTANCE_PROGRESS) < INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED)
return;

View file

@ -182,7 +182,7 @@ public:
{
float angle = rand_norm() * 2 * M_PI;
float dist = rand_norm() * 40.0f;
if( Creature* c = me->SummonCreature(NPC_SCARAB, AnubLocs[0].GetPositionX() + cos(angle) * dist, AnubLocs[0].GetPositionY() + std::sin(angle) * dist, AnubLocs[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000) )
if (Creature* c = me->SummonCreature(NPC_SCARAB, AnubLocs[0].GetPositionX() + cos(angle) * dist, AnubLocs[0].GetPositionY() + std::sin(angle) * dist, AnubLocs[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
{
c->SetFaction(FACTION_PREY);
c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
@ -193,7 +193,7 @@ public:
void DoAction(int32 param) override
{
switch( param )
switch (param)
{
case -1:
summons.DespawnAll();
@ -210,7 +210,7 @@ public:
events.RescheduleEvent(EVENT_SPELL_PENETRATING_COLD, 15s, 20s);
events.RescheduleEvent(EVENT_SUMMON_NERUBIAN, 5s, 8s);
events.RescheduleEvent(EVENT_SUBMERGE, 80s);
if( !IsHeroic() )
if (!IsHeroic())
events.RescheduleEvent(EVENT_RESPAWN_SPHERE, 4s);
for (ObjectGuid const& guid : summons)
@ -224,15 +224,15 @@ public:
}
summons.clear();
for( uint8 i = 0; i < 4; ++i )
if( Creature* c = me->SummonCreature(NPC_BURROW, AnubLocs[i + 1]) )
if (Creature* c = me->SummonCreature(NPC_BURROW, AnubLocs[i + 1]))
BurrowGUID[i] = c->GetGUID();
for( uint8 i = 0; i < 6; ++i )
if( Creature* c = me->SummonCreature(NPC_FROST_SPHERE, AnubLocs[i + 5]) )
if (Creature* c = me->SummonCreature(NPC_FROST_SPHERE, AnubLocs[i + 5]))
SphereGUID[i] = c->GetGUID();
Talk(SAY_AGGRO);
DoZoneInCombat();
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_ANUBARAK, IN_PROGRESS);
}
@ -243,21 +243,21 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
if( !bPhase3 && HealthBelowPct(30) && !me->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE) && !me->HasAura(SPELL_SUBMERGE) && !me->HasAura(SPELL_EMERGE) )
if (!bPhase3 && HealthBelowPct(30) && !me->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE) && !me->HasAura(SPELL_SUBMERGE) && !me->HasAura(SPELL_EMERGE))
{
bPhase3 = true;
events.CancelEvent(EVENT_SUBMERGE);
events.CancelEvent(EVENT_EMERGE);
events.CancelEvent(EVENT_EMERGE_2);
if( !IsHeroic() )
if (!IsHeroic())
events.CancelEvent(EVENT_SUMMON_NERUBIAN);
me->CastSpell((Unit*)nullptr, SPELL_LEECHING_SWARM, false);
Talk(EMOTE_LEECHING_SWARM);
@ -265,7 +265,7 @@ public:
return;
}
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -280,10 +280,10 @@ public:
uint8 i = StartAt;
do
{
if( Creature* c = ObjectAccessor::GetCreature(*me, SphereGUID[i]) )
if( !c->HasAura(SPELL_FROST_SPHERE) )
if (Creature* c = ObjectAccessor::GetCreature(*me, SphereGUID[i]))
if (!c->HasAura(SPELL_FROST_SPHERE))
{
if( Creature* c = me->SummonCreature(NPC_FROST_SPHERE, AnubLocs[i + 5]) )
if (Creature* c = me->SummonCreature(NPC_FROST_SPHERE, AnubLocs[i + 5]))
SphereGUID[i] = c->GetGUID();
break;
}
@ -294,7 +294,7 @@ public:
break;
case EVENT_SPELL_FREEZING_SLASH:
{
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_FREEZING_SLASH, false);
events.Repeat(15s, 20s);
}
@ -332,7 +332,7 @@ public:
case EVENT_SUMMON_SCARAB:
{
uint8 i = urand(0, 3);
if( Creature* c = ObjectAccessor::GetCreature(*me, BurrowGUID[i]) )
if (Creature* c = ObjectAccessor::GetCreature(*me, BurrowGUID[i]))
me->CastSpell(c, SPELL_SUMMON_SCARAB, true);
events.Repeat(4s);
}
@ -368,7 +368,7 @@ public:
void JustSummoned(Creature* summon) override
{
if( !summon )
if (!summon)
return;
summons.Summon(summon);
@ -379,13 +379,13 @@ public:
events.Reset();
summons.DespawnAll();
Talk(SAY_DEATH);
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_ANUBARAK, DONE);
}
void KilledUnit(Unit* who) override
{
if( who->IsPlayer() )
if (who->IsPlayer())
Talk(SAY_KILL_PLAYER);
}
@ -394,7 +394,7 @@ public:
events.Reset();
summons.DespawnAll();
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_FAILED, 1);
}
@ -409,7 +409,7 @@ public:
if (!bIntro)
{
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
if( !me->IsInCombat() )
if (!me->IsInCombat())
Talk(SAY_INTRO);
bIntro = true;
}
@ -442,7 +442,7 @@ public:
void DoAction(int32 param) override
{
if( param == 1 )
if (param == 1)
despawnTimer = 2000;
}
@ -453,11 +453,11 @@ public:
determinationTimer = urand(10000, 50000);
despawnTimer = 0;
if (me->GetFaction() == FACTION_MONSTER_2) // hostile - it's phase 2
if( Unit* target = me->SelectNearestTarget(250.0f) )
if (Unit* target = me->SelectNearestTarget(250.0f))
{
AttackStart(target);
DoZoneInCombat();
if( Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true) )
if (Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true))
{
me->AddThreat(t, 20000.0f);
AttackStart(t);
@ -472,9 +472,9 @@ public:
void UpdateAI(uint32 diff) override
{
if( despawnTimer )
if (despawnTimer)
{
if( despawnTimer <= (int32)diff )
if (despawnTimer <= (int32)diff )
{
despawnTimer = 0;
me->DisappearAndDie();
@ -485,10 +485,10 @@ public:
return;
}
if( !UpdateVictim() )
if (!UpdateVictim())
return;
if( determinationTimer <= (int32)diff )
if (determinationTimer <= (int32)diff )
{
me->CastSpell(me, SPELL_DETERMINATION, false);
determinationTimer = urand(20000, 60000);
@ -556,10 +556,10 @@ public:
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
if( me->GetHealth() <= damage )
if (me->GetHealth() <= damage )
{
damage = 0;
if( !me->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE) )
if (!me->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE))
{
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->GetMotionMaster()->MoveIdle();
@ -571,7 +571,7 @@ public:
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if( spell->Id == SPELL_SPIKE_FAIL )
if (spell->Id == SPELL_SPIKE_FAIL)
{
me->RemoveAllAuras();
me->DespawnOrUnsummon(1500);
@ -580,9 +580,9 @@ public:
void UpdateAI(uint32 diff) override
{
if( permafrostTimer )
if (permafrostTimer)
{
if( permafrostTimer <= diff )
if (permafrostTimer <= diff)
{
permafrostTimer = 0;
me->RemoveAurasDueToSpell(SPELL_FROST_SPHERE);
@ -631,9 +631,9 @@ public:
me->CastSpell(me, SPELL_SPIDER_FRENZY, true);
events.Reset();
events.RescheduleEvent(EVENT_SUBMERGE, 30s);
if( IsHeroic() )
if (IsHeroic())
events.RescheduleEvent(EVENT_SPELL_SHADOW_STRIKE, 30s, 45s);
if( Unit* target = me->SelectNearestTarget(250.0f) )
if (Unit* target = me->SelectNearestTarget(250.0f))
{
AttackStart(target);
DoZoneInCombat();
@ -642,13 +642,13 @@ public:
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if( !target || !spell )
if (!target || !spell)
return;
if( spell->Id == SPELL_SHADOW_STRIKE )
if (spell->Id == SPELL_SHADOW_STRIKE)
{
float o = target->GetOrientation();
if( o >= M_PI )
if (o >= M_PI)
o -= M_PI;
else
o += M_PI;
@ -661,25 +661,25 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_SHADOW_STRIKE:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true))
me->CastSpell(target, SPELL_SHADOW_STRIKE, false);
events.Repeat(30s, 45s);
break;
case EVENT_SUBMERGE:
if( HealthBelowPct(80) && !me->HasAura(RAID_MODE(66193, 67855, 67856, 67857)) ) // not having permafrost - allow submerge
if (HealthBelowPct(80) && !me->HasAura(RAID_MODE(66193, 67855, 67856, 67857))) // not having permafrost - allow submerge
{
me->GetMotionMaster()->MoveIdle();
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
@ -743,9 +743,9 @@ public:
void DoAction(int32 param) override
{
if( param == -1 )
if (param == -1)
{
if( Unit* target = ObjectAccessor::GetPlayer(*me, TargetGUID) )
if (Unit* target = ObjectAccessor::GetPlayer(*me, TargetGUID))
target->RemoveAura(SPELL_MARK);
TargetGUID.Clear();
me->RemoveAllAuras();
@ -758,7 +758,7 @@ public:
void SelectNewTarget(bool next)
{
if (TargetGUID)
if( Unit* target = ObjectAccessor::GetPlayer(*me, TargetGUID) )
if (Unit* target = ObjectAccessor::GetPlayer(*me, TargetGUID))
target->RemoveAura(SPELL_MARK);
TargetGUID.Clear();
if (!next)
@ -768,7 +768,7 @@ public:
}
DoZoneInCombat();
DoResetThreatList();
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true))
{
if (!next)
{
@ -791,10 +791,10 @@ public:
void UpdateAI(uint32 diff) override
{
if( TargetGUID )
if (TargetGUID)
{
Unit* target = ObjectAccessor::GetPlayer(*me, TargetGUID);
if( !target || !target->HasAura(SPELL_MARK) || !me->IsValidAttackTarget(target) || me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE || !me->HasUnitState(UNIT_STATE_CHASE_MOVE) )
if (!target || !target->HasAura(SPELL_MARK) || !me->IsValidAttackTarget(target) || me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE || !me->HasUnitState(UNIT_STATE_CHASE_MOVE))
{
SelectNewTarget(true);
return;
@ -803,7 +803,7 @@ public:
events.Update(diff);
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -840,13 +840,13 @@ public:
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
if( Unit* target = GetTarget() )
if (Unit* target = GetTarget())
{
if( Creature* c = target->FindNearestCreature(NPC_FROST_SPHERE, 8.0f, true) )
if (Creature* c = target->FindNearestCreature(NPC_FROST_SPHERE, 8.0f, true))
{
target->UpdatePosition(*c, false);
target->CastCustomSpell(SPELL_SPIKE_FAIL, SPELLVALUE_MAX_TARGETS, 1);
if( target->IsCreature() )
if (target->IsCreature())
target->ToCreature()->AI()->DoAction(-1);
Remove();
return;

View file

@ -116,7 +116,7 @@ public:
void Reset() override
{
events.Reset();
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_JARAXXUS, NOT_STARTED);
std::list<Creature*> creatures;
@ -135,34 +135,34 @@ public:
events.RescheduleEvent(EVENT_SPELL_INCINERATE_FLESH, 24s, 26s);
events.RescheduleEvent(EVENT_SPELL_NETHER_POWER, 25s, 45s);
events.RescheduleEvent(EVENT_SPELL_LEGION_FLAME, 30s);
//if( GetDifficulty() == RAID_DIFFICULTY_25MAN_HEROIC )
//if (GetDifficulty() == RAID_DIFFICULTY_25MAN_HEROIC )
// events.RescheduleEvent(EVENT_SPELL_TOUCH_OF_JARAXXUS, 10s, 15s);
events.RescheduleEvent(EVENT_SUMMON_NETHER_PORTAL, 20s); // it schedules EVENT_SUMMON_VOLCANO
me->RemoveAura(SPELL_CHAINS);
Talk(SAY_AGGRO);
DoZoneInCombat();
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_JARAXXUS, IN_PROGRESS);
}
void SpellHit(Unit* caster, SpellInfo const* spell) override
{
switch( spell->Id )
switch (spell->Id)
{
case 66228:
case 67106:
case 67107:
case 67108:
if( Aura* a = me->GetAura(spell->Id) )
if (Aura* a = me->GetAura(spell->Id))
a->SetStackAmount(spell->StackAmount);
break;
case 30449:
{
if( !caster )
if (!caster)
return;
uint32 id = 0;
switch( me->GetMap()->GetDifficulty() )
switch (me->GetMap()->GetDifficulty())
{
case 0:
id = 66228;
@ -177,9 +177,9 @@ public:
id = 67108;
break;
}
if( Aura* a = me->GetAura(id) )
if (Aura* a = me->GetAura(id))
{
if( a->GetStackAmount() > 1 )
if (a->GetStackAmount() > 1 )
a->ModStackAmount(-1);
else
a->Remove();
@ -194,30 +194,30 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_FEL_FIREBALL:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_FEL_FIREBALL, false);
events.Repeat(10s, 15s);
break;
case EVENT_SPELL_FEL_LIGHTNING:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true))
me->CastSpell(target, SPELL_FEL_LIGHTNING, false);
events.Repeat(10s, 15s);
break;
case EVENT_SPELL_INCINERATE_FLESH:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true))
{
Talk(EMOTE_INCINERATE, target);
Talk(SAY_INCINERATE);
@ -231,7 +231,7 @@ public:
events.Repeat(25s, 45s);
break;
case EVENT_SPELL_LEGION_FLAME:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true))
{
Talk(EMOTE_LEGION_FLAME, target);
me->CastSpell(target, SPELL_LEGION_FLAME, false);
@ -239,7 +239,7 @@ public:
events.Repeat(30s);
break;
case EVENT_SPELL_TOUCH_OF_JARAXXUS:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
me->CastSpell(target, SPELL_TOUCH_OF_JARAXXUS, false);
events.Repeat(10s, 15s);
break;
@ -266,7 +266,7 @@ public:
{
summons.DespawnAll();
Talk(SAY_DEATH);
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_JARAXXUS, DONE);
}
@ -285,7 +285,7 @@ public:
events.Reset();
summons.DespawnAll();
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_FAILED, 1);
}
@ -311,7 +311,7 @@ public:
void Reset() override
{
if( Unit* target = me->SelectNearestTarget(200.0f) )
if (Unit* target = me->SelectNearestTarget(200.0f))
{
AttackStart(target);
DoZoneInCombat();
@ -322,20 +322,20 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_FEL_STEAK:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 44.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 44.0f, true))
{
DoResetThreatList();
me->AddThreat(target, 50000.0f);
@ -381,7 +381,7 @@ public:
void Reset() override
{
if( Unit* target = me->SelectNearestTarget(200.0f) )
if (Unit* target = me->SelectNearestTarget(200.0f))
{
AttackStart(target);
DoZoneInCombat();
@ -389,7 +389,7 @@ public:
events.Reset();
events.RescheduleEvent(EVENT_SPELL_SHIVAN_SLASH, 10s, 20s);
events.RescheduleEvent(EVENT_SPELL_SPINNING_PAIN_SPIKE, 22s, 30s);
if( IsHeroic() )
if (IsHeroic())
events.RescheduleEvent(EVENT_SPELL_MISTRESS_KISS, 10s, 15s);
}
@ -401,25 +401,25 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_SHIVAN_SLASH:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_SHIVAN_SLASH, false);
events.Repeat(15s, 25s);
break;
case EVENT_SPELL_SPINNING_PAIN_SPIKE:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 140.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 140.0f, true))
me->CastSpell(target, SPELL_SPINNING_PAIN_SPIKE, false);
events.Repeat(25s, 30s);
break;
@ -457,7 +457,7 @@ public:
{
if (Unit* caster = GetCaster())
if (Unit* target = GetTarget())
if( target->HasUnitState(UNIT_STATE_CASTING) )
if (target->HasUnitState(UNIT_STATE_CASTING))
{
caster->CastSpell(target, 66359, true);
SetDuration(0);

View file

@ -113,7 +113,7 @@ public:
void AttackStart(Unit* who) override
{
if( who->GetGUID() != TargetGUID )
if (who->GetGUID() != TargetGUID )
return;
ScriptedAI::AttackStart(who);
}
@ -122,26 +122,26 @@ public:
void UpdateAI(uint32 diff) override
{
if( !TargetGUID && !me->GetVehicle() )
if (!TargetGUID && !me->GetVehicle())
return;
Unit* t = ObjectAccessor::GetUnit(*me, TargetGUID);
if( !t && !(t = me->GetVehicleBase()) )
if (!t && !(t = me->GetVehicleBase()))
return;
if( t->isDead() )
if (t->isDead())
{
t->RemoveAura(SPELL_CHANGE_VEHICLE);
me->RemoveAllAuras();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->SetHealth(me->GetMaxHealth());
if( pInstance )
if( Creature* gormok = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_GORMOK)) )
if( gormok->IsAlive() )
if( Vehicle* vk = gormok->GetVehicleKit() )
if (pInstance)
if (Creature* gormok = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_GORMOK)))
if (gormok->IsAlive())
if (Vehicle* vk = gormok->GetVehicleKit())
for( uint8 i = 0; i < 4; ++i )
if( !vk->GetPassenger(i) )
if (!vk->GetPassenger(i))
{
me->EnterVehicleUnattackable(gormok, i);
Reset();
@ -153,26 +153,26 @@ public:
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_SNOBOLLED:
if( t->IsPlayer() )
if (t->IsPlayer())
me->CastSpell((Unit*)nullptr, SPELL_SNOBOLLED, true);
break;
case EVENT_SPELL_BATTER:
if( t->IsPlayer() )
if (t->IsPlayer())
me->CastSpell(t, SPELL_BATTER);
events.Repeat(6s, 8s);
break;
case EVENT_SPELL_FIRE_BOMB:
{
if( !t->IsPlayer() && pInstance )
if (!t->IsPlayer() && pInstance )
{
GuidVector validPlayers;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
@ -180,14 +180,14 @@ public:
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
{
if( Player* p = itr->GetSource() )
if( p->IsAlive() && p->GetGUID() != TargetGUID && (!gormok || !p->IsWithinMeleeRange(gormok)) )
if (Player* p = itr->GetSource())
if (p->IsAlive() && p->GetGUID() != TargetGUID && (!gormok || !p->IsWithinMeleeRange(gormok)))
validPlayers.push_back(p->GetGUID());
}
if( !validPlayers.empty() )
if( Player* p = ObjectAccessor::GetPlayer(*me, validPlayers.at(urand(0, validPlayers.size() - 1))) )
if( Creature* trigger = me->SummonCreature(NPC_FIRE_BOMB, *p, TEMPSUMMON_TIMED_DESPAWN, 60000) )
if (!validPlayers.empty())
if (Player* p = ObjectAccessor::GetPlayer(*me, validPlayers.at(urand(0, validPlayers.size() - 1))))
if (Creature* trigger = me->SummonCreature(NPC_FIRE_BOMB, *p, TEMPSUMMON_TIMED_DESPAWN, 60000))
{
me->CastSpell(trigger, SPELL_FIRE_BOMB_AURA, true); // periodic damage aura, speed 14.0f
me->CastSpell(trigger, SPELL_FIRE_BOMB); // visual + initial damage 4k
@ -198,7 +198,7 @@ public:
}
break;
case EVENT_SPELL_HEAD_CRACK:
if( t->IsPlayer() )
if (t->IsPlayer())
me->CastSpell(t, SPELL_HEAD_CRACK);
events.Repeat(30s, 35s);
break;
@ -209,17 +209,17 @@ public:
void JustDied(Unit* /*pKiller*/) override
{
if( Unit* t = ObjectAccessor::GetUnit(*me, TargetGUID))
if (Unit* t = ObjectAccessor::GetUnit(*me, TargetGUID))
{
t->RemoveAura(SPELL_CHANGE_VEHICLE);
if( t->IsAlive() )
if (t->IsAlive())
t->RemoveAurasDueToSpell(SPELL_SNOBOLLED);
}
}
void DoAction(int32 param) override
{
if( param == 1 && !TargetGUID )
if (param == 1 && !TargetGUID)
me->DespawnOrUnsummon();
}
};
@ -265,9 +265,9 @@ public:
events.RescheduleEvent(EVENT_PICK_SNOBOLD_TARGET, 16s, 24s);
// refresh snobold position
if( Vehicle* vk = me->GetVehicleKit() )
if (Vehicle* vk = me->GetVehicleKit())
for( uint8 i = 0; i < 4; ++i )
if( Unit* snobold = vk->GetPassenger(i) )
if (Unit* snobold = vk->GetPassenger(i))
snobold->SendMovementFlagUpdate();
}
@ -280,22 +280,22 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_IMPALE:
if( !me->HasUnitFlag(UNIT_FLAG_DISARMED) )
if (!me->HasUnitFlag(UNIT_FLAG_DISARMED))
{
if( Unit* victim = me->GetVictim() )
if (Unit* victim = me->GetVictim())
me->CastSpell(victim, SPELL_IMPALE, false);
events.Repeat(9s, 10s);
}
@ -307,21 +307,21 @@ public:
events.Repeat(20s, 25s);
break;
case EVENT_PICK_SNOBOLD_TARGET:
if( Vehicle* vk = me->GetVehicleKit() )
if (Vehicle* vk = me->GetVehicleKit())
for( uint8 i = 0; i < 4; ++i )
if( Unit* snobold = vk->GetPassenger(i) )
if (Unit* snobold = vk->GetPassenger(i))
{
GuidVector validPlayers;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
{
if( Player* p = itr->GetSource() )
if( p->IsAlive() && !p->GetVehicleKit() && !p->IsMounted() && !p->GetVehicle() && !p->IsGameMaster() )
if (Player* p = itr->GetSource())
if (p->IsAlive() && !p->GetVehicleKit() && !p->IsMounted() && !p->GetVehicle() && !p->IsGameMaster())
validPlayers.push_back(p->GetGUID());
}
if( !validPlayers.empty() )
if( Player* p = ObjectAccessor::GetPlayer(*me, validPlayers.at(urand(0, validPlayers.size() - 1))) )
if (!validPlayers.empty())
if (Player* p = ObjectAccessor::GetPlayer(*me, validPlayers.at(urand(0, validPlayers.size() - 1))))
{
snobold->ChangeSeat(4); // switch to hand
me->setAttackTimer(BASE_ATTACK, 3000);
@ -337,12 +337,12 @@ public:
{
me->CastSpell(me, SPELL_RISING_ANGER, true);
Player* p = ObjectAccessor::GetPlayer(*me, PlayerGUID);
if( p && p->IsAlive() && !p->GetVehicleKit() && !p->IsMounted() && !p->GetVehicle() )
if (p && p->IsAlive() && !p->GetVehicleKit() && !p->IsMounted() && !p->GetVehicle())
{
if( Vehicle* vk = me->GetVehicleKit() )
if( Unit* snobold = vk->GetPassenger(4) )
if (Vehicle* vk = me->GetVehicleKit())
if (Unit* snobold = vk->GetPassenger(4))
{
if( snobold->IsCreature() )
if (snobold->IsCreature())
{
CAST_AI(npc_snobold_vassal::npc_snobold_vassalAI, snobold->ToCreature()->AI())->TargetGUID = PlayerGUID;
snobold->ToCreature()->AI()->AttackStart(p);
@ -353,21 +353,21 @@ public:
//snobold->ClearUnitState(UNIT_STATE_ONVEHICLE);
}
}
else if( Vehicle* vk = me->GetVehicleKit() )
else if (Vehicle* vk = me->GetVehicleKit())
{
events.RescheduleEvent(EVENT_PICK_SNOBOLD_TARGET, 5s);
if( Unit* snobold = vk->GetPassenger(4) )
if( snobold->IsCreature() )
if (Unit* snobold = vk->GetPassenger(4))
if (snobold->IsCreature())
{
bool needDespawn = true;
for( uint8 i = 0; i < 4; ++i )
if( !vk->GetPassenger(i) )
if (!vk->GetPassenger(i))
{
snobold->ChangeSeat(i);
needDespawn = false;
break;
}
if( needDespawn )
if (needDespawn)
snobold->ToCreature()->DespawnOrUnsummon();
}
}
@ -383,7 +383,7 @@ public:
{
summons.DoAction(1);
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_GORMOK, DONE);
}
@ -394,7 +394,7 @@ public:
void DoAction(int32 param) override
{
switch( param )
switch (param)
{
case -1:
summons.DespawnAll();
@ -407,7 +407,7 @@ public:
events.Reset();
summons.DespawnAll();
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_FAILED, 1);
}
};
@ -488,16 +488,16 @@ struct boss_jormungarAI : public ScriptedAI
void DoAction(int32 param) override
{
switch( param )
switch (param)
{
case -1:
if( !me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE) )
if (!me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
events.RescheduleEvent(EVENT_SUBMERGE, 1500ms);
break;
case -2:
if( me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE) )
if (me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
bIsStationary = true; // it will come out mobile soon
else if( me->GetDisplayId() == _MODEL_STATIONARY )
else if (me->GetDisplayId() == _MODEL_STATIONARY )
events.RescheduleEvent(EVENT_SUBMERGE, 1s);
else
events.CancelEvent(EVENT_SUBMERGE);
@ -510,7 +510,7 @@ struct boss_jormungarAI : public ScriptedAI
void ScheduleEvents()
{
events.Reset();
if( me->GetDisplayId() == _MODEL_STATIONARY )
if (me->GetDisplayId() == _MODEL_STATIONARY )
{
me->SetAttackTime(BASE_ATTACK, 1500);
events.RescheduleEvent(EVENT_SPELL_SPRAY, (me->GetEntry() == NPC_ACIDMAW ? 20s : 15s));
@ -523,7 +523,7 @@ struct boss_jormungarAI : public ScriptedAI
events.RescheduleEvent(EVENT_SPELL_SPEW, 15s, 30s);
events.RescheduleEvent(EVENT_SPELL_SLIME_POOL, 15s);
}
if( !me->HasAura(SPELL_ENRAGE) )
if (!me->HasAura(SPELL_ENRAGE))
events.RescheduleEvent(EVENT_SUBMERGE, 45s, 50s);
}
@ -540,11 +540,11 @@ struct boss_jormungarAI : public ScriptedAI
void AttackStart(Unit* who) override
{
if( me->GetDisplayId() == _MODEL_STATIONARY )
if (me->GetDisplayId() == _MODEL_STATIONARY )
{
if( !who )
if (!who)
return;
if( me->Attack(who, true) )
if (me->Attack(who, true))
DoStartNoMovement(who);
}
else
@ -553,15 +553,15 @@ struct boss_jormungarAI : public ScriptedAI
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -573,8 +573,8 @@ struct boss_jormungarAI : public ScriptedAI
Talk(EMOTE_SUBMERGE);
// second one submerge 1.5sec after the first one, used also for synchronizing
if( pInstance )
if( Creature* c = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(_TYPE_OTHER)) )
if (pInstance)
if (Creature* c = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(_TYPE_OTHER)))
c->AI()->DoAction(-1);
events.Reset();
@ -584,7 +584,7 @@ struct boss_jormungarAI : public ScriptedAI
case EVENT_MOVE_UNDERGROUND:
{
float angle = me->GetAngle(Locs[LOC_CENTER].GetPositionX() + urand(0, 20) - 10.0f, Locs[LOC_CENTER].GetPositionY() + urand(0, 20) - 10.0f), dist = urand(10, 35);
if( Creature* c = me->SummonCreature(NPC_WORLD_TRIGGER, *me, TEMPSUMMON_TIMED_DESPAWN, 6000) )
if (Creature* c = me->SummonCreature(NPC_WORLD_TRIGGER, *me, TEMPSUMMON_TIMED_DESPAWN, 6000))
{
c->SetSpeed(MOVE_RUN, 2.5f);
c->CastSpell(c, SPELL_CHURNING_GROUND, true);
@ -603,11 +603,11 @@ struct boss_jormungarAI : public ScriptedAI
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
me->StopMoving();
if( bIsStationary )
if (bIsStationary)
{
me->SetNativeDisplayId(_MODEL_MOBILE);
me->SetCombatMovement(true);
if( Unit* victim = me->GetVictim() )
if (Unit* victim = me->GetVictim())
me->GetMotionMaster()->MoveChase(victim);
}
else
@ -623,7 +623,7 @@ struct boss_jormungarAI : public ScriptedAI
}
break;
case EVENT_SPELL_SPRAY:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
me->CastSpell(target, _SPELL_SPRAY, false);
events.Repeat(20s);
break;
@ -632,7 +632,7 @@ struct boss_jormungarAI : public ScriptedAI
events.Repeat(15s, 30s);
break;
case EVENT_SPELL_BITE:
if( Unit* victim = me->GetVictim() )
if (Unit* victim = me->GetVictim())
me->CastSpell(victim, _SPELL_BITE, false);
events.Repeat(20s);
break;
@ -641,15 +641,15 @@ struct boss_jormungarAI : public ScriptedAI
events.Repeat(15s, 30s);
break;
case EVENT_SPELL_SLIME_POOL:
if( Creature* c = me->SummonCreature(NPC_SLIME_POOL, *me, TEMPSUMMON_TIMED_DESPAWN, 30000) )
if (Creature* c = me->SummonCreature(NPC_SLIME_POOL, *me, TEMPSUMMON_TIMED_DESPAWN, 30000))
c->CastSpell(c, SPELL_SLIME_POOL_EFFECT, true);
events.Repeat(30s);
break;
}
if( !me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE) )
if (!me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
{
if( me->GetDisplayId() == _MODEL_STATIONARY )
if (me->GetDisplayId() == _MODEL_STATIONARY )
DoSpellAttackIfReady(_SPELL_SPIT);
else
DoMeleeAttackIfReady();
@ -658,10 +658,10 @@ struct boss_jormungarAI : public ScriptedAI
void JustDied(Unit* /*pKiller*/) override
{
if( pInstance )
if (pInstance)
{
if( Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(_TYPE_OTHER)) )
if( c->IsAlive() )
if (Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(_TYPE_OTHER)))
if (c->IsAlive())
c->AI()->DoAction(-2);
pInstance->SetData(TYPE_JORMUNGAR, DONE);
}
@ -671,7 +671,7 @@ struct boss_jormungarAI : public ScriptedAI
{
events.Reset();
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_FAILED, 1);
}
};
@ -817,8 +817,8 @@ public:
{
Map::PlayerList const& lPlayers = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr )
if( Unit* p = itr->GetSource() )
if( p->IsAlive() && p->GetExactDist(me) <= 12.0f )
if (Unit* p = itr->GetSource())
if (p->IsAlive() && p->GetExactDist(me) <= 12.0f )
{
DoCastAOE(SPELL_TRAMPLE);
return true;
@ -829,7 +829,7 @@ public:
void MovementInform(uint32 /*type*/, uint32 id) override
{
if( id == EVENT_CHARGE )
if (id == EVENT_CHARGE)
{
events.Reset();
events.RescheduleEvent(EVENT_SPELL_FEROCIOUS_BUTT, 5s, 15s);
@ -843,7 +843,7 @@ public:
me->UpdatePosition(destX, destY, destZ, angle, true);
me->StopMovingOnCurrentPos();
if( !DoTrampleIfValid() )
if (!DoTrampleIfValid())
{
me->CastSpell(me, SPELL_STAGGERED_DAZE, true);
me->CastSpell((Unit*)nullptr, SPELL_TRAMPLE, true);
@ -862,20 +862,20 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_FEROCIOUS_BUTT:
if( Unit* victim = me->GetVictim() )
if (Unit* victim = me->GetVictim())
me->CastSpell(victim, SPELL_FEROCIOUS_BUTT, false);
events.Repeat(15s, 30s);
break;
@ -884,7 +884,7 @@ public:
events.Repeat(15s, 20s);
break;
case EVENT_SPELL_ARCTIC_BREATH:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 90.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 90.0f, true))
me->CastSpell(target, SPELL_ARCTIC_BREATH, false);
events.Repeat(20s, 30s);
break;
@ -906,7 +906,7 @@ public:
events.RescheduleEvent(EVENT_GAZE, 2s);
break;
case EVENT_GAZE:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 500.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 500.0f, true))
{
TargetGUID = target->GetGUID();
me->SetGuidValue(UNIT_FIELD_TARGET, TargetGUID);
@ -929,14 +929,14 @@ public:
case EVENT_JUMP_BACK:
{
float angle;
if( Unit* target = ObjectAccessor::GetPlayer(*me, TargetGUID) )
if (Unit* target = ObjectAccessor::GetPlayer(*me, TargetGUID))
angle = me->GetAngle(target);
else // in case something went wrong
angle = rand_norm() * 2 * M_PI;
float jumpangle = angle >= M_PI ? angle - M_PI : angle + M_PI;
float dist = 50.0f;
if( angle > 1.0f && angle < 2.0f ) // near main gate
if (angle > 1.0f && angle < 2.0f) // near main gate
dist = 46.0f;
destX = Locs[LOC_CENTER].GetPositionX() + cos(angle) * dist;
destY = Locs[LOC_CENTER].GetPositionY() + std::sin(angle) * dist;
@ -946,8 +946,8 @@ public:
events.RescheduleEvent(EVENT_TRAMPLE, 1500ms);
if( pInstance )
switch( GetDifficulty() )
if (pInstance)
switch (GetDifficulty())
{
case RAID_DIFFICULTY_10MAN_NORMAL:
pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MASSIVE_CRASH);
@ -976,7 +976,7 @@ public:
break;
case EVENT_CHECK_TRAMPLE_PLAYERS:
if( DoTrampleIfValid() )
if (DoTrampleIfValid())
{
events.Reset();
events.RescheduleEvent(EVENT_SPELL_FEROCIOUS_BUTT, 5s, 15s);
@ -996,7 +996,7 @@ public:
break;
}
if( me->GetReactState() != REACT_PASSIVE )
if (me->GetReactState() != REACT_PASSIVE )
DoMeleeAttackIfReady();
}
@ -1004,13 +1004,13 @@ public:
{
events.Reset();
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_FAILED, 1);
}
void JustDied(Unit* /*killer*/) override
{
if( !pInstance )
if (!pInstance)
return;
pInstance->SetData(TYPE_ICEHOWL, DONE);

View file

@ -116,9 +116,9 @@ struct boss_twin_valkyrAI : public ScriptedAI
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_HASTE_SPELLS, true);
events.Reset();
if( me->GetEntry() == NPC_LIGHTBANE )
if (me->GetEntry() == NPC_LIGHTBANE )
{
if( pInstance )
if (pInstance)
pInstance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, 21853);
// special events here
@ -127,7 +127,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
events.RescheduleEvent(EVENT_SPECIAL, 45s);
}
events.RescheduleEvent(EVENT_SPELL_SPIKE, 5s, 8s);
if( IsHeroic() )
if (IsHeroic())
events.RescheduleEvent(EVENT_SPELL_TOUCH, 10s, 25s, 1);
me->SetCanFly(true);
@ -142,14 +142,14 @@ struct boss_twin_valkyrAI : public ScriptedAI
void DoAction(int32 a) override
{
switch( a )
switch (a)
{
case -1:
summons.DespawnAll();
if( pInstance && me->GetEntry() == NPC_LIGHTBANE )
if (pInstance && me->GetEntry() == NPC_LIGHTBANE )
{
uint32 essenceId1 = 0, empoweredId1 = 0, touchId1 = 0, essenceId2 = 0, empoweredId2 = 0, touchId2 = 0;
switch( me->GetMap()->GetDifficulty() )
switch (me->GetMap()->GetDifficulty())
{
case 0:
essenceId1 = 65684;
@ -207,7 +207,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
/*void AttackStart(Unit* victim)
{
if( victim && me->Attack(victim, true) )
if (victim && me->Attack(victim, true))
me->GetMotionMaster()->MoveChase(victim, 0.0f, 0.0f, 6.0f);
}*/
@ -216,15 +216,15 @@ struct boss_twin_valkyrAI : public ScriptedAI
me->setActive(true);
me->LowerPlayerDamageReq(me->GetMaxHealth());
DoZoneInCombat();
if( Creature* twin = GetSister() )
if( !twin->IsInCombat() )
if( Unit* target = twin->SelectNearestTarget(200.0f) )
if (Creature* twin = GetSister())
if (!twin->IsInCombat())
if (Unit* target = twin->SelectNearestTarget(200.0f))
twin->AI()->AttackStart(target);
Talk(SAY_AGGRO);
me->CastSpell(me, me->GetEntry() == NPC_LIGHTBANE ? SPELL_LIGHT_SURGE : SPELL_DARK_SURGE, true);
if( pInstance && me->GetEntry() == NPC_LIGHTBANE )
if (pInstance && me->GetEntry() == NPC_LIGHTBANE )
pInstance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, 21853);
}
@ -265,13 +265,13 @@ struct boss_twin_valkyrAI : public ScriptedAI
void UpdateSharedHealth()
{
// lightbane synchronizes
if( me->GetEntry() == NPC_LIGHTBANE )
if( Creature* twin = GetSister() )
if( twin->IsAlive() && me->IsAlive() )
if (me->GetEntry() == NPC_LIGHTBANE )
if (Creature* twin = GetSister())
if (twin->IsAlive() && me->IsAlive())
{
int32 d = CAST_AI(boss_twin_valkyrAI, twin->AI())->LastSynchroHP - (int32)twin->GetHealth();
int32 newhealth = (int32)me->GetHealth() - d;
if( newhealth <= 0 )
if (newhealth <= 0)
newhealth = 1;
me->SetHealth( (uint32)newhealth );
twin->SetHealth(me->GetHealth());
@ -281,25 +281,25 @@ struct boss_twin_valkyrAI : public ScriptedAI
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
UpdateSharedHealth();
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
uint8 eventId = events.ExecuteEvent();
switch(eventId)
switch (eventId)
{
case 0:
break;
case EVENT_BERSERK:
me->CastSpell(me, SPELL_BERSERK, true);
Talk(SAY_BERSERK);
if( Creature* twin = GetSister() )
if (Creature* twin = GetSister())
{
twin->CastSpell(twin, SPELL_BERSERK, true);
twin->AI()->Talk(SAY_BERSERK);
@ -311,18 +311,18 @@ struct boss_twin_valkyrAI : public ScriptedAI
case EVENT_SUMMON_BALLS_3:
{
uint8 count = 0;
if( IsHeroic() )
if (IsHeroic())
count = eventId == EVENT_SUMMON_BALLS_3 ? 36 : 6;
else
count = eventId == EVENT_SUMMON_BALLS_3 ? 24 : 4;
for( uint8 i = 0; i < count; ++i )
{
float angle = rand_norm() * 2 * M_PI;
if( Creature* ball = me->SummonCreature((i % 2) ? NPC_CONCENTRATED_DARK : NPC_CONCENTRATED_LIGHT, Locs[LOC_CENTER].GetPositionX() + cos(angle) * 47.0f, Locs[LOC_CENTER].GetPositionY() + std::sin(angle) * 47.0f, Locs[LOC_CENTER].GetPositionZ() + 1.5f, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1500) )
if (Creature* ball = me->SummonCreature((i % 2) ? NPC_CONCENTRATED_DARK : NPC_CONCENTRATED_LIGHT, Locs[LOC_CENTER].GetPositionX() + cos(angle) * 47.0f, Locs[LOC_CENTER].GetPositionY() + std::sin(angle) * 47.0f, Locs[LOC_CENTER].GetPositionZ() + 1.5f, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1500))
boss_twin_valkyrAI::JustSummoned(ball);
}
switch( eventId )
switch (eventId)
{
case EVENT_SUMMON_BALLS_1:
events.RescheduleEvent(EVENT_SUMMON_BALLS_2, 8s);
@ -343,10 +343,10 @@ struct boss_twin_valkyrAI : public ScriptedAI
case EVENT_SPELL_TOUCH:
{
uint32 essenceId = 0;
switch( me->GetEntry() )
switch (me->GetEntry())
{
case NPC_LIGHTBANE:
switch( GetDifficulty() )
switch (GetDifficulty())
{
case 0:
essenceId = 65684;
@ -363,7 +363,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
}
break;
case NPC_DARKBANE:
switch( GetDifficulty() )
switch (GetDifficulty())
{
case 0:
essenceId = 65686;
@ -382,7 +382,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
}
/*
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, essenceId) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, essenceId))
me->CastSpell(target, me->GetEntry()==NPC_LIGHTBANE ? SPELL_LIGHT_TOUCH : SPELL_DARK_TOUCH, false);
events.RepeatEvent(urand(45000,50000));
*/
@ -414,17 +414,17 @@ struct boss_twin_valkyrAI : public ScriptedAI
do s = urand(0, 3);
while( SpecialMask & (1 << s) && (SpecialMask & 0xF) != 0xF );
SpecialMask |= (1 << s);
switch( s )
switch (s)
{
case 0: // light vortex
me->CastSpell((Unit*)nullptr, SPELL_LIGHT_VORTEX, false);
Talk(EMOTE_VORTEX);
Talk(SAY_LIGHT);
if( Creature* twin = GetSister() )
if (Creature* twin = GetSister())
twin->AI()->Talk(SAY_LIGHT);
break;
case 1: // dark vortex
if( Creature* twin = GetSister() )
if (Creature* twin = GetSister())
{
twin->CastSpell((Unit*)nullptr, SPELL_DARK_VORTEX, false);
twin->AI()->Talk(EMOTE_VORTEX);
@ -435,7 +435,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
case 2: // light pact
Talk(EMOTE_TWINK_PACT);
Talk(SAY_TWINK_PACT);
if( Creature* twin = GetSister() )
if (Creature* twin = GetSister())
{
twin->AI()->Talk(SAY_TWINK_PACT);
twin->AI()->DoAction(-3);
@ -444,7 +444,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
me->CastSpell(me, SPELL_LIGHT_TWIN_PACT, false);
break;
case 3: // dark pact
if( Creature* twin = GetSister() )
if (Creature* twin = GetSister())
{
twin->AI()->Talk(EMOTE_TWINK_PACT);
twin->AI()->Talk(SAY_TWINK_PACT);
@ -455,7 +455,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
}
break;
}
if( (SpecialMask & 0xF) == 0xF )
if ((SpecialMask & 0xF) == 0xF )
SpecialMask = 0;
events.Repeat(45s);
events.DelayEventsToMax(15000, 1); // no touch of light/darkness during special abilities!
@ -474,13 +474,13 @@ struct boss_twin_valkyrAI : public ScriptedAI
{
DoAction(-1);
Talk(SAY_DEATH);
if( pInstance )
if (pInstance)
{
pInstance->SetData(TYPE_VALKYR, DONE);
pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_POWERING_UP);
}
if( Creature* twin = GetSister() )
if( twin->IsAlive() )
if (Creature* twin = GetSister())
if (twin->IsAlive())
{
twin->SetHealth(1);
Unit::Kill(twin, twin);
@ -499,17 +499,17 @@ struct boss_twin_valkyrAI : public ScriptedAI
void KilledUnit(Unit* who) override
{
if( who->IsPlayer() )
if (who->IsPlayer())
{
Talk(SAY_KILL_PLAYER);
if( Creature* twin = GetSister() )
if (Creature* twin = GetSister())
twin->AI()->Talk(SAY_KILL_PLAYER);
}
}
void EnterEvadeMode(EvadeReason /* why */) override
{
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_FAILED, 0);
}
};
@ -530,9 +530,9 @@ public:
{
me->SetFlag(UNIT_FIELD_AURASTATE, 1 << (19 - 1));
SetEquipmentSlots(false, EQUIP_MAIN_2, EQUIP_OFFHAND_2, EQUIP_RANGED_2);
if( Creature* c = me->SummonCreature(NPC_DARK_ESSENCE, Locs[LOC_DARKESS_1]) )
if (Creature* c = me->SummonCreature(NPC_DARK_ESSENCE, Locs[LOC_DARKESS_1]))
boss_twin_valkyrAI::JustSummoned(c);
if( Creature* c = me->SummonCreature(NPC_DARK_ESSENCE, Locs[LOC_DARKESS_2]) )
if (Creature* c = me->SummonCreature(NPC_DARK_ESSENCE, Locs[LOC_DARKESS_2]))
boss_twin_valkyrAI::JustSummoned(c);
}
@ -556,9 +556,9 @@ public:
{
me->SetFlag(UNIT_FIELD_AURASTATE, 1 << (22 - 1));
SetEquipmentSlots(false, EQUIP_MAIN_1, EQUIP_OFFHAND_1, EQUIP_RANGED_1);
if( Creature* c = me->SummonCreature(NPC_LIGHT_ESSENCE, Locs[LOC_LIGHTESS_1]) )
if (Creature* c = me->SummonCreature(NPC_LIGHT_ESSENCE, Locs[LOC_LIGHTESS_1]))
boss_twin_valkyrAI::JustSummoned(c);
if( Creature* c = me->SummonCreature(NPC_LIGHT_ESSENCE, Locs[LOC_LIGHTESS_2]) )
if (Creature* c = me->SummonCreature(NPC_LIGHT_ESSENCE, Locs[LOC_LIGHTESS_2]))
boss_twin_valkyrAI::JustSummoned(c);
}
@ -573,7 +573,7 @@ public:
bool OnGossipHello(Player* player, Creature* creature) override
{
switch( creature->GetEntry() )
switch (creature->GetEntry())
{
case NPC_LIGHT_ESSENCE:
{
@ -582,7 +582,7 @@ public:
//uint32 empoweredId = 0;
uint32 touchId1 = 0;
//uint32 touchId2 = 0;
switch( creature->GetMap()->GetDifficulty() )
switch (creature->GetMap()->GetDifficulty())
{
case 0:
essenceId = 65684;
@ -628,7 +628,7 @@ public:
//uint32 empoweredId = 0;
//uint32 touchId1 = 0;
uint32 touchId2 = 0;
switch( creature->GetMap()->GetDifficulty() )
switch (creature->GetMap()->GetDifficulty())
{
case 0:
essenceId = 65686;
@ -706,10 +706,10 @@ public:
void MovementInform(uint32 type, uint32 id) override
{
if( type != POINT_MOTION_TYPE || id != 0 )
if (type != POINT_MOTION_TYPE || id != 0)
return;
if( urand(0, 2) )
if (urand(0, 2))
me->DespawnOrUnsummon(0);
}
@ -721,10 +721,10 @@ public:
void UpdateAI(uint32 /*diff*/) override
{
if( despawning )
if (despawning)
return;
if( me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE )
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE )
MoveToNextPoint();
}
};
@ -742,15 +742,15 @@ public:
void HandleAfterEffectAbsorb(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
{
uint16 count = absorbAmount / 1000;
if( !count || !GetOwner() )
if (!count || !GetOwner())
return;
if( SpellInfo const* se = GetAura()->GetSpellInfo() )
if( Unit* owner = GetOwner()->ToUnit() )
if (SpellInfo const* se = GetAura()->GetSpellInfo())
if (Unit* owner = GetOwner()->ToUnit())
{
uint32 auraId = 0;
uint32 empoweredId = 0;
switch( se->Id )
switch (se->Id)
{
case 65686:
auraId = 67590;
@ -785,15 +785,15 @@ public:
empoweredId = 65724;
break;
}
if( !owner->HasAura(auraId) )
if (!owner->HasAura(auraId))
{
owner->CastSpell(owner, SPELL_POWERING_UP, true);
if( --count == 0 )
if (--count == 0)
return;
}
if( Aura* aur = owner->GetAura(auraId) )
if (Aura* aur = owner->GetAura(auraId))
{
if( aur->GetStackAmount() + count < 100 )
if (aur->GetStackAmount() + count < 100 )
{
aur->ModStackAmount(count);
@ -834,15 +834,15 @@ public:
{
PreventDefaultAction();
Unit* caster = GetCaster();
if( !caster )
if (!caster)
return;
if( caster->GetMap()->GetId() == 649 )
if (caster->GetMap()->GetId() == 649 )
{
uint32 excludedID = GetSpellInfo()->ExcludeTargetAuraSpell;
Map::PlayerList const& pl = caster->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if( Player* plr = itr->GetSource() )
if( plr->IsAlive() && !plr->HasAura(excludedID) && !plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION) )
if (Player* plr = itr->GetSource())
if (plr->IsAlive() && !plr->HasAura(excludedID) && !plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
{
uint32 absorb = 0;
uint32 resist = 0;

View file

@ -36,15 +36,15 @@ public:
bool OnGossipHello(Player* player, Creature* creature) override
{
if(!creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
if (!creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
return true;
InstanceScript* pInstance = creature->GetInstanceScript();
if(!pInstance)
if (!pInstance)
return true;
uint32 gossipTextId = 0;
switch(pInstance->GetData(TYPE_INSTANCE_PROGRESS))
switch (pInstance->GetData(TYPE_INSTANCE_PROGRESS))
{
case INSTANCE_PROGRESS_INITIAL:
gossipTextId = MSG_TESTED;
@ -72,14 +72,14 @@ public:
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 uiAction) override
{
if( !creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP) )
if (!creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
return true;
InstanceScript* pInstance = creature->GetInstanceScript();
if( !pInstance )
if (!pInstance)
return true;
if( uiAction == GOSSIP_ACTION_INFO_DEF + 1337 )
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1337)
{
pInstance->SetData(TYPE_ANNOUNCER_GOSSIP_SELECT, 0);
creature->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);

View file

@ -133,7 +133,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case EVENT_SPELL_INFECTED_WOUND:
me->CastSpell(me->GetVictim(), SPELL_INFECTED_WOUND, false);

View file

@ -143,7 +143,7 @@ public:
if (me->isAttackReady())
me->SetFacingToObject(me->GetVictim());
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -204,7 +204,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -81,7 +81,7 @@ public:
void UpdateAI(uint32 diff) override
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -206,7 +206,7 @@ public:
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) override
{
ClearGossipMenuFor(player);
switch(uiAction)
switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
CloseGossipMenuFor(player);

View file

@ -151,7 +151,7 @@ public:
void SetData(uint32 type, uint32 data) override
{
switch(type)
switch (type)
{
case DATA_BRONJAHM:
m_auiEncounter[type] = data;
@ -180,22 +180,22 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
case 12752: // Soul Power
if( Creature* c = instance->GetCreature(NPC_BronjahmGUID) )
if (Creature* c = instance->GetCreature(NPC_BronjahmGUID))
{
std::list<Creature*> L;
uint8 count = 0;
c->GetCreaturesWithEntryInRange(L, 200.0f, 36535); // find all Corrupted Soul Fragment (36535)
for( std::list<Creature*>::const_iterator itr = L.begin(); itr != L.end(); ++itr )
if( (*itr)->IsAlive() )
if ((*itr)->IsAlive())
++count;
return (count >= 4);
}
break;
case 12976:
if( Creature* c = instance->GetCreature(NPC_DevourerGUID) )
if (Creature* c = instance->GetCreature(NPC_DevourerGUID))
return (bool)c->AI()->GetData(1);
break;
}

View file

@ -245,7 +245,7 @@ public:
void DoAction(int32 actionId) override
{
switch(actionId)
switch (actionId)
{
case ACTION_START_INTRO:
events.ScheduleEvent(EVENT_START_INTRO, 0ms);
@ -1767,7 +1767,7 @@ public:
if (me->IsNonMeleeSpellCast(false, true, true))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case EVENT_LK_CHECK_COMBAT:
if (me->isActiveObject()) // during fight
@ -1953,7 +1953,7 @@ public:
void DoAction(int32 actionId) override
{
switch(actionId)
switch (actionId)
{
case ACTION_START_INTRO:
events.ScheduleEvent(EVENT_LK_SAY_AGGRO, 0ms);
@ -2001,7 +2001,7 @@ public:
void UpdateAI(uint32 diff) override
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case EVENT_LK_SAY_AGGRO:
if (Creature* lkboss = pInstance->instance->GetCreature(pInstance->GetGuidData(NPC_LICH_KING_BOSS)))

View file

@ -228,7 +228,7 @@ public:
}
}
switch(creature->GetEntry())
switch (creature->GetEntry())
{
case NPC_SYLVANAS_PART1:
creature->SetVisible(false);
@ -372,7 +372,7 @@ public:
void OnGameObjectCreate(GameObject* go) override
{
switch(go->GetEntry())
switch (go->GetEntry())
{
case GO_FROSTMOURNE:
GO_FrostmourneGUID = go->GetGUID();
@ -408,7 +408,7 @@ public:
void SetData(uint32 type, uint32 data) override
{
switch(type)
switch (type)
{
case DATA_INTRO:
EncounterMask |= (1 << DATA_INTRO);
@ -597,7 +597,7 @@ public:
if (EncounterMask & (1 << DATA_BATTERED_HILT))
return;
switch(data)
switch (data)
{
case 1: // talked to leader
EncounterMask |= (1 << DATA_BATTERED_HILT);
@ -667,7 +667,7 @@ public:
uint32 GetData(uint32 type) const override
{
switch(type)
switch (type)
{
case DATA_INTRO:
case DATA_FALRIC:
@ -687,7 +687,7 @@ public:
ObjectGuid GetGuidData(uint32 type) const override
{
switch(type)
switch (type)
{
case NPC_DARK_RANGER_LORALEN:
return NPC_GuardGUID;

View file

@ -233,7 +233,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -175,7 +175,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING | UNIT_STATE_STUNNED))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -212,7 +212,7 @@ public:
break;
case EVENT_SPECIAL:
switch(urand(0, 2))
switch (urand(0, 2))
{
case 0: // Pursuit
if (Creature* k = GetKrick())
@ -305,7 +305,7 @@ public:
void UpdateAI(uint32 diff) override
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -150,7 +150,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -261,7 +261,7 @@ public:
void SetData(uint32 type, uint32 data) override
{
switch(type)
switch (type)
{
case DATA_INSTANCE_PROGRESS:
if (InstanceProgress < data)
@ -306,7 +306,7 @@ public:
void SetGuidData(uint32 type, ObjectGuid data) override
{
switch(type)
switch (type)
{
case DATA_NECROLYTE_1_GUID:
NPC_Necrolyte1GUID = data;
@ -374,7 +374,7 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
case 12993: // Doesn't Go to Eleven (4524)
return bAchievEleven;

View file

@ -73,7 +73,7 @@ public:
void UpdateAI(uint32 diff) override
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -469,7 +469,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -521,7 +521,7 @@ public:
{
if (type != POINT_MOTION_TYPE)
return;
switch(id)
switch (id)
{
case 1:
events.RescheduleEvent(id, 0ms);
@ -532,7 +532,7 @@ public:
void UpdateAI(uint32 diff) override
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -1013,7 +1013,7 @@ public:
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -1198,7 +1198,7 @@ public:
if (type != WAYPOINT_MOTION_TYPE)
return;
switch(id)
switch (id)
{
case 0:
Talk(me->GetEntry() == NPC_JAINA_PART2 ? SAY_JAINA_OUTRO_2 : SAY_SYLVANAS_OUTRO_2);
@ -1221,7 +1221,7 @@ public:
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -813,7 +813,7 @@ class spell_sindragosa_s_fury : public SpellScript
if (ResistFactor > 0.9f)
ResistFactor = 0.9f;
uint32 damage = uint32( (GetEffectValue() / _targetCount) * (1.0f - ResistFactor) );
uint32 damage = uint32( (GetEffectValue() / _targetCount) * (1.0f - ResistFactor));
SpellNonMeleeDamage damageInfo(GetCaster(), GetHitUnit(), GetSpellInfo(), GetSpellInfo()->SchoolMask);
damageInfo.damage = damage;

View file

@ -157,7 +157,7 @@ public:
void MoveToCorner()
{
switch(me->GetEntry())
switch (me->GetEntry())
{
case NPC_THANE_KORTHAZZ:
currentWaypoint = 0;

View file

@ -357,7 +357,7 @@ public:
void SummonHelpers(uint32 entry)
{
switch(entry)
switch (entry)
{
case NPC_LIVING_TRAINEE:
me->SummonCreature(NPC_LIVING_TRAINEE, PosSummonLiving[0].GetPositionX(), PosSummonLiving[0].GetPositionY(), PosSummonLiving[0].GetPositionZ(), PosSummonLiving[0].GetOrientation());

View file

@ -231,7 +231,7 @@ public:
}
if (GameObject* go = me->GetMap()->GetGameObject(pInstance->GetGuidData(DATA_KELTHUZAD_GATE)))
{
if(!_justSpawned) // Don't open the door if we just spawned and are still doing the conversation
if (!_justSpawned) // Don't open the door if we just spawned and are still doing the conversation
{
go->SetGoState(GO_STATE_ACTIVE);
}

View file

@ -222,7 +222,7 @@ public:
void DamageTaken(Unit* who, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
// Damage done by the controlled Death Knight understudies should also count toward damage done by players
if(who && who->IsCreature() && who->GetEntry() == NPC_DEATH_KNIGHT_UNDERSTUDY)
if (who && who->IsCreature() && who->GetEntry() == NPC_DEATH_KNIGHT_UNDERSTUDY)
{
me->LowerPlayerDamageReq(damage);
}

View file

@ -206,7 +206,7 @@ public:
void OnCreatureCreate(Creature* creature) override
{
switch(creature->GetEntry())
switch (creature->GetEntry())
{
case NPC_PATCHWERK:
_patchwerkGUID = creature->GetGUID();
@ -277,7 +277,7 @@ public:
return;
}
switch(pGo->GetEntry())
switch (pGo->GetEntry())
{
case GO_PATCHWERK_GATE:
_patchwerkGateGUID = pGo->GetGUID();
@ -621,7 +621,7 @@ public:
void SetData(uint32 id, uint32 data) override
{
switch(id)
switch (id)
{
case DATA_ABOMINATION_KILLED:
abominationsKilled++;
@ -768,7 +768,7 @@ public:
return false;
// Bosses data
switch(bossId)
switch (bossId)
{
case BOSS_KELTHUZAD:
if (state == NOT_STARTED)

View file

@ -382,7 +382,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -799,7 +799,7 @@ public:
if (!summon)
return;
summons.Summon(summon);
switch(summon->GetEntry())
switch (summon->GetEntry())
{
case NPC_ARCANE_OVERLOAD:
summon->CastSpell(summon, SPELL_ARCANE_OVERLOAD_DMG, true);
@ -989,7 +989,7 @@ public:
void DoAction(int32 param) override
{
switch(param)
switch (param)
{
case 1:
MoveTimer = 1;
@ -1123,7 +1123,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -1183,7 +1183,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -1321,12 +1321,12 @@ public:
void DoAction(int32 param) override
{
switch(param)
switch (param)
{
case 1: // move to next point
if (Vehicle* v = me->GetVehicleKit())
if (Unit* pass = v->GetPassenger(0))
switch(pass->GetEntry())
switch (pass->GetEntry())
{
case NPC_NEXUS_LORD:
{
@ -1357,7 +1357,7 @@ public:
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -1397,7 +1397,7 @@ public:
void UpdateAI(uint32 diff) override
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -97,7 +97,7 @@ public:
void OnCreatureCreate(Creature* creature) override
{
switch(creature->GetEntry())
switch (creature->GetEntry())
{
case NPC_MALYGOS:
NPC_MalygosGUID = creature->GetGUID();
@ -107,7 +107,7 @@ public:
void OnGameObjectCreate(GameObject* go) override
{
switch(go->GetEntry())
switch (go->GetEntry())
{
case GO_IRIS_N:
case GO_IRIS_H:
@ -124,7 +124,7 @@ public:
void SetData(uint32 type, uint32 data) override
{
switch(type)
switch (type)
{
case DATA_IRIS_ACTIVATED:
if (EncounterStatus == NOT_STARTED)
@ -134,7 +134,7 @@ public:
break;
case DATA_ENCOUNTER_STATUS:
EncounterStatus = data;
switch(data)
switch (data)
{
case NOT_STARTED:
bPokeAchiev = false;
@ -184,7 +184,7 @@ public:
ObjectGuid GetGuidData(uint32 type) const override
{
switch(type)
switch (type)
{
case DATA_MALYGOS_GUID:
return NPC_MalygosGUID;
@ -195,7 +195,7 @@ public:
void ProcessEvent(WorldObject* /*unit*/, uint32 eventId) override
{
switch(eventId)
switch (eventId)
{
case 20158:
if (GameObject* go = instance->GetGameObject(GO_PlatformGUID))
@ -233,7 +233,7 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* source, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
case ACHIEV_CRITERIA_A_POKE_IN_THE_EYE_10:
case ACHIEV_CRITERIA_A_POKE_IN_THE_EYE_25:

View file

@ -105,9 +105,9 @@ public:
{
pInstance->SetData(DATA_DRAKOS, DONE);
for( uint8 i = 0; i < 3; ++i )
if( ObjectGuid guid = pInstance->GetGuidData(DATA_DCD_1 + i) )
if( GameObject* pGo = ObjectAccessor::GetGameObject(*me, guid) )
if( pGo->GetGoState() != GO_STATE_ACTIVE )
if (ObjectGuid guid = pInstance->GetGuidData(DATA_DCD_1 + i))
if (GameObject* pGo = ObjectAccessor::GetGameObject(*me, guid))
if (pGo->GetGoState() != GO_STATE_ACTIVE )
{
pGo->SetLootState(GO_READY);
pGo->UseDoorOrButton(0, false);
@ -125,17 +125,17 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
DoMeleeAttackIfReady();
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -206,10 +206,10 @@ public:
void MovementInform(uint32 type, uint32 id) override
{
if( type != POINT_MOTION_TYPE || id != 1 )
if (type != POINT_MOTION_TYPE || id != 1)
return;
if( !located )
if (!located)
gonext = true;
}
@ -231,21 +231,21 @@ public:
void UpdateAI(uint32 diff) override
{
if( timer == 0 )
if (timer == 0)
me->CastSpell(me, SPELL_TELEPORT_VISUAL, true);
timer += diff;
if( timer > 10000 )
if (timer > 10000)
{
if( !located )
if (!located)
me->GetMotionMaster()->MoveIdle();
located = true;
me->CastSpell(me, SPELL_UNSTABLE_SPHERE_PULSE, true);
timer -= 2000;
}
if( !located && gonext )
if (!located && gonext)
{
PickNewLocation();
gonext = false;

View file

@ -93,7 +93,7 @@ public:
if (pInstance)
{
pInstance->SetData(DATA_EREGOS, NOT_STARTED);
if( pInstance->GetData(DATA_UROM) != DONE )
if (pInstance->GetData(DATA_UROM) != DONE )
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
else
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
@ -110,17 +110,17 @@ public:
{
pInstance->SetData(DATA_EREGOS, IN_PROGRESS);
if( me->FindNearestCreature(NPC_AMBER_DRAKE, 750.0f, true) )
if (me->FindNearestCreature(NPC_AMBER_DRAKE, 750.0f, true))
pInstance->SetData(DATA_AMBER_VOID, 0);
else
pInstance->SetData(DATA_AMBER_VOID, 1);
if( me->FindNearestCreature(NPC_EMERALD_DRAKE, 750.0f, true) )
if (me->FindNearestCreature(NPC_EMERALD_DRAKE, 750.0f, true))
pInstance->SetData(DATA_EMERALD_VOID, 0);
else
pInstance->SetData(DATA_EMERALD_VOID, 1);
if( me->FindNearestCreature(NPC_RUBY_DRAKE, 750.0f, true) )
if (me->FindNearestCreature(NPC_RUBY_DRAKE, 750.0f, true))
pInstance->SetData(DATA_RUBY_VOID, 0);
else
pInstance->SetData(DATA_RUBY_VOID, 1);
@ -148,10 +148,10 @@ public:
void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override
{
if( !me->GetMap()->IsHeroic() )
if (!me->GetMap()->IsHeroic())
return;
if( shiftNumber <= uint32(1) && uint32(me->GetHealth() * 100 / me->GetMaxHealth()) <= uint32(60 - shiftNumber * 40) )
if (shiftNumber <= uint32(1) && uint32(me->GetHealth() * 100 / me->GetMaxHealth()) <= uint32(60 - shiftNumber * 40))
{
++shiftNumber;
events.RescheduleEvent(EVENT_SPELL_PLANAR_SHIFT, 0ms);
@ -167,7 +167,7 @@ public:
void JustSummoned(Creature* pSummon) override
{
if( pSummon->GetEntry() != NPC_LEY_GUARDIAN_WHELP )
if (pSummon->GetEntry() != NPC_LEY_GUARDIAN_WHELP )
return;
DoZoneInCombat(pSummon, 300.0f);
@ -175,25 +175,25 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
if( me->HasAura(SPELL_PLANAR_SHIFT) || me->HasAura(SPELL_DRAKE_STOP_TIME) )
if (me->HasAura(SPELL_PLANAR_SHIFT) || me->HasAura(SPELL_DRAKE_STOP_TIME))
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
DoMeleeAttackIfReady();
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_ARCANE_BARRAGE:
if( Unit* v = me->GetVictim() )
if (Unit* v = me->GetVictim())
me->CastSpell(v, SPELL_ARCANE_BARRAGE, false);
events.Repeat(2500ms);
break;
@ -224,8 +224,8 @@ public:
Talk(SAY_SHIELD);
me->CastSpell(me, SPELL_PLANAR_SHIFT, false);
for( uint8 i = 0; i < 3; ++i )
if( Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 300.0f, false) )
if( Creature* pa = me->SummonCreature(NPC_PLANAR_ANOMALY, *me, TEMPSUMMON_TIMED_DESPAWN, 17000) )
if (Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 300.0f, false))
if (Creature* pa = me->SummonCreature(NPC_PLANAR_ANOMALY, *me, TEMPSUMMON_TIMED_DESPAWN, 17000))
{
pa->SetCanFly(true);
pa->SetDisableGravity(true);
@ -234,7 +234,7 @@ public:
pa->CastSpell(pa, SPELL_PLANAR_AURA_DAMAGE, true);
if (Aura* a = pa->GetAura(SPELL_PLANAR_AURA_DAMAGE))
a->SetDuration(15000);
if( pa->AI() )
if (pa->AI())
{
pa->AI()->AttackStart(t);
pa->GetMotionMaster()->MoveChase(t, 0.01f);

View file

@ -125,7 +125,7 @@ public:
if (pInstance)
{
pInstance->SetData(DATA_UROM, NOT_STARTED);
if( pInstance->GetData(DATA_VAROS) != DONE )
if (pInstance->GetData(DATA_VAROS) != DONE )
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
else
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
@ -143,20 +143,20 @@ public:
void JustEngagedWith(Unit* /*who*/) override
{
if( lock )
if (lock)
return;
uint8 phase = GetPhaseByCurrentPosition();
if( phase == 3 )
if (phase == 3)
{
Talk(SAY_AGGRO);
if( pInstance )
if (pInstance)
pInstance->SetData(DATA_UROM, IN_PROGRESS);
me->SetInCombatWithZone();
me->SetHomePosition(cords[0][0], cords[0][1], cords[0][2], cords[0][3]);
if( me->FindCurrentSpellBySpellId(SPELL_EVOCATION) )
if (me->FindCurrentSpellBySpellId(SPELL_EVOCATION))
me->InterruptNonMeleeSpells(false);
events.RescheduleEvent(EVENT_FROSTBOMB, 7s, 11s);
@ -167,7 +167,7 @@ public:
{
lock = true;
switch( phase )
switch (phase)
{
case 0:
Talk(SAY_SUMMON_1);
@ -190,7 +190,7 @@ public:
void AttackStart(Unit* who) override
{
if( lock )
if (lock)
return;
if (me->GetDistance(1103.0f, 1049.0f, 510.0f) < 55.0f)
@ -200,8 +200,8 @@ public:
void JustSummoned(Creature* pSummon) override
{
pSummon->SetInCombatWithZone();
if( Unit* v = pSummon->SelectVictim() )
if( pSummon->AI() )
if (Unit* v = pSummon->SelectVictim())
if (pSummon->AI())
pSummon->AI()->AttackStart(v);
}
@ -234,7 +234,7 @@ public:
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
switch( spell->Id )
switch (spell->Id)
{
case SPELL_SUMMON_MENAGERIE_1:
{
@ -299,9 +299,9 @@ public:
void UpdateAI(uint32 diff) override
{
if( releaseLockTimer )
if (releaseLockTimer)
{
if( releaseLockTimer >= 5000 )
if (releaseLockTimer >= 5000)
{
lock = false;
if (me->IsInCombat())
@ -315,27 +315,27 @@ public:
releaseLockTimer += diff;
}
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
DoMeleeAttackIfReady();
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_FROSTBOMB:
if( Unit* v = me->GetVictim() )
if (Unit* v = me->GetVictim())
me->CastSpell(v, SPELL_FROSTBOMB, false);
events.Repeat(7s, 11s);
break;
case EVENT_TIME_BOMB:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
DoCast(target, DUNGEON_MODE(SPELL_TIME_BOMB_N, SPELL_TIME_BOMB_H));
events.Repeat(20s, 25s);
break;

View file

@ -100,7 +100,7 @@ public:
if (pInstance)
{
pInstance->SetData(DATA_VAROS, NOT_STARTED);
if( pInstance->GetData(DATA_CC_COUNT) < 10 )
if (pInstance->GetData(DATA_CC_COUNT) < 10 )
{
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->CastSpell(me, 50053, true);
@ -157,23 +157,23 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
DoMeleeAttackIfReady();
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_AMPLIFY_MAGIC:
{
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
me->CastSpell(target, SPELL_AMPLIFY_MAGIC, false);
events.Repeat(17s + 500ms, 22s + 500ms);
}
@ -185,7 +185,7 @@ public:
{
Talk(SAY_AZURE);
Talk(SAY_AZURE_EMOTE);
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case EVENT_CALL_AZURE_RING_CAPTAIN_1:
me->CastSpell(me, SPELL_CALL_AZURE_RING_CAPTAIN_1, true);
@ -204,11 +204,11 @@ public:
events.ScheduleEvent(EVENT_CALL_AZURE_RING_CAPTAIN_1, 16s);
break;
}
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
{
if( Creature* trigger = me->SummonCreature(NPC_ARCANE_BEAM, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 13000) )
if (Creature* trigger = me->SummonCreature(NPC_ARCANE_BEAM, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 13000))
{
if( Creature* c = me->FindNearestCreature(NPC_AZURE_RING_CAPTAIN, 500.0f, true) )
if (Creature* c = me->FindNearestCreature(NPC_AZURE_RING_CAPTAIN, 500.0f, true))
c->CastSpell(trigger, SPELL_ARCANE_BEAM_VISUAL, true);
trigger->GetMotionMaster()->MoveChase(target, 0.1f);
trigger->CastSpell(me, SPELL_ARCANE_BEAM_PERIODIC_DAMAGE, true);
@ -234,7 +234,7 @@ public:
me->SetControlled(true, UNIT_STATE_ROOT);
me->CastSpell((Unit*)nullptr, SPELL_ENERGIZE_CORES, false);
ZapAngle += M_PI / 2;
if( ZapAngle >= 2 * M_PI )
if (ZapAngle >= 2 * M_PI)
ZapAngle -= 2 * M_PI;
events.ScheduleEvent(EVENT_ENERGIZE_CORES_THIN, 2s);
}

View file

@ -63,7 +63,7 @@ public:
void OnCreatureCreate(Creature* pCreature) override
{
switch( pCreature->GetEntry() )
switch (pCreature->GetEntry())
{
case NPC_DRAKOS:
uiDrakosGUID = pCreature->GetGUID();
@ -82,19 +82,19 @@ public:
void OnGameObjectCreate(GameObject* pGo) override
{
switch( pGo->GetEntry() )
switch (pGo->GetEntry())
{
case GO_DRAGON_CAGE_DOOR:
for( uint8 i = 0; i < 3; ++i )
{
if( DragonCageDoorGUID[i] )
if (DragonCageDoorGUID[i])
continue;
DragonCageDoorGUID[i] = pGo->GetGUID();
break;
}
if( m_auiEncounter[DATA_DRAKOS] == DONE )
if( pGo->GetGoState() != GO_STATE_ACTIVE )
if (m_auiEncounter[DATA_DRAKOS] == DONE)
if (pGo->GetGoState() != GO_STATE_ACTIVE )
{
pGo->SetLootState(GO_READY);
pGo->UseDoorOrButton(0, false);
@ -129,11 +129,11 @@ public:
void SetData(uint32 type, uint32 data) override
{
switch( type )
switch (type)
{
case DATA_DRAKOS:
m_auiEncounter[DATA_DRAKOS] = data;
if( data == DONE )
if (data == DONE)
{
DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 1);
DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT, 10 - CentrifugeCount);
@ -144,18 +144,18 @@ public:
break;
case DATA_VAROS:
m_auiEncounter[DATA_VAROS] = data;
if( data == DONE )
if (data == DONE)
{
DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 0);
if( Creature* urom = instance->GetCreature(uiUromGUID) )
if (Creature* urom = instance->GetCreature(uiUromGUID))
urom->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
}
break;
case DATA_UROM:
m_auiEncounter[DATA_UROM] = data;
if( data == DONE )
if( Creature* eregos = instance->GetCreature(uiEregosGUID) )
if (data == DONE)
if (Creature* eregos = instance->GetCreature(uiEregosGUID))
eregos->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
break;
case DATA_EREGOS:
@ -174,13 +174,13 @@ public:
}
break;
case DATA_CC_COUNT:
if( CentrifugeCount < 10 )
if (CentrifugeCount < 10)
{
++CentrifugeCount;
DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT, 10 - CentrifugeCount);
}
if( CentrifugeCount >= 10 )
if( Creature* varos = instance->GetCreature(uiVarosGUID) )
if (CentrifugeCount >= 10)
if (Creature* varos = instance->GetCreature(uiVarosGUID))
{
varos->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
varos->InterruptNonMeleeSpells(false);
@ -198,13 +198,13 @@ public:
break;
}
if( data == DONE )
if (data == DONE)
SaveToDB();
}
uint32 GetData(uint32 type) const override
{
switch( type )
switch (type)
{
case DATA_DRAKOS:
case DATA_VAROS:
@ -220,7 +220,7 @@ public:
ObjectGuid GetGuidData(uint32 identifier) const override
{
switch( identifier )
switch (identifier)
{
case DATA_DRAKOS:
return uiDrakosGUID;
@ -259,24 +259,24 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* source, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
case CRITERIA_EXPERIENCED_AMBER:
if( source )
if( Unit* drake = source->GetVehicleBase() )
if( drake->GetEntry() == NPC_AMBER_DRAKE )
if (source)
if (Unit* drake = source->GetVehicleBase())
if (drake->GetEntry() == NPC_AMBER_DRAKE )
return true;
break;
case CRITERIA_EXPERIENCED_EMERALD:
if( source )
if( Unit* drake = source->GetVehicleBase() )
if( drake->GetEntry() == NPC_EMERALD_DRAKE )
if (source)
if (Unit* drake = source->GetVehicleBase())
if (drake->GetEntry() == NPC_EMERALD_DRAKE )
return true;
break;
case CRITERIA_EXPERIENCED_RUBY:
if( source )
if( Unit* drake = source->GetVehicleBase() )
if( drake->GetEntry() == NPC_RUBY_DRAKE )
if (source)
if (Unit* drake = source->GetVehicleBase())
if (drake->GetEntry() == NPC_RUBY_DRAKE )
return true;
break;
case CRITERIA_AMBER_VOID:

View file

@ -157,7 +157,7 @@ public:
return;
}
if(me->GetEntry() == NPC_BELGARISTRASZ)
if (me->GetEntry() == NPC_BELGARISTRASZ)
{
Talk(SAY_BELGARISTRASZ);
}
@ -167,10 +167,10 @@ public:
bool OnGossipHello(Player* player, Creature* creature) override
{
if(creature->IsQuestGiver())
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
if(creature->GetInstanceScript()->GetData(DATA_DRAKOS) == DONE)
if (creature->GetInstanceScript()->GetData(DATA_DRAKOS) == DONE)
{
switch (creature->GetEntry())
{
@ -251,10 +251,10 @@ public:
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) override
{
ClearGossipMenuFor(player);
switch(creature->GetEntry())
switch (creature->GetEntry())
{
case NPC_VERDISA:
switch(uiAction)
switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF:
SendGossipMenuFor(player, GOSSIP_TEXTID_VERDISA2, creature->GetGUID());
@ -273,7 +273,7 @@ public:
CloseGossipMenuFor(player);
break;
case NPC_BELGARISTRASZ:
switch(uiAction)
switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF:
openedMenu[player->GetGUID()] = true;
@ -415,11 +415,11 @@ public:
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
for( uint8 i = 0; i < 8; ++i )
if( me->m_spells[i] == spell->Id )
if (me->m_spells[i] == spell->Id)
{
if( target && target->IsAlive() && !target->CanFly() && target->IsHostileTo(me) && !spell->IsTargetingArea())
if (target && target->IsAlive() && !target->CanFly() && target->IsHostileTo(me) && !spell->IsTargetingArea())
{
if( Unit* charmer = me->GetCharmer() )
if (Unit* charmer = me->GetCharmer())
Unit::Kill(charmer, charmer, false);
}
break;

View file

@ -143,7 +143,7 @@ public:
{
if (hp)
{
switch(HealthCheck)
switch (HealthCheck)
{
case 75:
Talk(SAY_75HEALTH);

View file

@ -73,7 +73,7 @@ public:
void OnCreatureCreate(Creature* pCreature) override
{
switch(pCreature->GetEntry())
switch (pCreature->GetEntry())
{
case NPC_BJARNGRIM:
m_uiGeneralBjarngrimGUID = pCreature->GetGUID();
@ -92,7 +92,7 @@ public:
void OnGameObjectCreate(GameObject* pGo) override
{
switch(pGo->GetEntry())
switch (pGo->GetEntry())
{
case GO_BJARNGRIM_DOOR:
m_uiBjarngrimDoorGUID = pGo->GetGUID();
@ -126,7 +126,7 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
case 7321: //Shatter Resistant (2042)
return volkhanAchievement;
@ -139,7 +139,7 @@ public:
void SetData(uint32 uiType, uint32 uiData) override
{
m_auiEncounter[uiType] = uiData;
if( uiType == TYPE_LOKEN_INTRO )
if (uiType == TYPE_LOKEN_INTRO)
SaveToDB();
// Achievements
@ -148,10 +148,10 @@ public:
else if (uiType == DATA_VOLKHAN_ACHIEVEMENT)
volkhanAchievement = (bool)uiData;
if( uiData != DONE )
if (uiData != DONE)
return;
switch(uiType)
switch (uiType)
{
case TYPE_BJARNGRIM:
HandleGameObject(m_uiBjarngrimDoorGUID, true);
@ -197,7 +197,7 @@ public:
ObjectGuid GetGuidData(uint32 uiData) const override
{
switch(uiData)
switch (uiData)
{
case TYPE_BJARNGRIM:
return m_uiGeneralBjarngrimGUID;

View file

@ -95,15 +95,15 @@ public:
void UpdateAI(uint32 diff) override
{
if(!UpdateVictim())
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case EVENT_STORM:
{

View file

@ -319,7 +319,7 @@ public:
me->SetReactState(REACT_PASSIVE);
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
if(pInstance)
if (pInstance)
{
pInstance->SetData(BRANN_BRONZEBEARD, 1);
pInstance->SetData(DATA_BRANN_ACHIEVEMENT, true);
@ -586,7 +586,7 @@ public:
for (int i = 0; i < count; ++i)
{
Creature* cr = me->SummonCreature(entry, 946.5971f + urand(0, 6), 383.5330f + urand(0, 6), 205.9943f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
if(cr)
if (cr)
{
cr->AI()->AttackStart(me);
cr->AddThreat(me, 100.0f);
@ -598,7 +598,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
ResetEvent();
if(pInstance)
if (pInstance)
{
if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_BRANN)))
{
@ -662,7 +662,7 @@ void brann_bronzebeard::brann_bronzebeardAI::WaypointReached(uint32 id)
// In front of Console
case 11:
SetEscortPaused(true);
if(pInstance)
if (pInstance)
{
pInstance->SetData(BOSS_TRIBUNAL_OF_AGES, IN_PROGRESS);
if (GameObject* tribunal = ObjectAccessor::GetGameObject(*me, pInstance->GetGuidData(GO_TRIBUNAL_CONSOLE)))
@ -672,7 +672,7 @@ void brann_bronzebeard::brann_bronzebeardAI::WaypointReached(uint32 id)
// Before Sjonnir's door
case 27:
SetEscortPaused(true);
if(pInstance)
if (pInstance)
{
pInstance->SetData(BRANN_BRONZEBEARD, 5);
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);

View file

@ -80,7 +80,7 @@ public:
void OnGameObjectCreate(GameObject* go) override
{
switch(go->GetEntry())
switch (go->GetEntry())
{
case GO_KADDRAK:
goKaddrakGUID = go->GetGUID();
@ -124,7 +124,7 @@ public:
void OnCreatureCreate(Creature* creature) override
{
switch(creature->GetEntry())
switch (creature->GetEntry())
{
case NPC_SJONNIR:
SjonnirGUID = creature->GetGUID();

View file

@ -340,7 +340,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case EVENT_FUSION_PUNCH:
me->CastSpell(me->GetVictim(), SPELL_FUSION_PUNCH, false);
@ -509,7 +509,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case EVENT_RUNE_OF_POWER:
{

View file

@ -432,7 +432,7 @@ public:
events.Repeat(20s);
return;
case EVENT_SUMMON:
if(summons.size() < 20)
if (summons.size() < 20)
if (Creature* lift = DoSummonFlyer(NPC_MECHANOLIFT, me, 30.0f, 50.0f, 0))
lift->GetMotionMaster()->MoveRandom(100);
@ -474,9 +474,9 @@ public:
return;
}
if(me->isAttackReady() && !me->HasUnitState(UNIT_STATE_STUNNED))
if (me->isAttackReady() && !me->HasUnitState(UNIT_STATE_STUNNED))
{
if(me->IsWithinCombatRange(me->GetVictim(), 15.0f))
if (me->IsWithinCombatRange(me->GetVictim(), 15.0f))
{
me->CastSpell(me->GetVictim(), SPELL_BATTERING_RAM, false);
me->resetAttackTimer();
@ -1036,7 +1036,7 @@ public:
_switchTargetTimer += diff;
if (_switchTargetTimer >= 30000)
{
if(Unit* target = me->SelectNearbyTarget(nullptr, 200.0f))
if (Unit* target = me->SelectNearbyTarget(nullptr, 200.0f))
{
if (target->GetVehicleBase() && target->GetVehicleBase()->GetEntry() == NPC_SEAT)
{

View file

@ -502,7 +502,7 @@ public:
events.ScheduleEvent(EVENT_FREYA_BERSERK, 10min);
events.SetPhase(EVENT_PHASE_ADDS);
if( !m_pInstance )
if (!m_pInstance)
return;
if (m_pInstance->GetData(TYPE_FREYA) != DONE)

View file

@ -177,7 +177,7 @@ public:
void DoAction(int32 param) override
{
switch( param )
switch (param)
{
case 1:
hardmodeAvailable = false;
@ -209,18 +209,18 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
if( !berserk && (me->GetPositionX() < 1720.0f || me->GetPositionX() > 1940.0f || me->GetPositionY() < 20.0f || me->GetPositionY() > 210.0f) )
if (!berserk && (me->GetPositionX() < 1720.0f || me->GetPositionX() > 1940.0f || me->GetPositionY() < 20.0f || me->GetPositionY() > 210.0f))
events.RescheduleEvent(EVENT_BERSERK, 1ms);
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -238,7 +238,7 @@ public:
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
{
Player* temp = itr->GetSource();
if( temp->IsAlive() && temp->GetDistance(me) > 15.0f )
if (temp->IsAlive() && temp->GetDistance(me) > 15.0f )
players.push_back(temp);
}
if (!players.empty())
@ -256,7 +256,7 @@ public:
me->SetGuidValue(UNIT_FIELD_TARGET, me->GetVictim()->GetGUID());
break;
case EVENT_SPELL_SEARING_FLAMES:
if(!me->HasAura(SPELL_SARONITE_BARRIER))
if (!me->HasAura(SPELL_SARONITE_BARRIER))
me->CastSpell(me->GetVictim(), SPELL_SEARING_FLAMES, false);
events.Repeat(me->GetMap()->Is25ManRaid() ? 8s : 15s);
break;
@ -273,19 +273,19 @@ public:
std::vector<Player*> inside;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if( Player* tmp = itr->GetSource() )
if( tmp->IsAlive() )
if (Player* tmp = itr->GetSource())
if (tmp->IsAlive())
{
if( tmp->GetDistance(me) > 15.0f )
if (tmp->GetDistance(me) > 15.0f )
outside.push_back(tmp);
else
inside.push_back(tmp);
}
Player* t = nullptr;
if( outside.size() >= uint8(me->GetMap()->Is25ManRaid() ? 9 : 4) )
if (outside.size() >= uint8(me->GetMap()->Is25ManRaid() ? 9 : 4))
t = outside.at(urand(0, outside.size() - 1));
else if( !inside.empty() )
else if (!inside.empty())
t = inside.at(urand(0, inside.size() - 1));
if (t)
@ -299,7 +299,7 @@ public:
vaporsCount++;
me->CastSpell(me, SPELL_SUMMON_SARONITE_VAPORS, false);
if( vaporsCount < 6 || !hardmodeAvailable )
if (vaporsCount < 6 || !hardmodeAvailable)
events.Repeat(30s);
else
{
@ -321,7 +321,7 @@ public:
if (summons.size())
{
Talk(SAY_EMOTE_ANIMUS);
if( Creature* sv = ObjectAccessor::GetCreature(*me, *(summons.begin())) )
if (Creature* sv = ObjectAccessor::GetCreature(*me, *(summons.begin())))
sv->CastSpell(sv, SPELL_SARONITE_ANIMUS_FORMATION_VISUAL, true);
events.ScheduleEvent(EVENT_SPELL_SUMMON_SARONITE_ANIMUS, 2s);
@ -334,7 +334,7 @@ public:
Talk(SAY_HARDMODE);
Talk(SAY_EMOTE_BARRIER);
me->CastSpell(me, SPELL_SARONITE_BARRIER, true);
if( Creature* sv = ObjectAccessor::GetCreature(*me, *(summons.begin())) )
if (Creature* sv = ObjectAccessor::GetCreature(*me, *(summons.begin())))
sv->CastSpell(sv, SPELL_SUMMON_SARONITE_ANIMUS, true);
events.ScheduleEvent(EVENT_DESPAWN_SARONITE_VAPORS, 2500ms);
@ -357,8 +357,8 @@ public:
Talk(SAY_DEATH);
if( GameObject* door = me->FindNearestGameObject(GO_VEZAX_DOOR, 500.0f) )
if( door->GetGoState() != GO_STATE_ACTIVE )
if (GameObject* door = me->FindNearestGameObject(GO_VEZAX_DOOR, 500.0f))
if (door->GetGoState() != GO_STATE_ACTIVE )
{
door->SetLootState(GO_READY);
door->UseDoorOrButton(0, false);
@ -367,7 +367,7 @@ public:
void KilledUnit(Unit* who) override
{
if( who->IsPlayer() )
if (who->IsPlayer())
Talk(SAY_SLAY);
}
@ -410,8 +410,8 @@ public:
me->CastSpell(me, SPELL_SARONITE_VAPORS_AURA, true);
// killed saronite vapors, hard mode unavailable
if( pInstance )
if( Creature* vezax = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_VEZAX)) )
if (pInstance)
if (Creature* vezax = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_VEZAX)))
vezax->AI()->DoAction(1);
}
@ -437,8 +437,8 @@ public:
npc_ulduar_saronite_animusAI(Creature* pCreature) : ScriptedAI(pCreature)
{
pInstance = pCreature->GetInstanceScript();
if( pInstance )
if( Creature* vezax = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_VEZAX)) )
if (pInstance)
if (Creature* vezax = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_VEZAX)))
vezax->AI()->JustSummoned(me);
timer = 0;
me->SetInCombatWithZone();
@ -451,8 +451,8 @@ public:
{
me->DespawnOrUnsummon(3000);
if( pInstance )
if( Creature* vezax = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_VEZAX)) )
if (pInstance)
if (Creature* vezax = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_VEZAX)))
vezax->AI()->DoAction(2);
}

View file

@ -310,7 +310,7 @@ public:
void SmallIcicles(bool enable)
{
if( enable )
if (enable)
me->CastSpell(me, SPELL_ICICLE_BOSS_AURA, true);
else
me->RemoveAura(SPELL_ICICLE_BOSS_AURA);
@ -318,7 +318,7 @@ public:
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
switch( spell->Id )
switch (spell->Id)
{
case SPELL_ICICLE_TBBA:
me->CastSpell(target, SPELL_ICICLE_VISUAL_UNPACKED, true);
@ -360,9 +360,9 @@ public:
events.Reset();
summons.DespawnAll();
if( GameObject* d = me->FindNearestGameObject(GO_HODIR_FROZEN_DOOR, 250.0f))
if (GameObject* d = me->FindNearestGameObject(GO_HODIR_FROZEN_DOOR, 250.0f))
{
if( d->GetGoState() != GO_STATE_ACTIVE )
if (d->GetGoState() != GO_STATE_ACTIVE )
{
d->SetLootState(GO_READY);
d->UseDoorOrButton(0, false);
@ -370,7 +370,7 @@ public:
}
if (GameObject* d = me->FindNearestGameObject(GO_HODIR_DOOR, 250.0f))
{
if( d->GetGoState() != GO_STATE_ACTIVE )
if (d->GetGoState() != GO_STATE_ACTIVE )
{
d->SetLootState(GO_READY);
d->UseDoorOrButton(0, false);
@ -414,7 +414,7 @@ public:
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.ExecuteEvent())
@ -518,7 +518,7 @@ public:
void SpawnHelpers()
{
char faction = 'A';
if( hhd[0][0].id )
if (hhd[0][0].id)
{
Map::PlayerList const& cl = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = cl.begin(); itr != cl.end(); ++itr)
@ -530,25 +530,25 @@ public:
}
uint8 cnt = 0;
if( faction )
if (faction)
for( uint8 k = 0; k < 4; ++k )
{
if( (faction == 'A' && ( k > 1 || (k == 1 && RAID_MODE(1, 0)) )) ||
(faction == 'H' && ( k < 2 || (k == 3 && RAID_MODE(1, 0)) )) )
if ((faction == 'A' && ( k > 1 || (k == 1 && RAID_MODE(1, 0)))) ||
(faction == 'H' && ( k < 2 || (k == 3 && RAID_MODE(1, 0)))))
continue;
for( uint8 i = 0; i < 4; ++i )
{
if( !hhd[k][i].id )
if (!hhd[k][i].id)
continue;
if( Creature* h_p = me->SummonCreature(hhd[k][i].id, hhd[k][i].x, hhd[k][i].y, 432.69f, M_PI / 2) )
if (Creature* h_p = me->SummonCreature(hhd[k][i].id, hhd[k][i].x, hhd[k][i].y, 432.69f, M_PI / 2))
{
h_p->SetFaction(1665);
if( cnt < 8 )
if (cnt < 8)
Helpers[cnt++] = h_p->GetGUID();
if( Creature* c = h_p->SummonCreature(NPC_FLASH_FREEZE_NPC, h_p->GetPositionX(), h_p->GetPositionY(), h_p->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000) )
if (Creature* c = h_p->SummonCreature(NPC_FLASH_FREEZE_NPC, h_p->GetPositionX(), h_p->GetPositionY(), h_p->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000))
{
c->CastSpell(h_p, SPELL_FLASH_FREEZE_TRAPPED_NPC, true);
JustSummoned(c);
@ -644,7 +644,7 @@ public:
void UpdateAI(uint32 diff) override
{
if( timer1 <= diff )
if (timer1 <= diff)
{
me->CastSpell(me, (me->GetEntry() == 33169 ? SPELL_ICICLE_FALL_EFFECT_UNPACKED : SPELL_ICICLE_FALL_EFFECT_PACKED), true);
me->CastSpell(me, SPELL_ICICLE_VISUAL_FALLING, false);
@ -745,7 +745,7 @@ public:
{
if (a == 1)
{
if( GameObject* fire = me->FindNearestGameObject(194300, 1.0f) )
if (GameObject* fire = me->FindNearestGameObject(194300, 1.0f))
{
fire->SetOwnerGUID(ObjectGuid::Empty);
fire->Delete();
@ -756,7 +756,7 @@ public:
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
switch( spell->Id )
switch (spell->Id)
{
case SPELL_ICE_SHARDS_SMALL:
case SPELL_ICE_SHARDS_BIG:
@ -803,7 +803,7 @@ public:
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if(spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
if (spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
{
events.Reset();
events.ScheduleEvent(EVENT_TRY_FREE_HELPER, 2s);
@ -814,19 +814,19 @@ public:
{
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_TRY_FREE_HELPER:
{
if( !me->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC) )
if( pInstance )
if( ObjectGuid g = pInstance->GetGuidData(TYPE_HODIR) )
if( Creature* hodir = ObjectAccessor::GetCreature(*me, g) )
if (!me->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC))
if (pInstance)
if (ObjectGuid g = pInstance->GetGuidData(TYPE_HODIR))
if (Creature* hodir = ObjectAccessor::GetCreature(*me, g))
{
AttackStart(hodir);
ScheduleAbilities();
@ -900,7 +900,7 @@ public:
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if(spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
if (spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
{
events.Reset();
events.ScheduleEvent(EVENT_TRY_FREE_HELPER, 2s);
@ -911,19 +911,19 @@ public:
{
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_TRY_FREE_HELPER:
{
if( !me->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC) )
if( pInstance )
if( ObjectGuid g = pInstance->GetGuidData(TYPE_HODIR) )
if( Creature* hodir = ObjectAccessor::GetCreature(*me, g) )
if (!me->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC))
if (pInstance)
if (ObjectGuid g = pInstance->GetGuidData(TYPE_HODIR))
if (Creature* hodir = ObjectAccessor::GetCreature(*me, g))
{
AttackStart(hodir);
ScheduleAbilities();
@ -998,7 +998,7 @@ public:
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if(spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
if (spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
{
events.Reset();
events.ScheduleEvent(EVENT_TRY_FREE_HELPER, 2s);
@ -1016,19 +1016,19 @@ public:
{
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_TRY_FREE_HELPER:
{
if( !me->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC) )
if( pInstance )
if( ObjectGuid g = pInstance->GetGuidData(TYPE_HODIR) )
if( Creature* hodir = ObjectAccessor::GetCreature(*me, g) )
if (!me->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC))
if (pInstance)
if (ObjectGuid g = pInstance->GetGuidData(TYPE_HODIR))
if (Creature* hodir = ObjectAccessor::GetCreature(*me, g))
{
AttackStart(hodir);
ScheduleAbilities();
@ -1100,7 +1100,7 @@ public:
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if(spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
if (spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
{
events.Reset();
events.ScheduleEvent(EVENT_TRY_FREE_HELPER, 2s);
@ -1111,19 +1111,19 @@ public:
{
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_TRY_FREE_HELPER:
{
if( !me->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC) )
if( pInstance )
if( ObjectGuid g = pInstance->GetGuidData(TYPE_HODIR) )
if( Creature* hodir = ObjectAccessor::GetCreature(*me, g) )
if (!me->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC))
if (pInstance)
if (ObjectGuid g = pInstance->GetGuidData(TYPE_HODIR))
if (Creature* hodir = ObjectAccessor::GetCreature(*me, g))
{
AttackStart(hodir);
ScheduleAbilities();
@ -1147,14 +1147,14 @@ public:
bool found = false;
me->GetCreaturesWithEntryInRange(FB, 150.0f, NPC_FLASH_FREEZE_NPC);
for( std::list<Creature*>::const_iterator itr = FB.begin(); itr != FB.end(); ++itr )
if( !((*itr)->HasAura(SPELL_MAGE_MELT_ICE)) )
if (!((*itr)->HasAura(SPELL_MAGE_MELT_ICE)))
{
me->CastSpell((*itr), SPELL_MAGE_MELT_ICE, false);
found = true;
break;
}
if( found )
if (found)
{
events.DelayEvents(2s);
events.Repeat(2s);
@ -1372,7 +1372,7 @@ class spell_hodir_flash_freeze_aura : public AuraScript
if (target->IsPlayer())
{
caster->ToCreature()->AI()->SetData(1, 1);
if( Creature* c = target->SummonCreature(NPC_FLASH_FREEZE_PLR, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 5 * 60 * 1000) )
if (Creature* c = target->SummonCreature(NPC_FLASH_FREEZE_PLR, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 5 * 60 * 1000))
{
c->CastSpell(target, SPELL_FLASH_FREEZE_TRAPPED_PLAYER, true);
caster->ToCreature()->AI()->JustSummoned(c);
@ -1380,7 +1380,7 @@ class spell_hodir_flash_freeze_aura : public AuraScript
}
else if (target->IsCreature())
{
if( Creature* c = target->SummonCreature(NPC_FLASH_FREEZE_NPC, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000) )
if (Creature* c = target->SummonCreature(NPC_FLASH_FREEZE_NPC, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000))
{
c->CastSpell(target, SPELL_FLASH_FREEZE_TRAPPED_NPC, true);
caster->ToCreature()->AI()->JustSummoned(c);

View file

@ -148,7 +148,7 @@ public:
void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
if( damage >= RAID_MODE(3000U, 5000U) && me->GetAura(S_BRITTLE) )
if (damage >= RAID_MODE(3000U, 5000U) && me->GetAura(S_BRITTLE))
{
me->CastSpell(me, SPELL_SHATTER, true);
Unit::Kill(attacker, me);
@ -219,7 +219,7 @@ public:
bShattered = false;
lastShatterMSTime = 0;
if( InstanceScript* m_pInstance = me->GetInstanceScript() )
if (InstanceScript* m_pInstance = me->GetInstanceScript())
{
m_pInstance->SetData(TYPE_IGNIS, NOT_STARTED);
m_pInstance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_STOKIN_THE_FURNACE_EVENT);
@ -256,7 +256,7 @@ public:
Talk(SAY_AGGRO);
DoZoneInCombat();
if( InstanceScript* m_pInstance = me->GetInstanceScript() )
if (InstanceScript* m_pInstance = me->GetInstanceScript())
{
m_pInstance->SetData(TYPE_IGNIS, IN_PROGRESS);
m_pInstance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_STOKIN_THE_FURNACE_EVENT);
@ -298,7 +298,7 @@ public:
{
Talk(SAY_DEATH);
if( me->GetInstanceScript() )
if (me->GetInstanceScript())
me->GetInstanceScript()->SetData(TYPE_IGNIS, DONE);
std::list<Creature*> icl;
@ -324,7 +324,7 @@ public:
if (!UpdateVictim())
return;
if( me->GetPositionX() < 490.0f || me->GetPositionX() > 690.0f || me->GetPositionY() < 130.0f || me->GetPositionY() > 410.0f )
if (me->GetPositionX() < 490.0f || me->GetPositionX() > 690.0f || me->GetPositionY() < 130.0f || me->GetPositionY() > 410.0f )
{
EnterEvadeMode(EVADE_REASON_OTHER);
return;
@ -380,9 +380,9 @@ public:
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
{
temp = itr->GetSource();
if( !temp->IsAlive() || temp->GetExactDist2d(me) > 90.0f )
if (!temp->IsAlive() || temp->GetExactDist2d(me) > 90.0f )
continue;
if( me->GetVictim() && temp->GetGUID() == me->GetVictim()->GetGUID() )
if (me->GetVictim() && temp->GetGUID() == me->GetVictim()->GetGUID())
continue;
bool found = false;
for (std::list<Creature*>::iterator iterator = icl.begin(); iterator != icl.end(); ++iterator)
@ -394,14 +394,14 @@ public:
}
}
if( !found )
if (!found)
playerGUIDs.push_back(temp->GetGUID());
}
if( !playerGUIDs.empty() )
if (!playerGUIDs.empty())
{
int8 pos = urand(0, playerGUIDs.size() - 1);
if( Player* pTarget = ObjectAccessor::GetPlayer(*me, playerGUIDs.at(pos)) )
if (Player* pTarget = ObjectAccessor::GetPlayer(*me, playerGUIDs.at(pos)))
{
Talk(SAY_SLAG_POT);
me->CastSpell(pTarget, SPELL_GRAB, false);

View file

@ -573,7 +573,7 @@ public:
{
float x, y, z;
// left arm
if( me->GetEntry() == NPC_LEFT_ARM )
if (me->GetEntry() == NPC_LEFT_ARM )
{
x = 1776.97f;
y = -44.8396f;

View file

@ -417,16 +417,16 @@ public:
events.Update(diff);
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_COMPUTER_SAY_INITIATED:
if( Creature* computer = me->SummonCreature(NPC_COMPUTER, 2746.7f, 2569.44f, 410.39f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000) )
if (Creature* computer = me->SummonCreature(NPC_COMPUTER, 2746.7f, 2569.44f, 410.39f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000))
computer->AI()->Talk(TALK_COMPUTER_INITIATED);
break;
case EVENT_COMPUTER_SAY_MINUTES:
if( Creature* computer = me->SummonCreature(NPC_COMPUTER, 2746.7f, 2569.44f, 410.39f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000) )
if (Creature* computer = me->SummonCreature(NPC_COMPUTER, 2746.7f, 2569.44f, 410.39f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000))
computer->AI()->Talk(minutesTalkNum++);
break;
case EVENT_MIMIRON_SAY_HARDMODE:
@ -442,12 +442,12 @@ public:
std::vector<Player*> pg;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if( Player* plr = itr->GetSource() )
if( plr->IsAlive() && plr->GetExactDist2d(me) < 150.0f && !plr->IsGameMaster() )
if (Player* plr = itr->GetSource())
if (plr->IsAlive() && plr->GetExactDist2d(me) < 150.0f && !plr->IsGameMaster())
pg.push_back(plr);
for( uint8 i = 0; i < 3; ++i )
if( !pg.empty() )
if (!pg.empty())
{
uint8 index = urand(0, pg.size() - 1);
Player* player = pg[index];
@ -467,7 +467,7 @@ public:
case EVENT_BERSERK:
berserk = true;
Talk(SAY_BERSERK);
if( hardmode )
if (hardmode)
me->SummonCreature(33576, 2744.78f, 2569.47f, 364.32f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 120000);
events.ScheduleEvent(EVENT_BERSERK_2, 0ms);
break;
@ -486,7 +486,7 @@ public:
}
break;
case EVENT_SIT_LMK2:
if(Creature* LMK2 = GetLMK2())
if (Creature* LMK2 = GetLMK2())
{
me->EnterVehicle(LMK2, 6);
events.ScheduleEvent(EVENT_SIT_LMK2_INTERVAL, 2s);
@ -500,8 +500,8 @@ public:
if (hardmode)
{
LMK2->CastSpell(LMK2, SPELL_EMERGENCY_MODE, true);
if( Vehicle* veh = LMK2->GetVehicleKit() )
if( Unit* cannon = veh->GetPassenger(3) )
if (Vehicle* veh = LMK2->GetVehicleKit())
if (Unit* cannon = veh->GetPassenger(3))
cannon->CastSpell(cannon, SPELL_EMERGENCY_MODE, true);
}
LMK2->AI()->SetData(1, 1);
@ -521,7 +521,7 @@ public:
EnterEvadeMode(EVADE_REASON_OTHER);
break;
case EVENT_ELEVATOR_INTERVAL_0:
if( GameObject* elevator = me->FindNearestGameObject(GO_MIMIRON_ELEVATOR, 100.0f) )
if (GameObject* elevator = me->FindNearestGameObject(GO_MIMIRON_ELEVATOR, 100.0f))
{
elevator->SetLootState(GO_READY);
elevator->UseDoorOrButton(0, false);
@ -530,9 +530,9 @@ public:
events.ScheduleEvent(EVENT_ELEVATOR_INTERVAL_1, 6s);
break;
case EVENT_ELEVATOR_INTERVAL_1:
if(me->SummonCreature(NPC_VX001, 2744.65f, 2569.46f, 364.40f, 3.14f, TEMPSUMMON_MANUAL_DESPAWN))
if (me->SummonCreature(NPC_VX001, 2744.65f, 2569.46f, 364.40f, 3.14f, TEMPSUMMON_MANUAL_DESPAWN))
{
if( GameObject* elevator = me->FindNearestGameObject(GO_MIMIRON_ELEVATOR, 100.0f) )
if (GameObject* elevator = me->FindNearestGameObject(GO_MIMIRON_ELEVATOR, 100.0f))
{
elevator->SetLootState(GO_READY);
elevator->UseDoorOrButton(0, true);
@ -557,7 +557,7 @@ public:
events.ScheduleEvent(EVENT_ENTER_VX001, 5s);
break;
case EVENT_ENTER_VX001:
if( Creature* VX001 = GetVX001() )
if (Creature* VX001 = GetVX001())
{
me->EnterVehicle(VX001, 1);
events.ScheduleEvent(EVENT_EMOTE_VX001, 2s);
@ -566,7 +566,7 @@ public:
EnterEvadeMode(EVADE_REASON_OTHER);
break;
case EVENT_EMOTE_VX001:
if( Creature* VX001 = GetVX001() )
if (Creature* VX001 = GetVX001())
{
VX001->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
events.ScheduleEvent(EVENT_VX001_START_FIGHT, 1750ms);
@ -575,9 +575,9 @@ public:
EnterEvadeMode(EVADE_REASON_OTHER);
break;
case EVENT_VX001_START_FIGHT:
if( Creature* VX001 = GetVX001() )
if (Creature* VX001 = GetVX001())
{
if( hardmode )
if (hardmode)
VX001->CastSpell(VX001, SPELL_EMERGENCY_MODE, true);
VX001->AI()->SetData(1, 2);
me->SetInCombatWithZone();
@ -586,7 +586,7 @@ public:
EnterEvadeMode(EVADE_REASON_OTHER);
break;
case EVENT_VX001_EMOTESTATE_DEATH:
if( Creature* VX001 = GetVX001() )
if (Creature* VX001 = GetVX001())
{
VX001->HandleEmoteCommand(EMOTE_STATE_DROWNED);
VX001->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DROWNED);
@ -596,8 +596,8 @@ public:
EnterEvadeMode(EVADE_REASON_OTHER);
break;
case EVENT_GET_OUT_VX001:
if( Creature* VX001 = GetVX001() )
if( Creature* ACU = me->SummonCreature(NPC_AERIAL_COMMAND_UNIT, 2743.91f, 2568.78f, 391.34f, M_PI, TEMPSUMMON_MANUAL_DESPAWN) )
if (Creature* VX001 = GetVX001())
if (Creature* ACU = me->SummonCreature(NPC_AERIAL_COMMAND_UNIT, 2743.91f, 2568.78f, 391.34f, M_PI, TEMPSUMMON_MANUAL_DESPAWN))
{
me->EnterVehicle(VX001, 4);
float speed = ACU->GetDistance(2737.75f, 2574.22f, 381.34f) / 2.0f;
@ -614,7 +614,7 @@ public:
events.ScheduleEvent(EVENT_ENTER_ACU, 7s);
break;
case EVENT_ENTER_ACU:
if( Creature* ACU = GetACU() )
if (Creature* ACU = GetACU())
{
me->EnterVehicle(ACU, 0);
events.ScheduleEvent(EVENT_SAY_ACU_ACTIVATE, 6s);
@ -627,9 +627,9 @@ public:
events.ScheduleEvent(EVENT_ACU_START_ATTACK, 4s);
break;
case EVENT_ACU_START_ATTACK:
if( Creature* ACU = GetACU() )
if (Creature* ACU = GetACU())
{
if( hardmode )
if (hardmode)
ACU->CastSpell(ACU, SPELL_EMERGENCY_MODE, true);
ACU->AI()->SetData(1, 3);
me->SetInCombatWithZone();
@ -654,7 +654,7 @@ public:
{
Creature* LMK2 = GetLMK2();
Creature* VX001 = GetVX001();
if( !VX001 || !LMK2 )
if (!VX001 || !LMK2)
{
EnterEvadeMode(EVADE_REASON_OTHER);
return;
@ -670,7 +670,7 @@ public:
{
Creature* VX001 = GetVX001();
Creature* LMK2 = GetLMK2();
if( !VX001 || !LMK2 )
if (!VX001 || !LMK2)
{
EnterEvadeMode(EVADE_REASON_OTHER);
return;
@ -687,7 +687,7 @@ public:
{
Creature* ACU = GetACU();
Creature* VX001 = GetVX001();
if( !VX001 || !ACU )
if (!VX001 || !ACU)
{
EnterEvadeMode(EVADE_REASON_OTHER);
return;
@ -705,7 +705,7 @@ public:
Creature* VX001 = GetVX001();
Creature* LMK2 = GetLMK2();
Creature* ACU = GetACU();
if( !VX001 || !LMK2 || !ACU )
if (!VX001 || !LMK2 || !ACU)
{
EnterEvadeMode(EVADE_REASON_OTHER);
return;
@ -717,7 +717,7 @@ public:
LMK2->CastSpell(LMK2, SPELL_SELF_REPAIR, true); //LMK2->SetHealth( LMK2->GetMaxHealth()/2 );
VX001->CastSpell(VX001, SPELL_SELF_REPAIR, true); //VX001->SetHealth( VX001->GetMaxHealth()/2 );
ACU->CastSpell(ACU, SPELL_SELF_REPAIR, true); //ACU->SetHealth( ACU->GetMaxHealth()/2 );
if( hardmode )
if (hardmode)
{
LMK2->CastSpell(LMK2, SPELL_EMERGENCY_MODE, true);
VX001->CastSpell(VX001, SPELL_EMERGENCY_MODE, true);
@ -770,11 +770,11 @@ public:
DoCastSelf(SPELL_SLEEP_VISUAL_1);
if( pInstance )
if (pInstance)
for( uint16 i = 0; i < 3; ++i )
if( ObjectGuid guid = pInstance->GetGuidData(DATA_GO_MIMIRON_DOOR_1 + i) )
if( GameObject* door = ObjectAccessor::GetGameObject(*me, guid) )
if( door->GetGoState() != GO_STATE_ACTIVE )
if (ObjectGuid guid = pInstance->GetGuidData(DATA_GO_MIMIRON_DOOR_1 + i))
if (GameObject* door = ObjectAccessor::GetGameObject(*me, guid))
if (door->GetGoState() != GO_STATE_ACTIVE )
{
door->SetLootState(GO_READY);
door->UseDoorOrButton(0, false);
@ -784,7 +784,7 @@ public:
pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, NPC_LEVIATHAN_MKII, 1, me);
if (hardmode)
if( Creature* computer = me->SummonCreature(NPC_COMPUTER, 2746.7f, 2569.44f, 410.39f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000) )
if (Creature* computer = me->SummonCreature(NPC_COMPUTER, 2746.7f, 2569.44f, 410.39f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000))
computer->AI()->Talk(TALK_COMPUTER_TERMINATED);
events.Reset();
@ -873,19 +873,19 @@ public:
void ResetGameObjects()
{
if( pInstance )
if (pInstance)
for( uint16 i = 0; i < 3; ++i )
if( ObjectGuid guid = pInstance->GetGuidData(DATA_GO_MIMIRON_DOOR_1 + i) )
if( GameObject* door = ObjectAccessor::GetGameObject(*me, guid) )
if( door->GetGoState() != GO_STATE_ACTIVE )
if (ObjectGuid guid = pInstance->GetGuidData(DATA_GO_MIMIRON_DOOR_1 + i))
if (GameObject* door = ObjectAccessor::GetGameObject(*me, guid))
if (door->GetGoState() != GO_STATE_ACTIVE )
{
door->SetLootState(GO_READY);
door->UseDoorOrButton(0, false);
}
if( GameObject* elevator = me->FindNearestGameObject(GO_MIMIRON_ELEVATOR, 200.0f) )
if (GameObject* elevator = me->FindNearestGameObject(GO_MIMIRON_ELEVATOR, 200.0f))
{
if( elevator->GetGoState() != GO_STATE_ACTIVE )
if (elevator->GetGoState() != GO_STATE_ACTIVE )
{
elevator->SetLootState(GO_READY);
elevator->SetByteValue(GAMEOBJECT_BYTES_1, 0, GO_STATE_ACTIVE);
@ -893,8 +893,8 @@ public:
elevator->EnableCollision(false);
}
if( GameObject* button = me->FindNearestGameObject(GO_BUTTON, 200.0f) )
if( button->GetGoState() != GO_STATE_READY )
if (GameObject* button = me->FindNearestGameObject(GO_BUTTON, 200.0f))
if (button->GetGoState() != GO_STATE_READY )
{
button->SetLootState(GO_READY);
button->UseDoorOrButton(0, false);
@ -904,18 +904,18 @@ public:
void CloseDoorAndButton()
{
if( pInstance )
if (pInstance)
for( uint16 i = 0; i < 3; ++i )
if( ObjectGuid guid = pInstance->GetGuidData(DATA_GO_MIMIRON_DOOR_1 + i) )
if( GameObject* door = ObjectAccessor::GetGameObject(*me, guid) )
if( door->GetGoState() != GO_STATE_READY )
if (ObjectGuid guid = pInstance->GetGuidData(DATA_GO_MIMIRON_DOOR_1 + i))
if (GameObject* door = ObjectAccessor::GetGameObject(*me, guid))
if (door->GetGoState() != GO_STATE_READY )
{
door->SetLootState(GO_READY);
door->UseDoorOrButton(0, false);
}
if( GameObject* button = me->FindNearestGameObject(GO_BUTTON, 200.0f) )
if( button->GetGoState() != GO_STATE_ACTIVE )
if (GameObject* button = me->FindNearestGameObject(GO_BUTTON, 200.0f))
if (button->GetGoState() != GO_STATE_ACTIVE )
{
button->SetLootState(GO_READY);
button->UseDoorOrButton(0, false);
@ -1143,7 +1143,7 @@ public:
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if (Player* plr = itr->GetSource())
if( plr->IsAlive() && plr->GetDistance2d(me) > 15.0f )
if (plr->IsAlive() && plr->GetDistance2d(me) > 15.0f )
pList.push_back(plr);
if (!pList.empty())
@ -1151,7 +1151,7 @@ public:
else
pTarget = (Player*)SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true);
if( pTarget )
if (pTarget)
cannon->CastSpell(pTarget, SPELL_NAPALM_SHELL, false);
events.Repeat(14s);
@ -1236,7 +1236,7 @@ public:
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if( spell->Id == SPELL_SELF_REPAIR )
if (spell->Id == SPELL_SELF_REPAIR)
{
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_AGGRESSIVE);
@ -1339,7 +1339,7 @@ public:
void DoAction(int32 action) override
{
if (action == 1337)
if( Vehicle* vk = me->GetVehicleKit() )
if (Vehicle* vk = me->GetVehicleKit())
for (uint8 i = 0; i < 2; ++i)
if (Unit* r = vk->GetPassenger(5 + i))
if (r->IsCreature())
@ -1422,15 +1422,15 @@ public:
events.Repeat(10s);
break;
case EVENT_SPELL_ROCKET_STRIKE:
if( Vehicle* vk = me->GetVehicleKit() )
if (Vehicle* vk = me->GetVehicleKit())
{
for( int i = 0; i < (Phase / 2); ++i )
{
uint8 index = (Phase == 2 ? rand() % 2 : i);
if( Unit* r = vk->GetPassenger(5 + index) )
if (Unit* r = vk->GetPassenger(5 + index))
if (Player* temp = SelectTargetFromPlayerList(100.0f))
{
if( Creature* trigger = me->SummonCreature(NPC_ROCKET_STRIKE_N, temp->GetPositionX(), temp->GetPositionY(), temp->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 6000) )
if (Creature* trigger = me->SummonCreature(NPC_ROCKET_STRIKE_N, temp->GetPositionX(), temp->GetPositionY(), temp->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 6000))
trigger->CastSpell(trigger, SPELL_ROCKET_STRIKE_AURA, true);
Position exitPos = r->GetPosition();
exitPos.m_positionX += cos(me->GetOrientation()) * 2.35f;
@ -1473,7 +1473,7 @@ public:
vb->SendMeleeAttackStop();
vb->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
if( !leftarm )
if (!leftarm)
{
vb->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOM_SPELL_03);
me->CastSpell(p, SPELL_HAND_PULSE_R, false);
@ -1560,7 +1560,7 @@ public:
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if( spell->Id == SPELL_SELF_REPAIR )
if (spell->Id == SPELL_SELF_REPAIR)
{
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_AGGRESSIVE);
@ -1715,12 +1715,12 @@ public:
return;
// following :D
if( Phase == 3 && !immobilized )
if( Unit* victim = me->GetVictim() )
if( me->GetExactDist2d(victim) > 25.0f )
if (Phase == 3 && !immobilized)
if (Unit* victim = me->GetVictim())
if (me->GetExactDist2d(victim) > 25.0f )
{
float angle = victim->GetAngle(me->GetPositionX(), me->GetPositionY());
me->SetOrientation( me->GetAngle(victim->GetPositionX(), victim->GetPositionY()) );
me->SetOrientation( me->GetAngle(victim->GetPositionX(), victim->GetPositionY()));
float x = victim->GetPositionX() + 15.0f * cos(angle);
float y = victim->GetPositionY() + 15.0f * std::sin(angle);
@ -1759,11 +1759,11 @@ public:
case 0:
break;
case EVENT_SPELL_PLASMA_BALL:
if( !immobilized )
if (!immobilized)
{
if (Phase == 3)
{
if( Unit* victim = me->GetVictim() )
if (Unit* victim = me->GetVictim())
me->CastSpell(victim, SPELL_PLASMA_BALL, false);
}
else
@ -1778,18 +1778,18 @@ public:
events.Repeat(3s);
break;
case EVENT_SUMMON_BOMB_BOT:
if( !immobilized )
if (!immobilized)
me->CastSpell(me, SPELL_SUMMON_BOMB_BOT, false);
events.Repeat(15s);
break;
case EVENT_SUMMON_ASSAULT_BOT:
if( GameObject* pad = me->FindNearestGameObject(RAND(194742, 194746, 194745), 200.0f) )
if (GameObject* pad = me->FindNearestGameObject(RAND(194742, 194746, 194745), 200.0f))
if (Creature* trigger = me->SummonCreature(NPC_BOT_SUMMON_TRIGGER, *pad, TEMPSUMMON_TIMED_DESPAWN, 15000))
trigger->AI()->DoAction(2);
events.Repeat(30s);
break;
case EVENT_SUMMON_JUNK_BOT:
if( GameObject* pad = me->FindNearestGameObject(RAND(194741, 194744, 194747), 200.0f) )
if (GameObject* pad = me->FindNearestGameObject(RAND(194741, 194744, 194747), 200.0f))
if (Creature* trigger = me->SummonCreature(NPC_BOT_SUMMON_TRIGGER, *pad, TEMPSUMMON_TIMED_DESPAWN, 15000))
trigger->AI()->DoAction(1);
events.Repeat(10s);
@ -1798,7 +1798,7 @@ public:
{
uint32 ids[3] = {194740, 194743, 194748};
for( uint8 i = 0; i < 3; ++i )
if( GameObject* pad = me->FindNearestGameObject(ids[i], 200.0f) )
if (GameObject* pad = me->FindNearestGameObject(ids[i], 200.0f))
if (Creature* trigger = me->SummonCreature(NPC_BOT_SUMMON_TRIGGER, *pad, TEMPSUMMON_MANUAL_DESPAWN))
trigger->AI()->DoAction(3);
events.Repeat(45s);
@ -1871,7 +1871,7 @@ public:
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if( spell->Id == SPELL_SELF_REPAIR )
if (spell->Id == SPELL_SELF_REPAIR)
{
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_AGGRESSIVE);
@ -2062,7 +2062,7 @@ public:
void DoAction(int32 param) override
{
switch( param )
switch (param)
{
case 1:
me->CastSpell(me, SPELL_BEAM_GREEN, true);
@ -2081,14 +2081,14 @@ public:
void UpdateAI(uint32 diff) override
{
if( timer <= diff )
if (timer <= diff)
{
uint32 option_npcid[3] = {NPC_JUNK_BOT, NPC_ASSAULT_BOT, NPC_EMERGENCY_FIRE_BOT};
InstanceScript* pInstance = me->GetInstanceScript();
if (Creature* ACU = GetACU()) // ACU summons for easy removing
if( Creature* bot = ACU->SummonCreature( option_npcid[option - 1], *me, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000 ) )
if (Creature* bot = ACU->SummonCreature( option_npcid[option - 1], *me, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000))
{
if( option < 3 )
if (option < 3)
bot->SetInCombatWithZone();
if (Creature* m = GetMimiron())
if (m->AI()->GetData(1)) // hardmode
@ -2190,12 +2190,12 @@ public:
bool OnGossipHello(Player* player, GameObject* go) override
{
if(!player || !go)
if (!player || !go)
return true;
if (InstanceScript* instance = go->GetInstanceScript())
{
if(instance->GetData(TYPE_MIMIRON) != NOT_STARTED)
if (instance->GetData(TYPE_MIMIRON) != NOT_STARTED)
return false;
if (Creature* c = ObjectAccessor::GetCreature(*go, instance->GetGuidData(TYPE_MIMIRON)))
@ -2226,7 +2226,7 @@ public:
CreateTime = GameTime::GetGameTime().count();
events.Reset();
events.ScheduleEvent(EVENT_FLAMES_SPREAD, 5750ms);
if( Creature* flame = me->SummonCreature(NPC_FLAMES_SPREAD, me->GetPositionX(), me->GetPositionY(), 364.32f, 0.0f) )
if (Creature* flame = me->SummonCreature(NPC_FLAMES_SPREAD, me->GetPositionX(), me->GetPositionY(), 364.32f, 0.0f))
{
FlameList.push_back(flame->GetGUID());
flame->CastSpell(flame, SPELL_FLAMES_AURA, true);
@ -2245,7 +2245,7 @@ public:
void SpreadFlame(float x, float y)
{
if( Creature* flame = me->SummonCreature(NPC_FLAMES_SPREAD, x, y, 364.32f, 0.0f) )
if (Creature* flame = me->SummonCreature(NPC_FLAMES_SPREAD, x, y, 364.32f, 0.0f))
{
FlameList.push_back(flame->GetGUID());
if (Creature* c = me->FindNearestCreature(NPC_FLAMES_SPREAD, 10.0f))
@ -2280,13 +2280,13 @@ public:
events.Update(diff);
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_FLAMES_SPREAD:
{
if( FlameList.empty() )
if (FlameList.empty())
{
me->DespawnOrUnsummon();
return;
@ -2300,15 +2300,15 @@ public:
}
Creature* last = ObjectAccessor::GetCreature(*me, FlameList.back());
if( last )
if (last)
{
float prevdist = 100.0f;
Player* target = nullptr;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if( Player* plr = itr->GetSource() )
if( plr->IsAlive() && plr->GetExactDist2d(last) < prevdist && !plr->IsGameMaster() )
if (Player* plr = itr->GetSource())
if (plr->IsAlive() && plr->GetExactDist2d(last) < prevdist && !plr->IsGameMaster())
{
target = plr;
prevdist = plr->GetExactDist2d(last);
@ -2345,7 +2345,7 @@ public:
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
switch( spell->Id )
switch (spell->Id)
{
case SPELL_FROST_BOMB_EXPLOSION_10:
case SPELL_FROST_BOMB_EXPLOSION_25:
@ -2403,7 +2403,7 @@ public:
void UpdateAI(uint32 diff) override
{
events.Update(diff);
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -197,7 +197,7 @@ public:
bGroundPhase = false;
flyTimes = 0;
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_RAZORSCALE, NOT_STARTED);
}
@ -223,7 +223,7 @@ public:
uint8 i = 0;
for( std::list<Creature*>::iterator itr = eeList.begin(); itr != eeList.end(); ++itr )
{
if( i > 2 )
if (i > 2)
break;
ExpeditionEngineerGUIDs[i] = (*itr)->GetGUID();
if (!i)
@ -233,7 +233,7 @@ public:
if (Creature* c = me->FindNearestCreature(NPC_EXPEDITION_COMMANDER, 300.0f, true))
CommanderGUID = c->GetGUID();
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_RAZORSCALE, IN_PROGRESS);
}
@ -241,7 +241,7 @@ public:
{
summons.DespawnAll();
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_RAZORSCALE, DONE);
}
@ -278,18 +278,18 @@ public:
case SPELL_CHAIN_4:
{
uint8 count = 0;
if( me->HasAura(SPELL_CHAIN_1) )
if (me->HasAura(SPELL_CHAIN_1))
count++;
if( me->HasAura(SPELL_CHAIN_3) )
if (me->HasAura(SPELL_CHAIN_3))
count++;
if (RAID_MODE(0, 1))
{
if( me->HasAura(SPELL_CHAIN_2) )
if (me->HasAura(SPELL_CHAIN_2))
count++;
if( me->HasAura(SPELL_CHAIN_4) )
if (me->HasAura(SPELL_CHAIN_4))
count++;
}
if( count >= REQ_CHAIN_COUNT )
if (count >= REQ_CHAIN_COUNT)
{
if (Creature* commander = ObjectAccessor::GetCreature(*me, CommanderGUID))
commander->AI()->Talk(SAY_COMMANDER_GROUND_PHASE);
@ -397,25 +397,25 @@ public:
}
break;
case EVENT_SPELL_FIREBALL:
if( Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 200.0f, true) )
if (Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 200.0f, true))
me->CastSpell(pTarget, SPELL_FIREBALL, false);
events.Repeat(4s);
break;
case EVENT_SPELL_DEVOURING_FLAME:
if( Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 200.0f, true) )
if (Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 200.0f, true))
me->CastSpell(pTarget, SPELL_DEVOURINGFLAME, false);
events.Repeat(13s);
break;
case EVENT_SUMMON_MOLE_MACHINES:
{
memset(cords, '\0', sizeof(cords));
uint8 num = RAID_MODE( urand(2, 3), urand(2, 4) );
uint8 num = RAID_MODE( urand(2, 3), urand(2, 4));
for( int i = 0; i < num; ++i )
{
// X: (550, 625) Y: (-185, -230)
cords[i][0] = urand(550, 625);
cords[i][1] = -230 + rand() % 45;
if( GameObject* drill = me->SummonGameObject(GO_DRILL, cords[i][0], cords[i][1], 391.1f, M_PI / 4, 0.0f, 0.0f, 0.0f, 0.0f, 8) )
if (GameObject* drill = me->SummonGameObject(GO_DRILL, cords[i][0], cords[i][1], 391.1f, M_PI / 4, 0.0f, 0.0f, 0.0f, 0.0f, 8))
{
//drill->SetGoAnimProgress(0);
//drill->SetLootState(GO_READY);
@ -432,13 +432,13 @@ public:
case EVENT_SUMMON_ADDS:
for( int i = 0; i < 4; ++i )
{
if( !cords[i][0] )
if (!cords[i][0])
break;
uint8 opt;
uint8 r = urand(1, 100);
if( r <= 30 ) opt = 1;
else if( r <= 65 ) opt = 2;
if (r <= 30) opt = 1;
else if (r <= 65) opt = 2;
else opt = 3;
for( int j = 0; j < 4; ++j )
@ -447,13 +447,13 @@ public:
float y = cords[i][1] + 4.0f * std::sin(j * M_PI / 2);
uint32 npc_entry = 0;
switch( opt )
switch (opt)
{
case 1:
if( j == 1 ) npc_entry = NPC_DARK_RUNE_SENTINEL;
if (j == 1) npc_entry = NPC_DARK_RUNE_SENTINEL;
break;
case 2:
switch( j )
switch (j)
{
case 1:
npc_entry = NPC_DARK_RUNE_WATCHER;
@ -464,7 +464,7 @@ public:
}
break;
default: // case 3:
switch( j )
switch (j)
{
case 1:
npc_entry = NPC_DARK_RUNE_WATCHER;
@ -479,7 +479,7 @@ public:
break;
}
if( npc_entry )
if (npc_entry)
if (Creature* c = me->SummonCreature(npc_entry, x, y, 391.1f, j * M_PI / 2, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
DoZoneInCombat(c);
}
@ -498,8 +498,8 @@ public:
me->SetInCombatWithZone(); // just in case
if (pInstance)
for( int i = 0; i < 4; ++i )
if( ObjectGuid guid = pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_1 + i) )
if( Creature* hfs = ObjectAccessor::GetCreature(*me, guid) )
if (ObjectGuid guid = pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_1 + i))
if (Creature* hfs = ObjectAccessor::GetCreature(*me, guid))
{
me->SummonCreature(34188, hfs->GetPositionX(), hfs->GetPositionY(), hfs->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 22000);
hfs->AI()->SetData(1, 0);
@ -515,7 +515,7 @@ public:
}
me->CastSpell(me, SPELL_WINGBUFFET, true);
if( (me->GetHealth() * 100) / me->GetMaxHealth() < 50 ) // start phase 3
if ((me->GetHealth() * 100) / me->GetMaxHealth() < 50 ) // start phase 3
{
Talk(EMOTE_PERMA_GROUND);
me->SetControlled(false, UNIT_STATE_ROOT);
@ -753,11 +753,11 @@ public:
{
if (pInstance)
{
if( me->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_1) )
if (me->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_1))
return GO_HARPOON_GUN_1;
else if( me->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_2) )
else if (me->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_2))
return GO_HARPOON_GUN_2;
else if( me->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_3) )
else if (me->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_3))
return GO_HARPOON_GUN_3;
else
return GO_HARPOON_GUN_4;
@ -773,12 +773,12 @@ public:
if (pInstance)
{
uint32 h_entry = GetHarpoonGunIdForThisHFS();
if( GameObject* wh = me->FindNearestGameObject(h_entry, 5.0f) )
if (GameObject* wh = me->FindNearestGameObject(h_entry, 5.0f))
{
wh->SetRespawnTime(0);
wh->Delete();
}
if( GameObject* bh = me->FindNearestGameObject(GO_BROKEN_HARPOON, 5.0f) )
if (GameObject* bh = me->FindNearestGameObject(GO_BROKEN_HARPOON, 5.0f))
if (bh->GetPhaseMask() != 1)
bh->SetPhaseMask(1, true);
}
@ -789,9 +789,9 @@ public:
{
if (++repairPoints >= REPAIR_POINTS)
{
if( GameObject* bh = me->FindNearestGameObject(GO_BROKEN_HARPOON, 4.0f) )
if (GameObject* bh = me->FindNearestGameObject(GO_BROKEN_HARPOON, 4.0f))
bh->SetPhaseMask(2, true);
if( GameObject* wh = me->SummonGameObject(GetHarpoonGunIdForThisHFS(), me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 3 * M_PI / 2, 0.0f, 0.0f, 0.0f, 0.0f, 0) )
if (GameObject* wh = me->SummonGameObject(GetHarpoonGunIdForThisHFS(), me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 3 * M_PI / 2, 0.0f, 0.0f, 0.0f, 0.0f, 0))
{
me->RemoveGameObject(wh, false);
if (Creature* cr = me->SummonCreature(NPC_RAZORSCALE_CONTROLLER, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 5000))
@ -884,7 +884,7 @@ public:
if (Creature* c = ObjectAccessor::GetCreature(*me, fixingGUID))
if (me->GetExactDist2dSq(c) <= 25.0f)
{
if( me->GetUInt32Value(UNIT_NPC_EMOTESTATE) != EMOTE_STATE_WORK )
if (me->GetUInt32Value(UNIT_NPC_EMOTESTATE) != EMOTE_STATE_WORK )
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_WORK);
if (std::fabs(me->GetOrientation() - me->GetAngle(c)) > M_PI / 4)
@ -899,10 +899,10 @@ public:
if (!fixingGUID)
{
Creature* razorscale = nullptr;
if( ObjectGuid rsGUID = pInstance->GetGuidData(TYPE_RAZORSCALE) )
if (ObjectGuid rsGUID = pInstance->GetGuidData(TYPE_RAZORSCALE))
razorscale = ObjectAccessor::GetCreature(*me, rsGUID);
if( !razorscale || !razorscale->IsInCombat() )
if (!razorscale || !razorscale->IsInCombat())
{
Reset();
me->GetMotionMaster()->MoveTargetedHome();
@ -910,8 +910,8 @@ public:
}
for( int i = 0; i < 4; ++i )
if( ObjectGuid fs_GUID = pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_1 + i) )
if( Creature* fs = ObjectAccessor::GetCreature(*me, fs_GUID) )
if (ObjectGuid fs_GUID = pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_1 + i))
if (Creature* fs = ObjectAccessor::GetCreature(*me, fs_GUID))
if (!fs->AI()->GetData(2))
{
float a = rand_norm() * M_PI;
@ -940,18 +940,18 @@ public:
bool OnGossipHello(Player* user, GameObject* go) override
{
if( !user || !go )
if (!user || !go)
return true;
InstanceScript* pInstance = go->GetInstanceScript();
if( !pInstance )
if (!pInstance)
return true;
Creature* rs = nullptr;
if( ObjectGuid rsGUID = pInstance->GetGuidData(TYPE_RAZORSCALE) )
if (ObjectGuid rsGUID = pInstance->GetGuidData(TYPE_RAZORSCALE))
rs = ObjectAccessor::GetCreature(*go, rsGUID);
if( !rs || !rs->IsInCombat() )
if (!rs || !rs->IsInCombat())
{
go->SetRespawnTime(0);
go->Delete();
@ -960,7 +960,7 @@ public:
uint32 npc = 0;
uint32 spell = 0;
switch( go->GetEntry() )
switch (go->GetEntry())
{
case GO_HARPOON_GUN_1:
npc = DATA_HARPOON_FIRE_STATE_1;
@ -980,8 +980,8 @@ public:
break;
}
if( ObjectGuid g = pInstance->GetGuidData(npc) )
if( Creature* hfs = ObjectAccessor::GetCreature(*go, g) )
if (ObjectGuid g = pInstance->GetGuidData(npc))
if (Creature* hfs = ObjectAccessor::GetCreature(*go, g))
hfs->AI()->SetData(3, spell);
go->SetLootState(GO_JUST_DEACTIVATED);
@ -1017,7 +1017,7 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
if (timer2 <= diff) timer2 = 0;
@ -1066,10 +1066,10 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
if( timer1 <= diff )
if (timer1 <= diff)
{
me->CastSpell(me->GetVictim(), SPELL_CHAINLIGHTNING, false);
timer1 = urand(10000, 12000);
@ -1122,10 +1122,10 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
if( timer1 <= diff )
if (timer1 <= diff)
{
me->CastSpell(me, SPELL_BATTLE_SHOUT, false);
timer1 = urand(15000, 20000);

View file

@ -1416,14 +1416,14 @@ public:
void RunRunicSmash(bool cast)
{
if (Creature* cr = ObjectAccessor::GetCreature(*me, _leftHand ? _triggerLeftGUID[0] : _triggerRightGUID[0]) )
if (Creature* cr = ObjectAccessor::GetCreature(*me, _leftHand ? _triggerLeftGUID[0] : _triggerRightGUID[0]))
{
if (cast)
cr->CastSpell(cr, SPELL_RUNIC_SMASH_DAMAGE, true);
cr->SetPosition(_leftHand ? 2235.0f : 2221.0f, _nextTriggerPos, cr->GetPositionZ(), 0.0f);
cr->StopMovingOnCurrentPos();
}
if( Creature* cr = ObjectAccessor::GetCreature(*me, _leftHand ? _triggerLeftGUID[1] : _triggerRightGUID[1]) )
if (Creature* cr = ObjectAccessor::GetCreature(*me, _leftHand ? _triggerLeftGUID[1] : _triggerRightGUID[1]))
{
if (cast)
cr->CastSpell(cr, SPELL_RUNIC_SMASH_DAMAGE, true);

View file

@ -308,7 +308,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
// Control events
case EVENT_HEALTH_CHECK:
@ -509,7 +509,7 @@ public:
_spawnSelection++;
break;
case 3:
if(_pummelerCount < 2)
if (_pummelerCount < 2)
me->SummonCreature(NPC_XM024_PUMMELLER, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + 2, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
_pummelerCount++;

View file

@ -791,7 +791,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case EVENT_SARA_P1_DOORS_CLOSE:
// Whispers of YS
@ -1405,7 +1405,7 @@ public:
{
// Stun
if (me->GetInstanceScript())
if(Creature* sara = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetGuidData(NPC_SARA)))
if (Creature* sara = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetGuidData(NPC_SARA)))
sara->AI()->DoAction(MINUTE * IN_MILLISECONDS - std::min((uint32)MINUTE * IN_MILLISECONDS, _induceTimer));
_induceTimer = 0;
@ -1419,7 +1419,7 @@ public:
return;
summons.DespawnAll();
switch(param)
switch (param)
{
case ACTION_ILLUSION_STORMWIND:
PrepareStormwindIllusion();
@ -1472,7 +1472,7 @@ public:
me->CastSpell(me, SPELL_BRAIN_HURT_VISUAL, true);
if (me->GetInstanceScript())
if(Creature* sara = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetGuidData(NPC_SARA)))
if (Creature* sara = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetGuidData(NPC_SARA)))
sara->AI()->DoAction(ACTION_BRAIN_DAMAGED);
}
}
@ -1905,7 +1905,7 @@ public:
if (_visualTimer)
{
_visualTimer += diff;
if (_visualTimer >= 100 && _visualTimer < 10000 )
if (_visualTimer >= 100 && _visualTimer < 10000)
{
me->CastSpell(me, SPELL_SIMPLE_TELEPORT, false);
_visualTimer = 10000;
@ -1989,7 +1989,7 @@ public:
if (_checkTimer != 0)
{
_checkTimer -= diff;
if (_checkTimer < 0 )
if (_checkTimer < 0)
_checkTimer = 0;
}
else
@ -2076,7 +2076,7 @@ public:
if (_checkTimer != 0)
{
_checkTimer -= diff;
if (_checkTimer < 0 )
if (_checkTimer < 0)
_checkTimer = 0;
}
else
@ -2171,7 +2171,7 @@ public:
if (_checkTimer != 0)
{
_checkTimer -= diff;
if (_checkTimer < 0 )
if (_checkTimer < 0)
_checkTimer = 0;
}
else

View file

@ -310,7 +310,7 @@ public:
void OnCreatureCreate(Creature* creature) override
{
switch(creature->GetEntry())
switch (creature->GetEntry())
{
case NPC_LEVIATHAN:
m_uiLeviathanGUID = creature->GetGUID();
@ -373,11 +373,11 @@ public:
break;
case NPC_HARPOON_FIRE_STATE:
{
if( creature->GetPositionX() > 595 )
if (creature->GetPositionX() > 595 )
m_RazorscaleHarpoonFireStateGUID[3] = creature->GetGUID();
else if( creature->GetPositionX() > 585 )
else if (creature->GetPositionX() > 585 )
m_RazorscaleHarpoonFireStateGUID[2] = creature->GetGUID();
else if( creature->GetPositionX() > 575 )
else if (creature->GetPositionX() > 575 )
m_RazorscaleHarpoonFireStateGUID[1] = creature->GetGUID();
else
m_RazorscaleHarpoonFireStateGUID[0] = creature->GetGUID();
@ -446,7 +446,7 @@ public:
// Flame Leviathan
case GO_REPAIR_STATION_TRAP:
{
if(m_RepairSGUID[0])
if (m_RepairSGUID[0])
m_RepairSGUID[1] = gameObject->GetGUID();
else
m_RepairSGUID[0] = gameObject->GetGUID();
@ -558,15 +558,15 @@ public:
case GO_HODIR_FROZEN_DOOR:
case GO_HODIR_DOOR:
if (GetData(TYPE_HODIR) == DONE)
if( gameObject->GetGoState() != GO_STATE_ACTIVE )
if (gameObject->GetGoState() != GO_STATE_ACTIVE )
{
gameObject->SetLootState(GO_READY);
gameObject->UseDoorOrButton(0, false);
}
break;
case GO_VEZAX_DOOR:
if( GetData(TYPE_VEZAX) == DONE )
if( gameObject->GetGoState() != GO_STATE_ACTIVE )
if (GetData(TYPE_VEZAX) == DONE )
if (gameObject->GetGoState() != GO_STATE_ACTIVE )
{
gameObject->SetLootState(GO_READY);
gameObject->UseDoorOrButton(0, false);
@ -669,7 +669,7 @@ public:
void SetData(uint32 type, uint32 data) override
{
switch(type)
switch (type)
{
case TYPE_LEVIATHAN:
m_auiEncounter[type] = data;
@ -1056,7 +1056,7 @@ public:
uint32 GetData(uint32 type) const override
{
switch(type)
switch (type)
{
case TYPE_LEVIATHAN:
case TYPE_IGNIS:

View file

@ -189,7 +189,7 @@ public:
else if (s->GetEntry() == NPC_THROW)
{
ThrowGUID = s->GetGUID();
if( Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 70.0f, true) )
if (Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 70.0f, true))
s->GetMotionMaster()->MovePoint(0, t->GetPositionX(), t->GetPositionY(), t->GetPositionZ());
}
}
@ -246,10 +246,10 @@ public:
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -263,16 +263,16 @@ public:
events.RescheduleEvent(EVENT_ANNHYLDE_YELL, 3s);
break;
case EVENT_VALKYR_MOVE:
if( Creature* s = ObjectAccessor::GetCreature(*me, ValkyrGUID) )
if (Creature* s = ObjectAccessor::GetCreature(*me, ValkyrGUID))
s->GetMotionMaster()->MovePoint(1, s->GetPositionX(), s->GetPositionY(), s->GetPositionZ() - 15.0f);
break;
case EVENT_ANNHYLDE_YELL:
if( Creature* s = ObjectAccessor::GetCreature(*me, ValkyrGUID) )
if (Creature* s = ObjectAccessor::GetCreature(*me, ValkyrGUID))
s->AI()->Talk(YELL_ANHYLDE_2);
break;
case EVENT_VALKYR_BEAM:
me->RemoveAura(SPELL_SUMMON_VALKYR);
if( Creature* c = ObjectAccessor::GetCreature(*me, ValkyrGUID) )
if (Creature* c = ObjectAccessor::GetCreature(*me, ValkyrGUID))
c->CastSpell(me, SPELL_RESURRECTION_BEAM, false);
events.RescheduleEvent(EVENT_RESURRECTION_BALL, 4s);
break;
@ -291,7 +291,7 @@ public:
events.RescheduleEvent(EVENT_START_PHASE_2, 1s);
break;
case EVENT_START_PHASE_2:
if( Creature* c = ObjectAccessor::GetCreature(*me, ValkyrGUID) )
if (Creature* c = ObjectAccessor::GetCreature(*me, ValkyrGUID))
{
c->DespawnOrUnsummon();
summons.DespawnAll();
@ -327,7 +327,7 @@ public:
events.Repeat(15s, 20s);
break;
case EVENT_SPELL_CLEAVE_OR_WOE_STRIKE:
if( me->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID) == 0 )
if (me->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID) == 0 )
{
events.Repeat(3s);
break;
@ -339,7 +339,7 @@ public:
events.Repeat(3s, 7s);
break;
case EVENT_SPELL_SMASH:
if( me->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID) == 0 )
if (me->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID) == 0 )
{
events.Repeat(3s);
break;

View file

@ -76,7 +76,7 @@ public:
if (Unit* s = t->GetSummonerUnit())
{
PrisonerGUID = s->GetGUID();
if( me->GetInstanceScript() && me->GetInstanceScript()->instance->IsHeroic() )
if (me->GetInstanceScript() && me->GetInstanceScript()->instance->IsHeroic())
{
const int32 dmg = 2000;
c->CastCustomSpell(s, SPELL_FROST_TOMB_AURA, nullptr, &dmg, nullptr, true);
@ -105,7 +105,7 @@ public:
{
if (Unit* p = ObjectAccessor::GetUnit(*me, PrisonerGUID))
{
if( !p->HasAura(SPELL_FROST_TOMB_AURA) )
if (!p->HasAura(SPELL_FROST_TOMB_AURA))
me->KillSelf();
}
else
@ -173,7 +173,7 @@ public:
void AttackStart(Unit* who) override
{
if( !who )
if (!who)
return;
UnitAI::AttackStartCaster(who, 12.0f);
@ -186,10 +186,10 @@ public:
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -198,8 +198,8 @@ public:
events.Repeat(4s, 5s);
break;
case EVENT_FROST_TOMB:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true) )
if( !target->HasAura(SPELL_FROST_TOMB_AURA) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true))
if (!target->HasAura(SPELL_FROST_TOMB_AURA))
{
Talk(SAY_FROST_TOMB_EMOTE, target);
Talk(SAY_FROST_TOMB);
@ -215,8 +215,8 @@ public:
{
float dist = rand_norm() * 4 + 3.0f;
float angle = rand_norm() * 2 * M_PI;
if( Creature* c = me->SummonCreature(NPC_SKELETON, 156.2f + cos(angle) * dist, 259.1f + std::sin(angle) * dist, 42.9f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000) )
if( Unit* target = c->SelectNearestTarget(250.0f) )
if (Creature* c = me->SummonCreature(NPC_SKELETON, 156.2f + cos(angle) * dist, 259.1f + std::sin(angle) * dist, 42.9f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
if (Unit* target = c->SelectNearestTarget(250.0f))
{
c->AddThreat(target, 5.0f);
DoZoneInCombat(c);
@ -266,7 +266,7 @@ public:
{
events.Reset();
events.RescheduleEvent(EVENT_SPELL_DECREPIFY, 10s, 20s);
if( IsHeroic() )
if (IsHeroic())
events.RescheduleEvent(EVENT_SPELL_BONE_ARMOR, 25s, 120s);
}
@ -292,9 +292,9 @@ public:
void UpdateAI(uint32 diff) override
{
if( pInstance && pInstance->GetData(DATA_KELESETH) != IN_PROGRESS )
if (pInstance && pInstance->GetData(DATA_KELESETH) != IN_PROGRESS )
{
if( me->IsAlive() )
if (me->IsAlive())
me->KillSelf();
return;
}
@ -304,20 +304,20 @@ public:
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_DECREPIFY:
if( !me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE) )
if (!me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
me->CastSpell(me->GetVictim(), SPELL_DECREPIFY, false);
events.Repeat(15s, 25s);
break;
case EVENT_SPELL_BONE_ARMOR:
if( !me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE) )
if (!me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
me->CastSpell((Unit*)nullptr, SPELL_BONE_ARMOR, false);
events.Repeat(40s, 120s);
break;
@ -337,7 +337,7 @@ public:
break;
}
if( !me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE) )
if (!me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
DoMeleeAttackIfReady();
}
};
@ -356,7 +356,7 @@ class spell_frost_tomb_aura : public AuraScript
{
PreventDefaultAction();
if (aurEff->GetTickNumber() == 1)
if( Unit* target = GetTarget() )
if (Unit* target = GetTarget())
target->CastSpell((Unit*)nullptr, SPELL_FROST_TOMB_SUMMON, true);
}

View file

@ -107,7 +107,7 @@ public:
void OnGameObjectCreate(GameObject* go) override
{
switch(go->GetEntry())
switch (go->GetEntry())
{
case GO_BELLOW_1:
GO_ForgeBellowGUID[0] = go->GetGUID();
@ -158,7 +158,7 @@ public:
void SetData(uint32 type, uint32 data) override
{
switch(type)
switch (type)
{
case DATA_KELESETH:
m_auiEncounter[0] = data;
@ -307,7 +307,7 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
case 7231: // On The Rocks
return bRocksAchiev;

View file

@ -174,11 +174,11 @@ public:
// Reset mini bosses
for(uint8 i = 0; i < 4; ++i)
{
if(Creature* Animal = ObjectAccessor::GetCreature(*me, m_pInstance->GetGuidData(DATA_NPC_FRENZIED_WORGEN + i)))
if (Creature* Animal = ObjectAccessor::GetCreature(*me, m_pInstance->GetGuidData(DATA_NPC_FRENZIED_WORGEN + i)))
{
Animal->SetPosition(Animal->GetHomePosition());
Animal->StopMovingOnCurrentPos();
if(Animal->isDead())
if (Animal->isDead())
Animal->Respawn(true);
Animal->CastSpell(Animal, SPELL_FREEZE, true);
@ -322,7 +322,7 @@ public:
void JustDied(Unit* /*pKiller*/) override
{
me->PlayDirectSound(SOUND_DEATH);
if(m_pInstance)
if (m_pInstance)
m_pInstance->SetData(DATA_GORTOK_PALEHOOF, DONE);
}

View file

@ -148,7 +148,7 @@ public:
me->UpdatePosition(343.02f, -507.325f, 104.567f, M_PI, true);
me->StopMovingOnCurrentPos();
if(m_pInstance)
if (m_pInstance)
{
m_pInstance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_LODI_DODI);
m_pInstance->SetData(DATA_SKADI_THE_RUTHLESS, NOT_STARTED);
@ -355,7 +355,7 @@ public:
void MovementInform(uint32 /*uiType*/, uint32 Id) override
{
switch(Id)
switch (Id)
{
case 0:
case 1:

View file

@ -193,7 +193,7 @@ public:
{
summons.DespawnAll();
Talk(SAY_DEATH);
if(instance)
if (instance)
instance->SetData(DATA_SVALA_SORROWGRAVE, DONE);
}

View file

@ -148,7 +148,7 @@ public:
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
if(pInstance)
if (pInstance)
{
pInstance->SetData(DATA_KING_YMIRON, NOT_STARTED);
pInstance->SetData(DATA_YMIRON_ACHIEVEMENT, true);
@ -168,7 +168,7 @@ public:
void JustEngagedWith(Unit* /*pWho*/) override
{
Talk(SAY_AGGRO);
if(pInstance)
if (pInstance)
{
pInstance->SetData(DATA_KING_YMIRON, IN_PROGRESS);
if (pInstance->GetData(DATA_SKADI_THE_RUTHLESS) == DONE)
@ -183,7 +183,7 @@ public:
void MovementInform(uint32 uiType, uint32 point) override
{
if(uiType != POINT_MOTION_TYPE)
if (uiType != POINT_MOTION_TYPE)
return;
if (point == 0)
@ -271,7 +271,7 @@ public:
king->SetDisableGravity(true);
me->RemoveUnitFlag(UNIT_FLAG_DISABLE_MOVE);
me->GetMotionMaster()->MoveChase(me->GetVictim());
switch(BoatOrder[BoatNum - 1])
switch (BoatOrder[BoatNum - 1])
{
case 0:
events.ScheduleEvent(EVENT_YMIRON_RANULF_ABILITY, 3s, 1);
@ -338,7 +338,7 @@ public:
summons.DespawnAll();
summons2.DespawnAll();
if(pInstance)
if (pInstance)
pInstance->SetData(DATA_KING_YMIRON, DONE);
}

View file

@ -73,14 +73,14 @@ public:
bool IsEncounterInProgress() const override
{
for(uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
if(Encounters[i] == IN_PROGRESS)
if (Encounters[i] == IN_PROGRESS)
return true;
return false;
}
void OnCreatureCreate(Creature* pCreature) override
{
switch(pCreature->GetEntry())
switch (pCreature->GetEntry())
{
case NPC_SVALA_SORROWGRAVE:
SvalaSorrowgrave = pCreature->GetGUID();
@ -114,7 +114,7 @@ public:
void OnGameObjectCreate(GameObject* pGo) override
{
switch(pGo->GetEntry())
switch (pGo->GetEntry())
{
case GO_SKADI_THE_RUTHLESS_DOOR:
SkadiRuthlessDoor = pGo->GetGUID();
@ -137,7 +137,7 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
case 7322: // The Incredible Hulk (2043)
return svalaAchievement;
@ -151,7 +151,7 @@ public:
void SetData(uint32 type, uint32 data) override
{
switch(type)
switch (type)
{
case DATA_SVALA_SORROWGRAVE:
case DATA_GORTOK_PALEHOOF:
@ -212,7 +212,7 @@ public:
uint32 GetData(uint32 type) const override
{
switch(type)
switch (type)
{
case DATA_SVALA_SORROWGRAVE:
return Encounters[0];

View file

@ -176,7 +176,7 @@ public:
void SetData(uint32 type, uint32 data) override
{
switch(type)
switch (type)
{
case EVENT_ARCHAVON:
case EVENT_EMALON:

View file

@ -99,7 +99,7 @@ public:
{
if (!target || !spell)
return;
switch(spell->Id)
switch (spell->Id)
{
case SPELL_ARCANE_VACUUM:
target->NearTeleportTo(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 10.0f, target->GetOrientation());
@ -117,7 +117,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -116,7 +116,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -280,7 +280,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -110,7 +110,7 @@ public:
if (!me->IsAlive())
return;
switch(param)
switch (param)
{
case ACTION_WATER_ELEMENT_HIT:
if (pInstance)

View file

@ -88,7 +88,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -91,7 +91,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -104,7 +104,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -103,7 +103,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -107,7 +107,7 @@ public:
void OnCreatureCreate(Creature* creature) override
{
switch(creature->GetEntry())
switch (creature->GetEntry())
{
case NPC_SINCLARI:
NPC_SinclariGUID = creature->GetGUID();
@ -162,7 +162,7 @@ public:
void OnGameObjectCreate(GameObject* go) override
{
switch(go->GetEntry())
switch (go->GetEntry())
{
case GO_ACTIVATION_CRYSTAL:
HandleGameObject(ObjectGuid::Empty, false, go); // make go not used yet
@ -202,7 +202,7 @@ public:
void SetData(uint32 type, uint32 data) override
{
switch(type)
switch (type)
{
case DATA_ACTIVATE_DEFENSE_SYSTEM:
{
@ -277,7 +277,7 @@ public:
void SetGuidData(uint32 type, ObjectGuid data) override
{
switch(type)
switch (type)
{
case DATA_ADD_TRASH_MOB:
trashMobs.insert(data);
@ -291,7 +291,7 @@ public:
uint32 GetData(uint32 type) const override
{
switch(type)
switch (type)
{
case DATA_ENCOUNTER_STATUS:
return (uint32)EncounterStatus;
@ -333,7 +333,7 @@ public:
{
Creature* pBoss = nullptr;
switch(uiBoss)
switch (uiBoss)
{
case BOSS_MORAGG:
HandleGameObject(GO_MoraggCellGUID, true);
@ -403,13 +403,13 @@ public:
void Update(uint32 diff) override
{
events.Update(diff);
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_CHECK_PLAYERS:
{
if( DoNeedCleanup(false) )
if (DoNeedCleanup(false))
InstanceCleanup();
events.Repeat(5s);
}
@ -522,7 +522,7 @@ public:
void OnPlayerEnter(Player* plr) override
{
if( DoNeedCleanup(plr->IsAlive()) )
if (DoNeedCleanup(plr->IsAlive()))
InstanceCleanup();
if (EncounterStatus == IN_PROGRESS)
@ -542,19 +542,19 @@ public:
uint8 aliveCount = 0;
Map::PlayerList const& pl = instance->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if( Player* plr = itr->GetSource() )
if( plr->IsAlive() && !plr->IsGameMaster() && !plr->HasAura(27827)/*spirit of redemption aura*/ )
if (Player* plr = itr->GetSource())
if (plr->IsAlive() && !plr->IsGameMaster() && !plr->HasAura(27827)/*spirit of redemption aura*/ )
++aliveCount;
bool need = enter ? aliveCount <= 1 : aliveCount == 0;
if( !need && CLEANED )
if (!need && CLEANED)
CLEANED = false;
return need;
}
void InstanceCleanup()
{
if( CLEANED )
if (CLEANED)
return;
CLEANED = true;
@ -638,7 +638,7 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
case CRITERIA_DEFENSELESS:
return GateHealth == 100 && !bDefensesUsed;

View file

@ -91,7 +91,7 @@ public:
{
ClearGossipMenuFor(player);
switch(uiAction)
switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
CloseGossipMenuFor(player);
@ -172,7 +172,7 @@ public:
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -325,7 +325,7 @@ struct violet_hold_trashAI : public npc_escortAI
if (!bAddedWP)
{
bAddedWP = true;
switch(PLoc)
switch (PLoc)
{
case 0:
for(int i = 0; i < 6; i++)
@ -1040,30 +1040,30 @@ public:
if (!pInstance)
return;
switch(uiBoss)
switch (uiBoss)
{
case 1:
if(uiWPointId == 2)
if (uiWPointId == 2)
FinishPointReached();
break;
case 2:
if(uiWPointId == 2)
if (uiWPointId == 2)
FinishPointReached();
break;
case 3:
if(uiWPointId == 1)
if (uiWPointId == 1)
FinishPointReached();
break;
case 4:
if(uiWPointId == 0)
if (uiWPointId == 0)
FinishPointReached();
break;
case 5:
if(uiWPointId == 0)
if (uiWPointId == 0)
FinishPointReached();
break;
case 6:
if(uiWPointId == 4)
if (uiWPointId == 4)
FinishPointReached();
break;
}
@ -1073,10 +1073,10 @@ public:
{
npc_escortAI::UpdateAI(diff);
if(!bAddedWPs)
if (!bAddedWPs)
{
bAddedWPs = true;
switch(uiBoss)
switch (uiBoss)
{
case 1:
for(int i = 0; i < 3; i++)

View file

@ -148,7 +148,7 @@ public:
void SetData(uint32 type, uint32 /*data*/) override
{
switch(type)
switch (type)
{
case ACTION_SHANDY_INTRO:
if (Creature* aquanos = me->FindNearestCreature(NPC_AQUANOS_ENTRY, 30, true))
@ -163,7 +163,7 @@ public:
_events.ScheduleEvent(EVENT_OUTRO_DH, 10min);
break;
default:
if(_lSource == type && _canWash)
if (_lSource == type && _canWash)
{
_canWash = false;
_events.ScheduleEvent(EVENT_INTRO_DH2, type == ACTION_UNMENTIONABLES ? 4s : 10s);
@ -243,7 +243,7 @@ public:
if (player->GetQuestStatus(QUEST_SUITABLE_DISGUISE_A) == QUEST_STATUS_INCOMPLETE ||
player->GetQuestStatus(QUEST_SUITABLE_DISGUISE_H) == QUEST_STATUS_INCOMPLETE)
{
if(player->GetTeamId() == TEAM_ALLIANCE)
if (player->GetTeamId() == TEAM_ALLIANCE)
AddGossipItemFor(player, GOSSIP_MENU_AQUANOS, GOSSIP_AQUANOS_ALLIANCE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
else
AddGossipItemFor(player, GOSSIP_MENU_AQUANOS, GOSSIP_AQUANOS_HORDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);

View file

@ -283,12 +283,12 @@ public:
bool OnGossipHello(Player* player, GameObject* go) override
{
if(!player || !go)
if (!player || !go)
return true;
Creature* t = player->FindNearestCreature(NPC_CONVERSING_WITH_THE_DEPTHS_TRIGGER, 10.0f, true);
if(t && t->AI() && CAST_AI(npc_conversing_with_the_depths_trigger::npc_conversing_with_the_depths_triggerAI, t->AI()))
if(!CAST_AI(npc_conversing_with_the_depths_trigger::npc_conversing_with_the_depths_triggerAI, t->AI())->running)
if (t && t->AI() && CAST_AI(npc_conversing_with_the_depths_trigger::npc_conversing_with_the_depths_triggerAI, t->AI()))
if (!CAST_AI(npc_conversing_with_the_depths_trigger::npc_conversing_with_the_depths_triggerAI, t->AI())->running)
CAST_AI(npc_conversing_with_the_depths_trigger::npc_conversing_with_the_depths_triggerAI, t->AI())->Start(player->GetGUID());
return true;

View file

@ -138,7 +138,7 @@ public:
void PrepareSummons()
{
switch(currentQuest)
switch (currentQuest)
{
case QUEST_BFV_FALLEN_HEROES:
me->SummonCreature(NPC_ELDRETH, 8245.5f, 3522.7f, 627.67f, 3.11f, TEMPSUMMON_MANUAL_DESPAWN, 30000);

View file

@ -400,7 +400,7 @@ public:
if (timer)
{
timer -= diff;
if( timer < 0 )
if (timer < 0)
timer = 0;
}
else if (success)

View file

@ -700,11 +700,11 @@ public:
player->PrepareQuestMenu(creature->GetGUID());
//Trainer Menu
if ( creature->IsTrainer() )
if (creature->IsTrainer())
AddGossipItemFor(player, GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
//Vendor Menu
if ( creature->IsVendor() )
if (creature->IsVendor())
if (player->HasSpell(SPELL_MECHANO_HOG) || player->HasSpell(SPELL_MEKGINEERS_CHOPPER))
AddGossipItemFor(player, GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);

View file

@ -38,12 +38,12 @@ OPvPCapturePointEP_EWT::OPvPCapturePointEP_EWT(OutdoorPvP* pvp)
void OPvPCapturePointEP_EWT::ChangeState()
{
// if changing from controlling alliance to horde or vice versa
if ( _oldState == OBJECTIVESTATE_ALLIANCE && _oldState != _state )
if (_oldState == OBJECTIVESTATE_ALLIANCE && _oldState != _state)
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_A));
((OutdoorPvPEP*)_pvp)->SetControlledState(EP_EWT, TEAM_NEUTRAL);
}
else if ( _oldState == OBJECTIVESTATE_HORDE && _oldState != _state )
else if (_oldState == OBJECTIVESTATE_HORDE && _oldState != _state)
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_H));
((OutdoorPvPEP*)_pvp)->SetControlledState(EP_EWT, TEAM_NEUTRAL);
@ -170,12 +170,12 @@ OPvPCapturePointEP_NPT::OPvPCapturePointEP_NPT(OutdoorPvP* pvp)
void OPvPCapturePointEP_NPT::ChangeState()
{
// if changing from controlling alliance to horde or vice versa
if ( _oldState == OBJECTIVESTATE_ALLIANCE && _oldState != _state )
if (_oldState == OBJECTIVESTATE_ALLIANCE && _oldState != _state)
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_A));
((OutdoorPvPEP*)_pvp)->SetControlledState(EP_NPT, TEAM_NEUTRAL);
}
else if ( _oldState == OBJECTIVESTATE_HORDE && _oldState != _state )
else if (_oldState == OBJECTIVESTATE_HORDE && _oldState != _state)
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_H));
((OutdoorPvPEP*)_pvp)->SetControlledState(EP_NPT, TEAM_NEUTRAL);
@ -312,12 +312,12 @@ OPvPCapturePointEP_CGT::OPvPCapturePointEP_CGT(OutdoorPvP* pvp)
void OPvPCapturePointEP_CGT::ChangeState()
{
// if changing from controlling alliance to horde or vice versa
if ( _oldState == OBJECTIVESTATE_ALLIANCE && _oldState != _state )
if (_oldState == OBJECTIVESTATE_ALLIANCE && _oldState != _state)
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_A));
((OutdoorPvPEP*)_pvp)->SetControlledState(EP_CGT, TEAM_NEUTRAL);
}
else if ( _oldState == OBJECTIVESTATE_HORDE && _oldState != _state )
else if (_oldState == OBJECTIVESTATE_HORDE && _oldState != _state)
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_H));
((OutdoorPvPEP*)_pvp)->SetControlledState(EP_CGT, TEAM_NEUTRAL);
@ -439,12 +439,12 @@ OPvPCapturePointEP_PWT::OPvPCapturePointEP_PWT(OutdoorPvP* pvp)
void OPvPCapturePointEP_PWT::ChangeState()
{
// if changing from controlling alliance to horde or vice versa
if ( _oldState == OBJECTIVESTATE_ALLIANCE && _oldState != _state )
if (_oldState == OBJECTIVESTATE_ALLIANCE && _oldState != _state)
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_A));
((OutdoorPvPEP*)_pvp)->SetControlledState(EP_PWT, TEAM_NEUTRAL);
}
else if ( _oldState == OBJECTIVESTATE_HORDE && _oldState != _state )
else if (_oldState == OBJECTIVESTATE_HORDE && _oldState != _state)
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_H));
((OutdoorPvPEP*)_pvp)->SetControlledState(EP_PWT, TEAM_NEUTRAL);

View file

@ -791,7 +791,7 @@ void OPvPCapturePointNA::ChangeState()
break;
case OBJECTIVESTATE_ALLIANCE:
m_HalaaState = HALAA_A;
if(m_canRecap)
if (m_canRecap)
FactionTakeOver(TEAM_ALLIANCE);
artkit = 2;
break;

View file

@ -358,7 +358,7 @@ struct boss_fathomguard_tidalvess : public ScriptedAI
int32 action = 0;
uint8 group = 0;
switch(entry)
switch (entry)
{
case NPC_SPITFIRE_TOTEM:
timer = 59s;
@ -407,7 +407,7 @@ struct boss_fathomguard_tidalvess : public ScriptedAI
void SummonTotem(uint32 entry)
{
switch(entry)
switch (entry)
{
case NPC_SPITFIRE_TOTEM:
DoCastSelf(SPELL_SPITFIRE_TOTEM);

View file

@ -103,7 +103,7 @@ struct boss_lady_vashj : public BossAI
void KilledUnit(Unit* /*victim*/) override
{
if(!_recentlySpoken)
if (!_recentlySpoken)
{
Talk(SAY_SLAY);
_recentlySpoken = true;
@ -132,7 +132,7 @@ struct boss_lady_vashj : public BossAI
void JustSummoned(Creature* summon) override
{
summons.Summon(summon);
switch(summon->GetEntry()) {
switch (summon->GetEntry()) {
case(WORLD_TRIGGER):
summon->CastSpell(summon, SPELL_MAGIC_BARRIER);
break;

View file

@ -93,7 +93,7 @@ struct boss_high_king_maulgar : public BossAI
void KilledUnit(Unit* /*victim*/) override
{
if(!_recentlySpoken)
if (!_recentlySpoken)
{
Talk(SAY_SLAY);
_recentlySpoken = true;

Some files were not shown because too many files have changed in this diff Show more