TrinityCore
Unit.h File Reference
#include "Object.h"
#include "CombatManager.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 <stack>
+ 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
 
struct  PositionUpdateInfo
 
class  Unit
 
struct  Unit::VisibleAuraSlotCompare
 
struct  Unit::ValuesUpdateForPlayerWithMaskSender
 
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 WARMODE_ENLISTED_SPELL_OUTSIDE   269083
 
#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 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_FOLLOW_FORMATION = 0x00080000,
  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_FOLLOW_FORMATION_MOVE = 0x20000000, 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_FOLLOW_FORMATION_MOVE, UNIT_STATE_CONTROLLED = UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING, 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, MAX_REACTIVE }
 

Functions

ProcFlagsHit createProcHitMask (SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
 

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_PLAYER_STEALTH_DETECT_RANGE

#define MAX_PLAYER_STEALTH_DETECT_RANGE   30.0f

◆ 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_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

◆ 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

◆ WARMODE_ENLISTED_SPELL_OUTSIDE

#define WARMODE_ENLISTED_SPELL_OUTSIDE   269083

◆ 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 
643 {
648 };
Definition: Unit.h:647
Definition: Unit.h:645
Definition: Unit.h:646
Definition: Unit.h:644

◆ BaseModGroup

Enumerator
CRIT_PERCENTAGE 
RANGED_CRIT_PERCENTAGE 
OFFHAND_CRIT_PERCENTAGE 
SHIELD_BLOCK_VALUE 
BASEMOD_END 
216 {
222 };
Definition: Unit.h:217
Definition: Unit.h:219
Definition: Unit.h:220
Definition: Unit.h:221
Definition: Unit.h:218

◆ BaseModType

Enumerator
FLAT_MOD 
PCT_MOD 
MOD_END 
225 {
226  FLAT_MOD,
227  PCT_MOD,
228  MOD_END
229 };
Definition: Unit.h:226
Definition: Unit.h:228
Definition: Unit.h:227

◆ CharmType

enum CharmType
Enumerator
CHARM_TYPE_CHARM 
CHARM_TYPE_POSSESS 
CHARM_TYPE_VEHICLE 
CHARM_TYPE_CONVERT 
633 {
638 };
Definition: Unit.h:636
Definition: Unit.h:634
Definition: Unit.h:635
Definition: Unit.h:637

◆ 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 
297 {
298  CR_AMPLIFY = 0,
299  CR_DEFENSE_SKILL = 1,
300  CR_DODGE = 2,
301  CR_PARRY = 3,
302  CR_BLOCK = 4,
303  CR_HIT_MELEE = 5,
304  CR_HIT_RANGED = 6,
305  CR_HIT_SPELL = 7,
306  CR_CRIT_MELEE = 8,
307  CR_CRIT_RANGED = 9,
308  CR_CRIT_SPELL = 10,
309  CR_CORRUPTION = 11,
311  CR_SPEED = 13,
314  CR_LIFESTEAL = 16,
315  CR_HASTE_MELEE = 17,
316  CR_HASTE_RANGED = 18,
317  CR_HASTE_SPELL = 19,
318  CR_AVOIDANCE = 20,
319  CR_STURDINESS = 21,
320  CR_UNUSED_7 = 22,
321  CR_EXPERTISE = 23,
323  CR_MASTERY = 25,
324  CR_PVP_POWER = 26,
325  CR_CLEAVE = 27,
329  CR_UNUSED_12 = 31
330 };
Definition: Unit.h:325
Definition: Unit.h:302
Definition: Unit.h:309
Definition: Unit.h:300
Definition: Unit.h:326
Definition: Unit.h:305
Definition: Unit.h:321
Definition: Unit.h:316
Definition: Unit.h:317
Definition: Unit.h:304
Definition: Unit.h:298
Definition: Unit.h:307
Definition: Unit.h:320
Definition: Unit.h:310
Definition: Unit.h:303
Definition: Unit.h:328
Definition: Unit.h:311
Definition: Unit.h:313
Definition: Unit.h:323
Definition: Unit.h:318
Definition: Unit.h:308
Definition: Unit.h:315
Definition: Unit.h:327
Definition: Unit.h:329
Definition: Unit.h:322
Definition: Unit.h:301
Definition: Unit.h:314
Definition: Unit.h:324
Definition: Unit.h:312
Definition: Unit.h:299
Definition: Unit.h:306
Definition: Unit.h:319

◆ CurrentSpellTypes

Enumerator
CURRENT_MELEE_SPELL 
CURRENT_GENERIC_SPELL 
CURRENT_CHANNELED_SPELL 
CURRENT_AUTOREPEAT_SPELL 
584  : uint8
585 {
590 };
Definition: Unit.h:587
Definition: Unit.h:586
Definition: Unit.h:589
Definition: Unit.h:588
uint8_t uint8
Definition: Define.h:145

◆ DamageEffectType

Enumerator
DIRECT_DAMAGE 
SPELL_DIRECT_DAMAGE 
DOT 
HEAL 
NODAMAGE 
SELF_DAMAGE 
334  : uint8
335 {
336  DIRECT_DAMAGE = 0, // used for normal weapon damage (not for class abilities or spells)
337  SPELL_DIRECT_DAMAGE = 1, // spell/class abilities damage
338  DOT = 2,
339  HEAL = 3,
340  NODAMAGE = 4, // used also in case when damage applied to health but not applied to spell channelInterruptFlags/etc
341  SELF_DAMAGE = 5
342 };
Definition: Unit.h:336
Definition: Unit.h:337
Definition: Unit.h:338
Definition: Unit.h:341
Definition: Unit.h:340
Definition: Unit.h:339
uint8_t uint8
Definition: Define.h:145

◆ DeathState

enum DeathState
Enumerator
ALIVE 
JUST_DIED 
CORPSE 
DEAD 
JUST_RESPAWNED 
232 {
233  ALIVE = 0,
234  JUST_DIED = 1,
235  CORPSE = 2,
236  DEAD = 3,
237  JUST_RESPAWNED = 4
238 };
Definition: Unit.h:236
Definition: Unit.h:234
Definition: Unit.h:233
Definition: Unit.h:235
Definition: Unit.h:237

◆ InventorySlot

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

◆ 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 
375  : uint8
376 {
379 };
Definition: Unit.h:377
Definition: Unit.h:377
Definition: Unit.h:377
Definition: Unit.h:378
Definition: Unit.h:377
Definition: Unit.h:378
Definition: Unit.h:377
Definition: Unit.h:378
uint8_t uint8
Definition: Define.h:145
Definition: Unit.h:378

◆ ReactiveType

Enumerator
REACTIVE_DEFENSE 
REACTIVE_DEFENSE_2 
MAX_REACTIVE 
724 {
725  REACTIVE_DEFENSE = 0,
726  REACTIVE_DEFENSE_2 = 1,
728 };
Definition: Unit.h:727
Definition: Unit.h:726
Definition: Unit.h:725

◆ UnitModifierFlatType

Enumerator
BASE_VALUE 
BASE_PCT_EXCLUDE_CREATE 
TOTAL_VALUE 
MODIFIER_TYPE_FLAT_END 
145 {
146  BASE_VALUE = 0,
147  BASE_PCT_EXCLUDE_CREATE = 1, // percent modifier affecting all stat values from auras and gear but not player base for level
148  TOTAL_VALUE = 2,
150 };
Definition: Unit.h:148
Definition: Unit.h:149
Definition: Unit.h:147
Definition: Unit.h:146

◆ UnitModifierPctType

Enumerator
BASE_PCT 
TOTAL_PCT 
MODIFIER_TYPE_PCT_END 
153 {
154  BASE_PCT = 0,
155  TOTAL_PCT = 1,
157 };
Definition: Unit.h:155
Definition: Unit.h:156
Definition: Unit.h:154

◆ 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 
166 {
167  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.
172  UNIT_MOD_MANA, // UNIT_MOD_MANA..UNIT_MOD_PAIN must be listed in existing order, it is accessed by index values of Powers enum.
184  UNIT_MOD_CHI,
191  UNIT_MOD_ARMOR, // UNIT_MOD_ARMOR..UNIT_MOD_RESISTANCE_ARCANE must be in existed order, it's accessed by index values of SpellSchools enum.
203  UNIT_MOD_END,
204  // synonyms
206  UNIT_MOD_STAT_END = UNIT_MOD_STAT_INTELLECT + 1,
208  UNIT_MOD_RESISTANCE_END = UNIT_MOD_RESISTANCE_ARCANE + 1,
210  UNIT_MOD_POWER_END = UNIT_MOD_PAIN + 1
211 };
Definition: Unit.h:187
Definition: Unit.h:182
Definition: Unit.h:168
Definition: Unit.h:210
Definition: Unit.h:167
Definition: Unit.h:190
Definition: Unit.h:192
Definition: Unit.h:200
Definition: Unit.h:174
Definition: Unit.h:184
Definition: Unit.h:198
Definition: Unit.h:207
Definition: Unit.h:202
Definition: Unit.h:203
Definition: Unit.h:201
Definition: Unit.h:188
Definition: Unit.h:183
Definition: Unit.h:178
Definition: Unit.h:208
Definition: Unit.h:206
Definition: Unit.h:169
Definition: Unit.h:177
Definition: Unit.h:194
Definition: Unit.h:193
Definition: Unit.h:186
Definition: Unit.h:170
Definition: Unit.h:185
Definition: Unit.h:172
Definition: Unit.h:171
Definition: Unit.h:205
Definition: Unit.h:196
Definition: Unit.h:209
Definition: Unit.h:180
Definition: Unit.h:197
Definition: Unit.h:181
Definition: Unit.h:199
Definition: Unit.h:173
Definition: Unit.h:179
Definition: Unit.h:175
Definition: Unit.h:189
Definition: Unit.h:195
Definition: Unit.h:176
Definition: Unit.h:191

◆ 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_FOLLOW_FORMATION 
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_FOLLOW_FORMATION_MOVE 
UNIT_STATE_ALL_STATE_SUPPORTED 
UNIT_STATE_UNATTACKABLE 
UNIT_STATE_MOVING 
UNIT_STATE_CONTROLLED 
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 
240  : uint32
241 {
242  UNIT_STATE_DIED = 0x00000001, // player has fake death aura
243  UNIT_STATE_MELEE_ATTACKING = 0x00000002, // player is melee attacking someone
244  UNIT_STATE_CHARMED = 0x00000004, // having any kind of charm aura on self
245  UNIT_STATE_STUNNED = 0x00000008,
246  UNIT_STATE_ROAMING = 0x00000010,
247  UNIT_STATE_CHASE = 0x00000020,
248  UNIT_STATE_FOCUSING = 0x00000040,
249  UNIT_STATE_FLEEING = 0x00000080,
250  UNIT_STATE_IN_FLIGHT = 0x00000100, // player is in flight mode
251  UNIT_STATE_FOLLOW = 0x00000200,
252  UNIT_STATE_ROOT = 0x00000400,
253  UNIT_STATE_CONFUSED = 0x00000800,
254  UNIT_STATE_DISTRACTED = 0x00001000,
255  UNIT_STATE_ISOLATED = 0x00002000, // area auras do not affect other players
256  UNIT_STATE_ATTACK_PLAYER = 0x00004000,
257  UNIT_STATE_CASTING = 0x00008000,
258  UNIT_STATE_POSSESSED = 0x00010000, // being possessed by another unit
259  UNIT_STATE_CHARGING = 0x00020000,
260  UNIT_STATE_JUMPING = 0x00040000,
261  UNIT_STATE_FOLLOW_FORMATION = 0x00080000,
262  UNIT_STATE_MOVE = 0x00100000,
263  UNIT_STATE_ROTATING = 0x00200000,
264  UNIT_STATE_EVADE = 0x00400000,
265  UNIT_STATE_ROAMING_MOVE = 0x00800000,
266  UNIT_STATE_CONFUSED_MOVE = 0x01000000,
267  UNIT_STATE_FLEEING_MOVE = 0x02000000,
268  UNIT_STATE_CHASE_MOVE = 0x04000000,
269  UNIT_STATE_FOLLOW_MOVE = 0x08000000,
270  UNIT_STATE_IGNORE_PATHFINDING = 0x10000000, // do not use pathfinding in any MovementGenerator
272 
279 
285  UNIT_STATE_SIGHTLESS = UNIT_STATE_LOST_CONTROL | UNIT_STATE_EVADE,
286  UNIT_STATE_CANNOT_TURN = UNIT_STATE_LOST_CONTROL | UNIT_STATE_ROTATING | UNIT_STATE_FOCUSING,
288 
290  UNIT_STATE_ALL_STATE = 0xffffffff
291 };
Definition: Unit.h:248
Definition: Unit.h:261
Definition: Unit.h:258
Definition: Unit.h:270
Definition: Unit.h:245
Definition: Unit.h:268
Definition: Unit.h:285
Definition: Unit.h:247
Definition: Unit.h:242
Definition: Unit.h:264
Definition: Unit.h:255
Definition: Unit.h:253
Definition: Unit.h:262
Definition: Unit.h:257
Definition: Unit.h:252
Definition: Unit.h:256
Definition: Unit.h:290
Definition: Unit.h:244
Definition: Unit.h:254
Definition: Unit.h:284
Definition: Unit.h:266
Definition: Unit.h:287
Definition: Unit.h:271
Definition: Unit.h:286
Definition: Unit.h:289
Definition: Unit.h:265
uint32_t uint32
Definition: Define.h:143
Definition: Unit.h:263
Definition: Unit.h:281
Definition: Unit.h:283
Definition: Unit.h:269
Definition: Unit.h:267
Definition: Unit.h:246
Definition: Unit.h:249
Definition: Unit.h:282
Definition: Unit.h:280
Definition: Unit.h:243
Definition: Unit.h:251
Definition: Unit.h:250
Definition: Unit.h:273
Definition: Unit.h:260
Definition: Unit.h:259

◆ 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 
345 {
346  UNIT_MASK_NONE = 0x00000000,
347  UNIT_MASK_SUMMON = 0x00000001,
348  UNIT_MASK_MINION = 0x00000002,
349  UNIT_MASK_GUARDIAN = 0x00000004,
350  UNIT_MASK_TOTEM = 0x00000008,
351  UNIT_MASK_PET = 0x00000010,
352  UNIT_MASK_VEHICLE = 0x00000020,
353  UNIT_MASK_PUPPET = 0x00000040,
354  UNIT_MASK_HUNTER_PET = 0x00000080,
355  UNIT_MASK_CONTROLABLE_GUARDIAN = 0x00000100,
356  UNIT_MASK_ACCESSORY = 0x00000200
357 };
Definition: Unit.h:354
Definition: Unit.h:352
Definition: Unit.h:349
Definition: Unit.h:356
Definition: Unit.h:355
Definition: Unit.h:348
Definition: Unit.h:347
Definition: Unit.h:350
Definition: Unit.h:351
Definition: Unit.h:346
Definition: Unit.h:353

◆ VictimState

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

◆ WeaponDamageRange

Enumerator
MINDAMAGE 
MAXDAMAGE 
160 {
161  MINDAMAGE,
162  MAXDAMAGE
163 };
Definition: Unit.h:161
Definition: Unit.h:162

Function Documentation

◆ createProcHitMask()

ProcFlagsHit createProcHitMask ( SpellNonMeleeDamage damageInfo,
SpellMissInfo  missCondition 
)
9742 {
9743  ProcFlagsHit hitMask = PROC_HIT_NONE;
9744  // Check victim state
9745  if (missCondition != SPELL_MISS_NONE)
9746  {
9747  switch (missCondition)
9748  {
9749  case SPELL_MISS_MISS:
9750  hitMask |= PROC_HIT_MISS;
9751  break;
9752  case SPELL_MISS_DODGE:
9753  hitMask |= PROC_HIT_DODGE;
9754  break;
9755  case SPELL_MISS_PARRY:
9756  hitMask |= PROC_HIT_PARRY;
9757  break;
9758  case SPELL_MISS_BLOCK:
9759  // spells can't be partially blocked (it's damage can though)
9760  hitMask |= PROC_HIT_BLOCK | PROC_HIT_FULL_BLOCK;
9761  break;
9762  case SPELL_MISS_EVADE:
9763  hitMask |= PROC_HIT_EVADE;
9764  break;
9765  case SPELL_MISS_IMMUNE:
9766  case SPELL_MISS_IMMUNE2:
9767  hitMask |= PROC_HIT_IMMUNE;
9768  break;
9769  case SPELL_MISS_DEFLECT:
9770  hitMask |= PROC_HIT_DEFLECT;
9771  break;
9772  case SPELL_MISS_ABSORB:
9773  hitMask |= PROC_HIT_ABSORB;
9774  break;
9775  case SPELL_MISS_REFLECT:
9776  hitMask |= PROC_HIT_REFLECT;
9777  break;
9778  case SPELL_MISS_RESIST:
9779  hitMask |= PROC_HIT_FULL_RESIST;
9780  break;
9781  default:
9782  break;
9783  }
9784  }
9785  else
9786  {
9787  // On block
9788  if (damageInfo->blocked)
9789  {
9790  hitMask |= PROC_HIT_BLOCK;
9791  if (damageInfo->fullBlock)
9792  hitMask |= PROC_HIT_FULL_BLOCK;
9793  }
9794  // On absorb
9795  if (damageInfo->absorb)
9796  hitMask |= PROC_HIT_ABSORB;
9797 
9798  // Don't set hit/crit hitMask if damage is nullified
9799  bool const damageNullified = (damageInfo->HitInfo & (HITINFO_FULL_ABSORB | HITINFO_FULL_RESIST)) != 0 || (hitMask & PROC_HIT_FULL_BLOCK) != 0;
9800  if (!damageNullified)
9801  {
9802  // On crit
9803  if (damageInfo->HitInfo & SPELL_HIT_TYPE_CRIT)
9804  hitMask |= PROC_HIT_CRITICAL;
9805  else
9806  hitMask |= PROC_HIT_NORMAL;
9807  }
9808  else if ((damageInfo->HitInfo & HITINFO_FULL_RESIST) != 0)
9809  hitMask |= PROC_HIT_FULL_RESIST;
9810  }
9811 
9812  return hitMask;
9813 }
Definition: SharedDefines.h:2703
Definition: SharedDefines.h:2692
Definition: SpellMgr.h:272
Definition: SharedDefines.h:2687
Definition: SharedDefines.h:2696
Definition: SpellMgr.h:274
Definition: SpellMgr.h:286
Definition: SpellMgr.h:283
Definition: SpellMgr.h:275
Definition: SpellMgr.h:276
Definition: SpellMgr.h:282
Definition: SharedDefines.h:2690
Definition: SpellMgr.h:278
Definition: SharedDefines.h:2688
bool fullBlock
Definition: Unit.h:563
Definition: SpellMgr.h:273
uint32 blocked
Definition: Unit.h:559
Definition: SharedDefines.h:2695
ProcFlagsHit
Definition: SpellMgr.h:270
Definition: SharedDefines.h:2693
Definition: SpellMgr.h:279
Definition: UnitDefines.h:431
Definition: SharedDefines.h:2686
Definition: SharedDefines.h:2694
Definition: SharedDefines.h:2689
uint32 HitInfo
Definition: Unit.h:560
Definition: UnitDefines.h:433
Definition: SharedDefines.h:2697
Definition: SpellMgr.h:284
Definition: SpellMgr.h:281
Definition: SpellMgr.h:277
Definition: SharedDefines.h:2691
Definition: SpellMgr.h:280
uint32 absorb
Definition: Unit.h:556
+ Here is the caller graph for this function:

Variable Documentation

◆ baseMoveSpeed

TC_GAME_API float baseMoveSpeed[MAX_MOVE_TYPE]

◆ playerBaseMoveSpeed

TC_GAME_API float playerBaseMoveSpeed[MAX_MOVE_TYPE]