TrinityCore
Unit.h File Reference
#include "Object.h"
#include "CombatManager.h"
#include "OptionalFwd.h"
#include "SpellAuraDefines.h"
#include "ThreatManager.h"
#include "Timer.h"
#include "UnitDefines.h"
#include "Util.h"
#include <boost/container/flat_set.hpp>
#include <array>
#include <map>
+ Include dependency graph for Unit.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  DispelableAura
 
struct  DiminishingReturn
 
class  DispelInfo
 
struct  CleanDamage
 
class  DamageInfo
 
class  HealInfo
 
class  ProcEventInfo
 
struct  CalcDamageInfo
 
struct  SpellNonMeleeDamage
 
struct  SpellPeriodicAuraLogInfo
 
struct  UnitActionBarEntry
 
struct  CharmInfo
 
class  Unit
 
struct  Unit::VisibleAuraSlotCompare
 
class  Trinity::PowerPctOrderPred
 
class  Trinity::HealthPctOrderPred
 

Namespaces

 Movement
 
 Trinity
 

Macros

#define VISUAL_WAYPOINT   1
 
#define WORLD_TRIGGER   12999
 
#define ARTIFACTS_ALL_WEAPONS_GENERAL_WEAPON_EQUIPPED_PASSIVE   197886
 
#define SPELL_DH_DOUBLE_JUMP   196055
 
#define DISPLAYID_HIDDEN_MOUNT   73200
 
#define MAX_SPELL_CHARM   4
 
#define MAX_SPELL_VEHICLE   6
 
#define MAX_SPELL_POSSESS   8
 
#define MAX_SPELL_CONTROL_BAR   10
 
#define MAX_AGGRO_RESET_TIME   10
 
#define MAX_AGGRO_RADIUS   45.0f
 
#define MAX_COMBAT_RATING   32
 
#define CURRENT_FIRST_NON_MELEE_SPELL   1
 
#define CURRENT_MAX_SPELL   4
 
#define UNIT_ACTION_BUTTON_ACTION(X)   (uint32(X) & 0x00FFFFFF)
 
#define UNIT_ACTION_BUTTON_TYPE(X)   ((uint32(X) & 0xFF000000) >> 24)
 
#define MAKE_UNIT_ACTION_BUTTON(A, T)   (uint32(A) | (uint32(T) << 24))
 
#define MAX_UNIT_ACTION_BAR_INDEX   (ACTION_BAR_INDEX_END-ACTION_BAR_INDEX_START)
 
#define REACTIVE_TIMER_START   4000
 
#define MAX_REACTIVE   2
 
#define SUMMON_SLOT_PET   0
 
#define SUMMON_SLOT_TOTEM   1
 
#define MAX_TOTEM_SLOT   5
 
#define SUMMON_SLOT_MINIPET   5
 
#define SUMMON_SLOT_QUEST   6
 
#define MAX_SUMMON_SLOT   7
 
#define MAX_GAMEOBJECT_SLOT   4
 
#define ATTACK_DISPLAY_DELAY   200
 
#define MAX_PLAYER_STEALTH_DETECT_RANGE   30.0f
 

Typedefs

typedef std::list< Unit * > UnitList
 
typedef std::vector< DispelableAuraDispelChargesList
 
typedef std::unordered_multimap< uint32, uint32SpellImmuneContainer
 
typedef std::list< Player * > SharedVisionList
 
typedef UnitActionBarEntry CharmSpellInfo
 

Enumerations

enum  VictimState {
  VICTIMSTATE_INTACT = 0, VICTIMSTATE_HIT = 1, VICTIMSTATE_DODGE = 2, VICTIMSTATE_PARRY = 3,
  VICTIMSTATE_INTERRUPT = 4, VICTIMSTATE_BLOCKS = 5, VICTIMSTATE_EVADES = 6, VICTIMSTATE_IS_IMMUNE = 7,
  VICTIMSTATE_DEFLECTS = 8
}
 
enum  InventorySlot { NULL_BAG = 0, NULL_SLOT = 255 }
 
enum  UnitModifierFlatType { BASE_VALUE = 0, BASE_PCT_EXCLUDE_CREATE = 1, TOTAL_VALUE = 2, MODIFIER_TYPE_FLAT_END = 3 }
 
enum  UnitModifierPctType { BASE_PCT = 0, TOTAL_PCT = 1, MODIFIER_TYPE_PCT_END = 2 }
 
enum  WeaponDamageRange { MINDAMAGE, MAXDAMAGE }
 
enum  UnitMods {
  UNIT_MOD_STAT_STRENGTH, UNIT_MOD_STAT_AGILITY, UNIT_MOD_STAT_STAMINA, UNIT_MOD_STAT_INTELLECT,
  UNIT_MOD_HEALTH, UNIT_MOD_MANA, UNIT_MOD_RAGE, UNIT_MOD_FOCUS,
  UNIT_MOD_ENERGY, UNIT_MOD_COMBO_POINTS, UNIT_MOD_RUNES, UNIT_MOD_RUNIC_POWER,
  UNIT_MOD_SOUL_SHARDS, UNIT_MOD_LUNAR_POWER, UNIT_MOD_HOLY_POWER, UNIT_MOD_ALTERNATE,
  UNIT_MOD_MAELSTROM, UNIT_MOD_CHI, UNIT_MOD_INSANITY, UNIT_MOD_BURNING_EMBERS,
  UNIT_MOD_DEMONIC_FURY, UNIT_MOD_ARCANE_CHARGES, UNIT_MOD_FURY, UNIT_MOD_PAIN,
  UNIT_MOD_ARMOR, UNIT_MOD_RESISTANCE_HOLY, UNIT_MOD_RESISTANCE_FIRE, UNIT_MOD_RESISTANCE_NATURE,
  UNIT_MOD_RESISTANCE_FROST, UNIT_MOD_RESISTANCE_SHADOW, UNIT_MOD_RESISTANCE_ARCANE, UNIT_MOD_ATTACK_POWER,
  UNIT_MOD_ATTACK_POWER_RANGED, UNIT_MOD_DAMAGE_MAINHAND, UNIT_MOD_DAMAGE_OFFHAND, UNIT_MOD_DAMAGE_RANGED,
  UNIT_MOD_END, UNIT_MOD_STAT_START = UNIT_MOD_STAT_STRENGTH, UNIT_MOD_STAT_END = UNIT_MOD_STAT_INTELLECT + 1, UNIT_MOD_RESISTANCE_START = UNIT_MOD_ARMOR,
  UNIT_MOD_RESISTANCE_END = UNIT_MOD_RESISTANCE_ARCANE + 1, UNIT_MOD_POWER_START = UNIT_MOD_MANA, UNIT_MOD_POWER_END = UNIT_MOD_PAIN + 1
}
 
