Missing part from thenecromancer's weapon proc patch.
Some changes in ProcDamageAndSpellFor to allow triggered spells to trigger other for victim. --HG-- branch : trunk
This commit is contained in:
+2
-2
@@ -7000,7 +7000,7 @@ void Player::CastItemCombatSpell(Item *item, CalcDamageInfo *damageInfo, ItemPro
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Can do effect if any damage done to target
|
// Can do effect if any damage done to target
|
||||||
if (damageInfo->damage)
|
if (damageInfo->procVictim & PROC_FLAG_TAKEN_ANY_DAMAGE)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 5; i++)
|
for (int i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
@@ -7064,7 +7064,7 @@ void Player::CastItemCombatSpell(Item *item, CalcDamageInfo *damageInfo, ItemPro
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Can do effect if any damage done to target
|
// Can do effect if any damage done to target
|
||||||
if (!(damageInfo->damage))
|
if (!(damageInfo->procVictim & PROC_FLAG_TAKEN_ANY_DAMAGE))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -1017,8 +1017,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
|||||||
caster->SendHealSpellLog(unitTarget, m_spellInfo->Id, addhealth, crit);
|
caster->SendHealSpellLog(unitTarget, m_spellInfo->Id, addhealth, crit);
|
||||||
|
|
||||||
// Do triggers for unit (reflect triggers passed on hit phase for correct drop charge)
|
// Do triggers for unit (reflect triggers passed on hit phase for correct drop charge)
|
||||||
if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
|
if (missInfo != SPELL_MISS_REFLECT)
|
||||||
caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo);
|
caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo, m_canTrigger);
|
||||||
|
|
||||||
int32 gain = unitTarget->ModifyHealth( int32(addhealth) );
|
int32 gain = unitTarget->ModifyHealth( int32(addhealth) );
|
||||||
|
|
||||||
@@ -1043,8 +1043,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
|||||||
procVictim |= PROC_FLAG_TAKEN_ANY_DAMAGE;
|
procVictim |= PROC_FLAG_TAKEN_ANY_DAMAGE;
|
||||||
|
|
||||||
// Do triggers for unit (reflect triggers passed on hit phase for correct drop charge)
|
// Do triggers for unit (reflect triggers passed on hit phase for correct drop charge)
|
||||||
if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
|
if (missInfo != SPELL_MISS_REFLECT)
|
||||||
caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo);
|
caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo, m_canTrigger);
|
||||||
|
|
||||||
caster->DealSpellDamage(&damageInfo, true);
|
caster->DealSpellDamage(&damageInfo, true);
|
||||||
|
|
||||||
@@ -1094,8 +1094,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
|||||||
SpellNonMeleeDamage damageInfo(caster, unitTarget, m_spellInfo->Id, m_spellSchoolMask);
|
SpellNonMeleeDamage damageInfo(caster, unitTarget, m_spellInfo->Id, m_spellSchoolMask);
|
||||||
procEx = createProcExtendMask(&damageInfo, missInfo);
|
procEx = createProcExtendMask(&damageInfo, missInfo);
|
||||||
// Do triggers for unit (reflect triggers passed on hit phase for correct drop charge)
|
// Do triggers for unit (reflect triggers passed on hit phase for correct drop charge)
|
||||||
if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
|
if (missInfo != SPELL_MISS_REFLECT)
|
||||||
caster->ProcDamageAndSpell(unit, procAttacker, procVictim, procEx, 0, m_attackType, m_spellInfo);
|
caster->ProcDamageAndSpell(unit, procAttacker, procVictim, procEx, 0, m_attackType, m_spellInfo, m_canTrigger);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call scripted function for AI if this spell is casted upon a creature (except pets)
|
// Call scripted function for AI if this spell is casted upon a creature (except pets)
|
||||||
|
|||||||
+3
-3
@@ -1659,7 +1659,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do effect if any damage done to target
|
// Do effect if any damage done to target
|
||||||
if (damageInfo->damage)
|
if (damageInfo->procVictim & PROC_FLAG_TAKEN_ANY_DAMAGE)
|
||||||
{
|
{
|
||||||
// victim's damage shield
|
// victim's damage shield
|
||||||
std::set<Aura*> alreadyDone;
|
std::set<Aura*> alreadyDone;
|
||||||
@@ -4725,10 +4725,10 @@ void Unit::SendSpellNonMeleeDamageLog(Unit *target,uint32 SpellID,uint32 Damage,
|
|||||||
SendMessageToSet( &data, true );
|
SendMessageToSet( &data, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVictim, uint32 procExtra, uint32 amount, WeaponAttackType attType, SpellEntry const *procSpell)
|
void Unit::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVictim, uint32 procExtra, uint32 amount, WeaponAttackType attType, SpellEntry const *procSpell, bool canTrigger)
|
||||||
{
|
{
|
||||||
// Not much to do if no flags are set.
|
// Not much to do if no flags are set.
|
||||||
if (procAttacker)
|
if (procAttacker && canTrigger)
|
||||||
ProcDamageAndSpellFor(false,pVictim,procAttacker, procExtra,attType, procSpell, amount);
|
ProcDamageAndSpellFor(false,pVictim,procAttacker, procExtra,attType, procSpell, amount);
|
||||||
// Now go on with a victim's events'n'auras
|
// Now go on with a victim's events'n'auras
|
||||||
// Not much to do if no flags are set or there is no victim
|
// Not much to do if no flags are set or there is no victim
|
||||||
|
|||||||
+1
-1
@@ -946,7 +946,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
|||||||
uint32 DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellEntry const *spellProto = NULL, bool durabilityLoss = true);
|
uint32 DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellEntry const *spellProto = NULL, bool durabilityLoss = true);
|
||||||
void Kill(Unit *pVictim, bool durabilityLoss = true);
|
void Kill(Unit *pVictim, bool durabilityLoss = true);
|
||||||
|
|
||||||
void ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellEntry const *procSpell = NULL);
|
void ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellEntry const *procSpell = NULL, bool canTrigger = true);
|
||||||
void ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage );
|
void ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage );
|
||||||
|
|
||||||
void HandleEmoteCommand(uint32 anim_id);
|
void HandleEmoteCommand(uint32 anim_id);
|
||||||
|
|||||||
Reference in New Issue
Block a user