*Fix aura type 280.
--HG-- branch : trunk
This commit is contained in:
+35
-1
@@ -4999,6 +4999,8 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply)
|
||||
}
|
||||
break;
|
||||
case CR_ARMOR_PENETRATION:
|
||||
if(affectStats)
|
||||
UpdateArmorPenetration(amount);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -10625,10 +10627,22 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update )
|
||||
|
||||
ApplyEquipCooldown(pItem);
|
||||
|
||||
// update expertise and armor penetration - passive auras may need it
|
||||
|
||||
if( slot == EQUIPMENT_SLOT_MAINHAND )
|
||||
UpdateExpertise(BASE_ATTACK);
|
||||
else if( slot == EQUIPMENT_SLOT_OFFHAND )
|
||||
UpdateExpertise(OFF_ATTACK);
|
||||
|
||||
switch(slot)
|
||||
{
|
||||
case EQUIPMENT_SLOT_MAINHAND:
|
||||
case EQUIPMENT_SLOT_OFFHAND:
|
||||
case EQUIPMENT_SLOT_RANGED:
|
||||
RecalculateRating(CR_ARMOR_PENETRATION);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -10771,6 +10785,16 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update )
|
||||
}
|
||||
else if( slot == EQUIPMENT_SLOT_OFFHAND )
|
||||
UpdateExpertise(OFF_ATTACK);
|
||||
// update armor penetration - passive auras may need it
|
||||
switch(slot)
|
||||
{
|
||||
case EQUIPMENT_SLOT_MAINHAND:
|
||||
case EQUIPMENT_SLOT_OFFHAND:
|
||||
case EQUIPMENT_SLOT_RANGED:
|
||||
RecalculateRating(CR_ARMOR_PENETRATION);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// need update known currency
|
||||
@@ -10878,7 +10902,17 @@ void Player::DestroyItem( uint8 bag, uint8 slot, bool update )
|
||||
// remove item dependent auras and casts (only weapon and armor slots)
|
||||
RemoveItemDependentAurasAndCasts(pItem);
|
||||
|
||||
// update expertise
|
||||
// update expertise and armor penetration - passive auras may need it
|
||||
switch(slot)
|
||||
{
|
||||
case EQUIPMENT_SLOT_MAINHAND:
|
||||
case EQUIPMENT_SLOT_OFFHAND:
|
||||
case EQUIPMENT_SLOT_RANGED:
|
||||
RecalculateRating(CR_ARMOR_PENETRATION);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if ( slot == EQUIPMENT_SLOT_MAINHAND )
|
||||
UpdateExpertise(BASE_ATTACK);
|
||||
else if( slot == EQUIPMENT_SLOT_OFFHAND )
|
||||
|
||||
@@ -1556,6 +1556,7 @@ class TRINITY_DLL_SPEC Player : public Unit
|
||||
|
||||
void UpdateDefenseBonusesMod();
|
||||
void ApplyRatingMod(CombatRating cr, int32 value, bool apply);
|
||||
inline void RecalculateRating(CombatRating cr) { ApplyRatingMod(cr, 0, true);}
|
||||
float GetMeleeCritFromAgility();
|
||||
float GetDodgeFromAgility();
|
||||
float GetSpellCritFromIntellect();
|
||||
@@ -1582,6 +1583,7 @@ class TRINITY_DLL_SPEC Player : public Unit
|
||||
|
||||
void UpdateAllSpellCritChances();
|
||||
void UpdateSpellCritChance(uint32 school);
|
||||
void UpdateArmorPenetration(int32 amount);
|
||||
void UpdateExpertise(WeaponAttackType attType);
|
||||
void ApplyManaRegenBonus(int32 amount, bool apply);
|
||||
void UpdateManaRegen();
|
||||
|
||||
@@ -325,7 +325,7 @@ enum AuraType
|
||||
SPELL_AURA_MOD_MAX_AFFECTED_TARGETS = 277,
|
||||
SPELL_AURA_MOD_DISARM_RANGED = 278,
|
||||
SPELL_AURA_279 = 279,
|
||||
SPELL_AURA_MOD_WEAPONTYPE_IGNORE_TARGET_RESISTANCE = 280,
|
||||
SPELL_AURA_MOD_ARMOR_PENETRATION_PCT = 280,
|
||||
SPELL_AURA_MOD_HONOR_GAIN_PCT = 281,
|
||||
SPELL_AURA_MOD_BASE_HEALTH_PCT = 282,
|
||||
SPELL_AURA_MOD_HEALING_RECEIVED = 283, // Possibly only for some spell family class spells
|
||||
|
||||
+10
-2
@@ -333,7 +333,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
|
||||
&Aura::HandleNoImmediateEffect, //277 SPELL_AURA_MOD_ABILITY_AFFECTED_TARGETS implemented in spell::settargetmap
|
||||
&Aura::HandleAuraModDisarm, //278 SPELL_AURA_MOD_DISARM_RANGED disarm ranged weapon
|
||||
&Aura::HandleNULL, //279 visual effects? 58836 and 57507
|
||||
&Aura::HandleNoImmediateEffect, //280 SPELL_AURA_MOD_WEAPONTYPE_IGNORE_TARGET_RESISTANCE
|
||||
&Aura::HandleModArmorPenetrationPct, //280 SPELL_AURA_MOD_ARMOR_PENETRATION_PCT
|
||||
&Aura::HandleNoImmediateEffect, //281 SPELL_AURA_MOD_HONOR_GAIN_PCT implemented in Player::RewardHonor
|
||||
&Aura::HandleAuraIncreaseBaseHealthPercent, //282 SPELL_AURA_INCREASE_BASE_HEALTH_PERCENT
|
||||
&Aura::HandleNoImmediateEffect, //283 SPELL_AURA_MOD_HEALING_RECEIVED implemented in Unit::SpellHealingBonus
|
||||
@@ -5728,7 +5728,7 @@ void AuraEffect::HandleForceMoveForward(bool apply, bool Real, bool /*changeAmou
|
||||
m_target->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FORCE_MOVE);
|
||||
}
|
||||
|
||||
void AuraEffect::HandleAuraModExpertise(bool /*apply*/, bool Real, bool /*changeAmount*/)
|
||||
void AuraEffect::HandleAuraModExpertise(bool /*apply*/, bool Real, bool changeAmount)
|
||||
{
|
||||
if(m_target->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
@@ -7272,6 +7272,14 @@ void AuraEffect::HandleAuraSafeFall( bool Apply, bool Real , bool /*changeAmount
|
||||
((Player*)m_target)->ActivateTaxiPathTo(506,GetId());
|
||||
}
|
||||
|
||||
void AuraEffect::HandleModArmorPenetrationPct(bool apply, bool Real, bool changeAmount)
|
||||
{
|
||||
if(m_target->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
((Player*)m_target)->RecalculateRating(CR_ARMOR_PENETRATION);
|
||||
}
|
||||
|
||||
void AuraEffect::HandleReflectSpells( bool Apply, bool Real , bool /*changeAmount*/)
|
||||
{
|
||||
// implemented in Unit::SpellHitResult
|
||||
|
||||
@@ -332,6 +332,7 @@ class TRINITY_DLL_SPEC AuraEffect
|
||||
void HandleAuraAllowOnlyAbility(bool apply, bool Real, bool changeAmount);
|
||||
void HandleCharmConvert(bool apply, bool Real, bool changeAmount);
|
||||
void HandleReflectSpells( bool Apply, bool Real , bool changeAmount);
|
||||
void HandleModArmorPenetrationPct(bool Apply, bool Real, bool changeAmount);
|
||||
|
||||
// add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras
|
||||
void HandleShapeshiftBoosts(bool apply);
|
||||
|
||||
@@ -4332,7 +4332,7 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
|
||||
if (roll_chance_i(aurEff->GetAmount()))
|
||||
consumeDiseases = false;
|
||||
}
|
||||
totalDamagePercentMod *= (float(CalculateDamage(2, unitTarget) * unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), consumeDiseases) / 2) + 100.0f) / 100.f;
|
||||
totalDamagePercentMod *= (float(CalculateDamage(2, unitTarget) * unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), consumeDiseases) / 2) + 100.0f) / 100.0f;
|
||||
}
|
||||
// Blood-Caked Strike - Blood-Caked Blade // Blood Strike
|
||||
else if (m_spellInfo->SpellIconID == 1736 || m_spellInfo->SpellFamilyFlags[0] & 0x400000)
|
||||
|
||||
@@ -160,6 +160,7 @@ bool Player::UpdateAllStats()
|
||||
UpdateManaRegen();
|
||||
UpdateExpertise(BASE_ATTACK);
|
||||
UpdateExpertise(OFF_ATTACK);
|
||||
RecalculateRating(CR_ARMOR_PENETRATION);
|
||||
for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
|
||||
UpdateResistances(i);
|
||||
|
||||
@@ -618,6 +619,35 @@ void Player::UpdateSpellCritChance(uint32 school)
|
||||
SetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1 + school, crit);
|
||||
}
|
||||
|
||||
void Player::UpdateArmorPenetration(int32 amount)
|
||||
{
|
||||
AuraEffectList const& expAuras = GetAurasByType(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT);
|
||||
for(AuraEffectList::const_iterator itr = expAuras.begin(); itr != expAuras.end(); ++itr)
|
||||
{
|
||||
// item neutral spell
|
||||
if((*itr)->GetSpellProto()->EquippedItemClass == -1)
|
||||
{
|
||||
amount *= ((*itr)->GetAmount() + 100.0f) / 100.0f;
|
||||
continue;
|
||||
}
|
||||
|
||||
// item dependent spell - check curent weapons
|
||||
for(int i = 0; i < MAX_ATTACK; ++i)
|
||||
{
|
||||
Item *weapon = GetWeaponForAttack(WeaponAttackType(i));
|
||||
|
||||
if(weapon && weapon->IsFitToSpellRequirements((*itr)->GetSpellProto()))
|
||||
{
|
||||
amount *= ((*itr)->GetAmount() + 100.0f) / 100.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Store Rating Value
|
||||
SetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_ARMOR_PENETRATION, amount);
|
||||
}
|
||||
|
||||
void Player::UpdateMeleeHitChances()
|
||||
{
|
||||
m_modMeleeHitChance = GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE);
|
||||
|
||||
+1
-32
@@ -1373,37 +1373,6 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 dama
|
||||
damageInfo->damage = damage;
|
||||
}
|
||||
|
||||
int32 Unit::GetIgnoredArmorMultiplier(SpellEntry const *spellInfo, WeaponAttackType attackType)
|
||||
{
|
||||
if (GetTypeId() != TYPEID_PLAYER)
|
||||
return 0;
|
||||
//check if spell uses weapon
|
||||
if (!spellInfo || spellInfo->EquippedItemClass!=ITEM_CLASS_WEAPON)
|
||||
return 0;
|
||||
Item *item = NULL;
|
||||
if(attackType == BASE_ATTACK)
|
||||
item = ((Player*)this)->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
|
||||
else if (attackType == OFF_ATTACK)
|
||||
item = ((Player*)this)->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
|
||||
else if (attackType == RANGED_ATTACK)
|
||||
item = ((Player*)this)->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED);
|
||||
if (!item)
|
||||
return 0;
|
||||
|
||||
AuraEffectList const& armAuras = GetAurasByType(SPELL_AURA_MOD_WEAPONTYPE_IGNORE_TARGET_RESISTANCE);
|
||||
int32 armorIgnored = 0;
|
||||
for(AuraEffectList::const_iterator i = armAuras.begin();i != armAuras.end(); ++i)
|
||||
{
|
||||
if (!((*i)->GetSpellProto()->EquippedItemClass==item->GetProto()->Class
|
||||
&& (*i)->GetSpellProto()->EquippedItemSubClassMask & (1<<item->GetProto()->SubClass)))
|
||||
continue;
|
||||
|
||||
if((*i)->GetAmount())
|
||||
armorIgnored += (*i)->GetAmount();
|
||||
}
|
||||
return (-armorIgnored);
|
||||
}
|
||||
|
||||
void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
|
||||
{
|
||||
if (damageInfo==0)
|
||||
@@ -1831,7 +1800,6 @@ uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellEnt
|
||||
// Ignore enemy armor by SPELL_AURA_MOD_TARGET_RESISTANCE aura
|
||||
armor += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, SPELL_SCHOOL_MASK_NORMAL);
|
||||
|
||||
armor *= float((GetIgnoredArmorMultiplier(spellInfo, attackType)+100.0f)/100.0f);
|
||||
if(spellInfo)
|
||||
if(Player *modOwner = GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_IGNORE_ARMOR, armor);
|
||||
@@ -7693,6 +7661,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
|
||||
// Can proc only if target has hp below 35%
|
||||
if(!pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, procSpell, this))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
// Custom basepoints/target for exist spell
|
||||
|
||||
@@ -1195,7 +1195,6 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
void DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss);
|
||||
|
||||
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellEntry const *spellInfo, WeaponAttackType attackType = BASE_ATTACK, bool crit = false);
|
||||
int32 GetIgnoredArmorMultiplier(SpellEntry const *spellInfo, WeaponAttackType attackType);
|
||||
void DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss);
|
||||
|
||||
float MeleeSpellMissChance(const Unit *pVictim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const;
|
||||
|
||||
Reference in New Issue
Block a user