Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
MoveSplineFlag.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 SKYFIRESERVER_MOVESPLINEFLAG_H
7#define SKYFIRESERVER_MOVESPLINEFLAG_H
8#include "MovementTypedefs.h"
9
10#include <string>
11
12namespace Movement
13{
14#if defined( __GNUC__ )
15#pragma pack(1)
16#else
17#pragma pack(push, 1)
18#endif
19
21 {
22 public:
23 enum eFlags
24 {
25 None = 0x00000000,
26 // x00-x07 used as animation Ids storage in pair with Animation flag
27 Unknown0 = 0x00000008, // NOT VERIFIED
28 FallingSlow = 0x00000010,
29 Done = 0x00000020,
30 Falling = 0x00000040, // Affects elevation computation, can't be combined with Parabolic flag
31 No_Spline = 0x00000080,
32 Unknown2 = 0x00000100, // NOT VERIFIED
33 Flying = 0x00000200, // Smooth movement(Catmullrom interpolation mode), flying animation
34 OrientationFixed = 0x00000400, // Model orientation fixed
35 Catmullrom = 0x00000800, // Used Catmullrom interpolation mode
36 Cyclic = 0x00001000, // Movement by cycled spline
37 Enter_Cycle = 0x00002000, // Everytimes appears with cyclic flag in monster move packet, erases first spline vertex after first cycle done
38 Frozen = 0x00004000, // Will never arrive
39 TransportEnter = 0x00008000,
40 TransportExit = 0x00010000,
41 Unknown3 = 0x00020000, // NOT VERIFIED
42 Unknown4 = 0x00040000, // NOT VERIFIED
43 OrientationInversed = 0x00080000,
44 SmoothGroundPath = 0x00100000,
45 Walkmode = 0x00200000,
46 UncompressedPath = 0x00400000,
47 Unknown6 = 0x00800000, // NOT VERIFIED
48 Animation = 0x01000000, // Plays animation after some time passed
49 Parabolic = 0x02000000, // Affects elevation computation, can't be combined with Falling flag
50 Final_Point = 0x04000000,
51 Final_Target = 0x08000000,
52 Final_Angle = 0x10000000,
53 Unknown7 = 0x20000000, // NOT VERIFIED
54 Unknown8 = 0x40000000, // NOT VERIFIED
55 Unknown9 = 0x80000000, // NOT VERIFIED
56
57 // Masks
59 // animation ids stored here, see AnimType enum, used with Animation flag
61 // flags that shouldn't be appended into SMSG_ON_MONSTER_MOVE\SMSG_ON_MONSTER_MOVE_TRANSPORT packet, should be more probably
63 // Unused, not suported flags
65 };
66
67 inline uint32& raw() { return (uint32&)*this; }
68 inline const uint32& raw() const { return (const uint32&)*this; }
69
70 MoveSplineFlag() { raw() = 0; }
72 MoveSplineFlag(const MoveSplineFlag& f) { raw() = f.raw(); }
73
74 // Constant interface
75
76 bool isSmooth() const { return raw() & Catmullrom; }
77 bool isLinear() const { return !isSmooth(); }
78 bool isFacing() const { return raw() & Mask_Final_Facing; }
79
80 uint8 getAnimationId() const { return animId; }
81 bool hasAllFlags(uint32 f) const { return (raw() & f) == f; }
82 bool hasFlag(uint32 f) const { return (raw() & f) != 0; }
83 uint32 operator & (uint32 f) const { return (raw() & f); }
84 uint32 operator | (uint32 f) const { return (raw() | f); }
85 std::string ToString() const;
86
87 // Not constant interface
88
89 void operator &= (uint32 f) { raw() &= f; }
90 void operator |= (uint32 f) { raw() |= f; }
91
94 void EnableFlying() { raw() = (raw() & ~(Falling)) | Flying; }
102
104 bool unknown0 : 1;
105 bool fallingSlow : 1;
106 bool done : 1;
107 bool falling : 1;
108 bool no_spline : 1;
109 bool unknown2 : 1;
110 bool flying : 1;
112 bool catmullrom : 1;
113 bool cyclic : 1;
114 bool enter_cycle : 1;
115 bool frozen : 1;
118 bool unknown3 : 1;
119 bool unknown4 : 1;
122 bool walkmode : 1;
124 bool unknown6 : 1;
125 bool animation : 1;
126 bool parabolic : 1;
127 bool final_point : 1;
128 bool final_target : 1;
129 bool final_angle : 1;
130 bool unknown7 : 1;
131 bool unknown8 : 1;
132 bool unknown9 : 1;
133 };
134#if defined( __GNUC__ )
135#pragma pack()
136#else
137#pragma pack(pop)
138#endif
139}
140
141#endif // SKYFIRESERVER_MOVESPLINEFLAG_H
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
std::string ToString() const
bool hasAllFlags(uint32 f) const
uint32 operator&(uint32 f) const
void EnableAnimation(uint8 anim)
bool hasFlag(uint32 f) const
uint32 operator|(uint32 f) const
MoveSplineFlag(const MoveSplineFlag &f)
const uint32 & raw() const