aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <none@none>2009-03-18 19:56:48 +0100
committerQAston <none@none>2009-03-18 19:56:48 +0100
commitd50316a731ba1066ac63db3fd9cfa237526249fc (patch)
tree0595742e76e9999604eda32980e532735c2f513e /src
parent55f2f1db17c48f69350337b7727005b59662ca22 (diff)
parent00c27bcc051f3d088670f05c967e9d793e6bde72 (diff)
*Merge.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Spell.cpp41
-rw-r--r--src/game/Spell.h1
-rw-r--r--src/game/SpellAuras.h6
-rw-r--r--src/game/Unit.cpp14
-rw-r--r--src/game/Unit.h6
5 files changed, 42 insertions, 26 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 4bcf3808e1b..a44086b9407 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -661,7 +661,6 @@ 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
@@ -670,11 +669,31 @@ void Spell::prepareDataForTriggerSystem()
else if (!m_triggeredByAuraSpell)
m_canTrigger = true; // Triggered from SPELL_EFFECT_TRIGGER_SPELL - can trigger
- if (!m_canTrigger && !m_CastItem)
+ if (!m_canTrigger) // Exceptions (some periodic triggers)
{
- // Triggered spells with spellfamilymask can trigger other spells
- if (m_spellInfo->SpellFamilyFlags)
- m_canTriggeredTrigger=true;
+ 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;
+ }
}
// Get data for type of attack and fill base info for trigger
@@ -953,8 +972,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 || m_canTriggeredTrigger) && missInfo != SPELL_MISS_REFLECT)
- caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo, m_canTriggeredTrigger);
+ if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
+ caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo);
int32 gain = unitTarget->ModifyHealth( int32(addhealth) );
@@ -979,8 +998,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 || m_canTriggeredTrigger) && missInfo != SPELL_MISS_REFLECT)
- caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo, m_canTriggeredTrigger);
+ if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
+ caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo);
caster->DealSpellDamage(&damageInfo, true);
@@ -998,8 +1017,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 || m_canTriggeredTrigger) && missInfo != SPELL_MISS_REFLECT)
- caster->ProcDamageAndSpell(unit, procAttacker, procVictim, procEx, 0, m_attackType, m_spellInfo, m_canTriggeredTrigger);
+ if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
+ caster->ProcDamageAndSpell(unit, procAttacker, procVictim, procEx, 0, m_attackType, m_spellInfo);
}
// 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 70cc61eaa61..66b98e7d566 100644
--- a/src/game/Spell.h
+++ b/src/game/Spell.h
@@ -538,7 +538,6 @@ 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 51d140c4a4f..3534fac5c96 100644
--- a/src/game/SpellAuras.h
+++ b/src/game/SpellAuras.h
@@ -262,14 +262,16 @@ class TRINITY_DLL_SPEC Aura
if (m_procCharges == charges)
return;
m_procCharges = charges;
- m_target->UpdateAuraForGroup(GetAuraSlot());
+ if(GetAuraSlot() < MAX_AURAS) // slot found send data to client
+ { m_target->UpdateAuraForGroup(GetAuraSlot()); }
}
bool DropAuraCharge() // return true if last charge dropped
{
if (m_procCharges == 0)
return false;
m_procCharges--;
- m_target->UpdateAuraForGroup(GetAuraSlot());
+ if(GetAuraSlot() < MAX_AURAS) // slot found send data to client
+ { m_target->UpdateAuraForGroup(GetAuraSlot()); }
return m_procCharges == 0;
}
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 57d876f4e40..25370e0f02f 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, bool triggered)
+void Unit::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVictim, uint32 procExtra, uint32 amount, WeaponAttackType attType, SpellEntry const *procSpell)
{
// Not much to do if no flags are set.
if (procAttacker)
- ProcDamageAndSpellFor(false,pVictim,procAttacker, procExtra,attType, procSpell, amount, triggered);
+ ProcDamageAndSpellFor(false,pVictim,procAttacker, procExtra,attType, procSpell, amount);
// 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, triggered);
+ pVictim->ProcDamageAndSpellFor(true,this,procVictim, procExtra, attType, procSpell, amount);
}
void Unit::SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo)
@@ -11695,7 +11695,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 , bool triggered)
+void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage )
{
// For melee/ranged based attack need update skills and set some Aura states
if (procFlag & MELEE_BASED_TRIGGER_MASK)
@@ -12565,7 +12565,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 triggered)
+bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent )
{
SpellEntry const* spellProto = aura->GetSpellProto ();
@@ -12591,10 +12591,6 @@ 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 bc3f8722136..14741562291 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, bool triggered = false);
- void ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage, bool triggered = false);
+ 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 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 triggered=false);
+ bool IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent );
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);