enum  BaseModGroup {
  CRIT_PERCENTAGE, RANGED_CRIT_PERCENTAGE, OFFHAND_CRIT_PERCENTAGE, SHIELD_BLOCK_VALUE,
  BASEMOD_END
}
 
enum  BaseModType { FLAT_MOD, PCT_MOD, MOD_END }
 
enum  DeathState {
  ALIVE = 0, JUST_DIED = 1, CORPSE = 2, DEAD = 3,
  JUST_RESPAWNED = 4
}
 
enum  UnitState : uint32 {
  UNIT_STATE_DIED = 0x00000001, UNIT_STATE_MELEE_ATTACKING = 0x00000002, UNIT_STATE_CHARMED = 0x00000004, UNIT_STATE_STUNNED = 0x00000008,
  UNIT_STATE_ROAMING = 0x00000010, UNIT_STATE_CHASE = 0x00000020, UNIT_STATE_FOCUSING = 0x00000040, UNIT_STATE_FLEEING = 0x00000080,
  UNIT_STATE_IN_FLIGHT = 0x00000100, UNIT_STATE_FOLLOW = 0x00000200, UNIT_STATE_ROOT = 0x00000400, UNIT_STATE_CONFUSED = 0x00000800,
  UNIT_STATE_DISTRACTED = 0x00001000, UNIT_STATE_ISOLATED = 0x00002000, UNIT_STATE_ATTACK_PLAYER = 0x00004000, UNIT_STATE_CASTING = 0x00008000,
  UNIT_STATE_POSSESSED = 0x00010000, UNIT_STATE_CHARGING = 0x00020000, UNIT_STATE_JUMPING = 0x00040000, UNIT_STATE_MOVE = 0x00100000,
  UNIT_STATE_ROTATING = 0x00200000, UNIT_STATE_EVADE = 0x00400000, UNIT_STATE_ROAMING_MOVE = 0x00800000, UNIT_STATE_CONFUSED_MOVE = 0x01000000,
  UNIT_STATE_FLEEING_MOVE = 0x02000000, UNIT_STATE_CHASE_MOVE = 0x04000000, UNIT_STATE_FOLLOW_MOVE = 0x08000000, UNIT_STATE_IGNORE_PATHFINDING = 0x10000000,
  UNIT_STATE_ALL_STATE_SUPPORTED, UNIT_STATE_UNATTACKABLE = UNIT_STATE_IN_FLIGHT, UNIT_STATE_MOVING = UNIT_STATE_ROAMING_MOVE | UNIT_STATE_CONFUSED_MOVE | UNIT_STATE_FLEEING_MOVE | UNIT_STATE_CHASE_MOVE | UNIT_STATE_FOLLOW_MOVE, UNIT_STATE_CONTROLLED = UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING,
  UNIT_STATE_CANT_CLIENT_CONTROL = UNIT_STATE_CHARMED | UNIT_STATE_FLEEING | UNIT_STATE_CONFUSED | UNIT_STATE_POSSESSED, UNIT_STATE_LOST_CONTROL = UNIT_STATE_CONTROLLED | UNIT_STATE_POSSESSED | UNIT_STATE_JUMPING | UNIT_STATE_CHARGING, UNIT_STATE_CANNOT_AUTOATTACK = UNIT_STATE_CONTROLLED | UNIT_STATE_CHARGING | UNIT_STATE_CASTING, UNIT_STATE_SIGHTLESS = UNIT_STATE_LOST_CONTROL | UNIT_STATE_EVADE,
  UNIT_STATE_CANNOT_TURN = UNIT_STATE_LOST_CONTROL | UNIT_STATE_ROTATING | UNIT_STATE_FOCUSING, UNIT_STATE_NOT_MOVE = UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DIED | UNIT_STATE_DISTRACTED, UNIT_STATE_ALL_ERASABLE = UNIT_STATE_ALL_STATE_SUPPORTED & ~(UNIT_STATE_IGNORE_PATHFINDING), UNIT_STATE_ALL_STATE = 0xffffffff
}
 
