mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +01:00
Core/Spells: Implement SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER
Correct variable names / comments for SPELL_AURA_BYPASS_ARMOR_FOR_CASTER
This commit is contained in:
@@ -1490,13 +1490,13 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo
|
||||
uint32 newdamage = 0;
|
||||
float armor = float(victim->GetArmor());
|
||||
|
||||
// bypass enemy armor effectiveness by SPELL_AURA_BYPASS_ARMOR_FOR_CASTER
|
||||
int32 auraEffectivenessReduction = 0;
|
||||
// bypass enemy armor by SPELL_AURA_BYPASS_ARMOR_FOR_CASTER
|
||||
int32 armorBypassPct = 0;
|
||||
AuraEffectList const & reductionAuras = victim->GetAuraEffectsByType(SPELL_AURA_BYPASS_ARMOR_FOR_CASTER);
|
||||
for (AuraEffectList::const_iterator i = reductionAuras.begin(); i != reductionAuras.end(); ++i)
|
||||
if ((*i)->GetCasterGUID() == GetGUID())
|
||||
auraEffectivenessReduction += (*i)->GetAmount();
|
||||
armor = CalculatePctN(armor, 100 - std::min(auraEffectivenessReduction, 100));
|
||||
armorBypassPct += (*i)->GetAmount();
|
||||
armor = CalculatePctN(armor, 100 - std::min(armorBypassPct, 100));
|
||||
|
||||
// Ignore enemy armor by SPELL_AURA_MOD_TARGET_RESISTANCE aura
|
||||
armor += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, SPELL_SCHOOL_MASK_NORMAL);
|
||||
@@ -11025,6 +11025,11 @@ bool Unit::isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMas
|
||||
if (Player* modOwner = GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CRITICAL_CHANCE, crit_chance);
|
||||
|
||||
AuraEffectList const& critAuras = victim->GetAuraEffectsByType(SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER);
|
||||
for (AuraEffectList::const_iterator i = critAuras.begin(); i != critAuras.end(); ++i)
|
||||
if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectedOnSpell(spellProto))
|
||||
crit_chance += (*i)->GetAmount();
|
||||
|
||||
crit_chance = crit_chance > 0.0f ? crit_chance : 0.0f;
|
||||
if (roll_chance_f(crit_chance))
|
||||
return true;
|
||||
|
||||
@@ -367,7 +367,7 @@ enum AuraType
|
||||
SPELL_AURA_MOD_MINIMUM_SPEED = 305,
|
||||
SPELL_AURA_306 = 306,
|
||||
SPELL_AURA_HEAL_ABSORB_TEST = 307,
|
||||
SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER = 308, // NYI
|
||||
SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER = 308,
|
||||
SPELL_AURA_309 = 309,
|
||||
SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE = 310,
|
||||
SPELL_AURA_311 = 311,
|
||||
|
||||
Reference in New Issue
Block a user