Backed out changeset eb07c8f645e8

--HG--
branch : trunk
This commit is contained in:
QAston
2009-03-18 19:55:31 +01:00
parent 98eb343d10
commit 00c27bcc05
5 changed files with 42 additions and 26 deletions
+30 -11
View File
@@ -661,7 +661,6 @@ 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
@@ -670,11 +669,31 @@ 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 && !m_CastItem) if (!m_canTrigger) // Exceptions (some periodic triggers)
{ {
// Triggered spells with spellfamilymask can trigger other spells switch (m_spellInfo->SpellFamilyName)
if (m_spellInfo->SpellFamilyFlags) {
m_canTriggeredTrigger=true; 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 // 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); 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 || m_canTriggeredTrigger) && missInfo != SPELL_MISS_REFLECT) if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo, m_canTriggeredTrigger); caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo);
int32 gain = unitTarget->ModifyHealth( int32(addhealth) ); int32 gain = unitTarget->ModifyHealth( int32(addhealth) );
@@ -979,8 +998,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 || m_canTriggeredTrigger) && missInfo != SPELL_MISS_REFLECT) if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo, m_canTriggeredTrigger); caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo);
caster->DealSpellDamage(&damageInfo, true); caster->DealSpellDamage(&damageInfo, true);
@@ -998,8 +1017,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 || m_canTriggeredTrigger) && missInfo != SPELL_MISS_REFLECT) if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
caster->ProcDamageAndSpell(unit, procAttacker, procVictim, procEx, 0, m_attackType, m_spellInfo, m_canTriggeredTrigger); 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) // Call scripted function for AI if this spell is casted upon a creature (except pets)
-1
View File
@@ -538,7 +538,6 @@ 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();
+4 -2
View File
@@ -262,14 +262,16 @@ class TRINITY_DLL_SPEC Aura
if (m_procCharges == charges) if (m_procCharges == charges)
return; return;
m_procCharges = charges; 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 bool DropAuraCharge() // return true if last charge dropped
{ {
if (m_procCharges == 0) if (m_procCharges == 0)
return false; return false;
m_procCharges--; m_procCharges--;
m_target->UpdateAuraForGroup(GetAuraSlot()); if(GetAuraSlot() < MAX_AURAS) // slot found send data to client
{ m_target->UpdateAuraForGroup(GetAuraSlot()); }
return m_procCharges == 0; return m_procCharges == 0;
} }
+5 -9
View File
@@ -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, 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. // Not much to do if no flags are set.
if (procAttacker) 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 // 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, triggered); pVictim->ProcDamageAndSpellFor(true,this,procVictim, procExtra, attType, procSpell, amount);
} }
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 , 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 // 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 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 (); SpellEntry const* spellProto = aura->GetSpellProto ();
@@ -12579,10 +12579,6 @@ 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
View File
@@ -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, 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, bool triggered = false); 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);
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 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 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);