*Procflag patch by DiSlord.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-11-26 15:14:03 -06:00
parent 0521e2d017
commit da6c516fdf
10 changed files with 3058 additions and 420 deletions
+74 -36
View File
@@ -330,6 +330,8 @@ bool IsPositiveTarget(uint32 targetA, uint32 targetB);
bool IsSingleTargetSpell(SpellEntry const *spellInfo);
bool IsSingleTargetSpells(SpellEntry const *spellInfo1, SpellEntry const *spellInfo2);
bool IsAuraAddedBySpell(uint32 auraType, uint32 spellId);
bool IsSpellAllowedInLocation(SpellEntry const *spellInfo,uint32 map_id,uint32 zone_id,uint32 area_id);
inline bool IsAreaEffectTarget( Targets target )
@@ -448,50 +450,86 @@ typedef std::map<uint32, uint64> SpellAffectMap;
// Spell proc event related declarations (accessed using SpellMgr functions)
enum ProcFlags
{
PROC_FLAG_NONE = 0x00000000, // None
PROC_FLAG_HIT_MELEE = 0x00000001, // On melee hit
PROC_FLAG_STRUCK_MELEE = 0x00000002, // On being struck melee
PROC_FLAG_KILL_XP_GIVER = 0x00000004, // On kill target giving XP or honor
PROC_FLAG_SPECIAL_DROP = 0x00000008, //
PROC_FLAG_DODGE = 0x00000010, // On dodge melee attack
PROC_FLAG_PARRY = 0x00000020, // On parry melee attack
PROC_FLAG_BLOCK = 0x00000040, // On block attack
PROC_FLAG_TOUCH = 0x00000080, // On being touched (for bombs, probably?)
PROC_FLAG_TARGET_LOW_HEALTH = 0x00000100, // On deal damage to enemy with 20% or less health
PROC_FLAG_LOW_HEALTH = 0x00000200, // On health dropped below 20%
PROC_FLAG_STRUCK_RANGED = 0x00000400, // On being struck ranged
PROC_FLAG_HIT_SPECIAL = 0x00000800, // (!)Removed, may be reassigned in future
PROC_FLAG_CRIT_MELEE = 0x00001000, // On crit melee
PROC_FLAG_STRUCK_CRIT_MELEE = 0x00002000, // On being critically struck in melee
PROC_FLAG_CAST_SPELL = 0x00004000, // On cast spell
PROC_FLAG_TAKE_DAMAGE = 0x00008000, // On take damage
PROC_FLAG_CRIT_SPELL = 0x00010000, // On crit spell
PROC_FLAG_HIT_SPELL = 0x00020000, // On hit spell
PROC_FLAG_STRUCK_CRIT_SPELL = 0x00040000, // On being critically struck by a spell
PROC_FLAG_HIT_RANGED = 0x00080000, // On getting ranged hit
PROC_FLAG_STRUCK_SPELL = 0x00100000, // On being struck by a spell
PROC_FLAG_TRAP = 0x00200000, // On trap activation (?)
PROC_FLAG_CRIT_RANGED = 0x00400000, // On getting ranged crit
PROC_FLAG_STRUCK_CRIT_RANGED = 0x00800000, // On being critically struck by a ranged attack
PROC_FLAG_RESIST_SPELL = 0x01000000, // On resist enemy spell
PROC_FLAG_TARGET_RESISTS = 0x02000000, // On enemy resisted spell
PROC_FLAG_TARGET_DODGE_OR_PARRY = 0x04000000, // On enemy dodges/parries
PROC_FLAG_HEAL = 0x08000000, // On heal
PROC_FLAG_CRIT_HEAL = 0x10000000, // On critical healing effect
PROC_FLAG_HEALED = 0x20000000, // On healing
PROC_FLAG_TARGET_BLOCK = 0x40000000, // On enemy blocks
PROC_FLAG_MISS = 0x80000000 // On miss melee attack
PROC_FLAG_NONE = 0x00000000,
PROC_FLAG_KILLED = 0x00000001, // 00 Killed by agressor
PROC_FLAG_KILL_AND_GET_XP = 0x00000002, // 01 Kill that yields experience or honor
PROC_FLAG_SUCCESSFUL_MILEE_HIT = 0x00000004, // 02 Successful melee attack
PROC_FLAG_TAKEN_MELEE_HIT = 0x00000008, // 03 Taken damage from melee strike hit
PROC_FLAG_SUCCESSFUL_MELEE_SPELL_HIT = 0x00000010, // 04 Successful attack by Spell that use melee weapon
PROC_FLAG_TAKEN_MELEE_SPELL_HIT = 0x00000020, // 05 Taken damage by Spell that use melee weapon
PROC_FLAG_SUCCESSFUL_RANGED_HIT = 0x00000040, // 06 Successful Ranged attack (all ranged attack deal as spell so newer set :( )
PROC_FLAG_TAKEN_RANGED_HIT = 0x00000080, // 07 Taken damage from ranged attack (all ranged attack deal as spell so newer set :( )
PROC_FLAG_SUCCESSFUL_RANGED_SPELL_HIT = 0x00000100, // 08 Successful Ranged attack by Spell that use ranged weapon
PROC_FLAG_TAKEN_RANGED_SPELL_HIT = 0x00000200, // 09 Taken damage by Spell that use ranged weapon
PROC_FLAG_SUCCESSFUL_POSITIVE_AOE_HIT = 0x00000400, // 10 Successful AoE (not 100% shure unused)
PROC_FLAG_TAKEN_POSITIVE_AOE = 0x00000800, // 11 Taken AoE (not 100% shure unused)
PROC_FLAG_SUCCESSFUL_AOE_SPELL_HIT = 0x00001000, // 12 Successful AoE damage spell hit (not 100% shure unused)
PROC_FLAG_TAKEN_AOE_SPELL_HIT = 0x00002000, // 13 Taken AoE damage spell hit (not 100% shure unused)
PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL = 0x00004000, // 14 Successful cast positive spell (by default only on healing)
PROC_FLAG_TAKEN_POSITIVE_SPELL = 0x00008000, // 15 Taken positive spell hit (by default only on healing)
PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT = 0x00010000, // 16 Successful negative spell cast (by default only on damage)
PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT = 0x00020000, // 17 Taken negative spell (by default only on damage)
PROC_FLAG_ON_DO_PERIODIC = 0x00040000, // 18 Successful do periodic (damage / healing, determined from 14-17 flags)
PROC_FLAG_ON_TAKE_PERIODIC = 0x00080000, // 19 Taken spell periodic (damage / healing, determined from 14-17 flags)
PROC_FLAG_TAKEN_ANY_DAMAGE = 0x00100000, // 20 Taken any damage
PROC_FLAG_ON_TRAP_ACTIVATION = 0x00200000, // 21 On trap activation
PROC_FLAG_TAKEN_OFFHAND_HIT = 0x00400000, // 22 Taken off-hand melee attacks(not used)
PROC_FLAG_SUCCESSFUL_OFFHAND_HIT = 0x00800000 // 23 Successful off-hand melee attacks
};
#define MELEE_BASED_TRIGGER_MASK (PROC_FLAG_SUCCESSFUL_MILEE_HIT | \
PROC_FLAG_TAKEN_MELEE_HIT | \
PROC_FLAG_SUCCESSFUL_MELEE_SPELL_HIT | \
PROC_FLAG_TAKEN_MELEE_SPELL_HIT | \
PROC_FLAG_SUCCESSFUL_RANGED_HIT | \
PROC_FLAG_TAKEN_RANGED_HIT | \
PROC_FLAG_SUCCESSFUL_RANGED_SPELL_HIT | \
PROC_FLAG_TAKEN_RANGED_SPELL_HIT)
enum ProcFlagsEx
{
PROC_EX_NONE = 0x0000000, // If none can tigger on Hit/Crit only (passive spells MUST defined by SpellFamily flag)
PROC_EX_NORMAL_HIT = 0x0000001, // If set only from normal hit (only damage spells)
PROC_EX_CRITICAL_HIT = 0x0000002,
PROC_EX_MISS = 0x0000004,
PROC_EX_RESIST = 0x0000008,
PROC_EX_DODGE = 0x0000010,
PROC_EX_PARRY = 0x0000020,
PROC_EX_BLOCK = 0x0000040,
PROC_EX_EVADE = 0x0000080,
PROC_EX_IMMUNE = 0x0000100,
PROC_EX_DEFLECT = 0x0000200,
PROC_EX_ABSORB = 0x0000400,
PROC_EX_REFLECT = 0x0000800,
PROC_EX_INTERRUPT = 0x0001000, // Melle hit result can be Interrupt (not used)
PROC_EX_RESERVED1 = 0x0002000,
PROC_EX_RESERVED2 = 0x0004000,
PROC_EX_RESERVED3 = 0x0008000,
PROC_EX_EX_TRIGGER_ALWAYS = 0x0010000, // If set trigger always ( no matter another flags) used for drop charges
PROC_EX_EX_ONE_TIME_TRIGGER = 0x0020000 // If set trigger always but only one time
};
struct SpellProcEventEntry
{
uint32 schoolMask; // if nonzero - bit mask for matching proc condition based on spell candidate's school: Fire=2, Mask=1<<(2-1)=2
uint32 category; // if nonzero - match proc condition based on candidate spell's category
uint32 skillId; // if nonzero - for matching proc condition based on candidate spell's skillId from SkillLineAbility.dbc (Shadow Bolt = Destruction)
uint32 spellFamilyName; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyNamer value
uint64 spellFamilyMask; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyFlags (like auras 107 and 108 do)
uint32 procFlags; // bitmask for matching proc event
uint32 procEx; // proc Extend info (see ProcFlagsEx)
float ppmRate; // for melee (ranged?) damage spells - proc rate per minute. if zero, falls back to flat chance from Spell.dbc
float customChance; // Owerride chance (in most cases for debug only)
uint32 cooldown; // hidden cooldown used for some spell proc events, applied to _triggered_spell_
};
@@ -701,7 +739,7 @@ class SpellMgr
return NULL;
}
static bool IsSpellProcEventCanTriggeredBy( SpellProcEventEntry const * spellProcEvent, SpellEntry const * procSpell, uint32 procFlags );
static bool IsSpellProcEventCanTriggeredBy( SpellProcEventEntry const * spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra, bool active);
// Spell target coordinates
SpellTargetPosition const* GetSpellTargetPosition(uint32 spell_id) const