enum  CombatRating {
  CR_AMPLIFY = 0, CR_DEFENSE_SKILL = 1, CR_DODGE = 2, CR_PARRY = 3,
  CR_BLOCK = 4, CR_HIT_MELEE = 5, CR_HIT_RANGED = 6, CR_HIT_SPELL = 7,
  CR_CRIT_MELEE = 8, CR_CRIT_RANGED = 9, CR_CRIT_SPELL = 10, CR_CORRUPTION = 11,
  CR_CORRUPTION_RESISTANCE = 12, CR_SPEED = 13, CR_RESILIENCE_CRIT_TAKEN = 14, CR_RESILIENCE_PLAYER_DAMAGE = 15,
  CR_LIFESTEAL = 16, CR_HASTE_MELEE = 17, CR_HASTE_RANGED = 18, CR_HASTE_SPELL = 19,
  CR_AVOIDANCE = 20, CR_STURDINESS = 21, CR_UNUSED_7 = 22, CR_EXPERTISE = 23,
  CR_ARMOR_PENETRATION = 24, CR_MASTERY = 25, CR_PVP_POWER = 26, CR_CLEAVE = 27,
  CR_VERSATILITY_DAMAGE_DONE = 28, CR_VERSATILITY_HEALING_DONE = 29, CR_VERSATILITY_DAMAGE_TAKEN = 30, CR_UNUSED_12 = 31
}
 
enum  DamageEffectType : uint8 {
  DIRECT_DAMAGE = 0, SPELL_DIRECT_DAMAGE = 1, DOT = 2, HEAL = 3,
  NODAMAGE = 4, SELF_DAMAGE = 5
}
 
enum  UnitTypeMask {
  UNIT_MASK_NONE = 0x00000000, UNIT_MASK_SUMMON = 0x00000001, UNIT_MASK_MINION = 0x00000002, UNIT_MASK_GUARDIAN = 0x00000004,
  UNIT_MASK_TOTEM = 0x00000008, UNIT_MASK_PET = 0x00000010, UNIT_MASK_VEHICLE = 0x00000020, UNIT_MASK_PUPPET = 0x00000040,
  UNIT_MASK_HUNTER_PET = 0x00000080, UNIT_MASK_CONTROLABLE_GUARDIAN = 0x00000100, UNIT_MASK_ACCESSORY = 0x00000200
}
 
enum  MeleeHitOutcome : uint8 {
  MELEE_HIT_EVADE, MELEE_HIT_MISS, MELEE_HIT_DODGE, MELEE_HIT_BLOCK,
  MELEE_HIT_PARRY, MELEE_HIT_GLANCING, MELEE_HIT_CRIT, MELEE_HIT_CRUSHING,
  MELEE_HIT_NORMAL
}
 
enum  CurrentSpellTypes : uint8 { CURRENT_MELEE_SPELL = 0, CURRENT_GENERIC_SPELL = 1, CURRENT_CHANNELED_SPELL = 2, CURRENT_AUTOREPEAT_SPELL = 3 }
 
enum  CharmType { CHARM_TYPE_CHARM, CHARM_TYPE_POSSESS, CHARM_TYPE_VEHICLE, CHARM_TYPE_CONVERT }
 
enum  ActionBarIndex { ACTION_BAR_INDEX_START = 0, ACTION_BAR_INDEX_PET_SPELL_START = 3, ACTION_BAR_INDEX_PET_SPELL_END = 7, ACTION_BAR_INDEX_END = 10 }
 
enum  ReactiveType { REACTIVE_DEFENSE = 0, REACTIVE_DEFENSE_2 = 1 }
 

Functions

uint32 createProcHitMask (SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
 
void SetUnitCurrentCastSpell (Unit *unit, Spell *spell)
 

Variables

TC_GAME_API float baseMoveSpeed [MAX_MOVE_TYPE]
 
TC_GAME_API float playerBaseMoveSpeed [MAX_MOVE_TYPE]
 

Macro Definition Documentation

◆ ARTIFACTS_ALL_WEAPONS_GENERAL_WEAPON_EQUIPPED_PASSIVE

#define ARTIFACTS_ALL_WEAPONS_GENERAL_WEAPON_EQUIPPED_PASSIVE   197886

◆ ATTACK_DISPLAY_DELAY

#define ATTACK_DISPLAY_DELAY   200

◆ CURRENT_FIRST_NON_MELEE_SPELL

#define CURRENT_FIRST_NON_MELEE_SPELL   1

◆ CURRENT_MAX_SPELL

#define CURRENT_MAX_SPELL   4

◆ DISPLAYID_HIDDEN_MOUNT

#define DISPLAYID_HIDDEN_MOUNT   73200

◆ MAKE_UNIT_ACTION_BUTTON

#define MAKE_UNIT_ACTION_BUTTON (   A,
 
)    (uint32(A) | (uint32(T) << 24))

◆ MAX_AGGRO_RADIUS

#define MAX_AGGRO_RADIUS   45.0f

◆ MAX_AGGRO_RESET_TIME

#define MAX_AGGRO_RESET_TIME   10

◆ MAX_COMBAT_RATING

#define MAX_COMBAT_RATING   32

◆ MAX_GAMEOBJECT_SLOT

#define MAX_GAMEOBJECT_SLOT   4

◆ MAX_PLAYER_STEALTH_DETECT_RANGE

#define MAX_PLAYER_STEALTH_DETECT_RANGE   30.0f

◆ MAX_REACTIVE

#define MAX_REACTIVE   2

◆ MAX_SPELL_CHARM

#define MAX_SPELL_CHARM   4

◆ MAX_SPELL_CONTROL_BAR

#define MAX_SPELL_CONTROL_BAR   10

◆ MAX_SPELL_POSSESS

#define MAX_SPELL_POSSESS   8

◆ MAX_SPELL_VEHICLE

#define MAX_SPELL_VEHICLE   6

◆ MAX_SUMMON_SLOT

#define MAX_SUMMON_SLOT   7

◆ MAX_TOTEM_SLOT

#define MAX_TOTEM_SLOT   5

◆ MAX_UNIT_ACTION_BAR_INDEX

