diff options
author | ccrs <ccrs@users.noreply.github.com> | 2018-04-19 13:31:39 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-09-26 01:22:17 +0200 |
commit | 4793b073eec2af32622ff703911721100730e868 (patch) | |
tree | 80a8505e660ae22c043856335a454ca0df2aff8e /src/server/game/Movement/MovementDefines.h | |
parent | 763459ada731d31c75c2bd436e486d6cf033a6d3 (diff) |
Core/Misc: movement header cleanup
(cherry picked from commit f9914caefc59f36ab7583432442a26b29124b7f1)
Diffstat (limited to 'src/server/game/Movement/MovementDefines.h')
-rw-r--r-- | src/server/game/Movement/MovementDefines.h | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/src/server/game/Movement/MovementDefines.h b/src/server/game/Movement/MovementDefines.h new file mode 100644 index 00000000000..dbacd9a469f --- /dev/null +++ b/src/server/game/Movement/MovementDefines.h @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2008-2018 TrinityCore <https://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef TRINITY_MOVEMENTDEFINES_H +#define TRINITY_MOVEMENTDEFINES_H + +#include "Common.h" +#include "ObjectGuid.h" + +#define SPEED_CHARGE 42.0f // assume it is 25 yard per 0.6 second + +enum MovementGeneratorType : uint8 +{ + IDLE_MOTION_TYPE = 0, // IdleMovementGenerator.h + RANDOM_MOTION_TYPE = 1, // RandomMovementGenerator.h + WAYPOINT_MOTION_TYPE = 2, // WaypointMovementGenerator.h + MAX_DB_MOTION_TYPE = 3, // Below motion types can't be set in DB. + CONFUSED_MOTION_TYPE = 4, // ConfusedMovementGenerator.h + CHASE_MOTION_TYPE = 5, // TargetedMovementGenerator.h + HOME_MOTION_TYPE = 6, // HomeMovementGenerator.h + FLIGHT_MOTION_TYPE = 7, // WaypointMovementGenerator.h + POINT_MOTION_TYPE = 8, // PointMovementGenerator.h + FLEEING_MOTION_TYPE = 9, // FleeingMovementGenerator.h + DISTRACT_MOTION_TYPE = 10, // IdleMovementGenerator.h + ASSISTANCE_MOTION_TYPE = 11, // PointMovementGenerator.h + ASSISTANCE_DISTRACT_MOTION_TYPE = 12, // IdleMovementGenerator.h + TIMED_FLEEING_MOTION_TYPE = 13, // FleeingMovementGenerator.h + FOLLOW_MOTION_TYPE = 14, + ROTATE_MOTION_TYPE = 15, + EFFECT_MOTION_TYPE = 16, + SPLINE_CHAIN_MOTION_TYPE = 17, // SplineChainMovementGenerator.h + FORMATION_MOTION_TYPE = 18, // FormationMovementGenerator.h + MAX_MOTION_TYPE // limit +}; + +enum MovementSlot : uint8 +{ + MOTION_SLOT_IDLE = 0, + MOTION_SLOT_ACTIVE, + MOTION_SLOT_CONTROLLED, + MAX_MOTION_SLOT +}; + +enum MotionMasterCleanFlags +{ + MOTIONMMASTER_CLEANFLAG_NONE = 0, + MOTIONMMASTER_CLEANFLAG_UPDATE = 1, // Clear or Expire called from update + MOTIONMMASTER_CLEANFLAG_RESET = 2 // Flag if need top()->Reset() +}; + +enum RotateDirection : uint8 +{ + ROTATE_DIRECTION_LEFT = 0, + ROTATE_DIRECTION_RIGHT +}; + +struct TC_GAME_API ChaseRange +{ + ChaseRange(float range); + ChaseRange(float _minRange, float _maxRange); + ChaseRange(float _minRange, float _minTolerance, float _maxTolerance, float _maxRange); + + // this contains info that informs how we should path! + float MinRange; // we have to move if we are within this range... (min. attack range) + float MinTolerance; // ...and if we are, we will move this far away + float MaxRange; // we have to move if we are outside this range... (max. attack range) + float MaxTolerance; // ...and if we are, we will move into this range +}; + +struct TC_GAME_API ChaseAngle +{ + ChaseAngle(float angle, float _tolerance = M_PI_4); + + float RelativeAngle; // we want to be at this angle relative to the target (0 = front, M_PI = back) + float Tolerance; // but we'll tolerate anything within +- this much + + float UpperBound() const; + float LowerBound() const; + bool IsAngleOkay(float relativeAngle) const; +}; + +struct JumpArrivalCastArgs +{ + uint32 SpellId; + ObjectGuid Target; +}; + +#endif |