mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-05 20:13:48 +00:00
First Commit
For Azeroth!
This commit is contained in:
387
src/server/game/Spells/Auras/SpellAuraDefines.h
Normal file
387
src/server/game/Spells/Auras/SpellAuraDefines.h
Normal file
@@ -0,0 +1,387 @@
|
||||
/*
|
||||
* Copyright (C)
|
||||
* Copyright (C)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef TRINITY_SPELLAURADEFINES_H
|
||||
#define TRINITY_SPELLAURADEFINES_H
|
||||
|
||||
#define MAX_AURAS 64 // client support up to 255, but it will cause problems with group auras updating
|
||||
|
||||
enum AURA_FLAGS
|
||||
{
|
||||
AFLAG_NONE = 0x00,
|
||||
AFLAG_EFF_INDEX_0 = 0x01,
|
||||
AFLAG_EFF_INDEX_1 = 0x02,
|
||||
AFLAG_EFF_INDEX_2 = 0x04,
|
||||
AFLAG_CASTER = 0x08,
|
||||
AFLAG_POSITIVE = 0x10,
|
||||
AFLAG_DURATION = 0x20,
|
||||
AFLAG_ANY_EFFECT_AMOUNT_SENT = 0x40, // used with AFLAG_EFF_INDEX_0/1/2
|
||||
AFLAG_NEGATIVE = 0x80
|
||||
};
|
||||
|
||||
// these are modes, in which aura effect handler may be called
|
||||
|
||||
enum AuraEffectHandleModes
|
||||
{
|
||||
AURA_EFFECT_HANDLE_DEFAULT = 0x0,
|
||||
AURA_EFFECT_HANDLE_REAL = 0x01, // handler applies/removes effect from unit
|
||||
AURA_EFFECT_HANDLE_SEND_FOR_CLIENT = 0x02, // handler sends apply/remove packet to unit
|
||||
AURA_EFFECT_HANDLE_CHANGE_AMOUNT = 0x04, // handler updates effect on target after effect amount change
|
||||
AURA_EFFECT_HANDLE_REAPPLY = 0x08, // handler updates effect on target after aura is reapplied on target
|
||||
AURA_EFFECT_HANDLE_STAT = 0x10, // handler updates effect on target when stat removal/apply is needed for calculations by core
|
||||
AURA_EFFECT_HANDLE_SKILL = 0x20, // handler updates effect on target when skill removal/apply is needed for calculations by core
|
||||
AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK = (AURA_EFFECT_HANDLE_SEND_FOR_CLIENT | AURA_EFFECT_HANDLE_REAL), // any case handler need to send packet
|
||||
AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK = (AURA_EFFECT_HANDLE_CHANGE_AMOUNT | AURA_EFFECT_HANDLE_REAL), // any case handler applies effect depending on amount
|
||||
AURA_EFFECT_HANDLE_CHANGE_AMOUNT_SEND_FOR_CLIENT_MASK = (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK),
|
||||
AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK = (AURA_EFFECT_HANDLE_REAPPLY | AURA_EFFECT_HANDLE_REAL),
|
||||
};
|
||||
|
||||
//m_schoolAbsorb
|
||||
enum DAMAGE_ABSORB_TYPE
|
||||
{
|
||||
ALL_DAMAGE_ABSORB = -2,
|
||||
ONLY_MAGIC_ABSORB = -1,
|
||||
};
|
||||
|
||||
enum AuraType
|
||||
{
|
||||
SPELL_AURA_NONE = 0,
|
||||
SPELL_AURA_BIND_SIGHT = 1,
|
||||
SPELL_AURA_MOD_POSSESS = 2,
|
||||
SPELL_AURA_PERIODIC_DAMAGE = 3,
|
||||
SPELL_AURA_DUMMY = 4,
|
||||
SPELL_AURA_MOD_CONFUSE = 5,
|
||||
SPELL_AURA_MOD_CHARM = 6,
|
||||
SPELL_AURA_MOD_FEAR = 7,
|
||||
SPELL_AURA_PERIODIC_HEAL = 8,
|
||||
SPELL_AURA_MOD_ATTACKSPEED = 9,
|
||||
SPELL_AURA_MOD_THREAT = 10,
|
||||
SPELL_AURA_MOD_TAUNT = 11,
|
||||
SPELL_AURA_MOD_STUN = 12,
|
||||
SPELL_AURA_MOD_DAMAGE_DONE = 13,
|
||||
SPELL_AURA_MOD_DAMAGE_TAKEN = 14,
|
||||
SPELL_AURA_DAMAGE_SHIELD = 15,
|
||||
SPELL_AURA_MOD_STEALTH = 16,
|
||||
SPELL_AURA_MOD_STEALTH_DETECT = 17,
|
||||
SPELL_AURA_MOD_INVISIBILITY = 18,
|
||||
SPELL_AURA_MOD_INVISIBILITY_DETECT = 19,
|
||||
SPELL_AURA_OBS_MOD_HEALTH = 20, //20, 21 unofficial
|
||||
SPELL_AURA_OBS_MOD_POWER = 21,
|
||||
SPELL_AURA_MOD_RESISTANCE = 22,
|
||||
SPELL_AURA_PERIODIC_TRIGGER_SPELL = 23,
|
||||
SPELL_AURA_PERIODIC_ENERGIZE = 24,
|
||||
SPELL_AURA_MOD_PACIFY = 25,
|
||||
SPELL_AURA_MOD_ROOT = 26,
|
||||
SPELL_AURA_MOD_SILENCE = 27,
|
||||
SPELL_AURA_REFLECT_SPELLS = 28,
|
||||
SPELL_AURA_MOD_STAT = 29,
|
||||
SPELL_AURA_MOD_SKILL = 30,
|
||||
SPELL_AURA_MOD_INCREASE_SPEED = 31,
|
||||
SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED = 32,
|
||||
SPELL_AURA_MOD_DECREASE_SPEED = 33,
|
||||
SPELL_AURA_MOD_INCREASE_HEALTH = 34,
|
||||
SPELL_AURA_MOD_INCREASE_ENERGY = 35,
|
||||
SPELL_AURA_MOD_SHAPESHIFT = 36,
|
||||
SPELL_AURA_EFFECT_IMMUNITY = 37,
|
||||
SPELL_AURA_STATE_IMMUNITY = 38,
|
||||
SPELL_AURA_SCHOOL_IMMUNITY = 39,
|
||||
SPELL_AURA_DAMAGE_IMMUNITY = 40,
|
||||
SPELL_AURA_DISPEL_IMMUNITY = 41,
|
||||
SPELL_AURA_PROC_TRIGGER_SPELL = 42,
|
||||
SPELL_AURA_PROC_TRIGGER_DAMAGE = 43,
|
||||
SPELL_AURA_TRACK_CREATURES = 44,
|
||||
SPELL_AURA_TRACK_RESOURCES = 45,
|
||||
SPELL_AURA_46 = 46, // Ignore all Gear test spells
|
||||
SPELL_AURA_MOD_PARRY_PERCENT = 47,
|
||||
SPELL_AURA_48 = 48, // One periodic spell
|
||||
SPELL_AURA_MOD_DODGE_PERCENT = 49,
|
||||
SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT = 50,
|
||||
SPELL_AURA_MOD_BLOCK_PERCENT = 51,
|
||||
SPELL_AURA_MOD_WEAPON_CRIT_PERCENT = 52,
|
||||
SPELL_AURA_PERIODIC_LEECH = 53,
|
||||
SPELL_AURA_MOD_HIT_CHANCE = 54,
|
||||
SPELL_AURA_MOD_SPELL_HIT_CHANCE = 55,
|
||||
SPELL_AURA_TRANSFORM = 56,
|
||||
SPELL_AURA_MOD_SPELL_CRIT_CHANCE = 57,
|
||||
SPELL_AURA_MOD_INCREASE_SWIM_SPEED = 58,
|
||||
SPELL_AURA_MOD_DAMAGE_DONE_CREATURE = 59,
|
||||
SPELL_AURA_MOD_PACIFY_SILENCE = 60,
|
||||
SPELL_AURA_MOD_SCALE = 61,
|
||||
SPELL_AURA_PERIODIC_HEALTH_FUNNEL = 62,
|
||||
SPELL_AURA_63 = 63, // old SPELL_AURA_PERIODIC_MANA_FUNNEL
|
||||
SPELL_AURA_PERIODIC_MANA_LEECH = 64,
|
||||
SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK = 65,
|
||||
SPELL_AURA_FEIGN_DEATH = 66,
|
||||
SPELL_AURA_MOD_DISARM = 67,
|
||||
SPELL_AURA_MOD_STALKED = 68,
|
||||
SPELL_AURA_SCHOOL_ABSORB = 69,
|
||||
SPELL_AURA_EXTRA_ATTACKS = 70,
|
||||
SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL = 71,
|
||||
SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT = 72,
|
||||
SPELL_AURA_MOD_POWER_COST_SCHOOL = 73,
|
||||
SPELL_AURA_REFLECT_SPELLS_SCHOOL = 74,
|
||||
SPELL_AURA_MOD_LANGUAGE = 75,
|
||||
SPELL_AURA_FAR_SIGHT = 76,
|
||||
SPELL_AURA_MECHANIC_IMMUNITY = 77,
|
||||
SPELL_AURA_MOUNTED = 78,
|
||||
SPELL_AURA_MOD_DAMAGE_PERCENT_DONE = 79,
|
||||
SPELL_AURA_MOD_PERCENT_STAT = 80,
|
||||
SPELL_AURA_SPLIT_DAMAGE_PCT = 81,
|
||||
SPELL_AURA_WATER_BREATHING = 82,
|
||||
SPELL_AURA_MOD_BASE_RESISTANCE = 83,
|
||||
SPELL_AURA_MOD_REGEN = 84,
|
||||
SPELL_AURA_MOD_POWER_REGEN = 85,
|
||||
SPELL_AURA_CHANNEL_DEATH_ITEM = 86,
|
||||
SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN = 87,
|
||||
SPELL_AURA_MOD_HEALTH_REGEN_PERCENT = 88,
|
||||
SPELL_AURA_PERIODIC_DAMAGE_PERCENT = 89,
|
||||
SPELL_AURA_90 = 90, // old SPELL_AURA_MOD_RESIST_CHANCE
|
||||
SPELL_AURA_MOD_DETECT_RANGE = 91,
|
||||
SPELL_AURA_PREVENTS_FLEEING = 92,
|
||||
SPELL_AURA_MOD_UNATTACKABLE = 93,
|
||||
SPELL_AURA_INTERRUPT_REGEN = 94,
|
||||
SPELL_AURA_GHOST = 95,
|
||||
SPELL_AURA_SPELL_MAGNET = 96,
|
||||
SPELL_AURA_MANA_SHIELD = 97,
|
||||
SPELL_AURA_MOD_SKILL_TALENT = 98,
|
||||
SPELL_AURA_MOD_ATTACK_POWER = 99,
|
||||
SPELL_AURA_AURAS_VISIBLE = 100,
|
||||
SPELL_AURA_MOD_RESISTANCE_PCT = 101,
|
||||
SPELL_AURA_MOD_MELEE_ATTACK_POWER_VERSUS = 102,
|
||||
SPELL_AURA_MOD_TOTAL_THREAT = 103,
|
||||
SPELL_AURA_WATER_WALK = 104,
|
||||
SPELL_AURA_FEATHER_FALL = 105,
|
||||
SPELL_AURA_HOVER = 106,
|
||||
SPELL_AURA_ADD_FLAT_MODIFIER = 107,
|
||||
SPELL_AURA_ADD_PCT_MODIFIER = 108,
|
||||
SPELL_AURA_ADD_TARGET_TRIGGER = 109,
|
||||
SPELL_AURA_MOD_POWER_REGEN_PERCENT = 110,
|
||||
SPELL_AURA_ADD_CASTER_HIT_TRIGGER = 111,
|
||||
SPELL_AURA_OVERRIDE_CLASS_SCRIPTS = 112,
|
||||
SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN = 113,
|
||||
SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT = 114,
|
||||
SPELL_AURA_MOD_HEALING = 115,
|
||||
SPELL_AURA_MOD_REGEN_DURING_COMBAT = 116,
|
||||
SPELL_AURA_MOD_MECHANIC_RESISTANCE = 117,
|
||||
SPELL_AURA_MOD_HEALING_PCT = 118,
|
||||
SPELL_AURA_119 = 119, // old SPELL_AURA_SHARE_PET_TRACKING
|
||||
SPELL_AURA_UNTRACKABLE = 120,
|
||||
SPELL_AURA_EMPATHY = 121,
|
||||
SPELL_AURA_MOD_OFFHAND_DAMAGE_PCT = 122,
|
||||
SPELL_AURA_MOD_TARGET_RESISTANCE = 123,
|
||||
SPELL_AURA_MOD_RANGED_ATTACK_POWER = 124,
|
||||
SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN = 125,
|
||||
SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT = 126,
|
||||
SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS = 127,
|
||||
SPELL_AURA_MOD_POSSESS_PET = 128,
|
||||
SPELL_AURA_MOD_SPEED_ALWAYS = 129,
|
||||
SPELL_AURA_MOD_MOUNTED_SPEED_ALWAYS = 130,
|
||||
SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS = 131,
|
||||
SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT = 132,
|
||||
SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT = 133,
|
||||
SPELL_AURA_MOD_MANA_REGEN_INTERRUPT = 134,
|
||||
SPELL_AURA_MOD_HEALING_DONE = 135,
|
||||
SPELL_AURA_MOD_HEALING_DONE_PERCENT = 136,
|
||||
SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE = 137,
|
||||
SPELL_AURA_MOD_MELEE_HASTE = 138,
|
||||
SPELL_AURA_FORCE_REACTION = 139,
|
||||
SPELL_AURA_MOD_RANGED_HASTE = 140,
|
||||
SPELL_AURA_MOD_RANGED_AMMO_HASTE = 141,
|
||||
SPELL_AURA_MOD_BASE_RESISTANCE_PCT = 142,
|
||||
SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE = 143,
|
||||
SPELL_AURA_SAFE_FALL = 144,
|
||||
SPELL_AURA_MOD_PET_TALENT_POINTS = 145,
|
||||
SPELL_AURA_ALLOW_TAME_PET_TYPE = 146,
|
||||
SPELL_AURA_MECHANIC_IMMUNITY_MASK = 147,
|
||||
SPELL_AURA_RETAIN_COMBO_POINTS = 148,
|
||||
SPELL_AURA_REDUCE_PUSHBACK = 149, // Reduce Pushback
|
||||
SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT = 150,
|
||||
SPELL_AURA_TRACK_STEALTHED = 151, // Track Stealthed
|
||||
SPELL_AURA_MOD_DETECTED_RANGE = 152, // Mod Detected Range
|
||||
SPELL_AURA_SPLIT_DAMAGE_FLAT = 153, // Split Damage Flat
|
||||
SPELL_AURA_MOD_STEALTH_LEVEL = 154, // Stealth Level Modifier
|
||||
SPELL_AURA_MOD_WATER_BREATHING = 155, // Mod Water Breathing
|
||||
SPELL_AURA_MOD_REPUTATION_GAIN = 156, // Mod Reputation Gain
|
||||
SPELL_AURA_PET_DAMAGE_MULTI = 157, // Mod Pet Damage
|
||||
SPELL_AURA_MOD_SHIELD_BLOCKVALUE = 158,
|
||||
SPELL_AURA_NO_PVP_CREDIT = 159,
|
||||
SPELL_AURA_MOD_AOE_AVOIDANCE = 160,
|
||||
SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT = 161,
|
||||
SPELL_AURA_POWER_BURN = 162,
|
||||
SPELL_AURA_MOD_CRIT_DAMAGE_BONUS = 163,
|
||||
SPELL_AURA_164 = 164,
|
||||
SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS = 165,
|
||||
SPELL_AURA_MOD_ATTACK_POWER_PCT = 166,
|
||||
SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT = 167,
|
||||
SPELL_AURA_MOD_DAMAGE_DONE_VERSUS = 168,
|
||||
SPELL_AURA_MOD_CRIT_PERCENT_VERSUS = 169,
|
||||
SPELL_AURA_DETECT_AMORE = 170,
|
||||
SPELL_AURA_MOD_SPEED_NOT_STACK = 171,
|
||||
SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK = 172,
|
||||
SPELL_AURA_173 = 173, // old SPELL_AURA_ALLOW_CHAMPION_SPELLS
|
||||
SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT = 174, // by defeult intelect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT
|
||||
SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT = 175,
|
||||
SPELL_AURA_SPIRIT_OF_REDEMPTION = 176,
|
||||
SPELL_AURA_AOE_CHARM = 177,
|
||||
SPELL_AURA_MOD_DEBUFF_RESISTANCE = 178,
|
||||
SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE = 179,
|
||||
SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS = 180,
|
||||
SPELL_AURA_181 = 181, // old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS - possible flat spell crit damage versus
|
||||
SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT = 182,
|
||||
SPELL_AURA_MOD_CRITICAL_THREAT = 183,
|
||||
SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE = 184,
|
||||
SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE= 185,
|
||||
SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE = 186,
|
||||
SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE = 187,
|
||||
SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_CHANCE = 188,
|
||||
SPELL_AURA_MOD_RATING = 189,
|
||||
SPELL_AURA_MOD_FACTION_REPUTATION_GAIN = 190,
|
||||
SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED = 191,
|
||||
SPELL_AURA_MOD_MELEE_RANGED_HASTE = 192,
|
||||
SPELL_AURA_MELEE_SLOW = 193,
|
||||
SPELL_AURA_MOD_TARGET_ABSORB_SCHOOL = 194,
|
||||
SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL = 195,
|
||||
SPELL_AURA_MOD_COOLDOWN = 196, // only 24818 Noxious Breath
|
||||
SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE = 197,
|
||||
SPELL_AURA_198 = 198, // old SPELL_AURA_MOD_ALL_WEAPON_SKILLS
|
||||
SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT = 199,
|
||||
SPELL_AURA_MOD_XP_PCT = 200,
|
||||
SPELL_AURA_FLY = 201,
|
||||
SPELL_AURA_IGNORE_COMBAT_RESULT = 202,
|
||||
SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE = 203,
|
||||
SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE = 204,
|
||||
SPELL_AURA_MOD_SCHOOL_CRIT_DMG_TAKEN = 205,
|
||||
SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED = 206,
|
||||
SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED = 207,
|
||||
SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED = 208,
|
||||
SPELL_AURA_MOD_MOUNTED_FLIGHT_SPEED_ALWAYS = 209,
|
||||
SPELL_AURA_MOD_VEHICLE_SPEED_ALWAYS = 210,
|
||||
SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK = 211,
|
||||
SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT = 212,
|
||||
SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT = 213,
|
||||
SPELL_AURA_214 = 214,
|
||||
SPELL_AURA_ARENA_PREPARATION = 215,
|
||||
SPELL_AURA_HASTE_SPELLS = 216,
|
||||
SPELL_AURA_MOD_MELEE_HASTE_2 = 217, // NYI
|
||||
SPELL_AURA_HASTE_RANGED = 218,
|
||||
SPELL_AURA_MOD_MANA_REGEN_FROM_STAT = 219,
|
||||
SPELL_AURA_MOD_RATING_FROM_STAT = 220,
|
||||
SPELL_AURA_IGNORED = 221,
|
||||
SPELL_AURA_222 = 222,
|
||||
SPELL_AURA_RAID_PROC_FROM_CHARGE = 223,
|
||||
SPELL_AURA_224 = 224,
|
||||
SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE = 225,
|
||||
SPELL_AURA_PERIODIC_DUMMY = 226,
|
||||
SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE = 227,
|
||||
SPELL_AURA_DETECT_STEALTH = 228,
|
||||
SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE = 229,
|
||||
SPELL_AURA_230 = 230,
|
||||
SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE = 231,
|
||||
SPELL_AURA_MECHANIC_DURATION_MOD = 232,
|
||||
SPELL_AURA_CHANGE_MODEL_FOR_ALL_HUMANOIDS = 233, // client-side only
|
||||
SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK = 234,
|
||||
SPELL_AURA_MOD_DISPEL_RESIST = 235,
|
||||
SPELL_AURA_CONTROL_VEHICLE = 236,
|
||||
SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER = 237,
|
||||
SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER = 238,
|
||||
SPELL_AURA_MOD_SCALE_2 = 239,
|
||||
SPELL_AURA_MOD_EXPERTISE = 240,
|
||||
SPELL_AURA_FORCE_MOVE_FORWARD = 241,
|
||||
SPELL_AURA_MOD_SPELL_DAMAGE_FROM_HEALING = 242,
|
||||
SPELL_AURA_MOD_FACTION = 243,
|
||||
SPELL_AURA_COMPREHEND_LANGUAGE = 244,
|
||||
SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL = 245,
|
||||
SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK = 246,
|
||||
SPELL_AURA_CLONE_CASTER = 247,
|
||||
SPELL_AURA_MOD_COMBAT_RESULT_CHANCE = 248,
|
||||
SPELL_AURA_CONVERT_RUNE = 249,
|
||||
SPELL_AURA_MOD_INCREASE_HEALTH_2 = 250,
|
||||
SPELL_AURA_MOD_ENEMY_DODGE = 251,
|
||||
SPELL_AURA_MOD_SPEED_SLOW_ALL = 252,
|
||||
SPELL_AURA_MOD_BLOCK_CRIT_CHANCE = 253,
|
||||
SPELL_AURA_MOD_DISARM_OFFHAND = 254,
|
||||
SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT = 255,
|
||||
SPELL_AURA_NO_REAGENT_USE = 256,
|
||||
SPELL_AURA_MOD_TARGET_RESIST_BY_SPELL_CLASS = 257,
|
||||
SPELL_AURA_258 = 258,
|
||||
SPELL_AURA_MOD_HOT_PCT = 259,
|
||||
SPELL_AURA_SCREEN_EFFECT = 260,
|
||||
SPELL_AURA_PHASE = 261,
|
||||
SPELL_AURA_ABILITY_IGNORE_AURASTATE = 262,
|
||||
SPELL_AURA_ALLOW_ONLY_ABILITY = 263,
|
||||
SPELL_AURA_264 = 264,
|
||||
SPELL_AURA_265 = 265,
|
||||
SPELL_AURA_266 = 266,
|
||||
SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL = 267,
|
||||
SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT = 268,
|
||||
SPELL_AURA_MOD_IGNORE_TARGET_RESIST = 269,
|
||||
SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST = 270, // Possibly need swap vs 195 aura used only in 1 spell Chaos Bolt Passive
|
||||
SPELL_AURA_MOD_DAMAGE_FROM_CASTER = 271,
|
||||
SPELL_AURA_IGNORE_MELEE_RESET = 272,
|
||||
SPELL_AURA_X_RAY = 273,
|
||||
SPELL_AURA_ABILITY_CONSUME_NO_AMMO = 274,
|
||||
SPELL_AURA_MOD_IGNORE_SHAPESHIFT = 275,
|
||||
SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC = 276, // NYI
|
||||
SPELL_AURA_MOD_MAX_AFFECTED_TARGETS = 277,
|
||||
SPELL_AURA_MOD_DISARM_RANGED = 278,
|
||||
SPELL_AURA_INITIALIZE_IMAGES = 279,
|
||||
SPELL_AURA_MOD_ARMOR_PENETRATION_PCT = 280,
|
||||
SPELL_AURA_MOD_HONOR_GAIN_PCT = 281,
|
||||
SPELL_AURA_MOD_BASE_HEALTH_PCT = 282,
|
||||
SPELL_AURA_MOD_HEALING_RECEIVED = 283, // Possibly only for some spell family class spells
|
||||
SPELL_AURA_LINKED = 284,
|
||||
SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR = 285,
|
||||
SPELL_AURA_ABILITY_PERIODIC_CRIT = 286,
|
||||
SPELL_AURA_DEFLECT_SPELLS = 287,
|
||||
SPELL_AURA_IGNORE_HIT_DIRECTION = 288,
|
||||
SPELL_AURA_289 = 289,
|
||||
SPELL_AURA_MOD_CRIT_PCT = 290,
|
||||
SPELL_AURA_MOD_XP_QUEST_PCT = 291,
|
||||
SPELL_AURA_OPEN_STABLE = 292,
|
||||
SPELL_AURA_OVERRIDE_SPELLS = 293,
|
||||
SPELL_AURA_PREVENT_REGENERATE_POWER = 294,
|
||||
SPELL_AURA_295 = 295,
|
||||
SPELL_AURA_SET_VEHICLE_ID = 296,
|
||||
SPELL_AURA_BLOCK_SPELL_FAMILY = 297,
|
||||
SPELL_AURA_STRANGULATE = 298,
|
||||
SPELL_AURA_299 = 299,
|
||||
SPELL_AURA_SHARE_DAMAGE_PCT = 300,
|
||||
SPELL_AURA_SCHOOL_HEAL_ABSORB = 301,
|
||||
SPELL_AURA_302 = 302,
|
||||
SPELL_AURA_MOD_DAMAGE_DONE_VERSUS_AURASTATE = 303,
|
||||
SPELL_AURA_MOD_FAKE_INEBRIATE = 304,
|
||||
SPELL_AURA_MOD_MINIMUM_SPEED = 305,
|
||||
SPELL_AURA_306 = 306,
|
||||
SPELL_AURA_HEAL_ABSORB_TEST = 307,
|
||||
SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER = 308,
|
||||
SPELL_AURA_309 = 309,
|
||||
SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE = 310,
|
||||
SPELL_AURA_311 = 311,
|
||||
SPELL_AURA_312 = 312,
|
||||
SPELL_AURA_313 = 313,
|
||||
SPELL_AURA_PREVENT_RESURRECTION = 314,
|
||||
SPELL_AURA_UNDERWATER_WALKING = 315,
|
||||
SPELL_AURA_PERIODIC_HASTE = 316,
|
||||
TOTAL_AURAS = 317
|
||||
};
|
||||
|
||||
enum AuraObjectType
|
||||
{
|
||||
UNIT_AURA_TYPE,
|
||||
DYNOBJ_AURA_TYPE,
|
||||
};
|
||||
#endif
|
||||
6745
src/server/game/Spells/Auras/SpellAuraEffects.cpp
Normal file
6745
src/server/game/Spells/Auras/SpellAuraEffects.cpp
Normal file
File diff suppressed because it is too large
Load Diff
392
src/server/game/Spells/Auras/SpellAuraEffects.h
Normal file
392
src/server/game/Spells/Auras/SpellAuraEffects.h
Normal file
@@ -0,0 +1,392 @@
|
||||
/*
|
||||
* Copyright (C)
|
||||
* Copyright (C)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_SPELLAURAEFFECTS_H
|
||||
#define TRINITY_SPELLAURAEFFECTS_H
|
||||
|
||||
class Unit;
|
||||
class AuraEffect;
|
||||
class Aura;
|
||||
|
||||
#include "SpellAuras.h"
|
||||
#include "Spell.h"
|
||||
|
||||
typedef void(AuraEffect::*pAuraEffectHandler)(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
|
||||
class AuraEffect
|
||||
{
|
||||
friend void Aura::_InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount);
|
||||
friend Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID, bool noPeriodicReset);
|
||||
friend Aura::~Aura();
|
||||
private:
|
||||
~AuraEffect();
|
||||
explicit AuraEffect(Aura* base, uint8 effIndex, int32 *baseAmount, Unit* caster);
|
||||
public:
|
||||
Unit* GetCaster() const { return GetBase()->GetCaster(); }
|
||||
uint64 GetCasterGUID() const { return GetBase()->GetCasterGUID(); }
|
||||
Aura* GetBase() const { return m_base; }
|
||||
void GetTargetList(std::list<Unit*> & targetList) const;
|
||||
void GetApplicationList(std::list<AuraApplication*> & applicationList) const;
|
||||
SpellModifier* GetSpellModifier() const { return m_spellmod; }
|
||||
|
||||
SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
|
||||
uint32 GetId() const { return m_spellInfo->Id; }
|
||||
uint32 GetEffIndex() const { return m_effIndex; }
|
||||
int32 GetBaseAmount() const { return m_baseAmount; }
|
||||
int32 GetAmplitude() const { return m_amplitude; }
|
||||
|
||||
int32 GetMiscValueB() const { return m_spellInfo->Effects[m_effIndex].MiscValueB; }
|
||||
int32 GetMiscValue() const { return m_spellInfo->Effects[m_effIndex].MiscValue; }
|
||||
AuraType GetAuraType() const { return (AuraType)m_spellInfo->Effects[m_effIndex].ApplyAuraName; }
|
||||
int32 GetAmount() const { return m_isAuraEnabled ? m_amount : 0; }
|
||||
int32 GetForcedAmount() const { return m_amount; }
|
||||
void SetAmount(int32 amount) { m_amount = amount; m_canBeRecalculated = false;}
|
||||
|
||||
int32 GetPeriodicTimer() const { return m_periodicTimer; }
|
||||
void SetPeriodicTimer(int32 periodicTimer) { m_periodicTimer = periodicTimer; }
|
||||
|
||||
int32 CalculateAmount(Unit* caster);
|
||||
void CalculatePeriodic(Unit* caster, bool create = false, bool load = false);
|
||||
void CalculatePeriodicData();
|
||||
void CalculateSpellMod();
|
||||
void ChangeAmount(int32 newAmount, bool mark = true, bool onStackOrReapply = false);
|
||||
void RecalculateAmount() { if (!CanBeRecalculated()) return; ChangeAmount(CalculateAmount(GetCaster()), false); }
|
||||
void RecalculateAmount(Unit* caster) { if (!CanBeRecalculated()) return; ChangeAmount(CalculateAmount(caster), false); }
|
||||
bool CanBeRecalculated() const { return m_canBeRecalculated; }
|
||||
void SetCanBeRecalculated(bool val) { m_canBeRecalculated = val; }
|
||||
void HandleEffect(AuraApplication * aurApp, uint8 mode, bool apply);
|
||||
void HandleEffect(Unit* target, uint8 mode, bool apply);
|
||||
void ApplySpellMod(Unit* target, bool apply);
|
||||
|
||||
void Update(uint32 diff, Unit* caster);
|
||||
void UpdatePeriodic(Unit* caster);
|
||||
|
||||
uint32 GetTickNumber() const { return m_tickNumber; }
|
||||
int32 GetTotalTicks() const { return m_amplitude ? (GetBase()->GetMaxDuration() / m_amplitude) : 1;}
|
||||
void ResetPeriodic(bool resetPeriodicTimer = false) { if (resetPeriodicTimer) m_periodicTimer = m_amplitude; m_tickNumber = 0;}
|
||||
|
||||
bool IsPeriodic() const { return m_isPeriodic; }
|
||||
void SetPeriodic(bool isPeriodic) { m_isPeriodic = isPeriodic; }
|
||||
bool IsAffectedOnSpell(SpellInfo const* spell) const;
|
||||
bool HasSpellClassMask() const { return m_spellInfo->Effects[m_effIndex].SpellClassMask; }
|
||||
|
||||
void SendTickImmune(Unit* target, Unit* caster) const;
|
||||
void PeriodicTick(AuraApplication * aurApp, Unit* caster) const;
|
||||
|
||||
void HandleProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
|
||||
void CleanupTriggeredSpells(Unit* target);
|
||||
|
||||
// add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras
|
||||
void HandleShapeshiftBoosts(Unit* target, bool apply) const;
|
||||
|
||||
// xinef: storing initial crit chance
|
||||
float GetCritChance() const { return m_critChance; }
|
||||
void SetCritChance(float crit) { m_critChance = crit; }
|
||||
uint8 GetCasterLevel() const { return m_casterLevel; }
|
||||
bool CanApplyResilience() const { return m_applyResilience; }
|
||||
float GetPctMods() const { return m_pctMods; }
|
||||
|
||||
// xinef: stacking
|
||||
uint32 GetAuraGroup() const { return m_auraGroup; }
|
||||
int32 GetOldAmount() const { return m_oldAmount; }
|
||||
void SetOldAmount(int32 amount) { m_oldAmount = amount; }
|
||||
void SetEnabled(bool enabled) { m_isAuraEnabled = enabled; }
|
||||
|
||||
private:
|
||||
Aura* const m_base;
|
||||
|
||||
SpellInfo const* const m_spellInfo;
|
||||
int32 const m_baseAmount;
|
||||
|
||||
bool m_applyResilience;
|
||||
uint8 m_casterLevel;
|
||||
int32 m_amount;
|
||||
float m_critChance;
|
||||
float m_pctMods;
|
||||
|
||||
// xinef: stacking
|
||||
uint32 m_auraGroup;
|
||||
int32 m_oldAmount;
|
||||
bool m_isAuraEnabled;
|
||||
// xinef: channel information for channel triggering
|
||||
ChannelTargetData* m_channelData;
|
||||
|
||||
|
||||
SpellModifier* m_spellmod;
|
||||
|
||||
int32 m_periodicTimer;
|
||||
int32 m_amplitude;
|
||||
uint32 m_tickNumber;
|
||||
|
||||
uint8 const m_effIndex;
|
||||
bool m_canBeRecalculated;
|
||||
bool m_isPeriodic;
|
||||
private:
|
||||
float CalcPeriodicCritChance(Unit const* caster, Unit const* target) const;
|
||||
|
||||
public:
|
||||
// aura effect apply/remove handlers
|
||||
void HandleNULL(AuraApplication const* /*aurApp*/, uint8 /*mode*/, bool /*apply*/) const
|
||||
{
|
||||
// not implemented
|
||||
}
|
||||
void HandleUnused(AuraApplication const* /*aurApp*/, uint8 /*mode*/, bool /*apply*/) const
|
||||
{
|
||||
// useless
|
||||
}
|
||||
void HandleNoImmediateEffect(AuraApplication const* /*aurApp*/, uint8 /*mode*/, bool /*apply*/) const
|
||||
{
|
||||
// aura type not have immediate effect at add/remove and handled by ID in other code place
|
||||
}
|
||||
// visibility & phases
|
||||
void HandleModInvisibilityDetect(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModInvisibility(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModStealth(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModStealthLevel(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModStealthDetect(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleSpiritOfRedemption(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraGhost(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandlePhase(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// unit model
|
||||
void HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraTransform(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModScale(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraCloneCaster(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// fight
|
||||
void HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModUnattackable(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModSilence(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModPacify(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModPacifyAndSilence(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraAllowOnlyAbility(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// tracking
|
||||
void HandleAuraTrackResources(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraTrackCreatures(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraTrackStealthed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModStalked(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraUntrackable(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// skills & talents
|
||||
void HandleAuraModPetTalentsPoints(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModSkill(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// movement
|
||||
void HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraHover(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleWaterBreathing(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleForceMoveForward(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// threat
|
||||
void HandleModThreat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModTotalThreat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModTaunt(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// control
|
||||
void HandleModConfuse(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModFear(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModStun(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRoot(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandlePreventFleeing(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// charm
|
||||
void HandleModPossess(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModPossessPet(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModCharm(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleCharmConvert(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraControlVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// modify speed
|
||||
void HandleAuraModIncreaseSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseMountedSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseSwimSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModDecreaseSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModUseNormalSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// immunity
|
||||
void HandleModStateImmunityMask(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModMechanicImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModEffectImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModStateImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModDmgImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModDispelImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// modify stats
|
||||
// resistance
|
||||
void HandleAuraModResistanceExclusive(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModResistance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModBaseResistancePCT(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModResistancePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModBaseResistance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModTargetResistance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// stat
|
||||
void HandleAuraModStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModPercentStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellDamagePercentFromStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellHealingPercentFromStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellDamagePercentFromAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellHealingPercentFromAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModHealingDone(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModTotalPercentStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModResistenceOfStatPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModExpertise(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// heal and energize
|
||||
void HandleModPowerRegen(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModPowerRegenPCT(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModManaRegen(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseHealth(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseMaxHealth(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseEnergy(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseEnergyPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseHealthPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraIncreaseBaseHealthPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// fight
|
||||
void HandleAuraModParryPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModDodgePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModBlockPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRegenInterrupt(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModWeaponCritPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModHitChance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellHitChance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellCritChance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellCritChanceShool(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModCritPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// attack speed
|
||||
void HandleModCastingSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModMeleeRangedSpeedPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModCombatSpeedPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModAttackSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModMeleeSpeedPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRangedHaste(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleRangedAmmoHaste(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// combat rating
|
||||
void HandleModRating(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModRatingFromStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// attack power
|
||||
void HandleAuraModAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRangedAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModAttackPowerPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRangedAttackPowerPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRangedAttackPowerOfStatPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModAttackPowerOfStatPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModAttackPowerOfArmor(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// damage bonus
|
||||
void HandleModDamageDone(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModDamagePercentDone(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModOffhandDamagePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleShieldBlockValue(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// power cost
|
||||
void HandleModPowerCostPCT(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModPowerCost(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleArenaPreparation(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleNoReagentUseAura(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraRetainComboPoints(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// others
|
||||
void HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleChannelDeathItem(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleBindSight(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleForceReaction(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraEmpathy(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModFaction(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleComprehendLanguage(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraConvertRune(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraLinked(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraOpenStable(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModFakeInebriation(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandlePreventResurrection(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
|
||||
// aura effect periodic tick handlers
|
||||
void HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandleObsModPowerAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) const;
|
||||
|
||||
// aura effect proc handlers
|
||||
void HandleProcTriggerSpellAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
void HandleProcTriggerSpellWithValueAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
void HandleProcTriggerDamageAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
void HandleRaidProcFromChargeAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
void HandleRaidProcFromChargeWithValueAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
};
|
||||
|
||||
namespace Trinity
|
||||
{
|
||||
// Binary predicate for sorting the priority of absorption aura effects
|
||||
class AbsorbAuraOrderPred
|
||||
{
|
||||
public:
|
||||
AbsorbAuraOrderPred() { }
|
||||
bool operator() (AuraEffect* aurEffA, AuraEffect* aurEffB) const
|
||||
{
|
||||
SpellInfo const* spellProtoA = aurEffA->GetSpellInfo();
|
||||
SpellInfo const* spellProtoB = aurEffB->GetSpellInfo();
|
||||
|
||||
// Wards
|
||||
if ((spellProtoA->SpellFamilyName == SPELLFAMILY_MAGE) ||
|
||||
(spellProtoA->SpellFamilyName == SPELLFAMILY_WARLOCK))
|
||||
if (spellProtoA->GetCategory() == 56)
|
||||
return true;
|
||||
if ((spellProtoB->SpellFamilyName == SPELLFAMILY_MAGE) ||
|
||||
(spellProtoB->SpellFamilyName == SPELLFAMILY_WARLOCK))
|
||||
if (spellProtoB->GetCategory() == 56)
|
||||
return false;
|
||||
|
||||
// Sacred Shield
|
||||
if (spellProtoA->Id == 58597)
|
||||
return true;
|
||||
if (spellProtoB->Id == 58597)
|
||||
return false;
|
||||
|
||||
// Fel Blossom
|
||||
if (spellProtoA->Id == 28527)
|
||||
return true;
|
||||
if (spellProtoB->Id == 28527)
|
||||
return false;
|
||||
|
||||
// Divine Aegis
|
||||
if (spellProtoA->Id == 47753)
|
||||
return true;
|
||||
if (spellProtoB->Id == 47753)
|
||||
return false;
|
||||
|
||||
// Ice Barrier
|
||||
if (spellProtoA->GetCategory() == 471)
|
||||
return true;
|
||||
if (spellProtoB->GetCategory() == 471)
|
||||
return false;
|
||||
|
||||
// Sacrifice
|
||||
if ((spellProtoA->SpellFamilyName == SPELLFAMILY_WARLOCK) &&
|
||||
(spellProtoA->SpellIconID == 693))
|
||||
return true;
|
||||
if ((spellProtoB->SpellFamilyName == SPELLFAMILY_WARLOCK) &&
|
||||
(spellProtoB->SpellIconID == 693))
|
||||
return false;
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif
|
||||
2718
src/server/game/Spells/Auras/SpellAuras.cpp
Normal file
2718
src/server/game/Spells/Auras/SpellAuras.cpp
Normal file
File diff suppressed because it is too large
Load Diff
304
src/server/game/Spells/Auras/SpellAuras.h
Normal file
304
src/server/game/Spells/Auras/SpellAuras.h
Normal file
@@ -0,0 +1,304 @@
|
||||
/*
|
||||
* Copyright (C)
|
||||
* Copyright (C)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_SPELLAURAS_H
|
||||
#define TRINITY_SPELLAURAS_H
|
||||
|
||||
#include "SpellAuraDefines.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "Unit.h"
|
||||
|
||||
class Unit;
|
||||
class SpellInfo;
|
||||
struct SpellModifier;
|
||||
struct ProcTriggerSpell;
|
||||
struct SpellProcEntry;
|
||||
|
||||
// forward decl
|
||||
class AuraEffect;
|
||||
class Aura;
|
||||
class DynamicObject;
|
||||
class AuraScript;
|
||||
class ProcInfo;
|
||||
|
||||
// update aura target map every 500 ms instead of every update - reduce amount of grid searcher calls
|
||||
#define UPDATE_TARGET_MAP_INTERVAL 500
|
||||
|
||||
class AuraApplication
|
||||
{
|
||||
friend void Unit::_ApplyAura(AuraApplication * aurApp, uint8 effMask);
|
||||
friend void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode);
|
||||
friend void Unit::_ApplyAuraEffect(Aura* aura, uint8 effIndex);
|
||||
friend void Unit::RemoveAura(AuraApplication * aurApp, AuraRemoveMode mode);
|
||||
friend AuraApplication * Unit::_CreateAuraApplication(Aura* aura, uint8 effMask);
|
||||
private:
|
||||
Unit* const _target;
|
||||
Aura* const _base;
|
||||
AuraRemoveMode _removeMode:8; // Store info for know remove aura reason
|
||||
uint8 _slot; // Aura slot on unit
|
||||
uint8 _flags; // Aura info flag
|
||||
uint8 _effectsToApply; // Used only at spell hit to determine which effect should be applied
|
||||
bool _needClientUpdate:1;
|
||||
|
||||
// xinef: stacking
|
||||
uint8 _disableMask;
|
||||
|
||||
explicit AuraApplication(Unit* target, Unit* caster, Aura* base, uint8 effMask);
|
||||
void _Remove();
|
||||
private:
|
||||
void _InitFlags(Unit* caster, uint8 effMask);
|
||||
void _HandleEffect(uint8 effIndex, bool apply);
|
||||
public:
|
||||
|
||||
Unit* GetTarget() const { return _target; }
|
||||
Aura* GetBase() const { return _base; }
|
||||
|
||||
uint8 GetSlot() const { return _slot; }
|
||||
uint8 GetFlags() const { return _flags; }
|
||||
uint8 GetEffectMask() const { return _flags & (AFLAG_EFF_INDEX_0 | AFLAG_EFF_INDEX_1 | AFLAG_EFF_INDEX_2); }
|
||||
bool HasEffect(uint8 effect) const { ASSERT(effect < MAX_SPELL_EFFECTS); return _flags & (1<<effect); }
|
||||
bool IsPositive() const { return _flags & AFLAG_POSITIVE; }
|
||||
bool IsSelfcasted() const { return _flags & AFLAG_CASTER; }
|
||||
uint8 GetEffectsToApply() const { return _effectsToApply; }
|
||||
|
||||
void SetRemoveMode(AuraRemoveMode mode) { _removeMode = mode; }
|
||||
AuraRemoveMode GetRemoveMode() const {return _removeMode;}
|
||||
|
||||
void SetNeedClientUpdate() { _needClientUpdate = true;}
|
||||
bool IsNeedClientUpdate() const { return _needClientUpdate;}
|
||||
void BuildUpdatePacket(ByteBuffer& data, bool remove) const;
|
||||
void ClientUpdate(bool remove = false);
|
||||
|
||||
// xinef: stacking
|
||||
bool IsActive(uint8 effIdx) { return ((1 << effIdx) & _disableMask) == 0; }
|
||||
void SetDisableMask(uint8 effIdx) { _disableMask |= 1 << effIdx; }
|
||||
void RemoveDisableMask(uint8 effIdx) { _disableMask &= ~(1 << effIdx); }
|
||||
};
|
||||
|
||||
class Aura
|
||||
{
|
||||
friend Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID, bool noPeriodicReset);
|
||||
public:
|
||||
typedef std::map<uint64, AuraApplication *> ApplicationMap;
|
||||
|
||||
static uint8 BuildEffectMaskForOwner(SpellInfo const* spellProto, uint8 avalibleEffectMask, WorldObject* owner);
|
||||
static Aura* TryRefreshStackOrCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject* owner, Unit* caster, int32* baseAmount = NULL, Item* castItem = NULL, uint64 casterGUID = 0, bool* refresh = NULL, bool periodicReset = false);
|
||||
static Aura* TryCreate(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount = NULL, Item* castItem = NULL, uint64 casterGUID = 0);
|
||||
static Aura* Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID);
|
||||
explicit Aura(SpellInfo const* spellproto, WorldObject* owner, Unit* caster, Item* castItem, uint64 casterGUID);
|
||||
void _InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount);
|
||||
virtual ~Aura();
|
||||
|
||||
SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
|
||||
uint32 GetId() const{ return GetSpellInfo()->Id; }
|
||||
|
||||
uint64 GetCastItemGUID() const { return m_castItemGuid; }
|
||||
uint64 GetCasterGUID() const { return m_casterGuid; }
|
||||
Unit* GetCaster() const;
|
||||
WorldObject* GetOwner() const { return m_owner; }
|
||||
Unit* GetUnitOwner() const { ASSERT(GetType() == UNIT_AURA_TYPE); return (Unit*)m_owner; }
|
||||
DynamicObject* GetDynobjOwner() const { ASSERT(GetType() == DYNOBJ_AURA_TYPE); return (DynamicObject*)m_owner; }
|
||||
|
||||
AuraObjectType GetType() const;
|
||||
|
||||
virtual void _ApplyForTarget(Unit* target, Unit* caster, AuraApplication * auraApp);
|
||||
virtual void _UnapplyForTarget(Unit* target, Unit* caster, AuraApplication * auraApp);
|
||||
void _Remove(AuraRemoveMode removeMode);
|
||||
virtual void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT) = 0;
|
||||
|
||||
virtual void FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster) = 0;
|
||||
void UpdateTargetMap(Unit* caster, bool apply = true);
|
||||
|
||||
void _RegisterForTargets() {Unit* caster = GetCaster(); UpdateTargetMap(caster, false);}
|
||||
void ApplyForTargets() {Unit* caster = GetCaster(); UpdateTargetMap(caster, true);}
|
||||
void _ApplyEffectForTargets(uint8 effIndex);
|
||||
|
||||
void UpdateOwner(uint32 diff, WorldObject* owner);
|
||||
void Update(uint32 diff, Unit* caster);
|
||||
|
||||
time_t GetApplyTime() const { return m_applyTime; }
|
||||
int32 GetMaxDuration() const { return m_maxDuration; }
|
||||
void SetMaxDuration(int32 duration) { m_maxDuration = duration; }
|
||||
int32 CalcMaxDuration() const { return CalcMaxDuration(GetCaster()); }
|
||||
int32 CalcMaxDuration(Unit* caster) const;
|
||||
int32 GetDuration() const { return m_duration; }
|
||||
void SetDuration(int32 duration, bool withMods = false);
|
||||
void RefreshDuration();
|
||||
void RefreshTimers(bool periodicReset = false);
|
||||
void RefreshTimersWithMods();
|
||||
bool IsExpired() const { return !GetDuration();}
|
||||
bool IsPermanent() const { return GetMaxDuration() == -1; }
|
||||
|
||||
uint8 GetCharges() const { return m_procCharges; }
|
||||
void SetCharges(uint8 charges);
|
||||
uint8 CalcMaxCharges(Unit* caster) const;
|
||||
uint8 CalcMaxCharges() const { return CalcMaxCharges(GetCaster()); }
|
||||
bool ModCharges(int32 num, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
bool DropCharge(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT) { return ModCharges(-1, removeMode); }
|
||||
|
||||
uint8 GetStackAmount() const { return m_stackAmount; }
|
||||
void SetStackAmount(uint8 num);
|
||||
bool ModStackAmount(int32 num, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT, bool periodicReset = false);
|
||||
|
||||
void RefreshSpellMods();
|
||||
|
||||
uint8 GetCasterLevel() const { return m_casterLevel; }
|
||||
|
||||
bool IsArea() const;
|
||||
bool IsPassive() const;
|
||||
bool IsDeathPersistent() const;
|
||||
bool IsRemovedOnShapeLost(Unit* target) const { return (GetCasterGUID() == target->GetGUID() && m_spellInfo->Stances && !m_spellInfo->HasAttribute(SPELL_ATTR2_NOT_NEED_SHAPESHIFT) && !m_spellInfo->HasAttribute(SPELL_ATTR0_NOT_SHAPESHIFT)); }
|
||||
bool CanBeSaved() const;
|
||||
bool IsRemoved() const { return m_isRemoved; }
|
||||
bool CanBeSentToClient() const;
|
||||
// Single cast aura helpers
|
||||
bool IsSingleTarget() const {return m_isSingleTarget; }
|
||||
bool IsSingleTargetWith(Aura const* aura) const;
|
||||
void SetIsSingleTarget(bool val) { m_isSingleTarget = val; }
|
||||
void UnregisterSingleTarget();
|
||||
int32 CalcDispelChance(Unit* auraTarget, bool offensive) const;
|
||||
|
||||
void SetLoadedState(int32 maxduration, int32 duration, int32 charges, uint8 stackamount, uint8 recalculateMask, int32 * amount);
|
||||
|
||||
// helpers for aura effects
|
||||
bool HasEffect(uint8 effIndex) const { return bool(GetEffect(effIndex)); }
|
||||
bool HasEffectType(AuraType type) const;
|
||||
AuraEffect* GetEffect(uint8 effIndex) const { ASSERT (effIndex < MAX_SPELL_EFFECTS); return m_effects[effIndex]; }
|
||||
uint8 GetEffectMask() const { uint8 effMask = 0; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (m_effects[i]) effMask |= 1<<i; return effMask; }
|
||||
void RecalculateAmountOfEffects();
|
||||
void HandleAllEffects(AuraApplication * aurApp, uint8 mode, bool apply);
|
||||
|
||||
// Helpers for targets
|
||||
ApplicationMap const & GetApplicationMap() {return m_applications;}
|
||||
void GetApplicationList(std::list<AuraApplication*> & applicationList) const;
|
||||
const AuraApplication * GetApplicationOfTarget (uint64 guid) const { ApplicationMap::const_iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return NULL; }
|
||||
AuraApplication * GetApplicationOfTarget (uint64 guid) { ApplicationMap::iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return NULL; }
|
||||
bool IsAppliedOnTarget(uint64 guid) const { return m_applications.find(guid) != m_applications.end(); }
|
||||
|
||||
void SetNeedClientUpdateForTargets() const;
|
||||
void HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, bool apply, bool onReapply);
|
||||
bool CanBeAppliedOn(Unit* target);
|
||||
bool CheckAreaTarget(Unit* target);
|
||||
bool CanStackWith(Aura const* checkAura, bool remove) const;
|
||||
bool IsAuraStronger(Aura const* newAura) const;
|
||||
|
||||
// Proc system
|
||||
// this subsystem is not yet in use - the core of it is functional, but still some research has to be done
|
||||
// and some dependant problems fixed before it can replace old proc system (for example cooldown handling)
|
||||
// currently proc system functionality is implemented in Unit::ProcDamageAndSpell
|
||||
bool IsProcOnCooldown() const;
|
||||
void AddProcCooldown(uint32 msec);
|
||||
bool IsUsingCharges() const { return m_isUsingCharges; }
|
||||
void SetUsingCharges(bool val) { m_isUsingCharges = val; }
|
||||
void PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
bool IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo) const;
|
||||
float CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const;
|
||||
void TriggerProcOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
|
||||
// AuraScript
|
||||
void LoadScripts();
|
||||
bool CallScriptCheckAreaTargetHandlers(Unit* target);
|
||||
void CallScriptDispel(DispelInfo* dispelInfo);
|
||||
void CallScriptAfterDispel(DispelInfo* dispelInfo);
|
||||
bool CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
|
||||
bool CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
|
||||
void CallScriptAfterEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
|
||||
void CallScriptAfterEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
|
||||
bool CallScriptEffectPeriodicHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp);
|
||||
void CallScriptEffectUpdatePeriodicHandlers(AuraEffect* aurEff);
|
||||
void CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32 & amount, bool & canBeRecalculated);
|
||||
void CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool & isPeriodic, int32 & amplitude);
|
||||
void CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellModifier* & spellMod);
|
||||
void CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & defaultPrevented);
|
||||
void CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount);
|
||||
void CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & defaultPrevented);
|
||||
void CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount);
|
||||
void CallScriptEffectSplitHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & splitAmount);
|
||||
|
||||
// Spell Proc Hooks
|
||||
bool CallScriptCheckProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
bool CallScriptPrepareProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
bool CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
void CallScriptAfterProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
bool CallScriptEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
void CallScriptAfterEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
|
||||
AuraScript* GetScriptByName(std::string const& scriptName) const;
|
||||
|
||||
std::list<AuraScript*> m_loadedScripts;
|
||||
private:
|
||||
void _DeleteRemovedApplications();
|
||||
protected:
|
||||
SpellInfo const* const m_spellInfo;
|
||||
uint64 const m_casterGuid;
|
||||
uint64 const m_castItemGuid; // it is NOT safe to keep a pointer to the item because it may get deleted
|
||||
time_t const m_applyTime;
|
||||
WorldObject* const m_owner; //
|
||||
|
||||
int32 m_maxDuration; // Max aura duration
|
||||
int32 m_duration; // Current time
|
||||
int32 m_timeCla; // Timer for power per sec calcultion
|
||||
int32 m_updateTargetMapInterval; // Timer for UpdateTargetMapOfEffect
|
||||
|
||||
uint8 const m_casterLevel; // Aura level (store caster level for correct show level dep amount)
|
||||
uint8 m_procCharges; // Aura charges (0 for infinite)
|
||||
uint8 m_stackAmount; // Aura stack amount
|
||||
|
||||
AuraEffect* m_effects[3];
|
||||
ApplicationMap m_applications;
|
||||
|
||||
bool m_isRemoved:1;
|
||||
bool m_isSingleTarget:1; // true if it's a single target spell and registered at caster - can change at spell steal for example
|
||||
bool m_isUsingCharges:1;
|
||||
|
||||
private:
|
||||
Unit::AuraApplicationList m_removedApplications;
|
||||
};
|
||||
|
||||
class UnitAura : public Aura
|
||||
{
|
||||
friend Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
protected:
|
||||
explicit UnitAura(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
public:
|
||||
void _ApplyForTarget(Unit* target, Unit* caster, AuraApplication * aurApp);
|
||||
void _UnapplyForTarget(Unit* target, Unit* caster, AuraApplication * aurApp);
|
||||
|
||||
void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
|
||||
void FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster);
|
||||
|
||||
// Allow Apply Aura Handler to modify and access m_AuraDRGroup
|
||||
void SetDiminishGroup(DiminishingGroup group) { m_AuraDRGroup = group; }
|
||||
DiminishingGroup GetDiminishGroup() const { return m_AuraDRGroup; }
|
||||
|
||||
private:
|
||||
DiminishingGroup m_AuraDRGroup:8; // Diminishing
|
||||
};
|
||||
|
||||
class DynObjAura : public Aura
|
||||
{
|
||||
friend Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
protected:
|
||||
explicit DynObjAura(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
public:
|
||||
void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
|
||||
void FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster);
|
||||
};
|
||||
#endif
|
||||
Reference in New Issue
Block a user