#define MAX_UNIT_ACTION_BAR_INDEX   (ACTION_BAR_INDEX_END-ACTION_BAR_INDEX_START)

◆ REACTIVE_TIMER_START

#define REACTIVE_TIMER_START   4000

◆ SPELL_DH_DOUBLE_JUMP

#define SPELL_DH_DOUBLE_JUMP   196055

◆ SUMMON_SLOT_MINIPET

#define SUMMON_SLOT_MINIPET   5

◆ SUMMON_SLOT_PET

#define SUMMON_SLOT_PET   0

◆ SUMMON_SLOT_QUEST

#define SUMMON_SLOT_QUEST   6

◆ SUMMON_SLOT_TOTEM

#define SUMMON_SLOT_TOTEM   1

◆ UNIT_ACTION_BUTTON_ACTION

#define UNIT_ACTION_BUTTON_ACTION (   X)    (uint32(X) & 0x00FFFFFF)

◆ UNIT_ACTION_BUTTON_TYPE

#define UNIT_ACTION_BUTTON_TYPE (   X)    ((uint32(X) & 0xFF000000) >> 24)

◆ VISUAL_WAYPOINT

#define VISUAL_WAYPOINT   1

◆ WORLD_TRIGGER

#define WORLD_TRIGGER   12999

Typedef Documentation

◆ CharmSpellInfo

◆ DispelChargesList

typedef std::vector<DispelableAura> DispelChargesList

◆ SharedVisionList

typedef std::list<Player*> SharedVisionList

◆ SpellImmuneContainer

typedef std::unordered_multimap<uint32 , uint32 > SpellImmuneContainer

◆ UnitList

typedef std::list<Unit*> UnitList

Enumeration Type Documentation

◆ ActionBarIndex

Enumerator
ACTION_BAR_INDEX_START 
ACTION_BAR_INDEX_PET_SPELL_START 
ACTION_BAR_INDEX_PET_SPELL_END 
ACTION_BAR_INDEX_END 
637 {
642 };
Definition: Unit.h:641
Definition: Unit.h:639
Definition: Unit.h:640
Definition: Unit.h:638

◆ BaseModGroup

Enumerator
CRIT_PERCENTAGE 
RANGED_CRIT_PERCENTAGE 
OFFHAND_CRIT_PERCENTAGE 
SHIELD_BLOCK_VALUE 
BASEMOD_END 
211 {
217 };
Definition: Unit.h:212
Definition: Unit.h:214
Definition: Unit.h:215
Definition: Unit.h:216
Definition: Unit.h:213

◆ BaseModType

Enumerator
FLAT_MOD 
PCT_MOD 
MOD_END 
220 {
221  FLAT_MOD,
222  PCT_MOD,
223  MOD_END
224 };
Definition: Unit.h:221
Definition: Unit.h:223
Definition: Unit.h:222

◆ CharmType

enum CharmType
Enumerator
CHARM_TYPE_CHARM 
CHARM_TYPE_POSSESS 
CHARM_TYPE_VEHICLE 
CHARM_TYPE_CONVERT 
627 {
632 };
Definition: Unit.h:630
Definition: Unit.h:628
Definition: Unit.h:629
Definition: Unit.h:631

◆ CombatRating

Enumerator
CR_AMPLIFY 
CR_DEFENSE_SKILL 
CR_DODGE 
CR_PARRY 
CR_BLOCK 
CR_HIT_MELEE 
CR_HIT_RANGED 
CR_HIT_SPELL 
CR_CRIT_MELEE 
CR_CRIT_RANGED 
CR_CRIT_SPELL 
CR_CORRUPTION 
CR_CORRUPTION_RESISTANCE 
CR_SPEED 
CR_RESILIENCE_CRIT_TAKEN 
CR_RESILIENCE_PLAYER_DAMAGE 
CR_LIFESTEAL 
CR_HASTE_MELEE 
CR_HASTE_RANGED 
CR_HASTE_SPELL 
CR_AVOIDANCE 
CR_STURDINESS 
CR_UNUSED_7 
CR_EXPERTISE 
CR_ARMOR_PENETRATION 
CR_MASTERY 
CR_PVP_POWER 
CR_CLEAVE 
CR_VERSATILITY_DAMAGE_DONE 
CR_VERSATILITY_HEALING_DONE 
CR_VERSATILITY_DAMAGE_TAKEN 
CR_UNUSED_12 
291 {
292  CR_AMPLIFY = 0,
293  CR_DEFENSE_SKILL = 1,
294  CR_DODGE = 2,
295  CR_PARRY = 3,
296  CR_BLOCK = 4,
297  CR_HIT_MELEE = 5,
298  CR_HIT_RANGED = 6,
299  CR_HIT_SPELL = 7,
300  CR_CRIT_MELEE = 8,
301  CR_CRIT_RANGED = 9,
302  CR_CRIT_SPELL = 10,
303  CR_CORRUPTION = 11,
305  CR_SPEED = 13,
308  CR_LIFESTEAL = 16,
309  CR_HASTE_MELEE = 17,
310  CR_HASTE_RANGED = 18,
311  CR_HASTE_SPELL = 19,
312  CR_AVOIDANCE = 20,
313  CR_STURDINESS = 21,
314  CR_UNUSED_7 = 22,
315  CR_EXPERTISE = 23,
317  CR_MASTERY = 25,
318  CR_PVP_POWER = 26,
319  CR_CLEAVE = 27,
323  CR_UNUSED_12 = 31
324 };
Definition: Unit.h:319
Definition: Unit.h:296
Definition: Unit.h:303
Definition: Unit.h:294
Definition: Unit.h:320
Definition: Unit.h:299
Definition: Unit.h:315
Definition: Unit.h:310
Definition: Unit.h:311
Definition: Unit.h:298
Definition: Unit.h:292
Definition: Unit.h:301
Definition: Unit.h:314
Definition: Unit.h:304
Definition: Unit.h:297
Definition: Unit.h:322
Definition: Unit.h:305
Definition: Unit.h:307
Definition: Unit.h:317
Definition: Unit.h:312
Definition: Unit.h:302
Definition: Unit.h:309
Definition: Unit.h:321
Definition: Unit.h:323
Definition: Unit.h:316
Definition: Unit.h:295
Definition: Unit.h:308
Definition: Unit.h:318
Definition: Unit.h:306
Definition: Unit.h:293
Definition: Unit.h:300
Definition: Unit.h:313

