mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-15 08:16:08 +00:00
chore(Core/Misc): Some cleanup (#19970)
* remove weird blanks * update if * ) ) to )) * missed some ) ) * now switch * .
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -193,7 +193,7 @@ public:
|
||||
{
|
||||
summons.DespawnAll();
|
||||
Talk(SAY_DEATH);
|
||||
if(instance)
|
||||
if (instance)
|
||||
instance->SetData(DATA_SVALA_SORROWGRAVE, DONE);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user