Do not allow finishing moves to proc from selfcast effects - original patch by freeganja
--HG-- branch : trunk
This commit is contained in:
@@ -349,7 +349,7 @@ enum SpellCategory
|
|||||||
#define SPELL_ATTR_EX4_UNK0 0x00000001 // 0
|
#define SPELL_ATTR_EX4_UNK0 0x00000001 // 0
|
||||||
#define SPELL_ATTR_EX4_UNK1 0x00000002 // 1 proc on finishing move?
|
#define SPELL_ATTR_EX4_UNK1 0x00000002 // 1 proc on finishing move?
|
||||||
#define SPELL_ATTR_EX4_UNK2 0x00000004 // 2
|
#define SPELL_ATTR_EX4_UNK2 0x00000004 // 2
|
||||||
#define SPELL_ATTR_EX4_UNK3 0x00000008 // 3
|
#define SPELL_ATTR_EX4_CANT_PROC_FROM_SELFCAST 0x00000008 // 3
|
||||||
#define SPELL_ATTR_EX4_UNK4 0x00000010 // 4
|
#define SPELL_ATTR_EX4_UNK4 0x00000010 // 4
|
||||||
#define SPELL_ATTR_EX4_UNK5 0x00000020 // 5
|
#define SPELL_ATTR_EX4_UNK5 0x00000020 // 5
|
||||||
#define SPELL_ATTR_EX4_UNK6 0x00000040 // 6
|
#define SPELL_ATTR_EX4_UNK6 0x00000040 // 6
|
||||||
|
|||||||
+9
-4
@@ -976,6 +976,10 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
|||||||
uint32 procVictim = m_procVictim;
|
uint32 procVictim = m_procVictim;
|
||||||
uint32 procEx = PROC_EX_NONE;
|
uint32 procEx = PROC_EX_NONE;
|
||||||
|
|
||||||
|
//Spells with this flag cannot trigger if effect is casted on self
|
||||||
|
bool canEffectTrigger = (m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_CANT_PROC_FROM_SELFCAST ? m_caster!=unitTarget : true)
|
||||||
|
&& m_canTrigger;
|
||||||
|
|
||||||
if (missInfo==SPELL_MISS_NONE) // In case spell hit target, do all effect on that target
|
if (missInfo==SPELL_MISS_NONE) // In case spell hit target, do all effect on that target
|
||||||
DoSpellHitOnUnit(unit, mask);
|
DoSpellHitOnUnit(unit, mask);
|
||||||
else if (missInfo == SPELL_MISS_REFLECT) // In case spell reflect from target, do all effect on caster (if hit)
|
else if (missInfo == SPELL_MISS_REFLECT) // In case spell reflect from target, do all effect on caster (if hit)
|
||||||
@@ -1011,7 +1015,7 @@ 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 (canEffectTrigger && 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);
|
||||||
|
|
||||||
int32 gain = unitTarget->ModifyHealth( int32(addhealth) );
|
int32 gain = unitTarget->ModifyHealth( int32(addhealth) );
|
||||||
@@ -1037,7 +1041,7 @@ 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 (canEffectTrigger && 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);
|
||||||
|
|
||||||
caster->DealSpellDamage(&damageInfo, true);
|
caster->DealSpellDamage(&damageInfo, true);
|
||||||
@@ -1088,7 +1092,7 @@ 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 (canEffectTrigger && 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1216,7 +1220,8 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
|
|||||||
if(m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->IsAIEnabled)
|
if(m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->IsAIEnabled)
|
||||||
((Creature*)m_caster)->AI()->SpellHitTarget(unit, m_spellInfo);
|
((Creature*)m_caster)->AI()->SpellHitTarget(unit, m_spellInfo);
|
||||||
|
|
||||||
if (m_ChanceTriggerSpells.size())
|
// spells with this flag can trigger only if not selfcast (eviscerate for example)
|
||||||
|
if (m_ChanceTriggerSpells.size() && (!m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_CANT_PROC_FROM_SELFCAST || unit!=m_caster)
|
||||||
{
|
{
|
||||||
int _duration=0;
|
int _duration=0;
|
||||||
for(ChanceTriggerSpells::const_iterator i = m_ChanceTriggerSpells.begin(); i != m_ChanceTriggerSpells.end(); ++i)
|
for(ChanceTriggerSpells::const_iterator i = m_ChanceTriggerSpells.begin(); i != m_ChanceTriggerSpells.end(); ++i)
|
||||||
|
|||||||
Reference in New Issue
Block a user