mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[9955] Prevent negetive proc events from possitive effects of negative spells.
Some negative spells have positive effects with targets not affected by negative effects of spell. For example spell 45524 cast negative effecst to target and possitive effect to caster self. For like possitive only target of negetive spell will not triggered negative proc events. In last cases will avoid triggering glyph 43537 at caster at spell 43537 cast.
This commit is contained in:
parent
182fda8f3e
commit
de454d6ff8
4 changed files with 32 additions and 9 deletions
|
|
@ -760,6 +760,14 @@ void Spell::prepareDataForTriggerSystem()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// some negative spells have positive effects to another or same targets
|
||||||
|
// avoid triggering negative hit for only positive targets
|
||||||
|
m_negativeEffectMask = 0x0;
|
||||||
|
for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
|
||||||
|
if (!IsPositiveEffect(m_spellInfo->Id, SpellEffectIndex(i)))
|
||||||
|
m_negativeEffectMask |= (1<<i);
|
||||||
|
|
||||||
// Hunter traps spells (for Entrapment trigger)
|
// Hunter traps spells (for Entrapment trigger)
|
||||||
// Gives your Immolation Trap, Frost Trap, Explosive Trap, and Snake Trap ....
|
// Gives your Immolation Trap, Frost Trap, Explosive Trap, and Snake Trap ....
|
||||||
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x000020000000001C)))
|
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x000020000000001C)))
|
||||||
|
|
@ -950,6 +958,14 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||||
uint32 procVictim = m_procVictim;
|
uint32 procVictim = m_procVictim;
|
||||||
uint32 procEx = PROC_EX_NONE;
|
uint32 procEx = PROC_EX_NONE;
|
||||||
|
|
||||||
|
// drop proc flags in case target not affected negative effects in negative spell
|
||||||
|
// for example caster bonus or animation
|
||||||
|
if (((procAttacker | procVictim) & NEGATIVE_TRIGGER_MASK) && !(target->effectMask & m_negativeEffectMask))
|
||||||
|
{
|
||||||
|
procAttacker = PROC_FLAG_NONE;
|
||||||
|
procVictim = PROC_FLAG_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_spellInfo->speed > 0)
|
if (m_spellInfo->speed > 0)
|
||||||
{
|
{
|
||||||
// mark effects that were already handled in Spell::HandleDelayedSpellLaunch on spell launch as processed
|
// mark effects that were already handled in Spell::HandleDelayedSpellLaunch on spell launch as processed
|
||||||
|
|
@ -1053,8 +1069,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Passive spell hits/misses or active spells only misses (only triggers)
|
// Passive spell hits/misses or active spells only misses (only triggers if proc flags set)
|
||||||
else
|
else if (procAttacker || procVictim)
|
||||||
{
|
{
|
||||||
// Fill base damage struct (unitTarget - is real spell target)
|
// Fill base damage struct (unitTarget - is real spell target)
|
||||||
SpellNonMeleeDamage damageInfo(caster, unitTarget, m_spellInfo->Id, m_spellSchoolMask);
|
SpellNonMeleeDamage damageInfo(caster, unitTarget, m_spellInfo->Id, m_spellSchoolMask);
|
||||||
|
|
|
||||||
|
|
@ -559,16 +559,17 @@ class Spell
|
||||||
GameObject* focusObject;
|
GameObject* focusObject;
|
||||||
|
|
||||||
// Damage and healing in effects need just calculate
|
// Damage and healing in effects need just calculate
|
||||||
int32 m_damage; // Damge in effects count here
|
int32 m_damage; // Damage in effects count here
|
||||||
int32 m_healing; // Healing in effects count here
|
int32 m_healing; // Healing in effects count here
|
||||||
int32 m_healthLeech; // Health leech in effects for all targets count here
|
int32 m_healthLeech; // Health leech in effects for all targets count here
|
||||||
|
|
||||||
//******************************************
|
//******************************************
|
||||||
// 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)
|
||||||
uint32 m_procAttacker; // Attacker trigger flags
|
uint8 m_negativeEffectMask; // Use for avoid sent negative spell procs for additional positive effects only targets
|
||||||
uint32 m_procVictim; // Victim trigger flags
|
uint32 m_procAttacker; // Attacker trigger flags
|
||||||
|
uint32 m_procVictim; // Victim trigger flags
|
||||||
void prepareDataForTriggerSystem();
|
void prepareDataForTriggerSystem();
|
||||||
|
|
||||||
//*****************************************
|
//*****************************************
|
||||||
|
|
|
||||||
|
|
@ -502,6 +502,12 @@ enum ProcFlags
|
||||||
PROC_FLAG_SUCCESSFUL_RANGED_SPELL_HIT | \
|
PROC_FLAG_SUCCESSFUL_RANGED_SPELL_HIT | \
|
||||||
PROC_FLAG_TAKEN_RANGED_SPELL_HIT)
|
PROC_FLAG_TAKEN_RANGED_SPELL_HIT)
|
||||||
|
|
||||||
|
#define NEGATIVE_TRIGGER_MASK (MELEE_BASED_TRIGGER_MASK | \
|
||||||
|
PROC_FLAG_SUCCESSFUL_AOE_SPELL_HIT | \
|
||||||
|
PROC_FLAG_TAKEN_AOE_SPELL_HIT | \
|
||||||
|
PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT | \
|
||||||
|
PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT)
|
||||||
|
|
||||||
enum ProcFlagsEx
|
enum ProcFlagsEx
|
||||||
{
|
{
|
||||||
PROC_EX_NONE = 0x0000000, // If none can tigger on Hit/Crit only (passive spells MUST defined by SpellFamily flag)
|
PROC_EX_NONE = 0x0000000, // If none can tigger on Hit/Crit only (passive spells MUST defined by SpellFamily flag)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9954"
|
#define REVISION_NR "9955"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue