Merge pull request #2617 from Chaplain/master
Core/Spells: Fixed exploit found in 9936921206.
This commit is contained in:
@@ -10393,17 +10393,12 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32
|
|||||||
|
|
||||||
AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
|
AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
|
||||||
for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
|
for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
|
||||||
if ((*i)->GetMiscValue() & spellProto->GetSchoolMask())
|
if ((*i)->GetMiscValue() & spellProto->GetSchoolMask() && !(spellProto->GetSchoolMask() & SPELL_SCHOOL_MASK_NORMAL))
|
||||||
{
|
{
|
||||||
if ((*i)->GetSpellInfo()->EquippedItemClass == -1)
|
if ((*i)->GetSpellInfo()->EquippedItemClass == -1)
|
||||||
AddPctN(DoneTotalMod, (*i)->GetAmount());
|
AddPctN(DoneTotalMod, (*i)->GetAmount());
|
||||||
else if (!((*i)->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK))
|
else if (!((*i)->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK) && ((*i)->GetSpellInfo()->EquippedItemSubClassMask == 0))
|
||||||
{
|
AddPctN(DoneTotalMod, (*i)->GetAmount());
|
||||||
if ((*i)->GetSpellInfo()->EquippedItemClass & spellProto->EquippedItemClass)
|
|
||||||
if (((*i)->GetSpellInfo()->EquippedItemSubClassMask == 0) ||
|
|
||||||
((*i)->GetSpellInfo()->EquippedItemSubClassMask & spellProto->EquippedItemSubClassMask))
|
|
||||||
AddPctN(DoneTotalMod, (*i)->GetAmount());
|
|
||||||
}
|
|
||||||
else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo()))
|
else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo()))
|
||||||
AddPctN(DoneTotalMod, (*i)->GetAmount());
|
AddPctN(DoneTotalMod, (*i)->GetAmount());
|
||||||
}
|
}
|
||||||
@@ -11762,27 +11757,14 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT
|
|||||||
{
|
{
|
||||||
if (spellProto)
|
if (spellProto)
|
||||||
{
|
{
|
||||||
if ((*i)->GetMiscValue() & spellProto->GetSchoolMask())
|
if ((*i)->GetMiscValue() & spellProto->GetSchoolMask() && !(spellProto->GetSchoolMask() & SPELL_SCHOOL_MASK_NORMAL))
|
||||||
{
|
{
|
||||||
if ((*i)->GetSpellInfo()->EquippedItemClass == -1)
|
if ((*i)->GetSpellInfo()->EquippedItemClass == -1)
|
||||||
AddPctN(DoneTotalMod, (*i)->GetAmount());
|
AddPctN(DoneTotalMod, (*i)->GetAmount());
|
||||||
else if (!((*i)->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK))
|
else if (!((*i)->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK) && ((*i)->GetSpellInfo()->EquippedItemSubClassMask == 0))
|
||||||
{
|
AddPctN(DoneTotalMod, (*i)->GetAmount());
|
||||||
if ((*i)->GetSpellInfo()->EquippedItemClass & spellProto->EquippedItemClass)
|
|
||||||
if (((*i)->GetSpellInfo()->EquippedItemSubClassMask == 0) ||
|
|
||||||
((*i)->GetSpellInfo()->EquippedItemSubClassMask & spellProto->EquippedItemSubClassMask))
|
|
||||||
AddPctN(DoneTotalMod, (*i)->GetAmount());
|
|
||||||
}
|
|
||||||
else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo()))
|
else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo()))
|
||||||
AddPctN(DoneTotalMod, (*i)->GetAmount());
|
AddPctN(DoneTotalMod, (*i)->GetAmount());
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((*i)->GetMiscValue() & GetMeleeDamageSchoolMask() &&
|
|
||||||
(*i)->GetSpellInfo()->EquippedItemClass == -1)
|
|
||||||
{
|
|
||||||
AddPctN(DoneTotalMod, (*i)->GetAmount());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4500,13 +4500,30 @@ void AuraEffect::HandleModDamagePercentDone(AuraApplication const* aurApp, uint8
|
|||||||
if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT)))
|
if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Player* target = aurApp->GetTarget()->ToPlayer();
|
Unit* target = aurApp->GetTarget();
|
||||||
if (!target)
|
if (!target)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for(int i = 0; i < MAX_ATTACK; ++i)
|
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||||
if(Item* item = target->GetWeaponForAttack(WeaponAttackType(i),false))
|
{
|
||||||
target->_ApplyWeaponDependentAuraDamageMod(item, WeaponAttackType(i), this, apply);
|
for(int i = 0; i < MAX_ATTACK; ++i)
|
||||||
|
if(Item* item = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i),false))
|
||||||
|
target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(item, WeaponAttackType(i), this, apply);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) && (GetSpellInfo()->EquippedItemClass == -1 || target->GetTypeId() != TYPEID_PLAYER))
|
||||||
|
{
|
||||||
|
target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, float (GetAmount()), apply);
|
||||||
|
target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float (GetAmount()), apply);
|
||||||
|
target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_PCT, float (GetAmount()), apply);
|
||||||
|
|
||||||
|
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||||
|
target->ToPlayer()->ApplyModSignedFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT, GetAmount() / 100.0f, apply);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// done in Player::_ApplyWeaponDependentAuraMods for !SPELL_SCHOOL_MASK_NORMAL and also for wand case
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AuraEffect::HandleModOffhandDamagePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
void AuraEffect::HandleModOffhandDamagePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||||
|
|||||||
Reference in New Issue
Block a user