Merge branch 'master' into 4.x
Conflicts: src/server/game/Spells/Auras/SpellAuraEffects.h
This commit is contained in:
commit
ed55fc3567
11 files changed
+111
-74
No files matched your search
@@ -1520,44 +1520,36 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo
|
||||
armor = floor(AddPctN(armor, -(*j)->GetAmount()));
|
||||
}
|
||||
|
||||
// Apply Player CR_ARMOR_PENETRATION rating and buffs from stances\specializations etc.
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
AuraEffectList const& ArPenAuras = GetAuraEffectsByType(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT);
|
||||
for (AuraEffectList::const_iterator itr = ArPenAuras.begin(); itr != ArPenAuras.end(); ++itr)
|
||||
float bonusPct = 0;
|
||||
AuraEffectList const& ResIgnoreAuras = GetAuraEffectsByType(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT);
|
||||
for (AuraEffectList::const_iterator itr = ResIgnoreAuras.begin(); itr != ResIgnoreAuras.end(); ++itr)
|
||||
{
|
||||
// item neutral spell
|
||||
if ((*itr)->GetSpellInfo()->EquippedItemClass == -1)
|
||||
{
|
||||
armor = floor(AddPctN(armor, -(*itr)->GetAmount()));
|
||||
continue;
|
||||
if (!spellInfo || (*itr)->IsAffectedOnSpell(spellInfo) || (*itr)->GetMiscValue() & spellInfo->GetSchoolMask())
|
||||
bonusPct += (*itr)->GetAmount();
|
||||
else if (!(*itr)->GetMiscValue() && !(*itr)->HasSpellClassMask())
|
||||
bonusPct += (*itr)->GetAmount();
|
||||
}
|
||||
|
||||
// item dependent spell - check current weapons
|
||||
for (int i = 0; i < MAX_ATTACK; ++i)
|
||||
else
|
||||
{
|
||||
Item* weapon = ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true);
|
||||
|
||||
if (weapon && weapon->IsFitToSpellRequirements((*itr)->GetSpellInfo()))
|
||||
{
|
||||
armor = floor(AddPctN(armor, -(*itr)->GetAmount()));
|
||||
break;
|
||||
}
|
||||
if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*itr)->GetSpellInfo()))
|
||||
bonusPct += (*itr)->GetAmount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Apply Player CR_ARMOR_PENETRATION rating
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
float maxArmorPen = 0;
|
||||
if (getLevel() < 60)
|
||||
if (victim->getLevel() < 60)
|
||||
maxArmorPen = float(400 + 85 * victim->getLevel());
|
||||
else
|
||||
maxArmorPen = 400 + 85 * victim->getLevel() + 4.5f * 85 * (victim->getLevel() - 59);
|
||||
// Cap armor penetration to this number
|
||||
maxArmorPen = std::min((armor + maxArmorPen) / 3, armor);
|
||||
// Figure out how much armor do we ignore
|
||||
float armorPen = CalculatePctF(maxArmorPen, ToPlayer()->GetRatingBonusValue(CR_ARMOR_PENETRATION));
|
||||
float armorPen = CalculatePctF(maxArmorPen, bonusPct + ToPlayer()->GetRatingBonusValue(CR_ARMOR_PENETRATION));
|
||||
// Got the value, apply it
|
||||
armor -= std::min(armorPen, maxArmorPen);
|
||||
}
|
||||
@@ -10905,12 +10897,6 @@ bool Unit::isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMas
|
||||
if (victim->HasAura(6788))
|
||||
crit_chance+=(*i)->GetAmount();
|
||||
break;
|
||||
case 21: // Test of Faith
|
||||
case 6935:
|
||||
case 6918:
|
||||
if (victim->HealthBelowPct(50))
|
||||
crit_chance+=(*i)->GetAmount();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -11140,11 +11126,6 @@ uint32 Unit::SpellHealingBonus(Unit* victim, SpellInfo const* spellProto, uint32
|
||||
case 3736: // Hateful Totem of the Third Wind / Increased Lesser Healing Wave / LK Arena (4/5/6) Totem of the Third Wind / Savage Totem of the Third Wind
|
||||
DoneTotal += (*i)->GetAmount();
|
||||
break;
|
||||
case 7997: // Renewed Hope
|
||||
case 7998:
|
||||
if (victim->HasAura(6788))
|
||||
AddPctN(DoneTotalMod, (*i)->GetAmount());
|
||||
break;
|
||||
case 21: // Test of Faith
|
||||
case 6935:
|
||||
case 6918:
|
||||
@@ -11785,23 +11766,6 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT
|
||||
AddPctF(TakenTotalMod, std::max(mod, float((*i)->GetAmount())));
|
||||
}
|
||||
break;
|
||||
// Blessing of Sanctuary
|
||||
// Greater Blessing of Sanctuary
|
||||
case 19:
|
||||
case 1804:
|
||||
{
|
||||
if ((*i)->GetSpellInfo()->SpellFamilyName != SPELLFAMILY_PALADIN)
|
||||
continue;
|
||||
|
||||
if ((*i)->GetMiscValue() & (spellProto ? spellProto->GetSchoolMask() : 0))
|
||||
AddPctN(TakenTotalMod, (*i)->GetAmount());
|
||||
break;
|
||||
}
|
||||
// Ebon Plague
|
||||
case 1933:
|
||||
if ((*i)->GetMiscValue() & (spellProto ? spellProto->GetSchoolMask() : 0))
|
||||
AddPctN(TakenTotalMod, (*i)->GetAmount());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user