root/trunk/src/arcemu-world/SpellAuras.h @ 3151

Revision 3151, 38.2 kB (checked in by AlexisB, 7 months ago)

ADDED: You can now log in with 3.3.2 build 11403. Expect client crashes and weird behavior! Thanks to Mangos for the packet/dbc changes.

  • Property svn:eol-style set to native
  • Property ff set to
    *.cpp = svn:eol-style=native
    Makefile = svn:eol-style=native
    README = svn:eol-style=native
    CHANGELOG = svn:eol-style=native
    LICENSE = svn:eol-style=native
  • Property svn:keywords set to Date Author Rev
Line 
1/*
2 * ArcEmu MMORPG Server
3 * Copyright (C) 2005-2007 Ascent Team <http://www.ascentemu.com/>
4 * Copyright (C) 2008-2010 <http://www.ArcEmu.org/>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21//! 4-bit flag
22enum AURA_FLAGS
23{
24        AFLAG_EMPTY                     = 0x0,
25        AFLAG_EFFECT_1          = 0x1,
26        AFLAG_EFFECT_2          = 0x2,
27        AFLAG_EFFECT_3          = 0x4,
28        AFLAG_NOT_CASTER        = 0x8,
29        AFLAG_SET                       = 0x9,
30        AFLAG_POSTIVE           = 0x10,
31        AFLAG_DURATION          = 0x20,
32        AFLAG_HIDE                      = 0x40, // Seems to hide the aura and tell client the aura was removed
33        AFLAG_NEGATIVE          = 0x80
34};
35
36enum AURA_INTERNAL_USAGE_FLAGS
37{
38        //if all 3 mods are resisted then we can send client as a fully resisted spell.
39        //don't change the value of these !
40        MOD_0_RESISTED  = 1,
41        MOD_1_RESISTED  = 2,
42        MOD_2_RESISTED  = 4,
43};
44
45enum AURA_STATE_FLAGS
46{
47        AURASTATE_FLAG_DODGE_BLOCK                      = 0x000001,     //1
48        AURASTATE_FLAG_HEALTH20                         = 0x000002,     //2
49        AURASTATE_FLAG_BERSERK                          = 0x000004,     //3
50        AURASTATE_FLAG_FROZEN                           = 0x000008,     //4
51        AURASTATE_FLAG_JUDGEMENT                        = 0x000010,     //5
52        AURASTATE_FLAG_PARRY                            = 0x000040,     //7
53        AURASTATE_FLAG_LASTKILLWITHHONOR        = 0x000200,     //10
54        AURASTATE_FLAG_CRITICAL                         = 0x000400,     //11
55        AURASTATE_FLAG_HEALTH35                         = 0x001000,     //13
56        AURASTATE_FLAG_IMMOLATE                         = 0x002000,     //14
57        AURASTATE_FLAG_REJUVENATE                       = 0x004000,     //15
58        AURASTATE_FLAG_POISON                           = 0x008000,     //16
59        AURASTATE_FLAG_ENRAGED                          = 0x010000,     //17
60        AURASTATE_FLAG_MAELSTROM_READY          = 0x020000,     //18
61        AURASTATE_FLAG_EVASIVE_CHARGE           = 0x200000,     //22
62        AURASTATE_FLAG_HEALTH75                         = 0x400000,     //23 (Health ABOVE 75%)
63};
64
65enum MOD_TYPES
66{
67    SPELL_AURA_NONE = 0,                                // None
68    SPELL_AURA_BIND_SIGHT = 1,                          // Bind Sight
69    SPELL_AURA_MOD_POSSESS = 2,                         // Mod Possess
70    SPELL_AURA_PERIODIC_DAMAGE = 3,                     // Periodic Damage
71    SPELL_AURA_DUMMY = 4,                               // Script Aura
72    SPELL_AURA_MOD_CONFUSE = 5,                         // Mod Confuse
73    SPELL_AURA_MOD_CHARM = 6,                           // Mod Charm
74    SPELL_AURA_MOD_FEAR = 7,                            // Mod Fear
75    SPELL_AURA_PERIODIC_HEAL = 8,                       // Periodic Heal
76    SPELL_AURA_MOD_ATTACKSPEED = 9,                     // Mod Attack Speed
77    SPELL_AURA_MOD_THREAT = 10,                         // Mod Threat
78    SPELL_AURA_MOD_TAUNT = 11,                          // Taunt
79    SPELL_AURA_MOD_STUN = 12,                           // Stun
80    SPELL_AURA_MOD_DAMAGE_DONE = 13,                    // Mod Damage Done
81    SPELL_AURA_MOD_DAMAGE_TAKEN = 14,                   // Mod Damage Taken
82    SPELL_AURA_DAMAGE_SHIELD = 15,                      // Damage Shield
83    SPELL_AURA_MOD_STEALTH = 16,                        // Mod Stealth
84    SPELL_AURA_MOD_DETECT = 17,                         // Mod Detect
85    SPELL_AURA_MOD_INVISIBILITY = 18,                   // Mod Invisibility
86    SPELL_AURA_MOD_INVISIBILITY_DETECTION = 19,         // Mod Invisibility Detection
87    SPELL_AURA_MOD_TOTAL_HEALTH_REGEN_PCT = 20,
88    SPELL_AURA_MOD_TOTAL_MANA_REGEN_PCT = 21,
89    SPELL_AURA_MOD_RESISTANCE = 22,                     // Mod Resistance
90    SPELL_AURA_PERIODIC_TRIGGER_SPELL = 23,             // Periodic Trigger
91    SPELL_AURA_PERIODIC_ENERGIZE = 24,                  // Periodic Energize
92    SPELL_AURA_MOD_PACIFY = 25,                         // Pacify
93    SPELL_AURA_MOD_ROOT = 26,                           // Root
94    SPELL_AURA_MOD_SILENCE = 27,                        // Silence
95    SPELL_AURA_REFLECT_SPELLS = 28,                     // Reflect Spells %
96    SPELL_AURA_MOD_STAT = 29,                           // Mod Stat
97    SPELL_AURA_MOD_SKILL = 30,                          // Mod Skill
98    SPELL_AURA_MOD_INCREASE_SPEED = 31,                 // Mod Speed
99    SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED = 32,         // Mod Speed Mounted
100    SPELL_AURA_MOD_DECREASE_SPEED = 33,                 // Mod Speed Slow
101    SPELL_AURA_MOD_INCREASE_HEALTH = 34,                // Mod Increase Health
102    SPELL_AURA_MOD_INCREASE_ENERGY = 35,                // Mod Increase Energy
103    SPELL_AURA_MOD_SHAPESHIFT = 36,                     // Shapeshift
104    SPELL_AURA_EFFECT_IMMUNITY = 37,                    // Immune Effect
105    SPELL_AURA_STATE_IMMUNITY = 38,                     // Immune State
106    SPELL_AURA_SCHOOL_IMMUNITY = 39,                    // Immune School
107    SPELL_AURA_DAMAGE_IMMUNITY = 40,                    // Immune Damage
108    SPELL_AURA_DISPEL_IMMUNITY = 41,                    // Immune Dispel Type
109    SPELL_AURA_PROC_TRIGGER_SPELL = 42,                 // Proc Trigger Spell
110    SPELL_AURA_PROC_TRIGGER_DAMAGE = 43,                // Proc Trigger Damage
111    SPELL_AURA_TRACK_CREATURES = 44,                    // Track Creatures
112    SPELL_AURA_TRACK_RESOURCES = 45,                    // Track Resources
113    SPELL_AURA_MOD_PARRY_SKILL = 46,                    // Mod Parry Skill
114    SPELL_AURA_MOD_PARRY_PERCENT = 47,                  // Mod Parry Percent
115    SPELL_AURA_MOD_DODGE_SKILL = 48,                    // Mod Dodge Skill
116    SPELL_AURA_MOD_DODGE_PERCENT = 49,                  // Mod Dodge Percent
117    SPELL_AURA_MOD_BLOCK_SKILL = 50,                    // Mod Block Skill
118    SPELL_AURA_MOD_BLOCK_PERCENT = 51,                  // Mod Block Percent
119    SPELL_AURA_MOD_CRIT_PERCENT = 52,                   // Mod Crit Percent
120    SPELL_AURA_PERIODIC_LEECH = 53,                     // Periodic Leech
121    SPELL_AURA_MOD_HIT_CHANCE = 54,                     // Mod Hit Chance
122    SPELL_AURA_MOD_SPELL_HIT_CHANCE = 55,               // Mod Spell Hit Chance
123    SPELL_AURA_TRANSFORM = 56,                          // Transform
124    SPELL_AURA_MOD_SPELL_CRIT_CHANCE = 57,              // Mod Spell Crit Chance
125    SPELL_AURA_MOD_INCREASE_SWIM_SPEED = 58,            // Mod Speed Swim
126    SPELL_AURA_MOD_DAMAGE_DONE_CREATURE = 59,           // Mod Creature Dmg Done
127    SPELL_AURA_MOD_PACIFY_SILENCE = 60,                 // Pacify & Silence
128    SPELL_AURA_MOD_SCALE = 61,                          // Mod Scale
129    SPELL_AURA_PERIODIC_HEALTH_FUNNEL = 62,             // Periodic Health Funnel
130    SPELL_AURA_PERIODIC_MANA_FUNNEL = 63,               // Periodic Mana Funnel
131    SPELL_AURA_PERIODIC_MANA_LEECH = 64,                // Periodic Mana Leech
132    SPELL_AURA_MOD_CASTING_SPEED = 65,                  // Haste - Spells
133    SPELL_AURA_FEIGN_DEATH = 66,                        // Feign Death
134    SPELL_AURA_MOD_DISARM = 67,                         // Disarm
135    SPELL_AURA_MOD_STALKED = 68,                        // Mod Stalked
136    SPELL_AURA_SCHOOL_ABSORB = 69,                      // School Absorb
137    SPELL_AURA_EXTRA_ATTACKS = 70,                      // Extra Attacks
138    SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL = 71,       // Mod School Spell Crit Chance
139    SPELL_AURA_MOD_POWER_COST = 72,                     // Mod Power Cost
140    SPELL_AURA_MOD_POWER_COST_SCHOOL = 73,              // Mod School Power Cost
141    SPELL_AURA_REFLECT_SPELLS_SCHOOL = 74,              // Reflect School Spells %
142    SPELL_AURA_MOD_LANGUAGE = 75,                       // Mod Language
143    SPELL_AURA_FAR_SIGHT = 76,                          // Far Sight
144    SPELL_AURA_MECHANIC_IMMUNITY = 77,                  // Immune Mechanic
145    SPELL_AURA_MOUNTED = 78,                            // Mounted
146    SPELL_AURA_MOD_DAMAGE_PERCENT_DONE = 79,            // Mod Dmg %
147    SPELL_AURA_MOD_PERCENT_STAT = 80,                   // Mod Stat %
148    SPELL_AURA_SPLIT_DAMAGE = 81,                       // Split Damage
149    SPELL_AURA_WATER_BREATHING = 82,                    // Water Breathing
150    SPELL_AURA_MOD_BASE_RESISTANCE = 83,                // Mod Base Resistance
151    SPELL_AURA_MOD_REGEN = 84,                          // Mod Health Regen
152    SPELL_AURA_MOD_POWER_REGEN = 85,                    // Mod Power Regen
153    SPELL_AURA_CHANNEL_DEATH_ITEM = 86,                 // Create Death Item
154    SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN = 87,           // Mod Dmg % Taken
155    SPELL_AURA_MOD_PERCENT_REGEN = 88,                  // Mod Health Regen Percent
156    SPELL_AURA_PERIODIC_DAMAGE_PERCENT = 89,            // Periodic Damage Percent
157    SPELL_AURA_MOD_RESIST_CHANCE = 90,                  // Mod Resist Chance
158    SPELL_AURA_MOD_DETECT_RANGE = 91,                   // Mod Detect Range
159    SPELL_AURA_PREVENTS_FLEEING = 92,                   // Prevent Fleeing
160        SPELL_AURA_MOD_UNATTACKABLE = 93,                   // Mod Unintractable
161    SPELL_AURA_INTERRUPT_REGEN = 94,                    // Interrupt Regen
162    SPELL_AURA_GHOST = 95,                              // Ghost
163    SPELL_AURA_SPELL_MAGNET = 96,                       // Spell Magnet
164    SPELL_AURA_MANA_SHIELD = 97,                        // Mana Shield
165    SPELL_AURA_MOD_SKILL_TALENT = 98,                   // Mod Skill Talent
166    SPELL_AURA_MOD_ATTACK_POWER = 99,                   // Mod Attack Power
167    SPELL_AURA_AURAS_VISIBLE = 100,                     // Auras Visible
168    SPELL_AURA_MOD_RESISTANCE_PCT = 101,                // Mod Resistance %
169    SPELL_AURA_MOD_CREATURE_ATTACK_POWER = 102,         // Mod Creature Attack Power
170    SPELL_AURA_MOD_TOTAL_THREAT = 103,                  // Mod Total Threat (Fade)
171    SPELL_AURA_WATER_WALK = 104,                        // Water Walk
172    SPELL_AURA_FEATHER_FALL = 105,                      // Feather Fall
173    SPELL_AURA_HOVER = 106,                             // Hover
174    SPELL_AURA_ADD_FLAT_MODIFIER = 107,                 // Add Flat Modifier
175    SPELL_AURA_ADD_PCT_MODIFIER = 108,                  // Add % Modifier
176    SPELL_AURA_ADD_TARGET_TRIGGER = 109,                // Add Class Target Trigger
177    SPELL_AURA_MOD_POWER_REGEN_PERCENT = 110,           // Mod Power Regen %
178    SPELL_AURA_ADD_CASTER_HIT_TRIGGER = 111,            // Add Class Caster Hit Trigger
179    SPELL_AURA_OVERRIDE_CLASS_SCRIPTS = 112,            // Override Class Scripts
180    SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN = 113,           // Mod Ranged Dmg Taken
181    SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT = 114,       // Mod Ranged % Dmg Taken
182    SPELL_AURA_MOD_HEALING = 115,                       // Mod Healing
183    SPELL_AURA_IGNORE_REGEN_INTERRUPT = 116,            // Regen During Combat
184    SPELL_AURA_MOD_MECHANIC_RESISTANCE = 117,           // Mod Mechanic Resistance
185    SPELL_AURA_MOD_HEALING_PCT = 118,                   // Mod Healing %
186    SPELL_AURA_SHARE_PET_TRACKING = 119,                // Share Pet Tracking
187    SPELL_AURA_UNTRACKABLE = 120,                       // Untrackable
188    SPELL_AURA_EMPATHY = 121,                           // Empathy (Lore, whatever)
189    SPELL_AURA_MOD_OFFHAND_DAMAGE_PCT = 122,            // Mod Offhand Dmg %
190    SPELL_AURA_MOD_POWER_COST_PCT = 123,                // Mod Power Cost % --> armor penetration & spell penetration
191    SPELL_AURA_MOD_RANGED_ATTACK_POWER = 124,           // Mod Ranged Attack Power
192    SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN = 125,            // Mod Melee Dmg Taken
193    SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT = 126,        // Mod Melee % Dmg Taken
194    SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS = 127,// Rngd Atk Pwr Attckr Bonus
195    SPELL_AURA_MOD_POSSESS_PET = 128,                   // Mod Possess Pet
196    SPELL_AURA_MOD_INCREASE_SPEED_ALWAYS = 129,         // Mod Speed Always
197    SPELL_AURA_MOD_MOUNTED_SPEED_ALWAYS = 130,          // Mod Mounted Speed Always
198    SPELL_AURA_MOD_CREATURE_RANGED_ATTACK_POWER = 131,  // Mod Creature Ranged Attack Power
199    SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT = 132,       // Mod Increase Energy %
200    SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT = 133,       // Mod Max Health %
201    SPELL_AURA_MOD_MANA_REGEN_INTERRUPT = 134,          // Mod Interrupted Mana Regen
202    SPELL_AURA_MOD_HEALING_DONE = 135,                  // Mod Healing Done
203    SPELL_AURA_MOD_HEALING_DONE_PERCENT = 136,          // Mod Healing Done %
204    SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE = 137,         // Mod Total Stat %
205    SPELL_AURA_MOD_HASTE = 138,                         // Haste - Melee
206    SPELL_AURA_FORCE_REACTION = 139,                    // Force Reaction
207    SPELL_AURA_MOD_RANGED_HASTE = 140,                  // Haste - Ranged
208    SPELL_AURA_MOD_RANGED_AMMO_HASTE = 141,             // Haste - Ranged (Ammo Only)
209    SPELL_AURA_MOD_BASE_RESISTANCE_PCT = 142,           // Mod Base Resistance %
210    SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE = 143,          // Mod Resistance Exclusive
211    SPELL_AURA_SAFE_FALL = 144,                         // Safe Fall
212    SPELL_AURA_CHARISMA = 145,                          // Charisma
213    SPELL_AURA_PERSUADED = 146,                         // Persuaded
214    SPELL_AURA_ADD_CREATURE_IMMUNITY = 147,             // Add Creature Immunity
215    SPELL_AURA_RETAIN_COMBO_POINTS = 148,               // Retain Combo Points
216    SPELL_AURA_RESIST_PUSHBACK = 149,                   // Resist Pushback
217    SPELL_AURA_MOD_SHIELD_BLOCK_PCT = 150,              // Mod Shield Block %
218    SPELL_AURA_TRACK_STEALTHED = 151,                   // Track Stealthed
219    SPELL_AURA_MOD_DETECTED_RANGE = 152,                // Mod Detected Range
220    SPELL_AURA_SPLIT_DAMAGE_FLAT = 153,                 // Split Damage Flat
221    SPELL_AURA_MOD_STEALTH_LEVEL = 154,                 // Stealth Level Modifier
222    SPELL_AURA_MOD_WATER_BREATHING = 155,               // Mod Water Breathing
223    SPELL_AURA_MOD_REPUTATION_ADJUST = 156,             // Mod Reputation Gain
224    SPELL_AURA_PET_DAMAGE_MULTI = 157,                  // Mod Pet Damage
225    SPELL_AURA_MOD_SHIELD_BLOCK = 158,                  // Mod Shield Block
226    SPELL_AURA_NO_PVP_CREDIT = 159,                     // No PVP Credit
227    SPELL_AURA_MOD_SIDE_REAR_PDAE_DAMAGE_TAKEN = 160,   // Mod Side/Rear PBAE Damage Taken
228    SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT = 161,        // Mod Health Regen In Combat
229    SPELL_AURA_POWER_BURN = 162,                        // Power Burn
230    SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE = 163,       // Mod Critical Damage Bonus (Physical)
231    SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS = 165, // Melee AP Attacker Bonus
232    SPELL_AURA_MOD_ATTACK_POWER_PCT = 166,              // Mod Attack Power
233    SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT = 167,       // Mod Ranged Attack Power %
234    SPELL_AURA_INCREASE_DAMAGE = 168,                   // Increase Damage Type
235    SPELL_AURA_INCREASE_CRITICAL = 169,                 // Increase Critical Type
236    SPELL_AURA_DETECT_AMORE = 170,                      // Detect Amore
237    SPELL_AURA_INCREASE_MOVEMENT_AND_MOUNTED_SPEED = 172,// Increase Movement and Mounted Speed (Non-Stacking)
238    SPELL_AURA_INCREASE_SPELL_DAMAGE_PCT = 174,         // Increase Spell Damage by % status
239    SPELL_AURA_INCREASE_SPELL_HEALING_PCT = 175,        // Increase Spell Healing by % status
240    SPELL_AURA_SPIRIT_OF_REDEMPTION = 176,              // Spirit of Redemption Auras
241    SPELL_AURA_AREA_CHARM = 177,                        // Area Charm
242    SPELL_AURA_INCREASE_ATTACKER_SPELL_CRIT = 179,      // Increase Attacker Spell Crit Type
243    SPELL_AURA_INCREASE_SPELL_DAMAGE_VS_TYPE = 180,     // Increase Spell Damage Type
244    SPELL_AURA_INCREASE_ARMOR_BASED_ON_INTELLECT_PCT = 182, // Increase Armor based on Intellect
245    SPELL_AURA_DECREASE_CRIT_THREAT = 183,              // Decrease Critical Threat by
246    SPELL_AURA_DECREASE_ATTACKER_CHANCE_TO_HIT_MELEE = 184,//Reduces Attacker Chance to Hit with Melee
247    SPELL_AURA_DECREASE_ATTACKER_CHANGE_TO_HIT_RANGED = 185,// Reduces Attacker Chance to Hit with Ranged
248    SPELL_AURA_DECREASE_ATTACKER_CHANGE_TO_HIT_SPELLS = 186,// Reduces Attacker Chance to Hit with Spells
249    SPELL_AURA_DECREASE_ATTACKER_CHANGE_TO_CRIT_MELEE = 187,// Reduces Attacker Chance to Crit with Melee (Ranged?)
250    SPELL_AURA_DECREASE_ATTACKER_CHANGE_TO_CRIT_RANGED = 188,// Reduces Attacker Chance to Crit with Ranged (Melee?)
251    SPELL_AURA_INCREASE_REPUTATION = 190,               // Increases reputation from killed creatures
252    SPELL_AURA_SPEED_LIMIT = 191,                       // speed limit
253    SPELL_AURA_MELEE_SLOW_PCT = 192,
254    SPELL_AURA_INCREASE_TIME_BETWEEN_ATTACKS = 193,
255    SPELL_AURA_INREASE_SPELL_DAMAGE_PCT_OF_INTELLECT = 194,  // NOT USED ANYMORE - 174 used instead
256    SPELL_AURA_INCREASE_HEALING_PCT_OF_INTELLECT = 195,         // NOT USED ANYMORE - 175 used instead
257    SPELL_AURA_MOD_ALL_WEAPON_SKILLS = 196,
258    SPELL_AURA_REDUCE_ATTACKER_CRICTICAL_HIT_CHANCE_PCT = 197,
259        SPELL_AURA_198 = 198,
260    SSPELL_AURA_INCREASE_SPELL_HIT_PCT = 199,
261        SPELL_AURA_CANNOT_BE_DODGED = 201,
262        SPELL_AURA_FINISHING_MOVES_CANNOT_BE_DODGED = 202,
263    SPELL_AURA_REDUCE_ATTACKER_CRICTICAL_HIT_DAMAGE_MELEE_PCT = 203,
264    SPELL_AURA_REDUCE_ATTACKER_CRICTICAL_HIT_DAMAGE_RANGED_PCT = 204,
265    SPELL_AURA_MOD_RANGED_ATTACK_POWER_BY_STAT_PCT = 212,
266    SPELL_AURA_INCREASE_RAGE_FROM_DAMAGE_DEALT_PCT = 213,
267    SPELL_AURA_INCREASE_CASTING_TIME_PCT = 216,
268    SPELL_AURA_REGEN_MANA_STAT_PCT=219,
269    SPELL_AURA_HEALING_STAT_PCT=220,
270        SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE=227, // Used by Mind Flay etc
271        SPELL_AURA_REDUCE_AOE_DAMAGE_TAKEN = 229,
272    SPELL_AURA_INCREASE_MAX_HEALTH=230,//Used by Commanding Shout
273        SPELL_AURA_MECHANIC_DURATION_MOD = 232,
274        SPELL_AURA_MOD_HEALING_BY_AP=237,
275        SPELL_AURA_MOD_SPELL_DAMAGE_BY_AP=238,
276        SPELL_AURA_EXPERTISE = 240,
277        SPELL_AURA_241 = 241,
278    SPELL_AURA_MOD_SPELL_DAMAGE_FROM_HEALING = 242,
279    SPELL_AURA_243 = 243,
280    SPELL_AURA_244 = 244,
281    SPELL_AURA_MOD_DURATION_OF_MAGIC_EFFECTS = 245,
282    SPELL_AURA_246 = 246,
283    SPELL_AURA_247 = 247,
284    SPELL_AURA_MOD_COMBAT_RESULT_CHANCE = 248,
285    SPELL_AURA_249 = 249,
286    SPELL_AURA_MOD_INCREASE_HEALTH_2 = 250,
287    SPELL_AURA_MOD_ENEMY_DODGE = 251,
288        SPELL_AURA_252 = 252,
289        SPELL_AURA_BLOCK_MULTIPLE_DAMAGE = 253,
290        SPELL_AURA_254 = 254,
291        SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT = 255,
292        SPELL_AURA_256 = 256,
293        SPELL_AURA_257 = 257,
294        SPELL_AURA_258 = 258,
295        SPELL_AURA_259 = 259,
296        SPELL_AURA_260 = 260,
297        SPELL_AURA_PHASE = 261,
298        SPELL_AURA_IGNORE_TARGET_AURA_STATE = 262,
299        SPELL_AURA_ALLOW_ONLY_ABILITY = 263,
300        SPELL_AURA_264 = 264,
301        SPELL_AURA_265 = 265,
302        SPELL_AURA_266 = 266,
303        SPELL_AURA_267 = 267,
304        SPELL_AURA_MOD_ATTACK_POWER_BY_STAT_PCT = 268,
305        SPELL_AURA_269 = 269,
306        SPELL_AURA_270 = 270,
307        SPELL_AURA_INCREASE_SPELL_DOT_DAMAGE_PCT = 271,
308        SPELL_AURA_272 = 272,
309        SPELL_AURA_273 = 273,
310        SPELL_AURA_274 = 274,
311        SPELL_AURA_275 = 275,
312        SPELL_AURA_276 = 276,
313        SPELL_AURA_277 = 277,
314        SPELL_AURA_278 = 278,
315        SPELL_AURA_279 = 279,
316        SPELL_AURA_IGNORE_ARMOR_PCT = 280,
317        SPELL_AURA_281 = 281,
318        SPELL_AURA_MOD_BASE_HEALTH = 282,
319        SPELL_AURA_283 = 283,
320        SPELL_AURA_284 = 284,
321        SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR = 285,
322        SPELL_AURA_286 = 286,
323        SPELL_AURA_REFLECT_INFRONT = 287,
324        SPELL_AURA_288 = 288,
325        SPELL_AURA_289 = 289,
326        SPELL_AURA_290 = 290,
327        SPELL_AURA_291 = 291,
328        SPELL_AURA_292 = 292,
329        SPELL_AURA_293 = 293,
330        SPELL_AURA_294 = 294,
331        SPELL_AURA_295 = 295,
332        SPELL_AURA_296 = 296,
333        SPELL_AURA_297 = 297,
334        SPELL_AURA_298 = 298,
335        SPELL_AURA_299 = 299,
336        SPELL_AURA_300 = 300,
337        SPELL_AURA_301 = 301,
338        SPELL_AURA_302 = 302,
339        SPELL_AURA_303 = 303,
340        SPELL_AURA_304 = 304,
341        SPELL_AURA_305 = 305,
342        SPELL_AURA_306 = 306,
343    SPELL_AURA_307 = 307,
344    SPELL_AURA_308 = 308,
345    SPELL_AURA_309 = 309,
346    SPELL_AURA_310 = 310,
347    SPELL_AURA_311 = 311,
348    SPELL_AURA_312 = 312,
349    SPELL_AURA_313 = 313,
350    SPELL_AURA_314 = 314,
351    SPELL_AURA_315 = 315,
352    SPELL_AURA_316 = 316,
353    TOTAL_SPELL_AURAS = 317,
354};
355
356enum AuraTickFlags
357{
358    FLAG_PERIODIC_DAMAGE            = 2,
359    FLAG_PERIODIC_TRIGGER_SPELL     = 4,
360    FLAG_PERIODIC_HEAL              = 8,
361    FLAG_PERIODIC_LEECH             = 16,
362    FLAG_PERIODIC_ENERGIZE          = 32,
363};
364
365struct Modifier
366{
367//    uint32 m_actamt;       // actual amt, for percent and stuff
368    uint32 m_type;           // What does it modify? (str,int,hp)
369    int32 m_amount;          // By how much does it mod?
370    int32 m_miscValue;       // Misc Value
371    uint32 i;
372
373    ///needed for per level effect
374    int32 realamount;
375        //need this to store % values or they cannot be reverted correctly (i think :D )
376    signed int fixed_amount[7];
377};
378
379
380struct ProcTriggerSpellOnSpell
381{
382    uint32 origId;
383    uint32 spellId;
384    uint64 caster;
385    uint32 procChance;
386    uint32 procFlags;
387    uint32 RemainingCharges;
388    uint32 LastTrigger;
389    void  *owner;//mark the owner of this proc to know which one to delete
390};
391
392struct DamageProc
393{
394    uint32 m_spellId;
395    uint32 m_damage;
396  //  uint64 m_caster;//log is: some reflects x arcane/nature damage to 'attacker' no matter who casted
397    uint32 m_school;
398    uint32 m_flags;
399    void  *owner;//mark the owner of this proc to know which one to delete
400};
401
402struct DamageSplitTarget
403{
404        uint64 m_target; // we store them
405        uint32 m_spellId;
406        float m_pctDamageSplit; // % of taken damage to transfer (i.e. Soul Link)
407        uint32 m_flatDamageSplit; // flat damage to transfer (i.e. Blessing of Sacrifice)
408        uint8 damage_type; // bitwise 0-127 thingy
409        void * creator;
410};
411
412#ifndef NEW_PROCFLAGS
413struct ProcTriggerSpell
414{
415        //  ProcTriggerSpell() : origId(0), trigger(0), spellId(0), caster(0), procChance(0), procFlags(0), procCharges(0) { }
416        uint32 origId;
417        // uint32 trigger;
418        uint32 spellId;
419        uint64 caster;
420        uint32 procChance;
421        uint32 procFlags;
422        uint32 procCharges;
423        //    SpellEntry *ospinfo;
424        //    SpellEntry *spinfo;
425        uint32 LastTrigger;
426        uint32 ProcType; //0=triggerspell/1=triggerclassspell
427        uint32 groupRelation[3];
428        bool deleted;
429};
430#else
431struct ProcTriggerSpell
432{
433        uint32 spellId;
434        uint32 parentId;
435        uint32 procFlags;
436        uint32 procChance;
437        uint32 procCharges;
438        uint32 LastTrigger;
439};
440#endif
441
442struct SpellCharge
443{
444    uint32 spellId;
445    uint32 count;
446    uint32 ProcFlag;
447    uint32 lastproc;
448    uint32 procdiff;
449};
450
451typedef set<uint32> AreaAuraList;
452
453class SERVER_DECL Aura : public EventableObject
454{
455        uint64 periodic_target;
456public:
457    Aura( SpellEntry *proto, int32 duration,Object* caster, Unit *target, bool temporary = false, Item* i_caster = NULL );
458        ~Aura();
459
460        void ExpireRemove();
461    void Remove();
462    void Expire();
463    void AddMod(uint32 t, int32 a,uint32 miscValue,uint32 i);
464
465    ARCEMU_INLINE SpellEntry* GetSpellProto() const { return m_spellProto; }
466    ARCEMU_INLINE uint32 GetSpellId() const {return m_spellProto->Id; }
467    ARCEMU_INLINE bool IsPassive(){ if(!m_spellProto) return false; return (m_spellProto->Attributes & ATTRIBUTES_PASSIVE && !m_areaAura);}
468
469    ARCEMU_INLINE int32 GetDuration() const { return m_duration; }
470         void SetDuration(int32 duration)
471         {
472                 m_duration = duration;
473                 timeleft = (uint32)UNIXTIME;
474         }
475
476    ARCEMU_INLINE uint16 GetAuraSlot() const { return m_auraSlot; }
477        void SetAuraSlot( uint16 slot ) { m_auraSlot = slot; }
478
479        ARCEMU_INLINE bool IsPositive() { return m_positive>0; }
480        void SetNegative(signed char value=1) { m_positive -= value; }
481        void SetPositive(signed char value=1) { m_positive += value; }
482
483        Object* GetCaster();
484        ARCEMU_INLINE uint64 GetCasterGUID(){return m_casterGuid;}
485        Unit* GetUnitCaster();
486        ARCEMU_INLINE Unit* GetTarget() { return m_target; }
487
488        Aura* StrongerThat(Aura *aur);
489        void ApplyModifiers(bool apply);
490        void UpdateModifiers();
491        void EventUpdateAA(float r);
492        void RemoveAA();
493
494        //! GetTimeLeft() milliseconds
495        ARCEMU_INLINE uint32 GetTimeLeft() 
496        {
497                if(m_duration==-1)return (uint32)-1;
498                int32 n=int32((UNIXTIME-time_t(timeleft))*1000);
499                if(n>=m_duration) return 0;
500                else
501                return (m_duration-n);
502        }
503
504        bool HasModType( uint32 type )
505        {
506                for( uint8 x = 0; x < m_modcount; ++x )
507                        if( m_modList[x].m_type == type )
508                                return true;
509                return false;
510        }
511        // Aura Handlers
512        void SpellAuraNULL(bool apply);
513        void SpellAuraBindSight(bool apply);
514        void SpellAuraModPossess(bool apply);
515        void SpellAuraPeriodicDamage(bool apply);
516        void SpellAuraDummy(bool apply);
517        void SpellAuraModConfuse(bool apply);
518        void SpellAuraModCharm(bool apply);
519        void SpellAuraModFear(bool apply);
520        void SpellAuraPeriodicHeal(bool apply);
521        void SpellAuraModAttackSpeed(bool apply);
522        void SpellAuraModThreatGenerated(bool apply);
523        void SpellAuraModTaunt(bool apply);
524        void SpellAuraModStun(bool apply);
525        void SpellAuraModDamageDone(bool apply);
526        void SpellAuraModDamageTaken(bool apply);
527        void SpellAuraDamageShield(bool apply);
528        void SpellAuraModStealth(bool apply);
529        void SpellAuraModDetect(bool apply);
530        void SpellAuraModInvisibility(bool apply);
531        void SpellAuraModInvisibilityDetection(bool apply);
532        void SpellAuraModTotalHealthRegenPct(bool apply);
533        void SpellAuraModTotalManaRegenPct(bool apply);
534        void SpellAuraModResistance(bool apply);
535        void SpellAuraPeriodicTriggerSpell(bool apply);
536        void SpellAuraPeriodicEnergize(bool apply);
537        void SpellAuraModPacify(bool apply);
538        void SpellAuraModRoot(bool apply);
539        void SpellAuraModSilence(bool apply);
540        void SpellAuraReflectSpells(bool apply);
541        void SpellAuraModStat(bool apply);
542        void SpellAuraModSkill(bool apply);
543        void SpellAuraModIncreaseSpeed(bool apply);
544        void SpellAuraModDecreaseSpeed(bool apply);
545        void SpellAuraModIncreaseHealth(bool apply);
546        void SpellAuraModIncreaseEnergy(bool apply);
547        void SpellAuraModShapeshift(bool apply);
548        void SpellAuraModEffectImmunity(bool apply);
549        void SpellAuraModStateImmunity(bool apply);
550        void SpellAuraModSchoolImmunity(bool apply);
551        void SpellAuraModDmgImmunity(bool apply);
552        void SpellAuraModDispelImmunity(bool apply);
553        void SpellAuraProcTriggerSpell(bool apply);
554        void SpellAuraProcTriggerDamage(bool apply);
555        void SpellAuraTrackCreatures(bool apply);
556        void SpellAuraTrackResources(bool apply);
557        void SpellAuraModParryPerc(bool apply);
558        void SpellAuraModDodgePerc(bool apply);
559        void SpellAuraModBlockPerc(bool apply);
560        void SpellAuraModCritPerc(bool apply);
561        void SpellAuraPeriodicLeech(bool apply);
562        void SpellAuraModHitChance(bool apply);
563        void SpellAuraModSpellHitChance(bool apply);
564        void SpellAuraTransform(bool apply);
565        void SpellAuraModSpellCritChance(bool apply);
566        void SpellAuraIncreaseSwimSpeed(bool apply);
567        void SpellAuraModCratureDmgDone(bool apply);
568        void SpellAuraPacifySilence(bool apply);
569        void SpellAuraModScale(bool apply);
570        void SpellAuraPeriodicHealthFunnel(bool apply);
571        void SpellAuraPeriodicManaLeech(bool apply);
572        void SpellAuraModCastingSpeed(bool apply);
573        void SpellAuraFeignDeath(bool apply);
574        void SpellAuraModDisarm(bool apply);
575        void SpellAuraModStalked(bool apply);
576        void SpellAuraSchoolAbsorb(bool apply);
577        void SpellAuraModSpellCritChanceSchool(bool apply);
578        void SpellAuraModPowerCost(bool apply);
579        void SpellAuraModPowerCostSchool(bool apply);
580        void SpellAuraReflectSpellsSchool(bool apply);
581        void SpellAuraModLanguage(bool apply);
582        void SpellAuraAddFarSight(bool apply);
583        void SpellAuraMechanicImmunity(bool apply);
584        void SpellAuraMounted(bool apply);
585        void SpellAuraModDamagePercDone(bool apply);
586        void SpellAuraModPercStat(bool apply);
587        void SpellAuraSplitDamage(bool apply);
588        void SpellAuraWaterBreathing(bool apply);
589        void SpellAuraModBaseResistance(bool apply);
590        void SpellAuraModRegen(bool apply);
591        void SpellAuraModPowerRegen(bool apply);
592        void SpellAuraModHealingPct(bool apply);
593        void SpellAuraChannelDeathItem(bool apply);
594        void SpellAuraModDamagePercTaken(bool apply);
595        void SpellAuraModRegenPercent(bool apply);
596        void SpellAuraPeriodicDamagePercent(bool apply);
597        void SpellAuraModResistChance(bool apply);
598        void SpellAuraModDetectRange(bool apply);
599        void SpellAuraPreventsFleeing(bool apply);
600        void SpellAuraModUnattackable(bool apply);
601        void SpellAuraInterruptRegen(bool apply);
602        void SpellAuraGhost(bool apply);
603        void SpellAuraMagnet(bool apply);
604        void SpellAuraManaShield(bool apply);
605        void SpellAuraSkillTalent(bool apply);
606        void SpellAuraModAttackPower(bool apply);
607        void SpellAuraVisible(bool apply);
608        void SpellAuraModResistancePCT(bool apply);
609        void SpellAuraModCreatureAttackPower(bool apply);
610        void SpellAuraModTotalThreat(bool apply);
611        void SpellAuraWaterWalk(bool apply);
612        void SpellAuraFeatherFall(bool apply);
613        void SpellAuraHover(bool apply);
614        void SpellAuraAddFlatModifier(bool apply);
615        void SpellAuraAddPctMod(bool apply);
616        void SpellAuraAddTargetTrigger(bool apply);
617        void SpellAuraModPowerRegPerc(bool apply);
618        void SpellAuraOverrideClassScripts(bool apply);
619        void SpellAuraModRangedDamageTaken(bool apply);
620        void SpellAuraModHealing(bool apply);
621        void SpellAuraIgnoreRegenInterrupt(bool apply);
622        void SpellAuraModMechanicResistance(bool apply);
623        void SpellAuraModHealingPCT(bool apply);
624        void SpellAuraUntrackable(bool apply);
625        void SpellAuraEmphaty(bool apply);
626        void SpellAuraModOffhandDamagePCT(bool apply);
627        void SpellAuraModPenetration(bool apply);
628        void SpellAuraModRangedAttackPower(bool apply);
629        void SpellAuraModMeleeDamageTaken(bool apply);
630        void SpellAuraModMeleeDamageTakenPct(bool apply);
631        void SpellAuraRAPAttackerBonus(bool apply);
632        void SpellAuraModIncreaseSpeedAlways(bool apply);
633        void SpellAuraModIncreaseMountedSpeed(bool apply);
634        void SpellAuraModCreatureRangedAttackPower(bool apply);
635        void SpellAuraModIncreaseEnergyPerc(bool apply);
636        void SpellAuraModIncreaseHealthPerc(bool apply);
637        void SpellAuraModManaRegInterrupt(bool apply);
638        void SpellAuraModHealingDone(bool apply);
639        void SpellAuraModHealingDonePct(bool apply);
640        void SpellAuraModTotalStatPerc(bool apply);
641        void SpellAuraModHaste(bool apply);
642        void SpellAuraForceReaction(bool apply);
643        void SpellAuraModRangedHaste(bool apply);
644        void SpellAuraModRangedAmmoHaste(bool apply);
645        void SpellAuraModBaseResistancePerc(bool apply);
646        void SpellAuraModResistanceExclusive(bool apply);
647        void SpellAuraSafeFall(bool apply);
648        void SpellAuraRetainComboPoints(bool apply);
649        void SpellAuraResistPushback(bool apply);
650        void SpellAuraModShieldBlockPCT(bool apply);
651        void SpellAuraTrackStealthed(bool apply);
652        void SpellAuraModDetectedRange(bool apply);
653        void SpellAuraSplitDamageFlat(bool apply);
654        void SpellAuraModStealthLevel(bool apply);
655        void SpellAuraModUnderwaterBreathing(bool apply);
656        void SpellAuraModReputationAdjust(bool apply);
657        void SpellAuraNoPVPCredit(bool apply);
658        void SpellAuraModHealthRegInCombat(bool apply);
659        void SpellAuraPowerBurn(bool apply);
660        void SpellAuraModCritDmgPhysical(bool apply);
661        void SpellAuraModPAttackPower(bool apply);
662        void SpellAuraModRangedAttackPowerPct(bool apply);
663        void SpellAuraAPAttackerBonus(bool apply);
664        void SpellAuraIncreaseDamageTypePCT(bool apply);
665        void SpellAuraIncreaseCricticalTypePCT(bool apply);
666        void SpellAuraIncreasePartySpeed(bool apply);
667        void SpellAuraIncreaseSpellDamageByAttribute(bool apply);
668        void SpellAuraIncreaseHealingByAttribute(bool apply);
669        void SpellAuraIncreaseArmorByPctInt(bool apply);
670        void SpellAuraReduceAttackerMHitChance(bool apply);
671        void SpellAuraReduceAttackerRHitChance(bool apply);
672        void SpellAuraReduceAttackerSHitChance(bool apply);
673        void SpellAuraReduceEnemyMCritChance(bool apply);
674        void SpellAuraReduceEnemyRCritChance(bool apply);
675        void SpellAuraLimitSpeed(bool apply);
676        void SpellAuraIncreaseTimeBetweenAttacksPCT(bool apply);
677//      void SpellAuraIncreaseSpellDamageByInt(bool apply);
678//      void SpellAuraIncreaseHealingByInt(bool apply);
679        void SpellAuraIncreaseAllWeaponSkill(bool apply);
680        void SpellAuraModAttackerCritChance(bool apply);
681        void SpellAuraIncreaseHitRate(bool apply);
682        void SpellAuraReduceCritMeleeAttackDmg(bool apply);
683        void SpellAuraReduceCritRangedAttackDmg(bool apply);
684        void SpellAuraEnableFlight(bool apply);
685        void SpellAuraEnableFlightWithUnmountedSpeed(bool apply);
686        void SpellAuraIncreaseRageFromDamageDealtPCT(bool apply);
687        void SpellAuraIncreaseFlightSpeed(bool apply);
688        void SpellAuraIncreaseMovementAndMountedSpeed(bool apply);
689        void SpellAuraIncreaseRating(bool apply);
690        //void SpellAuraIncreaseCastTimePCT(bool apply);
691        void SpellAuraRegenManaStatPCT(bool apply);
692        void SpellAuraSpellHealingStatPCT(bool apply);
693        void SpellAuraModStealthDetection(bool apply);
694        void SpellAuraReduceAOEDamageTaken(bool apply);
695        void SpellAuraIncreaseMaxHealth(bool apply);
696        void SpellAuraSpiritOfRedemption(bool apply);
697        void SpellAuraIncreaseAttackerSpellCrit(bool apply);
698        void SpellAuraIncreaseRepGainPct(bool apply);
699        void SpellAuraIncreaseRAPbyStatPct(bool apply);
700        //void SpellAuraModRangedDamageTakenPCT(bool apply);
701        void SpellAuraModBlockValue(bool apply);
702        void SpellAuraAllowFlight(bool apply);
703        void SpellAuraFinishingMovesCannotBeDodged(bool apply);
704        void SpellAuraExpertise(bool apply);
705        void SpellAuraDrinkNew(bool apply);
706        void SpellAuraModPossessPet(bool apply);
707        void SpellAuraModHealingByAP(bool apply);
708        void SpellAuraModSpellDamageByAP(bool apply);
709        void SpellAuraMeleeHaste(bool apply);
710        void SpellAuraReduceEffectDuration(bool apply);
711        void HandleAuraControlVehicle(bool apply);
712        void EventPeriodicDrink(uint32 amount);
713        void SpellAuraModCombatResultChance(bool apply);
714        void SpellAuraAddHealth(bool apply);
715        void SpellAuraRemoveReagentCost(bool apply);
716        void SpellAuraPeriodicTriggerSpellWithValue(bool apply);
717        void SpellAuraModMechanicDmgTakenPct(bool apply);
718        void SpellAuraBlockMultipleDamage(bool apply);
719        void SpellAuraIgnoreTargetAuraState(bool apply);
720        void SpellAuraAllowOnlyAbility(bool apply);
721        void SpellAuraIncreaseAPbyStatPct(bool apply);
722        void SpellAuraModSpellDamageDOTPct(bool apply);
723        void SpellAuraIgnoreShapeshift(bool apply);
724        void SpellAuraPhase(bool apply);
725        void SpellAuraModIgnoreArmorPct(bool apply);
726        void SpellAuraModBaseHealth(bool apply);
727        void SpellAuraModAttackPowerOfArmor(bool apply);
728        void SpellAuraReflectSpellsInfront(bool apply);
729        void UpdateAuraModDecreaseSpeed();
730
731        void SendModifierLog(int32 ** m,int32 v,uint32* mask,uint8 type,bool pct = false);
732        void SendDummyModifierLog(std::map<SpellEntry*,uint32> * m,SpellEntry * spellInfo,uint32 i,bool apply,bool pct = false);
733
734        // Events
735        void EventPeriodicDamage(uint32);
736        void EventPeriodicDamagePercent(uint32);
737        void EventPeriodicHeal(uint32);
738        void EventPeriodicTriggerSpell(SpellEntry* spellInfo);
739        void EventPeriodicTrigger(uint32 amount, uint32 type);
740        void EventPeriodicEnergize(uint32,uint32);
741        void EventPeriodicEnergizeVariable(uint32,uint32);
742        void EventPeriodicHeal1(uint32);
743        void EventPeriodicLeech(uint32);
744        void EventPeriodicBurn(uint32,uint32);
745        void EventPeriodicHealthFunnel(uint32);
746        void EventPeriodicManaLeech(uint32);
747        void EventPeriodicHealPct(float);
748        void EventPeriodicManaPct(float);
749        void EventPeriodicRegenManaStatPct(uint32 perc,uint32 stat);
750        void RelocateEvents();
751        int32 event_GetInstanceID();
752
753        ARCEMU_INLINE void SendPeriodicHealAuraLog(uint32 amt)
754        {
755                WorldPacket data(32);
756                data.SetOpcode(SMSG_PERIODICAURALOG);
757                data << m_target->GetNewGUID();
758                FastGUIDPack(data, m_casterGuid);
759                data << GetSpellProto()->Id;
760                data << uint32(1);
761                data << uint32(FLAG_PERIODIC_HEAL);
762                data << uint32(amt);
763                m_target->SendMessageToSet(&data,true);
764        }
765        // log message's
766        ARCEMU_INLINE void SendPeriodicAuraLog(Unit * Caster, Unit * Target, uint32 SpellID, uint32 School, uint32 Amount, uint32 abs_dmg, uint32 resisted_damage, uint32 Flags)
767        {
768                WorldPacket data(SMSG_PERIODICAURALOG, 46);
769                data << Target->GetNewGUID();              // target guid
770                data << Caster->GetNewGUID();              // caster guid
771                data << SpellID;                                                // spellid
772                data << (uint32)1;                                        // unknown? need research?
773                data << uint32(Flags | 0x1);                    // aura school
774                data << Amount;                                          // amount of done to target / heal / damage
775                data << (uint32)0;                               // cebernic: unknown?? needs more research, but it should fix unknown damage type with suffered.
776                data << g_spellSchoolConversionTable[School];
777                data << uint32(abs_dmg);
778                data << uint32(resisted_damage);
779                Caster->SendMessageToSet(&data, true);
780        }
781
782        void SendPeriodicAuraLog(const uint64& CasterGuid, Unit * Target, uint32 SpellID, uint32 School, uint32 Amount, uint32 abs_dmg, uint32 resisted_damage, uint32 Flags)
783        {
784                WorldPacket data(SMSG_PERIODICAURALOG, 46);
785                data << Target->GetNewGUID();              // target guid
786                FastGUIDPack(data, CasterGuid);          // caster guid
787                data << SpellID;                                                // spellid
788                data << (uint32)1;                                        // unknown?? need research?
789                data << uint32(Flags | 0x1);                    // aura school
790                data << Amount;                                          // amount of done to target / heal / damage
791                data << (uint32)0;                               // cebernic: unknown?? needs more research, but it should fix unknown damage type with suffered.
792                data << g_spellSchoolConversionTable[School];
793                data << uint32(abs_dmg);
794                data << uint32(resisted_damage);
795                Target->SendMessageToSet(&data, true);
796        }
797
798        bool WasCastInDuel() { return m_castInDuel; }
799
800        SpellEntry * m_spellProto;
801        // This is only used for AA
802        AreaAuraList targets;
803        uint64 m_casterGuid;
804
805        uint16 m_auraSlot;
806
807        uint32 m_castedItemId;
808        // Area aura stuff -> never passive.
809        bool m_areaAura;               
810        uint8 m_visualSlot;
811        // This represents the triggering spell id
812        uint32 pSpellId; 
813
814        // This stuff can be cached in spellproto.
815        ARCEMU_INLINE bool IsCombatStateAffecting()
816        {
817                for(uint32 x = 0; x < 3; ++x) {
818                        if(m_spellProto->EffectApplyAuraName[x] == SPELL_AURA_PERIODIC_DAMAGE ||
819                                m_spellProto->EffectApplyAuraName[x] == SPELL_AURA_PERIODIC_DAMAGE_PERCENT ||
820                                m_spellProto->EffectApplyAuraName[x] == SPELL_AURA_PERIODIC_TRIGGER_SPELL ||
821                                m_spellProto->EffectApplyAuraName[x] == SPELL_AURA_PERIODIC_LEECH ||
822                                m_spellProto->EffectApplyAuraName[x] == SPELL_AURA_PERIODIC_MANA_LEECH)
823                        {
824                                return true;
825                        }
826                }
827
828                return false;
829        }
830
831        bool m_castInDuel;
832        inline bool TargetWasImuneToMods()
833        {
834                return (m_modcount && ((( m_flags & MOD_0_RESISTED)+( m_flags & MOD_1_RESISTED)+( m_flags & MOD_2_RESISTED)) == m_modcount) );
835        }
836
837        int32 GetModAmount( uint32 i ) { if(i<3) return m_modList[i].m_amount; return 0; }
838        int32 GetModAmountByMod() { return mod->m_amount; };
839        uint32 GetAuraFlags() { return m_flags; }
840
841private:
842        uint32 GetCasterFaction() { return m_casterfaction; }
843        void SetCasterFaction(uint32 faction){ m_casterfaction = faction; }
844
845        ARCEMU_INLINE bool IsInrange(float x1,float y1, float z1, Object * o,float square_r)
846        {
847                float t;
848                float r;
849                t=x1-o->GetPositionX();
850                r=t*t;
851                t=y1-o->GetPositionY();
852                r+=t*t;
853                t=z1-o->GetPositionZ();
854                r+=t*t;
855                return ( r<=square_r);
856        }
857
858        Unit* m_target;
859        Player * p_target;
860        uint32 timeleft;
861        // In Milliseconds
862        int32 m_duration;
863//      bool m_positive;
864        signed char m_positive;
865
866        uint32 m_modcount;
867        Modifier m_modList[3];
868        Modifier * mod;
869
870        uint32  m_dynamicValue;
871        uint32  m_flags;
872
873protected:
874        uint32 m_casterfaction;
875
876        void SendInterrupted(uint8 result, Object * m_caster);
877        void SendChannelUpdate(uint32 time, Object * m_caster);
878public:
879        bool m_temporary;       // Skip saving
880        bool m_deleted;
881        int16 m_interrupted;
882        bool m_ignoreunapply; // \\\"special\\\" case, for unapply
883
884        ARCEMU_INLINE bool IsInterrupted() { return ( m_interrupted >= 0 ); }
885};
886
887typedef void(Aura::*pSpellAura)(bool apply);
Note: See TracBrowser for help on using the browser.