◆ CurrentSpellTypes

Enumerator
CURRENT_MELEE_SPELL 
CURRENT_GENERIC_SPELL 
CURRENT_CHANNELED_SPELL 
CURRENT_AUTOREPEAT_SPELL 
578  : uint8
579 {
584 };
Definition: Unit.h:581
Definition: Unit.h:580
Definition: Unit.h:583
Definition: Unit.h:582
uint8_t uint8
Definition: Define.h:154

◆ DamageEffectType

Enumerator
DIRECT_DAMAGE 
SPELL_DIRECT_DAMAGE 
DOT 
HEAL 
NODAMAGE 
SELF_DAMAGE 
328  : uint8
329 {
330  DIRECT_DAMAGE = 0, // used for normal weapon damage (not for class abilities or spells)
331  SPELL_DIRECT_DAMAGE = 1, // spell/class abilities damage
332  DOT = 2,
333  HEAL = 3,
334  NODAMAGE = 4, // used also in case when damage applied to health but not applied to spell channelInterruptFlags/etc
335  SELF_DAMAGE = 5
336 };
Definition: Unit.h:330
Definition: Unit.h:331
Definition: Unit.h:332
Definition: Unit.h:335
Definition: Unit.h:334
Definition: Unit.h:333
uint8_t uint8
Definition: Define.h:154

◆ DeathState

enum DeathState
Enumerator
ALIVE 
JUST_DIED 
CORPSE 
DEAD 
JUST_RESPAWNED 
227 {
228  ALIVE = 0,
229  JUST_DIED = 1,
230  CORPSE = 2,
231  DEAD = 3,
232  JUST_RESPAWNED = 4
233 };
Definition: Unit.h:231
Definition: Unit.h:229
Definition: Unit.h:228
Definition: Unit.h:230
Definition: Unit.h:232

◆ InventorySlot

Enumerator
NULL_BAG 
NULL_SLOT 
62 {
63  NULL_BAG = 0,
64  NULL_SLOT = 255
65 };
Definition: Unit.h:64
Definition: Unit.h:63

◆ MeleeHitOutcome

Enumerator
MELEE_HIT_EVADE 
MELEE_HIT_MISS 
MELEE_HIT_DODGE 
MELEE_HIT_BLOCK 
MELEE_HIT_PARRY 
MELEE_HIT_GLANCING 
MELEE_HIT_CRIT 
MELEE_HIT_CRUSHING 
MELEE_HIT_NORMAL 
369  : uint8
370 {
373 };
Definition: Unit.h:371
Definition: Unit.h:371
Definition: Unit.h:371
Definition: Unit.h:372
Definition: Unit.h:371
Definition: Unit.h:372
Definition: Unit.h:371
Definition: Unit.h:372
uint8_t uint8
Definition: Define.h:154
Definition: Unit.h:372

◆ ReactiveType

Enumerator
REACTIVE_DEFENSE 
REACTIVE_DEFENSE_2 
718 {
719  REACTIVE_DEFENSE = 0,
721 };
Definition: Unit.h:720
Definition: Unit.h:719

◆ UnitModifierFlatType

Enumerator
BASE_VALUE 
BASE_PCT_EXCLUDE_CREATE 
TOTAL_VALUE 
MODIFIER_TYPE_FLAT_END 
140 {
141  BASE_VALUE = 0,
142  BASE_PCT_EXCLUDE_CREATE = 1, // percent modifier affecting all stat values from auras and gear but not player base for level
143  TOTAL_VALUE = 2,
145 };
Definition: Unit.h:143
Definition: Unit.h:144
Definition: Unit.h:142
Definition: Unit.h:141

◆ UnitModifierPctType

Enumerator
BASE_PCT 
TOTAL_PCT 
MODIFIER_TYPE_PCT_END 
148 {
149  BASE_PCT = 0,
150  TOTAL_PCT = 1,
152 };
Definition: Unit.h:150
Definition: Unit.h:151
Definition: Unit.h:149

◆ UnitMods

