mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 23:26:23 +00:00
chore(Core/Misc): Some cleanup (#19970)
* remove weird blanks * update if * ) ) to )) * missed some ) ) * now switch * .
This commit is contained in:
@@ -3609,10 +3609,10 @@ float Creature::GetAttackDistance(Unit const* player) const
|
||||
if (creatureLevel + 5 <= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
// detect range auras
|
||||
retDistance += static_cast<float>( GetTotalAuraModifier(SPELL_AURA_MOD_DETECT_RANGE) );
|
||||
retDistance += static_cast<float>( GetTotalAuraModifier(SPELL_AURA_MOD_DETECT_RANGE));
|
||||
|
||||
// detected range auras
|
||||
retDistance += static_cast<float>( player->GetTotalAuraModifier(SPELL_AURA_MOD_DETECTED_RANGE) );
|
||||
retDistance += static_cast<float>( player->GetTotalAuraModifier(SPELL_AURA_MOD_DETECTED_RANGE));
|
||||
}
|
||||
|
||||
// "Minimum Aggro Radius for a mob seems to be combat range (5 yards)"
|
||||
|
||||
@@ -1175,7 +1175,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)));
|
||||
}
|
||||
|
||||
switch(GetEntry())
|
||||
switch (GetEntry())
|
||||
{
|
||||
case NPC_FELGUARD:
|
||||
{
|
||||
|
||||
@@ -4684,7 +4684,7 @@ void Player::DurabilityLossAll(double percent, bool inventory)
|
||||
|
||||
void Player::DurabilityLoss(Item* item, double percent)
|
||||
{
|
||||
if(!item || percent == 0.0)
|
||||
if (!item || percent == 0.0)
|
||||
return;
|
||||
|
||||
uint32 pMaxDurability = item ->GetUInt32Value(ITEM_FIELD_MAXDURABILITY);
|
||||
@@ -10001,13 +10001,13 @@ void Player::RemoveSpellMods(Spell* spell)
|
||||
spell->m_appliedMods.erase(iterMod);
|
||||
|
||||
// MAGE T8P4 BONUS
|
||||
if( spellInfo->SpellFamilyName == SPELLFAMILY_MAGE )
|
||||
if (spellInfo->SpellFamilyName == SPELLFAMILY_MAGE)
|
||||
{
|
||||
SpellInfo const* sp = mod->ownerAura->GetSpellInfo();
|
||||
// Missile Barrage, Hot Streak, Brain Freeze (trigger spell - Fireball!)
|
||||
if( sp->SpellIconID == 3261 || sp->SpellIconID == 2999 || sp->SpellIconID == 2938 )
|
||||
if( AuraEffect* aurEff = GetAuraEffectDummy(64869) )
|
||||
if( roll_chance_i(aurEff->GetAmount()) )
|
||||
if (sp->SpellIconID == 3261 || sp->SpellIconID == 2999 || sp->SpellIconID == 2938)
|
||||
if (AuraEffect* aurEff = GetAuraEffectDummy(64869))
|
||||
if (roll_chance_i(aurEff->GetAmount()))
|
||||
{
|
||||
mod->charges = 1;
|
||||
continue;
|
||||
@@ -15443,7 +15443,7 @@ void Player::PrepareCharmAISpells()
|
||||
}
|
||||
else if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE)
|
||||
{
|
||||
if( (int32)periodic_damage < CalculateSpellDamage(this, spellInfo, i) )
|
||||
if ((int32)periodic_damage < CalculateSpellDamage(this, spellInfo, i))
|
||||
{
|
||||
m_charmAISpells[SPELL_DOT_DAMAGE] = spellInfo->Id;
|
||||
break;
|
||||
|
||||
@@ -294,7 +294,7 @@ bool Player::CanCompleteQuest(uint32 quest_id, const QuestStatusData* q_savedSta
|
||||
return false;
|
||||
|
||||
// Xinef: take seasonals into account
|
||||
if(!qInfo->IsRepeatable() && !qInfo->IsSeasonal() && IsQuestRewarded(quest_id))
|
||||
if (!qInfo->IsRepeatable() && !qInfo->IsSeasonal() && IsQuestRewarded(quest_id))
|
||||
return false; // not allow re-complete quest
|
||||
|
||||
// auto complete quest
|
||||
|
||||
@@ -991,7 +991,7 @@ InventoryResult Player::CanStoreItem_InBag(uint8 bag, ItemPosCountVec& dest, Ite
|
||||
|
||||
// skip not existed bag or self targeted bag
|
||||
Bag* pBag = GetBagByPos(bag);
|
||||
if (!pBag || pBag == pSrcItem || (pSrcItem && (pSrcItem->GetGUID() == pBag->GetGUID())) )
|
||||
if (!pBag || pBag == pSrcItem || (pSrcItem && (pSrcItem->GetGUID() == pBag->GetGUID())))
|
||||
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
|
||||
|
||||
if (pSrcItem && pSrcItem->IsNotEmptyBag())
|
||||
@@ -1119,8 +1119,8 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& des
|
||||
if (pItem)
|
||||
{
|
||||
// you bad chet0rz, wpe pro
|
||||
if( bag == NULL_BAG && slot == NULL_SLOT )
|
||||
if( pItem->IsBag() && pItem->IsNotEmptyBag() )
|
||||
if (bag == NULL_BAG && slot == NULL_SLOT)
|
||||
if (pItem->IsBag() && pItem->IsNotEmptyBag())
|
||||
return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS;
|
||||
|
||||
// Xinef: Removed next loot generated check
|
||||
@@ -7197,7 +7197,7 @@ void Player::_SaveAuras(CharacterDatabaseTransaction trans, bool logout)
|
||||
continue;
|
||||
|
||||
Aura* aura = itr->second;
|
||||
if( !logout && aura->GetDuration() < 60 * IN_MILLISECONDS )
|
||||
if (!logout && aura->GetDuration() < 60 * IN_MILLISECONDS )
|
||||
continue;
|
||||
|
||||
int32 damage[MAX_SPELL_EFFECTS];
|
||||
|
||||
@@ -237,7 +237,7 @@ void Player::UpdateResistances(uint32 school)
|
||||
AuraEffectList const& mResbyIntellect = GetAuraEffectsByType(SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT);
|
||||
for(AuraEffectList::const_iterator i = mResbyIntellect.begin(); i != mResbyIntellect.end(); ++i)
|
||||
{
|
||||
if((*i)->GetMiscValue() & (1 << (school - 1)) )
|
||||
if ((*i)->GetMiscValue() & (1 << (school - 1)))
|
||||
value += int32(GetStat(Stats((*i)->GetMiscValueB())) * (*i)->GetAmount() / 100.0f);
|
||||
}
|
||||
|
||||
@@ -923,7 +923,7 @@ void Player::ApplyHealthRegenBonus(int32 amount, bool apply)
|
||||
|
||||
void Player::UpdateManaRegen()
|
||||
{
|
||||
if( HasAuraTypeWithMiscvalue(SPELL_AURA_PREVENT_REGENERATE_POWER, POWER_MANA + 1) )
|
||||
if (HasAuraTypeWithMiscvalue(SPELL_AURA_PREVENT_REGENERATE_POWER, POWER_MANA + 1))
|
||||
{
|
||||
SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, 0);
|
||||
SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER, 0);
|
||||
|
||||
@@ -2772,7 +2772,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(Unit const* victim, WeaponAttackTy
|
||||
|
||||
// Critical hit chance
|
||||
float crit_chance = GetUnitCriticalChance(attType, victim);
|
||||
if( crit_chance < 0 )
|
||||
if (crit_chance < 0)
|
||||
crit_chance = 0;
|
||||
|
||||
float dodge_chance = victim->GetUnitDodgeChance();
|
||||
@@ -4956,7 +4956,7 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId
|
||||
if (Aura* noxious = Aura::TryCreate(aura->GetSpellInfo(), aura->GetEffectMask(), dispeller, caster))
|
||||
{
|
||||
noxious->SetDuration(aura->GetDuration() * aureff->GetAmount() / 100);
|
||||
if (aura->GetUnitOwner() )
|
||||
if (aura->GetUnitOwner())
|
||||
if (const std::vector<int32>* spell_triggered = sSpellMgr->GetSpellLinked(-int32(aura->GetId())))
|
||||
for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
|
||||
aura->GetUnitOwner()->RemoveAurasDueToSpell(*itr);
|
||||
@@ -5691,7 +5691,7 @@ bool Unit::HasVisibleAuraType(AuraType auraType) const
|
||||
{
|
||||
AuraEffectList const& mAuraList = GetAuraEffectsByType(auraType);
|
||||
for (AuraEffectList::const_iterator i = mAuraList.begin(); i != mAuraList.end(); ++i)
|
||||
if( (*i)->GetBase()->CanBeSentToClient() )
|
||||
if ((*i)->GetBase()->CanBeSentToClient())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -6221,7 +6221,7 @@ void Unit::RemoveGameObject(uint32 spellid, bool del)
|
||||
}
|
||||
|
||||
go->SetOwnerGUID(ObjectGuid::Empty);
|
||||
if(del)
|
||||
if (del)
|
||||
{
|
||||
go->SetRespawnTime(0);
|
||||
go->Delete();
|
||||
@@ -6236,7 +6236,7 @@ void Unit::RemoveAllGameObjects()
|
||||
while(!m_gameObj.empty())
|
||||
{
|
||||
GameObject* go = ObjectAccessor::GetGameObject(*this, *m_gameObj.begin());
|
||||
if(go)
|
||||
if (go)
|
||||
{
|
||||
go->SetOwnerGUID(ObjectGuid::Empty);
|
||||
go->SetRespawnTime(0);
|
||||
@@ -7537,7 +7537,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
}
|
||||
case SPELLFAMILY_ROGUE:
|
||||
{
|
||||
switch(dummySpell->Id)
|
||||
switch (dummySpell->Id)
|
||||
{
|
||||
// Glyph of Backstab
|
||||
case 56800:
|
||||
@@ -7546,7 +7546,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
if (AuraEffect* aurEff = victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x100000, 0, 0, GetGUID()))
|
||||
if (Aura* aur = aurEff->GetBase())
|
||||
if (!aur->IsRemoved() && aur->GetDuration() > 0)
|
||||
if ((aur->GetApplyTime() + aur->GetMaxDuration() / 1000 + 5) > (GameTime::GetGameTime().count() + aur->GetDuration() / 1000) )
|
||||
if ((aur->GetApplyTime() + aur->GetMaxDuration() / 1000 + 5) > (GameTime::GetGameTime().count() + aur->GetDuration() / 1000))
|
||||
{
|
||||
aur->SetDuration(aur->GetDuration() + 2000);
|
||||
return true;
|
||||
@@ -7565,7 +7565,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
}
|
||||
}
|
||||
// Master of subtlety
|
||||
if( dummySpell->SpellIconID == 2114 )
|
||||
if (dummySpell->SpellIconID == 2114)
|
||||
{
|
||||
triggered_spell_id = 31665;
|
||||
basepoints0 = triggerAmount;
|
||||
@@ -8317,7 +8317,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
// Lightning Overload
|
||||
if (dummySpell->SpellIconID == 2018) // only this spell have SpellFamily Shaman SpellIconID == 2018 and dummy aura
|
||||
{
|
||||
if(!procSpell || !IsPlayer() || !victim)
|
||||
if (!procSpell || !IsPlayer() || !victim)
|
||||
return false;
|
||||
|
||||
if (procEx & PROC_EX_CRITICAL_HIT)
|
||||
@@ -8548,7 +8548,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
basepoints0 = triggerEntry->Effects[EFFECT_0].BasePoints * 2;
|
||||
|
||||
SetCantProc(true);
|
||||
if(basepoints0)
|
||||
if (basepoints0)
|
||||
CastCustomSpell(target, triggered_spell_id, &basepoints0, nullptr, nullptr, true, castItem, triggeredByAura, originalCaster);
|
||||
else
|
||||
CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura, originalCaster);
|
||||
@@ -8688,7 +8688,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
AddSpellCooldown(cooldown_spell_id, 0, cooldown);
|
||||
}
|
||||
|
||||
if(basepoints0)
|
||||
if (basepoints0)
|
||||
CastCustomSpell(target, triggered_spell_id, &basepoints0, nullptr, nullptr, true, castItem, triggeredByAura, originalCaster);
|
||||
else
|
||||
CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura, originalCaster);
|
||||
@@ -9586,7 +9586,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
{
|
||||
if (cooldown)
|
||||
{
|
||||
if (pTarget->HasSpellCooldown(trigger_spell_id) )
|
||||
if (pTarget->HasSpellCooldown(trigger_spell_id))
|
||||
return false;
|
||||
pTarget->AddSpellCooldown(trigger_spell_id, 0, cooldown);
|
||||
}
|
||||
@@ -9622,7 +9622,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
// Ruby Drake, Evasive Aura
|
||||
case 50241:
|
||||
{
|
||||
if( GetAura(50240) )
|
||||
if (GetAura(50240))
|
||||
return false;
|
||||
|
||||
break;
|
||||
@@ -9812,7 +9812,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
AddSpellCooldown(triggerEntry->Id, 0, cooldown);
|
||||
}
|
||||
|
||||
if(basepoints0)
|
||||
if (basepoints0)
|
||||
CastCustomSpell(target, triggerEntry->Id, &basepoints0, nullptr, nullptr, true, castItem, triggeredByAura);
|
||||
else
|
||||
CastSpell(target, triggerEntry->Id, true, castItem, triggeredByAura);
|
||||
@@ -10466,11 +10466,11 @@ void Unit::ModifyAuraState(AuraStateType flag, bool apply)
|
||||
Unit::AuraMap& tAuras = GetOwnedAuras();
|
||||
for (Unit::AuraMap::iterator itr = tAuras.begin(); itr != tAuras.end(); ++itr)
|
||||
{
|
||||
if( (*itr).second->IsRemoved() )
|
||||
if ((*itr).second->IsRemoved())
|
||||
continue;
|
||||
|
||||
if( (*itr).second->GetSpellInfo()->CasterAuraState == flag )
|
||||
if( AuraApplication* aurApp = (*itr).second->GetApplicationOfTarget(GetGUID()) )
|
||||
if ((*itr).second->GetSpellInfo()->CasterAuraState == flag )
|
||||
if (AuraApplication* aurApp = (*itr).second->GetApplicationOfTarget(GetGUID()))
|
||||
(*itr).second->HandleAllEffects(aurApp, AURA_EFFECT_HANDLE_REAL, true);
|
||||
}
|
||||
}
|
||||
@@ -10486,8 +10486,8 @@ void Unit::ModifyAuraState(AuraStateType flag, bool apply)
|
||||
Unit::AuraMap& tAuras = GetOwnedAuras();
|
||||
for (Unit::AuraMap::iterator itr = tAuras.begin(); itr != tAuras.end(); ++itr)
|
||||
{
|
||||
if( (*itr).second->GetSpellInfo()->CasterAuraState == flag )
|
||||
if( AuraApplication* aurApp = (*itr).second->GetApplicationOfTarget(GetGUID()) )
|
||||
if ((*itr).second->GetSpellInfo()->CasterAuraState == flag )
|
||||
if (AuraApplication* aurApp = (*itr).second->GetApplicationOfTarget(GetGUID()))
|
||||
(*itr).second->HandleAllEffects(aurApp, AURA_EFFECT_HANDLE_REAL, false);
|
||||
}
|
||||
}
|
||||
@@ -11383,7 +11383,7 @@ float Unit::SpellPctDamageModsDone(Unit* victim, SpellInfo const* spellProto, Da
|
||||
// Merciless Combat
|
||||
if ((*i)->GetSpellInfo()->SpellIconID == 2656)
|
||||
{
|
||||
if( (spellProto && spellProto->SpellFamilyFlags[0] & 0x2) || spellProto->SpellFamilyFlags[1] & 0x2 )
|
||||
if ((spellProto && spellProto->SpellFamilyFlags[0] & 0x2) || spellProto->SpellFamilyFlags[1] & 0x2 )
|
||||
if (!victim->HealthAbovePct(35))
|
||||
AddPct(DoneTotalMod, (*i)->GetAmount());
|
||||
}
|
||||
@@ -12463,7 +12463,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
|
||||
|
||||
// Check for table values
|
||||
SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id);
|
||||
if(bonus)
|
||||
if (bonus)
|
||||
{
|
||||
if (damagetype == DOT)
|
||||
{
|
||||
@@ -12711,7 +12711,7 @@ bool Unit::IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const
|
||||
// If m_immuneToDamage type contain magic, IMMUNE damage.
|
||||
SpellImmuneList const& damageList = m_spellImmune[IMMUNITY_DAMAGE];
|
||||
for (SpellImmuneList::const_iterator itr = damageList.begin(); itr != damageList.end(); ++itr)
|
||||
if((itr->type & meleeSchoolMask) == meleeSchoolMask)
|
||||
if ((itr->type & meleeSchoolMask) == meleeSchoolMask)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -12743,7 +12743,7 @@ bool Unit::IsImmunedToDamage(SpellInfo const* spellInfo) const
|
||||
// If m_immuneToDamage type contain magic, IMMUNE damage.
|
||||
SpellImmuneList const& damageList = m_spellImmune[IMMUNITY_DAMAGE];
|
||||
for (SpellImmuneList::const_iterator itr = damageList.begin(); itr != damageList.end(); ++itr)
|
||||
if((itr->type & schoolMask) == schoolMask)
|
||||
if ((itr->type & schoolMask) == schoolMask)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -12796,7 +12796,7 @@ bool Unit::IsImmunedToSchool(SpellSchoolMask meleeSchoolMask) const
|
||||
// If m_immuneToSchool type contain this school type, IMMUNE damage.
|
||||
SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
|
||||
for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
|
||||
if((itr->type & meleeSchoolMask) == meleeSchoolMask)
|
||||
if ((itr->type & meleeSchoolMask) == meleeSchoolMask)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -12818,7 +12818,7 @@ bool Unit::IsImmunedToSchool(SpellInfo const* spellInfo) const
|
||||
// If m_immuneToSchool type contain this school type, IMMUNE damage.
|
||||
SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
|
||||
for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
|
||||
if((itr->type & schoolMask) == schoolMask && !spellInfo->CanPierceImmuneAura(sSpellMgr->GetSpellInfo(itr->spellId)))
|
||||
if ((itr->type & schoolMask) == schoolMask && !spellInfo->CanPierceImmuneAura(sSpellMgr->GetSpellInfo(itr->spellId)))
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -13897,7 +13897,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
|
||||
{
|
||||
Player* owner = GetAffectingPlayer();
|
||||
Unit const* const thisUnit = owner ? owner : this;
|
||||
if (!(target->IsPlayer() && thisUnit->IsPlayer()) &&
|
||||
if (!(target->IsPlayer() && thisUnit->IsPlayer()) &&
|
||||
!(target->IsCreature() && thisUnit->IsCreature()))
|
||||
{
|
||||
Player const* player = target->IsPlayer() ? target->ToPlayer() : thisUnit->ToPlayer();
|
||||
@@ -15385,7 +15385,7 @@ float Unit::GetTotalAttackPowerValue(WeaponAttackType attType, Unit* victim) con
|
||||
if (attType == RANGED_ATTACK)
|
||||
{
|
||||
int32 ap = GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER_MODS);
|
||||
if( victim )
|
||||
if (victim)
|
||||
ap += victim->GetTotalAuraModifier(SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS);
|
||||
|
||||
if (ap < 0)
|
||||
@@ -15395,7 +15395,7 @@ float Unit::GetTotalAttackPowerValue(WeaponAttackType attType, Unit* victim) con
|
||||
else
|
||||
{
|
||||
int32 ap = GetInt32Value(UNIT_FIELD_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_ATTACK_POWER_MODS);
|
||||
if( victim )
|
||||
if (victim)
|
||||
ap += victim->GetTotalAuraModifier(SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS);
|
||||
|
||||
if (ap < 0)
|
||||
|
||||
Reference in New Issue
Block a user