diff options
| author | QAston <none@none> | 2009-03-17 19:07:38 +0100 |
|---|---|---|
| committer | QAston <none@none> | 2009-03-17 19:07:38 +0100 |
| commit | 98eb343d10e0467d5b7ef58038ca5845f547ae94 (patch) | |
| tree | deed0fbfffcf323cfb9b8026e4ef4bf401cd4840 /src | |
| parent | b1da219266bc8667ea97950a1e1047d6d492aedc (diff) | |
*Allow triggered spells with spellfamilyflags to trigger other ones if spellprocevent for triggering aura has specified spellfamily.
--HG--
branch : trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/Spell.cpp | 41 | ||||
| -rw-r--r-- | src/game/Spell.h | 1 | ||||
| -rw-r--r-- | src/game/SpellAuras.h | 6 | ||||
| -rw-r--r-- | src/game/Unit.cpp | 14 | ||||
| -rw-r--r-- | src/game/Unit.h | 6 |
5 files changed, 26 insertions, 42 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 57bcebcef62..b511cb6e20f 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -661,6 +661,7 @@ void Spell::prepareDataForTriggerSystem() // Fill flag can spell trigger or not // TODO: possible exist spell attribute for this m_canTrigger = false; + m_canTriggeredTrigger=false; if (m_CastItem) m_canTrigger = false; // Do not trigger from item cast spell @@ -669,31 +670,11 @@ void Spell::prepareDataForTriggerSystem() else if (!m_triggeredByAuraSpell) 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) - { - case SPELLFAMILY_MAGE: // Arcane Missles / Blizzard triggers need do it - 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; - } + // Triggered spells with spellfamilymask can trigger other spells + if (m_spellInfo->SpellFamilyFlags) + m_canTriggeredTrigger=true; } // 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); // Do triggers for unit (reflect triggers passed on hit phase for correct drop charge) - if (m_canTrigger && missInfo != SPELL_MISS_REFLECT) - caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo); + if ((m_canTrigger || m_canTriggeredTrigger) && missInfo != SPELL_MISS_REFLECT) + caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo, m_canTriggeredTrigger); int32 gain = unitTarget->ModifyHealth( int32(addhealth) ); @@ -998,8 +979,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) procVictim |= PROC_FLAG_TAKEN_ANY_DAMAGE; // Do triggers for unit (reflect triggers passed on hit phase for correct drop charge) - if (m_canTrigger && missInfo != SPELL_MISS_REFLECT) - caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo); + if ((m_canTrigger || m_canTriggeredTrigger) && missInfo != SPELL_MISS_REFLECT) + caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo, m_canTriggeredTrigger); caster->DealSpellDamage(&damageInfo, true); @@ -1017,8 +998,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) SpellNonMeleeDamage damageInfo(caster, unitTarget, m_spellInfo->Id, m_spellSchoolMask); procEx = createProcExtendMask(&damageInfo, missInfo); // Do triggers for unit (reflect triggers passed on hit phase for correct drop charge) - if (m_canTrigger && missInfo != SPELL_MISS_REFLECT) - caster->ProcDamageAndSpell(unit, procAttacker, procVictim, procEx, 0, m_attackType, m_spellInfo); + if ((m_canTrigger || m_canTriggeredTrigger) && missInfo != SPELL_MISS_REFLECT) + 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) diff --git a/src/game/Spell.h b/src/game/Spell.h index 66b98e7d566..70cc61eaa61 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -538,6 +538,7 @@ class Spell // Spell trigger system //****************************************** bool m_canTrigger; // Can start trigger (m_IsTriggeredSpell can`t use for this) + bool m_canTriggeredTrigger; uint32 m_procAttacker; // Attacker trigger flags uint32 m_procVictim; // Victim trigger flags void prepareDataForTriggerSystem(); diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 3534fac5c96..51d140c4a4f 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -262,16 +262,14 @@ class TRINITY_DLL_SPEC Aura if (m_procCharges == charges) return; 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 { if (m_procCharges == 0) return false; m_procCharges--; - if(GetAuraSlot() < MAX_AURAS) // slot found send data to client - { m_target->UpdateAuraForGroup(GetAuraSlot()); } + m_target->UpdateAuraForGroup(GetAuraSlot()); return m_procCharges == 0; } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e8e8435ac1a..96e3c6eecd4 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4708,15 +4708,15 @@ void Unit::SendSpellNonMeleeDamageLog(Unit *target,uint32 SpellID,uint32 Damage, 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. 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 // Not much to do if no flags are set or there is no victim 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) @@ -11683,7 +11683,7 @@ uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missC 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 if (procFlag & MELEE_BASED_TRIGGER_MASK) @@ -12553,7 +12553,7 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id) 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 (); @@ -12579,6 +12579,10 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry con if (!EventProcFlag) return false; + // Triggered spells cannot proc for auras without mask requirement + if (triggered && !spellProcEvent->spellFamilyMask) + return false; + // Check spellProcEvent data requirements if(!SpellMgr::IsSpellProcEventCanTriggeredBy(spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra, active)) return false; diff --git a/src/game/Unit.h b/src/game/Unit.h index a54945241d6..51acf779b18 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -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); 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 ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage ); + 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, bool triggered = false); void HandleEmoteCommand(uint32 anim_id); 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 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 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); |
