Pol  Revision:3cfda13
packetdefs.h
Go to the documentation of this file.
1 
2 #ifndef POL_PACKETDEFS_H
3 #define POL_PACKETDEFS_H
4 
5 #include "../../clib/compilerspecifics.h"
6 #include "../../clib/rawtypes.h"
7 #include "../action.h"
8 #include "packethelper.h"
9 #include "packets.h"
10 
11 namespace Pol
12 {
13 namespace Core
14 {
15 class UObject;
16 }
17 namespace Mobile
18 {
19 class Character;
20 }
21 namespace Network
22 {
23 class Client;
24 
25 class PktSender
26 {
27 public:
28  virtual ~PktSender(){};
29  virtual void Send( Client* client ) = 0;
30 };
31 
32 class SendWorldItem : public PktSender
33 {
34 public:
35  SendWorldItem( u32 serial, u16 graphic, u16 amount, u16 x, u16 y, s8 z, u8 facing, u16 color,
36  u8 flags );
37  virtual ~SendWorldItem(){};
38  virtual void Send( Client* client ) POL_OVERRIDE;
39  void updateFlags( u8 flags );
40 
41 private:
42  void buildF3();
43  void build1A();
50  s8 _z;
56 };
57 
58 class SendWorldMulti : public PktSender
59 {
60 public:
61  SendWorldMulti( u32 serial_ext, u16 graphic, u16 x, u16 y, s8 z, u16 color );
62  virtual ~SendWorldMulti(){};
63  virtual void Send( Client* client ) POL_OVERRIDE;
64 
65 private:
66  void buildF3();
67  void build1A();
73  s8 _z;
77 };
78 
80 {
81 public:
82  AddItemContainerMsg( u32 serial_ext, u16 graphic, u16 amount, u16 x, u16 y, u8 slotindex,
83  u32 containerserial_ext, u16 color );
84  virtual ~AddItemContainerMsg(){};
85  virtual void Send( Client* client ) POL_OVERRIDE;
86 
87 private:
88  void buildLegacy();
89  void build();
100 };
101 
103 {
104 public:
105  MobileAnimationMsg( u32 serial_ext, u16 anim, u16 action, u8 subaction, u16 action_old,
106  u16 framecount_old, u16 repeat_old, Core::DIRECTION_FLAG_OLD backward_old,
107  Core::REPEAT_FLAG_OLD repeat_flag_old, u8 delay_old, bool oldanim_valid,
108  bool newanim_valid );
109  MobileAnimationMsg( u32 serial_ext );
110  virtual ~MobileAnimationMsg(){};
111  virtual void Send( Client* client ) POL_OVERRIDE;
112  void update( u16 anim, u16 action, u8 subaction, u16 action_old, u16 framecount_old,
113  u16 repeat_old, Core::DIRECTION_FLAG_OLD backward_old,
114  Core::REPEAT_FLAG_OLD repeat_flag_old, u8 delay_old, bool oldanim_valid,
115  bool newanim_valid );
116 
117 private:
130  void build();
131  void build6E();
132 
135 };
136 
137 class PlaySoundPkt : public PktSender
138 {
139 public:
140  PlaySoundPkt( u8 type, u16 effect, u16 xcenter, u16 ycenter, s16 zcenter );
141  virtual ~PlaySoundPkt(){};
142  virtual void Send( Client* client ) POL_OVERRIDE;
143 
144 private:
145  void build();
152 };
153 
155 {
156 public:
157  RemoveObjectPkt( u32 serial );
158  virtual ~RemoveObjectPkt(){};
159  virtual void Send( Client* client ) POL_OVERRIDE;
160  void update( u32 serial );
161 
162 private:
163  void build();
166 };
167 
168 class SendDamagePkt : public PktSender
169 {
170 public:
171  SendDamagePkt( u32 serial, u16 damage );
172  virtual ~SendDamagePkt(){};
173  virtual void Send( Client* client ) POL_OVERRIDE;
174 
175 private:
176  void build();
177  void buildold();
178 
183 };
184 
185 class ObjRevisionPkt : public PktSender
186 {
187 public:
188  ObjRevisionPkt( u32 serial_ext, u32 rev );
189  virtual ~ObjRevisionPkt(){};
190  virtual void Send( Client* client ) POL_OVERRIDE;
191 
192 private:
193  void build();
194  void buildold();
195 
200 };
201 
203 {
204 public:
206  GraphicEffectPkt( u8 effect_type, u32 src_serial_ext, u32 dst_serial_ext, u16 effect, u16 xs,
207  u16 ys, s8 zs, u16 xd, u16 yd, s8 zd, u8 speed, u8 loop, u8 explode, u8 unk26 );
208  virtual ~GraphicEffectPkt(){};
209 
210  void movingEffect( const Core::UObject* src, const Core::UObject* dst, u16 effect, u8 speed,
211  u8 loop, u8 explode );
212  void movingEffect( u16 xs, u16 ys, s8 zs, u16 xd, u16 yd, s8 zd, u16 effect, u8 speed, u8 loop,
213  u8 explode );
214  void lightningBold( const Core::UObject* center );
215  void followEffect( const Core::UObject* center, u16 effect, u8 speed, u8 loop );
216  void stationaryEffect( u16 xs, u16 ys, s8 zs, u16 effect, u8 speed, u8 loop, u8 explode );
217 
218  virtual void Send( Client* client ) POL_OVERRIDE;
219 
220 private:
221  void build();
222 
237 
239 };
240 
242 {
243 public:
245  GraphicEffectExPkt( u8 effect_type, u32 src_serial_ext, u32 dst_serial_ext, u16 srcx, u16 srcy,
246  s8 srcz, u16 dstx, u16 dsty, s8 dstz, u16 effect, u8 speed, u8 duration,
247  u8 direction, u8 explode, u32 hue, u32 render, u16 effect3d,
248  u16 effect3dexplode, u16 effect3dsound, u32 itemid, u8 layer );
249  virtual ~GraphicEffectExPkt(){};
250 
251  void movingEffect( const Core::UObject* src, const Core::UObject* dst, u16 effect, u8 speed,
252  u8 duration, u32 hue, u32 render, u8 direction, u8 explode, u16 effect3d,
253  u16 effect3dexplode, u16 effect3dsound );
254  void movingEffect( u16 xs, u16 ys, s8 zs, u16 xd, u16 yd, s8 zd, u16 effect, u8 speed,
255  u8 duration, u32 hue, u32 render, u8 direction, u8 explode, u16 effect3d,
256  u16 effect3dexplode, u16 effect3dsound );
257  void followEffect( const Core::UObject* center, u16 effect, u8 speed, u8 duration, u32 hue,
258  u32 render, u8 layer, u16 effect3d );
259  void stationaryEffect( u16 x, u16 y, s8 z, u16 effect, u8 speed, u8 duration, u32 hue, u32 render,
260  u16 effect3d );
261 
262  virtual void Send( Client* client ) POL_OVERRIDE;
263 
264 private:
265  void build();
266 
288 
290 };
291 
293 {
294 public:
295  enum Color : u8
296  {
297  GREEN = 1,
298  YELLOW = 2,
299  RED = 3,
300  };
301  HealthBarStatusUpdate( u32 serial_ext, Color color, bool enable );
303  virtual void Send( Client* client ) POL_OVERRIDE;
304 
305 private:
306  void build();
307 
309  bool _enable;
312 };
313 
314 class MoveChrPkt : public PktSender
315 {
316 public:
317  MoveChrPkt( const Mobile::Character* chr );
318  virtual ~MoveChrPkt(){};
319  virtual void Send( Client* client ) POL_OVERRIDE;
320 
321 private:
322  void build();
323 
326 };
327 }
328 }
329 #endif
unsigned char u8
Definition: rawtypes.h:25
PktHelper::PacketOut< PktOut_C7 > _p
Definition: packetdefs.h:289
#define POL_OVERRIDE
PktHelper::PacketOut< PktOut_F3 > _p
Definition: packetdefs.h:76
PktHelper::PacketOut< PktOut_70 > _p
Definition: packetdefs.h:238
const Mobile::Character * _chr
Definition: packetdefs.h:324
PktHelper::PacketOut< PktOut_1D > _p
Definition: packetdefs.h:165
PktHelper::PacketOut< PktOut_6E > _p_old
Definition: packetdefs.h:133
PktHelper::PacketOut< PktOut_E2 > _p
Definition: packetdefs.h:134
unsigned short u16
Definition: rawtypes.h:26
unsigned int u32
Definition: rawtypes.h:27
PktHelper::PacketOut< PktOut_1A > _p_old
Definition: packetdefs.h:54
signed short s16
Definition: rawtypes.h:30
PktHelper::PacketOut< PktOut_25 > _p_old
Definition: packetdefs.h:98
REPEAT_FLAG_OLD
Definition: action.h:78
signed char s8
Definition: rawtypes.h:29
PktHelper::PacketOut< PktOut_BF_Sub22 > _p_old
Definition: packetdefs.h:181
PktHelper::PacketOut< PktOut_25 > _p
Definition: packetdefs.h:99
PktHelper::PacketOut< PktOut_54 > _p
Definition: packetdefs.h:151
PktHelper::PacketOut< PktOut_DC > _p
Definition: packetdefs.h:199
PktHelper::PacketOut< PktOut_0B > _p
Definition: packetdefs.h:182
PktHelper::PacketOut< PktOut_F3 > _p
Definition: packetdefs.h:55
PktHelper::PacketOut< PktOut_17 > _p
Definition: packetdefs.h:311
PktHelper::PacketOut< PktOut_BF_Sub10 > _p_old
Definition: packetdefs.h:198
PktHelper::PacketOut< PktOut_1A > _p_old
Definition: packetdefs.h:75
DIRECTION_FLAG_OLD
Definition: action.h:73
Definition: berror.cpp:12
PktHelper::PacketOut< PktOut_77 > _p
Definition: packetdefs.h:325