enum UnitMods
Enumerator
UNIT_MOD_STAT_STRENGTH 
UNIT_MOD_STAT_AGILITY 
UNIT_MOD_STAT_STAMINA 
UNIT_MOD_STAT_INTELLECT 
UNIT_MOD_HEALTH 
UNIT_MOD_MANA 
UNIT_MOD_RAGE 
UNIT_MOD_FOCUS 
UNIT_MOD_ENERGY 
UNIT_MOD_COMBO_POINTS 
UNIT_MOD_RUNES 
UNIT_MOD_RUNIC_POWER 
UNIT_MOD_SOUL_SHARDS 
UNIT_MOD_LUNAR_POWER 
UNIT_MOD_HOLY_POWER 
UNIT_MOD_ALTERNATE 
UNIT_MOD_MAELSTROM 
UNIT_MOD_CHI 
UNIT_MOD_INSANITY 
UNIT_MOD_BURNING_EMBERS 
UNIT_MOD_DEMONIC_FURY 
UNIT_MOD_ARCANE_CHARGES 
UNIT_MOD_FURY 
UNIT_MOD_PAIN 
UNIT_MOD_ARMOR 
UNIT_MOD_RESISTANCE_HOLY 
UNIT_MOD_RESISTANCE_FIRE 
UNIT_MOD_RESISTANCE_NATURE 
UNIT_MOD_RESISTANCE_FROST 
UNIT_MOD_RESISTANCE_SHADOW 
UNIT_MOD_RESISTANCE_ARCANE 
UNIT_MOD_ATTACK_POWER 
UNIT_MOD_ATTACK_POWER_RANGED 
UNIT_MOD_DAMAGE_MAINHAND 
UNIT_MOD_DAMAGE_OFFHAND 
UNIT_MOD_DAMAGE_RANGED 
UNIT_MOD_END 
UNIT_MOD_STAT_START 
UNIT_MOD_STAT_END 
UNIT_MOD_RESISTANCE_START 
UNIT_MOD_RESISTANCE_END 
UNIT_MOD_POWER_START 
UNIT_MOD_POWER_END 
161 {
162  UNIT_MOD_STAT_STRENGTH, // UNIT_MOD_STAT_STRENGTH..UNIT_MOD_STAT_INTELLECT must be in existed order, it's accessed by index values of Stats enum.
167  UNIT_MOD_MANA, // UNIT_MOD_MANA..UNIT_MOD_PAIN must be listed in existing order, it is accessed by index values of Powers enum.
179  UNIT_MOD_CHI,
186  UNIT_MOD_ARMOR, // UNIT_MOD_ARMOR..UNIT_MOD_RESISTANCE_ARCANE must be in existed order, it's accessed by index values of SpellSchools enum.
198  UNIT_MOD_END,
199  // synonyms
201  UNIT_MOD_STAT_END = UNIT_MOD_STAT_INTELLECT + 1,
203  UNIT_MOD_RESISTANCE_END = UNIT_MOD_RESISTANCE_ARCANE + 1,
205  UNIT_MOD_POWER_END = UNIT_MOD_PAIN + 1
206 };
Definition: Unit.h:182
Definition: Unit.h:177
Definition: Unit.h:163
Definition: Unit.h:205
Definition: Unit.h:162
Definition: Unit.h:185
Definition: Unit.h:187
Definition: Unit.h:195
Definition: Unit.h:169
Definition: Unit.h:179
Definition: Unit.h:193
Definition: Unit.h:202
Definition: Unit.h:197
Definition: Unit.h:198
Definition: Unit.h:196
Definition: Unit.h:183
Definition: Unit.h:178
Definition: Unit.h:173
Definition: Unit.h:203
Definition: Unit.h:201
Definition: Unit.h:164
Definition: Unit.h:172
Definition: Unit.h:189
Definition: Unit.h:188
Definition: Unit.h:181
Definition: Unit.h:165
Definition: Unit.h:180
Definition: Unit.h:167
Definition: Unit.h:166
Definition: Unit.h:200
Definition: Unit.h:191
Definition: Unit.h:204
Definition: Unit.h:175
Definition: Unit.h:192
Definition: Unit.h:176
Definition: Unit.h:194
Definition: Unit.h:168
Definition: Unit.h:174
Definition: Unit.h:170
Definition: Unit.h:184
Definition: Unit.h:190
Definition: Unit.h:171
Definition: Unit.h:186

◆ UnitState

