ManaPlus
playerhandler.cpp
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2004-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2019 The ManaPlus Developers
6  * Copyright (C) 2019-2021 Andrei Karas
7  *
8  * This file is part of The ManaPlus Client.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
25 
26 #include "notifymanager.h"
27 #include "party.h"
28 
29 #include "being/localplayer.h"
30 #include "being/playerinfo.h"
31 
32 #include "const/net/nostat.h"
33 
35 
38 
40 
41 #include "net/eathena/messageout.h"
43 #include "net/eathena/sp.h"
44 
45 #include "resources/db/unitsdb.h"
46 
47 #include "debug.h"
48 
49 extern int packetVersion;
50 extern int packetVersionMain;
51 extern int packetVersionRe;
52 extern int packetVersionZero;
53 extern int serverVersion;
54 
55 namespace EAthena
56 {
57 
59  Ea::PlayerHandler()
60 {
61  playerHandler = this;
62 }
63 
65 {
66  playerHandler = nullptr;
67 }
68 
70  const Keep keep) const
71 {
72  createOutPacket(CMSG_PLAYER_CHANGE_ACT);
73  outMsg.writeBeingId(id, "target id");
74  if (keep == Keep_true)
75  outMsg.writeInt8(7, "action");
76  else
77  outMsg.writeInt8(0, "action");
78 }
79 
81 {
82  createOutPacket(CMSG_PLAYER_STOP_ATTACK);
83 }
84 
85 void PlayerHandler::emote(const uint8_t emoteId) const
86 {
87  createOutPacket(CMSG_PLAYER_EMOTE);
88  outMsg.writeInt8(emoteId, "emote id");
89 }
90 
92  const int amount) const
93 {
94  if (attr >= Attributes::PLAYER_STR && attr <= Attributes::PLAYER_LUK)
95  {
96  createOutPacket(CMSG_STAT_UPDATE_REQUEST);
97  outMsg.writeInt16(CAST_S16(attr), "attribute id");
98  outMsg.writeInt8(CAST_S8(amount), "increase");
99  }
100 }
101 
102 void PlayerHandler::increaseSkill(const uint16_t skillId) const
103 {
105  return;
106 
107  createOutPacket(CMSG_SKILL_LEVELUP_REQUEST);
108  outMsg.writeInt16(skillId, "skill id");
109 }
110 
111 void PlayerHandler::pickUp(const FloorItem *const floorItem) const
112 {
113  if (floorItem == nullptr)
114  return;
115 
116  createOutPacket(CMSG_ITEM_PICKUP);
117  const BeingId id = floorItem->getId();
118  if (packetVersion >= 20101124)
119  {
120  outMsg.writeBeingId(id, "object id");
121  }
122  else if (packetVersion >= 20080827)
123  {
124  outMsg.writeInt32(0, "unused");
125  outMsg.writeInt8(0, "unused");
126  outMsg.writeBeingId(id, "object id");
127  }
128  else if (packetVersion >= 20070212)
129  {
130  outMsg.writeInt32(0, "unused");
131  outMsg.writeBeingId(id, "object id");
132  }
133  else if (packetVersion >= 20070108)
134  {
135  outMsg.writeInt32(0, "unused");
136  outMsg.writeInt8(0, "unused");
137  outMsg.writeBeingId(id, "object id");
138  }
139  else if (packetVersion >= 20050719)
140  {
141  outMsg.writeInt32(0, "unused");
142  outMsg.writeInt16(0, "unused");
143  outMsg.writeInt8(0, "unused");
144  outMsg.writeBeingId(id, "object id");
145  }
146  else if (packetVersion >= 20050718)
147  {
148  outMsg.writeInt8(0, "unused");
149  outMsg.writeBeingId(id, "object id");
150  }
151  else if (packetVersion >= 20050628)
152  {
153  outMsg.writeInt32(0, "unused");
154  outMsg.writeInt8(0, "unused");
155  outMsg.writeBeingId(id, "object id");
156  }
157  else if (packetVersion >= 20050509)
158  {
159  outMsg.writeInt16(0, "unused");
160  outMsg.writeBeingId(id, "object id");
161  }
162  else if (packetVersion >= 20050110)
163  {
164  outMsg.writeInt16(0, "unused");
165  outMsg.writeInt8(0, "unused");
166  outMsg.writeBeingId(id, "object id");
167  }
168  else if (packetVersion >= 20041129)
169  {
170  outMsg.writeInt8(0, "unused");
171  outMsg.writeBeingId(id, "object id");
172  }
173  else if (packetVersion >= 20041025)
174  {
175  outMsg.writeInt16(0, "unused");
176  outMsg.writeInt8(0, "unused");
177  outMsg.writeBeingId(id, "object id");
178  }
179  else if (packetVersion >= 20041005)
180  {
181  outMsg.writeInt32(0, "unused");
182  outMsg.writeBeingId(id, "object id");
183  }
184  else if (packetVersion >= 20040920)
185  {
186  outMsg.writeInt32(0, "unused");
187  outMsg.writeInt32(0, "unused");
188  outMsg.writeBeingId(id, "object id");
189  }
190  else if (packetVersion >= 20040906)
191  {
192  outMsg.writeInt32(0, "unused");
193  outMsg.writeInt8(0, "unused");
194  outMsg.writeBeingId(id, "object id");
195  }
196  else if (packetVersion >= 20040809)
197  {
198  outMsg.writeInt32(0, "unused");
199  outMsg.writeInt16(0, "unused");
200  outMsg.writeInt8(0, "unused");
201  outMsg.writeBeingId(id, "object id");
202  }
203  else if (packetVersion >= 20040713)
204  {
205  outMsg.writeInt32(0, "unused");
206  outMsg.writeBeingId(id, "object id");
207  }
208  else
209  {
210  outMsg.writeBeingId(id, "object id");
211  }
212 
214 }
215 
216 void PlayerHandler::setDirection(const unsigned char direction) const
217 {
218  createOutPacket(CMSG_PLAYER_CHANGE_DIR);
219  if (packetVersion >= 20101124)
220  {
221  outMsg.writeInt8(0, "head direction");
222  outMsg.writeInt8(0, "unused");
223  outMsg.writeInt8(MessageOut::toServerDirection(direction),
224  "player direction");
225  }
226  else if (packetVersion >= 20080827)
227  {
228  outMsg.writeInt16(0, "unused");
229  outMsg.writeInt8(0, "head direction");
230  outMsg.writeInt32(0, "unused");
231  outMsg.writeInt8(MessageOut::toServerDirection(direction),
232  "player direction");
233  }
234  else if (packetVersion >= 20070212)
235  {
236  outMsg.writeInt32(0, "unused");
237  outMsg.writeInt16(0, "unused");
238  outMsg.writeInt8(0, "head direction");
239  outMsg.writeInt16(0, "unused");
240  outMsg.writeInt8(MessageOut::toServerDirection(direction),
241  "player direction");
242  }
243  else if (packetVersion >= 20070108)
244  {
245  outMsg.writeInt32(0, "unused");
246  outMsg.writeInt32(0, "unused");
247  outMsg.writeInt8(0, "head direction");
248  outMsg.writeInt16(0, "unused");
249  outMsg.writeInt8(MessageOut::toServerDirection(direction),
250  "player direction");
251  }
252  else if (packetVersion >= 20060327)
253  {
254  outMsg.writeInt32(0, "unused");
255  outMsg.writeInt8(0, "unused");
256  outMsg.writeInt8(0, "head direction");
257  outMsg.writeInt8(0, "unused");
258  outMsg.writeInt16(0, "unused");
259  outMsg.writeInt8(MessageOut::toServerDirection(direction),
260  "player direction");
261  }
262  else if (packetVersion >= 20050719)
263  {
264  outMsg.writeInt32(0, "unused");
265  outMsg.writeInt16(0, "unused");
266  outMsg.writeInt8(0, "head direction");
267  outMsg.writeInt8(0, "unused");
268  outMsg.writeInt32(0, "unused");
269  outMsg.writeInt16(0, "unused");
270  outMsg.writeInt8(MessageOut::toServerDirection(direction),
271  "player direction");
272  }
273  else if (packetVersion >= 20050718)
274  {
275  outMsg.writeInt32(0, "unused");
276  outMsg.writeInt8(0, "head direction");
277  outMsg.writeInt8(0, "unused");
278  outMsg.writeInt16(0, "unused");
279  outMsg.writeInt8(MessageOut::toServerDirection(direction),
280  "player direction");
281  }
282  else if (packetVersion >= 20050628)
283  {
284  outMsg.writeInt32(0, "unused");
285  outMsg.writeInt16(0, "unused");
286  outMsg.writeInt8(0, "head direction");
287  outMsg.writeInt8(0, "unused");
288  outMsg.writeInt32(0, "unused");
289  outMsg.writeInt16(0, "unused");
290  outMsg.writeInt8(MessageOut::toServerDirection(direction),
291  "player direction");
292  }
293  else if (packetVersion >= 20050509)
294  {
295  outMsg.writeInt8(0, "unused");
296  outMsg.writeInt32(0, "unused");
297  outMsg.writeInt16(0, "unused");
298  outMsg.writeInt8(0, "head direction");
299  outMsg.writeInt8(0, "unused");
300  outMsg.writeInt16(0, "unused");
301  outMsg.writeInt8(MessageOut::toServerDirection(direction),
302  "player direction");
303  }
304  else if (packetVersion >= 20050110)
305  {
306  outMsg.writeInt32(0, "unused");
307  outMsg.writeInt32(0, "unused");
308  outMsg.writeInt16(0, "unused");
309  outMsg.writeInt8(0, "head direction");
310  outMsg.writeInt8(0, "unused");
311  outMsg.writeInt32(0, "unused");
312  outMsg.writeInt32(0, "unused");
313  outMsg.writeInt8(MessageOut::toServerDirection(direction),
314  "player direction");
315  }
316  else if (packetVersion >= 20041129)
317  {
318  outMsg.writeInt8(0, "unused");
319  outMsg.writeInt8(0, "head direction");
320  outMsg.writeInt8(0, "unused");
321  outMsg.writeInt16(0, "unused");
322  outMsg.writeInt8(MessageOut::toServerDirection(direction),
323  "player direction");
324  }
325  else if (packetVersion >= 20041025)
326  {
327  outMsg.writeInt32(0, "unused");
328  outMsg.writeInt8(0, "head direction");
329  outMsg.writeInt8(0, "unused");
330  outMsg.writeInt32(0, "unused");
331  outMsg.writeInt16(0, "unused");
332  outMsg.writeInt8(MessageOut::toServerDirection(direction),
333  "player direction");
334  }
335  else if (packetVersion >= 20041005)
336  {
337  outMsg.writeInt16(0, "unused");
338  outMsg.writeInt8(0, "unused");
339  outMsg.writeInt8(0, "head direction");
340  outMsg.writeInt32(0, "unused");
341  outMsg.writeInt16(0, "unused");
342  outMsg.writeInt8(MessageOut::toServerDirection(direction),
343  "player direction");
344  }
345  else if (packetVersion >= 20040920)
346  {
347  outMsg.writeInt32(0, "unused");
348  outMsg.writeInt16(0, "unused");
349  outMsg.writeInt8(0, "head direction");
350  outMsg.writeInt32(0, "unused");
351  outMsg.writeInt32(0, "unused");
352  outMsg.writeInt8(MessageOut::toServerDirection(direction),
353  "player direction");
354  }
355  else if (packetVersion >= 20040906)
356  {
357  outMsg.writeInt16(0, "unused");
358  outMsg.writeInt8(0, "head direction");
359  outMsg.writeInt16(0, "unused");
360  outMsg.writeInt16(0, "unused");
361  outMsg.writeInt8(MessageOut::toServerDirection(direction),
362  "player direction");
363  }
364  else if (packetVersion >= 20040809)
365  {
366  outMsg.writeInt16(0, "unused");
367  outMsg.writeInt16(0, "unused");
368  outMsg.writeInt8(0, "unused");
369  outMsg.writeInt8(0, "head direction");
370  outMsg.writeInt16(0, "unused");
371  outMsg.writeInt8(0, "unused");
372  outMsg.writeInt8(MessageOut::toServerDirection(direction),
373  "player direction");
374  }
375  else if (packetVersion >= 20040713)
376  {
377  outMsg.writeInt8(0, "unused");
378  outMsg.writeInt8(0, "unused");
379  outMsg.writeInt8(0, "unused");
380  outMsg.writeInt8(0, "head direction");
381  outMsg.writeInt16(0, "unused");
382  outMsg.writeInt16(0, "unused");
383  outMsg.writeInt16(0, "unused");
384  outMsg.writeInt8(MessageOut::toServerDirection(direction),
385  "player direction");
386  }
387  else
388  {
389  outMsg.writeInt8(0, "head direction");
390  outMsg.writeInt8(0, "unused");
391  outMsg.writeInt8(MessageOut::toServerDirection(direction),
392  "player direction");
393  }
394 }
395 
396 void PlayerHandler::setDestination(const int x, const int y,
397  const int direction) const
398 {
399  createOutPacket(CMSG_PLAYER_CHANGE_DEST);
400  if (packetVersion >= 20080827 && packetVersion < 20101124)
401  outMsg.writeInt32(0, "unused");
402  outMsg.writeCoordinates(CAST_U16(x),
403  CAST_U16(y),
404  CAST_U8(direction), "destination");
405 }
406 
407 void PlayerHandler::changeAction(const BeingActionT &action) const
408 {
409  unsigned char type;
410  switch (action)
411  {
412  case BeingAction::SIT:
413  type = 2;
414  break;
415  case BeingAction::STAND:
417  type = 3;
418  break;
419  default:
420  case BeingAction::MOVE:
421  case BeingAction::ATTACK:
422  case BeingAction::DEAD:
423  case BeingAction::HURT:
424  case BeingAction::SPAWN:
425  case BeingAction::CAST:
426  return;
427  }
428 
429  createOutPacket(CMSG_PLAYER_CHANGE_ACT);
430  outMsg.writeInt32(0, "unused");
431  outMsg.writeInt8(type, "action");
432 }
433 
435 {
436  createOutPacket(CMSG_PLAYER_RESTART);
437  outMsg.writeInt8(0, "action");
438 }
439 
441 {
442  createOutPacket(CMSG_ONLINE_LIST);
443 }
444 
445 void PlayerHandler::updateStatus(const uint8_t status) const
446 {
447  createOutPacket(CMSG_SET_STATUS);
448  outMsg.writeInt8(status, "status");
449  outMsg.writeInt8(0, "unused");
450 }
451 
452 void PlayerHandler::setShortcut(const int idx,
453  const int tab,
454  const uint8_t type,
455  const int id,
456  const int level) const
457 {
458  createOutPacket(CMSG_SET_SHORTCUTS);
459  if (packetVersionMain >= 20190522 ||
460  packetVersionRe >= 20190508 ||
461  packetVersionZero >= 20190605)
462  {
463  outMsg.writeInt16(CAST_S16(tab), "tab");
464  }
465  outMsg.writeInt16(CAST_S16(idx), "index");
466  outMsg.writeInt8(CAST_S8(type), "type");
467  outMsg.writeInt32(id, "id");
468  outMsg.writeInt16(CAST_S16(level), "level");
469 }
470 
472  const int tab) const
473 {
474  if (packetVersion < 20140129)
475  return;
476  createOutPacket(CMSG_SHORTCUTS_ROW_SHIFT);
477  if (packetVersionMain >= 20190522 ||
478  packetVersionRe >= 20190508 ||
479  packetVersionZero >= 20190605)
480  {
481  outMsg.writeInt16(CAST_S16(tab), "tab");
482  }
483  outMsg.writeInt8(CAST_S8(row), "row");
484 }
485 
487 {
488  createOutPacket(CMSG_REMOVE_OPTION);
489 }
490 
491 void PlayerHandler::changeCart(const int type) const
492 {
493  createOutPacket(CMSG_CHANGE_CART);
494  outMsg.writeInt16(CAST_S16(type), "type");
495 }
496 
498 {
499  createOutPacket(CMSG_PLAYER_SET_MEMO);
500 }
501 
503 {
504  createOutPacket(CMSG_DORI_DORI);
505 }
506 
508 {
509  createOutPacket(CMSG_EXPLOSION_SPIRITS);
510 }
511 
513 {
514  createOutPacket(CMSG_PVP_INFO);
515  outMsg.writeInt32(0, "char id");
516  outMsg.writeInt32(0, "account id");
517 }
518 
520 {
521  createOutPacket(CMSG_PLAYER_AUTO_REVIVE);
522 }
523 
525  const int data) const
526 {
527  createOutPacket(CMSG_SET_CONFIG_OPTION);
528  outMsg.writeInt32(id, "config option");
529  outMsg.writeInt32(data, "config data");
530 }
531 
532 #define setStatComplex(stat) \
533  PlayerInfo::setStatBase(stat, CAST_S32(base), notify); \
534  if (mod != NoStat) \
535  PlayerInfo::setStatMod(stat, mod, Notify_true)
536 
538  const int type,
539  const int64_t base,
540  const int mod,
541  const Notify notify) const
542 {
543  switch (type)
544  {
545  case Sp::SPEED:
548  CAST_S32(base),
549  Notify_true);
551  0,
552  Notify_true);
553  break;
554  case Sp::BASEEXP:
556  base,
557  Notify_true);
558  break;
559  case Sp::JOBEXP:
561  base,
562  Notify_true);
563  break;
564  case Sp::KARMA:
566  CAST_S32(base),
567  Notify_true);
569  0,
570  Notify_true);
571  break;
572  case Sp::MANNER:
574  CAST_S32(base),
575  Notify_true);
577  0,
578  Notify_true);
579  break;
580  case Sp::HP:
582  base,
583  Notify_true);
584  if (localPlayer->isInParty() && (Party::getParty(1) != nullptr))
585  {
586  PartyMember *const m = Party::getParty(1)
588  if (m != nullptr)
589  {
590  m->setHp(CAST_S32(base));
593  }
594  }
595  break;
596  case Sp::MAXHP:
598  base,
599  Notify_true);
600 
601  if (localPlayer->isInParty() && (Party::getParty(1) != nullptr))
602  {
603  PartyMember *const m = Party::getParty(1)->getMember(
604  localPlayer->getId());
605  if (m != nullptr)
606  {
608  m->setMaxHp(CAST_S32(base));
609  }
610  }
611  break;
612  case Sp::SP:
614  base,
615  Notify_true);
616  break;
617  case Sp::MAXSP:
619  base,
620  Notify_true);
621  break;
622  case Sp::STATUSPOINT:
624  base,
625  Notify_true);
626  break;
627  case Sp::BASELEVEL:
629  base,
630  Notify_true);
631  if (localPlayer != nullptr)
632  {
635  }
636  break;
637  case Sp::SKILLPOINT:
639  base,
640  Notify_true);
641  if (skillDialog != nullptr)
642  skillDialog->update();
643  break;
644  case Sp::STR:
646  break;
647  case Sp::AGI:
649  break;
650  case Sp::VIT:
652  break;
653  case Sp::INT:
655  break;
656  case Sp::DEX:
658  break;
659  case Sp::LUK:
661  break;
662  case Sp::ZENY:
663  {
664  const int oldMoney = PlayerInfo::getAttribute(Attributes::MONEY);
665  const int newMoney = CAST_S32(base);
666  if (newMoney > oldMoney)
667  {
669  UnitsDb::formatCurrency(newMoney - oldMoney));
670  }
671  else if (newMoney < oldMoney)
672  {
674  UnitsDb::formatCurrency(oldMoney - newMoney).c_str());
675  }
676 
678  newMoney,
679  Notify_true);
680  break;
681  }
682  case Sp::NEXTBASEEXP:
684  base,
685  Notify_true);
686  break;
687  case Sp::NEXTJOBEXP:
689  base,
690  Notify_true);
691  break;
692  case Sp::WEIGHT:
694  base,
695  Notify_true);
696  break;
697  case Sp::MAXWEIGHT:
699  base,
700  Notify_true);
701  break;
702  case Sp::USTR:
704  CAST_S32(base));
705  break;
706  case Sp::UAGI:
708  CAST_S32(base));
709  break;
710  case Sp::UVIT:
712  CAST_S32(base));
713  break;
714  case Sp::UINT:
716  CAST_S32(base));
717  break;
718  case Sp::UDEX:
720  CAST_S32(base));
721  break;
722  case Sp::ULUK:
724  CAST_S32(base));
725  break;
726 
727  case Sp::ATK1:
729  CAST_S32(base),
730  Notify_true);
732  break;
733  case Sp::ATK2:
735  CAST_S32(base),
736  Notify_true);
738  break;
739  case Sp::MATK1:
741  CAST_S32(base),
742  Notify_true);
743  break;
744  case Sp::MATK2:
746  CAST_S32(base),
747  Notify_true);
748  break;
749  case Sp::DEF1:
751  CAST_S32(base),
752  Notify_true);
753  break;
754  case Sp::DEF2:
756  CAST_S32(base),
757  Notify_true);
758  break;
759  case Sp::MDEF1:
761  CAST_S32(base),
762  Notify_true);
763  break;
764  case Sp::MDEF2:
766  CAST_S32(base),
767  Notify_true);
768  break;
769  case Sp::HIT:
771  CAST_S32(base),
772  Notify_true);
773  break;
774  case Sp::FLEE1:
776  CAST_S32(base),
777  Notify_true);
778  break;
779  case Sp::FLEE2:
781  CAST_S32(base),
782  Notify_true);
783  break;
784  case Sp::CRITICAL:
786  CAST_S32(base),
787  Notify_true);
788  break;
789  case Sp::ASPD:
792  CAST_S32(base),
793  Notify_true);
795  0,
796  Notify_true);
798  break;
799  case Sp::JOBLEVEL:
801  base,
802  Notify_true);
803  break;
804 
805  default:
807  break;
808  }
809 }
810 
811 void PlayerHandler::selectStyle(const int headColor,
812  const int headStyle,
813  const int bodyColor,
814  const int topStyle,
815  const int middleStyle,
816  const int bottomStyle,
817  const int bodyStyle) const
818 {
819  if (packetVersion < 20151104)
820  return;
821  if (packetVersionMain >= 20180516 ||
822  packetVersionRe >= 20180516 ||
823  packetVersionZero >= 20180523)
824  {
825  createOutPacket(CMSG_PLAYER_SELECT_STYLE2);
826  outMsg.writeInt16(CAST_S16(headColor), "head color");
827  outMsg.writeInt16(CAST_S16(headStyle), "head style");
828  outMsg.writeInt16(CAST_S16(bodyColor), "body color");
829  outMsg.writeInt16(CAST_S16(topStyle), "top style");
830  outMsg.writeInt16(CAST_S16(middleStyle), "middle style");
831  outMsg.writeInt16(CAST_S16(bottomStyle), "bottom style");
832  outMsg.writeInt16(CAST_S16(bodyStyle), "body style");
833  }
834  else
835  {
836  createOutPacket(CMSG_PLAYER_SELECT_STYLE);
837  outMsg.writeInt16(CAST_S16(headColor), "head color");
838  outMsg.writeInt16(CAST_S16(headStyle), "head style");
839  outMsg.writeInt16(CAST_S16(bodyColor), "body color");
840  outMsg.writeInt16(CAST_S16(topStyle), "top style");
841  outMsg.writeInt16(CAST_S16(middleStyle), "middle style");
842  outMsg.writeInt16(CAST_S16(bottomStyle), "bottom style");
843  }
844 }
845 
846 void PlayerHandler::setTitle(const int titleId) const
847 {
848  if (packetVersion < 20140903)
849  return;
850  createOutPacket(CMSG_PLAYER_SET_TITLE);
851  outMsg.writeInt32(titleId, "title");
852 }
853 
855 {
856  if (packetVersion < 20151104)
857  return;
858  createOutPacket(CMSG_PLAYER_STYLE_CLOSE);
859 }
860 
861 #undef setStatComplex
862 
863 } // namespace EAthena
Attributes ::T AttributesT
Definition: attributes.h:118
BeingAction ::T BeingActionT
Definition: beingaction.h:41
int BeingId
Definition: beingid.h:30
#define CAST_U16
Definition: cast.h:29
#define CAST_S8
Definition: cast.h:26
#define CAST_S16
Definition: cast.h:28
#define CAST_S32
Definition: cast.h:30
#define CAST_U8
Definition: cast.h:27
BeingId getId() const
Definition: actorsprite.h:64
void setMaxHp(const int maxHp)
Definition: avatar.h:99
void setHp(const int hp)
Definition: avatar.h:93
void setAttackSpeed(const int speed)
Definition: being.h:464
void updateName()
Definition: being.cpp:3425
void setLevel(const int n)
Definition: being.h:601
void setWalkSpeed(const int speed)
Definition: being.h:452
bool isInParty() const
Definition: being.h:321
void pickUp(const FloorItem *const floorItem) const
void changeCart(const int type) const
void attack(const BeingId id, const Keep keep) const
void setDestination(const int x, const int y, const int direction) const
void updateStatus(const uint8_t status) const
void closeStyleWindow() const
void setTitle(const int titleId) const
void setShortcut(const int idx, const int tab, const uint8_t type, const int id, const int level) const
void requestOnlineList() const
void emote(const uint8_t emoteId) const
void setStat(Net::MessageIn &msg, const int type, const int64_t base, const int mod, const Notify notify) const
void increaseSkill(const uint16_t skillId) const
void changeAction(const BeingActionT &action) const
void increaseAttribute(const AttributesT attr, const int amount) const
void setConfigOption(const int id, const int data) const
void setDirection(const unsigned char direction) const
void shortcutShiftRow(const int row, const int tab) const
void selectStyle(const int headColor, const int headStyle, const int bodyColor, const int topStyle, const int middleStyle, const int bottomStyle, const int bodyStyle) const
void explosionSpirits() const
static void pushPickup(const BeingId floorId)
static unsigned char toServerDirection(unsigned char direction) A_CONST
Definition: messageout.cpp:253
PartyMember * getMember(const BeingId id) const
Definition: party.cpp:99
static Party * getParty(const int16_t id)
Definition: party.cpp:313
std::string update(const int id)
void setPointsNeeded(const AttributesT id, const int needed)
#define setStatComplex(stat)
int serverVersion
Definition: client.cpp:124
int packetVersionRe
Definition: client.cpp:127
int packetVersionMain
Definition: client.cpp:126
int packetVersionZero
Definition: client.cpp:128
int packetVersion
Definition: client.cpp:125
const bool Keep_true
Definition: keep.h:30
bool Keep
Definition: keep.h:30
LocalPlayer * localPlayer
#define UNIMPLEMENTEDPACKETFIELD(field)
Definition: logger.h:59
uint32_t data
#define createOutPacket(name)
Definition: messageout.h:37
bool msg(InputEvent &event)
Definition: chat.cpp:39
@ PLAYER_CHAR_POINTS
Definition: attributes.h:49
@ PLAYER_EXP_NEEDED
Definition: attributes.h:37
@ TOTAL_WEIGHT
Definition: attributes.h:39
@ PLAYER_MAX_MP
Definition: attributes.h:35
@ PLAYER_BASE_LEVEL
Definition: attributes.h:31
@ PLAYER_KARMA
Definition: attributes.h:55
@ PLAYER_JOB_EXP
Definition: attributes.h:66
@ PLAYER_JOB_LEVEL
Definition: attributes.h:41
@ PLAYER_WALK_SPEED
Definition: attributes.h:53
@ PLAYER_MANNER
Definition: attributes.h:56
@ PLAYER_MAX_HP
Definition: attributes.h:33
@ PLAYER_JOB_EXP_NEEDED
Definition: attributes.h:67
@ PLAYER_ATTACK_DELAY
Definition: attributes.h:51
@ PLAYER_SKILL_POINTS
Definition: attributes.h:48
void notify(const unsigned int message)
void setStatMod(const AttributesT id, const int value, const Notify notify)
Definition: playerinfo.cpp:159
int32_t getAttribute(const AttributesT id)
Definition: playerinfo.cpp:102
void setAttribute(const AttributesT id, const int64_t value, const Notify notify)
Definition: playerinfo.cpp:110
void updateAttrs()
Definition: playerinfo.cpp:420
void setStatBase(const AttributesT id, const int value, const Notify notify)
Definition: playerinfo.cpp:143
@ NEXTJOBEXP
Definition: sp.h:54
@ STATUSPOINT
Definition: sp.h:40
@ SPEED
Definition: sp.h:31
@ MAXSP
Definition: sp.h:39
@ DEF1
Definition: sp.h:76
@ MATK1
Definition: sp.h:74
@ CRITICAL
Definition: sp.h:83
@ FLEE2
Definition: sp.h:82
@ ATK2
Definition: sp.h:73
@ UAGI
Definition: sp.h:64
@ LUK
Definition: sp.h:49
@ ASPD
Definition: sp.h:84
@ MDEF1
Definition: sp.h:78
@ MAXWEIGHT
Definition: sp.h:56
@ ATK1
Definition: sp.h:72
@ NEXTBASEEXP
Definition: sp.h:53
@ JOBLEVEL
Definition: sp.h:86
@ DEX
Definition: sp.h:48
@ SP
Definition: sp.h:38
@ KARMA
Definition: sp.h:34
@ FLEE1
Definition: sp.h:81
@ USTR
Definition: sp.h:63
@ BASEEXP
Definition: sp.h:32
@ AGI
Definition: sp.h:45
@ ZENY
Definition: sp.h:51
@ HIT
Definition: sp.h:80
@ MANNER
Definition: sp.h:35
@ ULUK
Definition: sp.h:68
@ VIT
Definition: sp.h:46
@ WEIGHT
Definition: sp.h:55
@ DEF2
Definition: sp.h:77
@ HP
Definition: sp.h:36
@ INT
Definition: sp.h:47
@ JOBEXP
Definition: sp.h:33
@ STR
Definition: sp.h:44
@ UDEX
Definition: sp.h:67
@ UVIT
Definition: sp.h:65
@ UINT
Definition: sp.h:66
@ SKILLPOINT
Definition: sp.h:43
@ BASELEVEL
Definition: sp.h:42
@ MDEF2
Definition: sp.h:79
@ MATK2
Definition: sp.h:75
@ MAXHP
Definition: sp.h:37
std::string formatCurrency(const int value)
Definition: unitsdb.cpp:324
Net::PlayerHandler * playerHandler
Definition: net.cpp:96
bool Notify
Definition: notify.h:30
const bool Notify_true
Definition: notify.h:30
SkillDialog * skillDialog
Definition: skilldialog.cpp:66
StatusWindow * statusWindow