|
@@ -6509,13 +6509,23 @@ void clif_wis_end(int fd, int result)
|
|
|
|
|
|
/// Returns character name requested by char_id (ZC_ACK_REQNAME_BYGID).
|
|
/// Returns character name requested by char_id (ZC_ACK_REQNAME_BYGID).
|
|
/// 0194 <char id>.L <name>.24B
|
|
/// 0194 <char id>.L <name>.24B
|
|
|
|
+/// 0af7 <flag>.W <char id>.L <name>.24B
|
|
void clif_solved_charname(int fd, int charid, const char* name)
|
|
void clif_solved_charname(int fd, int charid, const char* name)
|
|
{
|
|
{
|
|
|
|
+#if PACKETVER >= 20180221
|
|
|
|
+ WFIFOHEAD(fd,packet_len(0xaf7));
|
|
|
|
+ WFIFOW(fd,0) = 0xaf7;
|
|
|
|
+ WFIFOW(fd,2) = name[0] ? 3 : 2;
|
|
|
|
+ WFIFOL(fd,4) = charid;
|
|
|
|
+ safestrncpy(WFIFOCP(fd, 8), name, NAME_LENGTH);
|
|
|
|
+ WFIFOSET(fd,packet_len(0x0af7));
|
|
|
|
+#else
|
|
WFIFOHEAD(fd,packet_len(0x194));
|
|
WFIFOHEAD(fd,packet_len(0x194));
|
|
WFIFOW(fd,0)=0x194;
|
|
WFIFOW(fd,0)=0x194;
|
|
WFIFOL(fd,2)=charid;
|
|
WFIFOL(fd,2)=charid;
|
|
safestrncpy(WFIFOCP(fd,6), name, NAME_LENGTH);
|
|
safestrncpy(WFIFOCP(fd,6), name, NAME_LENGTH);
|
|
WFIFOSET(fd,packet_len(0x194));
|
|
WFIFOSET(fd,packet_len(0x194));
|
|
|
|
+#endif
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -12278,6 +12288,7 @@ static void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uin
|
|
/// Request to use a ground skill.
|
|
/// Request to use a ground skill.
|
|
/// 0116 <skill lv>.W <skill id>.W <x>.W <y>.W (CZ_USE_SKILL_TOGROUND)
|
|
/// 0116 <skill lv>.W <skill id>.W <x>.W <y>.W (CZ_USE_SKILL_TOGROUND)
|
|
/// 0366 <skill lv>.W <skill id>.W <x>.W <y>.W (CZ_USE_SKILL_TOGROUND2)
|
|
/// 0366 <skill lv>.W <skill id>.W <x>.W <y>.W (CZ_USE_SKILL_TOGROUND2)
|
|
|
|
+/// 0AF4 <skill lv>.W <skill id>.W <x>.W <y>.W <unknown>.B (CZ_USE_SKILL_TOGROUND3)
|
|
/// There are various variants of this packet, some of them have padding between fields.
|
|
/// There are various variants of this packet, some of them have padding between fields.
|
|
void clif_parse_UseSkillToPos(int fd, struct map_session_data *sd)
|
|
void clif_parse_UseSkillToPos(int fd, struct map_session_data *sd)
|
|
{
|
|
{
|
|
@@ -12292,6 +12303,8 @@ void clif_parse_UseSkillToPos(int fd, struct map_session_data *sd)
|
|
RFIFOW(fd,info->pos[1]), //skill num
|
|
RFIFOW(fd,info->pos[1]), //skill num
|
|
RFIFOW(fd,info->pos[2]), //pos x
|
|
RFIFOW(fd,info->pos[2]), //pos x
|
|
RFIFOW(fd,info->pos[3]), //pos y
|
|
RFIFOW(fd,info->pos[3]), //pos y
|
|
|
|
+ // TODO: find out what this is intended to do
|
|
|
|
+ //RFIFOB(fd, info->pos[4])
|
|
-1 //Skill more info.
|
|
-1 //Skill more info.
|
|
);
|
|
);
|
|
}
|
|
}
|
|
@@ -14303,6 +14316,7 @@ void clif_parse_NoviceExplosionSpirits(int fd, struct map_session_data *sd)
|
|
|
|
|
|
/// Toggles a single friend online/offline [Skotlex] (ZC_FRIENDS_STATE).
|
|
/// Toggles a single friend online/offline [Skotlex] (ZC_FRIENDS_STATE).
|
|
/// 0206 <account id>.L <char id>.L <state>.B
|
|
/// 0206 <account id>.L <char id>.L <state>.B
|
|
|
|
+/// 0206 <account id>.L <char id>.L <state>.B <name>.24B >= 20180221
|
|
/// state:
|
|
/// state:
|
|
/// 0 = online
|
|
/// 0 = online
|
|
/// 1 = offline
|
|
/// 1 = offline
|
|
@@ -14322,6 +14336,9 @@ void clif_friendslist_toggle(struct map_session_data *sd,uint32 account_id, uint
|
|
WFIFOL(fd, 2) = sd->status.friends[i].account_id;
|
|
WFIFOL(fd, 2) = sd->status.friends[i].account_id;
|
|
WFIFOL(fd, 6) = sd->status.friends[i].char_id;
|
|
WFIFOL(fd, 6) = sd->status.friends[i].char_id;
|
|
WFIFOB(fd,10) = !online; //Yeah, a 1 here means "logged off", go figure...
|
|
WFIFOB(fd,10) = !online; //Yeah, a 1 here means "logged off", go figure...
|
|
|
|
+#if PACKETVER >= 20180221
|
|
|
|
+ safestrncpy(WFIFOCP(fd, 11), sd->status.friends[i].name, NAME_LENGTH);
|
|
|
|
+#endif
|
|
WFIFOSET(fd, packet_len(0x206));
|
|
WFIFOSET(fd, packet_len(0x206));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -14340,21 +14357,29 @@ int clif_friendslist_toggle_sub(struct map_session_data *sd,va_list ap)
|
|
|
|
|
|
/// Sends the whole friends list (ZC_FRIENDS_LIST).
|
|
/// Sends the whole friends list (ZC_FRIENDS_LIST).
|
|
/// 0201 <packet len>.W { <account id>.L <char id>.L <name>.24B }*
|
|
/// 0201 <packet len>.W { <account id>.L <char id>.L <name>.24B }*
|
|
|
|
+/// 0201 <packet len>.W { <account id>.L <char id>.L }* >= 20180221
|
|
void clif_friendslist_send(struct map_session_data *sd)
|
|
void clif_friendslist_send(struct map_session_data *sd)
|
|
{
|
|
{
|
|
int i = 0, n, fd = sd->fd;
|
|
int i = 0, n, fd = sd->fd;
|
|
|
|
+#if PACKETVER >= 20180221
|
|
|
|
+ const int size = 8;
|
|
|
|
+#else
|
|
|
|
+ const int size = 8 + NAME_LENGTH;
|
|
|
|
+#endif
|
|
|
|
|
|
// Send friends list
|
|
// Send friends list
|
|
- WFIFOHEAD(fd, MAX_FRIENDS * 32 + 4);
|
|
|
|
|
|
+ WFIFOHEAD(fd, MAX_FRIENDS * size + 4);
|
|
WFIFOW(fd, 0) = 0x201;
|
|
WFIFOW(fd, 0) = 0x201;
|
|
for(i = 0; i < MAX_FRIENDS && sd->status.friends[i].char_id; i++) {
|
|
for(i = 0; i < MAX_FRIENDS && sd->status.friends[i].char_id; i++) {
|
|
- WFIFOL(fd, 4 + 32 * i + 0) = sd->status.friends[i].account_id;
|
|
|
|
- WFIFOL(fd, 4 + 32 * i + 4) = sd->status.friends[i].char_id;
|
|
|
|
- safestrncpy(WFIFOCP(fd, 4 + 32 * i + 8), sd->status.friends[i].name, NAME_LENGTH);
|
|
|
|
|
|
+ WFIFOL(fd, 4 + size * i + 0) = sd->status.friends[i].account_id;
|
|
|
|
+ WFIFOL(fd, 4 + size * i + 4) = sd->status.friends[i].char_id;
|
|
|
|
+#if PACKETVER < 20180221
|
|
|
|
+ safestrncpy(WFIFOCP(fd, 4 + size * i + 8), sd->status.friends[i].name, NAME_LENGTH);
|
|
|
|
+#endif
|
|
}
|
|
}
|
|
|
|
|
|
if (i) {
|
|
if (i) {
|
|
- WFIFOW(fd,2) = 4 + 32 * i;
|
|
|
|
|
|
+ WFIFOW(fd,2) = 4 + size * i;
|
|
WFIFOSET(fd, WFIFOW(fd,2));
|
|
WFIFOSET(fd, WFIFOW(fd,2));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -16561,10 +16586,10 @@ static void clif_quest_len(int def_len, int info_len, int avail_quests, int *lim
|
|
(*len_out) = ((*limit_out) * info_len) + def_len;
|
|
(*len_out) = ((*limit_out) * info_len) + def_len;
|
|
}
|
|
}
|
|
|
|
|
|
-/// Sends list of all quest states (ZC_ALL_QUEST_LIST).
|
|
|
|
-/// 02b1 <packet len>.W <num>.L { <quest id>.L <active>.B }*num
|
|
|
|
|
|
+/// Sends list of all quest states
|
|
|
|
+/// 02b1 <packet len>.W <num>.L { <quest id>.L <active>.B }*num (ZC_ALL_QUEST_LIST)
|
|
/// 097a <packet len>.W <num>.L { <quest id>.L <active>.B <remaining time>.L <time>.L <count>.W { <mob_id>.L <killed>.W <total>.W <mob name>.24B }*count }*num (ZC_ALL_QUEST_LIST2)
|
|
/// 097a <packet len>.W <num>.L { <quest id>.L <active>.B <remaining time>.L <time>.L <count>.W { <mob_id>.L <killed>.W <total>.W <mob name>.24B }*count }*num (ZC_ALL_QUEST_LIST2)
|
|
-/// 09f8 <packet len>.W <num>.L { <quest id>.L <active>.B <remaining time>.L <time>.L <count>.W { <mob_id>.L <killed>.W <total>.W <mob name>.24B }*count }*num (ZC_ALL_QUEST_LIST3) // TODO!
|
|
|
|
|
|
+/// 09f8 <packet len>.W <num>.L { <quest id>.L <active>.B <remaining time>.L <time>.L <count>.W { <hunt identification>.L <mob type>.L <mob_id>.L <min level>.W <max level>.W <killed>.W <total>.W <mob name>.24B }*count }*num (ZC_ALL_QUEST_LIST3)
|
|
void clif_quest_send_list(struct map_session_data *sd)
|
|
void clif_quest_send_list(struct map_session_data *sd)
|
|
{
|
|
{
|
|
int fd = sd->fd;
|
|
int fd = sd->fd;
|
|
@@ -16573,9 +16598,19 @@ void clif_quest_send_list(struct map_session_data *sd)
|
|
int limit = 0;
|
|
int limit = 0;
|
|
|
|
|
|
#if PACKETVER >= 20141022
|
|
#if PACKETVER >= 20141022
|
|
- clif_quest_len(offset, 15 + ((10 + NAME_LENGTH) * MAX_QUEST_OBJECTIVES), sd->avail_quests, &limit, &i);
|
|
|
|
|
|
+#if PACKETVER >= 20150513
|
|
|
|
+ int size = 22 + NAME_LENGTH;
|
|
|
|
+#else
|
|
|
|
+ int size = 10 + NAME_LENGTH;
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+ clif_quest_len(offset, 15 + ( size * MAX_QUEST_OBJECTIVES), sd->avail_quests, &limit, &i);
|
|
WFIFOHEAD(fd,i);
|
|
WFIFOHEAD(fd,i);
|
|
|
|
+#if PACKETVER >= 20150513
|
|
|
|
+ WFIFOW(fd, 0) = 0x9f8;
|
|
|
|
+#else
|
|
WFIFOW(fd, 0) = 0x97a;
|
|
WFIFOW(fd, 0) = 0x97a;
|
|
|
|
+#endif
|
|
WFIFOL(fd, 4) = limit;
|
|
WFIFOL(fd, 4) = limit;
|
|
|
|
|
|
for (i = 0; i < limit; i++) {
|
|
for (i = 0; i < limit; i++) {
|
|
@@ -16599,8 +16634,20 @@ void clif_quest_send_list(struct map_session_data *sd)
|
|
for( j = 0; j < qi->objectives_count; j++ ){
|
|
for( j = 0; j < qi->objectives_count; j++ ){
|
|
mob = mob_db(qi->objectives[j].mob);
|
|
mob = mob_db(qi->objectives[j].mob);
|
|
|
|
|
|
|
|
+#if PACKETVER >= 20150513
|
|
|
|
+ WFIFOL(fd, offset) = sd->quest_log[i].quest_id * 1000 + j;
|
|
|
|
+ offset += 4;
|
|
|
|
+ WFIFOL(fd, offset) = 0; // TODO: Find info - mobType
|
|
|
|
+ offset += 4;
|
|
|
|
+#endif
|
|
WFIFOL(fd, offset) = qi->objectives[j].mob;
|
|
WFIFOL(fd, offset) = qi->objectives[j].mob;
|
|
offset += 4;
|
|
offset += 4;
|
|
|
|
+#if PACKETVER >= 20150513
|
|
|
|
+ WFIFOW(fd, offset) = 0; // TODO: Find info - levelMin
|
|
|
|
+ offset += 2;
|
|
|
|
+ WFIFOW(fd, offset) = 0; // TODO: Find info - levelMax
|
|
|
|
+ offset += 2;
|
|
|
|
+#endif
|
|
WFIFOW(fd, offset) = sd->quest_log[i].count[j];
|
|
WFIFOW(fd, offset) = sd->quest_log[i].count[j];
|
|
offset += 2;
|
|
offset += 2;
|
|
WFIFOW(fd, offset) = qi->objectives[j].count;
|
|
WFIFOW(fd, offset) = qi->objectives[j].count;
|
|
@@ -16666,31 +16713,71 @@ void clif_quest_send_mission(struct map_session_data *sd)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-/// Notification about a new quest (ZC_ADD_QUEST).
|
|
|
|
-/// 02b3 <quest id>.L <active>.B <start time>.L <expire time>.L <mobs>.W { <mob id>.L <mob count>.W <mob name>.24B }*3
|
|
|
|
|
|
+/// Notification about a new quest
|
|
|
|
+/// 02b3 <quest id>.L <active>.B <start time>.L <expire time>.L <mobs>.W { <mob id>.L <mob count>.W <mob name>.24B }*3 (ZC_ADD_QUEST)
|
|
|
|
+/// 08fe <packet len>.W { <quest id>.L <mob id>.L <total count>.W <current count>.W }*3 (ZC_HUNTING_QUEST_INFO)
|
|
|
|
+/// 09f9 <quest id>.L <active>.B <start time>.L <expire time>.L <mobs>.W { <hunt identification>.L <mob type>.L <mob id>.L <min level>.W <max level>.W <mob count>.W <mob name>.24B }*3 (ZC_ADD_QUEST_EX)
|
|
void clif_quest_add(struct map_session_data *sd, struct quest *qd)
|
|
void clif_quest_add(struct map_session_data *sd, struct quest *qd)
|
|
{
|
|
{
|
|
int fd = sd->fd;
|
|
int fd = sd->fd;
|
|
- int i;
|
|
|
|
|
|
+ int i, offset;
|
|
struct quest_db *qi = quest_search(qd->quest_id);
|
|
struct quest_db *qi = quest_search(qd->quest_id);
|
|
|
|
+#if PACKETVER >= 20150513
|
|
|
|
+ int cmd = 0x9f9;
|
|
|
|
+#else
|
|
|
|
+ int cmd = 0x2b3;
|
|
|
|
+#endif
|
|
|
|
|
|
- WFIFOHEAD(fd, packet_len(0x2b3));
|
|
|
|
- WFIFOW(fd, 0) = 0x2b3;
|
|
|
|
|
|
+ WFIFOHEAD(fd, packet_len(cmd));
|
|
|
|
+ WFIFOW(fd, 0) = cmd;
|
|
WFIFOL(fd, 2) = qd->quest_id;
|
|
WFIFOL(fd, 2) = qd->quest_id;
|
|
WFIFOB(fd, 6) = qd->state;
|
|
WFIFOB(fd, 6) = qd->state;
|
|
WFIFOB(fd, 7) = qd->time - qi->time;
|
|
WFIFOB(fd, 7) = qd->time - qi->time;
|
|
WFIFOL(fd, 11) = qd->time;
|
|
WFIFOL(fd, 11) = qd->time;
|
|
WFIFOW(fd, 15) = qi->objectives_count;
|
|
WFIFOW(fd, 15) = qi->objectives_count;
|
|
|
|
|
|
- for (i = 0; i < qi->objectives_count; i++) {
|
|
|
|
|
|
+ for (i = 0, offset = 17; i < qi->objectives_count; i++) {
|
|
struct mob_db *mob;
|
|
struct mob_db *mob;
|
|
- WFIFOL(fd, i*30+17) = qi->objectives[i].mob;
|
|
|
|
- WFIFOW(fd, i*30+21) = qd->count[i];
|
|
|
|
|
|
+#if PACKETVER >= 20150513
|
|
|
|
+ WFIFOL(fd, offset) = qd->quest_id * 1000 + i;
|
|
|
|
+ offset += 4;
|
|
|
|
+ WFIFOL(fd, offset) = 0; // TODO: Find info - mobType
|
|
|
|
+ offset += 4;
|
|
|
|
+#endif
|
|
|
|
+ WFIFOL(fd, offset) = qi->objectives[i].mob;
|
|
|
|
+ offset += 4;
|
|
|
|
+#if PACKETVER >= 20150513
|
|
|
|
+ WFIFOW(fd, offset) = 0; // TODO: Find info - levelMin
|
|
|
|
+ offset += 2;
|
|
|
|
+ WFIFOW(fd, offset) = 0; // TODO: Find info - levelMax
|
|
|
|
+ offset += 2;
|
|
|
|
+#endif
|
|
|
|
+ WFIFOW(fd, offset) = qd->count[i];
|
|
|
|
+ offset += 2;
|
|
mob = mob_db(qi->objectives[i].mob);
|
|
mob = mob_db(qi->objectives[i].mob);
|
|
- safestrncpy(WFIFOCP(fd, i*30+23), mob->jname, NAME_LENGTH);
|
|
|
|
|
|
+ safestrncpy(WFIFOCP(fd, offset), mob->jname, NAME_LENGTH);
|
|
|
|
+ offset += NAME_LENGTH;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ WFIFOSET(fd, packet_len(cmd));
|
|
|
|
+
|
|
|
|
+#if PACKETVER >= 20150513
|
|
|
|
+ int len = 4 + qi->objectives_count * 12;
|
|
|
|
+
|
|
|
|
+ WFIFOHEAD(fd, len);
|
|
|
|
+ WFIFOW(fd, 0) = 0x8fe;
|
|
|
|
+ WFIFOW(fd, 2) = len;
|
|
|
|
+
|
|
|
|
+ for( i = 0, offset = 4; i < qi->objectives_count; i++, offset += 12 ){
|
|
|
|
+ WFIFOL(fd, offset) = qd->quest_id * 1000 + i;
|
|
|
|
+ WFIFOL(fd, offset+4) = qi->objectives[i].mob;
|
|
|
|
+ WFIFOW(fd, offset + 10) = qi->objectives[i].count;
|
|
|
|
+ WFIFOW(fd, offset + 12) = qd->count[i];
|
|
}
|
|
}
|
|
|
|
|
|
- WFIFOSET(fd, packet_len(0x2b3));
|
|
|
|
|
|
+ WFIFOSET(fd, len);
|
|
|
|
+
|
|
|
|
+#endif
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -16707,30 +16794,45 @@ void clif_quest_delete(struct map_session_data *sd, int quest_id)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-/// Notification of an update to the hunting mission counter (ZC_UPDATE_MISSION_HUNT).
|
|
|
|
-/// 02b5 <packet len>.W <mobs>.W { <quest id>.L <mob id>.L <total count>.W <current count>.W }*3
|
|
|
|
|
|
+/// Notification of an update to the hunting mission counter
|
|
|
|
+/// 02b5 <packet len>.W <mobs>.W { <quest id>.L <mob id>.L <total count>.W <current count>.W }*3 (ZC_UPDATE_MISSION_HUNT)
|
|
|
|
+/// 09fa <packet len>.W <mobs>.W { <quest id>.L <hunt identification>.L <total count>.W <current count>.W }*3 (ZC_UPDATE_MISSION_HUNT_EX)
|
|
void clif_quest_update_objective(struct map_session_data *sd, struct quest *qd, int mobid)
|
|
void clif_quest_update_objective(struct map_session_data *sd, struct quest *qd, int mobid)
|
|
{
|
|
{
|
|
int fd = sd->fd;
|
|
int fd = sd->fd;
|
|
- int i;
|
|
|
|
|
|
+ int i, offset;
|
|
struct quest_db *qi = quest_search(qd->quest_id);
|
|
struct quest_db *qi = quest_search(qd->quest_id);
|
|
int len = qi->objectives_count * 12 + 6;
|
|
int len = qi->objectives_count * 12 + 6;
|
|
|
|
+#if PACKETVER >= 20150513
|
|
|
|
+ int cmd = 0x9fa;
|
|
|
|
+#else
|
|
|
|
+ int cmd = 0x2b5;
|
|
|
|
+#endif
|
|
|
|
|
|
WFIFOHEAD(fd, len);
|
|
WFIFOHEAD(fd, len);
|
|
- WFIFOW(fd, 0) = 0x2b5;
|
|
|
|
- WFIFOW(fd, 2) = len;
|
|
|
|
|
|
+ WFIFOW(fd, 0) = cmd;
|
|
WFIFOW(fd, 4) = qi->objectives_count;
|
|
WFIFOW(fd, 4) = qi->objectives_count;
|
|
|
|
|
|
- for (i = 0; i < qi->objectives_count; i++) {
|
|
|
|
|
|
+ for (i = 0, offset = 6; i < qi->objectives_count; i++) {
|
|
if (mobid == 0 || mobid == qi->objectives[i].mob) {
|
|
if (mobid == 0 || mobid == qi->objectives[i].mob) {
|
|
- WFIFOL(fd, i * 12 + 6) = qd->quest_id;
|
|
|
|
- WFIFOL(fd, i * 12 + 10) = qi->objectives[i].mob;
|
|
|
|
- WFIFOW(fd, i * 12 + 14) = qi->objectives[i].count;
|
|
|
|
- WFIFOW(fd, i * 12 + 16) = qd->count[i];
|
|
|
|
|
|
+ WFIFOL(fd, offset) = qd->quest_id;
|
|
|
|
+ offset += 4;
|
|
|
|
+#if PACKETVER >= 20150513
|
|
|
|
+ WFIFOL(fd, offset) = qd->quest_id * 1000 + i;
|
|
|
|
+ offset += 4;
|
|
|
|
+#else
|
|
|
|
+ WFIFOL(fd, offset) = qi->objectives[i].mob;
|
|
|
|
+ offset += 4;
|
|
|
|
+#endif
|
|
|
|
+ WFIFOW(fd, offset) = qi->objectives[i].count;
|
|
|
|
+ offset += 2;
|
|
|
|
+ WFIFOW(fd, offset) = qd->count[i];
|
|
|
|
+ offset += 2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- WFIFOSET(fd, len);
|
|
|
|
|
|
+ WFIFOW(fd, 2) = offset;
|
|
|
|
+ WFIFOSET(fd, offset);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|