enum UnitState
{
UNIT_STATE_DIED = 1, // player has fake death aura
UNIT_STATE_MELEE_ATTACKING = 2, // player is melee attacking someone
UNIT_STATE_STUNNED = 8,
UNIT_STATE_ROAMING = 16,
UNIT_STATE_CHASE = 32,
UNIT_STATE_FLEEING = 128,
UNIT_STATE_IN_FLIGHT = 256, // player is in flight mode
UNIT_STATE_FOLLOW = 512,
UNIT_STATE_ROOT = 1024,
UNIT_STATE_CONFUSED = 2048,
UNIT_STATE_DISTRACTED = 4096,
UNIT_STATE_ISOLATED = 8192, // area auras do not affect other players
UNIT_STATE_ATTACK_PLAYER = 16384,
UNIT_STATE_CASTING = 32768,
UNIT_STATE_POSSESSED = 65536,
UNIT_STATE_CHARGING = 131072,
UNIT_STATE_JUMPING = 262144,
UNIT_STATE_MOVE = 1048576,
UNIT_STATE_ROTATING = 2097152,
UNIT_STATE_EVADE = 4194304,
UNIT_STATE_ROAMING_MOVE = 8388608,
UNIT_STATE_CONFUSED_MOVE = 16777216,
UNIT_STATE_FLEEING_MOVE = 33554432,
UNIT_STATE_CHASE_MOVE = 67108864,
UNIT_STATE_FOLLOW_MOVE = 134217728,
UNIT_STATE_IGNORE_PATHFINDING = 268435456, // do not use pathfinding in any MovementGenerator
UNIT_STATE_UNATTACKABLE = UNIT_STATE_IN_FLIGHT,
// for real move using movegen check and stop (except unstoppable 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_LOST_CONTROL = (UNIT_STATE_CONTROLLED | UNIT_STATE_JUMPING | UNIT_STATE_CHARGING),
UNIT_STATE_SIGHTLESS = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_EVADE),
UNIT_STATE_CANNOT_AUTOATTACK = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_CASTING),
UNIT_STATE_CANNOT_TURN = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_ROTATING),
// stay by different reasons
UNIT_STATE_NOT_MOVE = UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DIED | UNIT_STATE_DISTRACTED,
UNIT_STATE_ALL_STATE = -1 //(UNIT_STATE_STOPPED | UNIT_STATE_MOVING | UNIT_STATE_IN_COMBAT | UNIT_STATE_IN_FLIGHT)
};