mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-27 23:56:25 +00:00
chore(Core/Misc): Some cleanup (#19970)
* remove weird blanks * update if * ) ) to )) * missed some ) ) * now switch * .
This commit is contained in:
@@ -1058,7 +1058,7 @@ float AuraEffect::CalcPeriodicCritChance(Unit const* caster, Unit const* target)
|
||||
}
|
||||
}
|
||||
|
||||
switch(GetSpellInfo()->SpellFamilyName)
|
||||
switch (GetSpellInfo()->SpellFamilyName)
|
||||
{
|
||||
// Rupture - since 3.3.3 can crit
|
||||
case SPELLFAMILY_ROGUE:
|
||||
@@ -5603,7 +5603,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
||||
{
|
||||
if (Battleground* bg = target->ToPlayer()->GetBattleground())
|
||||
bg->RemovePlayerFromResurrectQueue(target->ToPlayer());
|
||||
if(Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId()))
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId()))
|
||||
bf->RemovePlayerFromResurrectQueue(target->GetGUID());
|
||||
}
|
||||
break;
|
||||
@@ -5623,7 +5623,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
||||
// Halls of Lightning, Arc Lightning
|
||||
case 52921:
|
||||
{
|
||||
if( aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE )
|
||||
if (aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE )
|
||||
return;
|
||||
|
||||
Player* player = nullptr;
|
||||
@@ -5631,7 +5631,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
||||
Acore::PlayerSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(target, player, checker);
|
||||
Cell::VisitWorldObjects(target, searcher, 10.0f);
|
||||
|
||||
if( player && player->GetGUID() != target->GetGUID() )
|
||||
if (player && player->GetGUID() != target->GetGUID())
|
||||
target->CastSpell(player, 52921, true);
|
||||
|
||||
return;
|
||||
@@ -6488,7 +6488,7 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
|
||||
{
|
||||
if (caster)
|
||||
if (Unit* victim = caster->GetVictim())
|
||||
if(victim->GetDistance(caster) < 45.0f)
|
||||
if (victim->GetDistance(caster) < 45.0f)
|
||||
{
|
||||
target = victim;
|
||||
break;
|
||||
|
||||
@@ -1613,7 +1613,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
case SPELLFAMILY_GENERIC:
|
||||
if (!caster)
|
||||
break;
|
||||
switch(GetId())
|
||||
switch (GetId())
|
||||
{
|
||||
case 61987: // Avenging Wrath
|
||||
// Remove the immunity shield marker on Avenging Wrath removal if Forbearance is not present
|
||||
@@ -2010,7 +2010,7 @@ bool Aura::IsAuraStronger(Aura const* newAura) const
|
||||
return true;
|
||||
|
||||
if (curValue == std::abs(newEffect->GetAmount()))
|
||||
if(!IsPassive() && !IsPermanent() && GetDuration() < newAura->GetDuration())
|
||||
if (!IsPassive() && !IsPermanent() && GetDuration() < newAura->GetDuration())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3069,7 +3069,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
|
||||
{
|
||||
// for delayed spells ignore negative spells (after duel end) for friendly targets
|
||||
/// @todo: this cause soul transfer bugged
|
||||
if(!IsTriggered() && m_spellInfo->Speed > 0.0f && unit->IsPlayer() && !m_spellInfo->IsPositive())
|
||||
if (!IsTriggered() && m_spellInfo->Speed > 0.0f && unit->IsPlayer() && !m_spellInfo->IsPositive())
|
||||
return SPELL_MISS_EVADE;
|
||||
|
||||
// assisting case, healing and resurrection
|
||||
@@ -3248,7 +3248,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
|
||||
HandleEffects(unit, nullptr, nullptr, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
}
|
||||
|
||||
if( sanct_effect >= 0 && (effectMask & (1 << sanct_effect)) )
|
||||
if (sanct_effect >= 0 && (effectMask & (1 << sanct_effect)))
|
||||
HandleEffects(unit, nullptr, nullptr, sanct_effect, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
|
||||
return SPELL_MISS_NONE;
|
||||
@@ -3275,7 +3275,7 @@ void Spell::DoTriggersOnSpellHit(Unit* unit, uint8 effMask)
|
||||
m_caster->CastSpell(unit, 61988, true);
|
||||
|
||||
// Fearie Fire (Feral) - damage
|
||||
if( m_preCastSpell == 60089 )
|
||||
if (m_preCastSpell == 60089)
|
||||
m_caster->CastSpell(unit, m_preCastSpell, true);
|
||||
else if (sSpellMgr->GetSpellInfo(m_preCastSpell))
|
||||
// Blizz seems to just apply aura without bothering to cast
|
||||
@@ -6540,24 +6540,24 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
}
|
||||
case SPELL_EFFECT_STEAL_BENEFICIAL_BUFF:
|
||||
{
|
||||
if( !m_targets.GetUnitTarget() || m_targets.GetUnitTarget() == m_caster)
|
||||
if (!m_targets.GetUnitTarget() || m_targets.GetUnitTarget() == m_caster)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
bool found = false;
|
||||
Unit::VisibleAuraMap const* visibleAuras = m_targets.GetUnitTarget()->GetVisibleAuras();
|
||||
for(Unit::VisibleAuraMap::const_iterator itr = visibleAuras->begin(); itr != visibleAuras->end(); ++itr)
|
||||
{
|
||||
if( itr->second->GetBase()->IsPassive() )
|
||||
if (itr->second->GetBase()->IsPassive())
|
||||
continue;
|
||||
|
||||
if( !itr->second->IsPositive() )
|
||||
if (!itr->second->IsPositive())
|
||||
continue;
|
||||
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if( !found )
|
||||
if (!found)
|
||||
return SPELL_FAILED_NOTHING_TO_STEAL;
|
||||
|
||||
break;
|
||||
@@ -8757,17 +8757,17 @@ void Spell::PrepareTriggersExecutedOnHit()
|
||||
{
|
||||
case SPELLFAMILY_PALADIN:
|
||||
{
|
||||
if( m_spellInfo->SpellFamilyFlags[1] & 0x40000000 )
|
||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x40000000)
|
||||
{
|
||||
Unit::AuraEffectList const& mVindication = m_caster->GetAuraEffectsByType(SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
for(Unit::AuraEffectList::const_iterator itr = mVindication.begin(); itr != mVindication.end(); ++itr)
|
||||
{
|
||||
if( (*itr)->GetSpellInfo()->Effects[EFFECT_0].TriggerSpell == 26017 )
|
||||
if ((*itr)->GetSpellInfo()->Effects[EFFECT_0].TriggerSpell == 26017 )
|
||||
{
|
||||
m_preCastSpell = 26017;
|
||||
break;
|
||||
}
|
||||
else if( (*itr)->GetSpellInfo()->Effects[EFFECT_0].TriggerSpell == 67 )
|
||||
else if ((*itr)->GetSpellInfo()->Effects[EFFECT_0].TriggerSpell == 67 )
|
||||
m_preCastSpell = 67;
|
||||
}
|
||||
}
|
||||
@@ -8776,7 +8776,7 @@ void Spell::PrepareTriggersExecutedOnHit()
|
||||
case SPELLFAMILY_DRUID:
|
||||
{
|
||||
// Faerie Fire (Feral)
|
||||
if( m_spellInfo->Id == 16857 && (m_caster->GetShapeshiftForm() == FORM_BEAR || m_caster->GetShapeshiftForm() == FORM_DIREBEAR) )
|
||||
if (m_spellInfo->Id == 16857 && (m_caster->GetShapeshiftForm() == FORM_BEAR || m_caster->GetShapeshiftForm() == FORM_DIREBEAR))
|
||||
m_preCastSpell = 60089;
|
||||
|
||||
break;
|
||||
|
||||
@@ -681,16 +681,16 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
// Trial of the Champion, Trample
|
||||
case 67866:
|
||||
{
|
||||
if( unitTarget && !unitTarget->IsVehicle() && !unitTarget->GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID) )
|
||||
if (unitTarget && !unitTarget->IsVehicle() && !unitTarget->GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID))
|
||||
unitTarget->CastSpell(unitTarget, 67867, false);
|
||||
return;
|
||||
}
|
||||
// Trial of the Champion, Hammer of the Righteous
|
||||
case 66867:
|
||||
{
|
||||
if( !unitTarget )
|
||||
if (!unitTarget)
|
||||
return;
|
||||
if( unitTarget->HasAura(66940) )
|
||||
if (unitTarget->HasAura(66940))
|
||||
m_caster->CastSpell(unitTarget, 66903, true);
|
||||
else
|
||||
m_caster->CastSpell(unitTarget, 66904, true);
|
||||
@@ -699,12 +699,12 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
case 17731:
|
||||
case 69294:
|
||||
{
|
||||
if( !gameObjTarget || gameObjTarget->GetRespawnTime() > GameTime::GetGameTime().count() )
|
||||
if (!gameObjTarget || gameObjTarget->GetRespawnTime() > GameTime::GetGameTime().count())
|
||||
return;
|
||||
|
||||
gameObjTarget->SetRespawnTime(10);
|
||||
gameObjTarget->SendCustomAnim(gameObjTarget->GetGoAnimProgress());
|
||||
if( Creature* trigger = gameObjTarget->SummonCreature(12758, *gameObjTarget, TEMPSUMMON_TIMED_DESPAWN, 1000) )
|
||||
if (Creature* trigger = gameObjTarget->SummonCreature(12758, *gameObjTarget, TEMPSUMMON_TIMED_DESPAWN, 1000))
|
||||
trigger->CastSpell(trigger, 17731, false);
|
||||
|
||||
return;
|
||||
@@ -712,7 +712,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
// HoL, Arc Weld
|
||||
case 59086:
|
||||
{
|
||||
if( m_caster && m_caster->IsPlayer() && m_caster->ToPlayer()->isMoving() )
|
||||
if (m_caster && m_caster->IsPlayer() && m_caster->ToPlayer()->isMoving())
|
||||
m_caster->CastSpell(m_caster, 59097, true);
|
||||
|
||||
return;
|
||||
@@ -753,7 +753,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
break;
|
||||
case SPELLFAMILY_ROGUE:
|
||||
// Hunger for Blood
|
||||
if( m_spellInfo->Id == 51662 )
|
||||
if (m_spellInfo->Id == 51662)
|
||||
{
|
||||
m_caster->CastSpell(m_caster, 63848, true);
|
||||
return;
|
||||
@@ -3126,7 +3126,7 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex)
|
||||
uint32 petentry = m_spellInfo->Effects[effIndex].MiscValue;
|
||||
int32 duration = m_spellInfo->GetDuration();
|
||||
|
||||
if(Player* modOwner = m_originalCaster->GetSpellModOwner())
|
||||
if (Player* modOwner = m_originalCaster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
|
||||
|
||||
Player* owner = m_originalCaster->ToPlayer();
|
||||
@@ -3448,7 +3448,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
|
||||
case SPELLFAMILY_HUNTER:
|
||||
{
|
||||
// Kill Shot
|
||||
if( m_spellInfo->SpellFamilyFlags[1] & 0x800000 )
|
||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x800000)
|
||||
{
|
||||
spell_bonus += int32(m_caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.4f);
|
||||
}
|
||||
@@ -3469,7 +3469,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
|
||||
{
|
||||
float disease_amt = m_spellInfo->Effects[EFFECT_2].CalcValue();
|
||||
//Death Knight T8 Melee 4P Bonus
|
||||
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736) )
|
||||
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736))
|
||||
AddPct(disease_amt, aurEff->GetAmount());
|
||||
|
||||
AddPct(totalDamagePercentMod, disease_amt * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) / 2.0f);
|
||||
@@ -3501,7 +3501,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
|
||||
|
||||
float disease_amt = m_spellInfo->Effects[EFFECT_2].CalcValue();
|
||||
//Death Knight T8 Melee 4P Bonus
|
||||
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736) )
|
||||
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736))
|
||||
AddPct(disease_amt, aurEff->GetAmount());
|
||||
|
||||
AddPct(totalDamagePercentMod, disease_amt * unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), consumeDiseases) / 2.0f);
|
||||
@@ -3520,7 +3520,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
|
||||
{
|
||||
float disease_amt = m_spellInfo->Effects[EFFECT_2].CalcValue();
|
||||
//Death Knight T8 Melee 4P Bonus
|
||||
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736) )
|
||||
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736))
|
||||
AddPct(disease_amt, aurEff->GetAmount());
|
||||
|
||||
AddPct(totalDamagePercentMod, disease_amt * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()));
|
||||
@@ -3945,7 +3945,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
}
|
||||
case 61263: // for item Intravenous Healing Potion (44698)
|
||||
{
|
||||
if( !m_caster || !unitTarget )
|
||||
if (!m_caster || !unitTarget)
|
||||
return;
|
||||
|
||||
m_caster->CastSpell(m_caster, 61267, true);
|
||||
@@ -3957,16 +3957,16 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
}
|
||||
case SPELLFAMILY_ROGUE:
|
||||
{
|
||||
switch( m_spellInfo->Id )
|
||||
switch (m_spellInfo->Id)
|
||||
{
|
||||
// Master of Subtlety
|
||||
case 31666:
|
||||
{
|
||||
if( !unitTarget )
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
Aura* mos = unitTarget->GetAura(31665);
|
||||
if( mos )
|
||||
if (mos)
|
||||
{
|
||||
mos->SetMaxDuration(6000);
|
||||
mos->SetDuration(6000, true);
|
||||
@@ -3977,11 +3977,11 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
// Overkill
|
||||
case 58428:
|
||||
{
|
||||
if( !unitTarget )
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
Aura* overkill = unitTarget->GetAura(58427);
|
||||
if( overkill )
|
||||
if (overkill)
|
||||
{
|
||||
overkill->SetMaxDuration(20000);
|
||||
overkill->SetDuration(20000, true);
|
||||
|
||||
@@ -3038,7 +3038,7 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
|
||||
{
|
||||
if (spellInfo->Effects[j].Effect)
|
||||
{
|
||||
switch(spellInfo->Effects[j].Effect)
|
||||
switch (spellInfo->Effects[j].Effect)
|
||||
{
|
||||
case SPELL_EFFECT_SCHOOL_DAMAGE:
|
||||
case SPELL_EFFECT_WEAPON_DAMAGE:
|
||||
@@ -3503,7 +3503,7 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
|
||||
{
|
||||
if (spellInfo->Effects[j].ApplyAuraName && spellInfo->Effects[j].TriggerSpell)
|
||||
{
|
||||
switch(spellInfo->Effects[j].ApplyAuraName)
|
||||
switch (spellInfo->Effects[j].ApplyAuraName)
|
||||
{
|
||||
case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
|
||||
case SPELL_AURA_PERIODIC_TRIGGER_SPELL_FROM_CLIENT:
|
||||
|
||||
Reference in New Issue
Block a user