[c12546] Fix usage of SpellEquippedItems and SPELL_AURA_MOD_DAMAGE_DONE & SPELL_AURA_MOD_DAMAGE_PERCENT_DONE auras as a result

This commit is contained in:
Dramacydal 2013-03-25 16:31:55 +03:00 committed by Antz
parent 6b58a8674d
commit d4f3fed660
5 changed files with 514 additions and 229 deletions

File diff suppressed because it is too large Load diff

View file

@ -6508,7 +6508,7 @@ void Aura::HandleModDamageDone(bool apply, bool Real)
if((m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL) != 0) if((m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL) != 0)
{ {
// apply generic physical damage bonuses including wand case // apply generic physical damage bonuses including wand case
if (equippedItems && (equippedItems->EquippedItemClass == -1 || target->GetTypeId() != TYPEID_PLAYER)) if (!equippedItems || equippedItems->EquippedItemClass == -1 || target->GetTypeId() != TYPEID_PLAYER)
{ {
target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_VALUE, float(m_modifier.m_amount), apply); target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_VALUE, float(m_modifier.m_amount), apply);
target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_VALUE, float(m_modifier.m_amount), apply); target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_VALUE, float(m_modifier.m_amount), apply);
@ -6594,7 +6594,7 @@ void Aura::HandleModDamagePercentDone(bool apply, bool Real)
if((m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL) != 0) if((m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL) != 0)
{ {
// apply generic physical damage bonuses including wand case // apply generic physical damage bonuses including wand case
if (equippedItems && (equippedItems->EquippedItemClass == -1 || target->GetTypeId() != TYPEID_PLAYER)) if (!equippedItems || equippedItems->EquippedItemClass == -1 || target->GetTypeId() != TYPEID_PLAYER)
{ {
target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, float(m_modifier.m_amount), apply); target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, float(m_modifier.m_amount), apply);
target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float(m_modifier.m_amount), apply); target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float(m_modifier.m_amount), apply);

View file

@ -4897,12 +4897,15 @@ void Spell::EffectProficiency(SpellEffectEntry const* /*effect*/)
SpellEquippedItemsEntry const* eqItems = m_spellInfo->GetSpellEquippedItems(); SpellEquippedItemsEntry const* eqItems = m_spellInfo->GetSpellEquippedItems();
if (eqItems && eqItems->EquippedItemClass == ITEM_CLASS_WEAPON && !(p_target->GetWeaponProficiency() & eqItems->EquippedItemSubClassMask)) if (!eqItems)
return;
if (eqItems->EquippedItemClass == ITEM_CLASS_WEAPON && !(p_target->GetWeaponProficiency() & eqItems->EquippedItemSubClassMask))
{ {
p_target->AddWeaponProficiency(eqItems->EquippedItemSubClassMask); p_target->AddWeaponProficiency(eqItems->EquippedItemSubClassMask);
p_target->SendProficiency(ITEM_CLASS_WEAPON, p_target->GetWeaponProficiency()); p_target->SendProficiency(ITEM_CLASS_WEAPON, p_target->GetWeaponProficiency());
} }
if (eqItems && eqItems->EquippedItemClass == ITEM_CLASS_ARMOR && !(p_target->GetArmorProficiency() & eqItems->EquippedItemSubClassMask)) if (eqItems->EquippedItemClass == ITEM_CLASS_ARMOR && !(p_target->GetArmorProficiency() & eqItems->EquippedItemSubClassMask))
{ {
p_target->AddArmorProficiency(eqItems->EquippedItemSubClassMask); p_target->AddArmorProficiency(eqItems->EquippedItemSubClassMask);
p_target->SendProficiency(ITEM_CLASS_ARMOR, p_target->GetArmorProficiency()); p_target->SendProficiency(ITEM_CLASS_ARMOR, p_target->GetArmorProficiency());

View file

@ -6558,9 +6558,9 @@ uint32 Unit::SpellDamageBonusDone(Unit* pVictim, SpellEntry const* spellProto, u
{ {
SpellEquippedItemsEntry const* spellEquip = (*i)->GetSpellProto()->GetSpellEquippedItems(); SpellEquippedItemsEntry const* spellEquip = (*i)->GetSpellProto()->GetSpellEquippedItems();
if( ((*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellProto)) && if( ((*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellProto)) &&
spellEquip && spellEquip->EquippedItemClass == -1 && (!spellEquip || spellEquip->EquippedItemClass == -1 &&
// -1 == any item class (not wand then) // -1 == any item class (not wand then)
spellEquip->EquippedItemInventoryTypeMask == 0 ) spellEquip->EquippedItemInventoryTypeMask == 0))
// 0 == any inventory type (not wand then) // 0 == any inventory type (not wand then)
{ {
DoneTotalMod *= ((*i)->GetModifier()->m_amount + 100.0f) / 100.0f; DoneTotalMod *= ((*i)->GetModifier()->m_amount + 100.0f) / 100.0f;
@ -6943,8 +6943,8 @@ int32 Unit::SpellBaseDamageBonusDone(SpellSchoolMask schoolMask)
{ {
SpellEquippedItemsEntry const* spellEquip = (*i)->GetSpellProto()->GetSpellEquippedItems(); SpellEquippedItemsEntry const* spellEquip = (*i)->GetSpellProto()->GetSpellEquippedItems();
if (((*i)->GetModifier()->m_miscvalue & schoolMask) != 0 && if (((*i)->GetModifier()->m_miscvalue & schoolMask) != 0 &&
spellEquip && spellEquip->EquippedItemClass == -1 && // -1 == any item class (not wand then) (!spellEquip || spellEquip->EquippedItemClass == -1 && // -1 == any item class (not wand then)
spellEquip->EquippedItemInventoryTypeMask == 0) // 0 == any inventory type (not wand then) spellEquip->EquippedItemInventoryTypeMask == 0)) // 0 == any inventory type (not wand then)
DoneAdvertisedBenefit += (*i)->GetModifier()->m_amount; DoneAdvertisedBenefit += (*i)->GetModifier()->m_amount;
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "12545" #define REVISION_NR "12546"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__