[7990] Trigering "on hit" combat spell only at related to current hit weapon.

Also check at loading that only weapon item templates have "on hit" spell triggers.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
nos4r2zod 2009-06-11 01:24:25 +04:00 committed by VladimirMangos
parent e3fd03c7b9
commit 31957a22d6
5 changed files with 13 additions and 8 deletions

View file

@ -1505,11 +1505,9 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
// If not miss
if (!(damageInfo->HitInfo & HITINFO_MISS))
{
// on weapon hit casts
if(GetTypeId() == TYPEID_PLAYER && pVictim->isAlive())
{
for(int i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i)
((Player*)this)->CastItemCombatSpell(((Player*)this)->GetItemByPos(INVENTORY_SLOT_BAG_0,i), pVictim, damageInfo->attackType);
}
((Player*)this)->CastItemCombatSpell(pVictim, damageInfo->attackType);
// victim's damage shield
std::set<Aura*> alreadyDone;