Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
Unit.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef SF_UNIT_H
7#define SF_UNIT_H
8
9#include "DBCStructure.h"
10#include "EventProcessor.h"
11#include "FollowerReference.h"
12#include "FollowerRefManager.h"
13#include "HostileRefManager.h"
14#include "MotionMaster.h"
15#include "MoveSplineInit.h"
16#include "Object.h"
17#include "SpellAuraDefines.h"
18#include "ThreatManager.h"
19
20#define WORLD_TRIGGER 12999
21
23{
24 SPELL_INTERRUPT_FLAG_MOVEMENT = 0x01, // why need this for instant?
25 SPELL_INTERRUPT_FLAG_PUSH_BACK = 0x02, // push back
26 SPELL_INTERRUPT_FLAG_UNK3 = 0x04, // any info?
27 SPELL_INTERRUPT_FLAG_INTERRUPT = 0x08, // interrupt
28 SPELL_INTERRUPT_FLAG_ABORT_ON_DMG = 0x10 // _complete_ interrupt on direct damage
29 //SPELL_INTERRUPT_UNK = 0x20 // unk, 564 of 727 spells having this spell start with "Glyph"
30};
31
32// See SpellAuraInterruptFlags for other values definitions
38
40{
41 AURA_INTERRUPT_FLAG_HITBYSPELL = 0x00000001, // 0 removed when getting hit by a negative spell?
42 AURA_INTERRUPT_FLAG_TAKE_DAMAGE = 0x00000002, // 1 removed by any damage
43 AURA_INTERRUPT_FLAG_CAST = 0x00000004, // 2 cast any spells
44 AURA_INTERRUPT_FLAG_MOVE = 0x00000008, // 3 removed by any movement
45 AURA_INTERRUPT_FLAG_TURNING = 0x00000010, // 4 removed by any turning
46 AURA_INTERRUPT_FLAG_JUMP = 0x00000020, // 5 removed by entering combat
47 AURA_INTERRUPT_FLAG_NOT_MOUNTED = 0x00000040, // 6 removed by dismounting
48 AURA_INTERRUPT_FLAG_NOT_ABOVEWATER = 0x00000080, // 7 removed by entering water
49 AURA_INTERRUPT_FLAG_NOT_UNDERWATER = 0x00000100, // 8 removed by leaving water
50 AURA_INTERRUPT_FLAG_NOT_SHEATHED = 0x00000200, // 9 removed by unsheathing
51 AURA_INTERRUPT_FLAG_TALK = 0x00000400, // 10 talk to npc / loot? action on creature
52 AURA_INTERRUPT_FLAG_USE = 0x00000800, // 11 mine/use/open action on gameobject
53 AURA_INTERRUPT_FLAG_MELEE_ATTACK = 0x00001000, // 12 removed by attacking
54 AURA_INTERRUPT_FLAG_SPELL_ATTACK = 0x00002000, // 13 ???
55 AURA_INTERRUPT_FLAG_UNK14 = 0x00004000, // 14
56 AURA_INTERRUPT_FLAG_TRANSFORM = 0x00008000, // 15 removed by transform?
57 AURA_INTERRUPT_FLAG_UNK16 = 0x00010000, // 16
58 AURA_INTERRUPT_FLAG_MOUNT = 0x00020000, // 17 misdirect, aspect, swim speed
59 AURA_INTERRUPT_FLAG_NOT_SEATED = 0x00040000, // 18 removed by standing up (used by food and drink mostly and sleep/Fake Death like)
60 AURA_INTERRUPT_FLAG_CHANGE_MAP = 0x00080000, // 19 leaving map/getting teleported
61 AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION = 0x00100000, // 20 removed by auras that make you invulnerable, or make other to lose selection on you
62 AURA_INTERRUPT_FLAG_UNK21 = 0x00200000, // 21
64 AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT = 0x00800000, // 23 removed by entering pvp combat
65 AURA_INTERRUPT_FLAG_DIRECT_DAMAGE = 0x01000000, // 24 removed by any direct damage
66 AURA_INTERRUPT_FLAG_LANDING = 0x02000000, // 25 removed by hitting the ground
67
69};
70
109
110#define MAX_SPELLMOD 36
111
121
123{
124 typedef std::pair<SpellValueMod, int32> CustomSpellValueMod;
125 typedef std::vector<CustomSpellValueMod> StorageType;
126
127public:
128 typedef StorageType::const_iterator const_iterator;
129
130public:
132 {
133 storage_.push_back(CustomSpellValueMod(mod, value));
134 }
135
137 {
138 return storage_.begin();
139 }
140
142 {
143 return storage_.end();
144 }
145
146private:
148};
149
154
155#define BASE_MINDAMAGE 1.0f
156#define BASE_MAXDAMAGE 2.0f
157#define BASE_ATTACK_TIME 2000
158
159// byte value (UNIT_FIELD_ANIM_TIER, 0)
173
174// byte flag value (UNIT_FIELD_ANIM_TIER, 2)
184
185// byte flags value (UNIT_FIELD_ANIM_TIER, 3)
193
194// byte value (UNIT_FIELD_ANIM_TIER, 3) — client animation tier for creatures
203
204// high byte (3 from 0..3) of UNIT_FIELD_SHAPESHIFT_FORM
241
242// low byte (0 from 0..3) of UNIT_FIELD_SHAPESHIFT_FORM
244{
245 SHEATH_STATE_UNARMED = 0, // non prepared weapon
246 SHEATH_STATE_MELEE = 1, // prepared melee weapon
247 SHEATH_STATE_RANGED = 2 // prepared ranged weapon
248};
249
250#define MAX_SHEATH_STATE 3
251
252// byte (1 from 0..3) of UNIT_FIELD_SHAPESHIFT_FORM
264
265// byte (2 from 0..3) of UNIT_FIELD_SHAPESHIFT_FORM
271
272#define CREATURE_MAX_SPELLS 8
273#define MAX_SPELL_CHARM 4
274#define MAX_SPELL_VEHICLE 6
275#define MAX_SPELL_POSSESS 8
276#define MAX_SPELL_CONTROL_BAR 10
277
278#define MAX_AGGRO_RESET_TIME 10 // in seconds
279#define MAX_AGGRO_RADIUS 45.0f // yards
280
287
288enum class VictimState
289{
290 VICTIMSTATE_MISS = 0, // set when attacker misses
291 VICTIMSTATE_WOUND = 1, // victim got clear/blocked hit
295 VICTIMSTATE_BLOCK = 5, // unused? not set when blocked, even on full block
299};
300
302{
304 HITINFO_UNK1 = 0x00000001, // req correct packet structure
306 HITINFO_OFFHAND = 0x00000004,
307 HITINFO_UNK2 = 0x00000008,
308 HITINFO_MISS = 0x00000010,
313 HITINFO_CRITICALHIT = 0x00000200, // critical hit
314 // 0x00000400
315 // 0x00000800
316 HITINFO_UNK12 = 0x00001000,
317 HITINFO_BLOCK = 0x00002000, // blocked damage
318 // 0x00004000 // Hides worldtext for 0 damage
319 // 0x00008000 // Related to blood visual
320 HITINFO_GLANCING = 0x00010000,
321 HITINFO_CRUSHING = 0x00020000,
323 // 0x00080000
324 // 0x00100000
325 HITINFO_SWINGNOHITSOUND = 0x00200000, // unused?
326 // 0x00400000
327 HITINFO_RAGE_GAIN = 0x00800000,
328 HITINFO_FAKE_DAMAGE = 0x01000000, // enables damage animation even if no damage done, set only if no damage
329 HITINFO_UNK25 = 0x02000000,
330 HITINFO_UNK26 = 0x04000000,
331};
332
333//i would like to remove this: (it is defined in item.h
335{
338};
339
341struct SpellValue;
342
343class AuraApplication;
344class Aura;
345class UnitAura;
346class AuraEffect;
347class Creature;
348class Spell;
349class SpellInfo;
350class DynamicObject;
351class GameObject;
352class Item;
353class Pet;
354class PetAura;
355class Minion;
356class Guardian;
357class UnitAI;
358class Totem;
359class Transport;
360class Vehicle;
361class VehicleJoinEvent;
362class TransportBase;
363class SpellCastTargets;
364namespace Movement
365{
367 class MoveSpline;
368}
369
370typedef std::list<Unit*> UnitList;
371typedef std::list< std::pair<Aura*, uint8> > DispelChargesList;
372
379
380typedef std::list<SpellImmune> SpellImmuneList;
381
390
396
403
405{
407 AURA_REMOVE_BY_DEFAULT = 1, // scripted remove, remove by stack with aura with different ids and sc aura remove
409 AURA_REMOVE_BY_ENEMY_SPELL, // dispel and absorb aura destroy
410 AURA_REMOVE_BY_EXPIRE, // aura duration has ended
412};
413
437
439{
440 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.
446 UNIT_MOD_MANA, // UNIT_MOD_MANA..UNIT_MOD_RUNIC_POWER must be in existed order, it's accessed by index values of Powers enum.
450 UNIT_MOD_UNUSED, // Old UNIT_MOD_HAPPINESS
463 UNIT_MOD_ARMOR, // UNIT_MOD_ARMOR..UNIT_MOD_RESISTANCE_ARCANE must be in existed order, it's accessed by index values of SpellSchools enum.
476 // synonyms
483};
484
493
500
501enum class DeathState
502{
503 ALIVE = 0,
506 DEAD = 3,
508};
509
511{
512 UNIT_STATE_DIED = 0x00000001, // player has fake death aura
513 UNIT_STATE_MELEE_ATTACKING = 0x00000002, // player is melee attacking someone
514 //UNIT_STATE_MELEE_ATTACK_BY = 0x00000004, // player is melee attack by someone
515 UNIT_STATE_STUNNED = 0x00000008,
516 UNIT_STATE_ROAMING = 0x00000010,
517 UNIT_STATE_CHASE = 0x00000020,
518 //UNIT_STATE_SEARCHING = 0x00000040,
519 UNIT_STATE_FLEEING = 0x00000080,
520 UNIT_STATE_IN_FLIGHT = 0x00000100, // player is in flight mode
521 UNIT_STATE_FOLLOW = 0x00000200,
522 UNIT_STATE_ROOT = 0x00000400,
525 UNIT_STATE_ISOLATED = 0x00002000, // area auras do not affect other players
527 UNIT_STATE_CASTING = 0x00008000,
530 UNIT_STATE_JUMPING = 0x00040000,
531 UNIT_STATE_MOVE = 0x00100000,
533 UNIT_STATE_EVADE = 0x00400000,
539 UNIT_STATE_IGNORE_PATHFINDING = 0x10000000, // do not use pathfinding in any MovementGenerator
541 // for real move using movegen check and stop (except unstoppable flight)
548 // stay by different reasons
550 UNIT_STATE_ALL_STATE = 0xffffffff //(UNIT_STATE_STOPPED | UNIT_STATE_MOVING | UNIT_STATE_IN_COMBAT | UNIT_STATE_IN_FLIGHT)
551};
552
565
566#define MAX_MOVE_TYPE 9
567
568extern float baseMoveSpeed[MAX_MOVE_TYPE];
570
578
609
610#define MAX_COMBAT_RATING 27
611
613{
614 DIRECT_DAMAGE = 0, // used for normal weapon damage (not for class abilities or spells)
615 SPELL_DIRECT_DAMAGE = 1, // spell/class abilities damage
616 DOT = 2,
617 HEAL = 3,
618 NODAMAGE = 4, // used also in case when damage applied to health but not applied to spell channelInterruptFlags/etc
620};
621
622// Value masks for UNIT_FIELD_FLAGS
624{
625 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
626 UNIT_FLAG_NON_ATTACKABLE = 0x00000002, // not attackable
628 UNIT_FLAG_PVP_ATTACKABLE = 0x00000008, // allow apply pvp rules to attackable state in addition to faction dependent state
629 UNIT_FLAG_RENAME = 0x00000010,
630 UNIT_FLAG_PREPARATION = 0x00000020, // don't take reagents for spells with SPELL_ATTR5_NO_REAGENT_WHILE_PREP
631 UNIT_FLAG_UNK_6 = 0x00000040,
632 UNIT_FLAG_NOT_ATTACKABLE_1 = 0x00000080, // ?? (UNIT_FLAG_PVP_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1) is NON_PVP_ATTACKABLE
633 UNIT_FLAG_IMMUNE_TO_PC = 0x00000100, // disables combat/assistance with PlayerCharacters (PC) - see Unit::_IsValidAttackTarget, Unit::_IsValidAssistTarget
634 UNIT_FLAG_IMMUNE_TO_NPC = 0x00000200, // disables combat/assistance with NonPlayerCharacters (NPC) - see Unit::_IsValidAttackTarget, Unit::_IsValidAssistTarget
635 UNIT_FLAG_LOOTING = 0x00000400, // loot animation
636 UNIT_FLAG_PET_IN_COMBAT = 0x00000800, // in combat?, 2.0.8
637 UNIT_FLAG_PVP = 0x00001000, // changed in 3.0.3
638 UNIT_FLAG_SILENCED = 0x00002000, // silenced, 2.1.1
639 UNIT_FLAG_UNK_14 = 0x00004000, // 2.0.8
640 UNIT_FLAG_UNK_15 = 0x00008000,
641 UNIT_FLAG_UNK_16 = 0x00010000,
642 UNIT_FLAG_PACIFIED = 0x00020000, // 3.0.3 ok
643 UNIT_FLAG_STUNNED = 0x00040000, // 3.0.3 ok
645 UNIT_FLAG_TAXI_FLIGHT = 0x00100000, // disable casting at client side spell not allowed by taxi flight (mounted?), probably used with 0x4 flag
646 UNIT_FLAG_DISARMED = 0x00200000, // 3.0.3, disable melee spells casting..., "Required melee weapon" added to melee spells tooltip.
647 UNIT_FLAG_CONFUSED = 0x00400000,
648 UNIT_FLAG_FLEEING = 0x00800000,
649 UNIT_FLAG_PLAYER_CONTROLLED = 0x01000000, // used in spell Eyes of the Beast for pet... let attack by controlled creature
652 UNIT_FLAG_MOUNT = 0x08000000,
653 UNIT_FLAG_UNK_28 = 0x10000000,
654 UNIT_FLAG_DISABLE_POWERS = 0x20000000, // used in Feing Death spell
655 UNIT_FLAG_SHEATHE = 0x40000000,
656 UNIT_FLAG_UNK_31 = 0x80000000,
658};
659
660// Value masks for UNIT_FIELD_FLAGS2
662{
664 UNIT_FLAG2_UNK1 = 0x00000002, // Hide unit model (show only player equip)
668 UNIT_FLAG2_INSTANTLY_APPEAR_MODEL = 0x00000020, // Unit model instantly appears when summoned (does not fade in)
671 UNIT_FLAG2_DISABLE_PRED_STATS = 0x00000100, // Player has disabled predicted stats (Used by raid frames)
672 UNIT_FLAG2_DISARM_RANGED = 0x00000400, // this does not disable ranged weapon display (maybe additional flag needed?)
674 UNIT_FLAG2_RESTRICT_PARTY_INTERACTION = 0x00001000, // Restrict interaction to party or raid
675 UNIT_FLAG2_PREVENT_SPELL_CLICK = 0x00002000, // Prevent spellclick
678 UNIT_FLAG2_UNK2 = 0x00010000,
679 UNIT_FLAG2_PLAY_DEATH_ANIM = 0x00020000, // Plays special death animation upon death
680 UNIT_FLAG2_ALLOW_CHEAT_SPELLS = 0x00040000 // Allows casting spells with AttributesEx7 & SPELL_ATTR7_IS_CHEAT_SPELL
681};
682
685{
686 UNIT_NPC_FLAG_NONE = 0x00000000,
687 UNIT_NPC_FLAG_GOSSIP = 0x00000001, // 100%
688 UNIT_NPC_FLAG_QUESTGIVER = 0x00000002, // 100%
689 UNIT_NPC_FLAG_UNK1 = 0x00000004,
690 UNIT_NPC_FLAG_UNK2 = 0x00000008,
691 UNIT_NPC_FLAG_TRAINER = 0x00000010, // 100%
692 UNIT_NPC_FLAG_TRAINER_CLASS = 0x00000020, // 100%
694 UNIT_NPC_FLAG_VENDOR = 0x00000080, // 100%
695 UNIT_NPC_FLAG_VENDOR_AMMO = 0x00000100, // 100%, general goods vendor
696 UNIT_NPC_FLAG_VENDOR_FOOD = 0x00000200, // 100%
697 UNIT_NPC_FLAG_VENDOR_POISON = 0x00000400, // guessed
698 UNIT_NPC_FLAG_VENDOR_REAGENT = 0x00000800, // 100%
699 UNIT_NPC_FLAG_REPAIR = 0x00001000, // 100%
700 UNIT_NPC_FLAG_FLIGHTMASTER = 0x00002000, // 100%
701 UNIT_NPC_FLAG_SPIRITHEALER = 0x00004000, // guessed
702 UNIT_NPC_FLAG_SPIRITGUIDE = 0x00008000, // guessed
703 UNIT_NPC_FLAG_INNKEEPER = 0x00010000, // 100%
704 UNIT_NPC_FLAG_BANKER = 0x00020000, // 100%
705 UNIT_NPC_FLAG_PETITIONER = 0x00040000, // 100% 0xC0000 = guild petitions, 0x40000 = arena team petitions
706 UNIT_NPC_FLAG_TABARDDESIGNER = 0x00080000, // 100%
707 UNIT_NPC_FLAG_BATTLEMASTER = 0x00100000, // 100%
708 UNIT_NPC_FLAG_AUCTIONEER = 0x00200000, // 100%
709 UNIT_NPC_FLAG_STABLEMASTER = 0x00400000, // 100%
710 UNIT_NPC_FLAG_GUILD_BANKER = 0x00800000, // cause client to send 997 opcode
711 UNIT_NPC_FLAG_SPELLCLICK = 0x01000000, // cause client to send 1015 opcode (spell click)
712 UNIT_NPC_FLAG_PLAYER_VEHICLE = 0x02000000, // players with mounts that have vehicle data should have it set
713 UNIT_NPC_FLAG_REFORGER = 0x08000000, // reforging
714 UNIT_NPC_FLAG_TRANSMOGRIFIER = 0x10000000, // transmogrification
715 UNIT_NPC_FLAG_VAULTKEEPER = 0x20000000, // void storage
716 UNIT_NPC_FLAG_WILDPET_CAPTURABLE = 0x40000000, // wild pet
717 UNIT_NPC_FLAG_BMAH = 0x80000000, // bmah goya (-2147483648)
718};
719
721{
722 MOVEMENTFLAG_NONE = 0x00000000,
727 MOVEMENTFLAG_LEFT = 0x00000010,
728 MOVEMENTFLAG_RIGHT = 0x00000020,
731 MOVEMENTFLAG_WALKING = 0x00000100, // Walking
732 MOVEMENTFLAG_DISABLE_GRAVITY = 0x00000200, // Former MOVEMENTFLAG_LEVITATING. This is used when walking is not possible.
733 MOVEMENTFLAG_ROOT = 0x00000400, // Must not be set along with MOVEMENTFLAG_MASK_MOVING
734 MOVEMENTFLAG_FALLING = 0x00000800, // damage dealt on that type of falling
743 MOVEMENTFLAG_SWIMMING = 0x00100000, // appears with fly flag also
744 MOVEMENTFLAG_ASCENDING = 0x00200000, // press "space" when flying
746 MOVEMENTFLAG_CAN_FLY = 0x00800000, // Appears when unit can fly AND also walk
747 MOVEMENTFLAG_FLYING = 0x01000000, // unit is actually flying. pretty sure this is only used for players. creatures use disable_gravity
748 MOVEMENTFLAG_SPLINE_ELEVATION = 0x02000000, // used for flight paths
749 MOVEMENTFLAG_WATERWALKING = 0x04000000, // prevent unit from falling through water
750 MOVEMENTFLAG_FALLING_SLOW = 0x08000000, // active rogue safe fall spell (passive)
751 MOVEMENTFLAG_HOVER = 0x10000000, // hover, cannot jump
753
759
762
765
766 // Movement flags allowed for creature in CreateObject - we need to keep all other enabled serverside
767 // to properly calculate all movement
771
775
779};
780
801
803{
804 UNIT_MASK_NONE = 0x00000000,
805 UNIT_MASK_SUMMON = 0x00000001,
806 UNIT_MASK_MINION = 0x00000002,
807 UNIT_MASK_GUARDIAN = 0x00000004,
808 UNIT_MASK_TOTEM = 0x00000008,
809 UNIT_MASK_PET = 0x00000010,
810 UNIT_MASK_VEHICLE = 0x00000020,
811 UNIT_MASK_PUPPET = 0x00000040,
815};
816
826
832
834{
835public:
836 explicit DispelInfo(Unit* dispeller, uint32 dispellerSpellId, uint8 chargesRemoved) :
837 _dispellerUnit(dispeller), _dispellerSpell(dispellerSpellId), _chargesRemoved(chargesRemoved)
838 { }
839
841 {
842 return _dispellerUnit;
843 }
845 {
846 return _dispellerSpell;
847 }
849 {
850 return _chargesRemoved;
851 }
853 {
854 _chargesRemoved = amount;
855 }
856private:
860};
861
863{
864 CleanDamage(uint32 mitigated, uint32 absorbed, WeaponAttackType _attackType, MeleeHitOutcome _hitOutCome) :
865 absorbed_damage(absorbed), mitigated_damage(mitigated), attackType(_attackType), hitOutCome(_hitOutCome)
866 { }
867
870
873};
874
875struct CalcDamageInfo;
876
878{
879private:
883 SpellInfo const* const m_spellInfo;
890public:
891 explicit DamageInfo(Unit* _attacker, Unit* _victim, uint32 _damage, SpellInfo const* _spellInfo, SpellSchoolMask _schoolMask, DamageEffectType _damageType);
892 explicit DamageInfo(CalcDamageInfo& dmgInfo);
893
894 void ModifyDamage(int32 amount);
895 void AbsorbDamage(uint32 amount);
896 void ResistDamage(uint32 amount);
897 void BlockDamage(uint32 amount);
898
900 {
901 return m_attacker;
902 }
904 {
905 return m_victim;
906 }
907 SpellInfo const* GetSpellInfo() const
908 {
909 return m_spellInfo;
910 }
912 {
913 return m_schoolMask;
914 }
916 {
917 return m_damageType;
918 }
920 {
921 return m_attackType;
922 }
924 {
925 return m_damage;
926 }
928 {
929 return m_absorb;
930 }
932 {
933 return m_resist;
934 }
936 {
937 return m_block;
938 }
939};
940
942{
943private:
946public:
947 explicit HealInfo(uint32 heal)
948 : m_heal(heal)
949 {
950 m_absorb = 0;
951 }
952 void AbsorbHeal(uint32 amount)
953 {
954 amount = std::min(amount, GetHeal());
955 m_absorb += amount;
956 m_heal -= amount;
957 }
958
960 {
961 return m_heal;
962 }
963};
964
966{
967public:
968 ProcEventInfo(Unit* actor, Unit* actionTarget, Unit* procTarget, uint32 typeMask,
969 uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask,
970 Spell* spell, DamageInfo* damageInfo, HealInfo* healInfo);
971
972 Unit* GetActor() const { return _actor; }
973 Unit* GetActionTarget() const { return _actionTarget; }
974 Unit* GetProcTarget() const { return _procTarget; }
975
976 uint32 GetTypeMask() const { return _typeMask; }
979 uint32 GetHitMask() const { return _hitMask; }
980
981
982 SpellInfo const* GetSpellInfo() const { return NULL; }
984
986 HealInfo* GetHealInfo() const { return _healInfo; }
987
988private:
989 Unit* const _actor;
999};
1000
1001// Struct for use in Unit::CalculateMeleeDamage
1002// Need create structure like in SMSG_ATTACKER_STATE_UPDATE opcode
1026
1027// Spell damage info structure based on structure sending in SMSG_SPELL_NON_MELEE_DAMAGE_LOG opcode
1029{
1030 SpellNonMeleeDamage(Unit* _attacker, Unit* _target, uint32 _SpellID, uint32 _schoolMask)
1031 : target(_target), attacker(_attacker), SpellID(_SpellID), damage(0), overkill(0), schoolMask(_schoolMask),
1032 absorb(0), resist(0), physicalLog(false), unused(false), blocked(0), HitInfo(0), cleanDamage(0)
1033 { }
1034
1047 // Used for help
1049};
1050
1052{
1053 SpellPeriodicAuraLogInfo(AuraEffect const* _auraEff, uint32 _damage, uint32 _overDamage, uint32 _absorb, uint32 _resist, uint32 _power, float _multiplier, bool _critical)
1054 : auraEff(_auraEff), damage(_damage), overDamage(_overDamage), absorb(_absorb), resist(_resist), power(_power), multiplier(_multiplier), critical(_critical)
1055 { }
1056
1059 uint32 overDamage; // overkill/overheal
1065};
1066
1068
1070{
1075
1077 {
1078 return _targetGUID;
1079 }
1081 {
1082 return _threatPct;
1083 }
1084
1085 void Set(uint64 guid, uint32 pct)
1086 {
1087 _targetGUID = guid;
1088 _threatPct = pct;
1089 }
1090
1092 {
1093 amount += _threatPct;
1094 _threatPct = uint32(std::max(0, amount));
1095 }
1096};
1097
1098#define MAX_DECLINED_NAME_CASES 5
1099
1105
1113
1114#define CURRENT_FIRST_NON_MELEE_SPELL 1
1115#define CURRENT_MAX_SPELL 4
1116
1118{
1119 explicit GlobalCooldown(uint32 _dur = 0, uint32 _time = 0) : duration(_dur), cast_time(_time)
1120 { }
1121
1124};
1125
1127
1128class GlobalCooldownMgr // Shared by Player and CharmInfo
1129{
1130public:
1133
1134public:
1135 bool HasGlobalCooldown(SpellInfo const* spellInfo) const;
1136 void AddGlobalCooldown(SpellInfo const* spellInfo, uint32 gcd);
1137 void CancelGlobalCooldown(SpellInfo const* spellInfo);
1138
1139private:
1141};
1142
1144{
1145 ACT_PASSIVE = 0x01, // 0x01 - passive
1146 ACT_ASSIST = 0x03, // 0x03 - assist
1147 ACT_DISABLED = 0x81, // 0x80 - castable
1148 ACT_ENABLED = 0xC1, // 0x40 | 0x80 - auto cast + castable
1149 ACT_COMMAND = 0x07, // 0x01 | 0x02 | 0x04
1150 ACT_REACTION = 0x06, // 0x02 | 0x04
1151 ACT_DECIDE = 0x00 // custom
1152};
1153
1161
1170
1171#define UNIT_ACTION_BUTTON_ACTION(X) (uint32(X) & 0x00FFFFFF)
1172#define UNIT_ACTION_BUTTON_TYPE(X) ((uint32(X) & 0xFF000000) >> 24)
1173#define MAKE_UNIT_ACTION_BUTTON(A, T) (uint32(A) | (uint32(T) << 24))
1174
1176{
1179
1181
1182 // helper
1188 {
1190 }
1192 {
1193 ActiveStates Type = GetType();
1194 return Type == ACT_DISABLED || Type == ACT_ENABLED || Type == ACT_PASSIVE;
1195 }
1196
1198 {
1199 packedData = MAKE_UNIT_ACTION_BUTTON(action, type);
1200 }
1201
1206
1207 void SetAction(uint32 action)
1208 {
1209 packedData = (packedData & 0xFF000000) | UNIT_ACTION_BUTTON_ACTION(action);
1210 }
1211};
1212
1213typedef std::list<Player*> SharedVisionList;
1214
1222
1224
1232
1233#define MAX_UNIT_ACTION_BAR_INDEX (ACTION_BAR_INDEX_END-ACTION_BAR_INDEX_START)
1234
1236{
1237public:
1238 explicit CharmInfo(Unit* unit);
1239 ~CharmInfo();
1240 void RestoreState();
1242 {
1243 return _petnumber;
1244 }
1245 void SetPetNumber(uint32 petnumber, bool statwindow);
1246
1248 {
1249 _CommandState = st;
1250 }
1252 {
1253 return _CommandState;
1254 }
1256 {
1257 return (_CommandState == state);
1258 }
1259
1261 void InitCharmCreateSpells();
1262 void InitPetActionBar();
1263 void InitEmptyActionBar(bool withAttack = true);
1264
1265 //return true if successful
1266 bool AddSpellToActionBar(SpellInfo const* spellInfo, ActiveStates newstate = ACT_DECIDE, uint8 preferredSlot = 0);
1267 bool RemoveSpellFromActionBar(uint32 spell_id);
1268 void LoadPetActionBar(const std::string& data);
1269 void BuildActionBar(WorldPacket* data) const;
1270 void SetSpellAutocast(SpellInfo const* spellInfo, bool state);
1271 void SetActionBar(uint8 index, uint32 spellOrAction, ActiveStates type)
1272 {
1273 PetActionBar[index].SetActionAndType(spellOrAction, type);
1274 }
1276 {
1277 return &(PetActionBar[index]);
1278 }
1279
1280 void ToggleCreatureAutocast(SpellInfo const* spellInfo, bool apply);
1281
1283 {
1284 return &(_charmspells[index]);
1285 }
1286
1291
1292 void SetIsCommandAttack(bool val);
1293 bool IsCommandAttack() const { return _isCommandAttack; }
1294 void SetIsCommandFollow(bool val);
1295 bool IsCommandFollow() const { return _isCommandFollow; }
1296 void SetIsAtStay(bool val);
1297 bool IsAtStay() const { return _isAtStay; }
1298 void SetIsFollowing(bool val);
1299 bool IsFollowing() const { return _isFollowing; }
1300 void SetIsReturning(bool val);
1301 bool IsReturning() const { return _isReturning; }
1302 void SaveStayPosition();
1303 void GetStayPosition(float& x, float& y, float& z) const;
1304
1305private:
1312
1313 //for restoration after charmed
1315
1321 float _stayX;
1322 float _stayY;
1323 float _stayZ;
1324
1326};
1327
1328// for clearing special attacks
1329#define REACTIVE_TIMER_START 4000
1330
1337
1338#define MAX_REACTIVE 3
1339#define SUMMON_SLOT_PET 0
1340#define SUMMON_SLOT_TOTEM 1
1341#define MAX_TOTEM_SLOT 5
1342#define SUMMON_SLOT_MINIPET 5
1343#define SUMMON_SLOT_QUEST 6
1344#define MAX_SUMMON_SLOT 7
1345
1346#define MAX_GAMEOBJECT_SLOT 4
1347
1359
1360// delay time next attack to prevent client attack animation problems
1361#define ATTACK_DISPLAY_DELAY 200
1362#define MAX_PLAYER_STEALTH_DETECT_RANGE 30.0f // max distance for detection targets by player
1363
1364struct SpellProcEventEntry; // used only privately
1365
1366class Unit : public WorldObject
1367{
1368public:
1369 typedef std::set<Unit*> AttackerSet;
1370 typedef std::set<Unit*> ControlList;
1371
1372 typedef std::multimap<uint32, Aura*> AuraMap;
1373 typedef std::pair<AuraMap::const_iterator, AuraMap::const_iterator> AuraMapBounds;
1374 typedef std::pair<AuraMap::iterator, AuraMap::iterator> AuraMapBoundsNonConst;
1375
1376 typedef std::multimap<uint32, AuraApplication*> AuraApplicationMap;
1377 typedef std::pair<AuraApplicationMap::const_iterator, AuraApplicationMap::const_iterator> AuraApplicationMapBounds;
1378 typedef std::pair<AuraApplicationMap::iterator, AuraApplicationMap::iterator> AuraApplicationMapBoundsNonConst;
1379
1380 typedef std::multimap<AuraStateType, AuraApplication*> AuraStateAurasMap;
1381 typedef std::pair<AuraStateAurasMap::const_iterator, AuraStateAurasMap::const_iterator> AuraStateAurasMapBounds;
1382
1383 typedef std::list<AuraEffect*> AuraEffectList;
1384 typedef std::list<Aura*> AuraList;
1385 typedef std::list<AuraApplication*> AuraApplicationList;
1386 typedef std::list<DiminishingReturn> Diminishing;
1387 typedef std::set<uint32> ComboPointHolderSet;
1388
1389 typedef std::map<uint8, AuraApplication*> VisibleAuraMap;
1390
1391 virtual ~Unit();
1392
1394 {
1395 return i_AI;
1396 }
1397 void SetAI(UnitAI* newAI)
1398 {
1399 i_AI = newAI;
1400 }
1401
1402 void AddToWorld() override;
1403 void RemoveFromWorld() override;
1404
1405 void CleanupBeforeRemoveFromMap(bool finalCleanup);
1406 void CleanupsBeforeDelete(bool finalCleanup = true) override; // used in ~Creature/~Player (or before mass creature delete to remove cross-references to already deleted units)
1407
1410 float ApplyDiminishingToDuration(DiminishingGroup group, int32& duration, Unit* caster, DiminishingLevels Level, int32 limitduration);
1411 void ApplyDiminishingAura(DiminishingGroup group, bool apply);
1413 {
1414 m_Diminishing.clear();
1415 }
1416
1417 // target dependent range checks
1418 float GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const;
1419 float GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const;
1420
1421 void Update(uint32 time) OVERRIDE;
1422
1424 {
1425 m_attackTimer[uint8(type)] = time;
1426 }
1429 {
1430 return m_attackTimer[uint8(type)];
1431 }
1433 {
1434 return m_attackTimer[uint8(type)] == 0;
1435 }
1436 bool haveOffhandWeapon() const;
1437 bool CanDualWield() const
1438 {
1439 return m_canDualWield;
1440 }
1441 void SetCanDualWield(bool value)
1442 {
1443 m_canDualWield = value;
1444 }
1445 float GetCombatReach() const
1446 {
1448 }
1449 float GetMeleeReach() const;
1450 bool IsWithinCombatRange(const Unit* obj, float dist2compare) const;
1451 bool IsWithinMeleeRange(const Unit* obj, float dist = MELEE_RANGE) const;
1452 void GetRandomContactPoint(const Unit* target, float& x, float& y, float& z, float distance2dMin, float distance2dMax) const;
1455
1456 void _addAttacker(Unit* pAttacker); // must be called only from Unit::Attack(Unit*)
1457 void _removeAttacker(Unit* pAttacker); // must be called only from Unit::AttackStop()
1458 Unit* getAttackerForHelper() const; // If someone wants to help, who to give them
1459 bool Attack(Unit* victim, bool meleeAttack);
1460 void CastStop(uint32 except_spellid = 0);
1461 bool AttackStop();
1462 void RemoveAllAttackers();
1464 {
1465 return m_attackers;
1466 }
1467 bool isAttackingPlayer() const;
1469 {
1470 return m_attacking;
1471 }
1472
1473 void CombatStop(bool includingCast = false);
1474 void CombatStopWithPets(bool includingCast = false);
1475 void StopAttackFaction(uint32 faction_id);
1476 void GetAttackableUnitListInRange(std::list<Unit*>& list, float fMaxSearchRange) const;
1477 Unit* SelectNearbyTarget(Unit* exclude = NULL, float dist = NOMINAL_MELEE_RANGE) const;
1478 void SendMeleeAttackStop(Unit* victim = NULL);
1479 void SendMeleeAttackStart(Unit* victim);
1480
1482 {
1483 m_state |= f;
1484 }
1485 bool HasUnitState(const uint32 f) const
1486 {
1487 return (m_state & f);
1488 }
1490 {
1491 m_state &= ~f;
1492 }
1493 bool CanFreeMove() const;
1494
1496 {
1497 return mask & m_unitTypeMask;
1498 }
1500 {
1501 m_unitTypeMask |= mask;
1502 }
1503 bool IsSummon() const
1504 {
1506 }
1507 bool IsGuardian() const
1508 {
1510 }
1511 bool IsPet() const
1512 {
1514 }
1515 bool IsHunterPet() const
1516 {
1518 }
1519 bool IsTotem() const
1520 {
1522 }
1523 bool IsVehicle() const
1524 {
1526 }
1527
1529 {
1531 }
1532 uint8 getLevelForTarget(WorldObject const* /*target*/) const override { return getLevel(); }
1533 void SetLevel(uint8 lvl);
1534
1536 {
1537 return GetByteValue(UNIT_FIELD_SEX, 0);
1538 }
1540 {
1541 return 1 << (getRace() - 1);
1542 }
1544 {
1545 return GetByteValue(UNIT_FIELD_SEX, 1);
1546 }
1548 {
1549 return 1 << (getClass() - 1);
1550 }
1552 {
1553 return GetByteValue(UNIT_FIELD_SEX, 3);
1554 }
1559
1560 void SetRace(uint8 race)
1561 {
1562 SetByteValue(UNIT_FIELD_SEX, 0, race);
1563 }
1564 void SetClass(uint8 newClass)
1565 {
1566 SetByteValue(UNIT_FIELD_SEX, 1, newClass);
1567 }
1568 void SetGender(uint8 gender)
1569 {
1570 SetByteValue(UNIT_FIELD_SEX, 3, gender);
1571 }
1572
1573 float GetStat(Stats stat) const
1574 {
1575 return float(GetUInt32Value(UNIT_FIELD_STATS + EUnitFields(stat)));
1576 }
1577 void SetStat(Stats stat, int32 val)
1578 {
1580 }
1582 {
1584 }
1585 void SetArmor(int32 val)
1586 {
1588 }
1589
1591 {
1593 }
1596 {
1598 }
1599
1601 {
1603 }
1605 {
1607 }
1608
1609 bool IsFullHealth() const
1610 {
1611 return GetHealth() == GetMaxHealth();
1612 }
1613 bool HealthBelowPct(int32 pct) const
1614 {
1615 return GetHealth() < CountPctFromMaxHealth(pct);
1616 }
1617 bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
1618 {
1619 return int64(GetHealth()) - int64(damage) < int64(CountPctFromMaxHealth(pct));
1620 }
1621 bool HealthAbovePct(int32 pct) const
1622 {
1623 return GetHealth() > CountPctFromMaxHealth(pct);
1624 }
1625 bool HealthAbovePctHealed(int32 pct, uint32 heal) const
1626 {
1627 return uint64(GetHealth()) + uint64(heal) > CountPctFromMaxHealth(pct);
1628 }
1629 float GetHealthPct() const
1630 {
1631 return GetMaxHealth() ? 100.f * GetHealth() / GetMaxHealth() : 0.0f;
1632 }
1634 {
1635 return CalculatePct(GetMaxHealth(), pct);
1636 }
1638 {
1639 return CalculatePct(GetHealth(), pct);
1640 }
1641
1642 void SetHealth(uint32 val);
1643 void SetMaxHealth(uint32 val);
1644 inline void SetFullHealth()
1645 {
1647 }
1650
1656 {
1658 }
1659
1660 void setPowerType(Powers power);
1661 int32 GetPower(Powers power) const;
1663 {
1664 return power == POWER_ECLIPSE ? -100 : 0;
1665 }
1666 int32 GetMaxPower(Powers power) const;
1668 {
1669 return CalculatePct(GetMaxPower(power), pct);
1670 }
1671 void SetPower(Powers power, int32 val);
1672 void SetMaxPower(Powers power, int32 val);
1673 // returns the change in power
1674 int32 ModifyPower(Powers power, int32 val);
1675 int32 ModifyPowerPct(Powers power, float pct, bool apply = true);
1676
1682 void ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply);
1683 void ApplyCastTimePercentMod(float val, bool apply);
1684
1689 virtual void SetSheath(SheathState sheathed)
1690 {
1692 }
1693
1694 // faction template id
1699 void setFaction(uint32 faction)
1700 {
1702 }
1704
1705 ReputationRank GetReactionTo(Unit const* target) const;
1706 ReputationRank static GetFactionReactionTo(FactionTemplateEntry const* factionTemplateEntry, Unit const* target);
1707
1708 bool IsHostileTo(Unit const* unit) const;
1709 bool IsHostileToPlayers() const;
1710 bool IsFriendlyTo(Unit const* unit) const;
1711 bool IsNeutralToAll() const;
1712 bool IsInPartyWith(Unit const* unit) const;
1713 bool IsInRaidWith(Unit const* unit) const;
1714 void GetPartyMembers(std::list<Unit*>& units);
1715 bool IsContestedGuard() const;
1716 bool IsPvP() const
1717 {
1719 }
1720 void SetPvP(bool state);
1721 uint32 GetCreatureType() const;
1723
1725 {
1727 }
1728 bool IsSitState() const;
1729 bool IsStandState() const;
1730 void SetStandState(uint8 state);
1731 void SetAnimTier(AnimTier tier);
1732
1734 {
1736 }
1738 {
1740 }
1741
1742 bool IsMounted() const
1743 {
1745 }
1750 void Mount(uint32 mount, uint32 vehicleId = 0, uint32 creatureEntry = 0);
1751 void Dismount();
1752 MountCapabilityEntry const* GetMountCapability(uint32 mountType) const;
1753
1754 void SendDurabilityLoss(Player* receiver, uint32 percent);
1755 void PlayOneShotAnimKit(uint32 id);
1756
1757 uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const
1758 {
1759 return (target ? getLevelForTarget(target) : getLevel()) * 5;
1760 }
1761 void DealDamageMods(Unit* victim, uint32& damage, uint32* absorb);
1762 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);
1763 void Kill(Unit* victim, bool durabilityLoss = true);
1764 int32 DealHeal(Unit* victim, uint32 addhealth);
1765
1766 void ProcDamageAndSpell(Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = WeaponAttackType::BASE_ATTACK, SpellInfo const* procSpell = NULL, SpellInfo const* procAura = NULL);
1767 void ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage, SpellInfo const* procAura = NULL);
1768
1769 void GetProcAurasTriggeredOnEvent(AuraApplicationList& aurasTriggeringProc, AuraApplicationList* procAuras, ProcEventInfo eventInfo);
1770 void TriggerAurasProcOnEvent(CalcDamageInfo& damageInfo);
1771 void TriggerAurasProcOnEvent(AuraApplicationList* myProcAuras, AuraApplicationList* targetProcAuras,
1772 Unit* actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget,
1773 uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell* spell,
1774 DamageInfo* damageInfo, HealInfo* healInfo);
1775 void TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, AuraApplicationList& procAuras);
1776
1777 void HandleEmoteCommand(uint32 anim_id);
1778 void AttackerStateUpdate(Unit* victim, WeaponAttackType attType = WeaponAttackType::BASE_ATTACK, bool extra = false);
1779
1780 void CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* damageInfo, WeaponAttackType attackType = WeaponAttackType::BASE_ATTACK);
1781 void DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss);
1782 void HandleProcExtraAttackFor(Unit* victim);
1783
1784 void CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType = WeaponAttackType::BASE_ATTACK, bool crit = false);
1785 void DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss);
1786
1787 // player or player's pet resilience (-1%)
1796
1797 void ApplyResilience(Unit const* victim, int32* damage, bool isCrit) const;
1798
1799 float MeleeSpellMissChance(Unit const* victim, WeaponAttackType attType, uint32 spellId) const;
1800 SpellMissInfo MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo);
1801 SpellMissInfo MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo);
1802 SpellMissInfo SpellHitResult(Unit* victim, SpellInfo const* spellInfo, bool canReflect = false);
1803
1804 float GetUnitDodgeChance() const;
1805 float GetUnitParryChance() const;
1806 float GetUnitBlockChance() const;
1807 float GetUnitMissChance(WeaponAttackType attType) const;
1808 float GetUnitCriticalChance(WeaponAttackType attackType, const Unit* victim) const;
1809 int32 GetMechanicResistChance(SpellInfo const* spellInfo) const;
1810 bool CanUseAttackType(WeaponAttackType attacktype) const;
1811
1812 virtual uint32 GetBlockPercent() const
1813 {
1814 return 30;
1815 }
1816
1817 uint32 GetUnitMeleeSkill(Unit const* target = NULL) const;
1818
1819 float GetWeaponProcChance() const;
1820 float GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo* spellProto) const;
1821
1822 MeleeHitOutcome RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackType attType) const;
1823 MeleeHitOutcome RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const;
1824
1825 bool IsVendor() const
1826 {
1828 }
1829 bool IsTrainer() const
1830 {
1832 }
1833 bool IsQuestGiver() const
1834 {
1836 }
1837 bool IsGossip() const
1838 {
1840 }
1841 bool IsTaxi() const
1842 {
1844 }
1845 bool IsGuildMaster() const
1846 {
1848 }
1853 bool IsBanker() const
1854 {
1856 }
1857 bool IsInnkeeper() const
1858 {
1860 }
1865 bool IsSpiritGuide() const
1866 {
1868 }
1873 bool IsAuctioner() const
1874 {
1876 }
1877 bool IsArmorer() const
1878 {
1880 }
1881 bool IsServiceProvider() const;
1886 bool IsBMAuctioner() const
1887 {
1889 }
1890
1891 bool IsInFlight() const
1892 {
1894 }
1895
1896 bool IsInCombat() const
1897 {
1899 }
1900 void CombatStart(Unit* target, bool initialAggro = true);
1901 void SetInCombatState(bool PvP, Unit* enemy = NULL);
1902 void SetInCombatWith(Unit* enemy);
1903 void ClearInCombat();
1905 {
1906 return m_CombatTimer;
1907 }
1908
1909 bool HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint32 familyFlags) const;
1910 bool virtual HasSpell(uint32 /*spellID*/) const
1911 {
1912 return false;
1913 }
1914 bool HasBreakableByDamageAuraType(AuraType type, uint32 excludeAura = 0) const;
1915 bool HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel = NULL) const;
1916
1917 bool HasStealthAura() const
1918 {
1920 }
1922 {
1924 }
1925 bool isFeared() const
1926 {
1928 }
1929 bool isInRoots() const
1930 {
1932 }
1933 bool IsPolymorphed() const;
1934
1935 bool isFrozen() const;
1936
1937 bool isTargetableForAttack(bool checkFakeDeath = true) const;
1938
1939 bool IsValidAttackTarget(Unit const* target) const;
1940 bool _IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, WorldObject const* obj = NULL) const;
1941
1942 bool IsValidAssistTarget(Unit const* target) const;
1943 bool _IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) const;
1944
1945 virtual bool IsInWater() const;
1946 virtual bool IsUnderWater() const;
1947 virtual void UpdateUnderwaterState(Map* m, float x, float y, float z);
1948 bool isInAccessiblePlaceFor(Creature const* c) const;
1949
1950 void SendHealSpellLog(ObjectGuid CasterGUID, ObjectGuid TargetGUID, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical = false);
1951 int32 HealBySpell(Unit* victim, SpellInfo const* spellInfo, uint32 addHealth, bool critical = false);
1952 void SendEnergizeSpellLog(Unit* victim, uint32 spellID, int32 damage, Powers powertype);
1953 void EnergizeBySpell(Unit* victim, uint32 SpellID, int32 Damage, Powers powertype);
1954 uint32 SpellNonMeleeDamageLog(Unit* victim, uint32 spellID, uint32 damage);
1955
1956 void CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
1957 void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
1958 void CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
1959 void CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
1960 void CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
1961 void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
1962 void CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
1963 void CastCustomSpell(Unit* victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
1964 void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
1965 void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim = NULL, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
1966 void CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit* victim = NULL, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
1967 Aura* AddAura(uint32 spellId, Unit* target);
1968 Aura* AddAura(SpellInfo const* spellInfo, uint32 effMask, Unit* target);
1969 void SetAuraStack(uint32 spellId, Unit* target, uint32 stack);
1970 void SendPlaySpellVisualKit(uint32 SpellVisualId, uint32 Duration, int32 Type);
1971 void SendPlaySpellVisual(uint32 SpellVisualId, float x, float y, float z, float orientation, uint8 SpeedTime, uint16 MissReason, uint16 ReflectStatus);
1972
1973 void DeMorph();
1974
1975 void SendAttackStateUpdate(CalcDamageInfo* damageInfo);
1976 void SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 SwingType, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount);
1978 void SendSpellNonMeleeDamageLog(Unit* target, uint32 SpellID, uint32 Damage, SpellSchoolMask damageSchoolMask, uint32 AbsorbedDamage, uint32 Resist, bool PhysicalDamage, uint32 Blocked, bool CriticalHit = false);
1980 void SendSpellMiss(Unit* target, uint32 spellID, SpellMissInfo missInfo);
1981 void SendSpellDamageResist(Unit* target, uint32 spellId);
1982 void SendSpellDamageImmune(Unit* target, uint32 spellId);
1983
1984 void NearTeleportTo(float x, float y, float z, float orientation, bool casting = false);
1985 void SendTeleportPacket(Position& pos);
1986 virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport = false);
1987 // returns true if unit's position really changed
1988 bool UpdatePosition(const Position& pos, bool teleport = false);
1989 void UpdateOrientation(float orientation);
1990 void UpdateHeight(float newZ);
1991
1992 void SendMoveKnockBack(Player* player, float speedXY, float speedZ, float vcos, float vsin);
1993 void KnockbackFrom(float x, float y, float speedXY, float speedZ);
1994 void JumpTo(float speedXY, float speedZ, bool forward = true);
1995 void JumpTo(WorldObject* obj, float speedZ);
1996
1997 void MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath = false, bool forceDestination = false);
1998
1999
2000 //void SendSetPlayHoverAnim(bool PlayHoverAnim);
2001 //void SendMovementSetSplineAnim(Movement::AnimType anim);
2002
2003 bool IsLevitating() const
2004 {
2005 return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
2006 }
2007 bool IsWalking() const
2008 {
2009 return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING);
2010 }
2011 bool SetWalk(bool enable);
2012 bool SetDisableGravity(bool disable, bool packetOnly = false);
2013 bool SetFall(bool enable);
2014 bool SetSwim(bool enable);
2015 bool SetCanFly(bool enable);
2016 bool SetWaterWalking(bool enable, bool packetOnly = false);
2017 bool SetFeatherFall(bool enable, bool packetOnly = false);
2018 bool SetHover(bool enable, bool packetOnly = false);
2019 void SendSetVehicleRecId(uint32 vehicleId);
2020
2021 void SetInFront(WorldObject const* target);
2022 void SetFacingTo(float ori);
2023 void SetFacingToObject(WorldObject* object);
2024
2025 void SendChangeCurrentVictimOpcode(HostileReference* pHostileReference);
2027 void SendRemoveFromThreatListOpcode(HostileReference* pHostileReference);
2028 void SendThreatListUpdate();
2029
2030 void SendClearTarget();
2031
2032 bool IsAlive() const
2033 {
2034 return (m_deathState == DeathState::ALIVE);
2035 }
2036 bool isDying() const
2037 {
2039 }
2040 bool isDead() const
2041 {
2043 }
2045 {
2046 return m_deathState;
2047 }
2048 virtual void setDeathState(DeathState s); // overwrited in Creature/Player/Pet
2049
2051 {
2053 }
2054 void SetOwnerGUID(uint64 owner);
2056 {
2058 }
2060 {
2062 }
2064 {
2066 }
2068 {
2070 }
2072 {
2074 }
2076 {
2078 }
2080 {
2082 }
2084 {
2086 }
2088 {
2090 }
2092 {
2094 }
2096 {
2098 }
2099
2101 {
2102 return m_ControlledByPlayer;
2103 }
2110
2111 Player* GetSpellModOwner() const;
2112
2113 Unit* GetOwner() const;
2114 Guardian* GetGuardianPet() const;
2115 Minion* GetFirstMinion() const;
2116 Unit* GetCharmer() const;
2117 Unit* GetCharm() const;
2118 Unit* GetCharmerOrOwner() const;
2121 Player* GetAffectingPlayer() const;
2122
2123 void SetMinion(Minion* minion, bool apply);
2124 void GetAllMinionsByEntry(std::list<Creature*>& Minions, uint32 entry);
2125 void RemoveAllMinionsByEntry(uint32 entry);
2126 void SetCharm(Unit* target, bool apply);
2127 Unit* GetNextRandomRaidMemberOrPet(float radius);
2128 bool SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* aurApp = NULL);
2129 void RemoveCharmedBy(Unit* charmer);
2130 void RestoreFaction();
2131
2133 Unit* GetFirstControlled() const;
2134 void RemoveAllControlled();
2135
2136 bool IsCharmed() const
2137 {
2138 return GetCharmerGUID() != 0;
2139 }
2140 bool isPossessed() const
2141 {
2143 }
2144 bool isPossessedByPlayer() const;
2145 bool isPossessing() const;
2146 bool isPossessing(Unit* u) const;
2147
2149 {
2150 return m_charmInfo;
2151 }
2153 void DeleteCharmInfo();
2154 void UpdateCharmAI();
2155 //Player* GetMoverSource() const;
2158 {
2159 return m_sharedVision;
2160 }
2161 void AddPlayerToVision(Player* player);
2162 void RemovePlayerFromVision(Player* player);
2163 bool HasSharedVision() const
2164 {
2165 return !m_sharedVision.empty();
2166 }
2167 void RemoveBindSightAuras();
2168 void RemoveCharmAuras();
2169
2170 Pet* CreateTamedPetFrom(Creature* creatureTarget, uint32 spell_id = 0);
2171 Pet* CreateTamedPetFrom(uint32 creatureEntry, uint32 spell_id = 0);
2172 bool InitTamedPet(Pet* pet, uint8 level, uint32 spell_id) const;
2173
2174 // aura apply/remove helpers - you should better not use these
2175 Aura* _TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint32 effMask, Unit* caster, int32* baseAmount = NULL, Item* castItem = NULL, uint64 casterGUID = 0);
2176 void _AddAura(UnitAura* aura, Unit* caster);
2178 void _ApplyAuraEffect(Aura* aura, uint8 effIndex);
2179 void _ApplyAura(AuraApplication* aurApp, uint32 effMask);
2180 void _UnapplyAura(AuraApplicationMap::iterator& i, AuraRemoveMode removeMode);
2181 void _UnapplyAura(AuraApplication* aurApp, AuraRemoveMode removeMode);
2182
2184
2185 void _RegisterAuraEffect(AuraEffect* aurEff, bool apply);
2186
2187 // m_ownedAuras container management
2189 {
2190 return m_ownedAuras;
2191 }
2192 AuraMap const& GetOwnedAuras() const
2193 {
2194 return m_ownedAuras;
2195 }
2196
2197 void RemoveOwnedAura(AuraMap::iterator& i, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
2198 void RemoveOwnedAura(uint32 spellId, uint64 casterGUID = 0, uint32 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
2200
2201 Aura* GetOwnedAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint32 reqEffMask = 0, Aura* except = NULL) const;
2202
2203 // m_appliedAuras container management
2209 {
2210 return m_appliedAuras;
2211 }
2212
2213 void RemoveAura(AuraApplicationMap::iterator& i, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
2214 void RemoveAura(uint32 spellId, uint64 casterGUID = 0, uint32 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
2217
2218 void RemoveAurasDueToSpell(uint32 spellId, uint64 casterGUID = 0, uint32 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
2219 void RemoveAuraFromStack(uint32 spellId, uint64 casterGUID = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
2220 void RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId, uint64 casterGUID, Unit* dispeller, uint8 chargesRemoved = 1);
2221 void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit* stealer);
2222 void RemoveAurasDueToItemSpell(uint32 spellId, uint64 castItemGuid);
2223 void RemoveAurasByType(AuraType auraType, uint64 casterGUID = 0, Aura* except = NULL, bool negative = true, bool positive = true);
2224 void RemoveNotOwnSingleTargetAuras(uint32 newPhase = 0, bool phaseid = false);
2225 void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = 0);
2226 void RemoveAurasWithAttribute(uint32 flags);
2227 void RemoveAurasWithFamily(SpellFamilyNames family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, uint64 casterGUID);
2228 void RemoveAurasWithMechanic(uint32 mechanic_mask, AuraRemoveMode removemode = AURA_REMOVE_BY_DEFAULT, uint32 except = 0);
2230
2232 void RemoveAllAuras();
2233 void RemoveArenaAuras();
2234 void RemoveAllAurasOnDeath();
2237 void RemoveAllAurasExceptType(AuraType type1, AuraType type2);
2238 void DelayOwnedAuras(uint32 spellId, uint64 caster, int32 delaytime);
2239
2241 void _ApplyAllAuraStatMods();
2242
2244 {
2245 return m_modAuras[type];
2246 }
2248 {
2249 return m_scAuras;
2250 }
2252 {
2253 return m_scAuras;
2254 }
2255
2256 AuraEffect* GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 casterGUID = 0) const;
2257 AuraEffect* GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, uint64 casterGUID = 0) const;
2258 AuraEffect* GetAuraEffect(AuraType type, SpellFamilyNames name, uint32 iconId, uint8 effIndex) const; // spell mustn't have familyflags
2259 AuraEffect* GetAuraEffect(AuraType type, SpellFamilyNames family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, uint64 casterGUID = 0) const;
2260 AuraEffect* GetDummyAuraEffect(SpellFamilyNames name, uint32 iconId, uint8 effIndex) const;
2261
2262 AuraApplication* GetAuraApplication(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint32 reqEffMask = 0, AuraApplication* except = NULL) const;
2263 Aura* GetAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint32 reqEffMask = 0) const;
2264
2265 AuraApplication* GetAuraApplicationOfRankedSpell(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint32 reqEffMask = 0, AuraApplication* except = NULL) const;
2266 Aura* GetAuraOfRankedSpell(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint32 reqEffMask = 0) const;
2267
2268 void GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelChargesList& dispelList);
2269
2270 bool HasAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster = 0) const;
2271 uint32 GetAuraCount(uint32 spellId) const;
2272 bool HasAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint32 reqEffMask = 0) const;
2273 bool HasAuraType(AuraType auraType) const;
2274 bool HasAuraTypeWithCaster(AuraType auratype, uint64 caster) const;
2275 bool HasAuraTypeWithMiscvalue(AuraType auratype, int32 miscvalue) const;
2276 bool HasAuraTypeWithAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const;
2277 bool HasAuraTypeWithValue(AuraType auratype, int32 value) const;
2278 bool HasNegativeAuraWithInterruptFlag(uint32 flag, uint64 guid = 0) const;
2279 bool HasNegativeAuraWithAttribute(uint32 flag, uint64 guid = 0) const;
2280 bool HasAuraWithMechanic(uint32 mechanicMask) const;
2281
2282 AuraEffect* IsScriptOverriden(SpellInfo const* spell, int32 script) const;
2283 uint32 GetDiseasesByCaster(uint64 casterGUID, bool remove = false);
2284 uint32 GetDoTsByCaster(uint64 casterGUID) const;
2285
2286 int32 GetTotalAuraModifier(AuraType auratype) const;
2287 float GetTotalAuraMultiplier(AuraType auratype) const;
2290
2291 int32 GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const;
2292 float GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const;
2293 int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, const AuraEffect* except = NULL) const;
2294 int32 GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const;
2295
2296 int32 GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
2297 float GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_value) const;
2298 int32 GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
2299 int32 GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
2300
2301 int32 GetTotalAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const;
2302 float GetTotalAuraMultiplierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const;
2303 int32 GetMaxPositiveAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const;
2304 int32 GetMaxNegativeAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const;
2305
2306 float GetResistanceBuffMods(SpellSchools school, bool positive) const;
2307 void SetResistanceBuffMods(SpellSchools school, bool positive, float val);
2308 void ApplyResistanceBuffModsMod(SpellSchools school, bool positive, float val, bool apply);
2309 void ApplyResistanceBuffModsPercentMod(SpellSchools school, bool positive, float val, bool apply);
2310 void InitStatBuffMods();
2311 void ApplyStatBuffMod(Stats stat, float val, bool apply);
2312 void ApplyStatPercentBuffMod(Stats stat, float val, bool apply);
2313 void SetCreateStat(Stats stat, float val)
2314 {
2315 m_createStats[stat] = val;
2316 }
2326 {
2328 }
2330 {
2332 }
2333 uint32 GetPowerIndex(uint32 powerType) const;
2334 int32 GetCreatePowers(Powers power) const;
2335 float GetPosStat(Stats stat) const
2336 {
2338 }
2339 float GetNegStat(Stats stat) const
2340 {
2342 }
2343 float GetCreateStat(Stats stat) const
2344 {
2345 return m_createStats[stat];
2346 }
2347
2348 void SetCurrentCastedSpell(Spell* pSpell);
2349 virtual void ProhibitSpellSchool(SpellSchoolMask /*idSchoolMask*/, uint32 /*unTimeMs*/)
2350 { }
2351 void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed = true, bool withInstant = true);
2352 void FinishSpell(CurrentSpellTypes spellType, bool ok = true);
2353
2354 // set withDelayed to true to account delayed spells as casted
2355 // delayed+channeled spells are always accounted as casted
2356 // we can skip channeled or delayed checks using flags
2357 bool IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled = false, bool skipAutorepeat = false, bool isAutoshoot = false, bool skipInstant = true) const;
2358
2359 // set withDelayed to true to interrupt delayed spells too
2360 // delayed+channeled spells are always interrupted
2361 void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid = 0, bool withInstant = true);
2362
2364 {
2365 return m_currentSpells[spellType];
2366 }
2367 Spell* GetCurrentSpell(uint32 spellType) const
2368 {
2369 return m_currentSpells[spellType];
2370 }
2371 Spell* FindCurrentSpellBySpellId(uint32 spell_id) const;
2372 int32 GetCurrentSpellCastTime(uint32 spell_id) const;
2373
2376
2382
2383 bool IsInFeralForm() const;
2384
2385 bool IsInDisallowedMountForm() const;
2386
2391
2394
2395 // Event handler
2397
2398 // stat system
2399 bool HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, float amount, bool apply);
2400 void SetModifierValue(UnitMods unitMod, UnitModifierType modifierType, float value)
2401 {
2402 m_auraModifiersGroup[unitMod][modifierType] = value;
2403 }
2404 float GetModifierValue(UnitMods unitMod, UnitModifierType modifierType) const;
2405 float GetTotalStatValue(Stats stat) const;
2406 float GetTotalAuraModValue(UnitMods unitMod) const;
2408 Stats GetStatByAuraGroup(UnitMods unitMod) const;
2410 bool CanModifyStats() const
2411 {
2412 return m_canModifyStats;
2413 }
2414 void SetCanModifyStats(bool modifyStats)
2415 {
2416 m_canModifyStats = modifyStats;
2417 }
2418 virtual bool UpdateStats(Stats stat) = 0;
2419 virtual bool UpdateAllStats() = 0;
2420 virtual void UpdateResistances(uint32 school) = 0;
2421 virtual void UpdateArmor() = 0;
2422 virtual void UpdateMaxHealth() = 0;
2423 virtual void UpdateMaxPower(Powers power) = 0;
2424 virtual void UpdateAttackPowerAndDamage(bool ranged = false) = 0;
2425 virtual void UpdateDamagePhysical(WeaponAttackType attType) = 0;
2426 float GetTotalAttackPowerValue(WeaponAttackType attType) const;
2427 float GetWeaponDamageRange(WeaponAttackType attType, WeaponDamageRange type) const;
2428 void SetBaseWeaponDamage(WeaponAttackType attType, WeaponDamageRange damageRange, float value)
2429 {
2430 m_weaponDamage[uint8(attType)][uint8(damageRange)] = value;
2431 }
2432
2433 bool isInFrontInMap(Unit const* target, float distance, float arc = M_PI) const;
2434 bool isInBackInMap(Unit const* target, float distance, float arc = M_PI) const;
2435
2436 // Visibility system
2437 bool IsVisible() const;
2438 void SetVisible(bool x);
2439 void ClearPhases(bool update = false);
2440 bool SetPhased(uint32 id, bool update, bool apply) OVERRIDE;
2441 // common function for visibility checks for player/creatures with detection code
2442 void SetPhaseMask(uint32 newPhaseMask, bool update) override;// overwrite WorldObject::SetPhaseMask
2443 void UpdateObjectVisibility(bool forced = true) override;
2444
2447
2448 // Threat related methods
2449 bool CanHaveThreatList() const;
2450 void AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = NULL);
2451 float ApplyTotalThreatModifier(float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL);
2452 void DeleteThreatList();
2453 void TauntApply(Unit* victim);
2454 void TauntFadeOut(Unit* taunter);
2456 {
2457 return m_ThreatManager;
2458 }
2459 void addHatedBy(HostileReference* pHostileReference)
2460 {
2461 m_HostileRefManager.insertFirst(pHostileReference);
2462 };
2463 void removeHatedBy(HostileReference* /*pHostileReference*/)
2464 { /* nothing to do yet */
2465 }
2470
2472 {
2473 return &m_visibleAuras;
2474 }
2476 void SetVisibleAura(uint8 slot, AuraApplication* aur);
2477 void RemoveVisibleAura(uint8 slot);
2478
2480 {
2481 return m_interruptMask;
2482 }
2484 {
2485 m_interruptMask |= mask;
2486 }
2487 void UpdateInterruptMask();
2488 bool HasVisionObscured(Unit const* target) const;
2489
2491 {
2493 }
2494 virtual void SetDisplayId(uint32 modelId);
2499 void RestoreDisplayId();
2501 {
2503 }
2504 void setTransForm(uint32 spellid)
2505 {
2506 m_transform = spellid;
2507 }
2509 {
2510 return m_transform;
2511 }
2512
2513 // DynamicObject management
2514 void _RegisterDynObject(DynamicObject* dynObj);
2515 void _UnregisterDynObject(DynamicObject* dynObj);
2517 void RemoveDynObject(uint32 spellId);
2518 void RemoveAllDynObjects();
2519
2520 GameObject* GetGameObject(uint32 spellId) const;
2521 void AddGameObject(GameObject* gameObj);
2522 void TrackGameObject(GameObject* gameObj);
2523 void RemoveGameObject(GameObject* gameObj, bool del);
2524 void RemoveGameObject(uint32 spellid, bool del);
2525 void RemoveAllGameObjects();
2526
2527 uint32 CalculateDamage(WeaponAttackType attType, bool normalized, bool addTotalPct);
2528 float GetAPMultiplier(WeaponAttackType attType, bool normalized);
2529 void ModifyAuraState(AuraStateType flag, bool apply);
2531 bool HasAuraState(AuraStateType flag, SpellInfo const* spellProto = NULL, Unit const* Caster = NULL) const;
2532 void UnsummonAllTotems();
2533 Unit* GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo);
2534 Unit* GetMeleeHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo = NULL);
2535
2538 uint32 SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1) const;
2539 uint32 SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1) const;
2542 uint32 SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1) const;
2543 uint32 SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1) const;
2544
2545 uint32 MeleeDamageBonusDone(Unit* pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const* spellProto = NULL);
2546 uint32 MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackType attType, SpellInfo const* spellProto = NULL);
2547
2548
2549 bool isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType = WeaponAttackType::BASE_ATTACK);
2550 bool isBlockCritical();
2551 bool isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType = WeaponAttackType::BASE_ATTACK) const;
2552 uint32 SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage, Unit* victim);
2553 uint32 SpellCriticalHealingBonus(SpellInfo const* spellProto, uint32 damage, Unit* victim);
2554
2555 void SetContestedPvP(Player* attackedPlayer = NULL);
2556
2557 uint32 GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const;
2558 float CalculateDefaultCoefficient(SpellInfo const* spellInfo, DamageEffectType damagetype) const;
2559
2560 uint32 GetRemainingPeriodicAmount(uint64 caster, uint32 spellId, AuraType auraType, uint8 effectIndex = 0) const;
2561
2562 void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply);
2563 void ApplySpellDispelImmunity(const SpellInfo* spellProto, DispelType type, bool apply);
2564 virtual bool IsImmunedToSpell(SpellInfo const* spellInfo) const; // redefined in Creature
2565
2568
2569 bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const;
2570 bool IsImmunedToDamage(SpellInfo const* spellInfo) const;
2571 virtual bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const; // redefined in Creature
2572
2573 static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const* spellInfo = NULL, uint8 effIndex = MAX_SPELL_EFFECTS);
2574 uint32 CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType = WeaponAttackType::MAX_ATTACK);
2575 uint32 CalcSpellResistance(Unit* victim, SpellSchoolMask schoolMask, SpellInfo const* spellInfo) const;
2576 void CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, uint32 const damage, uint32* absorb, uint32* resist, SpellInfo const* spellInfo = NULL);
2577 void CalcHealAbsorb(Unit* victim, SpellInfo const* spellInfo, uint32& healAmount, uint32& absorb);
2578
2579 void UpdateSpeed(UnitMoveType mtype, bool forced);
2580 float GetSpeed(UnitMoveType mtype) const;
2581 float GetSpeedRate(UnitMoveType mtype) const
2582 {
2583 return m_speed_rate[mtype];
2584 }
2585 void SetSpeed(UnitMoveType mtype, float rate, bool forced = false);
2586
2587 float ApplyEffectModifiers(SpellInfo const* spellProto, uint8 effect_index, float value) const;
2588 int32 CalculateSpellDamage(Unit const* target, SpellInfo const* spellProto, uint8 effect_index, int32 const* basePoints = NULL) const;
2589 int32 CalcSpellDuration(SpellInfo const* spellProto);
2590 int32 ModSpellDuration(SpellInfo const* spellProto, Unit const* target, int32 duration, bool positive, uint32 effectMask);
2591 void ModSpellCastTime(SpellInfo const* spellProto, int32& castTime, Spell* spell = NULL);
2592 float CalculateLevelPenalty(SpellInfo const* spellProto) const;
2593
2595 {
2596 m_FollowingRefManager.insertFirst(pRef);
2597 }
2599 { /* nothing to do yet */
2600 }
2601 static Unit* GetUnit(WorldObject& object, uint64 guid);
2602 static Player* GetPlayer(WorldObject& object, uint64 guid);
2603 static Creature* GetCreature(WorldObject& object, uint64 guid);
2604
2606 {
2607 return &i_motionMaster;
2608 }
2610 {
2611 return &i_motionMaster;
2612 }
2613
2614 bool IsStopped() const
2615 {
2617 }
2618 void StopMoving();
2619
2621 {
2622 m_movementInfo.AddMovementFlag(f);
2623 }
2625 {
2626 m_movementInfo.RemoveMovementFlag(f);
2627 }
2629 {
2630 return m_movementInfo.HasMovementFlag(f);
2631 }
2633 {
2634 return m_movementInfo.GetMovementFlags();
2635 }
2637 {
2638 m_movementInfo.SetMovementFlags(f);
2639 }
2640
2642 {
2643 m_movementInfo.AddExtraMovementFlag(f);
2644 }
2646 {
2647 m_movementInfo.RemoveExtraMovementFlag(f);
2648 }
2650 {
2651 return m_movementInfo.HasExtraMovementFlag(f);
2652 }
2654 {
2655 return m_movementInfo.GetExtraMovementFlags();
2656 }
2658 {
2659 m_movementInfo.SetExtraMovementFlags(f);
2660 }
2661 bool IsSplineEnabled() const;
2662
2663 float GetPositionZMinusOffset() const;
2664
2665 void SetControlled(bool apply, UnitState state);
2666
2668 {
2669 m_ComboPointHolders.insert(lowguid);
2670 }
2672 {
2673 m_ComboPointHolders.erase(lowguid);
2674 }
2676
2678 void SendPetActionFeedback(uint8 msg) const;
2679 void SendPetTalk(uint32 pettalk) const;
2680 void SendPetAIReaction(ObjectGuid UnitGUID) const;
2682
2687
2688 // reactive attacks
2689 void ClearAllReactives();
2691 {
2693 }
2694 void UpdateReactives(uint32 p_time);
2695
2696 // group updates
2697 void UpdateAuraForGroup(uint8 slot);
2698
2699 // proc trigger system
2700 bool CanProc() const
2701 {
2702 return !m_procDeep;
2703 }
2704 void SetCantProc(bool apply);
2705
2706 // pet auras
2707 typedef std::set<PetAura const*> PetAuraSet;
2709 void AddPetAura(PetAura const* petSpell);
2710 void RemovePetAura(PetAura const* petSpell);
2711
2713 uint32 GetModelForTotem(uint32 totemType) const;
2714
2715 // Redirect Threat
2717 {
2718 _redirectThreadInfo.Set(guid, pct);
2719 }
2721 {
2722 SetRedirectThreat(0, 0);
2723 }
2725 {
2726 _redirectThreadInfo.ModifyThreatPct(amount);
2727 }
2729 {
2730 return _redirectThreadInfo.GetThreatPct();
2731 }
2733
2734 friend class VehicleJoinEvent;
2737 bool CreateVehicleKit(uint32 id, uint32 creatureEntry, bool loading = false);
2738 void RemoveVehicleKit(bool remove = false);
2740 {
2741 return m_vehicleKit;
2742 }
2744 {
2745 return m_vehicle;
2746 }
2747 void SetVehicle(Vehicle* vehicle)
2748 {
2749 m_vehicle = vehicle;
2750 }
2751 bool IsOnVehicle(const Unit* vehicle) const;
2752 Unit* GetVehicleBase() const;
2754 uint64 GetTransGUID() const override;
2757
2759
2760 bool HandleSpellClick(Unit* clicker, int8 seatId = -1);
2761 void EnterVehicle(Unit* base, int8 seatId = -1);
2762 void ExitVehicle(Position const* exitPosition = NULL);
2763 void ChangeSeat(int8 seatId, bool next = true);
2764
2765 // Should only be called by AuraEffect::HandleAuraControlVehicle(AuraApplication const* auraApp, uint8 mode, bool apply) const;
2766 void _ExitVehicle(Position const* exitPosition = NULL);
2767 void _EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp = NULL);
2768
2770
2771 bool isMoving() const
2772 {
2773 return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_MASK_MOVING);
2774 }
2775 bool isTurning() const
2776 {
2777 return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_MASK_TURNING);
2778 }
2779 virtual bool CanFly() const = 0;
2780 bool IsFlying() const
2781 {
2783 }
2784 bool IsFalling() const;
2785
2786 void RewardRage(uint32 baseRage, bool attacker);
2787
2788 virtual float GetFollowAngle() const
2789 {
2790 return static_cast<float>(M_PI / 2);
2791 }
2792
2793 void OutDebugInfo() const;
2794 virtual bool isBeingLoaded() const
2795 {
2796 return false;
2797 }
2799 {
2801 }
2802
2804 {
2805 if (IsPet()) return reinterpret_cast<Pet*>(this); else return NULL;
2806 }
2807 Pet const* ToPet() const
2808 {
2809 if (IsPet()) return reinterpret_cast<Pet const*>(this); else return NULL;
2810 }
2811
2813 {
2814 if (IsTotem()) return reinterpret_cast<Totem*>(this); else return NULL;
2815 }
2816 Totem const* ToTotem() const
2817 {
2818 if (IsTotem()) return reinterpret_cast<Totem const*>(this); else return NULL;
2819 }
2820
2822 {
2823 if (IsSummon()) return reinterpret_cast<TempSummon*>(this); else return NULL;
2824 }
2826 {
2827 if (IsSummon()) return reinterpret_cast<TempSummon const*>(this); else return NULL;
2828 }
2829
2831 {
2833 }
2834 virtual void SetTarget(uint64 /*guid*/) = 0;
2835
2836 // Movement info
2837 std::unique_ptr<Movement::MoveSpline> movespline;
2838
2839 // Part of Evade mechanics
2840 time_t GetLastDamagedTime() const
2841 {
2842 return _lastDamagedTime;
2843 }
2844 void SetLastDamagedTime(time_t val)
2845 {
2846 _lastDamagedTime = val;
2847 }
2848
2850 {
2851 return m_movementCounter;
2852 }
2854 {
2856 }
2858 {
2860 }
2861
2862protected:
2863 explicit Unit(bool isWorldObject);
2864
2865 void BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, Player* target) const override;
2866
2868
2869 void _UpdateSpells(uint32 time);
2870 void _DeleteRemovedAuras();
2871
2873
2875
2877
2879
2882
2884
2886
2887 typedef std::list<DynamicObject*> DynObjectList;
2889
2890 typedef std::list<GameObject*> GameObjectList;
2894
2898
2902 AuraMap::iterator m_auraUpdateIterator;
2904
2906 AuraList m_scAuras; // casted singlecast auras
2907 AuraApplicationList m_interruptableAuras; // auras which have interrupt mask applied on unit
2908 AuraStateAurasMap m_auraStateAuras; // Used for improve performance of aura state checks on aura apply/remove
2910
2915
2917
2920
2921 void SendMissileCancel(uint32 spellId, bool cancel = true);
2922
2924
2926
2929
2931
2934
2937
2938 bool IsAlwaysVisibleFor(WorldObject const* seer) const override;
2939 bool IsAlwaysDetectableFor(WorldObject const* seer) const override;
2940
2941 void DisableSpline();
2942
2943private:
2944 bool IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent);
2945 bool HandleAuraProcOnPowerAmount(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
2946 bool HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
2947 bool HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool* handled);
2948 bool HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
2949 bool HandleOverrideClassScriptAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 cooldown);
2951 bool HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura);
2952
2953 void UpdateSplineMovement(uint32 t_diff);
2954 void UpdateSplinePosition();
2955
2956 // player or player's pet
2957 float GetCombatRatingReduction(CombatRating cr) const;
2958 uint32 GetCombatRatingDamageReduction(CombatRating cr, float rate, float cap, uint32 damage) const;
2959
2960protected:
2961 void SetFeared(bool apply);
2962 void SetConfused(bool apply);
2963 void SetStunned(bool apply);
2964 void SetRooted(bool apply, bool packetOnly = false);
2965
2967
2968private:
2969 uint32 m_state; // Even derived shouldn't modify
2972
2974 // Manage all Units that are threatened by us
2976
2978
2980
2982
2983 bool m_cleanupDone; // lock made to not add stuff after cleanup before delete
2984 bool m_duringRemoveFromWorld; // lock made to not add stuff after begining removing from world
2985
2986 bool _isWalkingBeforeCharm; // Are we walking before we were charmed?
2987
2988 time_t _lastDamagedTime; // Part of Evade mechanics
2989};
2990
2991namespace Skyfire
2992{
2993 // Binary predicate for sorting Units based on percent value of a power
2995 {
2996 public:
2997 PowerPctOrderPred(Powers power, bool ascending = true) : m_power(power), m_ascending(ascending)
2998 { }
2999 bool operator() (const Unit* a, const Unit* b) const
3000 {
3001 float rA = a->GetMaxPower(m_power) ? float(a->GetPower(m_power)) / float(a->GetMaxPower(m_power)) : 0.0f;
3002 float rB = b->GetMaxPower(m_power) ? float(b->GetPower(m_power)) / float(b->GetMaxPower(m_power)) : 0.0f;
3003 return m_ascending ? rA < rB : rA > rB;
3004 }
3005 private:
3007 const bool m_ascending;
3008 };
3009
3010 // Binary predicate for sorting Units based on percent value of health
3012 {
3013 public:
3014 HealthPctOrderPred(bool ascending = true) : m_ascending(ascending)
3015 { }
3016 bool operator() (const Unit* a, const Unit* b) const
3017 {
3018 float rA = a->GetMaxHealth() ? float(a->GetHealth()) / float(a->GetMaxHealth()) : 0.0f;
3019 float rB = b->GetMaxHealth() ? float(b->GetHealth()) / float(b->GetMaxHealth()) : 0.0f;
3020 return m_ascending ? rA < rB : rA > rB;
3021 }
3022 private:
3023 const bool m_ascending;
3024 };
3025}
3026#endif
#define M_PI
Definition Common.h:192
#define MAX_SPELL_EFFECTS
std::int32_t int32
Definition Define.h:73
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
std::int8_t int8
Definition Define.h:75
#define OVERRIDE
Definition Define.h:60
std::uint64_t uint64
Definition Define.h:76
std::int64_t int64
Definition Define.h:72
std::uint16_t uint16
Definition Define.h:78
#define NOMINAL_MELEE_RANGE
Definition Object.h:32
#define MELEE_RANGE
Definition Object.h:33
bool IS_PLAYER_GUID(uint64 guid)
#define MAX_STATS
Powers
@ POWER_ECLIPSE
DiminishingGroup
SpellSchools
@ SPELL_SCHOOL_NORMAL
SpellFamilyNames
ReputationRank
DiminishingLevels
SpellMissInfo
AuraStateType
Stats
#define MAX_SPELL_SCHOOL
DispelType
#define MAX_SPELL_IMMUNITY
SpellSchoolMask
@ SPELL_SCHOOL_MASK_NORMAL
@ SPELL_SCHOOL_MASK_NONE
@ TOTAL_AURAS
@ SPELL_AURA_MOD_FEAR
@ SPELL_AURA_MOD_INVISIBILITY
@ SPELL_AURA_MOD_ROOT
@ SPELL_AURA_MOD_STEALTH
float baseMoveSpeed[MAX_MOVE_TYPE]
Definition Unit.cpp:56
float playerBaseMoveSpeed[MAX_MOVE_TYPE]
Definition Unit.cpp:69
SpellChannelInterruptFlags
Definition Unit.h:34
@ CHANNEL_FLAG_DELAY
Definition Unit.h:36
@ CHANNEL_INTERRUPT_FLAG_INTERRUPT
Definition Unit.h:35
NPCFlags
Non Player Character flags.
Definition Unit.h:685
@ UNIT_NPC_FLAG_REFORGER
Definition Unit.h:713
@ UNIT_NPC_FLAG_WILDPET_CAPTURABLE
Definition Unit.h:716
@ UNIT_NPC_FLAG_VENDOR_AMMO
Definition Unit.h:695
@ UNIT_NPC_FLAG_TABARDDESIGNER
Definition Unit.h:706
@ UNIT_NPC_FLAG_BANKER
Definition Unit.h:704
@ UNIT_NPC_FLAG_AUCTIONEER
Definition Unit.h:708
@ UNIT_NPC_FLAG_UNK2
Definition Unit.h:690
@ UNIT_NPC_FLAG_VENDOR_POISON
Definition Unit.h:697
@ UNIT_NPC_FLAG_GUILD_BANKER
Definition Unit.h:710
@ UNIT_NPC_FLAG_VENDOR
Definition Unit.h:694
@ UNIT_NPC_FLAG_STABLEMASTER
Definition Unit.h:709
@ UNIT_NPC_FLAG_VENDOR_REAGENT
Definition Unit.h:698
@ UNIT_NPC_FLAG_GOSSIP
Definition Unit.h:687
@ UNIT_NPC_FLAG_NONE
Definition Unit.h:686
@ UNIT_NPC_FLAG_BATTLEMASTER
Definition Unit.h:707
@ UNIT_NPC_FLAG_VENDOR_FOOD
Definition Unit.h:696
@ UNIT_NPC_FLAG_QUESTGIVER
Definition Unit.h:688
@ UNIT_NPC_FLAG_INNKEEPER
Definition Unit.h:703
@ UNIT_NPC_FLAG_SPELLCLICK
Definition Unit.h:711
@ UNIT_NPC_FLAG_UNK1
Definition Unit.h:689
@ UNIT_NPC_FLAG_TRANSMOGRIFIER
Definition Unit.h:714
@ UNIT_NPC_FLAG_PLAYER_VEHICLE
Definition Unit.h:712
@ UNIT_NPC_FLAG_BMAH
Definition Unit.h:717
@ UNIT_NPC_FLAG_FLIGHTMASTER
Definition Unit.h:700
@ UNIT_NPC_FLAG_TRAINER_CLASS
Definition Unit.h:692
@ UNIT_NPC_FLAG_VAULTKEEPER
Definition Unit.h:715
@ UNIT_NPC_FLAG_TRAINER_PROFESSION
Definition Unit.h:693
@ UNIT_NPC_FLAG_REPAIR
Definition Unit.h:699
@ UNIT_NPC_FLAG_TRAINER
Definition Unit.h:691
@ UNIT_NPC_FLAG_PETITIONER
Definition Unit.h:705
@ UNIT_NPC_FLAG_SPIRITGUIDE
Definition Unit.h:702
@ UNIT_NPC_FLAG_SPIRITHEALER
Definition Unit.h:701
SpellAuraInterruptFlags
Definition Unit.h:40
@ AURA_INTERRUPT_FLAG_TAKE_DAMAGE
Definition Unit.h:42
@ AURA_INTERRUPT_FLAG_SPELL_ATTACK
Definition Unit.h:54
@ AURA_INTERRUPT_FLAG_TELEPORTED
Definition Unit.h:63
@ AURA_INTERRUPT_FLAG_CAST
Definition Unit.h:43
@ AURA_INTERRUPT_FLAG_NOT_SHEATHED
Definition Unit.h:50
@ AURA_INTERRUPT_FLAG_UNK21
Definition Unit.h:62
@ AURA_INTERRUPT_FLAG_NOT_VICTIM
Definition Unit.h:68
@ AURA_INTERRUPT_FLAG_DIRECT_DAMAGE
Definition Unit.h:65
@ AURA_INTERRUPT_FLAG_UNK14
Definition Unit.h:55
@ AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION
Definition Unit.h:61
@ AURA_INTERRUPT_FLAG_USE
Definition Unit.h:52
@ AURA_INTERRUPT_FLAG_TALK
Definition Unit.h:51
@ AURA_INTERRUPT_FLAG_HITBYSPELL
Definition Unit.h:41
@ AURA_INTERRUPT_FLAG_MOVE
Definition Unit.h:44
@ AURA_INTERRUPT_FLAG_TURNING
Definition Unit.h:45
@ AURA_INTERRUPT_FLAG_JUMP
Definition Unit.h:46
@ AURA_INTERRUPT_FLAG_NOT_ABOVEWATER
Definition Unit.h:48
@ AURA_INTERRUPT_FLAG_NOT_SEATED
Definition Unit.h:59
@ AURA_INTERRUPT_FLAG_NOT_UNDERWATER
Definition Unit.h:49
@ AURA_INTERRUPT_FLAG_MELEE_ATTACK
Definition Unit.h:53
@ AURA_INTERRUPT_FLAG_TRANSFORM
Definition Unit.h:56
@ AURA_INTERRUPT_FLAG_UNK16
Definition Unit.h:57
@ AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT
Definition Unit.h:64
@ AURA_INTERRUPT_FLAG_CHANGE_MAP
Definition Unit.h:60
@ AURA_INTERRUPT_FLAG_MOUNT
Definition Unit.h:58
@ AURA_INTERRUPT_FLAG_LANDING
Definition Unit.h:66
@ AURA_INTERRUPT_FLAG_NOT_MOUNTED
Definition Unit.h:47
MovementFlags
Definition Unit.h:721
@ MOVEMENTFLAG_MASK_PLAYER_ONLY
Definition Unit.h:773
@ MOVEMENTFLAG_DESCENDING
Definition Unit.h:745
@ MOVEMENTFLAG_MASK_CREATURE_ALLOWED
Definition Unit.h:768
@ MOVEMENTFLAG_PITCH_DOWN
Definition Unit.h:730
@ MOVEMENTFLAG_PENDING_STRAFE_STOP
Definition Unit.h:737
@ MOVEMENTFLAG_PITCH_UP
Definition Unit.h:729
@ MOVEMENTFLAG_RIGHT
Definition Unit.h:728
@ MOVEMENTFLAG_PENDING_STOP
Definition Unit.h:736
@ MOVEMENTFLAG_FORWARD
Definition Unit.h:723
@ MOVEMENTFLAG_PENDING_STRAFE_LEFT
Definition Unit.h:740
@ MOVEMENTFLAG_NONE
Definition Unit.h:722
@ MOVEMENTFLAG_STRAFE_LEFT
Definition Unit.h:725
@ MOVEMENTFLAG_BACKWARD
Definition Unit.h:724
@ MOVEMENTFLAG_WATERWALKING
Definition Unit.h:749
@ MOVEMENTFLAG_MASK_MOVING
Definition Unit.h:755
@ MOVEMENTFLAG_DISABLE_GRAVITY
Definition Unit.h:732
@ MOVEMENTFLAG_PENDING_BACKWARD
Definition Unit.h:739
@ MOVEMENTFLAG_FLYING
Definition Unit.h:747
@ MOVEMENTFLAG_FALLING_SLOW
Definition Unit.h:750
@ MOVEMENTFLAG_PENDING_STRAFE_RIGHT
Definition Unit.h:741
@ MOVEMENTFLAG_CAN_FLY
Definition Unit.h:746
@ MOVEMENTFLAG_ROOT
Definition Unit.h:733
@ MOVEMENTFLAG_MASK_TURNING
Definition Unit.h:760
@ MOVEMENTFLAG_FALLING
Definition Unit.h:734
@ MOVEMENTFLAG_LEFT
Definition Unit.h:727
@ MOVEMENTFLAG_MASK_MOVING_FLY
Definition Unit.h:763
@ MOVEMENTFLAG_STRAFE_RIGHT
Definition Unit.h:726
@ MOVEMENTFLAG_FALLING_FAR
Definition Unit.h:735
@ MOVEMENTFLAG_MASK_HAS_PLAYER_STATUS_OPCODE
Movement flags that have change status opcodes associated for players.
Definition Unit.h:777
@ MOVEMENTFLAG_SWIMMING
Definition Unit.h:743
@ MOVEMENTFLAG_ASCENDING
Definition Unit.h:744
@ MOVEMENTFLAG_PENDING_FORWARD
Definition Unit.h:738
@ MOVEMENTFLAG_HOVER
Definition Unit.h:751
@ MOVEMENTFLAG_SPLINE_ELEVATION
Definition Unit.h:748
@ MOVEMENTFLAG_PENDING_ROOT
Definition Unit.h:742
@ MOVEMENTFLAG_WALKING
Definition Unit.h:731
@ MOVEMENTFLAG_DISABLE_COLLISION
Definition Unit.h:752
UnitRename
Definition Unit.h:267
@ UNIT_CAN_BE_RENAMED
Definition Unit.h:268
@ UNIT_CAN_BE_ABANDONED
Definition Unit.h:269
UnitTypeMask
Definition Unit.h:803
@ UNIT_MASK_NONE
Definition Unit.h:804
@ UNIT_MASK_PUPPET
Definition Unit.h:811
@ UNIT_MASK_CONTROLABLE_GUARDIAN
Definition Unit.h:813
@ UNIT_MASK_HUNTER_PET
Definition Unit.h:812
@ UNIT_MASK_TOTEM
Definition Unit.h:808
@ UNIT_MASK_ACCESSORY
Definition Unit.h:814
@ UNIT_MASK_SUMMON
Definition Unit.h:805
@ UNIT_MASK_VEHICLE
Definition Unit.h:810
@ UNIT_MASK_GUARDIAN
Definition Unit.h:807
@ UNIT_MASK_MINION
Definition Unit.h:806
@ UNIT_MASK_PET
Definition Unit.h:809
BaseModType
Definition Unit.h:495
@ FLAT_MOD
Definition Unit.h:496
@ MOD_END
Definition Unit.h:498
@ PCT_MOD
Definition Unit.h:497
UnitActionBarEntry CharmSpellInfo
Definition Unit.h:1223
#define MAX_UNIT_ACTION_BAR_INDEX
Definition Unit.h:1233
DamageTypeToSchool
Definition Unit.h:398
@ RESISTANCE
Definition Unit.h:399
@ DAMAGE_DEALT
Definition Unit.h:400
@ DAMAGE_TAKEN
Definition Unit.h:401
WeaponAttackType
Definition Unit.h:572
VictimState
Definition Unit.h:289
@ VICTIMSTATE_DODGE
Definition Unit.h:292
@ VICTIMSTATE_BLOCK
Definition Unit.h:295
@ VICTIMSTATE_MISS
Definition Unit.h:290
@ VICTIMSTATE_EVADE
Definition Unit.h:296
@ VICTIMSTATE_INTERRUPT
Definition Unit.h:294
@ VICTIMSTATE_WOUND
Definition Unit.h:291
@ VICTIMSTATE_DEFLECT
Definition Unit.h:298
@ VICTIMSTATE_PARRY
Definition Unit.h:293
@ VICTIMSTATE_IMMUNE
Definition Unit.h:297
#define UNIT_ACTION_BUTTON_ACTION(X)
Definition Unit.h:1171
SpellModOp
Definition Unit.h:72
@ SPELLMOD_RANGE
Definition Unit.h:78
@ SPELLMOD_EFFECT2
Definition Unit.h:85
@ SPELLMOD_DAMAGE
Definition Unit.h:73
@ SPELLMOD_CHANCE_OF_SUCCESS
Definition Unit.h:91
@ SPELLMOD_CRIT_DAMAGE_BONUS
Definition Unit.h:88
@ SPELLMOD_DOT
Definition Unit.h:95
@ SPELLMOD_NOT_LOSE_CASTING_TIME
Definition Unit.h:82
@ SPELLMOD_EFFECT5
Definition Unit.h:106
@ SPELLMOD_ALL_EFFECTS
Definition Unit.h:81
@ SPELLMOD_CHARGES2
Definition Unit.h:104
@ SPELLMOD_CRITICAL_CHANCE
Definition Unit.h:80
@ SPELLMOD_CRIT_DAMAGE_BONUS_2
Definition Unit.h:102
@ SPELLMOD_BONUS_MULTIPLIER
Definition Unit.h:97
@ SPELLMOD_EFFECT3
Definition Unit.h:96
@ SPELLMOD_SPELL_COST_REFUND_ON_FAIL
Definition Unit.h:103
@ SPELLMOD_VALUE_MULTIPLIER
Definition Unit.h:100
@ SPELLMOD_DAMAGE_MULTIPLIER
Definition Unit.h:93
@ SPELLMOD_GLOBAL_COOLDOWN
Definition Unit.h:94
@ SPELLMOD_PROC_PER_MINUTE
Definition Unit.h:99
@ SPELLMOD_THREAT
Definition Unit.h:75
@ SPELLMOD_UNK_35
Definition Unit.h:107
@ SPELLMOD_EFFECT4
Definition Unit.h:105
@ SPELLMOD_IGNORE_ARMOR
Definition Unit.h:86
@ SPELLMOD_ACTIVATION_TIME
Definition Unit.h:92
@ SPELLMOD_COOLDOWN
Definition Unit.h:84
@ SPELLMOD_EFFECT1
Definition Unit.h:76
@ SPELLMOD_DURATION
Definition Unit.h:74
@ SPELLMOD_JUMP_TARGETS
Definition Unit.h:90
@ SPELLMOD_CASTING_TIME
Definition Unit.h:83
@ SPELLMOD_CHARGES
Definition Unit.h:77
@ SPELLMOD_RADIUS
Definition Unit.h:79
@ SPELLMOD_COST
Definition Unit.h:87
@ SPELLMOD_RESIST_MISS_CHANCE
Definition Unit.h:89
@ SPELLMOD_RESIST_DISPEL_CHANCE
Definition Unit.h:101
WeaponDamageRange
Definition Unit.h:392
SpellValueMod
Definition Unit.h:113
@ SPELLVALUE_AURA_STACK
Definition Unit.h:119
@ SPELLVALUE_BASE_POINT1
Definition Unit.h:115
@ SPELLVALUE_RADIUS_MOD
Definition Unit.h:117
@ SPELLVALUE_MAX_TARGETS
Definition Unit.h:118
@ SPELLVALUE_BASE_POINT2
Definition Unit.h:116
@ SPELLVALUE_BASE_POINT0
Definition Unit.h:114
UnitMods
Definition Unit.h:439
@ UNIT_MOD_DAMAGE_OFFHAND
Definition Unit.h:473
@ UNIT_MOD_RUNE
Definition Unit.h:451
@ UNIT_MOD_STAT_INTELLECT
Definition Unit.h:443
@ UNIT_MOD_POWER_END
Definition Unit.h:482
@ UNIT_MOD_STAT_SPIRIT
Definition Unit.h:444
@ UNIT_MOD_ARMOR
Definition Unit.h:463
@ UNIT_MOD_RESISTANCE_SHADOW
Definition Unit.h:468
@ UNIT_MOD_RESISTANCE_FROST
Definition Unit.h:467
@ UNIT_MOD_END
Definition Unit.h:475
@ UNIT_MOD_ATTACK_POWER
Definition Unit.h:470
@ UNIT_MOD_STAT_END
Definition Unit.h:478
@ UNIT_MOD_RESISTANCE_HOLY
Definition Unit.h:464
@ UNIT_MOD_ALTERNATE_POWER
Definition Unit.h:456
@ UNIT_MOD_RESISTANCE_START
Definition Unit.h:479
@ UNIT_MOD_SOUL_SHARDS
Definition Unit.h:453
@ UNIT_MOD_RESISTANCE_ARCANE
Definition Unit.h:469
@ UNIT_MOD_ARCANE_CHARGES
Definition Unit.h:462
@ UNIT_MOD_ECLIPSE
Definition Unit.h:454
@ UNIT_MOD_ENERGY
Definition Unit.h:449
@ UNIT_MOD_HEALTH
Definition Unit.h:445
@ UNIT_MOD_DAMAGE_RANGED
Definition Unit.h:474
@ UNIT_MOD_HOLY_POWER
Definition Unit.h:455
@ UNIT_MOD_BURNING_EMBERS
Definition Unit.h:460
@ UNIT_MOD_POWER_START
Definition Unit.h:481
@ UNIT_MOD_CHI
Definition Unit.h:458
@ UNIT_MOD_RESISTANCE_FIRE
Definition Unit.h:465
@ UNIT_MOD_STAT_STRENGTH
Definition Unit.h:440
@ UNIT_MOD_RESISTANCE_NATURE
Definition Unit.h:466
@ UNIT_MOD_DEMONIC_FURY
Definition Unit.h:461
@ UNIT_MOD_STAT_AGILITY
Definition Unit.h:441
@ UNIT_MOD_RESISTANCE_END
Definition Unit.h:480
@ UNIT_MOD_FOCUS
Definition Unit.h:448
@ UNIT_MOD_DARK_FORCE
Definition Unit.h:457
@ UNIT_MOD_DAMAGE_MAINHAND
Definition Unit.h:472
@ UNIT_MOD_SHADOW_ORBS
Definition Unit.h:459
@ UNIT_MOD_UNUSED
Definition Unit.h:450
@ UNIT_MOD_MANA
Definition Unit.h:446
@ UNIT_MOD_STAT_START
Definition Unit.h:477
@ UNIT_MOD_RAGE
Definition Unit.h:447
@ UNIT_MOD_STAT_STAMINA
Definition Unit.h:442
@ UNIT_MOD_RUNIC_POWER
Definition Unit.h:452
@ UNIT_MOD_ATTACK_POWER_RANGED
Definition Unit.h:471
HitInfo
Definition Unit.h:302
@ HITINFO_PARTIAL_ABSORB
Definition Unit.h:310
@ HITINFO_UNK26
Definition Unit.h:330
@ HITINFO_UNK2
Definition Unit.h:307
@ HITINFO_FULL_RESIST
Definition Unit.h:311
@ HITINFO_NORMALSWING
Definition Unit.h:303
@ HITINFO_BLOCK
Definition Unit.h:317
@ HITINFO_CRUSHING
Definition Unit.h:321
@ HITINFO_FAKE_DAMAGE
Definition Unit.h:328
@ HITINFO_SWINGNOHITSOUND
Definition Unit.h:325
@ HITINFO_UNK12
Definition Unit.h:316
@ HITINFO_MISS
Definition Unit.h:308
@ HITINFO_RAGE_GAIN
Definition Unit.h:327
@ HITINFO_FULL_ABSORB
Definition Unit.h:309
@ HITINFO_NO_ANIMATION
Definition Unit.h:322
@ HITINFO_UNK25
Definition Unit.h:329
@ HITINFO_OFFHAND
Definition Unit.h:306
@ HITINFO_UNK1
Definition Unit.h:304
@ HITINFO_GLANCING
Definition Unit.h:320
@ HITINFO_CRITICALHIT
Definition Unit.h:313
@ HITINFO_PARTIAL_RESIST
Definition Unit.h:312
@ HITINFO_AFFECTS_VICTIM
Definition Unit.h:305
ActionBarIndex
Definition Unit.h:1226
@ ACTION_BAR_INDEX_PET_SPELL_START
Definition Unit.h:1228
@ ACTION_BAR_INDEX_PET_SPELL_END
Definition Unit.h:1229
@ ACTION_BAR_INDEX_END
Definition Unit.h:1230
@ ACTION_BAR_INDEX_START
Definition Unit.h:1227
UnitBytes1_Flags
Definition Unit.h:187
@ UNIT_BYTE1_FLAG_HOVER
Definition Unit.h:189
@ UNIT_BYTE1_FLAG_ALL
Definition Unit.h:191
@ UNIT_BYTE1_FLAG_ALWAYS_STAND
Definition Unit.h:188
@ UNIT_BYTE1_FLAG_UNK_3
Definition Unit.h:190
DeathState
Definition Unit.h:502
@ ALIVE
Definition Unit.h:503
@ JUST_DIED
Definition Unit.h:504
@ JUST_RESPAWNED
Definition Unit.h:507
@ CORPSE
Definition Unit.h:505
UNORDERED_MAP< uint32, GlobalCooldown > GlobalCooldownList
Definition Unit.h:1126
std::list< Player * > SharedVisionList
Definition Unit.h:1213
#define MAX_MOVE_TYPE
Definition Unit.h:566
CommandStates
Definition Unit.h:1163
@ COMMAND_ATTACK
Definition Unit.h:1166
@ COMMAND_MOVE_TO
Definition Unit.h:1168
@ COMMAND_ABANDON
Definition Unit.h:1167
@ COMMAND_STAY
Definition Unit.h:1164
@ COMMAND_FOLLOW
Definition Unit.h:1165
UnitStandStateType
Definition Unit.h:161
@ UNIT_STAND_STATE_SLEEP
Definition Unit.h:165
@ UNIT_STAND_STATE_SIT_HIGH_CHAIR
Definition Unit.h:168
@ UNIT_STAND_STATE_SUBMERGED
Definition Unit.h:171
@ UNIT_STAND_STATE_SIT_MEDIUM_CHAIR
Definition Unit.h:167
@ UNIT_STAND_STATE_SIT_LOW_CHAIR
Definition Unit.h:166
@ UNIT_STAND_STATE_DEAD
Definition Unit.h:169
@ UNIT_STAND_STATE_KNEEL
Definition Unit.h:170
@ UNIT_STAND_STATE_SIT_CHAIR
Definition Unit.h:164
@ UNIT_STAND_STATE_STAND
Definition Unit.h:162
@ UNIT_STAND_STATE_SIT
Definition Unit.h:163
#define MAX_SUMMON_SLOT
Definition Unit.h:1344
Swing
Definition Unit.h:282
@ SINGLEHANDEDSWING
Definition Unit.h:284
@ NOSWING
Definition Unit.h:283
@ TWOHANDEDSWING
Definition Unit.h:285
UnitStandFlags
Definition Unit.h:176
@ UNIT_STAND_FLAGS_UNK4
Definition Unit.h:180
@ UNIT_STAND_FLAGS_UNK5
Definition Unit.h:181
@ UNIT_STAND_FLAGS_ALL
Definition Unit.h:182
@ UNIT_STAND_FLAGS_UNK1
Definition Unit.h:177
@ UNIT_STAND_FLAGS_CREEP
Definition Unit.h:178
@ UNIT_STAND_FLAGS_UNTRACKABLE
Definition Unit.h:179
#define MAX_DECLINED_NAME_CASES
Definition Unit.h:1098
BaseModGroup
Definition Unit.h:486
@ OFFHAND_CRIT_PERCENTAGE
Definition Unit.h:489
@ BASEMOD_END
Definition Unit.h:491
@ SHIELD_BLOCK_VALUE
Definition Unit.h:490
@ CRIT_PERCENTAGE
Definition Unit.h:487
@ RANGED_CRIT_PERCENTAGE
Definition Unit.h:488
AuraRemoveMode
Definition Unit.h:405
@ AURA_REMOVE_BY_CANCEL
Definition Unit.h:408
@ AURA_REMOVE_NONE
Definition Unit.h:406
@ AURA_REMOVE_BY_DEFAULT
Definition Unit.h:407
@ AURA_REMOVE_BY_DEATH
Definition Unit.h:411
@ AURA_REMOVE_BY_EXPIRE
Definition Unit.h:410
@ AURA_REMOVE_BY_ENEMY_SPELL
Definition Unit.h:409
TriggerCastFlags
Definition Unit.h:415
@ TRIGGERED_IGNORE_EQUIPPED_ITEM_REQUIREMENT
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
Definition Unit.h:433
@ TRIGGERED_FULL_MASK
Will ignore most target checks (mostly DBC target checks).
Definition Unit.h:435
@ TRIGGERED_IGNORE_POWER_AND_REAGENT_COST
Will ignore Spell and Category cooldowns.
Definition Unit.h:419
@ TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD
Will ignore GCD.
Definition Unit.h:418
@ TRIGGERED_CAST_DIRECTLY
Will ignore combo point requirement.
Definition Unit.h:424
@ TRIGGERED_IGNORE_TARGET_CHECK
Will ignore equipped item requirements.
Definition Unit.h:434
@ TRIGGERED_IGNORE_CASTER_AURASTATE
Will ignore shapeshift checks.
Definition Unit.h:428
@ TRIGGERED_IGNORE_AURA_SCALING
Will not take away cast item or update related achievement criteria.
Definition Unit.h:421
@ TRIGGERED_IGNORE_CAST_IN_PROGRESS
Will ignore aura scaling.
Definition Unit.h:422
@ TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE
Will ignore caster aura states including combat requirements and death state.
Definition Unit.h:429
@ TRIGGERED_IGNORE_SHAPESHIFT
Will not adjust facing to target (if any).
Definition Unit.h:427
@ TRIGGERED_IGNORE_AURA_INTERRUPT_FLAGS
In Spell::prepare, will be cast directly without setting containers for executed spell.
Definition Unit.h:425
@ TRIGGERED_IGNORE_CAST_ITEM
Will ignore power and reagent cost.
Definition Unit.h:420
@ TRIGGERED_IGNORE_COMBO_POINTS
Will not check if a current cast is in progress.
Definition Unit.h:423
@ TRIGGERED_IGNORE_GCD
Not triggered.
Definition Unit.h:417
@ TRIGGERED_DISALLOW_PROC_EVENTS
Will ignore caster aura restrictions or requirements.
Definition Unit.h:431
@ TRIGGERED_IGNORE_CASTER_AURAS
Will ignore mounted/on vehicle restrictions.
Definition Unit.h:430
@ TRIGGERED_DONT_REPORT_CAST_ERROR
Disallows proc events from triggered spell (default).
Definition Unit.h:432
@ TRIGGERED_NONE
Definition Unit.h:416
@ TRIGGERED_IGNORE_SET_FACING
Will ignore interruptible aura's at cast.
Definition Unit.h:426
UnitModifierType
Definition Unit.h:383
@ MODIFIER_TYPE_END
Definition Unit.h:388
@ BASE_VALUE
Definition Unit.h:384
@ TOTAL_VALUE
Definition Unit.h:386
@ TOTAL_PCT
Definition Unit.h:387
@ BASE_PCT
Definition Unit.h:385
#define MAKE_UNIT_ACTION_BUTTON(A, T)
Definition Unit.h:1173
#define CURRENT_MAX_SPELL
Definition Unit.h:1115
CombatRating
Definition Unit.h:580
@ CR_CRIT_SPELL
Definition Unit.h:591
@ CR_ARMOR_PENETRATION
Definition Unit.h:605
@ CR_RESILIENCE_CRIT_TAKEN
Definition Unit.h:595
@ CR_PVP_POWER
Definition Unit.h:607
@ CR_EXPERTISE
Definition Unit.h:604
@ CR_WEAPON_SKILL_OFFHAND
Definition Unit.h:602
@ CR_HIT_TAKEN_SPELL
Definition Unit.h:594
@ CR_HIT_MELEE
Definition Unit.h:586
@ CR_HIT_TAKEN_RANGED
Definition Unit.h:593
@ CR_HIT_SPELL
Definition Unit.h:588
@ CR_CRIT_TAKEN_SPELL
Definition Unit.h:597
@ CR_HIT_TAKEN_MELEE
Definition Unit.h:592
@ CR_WEAPON_SKILL
Definition Unit.h:581
@ CR_HIT_RANGED
Definition Unit.h:587
@ CR_WEAPON_SKILL_MAINHAND
Definition Unit.h:601
@ CR_HASTE_MELEE
Definition Unit.h:598
@ CR_WEAPON_SKILL_RANGED
Definition Unit.h:603
@ CR_HASTE_RANGED
Definition Unit.h:599
@ CR_CRIT_MELEE
Definition Unit.h:589
@ CR_CRIT_RANGED
Definition Unit.h:590
@ CR_DEFENSE_SKILL
Definition Unit.h:582
@ CR_HASTE_SPELL
Definition Unit.h:600
@ CR_RESILIENCE_PLAYER_DAMAGE_TAKEN
Definition Unit.h:596
@ CR_MASTERY
Definition Unit.h:606
InventorySlot
Definition Unit.h:335
@ NULL_BAG
Definition Unit.h:336
@ NULL_SLOT
Definition Unit.h:337
#define UNIT_ACTION_BUTTON_TYPE(X)
Definition Unit.h:1172
ShapeshiftForm
Definition Unit.h:206
@ FORM_FIERCE_TIGER
Definition Unit.h:231
@ FORM_DIREBEAR
Definition Unit.h:215
@ FORM_UNDEAD
Definition Unit.h:232
@ FORM_TRAVEL
Definition Unit.h:210
@ FORM_CREATUREBEAR
Definition Unit.h:221
@ FORM_SHADOW
Definition Unit.h:235
@ FORM_SHADOW_DANCE
Definition Unit.h:220
@ FORM_SPIRITOFREDEMPTION
Definition Unit.h:239
@ FORM_BERSERKERSTANCE
Definition Unit.h:226
@ FORM_MASTER_ANGLER
Definition Unit.h:233
@ FORM_DEFENSIVESTANCE
Definition Unit.h:225
@ FORM_THARONJA_SKELETON
Definition Unit.h:217
@ FORM_FLIGHT_EPIC
Definition Unit.h:234
@ FORM_STEVES_GHOUL
Definition Unit.h:216
@ FORM_MOONKIN
Definition Unit.h:238
@ FORM_NONE
Definition Unit.h:207
@ FORM_CREATURECAT
Definition Unit.h:222
@ FORM_CAT
Definition Unit.h:208
@ FORM_FLIGHT
Definition Unit.h:236
@ FORM_ZOMBIE
Definition Unit.h:228
@ FORM_GHOSTWOLF
Definition Unit.h:223
@ FORM_AMBIENT
Definition Unit.h:213
@ FORM_AQUA
Definition Unit.h:211
@ FORM_STEALTH
Definition Unit.h:237
@ FORM_BATTLESTANCE
Definition Unit.h:224
@ FORM_BLB_PLAYER
Definition Unit.h:219
@ FORM_METAMORPHOSIS
Definition Unit.h:229
@ FORM_GHOUL
Definition Unit.h:214
@ FORM_TREE
Definition Unit.h:209
@ FORM_TEST_OF_STRENGTH
Definition Unit.h:218
@ FORM_STURDY_OX
Definition Unit.h:230
@ FORM_WISE_SERPENT
Definition Unit.h:227
@ FORM_BEAR
Definition Unit.h:212
CharmType
Definition Unit.h:1216
@ CHARM_TYPE_CHARM
Definition Unit.h:1217
@ CHARM_TYPE_POSSESS
Definition Unit.h:1218
@ CHARM_TYPE_CONVERT
Definition Unit.h:1220
@ CHARM_TYPE_VEHICLE
Definition Unit.h:1219
CurrentSpellTypes
Definition Unit.h:1107
@ CURRENT_CHANNELED_SPELL
Definition Unit.h:1110
@ CURRENT_GENERIC_SPELL
Definition Unit.h:1109
@ CURRENT_MELEE_SPELL
Definition Unit.h:1108
@ CURRENT_AUTOREPEAT_SPELL
Definition Unit.h:1111
SheathState
Definition Unit.h:244
@ SHEATH_STATE_UNARMED
Definition Unit.h:245
@ SHEATH_STATE_MELEE
Definition Unit.h:246
@ SHEATH_STATE_RANGED
Definition Unit.h:247
MeleeHitOutcome
Definition Unit.h:828
@ MELEE_HIT_NORMAL
Definition Unit.h:830
@ MELEE_HIT_CRUSHING
Definition Unit.h:830
@ MELEE_HIT_PARRY
Definition Unit.h:829
@ MELEE_HIT_DODGE
Definition Unit.h:829
@ MELEE_HIT_EVADE
Definition Unit.h:829
@ MELEE_HIT_BLOCK
Definition Unit.h:829
@ MELEE_HIT_GLANCING
Definition Unit.h:830
SpellInterruptFlags
Definition Unit.h:23
@ SPELL_INTERRUPT_FLAG_UNK3
Definition Unit.h:26
@ SPELL_INTERRUPT_FLAG_ABORT_ON_DMG
Definition Unit.h:28
@ SPELL_INTERRUPT_FLAG_PUSH_BACK
Definition Unit.h:25
@ SPELL_INTERRUPT_FLAG_INTERRUPT
Definition Unit.h:27
@ SPELL_INTERRUPT_FLAG_MOVEMENT
Definition Unit.h:24
std::list< Unit * > UnitList
Definition Unit.h:370
#define REACTIVE_TIMER_START
Definition Unit.h:1329
ReactiveType
Definition Unit.h:1332
@ REACTIVE_OVERPOWER
Definition Unit.h:1335
@ REACTIVE_DEFENSE
Definition Unit.h:1333
@ REACTIVE_HUNTER_PARRY
Definition Unit.h:1334
std::list< std::pair< Aura *, uint8 > > DispelChargesList
Definition Unit.h:371
SpellFacingFlags
Definition Unit.h:151
@ SPELL_FACING_FLAG_INFRONT
Definition Unit.h:152
MovementFlags2
Definition Unit.h:782
@ MOVEMENTFLAG2_UNK8
Definition Unit.h:792
@ MOVEMENTFLAG2_CAN_SWIM_TO_FLY_TRANS
Definition Unit.h:794
@ MOVEMENTFLAG2_UNK9
Definition Unit.h:793
@ MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING
Definition Unit.h:788
@ MOVEMENTFLAG2_INTERPOLATED_PITCHING
Definition Unit.h:799
@ MOVEMENTFLAG2_UNK11
Definition Unit.h:795
@ MOVEMENTFLAG2_UNK7
Definition Unit.h:791
@ MOVEMENTFLAG2_INTERPOLATED_MOVEMENT
Definition Unit.h:797
@ MOVEMENTFLAG2_UNK5
Definition Unit.h:789
@ MOVEMENTFLAG2_NO_STRAFE
Definition Unit.h:784
@ MOVEMENTFLAG2_UNK12
Definition Unit.h:796
@ MOVEMENTFLAG2_INTERPOLATED_TURNING
Definition Unit.h:798
@ MOVEMENTFLAG2_UNK6
Definition Unit.h:790
@ MOVEMENTFLAG2_FULL_SPEED_PITCHING
Definition Unit.h:787
@ MOVEMENTFLAG2_NONE
Definition Unit.h:783
@ MOVEMENTFLAG2_FULL_SPEED_TURNING
Definition Unit.h:786
@ MOVEMENTFLAG2_NO_JUMPING
Definition Unit.h:785
#define SUMMON_SLOT_PET
Definition Unit.h:1339
ActiveStates
Definition Unit.h:1144
@ ACT_REACTION
Definition Unit.h:1150
@ ACT_DECIDE
Definition Unit.h:1151
@ ACT_COMMAND
Definition Unit.h:1149
@ ACT_ENABLED
Definition Unit.h:1148
@ ACT_PASSIVE
Definition Unit.h:1145
@ ACT_DISABLED
Definition Unit.h:1147
@ ACT_ASSIST
Definition Unit.h:1146
#define MAX_REACTIVE
Definition Unit.h:1338
#define MAX_GAMEOBJECT_SLOT
Definition Unit.h:1346
UnitPVPStateFlags
Definition Unit.h:254
@ UNIT_BYTE2_FLAG_UNK1
Definition Unit.h:256
@ UNIT_BYTE2_FLAG_UNK6
Definition Unit.h:261
@ UNIT_BYTE2_FLAG_PVP
Definition Unit.h:255
@ UNIT_BYTE2_FLAG_FFA_PVP
Definition Unit.h:257
@ UNIT_BYTE2_FLAG_UNK4
Definition Unit.h:259
@ UNIT_BYTE2_FLAG_UNK5
Definition Unit.h:260
@ UNIT_BYTE2_FLAG_UNK7
Definition Unit.h:262
@ UNIT_BYTE2_FLAG_SANCTUARY
Definition Unit.h:258
UnitState
Definition Unit.h:511
@ UNIT_STATE_DISTRACTED
Definition Unit.h:524
@ UNIT_STATE_NOT_MOVE
Definition Unit.h:549
@ UNIT_STATE_EVADE
Definition Unit.h:533
@ UNIT_STATE_DIED
Definition Unit.h:512
@ UNIT_STATE_ATTACK_PLAYER
Definition Unit.h:526
@ UNIT_STATE_POSSESSED
Definition Unit.h:528
@ UNIT_STATE_CHASE
Definition Unit.h:517
@ UNIT_STATE_ROAMING_MOVE
Definition Unit.h:534
@ UNIT_STATE_UNATTACKABLE
Definition Unit.h:540
@ UNIT_STATE_ALL_STATE
Definition Unit.h:550
@ UNIT_STATE_LOST_CONTROL
Definition Unit.h:544
@ UNIT_STATE_CANNOT_AUTOATTACK
Definition Unit.h:546
@ UNIT_STATE_CONFUSED
Definition Unit.h:523
@ UNIT_STATE_FLEEING_MOVE
Definition Unit.h:536
@ UNIT_STATE_ROOT
Definition Unit.h:522
@ UNIT_STATE_SIGHTLESS
Definition Unit.h:545
@ UNIT_STATE_CONFUSED_MOVE
Definition Unit.h:535
@ UNIT_STATE_CHASE_MOVE
Definition Unit.h:537
@ UNIT_STATE_ISOLATED
Definition Unit.h:525
@ UNIT_STATE_FOLLOW
Definition Unit.h:521
@ UNIT_STATE_CHARGING
Definition Unit.h:529
@ UNIT_STATE_IGNORE_PATHFINDING
Definition Unit.h:539
@ UNIT_STATE_ROAMING
Definition Unit.h:516
@ UNIT_STATE_CONTROLLED
Definition Unit.h:543
@ UNIT_STATE_FLEEING
Definition Unit.h:519
@ UNIT_STATE_CANNOT_TURN
Definition Unit.h:547
@ UNIT_STATE_MOVING
Definition Unit.h:542
@ UNIT_STATE_FOLLOW_MOVE
Definition Unit.h:538
@ UNIT_STATE_MOVE
Definition Unit.h:531
@ UNIT_STATE_MELEE_ATTACKING
Definition Unit.h:513
@ UNIT_STATE_IN_FLIGHT
Definition Unit.h:520
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ UNIT_STATE_ROTATING
Definition Unit.h:532
@ UNIT_STATE_STUNNED
Definition Unit.h:515
@ UNIT_STATE_JUMPING
Definition Unit.h:530
AnimTier
Definition Unit.h:196
@ ANIM_TIER_SUBMERGED
Definition Unit.h:201
@ ANIM_TIER_GROUND
Definition Unit.h:197
@ ANIM_TIER_HOVER
Definition Unit.h:199
@ ANIM_TIER_FLY
Definition Unit.h:200
@ ANIM_TIER_SWIM
Definition Unit.h:198
PlayerTotemType
Definition Unit.h:1349
@ SUMMON_TYPE_LIGHTSPRING
Definition Unit.h:1355
@ SUMMON_TYPE_TOTEM_EARTH
Definition Unit.h:1351
@ SUMMON_TYPE_TOTEM_WATER
Definition Unit.h:1352
@ SUMMON_TYPE_STATUE_JADE
Definition Unit.h:1356
@ SUMMON_TYPE_TOTEM_FIRE
Definition Unit.h:1350
@ SUMMON_TYPE_STATUE_OX
Definition Unit.h:1357
@ SUMMON_TYPE_TOTEM_AIR
Definition Unit.h:1353
UnitMoveType
Definition Unit.h:554
@ MOVE_FLIGHT
Definition Unit.h:561
@ MOVE_SWIM
Definition Unit.h:558
@ MOVE_TURN_RATE
Definition Unit.h:560
@ MOVE_FLIGHT_BACK
Definition Unit.h:562
@ MOVE_SWIM_BACK
Definition Unit.h:559
@ MOVE_RUN
Definition Unit.h:556
@ MOVE_PITCH_RATE
Definition Unit.h:563
@ MOVE_RUN_BACK
Definition Unit.h:557
@ MOVE_WALK
Definition Unit.h:555
ReactStates
Definition Unit.h:1155
@ REACT_DEFENSIVE
Definition Unit.h:1157
@ REACT_PASSIVE
Definition Unit.h:1156
@ REACT_AGGRESSIVE
Definition Unit.h:1158
@ REACT_ASSIST
Definition Unit.h:1159
std::list< SpellImmune > SpellImmuneList
Definition Unit.h:380
UnitFlags
Definition Unit.h:624
@ UNIT_FLAG_TAXI_FLIGHT
Definition Unit.h:645
@ UNIT_FLAG_STUNNED
Definition Unit.h:643
@ UNIT_FLAG_NON_ATTACKABLE
Definition Unit.h:626
@ MAX_UNIT_FLAGS
Definition Unit.h:657
@ UNIT_FLAG_UNK_6
Definition Unit.h:631
@ UNIT_FLAG_IN_COMBAT
Definition Unit.h:644
@ UNIT_FLAG_PREPARATION
Definition Unit.h:630
@ UNIT_FLAG_IMMUNE_TO_NPC
Definition Unit.h:634
@ UNIT_FLAG_PVP
Definition Unit.h:637
@ UNIT_FLAG_DISABLE_POWERS
Definition Unit.h:654
@ UNIT_FLAG_SERVER_CONTROLLED
Definition Unit.h:625
@ UNIT_FLAG_UNK_31
Definition Unit.h:656
@ UNIT_FLAG_DISARMED
Definition Unit.h:646
@ UNIT_FLAG_PACIFIED
Definition Unit.h:642
@ UNIT_FLAG_PVP_ATTACKABLE
Definition Unit.h:628
@ UNIT_FLAG_CONFUSED
Definition Unit.h:647
@ UNIT_FLAG_DISABLE_MOVE
Definition Unit.h:627
@ UNIT_FLAG_FLEEING
Definition Unit.h:648
@ UNIT_FLAG_NOT_SELECTABLE
Definition Unit.h:650
@ UNIT_FLAG_RENAME
Definition Unit.h:629
@ UNIT_FLAG_LOOTING
Definition Unit.h:635
@ UNIT_FLAG_IMMUNE_TO_PC
Definition Unit.h:633
@ UNIT_FLAG_NOT_ATTACKABLE_1
Definition Unit.h:632
@ UNIT_FLAG_SILENCED
Definition Unit.h:638
@ UNIT_FLAG_PLAYER_CONTROLLED
Definition Unit.h:649
@ UNIT_FLAG_SKINNABLE
Definition Unit.h:651
@ UNIT_FLAG_UNK_15
Definition Unit.h:640
@ UNIT_FLAG_UNK_16
Definition Unit.h:641
@ UNIT_FLAG_MOUNT
Definition Unit.h:652
@ UNIT_FLAG_PET_IN_COMBAT
Definition Unit.h:636
@ UNIT_FLAG_UNK_28
Definition Unit.h:653
@ UNIT_FLAG_UNK_14
Definition Unit.h:639
@ UNIT_FLAG_SHEATHE
Definition Unit.h:655
uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
UnitFlags2
Definition Unit.h:662
@ UNIT_FLAG2_UNK2
Definition Unit.h:678
@ UNIT_FLAG2_MIRROR_IMAGE
Definition Unit.h:667
@ UNIT_FLAG2_ALLOW_ENEMY_INTERACT
Definition Unit.h:676
@ UNIT_FLAG2_DISABLE_TURN
Definition Unit.h:677
@ UNIT_FLAG2_PLAY_DEATH_ANIM
Definition Unit.h:679
@ UNIT_FLAG2_IGNORE_REPUTATION
Definition Unit.h:665
@ UNIT_FLAG2_PREVENT_SPELL_CLICK
Definition Unit.h:675
@ UNIT_FLAG2_RESTRICT_PARTY_INTERACTION
Definition Unit.h:674
@ UNIT_FLAG2_DISABLE_PRED_STATS
Definition Unit.h:671
@ UNIT_FLAG2_COMPREHEND_LANG
Definition Unit.h:666
@ UNIT_FLAG2_FORCE_MOVEMENT
Definition Unit.h:669
@ UNIT_FLAG2_ALLOW_CHEAT_SPELLS
Definition Unit.h:680
@ UNIT_FLAG2_FEIGN_DEATH
Definition Unit.h:663
@ UNIT_FLAG2_UNK1
Definition Unit.h:664
@ UNIT_FLAG2_REGENERATE_POWER
Definition Unit.h:673
@ UNIT_FLAG2_INSTANTLY_APPEAR_MODEL
Definition Unit.h:668
@ UNIT_FLAG2_DISARM_OFFHAND
Definition Unit.h:670
@ UNIT_FLAG2_DISARM_RANGED
Definition Unit.h:672
DamageEffectType
Definition Unit.h:613
@ SELF_DAMAGE
Definition Unit.h:619
@ DIRECT_DAMAGE
Definition Unit.h:614
@ NODAMAGE
Definition Unit.h:618
@ DOT
Definition Unit.h:616
@ SPELL_DIRECT_DAMAGE
Definition Unit.h:615
@ HEAL
Definition Unit.h:617
#define UNORDERED_MAP
EUnitFields
@ UNIT_FIELD_ATTACK_ROUND_BASE_TIME
@ UNIT_FIELD_RESISTANCES
@ UNIT_FIELD_NATIVE_DISPLAY_ID
@ UNIT_FIELD_STAT_POS_BUFF
@ UNIT_FIELD_CRITTER
@ UNIT_FIELD_HEALTH
@ UNIT_FIELD_SHAPESHIFT_FORM
@ UNIT_FIELD_MAX_HEALTH
@ UNIT_FIELD_MOUNT_DISPLAY_ID
@ UNIT_FIELD_LEVEL
@ UNIT_FIELD_SUMMON
@ UNIT_FIELD_STATS
@ UNIT_FIELD_CHARMED_BY
@ UNIT_FIELD_CHARM
@ UNIT_FIELD_BASE_MANA
@ UNIT_FIELD_FACTION_TEMPLATE
@ UNIT_FIELD_DISPLAY_ID
@ UNIT_FIELD_NPC_FLAGS
@ UNIT_FIELD_ANIM_TIER
@ UNIT_FIELD_FLAGS
@ UNIT_FIELD_SEX
@ UNIT_FIELD_SUMMONED_BY
@ UNIT_FIELD_COMBAT_REACH
@ UNIT_FIELD_TARGET
@ UNIT_FIELD_DISPLAY_POWER
@ UNIT_FIELD_BASE_HEALTH
@ UNIT_FIELD_CREATED_BY
@ UNIT_FIELD_STAT_NEG_BUFF
@ PLAYER_FIELD_VIRTUAL_PLAYER_REALM
T CalculatePct(T base, U pct)
Definition Util.h:103
std::vector< CustomSpellValueMod > StorageType
Definition Unit.h:125
void AddSpellMod(SpellValueMod mod, int32 value)
Definition Unit.h:131
StorageType storage_
Definition Unit.h:147
const_iterator end() const
Definition Unit.h:141
std::pair< SpellValueMod, int32 > CustomSpellValueMod
Definition Unit.h:124
StorageType::const_iterator const_iterator
Definition Unit.h:128
const_iterator begin() const
Definition Unit.h:136
void ResistDamage(uint32 amount)
Definition Unit.cpp:112
void AbsorbDamage(uint32 amount)
Definition Unit.cpp:105
uint32 m_resist
Definition Unit.h:888
Unit *const m_attacker
Definition Unit.h:880
void ModifyDamage(int32 amount)
Definition Unit.cpp:99
WeaponAttackType m_attackType
Definition Unit.h:886
Unit * GetVictim() const
Definition Unit.h:903
Unit * GetAttacker() const
Definition Unit.h:899
SpellInfo const *const m_spellInfo
Definition Unit.h:883
uint32 m_block
Definition Unit.h:889
SpellInfo const * GetSpellInfo() const
Definition Unit.h:907
void BlockDamage(uint32 amount)
Definition Unit.cpp:119
DamageEffectType GetDamageType() const
Definition Unit.h:915
WeaponAttackType GetAttackType() const
Definition Unit.h:919
uint32 GetResist() const
Definition Unit.h:931
SpellSchoolMask GetSchoolMask() const
Definition Unit.h:911
uint32 m_absorb
Definition Unit.h:887
uint32 m_damage
Definition Unit.h:882
DamageInfo(Unit *_attacker, Unit *_victim, uint32 _damage, SpellInfo const *_spellInfo, SpellSchoolMask _schoolMask, DamageEffectType _damageType)
Definition Unit.cpp:82
uint32 GetBlock() const
Definition Unit.h:935
SpellSchoolMask const m_schoolMask
Definition Unit.h:884
uint32 GetDamage() const
Definition Unit.h:923
DamageEffectType const m_damageType
Definition Unit.h:885
Unit *const m_victim
Definition Unit.h:881
uint32 GetAbsorb() const
Definition Unit.h:927
uint32 GetDispellerSpellId() const
Definition Unit.h:844
Unit * GetDispeller() const
Definition Unit.h:840
void SetRemovedCharges(uint8 amount)
Definition Unit.h:852
uint32 _dispellerSpell
Definition Unit.h:858
uint8 _chargesRemoved
Definition Unit.h:859
uint8 GetRemovedCharges() const
Definition Unit.h:848
Unit * _dispellerUnit
Definition Unit.h:857
DispelInfo(Unit *dispeller, uint32 dispellerSpellId, uint8 chargesRemoved)
Definition Unit.h:836
bool HasGlobalCooldown(SpellInfo const *spellInfo) const
Definition Unit.cpp:248
GlobalCooldownList m_GlobalCooldowns
Definition Unit.h:1140
void AddGlobalCooldown(SpellInfo const *spellInfo, uint32 gcd)
Definition Unit.cpp:254
void CancelGlobalCooldown(SpellInfo const *spellInfo)
Definition Unit.cpp:259
uint32 m_absorb
Definition Unit.h:945
HealInfo(uint32 heal)
Definition Unit.h:947
void AbsorbHeal(uint32 amount)
Definition Unit.h:952
uint32 m_heal
Definition Unit.h:944
uint32 GetHeal() const
Definition Unit.h:959
Definition Item.h:202
Definition Map.h:238
void propagateSpeedChange()
uint8 GetByteValue(uint16 index, uint8 offset) const
Definition Object.cpp:343
void SetByteValue(uint16 index, uint8 offset, uint8 value)
Definition Object.cpp:1158
uint32 GetUInt32Value(uint16 index) const
Definition Object.cpp:325
float GetFloatValue(uint16 index) const
Definition Object.cpp:337
uint64 GetUInt64Value(uint16 index) const
Definition Object.cpp:331
void SetFloatValue(uint16 index, float value)
Definition Object.cpp:1141
void RemoveByteFlag(uint16 index, uint8 offset, uint8 newFlag)
Definition Object.cpp:1345
bool HasFlag(uint16 index, uint32 flag) const
Definition Object.cpp:1309
float * m_floatValues
Definition Object.h:251
bool HasByteFlag(uint16 index, uint8 offset, uint8 flag) const
Definition Object.cpp:1376
void SetUInt32Value(uint16 index, uint32 value)
Definition Object.cpp:1038
void SetStatInt32Value(uint16 index, int32 value)
Definition Object.cpp:1214
void SetUInt64Value(uint16 index, uint64 value)
Definition Object.cpp:1079
void SetByteFlag(uint16 index, uint8 offset, uint8 newFlag)
Definition Object.cpp:1322
Definition Pet.h:28
uint32 GetHitMask() const
Definition Unit.h:979
HealInfo * GetHealInfo() const
Definition Unit.h:986
DamageInfo * _damageInfo
Definition Unit.h:997
SpellSchoolMask GetSchoolMask() const
Definition Unit.h:983
HealInfo * _healInfo
Definition Unit.h:998
Unit * GetActionTarget() const
Definition Unit.h:973
uint32 GetSpellTypeMask() const
Definition Unit.h:977
ProcEventInfo(Unit *actor, Unit *actionTarget, Unit *procTarget, uint32 typeMask, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
Definition Unit.cpp:126
uint32 GetTypeMask() const
Definition Unit.h:976
Unit *const _actionTarget
Definition Unit.h:990
SpellInfo const * GetSpellInfo() const
Definition Unit.h:982
uint32 _hitMask
Definition Unit.h:995
uint32 _spellTypeMask
Definition Unit.h:993
uint32 GetSpellPhaseMask() const
Definition Unit.h:978
Unit *const _actor
Definition Unit.h:989
Spell * _spell
Definition Unit.h:996
DamageInfo * GetDamageInfo() const
Definition Unit.h:985
uint32 _typeMask
Definition Unit.h:992
Unit * GetProcTarget() const
Definition Unit.h:974
Unit * GetActor() const
Definition Unit.h:972
uint32 _spellPhaseMask
Definition Unit.h:994
Unit *const _procTarget
Definition Unit.h:991
bool operator()(const Unit *a, const Unit *b) const
Definition Unit.h:3016
HealthPctOrderPred(bool ascending=true)
Definition Unit.h:3014
bool operator()(const Unit *a, const Unit *b) const
Definition Unit.h:2999
const Powers m_power
Definition Unit.h:3006
PowerPctOrderPred(Powers power, bool ascending=true)
Definition Unit.h:2997
Definition Spell.h:289
Definition Totem.h:19
Definition Unit.h:1367
bool HasAuraTypeWithAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
void EnterVehicle(Unit *base, int8 seatId=-1)
Definition Unit.cpp:8234
int32 ModifyHealth(int32 val)
Definition Unit.cpp:4023
void ApplyResilience(Unit const *victim, int32 *damage, bool isCrit) const
Definition Unit.cpp:7395
uint32 m_reactiveTimer[MAX_REACTIVE]
Definition Unit.h:2927
void ClearUnitState(uint32 f)
Definition Unit.h:1489
AuraApplication * GetAuraApplicationOfRankedSpell(uint32 spellId, uint64 casterGUID=0, uint64 itemCasterGUID=0, uint32 reqEffMask=0, AuraApplication *except=NULL) const
void OutDebugInfo() const
Definition Unit.cpp:8989
bool IsStopped() const
Definition Unit.h:2614
void _EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=NULL)
Definition Unit.cpp:8239
bool IsVehicle() const
Definition Unit.h:1523
uint64 LastCharmerGUID
Definition Unit.h:2736
void SetMinion(Minion *minion, bool apply)
Definition Unit.cpp:2432
std::pair< AuraApplicationMap::iterator, AuraApplicationMap::iterator > AuraApplicationMapBoundsNonConst
Definition Unit.h:1378
void CastStop(uint32 except_spellid=0)
bool _IsValidAssistTarget(Unit const *target, SpellInfo const *bySpell) const
Definition Unit.cpp:3936
bool IsCharmed() const
Definition Unit.h:2136
AuraList m_scAuras
Definition Unit.h:2906
bool m_duringRemoveFromWorld
Definition Unit.h:2984
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Vehicle * GetVehicle() const
Definition Unit.h:2743
bool HandleAuraRaidProcFromChargeWithValue(AuraEffect *triggeredByAura)
void SetVisible(bool x)
Definition Unit.cpp:4163
float GetPosStat(Stats stat) const
Definition Unit.h:2335
Aura * _TryStackingOrRefreshingExistingAura(SpellInfo const *newAura, uint32 effMask, Unit *caster, int32 *baseAmount=NULL, Item *castItem=NULL, uint64 casterGUID=0)
bool IsBattleMaster() const
Definition Unit.h:1849
std::list< GameObject * > GameObjectList
Definition Unit.h:2890
bool HealthAbovePct(int32 pct) const
Definition Unit.h:1621
void DeleteCharmInfo()
Definition Unit.cpp:5526
void RemoveGameObject(GameObject *gameObj, bool del)
Definition Unit.cpp:1689
bool isTargetableForAttack(bool checkFakeDeath=true) const
Definition Unit.cpp:3795
bool IsHunterPet() const
Definition Unit.h:1515
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition Unit.h:2243
uint32 GetSchoolImmunityMask() const
Definition Unit.cpp:3560
Spell * m_currentSpells[CURRENT_MAX_SPELL]
Definition Unit.h:2895
float GetHealthPct() const
Definition Unit.h:1629
uint8 getGender() const
Definition Unit.h:1551
uint32 m_lastSanctuaryTime
Definition Unit.h:2446
uint32 GetMechanicImmunityMask() const
Definition Unit.cpp:3570
virtual void UpdateDamagePhysical(WeaponAttackType attType)=0
DiminishingLevels GetDiminishing(DiminishingGroup group)
Definition Unit.cpp:4837
void SetCreateStat(Stats stat, float val)
Definition Unit.h:2313
bool HasAuraState(AuraStateType flag, SpellInfo const *spellProto=NULL, Unit const *Caster=NULL) const
void SetStat(Stats stat, int32 val)
Definition Unit.h:1577
void _RemoveNoStackAurasDueToAura(Aura *aura)
int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, const AuraEffect *except=NULL) const
void setFaction(uint32 faction)
Definition Unit.h:1699
Unit * GetCharm() const
Definition Unit.cpp:2405
void ApplyResistanceBuffModsPercentMod(SpellSchools school, bool positive, float val, bool apply)
Definition Unit.cpp:1584
void GetRandomContactPoint(const Unit *target, float &x, float &y, float &z, float distance2dMin, float distance2dMax) const
Definition Unit.cpp:479
AuraList m_removedAuras
Definition Unit.h:2901
uint32 SpellCriticalDamageBonus(SpellInfo const *spellProto, uint32 damage, Unit *victim)
Definition Unit.cpp:3316
void SetResistanceBuffMods(SpellSchools school, bool positive, float val)
Definition Unit.cpp:1574
uint32 GetUnitMovementFlags() const
Definition Unit.h:2632
LiquidTypeEntry const * _lastLiquid
Definition Unit.h:2936
bool HasAuraTypeWithValue(AuraType auratype, int32 value) const
bool IsGuildMaster() const
Definition Unit.h:1845
uint32 getVirtualRealm() const
Definition Unit.h:1555
bool HasAuraTypeWithCaster(AuraType auratype, uint64 caster) const
void RemovePetAura(PetAura const *petSpell)
Definition Unit.cpp:6245
AuraApplication * GetVisibleAura(uint8 slot) const
Definition Unit.cpp:492
void _UpdateAutoRepeatSpell()
Definition Unit.cpp:1251
int32 CalculateSpellDamage(Unit const *target, SpellInfo const *spellProto, uint8 effect_index, int32 const *basePoints=NULL) const
Definition Unit.cpp:4709
void SendMoveKnockBack(Player *player, float speedXY, float speedZ, float vcos, float vsin)
Definition Unit.cpp:7580
void IncrDiminishing(DiminishingGroup group)
Definition Unit.cpp:4863
float GetTotalAuraModValue(UnitMods unitMod) const
Unit * SelectNearbyTarget(Unit *exclude=NULL, float dist=NOMINAL_MELEE_RANGE) const
Definition Unit.cpp:6043
uint32 m_transform
Definition Unit.h:2893
void SetFacingTo(float ori)
Definition Unit.cpp:9114
void Kill(Unit *victim, bool durabilityLoss=true)
Definition Unit.cpp:6342
void RemoveAllControlled()
Definition Unit.cpp:2783
Unit * GetOwner() const
Definition Unit.cpp:2339
Pet * ToPet()
Definition Unit.h:2803
Player * m_movedPlayer
Definition Unit.h:2156
bool CanHaveThreatList() const
Definition Unit.cpp:4424
uint64 GetCharmGUID() const
Definition Unit.h:2079
float GetTotalStatValue(Stats stat) const
Definition Unit.cpp:5041
uint32 GetCombatTimer() const
Definition Unit.h:1904
void CombatStop(bool includingCast=false)
void TrackGameObject(GameObject *gameObj)
Definition Unit.cpp:1663
void ClearPhases(bool update=false)
Definition Unit.cpp:7511
void PlayOneShotAnimKit(uint32 id)
Definition Unit.cpp:6328
void RemoveAurasWithMechanic(uint32 mechanic_mask, AuraRemoveMode removemode=AURA_REMOVE_BY_DEFAULT, uint32 except=0)
virtual void SetTarget(uint64)=0
void SendMeleeAttackStop(Unit *victim=NULL)
Definition Unit.cpp:647
ReputationRank GetReactionTo(Unit const *target) const
Definition Unit.cpp:2140
uint32 m_CombatTimer
Definition Unit.h:2970
bool IsContestedGuard() const
Definition Unit.cpp:7309
bool IsValidAttackTarget(Unit const *target) const
Definition Unit.cpp:3810
bool isSpellBlocked(Unit *victim, SpellInfo const *spellProto, WeaponAttackType attackType=WeaponAttackType::BASE_ATTACK)
Definition Unit.cpp:696
float GetSpeed(UnitMoveType mtype) const
Definition Unit.cpp:4313
uint64 GetCreatorGUID() const
Definition Unit.h:2055
bool SetFall(bool enable)
Definition Unit.cpp:9185
void _UnregisterDynObject(DynamicObject *dynObj)
Definition Unit.cpp:1613
bool m_canModifyStats
Definition Unit.h:2913
uint32 GetMovementCounter() const
Definition Unit.h:2849
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
void UpdateObjectVisibility(bool forced=true) override
Definition Unit.cpp:7567
uint32 getFaction() const
Definition Unit.h:1695
void AddInterruptMask(uint32 mask)
Definition Unit.h:2483
void SetFullHealth()
Definition Unit.h:1644
uint32 GetRemainingPeriodicAmount(uint64 caster, uint32 spellId, AuraType auraType, uint8 effectIndex=0) const
Definition Unit.cpp:9031
bool HasVisionObscured(Unit const *target) const
Definition Unit.cpp:523
bool IsInnkeeper() const
Definition Unit.h:1857
Diminishing m_Diminishing
Definition Unit.h:2973
void SetContestedPvP(Player *attackedPlayer=NULL)
bool IsTabardDesigner() const
Definition Unit.h:1869
void SendClearThreatListOpcode(ObjectGuid UnitGUID)
Definition Unit.cpp:8875
bool isInRoots() const
Definition Unit.h:1929
void UpdateHeight(float newZ)
Only server-side height update, does not broadcast to client.
Definition Unit.cpp:8749
bool isBlockCritical()
Definition Unit.cpp:715
bool IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition Unit.cpp:1402
void RemoveComboPointHolder(uint32 lowguid)
Definition Unit.h:2671
ComboPointHolderSet m_ComboPointHolders
Definition Unit.h:2979
void SetConfused(bool apply)
Definition Unit.cpp:6856
void _UpdateSpells(uint32 time)
Definition Unit.cpp:1195
Unit * GetCharmerOrOwnerOrSelf() const
Definition Unit.cpp:2424
void SetAnimTier(AnimTier tier)
Definition Unit.cpp:5917
void AddToWorld() override
Definition Unit.cpp:5400
bool SetPhased(uint32 id, bool update, bool apply) OVERRIDE
Definition Unit.cpp:7516
void RestoreFaction()
Definition Unit.cpp:7135
FactionTemplateEntry const * GetFactionTemplateEntry() const
Definition Unit.cpp:2117
void _UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode)
bool NeedChangeAI
Definition Unit.h:2735
SpellMissInfo MeleeSpellHitResult(Unit *victim, SpellInfo const *spellInfo)
Definition Unit.cpp:760
bool HasAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster=0) const
void SetControlled(bool apply, UnitState state)
Definition Unit.cpp:6669
SpellSchools GetSpellSchoolByAuraGroup(UnitMods unitMod) const
Definition Unit.cpp:5057
SpellMissInfo MagicSpellHitResult(Unit *victim, SpellInfo const *spellInfo)
Definition Unit.cpp:934
void SetStunned(bool apply)
Definition Unit.cpp:6761
uint32 GetModelForForm(ShapeshiftForm form) const
Definition Unit.cpp:7638
Stats GetStatByAuraGroup(UnitMods unitMod) const
Definition Unit.cpp:5077
bool HasNegativeAuraWithAttribute(uint32 flag, uint64 guid=0) const
uint32 m_regenTimer
Definition Unit.h:2928
uint32 m_state
Definition Unit.h:2969
float m_auraModifiersGroup[UNIT_MOD_END][MODIFIER_TYPE_END]
Definition Unit.h:2911
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
void SetCreateHealth(uint32 val)
Definition Unit.h:2317
std::list< Aura * > AuraList
Definition Unit.h:1384
uint32 GetResistance(SpellSchools school) const
Definition Unit.h:1590
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0)
void AddPetAura(PetAura const *petSpell)
Definition Unit.cpp:6235
void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit *stealer)
float m_modAttackSpeedPct[3]
Definition Unit.h:2393
void SetPower(Powers power, int32 val)
Definition Unit.cpp:5255
void SendPetActionFeedback(uint8 msg) const
-------—Pet responses methods--------------—
Definition Unit.cpp:5833
void RemoveAurasDueToSpell(uint32 spellId, uint64 casterGUID=0, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
virtual bool UpdateAllStats()=0
Player * GetSpellModOwner() const
Definition Unit.cpp:5818
Spell * FindCurrentSpellBySpellId(uint32 spell_id) const
Definition Unit.cpp:1448
int32 GetTotalAuraModifierByAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
Vehicle * m_vehicle
Definition Unit.h:2932
Totem * ToTotem()
Definition Unit.h:2812
void SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo)
Definition Unit.cpp:1927
Creature * GetVehicleCreatureBase() const
Definition Unit.cpp:7208
void RemoveVehicleKit(bool remove=false)
Definition Unit.cpp:7179
void SetRace(uint8 race)
Definition Unit.h:1560
uint32 m_overrideAutoattackRange
Definition Unit.h:2897
void RemoveAllGameObjects()
Definition Unit.cpp:1753
uint64 GetCharmerOrOwnerGUID() const
Definition Unit.cpp:5806
bool isPossessedByPlayer() const
Definition Unit.cpp:2808
void SendClearTarget()
Definition Unit.cpp:9046
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition Unit.h:1376
void ApplyStatBuffMod(Stats stat, float val, bool apply)
Definition Unit.cpp:1597
float GetSpellMinRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
Definition Unit.cpp:4886
bool HealthAbovePctHealed(int32 pct, uint32 heal) const
Definition Unit.h:1625
void _RegisterDynObject(DynamicObject *dynObj)
Definition Unit.cpp:1608
bool isInFrontInMap(Unit const *target, float distance, float arc=M_PI) const
Definition Unit.cpp:1463
bool IsPolymorphed() const
Definition Unit.cpp:5928
bool isFrozen() const
Definition Unit.cpp:5796
float GetUnitDodgeChance() const
Definition Unit.cpp:1063
bool HandleDummyAuraProc(Unit *victim, uint32 damage, AuraEffect *triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
Definition UnitProc.cpp:193
ShapeshiftForm GetShapeshiftForm() const
Definition Unit.h:2377
void SetPvP(bool state)
Definition Unit.cpp:7317
void SetBaseWeaponDamage(WeaponAttackType attType, WeaponDamageRange damageRange, float value)
Definition Unit.h:2428
float ApplyTotalThreatModifier(float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL)
Definition Unit.cpp:4451
void WriteMovementInfo(WorldPacket &data, Movement::ExtraMovementStatusElement *extras=NULL)
Definition Unit.cpp:8407
virtual bool isBeingLoaded() const
Definition Unit.h:2794
void RemoveNotOwnSingleTargetAuras(uint32 newPhase=0, bool phaseid=false)
float CalculateDefaultCoefficient(SpellInfo const *spellInfo, DamageEffectType damagetype) const
Definition Unit.cpp:6213
float GetCombatRatingReduction(CombatRating cr) const
Definition Unit.cpp:7620
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=NULL)
Definition Unit.cpp:4463
bool isSpellCrit(Unit *victim, SpellInfo const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType=WeaponAttackType::BASE_ATTACK) const
Definition Unit.cpp:3111
virtual void UpdateAttackPowerAndDamage(bool ranged=false)=0
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition Unit.cpp:2355
void HandleProcExtraAttackFor(Unit *victim)
void SetCreatorGUID(uint64 creator)
Definition Unit.h:2059
Spell * GetCurrentSpell(uint32 spellType) const
Definition Unit.h:2367
bool HandleAuraProc(Unit *victim, uint32 damage, Aura *triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool *handled)
std::set< PetAura const * > PetAuraSet
Definition Unit.h:2707
void SetCantProc(bool apply)
uint32 SpellCriticalHealingBonus(SpellInfo const *spellProto, uint32 damage, Unit *victim)
Definition Unit.cpp:3353
Unit * GetCharmer() const
Definition Unit.cpp:2348
void GetAttackableUnitListInRange(std::list< Unit * > &list, float fMaxSearchRange) const
Definition Unit.cpp:8973
float GetPositionZMinusOffset() const
Definition Unit.cpp:6660
Unit * getAttackerForHelper() const
uint32 SpellHealingBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack=1) const
void SendMeleeAttackStart(Unit *victim)
Definition Unit.cpp:603
Pet * CreateTamedPetFrom(Creature *creatureTarget, uint32 spell_id=0)
Definition Unit.cpp:6255
bool IsHostileToPlayers() const
Definition Unit.cpp:2288
Aura * GetAura(uint32 spellId, uint64 casterGUID=0, uint64 itemCasterGUID=0, uint32 reqEffMask=0) const
UnitAI * i_AI
Definition Unit.h:2867
bool IsInDisallowedMountForm() const
Definition Unit.cpp:4942
void SendSpellDamageImmune(Unit *target, uint32 spellId)
Definition Unit.cpp:1956
void DealDamageMods(Unit *victim, uint32 &damage, uint32 *absorb)
float m_weaponDamage[uint8(WeaponAttackType::MAX_ATTACK)][2]
Definition Unit.h:2912
void _removeAttacker(Unit *pAttacker)
void SendAttackStateUpdate(CalcDamageInfo *damageInfo)
Definition Unit.cpp:1985
bool IsArmorer() const
Definition Unit.h:1877
void RemoveAllAurasExceptType(AuraType type)
CharmInfo * m_charmInfo
Definition Unit.h:2918
void GetProcAurasTriggeredOnEvent(AuraApplicationList &aurasTriggeringProc, AuraApplicationList *procAuras, ProcEventInfo eventInfo)
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition Unit.cpp:1433
bool IsPvP() const
Definition Unit.h:1716
DynamicObject * GetDynObject(uint32 spellId)
Definition Unit.cpp:1618
int32 CalcSpellDuration(SpellInfo const *spellProto)
Definition Unit.cpp:4714
virtual bool CanFly() const =0
void SetAuraStack(uint32 spellId, Unit *target, uint32 stack)
Unit * GetVehicleBase() const
Definition Unit.cpp:7203
bool haveOffhandWeapon() const
Definition Unit.cpp:350
MotionMaster * GetMotionMaster()
Definition Unit.h:2605
AuraApplicationMap const & GetAppliedAuras() const
Definition Unit.h:2208
uint64 GetPetGUID() const
Definition Unit.h:2087
uint32 MeleeDamageBonusTaken(Unit *attacker, uint32 pdamage, WeaponAttackType attType, SpellInfo const *spellProto=NULL)
bool IsPet() const
Definition Unit.h:1511
void _addAttacker(Unit *pAttacker)
void SetInCombatState(bool PvP, Unit *enemy=NULL)
bool CanProc() const
Definition Unit.h:2700
void RemoveVisibleAura(uint8 slot)
Definition Unit.cpp:506
void Dismount()
Definition Unit.cpp:3685
void SetCharm(Unit *target, bool apply)
Definition Unit.cpp:2617
void SendTeleportPacket(Position &pos)
Definition Unit.cpp:8670
MeleeHitOutcome RollMeleeOutcomeAgainst(const Unit *victim, WeaponAttackType attType) const
static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const *spellInfo=NULL, uint8 effIndex=MAX_SPELL_EFFECTS)
void SendHealSpellLog(ObjectGuid CasterGUID, ObjectGuid TargetGUID, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical=false)
Definition Unit.cpp:2925
float ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, Unit *caster, DiminishingLevels Level, int32 limitduration)
uint8 getLevelForTarget(WorldObject const *) const override
Definition Unit.h:1532
bool SetCharmedBy(Unit *charmer, CharmType type, AuraApplication const *aurApp=NULL)
Definition Unit.cpp:6878
uint64 m_SummonSlot[MAX_SUMMON_SLOT]
Definition Unit.h:2374
float GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_value) const
bool CanDualWield() const
Definition Unit.h:1437
void UpdateInterruptMask()
Definition Unit.cpp:512
void StartReactiveTimer(ReactiveType reactive)
Definition Unit.h:2690
void SetLastDamagedTime(time_t val)
Definition Unit.h:2844
void SetUnitMovementFlags(uint32 f)
Definition Unit.h:2636
void CleanupsBeforeDelete(bool finalCleanup=true) override
Definition Unit.cpp:5479
uint32 GetMaxHealth() const
Definition Unit.h:1604
bool IsTrainer() const
Definition Unit.h:1829
Aura * AddAura(uint32 spellId, Unit *target)
void TauntApply(Unit *victim)
Definition Unit.cpp:4481
void SetExtraUnitMovementFlags(uint16 f)
Definition Unit.h:2657
bool isAttackingPlayer() const
uint64 m_ObjectSlot[MAX_GAMEOBJECT_SLOT]
Definition Unit.h:2375
virtual void UpdateResistances(uint32 school)=0
void SetFacingToObject(WorldObject *object)
Definition Unit.cpp:9124
void RemoveAurasDueToItemSpell(uint32 spellId, uint64 castItemGuid)
void UpdateSplineMovement(uint32 t_diff)
Definition Unit.cpp:366
bool IsLevitating() const
Definition Unit.h:2003
void RemoveAuraFromStack(uint32 spellId, uint64 casterGUID=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
uint32 GetDamageReduction(uint32 damage) const
Definition Unit.h:1792
bool IsFullHealth() const
Definition Unit.h:1609
void CombatStart(Unit *target, bool initialAggro=true)
bool CanFreeMove() const
Definition Unit.cpp:5144
uint32 CalcArmorReducedDamage(Unit *victim, const uint32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=WeaponAttackType::MAX_ATTACK)
uint8 getClass() const
Definition Unit.h:1543
std::pair< AuraMap::const_iterator, AuraMap::const_iterator > AuraMapBounds
Definition Unit.h:1373
bool HandleOverrideClassScriptAuraProc(Unit *victim, uint32 damage, AuraEffect *triggeredByAura, SpellInfo const *procSpell, uint32 cooldown)
int32 ModSpellDuration(SpellInfo const *spellProto, Unit const *target, int32 duration, bool positive, uint32 effectMask)
Definition Unit.cpp:4736
float GetNegStat(Stats stat) const
Definition Unit.h:2339
float m_createStats[MAX_STATS]
Definition Unit.h:2878
bool HasAuraWithMechanic(uint32 mechanicMask) const
float ApplyEffectModifiers(SpellInfo const *spellProto, uint8 effect_index, float value) const
Definition Unit.cpp:4681
bool HandleProcTriggerSpell(Unit *victim, uint32 damage, AuraEffect *triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
bool IsSplineEnabled() const
Definition Unit.cpp:9355
int32 GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const
void RemoveAllAurasRequiringDeadTarget()
uint64 GetTarget() const
Definition Unit.h:2830
void UpdateReactives(uint32 p_time)
Definition Unit.cpp:6007
bool IsAlive() const
Definition Unit.h:2032
AuraEffect * GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, uint64 casterGUID=0) const
AuraEffect * IsScriptOverriden(SpellInfo const *spell, int32 script) const
float m_modRangedHitChance
Definition Unit.h:2388
bool IsOnVehicle(const Unit *vehicle) const
Definition Unit.cpp:7198
void ApplyStatPercentBuffMod(Stats stat, float val, bool apply)
Definition Unit.cpp:1602
DeathState m_deathState
Definition Unit.h:2883
void SetClass(uint8 newClass)
Definition Unit.h:1564
void ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
Definition Unit.cpp:6074
void NearTeleportTo(float x, float y, float z, float orientation, bool casting=false)
Definition Unit.cpp:8393
float GetTotalAuraMultiplierByAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
int32 GetMaxPower(Powers power) const
Definition Unit.cpp:5246
uint32 m_unitTypeMask
Definition Unit.h:2935
void StopMoving()
-------—End of Pet responses methods-------—
Definition Unit.cpp:5877
std::pair< AuraApplicationMap::const_iterator, AuraApplicationMap::const_iterator > AuraApplicationMapBounds
Definition Unit.h:1377
uint32 GetUnitMeleeSkill(Unit const *target=NULL) const
Definition Unit.cpp:1058
void AddPlayerToVision(Player *player)
Definition Unit.cpp:2878
uint64 GetMinionGUID() const
Definition Unit.h:2063
GameObject * GetGameObject(uint32 spellId) const
Definition Unit.cpp:1654
bool IsWithinCombatRange(const Unit *obj, float dist2compare) const
Definition Unit.cpp:447
virtual ~Unit()
Definition Unit.cpp:266
void ProcDamageAndSpellFor(bool isVictim, Unit *target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const *procSpell, uint32 damage, SpellInfo const *procAura=NULL)
uint32 m_removedAurasCount
Definition Unit.h:2903
void RemoveAllAurasOnDeath()
uint32 m_movementCounter
Incrementing counter used in movement packets.
Definition Unit.h:2966
void SetHealth(uint32 val)
Definition Unit.cpp:5162
bool IsStandState() const
Definition Unit.cpp:5896
TempSummon * ToTempSummon()
Definition Unit.h:2821
bool IsQuestGiver() const
Definition Unit.h:1833
CharmInfo * GetCharmInfo()
Definition Unit.h:2148
virtual uint32 GetBlockPercent() const
Definition Unit.h:1812
bool HasStealthAura() const
Definition Unit.h:1917
void AddComboPointHolder(uint32 lowguid)
Definition Unit.h:2667
ControlList m_Controlled
Definition Unit.h:2132
void DisableSpline()
Definition Unit.cpp:430
int32 GetMechanicResistChance(SpellInfo const *spellInfo) const
Definition Unit.cpp:722
void DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
AuraMap::iterator m_auraUpdateIterator
Definition Unit.h:2902
std::list< AuraApplication * > AuraApplicationList
Definition Unit.h:1385
std::map< uint8, AuraApplication * > VisibleAuraMap
Definition Unit.h:1389
void RemoveAurasWithAttribute(uint32 flags)
uint16 GetMaxSkillValueForLevel(Unit const *target=NULL) const
Definition Unit.h:1757
bool IsTriggeredAtSpellProcEvent(Unit *victim, Aura *aura, SpellInfo const *procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const *&spellProcEvent)
bool m_AutoRepeatFirstCast
Definition Unit.h:2874
std::set< Unit * > ControlList
Definition Unit.h:1370
TempSummon const * ToTempSummon() const
Definition Unit.h:2825
void TauntFadeOut(Unit *taunter)
Definition Unit.cpp:4509
void _DeleteRemovedAuras()
bool HandleAuraRaidProcFromCharge(AuraEffect *triggeredByAura)
void _ApplyAura(AuraApplication *aurApp, uint32 effMask)
int32 ModifyPower(Powers power, int32 val)
Definition Unit.cpp:4081
Unit * GetNextRandomRaidMemberOrPet(float radius)
Definition Unit.cpp:2826
Powers GetPowerTypeByAuraGroup(UnitMods unitMod) const
Definition Unit.cpp:5096
int32 HealBySpell(Unit *victim, SpellInfo const *spellInfo, uint32 addHealth, bool critical=false)
Definition Unit.cpp:2963
bool IsNeutralToAll() const
Definition Unit.cpp:2301
uint32 m_extraAttacks
Definition Unit.h:1453
bool HasAura(uint32 spellId, uint64 casterGUID=0, uint64 itemCasterGUID=0, uint32 reqEffMask=0) const
uint64 GetCharmerGUID() const
Definition Unit.h:2071
virtual bool HasSpell(uint32) const
Definition Unit.h:1910
std::pair< AuraStateAurasMap::const_iterator, AuraStateAurasMap::const_iterator > AuraStateAurasMapBounds
Definition Unit.h:1381
float GetUnitMissChance(WeaponAttackType attType) const
Definition Unit.cpp:1114
void AddUnitState(uint32 f)
Definition Unit.h:1481
uint32 GetCritDamageReduction(uint32 damage) const
Definition Unit.h:1788
void ClearComboPointHolders()
Definition Unit.cpp:5980
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition Unit.cpp:3635
std::multimap< AuraStateType, AuraApplication * > AuraStateAurasMap
Definition Unit.h:1380
bool IsTaxi() const
Definition Unit.h:1841
void SetCreateMana(uint32 val)
Definition Unit.h:2325
void RemoveExtraUnitMovementFlag(uint16 f)
Definition Unit.h:2645
void SendSpellDamageResist(Unit *target, uint32 spellId)
Definition Unit.cpp:1946
bool isInAccessiblePlaceFor(Creature const *c) const
Definition Unit.cpp:1473
uint32 SpellHealingBonusTaken(Unit *caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack=1) const
bool IsCharmedOwnedByPlayerOrPlayer() const
Definition Unit.h:2106
int32 GetMinPower(Powers power) const
Definition Unit.h:1662
Pet const * ToPet() const
Definition Unit.h:2807
int32 DealHeal(Unit *victim, uint32 addhealth)
Definition Unit.cpp:2687
bool _IsValidAttackTarget(Unit const *target, SpellInfo const *bySpell, WorldObject const *obj=NULL) const
Definition Unit.cpp:3816
uint32 getAttackTimer(WeaponAttackType type) const
Definition Unit.h:1428
virtual void SetSheath(SheathState sheathed)
Definition Unit.h:1689
uint32 BuildAuraStateUpdateForTarget(Unit *target) const
bool IsDuringRemoveFromWorld() const
Definition Unit.h:2798
Unit * GetRedirectThreatTarget()
Definition Unit.cpp:7158
float GetSpellMaxRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
Definition Unit.cpp:4877
void _ExitVehicle(Position const *exitPosition=NULL)
Definition Unit.cpp:8325
ThreatManager m_ThreatManager
Definition Unit.h:2930
bool m_ControlledByPlayer
Definition Unit.h:2758
void SetFeared(bool apply)
Definition Unit.cpp:6816
Unit * GetCharmerOrOwner() const
Definition Unit.cpp:2419
Unit * GetMeleeHitRedirectTarget(Unit *victim, SpellInfo const *spellInfo=NULL)
Definition Unit.cpp:2751
MotionMaster i_motionMaster
Definition Unit.h:2925
uint32 GetRedirectThreatPercent() const
Definition Unit.h:2728
int32 GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const
void _ApplyAllAuraStatMods()
bool CanUseAttackType(WeaponAttackType attacktype) const
Definition Unit.cpp:744
void propagateSpeedChange()
-------—End of Pet responses methods-------—
Definition Unit.h:2683
bool SetHover(bool enable, bool packetOnly=false)
Definition Unit.cpp:9287
bool isFeared() const
Definition Unit.h:1925
uint32 GetCreatureType() const
Definition Unit.cpp:4910
void SetOwnerGUID(uint64 owner)
Definition Unit.cpp:2314
float GetMeleeReach() const
Definition Unit.cpp:441
AuraMap const & GetOwnedAuras() const
Definition Unit.h:2192
void AddGameObject(GameObject *gameObj)
Definition Unit.cpp:1671
bool HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, float amount, bool apply)
Definition Unit.cpp:4955
void SetCurrentCastedSpell(Spell *pSpell)
Definition Unit.cpp:1289
void SendSetVehicleRecId(uint32 vehicleId)
Definition Unit.cpp:9540
bool SetSwim(bool enable)
Definition Unit.cpp:9201
virtual bool IsImmunedToSpell(SpellInfo const *spellInfo) const
Definition Unit.cpp:3456
bool isAttackReady(WeaponAttackType type=WeaponAttackType::BASE_ATTACK) const
Definition Unit.h:1432
float GetCombatReach() const
Definition Unit.h:1445
uint32 CountPctFromCurHealth(int32 pct) const
Definition Unit.h:1637
void CalcAbsorbResist(Unit *victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, uint32 const damage, uint32 *absorb, uint32 *resist, SpellInfo const *spellInfo=NULL)
int32 CountPctFromMaxPower(Powers power, int32 pct) const
Definition Unit.h:1667
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition Unit.cpp:8701
DynObjectList m_dynObj
Definition Unit.h:2888
int32 GetHealthGain(int32 dVal)
Definition Unit.cpp:4055
void EnergizeBySpell(Unit *victim, uint32 SpellID, int32 Damage, Powers powertype)
Definition Unit.cpp:3045
void RemoveAurasWithFamily(SpellFamilyNames family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, uint64 casterGUID)
AuraApplicationList m_interruptableAuras
Definition Unit.h:2907
bool IsInFlight() const
Definition Unit.h:1891
void SetResistance(SpellSchools school, int32 val)
Definition Unit.h:1595
SpellImmuneList m_spellImmune[MAX_SPELL_IMMUNITY]
Definition Unit.h:2445
uint32 GetDisplayId() const
Definition Unit.h:2490
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)
void ModifyAuraState(AuraStateType flag, bool apply)
static Creature * GetCreature(WorldObject &object, uint64 guid)
Definition Unit.cpp:4905
bool HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint32 familyFlags) const
Definition Unit.cpp:567
uint32 GetAuraCount(uint32 spellId) const
bool isInBackInMap(Unit const *target, float distance, float arc=M_PI) const
Definition Unit.cpp:1468
void SetCritterGUID(uint64 guid)
Definition Unit.h:2091
bool isPossessing() const
Definition Unit.cpp:2818
uint32 GetNativeDisplayId() const
Definition Unit.h:2495
bool IsBMAuctioner() const
Definition Unit.h:1886
uint64 GetTransGUID() const override
Definition Unit.cpp:7217
uint32 CalculateDamage(WeaponAttackType attType, bool normalized, bool addTotalPct)
virtual void UpdateArmor()=0
bool HealthBelowPct(int32 pct) const
Definition Unit.h:1613
void UpdateCharmAI()
Definition Unit.cpp:5491
void ClearAllReactives()
Definition Unit.cpp:5994
EventProcessor m_Events
Definition Unit.h:2396
void SetRooted(bool apply, bool packetOnly=false)
Definition Unit.cpp:6794
void AddUnitMovementFlag(uint32 f)
Definition Unit.h:2620
float GetModifierValue(UnitMods unitMod, UnitModifierType modifierType) const
Definition Unit.cpp:5027
bool Attack(Unit *victim, bool meleeAttack)
float GetWeaponDamageRange(WeaponAttackType attType, WeaponDamageRange type) const
Definition Unit.cpp:5136
void UpdateAuraForGroup(uint8 slot)
int32 SpellBaseDamageBonusTaken(SpellSchoolMask schoolMask) const
Definition Unit.cpp:3099
void JumpTo(float speedXY, float speedZ, bool forward=true)
Definition Unit.cpp:8139
void RemoveStandFlags(uint8 flags)
Definition Unit.h:1737
bool SetCanFly(bool enable)
Definition Unit.cpp:9219
HostileRefManager m_HostileRefManager
Definition Unit.h:2975
void CalcHealAbsorb(Unit *victim, SpellInfo const *spellInfo, uint32 &healAmount, uint32 &absorb)
bool isPossessed() const
Definition Unit.h:2140
SharedVisionList const & GetSharedVisionList()
Definition Unit.h:2157
void SendRemoveFromThreatListOpcode(HostileReference *pHostileReference)
Definition Unit.cpp:8883
int32 m_baseSpellCritChance
Definition Unit.h:2390
bool HasUnitMovementFlag(uint32 f) const
Definition Unit.h:2628
void AddExtraUnitMovementFlag(uint16 f)
Definition Unit.h:2641
uint32 CalcSpellResistance(Unit *victim, SpellSchoolMask schoolMask, SpellInfo const *spellInfo) const
int32 GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const
virtual void UpdateMaxPower(Powers power)=0
void _AddAura(UnitAura *aura, Unit *caster)
AttackerSet m_attackers
Definition Unit.h:2880
bool IsSummon() const
Definition Unit.h:1503
void SendPetTalk(uint32 pettalk) const
Definition Unit.cpp:5844
virtual bool IsInWater() const
Definition Unit.cpp:1481
uint32 GetHealth() const
Definition Unit.h:1600
TransportBase * GetDirectTransport() const
Returns the transport this unit is on directly (if on vehicle and transport, return vehicle).
Definition Unit.cpp:7227
void addFollower(FollowerReference *pRef)
Definition Unit.h:2594
void RewardRage(uint32 baseRage, bool attacker)
Definition Unit.cpp:8914
uint32 GetCreateHealth() const
Definition Unit.h:2321
uint32 GetModelForTotem(uint32 totemType) const
Definition Unit.cpp:7989
void SetGender(uint8 gender)
Definition Unit.h:1568
void SetAutoattackOverrideRange(uint32 range)
Definition Unit.h:2857
void RemoveDynObject(uint32 spellId)
Definition Unit.cpp:1631
void SetAutoattackOverrideSpell(SpellInfo const *spellInfo)
Definition Unit.h:2853
uint32 getRaceMask() const
Definition Unit.h:1539
void DeleteThreatList()
Definition Unit.cpp:4472
Unit * m_attacking
Definition Unit.h:2881
AttackerSet const & getAttackers() const
Definition Unit.h:1463
void SetAI(UnitAI *newAI)
Definition Unit.h:1397
uint32 GetPowerIndex(uint32 powerType) const
Definition Unit.cpp:5346
bool SetFeatherFall(bool enable, bool packetOnly=false)
Definition Unit.cpp:9266
float GetTotalAuraMultiplier(AuraType auratype) const
std::multimap< uint32, Aura * > AuraMap
Definition Unit.h:1372
bool IsVisible() const
Definition Unit.cpp:4158
bool HasAuraType(AuraType auraType) const
static Unit * GetUnit(WorldObject &object, uint64 guid)
Definition Unit.cpp:4895
bool isMoving() const
Definition Unit.h:2771
bool SetWalk(bool enable)
Definition Unit.cpp:9137
void removeHatedBy(HostileReference *)
Definition Unit.h:2463
int32 GetMaxPositiveAuraModifier(AuraType auratype) const
void SetVisibleAura(uint8 slot, AuraApplication *aur)
Definition Unit.cpp:500
Totem const * ToTotem() const
Definition Unit.h:2816
void setAttackTimer(WeaponAttackType type, uint32 time)
Definition Unit.h:1423
virtual bool UpdateStats(Stats stat)=0
void SetNativeDisplayId(uint32 modelId)
Definition Unit.h:2500
void SetRedirectThreat(uint64 guid, uint32 pct)
Definition Unit.h:2716
void RemoveAllDynObjects()
Definition Unit.cpp:1648
uint32 MeleeDamageBonusDone(Unit *pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const *spellProto=NULL)
bool IsBanker() const
Definition Unit.h:1853
uint32 GetArmor() const
Definition Unit.h:1581
float m_modMeleeHitChance
Definition Unit.h:2387
void RemoveArenaAuras()
void _RemoveAllAuraStatMods()
void SetPhaseMask(uint32 newPhaseMask, bool update) override
Definition Unit.cpp:7454
uint32 GetAttackTime(WeaponAttackType att) const
Definition Unit.cpp:4122
uint32 SpellDamageBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack=1) const
time_t GetLastDamagedTime() const
Definition Unit.h:2840
void setTransForm(uint32 spellid)
Definition Unit.h:2504
uint16 GetExtraUnitMovementFlags() const
Definition Unit.h:2653
Unit * GetMagicHitRedirectTarget(Unit *victim, SpellInfo const *spellInfo)
Definition Unit.cpp:2729
uint32 GetDiseasesByCaster(uint64 casterGUID, bool remove=false)
void StopAttackFaction(uint32 faction_id)
Definition Unit.cpp:8939
uint32 GetCastingTimeForBonus(SpellInfo const *spellProto, DamageEffectType damagetype, uint32 CastingTime) const
Definition Unit.cpp:6120
bool IsWithinMeleeRange(const Unit *obj, float dist=MELEE_RANGE) const
Definition Unit.cpp:463
void RemoveAreaAurasDueToLeaveWorld()
AuraList const & GetSingleCastAuras() const
Definition Unit.h:2251
VisibleAuraMap const * GetVisibleAuras()
Definition Unit.h:2471
bool CanModifyStats() const
Definition Unit.h:2410
uint16 HasExtraUnitMovementFlag(uint16 f) const
Definition Unit.h:2649
void RemoveCharmedBy(Unit *charmer)
Definition Unit.cpp:7029
bool IsMounted() const
Definition Unit.h:1742
HostileRefManager & getHostileRefManager()
Definition Unit.h:2466
int32 ModifyPowerPct(Powers power, float pct, bool apply=true)
Definition Unit.cpp:4114
void RemoveAurasByType(AuraType auraType, uint64 casterGUID=0, Aura *except=NULL, bool negative=true, bool positive=true)
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 casterGUID=0) const
float GetSpeedRate(UnitMoveType mtype) const
Definition Unit.h:2581
virtual void SetDisplayId(uint32 modelId)
Definition Unit.cpp:5941
std::set< Unit * > AttackerSet
Definition Unit.h:1369
void SendMissileCancel(uint32 spellId, bool cancel=true)
Definition Unit.cpp:9566
time_t _lastDamagedTime
Definition Unit.h:2988
virtual float GetFollowAngle() const
Definition Unit.h:2788
void CleanupBeforeRemoveFromMap(bool finalCleanup)
Definition Unit.cpp:5453
uint8 getStandState() const
Definition Unit.h:1724
bool IsGuardian() const
Definition Unit.h:1507
Unit * GetVictim() const
Definition Unit.h:1468
int32 GetPower(Powers power) const
Definition Unit.cpp:5237
std::list< DiminishingReturn > Diminishing
Definition Unit.h:1386
RedirectThreatInfo _redirectThreadInfo
Definition Unit.h:2981
Vehicle * m_vehicleKit
Definition Unit.h:2933
int32 SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) const
Definition Unit.cpp:3365
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log)
Definition Unit.cpp:1766
float GetAPMultiplier(WeaponAttackType attType, bool normalized)
void UpdateOrientation(float orientation)
Only server-side orientation update, does not broadcast to client.
Definition Unit.cpp:8741
virtual bool IsUnderWater() const
Definition Unit.cpp:1486
float GetUnitBlockChance() const
Definition Unit.cpp:1126
void RemovePlayerFromVision(Player *player)
Definition Unit.cpp:2889
bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const
Definition Unit.cpp:3415
std::set< uint32 > ComboPointHolderSet
Definition Unit.h:1387
float GetCreateStat(Stats stat) const
Definition Unit.h:2343
void UpdateSplinePosition()
Definition Unit.cpp:382
DeathState getDeathState() const
Definition Unit.h:2044
Unit * GetFirstControlled() const
Definition Unit.cpp:2769
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition Unit.cpp:4318
void SetArmor(int32 val)
Definition Unit.h:1585
bool IsAIEnabled
Definition Unit.h:2735
void ApplyCastTimePercentMod(float val, bool apply)
Definition Unit.cpp:6106
void DelayOwnedAuras(uint32 spellId, uint64 caster, int32 delaytime)
void ModifyRedirectThreat(int32 amount)
Definition Unit.h:2724
void DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
void SetCharmerGUID(uint64 owner)
Definition Unit.h:2075
bool IsGossip() const
Definition Unit.h:1837
bool CreateVehicleKit(uint32 id, uint32 creatureEntry, bool loading=false)
Definition Unit.cpp:7163
virtual bool IsImmunedToSpellEffect(SpellInfo const *spellInfo, uint32 index) const
Definition Unit.cpp:3520
AuraApplication * GetAuraApplication(uint32 spellId, uint64 casterGUID=0, uint64 itemCasterGUID=0, uint32 reqEffMask=0, AuraApplication *except=NULL) const
bool HasUnitState(const uint32 f) const
Definition Unit.h:1485
void SetModifierValue(UnitMods unitMod, UnitModifierType modifierType, float value)
Definition Unit.h:2400
Player * GetAffectingPlayer() const
Definition Unit.cpp:2364
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
Definition Unit.cpp:3580
TimeTrackerSmall m_movesplineTimer
Definition Unit.h:2971
void FinishSpell(CurrentSpellTypes spellType, bool ok=true)
Definition Unit.cpp:1390
void resetAttackTimer(WeaponAttackType type=WeaponAttackType::BASE_ATTACK)
Definition Unit.cpp:436
bool m_isSorted
Definition Unit.h:2892
bool IsInRaidWith(Unit const *unit) const
Definition Unit.cpp:7253
void UnsummonAllTotems()
Definition Unit.cpp:2912
void CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
AuraApplication * _CreateAuraApplication(Aura *aura, uint32 effMask)
GameObjectList m_gameObj
Definition Unit.h:2891
AuraMap m_ownedAuras
Definition Unit.h:2899
Unit(bool isWorldObject)
Definition Unit.cpp:142
uint32 getClassMask() const
Definition Unit.h:1547
bool IsInFeralForm() const
Definition Unit.cpp:4936
int32 GetCreatePowers(Powers power) const
Definition Unit.cpp:5359
std::unique_ptr< Movement::MoveSpline > movespline
Definition Unit.h:2837
static ReputationRank GetFactionReactionTo(FactionTemplateEntry const *factionTemplateEntry, Unit const *target)
Definition Unit.cpp:2231
void SetCanModifyStats(bool modifyStats)
Definition Unit.h:2414
bool IsFriendlyTo(Unit const *unit) const
Definition Unit.cpp:2283
std::pair< AuraMap::iterator, AuraMap::iterator > AuraMapBoundsNonConst
Definition Unit.h:1374
void RemoveUnitMovementFlag(uint32 f)
Definition Unit.h:2624
uint32 GetMountID() const
Definition Unit.h:1746
void RemoveBindSightAuras()
Definition Unit.cpp:2899
ThreatManager & getThreatManager()
Definition Unit.h:2455
int32 GetMaxNegativeAuraModifier(AuraType auratype) const
AuraApplicationMap m_appliedAuras
Definition Unit.h:2900
int32 GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const
CharmInfo * InitCharmInfo()
Definition Unit.cpp:5518
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId, uint64 casterGUID, Unit *dispeller, uint8 chargesRemoved=1)
void SetVehicle(Vehicle *vehicle)
Definition Unit.h:2747
void RemoveAllAttackers()
bool HasInvisibilityAura() const
Definition Unit.h:1921
void addHatedBy(HostileReference *pHostileReference)
Definition Unit.h:2459
void RemoveFromWorld() override
Definition Unit.cpp:5409
void SendPlaySpellVisual(uint32 SpellVisualId, float x, float y, float z, float orientation, uint8 SpeedTime, uint16 MissReason, uint16 ReflectStatus)
Definition Unit.cpp:7325
uint32 SpellDamageBonusTaken(Unit *caster, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack=1) const
void ResetRedirectThreat()
Definition Unit.h:2720
uint32 m_attackTimer[uint8(WeaponAttackType::MAX_ATTACK)]
Definition Unit.h:2876
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=WeaponAttackType::BASE_ATTACK, bool crit=false)
UnitAI * GetAI()
Definition Unit.h:1393
bool InitTamedPet(Pet *pet, uint8 level, uint32 spell_id) const
Definition Unit.cpp:6295
virtual void UpdateMaxHealth()=0
uint32 HasUnitTypeMask(uint32 mask) const
Definition Unit.h:1495
void _RegisterAuraEffect(AuraEffect *aurEff, bool apply)
void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo)
Definition Unit.cpp:1838
void ClearInCombat()
uint32 CountPctFromMaxHealth(int32 pct) const
Definition Unit.h:1633
float GetResistanceBuffMods(SpellSchools school, bool positive) const
Definition Unit.cpp:1569
bool isDying() const
Definition Unit.h:2036
SpellInfo const * m_overrideAutoattackSpellInfo
Definition Unit.h:2896
float GetStat(Stats stat) const
Definition Unit.h:1573
void SendEnergizeSpellLog(Unit *victim, uint32 spellID, int32 damage, Powers powertype)
Definition Unit.cpp:2974
void UpdateSpeed(UnitMoveType mtype, bool forced)
Definition Unit.cpp:4173
void SendDurabilityLoss(Player *receiver, uint32 percent)
Definition Unit.cpp:6321
void AttackerStateUpdate(Unit *victim, WeaponAttackType attType=WeaponAttackType::BASE_ATTACK, bool extra=false)
uint64 GetOwnerGUID() const
Definition Unit.h:2050
void RemoveAllAuras()
bool IsControlledByPlayer() const
Definition Unit.h:2100
void RestoreDisplayId()
Definition Unit.cpp:5946
float GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const
void HandleEmoteCommand(uint32 anim_id)
void removeFollower(FollowerReference *)
Definition Unit.h:2598
bool m_canDualWield
Definition Unit.h:1454
int32 GetMaxNegativeAuraModifierByAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
Definition Unit.cpp:1555
virtual SpellSchoolMask GetMeleeDamageSchoolMask() const
Definition Unit.cpp:5801
Minion * GetFirstMinion() const
Definition Unit.cpp:2375
SheathState GetSheath() const
Definition Unit.h:1685
bool HandleSpellClick(Unit *clicker, int8 seatId=-1)
Definition Unit.cpp:8160
bool HasBreakableByDamageAuraType(AuraType type, uint32 excludeAura=0) const
Definition Unit.cpp:579
bool IsAlwaysVisibleFor(WorldObject const *seer) const override
Definition Unit.cpp:4128
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:1617
AuraEffect * GetDummyAuraEffect(SpellFamilyNames name, uint32 iconId, uint8 effIndex) const
uint32 getTransForm() const
Definition Unit.h:2508
void SetMaxPower(Powers power, int32 val)
Definition Unit.cpp:5317
float GetUnitParryChance() const
Definition Unit.cpp:1083
bool HasSharedVision() const
Definition Unit.h:2163
PetAuraSet m_petAuras
Definition Unit.h:2708
bool SetDisableGravity(bool disable, bool packetOnly=false)
Definition Unit.cpp:9156
Powers getPowerType() const
Definition Unit.h:1651
virtual void setDeathState(DeathState s)
Definition Unit.cpp:4365
void SetMaxHealth(uint32 val)
Definition Unit.cpp:5206
void GetPartyMembers(std::list< Unit * > &units)
Definition Unit.cpp:7272
FollowerRefManager m_FollowingRefManager
Definition Unit.h:2977
uint32 m_interruptMask
Definition Unit.h:2909
uint32 GetCombatRatingDamageReduction(CombatRating cr, float rate, float cap, uint32 damage) const
Definition Unit.cpp:7632
friend class VehicleJoinEvent
Definition Unit.h:2734
int32 GetTotalAuraModifier(AuraType auratype) const
void SendChangeCurrentVictimOpcode(HostileReference *pHostileReference)
Definition Unit.cpp:8792
uint32 GetCreatureTypeMask() const
Definition Unit.cpp:4925
bool IsVendor() const
Definition Unit.h:1825
bool IsFlying() const
Definition Unit.h:2780
bool HasBreakableByDamageCrowdControlAura(Unit *excludeCasterChannel=NULL) const
Definition Unit.cpp:589
uint8 getLevel() const
Definition Unit.h:1528
AuraApplicationMap & GetAppliedAuras()
Definition Unit.h:2204
std::list< AuraEffect * > AuraEffectList
Definition Unit.h:1383
int32 GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const
void InitStatBuffMods()
Definition Unit.cpp:1589
int32 m_procDeep
Definition Unit.h:2885
void SetAttackTime(WeaponAttackType att, uint32 val)
Definition Unit.h:1678
void SetMinionGUID(uint64 guid)
Definition Unit.h:2067
void ClearDiminishings()
Definition Unit.h:1412
void GetDispellableAuraList(Unit *caster, uint32 dispelMask, DispelChargesList &dispelList)
bool IsSpiritHealer() const
Definition Unit.h:1861
VisibleAuraMap m_visibleAuras
Definition Unit.h:2914
void SetLevel(uint8 lvl)
Definition Unit.cpp:5150
uint32 GetCreateMana() const
Definition Unit.h:2329
uint32 SpellNonMeleeDamageLog(Unit *victim, uint32 spellID, uint32 damage)
bool IsServiceProvider() const
Definition Unit.cpp:3786
MountCapabilityEntry const * GetMountCapability(uint32 mountType) const
Definition Unit.cpp:3728
bool IsAuctioner() const
Definition Unit.h:1873
bool IsTotem() const
Definition Unit.h:1519
void ChangeSeat(int8 seatId, bool next=true)
Definition Unit.cpp:8274
void SetInFront(WorldObject const *target)
Definition Unit.cpp:9108
void ApplyDiminishingAura(DiminishingGroup group, bool apply)
void ApplySpellDispelImmunity(const SpellInfo *spellProto, DispelType type, bool apply)
Definition Unit.cpp:3611
int32 GetMaxPositiveAuraModifierByAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
Definition Unit.cpp:1541
AuraStateAurasMap m_auraStateAuras
Definition Unit.h:2908
const MotionMaster * GetMotionMaster() const
Definition Unit.h:2609
static Player * GetPlayer(WorldObject &object, uint64 guid)
Definition Unit.cpp:4900
float m_speed_rate[MAX_MOVE_TYPE]
Definition Unit.h:2916
int32 SpellBaseHealingBonusTaken(SpellSchoolMask schoolMask) const
Definition Unit.cpp:3403
void setPowerType(Powers power)
Definition Unit.cpp:2079
AuraList & GetSingleCastAuras()
Definition Unit.h:2247
void SetFieldPowerType(uint32 powerType)
Definition Unit.h:1655
float MeleeSpellMissChance(Unit const *victim, WeaponAttackType attType, uint32 spellId) const
Definition Unit.cpp:7421
bool IsAlwaysDetectableFor(WorldObject const *seer) const override
Definition Unit.cpp:4147
bool IsValidAssistTarget(Unit const *target) const
Definition Unit.cpp:3930
void AddUnitTypeMask(uint32 mask)
Definition Unit.h:1499
void SetCanDualWield(bool value)
Definition Unit.h:1441
Vehicle * GetVehicleKit() const
Definition Unit.h:2739
void SendPlaySpellVisualKit(uint32 SpellVisualId, uint32 Duration, int32 Type)
Definition Unit.cpp:7377
float m_modSpellHitChance
Definition Unit.h:2389
void TriggerAurasProcOnEvent(CalcDamageInfo &damageInfo)
Guardian * GetGuardianPet() const
Definition Unit.cpp:2390
uint64 GetCritterGUID() const
Definition Unit.h:2095
void SendThreatListUpdate()
Definition Unit.cpp:8756
std::list< DynamicObject * > DynObjectList
Definition Unit.h:2887
bool IsHostileTo(Unit const *unit) const
Definition Unit.cpp:2278
void ExitVehicle(Position const *exitPosition=NULL)
Definition Unit.cpp:8306
UnitAI * i_disabledAI
Definition Unit.h:2867
AuraEffectList m_modAuras[TOTAL_AURAS]
Definition Unit.h:2905
void SetStandState(uint8 state)
Definition Unit.cpp:5902
void _ApplyAuraEffect(Aura *aura, uint8 effIndex)
uint32 GetInterruptMask() const
Definition Unit.h:2479
void DeMorph()
Definition Unit.cpp:1536
void RemoveAllMinionsByEntry(uint32 entry)
Definition Unit.cpp:2604
AuraMap & GetOwnedAuras()
Definition Unit.h:2188
int32 SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) const
Definition Unit.cpp:3055
bool IsSpiritService() const
Definition Unit.h:1882
Aura * GetAuraOfRankedSpell(uint32 spellId, uint64 casterGUID=0, uint64 itemCasterGUID=0, uint32 reqEffMask=0) const
virtual void UpdateUnderwaterState(Map *m, float x, float y, float z)
Definition Unit.cpp:1491
bool IsFalling() const
Definition Unit.cpp:8388
virtual void ProhibitSpellSchool(SpellSchoolMask, uint32)
Definition Unit.h:2349
bool AttackStop()
void KnockbackFrom(float x, float y, float speedXY, float speedZ)
Definition Unit.cpp:7597
int32 GetCurrentSpellCastTime(uint32 spell_id) const
Definition Unit.cpp:1456
bool HandleAuraProcOnPowerAmount(Unit *victim, uint32 damage, AuraEffect *triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
Definition UnitProc.cpp:64
uint64 GetCharmerOrOwnerOrOwnGUID() const
Definition Unit.cpp:5811
float CalculateLevelPenalty(SpellInfo const *spellProto) const
void SetShapeshiftForm(ShapeshiftForm form)
Definition Unit.cpp:4931
void GetAllMinionsByEntry(std::list< Creature * > &Minions, uint32 entry)
Definition Unit.cpp:2592
bool IsInPartyWith(Unit const *unit) const
Definition Unit.cpp:7234
void Update(uint32 time) OVERRIDE
Definition Unit.cpp:293
bool m_cleanupDone
Definition Unit.h:2983
void ProcDamageAndSpell(Unit *victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType=WeaponAttackType::BASE_ATTACK, SpellInfo const *procSpell=NULL, SpellInfo const *procAura=NULL)
Definition UnitProc.cpp:53
SharedVisionList m_sharedVision
Definition Unit.h:2919
void SetInCombatWith(Unit *enemy)
bool HasAuraTypeWithMiscvalue(AuraType auratype, int32 miscvalue) const
void SendPetAIReaction(ObjectGuid UnitGUID) const
Definition Unit.cpp:5858
void SetStandFlags(uint8 flags)
Definition Unit.h:1733
void ApplyResistanceBuffModsMod(SpellSchools school, bool positive, float val, bool apply)
Definition Unit.cpp:1579
void RemoveMovementImpairingAuras()
bool _isWalkingBeforeCharm
Definition Unit.h:2986
void RemoveCharmAuras()
Definition Unit.cpp:2904
bool IsInCombat() const
Definition Unit.h:1896
bool IsWalking() const
Definition Unit.h:2007
float GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo *spellProto) const
void ModSpellCastTime(SpellInfo const *spellProto, int32 &castTime, Spell *spell=NULL)
Definition Unit.cpp:4821
bool IsSitState() const
Definition Unit.cpp:5889
Aura * GetOwnedAura(uint32 spellId, uint64 casterGUID=0, uint64 itemCasterGUID=0, uint32 reqEffMask=0, Aura *except=NULL) const
void SetPetGUID(uint64 guid)
Definition Unit.h:2083
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
Definition Unit.cpp:1365
bool isTurning() const
Definition Unit.h:2775
float GetTotalAttackPowerValue(WeaponAttackType attType) const
Definition Unit.cpp:5118
float m_threatModifier[MAX_SPELL_SCHOOL]
Definition Unit.h:2392
void BuildValuesUpdate(uint8 updatetype, ByteBuffer *data, Player *target) const override
Definition Unit.cpp:9361
void CalculateMeleeDamage(Unit *victim, uint32 damage, CalcDamageInfo *damageInfo, WeaponAttackType attackType=WeaponAttackType::BASE_ATTACK)
bool SetWaterWalking(bool enable, bool packetOnly=false)
Definition Unit.cpp:9245
void MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath=false, bool forceDestination=false)
Definition Unit.cpp:358
uint8 getRace() const
Definition Unit.h:1535
bool HasNegativeAuraWithInterruptFlag(uint32 flag, uint64 guid=0) const
uint32 GetDoTsByCaster(uint64 casterGUID) const
bool IsSpiritGuide() const
Definition Unit.h:1865
float GetWeaponProcChance() const
float GetUnitCriticalChance(WeaponAttackType attackType, const Unit *victim) const
Definition Unit.cpp:1155
bool isDead() const
Definition Unit.h:2040
void CombatStopWithPets(bool includingCast=false)
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition Unit.h:2363
SpellMissInfo SpellHitResult(Unit *victim, SpellInfo const *spellInfo, bool canReflect=false)
Definition Unit.cpp:1007
WorldObject(bool isWorldObject)
Definition Object.cpp:1514
MovementInfo m_movementInfo
Definition Object.h:807
uint32 damageSchoolMask
Definition Unit.h:1011
uint32 blocked_amount
Definition Unit.h:1015
MeleeHitOutcome hitOutCome
Definition Unit.h:1024
uint32 procAttacker
Definition Unit.h:1020
uint32 procVictim
Definition Unit.h:1021
uint32 cleanDamage
Definition Unit.h:1023
VictimState TargetState
Definition Unit.h:1017
uint32 absorb
Definition Unit.h:1013
uint32 resist
Definition Unit.h:1014
uint32 damage
Definition Unit.h:1012
uint32 procEx
Definition Unit.h:1022
uint32 HitInfo
Definition Unit.h:1016
Unit * attacker
Definition Unit.h:1009
Unit * target
Definition Unit.h:1010
WeaponAttackType attackType
Definition Unit.h:1019
void RestoreState()
Definition Unit.cpp:5554
void SaveStayPosition()
Definition Unit.cpp:9077
bool IsCommandAttack() const
Definition Unit.h:1293
CharmInfo(Unit *unit)
Definition Unit.cpp:5536
float _stayY
Definition Unit.h:1322
bool IsReturning() const
Definition Unit.h:1301
void SetIsCommandFollow(bool val)
Definition Unit.cpp:9072
bool IsAtStay() const
Definition Unit.h:1297
void BuildActionBar(WorldPacket *data) const
Definition Unit.cpp:5778
uint32 GetPetNumber() const
Definition Unit.h:1241
void LoadPetActionBar(const std::string &data)
Definition Unit.cpp:5746
GlobalCooldownMgr & GetGlobalCooldownMgr()
Definition Unit.h:1287
void SetActionBar(uint8 index, uint32 spellOrAction, ActiveStates type)
Definition Unit.h:1271
bool _isAtStay
Definition Unit.h:1318
bool AddSpellToActionBar(SpellInfo const *spellInfo, ActiveStates newstate=ACT_DECIDE, uint8 preferredSlot=0)
Definition Unit.cpp:5676
void InitPossessCreateSpells()
Definition Unit.cpp:5596
void SetIsAtStay(bool val)
Definition Unit.cpp:9093
float _stayX
Definition Unit.h:1321
CharmSpellInfo * GetCharmSpell(uint8 index)
Definition Unit.h:1282
void SetPetNumber(uint32 petnumber, bool statwindow)
Definition Unit.cpp:5737
float _stayZ
Definition Unit.h:1323
void SetIsFollowing(bool val)
Definition Unit.cpp:9098
void InitPetActionBar()
Definition Unit.cpp:5561
bool _isCommandFollow
Definition Unit.h:1317
CommandStates GetCommandState() const
Definition Unit.h:1251
UnitActionBarEntry PetActionBar[MAX_UNIT_ACTION_BAR_INDEX]
Definition Unit.h:1307
~CharmInfo()
Definition Unit.cpp:5551
void SetIsReturning(bool val)
Definition Unit.cpp:9103
void InitCharmCreateSpells()
Definition Unit.cpp:5626
bool RemoveSpellFromActionBar(uint32 spell_id)
Definition Unit.cpp:5708
CommandStates _CommandState
Definition Unit.h:1309
void GetStayPosition(float &x, float &y, float &z) const
Definition Unit.cpp:9086
UnitActionBarEntry const * GetActionBarEntry(uint8 index) const
Definition Unit.h:1275
void SetSpellAutocast(SpellInfo const *spellInfo, bool state)
Definition Unit.cpp:5784
bool IsFollowing() const
Definition Unit.h:1299
bool _isFollowing
Definition Unit.h:1319
bool HasCommandState(CommandStates state) const
Definition Unit.h:1255
bool _isCommandAttack
Definition Unit.h:1316
ReactStates _oldReactState
Definition Unit.h:1314
GlobalCooldownMgr m_GlobalCooldownMgr
Definition Unit.h:1325
void ToggleCreatureAutocast(SpellInfo const *spellInfo, bool apply)
Definition Unit.cpp:5727
void SetCommandState(CommandStates st)
Definition Unit.h:1247
void InitEmptyActionBar(bool withAttack=true)
Definition Unit.cpp:5586
void SetIsCommandAttack(bool val)
Definition Unit.cpp:9067
bool _isReturning
Definition Unit.h:1320
bool IsCommandFollow() const
Definition Unit.h:1295
Unit * _unit
Definition Unit.h:1306
bool _barInit
Definition Unit.h:1311
uint32 _petnumber
Definition Unit.h:1310
CharmSpellInfo _charmspells[4]
Definition Unit.h:1308
MeleeHitOutcome hitOutCome
Definition Unit.h:872
uint32 mitigated_damage
Definition Unit.h:869
uint32 absorbed_damage
Definition Unit.h:868
CleanDamage(uint32 mitigated, uint32 absorbed, WeaponAttackType _attackType, MeleeHitOutcome _hitOutCome)
Definition Unit.h:864
WeaponAttackType attackType
Definition Unit.h:871
uint32 nameLength[MAX_DECLINED_NAME_CASES]
Definition Unit.h:1103
std::string name[MAX_DECLINED_NAME_CASES]
Definition Unit.h:1102
uint32 hitCount
Definition Unit.h:824
DiminishingReturn(DiminishingGroup group, uint32 t, uint32 count)
Definition Unit.h:819
DiminishingGroup DRGroup
Definition Unit.h:821
uint32 hitTime
Definition Unit.h:823
uint16 stack
Definition Unit.h:822
GlobalCooldown(uint32 _dur=0, uint32 _time=0)
Definition Unit.h:1119
uint32 cast_time
Definition Unit.h:1123
uint32 duration
Definition Unit.h:1122
uint64 GetTargetGUID() const
Definition Unit.h:1076
void Set(uint64 guid, uint32 pct)
Definition Unit.h:1085
uint32 GetThreatPct() const
Definition Unit.h:1080
uint32 _threatPct
Definition Unit.h:1074
uint64 _targetGUID
Definition Unit.h:1073
void ModifyThreatPct(int32 amount)
Definition Unit.h:1091
uint32 spellId
Definition Unit.h:377
SpellImmune()
Definition Unit.h:375
uint32 type
Definition Unit.h:376
uint32 schoolMask
Definition Unit.h:1040
SpellNonMeleeDamage(Unit *_attacker, Unit *_target, uint32 _SpellID, uint32 _schoolMask)
Definition Unit.h:1030
uint32 cleanDamage
Definition Unit.h:1048
SpellPeriodicAuraLogInfo(AuraEffect const *_auraEff, uint32 _damage, uint32 _overDamage, uint32 _absorb, uint32 _resist, uint32 _power, float _multiplier, bool _critical)
Definition Unit.h:1053
AuraEffect const * auraEff
Definition Unit.h:1057
Definition SpellMgr.h:263
Definition Unit.h:1176
ActiveStates GetType() const
Definition Unit.h:1183
void SetActionAndType(uint32 action, ActiveStates type)
Definition Unit.h:1197
bool IsActionBarForSpell() const
Definition Unit.h:1191
void SetType(ActiveStates type)
Definition Unit.h:1202
UnitActionBarEntry()
Definition Unit.h:1177
void SetAction(uint32 action)
Definition Unit.h:1207
uint32 packedData
Definition Unit.h:1180
uint32 GetAction() const
Definition Unit.h:1187