mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[8898] Fix typo: get SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT data from victim.
Signed-off-by: VladimirMangos <vladimir@getmangos.com> Also added function for 2 repeated loop code and fix another typo for second SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT case.
This commit is contained in:
parent
5186046c5e
commit
cd2ec48742
3 changed files with 23 additions and 20 deletions
|
|
@ -3466,6 +3466,23 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_
|
||||||
return modifier;
|
return modifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float Unit::GetTotalAuraMultiplierByMiscValueForMask(AuraType auratype, uint32 mask) const
|
||||||
|
{
|
||||||
|
if(!mask)
|
||||||
|
return 1.0f;
|
||||||
|
|
||||||
|
float multiplier = 1.0f;
|
||||||
|
|
||||||
|
AuraList const& mTotalAuraList = GetAurasByType(auratype);
|
||||||
|
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
|
||||||
|
{
|
||||||
|
Modifier* mod = (*i)->GetModifier();
|
||||||
|
if (mask & (1 << (mod->m_miscvalue -1)))
|
||||||
|
multiplier *= (100.0f + mod->m_amount)/100.0f;
|
||||||
|
}
|
||||||
|
return multiplier;
|
||||||
|
}
|
||||||
|
|
||||||
bool Unit::AddAura(Aura *Aur)
|
bool Unit::AddAura(Aura *Aur)
|
||||||
{
|
{
|
||||||
SpellEntry const* aurSpellInfo = Aur->GetSpellProto();
|
SpellEntry const* aurSpellInfo = Aur->GetSpellProto();
|
||||||
|
|
@ -8571,15 +8588,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mod damage from spell mechanic
|
// Mod damage from spell mechanic
|
||||||
if (uint32 mechanicMask = GetAllSpellMechanicMask(spellProto))
|
TakenTotalMod *= pVictim->GetTotalAuraMultiplierByMiscValueForMask(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT,GetAllSpellMechanicMask(spellProto));
|
||||||
{
|
|
||||||
AuraList const& mDamageDoneMechanic = pVictim->GetAurasByType(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT);
|
|
||||||
for(AuraList::const_iterator i = mDamageDoneMechanic.begin();i != mDamageDoneMechanic.end(); ++i)
|
|
||||||
{
|
|
||||||
if (mechanicMask & uint32(1 << ((*i)->GetModifier()->m_miscvalue)))
|
|
||||||
TakenTotalMod *= ((*i)->GetModifier()->m_amount + 100.0f) / 100.0f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mod damage taken from AoE spells
|
// Mod damage taken from AoE spells
|
||||||
if(IsAreaOfEffectSpell(spellProto))
|
if(IsAreaOfEffectSpell(spellProto))
|
||||||
|
|
@ -9388,16 +9397,7 @@ uint32 Unit::MeleeDamageBonus(Unit *pVictim, uint32 pdamage,WeaponAttackType att
|
||||||
TakenPercent *= pVictim->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, schoolMask);
|
TakenPercent *= pVictim->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, schoolMask);
|
||||||
|
|
||||||
// ..taken pct (by mechanic mask)
|
// ..taken pct (by mechanic mask)
|
||||||
if (mechanicMask)
|
TakenPercent *= pVictim->GetTotalAuraMultiplierByMiscValueForMask(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT,mechanicMask);
|
||||||
{
|
|
||||||
AuraList const& mTotalAuraList = GetAurasByType(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT);
|
|
||||||
for(AuraList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
|
|
||||||
{
|
|
||||||
Modifier* mod = (*i)->GetModifier();
|
|
||||||
if ((1<<(mod->m_miscvalue-1)) & mechanicMask)
|
|
||||||
TakenPercent *= (100.0f + mod->m_amount)/100.0f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ..taken pct (melee/ranged)
|
// ..taken pct (melee/ranged)
|
||||||
if(attType == RANGED_ATTACK)
|
if(attType == RANGED_ATTACK)
|
||||||
|
|
|
||||||
|
|
@ -1424,6 +1424,9 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
||||||
int32 GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
|
int32 GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
|
||||||
int32 GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
|
int32 GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
|
||||||
|
|
||||||
|
// misc have plain value but we check it fit to provided values mask (mask & (1 << (misc-1)))
|
||||||
|
float GetTotalAuraMultiplierByMiscValueForMask(AuraType auratype, uint32 mask) const;
|
||||||
|
|
||||||
Aura* GetDummyAura(uint32 spell_id) const;
|
Aura* GetDummyAura(uint32 spell_id) const;
|
||||||
|
|
||||||
uint32 m_AuraFlags;
|
uint32 m_AuraFlags;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8897"
|
#define REVISION_NR "8898"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue