44 #include "gui/viewport.h"
67 #include "resources/map/map.h"
71 #include "utils/timer.h"
89 const uint32_t weapon,
90 const uint16_t headBottom,
91 const uint16_t headMid,
92 const uint16_t headTop,
94 const uint16_t gloves,
100 const uint32_t weapon,
101 const uint16_t headBottom,
102 const uint16_t headMid,
103 const uint16_t headTop,
104 const uint16_t shoes,
105 const uint16_t gloves,
106 const bool updateSlots)
108 const ActorTypeT actorType = dstBeing->getType();
113 dstBeing->setHairColor(hairColor);
125 ItemDB::get(-hairStyle).getDyeColorsString(hairColor));
147 dstBeing->setWeaponId(weapon);
155 if (dstBeing->getAllowNpcEquipment())
157 dstBeing->setHairColor(hairColor);
179 dstBeing->setWeaponId(weapon);
206 msg.readBeingId(
"being id"));
207 const uint8_t type =
msg.readUInt8(
"type");
209 const int id =
msg.readItemId(
"id1");
210 unsigned int id2 =
msg.readItemId(
"id2");
222 Being *dstBeing =
nullptr;
228 const BeingId id =
msg.readBeingId(
"being id");
230 FOR_EACH (Net::Characters::iterator, it, chars)
233 if (character->
dummy !=
nullptr &&
236 dstBeing = character->
dummy;
244 msg.readBeingId(
"being id"));
247 const uint8_t type =
msg.readUInt8(
"type");
249 const int id =
msg.readInt16(
"id1");
250 unsigned int id2 =
msg.readInt16(
"id2");
255 cards[f] =
msg.readUInt16(
"card");
257 if (dstBeing ==
nullptr)
264 Being *
const dstBeing,
268 const int *
const cards)
426 if (
msg.getVersion() >= 20091103)
428 msg.readInt16(
"len");
430 msg.readUInt8(
"object type"));
434 const BeingId id =
msg.readBeingId(
"being id");
435 if (
msg.getVersion() >= 20131223)
436 msg.readBeingId(
"char id");
444 int16_t speed =
msg.readInt16(
"speed");
445 const uint32_t opt1 =
msg.readInt16(
"opt1");
447 const uint32_t opt2 =
msg.readInt16(
"opt2");
449 if (
msg.getVersion() >= 20080102)
450 option =
msg.readInt32(
"option");
452 option =
msg.readInt16(
"option");
453 const int16_t job =
msg.readInt16(
"class");
465 if (dstBeing ==
nullptr)
471 if (dstBeing ==
nullptr)
504 const int hairStyle =
msg.readInt16(
"hair style");
506 if (
msg.getVersion() >= 7)
508 weapon =
msg.readItemId(
"weapon");
509 msg.readItemId(
"shield");
515 const uint16_t headBottom =
msg.readInt16(
"head bottom");
516 if (
msg.getVersion() < 7)
517 msg.readInt16(
"shield");
518 const uint16_t headTop =
msg.readInt16(
"head top");
519 const uint16_t headMid =
msg.readInt16(
"head mid");
522 const uint16_t shoes =
msg.readInt16(
"shoes or clothes color?");
524 const uint16_t gloves =
msg.readInt16(
"head dir / gloves");
526 if (
msg.getVersion() >= 20101124)
527 msg.readInt16(
"robe");
528 msg.readInt32(
"guild id");
529 msg.readInt16(
"guild emblem");
532 if (
msg.getVersion() >= 7)
533 opt3 =
msg.readInt32(
"opt3");
535 opt3 =
msg.readInt16(
"opt3");
537 const uint8_t gender =
CAST_U8(
msg.readUInt8(
"gender") & 3);
554 msg.readCoordinates(
x,
y, dir,
"position");
576 const int level =
CAST_S32(
msg.readInt16(
"level"));
579 if (
msg.getVersion() >= 20080102)
580 msg.readInt16(
"font");
582 if (
msg.getVersion() >= 20120221)
584 const int maxHP =
msg.readInt32(
"max hp");
585 const int hp =
msg.readInt32(
"hp");
588 msg.readInt8(
"is boss");
591 if (
msg.getVersion() >= 20150513)
593 msg.readInt16(
"body2");
595 if (
msg.getVersion() >= 20131223)
597 msg.readString(24,
"name");
611 if (
msg.getVersion() >= 20091103)
612 msg.readInt16(
"len");
614 if (
msg.getVersion() >= 20071106)
617 msg.readUInt8(
"object type"));
626 const BeingId id =
msg.readBeingId(
"being id");
627 if (
msg.getVersion() >= 20131223)
628 msg.readBeingId(
"char id");
635 int16_t speed =
msg.readInt16(
"speed");
636 const uint32_t opt1 =
msg.readInt16(
"opt1");
638 const uint32_t opt2 =
msg.readInt16(
"opt2");
640 if (
msg.getVersion() >= 7)
641 option =
msg.readInt32(
"option");
643 option =
msg.readInt16(
"option");
644 const int16_t job =
msg.readInt16(
"class");
656 if (dstBeing ==
nullptr)
662 if (dstBeing ==
nullptr)
687 const int hairStyle =
msg.readInt16(
"hair style");
689 if (
msg.getVersion() >= 7)
691 weapon =
msg.readItemId(
"weapon");
692 msg.readItemId(
"shield");
698 const uint16_t headBottom =
msg.readInt16(
"head bottom");
699 msg.readInt32(
"tick");
700 if (
msg.getVersion() < 7)
701 msg.readInt16(
"shield");
702 const uint16_t headTop =
msg.readInt16(
"head top");
703 const uint16_t headMid =
msg.readInt16(
"head mid");
706 const uint16_t shoes =
msg.readInt16(
"shoes or clothes color?");
708 const uint16_t gloves =
msg.readInt16(
"head dir / gloves");
710 if (
msg.getVersion() >= 20101124)
711 msg.readInt16(
"robe");
712 msg.readInt32(
"guild id");
713 msg.readInt16(
"guild emblem");
716 if (
msg.getVersion() >= 7)
717 opt3 =
msg.readInt32(
"opt3");
719 opt3 =
msg.readInt16(
"opt3");
721 const uint8_t gender =
CAST_U8(
msg.readUInt8(
"gender") & 3);
739 msg.readCoordinatePair(srcX, srcY, dstX, dstY,
"move path");
740 msg.readUInt8(
"(sx<<4) | (sy&0x0f)");
762 if (abs(x2 - srcX) > abs(y2 - srcY))
775 const int level =
CAST_S32(
msg.readInt16(
"level"));
778 if (
msg.getVersion() >= 20080102)
779 msg.readInt16(
"font");
780 if (
msg.getVersion() >= 20120221)
782 const int maxHP =
msg.readInt32(
"max hp");
783 const int hp =
msg.readInt32(
"hp");
786 msg.readInt8(
"is boss");
788 if (
msg.getVersion() >= 20150513)
790 msg.readInt16(
"body2");
792 if (
msg.getVersion() >= 20131223)
794 msg.readString(24,
"name");
810 if (
msg.getVersion() >= 20091103)
812 msg.readInt16(
"len");
814 msg.readUInt8(
"object type"));
818 const BeingId id =
msg.readBeingId(
"being id");
819 if (
msg.getVersion() >= 20131223)
821 msg.readBeingId(
"char id");
825 int16_t speed =
msg.readInt16(
"speed");
826 const uint32_t opt1 =
msg.readInt16(
"opt1");
828 const uint32_t opt2 =
msg.readInt16(
"opt2");
830 if (
msg.getVersion() >= 20080102)
831 option =
msg.readInt32(
"option");
833 option =
msg.readInt16(
"option");
834 const int16_t job =
msg.readInt16(
"class");
846 if (dstBeing ==
nullptr)
852 if (dstBeing ==
nullptr)
877 const int hairStyle =
msg.readInt16(
"hair style");
879 if (
msg.getVersion() >= 7)
881 weapon =
msg.readItemId(
"weapon");
882 msg.readItemId(
"shield");
888 const uint16_t headBottom =
msg.readInt16(
"head bottom");
889 if (
msg.getVersion() < 7)
890 msg.readInt16(
"shield");
891 const uint16_t headTop =
msg.readInt16(
"head top");
892 const uint16_t headMid =
msg.readInt16(
"head mid");
895 const uint16_t shoes =
msg.readInt16(
"shoes or clothes color?");
896 const uint16_t gloves =
msg.readInt16(
"head dir / gloves");
898 if (
msg.getVersion() >= 20101124)
899 msg.readInt16(
"robe");
900 msg.readInt32(
"guild id");
901 msg.readInt16(
"guild emblem");
904 if (
msg.getVersion() >= 7)
905 opt3 =
msg.readInt32(
"opt3");
907 opt3 =
msg.readInt16(
"opt3");
910 const uint8_t gender =
CAST_U8(
msg.readUInt8(
"gender") & 3);
927 msg.readCoordinates(
x,
y, dir,
"position");
948 const int level =
CAST_S32(
msg.readInt16(
"level"));
951 if (
msg.getVersion() >= 20080102)
952 msg.readInt16(
"font");
953 if (
msg.getVersion() >= 20120221)
955 const int maxHP =
msg.readInt32(
"max hp");
956 const int hp =
msg.readInt32(
"hp");
959 msg.readInt8(
"is boss");
961 if (
msg.getVersion() >= 20150513)
963 msg.readInt16(
"body2");
965 if (
msg.getVersion() >= 20131223)
967 msg.readString(24,
"name");
978 const int16_t type =
msg.readInt16(
"type");
979 const int flags =
msg.readInt32(
"flags");
997 const int16_t type =
msg.readInt16(
"type");
1006 const BeingId srcId =
msg.readBeingId(
"src id");
1007 const BeingId dstId =
msg.readBeingId(
"dst id");
1008 const int dstX =
msg.readInt16(
"dst x");
1009 const int dstY =
msg.readInt16(
"dst y");
1010 const int skillId =
msg.readInt16(
"skill id");
1011 msg.readInt32(
"element");
1012 const int castTime =
msg.readInt32(
"cast time");
1026 const BeingId srcId =
msg.readBeingId(
"src id");
1027 const BeingId dstId =
msg.readBeingId(
"dst id");
1028 const int dstX =
msg.readInt16(
"dst x");
1029 const int dstY =
msg.readInt16(
"dst y");
1030 const int skillId =
msg.readInt16(
"skill id");
1031 msg.readInt32(
"element");
1032 const int castTime =
msg.readInt32(
"cast time");
1033 msg.readInt8(
"dispossable");
1047 const BeingId srcId =
msg.readBeingId(
"src id");
1048 const BeingId dstId =
msg.readBeingId(
"dst id");
1049 const int dstX =
msg.readInt16(
"dst x");
1050 const int dstY =
msg.readInt16(
"dst y");
1051 const int skillId =
msg.readInt16(
"skill id");
1052 msg.readInt32(
"element");
1053 const int castTime =
msg.readInt32(
"cast time");
1054 msg.readInt8(
"dispossable");
1055 msg.readInt32(
"unknown");
1069 msg.readInt16(
"len");
1070 const BeingId srcId =
msg.readBeingId(
"src id");
1071 const BeingId dstId =
msg.readBeingId(
"dst id");
1072 const int dstX =
msg.readInt16(
"dst x");
1073 const int dstY =
msg.readInt16(
"dst y");
1074 const int skillId =
msg.readInt16(
"skill id");
1075 const int skillLevel =
msg.readInt16(
"skill level");
1076 msg.readInt32(
"element");
1077 const int castTime =
msg.readInt32(
"cast time");
1078 const int range =
msg.readInt32(
"skill range");
1099 const int skillLevel,
1117 if (srcBeing !=
nullptr)
1120 if (dstBeing !=
nullptr)
1131 else if (dstX != 0 || dstY != 0)
1133 if (srcBeing !=
nullptr)
1139 if (srcBeing !=
nullptr)
1158 BLOCK_START(
"BeingRecv::processBeingStatusChange")
1161 BLOCK_END(
"BeingRecv::processBeingStatusChange")
1166 const uint16_t status =
msg.readInt16(
"status");
1167 const BeingId id =
msg.readBeingId(
"being id");
1169 msg.readUInt8(
"flag: 0: stop, 1: start"),
Enable);
1170 if (
msg.getVersion() >= 20120618)
1171 msg.readInt32(
"total");
1172 if (
msg.getVersion() >= 20090121)
1174 msg.readInt32(
"left");
1175 msg.readInt32(
"val1");
1176 msg.readInt32(
"val2");
1177 msg.readInt32(
"val3");
1184 if (dstBeing !=
nullptr)
1186 BLOCK_END(
"BeingRecv::processBeingStatusChange")
1194 BLOCK_END(
"BeingRecv::processBeingMove2")
1204 msg.readBeingId(
"being id"));
1210 msg.readCoordinatePair(srcX, srcY, dstX, dstY,
"move path");
1211 msg.readUInt8(
"(sx<<4) | (sy&0x0f)");
1212 msg.readInt32(
"tick");
1220 if (dstBeing ==
nullptr)
1222 BLOCK_END(
"BeingRecv::processBeingMove2")
1235 BLOCK_END(
"BeingRecv::processBeingMove2")
1243 BLOCK_END(
"BeingRecv::processBeingAction2")
1248 msg.readBeingId(
"src being id"));
1250 msg.readBeingId(
"dst being id"));
1252 msg.readInt32(
"tick");
1253 const int srcSpeed =
msg.readInt32(
"src speed");
1254 msg.readInt32(
"dst speed");
1256 if (
msg.getVersion() >= 20071113)
1257 param1 =
msg.readInt32(
"damage");
1259 param1 =
msg.readInt16(
"damage");
1260 if (
msg.getVersion() >= 20131223)
1261 msg.readUInt8(
"is sp damaged");
1262 msg.readInt16(
"count");
1264 msg.readUInt8(
"action"));
1265 if (
msg.getVersion() >= 20071113)
1266 msg.readInt32(
"left damage");
1268 msg.readInt16(
"left damage");
1281 if (srcBeing !=
nullptr)
1290 if (dstBeing !=
nullptr)
1303 if (srcBeing !=
nullptr)
1316 if (srcBeing !=
nullptr)
1336 BLOCK_END(
"BeingRecv::processBeingAction2")
1344 msg.readBeingId(
"being id"));
1347 if (
msg.getVersion() >= 20100126)
1349 hp =
msg.readInt32(
"hp");
1350 maxHP =
msg.readInt32(
"max hp");
1354 hp =
msg.readInt16(
"hp");
1355 maxHP =
msg.readInt16(
"max hp");
1357 if (dstBeing !=
nullptr)
1359 dstBeing->
setHP(hp);
1369 msg.readBeingId(
"monster id"));
1370 const int hp =
msg.readInt32(
"hp");
1371 const int maxHP =
msg.readInt32(
"max hp");
1372 if (dstBeing !=
nullptr)
1374 dstBeing->
setHP(hp);
1381 const int id =
msg.readInt16(
"skill id");
1382 msg.readInt16(
"inf");
1383 msg.readInt16(
"unused");
1384 const int level =
msg.readInt16(
"skill level");
1385 msg.readInt16(
"sp");
1386 msg.readInt16(
"range");
1387 msg.readString(24,
"skill name");
1388 msg.readInt8(
"unused");
1401 const int count = (
msg.readInt16(
"len") - 4) / 28;
1402 msg.readInt16(
"rank type");
1403 for (
int f = 0; f < count; f ++)
1405 msg.readString(24,
"name");
1406 msg.readInt32(
"points");
1408 msg.readInt32(
"my points");
1415 msg.readInt16(
"rank type");
1416 for (
int f = 0; f < 10; f ++)
1417 msg.readBeingId(
"char id");
1418 for (
int f = 0; f < 10; f ++)
1419 msg.readInt32(
"points");
1420 msg.readInt32(
"my points");
1427 for (
int f = 0; f < 10; f ++)
1428 msg.readString(24,
"name");
1429 for (
int f = 0; f < 10; f ++)
1430 msg.readInt32(
"points");
1437 for (
int f = 0; f < 10; f ++)
1438 msg.readString(24,
"name");
1439 for (
int f = 0; f < 10; f ++)
1440 msg.readInt32(
"points");
1447 for (
int f = 0; f < 10; f ++)
1448 msg.readString(24,
"name");
1449 for (
int f = 0; f < 10; f ++)
1450 msg.readInt32(
"points");
1457 for (
int f = 0; f < 10; f ++)
1458 msg.readString(24,
"name");
1459 for (
int f = 0; f < 10; f ++)
1460 msg.readInt32(
"points");
1465 BLOCK_START(
"BeingRecv::processBeingChangeDirection")
1468 BLOCK_END(
"BeingRecv::processBeingChangeDirection")
1473 msg.readBeingId(
"being id"));
1475 msg.readInt16(
"head direction");
1478 CAST_U8(
msg.readUInt8(
"player direction") & 0x0FU));
1480 if (dstBeing ==
nullptr)
1482 BLOCK_END(
"BeingRecv::processBeingChangeDirection")
1489 BLOCK_END(
"BeingRecv::processBeingChangeDirection")
1497 const BeingId id =
msg.readBeingId(
"being id");
1499 if (being ==
nullptr)
1501 msg.readInt32(
"effect type");
1505 const int effectType =
msg.readInt32(
"effect type");
1521 msg.readBeingId(
"being id");
1522 msg.readInt32(
"effect type");
1528 const int cnt = (
msg.readInt16(
"len") - 9) / 2;
1533 msg.readBeingId(
"being id");
1534 msg.readUInt8(
"enable");
1535 for (
int f = 0; f < cnt; f ++)
1536 msg.readInt16(
"hat effect");
1544 msg.readBeingId(
"account id");
1545 msg.readInt32(
"effect type");
1546 msg.readInt32(
"num");
1553 msg.readString(24,
"sound effect name");
1554 msg.readUInt8(
"type");
1555 msg.readInt32(
"unused");
1556 msg.readInt32(
"source being id");
1562 msg.readInt16(
"skill id");
1563 msg.readInt32(
"src id");
1564 msg.readInt16(
"val");
1567 msg.readInt32(
"tick");
1572 if (
msg.getVersion() >= 20110718)
1573 msg.readInt16(
"len");
1574 const BeingId id =
msg.readBeingId(
"skill unit id");
1575 const BeingId creatorId =
msg.readBeingId(
"creator accound id");
1576 const int x =
msg.readInt16(
"x");
1577 const int y =
msg.readInt16(
"y");
1579 if (
msg.getVersion() >= 20121212)
1580 job =
msg.readInt32(
"job");
1581 if (
msg.getVersion() >= 20110718)
1582 msg.readUInt8(
"radius");
1583 msg.readUInt8(
"visible");
1585 if (
msg.getVersion() >= 20130731)
1586 level =
msg.readUInt8(
"level");
1591 if (dstBeing ==
nullptr)
1604 BLOCK_END(
"BeingRecv::processPlayerStop")
1609 const BeingId id =
msg.readBeingId(
"account id");
1611 if (dstBeing ==
nullptr)
1613 msg.readInt16(
"opt1");
1614 msg.readInt16(
"opt2");
1615 if (
msg.getVersion() >= 7)
1616 msg.readInt32(
"option");
1618 msg.readInt16(
"option");
1619 msg.readUInt8(
"karma");
1623 const uint32_t opt1 =
msg.readInt16(
"opt1");
1624 const uint32_t opt2 =
msg.readInt16(
"opt2");
1626 if (
msg.getVersion() >= 7)
1627 option =
msg.readInt32(
"option");
1629 option =
msg.readInt16(
"option");
1635 BLOCK_END(
"BeingRecv::processPlayerStop")
1645 const BeingId id =
msg.readBeingId(
"account id");
1647 if (dstBeing ==
nullptr)
1650 const uint32_t option =
msg.readInt32(
"option");
1652 msg.readInt32(
"showEFST");
1662 BLOCK_END(
"BeingRecv::processBeingResurrect")
1668 const BeingId id =
msg.readBeingId(
"being id");
1669 msg.readInt16(
"unused");
1671 if (dstBeing ==
nullptr)
1674 BLOCK_END(
"BeingRecv::processBeingResurrect")
1689 BLOCK_END(
"BeingRecv::processBeingResurrect")
1697 const BeingId beingId =
msg.readBeingId(
"being id");
1698 msg.readInt32(
"group id");
1699 const std::string name =
msg.readString(24,
"name");
1700 msg.readString(24,
"title");
1705 if (dstBeing !=
nullptr)
1740 if (member !=
nullptr)
1752 BLOCK_START(
"BeingRecv::processPlayerGuilPartyInfo")
1755 BLOCK_END(
"BeingRecv::processPlayerGuilPartyInfo")
1759 const BeingId beingId =
msg.readBeingId(
"being id");
1760 const std::string name =
msg.readString(24,
"char name");
1763 if (dstBeing !=
nullptr)
1777 msg.readString(24,
"party name");
1778 msg.readString(24,
"guild name");
1779 msg.readString(24,
"guild pos");
1781 BLOCK_END(
"BeingRecv::processPlayerGuilPartyInfo")
1786 BLOCK_START(
"BeingRecv::processPlayerGuilPartyInfo2")
1789 BLOCK_END(
"BeingRecv::processPlayerGuilPartyInfo2")
1793 const BeingId beingId =
msg.readBeingId(
"being id");
1794 const std::string name =
msg.readString(24,
"char name");
1797 if (dstBeing !=
nullptr)
1811 msg.readString(24,
"party name");
1812 msg.readString(24,
"guild name");
1813 msg.readString(24,
"guild pos");
1816 msg.readInt32(
"title");
1817 BLOCK_END(
"BeingRecv::processPlayerGuilPartyInfo2")
1822 const BeingId id =
msg.readBeingId(
"skill unit id");
1826 if (dstBeing ==
nullptr)
1836 if (
msg.getVersion() < 20071106)
1838 msg.readBeingId(
"npc id");
1839 msg.skip(8,
"unused");
1840 msg.readInt16(
"class?");
1841 msg.skip(30,
"unused");
1842 msg.readCoordinates(
x,
y, dir,
"position");
1843 msg.readUInt8(
"sx");
1844 msg.readUInt8(
"sy");
1845 msg.skip(3,
"unused");
1849 msg.readUInt8(
"object type"));
1850 const BeingId id =
msg.readBeingId(
"npc id");
1851 msg.skip(8,
"unused");
1852 const uint16_t job =
msg.readInt16(
"class?");
1853 msg.skip(30,
"unused");
1854 msg.readCoordinates(
x,
y, dir,
"position");
1855 msg.readUInt8(
"sx");
1856 msg.readUInt8(
"sy");
1857 msg.skip(3,
"unused");
1860 if (dstBeing ==
nullptr)
1869 const BeingId id =
msg.readBeingId(
"account id");
1870 const int type =
msg.readInt16(
"type");
1871 const int value =
msg.readInt32(
"value");
1876 if (dstBeing ==
nullptr)
1892 BLOCK_END(
"BeingRecv::processBeingSelfEffect")
1896 const BeingId id =
msg.readBeingId(
"being id");
1898 if (being ==
nullptr)
1901 msg.readInt32(
"effect type");
1902 BLOCK_END(
"BeingRecv::processBeingSelfEffect")
1906 const int effectType =
msg.readInt32(
"effect type");
1910 BLOCK_END(
"BeingRecv::processBeingSelfEffect")
1917 const int len =
msg.readInt16(
"len");
1921 msg.readBeingId(
"monster id"));
1922 const int attackRange =
msg.readInt32(
"range");
1923 if (dstBeing !=
nullptr)
1931 const int len =
msg.readInt16(
"len");
1936 msg.readBeingId(
"player id"));
1937 const int groupId =
msg.readInt32(
"group id");
1939 mount =
msg.readInt16(
"mount");
1942 language =
msg.readInt16(
"language");
1945 clanId =
msg.readInt32(
"clan id");
1946 if (dstBeing !=
nullptr)
1957 if (
info ==
nullptr)
1975 msg.readInt16(
"class");
1976 msg.readInt16(
"level");
1977 msg.readInt16(
"size");
1978 msg.readInt32(
"hp");
1979 msg.readInt16(
"def");
1980 msg.readInt16(
"race");
1981 msg.readInt16(
"mdef");
1982 msg.readInt16(
"ele");
1989 msg.readBeingId(
"being id");
1990 msg.readUInt8(
"type");
1991 msg.readInt32(
"class");
1999 msg.readBeingId(
"being id"));
2000 const int balls =
msg.readInt16(
"spirits amount");
2001 if (dstBeing !=
nullptr)
2009 msg.readInt32(
"src being id");
2010 msg.readInt32(
"dst being id");
2011 msg.readInt32(
"flag");
2018 msg.readBeingId(
"being id");
2019 msg.readInt32(
"wait");
2026 msg.readBeingId(
"being id");
2034 msg.readBeingId(
"being id"));
2035 const int x =
msg.readInt16(
"x");
2036 const int y =
msg.readInt16(
"y");
2037 if (dstBeing ==
nullptr)
2055 msg.readString(24,
"map name");
2056 msg.readInt32(
"monster id");
2057 msg.readUInt8(
"start");
2058 msg.readUInt8(
"result");
2065 msg.readUInt8(
"which");
2072 msg.readUInt8(
"info type");
2075 msg.readInt16(
"min hours");
2076 msg.readInt16(
"min minutes");
2077 msg.readInt16(
"max hours");
2078 msg.readInt16(
"max minutes");
2079 msg.readString(24,
"monster name");
2086 msg.readBeingId(
"account id");
2087 msg.readInt16(
"font");
2094 msg.readBeingId(
"account id");
2095 msg.readInt16(
"shields");
2096 msg.readInt16(
"unused");
2103 msg.readBeingId(
"account id");
2104 msg.readInt16(
"charm type");
2105 msg.readInt16(
"charm count");
2112 const int count = (
msg.readInt16(
"len") - 45) / (21 +
itemIdLen * 5);
2113 msg.readString(24,
"name");
2114 msg.readInt16(
"job");
2115 msg.readInt16(
"head");
2116 msg.readInt16(
"accessory");
2117 msg.readInt16(
"accessory2");
2118 msg.readInt16(
"accessory3");
2119 if (
msg.getVersion() >= 20101124)
2120 msg.readInt16(
"robe");
2121 msg.readInt16(
"hair color");
2122 msg.readInt16(
"body color");
2123 msg.readUInt8(
"gender");
2124 for (
int f = 0; f < count; f ++)
2126 msg.readInt16(
"index");
2127 msg.readItemId(
"item id");
2128 msg.readUInt8(
"item type");
2129 msg.readInt32(
"location");
2130 msg.readInt32(
"wear state");
2131 msg.readInt8(
"refine");
2132 for (
int d = 0; d <
maxCards; d ++)
2133 msg.readItemId(
"card");
2134 msg.readInt32(
"hire expire date (?)");
2135 msg.readInt16(
"equip type");
2136 msg.readInt16(
"item sprite number");
2137 msg.readUInt8(
"flags");
2145 const int count = (
msg.readInt16(
"len") - 47) / (21 +
itemIdLen * 5);
2146 msg.readString(24,
"name");
2147 msg.readInt16(
"job");
2148 msg.readInt16(
"head");
2149 msg.readInt16(
"accessory");
2150 msg.readInt16(
"accessory2");
2151 msg.readInt16(
"accessory3");
2152 msg.readInt16(
"robe");
2153 msg.readInt16(
"hair color");
2154 msg.readInt16(
"body color");
2155 msg.readInt16(
"body2");
2156 msg.readUInt8(
"gender");
2157 for (
int f = 0; f < count; f ++)
2159 msg.readInt16(
"index");
2160 msg.readItemId(
"item id");
2161 msg.readUInt8(
"item type");
2162 msg.readInt32(
"location");
2163 msg.readInt32(
"wear state");
2164 msg.readInt8(
"refine");
2165 for (
int d = 0; d <
maxCards; d ++)
2166 msg.readItemId(
"card");
2167 msg.readInt32(
"hire expire date (?)");
2168 msg.readInt16(
"equip type");
2169 msg.readInt16(
"item sprite number");
2170 msg.readUInt8(
"flags");
2177 const BeingId id =
msg.readBeingId(
"being id");
2178 const int rank =
msg.readInt32(
"rank");
2179 msg.readInt32(
"num");
2183 if (dstBeing !=
nullptr)
2194 BLOCK_END(
"BeingRecv::processNameResponse2")
2198 const int len =
msg.readInt16(
"len");
2199 const BeingId beingId =
msg.readBeingId(
"account id");
2200 const std::string str =
msg.readString(len - 8,
"name");
2203 if (dstBeing !=
nullptr)
2226 if (member !=
nullptr)
2233 BLOCK_END(
"BeingRecv::processNameResponse2")
2273 logger->
log(
"not supported object type: %d, job: %d",
2280 logger->
log(
"not supported object type: %d, job: %d",
2292 if ((
info !=
nullptr) &&
info->id ==
id)
2305 msg.readInt32(
"id?");
2314 const int flag =
msg.readInt16(
"flag");
2319 const int id =
msg.readInt32(
"char id");
2322 msg.readString(24,
"name");
2330 const BeingId id =
msg.readBeingId(
"graffiti id");
2331 const BeingId creatorId =
msg.readBeingId(
"creator id");
2332 const int x =
msg.readInt16(
"x");
2333 const int y =
msg.readInt16(
"y");
2334 const int job =
msg.readUInt8(
"job");
2335 msg.readUInt8(
"visible");
2336 msg.readUInt8(
"is content");
2337 const std::string text =
msg.readString(80,
"text");
2340 if (dstBeing ==
nullptr)
2355 BLOCK_END(
"BeingRecv::processSkillDamage")
2359 const int id =
msg.readInt16(
"skill id");
2361 msg.readBeingId(
"src being id"));
2363 msg.readBeingId(
"dst being id"));
2364 msg.readInt32(
"tick");
2365 msg.readInt32(
"src speed");
2366 msg.readInt32(
"dst speed");
2368 if (
msg.getVersion() >= 3)
2369 param1 =
msg.readInt32(
"damage");
2371 param1 =
msg.readInt16(
"damage");
2372 const int level =
msg.readInt16(
"skill level");
2373 msg.readInt16(
"div");
2374 msg.readUInt8(
"skill hit/type?");
2375 if (srcBeing !=
nullptr)
2376 srcBeing->
handleSkill(dstBeing, param1,
id, level);
2377 if (dstBeing !=
nullptr)
2379 BLOCK_END(
"BeingRecv::processSkillDamage")
2388 msg.readUInt8(
"navigate type");
2389 msg.readUInt8(
"transportation flag");
2390 msg.readUInt8(
"hide window");
2391 msg.readString(16,
"map name");
2394 msg.readInt16(
"mob id");
2401 if (being ==
nullptr)
ActorManager * actorManager
AttackType ::T AttackTypeT
const BeingId BeingId_zero
#define fromBool(val, name)
#define reportAlways(...)
Being * findBeing(const BeingId id) const
void destroy(ActorSprite *const actor)
void addChar(const int32_t id, const std::string &name)
void undelete(const ActorSprite *const actor)
void updateNameId(const std::string &name, const BeingId beingId)
bool isBlocked(const BeingId id) const
Being * createBeing(const BeingId id, const ActorTypeT type, const BeingTypeId subtype)
void erase(ActorSprite *const actor)
void setStatusEffectOpitons(const uint32_t option, const uint32_t opt1, const uint32_t opt2, const uint32_t opt3)
void setStatusEffectOpiton0(const uint32_t option)
void setStatusEffect(const int32_t index, const Enable active, const IsStart start)
void setName(const std::string &name)
void setKarma(const int karma)
void setWeaponId(const int id)
void setLanguageId(const int lang)
virtual void setDirection(const uint8_t direction)
virtual void setAction(const BeingActionT &action, const int attackId)
void setGuildName(const std::string &name)
virtual void setTileCoords(const int x, const int y)
void setClanName(const std::string &name)
static GenderT intToGender(const uint8_t sex) A_CONST
uint8_t getDirection() const
void setLevel(const int n)
void setSpriteCards(const unsigned int slot, const int id, const CardsList &cards)
int getSpriteID(const int slot) const
void setWalkSpeed(const int speed)
void setCreatorId(const BeingId id)
void setHorse(const int horseId)
void setPvpRank(const unsigned int rank)
uint8_t calcDirection(const int dstX, const int dstY) const
void setLook(const uint16_t look)
void recalcSpritesOrder()
void setShowName(const bool doShowName)
void handleAttack(Being *const victim, const int damage, const int attackId)
void handleSkillCasting(Being *const victim, const int skillId, const int skillLevel)
void setName(const std::string &name)
void setSubtype(const BeingTypeId subtype, const uint16_t look)
void takeDamage(Being *const attacker, const int amount, const AttackTypeT type, const int attackId, const int level)
void setHairColorSpriteID(const unsigned int slot, const int id)
void setHairColor(const unsigned int slot, const ItemColor color)
void setMaxHP(const int hp)
const std::string & getName() const
void addCast(const int dstX, const int dstY, const int skillId, const int skillLevel, const int range, const int waitTimeTicks)
void setSpriteId(const unsigned int slot, const int id)
void setGuildPos(const std::string &pos)
void setPartyName(const std::string &name)
void setActionTime(const int actionTime)
virtual void setGroupId(const int id)
BeingActionT getCurrentAction() const
void setAttackRange(const int range)
void setCachedDestination(const int dstX, const int dstY)
void handleSkill(Being *const victim, const int damage, const int skillId, const int skillLevel)
void setManner(const int manner)
ActorTypeT getType() const
void setSpiritBalls(const unsigned int balls)
void setSpriteColor(const unsigned int slot, const int id, const std::string &color)
void setDestination(const int dstX, const int dstY)
void setAttackDelay(const int n)
bool trigger(const int id, Being *const being, const int rotation)
Map * getCurrentMap() const
std::string getDyeColorsString(const ItemColor color) const
static std::string getKeyShortString(const std::string &key)
void freezeMoving(const int timeWaitTicks)
void followMoveTo(const Being *const being, const int x, const int y)
Being * getTarget() const
void imitateDirection(const Being *const being, const unsigned char dir)
void stopAttack(const bool keepAttack)
void imitateOutfit(const Being *const player, const int sprite) const
void checkNewName(Being *const being)
void imitateAction(const Being *const being, const BeingActionT &action)
void log(const char *const log_text,...)
void setPvpMode(const int mode)
void addPortalTile(const std::string &name, const int type, const int x, const int y)
static Net::Characters mCharacters
static uint8_t fromServerDirection(const uint8_t serverDir)
virtual bool haveNpcGender() const =0
virtual bool haveMove3() const =0
static std::string keyName(const int number)
void playCastingDstTileEffect(const int id, const int level, const int x, const int y, const int delay) const
void resetDamage(const std::string &name)
int getPortalIndex(const int x, const int y)
virtual void scheduleDelete()
static const int MILLISECONDS_IN_A_TICK
EffectManager * effectManager
#define FOR_EACH(type, iter, array)
#define fromInt(val, name)
LocalPlayer * localPlayer
#define UNIMPLEMENTEDPACKETFIELD(field)
#define UNIMPLEMENTEDPACKET
bool msg(InputEvent &event)
bool info(InputEvent &event)
const ClanInfo * get(const int clanId)
void processBeingChangeLook2(Net::MessageIn &msg)
void processSkillCasting3(Net::MessageIn &msg)
void processBeingFont(Net::MessageIn &msg)
void processPlayerGuilPartyInfo(Net::MessageIn &msg)
void processBossMapInfo(Net::MessageIn &msg)
void processSkillGroundNoDamage(Net::MessageIn &msg)
void processMobInfo(Net::MessageIn &msg)
void processBeingAction2(Net::MessageIn &msg)
void processNavigateTo(Net::MessageIn &msg)
void processBeingChangeDirection(Net::MessageIn &msg)
void processBeingChangeLookContinue(const Net::MessageIn &msg, Being *const dstBeing, const uint8_t type, const int id, const int id2, const int *const cards)
void processSpiritBalls(Net::MessageIn &msg)
void processPlayerStatusChange(Net::MessageIn &msg)
void processPvpSet(Net::MessageIn &msg)
void processSkillCastingEvol(Net::MessageIn &msg)
void processNameResponseTitle(Net::MessageIn &msg)
void processBeingSlide(Net::MessageIn &msg)
void processBeingSpecialEffectNum(Net::MessageIn &msg)
void processSkillAutoCast(Net::MessageIn &msg)
void processSkillDamage(Net::MessageIn &msg)
void processNameResponse2(Net::MessageIn &msg)
void processMapTypeProperty(Net::MessageIn &msg)
void processBeingStatUpdate1(Net::MessageIn &msg)
void processBeingSoundEffect(Net::MessageIn &msg)
Being * createBeing2(Net::MessageIn &msg, const BeingId id, const int32_t job, const BeingTypeT beingType)
void processStarsKill(Net::MessageIn &msg)
void processPkRanksList(Net::MessageIn &msg)
void processSkillEntry(Net::MessageIn &msg)
void processComboDelay(Net::MessageIn &msg)
void processBeingMilleniumShield(Net::MessageIn &msg)
void processAlchemistRanksList(Net::MessageIn &msg)
void applyPlayerAction(Net::MessageIn &msg, Being *const being, const uint8_t type)
void processBeingViewEquipment2(Net::MessageIn &msg)
void processBeingRemoveSkill(Net::MessageIn &msg)
void processBeingVisible(Net::MessageIn &msg)
void processBlacksmithRanksList(Net::MessageIn &msg)
void processGraffiti(Net::MessageIn &msg)
void processSkillCasting2(Net::MessageIn &msg)
void processMonsterInfo(Net::MessageIn &msg)
void processSkillCasting(Net::MessageIn &msg)
void processSkillCancel(Net::MessageIn &msg)
void processBeingFakeName(Net::MessageIn &msg)
void processBeingCharm(Net::MessageIn &msg)
void processWddingEffect(Net::MessageIn &msg)
void processBeingResurrect(Net::MessageIn &msg)
void processPlayerGuilPartyInfo2(Net::MessageIn &msg)
void processBeingHatEffects(Net::MessageIn &msg)
void processTaekwonRanksList(Net::MessageIn &msg)
void processSkillCastingContinue(Net::MessageIn &msg, const BeingId srcId, const BeingId dstId, const int dstX, const int dstY, const int skillId, const int skillLevel, const int range, const SkillType2::SkillType2 inf2, const int castTime)
void processBeingSpecialEffect(Net::MessageIn &msg)
void processBeingMove(Net::MessageIn &msg)
void processBeingViewEquipment(Net::MessageIn &msg)
void processBeingStatusChange(Net::MessageIn &msg)
void processPlayerStatusChange2(Net::MessageIn &msg)
void processRanksList2(Net::MessageIn &msg)
void processBeingRemoveSpecialEffect(Net::MessageIn &msg)
void processBeingChangeLookCards(Net::MessageIn &msg)
void processBeingMove2(Net::MessageIn &msg)
void processMonsterHp(Net::MessageIn &msg)
void processBeingSpawn(Net::MessageIn &msg)
void processBeingAttrs(Net::MessageIn &msg)
void processBeingHp(Net::MessageIn &msg)
void processMapType(Net::MessageIn &msg)
void processBladeStop(Net::MessageIn &msg)
void processClassChange(Net::MessageIn &msg)
void processSolveCharName(Net::MessageIn &msg)
void processRanksList1(Net::MessageIn &msg)
void processBeingSelfEffect(Net::MessageIn &msg)
void processGladiatorFeelRequest(Net::MessageIn &msg)
static void setBasicFields(Being *const dstBeing, const uint8_t gender, const int hairStyle, const ItemColor hairColor, const uint32_t weapon, const uint16_t headBottom, const uint16_t headMid, const uint16_t headTop, const uint16_t shoes, const uint16_t gloves, const bool notMove)
const ItemInfo & get(const int id)
std::list< Character * > Characters
void notify(const unsigned int message)
void setServerLanguage(const int lang)
void setPetBeing(Being *const being)
void setMercenaryBeing(Being *const being)
MercenaryInfo * getMercenary()
Net::ServerFeatures * serverFeatures
OutfitWindow * outfitWindow
#define BLOCK_START(name)
SkillDialog * skillDialog
SocialWindow * socialWindow
MapTypeProperty2Bits bits