TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Unit.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef __UNIT_H
20 #define __UNIT_H
21 
22 #include "DBCStructure.h"
23 #include "EventProcessor.h"
24 #include "FollowerReference.h"
25 #include "FollowerRefManager.h"
26 #include "HostileRefManager.h"
27 #include "MotionMaster.h"
28 #include "Object.h"
29 #include "SpellAuraDefines.h"
30 #include "ThreatManager.h"
31 #include "MoveSplineInit.h"
32 
33 #define WORLD_TRIGGER 12999
34 
36 {
37  SPELL_INTERRUPT_FLAG_MOVEMENT = 0x01, // why need this for instant?
38  SPELL_INTERRUPT_FLAG_PUSH_BACK = 0x02, // push back
39  SPELL_INTERRUPT_FLAG_UNK3 = 0x04, // any info?
40  SPELL_INTERRUPT_FLAG_INTERRUPT = 0x08, // interrupt
41  SPELL_INTERRUPT_FLAG_ABORT_ON_DMG = 0x10 // _complete_ interrupt on direct damage
42  //SPELL_INTERRUPT_UNK = 0x20 // unk, 564 of 727 spells having this spell start with "Glyph"
43 };
44 
45 // See SpellAuraInterruptFlags for other values definitions
47 {
48  CHANNEL_INTERRUPT_FLAG_INTERRUPT = 0x08, // interrupt
50 };
51 
53 {
54  AURA_INTERRUPT_FLAG_HITBYSPELL = 0x00000001, // 0 removed when getting hit by a negative spell?
55  AURA_INTERRUPT_FLAG_TAKE_DAMAGE = 0x00000002, // 1 removed by any damage
56  AURA_INTERRUPT_FLAG_CAST = 0x00000004, // 2 cast any spells
57  AURA_INTERRUPT_FLAG_MOVE = 0x00000008, // 3 removed by any movement
58  AURA_INTERRUPT_FLAG_TURNING = 0x00000010, // 4 removed by any turning
59  AURA_INTERRUPT_FLAG_JUMP = 0x00000020, // 5 removed by entering combat
60  AURA_INTERRUPT_FLAG_NOT_MOUNTED = 0x00000040, // 6 removed by dismounting
61  AURA_INTERRUPT_FLAG_NOT_ABOVEWATER = 0x00000080, // 7 removed by entering water
62  AURA_INTERRUPT_FLAG_NOT_UNDERWATER = 0x00000100, // 8 removed by leaving water
63  AURA_INTERRUPT_FLAG_NOT_SHEATHED = 0x00000200, // 9 removed by unsheathing
64  AURA_INTERRUPT_FLAG_TALK = 0x00000400, // 10 talk to npc / loot? action on creature
65  AURA_INTERRUPT_FLAG_USE = 0x00000800, // 11 mine/use/open action on gameobject
66  AURA_INTERRUPT_FLAG_MELEE_ATTACK = 0x00001000, // 12 removed by attacking
67  AURA_INTERRUPT_FLAG_SPELL_ATTACK = 0x00002000, // 13 ???
68  AURA_INTERRUPT_FLAG_UNK14 = 0x00004000, // 14
69  AURA_INTERRUPT_FLAG_TRANSFORM = 0x00008000, // 15 removed by transform?
70  AURA_INTERRUPT_FLAG_UNK16 = 0x00010000, // 16
71  AURA_INTERRUPT_FLAG_MOUNT = 0x00020000, // 17 misdirect, aspect, swim speed
72  AURA_INTERRUPT_FLAG_NOT_SEATED = 0x00040000, // 18 removed by standing up (used by food and drink mostly and sleep/Fake Death like)
73  AURA_INTERRUPT_FLAG_CHANGE_MAP = 0x00080000, // 19 leaving map/getting teleported
74  AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION = 0x00100000, // 20 removed by auras that make you invulnerable, or make other to lose selection on you
75  AURA_INTERRUPT_FLAG_UNK21 = 0x00200000, // 21
76  AURA_INTERRUPT_FLAG_TELEPORTED = 0x00400000, // 22
77  AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT = 0x00800000, // 23 removed by entering pvp combat
78  AURA_INTERRUPT_FLAG_DIRECT_DAMAGE = 0x01000000, // 24 removed by any direct damage
79  AURA_INTERRUPT_FLAG_LANDING = 0x02000000, // 25 removed by hitting the ground
80 
82 };
83 
85 {
100  SPELLMOD_COST = 14, // Used when SpellPowerEntry::PowerIndex == 0
111  // spellmod 25
115  SPELLMOD_CRIT_DAMAGE_BONUS_2 = 29, //one not used spell
117  SPELLMOD_STACK_AMOUNT = 31, // has no effect on tooltip parsing
120  SPELLMOD_SPELL_COST2 = 34, // Used when SpellPowerEntry::PowerIndex == 1
122  SPELLMOD_STACK_AMOUNT2 = 37 // same as SPELLMOD_STACK_AMOUNT but affects tooltips
123 };
124 
125 #define MAX_SPELLMOD 38
126 
128 {
165 };
166 
168 {
169  typedef std::pair<SpellValueMod, int32> CustomSpellValueMod;
170  typedef std::vector<CustomSpellValueMod> StorageType;
171 
172 public:
173  typedef StorageType::const_iterator const_iterator;
174 
175 public:
177  {
178  storage_.push_back(CustomSpellValueMod(mod, value));
179  }
180 
181  const_iterator begin() const
182  {
183  return storage_.begin();
184  }
185 
186  const_iterator end() const
187  {
188  return storage_.end();
189  }
190 
191 private:
192  StorageType storage_;
193 };
194 
196 {
198 };
199 
200 #define BASE_MINDAMAGE 1.0f
201 #define BASE_MAXDAMAGE 2.0f
202 #define BASE_ATTACK_TIME 2000
203 
204 // byte value (UNIT_FIELD_BYTES_1, 0)
206 {
217 };
218 
219 // byte flag value (UNIT_FIELD_BYTES_1, 2)
221 {
228 };
229 
231 {
235 };
236 
238 {
242 };
243 
245 {
248 };
249 
250 // byte flags value (UNIT_FIELD_BYTES_1, 3)
252 {
257 };
258 
259 // high byte (3 from 0..3) of UNIT_FIELD_BYTES_2
261 {
262  FORM_NONE = 0x00,
263  FORM_CAT = 0x01,
264  FORM_TREE = 0x02,
265  FORM_TRAVEL = 0x03,
266  FORM_AQUA = 0x04,
267  FORM_BEAR = 0x05,
268  FORM_AMBIENT = 0x06,
269  FORM_GHOUL = 0x07,
270  FORM_DIREBEAR = 0x08, // Removed in 4.0.1
282  FORM_TEST = 0x14,
283  FORM_ZOMBIE = 0x15,
285  FORM_UNDEAD = 0x19,
288  FORM_SHADOW = 0x1C,
289  FORM_FLIGHT = 0x1D,
290  FORM_STEALTH = 0x1E,
291  FORM_MOONKIN = 0x1F,
293 };
294 
295 // low byte (0 from 0..3) of UNIT_FIELD_BYTES_2
297 {
298  SHEATH_STATE_UNARMED = 0, // non prepared weapon
299  SHEATH_STATE_MELEE = 1, // prepared melee weapon
300  SHEATH_STATE_RANGED = 2 // prepared ranged weapon
301 };
302 
303 #define MAX_SHEATH_STATE 3
304 
305 // byte (1 from 0..3) of UNIT_FIELD_BYTES_2
307 {
316 };
317 
318 // byte (2 from 0..3) of UNIT_FIELD_BYTES_2
320 {
323 };
324 
325 #define MAX_SPELL_CHARM 4
326 #define MAX_SPELL_VEHICLE 6
327 #define MAX_SPELL_POSSESS 8
328 #define MAX_SPELL_CONTROL_BAR 10
329 
330 #define MAX_AGGRO_RESET_TIME 10 // in seconds
331 #define MAX_AGGRO_RADIUS 45.0f // yards
332 
334 {
335  VICTIMSTATE_INTACT = 0, // set when attacker misses
336  VICTIMSTATE_HIT = 1, // victim got clear/blocked hit
340  VICTIMSTATE_BLOCKS = 5, // unused? not set when blocked, even on full block
344 };
345 
347 {
348  HITINFO_NORMALSWING = 0x00000000,
349  HITINFO_UNK1 = 0x00000001, // req correct packet structure
351  HITINFO_OFFHAND = 0x00000004,
352  HITINFO_UNK2 = 0x00000008,
353  HITINFO_MISS = 0x00000010,
354  HITINFO_FULL_ABSORB = 0x00000020,
356  HITINFO_FULL_RESIST = 0x00000080,
358  HITINFO_CRITICALHIT = 0x00000200, // critical hit
359  // 0x00000400
360  // 0x00000800
361  HITINFO_UNK12 = 0x00001000,
362  HITINFO_BLOCK = 0x00002000, // blocked damage
363  // 0x00004000 // Hides worldtext for 0 damage
364  // 0x00008000 // Related to blood visual
365  HITINFO_GLANCING = 0x00010000,
366  HITINFO_CRUSHING = 0x00020000,
367  HITINFO_NO_ANIMATION = 0x00040000,
368  // 0x00080000
369  // 0x00100000
370  HITINFO_SWINGNOHITSOUND = 0x00200000, // unused?
371  // 0x00400000
372  HITINFO_RAGE_GAIN = 0x00800000
373 };
374 
375 //i would like to remove this: (it is defined in item.h
377 {
378  NULL_BAG = 0,
379  NULL_SLOT = 255
380 };
381 
382 struct FactionTemplateEntry;
383 struct MountCapabilityEntry;
384 struct SpellValue;
385 
386 class AuraApplication;
387 class Aura;
388 class UnitAura;
389 class AuraEffect;
390 class Creature;
391 class Spell;
392 class SpellInfo;
393 class SpellEffectInfo;
394 class SpellHistory;
395 class DynamicObject;
396 class GameObject;
397 class Item;
398 class Pet;
399 class PetAura;
400 class Minion;
401 class Guardian;
402 class UnitAI;
403 class Totem;
404 class Transport;
405 class Vehicle;
406 class VehicleJoinEvent;
407 class TransportBase;
408 class SpellCastTargets;
409 namespace Movement
410 {
411  class MoveSpline;
412 }
413 namespace WorldPackets
414 {
415  namespace CombatLog
416  {
417  class CombatLogServerPacket;
418  }
419 }
420 
421 typedef std::list<Unit*> UnitList;
422 typedef std::list<std::pair<Aura*, uint8>> DispelChargesList;
423 
425 {
428 };
429 
430 typedef std::list<SpellImmune> SpellImmuneList;
431 
433 {
435  BASE_PCT_EXCLUDE_CREATE = 1, // percent modifier affecting all stat values from auras and gear but not player base for level
436  BASE_PCT = 2,
440 };
441 
443 {
446 };
447 
449 {
451  AURA_REMOVE_BY_DEFAULT = 1, // scripted remove, remove by stack with aura with different ids and sc aura remove
453  AURA_REMOVE_BY_ENEMY_SPELL, // dispel and absorb aura destroy
454  AURA_REMOVE_BY_EXPIRE, // aura duration has ended
456 };
457 
459 {
460  TRIGGERED_NONE = 0x00000000,
461  TRIGGERED_IGNORE_GCD = 0x00000001,
468  TRIGGERED_CAST_DIRECTLY = 0x00000080,
479  TRIGGERED_FULL_MASK = 0xFFFFFFFF
480 };
481 
483 {
484  UNIT_MOD_STAT_STRENGTH, // UNIT_MOD_STAT_STRENGTH..UNIT_MOD_STAT_SPIRIT must be in existed order, it's accessed by index values of Stats enum.
490  UNIT_MOD_MANA, // UNIT_MOD_MANA..UNIT_MOD_RUNIC_POWER must be in existed order, it's accessed by index values of Powers enum.
494  UNIT_MOD_UNUSED, // Old UNIT_MOD_HAPPINESS
501  UNIT_MOD_ARMOR, // UNIT_MOD_ARMOR..UNIT_MOD_RESISTANCE_ARCANE must be in existed order, it's accessed by index values of SpellSchools enum.
514  // synonyms
521 };
522 
524 {
530 };
531 
533 {
537 };
538 
540 {
541  ALIVE = 0,
543  CORPSE = 2,
544  DEAD = 3,
546 };
547 
549 {
550  UNIT_STATE_DIED = 0x00000001, // player has fake death aura
551  UNIT_STATE_MELEE_ATTACKING = 0x00000002, // player is melee attacking someone
552  //UNIT_STATE_MELEE_ATTACK_BY = 0x00000004, // player is melee attack by someone
553  UNIT_STATE_STUNNED = 0x00000008,
554  UNIT_STATE_ROAMING = 0x00000010,
555  UNIT_STATE_CHASE = 0x00000020,
556  //UNIT_STATE_SEARCHING = 0x00000040,
557  UNIT_STATE_FLEEING = 0x00000080,
558  UNIT_STATE_IN_FLIGHT = 0x00000100, // player is in flight mode
559  UNIT_STATE_FOLLOW = 0x00000200,
560  UNIT_STATE_ROOT = 0x00000400,
561  UNIT_STATE_CONFUSED = 0x00000800,
562  UNIT_STATE_DISTRACTED = 0x00001000,
563  UNIT_STATE_ISOLATED = 0x00002000, // area auras do not affect other players
565  UNIT_STATE_CASTING = 0x00008000,
566  UNIT_STATE_POSSESSED = 0x00010000,
567  UNIT_STATE_CHARGING = 0x00020000,
568  UNIT_STATE_JUMPING = 0x00040000,
569  UNIT_STATE_MOVE = 0x00100000,
570  UNIT_STATE_ROTATING = 0x00200000,
571  UNIT_STATE_EVADE = 0x00400000,
575  UNIT_STATE_CHASE_MOVE = 0x04000000,
577  UNIT_STATE_IGNORE_PATHFINDING = 0x10000000, // do not use pathfinding in any MovementGenerator
585  // for real move using movegen check and stop (except unstoppable flight)
592  // stay by different reasons
594  UNIT_STATE_ALL_STATE = 0xffffffff //(UNIT_STATE_STOPPED | UNIT_STATE_MOVING | UNIT_STATE_IN_COMBAT | UNIT_STATE_IN_FLIGHT)
595 };
596 
598 {
600  MOVE_RUN = 1,
608 };
609 
610 #define MAX_MOVE_TYPE 9
611 
614 
616 {
621 };
622 
624 {
626  CR_DEFENSE_SKILL = 1, // Removed in 4.0.1
627  CR_DODGE = 2,
628  CR_PARRY = 3,
629  CR_BLOCK = 4,
638  CR_SPEED = 13,
654  // placeholder = 29,
656 };
657 
658 #define MAX_COMBAT_RATING 31
659 
661 {
662  DIRECT_DAMAGE = 0, // used for normal weapon damage (not for class abilities or spells)
663  SPELL_DIRECT_DAMAGE = 1, // spell/class abilities damage
664  DOT = 2,
665  HEAL = 3,
666  NODAMAGE = 4, // used also in case when damage applied to health but not applied to spell channelInterruptFlags/etc
668 };
669 
670 // Value masks for UNIT_FIELD_FLAGS
672 {
673  UNIT_FLAG_SERVER_CONTROLLED = 0x00000001, // set only when unit movement is controlled by server - by SPLINE/MONSTER_MOVE packets, together with UNIT_FLAG_STUNNED; only set to units controlled by client; client function CGUnit_C::IsClientControlled returns false when set for owner
674  UNIT_FLAG_NON_ATTACKABLE = 0x00000002, // not attackable
676  UNIT_FLAG_PVP_ATTACKABLE = 0x00000008, // allow apply pvp rules to attackable state in addition to faction dependent state
677  UNIT_FLAG_RENAME = 0x00000010,
678  UNIT_FLAG_PREPARATION = 0x00000020, // don't take reagents for spells with SPELL_ATTR5_NO_REAGENT_WHILE_PREP
679  UNIT_FLAG_UNK_6 = 0x00000040,
680  UNIT_FLAG_NOT_ATTACKABLE_1 = 0x00000080, // ?? (UNIT_FLAG_PVP_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1) is NON_PVP_ATTACKABLE
681  UNIT_FLAG_IMMUNE_TO_PC = 0x00000100, // disables combat/assistance with PlayerCharacters (PC) - see Unit::_IsValidAttackTarget, Unit::_IsValidAssistTarget
682  UNIT_FLAG_IMMUNE_TO_NPC = 0x00000200, // disables combat/assistance with NonPlayerCharacters (NPC) - see Unit::_IsValidAttackTarget, Unit::_IsValidAssistTarget
683  UNIT_FLAG_LOOTING = 0x00000400, // loot animation
684  UNIT_FLAG_PET_IN_COMBAT = 0x00000800, // in combat?, 2.0.8
685  UNIT_FLAG_PVP = 0x00001000, // changed in 3.0.3
686  UNIT_FLAG_SILENCED = 0x00002000, // silenced, 2.1.1
687  UNIT_FLAG_UNK_14 = 0x00004000, // 2.0.8
688  UNIT_FLAG_UNK_15 = 0x00008000,
689  UNIT_FLAG_UNK_16 = 0x00010000,
690  UNIT_FLAG_PACIFIED = 0x00020000, // 3.0.3 ok
691  UNIT_FLAG_STUNNED = 0x00040000, // 3.0.3 ok
692  UNIT_FLAG_IN_COMBAT = 0x00080000,
693  UNIT_FLAG_TAXI_FLIGHT = 0x00100000, // disable casting at client side spell not allowed by taxi flight (mounted?), probably used with 0x4 flag
694  UNIT_FLAG_DISARMED = 0x00200000, // 3.0.3, disable melee spells casting..., "Required melee weapon" added to melee spells tooltip.
695  UNIT_FLAG_CONFUSED = 0x00400000,
696  UNIT_FLAG_FLEEING = 0x00800000,
697  UNIT_FLAG_PLAYER_CONTROLLED = 0x01000000, // used in spell Eyes of the Beast for pet... let attack by controlled creature
699  UNIT_FLAG_SKINNABLE = 0x04000000,
700  UNIT_FLAG_MOUNT = 0x08000000,
701  UNIT_FLAG_UNK_28 = 0x10000000,
702  UNIT_FLAG_UNK_29 = 0x20000000, // used in Feing Death spell
703  UNIT_FLAG_SHEATHE = 0x40000000,
704  UNIT_FLAG_UNK_31 = 0x80000000,
706 };
707 
708 // Value masks for UNIT_FIELD_FLAGS_2
710 {
712  UNIT_FLAG2_UNK1 = 0x00000002, // Hide unit model (show only player equip)
716  UNIT_FLAG2_INSTANTLY_APPEAR_MODEL = 0x00000020, // Unit model instantly appears when summoned (does not fade in)
719  UNIT_FLAG2_DISABLE_PRED_STATS = 0x00000100, // Player has disabled predicted stats (Used by raid frames)
720  UNIT_FLAG2_DISARM_RANGED = 0x00000400, // this does not disable ranged weapon display (maybe additional flag needed?)
722  UNIT_FLAG2_RESTRICT_PARTY_INTERACTION = 0x00001000, // Restrict interaction to party or raid
723  UNIT_FLAG2_PREVENT_SPELL_CLICK = 0x00002000, // Prevent spellclick
726  UNIT_FLAG2_UNK2 = 0x00010000,
727  UNIT_FLAG2_PLAY_DEATH_ANIM = 0x00020000, // Plays special death animation upon death
728  UNIT_FLAG2_ALLOW_CHEAT_SPELLS = 0x00040000 // Allows casting spells with AttributesEx7 & SPELL_ATTR7_IS_CHEAT_SPELL
729 };
730 
733 {
734  UNIT_NPC_FLAG_NONE = 0x0000000000,
735  UNIT_NPC_FLAG_GOSSIP = 0x0000000001, // 100%
736  UNIT_NPC_FLAG_QUESTGIVER = 0x0000000002, // 100%
737  UNIT_NPC_FLAG_UNK1 = 0x0000000004,
738  UNIT_NPC_FLAG_UNK2 = 0x0000000008,
739  UNIT_NPC_FLAG_TRAINER = 0x0000000010, // 100%
740  UNIT_NPC_FLAG_TRAINER_CLASS = 0x0000000020, // 100%
741  UNIT_NPC_FLAG_TRAINER_PROFESSION = 0x0000000040, // 100%
742  UNIT_NPC_FLAG_VENDOR = 0x0000000080, // 100%
743  UNIT_NPC_FLAG_VENDOR_AMMO = 0x0000000100, // 100%, general goods vendor
744  UNIT_NPC_FLAG_VENDOR_FOOD = 0x0000000200, // 100%
745  UNIT_NPC_FLAG_VENDOR_POISON = 0x0000000400, // guessed
746  UNIT_NPC_FLAG_VENDOR_REAGENT = 0x0000000800, // 100%
747  UNIT_NPC_FLAG_REPAIR = 0x0000001000, // 100%
748  UNIT_NPC_FLAG_FLIGHTMASTER = 0x0000002000, // 100%
749  UNIT_NPC_FLAG_SPIRITHEALER = 0x0000004000, // guessed
750  UNIT_NPC_FLAG_SPIRITGUIDE = 0x0000008000, // guessed
751  UNIT_NPC_FLAG_INNKEEPER = 0x0000010000, // 100%
752  UNIT_NPC_FLAG_BANKER = 0x0000020000, // 100%
753  UNIT_NPC_FLAG_PETITIONER = 0x0000040000, // 100% 0xC0000 = guild petitions, 0x40000 = arena team petitions
754  UNIT_NPC_FLAG_TABARDDESIGNER = 0x0000080000, // 100%
755  UNIT_NPC_FLAG_BATTLEMASTER = 0x0000100000, // 100%
756  UNIT_NPC_FLAG_AUCTIONEER = 0x0000200000, // 100%
757  UNIT_NPC_FLAG_STABLEMASTER = 0x0000400000, // 100%
758  UNIT_NPC_FLAG_GUILD_BANKER = 0x0000800000, // cause client to send 997 opcode
759  UNIT_NPC_FLAG_SPELLCLICK = 0x0001000000, // cause client to send 1015 opcode (spell click)
760  UNIT_NPC_FLAG_PLAYER_VEHICLE = 0x0002000000, // players with mounts that have vehicle data should have it set
761  UNIT_NPC_FLAG_MAILBOX = 0x0004000000, // mailbox
762  UNIT_NPC_FLAG_REFORGER = 0x0008000000, // reforging
763  UNIT_NPC_FLAG_TRANSMOGRIFIER = 0x0010000000, // transmogrification
764  UNIT_NPC_FLAG_VAULTKEEPER = 0x0020000000, // void storage
765  UNIT_NPC_FLAG_BLACK_MARKET = 0x0080000000, // black market
771 };
772 
774 {
775  MOVEMENTFLAG_NONE = 0x00000000,
776  MOVEMENTFLAG_FORWARD = 0x00000001,
777  MOVEMENTFLAG_BACKWARD = 0x00000002,
780  MOVEMENTFLAG_LEFT = 0x00000010,
781  MOVEMENTFLAG_RIGHT = 0x00000020,
782  MOVEMENTFLAG_PITCH_UP = 0x00000040,
784  MOVEMENTFLAG_WALKING = 0x00000100, // Walking
785  MOVEMENTFLAG_DISABLE_GRAVITY = 0x00000200, // Former MOVEMENTFLAG_LEVITATING. This is used when walking is not possible.
786  MOVEMENTFLAG_ROOT = 0x00000400, // Must not be set along with MOVEMENTFLAG_MASK_MOVING
787  MOVEMENTFLAG_FALLING = 0x00000800, // damage dealt on that type of falling
796  MOVEMENTFLAG_SWIMMING = 0x00100000, // appears with fly flag also
797  MOVEMENTFLAG_ASCENDING = 0x00200000, // press "space" when flying
799  MOVEMENTFLAG_CAN_FLY = 0x00800000, // Appears when unit can fly AND also walk
800  MOVEMENTFLAG_FLYING = 0x01000000, // unit is actually flying. pretty sure this is only used for players. creatures use disable_gravity
801  MOVEMENTFLAG_SPLINE_ELEVATION = 0x02000000, // used for flight paths
802  MOVEMENTFLAG_WATERWALKING = 0x04000000, // prevent unit from falling through water
803  MOVEMENTFLAG_FALLING_SLOW = 0x08000000, // active rogue safe fall spell (passive)
804  MOVEMENTFLAG_HOVER = 0x10000000, // hover, cannot jump
806 
812 
815 
818 
819  // Movement flags allowed for creature in CreateObject - we need to keep all other enabled serverside
820  // to properly calculate all movement
824 
828 
832 };
833 
835 {
836  MOVEMENTFLAG2_NONE = 0x00000000,
842  MOVEMENTFLAG2_UNK5 = 0x00000020,
843  MOVEMENTFLAG2_UNK6 = 0x00000040,
844  MOVEMENTFLAG2_UNK7 = 0x00000080,
845  MOVEMENTFLAG2_UNK8 = 0x00000100,
846  MOVEMENTFLAG2_UNK9 = 0x00000200,
848  MOVEMENTFLAG2_UNK11 = 0x00000800,
849  MOVEMENTFLAG2_UNK12 = 0x00001000,
853 };
854 
856 {
857  UNIT_MASK_NONE = 0x00000000,
858  UNIT_MASK_SUMMON = 0x00000001,
859  UNIT_MASK_MINION = 0x00000002,
860  UNIT_MASK_GUARDIAN = 0x00000004,
861  UNIT_MASK_TOTEM = 0x00000008,
862  UNIT_MASK_PET = 0x00000010,
863  UNIT_MASK_VEHICLE = 0x00000020,
864  UNIT_MASK_PUPPET = 0x00000040,
865  UNIT_MASK_HUNTER_PET = 0x00000080,
867  UNIT_MASK_ACCESSORY = 0x00000200
868 };
869 
871 {
873  : DRGroup(group), stack(0), hitTime(t), hitCount(count)
874  { }
875 
880 };
881 
883 {
886 };
887 
889 {
890 public:
891  explicit DispelInfo(Unit* dispeller, uint32 dispellerSpellId, uint8 chargesRemoved) :
892  _dispellerUnit(dispeller), _dispellerSpell(dispellerSpellId), _chargesRemoved(chargesRemoved) { }
893 
894  Unit* GetDispeller() const { return _dispellerUnit; }
898  {
899  _chargesRemoved = amount;
900  }
901 private:
905 };
906 
908 {
909  CleanDamage(uint32 mitigated, uint32 absorbed, WeaponAttackType _attackType, MeleeHitOutcome _hitOutCome) :
910  absorbed_damage(absorbed), mitigated_damage(mitigated), attackType(_attackType), hitOutCome(_hitOutCome) { }
911 
914 
917 };
918 
919 struct CalcDamageInfo;
920 
922 {
923 private:
924  Unit* const m_attacker;
925  Unit* const m_victim;
927  SpellInfo const* const m_spellInfo;
934 public:
935  explicit DamageInfo(Unit* _attacker, Unit* _victim, uint32 _damage, SpellInfo const* _spellInfo, SpellSchoolMask _schoolMask, DamageEffectType _damageType);
936  explicit DamageInfo(CalcDamageInfo& dmgInfo);
937 
938  void ModifyDamage(int32 amount);
939  void AbsorbDamage(uint32 amount);
940  void ResistDamage(uint32 amount);
941  void BlockDamage(uint32 amount);
942 
943  Unit* GetAttacker() const { return m_attacker; }
944  Unit* GetVictim() const { return m_victim; }
945  SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
946  SpellSchoolMask GetSchoolMask() const { return m_schoolMask; }
947  DamageEffectType GetDamageType() const { return m_damageType; }
948  WeaponAttackType GetAttackType() const { return m_attackType; }
949  uint32 GetDamage() const { return m_damage; }
950  uint32 GetAbsorb() const { return m_absorb; }
951  uint32 GetResist() const { return m_resist; }
952  uint32 GetBlock() const { return m_block; }
953 };
954 
955 class HealInfo
956 {
957 private:
958  Unit* const _healer;
959  Unit* const _target;
962  SpellInfo const* const _spellInfo;
964 
965 public:
966  explicit HealInfo(Unit* healer, Unit* target, uint32 heal, SpellInfo const* spellInfo, SpellSchoolMask schoolMask)
967  : _healer(healer), _target(target), _heal(heal), _absorb(0), _spellInfo(spellInfo), _schoolMask(schoolMask) { }
968 
969  void AbsorbHeal(uint32 amount)
970  {
971  amount = std::min(amount, GetHeal());
972  _absorb += amount;
973  _heal -= amount;
974  }
975 
976  Unit* GetHealer() const { return _healer; }
977  Unit* GetTarget() const { return _target; }
978  uint32 GetHeal() const { return _heal; }
979  uint32 GetAbsorb() const { return _absorb; }
980  SpellInfo const* GetSpellInfo() const { return _spellInfo; };
982 };
983 
985 {
986 public:
987  ProcEventInfo(Unit* actor, Unit* actionTarget, Unit* procTarget, uint32 typeMask,
988  uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask,
989  Spell* spell, DamageInfo* damageInfo, HealInfo* healInfo);
990 
991  Unit* GetActor() { return _actor; }
992  Unit* GetActionTarget() const { return _actionTarget; }
993  Unit* GetProcTarget() const { return _procTarget; }
994 
995  uint32 GetTypeMask() const { return _typeMask; }
996  uint32 GetSpellTypeMask() const { return _spellTypeMask; }
997  uint32 GetSpellPhaseMask() const { return _spellPhaseMask; }
998  uint32 GetHitMask() const { return _hitMask; }
999 
1000  SpellInfo const* GetSpellInfo() const;
1001  SpellSchoolMask GetSchoolMask() const;
1002 
1003  DamageInfo* GetDamageInfo() const { return _damageInfo; }
1004  HealInfo* GetHealInfo() const { return _healInfo; }
1005 
1006 private:
1007  Unit* const _actor;
1017 };
1018 
1019 // Struct for use in Unit::CalculateMeleeDamage
1020 // Need create structure like in SMSG_ATTACKERSTATEUPDATE opcode
1022 {
1023  Unit *attacker; // Attacker
1024  Unit *target; // Target for damage
1032 // Helper
1037  uint32 cleanDamage; // Used only for rage calculation
1039 };
1040 
1041 // Spell damage info structure based on structure sending in SMSG_SPELLNONMELEEDAMAGELOG opcode
1043 {
1044  SpellNonMeleeDamage(Unit* _attacker, Unit* _target, uint32 _SpellID, uint32 _schoolMask);
1045 
1056  // Used for help
1059 };
1060 
1062 {
1063  SpellPeriodicAuraLogInfo(AuraEffect const* _auraEff, uint32 _damage, uint32 _overDamage, uint32 _absorb, uint32 _resist, float _multiplier, bool _critical)
1064  : auraEff(_auraEff), damage(_damage), overDamage(_overDamage), absorb(_absorb), resist(_resist), multiplier(_multiplier), critical(_critical){ }
1065 
1068  uint32 overDamage; // overkill/overheal
1071  float multiplier;
1072  bool critical;
1073 };
1074 
1075 uint32 createProcExtendMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCondition);
1076 
1078 {
1082 
1084  uint32 GetThreatPct() const { return _threatPct; }
1085 
1086  void Set(ObjectGuid guid, uint32 pct)
1087  {
1088  _targetGUID = guid;
1089  _threatPct = pct;
1090  }
1091 
1092  void ModifyThreatPct(int32 amount)
1093  {
1094  amount += _threatPct;
1095  _threatPct = uint32(std::max(0, amount));
1096  }
1097 };
1098 
1099 #define MAX_DECLINED_NAME_CASES 5
1100 
1102 {
1104 };
1105 
1107 {
1112 };
1113 
1114 #define CURRENT_FIRST_NON_MELEE_SPELL 1
1115 #define CURRENT_MAX_SPELL 4
1116 
1118 {
1119  ACT_PASSIVE = 0x01, // 0x01 - passive
1120  ACT_DISABLED = 0x81, // 0x80 - castable
1121  ACT_ENABLED = 0xC1, // 0x40 | 0x80 - auto cast + castable
1122  ACT_COMMAND = 0x07, // 0x01 | 0x02 | 0x04
1123  ACT_REACTION = 0x06, // 0x02 | 0x04
1124  ACT_DECIDE = 0x00 // custom
1125 };
1126 
1128 {
1133 };
1134 
1136 {
1142 };
1143 
1144 #define UNIT_ACTION_BUTTON_ACTION(X) (uint32(X) & 0x00FFFFFF)
1145 #define UNIT_ACTION_BUTTON_TYPE(X) ((uint32(X) & 0xFF000000) >> 24)
1146 #define MAKE_UNIT_ACTION_BUTTON(A, T) (uint32(A) | (uint32(T) << 24))
1147 
1149 {
1151 
1153 
1154  // helper
1156  uint32 GetAction() const { return UNIT_ACTION_BUTTON_ACTION(packedData); }
1157  bool IsActionBarForSpell() const
1158  {
1160  return Type == ACT_DISABLED || Type == ACT_ENABLED || Type == ACT_PASSIVE;
1161  }
1162 
1164  {
1165  packedData = MAKE_UNIT_ACTION_BUTTON(action, type);
1166  }
1167 
1169  {
1170  packedData = MAKE_UNIT_ACTION_BUTTON(UNIT_ACTION_BUTTON_ACTION(packedData), type);
1171  }
1172 
1173  void SetAction(uint32 action)
1174  {
1175  packedData = (packedData & 0xFF000000) | UNIT_ACTION_BUTTON_ACTION(action);
1176  }
1177 };
1178 
1179 typedef std::list<Player*> SharedVisionList;
1180 
1182 {
1187 };
1188 
1190 
1192 {
1197 };
1198 
1199 #define MAX_UNIT_ACTION_BAR_INDEX (ACTION_BAR_INDEX_END-ACTION_BAR_INDEX_START)
1200 
1202 {
1203  public:
1204  explicit CharmInfo(Unit* unit);
1205  ~CharmInfo();
1206  void RestoreState();
1207  uint32 GetPetNumber() const { return _petnumber; }
1208  void SetPetNumber(uint32 petnumber, bool statwindow);
1209 
1210  void SetCommandState(CommandStates st) { _CommandState = st; }
1211  CommandStates GetCommandState() const { return _CommandState; }
1212  bool HasCommandState(CommandStates state) const { return (_CommandState == state); }
1213 
1214  void InitPossessCreateSpells();
1215  void InitCharmCreateSpells();
1216  void InitPetActionBar();
1217  void InitEmptyActionBar(bool withAttack = true);
1218 
1219  //return true if successful
1220  bool AddSpellToActionBar(SpellInfo const* spellInfo, ActiveStates newstate = ACT_DECIDE, uint8 preferredSlot = 0);
1221  bool RemoveSpellFromActionBar(uint32 spell_id);
1222  void LoadPetActionBar(const std::string& data);
1223  void BuildActionBar(WorldPacket* data);
1224  void SetSpellAutocast(SpellInfo const* spellInfo, bool state);
1225  void SetActionBar(uint8 index, uint32 spellOrAction, ActiveStates type)
1226  {
1227  PetActionBar[index].SetActionAndType(spellOrAction, type);
1228  }
1229  UnitActionBarEntry const* GetActionBarEntry(uint8 index) const { return &(PetActionBar[index]); }
1230 
1231  void ToggleCreatureAutocast(SpellInfo const* spellInfo, bool apply);
1232 
1233  CharmSpellInfo* GetCharmSpell(uint8 index) { return &(_charmspells[index]); }
1234 
1235  void SetIsCommandAttack(bool val);
1236  bool IsCommandAttack();
1237  void SetIsCommandFollow(bool val);
1238  bool IsCommandFollow();
1239  void SetIsAtStay(bool val);
1240  bool IsAtStay();
1241  void SetIsFollowing(bool val);
1242  bool IsFollowing();
1243  void SetIsReturning(bool val);
1244  bool IsReturning();
1245  void SaveStayPosition();
1246  void GetStayPosition(float &x, float &y, float &z);
1247 
1248  private:
1249 
1252  CharmSpellInfo _charmspells[4];
1255 
1256  //for restoration after charmed
1258 
1264  float _stayX;
1265  float _stayY;
1266  float _stayZ;
1267 };
1268 
1269 // for clearing special attacks
1270 #define REACTIVE_TIMER_START 4000
1271 
1273 {
1277 };
1278 
1279 #define MAX_REACTIVE 3
1280 #define SUMMON_SLOT_PET 0
1281 #define SUMMON_SLOT_TOTEM 1
1282 #define MAX_TOTEM_SLOT 5
1283 #define SUMMON_SLOT_MINIPET 5
1284 #define SUMMON_SLOT_QUEST 6
1285 #define MAX_SUMMON_SLOT 7
1286 
1287 #define MAX_GAMEOBJECT_SLOT 4
1288 
1290 {
1295 };
1296 
1297 #define MAX_EQUIPMENT_ITEMS 3
1298 
1299 // delay time next attack to prevent client attack animation problems
1300 #define ATTACK_DISPLAY_DELAY 200
1301 #define MAX_PLAYER_STEALTH_DETECT_RANGE 30.0f // max distance for detection targets by player
1302 
1303 struct SpellProcEventEntry; // used only privately
1304 
1306 {
1307  public:
1308  typedef std::set<Unit*> AttackerSet;
1309  typedef std::set<Unit*> ControlList;
1310 
1311  typedef std::multimap<uint32, Aura*> AuraMap;
1312  typedef std::pair<AuraMap::const_iterator, AuraMap::const_iterator> AuraMapBounds;
1313  typedef std::pair<AuraMap::iterator, AuraMap::iterator> AuraMapBoundsNonConst;
1314 
1315  typedef std::multimap<uint32, AuraApplication*> AuraApplicationMap;
1316  typedef std::pair<AuraApplicationMap::const_iterator, AuraApplicationMap::const_iterator> AuraApplicationMapBounds;
1317  typedef std::pair<AuraApplicationMap::iterator, AuraApplicationMap::iterator> AuraApplicationMapBoundsNonConst;
1318 
1319  typedef std::multimap<AuraStateType, AuraApplication*> AuraStateAurasMap;
1320  typedef std::pair<AuraStateAurasMap::const_iterator, AuraStateAurasMap::const_iterator> AuraStateAurasMapBounds;
1321 
1322  typedef std::list<AuraEffect*> AuraEffectList;
1323  typedef std::list<Aura*> AuraList;
1324  typedef std::list<AuraApplication *> AuraApplicationList;
1325  typedef std::list<DiminishingReturn> Diminishing;
1326 
1327  typedef std::map<uint8, AuraApplication*> VisibleAuraMap;
1328 
1329  virtual ~Unit();
1330 
1331  UnitAI* GetAI() { return i_AI; }
1332  void SetAI(UnitAI* newAI) { i_AI = newAI; }
1333 
1334  void AddToWorld() override;
1335  void RemoveFromWorld() override;
1336 
1337  void CleanupBeforeRemoveFromMap(bool finalCleanup);
1338  void CleanupsBeforeDelete(bool finalCleanup = true) override; // used in ~Creature/~Player (or before mass creature delete to remove cross-references to already deleted units)
1339 
1340  void SendCombatLogMessage(WorldPackets::CombatLog::CombatLogServerPacket* combatLog) const;
1341 
1342  DiminishingLevels GetDiminishing(DiminishingGroup group);
1343  void IncrDiminishing(DiminishingGroup group);
1344  float ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, Unit* caster, DiminishingLevels Level, int32 limitduration);
1345  void ApplyDiminishingAura(DiminishingGroup group, bool apply);
1346  void ClearDiminishings() { m_Diminishing.clear(); }
1347 
1348  // target dependent range checks
1349  float GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const;
1350  float GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const;
1351 
1352  virtual void Update(uint32 time) override;
1353 
1354  void setAttackTimer(WeaponAttackType type, uint32 time) { m_attackTimer[type] = time; }
1355  void resetAttackTimer(WeaponAttackType type = BASE_ATTACK);
1356  uint32 getAttackTimer(WeaponAttackType type) const { return m_attackTimer[type]; }
1357  bool isAttackReady(WeaponAttackType type = BASE_ATTACK) const { return m_attackTimer[type] == 0; }
1358  bool haveOffhandWeapon() const;
1359  bool CanDualWield() const { return m_canDualWield; }
1360  virtual void SetCanDualWield(bool value) { m_canDualWield = value; }
1361  float GetCombatReach() const { return m_floatValues[UNIT_FIELD_COMBATREACH]; }
1362  float GetMeleeReach() const;
1363  bool IsWithinCombatRange(const Unit* obj, float dist2compare) const;
1364  bool IsWithinMeleeRange(const Unit* obj, float dist = MELEE_RANGE) const;
1365  void GetRandomContactPoint(const Unit* target, float &x, float &y, float &z, float distance2dMin, float distance2dMax) const;
1368 
1369  void _addAttacker(Unit* pAttacker); // must be called only from Unit::Attack(Unit*)
1370  void _removeAttacker(Unit* pAttacker); // must be called only from Unit::AttackStop()
1371  Unit* getAttackerForHelper() const; // If someone wants to help, who to give them
1372  bool Attack(Unit* victim, bool meleeAttack);
1373  void MustReacquireTarget() { m_shouldReacquireTarget = true; } // flags the Unit for forced target reacquisition in the next ::Attack call
1374  void CastStop(uint32 except_spellid = 0);
1375  bool AttackStop();
1376  void RemoveAllAttackers();
1377  AttackerSet const& getAttackers() const { return m_attackers; }
1378  bool isAttackingPlayer() const;
1379  Unit* GetVictim() const { return m_attacking; }
1380  // Use this only when 100% sure there is a victim
1382  {
1383  ASSERT(m_attacking);
1384  return m_attacking;
1385  }
1386 
1387  void CombatStop(bool includingCast = false);
1388  void CombatStopWithPets(bool includingCast = false);
1389  void StopAttackFaction(uint32 faction_id);
1390  Unit* SelectNearbyTarget(Unit* exclude = NULL, float dist = NOMINAL_MELEE_RANGE) const;
1391  void SendMeleeAttackStop(Unit* victim = NULL);
1392  void SendMeleeAttackStart(Unit* victim);
1393 
1394  void AddUnitState(uint32 f) { m_state |= f; }
1395  bool HasUnitState(const uint32 f) const { return (m_state & f) != 0; }
1396  void ClearUnitState(uint32 f) { m_state &= ~f; }
1397  bool CanFreeMove() const;
1398 
1399  uint32 HasUnitTypeMask(uint32 mask) const { return mask & m_unitTypeMask; }
1400  void AddUnitTypeMask(uint32 mask) { m_unitTypeMask |= mask; }
1401  bool IsSummon() const { return (m_unitTypeMask & UNIT_MASK_SUMMON) != 0; }
1402  bool IsGuardian() const { return (m_unitTypeMask & UNIT_MASK_GUARDIAN) != 0; }
1403  bool IsPet() const { return (m_unitTypeMask & UNIT_MASK_PET) != 0; }
1404  bool IsHunterPet() const{ return (m_unitTypeMask & UNIT_MASK_HUNTER_PET) != 0; }
1405  bool IsTotem() const { return (m_unitTypeMask & UNIT_MASK_TOTEM) != 0; }
1406  bool IsVehicle() const { return (m_unitTypeMask & UNIT_MASK_VEHICLE) != 0; }
1407 
1409  uint8 getLevelForTarget(WorldObject const* /*target*/) const override { return getLevel(); }
1410  void SetLevel(uint8 lvl);
1412  uint32 getRaceMask() const { return 1 << (getRace()-1); }
1414  uint32 getClassMask() const { return 1 << (getClass()-1); }
1416 
1417  float GetStat(Stats stat) const { return float(GetUInt32Value(UNIT_FIELD_STAT+stat)); }
1418  void SetStat(Stats stat, int32 val) { SetStatInt32Value(UNIT_FIELD_STAT+stat, val); }
1419  uint32 GetArmor() const { return GetResistance(SPELL_SCHOOL_NORMAL); }
1420  void SetArmor(int32 val) { SetResistance(SPELL_SCHOOL_NORMAL, val); }
1421 
1423  uint32 GetResistance(SpellSchoolMask mask) const;
1425 
1428 
1429  bool IsFullHealth() const { return GetHealth() == GetMaxHealth(); }
1430  bool HealthBelowPct(int32 pct) const { return GetHealth() < CountPctFromMaxHealth(pct); }
1431  bool HealthBelowPctDamaged(int32 pct, uint32 damage) const { return int64(GetHealth()) - int64(damage) < int64(CountPctFromMaxHealth(pct)); }
1432  bool HealthAbovePct(int32 pct) const { return GetHealth() > CountPctFromMaxHealth(pct); }
1433  bool HealthAbovePctHealed(int32 pct, uint32 heal) const { return uint64(GetHealth()) + uint64(heal) > CountPctFromMaxHealth(pct); }
1434  float GetHealthPct() const { return GetMaxHealth() ? 100.f * GetHealth() / GetMaxHealth() : 0.0f; }
1435  uint32 CountPctFromMaxHealth(int32 pct) const { return CalculatePct(GetMaxHealth(), pct); }
1436  uint32 CountPctFromCurHealth(int32 pct) const { return CalculatePct(GetHealth(), pct); }
1437 
1438  void SetHealth(uint32 val);
1439  void SetMaxHealth(uint32 val);
1440  inline void SetFullHealth() { SetHealth(GetMaxHealth()); }
1441  int32 ModifyHealth(int32 val);
1442  int32 GetHealthGain(int32 dVal);
1443 
1445  void setPowerType(Powers power);
1446  int32 GetPower(Powers power) const;
1447  int32 GetMinPower(Powers power) const { return power == POWER_ECLIPSE ? -100 : 0; }
1448  int32 GetMaxPower(Powers power) const;
1449  float GetPowerPct(Powers power) const { return GetMaxPower(power) ? 100.f * GetPower(power) / GetMaxPower(power) : 0.0f; }
1450  int32 CountPctFromMaxPower(Powers power, int32 pct) const { return CalculatePct(GetMaxPower(power), pct); }
1451  void SetPower(Powers power, int32 val);
1452  void SetMaxPower(Powers power, int32 val);
1453  // returns the change in power
1454  int32 ModifyPower(Powers power, int32 val);
1455  int32 ModifyPowerPct(Powers power, float pct, bool apply = true);
1456 
1457  uint32 GetAttackTime(WeaponAttackType att) const;
1458  void SetAttackTime(WeaponAttackType att, uint32 val) { SetFloatValue(UNIT_FIELD_BASEATTACKTIME + att, val*m_modAttackSpeedPct[att]); }
1459  void ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply);
1460  void ApplyCastTimePercentMod(float val, bool apply);
1461 
1463  virtual void SetSheath(SheathState sheathed) { SetByteValue(UNIT_FIELD_BYTES_2, 0, sheathed); }
1464 
1465  // faction template id
1468  FactionTemplateEntry const* GetFactionTemplateEntry() const;
1469 
1470  ReputationRank GetReactionTo(Unit const* target) const;
1471  ReputationRank static GetFactionReactionTo(FactionTemplateEntry const* factionTemplateEntry, Unit const* target);
1472 
1473  bool IsHostileTo(Unit const* unit) const;
1474  bool IsHostileToPlayers() const;
1475  bool IsFriendlyTo(Unit const* unit) const;
1476  bool IsNeutralToAll() const;
1477  bool IsInPartyWith(Unit const* unit) const;
1478  bool IsInRaidWith(Unit const* unit) const;
1479  void GetPartyMembers(std::list<Unit*> &units);
1480  bool IsContestedGuard() const;
1483  virtual void SetPvP(bool state);
1484 
1485  uint32 GetCreatureType() const;
1486  uint32 GetCreatureTypeMask() const;
1487 
1489  bool IsSitState() const;
1490  bool IsStandState() const;
1491  void SetStandState(UnitStandStateType state, uint32 animKitID = 0);
1492 
1495 
1498  void Mount(uint32 mount, uint32 vehicleId = 0, uint32 creatureEntry = 0);
1499  void Dismount();
1500  MountCapabilityEntry const* GetMountCapability(uint32 mountType) const;
1501 
1502  void SendDurabilityLoss(Player* receiver, uint32 percent);
1503  void PlayOneShotAnimKitId(uint16 animKitId);
1504  void SetAIAnimKitId(uint16 animKitId);
1505  uint16 GetAIAnimKitId() const override { return _aiAnimKitId; }
1506  void SetMovementAnimKitId(uint16 animKitId);
1507  uint16 GetMovementAnimKitId() const override { return _movementAnimKitId; }
1508  void SetMeleeAnimKitId(uint16 animKitId);
1509  uint16 GetMeleeAnimKitId() const override { return _meleeAnimKitId; }
1510 
1511  uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
1512  void DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb);
1513  uint32 DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = NULL, bool durabilityLoss = true);
1514  void Kill(Unit* victim, bool durabilityLoss = true);
1515  void KillSelf(bool durabilityLoss = true) { Kill(this, durabilityLoss); }
1516  int32 DealHeal(Unit* victim, uint32 addhealth);
1517 
1518  void ProcDamageAndSpell(Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpell = NULL, SpellInfo const* procAura = NULL);
1519  void ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage, SpellInfo const* procAura = NULL);
1520 
1521  void GetProcAurasTriggeredOnEvent(AuraApplicationList& aurasTriggeringProc, AuraApplicationList* procAuras, ProcEventInfo eventInfo);
1522  void TriggerAurasProcOnEvent(CalcDamageInfo& damageInfo);
1523  void TriggerAurasProcOnEvent(AuraApplicationList* myProcAuras, AuraApplicationList* targetProcAuras,
1524  Unit* actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget,
1525  uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell* spell,
1526  DamageInfo* damageInfo, HealInfo* healInfo);
1527  void TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, AuraApplicationList& procAuras);
1528 
1529  void HandleEmoteCommand(uint32 anim_id);
1530  void AttackerStateUpdate (Unit* victim, WeaponAttackType attType = BASE_ATTACK, bool extra = false);
1531 
1532  void CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* damageInfo, WeaponAttackType attackType = BASE_ATTACK);
1533  void DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss);
1534  void HandleProcExtraAttackFor(Unit* victim);
1535 
1536  void CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType = BASE_ATTACK, bool crit = false);
1537  void DealSpellDamage(SpellNonMeleeDamage const* damageInfo, bool durabilityLoss);
1538 
1539  // player or player's pet resilience (-1%)
1540  uint32 GetDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN, 1.0f, 100.0f, damage); }
1541 
1542  void ApplyResilience(Unit const* victim, int32* damage) const;
1543 
1544  float MeleeSpellMissChance(Unit const* victim, WeaponAttackType attType, uint32 spellId) const;
1545  SpellMissInfo MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo);
1546  SpellMissInfo MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo);
1547  SpellMissInfo SpellHitResult(Unit* victim, SpellInfo const* spellInfo, bool canReflect = false);
1548 
1549  float GetUnitDodgeChanceAgainst(Unit const* attacker) const;
1550  float GetUnitParryChanceAgainst(Unit const* attacker) const;
1551  float GetUnitBlockChanceAgainst(Unit const* attacker) const;
1552  float GetUnitMissChance(WeaponAttackType attType) const;
1553  float GetUnitCriticalChance(WeaponAttackType attackType, const Unit* victim) const;
1554  int32 GetMechanicResistChance(SpellInfo const* spellInfo) const;
1555  bool CanUseAttackType(uint8 attacktype) const;
1556 
1557  virtual uint32 GetBlockPercent() const { return 30; }
1558 
1559  float GetWeaponProcChance() const;
1560  float GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo* spellProto) const;
1561 
1562  MeleeHitOutcome RollMeleeOutcomeAgainst(Unit const* victim, WeaponAttackType attType) const;
1563 
1578  bool IsServiceProvider() const;
1580  bool IsCritter() const { return GetCreatureType() == CREATURE_TYPE_CRITTER; }
1581 
1582  bool IsInFlight() const { return HasUnitState(UNIT_STATE_IN_FLIGHT); }
1583 
1585  bool IsInCombatWith(Unit const* who) const;
1586  void CombatStart(Unit* target, bool initialAggro = true);
1587  void SetInCombatState(bool PvP, Unit* enemy = NULL);
1588  void SetInCombatWith(Unit* enemy);
1589  void ClearInCombat();
1590  uint32 GetCombatTimer() const { return m_CombatTimer; }
1591 
1592  bool HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint32 familyFlags) const;
1593  bool virtual HasSpell(uint32 /*spellID*/) const { return false; }
1594  bool HasBreakableByDamageAuraType(AuraType type, uint32 excludeAura = 0) const;
1595  bool HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel = NULL) const;
1596 
1597  bool HasStealthAura() const { return HasAuraType(SPELL_AURA_MOD_STEALTH); }
1598  bool HasInvisibilityAura() const { return HasAuraType(SPELL_AURA_MOD_INVISIBILITY); }
1599  bool isFeared() const { return HasAuraType(SPELL_AURA_MOD_FEAR); }
1600  bool isInRoots() const { return HasAuraType(SPELL_AURA_MOD_ROOT); }
1601  bool IsPolymorphed() const;
1602 
1603  bool isFrozen() const;
1604 
1605  bool isTargetableForAttack(bool checkFakeDeath = true) const;
1606 
1607  bool IsValidAttackTarget(Unit const* target) const;
1608  bool _IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, WorldObject const* obj = NULL) const;
1609 
1610  bool IsValidAssistTarget(Unit const* target) const;
1611  bool _IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) const;
1612 
1613  virtual bool IsInWater() const;
1614  virtual bool IsUnderWater() const;
1615  virtual void UpdateUnderwaterState(Map* m, float x, float y, float z);
1616  bool isInAccessiblePlaceFor(Creature const* c) const;
1617 
1618  void SendHealSpellLog(Unit* victim, uint32 spellID, uint32 health, uint32 overHeal, uint32 absorbed, bool crit = false);
1619  int32 HealBySpell(Unit* victim, SpellInfo const* spellInfo, uint32 addHealth, bool critical = false);
1620  void SendEnergizeSpellLog(Unit* victim, uint32 spellID, int32 damage, Powers powertype);
1621  void EnergizeBySpell(Unit* victim, uint32 SpellID, int32 Damage, Powers powertype);
1622 
1623  void CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
1624  void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
1625  void CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
1626  void CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
1627  void CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
1628  void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
1629  void CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
1630  void CastCustomSpell(Unit* victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
1631  void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
1632  void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim = NULL, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
1633  void CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit* victim = NULL, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
1634  Aura* AddAura(uint32 spellId, Unit* target);
1635  Aura* AddAura(SpellInfo const* spellInfo, uint32 effMask, Unit* target);
1636  void SetAuraStack(uint32 spellId, Unit* target, uint32 stack);
1637  void SendPlaySpellVisualKit(uint32 id, uint32 type);
1638 
1639  void DeMorph();
1640 
1641  void SendAttackStateUpdate(CalcDamageInfo* damageInfo);
1642  void SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 SwingType, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount);
1643  void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const* log);
1644  void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* pInfo);
1645  void SendSpellMiss(Unit* target, uint32 spellID, SpellMissInfo missInfo);
1646  void SendSpellDamageResist(Unit* target, uint32 spellId);
1647  void SendSpellDamageImmune(Unit* target, uint32 spellId, bool isPeriodic);
1648 
1649  void NearTeleportTo(float x, float y, float z, float orientation, bool casting = false);
1650  void SendTeleportPacket(Position& pos);
1651  virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport = false);
1652  // returns true if unit's position really changed
1653  virtual bool UpdatePosition(const Position &pos, bool teleport = false);
1654  void UpdateOrientation(float orientation);
1655  void UpdateHeight(float newZ);
1656 
1657  void SendMoveKnockBack(Player* player, float speedXY, float speedZ, float vcos, float vsin);
1658  void KnockbackFrom(float x, float y, float speedXY, float speedZ);
1659  void JumpTo(float speedXY, float speedZ, bool forward = true);
1660  void JumpTo(WorldObject* obj, float speedZ, bool withOrientation = false);
1661 
1662  void MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath = false, bool forceDestination = false);
1663 
1664 
1665  void SendSetPlayHoverAnim(bool enable);
1666 
1667  bool IsLevitating() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); }
1668  bool IsWalking() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING); }
1669  bool IsHovering() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_HOVER); }
1670  bool SetWalk(bool enable);
1671  bool SetDisableGravity(bool disable, bool packetOnly = false);
1672  bool SetFall(bool enable);
1673  bool SetSwim(bool enable);
1674  bool SetCanFly(bool enable);
1675  bool SetWaterWalking(bool enable, bool packetOnly = false);
1676  bool SetFeatherFall(bool enable, bool packetOnly = false);
1677  bool SetHover(bool enable, bool packetOnly = false);
1678  bool SetCollision(bool disable);
1679  void SendSetVehicleRecId(uint32 vehicleId);
1680 
1681  void SetInFront(WorldObject const* target);
1682  void SetFacingTo(float ori);
1683  void SetFacingToObject(WorldObject const* object);
1684 
1685  void SendChangeCurrentVictimOpcode(HostileReference* pHostileReference);
1686  void SendClearThreatListOpcode();
1687  void SendRemoveFromThreatListOpcode(HostileReference* pHostileReference);
1688  void SendThreatListUpdate();
1689 
1690  void SendClearTarget();
1691 
1692  bool IsAlive() const { return (m_deathState == ALIVE); }
1693  bool isDying() const { return (m_deathState == JUST_DIED); }
1694  bool isDead() const { return (m_deathState == DEAD || m_deathState == CORPSE); }
1695  DeathState getDeathState() const { return m_deathState; }
1696  virtual void setDeathState(DeathState s); // overwrited in Creature/Player/Pet
1697 
1699  void SetOwnerGUID(ObjectGuid owner);
1707  void SetPetGUID(ObjectGuid guid) { m_SummonSlot[SUMMON_SLOT_PET] = guid; }
1708  ObjectGuid GetPetGUID() const { return m_SummonSlot[SUMMON_SLOT_PET]; }
1711 
1712  bool IsControlledByPlayer() const { return m_ControlledByPlayer; }
1713  ObjectGuid GetCharmerOrOwnerGUID() const;
1714  ObjectGuid GetCharmerOrOwnerOrOwnGUID() const;
1715  bool IsCharmedOwnedByPlayerOrPlayer() const { return GetCharmerOrOwnerOrOwnGUID().IsPlayer(); }
1716 
1717  Player* GetSpellModOwner() const;
1718 
1719  Unit* GetOwner() const;
1720  Guardian* GetGuardianPet() const;
1721  Minion* GetFirstMinion() const;
1722  Unit* GetCharmer() const;
1723  Unit* GetCharm() const;
1724  Unit* GetCharmerOrOwner() const;
1725  Unit* GetCharmerOrOwnerOrSelf() const;
1726  Player* GetCharmerOrOwnerPlayerOrPlayerItself() const;
1727  Player* GetAffectingPlayer() const;
1728 
1729  void SetMinion(Minion *minion, bool apply);
1730  void GetAllMinionsByEntry(std::list<TempSummon*>& Minions, uint32 entry);
1731  void RemoveAllMinionsByEntry(uint32 entry);
1732  void SetCharm(Unit* target, bool apply);
1733  Unit* GetNextRandomRaidMemberOrPet(float radius);
1734  bool SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* aurApp = NULL);
1735  void RemoveCharmedBy(Unit* charmer);
1736  void RestoreFaction();
1737 
1738  ControlList m_Controlled;
1739  Unit* GetFirstControlled() const;
1740  void RemoveAllControlled();
1741 
1742  bool IsCharmed() const { return !GetCharmerGUID().IsEmpty(); }
1743  bool isPossessed() const { return HasUnitState(UNIT_STATE_POSSESSED); }
1744  bool isPossessedByPlayer() const;
1745  bool isPossessing() const;
1746  bool isPossessing(Unit* u) const;
1747 
1748  CharmInfo* GetCharmInfo() { return m_charmInfo; }
1749  CharmInfo* InitCharmInfo();
1750  void DeleteCharmInfo();
1751  void UpdateCharmAI();
1752  //Player* GetMoverSource() const;
1754  SharedVisionList const& GetSharedVisionList() { return m_sharedVision; }
1755  void AddPlayerToVision(Player* player);
1756  void RemovePlayerFromVision(Player* player);
1757  bool HasSharedVision() const { return !m_sharedVision.empty(); }
1758  void RemoveBindSightAuras();
1759  void RemoveCharmAuras();
1760 
1761  Pet* CreateTamedPetFrom(Creature* creatureTarget, uint32 spell_id = 0);
1762  Pet* CreateTamedPetFrom(uint32 creatureEntry, uint32 spell_id = 0);
1763  bool InitTamedPet(Pet* pet, uint8 level, uint32 spell_id);
1764 
1765  // aura apply/remove helpers - you should better not use these
1766  Aura* _TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint32 effMask, Unit* caster, int32 *baseAmount = NULL, Item* castItem = NULL, ObjectGuid casterGUID = ObjectGuid::Empty, int32 castItemLevel = -1);
1767  void _AddAura(UnitAura* aura, Unit* caster);
1768  AuraApplication * _CreateAuraApplication(Aura* aura, uint32 effMask);
1769  void _ApplyAuraEffect(Aura* aura, uint8 effIndex);
1770  void _ApplyAura(AuraApplication * aurApp, uint32 effMask);
1771  void _UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode);
1772  void _UnapplyAura(AuraApplication * aurApp, AuraRemoveMode removeMode);
1773  void _RemoveNoStackAuraApplicationsDueToAura(Aura* aura);
1774  void _RemoveNoStackAurasDueToAura(Aura* aura);
1775  bool _IsNoStackAuraDueToAura(Aura* appliedAura, Aura* existingAura) const;
1776  void _RegisterAuraEffect(AuraEffect* aurEff, bool apply);
1777 
1778  // m_ownedAuras container management
1779  AuraMap & GetOwnedAuras() { return m_ownedAuras; }
1780  AuraMap const& GetOwnedAuras() const { return m_ownedAuras; }
1781 
1782  void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
1783  void RemoveOwnedAura(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, uint32 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
1784  void RemoveOwnedAura(Aura* aura, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
1785 
1786  Aura* GetOwnedAura(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, ObjectGuid itemCasterGUID = ObjectGuid::Empty, uint32 reqEffMask = 0, Aura* except = NULL) const;
1787 
1788  // m_appliedAuras container management
1789  AuraApplicationMap & GetAppliedAuras() { return m_appliedAuras; }
1790  AuraApplicationMap const& GetAppliedAuras() const { return m_appliedAuras; }
1791 
1792  void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
1793  void RemoveAura(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, uint32 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
1794  void RemoveAura(AuraApplication * aurApp, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
1795  void RemoveAura(Aura* aur, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
1796 
1797  // Convenience methods removing auras by predicate
1798  void RemoveAppliedAuras(std::function<bool(AuraApplication const*)> const& check);
1799  void RemoveOwnedAuras(std::function<bool(Aura const*)> const& check);
1800 
1801  // Optimized overloads taking advantage of map key
1802  void RemoveAppliedAuras(uint32 spellId, std::function<bool(AuraApplication const*)> const& check);
1803  void RemoveOwnedAuras(uint32 spellId, std::function<bool(Aura const*)> const& check);
1804 
1805  void RemoveAurasByType(AuraType auraType, std::function<bool(AuraApplication const*)> const& check);
1806 
1807  void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, uint32 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
1808  void RemoveAuraFromStack(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
1809  void RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId, ObjectGuid casterGUID, Unit* dispeller, uint8 chargesRemoved = 1);
1810  void RemoveAurasDueToSpellBySteal(uint32 spellId, ObjectGuid casterGUID, Unit* stealer);
1811  void RemoveAurasDueToItemSpell(uint32 spellId, ObjectGuid castItemGuid);
1812  void RemoveAurasByType(AuraType auraType, ObjectGuid casterGUID = ObjectGuid::Empty, Aura* except = NULL, bool negative = true, bool positive = true);
1813  void RemoveNotOwnSingleTargetAuras(uint32 newPhase = 0x0, bool phaseid = false);
1814  void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = 0);
1815  void RemoveAurasWithAttribute(uint32 flags);
1816  void RemoveAurasWithFamily(SpellFamilyNames family, flag128 const& familyFlag, ObjectGuid casterGUID);
1817  void RemoveAurasWithMechanic(uint32 mechanic_mask, AuraRemoveMode removemode = AURA_REMOVE_BY_DEFAULT, uint32 except = 0);
1818  void RemoveMovementImpairingAuras();
1819 
1820  void RemoveAreaAurasDueToLeaveWorld();
1821  void RemoveAllAuras();
1822  void RemoveArenaAuras();
1823  void RemoveAllAurasOnDeath();
1824  void RemoveAllAurasRequiringDeadTarget();
1825  void RemoveAllAurasExceptType(AuraType type);
1826  void RemoveAllAurasExceptType(AuraType type1, AuraType type2);
1827  void DelayOwnedAuras(uint32 spellId, ObjectGuid caster, int32 delaytime);
1828 
1829  void _RemoveAllAuraStatMods();
1830  void _ApplyAllAuraStatMods();
1831 
1832  AuraEffectList const& GetAuraEffectsByType(AuraType type) const { return m_modAuras[type]; }
1833  AuraList & GetSingleCastAuras() { return m_scAuras; }
1834  AuraList const& GetSingleCastAuras() const { return m_scAuras; }
1835 
1836  AuraEffect* GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID = ObjectGuid::Empty) const;
1837  AuraEffect* GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID = ObjectGuid::Empty) const;
1838  AuraEffect* GetAuraEffect(AuraType type, SpellFamilyNames name, uint32 iconId, uint8 effIndex) const; // spell mustn't have familyflags
1839  AuraEffect* GetAuraEffect(AuraType type, SpellFamilyNames family, flag128 const& familyFlag, ObjectGuid casterGUID = ObjectGuid::Empty) const;
1840  AuraEffect* GetDummyAuraEffect(SpellFamilyNames name, uint32 iconId, uint8 effIndex) const;
1841 
1842  AuraApplication * GetAuraApplication(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, ObjectGuid itemCasterGUID = ObjectGuid::Empty, uint32 reqEffMask = 0, AuraApplication * except = NULL) const;
1843  Aura* GetAura(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, ObjectGuid itemCasterGUID = ObjectGuid::Empty, uint32 reqEffMask = 0) const;
1844 
1845  AuraApplication * GetAuraApplicationOfRankedSpell(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, ObjectGuid itemCasterGUID = ObjectGuid::Empty, uint32 reqEffMask = 0, AuraApplication * except = NULL) const;
1846  Aura* GetAuraOfRankedSpell(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, ObjectGuid itemCasterGUID = ObjectGuid::Empty, uint32 reqEffMask = 0) const;
1847 
1848  void GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelChargesList& dispelList);
1849 
1850  bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster = ObjectGuid::Empty) const;
1851  uint32 GetAuraCount(uint32 spellId) const;
1852  bool HasAura(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, ObjectGuid itemCasterGUID = ObjectGuid::Empty, uint32 reqEffMask = 0) const;
1853  bool HasAuraType(AuraType auraType) const;
1854  bool HasAuraTypeWithCaster(AuraType auratype, ObjectGuid caster) const;
1855  bool HasAuraTypeWithMiscvalue(AuraType auratype, int32 miscvalue) const;
1856  bool HasAuraTypeWithAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const;
1857  bool HasAuraTypeWithValue(AuraType auratype, int32 value) const;
1858  bool HasNegativeAuraWithInterruptFlag(uint32 flag, ObjectGuid guid = ObjectGuid::Empty) const;
1859  bool HasNegativeAuraWithAttribute(uint32 flag, ObjectGuid guid = ObjectGuid::Empty) const;
1860  bool HasAuraWithMechanic(uint32 mechanicMask) const;
1861 
1862  AuraEffect* IsScriptOverriden(SpellInfo const* spell, int32 script) const;
1863  uint32 GetDiseasesByCaster(ObjectGuid casterGUID, bool remove = false);
1864  uint32 GetDoTsByCaster(ObjectGuid casterGUID) const;
1865 
1866  int32 GetTotalAuraModifier(AuraType auratype) const;
1867  float GetTotalAuraMultiplier(AuraType auratype) const;
1868  int32 GetMaxPositiveAuraModifier(AuraType auratype) const;
1869  int32 GetMaxNegativeAuraModifier(AuraType auratype) const;
1870 
1871  int32 GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const;
1872  float GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const;
1873  int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, const AuraEffect* except = NULL) const;
1874  int32 GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const;
1875 
1876  int32 GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
1877  float GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_value) const;
1878  int32 GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
1879  int32 GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
1880 
1881  int32 GetTotalAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const;
1882  float GetTotalAuraMultiplierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const;
1883  int32 GetMaxPositiveAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const;
1884  int32 GetMaxNegativeAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const;
1885 
1886  float GetResistanceBuffMods(SpellSchools school, bool positive) const;
1887  void SetResistanceBuffMods(SpellSchools school, bool positive, float val);
1888  void ApplyResistanceBuffModsMod(SpellSchools school, bool positive, float val, bool apply);
1889  void ApplyResistanceBuffModsPercentMod(SpellSchools school, bool positive, float val, bool apply);
1890  void InitStatBuffMods();
1891  void ApplyStatBuffMod(Stats stat, float val, bool apply);
1892  void ApplyStatPercentBuffMod(Stats stat, float val, bool apply);
1893  void SetCreateStat(Stats stat, float val) { m_createStats[stat] = val; }
1898  uint32 GetPowerIndex(uint32 powerType) const;
1899  int32 GetCreatePowers(Powers power) const;
1900  float GetPosStat(Stats stat) const { return GetFloatValue(UNIT_FIELD_POSSTAT+stat); }
1901  float GetNegStat(Stats stat) const { return GetFloatValue(UNIT_FIELD_NEGSTAT+stat); }
1902  float GetCreateStat(Stats stat) const { return m_createStats[stat]; }
1903 
1906 
1907  void SetCurrentCastSpell(Spell* pSpell);
1908  void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed = true, bool withInstant = true);
1909  void FinishSpell(CurrentSpellTypes spellType, bool ok = true);
1910 
1911  // set withDelayed to true to account delayed spells as cast
1912  // delayed+channeled spells are always accounted as cast
1913  // we can skip channeled or delayed checks using flags
1914  bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled = false, bool skipAutorepeat = false, bool isAutoshoot = false, bool skipInstant = true) const;
1915 
1916  // set withDelayed to true to interrupt delayed spells too
1917  // delayed+channeled spells are always interrupted
1918  void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid = 0, bool withInstant = true);
1919 
1920  Spell* GetCurrentSpell(CurrentSpellTypes spellType) const { return m_currentSpells[spellType]; }
1921  Spell* GetCurrentSpell(uint32 spellType) const { return m_currentSpells[spellType]; }
1922  Spell* FindCurrentSpellBySpellId(uint32 spell_id) const;
1923  int32 GetCurrentSpellCastTime(uint32 spell_id) const;
1924  virtual SpellInfo const* GetCastSpellInfo(SpellInfo const* spellInfo) const;
1925 
1926  SpellHistory* GetSpellHistory() { return _spellHistory; }
1927  SpellHistory const* GetSpellHistory() const { return _spellHistory; }
1928 
1931 
1933  void SetShapeshiftForm(ShapeshiftForm form);
1934 
1935  bool IsInFeralForm() const;
1936 
1937  bool IsInDisallowedMountForm() const;
1938 
1943 
1944  float m_threatModifier[MAX_SPELL_SCHOOL];
1945  float m_modAttackSpeedPct[3];
1946 
1947  // Event handler
1949 
1950  // stat system
1951  bool HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, float amount, bool apply);
1952  void SetModifierValue(UnitMods unitMod, UnitModifierType modifierType, float value) { m_auraModifiersGroup[unitMod][modifierType] = value; }
1953  float GetModifierValue(UnitMods unitMod, UnitModifierType modifierType) const;
1954  float GetTotalStatValue(Stats stat) const;
1955  float GetTotalAuraModValue(UnitMods unitMod) const;
1956  SpellSchools GetSpellSchoolByAuraGroup(UnitMods unitMod) const;
1957  Stats GetStatByAuraGroup(UnitMods unitMod) const;
1958  Powers GetPowerTypeByAuraGroup(UnitMods unitMod) const;
1959  bool CanModifyStats() const { return m_canModifyStats; }
1960  void SetCanModifyStats(bool modifyStats) { m_canModifyStats = modifyStats; }
1961  virtual bool UpdateStats(Stats stat) = 0;
1962  virtual bool UpdateAllStats() = 0;
1963  virtual void UpdateResistances(uint32 school) = 0;
1964  virtual void UpdateAllResistances();
1965  virtual void UpdateArmor() = 0;
1966  virtual void UpdateMaxHealth() = 0;
1967  virtual void UpdateMaxPower(Powers power) = 0;
1968  virtual void UpdateAttackPowerAndDamage(bool ranged = false) = 0;
1969  virtual void UpdateDamagePhysical(WeaponAttackType attType);
1970  float GetTotalAttackPowerValue(WeaponAttackType attType) const;
1971  float GetWeaponDamageRange(WeaponAttackType attType, WeaponDamageRange type) const;
1972  void SetBaseWeaponDamage(WeaponAttackType attType, WeaponDamageRange damageRange, float value) { m_weaponDamage[attType][damageRange] = value; }
1973  virtual void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage) = 0;
1974  uint32 CalculateDamage(WeaponAttackType attType, bool normalized, bool addTotalPct);
1975  float GetAPMultiplier(WeaponAttackType attType, bool normalized);
1976 
1977  bool isInFrontInMap(Unit const* target, float distance, float arc = float(M_PI)) const;
1978  bool isInBackInMap(Unit const* target, float distance, float arc = float(M_PI)) const;
1979 
1980  // Visibility system
1981  bool IsVisible() const;
1982  void SetVisible(bool x);
1983 
1984  // common function for visibility checks for player/creatures with detection code
1985  bool SetInPhase(uint32 id, bool update, bool apply) override;
1986  void UpdateObjectVisibility(bool forced = true) override;
1987 
1988  SpellImmuneList m_spellImmune[MAX_SPELL_IMMUNITY];
1990 
1991  // Threat related methods
1992  bool CanHaveThreatList(bool skipAliveCheck = false) const;
1993  void AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = NULL);
1994  float ApplyTotalThreatModifier(float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL);
1995  void DeleteThreatList();
1996  void TauntApply(Unit* victim);
1997  void TauntFadeOut(Unit* taunter);
1998  ThreatManager& getThreatManager() { return m_ThreatManager; }
1999  void addHatedBy(HostileReference* pHostileReference) { m_HostileRefManager.insertFirst(pHostileReference); }
2000  void removeHatedBy(HostileReference* /*pHostileReference*/) { /* nothing to do yet */ }
2001  HostileRefManager& getHostileRefManager() { return m_HostileRefManager; }
2002 
2003  VisibleAuraMap const* GetVisibleAuras() { return &m_visibleAuras; }
2004  AuraApplication * GetVisibleAura(uint8 slot) const;
2005  void SetVisibleAura(uint8 slot, AuraApplication * aur);
2006  void RemoveVisibleAura(uint8 slot);
2007 
2008  uint32 GetInterruptMask() const { return m_interruptMask; }
2009  void AddInterruptMask(uint32 mask) { m_interruptMask |= mask; }
2010  void UpdateInterruptMask();
2011 
2013  virtual void SetDisplayId(uint32 modelId);
2015  void RestoreDisplayId();
2017  void setTransForm(uint32 spellid) { m_transform = spellid;}
2018  uint32 getTransForm() const { return m_transform;}
2019 
2020  // DynamicObject management
2021  void _RegisterDynObject(DynamicObject* dynObj);
2022  void _UnregisterDynObject(DynamicObject* dynObj);
2023  DynamicObject* GetDynObject(uint32 spellId);
2024  void RemoveDynObject(uint32 spellId);
2025  void RemoveAllDynObjects();
2026 
2027  GameObject* GetGameObject(uint32 spellId) const;
2028  void AddGameObject(GameObject* gameObj);
2029  void RemoveGameObject(GameObject* gameObj, bool del);
2030  void RemoveGameObject(uint32 spellid, bool del);
2031  void RemoveAllGameObjects();
2032 
2033  void ModifyAuraState(AuraStateType flag, bool apply);
2034  uint32 BuildAuraStateUpdateForTarget(Unit* target) const;
2035  bool HasAuraState(AuraStateType flag, SpellInfo const* spellProto = NULL, Unit const* Caster = NULL) const;
2036  void UnsummonAllTotems();
2037  bool IsMagnet() const;
2038  Unit* GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo);
2039  Unit* GetMeleeHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo = NULL);
2040 
2041  int32 SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) const;
2042  int32 SpellBaseDamageBonusTaken(SpellSchoolMask schoolMask) const;
2043  uint32 SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, SpellEffectInfo const* effect, uint32 stack = 1) const;
2044  float SpellDamagePctDone(Unit* victim, SpellInfo const* spellProto, DamageEffectType damagetype) const;
2045  uint32 SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, SpellEffectInfo const* effect, uint32 stack = 1) const;
2046  int32 SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) const;
2047  int32 SpellBaseHealingBonusTaken(SpellSchoolMask schoolMask) const;
2048  uint32 SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, SpellEffectInfo const* effect, uint32 stack = 1) const;
2049  float SpellHealingPctDone(Unit* victim, SpellInfo const* spellProto) const;
2050  uint32 SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, SpellEffectInfo const* effect, uint32 stack = 1) const;
2051 
2052  uint32 MeleeDamageBonusDone(Unit* pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const* spellProto = NULL);
2053  uint32 MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackType attType, SpellInfo const* spellProto = NULL);
2054 
2055  bool isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType = BASE_ATTACK);
2056  bool isBlockCritical();
2057  bool IsSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType = BASE_ATTACK) const;
2058  float GetUnitSpellCriticalChance(Unit* victim, SpellInfo const* spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType = BASE_ATTACK) const;
2059  uint32 SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage, Unit* victim);
2060  uint32 SpellCriticalHealingBonus(SpellInfo const* spellProto, uint32 damage, Unit* victim);
2061 
2062  void SetContestedPvP(Player* attackedPlayer = NULL);
2063 
2064  uint32 GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const;
2065  float CalculateDefaultCoefficient(SpellInfo const* spellInfo, DamageEffectType damagetype) const;
2066 
2067  uint32 GetRemainingPeriodicAmount(ObjectGuid caster, uint32 spellId, AuraType auraType, uint8 effectIndex = 0) const;
2068 
2069  void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply);
2070  void ApplySpellDispelImmunity(const SpellInfo* spellProto, DispelType type, bool apply);
2071  virtual bool IsImmunedToSpell(SpellInfo const* spellInfo) const; // redefined in Creature
2072  uint32 GetSchoolImmunityMask() const;
2073  uint32 GetMechanicImmunityMask() const;
2074 
2075  bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const;
2076  bool IsImmunedToDamage(SpellInfo const* spellInfo) const;
2077  virtual bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const; // redefined in Creature
2078 
2079  bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const* spellInfo = NULL, uint8 effIndex = MAX_SPELL_EFFECTS);
2080  uint32 CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType = MAX_ATTACK);
2081  uint32 CalcSpellResistance(Unit* victim, SpellSchoolMask schoolMask, SpellInfo const* spellInfo) const;
2082  void CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, uint32 const damage, uint32* absorb, uint32* resist, SpellInfo const* spellInfo = NULL);
2083  void CalcHealAbsorb(Unit* victim, SpellInfo const* spellInfo, uint32& healAmount, uint32& absorb);
2084 
2085  void UpdateSpeed(UnitMoveType mtype, bool forced);
2086  float GetSpeed(UnitMoveType mtype) const;
2087  float GetSpeedRate(UnitMoveType mtype) const { return m_speed_rate[mtype]; }
2088  void SetSpeed(UnitMoveType mtype, float rate, bool forced = false);
2089 
2090  float ApplyEffectModifiers(SpellInfo const* spellProto, uint8 effect_index, float value) const;
2091  int32 CalculateSpellDamage(Unit const* target, SpellInfo const* spellProto, uint8 effect_index, int32 const* basePoints = nullptr, float* variance = nullptr, int32 itemLevel = -1) const;
2092  int32 CalcSpellDuration(SpellInfo const* spellProto);
2093  int32 ModSpellDuration(SpellInfo const* spellProto, Unit const* target, int32 duration, bool positive, uint32 effectMask);
2094  void ModSpellCastTime(SpellInfo const* spellProto, int32& castTime, Spell* spell = NULL);
2095  void ModSpellDurationTime(SpellInfo const* spellProto, int32& castTime, Spell* spell = NULL);
2096  float CalculateLevelPenalty(SpellInfo const* spellProto) const;
2097 
2098  void addFollower(FollowerReference* pRef) { m_FollowingRefManager.insertFirst(pRef); }
2099  void removeFollower(FollowerReference* /*pRef*/) { /* nothing to do yet */ }
2100 
2101  MotionMaster* GetMotionMaster() { return i_motionMaster; }
2102  const MotionMaster* GetMotionMaster() const { return i_motionMaster; }
2103 
2104  bool IsStopped() const { return !(HasUnitState(UNIT_STATE_MOVING)); }
2105  void StopMoving();
2106 
2107  void AddUnitMovementFlag(uint32 f) { m_movementInfo.AddMovementFlag(f); }
2108  void RemoveUnitMovementFlag(uint32 f) { m_movementInfo.RemoveMovementFlag(f); }
2109  bool HasUnitMovementFlag(uint32 f) const { return m_movementInfo.HasMovementFlag(f); }
2110  uint32 GetUnitMovementFlags() const { return m_movementInfo.GetMovementFlags(); }
2111  void SetUnitMovementFlags(uint32 f) { m_movementInfo.SetMovementFlags(f); }
2112 
2113  void AddExtraUnitMovementFlag(uint16 f) { m_movementInfo.AddExtraMovementFlag(f); }
2114  void RemoveExtraUnitMovementFlag(uint16 f) { m_movementInfo.RemoveExtraMovementFlag(f); }
2115  uint16 HasExtraUnitMovementFlag(uint16 f) const { return m_movementInfo.HasExtraMovementFlag(f); }
2116  uint16 GetExtraUnitMovementFlags() const { return m_movementInfo.GetExtraMovementFlags(); }
2117  void SetExtraUnitMovementFlags(uint16 f) { m_movementInfo.SetExtraMovementFlags(f); }
2118  bool IsSplineEnabled() const;
2119 
2120  float GetPositionZMinusOffset() const;
2121 
2122  void SetControlled(bool apply, UnitState state);
2123 
2125  void SendPetActionFeedback (uint8 msg);
2126  void SendPetTalk (uint32 pettalk);
2127  void SendPetAIReaction(ObjectGuid guid);
2129 
2130  void propagateSpeedChange() { GetMotionMaster()->propagateSpeedChange(); }
2131 
2132  // reactive attacks
2133  void ClearAllReactives();
2134  void StartReactiveTimer(ReactiveType reactive) { m_reactiveTimer[reactive] = REACTIVE_TIMER_START;}
2135  void UpdateReactives(uint32 p_time);
2136 
2137  // group updates
2138  void UpdateAuraForGroup(uint8 slot);
2139 
2140  // proc trigger system
2141  bool CanProc() const {return !m_procDeep;}
2142  void SetCantProc(bool apply);
2143 
2144  // pet auras
2145  typedef std::set<PetAura const*> PetAuraSet;
2146  PetAuraSet m_petAuras;
2147  void AddPetAura(PetAura const* petSpell);
2148  void RemovePetAura(PetAura const* petSpell);
2149 
2150  uint32 GetModelForForm(ShapeshiftForm form) const;
2151  uint32 GetModelForTotem(PlayerTotemType totemType);
2152 
2153  // Redirect Threat
2154  void SetRedirectThreat(ObjectGuid guid, uint32 pct) { _redirectThreadInfo.Set(guid, pct); }
2155  void ResetRedirectThreat() { SetRedirectThreat(ObjectGuid::Empty, 0); }
2156  void ModifyRedirectThreat(int32 amount) { _redirectThreadInfo.ModifyThreatPct(amount); }
2157  uint32 GetRedirectThreatPercent() const { return _redirectThreadInfo.GetThreatPct(); }
2158  Unit* GetRedirectThreatTarget();
2159 
2160  friend class VehicleJoinEvent;
2161  bool IsAIEnabled, NeedChangeAI;
2163  bool CreateVehicleKit(uint32 id, uint32 creatureEntry, bool loading = false);
2164  void RemoveVehicleKit(bool onRemoveFromWorld = false);
2165  Vehicle* GetVehicleKit()const { return m_vehicleKit; }
2166  Vehicle* GetVehicle() const { return m_vehicle; }
2167  void SetVehicle(Vehicle* vehicle) { m_vehicle = vehicle; }
2168  bool IsOnVehicle(const Unit* vehicle) const;
2169  Unit* GetVehicleBase() const;
2170  Creature* GetVehicleCreatureBase() const;
2171  ObjectGuid GetTransGUID() const override;
2173  TransportBase* GetDirectTransport() const;
2174 
2176 
2177  bool HandleSpellClick(Unit* clicker, int8 seatId = -1);
2178  void EnterVehicle(Unit* base, int8 seatId = -1);
2179  void ExitVehicle(Position const* exitPosition = NULL);
2180  void ChangeSeat(int8 seatId, bool next = true);
2181 
2182  // Should only be called by AuraEffect::HandleAuraControlVehicle(AuraApplication const* auraApp, uint8 mode, bool apply) const;
2183  void _ExitVehicle(Position const* exitPosition = NULL);
2184  void _EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp = NULL);
2185 
2186  bool isMoving() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_MASK_MOVING); }
2187  bool isTurning() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_MASK_TURNING); }
2188  virtual bool CanFly() const = 0;
2189  bool IsFlying() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_DISABLE_GRAVITY); }
2190  bool IsFalling() const;
2191 
2192  void RewardRage(uint32 baseRage, bool attacker);
2193 
2194  virtual float GetFollowAngle() const { return static_cast<float>(M_PI/2); }
2195 
2196  void OutDebugInfo() const;
2197  virtual bool IsLoading() const { return false; }
2198  bool IsDuringRemoveFromWorld() const {return m_duringRemoveFromWorld;}
2199 
2200  Pet* ToPet() { if (IsPet()) return reinterpret_cast<Pet*>(this); else return NULL; }
2201  Pet const* ToPet() const { if (IsPet()) return reinterpret_cast<Pet const*>(this); else return NULL; }
2202 
2203  Totem* ToTotem() { if (IsTotem()) return reinterpret_cast<Totem*>(this); else return NULL; }
2204  Totem const* ToTotem() const { if (IsTotem()) return reinterpret_cast<Totem const*>(this); else return NULL; }
2205 
2206  TempSummon* ToTempSummon() { if (IsSummon()) return reinterpret_cast<TempSummon*>(this); else return NULL; }
2207  TempSummon const* ToTempSummon() const { if (IsSummon()) return reinterpret_cast<TempSummon const*>(this); else return NULL; }
2208 
2210  virtual void SetTarget(ObjectGuid const& /*guid*/) = 0;
2211 
2212  // Movement info
2214 
2215  // Part of Evade mechanics
2216  time_t GetLastDamagedTime() const { return _lastDamagedTime; }
2217  void SetLastDamagedTime(time_t val) { _lastDamagedTime = val; }
2218 
2219  int32 GetHighestExclusiveSameEffectSpellGroupValue(AuraEffect const* aurEff, AuraType auraType, bool checkMiscValue = false, int32 miscValue = 0) const;
2220  bool IsHighestExclusiveAura(Aura const* aura, bool removeOtherAuraApplications = false);
2221 
2222  virtual void Talk(std::string const& text, ChatMsg msgType, Language language, float textRange, WorldObject const* target);
2223  virtual void Say(std::string const& text, Language language, WorldObject const* target = nullptr);
2224  virtual void Yell(std::string const& text, Language language, WorldObject const* target = nullptr);
2225  virtual void TextEmote(std::string const& text, WorldObject const* target = nullptr, bool isBossEmote = false);
2226  virtual void Whisper(std::string const& text, Language language, Player* target, bool isBossWhisper = false);
2227  void Talk(uint32 textId, ChatMsg msgType, float textRange, WorldObject const* target);
2228  void Say(uint32 textId, WorldObject const* target = nullptr);
2229  void Yell(uint32 textId, WorldObject const* target = nullptr);
2230  void TextEmote(uint32 textId, WorldObject const* target = nullptr, bool isBossEmote = false);
2231  void Whisper(uint32 textId, Player* target, bool isBossWhisper = false);
2232 
2233  uint32 GetVirtualItemId(uint32 slot) const;
2234  void SetVirtualItem(uint32 slot, uint32 itemId, uint16 appearanceModId = 0);
2235 
2236  protected:
2237  explicit Unit (bool isWorldObject);
2238 
2239  void BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, Player* target) const override;
2240  void DestroyForPlayer(Player* target) const override;
2241 
2243 
2244  void _UpdateSpells(uint32 time);
2245  void _DeleteRemovedAuras();
2246 
2247  void _UpdateAutoRepeatSpell();
2248 
2250 
2251  uint32 m_attackTimer[MAX_ATTACK];
2252 
2253  float m_createStats[MAX_STATS];
2254 
2255  AttackerSet m_attackers;
2258 
2260 
2262 
2263  typedef std::list<DynamicObject*> DynObjectList;
2264  DynObjectList m_dynObj;
2265 
2266  typedef std::list<GameObject*> GameObjectList;
2267  GameObjectList m_gameObj;
2268 
2270 
2271  Spell* m_currentSpells[CURRENT_MAX_SPELL];
2272 
2273  AuraMap m_ownedAuras;
2274  AuraApplicationMap m_appliedAuras;
2275  AuraList m_removedAuras;
2276  AuraMap::iterator m_auraUpdateIterator;
2278 
2279  AuraEffectList m_modAuras[TOTAL_AURAS];
2280  AuraList m_scAuras; // cast singlecast auras
2281  AuraApplicationList m_interruptableAuras; // auras which have interrupt mask applied on unit
2282  AuraStateAurasMap m_auraStateAuras; // Used for improve performance of aura state checks on aura apply/remove
2284 
2285  float m_auraModifiersGroup[UNIT_MOD_END][MODIFIER_TYPE_END];
2286  float m_weaponDamage[MAX_ATTACK][2];
2288  VisibleAuraMap m_visibleAuras;
2289 
2290  float m_speed_rate[MAX_MOVE_TYPE];
2291 
2293  SharedVisionList m_sharedVision;
2294 
2295  virtual SpellSchoolMask GetMeleeDamageSchoolMask() const;
2296 
2298 
2299  uint32 m_reactiveTimer[MAX_REACTIVE];
2301 
2303 
2306 
2309 
2310  bool IsAlwaysVisibleFor(WorldObject const* seer) const override;
2311  bool IsAlwaysDetectableFor(WorldObject const* seer) const override;
2312 
2313  void DisableSpline();
2314  private:
2315  bool IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const* & spellProcEvent);
2316  bool HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
2317  bool HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool * handled);
2318  bool HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
2319  bool HandleOverrideClassScriptAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 cooldown);
2320  bool HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura);
2321  bool HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura);
2322 
2323  void UpdateSplineMovement(uint32 t_diff);
2324  void UpdateSplinePosition();
2325 
2326  // player or player's pet
2327  float GetCombatRatingReduction(CombatRating cr) const;
2328  uint32 GetCombatRatingDamageReduction(CombatRating cr, float rate, float cap, uint32 damage) const;
2329 
2330  protected:
2331  void SetFeared(bool apply);
2332  void SetConfused(bool apply);
2333  void SetStunned(bool apply);
2334  void SetRooted(bool apply, bool packetOnly = false);
2335 
2337 
2338  private:
2339 
2340  uint32 m_state; // Even derived shouldn't modify
2343 
2344  Diminishing m_Diminishing;
2345  // Manage all Units that are threatened by us
2347 
2349 
2351 
2352  bool m_cleanupDone; // lock made to not add stuff after cleanup before delete
2353  bool m_duringRemoveFromWorld; // lock made to not add stuff after begining removing from world
2354 
2357 
2361 
2362  time_t _lastDamagedTime; // Part of Evade mechanics
2363 
2365 };
2366 
2367 namespace Trinity
2368 {
2369  // Binary predicate for sorting Units based on percent value of a power
2371  {
2372  public:
2373  PowerPctOrderPred(Powers power, bool ascending = true) : _power(power), _ascending(ascending) { }
2374 
2375  bool operator()(WorldObject const* objA, WorldObject const* objB) const
2376  {
2377  Unit const* a = objA->ToUnit();
2378  Unit const* b = objB->ToUnit();
2379  float rA = (a && a->GetMaxPower(_power)) ? float(a->GetPower(_power)) / float(a->GetMaxPower(_power)) : 0.0f;
2380  float rB = (b && b->GetMaxPower(_power)) ? float(b->GetPower(_power)) / float(b->GetMaxPower(_power)) : 0.0f;
2381  return _ascending ? rA < rB : rA > rB;
2382  }
2383 
2384  bool operator()(Unit const* a, Unit const* b) const
2385  {
2386  float rA = a->GetMaxPower(_power) ? float(a->GetPower(_power)) / float(a->GetMaxPower(_power)) : 0.0f;
2387  float rB = b->GetMaxPower(_power) ? float(b->GetPower(_power)) / float(b->GetMaxPower(_power)) : 0.0f;
2388  return _ascending ? rA < rB : rA > rB;
2389  }
2390 
2391  private:
2393  bool const _ascending;
2394  };
2395 
2396  // Binary predicate for sorting Units based on percent value of health
2398  {
2399  public:
2400  HealthPctOrderPred(bool ascending = true) : _ascending(ascending) { }
2401 
2402  bool operator()(WorldObject const* objA, WorldObject const* objB) const
2403  {
2404  Unit const* a = objA->ToUnit();
2405  Unit const* b = objB->ToUnit();
2406  float rA = (a && a->GetMaxHealth()) ? float(a->GetHealth()) / float(a->GetMaxHealth()) : 0.0f;
2407  float rB = (b && b->GetMaxHealth()) ? float(b->GetHealth()) / float(b->GetMaxHealth()) : 0.0f;
2408  return _ascending ? rA < rB : rA > rB;
2409  }
2410 
2411  bool operator() (Unit const* a, Unit const* b) const
2412  {
2413  float rA = a->GetMaxHealth() ? float(a->GetHealth()) / float(a->GetMaxHealth()) : 0.0f;
2414  float rB = b->GetMaxHealth() ? float(b->GetHealth()) / float(b->GetMaxHealth()) : 0.0f;
2415  return _ascending ? rA < rB : rA > rB;
2416  }
2417 
2418  private:
2419  bool const _ascending;
2420  };
2421 }
2422 #endif
AuraList m_removedAuras
Definition: Unit.h:2275
bool HasStealthAura() const
Definition: Unit.h:1597
AuraType
Definition: SpellAuraDefines.h:58
Definition: Unit.h:679
Definition: Unit.h:770
bool HealthAbovePctHealed(int32 pct, uint32 heal) const
Definition: Unit.h:1433
UnitMoveType
Definition: Unit.h:597
Definition: MoveSpline.h:49
Definition: SpellAuraEffects.h:30
Definition: Unit.h:208
uint32 GetCreateMana() const
Definition: Unit.h:1897
Definition: Unit.h:564
Definition: Unit.h:718
Definition: Unit.h:784
Definition: Unit.h:56
Definition: Unit.h:620
bool IsBanker() const
Definition: Unit.h:1571
Definition: Unit.h:765
Definition: Unit.h:214
void setAttackTimer(WeaponAttackType type, uint32 time)
Definition: Unit.h:1354
Definition: Unit.h:207
Definition: Unit.h:158
time_t GetLastDamagedTime() const
Definition: Unit.h:2216
Definition: Unit.h:120
Definition: TemporarySummon.h:83
Definition: Unit.h:279
Definition: Unit.h:131
bool IsVendor() const
Definition: Unit.h:1564
ShapeshiftForm
Definition: Unit.h:260
BaseModGroup
Definition: Unit.h:523
Definition: Unit.h:256
Definition: Unit.h:485
uint32 SpellID
Definition: Unit.h:1048
Definition: Unit.h:262
uint32 procAttacker
Definition: Unit.h:1034
uint32 GetDispellerSpellId() const
Definition: Unit.h:895
Definition: Unit.h:629
Unit * EnsureVictim() const
Definition: Unit.h:1381
Movement flags that have change status opcodes associated for players.
Definition: Unit.h:830
Definition: Unit.h:1109
Definition: Unit.h:865
uint32 GetThreatPct() const
Definition: Unit.h:1084
EventProcessor m_Events
Definition: Unit.h:1948
void SetActionAndType(uint32 action, ActiveStates type)
Definition: Unit.h:1163
Definition: Unit.h:292
Definition: Unit.h:212
uint32 GetDamageReduction(uint32 damage) const
Definition: Unit.h:1540
Definition: Unit.h:156
Spell * _spell
Definition: Unit.h:1014
Definition: Unit.h:272
Definition: Unit.h:520
Definition: Unit.h:703
Definition: Unit.h:685
uint32 m_removedAurasCount
Definition: Unit.h:2277
Definition: Unit.h:1293
Definition: Unit.h:351
Definition: Unit.h:49
Definition: Unit.h:586
Definition: Unit.h:1139
Definition: Unit.h:544
Definition: Unit.h:735
Definition: Unit.h:167
uint32 GetAction() const
Definition: Unit.h:1156
ObjectGuid _targetGUID
Definition: Unit.h:1080
Definition: Unit.h:743
Definition: Unit.h:234
const MotionMaster * GetMotionMaster() const
Definition: Unit.h:2102
Definition: Vehicle.h:32
bool IsFlying() const
Definition: Unit.h:2189
Definition: Unit.h:627
Definition: Unit.h:104
uint32 GetSpellTypeMask() const
Definition: Unit.h:996
Definition: UpdateFields.h:118
const_iterator end() const
Definition: Unit.h:186
Definition: Unit.h:484
UnitPVPStateFlags
Definition: Unit.h:306
Definition: Unit.h:215
void SetStat(Stats stat, int32 val)
Definition: Unit.h:1418
uint32 GetUInt32Value(uint16 index) const
Definition: Object.cpp:300
bool HasUnitMovementFlag(uint32 f) const
Definition: Unit.h:2109
Unit * attacker
Definition: Unit.h:1023
Definition: Unit.h:759
Definition: Unit.h:837
Definition: Unit.h:605
Definition: Unit.h:92
Definition: Unit.h:562
Definition: UpdateFields.h:89
uint16 _meleeAnimKitId
Definition: Unit.h:2360
#define MAX_MOVE_TYPE
Definition: Unit.h:610
Definition: Unit.h:89
Will ignore caster aura states including combat requirements and death state.
Definition: Unit.h:473
Definition: Unit.h:758
#define MAX_GAMEOBJECT_SLOT
Definition: Unit.h:1287
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: ByteBuffer.h:70
UnitStandFlags
Definition: Unit.h:220
Definition: Unit.h:588
int8_t int8
Definition: Define.h:148
Definition: TemporarySummon.h:40
void KillSelf(bool durabilityLoss=true)
Definition: Unit.h:1515
Definition: Unit.h:353
Definition: Unit.h:653
bool m_ControlledByPlayer
Definition: Unit.h:2175
uint32 GetMaxHealth() const
Definition: Unit.h:1427
float m_modMeleeHitChance
Definition: Unit.h:1939
Definition: Unit.h:118
Definition: UpdateFields.h:146
uint8 _chargesRemoved
Definition: Unit.h:904
#define UNIT_ACTION_BUTTON_TYPE(X)
Definition: Unit.h:1145
Definition: Unit.h:674
Definition: Unit.h:502
Definition: Unit.h:57
Definition: Unit.h:315
bool IsSpiritHealer() const
Definition: Unit.h:1573
Definition: Unit.h:1131
Definition: Unit.h:98
Definition: UpdateFields.h:84
AuraMap m_ownedAuras
Definition: Unit.h:2273
uint8 getLevelForTarget(WorldObject const *) const override
Definition: Unit.h:1409
uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
Definition: Unit.cpp:12194
bool const _ascending
Definition: Unit.h:2419
std::list< DynamicObject * > DynObjectList
Definition: Unit.h:2263
bool _isCommandAttack
Definition: Unit.h:1259
SpellModOp
Definition: Unit.h:84
Definition: Unit.h:686
ActiveStates GetType() const
Definition: Unit.h:1155
Definition: Unit.h:699
ReputationRank
Definition: SharedDefines.h:211
Definition: Unit.h:379
Definition: Unit.h:161
std::list< GameObject * > GameObjectList
Definition: Unit.h:2266
std::pair< SpellValueMod, int32 > CustomSpellValueMod
Definition: Unit.h:169
Definition: Unit.h:69
bool IsArmorer() const
Definition: Unit.h:1577
ObjectGuid GetCharmGUID() const
Definition: Unit.h:1706
uint32 _absorb
Definition: Unit.h:961
Definition: Unit.h:224
Definition: Unit.h:712
uint32 GetDisplayId() const
Definition: Unit.h:2012
Definition: Unit.h:632
bool IsVehicle() const
Definition: Unit.h:1406
Definition: SpellAuraDefines.h:543
Definition: Unit.h:163
Definition: UpdateFields.h:96
Definition: Unit.h:94
Definition: Unit.h:273
Definition: Unit.h:142
AuraEffect const * auraEff
Definition: Unit.h:1066
CurrentSpellTypes
Definition: Unit.h:1106
Definition: Unit.h:565
Definition: Unit.h:266
void SetMinionGUID(ObjectGuid guid)
Definition: Unit.h:1703
VisibleAuraMap m_visibleAuras
Definition: Unit.h:2288
Definition: Unit.h:885
uint32 GetUnitMovementFlags() const
Definition: Unit.h:2110
SpellSchoolMask
Definition: SharedDefines.h:285
Definition: Unit.h:751
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:1431
virtual bool IsLoading() const
Definition: Unit.h:2197
UnitMods
Definition: Unit.h:482
Definition: Unit.h:510
bool IsControlledByPlayer() const
Definition: Unit.h:1712
#define M_PI
Definition: Common.h:163
Definition: SpellInfo.h:326
Definition: Unit.h:444
Definition: Unit.h:312
Definition: Unit.h:87
uint32 getFaction() const
Definition: Unit.h:1466
SpellHistory * _spellHistory
Definition: Unit.h:2364
bool IsTaxi() const
Definition: Unit.h:1568
Definition: Unit.h:525
Definition: Unit.h:762
uint32 blocked_amount
Definition: Unit.h:1029
void SetModifierValue(UnitMods unitMod, UnitModifierType modifierType, float value)
Definition: Unit.h:1952
uint16 GetMaxSkillValueForLevel(Unit const *target=NULL) const
Definition: Unit.h:1511
Definition: Unit.h:282
Definition: Unit.h:271
void AddUnitState(uint32 f)
Definition: Unit.h:1394
Definition: Unit.h:863
Definition: Unit.h:143
Definition: Unit.h:1129
Definition: Unit.h:93
uint16 GetMovementAnimKitId() const override
Definition: Unit.h:1507
DamageInfo * _damageInfo
Definition: Unit.h:1015
Definition: Unit.h:860
bool m_shouldReacquireTarget
Definition: Unit.h:2257
Definition: Unit.h:91
bool CanProc() const
Definition: Unit.h:2141
Definition: Unit.h:2370
Definition: Unit.h:701
Definition: Unit.h:782
float GetPosStat(Stats stat) const
Definition: Unit.h:1900
uint32 HitInfo
Definition: Unit.h:1030
void SetAttackTime(WeaponAttackType att, uint32 val)
Definition: Unit.h:1458
virtual void DestroyForPlayer(Player *target) const
Definition: Object.cpp:283
bool m_duringRemoveFromWorld
Definition: Unit.h:2353
Definition: Unit.h:542
float GetNegStat(Stats stat) const
Definition: Unit.h:1901
StorageType::const_iterator const_iterator
Definition: Unit.h:173
Definition: Unit.h:648
float _stayY
Definition: Unit.h:1265
Definition: Unit.h:1077
Definition: Unit.h:492
Definition: Unit.h:640
SharedVisionList const & GetSharedVisionList()
Definition: Unit.h:1754
Definition: Unit.h:619
Definition: Unit.h:289
UnitModifierType
Definition: Unit.h:432
CharmSpellInfo * GetCharmSpell(uint8 index)
Definition: Unit.h:1233
Definition: SpellAuraDefines.h:76
Definition: Unit.h:114
Definition: Unit.h:742
Definition: Unit.h:867
Pet * ToPet()
Definition: Unit.h:2200
Unit * attacker
Definition: Unit.h:1047
CleanDamage(uint32 mitigated, uint32 absorbed, WeaponAttackType _attackType, MeleeHitOutcome _hitOutCome)
Definition: Unit.h:909
Definition: Unit.h:594
bool isInRoots() const
Definition: Unit.h:1600
Definition: Unit.h:787
void RemoveStandFlags(uint8 flags)
Definition: Unit.h:1494
Definition: Unit.h:802
Definition: Unit.h:1148
Unit * GetHealer() const
Definition: Unit.h:976
int32 m_baseSpellCritChance
Definition: Unit.h:1942
Will ignore shapeshift checks.
Definition: Unit.h:472
bool const _ascending
Definition: Unit.h:2393
Definition: Unit.h:270
Movement::MoveSpline * movespline
Definition: Unit.h:2213
void addHatedBy(HostileReference *pHostileReference)
Definition: Unit.h:1999
uint32 procVictim
Definition: Unit.h:1035
Definition: Unit.h:281
Definition: Unit.h:584
uint32 hitTime
Definition: Unit.h:878
uint32 overDamage
Definition: Unit.h:1068
SharedVisionList m_sharedVision
Definition: Unit.h:2293
int next(int i, int n)
Definition: RecastContour.cpp:469
WeaponAttackType attackType
Definition: Unit.h:915
bool periodicLog
Definition: Unit.h:1053
Definition: Unit.h:81
AuraMap & GetOwnedAuras()
Definition: Unit.h:1779
Definition: Unit.h:488
bool IsPvP() const
Definition: Unit.h:1481
AuraStateType
Definition: SharedDefines.h:1754
Will ignore caster aura restrictions or requirements.
Definition: Unit.h:475
AuraStateAurasMap m_auraStateAuras
Definition: Unit.h:2282
uint32 resist
Definition: Unit.h:1028
Definition: Unit.h:1110
void ModifyThreatPct(int32 amount)
Definition: Unit.h:1092
bool IsBattleMaster() const
Definition: Unit.h:1570
Definition: Unit.h:779
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
uint32 GetSpellPhaseMask() const
Definition: Unit.h:997
Definition: SpellAuras.h:50
Definition: Unit.h:254
SpellValueMod
Definition: Unit.h:127
bool operator()(WorldObject const *objA, WorldObject const *objB) const
Definition: Unit.h:2402
uint32 GetHitMask() const
Definition: Unit.h:998
Definition: Unit.h:643
bool IsInCombat() const
Definition: Unit.h:1584
Definition: Unit.h:450
TC_SHARED_API::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::FieldOptions,::google::protobuf::internal::EnumTypeTraits< ::bgs::protocol::LogOption,::bgs::protocol::LogOption_IsValid >, 14, false > log
Definition: Unit.h:738
Powers const _power
Definition: Unit.h:2392
Definition: Unit.h:1130
Definition: Unit.h:68
Definition: UpdateFields.h:101
Definition: Unit.h:808
CharmInfo * m_charmInfo
Definition: Unit.h:2292
Definition: Unit.h:849
Definition: Unit.h:644
Definition: Unit.h:778
std::list< AuraEffect * > AuraEffectList
Definition: Unit.h:1322
UnitActionBarEntry()
Definition: Unit.h:1150
Definition: Unit.h:739
Definition: Unit.h:434
Vehicle * m_vehicleKit
Definition: Unit.h:2305
void SetRedirectThreat(ObjectGuid guid, uint32 pct)
Definition: Unit.h:2154
Talk
Definition: boss_noth.cpp:41
Definition: SpellAuraDefines.h:67
Definition: Unit.h:792
virtual void Update(uint32)
Definition: Object.h:430
void SetCreateHealth(uint32 val)
Definition: Unit.h:1894
bool HasByteFlag(uint16 index, uint8 offset, uint8 flag) const
Definition: Object.cpp:1298
Definition: UpdateFields.h:85
Definition: Unit.h:541
Definition: Unit.h:352
virtual bool HasSpell(uint32) const
Definition: Unit.h:1593
Definition: Unit.h:721
Definition: Unit.h:508
DiminishingGroup
Definition: SharedDefines.h:4369
Definition: Unit.h:76
Definition: Unit.h:631
Stats
Definition: SharedDefines.h:235
Definition: Unit.h:151
Definition: Unit.h:64
Definition: Unit.h:132
uint32 m_lastSanctuaryTime
Definition: Unit.h:1989
ChatMsg
Definition: SharedDefines.h:4228
void SetAI(UnitAI *newAI)
Definition: Unit.h:1332
uint32 mitigated_damage
Definition: Unit.h:913
void SetCanModifyStats(bool modifyStats)
Definition: Unit.h:1960
bool IsInFlight() const
Definition: Unit.h:1582
Definition: Unit.h:574
UnitTypeMask
Definition: Unit.h:855
arena_t NULL
Definition: jemalloc_internal.h:624
uint16 GetMeleeAnimKitId() const override
Definition: Unit.h:1509
Definition: Unit.h:517
#define UNIT_ACTION_BUTTON_ACTION(X)
Definition: Unit.h:1144
Definition: boss_warbringer_omrogg.cpp:70
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:996
Definition: Unit.h:284
Diminishing m_Diminishing
Definition: Unit.h:2344
Definition: Unit.h:157
AuraList const & GetSingleCastAuras() const
Definition: Unit.h:1834
SpellSchools
Definition: SharedDefines.h:272
Definition: Unit.h:366
Definition: UpdateFields.h:82
std::list< Aura * > AuraList
Definition: Unit.h:1323
TC_GAME_API float playerBaseMoveSpeed[MAX_MOVE_TYPE]
Definition: Unit.cpp:88
uint32 m_absorb
Definition: Unit.h:931
WeaponAttackType m_attackType
Definition: Unit.h:930
Definition: Unit.h:570
Definition: UpdateFields.h:97
Definition: Unit.h:561
Definition: Unit.h:498
Definition: Unit.h:634
ObjectGuid GetCharmerGUID() const
Definition: Unit.h:1704
Definition: Spell.h:265
uint16 _aiAnimKitId
Definition: Unit.h:2358
Definition: Unit.h:664
Will ignore most target checks (mostly DBC target checks)
Definition: Unit.h:479
Definition: Transport.h:28
CommandStates _CommandState
Definition: Unit.h:1253
void SetRemovedCharges(uint8 amount)
Definition: Unit.h:897
Definition: Unit.h:512
Definition: Unit.h:1185
Definition: Unit.h:310
Definition: Unit.h:757
Definition: Unit.h:673
Definition: Unit.h:678
bool m_AutoRepeatFirstCast
Definition: Unit.h:2249
Definition: Unit.h:286
Will ignore Spell and Category cooldowns.
Definition: Unit.h:463
UnitBytes1Offsets
Definition: Unit.h:237
Definition: Unit.h:727
uint32 packedData
Definition: Unit.h:1152
Definition: Unit.h:800
Definition: Unit.h:799
Vehicle * m_vehicle
Definition: Unit.h:2304
PlayerTotemType
Definition: Unit.h:1289
void SetNativeDisplayId(uint32 modelId)
Definition: Unit.h:2016
bool m_cleanupDone
Definition: Unit.h:2352
Definition: Unit.h:152
Definition: Unit.h:675
Definition: ThreatManager.h:201
Definition: Unit.h:599
Definition: Unit.h:253
Definition: Unit.h:719
Definition: Unit.h:955
uint64_t uint64
Definition: g3dmath.h:170
virtual void CleanupsBeforeDelete(bool finalCleanup=true)
Definition: Object.cpp:1506
bool IsLevitating() const
Definition: Unit.h:1667
Definition: Object.h:423
TimeTrackerSmall m_movesplineTimer
Definition: Unit.h:2342
Definition: Unit.h:513
Definition: Unit.h:705
Definition: Unit.h:1196
Definition: Creature.h:467
Definition: FollowerReference.h:27
Definition: Unit.h:240
DispelType
Definition: SharedDefines.h:1836
RedirectThreatInfo()
Definition: Unit.h:1079
Definition: Unit.h:96
uint32 spellId
Definition: Unit.h:427
Not triggered.
Definition: Unit.h:461
bool critical
Definition: Unit.h:1072
UnitActionBarEntry const * GetActionBarEntry(uint8 index) const
Definition: Unit.h:1229
Definition: Unit.h:557
Definition: Unit.h:225
Definition: Unit.h:285
Definition: Timer.h:134
void SetGuidValue(uint16 index, ObjectGuid const &value)
Definition: Object.cpp:1120
DispelInfo(Unit *dispeller, uint32 dispellerSpellId, uint8 chargesRemoved)
Definition: Unit.h:891
ObjectGuid GetMinionGUID() const
Definition: Unit.h:1702
Definition: Unit.h:239
void RemoveExtraUnitMovementFlag(uint16 f)
Definition: Unit.h:2114
Definition: UpdateFields.h:145
Definition: Unit.h:801
Definition: Unit.h:455
uint32 GetHeal() const
Definition: Unit.h:978
Definition: Unit.h:543
Definition: Unit.h:795
bool _isAtStay
Definition: Unit.h:1261
Definition: Unit.h:511
#define MAX_DECLINED_NAME_CASES
Definition: Unit.h:1099
Definition: Unit.h:601
uint16 stack
Definition: Unit.h:877
void SetStatInt32Value(uint16 index, int32 value)
Definition: Object.cpp:1143
Unit * GetActionTarget() const
Definition: Unit.h:992
uint32 cleanDamage
Definition: Unit.h:1057
Definition: SpellAuraDefines.h:86
Definition: Unit.h:148
std::list< std::pair< Aura *, uint8 > > DispelChargesList
Definition: Unit.h:422
Definition: Unit.h:146
int32 GetPower(Powers power) const
Definition: Unit.cpp:11589
Will ignore GCD.
Definition: Unit.h:462
Unit * _dispellerUnit
Definition: Unit.h:902
ObjectGuid GetPetGUID() const
Definition: Unit.h:1708
bool IsHovering() const
Definition: Unit.h:1669
void apply(T *val)
Definition: ByteConverter.h:41
MeleeHitOutcome hitOutCome
Definition: Unit.h:1038
void AddExtraUnitMovementFlag(uint16 f)
Definition: Unit.h:2113
Definition: Unit.h:724
Definition: Unit.h:696
std::pair< AuraMap::iterator, AuraMap::iterator > AuraMapBoundsNonConst
Definition: Unit.h:1313
ShapeshiftForm GetShapeshiftForm() const
Definition: Unit.h:1932
uint32 m_transform
Definition: Unit.h:2269
Definition: UpdateFields.h:105
Definition: Unit.h:866
Definition: Unit.h:452
AuraApplicationList m_interruptableAuras
Definition: Unit.h:2281
uint32 _hitMask
Definition: Unit.h:1013
CharmInfo * GetCharmInfo()
Definition: Unit.h:1748
#define MAX_SPELL_SCHOOL
Definition: SharedDefines.h:283
Definition: Unit.h:551
uint32 absorb
Definition: Unit.h:1069
Will ignore combo point requirement.
Definition: Unit.h:468
UnitFlags2
Definition: Unit.h:709
Definition: Unit.h:1111
Definition: Unit.h:233
Definition: Unit.h:859
Definition: SpellAuras.h:329
double distance(double x, double y)
Definition: g3dmath.h:731
bool operator()(WorldObject const *objA, WorldObject const *objB) const
Definition: Unit.h:2375
Definition: Unit.h:527
Definition: Unit.h:496
bool IsGuildMaster() const
Definition: Unit.h:1569
Definition: Unit.h:681
uint32 _oldFactionId
faction before charm
Definition: Unit.h:2355
Definition: Unit.h:884
Definition: Unit.h:134
time_t _lastDamagedTime
Definition: Unit.h:2362
uint32 m_state
Definition: Unit.h:2340
Definition: Unit.h:741
Definition: Unit.h:358
Definition: Unit.h:518
T max(const T &x, const T &y)
Definition: g3dmath.h:320
Definition: UpdateFields.h:113
Definition: Unit.h:106
HealInfo(Unit *healer, Unit *target, uint32 heal, SpellInfo const *spellInfo, SpellSchoolMask schoolMask)
Definition: Unit.h:966
void AddUnitMovementFlag(uint32 f)
Definition: Unit.h:2107
Definition: VehicleDefines.h:119
CommandStates
Definition: Unit.h:1135
TempSummon const * ToTempSummon() const
Definition: Unit.h:2207
void SetResistance(SpellSchools school, int32 val)
Definition: Unit.h:1424
Definition: Unit.h:309
uint32 procEx
Definition: Unit.h:1036
Unit *const m_victim
Definition: Unit.h:925
Definition: Unit.h:59
UnitAI * i_disabledAI
Definition: Unit.h:2242
void SetByteFlag(uint16 index, uint8 offset, uint8 newFlag)
Definition: Object.cpp:1252
uint8 getLevel() const
Definition: Unit.h:1408
Definition: Unit.h:372
ObjectGuid GetChannelObjectGuid() const
Definition: Unit.h:1904
Definition: Unit.h:107
Definition: Unit.h:109
int32 CountPctFromMaxPower(Powers power, int32 pct) const
Definition: Unit.h:1450
uint32 GetAbsorb() const
Definition: Unit.h:979
Definition: Unit.h:75
MeleeHitOutcome
Definition: Unit.h:882
Definition: Unit.h:1124
#define MAX_SPELL_IMMUNITY
Definition: SharedDefines.h:1869
bool isMoving() const
Definition: Unit.h:2186
WeaponAttackType attackType
Definition: Unit.h:1033
Definition: Unit.h:1292
MovementFlags2
Definition: Unit.h:834
void SetCommandState(CommandStates st)
Definition: Unit.h:1210
#define MAX_STATS
Definition: SharedDefines.h:244
Definition: Unit.h:688
Definition: Totem.h:38
virtual uint8 getLevelForTarget(WorldObject const *) const
Definition: Object.h:517
std::list< SpellImmune > SpellImmuneList
Definition: Unit.h:430
Definition: Unit.h:103
Definition: Unit.h:162
Definition: Unit.h:568
Definition: UpdateFields.h:92
int32 m_procDeep
Definition: Unit.h:2261
uint16 GetAIAnimKitId() const override
Definition: Unit.h:1505
Definition: Unit.h:209
Definition: Unit.h:55
TempSummon * ToTempSummon()
Definition: Unit.h:2206
Definition: Unit.h:793
Definition: Unit.h:37
Definition: Unit.h:495
Definition: Unit.h:783
void SetCharmerGUID(ObjectGuid owner)
Definition: Unit.h:1705
Definition: Unit.h:516
void setFaction(uint32 faction)
Definition: Unit.h:1467
bool IsSpiritGuide() const
Definition: Unit.h:1574
Definition: Unit.h:314
CharmType
Definition: Unit.h:1181
std::map< uint8, AuraApplication * > VisibleAuraMap
Definition: Unit.h:1327
Definition: DynamicObject.h:35
Definition: Unit.h:486
bool IsHunterPet() const
Definition: Unit.h:1404
CommandStates GetCommandState() const
Definition: Unit.h:1211
bool IsWalking() const
Definition: Unit.h:1668
float m_modSpellHitChance
Definition: Unit.h:1941
void ClearUnitState(uint32 f)
Definition: Unit.h:1396
Definition: Unit.h:625
std::list< DiminishingReturn > Diminishing
Definition: Unit.h:1325
Definition: Unit.h:591
Definition: Unit.h:885
uint32 getTransForm() const
Definition: Unit.h:2018
Powers getPowerType() const
Definition: Unit.h:1444
float GetCombatReach() const
Definition: Unit.h:1361
Definition: Unit.h:573
Totem * ToTotem()
Definition: Unit.h:2203
Definition: Unit.h:602
Pet const * ToPet() const
Definition: Unit.h:2201
Unit *const m_attacker
Definition: Unit.h:924
SpellSchoolMask GetSchoolMask() const
Definition: Unit.h:946
Definition: Unit.h:984
Definition: Unit.h:715
SpellInfo const *const _spellInfo
Definition: Unit.h:962
Definition: SpellHistory.h:42
Definition: Unit.h:108
Definition: TemporarySummon.h:66
void SetVehicle(Vehicle *vehicle)
Definition: Unit.h:2167
Definition: UpdateFields.h:137
Definition: Unit.h:569
Definition: Unit.h:690
Definition: Unit.h:153
Definition: SpellMgr.h:276
Definition: Unit.h:630
T min(const T &x, const T &y)
Definition: g3dmath.h:305
uint32 m_block
Definition: Unit.h:933
Definition: Unit.h:241
Definition: Unit.h:692
Will ignore interruptible aura's at cast.
Definition: Unit.h:470
SpellHistory * GetSpellHistory()
Definition: Unit.h:1926
Powers
Definition: SharedDefines.h:246
Definition: Unit.h:60
Definition: Unit.h:534
uint32 resist
Definition: Unit.h:1052
Definition: Unit.h:536
bool IsQuestGiver() const
Definition: Unit.h:1566
SpellHistory const * GetSpellHistory() const
Definition: Unit.h:1927
uint32 GetRedirectThreatPercent() const
Definition: Unit.h:2157
bool isFeared() const
Definition: Unit.h:1599
UnitStandStateType GetStandState() const
Definition: Unit.h:1488
virtual bool IsAlwaysVisibleFor(WorldObject const *) const
Definition: Object.h:639
virtual bool SetInPhase(uint32 id, bool update, bool apply)
Definition: Object.cpp:2879
Definition: Unit.h:1291
Definition: Unit.h:65
Unit *const _actor
Definition: Unit.h:1007
AttackerSet const & getAttackers() const
Definition: Unit.h:1377
std::pair< AuraApplicationMap::const_iterator, AuraApplicationMap::const_iterator > AuraApplicationMapBounds
Definition: Unit.h:1316
Definition: Unit.h:666
DiminishingGroup DRGroup
Definition: Unit.h:876
Definition: Unit.h:340
Definition: Unit.h:378
Definition: Unit.h:159
Definition: Unit.h:494
bool _isReturning
Definition: Unit.h:1263
Definition: SpellMgr.h:433
Language
Definition: SharedDefines.h:959
Definition: Unit.h:1042
GameObjectList m_gameObj
Definition: Unit.h:2267
UnitBytes2Offsets
Definition: Unit.h:244
bool IsInnkeeper() const
Definition: Unit.h:1572
Definition: Unit.h:553
Definition: Unit.h:117
Definition: Unit.h:618
Definition: Unit.h:72
Definition: Unit.h:804
Definition: Unit.h:277
Definition: Unit.h:789
Definition: Unit.h:1194
Definition: Unit.h:545
ObjectGuid GetTargetGUID() const
Definition: Unit.h:1083
bool IsGuardian() const
Definition: Unit.h:1402
std::pair< AuraMap::const_iterator, AuraMap::const_iterator > AuraMapBounds
Definition: Unit.h:1312
Definition: Unit.h:763
Definition: Unit.h:102
Definition: Unit.h:337
HostileRefManager & getHostileRefManager()
Definition: Unit.h:2001
Definition: Unit.h:1140
Definition: Unit.h:110
AuraApplicationMap & GetAppliedAuras()
Definition: Unit.h:1789
bool IsDuringRemoveFromWorld() const
Definition: Unit.h:2198
bool IsStopped() const
Definition: Unit.h:2104
Definition: SharedDefines.h:288
Definition: Unit.h:154
Definition: Unit.h:133
Definition: Unit.h:1108
Definition: Unit.h:356
uint32 _spellTypeMask
Definition: Unit.h:1011
Definition: Unit.h:263
Definition: MotionMaster.h:82
uint32 GetPetNumber() const
Definition: Unit.h:1207
Definition: Unit.h:140
Definition: Unit.h:655
Definition: UpdateFields.h:138
Definition: Unit.h:593
const_iterator begin() const
Definition: Unit.h:181
void Set(ObjectGuid guid, uint32 pct)
Definition: Unit.h:1086
Definition: DBCStructure.h:789
bool IsFullHealth() const
Definition: Unit.h:1429
Definition: Unit.h:149
Definition: Unit.h:504
Definition: Unit.h:367
RedirectThreatInfo _redirectThreadInfo
Definition: Unit.h:2350
Definition: Unit.h:638
Definition: Unit.h:839
Definition: Unit.h:101
Definition: Unit.h:336
std::set< Unit * > AttackerSet
Definition: Unit.h:1308
Definition: Unit.h:760
virtual void SetCanDualWield(bool value)
Definition: Unit.h:1360
Definition: Unit.h:348
SheathState
Definition: Unit.h:296
Definition: Unit.h:704
Definition: Unit.h:559
Definition: Unit.h:144
MotionMaster * i_motionMaster
Definition: Unit.h:2297
bool HasInvisibilityAura() const
Definition: Unit.h:1598
bool IsAlive() const
Definition: Unit.h:1692
Definition: Unit.h:1021
Unit * GetVictim() const
Definition: Unit.h:1379
void SetCreateMana(uint32 val)
Definition: Unit.h:1896
Unit * _unit
Definition: Unit.h:1250
SpellPeriodicAuraLogInfo(AuraEffect const *_auraEff, uint32 _damage, uint32 _overDamage, uint32 _absorb, uint32 _resist, float _multiplier, bool _critical)
Definition: Unit.h:1063
VisibleAuraMap const * GetVisibleAuras()
Definition: Unit.h:2003
MeleeHitOutcome hitOutCome
Definition: Unit.h:916
BaseModType
Definition: Unit.h:532
Definition: Unit.h:145
uint32 damage
Definition: Unit.h:1067
Definition: Unit.h:650
void SetByteValue(uint16 index, uint8 offset, uint8 value)
Definition: Object.cpp:1080
DeathState m_deathState
Definition: Unit.h:2259
G3D::int16 z
Definition: Vector3int16.h:46
bool IsActionBarForSpell() const
Definition: Unit.h:1157
Definition: Unit.h:503
DamageEffectType
Definition: Unit.h:660
Definition: Unit.h:100
Unit * m_attacking
Definition: Unit.h:2256
bool HealthBelowPct(int32 pct) const
Definition: Unit.h:1430
Definition: Unit.h:528
void SetLastDamagedTime(time_t val)
Definition: Unit.h:2217
Definition: Unit.h:409
Definition: Item.h:259
void SetArmor(int32 val)
Definition: Unit.h:1420
Definition: Unit.h:529
SpellInterruptFlags
Definition: Unit.h:35
uint32 GetBlock() const
Definition: Unit.h:952
Definition: Unit.h:796
Definition: Util.h:362
Definition: Unit.h:785
TriggerCastFlags
Definition: Unit.h:458
Definition: UpdateFields.h:99
virtual void RemoveFromWorld() override
Definition: Object.cpp:1515
Definition: Unit.h:122
Definition: Unit.h:775
AuraApplicationMap const & GetAppliedAuras() const
Definition: Unit.h:1790
float GetFloatValue(uint16 index) const
Definition: Object.cpp:312
Definition: SharedDefines.h:274
std::set< Unit * > ControlList
Definition: Unit.h:1309
Definition: Unit.h:1294
Definition: Unit.h:746
int32 GetMinPower(Powers power) const
Definition: Unit.h:1447
Definition: Unit.h:736
Definition: ThreatManager.h:49
WeaponDamageRange
Definition: Unit.h:442
Definition: SpellInfo.h:238
Definition: Unit.h:1274
Definition: Unit.h:58
Definition: Unit.h:725
SpellSchoolMask const _schoolMask
Definition: Unit.h:963
void SetCreateStat(Stats stat, float val)
Definition: Unit.h:1893
Definition: Unit.h:645
bool _isWalkingBeforeCharm
Are we walking before we were charmed?
Definition: Unit.h:2356
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition: Unit.h:1920
void RemoveByteFlag(uint16 index, uint8 offset, uint8 newFlag)
Definition: Object.cpp:1271
std::multimap< uint32, Aura * > AuraMap
Definition: Unit.h:1311
uint32 absorbed_damage
Definition: Unit.h:912
Definition: Unit.h:683
Definition: Unit.h:768
UnitStandStateType
Definition: Unit.h:205
Unit *const _procTarget
Definition: Unit.h:1009
Definition: Unit.h:155
int32_t int32
Definition: Define.h:146
Definition: Unit.h:138
TC_GAME_API float baseMoveSpeed[MAX_MOVE_TYPE]
Definition: Unit.cpp:75
AuraList m_scAuras
Definition: Unit.h:2280
Definition: Unit.h:840
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition: Unit.h:1832
Definition: Unit.h:744
Definition: Unit.h:86
uint32_t uint32
Definition: Define.h:150
HostileRefManager m_HostileRefManager
Definition: Unit.h:2346
Definition: Unit.h:826
Definition: Unit.h:213
UnitRename
Definition: Unit.h:319
Definition: Unit.h:362
Definition: Unit.h:298
Definition: Unit.h:338
SpellInfo const * GetSpellInfo() const
Definition: Unit.h:945
uint32 blocked
Definition: Unit.h:1054
Definition: Unit.h:1275
ActionBarIndex
Definition: Unit.h:1191
uint64_t uint64
Definition: Define.h:149
void AddUnitTypeMask(uint32 mask)
Definition: Unit.h:1400
Definition: Unit.h:136
Definition: Unit.h:487
uint32 absorb
Definition: Unit.h:1027
Will ignore mounted/on vehicle restrictions.
Definition: Unit.h:474
Definition: Unit.h:884
void SetUnitMovementFlags(uint32 f)
Definition: Unit.h:2111
uint32 TargetState
Definition: Unit.h:1031
FollowerRefManager m_FollowingRefManager
Definition: Unit.h:2348
G3D::int16 y
Definition: Vector2int16.h:38
SpellFacingFlags
Definition: Unit.h:195
void SetStandFlags(uint8 flags)
Definition: Unit.h:1493
ObjectGuid const & GetGuidValue(uint16 index) const
Definition: Object.cpp:332
uint16_t uint16
Definition: Define.h:151
Definition: Unit.h:745
Definition: Unit.h:211
UnitActionBarEntry CharmSpellInfo
Definition: Unit.h:1189
Definition: Unit.h:607
Definition: Unit.h:590
Definition: UpdateFields.h:140
uint32 m_movementCounter
Incrementing counter used in movement packets.
Definition: Unit.h:2336
Definition: GameObject.h:880
SpellMissInfo
Definition: SharedDefines.h:2019
Definition: Unit.h:1123
Definition: Unit.h:652
uint32 resist
Definition: Unit.h:1070
Definition: Unit.h:714
void ClearDiminishings()
Definition: Unit.h:1346
Definition: Unit.h:635
Definition: Unit.h:713
Definition: Unit.h:794
Definition: Unit.h:642
bool isPossessed() const
Definition: Unit.h:1743
AuraList & GetSingleCastAuras()
Definition: Unit.h:1833
Definition: Unit.h:226
Definition: Unit.h:587
Definition: Unit.h:567
Definition: Unit.h:803
Definition: Unit.h:884
Definition: Unit.h:141
Definition: Unit.h:884
Definition: Unit.h:139
uint32 damageSchoolMask
Definition: Unit.h:1025
Definition: UpdateFields.h:117
Definition: Unit.h:115
Definition: UpdateFields.h:144
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
Definition: Unit.h:1357
std::set< PetAura const * > PetAuraSet
Definition: Unit.h:2145
#define REACTIVE_TIMER_START
Definition: Unit.h:1270
void addFollower(FollowerReference *pRef)
Definition: Unit.h:2098
Definition: Unit.h:2397
ReactiveType
Definition: Unit.h:1272
Definition: Unit.h:780
Definition: Unit.h:740
Definition: Unit.h:749
Definition: Unit.h:38
Definition: Unit.h:858
void SetAction(uint32 action)
Definition: Unit.h:1173
Definition: Unit.h:717
bool NeedChangeAI
Definition: Unit.h:2161
NPCFlags
Non Player Character flags.
Definition: Unit.h:732
Definition: Unit.h:734
Definition: Unit.h:291
Definition: Unit.h:711
Definition: Unit.h:689
Definition: Unit.h:571
void SetType(ActiveStates type)
Definition: Unit.h:1168
uint32 GetMountID() const
Definition: Unit.h:1497
Definition: Unit.h:365
DiminishingLevels
Definition: SharedDefines.h:4874
Definition: Unit.h:268
Definition: Unit.h:113
Definition: Unit.h:97
virtual void SetSheath(SheathState sheathed)
Definition: Unit.h:1463
std::pair< AuraApplicationMap::iterator, AuraApplicationMap::iterator > AuraApplicationMapBoundsNonConst
Definition: Unit.h:1317
Definition: Unit.h:357
Definition: Map.h:259
SpellChannelInterruptFlags
Definition: Unit.h:46
Definition: Unit.h:1195
Definition: Spell.h:170
Definition: Unit.h:566
Definition: Unit.h:845
Definition: Unit.h:216
#define MAX_REACTIVE
Definition: Unit.h:1279
Definition: Unit.h:848
ReactStates
Definition: Unit.h:1127
uint32 _petnumber
Definition: Unit.h:1254
uint32 GetDamage() const
Definition: Unit.h:949
VictimState
Definition: Unit.h:333
Will not adjust facing to target (if any)
Definition: Unit.h:471
void SetCritterGUID(ObjectGuid guid)
Definition: Unit.h:1709
Definition: Unit.h:646
Definition: Unit.h:790
T CalculatePct(T base, U pct)
Definition: Util.h:92
Definition: Unit.h:838
bool IsCharmedOwnedByPlayerOrPlayer() const
Definition: Unit.h:1715
void RemoveUnitMovementFlag(uint32 f)
Definition: Unit.h:2108
Definition: CombatLogPackets.h:29
WeaponAttackType GetAttackType() const
Definition: Unit.h:948
Definition: Unit.h:70
Definition: Unit.h:210
uint32 schoolMask
Definition: Unit.h:1050
Definition: Unit.h:342
Definition: Unit.h:121
Definition: Unit.h:726
virtual void AddToWorld()
Definition: Object.cpp:142
Definition: UpdateFields.h:116
void SetBaseWeaponDamage(WeaponAttackType attType, WeaponDamageRange damageRange, float value)
Definition: Unit.h:1972
SheathState GetSheath() const
Definition: Unit.h:1462
Definition: Unit.h:754
ThreatManager m_ThreatManager
Definition: Unit.h:2302
ControlList m_Controlled
Definition: Unit.h:1738
Definition: Unit.h:308
Definition: Unit.h:776
UnitAI * GetAI()
Definition: Unit.h:1331