mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
*Merge.
--HG-- branch : trunk
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user