*Allow triggered spells with spellfamilyflags to trigger other ones if spellprocevent for triggering aura has specified spellfamily.
--HG-- branch : trunk
This commit is contained in:
+11
-30
@@ -661,6 +661,7 @@ void Spell::prepareDataForTriggerSystem()
|
|||||||
// Fill flag can spell trigger or not
|
// Fill flag can spell trigger or not
|
||||||
// TODO: possible exist spell attribute for this
|
// TODO: possible exist spell attribute for this
|
||||||
m_canTrigger = false;
|
m_canTrigger = false;
|
||||||
|
m_canTriggeredTrigger=false;
|
||||||
|
|
||||||
if (m_CastItem)
|
if (m_CastItem)
|
||||||
m_canTrigger = false; // Do not trigger from item cast spell
|
m_canTrigger = false; // Do not trigger from item cast spell
|
||||||
@@ -669,31 +670,11 @@ void Spell::prepareDataForTriggerSystem()
|
|||||||
else if (!m_triggeredByAuraSpell)
|
else if (!m_triggeredByAuraSpell)
|
||||||
m_canTrigger = true; // Triggered from SPELL_EFFECT_TRIGGER_SPELL - can trigger
|
m_canTrigger = true; // Triggered from SPELL_EFFECT_TRIGGER_SPELL - can trigger
|
||||||
|
|
||||||
if (!m_canTrigger) // Exceptions (some periodic triggers)
|
if (!m_canTrigger && !m_CastItem)
|
||||||
{
|
{
|
||||||
switch (m_spellInfo->SpellFamilyName)
|
// Triggered spells with spellfamilymask can trigger other spells
|
||||||
{
|
if (m_spellInfo->SpellFamilyFlags)
|
||||||
case SPELLFAMILY_MAGE: // Arcane Missles / Blizzard triggers need do it
|
m_canTriggeredTrigger=true;
|
||||||
if (m_spellInfo->SpellFamilyFlags[0] & 0x200080) m_canTrigger = true;
|
|
||||||
break;
|
|
||||||
case SPELLFAMILY_WARLOCK: // For Hellfire Effect / Rain of Fire / Seed of Corruption triggers need do it
|
|
||||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x00008000 || m_spellInfo->SpellFamilyFlags[0] & 0x00000060) m_canTrigger = true;
|
|
||||||
break;
|
|
||||||
case SPELLFAMILY_PRIEST: // For Penance heal/damage triggers need do it
|
|
||||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x00018000) m_canTrigger = true;
|
|
||||||
break;
|
|
||||||
case SPELLFAMILY_ROGUE: // For poisons need do it
|
|
||||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x00000010 || m_spellInfo->SpellFamilyFlags[0] & 0x1001E000) m_canTrigger = true;
|
|
||||||
break;
|
|
||||||
case SPELLFAMILY_HUNTER: // Hunter Rapid Killing/Explosive Trap Effect/Immolation Trap Effect/Frost Trap Aura/Snake Trap Effect/Explosive Shot
|
|
||||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x01002000
|
|
||||||
|| m_spellInfo->SpellFamilyFlags[0] & 0x00000214 ||
|
|
||||||
m_spellInfo->SpellFamilyFlags[2] & 0x200) m_canTrigger = true;
|
|
||||||
break;
|
|
||||||
case SPELLFAMILY_PALADIN: // For Judgements (all) / Holy Shock triggers need do it
|
|
||||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x00010009 || m_spellInfo->SpellFamilyFlags[0] & 0x00B80400) m_canTrigger = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get data for type of attack and fill base info for trigger
|
// Get data for type of attack and fill base info for trigger
|
||||||
@@ -972,8 +953,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 ((m_canTrigger || m_canTriggeredTrigger) && 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_canTriggeredTrigger);
|
||||||
|
|
||||||
int32 gain = unitTarget->ModifyHealth( int32(addhealth) );
|
int32 gain = unitTarget->ModifyHealth( int32(addhealth) );
|
||||||
|
|
||||||
@@ -998,8 +979,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 ((m_canTrigger || m_canTriggeredTrigger) && 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_canTriggeredTrigger);
|
||||||
|
|
||||||
caster->DealSpellDamage(&damageInfo, true);
|
caster->DealSpellDamage(&damageInfo, true);
|
||||||
|
|
||||||
@@ -1017,8 +998,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 ((m_canTrigger || m_canTriggeredTrigger) && 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_canTriggeredTrigger);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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)
|
||||||
|
|||||||
@@ -538,6 +538,7 @@ class Spell
|
|||||||
// Spell trigger system
|
// Spell trigger system
|
||||||
//******************************************
|
//******************************************
|
||||||
bool m_canTrigger; // Can start trigger (m_IsTriggeredSpell can`t use for this)
|
bool m_canTrigger; // Can start trigger (m_IsTriggeredSpell can`t use for this)
|
||||||
|
bool m_canTriggeredTrigger;
|
||||||
uint32 m_procAttacker; // Attacker trigger flags
|
uint32 m_procAttacker; // Attacker trigger flags
|
||||||
uint32 m_procVictim; // Victim trigger flags
|
uint32 m_procVictim; // Victim trigger flags
|
||||||
void prepareDataForTriggerSystem();
|
void prepareDataForTriggerSystem();
|
||||||
|
|||||||
@@ -262,16 +262,14 @@ class TRINITY_DLL_SPEC Aura
|
|||||||
if (m_procCharges == charges)
|
if (m_procCharges == charges)
|
||||||
return;
|
return;
|
||||||
m_procCharges = charges;
|
m_procCharges = charges;
|
||||||
if(GetAuraSlot() < MAX_AURAS) // slot found send data to client
|
m_target->UpdateAuraForGroup(GetAuraSlot());
|
||||||
{ m_target->UpdateAuraForGroup(GetAuraSlot()); }
|
|
||||||
}
|
}
|
||||||
bool DropAuraCharge() // return true if last charge dropped
|
bool DropAuraCharge() // return true if last charge dropped
|
||||||
{
|
{
|
||||||
if (m_procCharges == 0)
|
if (m_procCharges == 0)
|
||||||
return false;
|
return false;
|
||||||
m_procCharges--;
|
m_procCharges--;
|
||||||
if(GetAuraSlot() < MAX_AURAS) // slot found send data to client
|
m_target->UpdateAuraForGroup(GetAuraSlot());
|
||||||
{ m_target->UpdateAuraForGroup(GetAuraSlot()); }
|
|
||||||
return m_procCharges == 0;
|
return m_procCharges == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+9
-5
@@ -4708,15 +4708,15 @@ 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 triggered)
|
||||||
{
|
{
|
||||||
// Not much to do if no flags are set.
|
// Not much to do if no flags are set.
|
||||||
if (procAttacker)
|
if (procAttacker)
|
||||||
ProcDamageAndSpellFor(false,pVictim,procAttacker, procExtra,attType, procSpell, amount);
|
ProcDamageAndSpellFor(false,pVictim,procAttacker, procExtra,attType, procSpell, amount, triggered);
|
||||||
// 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
|
||||||
if(pVictim && pVictim->isAlive() && procVictim)
|
if(pVictim && pVictim->isAlive() && procVictim)
|
||||||
pVictim->ProcDamageAndSpellFor(true,this,procVictim, procExtra, attType, procSpell, amount);
|
pVictim->ProcDamageAndSpellFor(true,this,procVictim, procExtra, attType, procSpell, amount, triggered);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo)
|
void Unit::SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo)
|
||||||
@@ -11683,7 +11683,7 @@ uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missC
|
|||||||
return procEx;
|
return procEx;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage )
|
void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage , bool triggered)
|
||||||
{
|
{
|
||||||
// For melee/ranged based attack need update skills and set some Aura states
|
// For melee/ranged based attack need update skills and set some Aura states
|
||||||
if (procFlag & MELEE_BASED_TRIGGER_MASK)
|
if (procFlag & MELEE_BASED_TRIGGER_MASK)
|
||||||
@@ -12553,7 +12553,7 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id)
|
|||||||
return pet;
|
return pet;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent )
|
bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent , bool triggered)
|
||||||
{
|
{
|
||||||
SpellEntry const* spellProto = aura->GetSpellProto ();
|
SpellEntry const* spellProto = aura->GetSpellProto ();
|
||||||
|
|
||||||
@@ -12579,6 +12579,10 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry con
|
|||||||
if (!EventProcFlag)
|
if (!EventProcFlag)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Triggered spells cannot proc for auras without mask requirement
|
||||||
|
if (triggered && !spellProcEvent->spellFamilyMask)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Check spellProcEvent data requirements
|
// Check spellProcEvent data requirements
|
||||||
if(!SpellMgr::IsSpellProcEventCanTriggeredBy(spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra, active))
|
if(!SpellMgr::IsSpellProcEventCanTriggeredBy(spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra, active))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
+3
-3
@@ -1017,8 +1017,8 @@ 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 triggered = false);
|
||||||
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, bool triggered = false);
|
||||||
|
|
||||||
void HandleEmoteCommand(uint32 anim_id);
|
void HandleEmoteCommand(uint32 anim_id);
|
||||||
void AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType = BASE_ATTACK, bool extra = false );
|
void AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType = BASE_ATTACK, bool extra = false );
|
||||||
@@ -1615,7 +1615,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
|||||||
void SendAttackStop(Unit* victim); // only from AttackStop(Unit*)
|
void SendAttackStop(Unit* victim); // only from AttackStop(Unit*)
|
||||||
//void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*)
|
//void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*)
|
||||||
|
|
||||||
bool IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent );
|
bool IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent , bool triggered=false);
|
||||||
bool HandleDummyAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
|
bool HandleDummyAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
|
||||||
bool HandleObsModEnergyAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
|
bool HandleObsModEnergyAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
|
||||||
bool HandleHasteAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
|
bool HandleHasteAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
|
||||||
|
|||||||
Reference in New Issue
Block a user