enum UnitState : uint32
Enumerator
UNIT_STATE_DIED 
UNIT_STATE_MELEE_ATTACKING 
UNIT_STATE_CHARMED 
UNIT_STATE_STUNNED 
UNIT_STATE_ROAMING 
UNIT_STATE_CHASE 
UNIT_STATE_FOCUSING 
UNIT_STATE_FLEEING 
UNIT_STATE_IN_FLIGHT 
UNIT_STATE_FOLLOW 
UNIT_STATE_ROOT 
UNIT_STATE_CONFUSED 
UNIT_STATE_DISTRACTED 
UNIT_STATE_ISOLATED 
UNIT_STATE_ATTACK_PLAYER 
UNIT_STATE_CASTING 
UNIT_STATE_POSSESSED 
UNIT_STATE_CHARGING 
UNIT_STATE_JUMPING 
UNIT_STATE_MOVE 
UNIT_STATE_ROTATING 
UNIT_STATE_EVADE 
UNIT_STATE_ROAMING_MOVE 
UNIT_STATE_CONFUSED_MOVE 
UNIT_STATE_FLEEING_MOVE 
UNIT_STATE_CHASE_MOVE 
UNIT_STATE_FOLLOW_MOVE 
UNIT_STATE_IGNORE_PATHFINDING 
UNIT_STATE_ALL_STATE_SUPPORTED 
UNIT_STATE_UNATTACKABLE 
UNIT_STATE_MOVING 
UNIT_STATE_CONTROLLED 
UNIT_STATE_CANT_CLIENT_CONTROL 
UNIT_STATE_LOST_CONTROL 
UNIT_STATE_CANNOT_AUTOATTACK 
UNIT_STATE_SIGHTLESS 
UNIT_STATE_CANNOT_TURN 
UNIT_STATE_NOT_MOVE 
UNIT_STATE_ALL_ERASABLE 
UNIT_STATE_ALL_STATE 
235  : uint32
236 {
237  UNIT_STATE_DIED = 0x00000001, // player has fake death aura
238  UNIT_STATE_MELEE_ATTACKING = 0x00000002, // player is melee attacking someone
239  UNIT_STATE_CHARMED = 0x00000004, // having any kind of charm aura on self
240  UNIT_STATE_STUNNED = 0x00000008,
241  UNIT_STATE_ROAMING = 0x00000010,
242  UNIT_STATE_CHASE = 0x00000020,
243  UNIT_STATE_FOCUSING = 0x00000040,
244  UNIT_STATE_FLEEING = 0x00000080,
245  UNIT_STATE_IN_FLIGHT = 0x00000100, // player is in flight mode
246  UNIT_STATE_FOLLOW = 0x00000200,
247  UNIT_STATE_ROOT = 0x00000400,
248  UNIT_STATE_CONFUSED = 0x00000800,
249  UNIT_STATE_DISTRACTED = 0x00001000,
250  UNIT_STATE_ISOLATED = 0x00002000, // area auras do not affect other players
251  UNIT_STATE_ATTACK_PLAYER = 0x00004000,
252  UNIT_STATE_CASTING = 0x00008000,
253  UNIT_STATE_POSSESSED = 0x00010000, // being possessed by another unit
254  UNIT_STATE_CHARGING = 0x00020000,
255  UNIT_STATE_JUMPING = 0x00040000,
256  UNIT_STATE_MOVE = 0x00100000,
257  UNIT_STATE_ROTATING = 0x00200000,
258  UNIT_STATE_EVADE = 0x00400000,
259  UNIT_STATE_ROAMING_MOVE = 0x00800000,
260  UNIT_STATE_CONFUSED_MOVE = 0x01000000,
261  UNIT_STATE_FLEEING_MOVE = 0x02000000,
262  UNIT_STATE_CHASE_MOVE = 0x04000000,
263  UNIT_STATE_FOLLOW_MOVE = 0x08000000,
264  UNIT_STATE_IGNORE_PATHFINDING = 0x10000000, // do not use pathfinding in any MovementGenerator
265 
272 
279  UNIT_STATE_SIGHTLESS = UNIT_STATE_LOST_CONTROL | UNIT_STATE_EVADE,
280  UNIT_STATE_CANNOT_TURN = UNIT_STATE_LOST_CONTROL | UNIT_STATE_ROTATING | UNIT_STATE_FOCUSING,
282 
284  UNIT_STATE_ALL_STATE = 0xffffffff
285 };
Definition: Unit.h:243
Definition: Unit.h:253
Definition: Unit.h:264
Definition: Unit.h:240
Definition: Unit.h:262
Definition: Unit.h:279
Definition: Unit.h:242
Definition: Unit.h:237
Definition: Unit.h:258
Definition: Unit.h:250
Definition: Unit.h:248
Definition: Unit.h:256
Definition: Unit.h:252
Definition: Unit.h:247
Definition: Unit.h:251
Definition: Unit.h:284
Definition: Unit.h:276
Definition: Unit.h:239
Definition: Unit.h:249
Definition: Unit.h:278
Definition: Unit.h:260
Definition: Unit.h:281
Definition: Unit.h:280
Definition: Unit.h:283
Definition: Unit.h:259
uint32_t uint32
Definition: Define.h:152
Definition: Unit.h:257
Definition: Unit.h:274
Definition: Unit.h:277
Definition: Unit.h:263
Definition: Unit.h:261
Definition: Unit.h:241
Definition: Unit.h:244
Definition: Unit.h:275
Definition: Unit.h:273
Definition: Unit.h:238
Definition: Unit.h:246
Definition: Unit.h:245
Definition: Unit.h:266
Definition: Unit.h:255
Definition: Unit.h:254

◆ UnitTypeMask

Enumerator
UNIT_MASK_NONE 
UNIT_MASK_SUMMON 
UNIT_MASK_MINION 
UNIT_MASK_GUARDIAN 
UNIT_MASK_TOTEM 
UNIT_MASK_PET 
UNIT_MASK_VEHICLE 
UNIT_MASK_PUPPET 
UNIT_MASK_HUNTER_PET 
UNIT_MASK_CONTROLABLE_GUARDIAN 
UNIT_MASK_ACCESSORY 
339 {
340  UNIT_MASK_NONE = 0x00000000,
341  UNIT_MASK_SUMMON = 0x00000001,
342  UNIT_MASK_MINION = 0x00000002,
343  UNIT_MASK_GUARDIAN = 0x00000004,
344  UNIT_MASK_TOTEM = 0x00000008,
345  UNIT_MASK_PET = 0x00000010,
346  UNIT_MASK_VEHICLE = 0x00000020,
347  UNIT_MASK_PUPPET = 0x00000040,
348  UNIT_MASK_HUNTER_PET = 0x00000080,
349  UNIT_MASK_CONTROLABLE_GUARDIAN = 0x00000100,
350  UNIT_MASK_ACCESSORY = 0x00000200
351 };
Definition: Unit.h:348
Definition: Unit.h:346
Definition: Unit.h:343
Definition: Unit.h:350
Definition: Unit.h:349
Definition: Unit.h:342
Definition: Unit.h:341
Definition: Unit.h:344
Definition: Unit.h:345
Definition: Unit.h:340
Definition: Unit.h:347

◆ VictimState

Enumerator
VICTIMSTATE_INTACT 
VICTIMSTATE_HIT 
VICTIMSTATE_DODGE 
VICTIMSTATE_PARRY 
VICTIMSTATE_INTERRUPT 
VICTIMSTATE_BLOCKS 
VICTIMSTATE_EVADES 
VICTIMSTATE_IS_IMMUNE 
VICTIMSTATE_DEFLECTS 
48 {
49  VICTIMSTATE_INTACT = 0, // set when attacker misses
50  VICTIMSTATE_HIT = 1, // victim got clear/blocked hit
54  VICTIMSTATE_BLOCKS = 5, // unused? not set when blocked, even on full block
58 };
Definition: Unit.h:54
Definition: Unit.h:51
Definition: Unit.h:50
Definition: Unit.h:52
Definition: Unit.h:56
Definition: Unit.h:53
Definition: Unit.h:55
Definition: Unit.h:57
Definition: Unit.h:49

