Fix build

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-12-25 20:12:31 +01:00
parent 06d014f04d
commit 70ec4a8f9b
+38 -38
View File
@@ -11607,49 +11607,49 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att
float TakenTotalMod = 1.0f;
// ..done
if (spellProto)
{
AuraEffectList const &mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
if ((*i)->GetMiscValue() & GetSpellSchoolMask(spellProto))
{
if ((*i)->GetSpellProto()->EquippedItemClass == -1)
{
AddPctN(DoneTotalMod, (*i)->GetAmount());
}
else if (!((*i)->GetSpellProto()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK))
{
if ((*i)->GetSpellProto()->EquippedItemClass & spellProto->EquippedItemClass)
if (((*i)->GetSpellProto()->EquippedItemSubClassMask == 0) ||
((*i)->GetSpellProto()->EquippedItemSubClassMask & spellProto->EquippedItemSubClassMask))
AddPctN(DoneTotalMod, (*i)->GetAmount());
}
else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellProto()))
AddPctN(DoneTotalMod, (*i)->GetAmount());
}
}
else if (ToPlayer())
{
if (!((*i)->GetSpellProto()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK))
AuraEffectList const &mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
if (spellProto)
{
EquipmentSlots slot;
switch (attType)
if ((*i)->GetMiscValue() & GetSpellSchoolMask(spellProto))
{
if ((*i)->GetSpellProto()->EquippedItemClass == -1)
{
AddPctN(DoneTotalMod, (*i)->GetAmount());
}
else if (!((*i)->GetSpellProto()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK))
{
if ((*i)->GetSpellProto()->EquippedItemClass & spellProto->EquippedItemClass)
if (((*i)->GetSpellProto()->EquippedItemSubClassMask == 0) ||
((*i)->GetSpellProto()->EquippedItemSubClassMask & spellProto->EquippedItemSubClassMask))
AddPctN(DoneTotalMod, (*i)->GetAmount());
}
else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellProto()))
AddPctN(DoneTotalMod, (*i)->GetAmount());
}
}
else if (ToPlayer())
{
if (!((*i)->GetSpellProto()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK))
{
case BASE_ATTACK: slot = EQUIPMENT_SLOT_MAINHAND; break;
case OFF_ATTACK: slot = EQUIPMENT_SLOT_OFFHAND; break;
case RANGED_ATTACK: slot = EQUIPMENT_SLOT_RANGED; break;
default: return;
EquipmentSlots slot;
switch (attType)
{
case BASE_ATTACK: slot = EQUIPMENT_SLOT_MAINHAND; break;
case OFF_ATTACK: slot = EQUIPMENT_SLOT_OFFHAND; break;
case RANGED_ATTACK: slot = EQUIPMENT_SLOT_RANGED; break;
default: return;
}
Item * item = ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot);
if (item && !item->IsBroken() && item->IsFitToSpellRequirements((*i)->GetSpellProto()))
AddPctN(DoneTotalMod, (*i)->GetAmount());
}
Item * item = ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot);
if (item && !item->IsBroken() && item->IsFitToSpellRequirements((*i)->GetSpellProto()))
else if (ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellProto()))
AddPctN(DoneTotalMod, (*i)->GetAmount());
}
else if (ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellProto()))
AddPctN(DoneTotalMod, (*i)->GetAmount());
}
AuraEffectList const &mDamageDoneVersus = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS);
for (AuraEffectList::const_iterator i = mDamageDoneVersus.begin(); i != mDamageDoneVersus.end(); ++i)