◆ WeaponDamageRange

Enumerator
MINDAMAGE 
MAXDAMAGE 
155 {
156  MINDAMAGE,
157  MAXDAMAGE
158 };
Definition: Unit.h:156
Definition: Unit.h:157

Function Documentation

◆ createProcHitMask()

uint32 createProcHitMask ( SpellNonMeleeDamage damageInfo,
SpellMissInfo  missCondition 
)
9493 {
9494  uint32 hitMask = PROC_HIT_NONE;
9495  // Check victim state
9496  if (missCondition != SPELL_MISS_NONE)
9497  {
9498  switch (missCondition)
9499  {
9500  case SPELL_MISS_MISS:
9501  hitMask |= PROC_HIT_MISS;
9502  break;
9503  case SPELL_MISS_DODGE:
9504  hitMask |= PROC_HIT_DODGE;
9505  break;
9506  case SPELL_MISS_PARRY:
9507  hitMask |= PROC_HIT_PARRY;
9508  break;
9509  case SPELL_MISS_BLOCK:
9510  // spells can't be partially blocked (it's damage can though)
9511  hitMask |= PROC_HIT_BLOCK | PROC_HIT_FULL_BLOCK;
9512  break;
9513  case SPELL_MISS_EVADE:
9514  hitMask |= PROC_HIT_EVADE;
9515  break;
9516  case SPELL_MISS_IMMUNE:
9517  case SPELL_MISS_IMMUNE2:
9518  hitMask |= PROC_HIT_IMMUNE;
9519  break;
9520  case SPELL_MISS_DEFLECT:
9521  hitMask |= PROC_HIT_DEFLECT;
9522  break;
9523  case SPELL_MISS_ABSORB:
9524  hitMask |= PROC_HIT_ABSORB;
9525  break;
9526  case SPELL_MISS_REFLECT:
9527  hitMask |= PROC_HIT_REFLECT;
9528  break;
9529  case SPELL_MISS_RESIST:
9530  hitMask |= PROC_HIT_FULL_RESIST;
9531  break;
9532  default:
9533  break;
9534  }
9535  }
9536  else
9537  {
9538  // On block
9539  if (damageInfo->blocked)
9540  {
9541  hitMask |= PROC_HIT_BLOCK;
9542  if (damageInfo->fullBlock)
9543  hitMask |= PROC_HIT_FULL_BLOCK;
9544  }
9545  // On absorb
9546  if (damageInfo->absorb)
9547  hitMask |= PROC_HIT_ABSORB;
9548 
9549  // Don't set hit/crit hitMask if damage is nullified
9550  bool const damageNullified = (damageInfo->HitInfo & (HITINFO_FULL_ABSORB | HITINFO_FULL_RESIST)) != 0 || (hitMask & PROC_HIT_FULL_BLOCK) != 0;
9551  if (!damageNullified)
9552  {
9553  // On crit
9554  if (damageInfo->HitInfo & SPELL_HIT_TYPE_CRIT)
9555  hitMask |= PROC_HIT_CRITICAL;
9556  else
9557  hitMask |= PROC_HIT_NORMAL;
9558  }
9559  else if ((damageInfo->HitInfo & HITINFO_FULL_RESIST) != 0)
9560  hitMask |= PROC_HIT_FULL_RESIST;
9561  }
9562 
9563  return hitMask;
9564 }
Definition: SharedDefines.h:2596
Definition: SpellMgr.h:246
Definition: SharedDefines.h:2585
Definition: SpellMgr.h:255
Definition: SpellMgr.h:251
Definition: SharedDefines.h:2580
Definition: SharedDefines.h:2589
Definition: SpellMgr.h:252
Definition: SpellMgr.h:254
Definition: SharedDefines.h:2583
Definition: SpellMgr.h:257
Definition: SharedDefines.h:2581
Definition: SpellMgr.h:259
bool fullBlock
Definition: Unit.h:557
Definition: SpellMgr.h:253
Definition: SpellMgr.h:249
uint32_t uint32
Definition: Define.h:152
uint32 blocked
Definition: Unit.h:553
Definition: SharedDefines.h:2588
Definition: SharedDefines.h:2586
Definition: SpellMgr.h:245
Definition: UnitDefines.h:329
Definition: SpellMgr.h:248
Definition: SharedDefines.h:2579
Definition: SharedDefines.h:2587
Definition: SharedDefines.h:2582
Definition: SpellMgr.h:250
uint32 HitInfo
Definition: Unit.h:554
Definition: SpellMgr.h:256
Definition: UnitDefines.h:331
Definition: SharedDefines.h:2590
Definition: SpellMgr.h:247
Definition: SharedDefines.h:2584
uint32 absorb
Definition: Unit.h:550
+ Here is the caller graph for this function:

◆ SetUnitCurrentCastSpell()

void SetUnitCurrentCastSpell ( Unit unit,
Spell spell 
)
inline
2047 {
2048  unit->SetCurrentCastSpell(spell);
2049 }
void SetCurrentCastSpell(Spell *pSpell)
Definition: Unit.cpp:2788
+ Here is the call graph for this function:

Variable Documentation

◆ baseMoveSpeed

TC_GAME_API float baseMoveSpeed[MAX_MOVE_TYPE]

◆ playerBaseMoveSpeed

TC_GAME_API float playerBaseMoveSpeed[MAX_MOVE_TYPE]