diff options
Diffstat (limited to 'src')
69 files changed, 5868 insertions, 2902 deletions
diff --git a/src/char/char.c b/src/char/char.c index cad28b373..c5afc0f63 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -2273,6 +2273,8 @@ static int char_char_married(int pl1, int pl2) static int char_char_child(int parent_id, int child_id) { + if (parent_id == 0 || child_id == 0) // Failsafe, avoild querys and fix EXP bug dividing with lower level chars + return 0; if( SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `child` FROM `%s` WHERE `char_id` = '%d'", char_db, parent_id) ) Sql_ShowDebug(inter->sql_handle); else if( SQL_SUCCESS == SQL->NextRow(inter->sql_handle) ) @@ -2292,6 +2294,8 @@ static int char_char_child(int parent_id, int child_id) static int char_char_family(int cid1, int cid2, int cid3) { + if (cid1 == 0 || cid2 == 0 || cid3 == 0) //Failsafe, and avoid querys where there is no sense to keep executing if any of the inputs are 0 + return 0; if( SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `char_id`,`partner_id`,`child` FROM `%s` WHERE `char_id` IN ('%d','%d','%d')", char_db, cid1, cid2, cid3) ) Sql_ShowDebug(inter->sql_handle); else while( SQL_SUCCESS == SQL->NextRow(inter->sql_handle) ) diff --git a/src/char/int_guild.c b/src/char/int_guild.c index 8e05c76e2..87cb3bee0 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -1612,7 +1612,6 @@ static int inter_guild_parse_frommap(int fd) case 0x3034: mapif->parse_GuildLeave(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOB(fd,14), RFIFOP(fd,15)); break; case 0x3035: mapif->parse_GuildChangeMemberInfoShort(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOL(fd,15),RFIFOL(fd,19)); break; case 0x3036: mapif->parse_BreakGuild(fd,RFIFOL(fd,2)); break; - case 0x3037: mapif->parse_GuildMessage(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12); break; case 0x3039: mapif->parse_GuildBasicInfoChange(fd, RFIFOL(fd,4), RFIFOW(fd,8), RFIFOP(fd,10), RFIFOW(fd,2)-10); break; case 0x303A: mapif->parse_GuildMemberInfoChange(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOL(fd,12), RFIFOW(fd,16), RFIFOP(fd,18), RFIFOW(fd,2)-18); break; case 0x303B: mapif->parse_GuildPosition(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12)); break; diff --git a/src/char/int_party.c b/src/char/int_party.c index 8ee03ecc5..c27d708f2 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -599,7 +599,6 @@ static int inter_party_parse_frommap(int fd) case 0x3024: mapif->parse_PartyLeave(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)); break; case 0x3025: mapif->parse_PartyChangeMap(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOW(fd,14), RFIFOB(fd,16), RFIFOW(fd,17)); break; case 0x3026: mapif->parse_BreakParty(fd, RFIFOL(fd,2)); break; - case 0x3027: mapif->parse_PartyMessage(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12); break; case 0x3029: mapif->parse_PartyLeaderChange(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)); break; default: return 0; diff --git a/src/char/inter.c b/src/char/inter.c index 64c840c16..264327289 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -53,9 +53,6 @@ #include <stdio.h> #include <stdlib.h> -#define WISDATA_TTL (60*1000) // Wis data Time To Live (60 seconds) -#define WISDELLIST_MAX 256 // Number of elements in the list Delete data Wis - static struct inter_interface inter_s; struct inter_interface *inter; @@ -70,10 +67,10 @@ int party_share_level = 10; // recv. packet list static int inter_recv_packet_length[] = { - -1,-1, 7,-1, -1,13,36, (2 + 4 + 4 + 4 + NAME_LENGTH), 0, 0, 0, 0, 0, 0, 0, 0, // 3000- + 0, 0, 0, 0, -1,13,36, (2 + 4 + 4 + 4 + NAME_LENGTH), 0, 0, 0, 0, 0, 0, 0, 0, // 3000- 6,-1, 6,-1, 0, 0, 0, 0, 10,-1, 0, 0, 0, 0, 0, 0, // 3010- Account Storage, Achievements [Smokexyz] - -1,10,-1,14, 14,19, 6,-1, 14,14, 0, 0, 0, 0, 0, 0, // 3020- Party - -1, 6,-1,-1, 55,23, 6,-1, 14,-1,-1,-1, 18,19,186,-1, // 3030- + -1,10,-1,14, 14,19, 6, 0, 14,14, 0, 0, 0, 0, 0, 0, // 3020- Party + -1, 6,-1,-1, 55,23, 6, 0, 14,-1,-1,-1, 18,19,186,-1, // 3030- -1, 9, 0, 0, 10,10, 0, 0, 7, 6,10,10, 10,-1, 0, 0, // 3040- Clan System(3044-3045) -1,-1,10,10, 0,-1,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3050- Auction System [Zephyrus], Item Bound [Mhalicot] 6,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3060- Quest system [Kevin] [Inkfish] @@ -82,9 +79,6 @@ static int inter_recv_packet_length[] = { -1,10,-1, 6, 0, 20,10,20, -1,6 + NAME_LENGTH, 0, 0, 0, 0, 0, 0, // 3090- Homunculus packets [albator], RoDEX packets }; -static struct DBMap *wis_db = NULL; // int wis_id -> struct WisData* -static int wis_dellist[WISDELLIST_MAX], wis_delnum; - #define MAX_JOB_NAMES 150 static char *msg_table[MAX_JOB_NAMES]; // messages 550 ~ 699 are job names @@ -964,7 +958,6 @@ static int inter_init_sql(const char *file) Sql_ShowDebug(inter->sql_handle); } - wis_db = idb_alloc(DB_OPT_RELEASE_DATA); inter_guild->sql_init(); inter_storage->sql_init(); inter_party->sql_init(); @@ -985,8 +978,6 @@ static int inter_init_sql(const char *file) // finalize static void inter_final(void) { - wis_db->destroy(wis_db, NULL); - inter_guild->sql_final(); inter_storage->sql_final(); inter_party->sql_final(); @@ -1011,77 +1002,6 @@ static int inter_mapif_init(int fd) //-------------------------------------------------------- -/** - * Existence check of WISP data - * @see DBApply - */ -static int inter_check_ttl_wisdata_sub(union DBKey key, struct DBData *data, va_list ap) -{ - int64 tick; - struct WisData *wd = DB->data2ptr(data); - nullpo_ret(wd); - tick = va_arg(ap, int64); - - if (DIFF_TICK(tick, wd->tick) > WISDATA_TTL && wis_delnum < WISDELLIST_MAX) - wis_dellist[wis_delnum++] = wd->id; - - return 0; -} - -static int inter_check_ttl_wisdata(void) -{ - int64 tick = timer->gettick(); - int i; - - do { - wis_delnum = 0; - wis_db->foreach(wis_db, inter->check_ttl_wisdata_sub, tick); - for(i = 0; i < wis_delnum; i++) { - struct WisData *wd = (struct WisData*)idb_get(wis_db, wis_dellist[i]); - ShowWarning("inter: wis data id=%d time out : from %s to %s\n", wd->id, wd->src, wd->dst); - // removed. not send information after a timeout. Just no answer for the player - //mapif->wis_end(wd, 1); // flag: 0: success to send whisper, 1: target character is not logged in?, 2: ignored by target - idb_remove(wis_db, wd->id); - } - } while(wis_delnum >= WISDELLIST_MAX); - - return 0; -} - -static struct WisData *inter_add_wisdata(int fd, const unsigned char *src, const unsigned char *dst, const unsigned char *msg, int msg_len) -{ - static int wisid = 0; - struct WisData *wd; - - CREATE(wd, struct WisData, 1); - - // Whether the failure of previous wisp/page transmission (timeout) - inter->check_ttl_wisdata(); - - wd->id = ++wisid; - wd->fd = fd; - wd->len = msg_len; - memcpy(wd->src, src, NAME_LENGTH); - memcpy(wd->dst, dst, NAME_LENGTH); - memcpy(wd->msg, msg, wd->len); - wd->tick = timer->gettick(); - idb_put(wis_db, wd->id, wd); - - return wd; -} - -static struct WisData *inter_get_wisdata(int id) -{ - return idb_get(wis_db, id); -} - -static void inter_remove_wisdata(int id) -{ - idb_remove(wis_db, id); -} - -//-------------------------------------------------------- - /// Returns the length of the next complete packet to process, /// or 0 if no complete packet exists in the queue. /// @@ -1115,10 +1035,6 @@ static int inter_parse_frommap(int fd) return 2; switch(cmd) { - case 0x3000: mapif->parse_broadcast(fd); break; - case 0x3001: mapif->parse_WisRequest(fd); break; - case 0x3002: mapif->parse_WisReply(fd); break; - case 0x3003: mapif->parse_WisToGM(fd); break; case 0x3004: mapif->parse_Registry(fd); break; case 0x3005: mapif->parse_RegistryRequest(fd); break; case 0x3006: mapif->parse_NameChangeRequest(fd); break; @@ -1167,8 +1083,6 @@ void inter_defaults(void) inter->log = inter_log; inter->init_sql = inter_init_sql; inter->mapif_init = inter_mapif_init; - inter->check_ttl_wisdata_sub = inter_check_ttl_wisdata_sub; - inter->check_ttl_wisdata = inter_check_ttl_wisdata; inter->check_length = inter_check_length; inter->parse_frommap = inter_parse_frommap; inter->final = inter_final; @@ -1176,7 +1090,4 @@ void inter_defaults(void) inter->config_read_connection = inter_config_read_connection; inter->accinfo = inter_accinfo; inter->accinfo2 = inter_accinfo2; - inter->add_wisdata = inter_add_wisdata; - inter->get_wisdata = inter_get_wisdata; - inter->remove_wisdata = inter_remove_wisdata; } diff --git a/src/char/inter.h b/src/char/inter.h index 94ee3ab60..f97c619c0 100644 --- a/src/char/inter.h +++ b/src/char/inter.h @@ -30,12 +30,6 @@ struct Sql; // common/sql.h struct config_t; // common/conf.h -struct WisData { - int id, fd, count, len; - int64 tick; - unsigned char src[24], dst[24], msg[512]; -}; - /** * inter interface **/ @@ -54,8 +48,6 @@ struct inter_interface { int (*log) (char* fmt, ...); int (*init_sql) (const char *file); int (*mapif_init) (int fd); - int (*check_ttl_wisdata_sub) (union DBKey key, struct DBData *data, va_list ap); - int (*check_ttl_wisdata) (void); int (*check_length) (int fd, int length); int (*parse_frommap) (int fd); void (*final) (void); @@ -66,9 +58,6 @@ struct inter_interface { void (*accinfo2) (bool success, int map_fd, int u_fd, int u_aid, int account_id, const char *userid, const char *user_pass, const char *email, const char *last_ip, const char *lastlogin, const char *pin_code, const char *birthdate, int group_id, int logincount, int state); - struct WisData *(*add_wisdata) (int fd, const unsigned char *src, const unsigned char *dst, const unsigned char *msg, int msg_len); - struct WisData *(*get_wisdata) (int id); - void (*remove_wisdata) (int id); }; #ifdef HERCULES_CORE diff --git a/src/char/mapif.c b/src/char/mapif.c index 8f213ecb5..29be4eaa2 100644 --- a/src/char/mapif.c +++ b/src/char/mapif.c @@ -596,22 +596,6 @@ static int mapif_guild_broken(int guild_id, int flag) return 0; } -// Send guild message -static int mapif_guild_message(int guild_id, int account_id, const char *mes, int len, int sfd) -{ - unsigned char buf[512]; - nullpo_ret(mes); - if (len > 500) - len = 500; - WBUFW(buf, 0) = 0x3837; - WBUFW(buf, 2) = len + 12; - WBUFL(buf, 4) = guild_id; - WBUFL(buf, 8) = account_id; - memcpy(WBUFP(buf, 12), mes, len); - mapif->sendallwos(sfd, buf, len + 12); - return 0; -} - // Send basic info static int mapif_guild_basicinfochanged(int guild_id, int type, const void *data, int len) { @@ -810,12 +794,6 @@ static int mapif_parse_BreakGuild(int fd, int guild_id) return 0; } -// Forward Guild message to others map servers -static int mapif_parse_GuildMessage(int fd, int guild_id, int account_id, const char *mes, int len) -{ - return mapif->guild_message(guild_id,account_id,mes,len, fd); -} - /** * Changes basic guild information * The types are available in mmo.h::guild_basic_info @@ -1319,20 +1297,6 @@ static int mapif_party_broken(int party_id, int flag) return 0; } -//Remarks in the party -static int mapif_party_message(int party_id, int account_id, const char *mes, int len, int sfd) -{ - unsigned char buf[512]; - nullpo_ret(mes); - WBUFW(buf, 0) = 0x3827; - WBUFW(buf, 2) = len + 12; - WBUFL(buf, 4) = party_id; - WBUFL(buf, 8) = account_id; - memcpy(WBUFP(buf, 12), mes, len); - mapif->sendallwos(sfd, buf, len + 12); - return 0; -} - // Create Party static int mapif_parse_CreateParty(int fd, const char *name, int item, int item2, const struct party_member *leader) { @@ -1408,12 +1372,6 @@ static int mapif_parse_BreakParty(int fd, int party_id) return 0; } -//Party sending the message -static int mapif_parse_PartyMessage(int fd, int party_id, int account_id, const char *mes, int len) -{ - return mapif->party_message(party_id, account_id, mes, len, fd); -} - static int mapif_parse_PartyLeaderChange(int fd, int party_id, int account_id, int char_id) { if (!inter_party->change_leader(party_id, account_id, char_id)) @@ -2034,67 +1992,6 @@ static void mapif_parse_accinfo(int fd) inter->accinfo(u_fd, aid, castergroup, query, fd); } -// broadcast sending -static int mapif_broadcast(const unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd) -{ - unsigned char *buf = (unsigned char*)aMalloc((len)*sizeof(unsigned char)); - - nullpo_ret(mes); - Assert_ret(len >= 16); - WBUFW(buf, 0) = 0x3800; - WBUFW(buf, 2) = len; - WBUFL(buf, 4) = fontColor; - WBUFW(buf, 8) = fontType; - WBUFW(buf, 10) = fontSize; - WBUFW(buf, 12) = fontAlign; - WBUFW(buf, 14) = fontY; - memcpy(WBUFP(buf, 16), mes, len - 16); - mapif->sendallwos(sfd, buf, len); - - aFree(buf); - return 0; -} - -// Wis sending -static int mapif_wis_message(struct WisData *wd) -{ - unsigned char buf[2048]; - nullpo_ret(wd); - //if (wd->len > 2047-56) wd->len = 2047-56; //Force it to fit to avoid crashes. [Skotlex] - if (wd->len < 0) - wd->len = 0; - if (wd->len >= (int)sizeof(wd->msg) - 1) - wd->len = (int)sizeof(wd->msg) - 1; - - WBUFW(buf, 0) = 0x3801; - WBUFW(buf, 2) = 56 + wd->len; - WBUFL(buf, 4) = wd->id; - memcpy(WBUFP(buf, 8), wd->src, NAME_LENGTH); - memcpy(WBUFP(buf, 32), wd->dst, NAME_LENGTH); - memcpy(WBUFP(buf, 56), wd->msg, wd->len); - wd->count = mapif->sendall(buf, WBUFW(buf, 2)); - - return 0; -} - -static void mapif_wis_response(int fd, const unsigned char *src, int flag) -{ - unsigned char buf[27]; - nullpo_retv(src); - WBUFW(buf, 0) = 0x3802; - memcpy(WBUFP(buf, 2), src, 24); - WBUFB(buf, 26) = flag; - mapif->send(fd, buf, 27); -} - -// Wis sending result -static int mapif_wis_end(struct WisData *wd, int flag) -{ - nullpo_ret(wd); - mapif->wis_response(wd->fd, wd->src, flag); - return 0; -} - #if 0 // Account registry transfer to map-server static void mapif_account_reg(int fd, unsigned char *src) @@ -2126,89 +2023,6 @@ static int mapif_disconnectplayer(int fd, int account_id, int char_id, int reaso return 0; } -// broadcast sending -static int mapif_parse_broadcast(int fd) -{ - mapif->broadcast(RFIFOP(fd, 16), RFIFOW(fd, 2), RFIFOL(fd, 4), RFIFOW(fd, 8), RFIFOW(fd, 10), RFIFOW(fd, 12), RFIFOW(fd, 14), fd); - return 0; -} - -// Wisp/page request to send -static int mapif_parse_WisRequest(int fd) -{ - struct WisData* wd; - char name[NAME_LENGTH]; - char *data; - size_t len; - - if (fd <= 0) // check if we have a valid fd - return 0; - - if (RFIFOW(fd, 2) - 52 >= sizeof(wd->msg)) { - ShowWarning("inter: Wis message size too long.\n"); - return 0; - } else if (RFIFOW(fd, 2) - 52 <= 0) { // normally, impossible, but who knows... - ShowError("inter: Wis message doesn't exist.\n"); - return 0; - } - - safestrncpy(name, RFIFOP(fd, 28), NAME_LENGTH); //Received name may be too large and not contain \0! [Skotlex] - - // search if character exists before to ask all map-servers - if (!chr->name_exists(name, NULL)) { - mapif->wis_response(fd, RFIFOP(fd, 4), 1); - } else { - // Character exists. So, ask all map-servers - - // to be sure of the correct name, rewrite it - SQL->GetData(inter->sql_handle, 0, &data, &len); - memset(name, 0, NAME_LENGTH); - memcpy(name, data, min(len, NAME_LENGTH)); - // if source is destination, don't ask other servers. - if (strncmp(RFIFOP(fd, 4), name, NAME_LENGTH) == 0) { - mapif->wis_response(fd, RFIFOP(fd, 4), 1); - } else { - wd = inter->add_wisdata(fd, RFIFOP(fd, 4), RFIFOP(fd, 28), RFIFOP(fd, 52), RFIFOW(fd, 2) - 52); - mapif->wis_message(wd); - } - } - - SQL->FreeResult(inter->sql_handle); - return 0; -} - -// Wisp/page transmission result -static int mapif_parse_WisReply(int fd) -{ - int id, flag; - struct WisData *wd; - - id = RFIFOL(fd,2); - flag = RFIFOB(fd,6); - wd = inter->get_wisdata(id); - if (wd == NULL) - return 0; // This wisp was probably suppress before, because it was timeout of because of target was found on another map-server - - if ((--wd->count) <= 0 || flag != 1) { - mapif->wis_end(wd, flag); // flag: 0: success to send whisper, 1: target character is not logged in?, 2: ignored by target - inter->remove_wisdata(id); - } - - return 0; -} - -// Received wisp message from map-server for ALL gm (just copy the message and resends it to ALL map-servers) -static int mapif_parse_WisToGM(int fd) -{ - unsigned char buf[2048]; // 0x3003/0x3803 <packet_len>.w <wispname>.24B <min_gm_level>.w <message>.?B - - memcpy(WBUFP(buf,0), RFIFOP(fd,0), RFIFOW(fd,2)); // Message contains the NUL terminator (see intif_wis_message_to_gm()) - WBUFW(buf, 0) = 0x3803; - mapif->sendall(buf, RFIFOW(fd,2)); - - return 0; -} - // Save account_reg into sql (type=2) static int mapif_parse_Registry(int fd) { @@ -2532,7 +2346,6 @@ void mapif_defaults(void) mapif->guild_withdraw = mapif_guild_withdraw; mapif->guild_memberinfoshort = mapif_guild_memberinfoshort; mapif->guild_broken = mapif_guild_broken; - mapif->guild_message = mapif_guild_message; mapif->guild_basicinfochanged = mapif_guild_basicinfochanged; mapif->guild_memberinfochanged = mapif_guild_memberinfochanged; mapif->guild_skillupack = mapif_guild_skillupack; @@ -2548,7 +2361,6 @@ void mapif_defaults(void) mapif->parse_GuildLeave = mapif_parse_GuildLeave; mapif->parse_GuildChangeMemberInfoShort = mapif_parse_GuildChangeMemberInfoShort; mapif->parse_BreakGuild = mapif_parse_BreakGuild; - mapif->parse_GuildMessage = mapif_parse_GuildMessage; mapif->parse_GuildBasicInfoChange = mapif_parse_GuildBasicInfoChange; mapif->parse_GuildMemberInfoChange = mapif_parse_GuildMemberInfoChange; mapif->parse_GuildPosition = mapif_parse_GuildPosition; @@ -2596,7 +2408,6 @@ void mapif_defaults(void) mapif->party_withdraw = mapif_party_withdraw; mapif->party_membermoved = mapif_party_membermoved; mapif->party_broken = mapif_party_broken; - mapif->party_message = mapif_party_message; mapif->parse_CreateParty = mapif_parse_CreateParty; mapif->parse_PartyInfo = mapif_parse_PartyInfo; mapif->parse_PartyAddMember = mapif_parse_PartyAddMember; @@ -2604,7 +2415,6 @@ void mapif_defaults(void) mapif->parse_PartyLeave = mapif_parse_PartyLeave; mapif->parse_PartyChangeMap = mapif_parse_PartyChangeMap; mapif->parse_BreakParty = mapif_parse_BreakParty; - mapif->parse_PartyMessage = mapif_parse_PartyMessage; mapif->parse_PartyLeaderChange = mapif_parse_PartyLeaderChange; mapif->pet_created = mapif_pet_created; mapif->pet_info = mapif_pet_info; @@ -2644,16 +2454,8 @@ void mapif_defaults(void) mapif->itembound_ack = mapif_itembound_ack; mapif->parse_ItemBoundRetrieve = mapif_parse_ItemBoundRetrieve; mapif->parse_accinfo = mapif_parse_accinfo; - mapif->broadcast = mapif_broadcast; - mapif->wis_message = mapif_wis_message; - mapif->wis_response = mapif_wis_response; - mapif->wis_end = mapif_wis_end; mapif->account_reg_reply = mapif_account_reg_reply; mapif->disconnectplayer = mapif_disconnectplayer; - mapif->parse_broadcast = mapif_parse_broadcast; - mapif->parse_WisRequest = mapif_parse_WisRequest; - mapif->parse_WisReply = mapif_parse_WisReply; - mapif->parse_WisToGM = mapif_parse_WisToGM; mapif->parse_Registry = mapif_parse_Registry; mapif->parse_RegistryRequest = mapif_parse_RegistryRequest; mapif->namechange_ack = mapif_namechange_ack; diff --git a/src/char/mapif.h b/src/char/mapif.h index 71a41f94c..f5b54b6b7 100644 --- a/src/char/mapif.h +++ b/src/char/mapif.h @@ -23,7 +23,6 @@ #include "common/hercules.h" #include "common/mmo.h" -struct WisData; struct rodex_item; /** @@ -71,7 +70,6 @@ struct mapif_interface { int (*guild_withdraw) (int guild_id, int account_id, int char_id, int flag, const char *name, const char *mes); int (*guild_memberinfoshort) (struct guild *g, int idx); int (*guild_broken) (int guild_id, int flag); - int (*guild_message) (int guild_id, int account_id, const char *mes, int len, int sfd); int (*guild_basicinfochanged) (int guild_id, int type, const void *data, int len); int (*guild_memberinfochanged) (int guild_id, int account_id, int char_id, int type, const void *data, int len); int (*guild_skillupack) (int guild_id, uint16 skill_id, int account_id); @@ -87,7 +85,6 @@ struct mapif_interface { int (*parse_GuildLeave) (int fd, int guild_id, int account_id, int char_id, int flag, const char *mes); int (*parse_GuildChangeMemberInfoShort) (int fd, int guild_id, int account_id, int char_id, int online, int lv, int class); int (*parse_BreakGuild) (int fd, int guild_id); - int (*parse_GuildMessage) (int fd, int guild_id, int account_id, const char *mes, int len); int (*parse_GuildBasicInfoChange) (int fd, int guild_id, int type, const void *data, int len); int (*parse_GuildMemberInfoChange) (int fd, int guild_id, int account_id, int char_id, int type, const char *data, int len); int (*parse_GuildPosition) (int fd, int guild_id, int idx, const struct guild_position *p); @@ -135,7 +132,6 @@ struct mapif_interface { int (*party_withdraw) (int party_id,int account_id, int char_id); int (*party_membermoved) (struct party *p, int idx); int (*party_broken) (int party_id, int flag); - int (*party_message) (int party_id, int account_id, const char *mes, int len, int sfd); int (*parse_CreateParty) (int fd, const char *name, int item, int item2, const struct party_member *leader); void (*parse_PartyInfo) (int fd, int party_id, int char_id); int (*parse_PartyAddMember) (int fd, int party_id, const struct party_member *member); @@ -143,7 +139,6 @@ struct mapif_interface { int (*parse_PartyLeave) (int fd, int party_id, int account_id, int char_id); int (*parse_PartyChangeMap) (int fd, int party_id, int account_id, int char_id, unsigned short map, int online, unsigned int lv); int (*parse_BreakParty) (int fd, int party_id); - int (*parse_PartyMessage) (int fd, int party_id, int account_id, const char *mes, int len); int (*parse_PartyLeaderChange) (int fd, int party_id, int account_id, int char_id); int (*pet_created) (int fd, int account_id, struct s_pet *p); int (*pet_info) (int fd, int account_id, struct s_pet *p); @@ -182,16 +177,8 @@ struct mapif_interface { int (*itembound_ack) (int fd, int aid, int guild_id); void (*parse_ItemBoundRetrieve) (int fd); void (*parse_accinfo) (int fd); - int (*broadcast) (const unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd); - int (*wis_message) (struct WisData *wd); - void (*wis_response) (int fd, const unsigned char *src, int flag); - int (*wis_end) (struct WisData *wd, int flag); int (*account_reg_reply) (int fd,int account_id,int char_id, int type); int (*disconnectplayer) (int fd, int account_id, int char_id, int reason); - int (*parse_broadcast) (int fd); - int (*parse_WisRequest) (int fd); - int (*parse_WisReply) (int fd); - int (*parse_WisToGM) (int fd); int (*parse_Registry) (int fd); int (*parse_RegistryRequest) (int fd); void (*namechange_ack) (int fd, int account_id, int char_id, int type, int flag, const char *name); diff --git a/src/common/HPM.c b/src/common/HPM.c index a579a0926..479135767 100644 --- a/src/common/HPM.c +++ b/src/common/HPM.c @@ -458,11 +458,12 @@ static bool hplugins_addconf(unsigned int pluginID, enum HPluginConfType type, c static struct hplugin *hplugin_load(const char *filename) { + typedef void *(ImportSymbolFunc)(char *, unsigned int); struct hplugin *plugin; struct hplugin_info *info; struct HPMi_interface **HPMi; bool anyEvent = false; - void **import_symbol_ref; + ImportSymbolFunc **import_symbol_ref; int *HPMDataCheckVer; unsigned int *HPMDataCheckLen; struct s_HPMDataCheck *HPMDataCheck; @@ -499,7 +500,7 @@ static struct hplugin *hplugin_load(const char *filename) plugin->info = info; plugin->filename = aStrdup(filename); - if( !( import_symbol_ref = plugin_import(plugin->dll, "import_symbol",void **) ) ) { + if ((import_symbol_ref = plugin_import(plugin->dll, "import_symbol", ImportSymbolFunc **)) == NULL) { ShowFatalError("HPM:plugin_load: failed to retrieve 'import_symbol' for '"CL_WHITE"%s"CL_RESET"'!\n", filename); exit(EXIT_FAILURE); } diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index 1e1d8068f..9c015e1f5 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -52,7 +52,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { #define CHAR_GEOIP_H #endif // CHAR_GEOIP_H #ifdef CHAR_INTER_H - { "WisData", sizeof(struct WisData), SERVER_TYPE_CHAR }, { "inter_interface", sizeof(struct inter_interface), SERVER_TYPE_CHAR }, #else #define CHAR_INTER_H @@ -526,6 +525,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "item_combo", sizeof(struct item_combo), SERVER_TYPE_MAP }, { "item_data", sizeof(struct item_data), SERVER_TYPE_MAP }, { "item_group", sizeof(struct item_group), SERVER_TYPE_MAP }, + { "item_lapineddukddak", sizeof(struct item_lapineddukddak), SERVER_TYPE_MAP }, { "item_package", sizeof(struct item_package), SERVER_TYPE_MAP }, { "item_package_must_entry", sizeof(struct item_package_must_entry), SERVER_TYPE_MAP }, { "item_package_rand_entry", sizeof(struct item_package_rand_entry), SERVER_TYPE_MAP }, @@ -666,6 +666,9 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_ZC_ACK_LEAVE_GUILD1", sizeof(struct PACKET_ZC_ACK_LEAVE_GUILD1), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_LEAVE_GUILD2", sizeof(struct PACKET_ZC_ACK_LEAVE_GUILD2), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_OPEN_WRITE_MAIL", sizeof(struct PACKET_ZC_ACK_OPEN_WRITE_MAIL), SERVER_TYPE_MAP }, + { "PACKET_ZC_ACK_RANKING_name", sizeof(struct PACKET_ZC_ACK_RANKING_name), SERVER_TYPE_MAP }, + { "PACKET_ZC_ACK_RANKING_points", sizeof(struct PACKET_ZC_ACK_RANKING_points), SERVER_TYPE_MAP }, + { "PACKET_ZC_ACK_RANKING_sub", sizeof(struct PACKET_ZC_ACK_RANKING_sub), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_REMOVE_ITEM_MAIL", sizeof(struct PACKET_ZC_ACK_REMOVE_ITEM_MAIL), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_REQMAKINGITEM", sizeof(struct PACKET_ZC_ACK_REQMAKINGITEM), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_REQNAME_TITLE", sizeof(struct PACKET_ZC_ACK_REQNAME_TITLE), SERVER_TYPE_MAP }, @@ -680,6 +683,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_ZC_ADD_ITEM_TO_MAIL", sizeof(struct PACKET_ZC_ADD_ITEM_TO_MAIL), SERVER_TYPE_MAP }, { "PACKET_ZC_ADD_ITEM_TO_STORE", sizeof(struct PACKET_ZC_ADD_ITEM_TO_STORE), SERVER_TYPE_MAP }, { "PACKET_ZC_ADD_MEMBER_TO_GROUP", sizeof(struct PACKET_ZC_ADD_MEMBER_TO_GROUP), SERVER_TYPE_MAP }, + { "PACKET_ZC_ADD_SKILL", sizeof(struct PACKET_ZC_ADD_SKILL), SERVER_TYPE_MAP }, { "PACKET_ZC_BAN_LIST", sizeof(struct PACKET_ZC_BAN_LIST), SERVER_TYPE_MAP }, { "PACKET_ZC_BAN_LIST_sub", sizeof(struct PACKET_ZC_BAN_LIST_sub), SERVER_TYPE_MAP }, { "PACKET_ZC_CASH_ITEM_DELETE", sizeof(struct PACKET_ZC_CASH_ITEM_DELETE), SERVER_TYPE_MAP }, @@ -715,6 +719,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_ZC_NOTIFY_UNREADMAIL", sizeof(struct PACKET_ZC_NOTIFY_UNREADMAIL), SERVER_TYPE_MAP }, { "PACKET_ZC_NOTIFY_WEAPONITEMLIST", sizeof(struct PACKET_ZC_NOTIFY_WEAPONITEMLIST), SERVER_TYPE_MAP }, { "PACKET_ZC_NOTIFY_WEAPONITEMLIST_sub", sizeof(struct PACKET_ZC_NOTIFY_WEAPONITEMLIST_sub), SERVER_TYPE_MAP }, + { "PACKET_ZC_NPC_MARKET_PURCHASE_RESULT_sub", sizeof(struct PACKET_ZC_NPC_MARKET_PURCHASE_RESULT_sub), SERVER_TYPE_MAP }, { "PACKET_ZC_OPEN_UI", sizeof(struct PACKET_ZC_OPEN_UI), SERVER_TYPE_MAP }, { "PACKET_ZC_OVERWEIGHT_PERCENT", sizeof(struct PACKET_ZC_OVERWEIGHT_PERCENT), SERVER_TYPE_MAP }, { "PACKET_ZC_PC_CASH_POINT_ITEMLIST", sizeof(struct PACKET_ZC_PC_CASH_POINT_ITEMLIST), SERVER_TYPE_MAP }, @@ -734,14 +739,19 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_ZC_SEARCH_STORE_INFO_ACK", sizeof(struct PACKET_ZC_SEARCH_STORE_INFO_ACK), SERVER_TYPE_MAP }, { "PACKET_ZC_SEARCH_STORE_INFO_ACK_sub", sizeof(struct PACKET_ZC_SEARCH_STORE_INFO_ACK_sub), SERVER_TYPE_MAP }, { "PACKET_ZC_SKILL_SCALE", sizeof(struct PACKET_ZC_SKILL_SCALE), SERVER_TYPE_MAP }, + { "PACKET_ZC_SKILLINFO_LIST", sizeof(struct PACKET_ZC_SKILLINFO_LIST), SERVER_TYPE_MAP }, + { "PACKET_ZC_SKILLINFO_UPDATE2", sizeof(struct PACKET_ZC_SKILLINFO_UPDATE2), SERVER_TYPE_MAP }, { "PACKET_ZC_SPRITE_CHANGE", sizeof(struct PACKET_ZC_SPRITE_CHANGE), SERVER_TYPE_MAP }, + { "PACKET_ZC_STATUS_CHANGE_ACK", sizeof(struct PACKET_ZC_STATUS_CHANGE_ACK), SERVER_TYPE_MAP }, { "PACKET_ZC_STYLE_CHANGE_RES", sizeof(struct PACKET_ZC_STYLE_CHANGE_RES), SERVER_TYPE_MAP }, + { "PACKET_ZC_TALKBOX_CHATCONTENTS", sizeof(struct PACKET_ZC_TALKBOX_CHATCONTENTS), SERVER_TYPE_MAP }, { "PACKET_ZC_UI_ACTION", sizeof(struct PACKET_ZC_UI_ACTION), SERVER_TYPE_MAP }, { "PACKET_ZC_UPDATE_ITEM_FROM_BUYING_STORE", sizeof(struct PACKET_ZC_UPDATE_ITEM_FROM_BUYING_STORE), SERVER_TYPE_MAP }, { "PACKET_ZC_USE_ITEM_ACK", sizeof(struct PACKET_ZC_USE_ITEM_ACK), SERVER_TYPE_MAP }, { "PACKET_ZC_WARPLIST", sizeof(struct PACKET_ZC_WARPLIST), SERVER_TYPE_MAP }, { "PACKET_ZC_WARPLIST_sub", sizeof(struct PACKET_ZC_WARPLIST_sub), SERVER_TYPE_MAP }, { "PACKET_ZC_WRITE_MAIL_RESULT", sizeof(struct PACKET_ZC_WRITE_MAIL_RESULT), SERVER_TYPE_MAP }, + { "SKILLDATA", sizeof(struct SKILLDATA), SERVER_TYPE_MAP }, { "ZC_INVENTORY_END", sizeof(struct ZC_INVENTORY_END), SERVER_TYPE_MAP }, { "ZC_INVENTORY_START", sizeof(struct ZC_INVENTORY_START), SERVER_TYPE_MAP }, { "ZC_PROGRESS_ACTOR", sizeof(struct ZC_PROGRESS_ACTOR), SERVER_TYPE_MAP }, @@ -788,7 +798,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "packet_monster_hp", sizeof(struct packet_monster_hp), SERVER_TYPE_MAP }, { "packet_notify_bounditem", sizeof(struct packet_notify_bounditem), SERVER_TYPE_MAP }, { "packet_npc_market_purchase", sizeof(struct packet_npc_market_purchase), SERVER_TYPE_MAP }, - { "packet_npc_market_result_ack", sizeof(struct packet_npc_market_result_ack), SERVER_TYPE_MAP }, { "packet_package_item_announce", sizeof(struct packet_package_item_announce), SERVER_TYPE_MAP }, { "packet_party_leader_changed", sizeof(struct packet_party_leader_changed), SERVER_TYPE_MAP }, { "packet_quest_add_header", sizeof(struct packet_quest_add_header), SERVER_TYPE_MAP }, diff --git a/src/common/mmo.h b/src/common/mmo.h index b58a70ae9..66736bff0 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -139,7 +139,7 @@ // Note that newer clients no longer save hotkeys in the registry! #define HOTKEY_SAVING -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 #define MAX_HOTKEYS 38 #elif PACKETVER_MAIN_NUM >= 20141022 || PACKETVER_RE_NUM >= 20141015 || defined(PACKETVER_ZERO) // (38 = 9 skills x 4 bars & 2 Quickslots)(0x07d9,268) @@ -156,7 +156,7 @@ #endif #endif // PACKETVER_MAIN_NUM >= 20070711 || PACKETVER_RE_NUM >= 20080827 || PACKETVER_AD_NUM >= 20070711 || PACKETVER_SAK_NUM >= 20070628 || defined(PACKETVER_ZERO) -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 #define MAX_HOTKEYS_DB ((MAX_HOTKEYS) * 2) #else #define MAX_HOTKEYS_DB MAX_HOTKEYS @@ -907,6 +907,14 @@ struct guild_castle { int mapindex; char castle_name[NAME_LENGTH]; char castle_event[NAME_LENGTH]; + int siege_type; + bool enable_client_warp; + struct { + int x; + int y; + int zeny; + int zeny_siege; + } client_warp; int guild_id; int economy; int defense; diff --git a/src/common/packets/packets2019_len_main.h b/src/common/packets/packets2019_len_main.h index 0382a72d3..424abe14f 100644 --- a/src/common/packets/packets2019_len_main.h +++ b/src/common/packets/packets2019_len_main.h @@ -103,7 +103,11 @@ packetLen(0x007c, 44) // ZC_NOTIFY_STANDENTRY_NPC packetLen(0x007d, 2) // CZ_NOTIFY_ACTORINIT // Packet: 0x007e +#if PACKETVER >= 20190904 +packetLen(0x007e, 46) // CZ_REQUEST_TIME +#elif PACKETVER >= 20190109 packetLen(0x007e, 105) // CZ_REQUEST_TIME +#endif // Packet: 0x007f packetLen(0x007f, 6) // ZC_NOTIFY_TIME @@ -916,7 +920,11 @@ packetLen(0x018f, 8) // ZC_ACK_REQMAKINGITEM packetLen(0x0190, 23) // CZ_USE_SKILL_TOGROUND_WITHTALKBOX // Packet: 0x0191 +#if PACKETVER >= 20190904 +packetLen(0x0191, 27) // ZC_TALKBOX_CHATCONTENTS +#elif PACKETVER >= 20190109 packetLen(0x0191, 86) // ZC_TALKBOX_CHATCONTENTS +#endif // Packet: 0x0192 packetLen(0x0192, 24) // ZC_UPDATE_MAPINFO @@ -1966,7 +1974,11 @@ packetLen(0x0365, 8) // CZ_MOVE_ITEM_FROM_STORE_TO_BODY2 packetLen(0x0366, 10) // CZ_USE_SKILL_TOGROUND2 // Packet: 0x0367 +#if PACKETVER >= 20190904 +packetLen(0x0367, 31) // CZ_USE_SKILL_TOGROUND_WITHTALKBOX2 +#elif PACKETVER >= 20190109 packetLen(0x0367, 90) // CZ_USE_SKILL_TOGROUND_WITHTALKBOX2 +#endif // Packet: 0x0368 packetLen(0x0368, 6) // CZ_REQNAME2 @@ -3757,7 +3769,7 @@ packetLen(0x0a39, 36) // CH_MAKE_CHAR packetLen(0x0a3a, 12) // Packet: 0x0a3b -packetLen(0x0a3b, -1) // ZC_CUSTOM_HAT_EFFECT +packetLen(0x0a3b, -1) // ZC_HAT_EFFECT // Packet: 0x0a3c packetLen(0x0a3c, -1) @@ -3901,7 +3913,7 @@ packetLen(0x0a74, 8) packetLen(0x0a76, 80) // Packet: 0x0a77 -packetLen(0x0a77, 15) +packetLen(0x0a77, 15) // CZ_CAMERA_INFO // Packet: 0x0a78 packetLen(0x0a78, 15) @@ -4270,7 +4282,7 @@ packetLen(0x0af4, 11) // CZ_USE_SKILL_TOGROUND packetLen(0x0af5, 3) // Packet: 0x0af6 -packetLen(0x0af6, 88) +packetLen(0x0af6, 88) // ZC_ACK_RANKING // Packet: 0x0af7 packetLen(0x0af7, 32) // ZC_ACK_REQNAME_BYGID @@ -4312,7 +4324,13 @@ packetLen(0x0b02, 26) // AC_REFUSE_LOGIN4 packetLen(0x0b03, -1) // ZC_EQUIPWIN_MICROSCOPE_V7 // Packet: 0x0b04 +#if PACKETVER >= 20190807 +packetLen(0x0b04, 90) +#elif PACKETVER >= 20190605 +packetLen(0x0b04, 72) +#elif PACKETVER >= 20190109 packetLen(0x0b04, 80) +#endif // Packet: 0x0b05 packetLen(0x0b05, 63) // ZC_OFFLINE_STORE_VISIBLE @@ -4393,12 +4411,16 @@ packetLen(0x0b1d, 2) // ZC_PING #endif // Packet: 0x0b1e -#if PACKETVER >= 20190227 +#if PACKETVER >= 20190619 +packetLen(0x0b1e, 14) +#elif PACKETVER >= 20190227 packetLen(0x0b1e, 10) #endif // Packet: 0x0b1f -#if PACKETVER >= 20190306 +#if PACKETVER >= 20190619 +packetLen(0x0b1f, 14) +#elif PACKETVER >= 20190306 packetLen(0x0b1f, 10) #endif @@ -4466,12 +4488,16 @@ packetLen(0x0b28, 22) #endif // Packet: 0x0b29 -#if PACKETVER >= 20190508 +#if PACKETVER >= 20190605 +// removed +#elif PACKETVER >= 20190508 packetLen(0x0b29, 6) #endif // Packet: 0x0b2a -#if PACKETVER >= 20190522 +#if PACKETVER >= 20190605 +// removed +#elif PACKETVER >= 20190522 packetLen(0x0b2a, 40) #elif PACKETVER >= 20190508 packetLen(0x0b2a, 6) @@ -4499,7 +4525,7 @@ packetLen(0x0b2e, 4) // Packet: 0x0b2f #if PACKETVER >= 20190529 -packetLen(0x0b2f, 73) +packetLen(0x0b2f, 73) // ZC_PROPERTY_HOMUN_3 #endif // Packet: 0x0b30 @@ -4507,5 +4533,234 @@ packetLen(0x0b2f, 73) packetLen(0x0b30, -1) #endif +// Packet: 0x0b31 +#if PACKETVER >= 20190619 +packetLen(0x0b31, 17) // ZC_ADD_SKILL +#endif + +// Packet: 0x0b32 +#if PACKETVER >= 20190619 +packetLen(0x0b32, -1) // ZC_SKILLINFO_LIST +#endif + +// Packet: 0x0b33 +#if PACKETVER >= 20190619 +packetLen(0x0b33, 17) // ZC_SKILLINFO_UPDATE2 +#endif + +// Packet: 0x0b34 +#if PACKETVER >= 20190724 +packetLen(0x0b34, 50) +#elif PACKETVER >= 20190703 +packetLen(0x0b34, 26) +#endif + +// Packet: 0x0b35 +#if PACKETVER >= 20190703 +packetLen(0x0b35, 3) +#endif + +// Packet: 0x0b36 +#if PACKETVER >= 20190717 +packetLen(0x0b36, -1) +#endif + +// Packet: 0x0b37 +#if PACKETVER >= 20190724 +packetLen(0x0b37, -1) +#endif + +// Packet: 0x0b38 +#if PACKETVER >= 20190724 +packetLen(0x0b38, -1) +#endif + +// Packet: 0x0b39 +#if PACKETVER >= 20190724 +packetLen(0x0b39, -1) +#endif + +// Packet: 0x0b3a +#if PACKETVER >= 20190724 +packetLen(0x0b3a, 4) +#endif + +// Packet: 0x0b3b +#if PACKETVER >= 20190724 +packetLen(0x0b3b, 4) +#endif + +// Packet: 0x0b3c +#if PACKETVER >= 20190724 +packetLen(0x0b3c, 4) +#endif + +// Packet: 0x0b3d +#if PACKETVER >= 20190724 +packetLen(0x0b3d, -1) +#endif + +// Packet: 0x0b3e +#if PACKETVER >= 20190724 +packetLen(0x0b3e, -1) +#endif + +// Packet: 0x0b3f +#if PACKETVER >= 20190724 +packetLen(0x0b3f, 64) +#endif + +// Packet: 0x0b40 +#if PACKETVER >= 20190724 +packetLen(0x0b40, -1) +#endif + +// Packet: 0x0b41 +#if PACKETVER >= 20190724 +packetLen(0x0b41, 41) +#endif + +// Packet: 0x0b42 +#if PACKETVER >= 20190724 +packetLen(0x0b42, 30) +#endif + +// Packet: 0x0b43 +#if PACKETVER >= 20190724 +packetLen(0x0b43, 47) +#endif + +// Packet: 0x0b44 +#if PACKETVER >= 20190724 +packetLen(0x0b44, 32) +#endif + +// Packet: 0x0b45 +#if PACKETVER >= 20190724 +packetLen(0x0b45, 32) +#endif + +// Packet: 0x0b46 +#if PACKETVER >= 20190724 +packetLen(0x0b46, 10) +#endif + +// Packet: 0x0b47 +#if PACKETVER >= 20190724 +packetLen(0x0b47, 14) +#endif + +// Packet: 0x0b48 +#if PACKETVER >= 20190724 +packetLen(0x0b48, 18) +#endif + +// Packet: 0x0b49 +#if PACKETVER >= 20190724 +packetLen(0x0b49, 4) +#endif + +// Packet: 0x0b4a +#if PACKETVER >= 20190724 +packetLen(0x0b4a, 6) +#endif + +// Packet: 0x0b4b +#if PACKETVER >= 20190724 +packetLen(0x0b4b, 4) +#endif + +// Packet: 0x0b4c +#if PACKETVER >= 20190724 +packetLen(0x0b4c, 2) +#endif + +// Packet: 0x0b4d +#if PACKETVER >= 20190807 +packetLen(0x0b4d, -1) +#elif PACKETVER >= 20190724 +packetLen(0x0b4d, 6) +#endif + +// Packet: 0x0b4e +#if PACKETVER >= 20190807 +packetLen(0x0b4e, -1) +#endif + +// Packet: 0x0b4f +#if PACKETVER >= 20190807 +packetLen(0x0b4f, 2) +#endif + +// Packet: 0x0b50 +#if PACKETVER >= 20190807 +packetLen(0x0b50, 2) +#endif + +// Packet: 0x0b51 +#if PACKETVER >= 20190807 +packetLen(0x0b51, 2) +#endif + +// Packet: 0x0b52 +#if PACKETVER >= 20190807 +packetLen(0x0b52, 2) +#endif + +// Packet: 0x0b53 +#if PACKETVER >= 20190821 +packetLen(0x0b53, 52) +#endif + +// Packet: 0x0b54 +#if PACKETVER >= 20190821 +packetLen(0x0b54, 8) +#endif + +// Packet: 0x0b55 +#if PACKETVER >= 20190821 +packetLen(0x0b55, -1) +#endif + +// Packet: 0x0b56 +#if PACKETVER >= 20190904 +packetLen(0x0b56, -1) +#endif + +// Packet: 0x0b57 +#if PACKETVER >= 20190904 +packetLen(0x0b57, -1) +#endif + +// Packet: 0x0b58 +#if PACKETVER >= 20190904 +packetLen(0x0b58, 2) +#endif + +// Packet: 0x0b59 +#if PACKETVER >= 20190918 +packetLen(0x0b59, 2) +#endif + +// Packet: 0x0b5a +#if PACKETVER >= 20190918 +packetLen(0x0b5a, 4) +#endif + +// Packet: 0x0b5b +#if PACKETVER >= 20190918 +packetLen(0x0b5b, -1) +#endif + +// Packet: 0x0b5c +#if PACKETVER >= 20190918 +packetLen(0x0b5c, 10) +#endif + +// Packet: 0x0b5d +#if PACKETVER >= 20190918 +packetLen(0x0b5d, 2) +#endif + #endif /* COMMON_PACKETS2019_LEN_MAIN_H */ diff --git a/src/common/packets/packets2019_len_re.h b/src/common/packets/packets2019_len_re.h index c553d9324..32c14775d 100644 --- a/src/common/packets/packets2019_len_re.h +++ b/src/common/packets/packets2019_len_re.h @@ -103,7 +103,11 @@ packetLen(0x007c, 44) // ZC_NOTIFY_STANDENTRY_NPC packetLen(0x007d, 2) // CZ_NOTIFY_ACTORINIT // Packet: 0x007e +#if PACKETVER >= 20190904 +packetLen(0x007e, 46) // CZ_REQUEST_TIME +#elif PACKETVER >= 20190109 packetLen(0x007e, 105) // CZ_REQUEST_TIME +#endif // Packet: 0x007f packetLen(0x007f, 6) // ZC_NOTIFY_TIME @@ -916,7 +920,11 @@ packetLen(0x018f, 8) // ZC_ACK_REQMAKINGITEM packetLen(0x0190, 23) // CZ_USE_SKILL_TOGROUND_WITHTALKBOX // Packet: 0x0191 +#if PACKETVER >= 20190904 +packetLen(0x0191, 27) // ZC_TALKBOX_CHATCONTENTS +#elif PACKETVER >= 20190109 packetLen(0x0191, 86) // ZC_TALKBOX_CHATCONTENTS +#endif // Packet: 0x0192 packetLen(0x0192, 24) // ZC_UPDATE_MAPINFO @@ -1972,7 +1980,11 @@ packetLen(0x0365, 8) // CZ_MOVE_ITEM_FROM_STORE_TO_BODY2 packetLen(0x0366, 10) // CZ_USE_SKILL_TOGROUND2 // Packet: 0x0367 +#if PACKETVER >= 20190904 +packetLen(0x0367, 31) // CZ_USE_SKILL_TOGROUND_WITHTALKBOX2 +#elif PACKETVER >= 20190109 packetLen(0x0367, 90) // CZ_USE_SKILL_TOGROUND_WITHTALKBOX2 +#endif // Packet: 0x0368 packetLen(0x0368, 6) // CZ_REQNAME2 @@ -3763,7 +3775,7 @@ packetLen(0x0a39, 36) // CH_MAKE_CHAR packetLen(0x0a3a, 12) // Packet: 0x0a3b -packetLen(0x0a3b, -1) // ZC_CUSTOM_HAT_EFFECT +packetLen(0x0a3b, -1) // ZC_HAT_EFFECT // Packet: 0x0a3c packetLen(0x0a3c, -1) @@ -3907,7 +3919,7 @@ packetLen(0x0a74, 8) packetLen(0x0a76, 80) // Packet: 0x0a77 -packetLen(0x0a77, 15) +packetLen(0x0a77, 15) // CZ_CAMERA_INFO // Packet: 0x0a78 packetLen(0x0a78, 15) @@ -4276,7 +4288,7 @@ packetLen(0x0af4, 11) // CZ_USE_SKILL_TOGROUND packetLen(0x0af5, 3) // Packet: 0x0af6 -packetLen(0x0af6, 88) +packetLen(0x0af6, 88) // ZC_ACK_RANKING // Packet: 0x0af7 packetLen(0x0af7, 32) // ZC_ACK_REQNAME_BYGID @@ -4318,7 +4330,13 @@ packetLen(0x0b02, 26) // AC_REFUSE_LOGIN4 packetLen(0x0b03, -1) // ZC_EQUIPWIN_MICROSCOPE_V7 // Packet: 0x0b04 +#if PACKETVER >= 20190807 +packetLen(0x0b04, 90) +#elif PACKETVER >= 20190605 +packetLen(0x0b04, 72) +#elif PACKETVER >= 20190109 packetLen(0x0b04, 80) +#endif // Packet: 0x0b05 packetLen(0x0b05, 63) // ZC_OFFLINE_STORE_VISIBLE @@ -4399,12 +4417,22 @@ packetLen(0x0b1d, 2) // ZC_PING #endif // Packet: 0x0b1e -#if PACKETVER >= 20190227 +#if PACKETVER >= 20190619 +packetLen(0x0b1e, 14) +#elif PACKETVER >= 20190605 +packetLen(0x0b1e, 14) +// ignored packet from 2019-06-05hRagexeRE +#elif PACKETVER >= 20190227 packetLen(0x0b1e, 10) #endif // Packet: 0x0b1f -#if PACKETVER >= 20190306 +#if PACKETVER >= 20190619 +packetLen(0x0b1f, 14) +#elif PACKETVER >= 20190605 +packetLen(0x0b1f, 14) +// ignored packet from 2019-06-05hRagexeRE +#elif PACKETVER >= 20190306 packetLen(0x0b1f, 10) #endif @@ -4472,12 +4500,16 @@ packetLen(0x0b28, 22) #endif // Packet: 0x0b29 -#if PACKETVER >= 20190508 +#if PACKETVER >= 20190605 +// removed +#elif PACKETVER >= 20190508 packetLen(0x0b29, 6) #endif // Packet: 0x0b2a -#if PACKETVER >= 20190522 +#if PACKETVER >= 20190605 +// removed +#elif PACKETVER >= 20190522 packetLen(0x0b2a, 40) #elif PACKETVER >= 20190508 packetLen(0x0b2a, 6) @@ -4505,7 +4537,7 @@ packetLen(0x0b2e, 4) // Packet: 0x0b2f #if PACKETVER >= 20190529 -packetLen(0x0b2f, 73) +packetLen(0x0b2f, 73) // ZC_PROPERTY_HOMUN_3 #endif // Packet: 0x0b30 @@ -4513,5 +4545,234 @@ packetLen(0x0b2f, 73) packetLen(0x0b30, -1) #endif +// Packet: 0x0b31 +#if PACKETVER >= 20190619 +packetLen(0x0b31, 17) // ZC_ADD_SKILL +#endif + +// Packet: 0x0b32 +#if PACKETVER >= 20190619 +packetLen(0x0b32, -1) // ZC_SKILLINFO_LIST +#endif + +// Packet: 0x0b33 +#if PACKETVER >= 20190619 +packetLen(0x0b33, 17) // ZC_SKILLINFO_UPDATE2 +#endif + +// Packet: 0x0b34 +#if PACKETVER >= 20190724 +packetLen(0x0b34, 50) +#elif PACKETVER >= 20190703 +packetLen(0x0b34, 26) +#endif + +// Packet: 0x0b35 +#if PACKETVER >= 20190703 +packetLen(0x0b35, 3) +#endif + +// Packet: 0x0b36 +#if PACKETVER >= 20190717 +packetLen(0x0b36, -1) +#endif + +// Packet: 0x0b37 +#if PACKETVER >= 20190724 +packetLen(0x0b37, -1) +#endif + +// Packet: 0x0b38 +#if PACKETVER >= 20190724 +packetLen(0x0b38, -1) +#endif + +// Packet: 0x0b39 +#if PACKETVER >= 20190724 +packetLen(0x0b39, -1) +#endif + +// Packet: 0x0b3a +#if PACKETVER >= 20190724 +packetLen(0x0b3a, 4) +#endif + +// Packet: 0x0b3b +#if PACKETVER >= 20190724 +packetLen(0x0b3b, 4) +#endif + +// Packet: 0x0b3c +#if PACKETVER >= 20190724 +packetLen(0x0b3c, 4) +#endif + +// Packet: 0x0b3d +#if PACKETVER >= 20190724 +packetLen(0x0b3d, -1) +#endif + +// Packet: 0x0b3e +#if PACKETVER >= 20190724 +packetLen(0x0b3e, -1) +#endif + +// Packet: 0x0b3f +#if PACKETVER >= 20190724 +packetLen(0x0b3f, 64) +#endif + +// Packet: 0x0b40 +#if PACKETVER >= 20190724 +packetLen(0x0b40, -1) +#endif + +// Packet: 0x0b41 +#if PACKETVER >= 20190724 +packetLen(0x0b41, 41) +#endif + +// Packet: 0x0b42 +#if PACKETVER >= 20190724 +packetLen(0x0b42, 30) +#endif + +// Packet: 0x0b43 +#if PACKETVER >= 20190724 +packetLen(0x0b43, 47) +#endif + +// Packet: 0x0b44 +#if PACKETVER >= 20190724 +packetLen(0x0b44, 32) +#endif + +// Packet: 0x0b45 +#if PACKETVER >= 20190724 +packetLen(0x0b45, 32) +#endif + +// Packet: 0x0b46 +#if PACKETVER >= 20190724 +packetLen(0x0b46, 10) +#endif + +// Packet: 0x0b47 +#if PACKETVER >= 20190724 +packetLen(0x0b47, 14) +#endif + +// Packet: 0x0b48 +#if PACKETVER >= 20190724 +packetLen(0x0b48, 18) +#endif + +// Packet: 0x0b49 +#if PACKETVER >= 20190724 +packetLen(0x0b49, 4) +#endif + +// Packet: 0x0b4a +#if PACKETVER >= 20190724 +packetLen(0x0b4a, 6) +#endif + +// Packet: 0x0b4b +#if PACKETVER >= 20190724 +packetLen(0x0b4b, 4) +#endif + +// Packet: 0x0b4c +#if PACKETVER >= 20190724 +packetLen(0x0b4c, 2) +#endif + +// Packet: 0x0b4d +#if PACKETVER >= 20190807 +packetLen(0x0b4d, -1) +#elif PACKETVER >= 20190724 +packetLen(0x0b4d, 6) +#endif + +// Packet: 0x0b4e +#if PACKETVER >= 20190807 +packetLen(0x0b4e, -1) +#endif + +// Packet: 0x0b4f +#if PACKETVER >= 20190807 +packetLen(0x0b4f, 2) +#endif + +// Packet: 0x0b50 +#if PACKETVER >= 20190807 +packetLen(0x0b50, 2) +#endif + +// Packet: 0x0b51 +#if PACKETVER >= 20190807 +packetLen(0x0b51, 2) +#endif + +// Packet: 0x0b52 +#if PACKETVER >= 20190807 +packetLen(0x0b52, 2) +#endif + +// Packet: 0x0b53 +#if PACKETVER >= 20190821 +packetLen(0x0b53, 52) +#endif + +// Packet: 0x0b54 +#if PACKETVER >= 20190821 +packetLen(0x0b54, 8) +#endif + +// Packet: 0x0b55 +#if PACKETVER >= 20190821 +packetLen(0x0b55, -1) +#endif + +// Packet: 0x0b56 +#if PACKETVER >= 20190904 +packetLen(0x0b56, -1) +#endif + +// Packet: 0x0b57 +#if PACKETVER >= 20190904 +packetLen(0x0b57, -1) +#endif + +// Packet: 0x0b58 +#if PACKETVER >= 20190904 +packetLen(0x0b58, 2) +#endif + +// Packet: 0x0b59 +#if PACKETVER >= 20190918 +packetLen(0x0b59, 2) +#endif + +// Packet: 0x0b5a +#if PACKETVER >= 20190918 +packetLen(0x0b5a, 4) +#endif + +// Packet: 0x0b5b +#if PACKETVER >= 20190918 +packetLen(0x0b5b, -1) +#endif + +// Packet: 0x0b5c +#if PACKETVER >= 20190918 +packetLen(0x0b5c, 10) +#endif + +// Packet: 0x0b5d +#if PACKETVER >= 20190918 +packetLen(0x0b5d, 2) +#endif + #endif /* COMMON_PACKETS2019_LEN_RE_H */ diff --git a/src/common/packets/packets2019_len_zero.h b/src/common/packets/packets2019_len_zero.h index 3295b26d9..9cdc9db05 100644 --- a/src/common/packets/packets2019_len_zero.h +++ b/src/common/packets/packets2019_len_zero.h @@ -103,7 +103,11 @@ packetLen(0x007c, 44) // ZC_NOTIFY_STANDENTRY_NPC packetLen(0x007d, 2) // CZ_NOTIFY_ACTORINIT // Packet: 0x007e +#if PACKETVER >= 20190828 +packetLen(0x007e, 46) // CZ_REQUEST_TIME +#elif PACKETVER >= 20190116 packetLen(0x007e, 105) // CZ_REQUEST_TIME +#endif // Packet: 0x007f packetLen(0x007f, 6) // ZC_NOTIFY_TIME @@ -916,7 +920,11 @@ packetLen(0x018f, 8) // ZC_ACK_REQMAKINGITEM packetLen(0x0190, 23) // CZ_USE_SKILL_TOGROUND_WITHTALKBOX // Packet: 0x0191 +#if PACKETVER >= 20190828 +packetLen(0x0191, 27) // ZC_TALKBOX_CHATCONTENTS +#elif PACKETVER >= 20190116 packetLen(0x0191, 86) // ZC_TALKBOX_CHATCONTENTS +#endif // Packet: 0x0192 packetLen(0x0192, 24) // ZC_UPDATE_MAPINFO @@ -1966,7 +1974,11 @@ packetLen(0x0365, 8) // CZ_MOVE_ITEM_FROM_STORE_TO_BODY2 packetLen(0x0366, 10) // CZ_USE_SKILL_TOGROUND2 // Packet: 0x0367 +#if PACKETVER >= 20190828 +packetLen(0x0367, 31) // CZ_USE_SKILL_TOGROUND_WITHTALKBOX2 +#elif PACKETVER >= 20190116 packetLen(0x0367, 90) // CZ_USE_SKILL_TOGROUND_WITHTALKBOX2 +#endif // Packet: 0x0368 packetLen(0x0368, 6) // CZ_REQNAME2 @@ -3757,7 +3769,7 @@ packetLen(0x0a39, 36) // CH_MAKE_CHAR packetLen(0x0a3a, 12) // Packet: 0x0a3b -packetLen(0x0a3b, -1) // ZC_CUSTOM_HAT_EFFECT +packetLen(0x0a3b, -1) // ZC_HAT_EFFECT // Packet: 0x0a3c packetLen(0x0a3c, -1) @@ -3901,7 +3913,7 @@ packetLen(0x0a74, 8) packetLen(0x0a76, 80) // Packet: 0x0a77 -packetLen(0x0a77, 15) +packetLen(0x0a77, 15) // CZ_CAMERA_INFO // Packet: 0x0a78 packetLen(0x0a78, 15) @@ -4270,7 +4282,7 @@ packetLen(0x0af4, 11) // CZ_USE_SKILL_TOGROUND packetLen(0x0af5, 3) // Packet: 0x0af6 -packetLen(0x0af6, 88) +packetLen(0x0af6, 88) // ZC_ACK_RANKING // Packet: 0x0af7 packetLen(0x0af7, 32) // ZC_ACK_REQNAME_BYGID @@ -4312,7 +4324,13 @@ packetLen(0x0b02, 26) // AC_REFUSE_LOGIN4 packetLen(0x0b03, -1) // ZC_EQUIPWIN_MICROSCOPE_V7 // Packet: 0x0b04 +#if PACKETVER >= 20190814 +packetLen(0x0b04, 90) +#elif PACKETVER >= 20190605 +packetLen(0x0b04, 72) +#elif PACKETVER >= 20190116 packetLen(0x0b04, 80) +#endif // Packet: 0x0b05 packetLen(0x0b05, 63) // ZC_OFFLINE_STORE_VISIBLE @@ -4393,12 +4411,16 @@ packetLen(0x0b1d, 2) // ZC_PING #endif // Packet: 0x0b1e -#if PACKETVER >= 20190313 +#if PACKETVER >= 20190626 +packetLen(0x0b1e, 14) +#elif PACKETVER >= 20190313 packetLen(0x0b1e, 10) #endif // Packet: 0x0b1f -#if PACKETVER >= 20190313 +#if PACKETVER >= 20190626 +packetLen(0x0b1f, 14) +#elif PACKETVER >= 20190313 packetLen(0x0b1f, 10) #endif @@ -4456,14 +4478,18 @@ packetLen(0x0b28, -1) #endif // Packet: 0x0b29 -#if PACKETVER >= 20190502 +#if PACKETVER >= 20190605 +// removed +#elif PACKETVER >= 20190502 packetLen(0x0b29, 6) #elif PACKETVER >= 20190424 packetLen(0x0b29, 3) #endif // Packet: 0x0b2a -#if PACKETVER >= 20190529 +#if PACKETVER >= 20190605 +// removed +#elif PACKETVER >= 20190529 packetLen(0x0b2a, 40) #elif PACKETVER >= 20190502 packetLen(0x0b2a, 6) @@ -4491,7 +4517,7 @@ packetLen(0x0b2e, 4) // Packet: 0x0b2f #if PACKETVER >= 20190529 -packetLen(0x0b2f, 73) +packetLen(0x0b2f, 73) // ZC_PROPERTY_HOMUN_3 #endif // Packet: 0x0b30 @@ -4499,5 +4525,234 @@ packetLen(0x0b2f, 73) packetLen(0x0b30, -1) #endif +// Packet: 0x0b31 +#if PACKETVER >= 20190626 +packetLen(0x0b31, 17) // ZC_ADD_SKILL +#endif + +// Packet: 0x0b32 +#if PACKETVER >= 20190626 +packetLen(0x0b32, -1) // ZC_SKILLINFO_LIST +#endif + +// Packet: 0x0b33 +#if PACKETVER >= 20190626 +packetLen(0x0b33, 17) // ZC_SKILLINFO_UPDATE2 +#endif + +// Packet: 0x0b34 +#if PACKETVER >= 20190724 +packetLen(0x0b34, 50) +#elif PACKETVER >= 20190626 +packetLen(0x0b34, 26) +#endif + +// Packet: 0x0b35 +#if PACKETVER >= 20190709 +packetLen(0x0b35, 3) +#endif + +// Packet: 0x0b36 +#if PACKETVER >= 20190709 +packetLen(0x0b36, -1) +#endif + +// Packet: 0x0b37 +#if PACKETVER >= 20190724 +packetLen(0x0b37, -1) +#endif + +// Packet: 0x0b38 +#if PACKETVER >= 20190724 +packetLen(0x0b38, -1) +#endif + +// Packet: 0x0b39 +#if PACKETVER >= 20190724 +packetLen(0x0b39, -1) +#endif + +// Packet: 0x0b3a +#if PACKETVER >= 20190724 +packetLen(0x0b3a, 4) +#endif + +// Packet: 0x0b3b +#if PACKETVER >= 20190724 +packetLen(0x0b3b, 4) +#endif + +// Packet: 0x0b3c +#if PACKETVER >= 20190724 +packetLen(0x0b3c, 4) +#endif + +// Packet: 0x0b3d +#if PACKETVER >= 20190724 +packetLen(0x0b3d, -1) +#endif + +// Packet: 0x0b3e +#if PACKETVER >= 20190724 +packetLen(0x0b3e, -1) +#endif + +// Packet: 0x0b3f +#if PACKETVER >= 20190724 +packetLen(0x0b3f, 64) +#endif + +// Packet: 0x0b40 +#if PACKETVER >= 20190724 +packetLen(0x0b40, -1) +#endif + +// Packet: 0x0b41 +#if PACKETVER >= 20190724 +packetLen(0x0b41, 41) +#endif + +// Packet: 0x0b42 +#if PACKETVER >= 20190724 +packetLen(0x0b42, 30) +#endif + +// Packet: 0x0b43 +#if PACKETVER >= 20190724 +packetLen(0x0b43, 47) +#endif + +// Packet: 0x0b44 +#if PACKETVER >= 20190724 +packetLen(0x0b44, 32) +#endif + +// Packet: 0x0b45 +#if PACKETVER >= 20190724 +packetLen(0x0b45, 32) +#endif + +// Packet: 0x0b46 +#if PACKETVER >= 20190724 +packetLen(0x0b46, 10) +#endif + +// Packet: 0x0b47 +#if PACKETVER >= 20190724 +packetLen(0x0b47, 14) +#endif + +// Packet: 0x0b48 +#if PACKETVER >= 20190724 +packetLen(0x0b48, 18) +#endif + +// Packet: 0x0b49 +#if PACKETVER >= 20190724 +packetLen(0x0b49, 4) +#endif + +// Packet: 0x0b4a +#if PACKETVER >= 20190724 +packetLen(0x0b4a, 6) +#endif + +// Packet: 0x0b4b +#if PACKETVER >= 20190724 +packetLen(0x0b4b, 4) +#endif + +// Packet: 0x0b4c +#if PACKETVER >= 20190724 +packetLen(0x0b4c, 2) +#endif + +// Packet: 0x0b4d +#if PACKETVER >= 20190814 +packetLen(0x0b4d, -1) +#elif PACKETVER >= 20190724 +packetLen(0x0b4d, 6) +#endif + +// Packet: 0x0b4e +#if PACKETVER >= 20190814 +packetLen(0x0b4e, -1) +#endif + +// Packet: 0x0b4f +#if PACKETVER >= 20190814 +packetLen(0x0b4f, 2) +#endif + +// Packet: 0x0b50 +#if PACKETVER >= 20190814 +packetLen(0x0b50, 2) +#endif + +// Packet: 0x0b51 +#if PACKETVER >= 20190814 +packetLen(0x0b51, 2) +#endif + +// Packet: 0x0b52 +#if PACKETVER >= 20190814 +packetLen(0x0b52, 2) +#endif + +// Packet: 0x0b53 +#if PACKETVER >= 20190814 +packetLen(0x0b53, 52) +#endif + +// Packet: 0x0b54 +#if PACKETVER >= 20190814 +packetLen(0x0b54, 8) +#endif + +// Packet: 0x0b55 +#if PACKETVER >= 20190828 +packetLen(0x0b55, -1) +#endif + +// Packet: 0x0b56 +#if PACKETVER >= 20190828 +packetLen(0x0b56, -1) +#endif + +// Packet: 0x0b57 +#if PACKETVER >= 20190828 +packetLen(0x0b57, -1) +#endif + +// Packet: 0x0b58 +#if PACKETVER >= 20190828 +packetLen(0x0b58, 2) +#endif + +// Packet: 0x0b59 +#if PACKETVER >= 20190918 +packetLen(0x0b59, 2) +#endif + +// Packet: 0x0b5a +#if PACKETVER >= 20190918 +packetLen(0x0b5a, 4) +#endif + +// Packet: 0x0b5b +#if PACKETVER >= 20190918 +packetLen(0x0b5b, -1) +#endif + +// Packet: 0x0b5c +#if PACKETVER >= 20190918 +packetLen(0x0b5c, 10) +#endif + +// Packet: 0x0b5d +#if PACKETVER >= 20190918 +packetLen(0x0b5d, 2) +#endif + #endif /* COMMON_PACKETS2019_LEN_ZERO_H */ diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 97af2afff..f57583cfc 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -511,7 +511,7 @@ ACMD(where) return false; } - pl_sd = map->nick2sd(atcmd_player_name); + pl_sd = map->nick2sd(atcmd_player_name, true); if (pl_sd == NULL || strncmp(pl_sd->status.name, atcmd_player_name, NAME_LENGTH) != 0 || (pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) && pc_get_group_level(pl_sd) > pc_get_group_level(sd) && !pc_has_permission(sd, PC_PERM_WHO_DISPLAY_AID)) @@ -548,7 +548,7 @@ ACMD(jumpto) return false; } - if ((pl_sd=map->nick2sd(message)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) { + if ((pl_sd=map->nick2sd(message, true)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) { clif->message(fd, msg_fd(fd,3)); // Character not found. return false; } @@ -1107,8 +1107,10 @@ ACMD(kami) sscanf(message, "%199[^\n]", atcmd_output); if (stristr(info->command, "l") != NULL) clif->broadcast(&sd->bl, atcmd_output, (int)strlen(atcmd_output) + 1, BC_DEFAULT, ALL_SAMEMAP); + else if (info->command[4] == 'b' || info->command[4] == 'B') + clif->broadcast(NULL, atcmd_output, (int)strlen(atcmd_output) + 1, BC_BLUE, ALL_CLIENT); else - intif->broadcast(atcmd_output, (int)strlen(atcmd_output) + 1, (*(info->command + 4) == 'b' || *(info->command + 4) == 'B') ? BC_BLUE : BC_YELLOW); + clif->broadcast(NULL, atcmd_output, (int)strlen(atcmd_output) + 1, BC_YELLOW, ALL_CLIENT); } else { if(!*message || (sscanf(message, "%10u %199[^\n]", &color, atcmd_output) < 2)) { clif->message(fd, msg_fd(fd,981)); // Please enter color and message (usage: @kamic <color> <message>). @@ -1119,7 +1121,7 @@ ACMD(kami) clif->message(fd, msg_fd(fd,982)); // Invalid color. return false; } - intif->broadcast2(atcmd_output, (int)strlen(atcmd_output) + 1, color, 0x190, 12, 0, 0); + clif->broadcast2(NULL, atcmd_output, (int)strlen(atcmd_output) + 1, color, 0x190, 12, 0, 0, ALL_CLIENT); } return true; } @@ -2232,26 +2234,56 @@ ACMD(refine) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!*message || sscanf(message, "%12d %12d", &position, &refine_level) < 2) { - clif->message(fd, msg_fd(fd,996)); // Please enter a position and an amount (usage: @refine <equip position> <+/- amount>). - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,997), EQP_HEAD_LOW); // %d: Lower Headgear + clif->message(fd, msg_fd(fd, 996)); // Please enter a position and an amount (usage: @refine <equip position> <+/- amount>). +#if PACKETVER > 20100707 + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1515), -3); // %d: Refine All Equip (Shadow) clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,998), EQP_HAND_R); // %d: Right Hand + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1514), -2); // %d: Refine All Equip (Costume) clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,999), EQP_GARMENT); // %d: Garment +#endif + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1513), -1); // %d: Refine All Equip (General) + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 997), EQP_HEAD_LOW); // %d: Headgear (Low) + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 998), EQP_HAND_R); // Hand (Right) + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 999), EQP_GARMENT); // %d: Garment + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1000), EQP_ACC_L); // Accessory (Left) + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1001), EQP_ARMOR); // %d: Body Armor + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1002), EQP_HAND_L); // Hand (Left) + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1003), EQP_SHOES); // %d: Shoes clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1000), EQP_ACC_L); // %d: Left Accessory + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1004), EQP_ACC_R); // Accessory (Right) clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1001), EQP_ARMOR); // %d: Body Armor + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1005), EQP_HEAD_TOP); // %d: Headgear (Top) clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1002), EQP_HAND_L); // %d: Left Hand + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1006), EQP_HEAD_MID); // %d: Headgear (Mid) +#if PACKETVER > 20100707 + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1503), EQP_COSTUME_HEAD_TOP); // %d: Costume Headgear (Top) clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1003), EQP_SHOES); // %d: Shoes + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1504), EQP_COSTUME_HEAD_MID); // %d: Costume Headgear (Mid) clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1004), EQP_ACC_R); // %d: Right Accessory + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1505), EQP_COSTUME_HEAD_LOW); // %d: Costume Headgear (Low) clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1005), EQP_HEAD_TOP); // %d: Top Headgear + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1506), EQP_COSTUME_GARMENT); // %d: Costume Garment clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1006), EQP_HEAD_MID); // %d: Mid Headgear + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1507), EQP_SHADOW_ARMOR); // %d: Shadow Armor + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1508), EQP_SHADOW_WEAPON); // %d: Shadow Weapon + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1509), EQP_SHADOW_SHIELD); // %d: Shadow Shield + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1510), EQP_SHADOW_SHOES); // %d: Shadow Shoes + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1511), EQP_SHADOW_ACC_R); // %d: Shadow Accessory (Right) + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1512), EQP_SHADOW_ACC_L); // %d: Shadow Accessory (Left) + clif->message(fd, atcmd_output); +#endif clif->message(fd, atcmd_output); return false; } @@ -2263,22 +2295,33 @@ ACMD(refine) int idx = sd->equip_index[j]; if (idx < 0) continue; - if(j == EQI_AMMO) continue; /* can't equip ammo */ - if(j == EQI_HAND_R && sd->equip_index[EQI_HAND_L] == idx) + if (j == EQI_AMMO) + continue; /* can't equip ammo */ + if (j == EQI_HAND_R && sd->equip_index[EQI_HAND_L] == idx) continue; - if(j == EQI_HEAD_MID && sd->equip_index[EQI_HEAD_LOW] == idx) + if (j == EQI_HEAD_MID && sd->equip_index[EQI_HEAD_LOW] == idx) continue; - if(j == EQI_HEAD_TOP && (sd->equip_index[EQI_HEAD_MID] == idx || sd->equip_index[EQI_HEAD_LOW] == idx)) + if (j == EQI_HEAD_TOP && (sd->equip_index[EQI_HEAD_MID] == idx || sd->equip_index[EQI_HEAD_LOW] == idx)) + continue; + if (j == EQI_COSTUME_MID && sd->equip_index[EQI_COSTUME_LOW] == idx) + continue; + if (j == EQI_COSTUME_TOP && (sd->equip_index[EQI_COSTUME_MID] == idx || sd->equip_index[EQI_COSTUME_LOW] == idx)) continue; - if(position && !(sd->status.inventory[idx].equip & position)) + if (position == -3 && !itemdb_is_shadowequip(sd->status.inventory[idx].equip)) + continue; + else if (position == -2 && !itemdb_is_costumeequip(sd->status.inventory[idx].equip)) + continue; + else if (position == -1 && (itemdb_is_costumeequip(sd->status.inventory[idx].equip) || itemdb_is_shadowequip(sd->status.inventory[idx].equip))) + continue; + else if (position && !(sd->status.inventory[idx].equip & position)) continue; final_refine = cap_value(sd->status.inventory[idx].refine + refine_level, 0, MAX_REFINE); if (sd->status.inventory[idx].refine != final_refine) { sd->status.inventory[idx].refine = final_refine; current_position = sd->status.inventory[idx].equip; - pc->unequipitem(sd, idx, PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE); + pc->unequipitem(sd, idx, PCUNEQUIPITEM_RECALC | PCUNEQUIPITEM_FORCE); clif->refine(fd, 0, idx, sd->status.inventory[idx].refine); clif->delitem(sd, idx, 1, DELITEM_MATERIALCHANGE); clif->additem(sd, idx, 1, 0); @@ -2289,11 +2332,11 @@ ACMD(refine) } if (count == 0) - clif->message(fd, msg_fd(fd,166)); // No item has been refined. + clif->message(fd, msg_fd(fd, 166)); // No item has been refined. else if (count == 1) - clif->message(fd, msg_fd(fd,167)); // 1 item has been refined. + clif->message(fd, msg_fd(fd, 167)); // 1 item has been refined. else { - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,168), count); // %d items have been refined. + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 168), count); // %d items have been refined. clif->message(fd, atcmd_output); } @@ -2861,7 +2904,7 @@ ACMD(recall) return false; } - if ((pl_sd=map->nick2sd(message)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) { + if ((pl_sd=map->nick2sd(message, true)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) { clif->message(fd, msg_fd(fd,3)); // Character not found. return false; } @@ -3186,7 +3229,7 @@ ACMD(kick) return false; } - if ((pl_sd=map->nick2sd(message)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) { + if ((pl_sd=map->nick2sd(message, true)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) { clif->message(fd, msg_fd(fd,3)); // Character not found. return false; } @@ -3516,7 +3559,7 @@ ACMD(idsearch) safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,77), item_name); // Search results for '%s' (name: id): clif->message(fd, atcmd_output); - match = itemdb->search_name_array(item_array, MAX_SEARCH, item_name, 0); + match = itemdb->search_name_array(item_array, MAX_SEARCH, item_name, IT_SEARCH_NAME_PARTIAL); if (match > MAX_SEARCH) { safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,269), MAX_SEARCH, match); clif->message(fd, atcmd_output); @@ -4321,7 +4364,7 @@ ACMD(nuke) return false; } - if ((pl_sd = map->nick2sd(atcmd_player_name)) != NULL) { + if ((pl_sd = map->nick2sd(atcmd_player_name, true)) != NULL) { if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // you can kill only lower or same GM level skill->castend_nodamage_id(&pl_sd->bl, &pl_sd->bl, NPC_SELFDESTRUCTION, 99, timer->gettick(), 0); clif->message(fd, msg_fd(fd,109)); // Player has been nuked! @@ -4464,6 +4507,38 @@ ACMD(unloadnpc) return true; } +/// Unload existing NPC within the NPC file and reload it. +/// Usage: @reloadnpc npc/sample_npc.txt +ACMD(reloadnpc) +{ + if (!*message) { + clif->message(fd, msg_fd(fd, 1385)); // Usage: @unloadnpcfile <file name> + return false; + } else if (npc->unloadfile(message) == true) { + clif->message(fd, msg_fd(fd, 1386)); // File unloaded. Be aware that mapflags and monsters spawned directly are not removed. + + FILE *fp = fopen(message, "r"); + // check if script file exists + if (fp == NULL) { + clif->message(fd, msg_fd(fd, 261)); + return false; + } + fclose(fp); + + // add to list of script sources and run it + npc->addsrcfile(message); + npc->parsesrcfile(message, true); + npc->read_event_script(); + + clif->message(fd, msg_fd(fd, 262)); + } else { + clif->message(fd, msg_fd(fd, 1387)); // File not found. + return false; + } + + return true; +} + /*========================================== * time in txt for time command (by [Yor]) *------------------------------------------*/ @@ -4609,7 +4684,7 @@ ACMD(jail) return false; } - if ((pl_sd = map->nick2sd(atcmd_player_name)) == NULL) { + if ((pl_sd = map->nick2sd(atcmd_player_name, true)) == NULL) { clif->message(fd, msg_fd(fd,3)); // Character not found. return false; } @@ -4661,7 +4736,7 @@ ACMD(unjail) return false; } - if ((pl_sd = map->nick2sd(atcmd_player_name)) == NULL) { + if ((pl_sd = map->nick2sd(atcmd_player_name, true)) == NULL) { clif->message(fd, msg_fd(fd,3)); // Character not found. return false; } @@ -4740,7 +4815,7 @@ ACMD(jailfor) return false; } - if ((pl_sd = map->nick2sd(atcmd_player_name)) == NULL) { + if ((pl_sd = map->nick2sd(atcmd_player_name, true)) == NULL) { clif->message(fd, msg_fd(fd,3)); // Character not found. return false; } @@ -5052,7 +5127,7 @@ ACMD(broadcast) } safesnprintf(atcmd_output, sizeof(atcmd_output), "%s: %s", sd->status.name, message); - intif->broadcast(atcmd_output, (int)strlen(atcmd_output) + 1, BC_DEFAULT); + clif->broadcast(NULL, atcmd_output, (int)strlen(atcmd_output) + 1, BC_DEFAULT, ALL_CLIENT); return true; } @@ -5271,7 +5346,7 @@ ACMD(follow) return true; } - if ((pl_sd = map->nick2sd(message)) == NULL) { + if ((pl_sd = map->nick2sd(message, true)) == NULL) { clif->message(fd, msg_fd(fd,3)); // Character not found. return false; } @@ -5294,7 +5369,6 @@ ACMD(follow) ACMD(dropall) { int type = -1; - int count = 0; if (message[0] != '\0') { type = atoi(message); @@ -5305,25 +5379,32 @@ ACMD(dropall) } } + int count = 0, count_skipped = 0; for (int i = 0; i < sd->status.inventorySize; i++) { - if (sd->status.inventory[i].amount) { + if (sd->status.inventory[i].amount > 0) { struct item_data *item_data = itemdb->exists(sd->status.inventory[i].nameid); if (item_data == NULL) { ShowWarning("Non-existant item %d on dropall list (account_id: %d, char_id: %d)\n", sd->status.inventory[i].nameid, sd->status.account_id, sd->status.char_id); continue; } + if (!pc->candrop(sd, &sd->status.inventory[i])) continue; + if (type == -1 || type == item_data->type) { if (sd->status.inventory[i].equip != 0) pc->unequipitem(sd, i, PCUNEQUIPITEM_RECALC | PCUNEQUIPITEM_FORCE); - count += sd->status.inventory[i].amount; - pc->dropitem(sd, i, sd->status.inventory[i].amount); + + int amount = sd->status.inventory[i].amount; + if (pc->dropitem(sd, i, amount) != 0) + count += amount; + else + count_skipped += amount; } } } - sprintf(atcmd_output, msg_fd(fd, 1502), count); // %d items are dropped! + sprintf(atcmd_output, msg_fd(fd, 1502), count, count_skipped); // %d items are dropped (%d skipped)! clif->message(fd, atcmd_output); return true; } @@ -5521,7 +5602,7 @@ ACMD(useskill) if (!strcmp(target,"self")) pl_sd = sd; //quick keyword - else if ((pl_sd = map->nick2sd(target)) == NULL) { + else if ((pl_sd = map->nick2sd(target, true)) == NULL) { clif->message(fd, msg_fd(fd,3)); // Character not found. return false; } @@ -5589,7 +5670,7 @@ ACMD(skilltree) return false; } - if ( (pl_sd = map->nick2sd(target)) == NULL ) { + if ( (pl_sd = map->nick2sd(target, true)) == NULL ) { clif->message(fd, msg_fd(fd,3)); // Character not found. return false; } @@ -5659,7 +5740,7 @@ ACMD(marry) return false; } - if ((pl_sd = map->nick2sd(player_name)) == NULL) { + if ((pl_sd = map->nick2sd(player_name, true)) == NULL) { clif->message(fd, msg_fd(fd,3)); return false; } @@ -5789,7 +5870,7 @@ ACMD(changegm) return false; } - if ((pl_sd=map->nick2sd(message)) == NULL || pl_sd->status.guild_id != sd->status.guild_id) { + if ((pl_sd=map->nick2sd(message, true)) == NULL || pl_sd->status.guild_id != sd->status.guild_id) { clif->message(fd, msg_fd(fd,1184)); // Target character must be online and be a guild member. return false; } @@ -5810,7 +5891,7 @@ ACMD(changeleader) return false; } - if (party->changeleader(sd, map->nick2sd(message))) + if (party->changeleader(sd, map->nick2sd(message, true))) return true; return false; } @@ -6274,7 +6355,7 @@ ACMD(mobsearch) } if (mob_id == atoi(mob_name)) { strcpy(mob_name,mob->db(mob_id)->jname); // DEFAULT_MOB_JNAME - //strcpy(mob_name,mob_db(mob_id)->name); // DEFAULT_MOB_NAME + //strcpy(mob_name,mob->db(mob_id)->name); // DEFAULT_MOB_NAME } snprintf(atcmd_output, sizeof atcmd_output, msg_fd(fd,1220), mob_name, mapindex_id2name(sd->mapindex)); // Mob Search... %s %s @@ -6576,7 +6657,7 @@ ACMD(trade) return false; } - if ((pl_sd = map->nick2sd(message)) == NULL) { + if ((pl_sd = map->nick2sd(message, true)) == NULL) { clif->message(fd, msg_fd(fd,3)); // Character not found. return false; } @@ -6620,7 +6701,7 @@ ACMD(unmute) return false; } - if ((pl_sd = map->nick2sd(message)) == NULL) { + if ((pl_sd = map->nick2sd(message, true)) == NULL) { clif->message(fd, msg_fd(fd,3)); // Character not found. return false; } @@ -6675,6 +6756,18 @@ ACMD(changesex) return true; } +ACMD(changecharsex) +{ + int i; + + pc->resetskill(sd, PCRESETSKILL_CHSEX); + // to avoid any problem with equipment and invalid sex, equipment is unequipped. + for (i=0; i<EQI_MAX; i++) + if (sd->equip_index[i] >= 0) pc->unequipitem(sd, sd->equip_index[i], PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE); + chrif->changesex(sd, false); + return true; +} + /*================================================ * @mute - Mutes a player for a set amount of time *------------------------------------------------*/ @@ -6688,7 +6781,7 @@ ACMD(mute) return false; } - if ((pl_sd = map->nick2sd(atcmd_player_name)) == NULL) { + if ((pl_sd = map->nick2sd(atcmd_player_name, true)) == NULL) { clif->message(fd, msg_fd(fd,3)); // Character not found. return false; } @@ -6720,6 +6813,9 @@ ACMD(mute) *------------------------------------------*/ ACMD(refresh) { + if (sd->npc_id > 0) + return false; + clif->refresh(sd); return true; } @@ -6731,29 +6827,41 @@ ACMD(refreshall) iter = mapit_getallusers(); for (iter_sd = BL_UCAST(BL_PC, mapit->first(iter)); mapit->exists(iter); iter_sd = BL_UCAST(BL_PC, mapit->next(iter))) - clif->refresh(iter_sd); + if (iter_sd->npc_id <= 0) + clif->refresh(iter_sd); mapit->free(iter); return true; } /*========================================== - * @identify + * @identify / @identifyall * => GM's magnifier. *------------------------------------------*/ ACMD(identify) { int num = 0; + bool identifyall = (strcmpi(info->command, "identifyall") == 0); - for (int i = 0; i < sd->status.inventorySize; i++) { - if(sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].identify!=1){ - num++; + if (!identifyall) { + for (int i = 0; i < sd->status.inventorySize; i++) { + if (sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].identify != 1) { + num++; + } } - } - if (num > 0) { - clif->item_identify_list(sd); } else { - clif->message(fd,msg_fd(fd,1238)); // There are no items to appraise. + for (int i = 0; i < sd->status.inventorySize; i++) { + if (sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].identify != 1) { + skill->identify(sd, i); + num++; + } + } } + + if (num == 0) + clif->message(fd,msg_fd(fd,1238)); // There are no items to appraise. + else if (!identifyall) + clif->item_identify_list(sd); + return true; } @@ -6970,7 +7078,7 @@ ACMD(showmobs) if (mob_id == atoi(mob_name)) { strcpy(mob_name,mob->db(mob_id)->jname); // DEFAULT_MOB_JNAME - //strcpy(mob_name,mob_db(mob_id)->name); // DEFAULT_MOB_NAME + //strcpy(mob_name,mob->db(mob_id)->name); // DEFAULT_MOB_NAME } snprintf(atcmd_output, sizeof atcmd_output, msg_fd(fd,1252), // Mob Search... %s %s @@ -7351,7 +7459,7 @@ ACMD(iteminfo) return false; } if ((item_array[0] = itemdb->exists(atoi(message))) == NULL) - count = itemdb->search_name_array(item_array, MAX_SEARCH, message, 0); + count = itemdb->search_name_array(item_array, MAX_SEARCH, message, IT_SEARCH_NAME_PARTIAL); if (!count) { clif->message(fd, msg_fd(fd,19)); // Invalid item ID or name. @@ -7402,7 +7510,7 @@ ACMD(whodrops) return false; } if ((item_array[0] = itemdb->exists(atoi(message))) == NULL) - count = itemdb->search_name_array(item_array, MAX_SEARCH, message, 0); + count = itemdb->search_name_array(item_array, MAX_SEARCH, message, IT_SEARCH_NAME_PARTIAL); if (!count) { clif->message(fd, msg_fd(fd,19)); // Invalid item ID or name. @@ -7883,7 +7991,7 @@ ACMD(showdelay) ACMD(invite) { unsigned int did = sd->duel_group; - struct map_session_data *target_sd = map->nick2sd(message); + struct map_session_data *target_sd = map->nick2sd(message, true); if (did == 0) { @@ -7956,7 +8064,7 @@ ACMD(duel) } duel->create(sd, maxpl); } else { - struct map_session_data *target_sd = map->nick2sd(message); + struct map_session_data *target_sd = map->nick2sd(message, true); if (target_sd != NULL) { unsigned int newduel; if ((newduel = duel->create(sd, 2)) != -1) { @@ -8101,7 +8209,7 @@ ACMD(clone) return false; } - if ((pl_sd=map->nick2sd(message)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) { + if ((pl_sd=map->nick2sd(message, true)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) { clif->message(fd, msg_fd(fd,3)); // Character not found. return false; } @@ -8175,7 +8283,7 @@ ACMD(request) } safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,278), message); // (@request): %s - intif->wis_message_to_gm(sd->status.name, PC_PERM_RECEIVE_REQUESTS, atcmd_output); + pc->wis_message_to_gm(sd->status.name, PC_PERM_RECEIVE_REQUESTS, atcmd_output); clif_disp_onlyself(sd, atcmd_output); clif->message(sd->fd,msg_fd(fd,279)); // @request sent. return true; @@ -9219,7 +9327,7 @@ ACMD(channel) return false; } - if (sub4[0] == '\0' || (pl_sd = map->nick2sd(sub4)) == NULL) { + if (sub4[0] == '\0' || (pl_sd = map->nick2sd(sub4, true)) == NULL) { safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1434), sub4);// Player '%s' was not found clif->message(fd, atcmd_output); return false; @@ -9266,7 +9374,7 @@ ACMD(channel) clif->message(fd, atcmd_output); return false; } - if (sub4[0] == '\0' || (pl_sd = map->nick2sd(sub4)) == NULL) { + if (sub4[0] == '\0' || (pl_sd = map->nick2sd(sub4, true)) == NULL) { safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1434), sub4);// Player '%s' was not found clif->message(fd, atcmd_output); return false; @@ -10025,10 +10133,12 @@ static void atcommand_basecommands(void) ACMD_DEF(clearweather), ACMD_DEF(uptime), ACMD_DEF(changesex), + ACMD_DEF(changecharsex), ACMD_DEF(mute), ACMD_DEF(refresh), ACMD_DEF(refreshall), ACMD_DEF(identify), + ACMD_DEF2("identifyall", identify), ACMD_DEF(misceffect), ACMD_DEF(mobsearch), ACMD_DEF(cleanmap), @@ -10118,6 +10228,7 @@ static void atcommand_basecommands(void) ACMD_DEF(addperm), ACMD_DEF2("rmvperm", addperm), ACMD_DEF(unloadnpcfile), + ACMD_DEF(reloadnpc), ACMD_DEF(cart), ACMD_DEF(cashmount), ACMD_DEF(join), @@ -10358,7 +10469,7 @@ static bool atcommand_exec(const int fd, struct map_session_data *sd, const char return true; } - ssd = map->nick2sd(charname); + ssd = map->nick2sd(charname, true); if (ssd == NULL) { sprintf(output, msg_fd(fd,1389), command); // %s failed. Player not found. clif->message(fd, output); diff --git a/src/map/atcommand.h b/src/map/atcommand.h index 4fbf6b93a..f1da2760a 100644 --- a/src/map/atcommand.h +++ b/src/map/atcommand.h @@ -41,7 +41,7 @@ struct config_setting_t; * Defines **/ #define ATCOMMAND_LENGTH 50 -#define MAX_MSG 1503 +#define MAX_MSG 1516 #define msg_txt(idx) atcommand->msg(idx) #define msg_sd(sd,msg_number) atcommand->msgsd((sd),(msg_number)) #define msg_fd(fd,msg_number) atcommand->msgfd((fd),(msg_number)) diff --git a/src/map/battle.c b/src/map/battle.c index c40c3afac..726547c66 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3467,11 +3467,6 @@ static int64 battle_calc_gvg_damage(struct block_list *src, struct block_list *b case NC_SELFDESTRUCTION: break; default: - /* Uncomment if you want god-mode Emperiums at 100 defense. [Kisuka] - if (md && md->guardian_data) { - damage -= damage * (md->guardian_data->castle->defense/100) * battle_config.castle_defense_rate/100; - } - */ break; } return damage; @@ -6321,6 +6316,18 @@ static enum damage_lv battle_weapon_attack(struct block_list *src, struct block_ if (sd && sd->state.arrow_atk) //Consume arrow. battle->consume_ammo(sd, 0, 0); + if (target->type == BL_MOB) { + struct mob_data *md = BL_CAST(BL_MOB, target); + if (md != NULL) { + if (md->db->dmg_taken_rate != 100) { + if (wd.damage > 0) + wd.damage = apply_percentrate64(wd.damage, md->db->dmg_taken_rate, 100); + if (wd.damage2 > 0) + wd.damage2 = apply_percentrate64(wd.damage2, md->db->dmg_taken_rate, 100); + } + } + } + damage = wd.damage + wd.damage2; if( damage > 0 && src != target ) { if( sc && sc->data[SC_DUPLELIGHT] && (wd.flag&BF_SHORT) && rnd()%100 <= 10+2*sc->data[SC_DUPLELIGHT]->val1 ){ @@ -7176,7 +7183,6 @@ static const struct battle_data { { "skill_removetrap_type", &battle_config.skill_removetrap_type, 0, 0, 1, }, { "disp_experience", &battle_config.disp_experience, 0, 0, 1, }, { "disp_zeny", &battle_config.disp_zeny, 0, 0, 1, }, - { "castle_defense_rate", &battle_config.castle_defense_rate, 100, 0, 100, }, { "bone_drop", &battle_config.bone_drop, 0, 0, 2, }, { "buyer_name", &battle_config.buyer_name, 1, 0, 1, }, { "skill_wall_check", &battle_config.skill_wall_check, 1, 0, 1, }, @@ -7436,6 +7442,8 @@ static const struct battle_data { { "critical_max_limit", &battle_config.critical_max, SHRT_MAX, 1, INT_MAX, }, { "hit_min_limit", &battle_config.hit_min, 1, 1, INT_MAX, }, { "hit_max_limit", &battle_config.hit_max, SHRT_MAX, 1, INT_MAX, }, + { "autoloot_adjust", &battle_config.autoloot_adjust, 0, 0, 1, }, + { "hom_bonus_exp_from_master", &battle_config.hom_bonus_exp_from_master, 10, 0, 100, }, }; static bool battle_set_value_sub(int index, int value) diff --git a/src/map/battle.h b/src/map/battle.h index 0ff5135d8..e9bc6b258 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -103,8 +103,8 @@ enum e_battle_check_target { //New definitions [Skotlex] enum battle_dmg_type { BDT_NORMAL = 0, // Normal attack //BDT_PICKUP = 1, // Pick up item - //BDT_SITDOWN = 2, // Sit down - //BDT_STANDUP = 3, // Stand up + BDT_SITDOWN = 2, // Sit down + BDT_STANDUP = 3, // Stand up BDT_ENDURE = 4, // Damage (endure) BDT_SPLASH = 5, // Splash BDT_SKILL = 6, // Skill @@ -342,7 +342,6 @@ struct Battle_Config { int skill_removetrap_type; int disp_experience; int disp_zeny; - int castle_defense_rate; int backstab_bow_penalty; int hp_rate; int sp_rate; @@ -478,6 +477,7 @@ struct Battle_Config { int client_emblem_max_blank_percent; int hom_max_level; int hom_S_max_level; + int hom_bonus_exp_from_master; // [BattleGround Settings] int bg_update_interval; @@ -605,6 +605,8 @@ struct Battle_Config { int critical_max; int hit_min; int hit_max; + + int autoloot_adjust; }; /* criteria for battle_config.idletime_critera */ diff --git a/src/map/battleground.c b/src/map/battleground.c index c2772a2b9..e0d2e8003 100644 --- a/src/map/battleground.c +++ b/src/map/battleground.c @@ -169,13 +169,13 @@ static int bg_team_leave(struct map_session_data *sd, enum bg_team_leave_type fl switch (flag) { default: case BGTL_QUIT: - sprintf(output, "Server : %s has quit the game...", sd->status.name); + sprintf(output, msg_txt(464), sd->status.name); // Server : %s has quit the game... break; case BGTL_LEFT: - sprintf(output, "Server : %s is leaving the battlefield...", sd->status.name); + sprintf(output, msg_txt(454), sd->status.name); // Server : %s is leaving the battlefield... break; case BGTL_AFK: - sprintf(output, "Server : %s has been afk-kicked from the battlefield...", sd->status.name); + sprintf(output, msg_txt(455), sd->status.name); // Server : %s has been afk-kicked from the battlefield... break; } clif->bg_message(bgd, 0, "Server", output); @@ -860,9 +860,9 @@ static enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, str if ( ( tick = pc_readglobalreg(sd, script->add_variable(bg->gdelay_var)) ) && tsec < tick ) { char response[100]; if( (tick-tsec) > 60 ) - sprintf(response, "You are a deserter! Wait %u minute(s) before you can apply again", (tick - tsec) / 60); + sprintf(response, msg_sd(sd, 456), (tick - tsec) / 60); // You are a deserter! Wait %u minute(s) before you can apply again else - sprintf(response, "You are a deserter! Wait %u seconds before you can apply again", (tick - tsec)); + sprintf(response, msg_sd(sd, 457), (tick - tsec)); // You are a deserter! Wait %u seconds before you can apply again clif->messagecolor_self(sd->fd, COLOR_RED, response); return BGQA_FAIL_DESERTER; } @@ -870,9 +870,9 @@ static enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, str if ( ( tick = pc_readglobalreg(sd, script->add_variable(arena->delay_var)) ) && tsec < tick ) { char response[100]; if( (tick-tsec) > 60 ) - sprintf(response, "You can't reapply to this arena so fast. Apply to the different arena or wait %u minute(s)", (tick - tsec) / 60); + sprintf(response, msg_sd(sd, 458), (tick - tsec) / 60); // You can't reapply to this arena so fast. Apply to the different arena or wait %u minute(s) else - sprintf(response, "You can't reapply to this arena so fast. Apply to the different arena or wait %u seconds", (tick - tsec)); + sprintf(response, msg_sd(sd, 459), (tick - tsec)); // You can't reapply to this arena so fast. Apply to the different arena or wait %u seconds clif->messagecolor_self(sd->fd, COLOR_RED, response); return BGQA_FAIL_COOLDOWN; } @@ -894,9 +894,9 @@ static enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, str if ( count < arena->min_team_players ) { char response[121]; if( count != sd->guild->connect_member && sd->guild->connect_member >= arena->min_team_players ) - sprintf(response, "Can't apply: not enough members in your team/guild that have not entered the queue in individual mode, minimum is %d", arena->min_team_players); + sprintf(response, msg_sd(sd, 460), arena->min_team_players); // Can't apply: not enough members in your team/guild that have not entered the queue in individual mode, minimum is %d else - sprintf(response, "Can't apply: not enough members in your team/guild, minimum is %d", arena->min_team_players); + sprintf(response, msg_sd(sd, 461), arena->min_team_players); // Can't apply: not enough members in your team/guild, minimum is %d clif->messagecolor_self(sd->fd, COLOR_RED, response); return BGQA_FAIL_TEAM_COUNT; } @@ -926,9 +926,9 @@ static enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, str if( count < arena->min_team_players ) { char response[121]; if( count != p->party.count && p->party.count >= arena->min_team_players ) - sprintf(response, "Can't apply: not enough members in your team/party that have not entered the queue in individual mode, minimum is %d", arena->min_team_players); + sprintf(response, msg_sd(sd, 462), arena->min_team_players); // Can't apply: not enough members in your team/party that have not entered the queue in individual mode, minimum is %d else - sprintf(response, "Can't apply: not enough members in your team/party, minimum is %d",arena->min_team_players); + sprintf(response, msg_sd(sd, 463), arena->min_team_players); // Can't apply: not enough members in your team/party, minimum is %d clif->messagecolor_self(sd->fd, COLOR_RED, response); return BGQA_FAIL_TEAM_COUNT; } diff --git a/src/map/channel.c b/src/map/channel.c index e27e9fb0b..c87e425eb 100644 --- a/src/map/channel.c +++ b/src/map/channel.c @@ -324,7 +324,7 @@ static void channel_join_sub(struct channel_data *chan, struct map_session_data if (!stealth && (chan->options&HCS_OPT_ANNOUNCE_JOIN)) { char message[60]; - sprintf(message, "#%s '%s' joined",chan->name,sd->status.name); + sprintf(message, msg_txt(897), chan->name, sd->status.name); // #%s '%s' joined clif->channel_msg(chan,sd,message); } @@ -442,7 +442,7 @@ static void channel_leave(struct channel_data *chan, struct map_session_data *sd channel->delete(chan); } else if (!channel->config->closing && (chan->options & HCS_OPT_ANNOUNCE_JOIN)) { char message[60]; - sprintf(message, "#%s '%s' left",chan->name,sd->status.name); + sprintf(message, msg_txt(898), chan->name, sd->status.name); // #%s '%s' left clif->channel_msg(chan,sd,message); } diff --git a/src/map/clif.c b/src/map/clif.c index 4e8653783..5c6bc39d3 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -92,9 +92,6 @@ static struct packet_itemlist_equip itemlist_equip; static struct ZC_STORE_ITEMLIST_NORMAL storelist_normal; static struct ZC_STORE_ITEMLIST_EQUIP storelist_equip; static struct packet_viewequip_ack viewequip_list; -#if PACKETVER >= 20131223 -static struct packet_npc_market_result_ack npcmarket_result; -#endif // temporart buffer for send big packets char packet_buf[0xffff]; //#define DUMP_UNKNOWN_PACKET @@ -1649,7 +1646,9 @@ static void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int p.level = hd->homunculus.level; p.hunger = hd->homunculus.hunger; p.intimacy = hd->homunculus.intimacy / 100; +#if !(PACKETVER_MAIN_NUM >= 20190619 || PACKETVER_RE_NUM >= 20190605 || PACKETVER_ZERO_NUM >= 20190626) p.itemId = 0; // equip id +#endif #ifdef RENEWAL p.atk2 = cap_value(hstatus->rhw.atk2, 0, INT16_MAX); #else @@ -3909,20 +3908,16 @@ static void clif_arrow_fail(struct map_session_data *sd, int type) /// 01ad <packet len>.W { <name id>.W }* static void clif_arrow_create_list(struct map_session_data *sd) { - int i, c; - int fd; - int len; - struct PACKET_ZC_MAKINGARROW_LIST *p; - nullpo_retv(sd); - fd = sd->fd; - len = MAX_SKILL_ARROW_DB * sizeof(struct PACKET_ZC_MAKINGARROW_LIST_sub) + sizeof(struct PACKET_ZC_MAKINGARROW_LIST); + int fd = sd->fd; + int len = MAX_SKILL_ARROW_DB * sizeof(struct PACKET_ZC_MAKINGARROW_LIST_sub) + sizeof(struct PACKET_ZC_MAKINGARROW_LIST); WFIFOHEAD(fd, len); - p = WFIFOP(fd, 0); - p->packetType = 0x1ad; + struct PACKET_ZC_MAKINGARROW_LIST *p = WFIFOP(fd, 0); + p->packetType = HEADER_ZC_MAKINGARROW_LIST; - for (i = 0, c = 0; i < MAX_SKILL_ARROW_DB; i++) { + int c = 0; + for (int i = 0; i < MAX_SKILL_ARROW_DB; i++) { int j; if (skill->dbs->arrow_db[i].nameid > 0 && (j = pc->search_inventory(sd, skill->dbs->arrow_db[i].nameid)) != INDEX_NOT_FOUND @@ -3953,17 +3948,16 @@ static void clif_arrow_create_list(struct map_session_data *sd) /// 1 = success static void clif_statusupack(struct map_session_data *sd, int type, int ok, int val) { - int fd; - nullpo_retv(sd); + int fd = sd->fd; - fd=sd->fd; - WFIFOHEAD(fd,packet_len(0xbc)); - WFIFOW(fd,0)=0xbc; - WFIFOW(fd,2)=type; - WFIFOB(fd,4)=ok; - WFIFOB(fd,5)=cap_value(val,0,UINT8_MAX); - WFIFOSET(fd,packet_len(0xbc)); + WFIFOHEAD(fd, sizeof(struct PACKET_ZC_STATUS_CHANGE_ACK)); + struct PACKET_ZC_STATUS_CHANGE_ACK *p = WFIFOP(fd, 0); + p->packetType = HEADER_ZC_STATUS_CHANGE_ACK; + p->sp = type; + p->ok = ok; + p->value = cap_value(val, 0, UINT8_MAX); + WFIFOSET(fd, sizeof(struct PACKET_ZC_STATUS_CHANGE_ACK)); } /// Notifies the client about the result of a request to equip an item (ZC_REQ_WEAR_EQUIP_ACK). @@ -4795,9 +4789,9 @@ static void clif_getareachar_unit(struct map_session_data *sd, struct block_list //Modifies the type of damage according to status changes [Skotlex] //Aegis data specifies that: 4 endure against single hit sources, 9 against multi-hit. -static inline int clif_calc_delay(int type, int div, int damage, int delay) +static inline enum battle_dmg_type clif_calc_delay(enum battle_dmg_type type, int div, int damage, int delay) { - return ( delay == 0 && damage > 0 ) ? ( div > 1 ? 9 : 4 ) : type; + return ( delay == 0 && damage > 0 ) ? ( div > 1 ? BDT_MULTIENDURE : BDT_ENDURE ) : type; } /*========================================== @@ -4828,7 +4822,7 @@ static int clif_calc_walkdelay(struct block_list *bl, int delay, int type, int d /// 08c8 <src ID>.L <dst ID>.L <server tick>.L <src speed>.L <dst speed>.L <damage>.L <IsSPDamage>.B <div>.W <type>.B <damage2>.L (ZC_NOTIFY_ACT2) /// type: @see enum battle_dmg_type /// for BDT_NORMAL: [ damage: total damage, div: amount of hits, damage2: assassin dual-wield damage ] -static int clif_damage(struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, unsigned char type, int64 in_damage2) +static int clif_damage(struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, enum battle_dmg_type type, int64 in_damage2) { struct packet_damage p; struct status_change *sc; @@ -5257,58 +5251,79 @@ static int clif_insight(struct block_list *bl, va_list ap) return 0; } +static void clif_playerSkillToPacket(struct map_session_data *sd, struct SKILLDATA *skillData, int skillId, int idx, bool newSkill) +{ + nullpo_retv(sd); + nullpo_retv(skillData); + Assert_retv(idx >= 0 && idx < MAX_SKILL_DB); + + int skill_lv = sd->status.skill[idx].lv; + skillData->id = skillId; + skillData->inf = skill->get_inf(skillId); + skillData->level = skill_lv; + if (skill_lv > 0) { + skillData->sp = skill->get_sp(skillId, skill_lv); + skillData->range2 = skill->get_range2(&sd->bl, skillId, skill_lv); + } else { + skillData->sp = 0; + skillData->range2 = 0; + } +#if PACKETVER_RE_NUM >= 20190807 + if (newSkill) + skillData->level2 = 0; + else + skillData->level2 = skill_lv; +#else + safestrncpy(skillData->name, skill->get_name(skillId), NAME_LENGTH); +#endif + if (sd->status.skill[idx].flag == SKILL_FLAG_PERMANENT) + skillData->upFlag = (skill_lv < skill->tree_get_max(skillId, sd->status.class)) ? 1 : 0; + else + skillData->upFlag = 0; +} + /// Updates whole skill tree (ZC_SKILLINFO_LIST). /// 010f <packet len>.W { <skill id>.W <type>.L <level>.W <sp cost>.W <attack range>.W <skill name>.24B <upgradable>.B }* static void clif_skillinfoblock(struct map_session_data *sd) { - int fd; - int i,len,id; - nullpo_retv(sd); - fd=sd->fd; - if (!fd) return; + int fd = sd->fd; + if (!fd) + return; - WFIFOHEAD(fd, MAX_SKILL_DB * 37 + 4); - WFIFOW(fd,0) = 0x10f; - for ( i = 0, len = 4; i < MAX_SKILL_DB; i++) { - if( (id = sd->status.skill[i].id) != 0 ) { - int level; + WFIFOHEAD(fd, sizeof(struct PACKET_ZC_SKILLINFO_LIST) + MAX_SKILL_DB * sizeof(struct SKILLDATA)); + struct PACKET_ZC_SKILLINFO_LIST *p = WFIFOP(fd, 0); + + p->packetType = HEADER_ZC_SKILLINFO_LIST; + int skillIndex = 0; + int len = sizeof(struct PACKET_ZC_SKILLINFO_LIST); + int i; + for (i = 0; i < MAX_SKILL_DB; i++) { + int id = sd->status.skill[i].id; + if (id != 0) { // workaround for bugreport:5348 - if (len + 37 > 8192) + if (len + sizeof(struct SKILLDATA) > 8192) break; - WFIFOW(fd, len) = id; - WFIFOL(fd, len + 2) = skill->get_inf(id); - level = sd->status.skill[i].lv; - WFIFOW(fd, len + 6) = level; - if (level) { - WFIFOW(fd, len + 8) = skill->get_sp(id, level); - WFIFOW(fd, len + 10)= skill->get_range2(&sd->bl, id, level); - } - else { - WFIFOW(fd, len + 8) = 0; - WFIFOW(fd, len + 10)= 0; - } - safestrncpy(WFIFOP(fd,len+12), skill->get_name(id), NAME_LENGTH); - if(sd->status.skill[i].flag == SKILL_FLAG_PERMANENT) - WFIFOB(fd,len+36) = (sd->status.skill[i].lv < skill->tree_get_max(id, sd->status.class))? 1:0; - else - WFIFOB(fd,len+36) = 0; - len += 37; + clif->playerSkillToPacket(sd, &p->skills[skillIndex], id, i, false); + len += sizeof(struct SKILLDATA); + skillIndex++; } } - WFIFOW(fd,2)=len; - WFIFOSET(fd,len); + p->packetLength = len; + WFIFOSET(fd, len); // workaround for bugreport:5348; send the remaining skills one by one to bypass packet size limit - for ( ; i < MAX_SKILL_DB; i++) { - if( (id = sd->status.skill[i].id) != 0 ) { + for (; i < MAX_SKILL_DB; i++) { + int id = sd->status.skill[i].id; + if (id != 0) { clif->addskill(sd, id); clif->skillinfo(sd, id, 0); } } } + /** * Server tells client 'sd' to add skill of id 'id' to it's skill tree (e.g. with Ice Falcion item) **/ @@ -5317,36 +5332,21 @@ static void clif_skillinfoblock(struct map_session_data *sd) /// 0111 <skill id>.W <type>.L <level>.W <sp cost>.W <attack range>.W <skill name>.24B <upgradable>.B static void clif_addskill(struct map_session_data *sd, int id) { - int fd, skill_lv, idx = skill->get_index(id); - nullpo_retv(sd); - fd = sd->fd; - if (!fd) return; + int fd = sd->fd; + if (!fd) + return; + int idx = skill->get_index(id); if (sd->status.skill[idx].id <= 0) return; - skill_lv = sd->status.skill[idx].lv; - - WFIFOHEAD(fd, packet_len(0x111)); - WFIFOW(fd,0) = 0x111; - WFIFOW(fd,2) = id; - WFIFOL(fd,4) = skill->get_inf(id); - WFIFOW(fd,8) = skill_lv; - if (skill_lv > 0) { - WFIFOW(fd,10) = skill->get_sp(id, skill_lv); - WFIFOW(fd,12) = skill->get_range2(&sd->bl, id, skill_lv); - } else { - WFIFOW(fd,10) = 0; - WFIFOW(fd,12) = 0; - } - safestrncpy(WFIFOP(fd,14), skill->get_name(id), NAME_LENGTH); - if (sd->status.skill[idx].flag == SKILL_FLAG_PERMANENT) - WFIFOB(fd,38) = (skill_lv < skill->tree_get_max(id, sd->status.class))? 1:0; - else - WFIFOB(fd,38) = 0; - WFIFOSET(fd,packet_len(0x111)); + WFIFOHEAD(fd, sizeof(struct PACKET_ZC_ADD_SKILL)); + struct PACKET_ZC_ADD_SKILL *p = WFIFOP(fd, 0); + p->packetType = HEADER_ZC_ADD_SKILL; + clif->playerSkillToPacket(sd, &p->skill, id, idx, true); + WFIFOSET(fd, sizeof(struct PACKET_ZC_ADD_SKILL)); } /// Deletes a skill from the skill tree (ZC_SKILLINFO_DELETE). @@ -5399,32 +5399,34 @@ static void clif_skillup(struct map_session_data *sd, uint16 skill_id, int skill /// 07e1 <skill id>.W <type>.L <level>.W <sp cost>.W <attack range>.W <upgradable>.B static void clif_skillinfo(struct map_session_data *sd, int skill_id, int inf) { + nullpo_retv(sd); + const int fd = sd->fd; int idx = skill->get_index(skill_id); - int skill_lv; - - nullpo_retv(sd); Assert_retv(idx >= 0 && idx < MAX_SKILL_DB); - skill_lv = sd->status.skill[idx].lv; - - WFIFOHEAD(fd,packet_len(0x7e1)); - WFIFOW(fd,0) = 0x7e1; - WFIFOW(fd,2) = skill_id; - WFIFOL(fd,4) = inf?inf:skill->get_inf(skill_id); - WFIFOW(fd,8) = skill_lv; + WFIFOHEAD(fd, sizeof(struct PACKET_ZC_SKILLINFO_UPDATE2)); + struct PACKET_ZC_SKILLINFO_UPDATE2 *p = WFIFOP(fd, 0); + p->packetType = HEADER_ZC_SKILLINFO_UPDATE2; + int skill_lv = sd->status.skill[idx].lv; + p->id = skill_id; + p->inf = skill->get_inf(skill_id); + p->level = skill_lv; if (skill_lv > 0) { - WFIFOW(fd,10) = skill->get_sp(skill_id, skill_lv); - WFIFOW(fd,12) = skill->get_range2(&sd->bl, skill_id, skill_lv); + p->sp = skill->get_sp(skill_id, skill_lv); + p->range2 = skill->get_range2(&sd->bl, skill_id, skill_lv); } else { - WFIFOW(fd,10) = 0; - WFIFOW(fd,12) = 0; + p->sp = 0; + p->range2 = 0; } +#if PACKETVER_RE_NUM >= 20190807 + p->level2 = skill_lv; +#endif if (sd->status.skill[idx].flag == SKILL_FLAG_PERMANENT) - WFIFOB(fd,14) = (skill_lv < skill->tree_get_max(skill_id, sd->status.class))? 1:0; + p->upFlag = (skill_lv < skill->tree_get_max(skill_id, sd->status.class)) ? 1 : 0; else - WFIFOB(fd,14) = 0; - WFIFOSET(fd,packet_len(0x7e1)); + p->upFlag = 0; + WFIFOSET(fd, sizeof(struct PACKET_ZC_SKILLINFO_UPDATE2)); } /// Notifies clients in area, that an object is about to use a skill. @@ -5571,7 +5573,7 @@ static void clif_skill_cooldown(struct map_session_data *sd, uint16 skill_id, un /// Skill attack effect and damage. /// 0114 <skill id>.W <src id>.L <dst id>.L <tick>.L <src delay>.L <dst delay>.L <damage>.W <level>.W <div>.W <type>.B (ZC_NOTIFY_SKILL) /// 01de <skill id>.W <src id>.L <dst id>.L <tick>.L <src delay>.L <dst delay>.L <damage>.L <level>.W <div>.W <type>.B (ZC_NOTIFY_SKILL2) -static int clif_skill_damage(struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int64 in_damage, int div, uint16 skill_id, uint16 skill_lv, int type) +static int clif_skill_damage(struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int64 in_damage, int div, uint16 skill_id, uint16 skill_lv, enum battle_dmg_type type) { unsigned char buf[64]; struct status_change *sc; @@ -5673,7 +5675,7 @@ static int clif_skill_damage(struct block_list *src, struct block_list *dst, int /// Ground skill attack effect and damage (ZC_NOTIFY_SKILL_POSITION). /// 0115 <skill id>.W <src id>.L <dst id>.L <tick>.L <src delay>.L <dst delay>.L <x>.W <y>.W <damage>.W <level>.W <div>.W <type>.B #if 0 -static int clif_skill_damage2(struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int damage, int div, uint16 skill_id, uint16 skill_lv, int type) +static int clif_skill_damage2(struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int damage, int div, uint16 skill_id, uint16 skill_lv, enum battle_dmg_type type) { unsigned char buf[64]; struct status_change *sc; @@ -5996,7 +5998,7 @@ static void clif_cooking_list(struct map_session_data *sd, int trigger, uint16 s len = sizeof(struct PACKET_ZC_MAKINGITEM_LIST) + MAX_SKILL_PRODUCE_DB * sizeof(struct PACKET_ZC_MAKINGITEM_LIST_sub); WFIFOHEAD(fd, len); p = WFIFOP(fd, 0); - p->packetType = 0x25a; + p->packetType = HEADER_ZC_MAKINGITEM_LIST; p->makeItem = list_type; // list type c = 0; @@ -6456,7 +6458,7 @@ static void clif_wis_message(int fd, const char *nick, const char *mes, int mes_ safestrncpy(WFIFOP(fd,28), mes, mes_len + 1); WFIFOSET(fd,WFIFOW(fd,2)); #else - ssd = map->nick2sd(nick); + ssd = map->nick2sd(nick, false); WFIFOHEAD(fd, mes_len + NAME_LENGTH + 9); WFIFOW(fd,0) = 0x97; @@ -8104,6 +8106,54 @@ static void clif_guild_allianceinfo(struct map_session_data *sd) WFIFOSET(fd,WFIFOW(fd,2)); } +static void clif_guild_castlelist(struct map_session_data *sd) +{ +#if PACKETVER_MAIN_NUM >= 20190731 || PACKETVER_RE_NUM >= 20190717 || PACKETVER_ZERO_NUM >= 20190814 + nullpo_retv(sd); + + struct guild *g = sd->guild; + if (g == NULL) + return; + + int castle_count = guild->checkcastles(g); + if (castle_count > 0) { + int len = sizeof(struct PACKET_ZC_GUILD_CASTLE_LIST) + castle_count; + struct PACKET_ZC_GUILD_CASTLE_LIST *p = aMalloc(len); + p->packetType = HEADER_ZC_GUILD_CASTLE_LIST; + p->packetLength = len; + + int i = 0; + struct DBIterator *iter = db_iterator(guild->castle_db); + for (struct guild_castle *gc = dbi_first(iter); dbi_exists(iter); gc = dbi_next(iter)) { + if (gc->guild_id == g->guild_id) { + p->castle_list[i] = gc->castle_id; + ++i; + } + } + dbi_destroy(iter); + + clif->send(p, len, &sd->bl, SELF); + aFree(p); + } +#endif +} + +static void clif_guild_castleinfo(struct map_session_data *sd, struct guild_castle *gc) +{ +#if PACKETVER_MAIN_NUM >= 20190731 || PACKETVER_RE_NUM >= 20190717 || PACKETVER_ZERO_NUM >= 20190814 + + nullpo_retv(sd); + nullpo_retv(gc); + + struct PACKET_ZC_CASTLE_INFO p = { 0 }; + p.packetType = HEADER_ZC_CASTLE_INFO; + p.castle_id = gc->castle_id; + p.economy = gc->economy; + p.defense = gc->defense; + clif->send(&p, sizeof(p), &sd->bl, SELF); +#endif +} + /// Guild member manager information (ZC_MEMBERMGR_INFO). /// 0154 <packet len>.W { <account>.L <char id>.L <hair style>.W <hair color>.W <gender>.W <class>.W <level>.W <contrib exp>.L <state>.L <position>.L <memo>.50B <name>.24B }* /// state: @@ -8687,14 +8737,14 @@ static void clif_emotion(struct block_list *bl, int type) /// 0191 <id>.L <contents>.80B static void clif_talkiebox(struct block_list *bl, const char *talkie) { - unsigned char buf[MESSAGE_SIZE+6]; nullpo_retv(bl); nullpo_retv(talkie); + struct PACKET_ZC_TALKBOX_CHATCONTENTS p; - WBUFW(buf,0) = 0x191; - WBUFL(buf,2) = bl->id; - safestrncpy(WBUFP(buf,6),talkie,MESSAGE_SIZE); - clif->send(buf,packet_len(0x191),bl,AREA); + p.PacketType = HEADER_ZC_TALKBOX_CHATCONTENTS; + p.aid = bl->id; + safestrncpy(&p.message[0], talkie, TALKBOX_MESSAGE_SIZE); + clif->send(&p, sizeof(struct PACKET_ZC_TALKBOX_CHATCONTENTS), bl, AREA); } /// Displays wedding effect centered on an object (ZC_CONGRATULATION). @@ -9296,9 +9346,6 @@ static void clif_pcname_ack(int fd, struct block_list *bl) packet.gid = bl->id; const struct map_session_data *ssd = BL_UCCAST(BL_PC, bl); - const struct party_data *p = NULL; - const struct guild *g = NULL; - int ps = -1; if (ssd->fakename[0] != '\0' && ssd->disguise != -1) { packet.packet_id = reqName; @@ -9324,9 +9371,12 @@ static void clif_pcname_ack(int fd, struct block_list *bl) #endif memcpy(packet.name, ssd->status.name, NAME_LENGTH); + const struct party_data *p = NULL; + int ps = -1; if (ssd->status.party_id != 0) { p = party->search(ssd->status.party_id); } + const struct guild *g = NULL; if (ssd->status.guild_id != 0) { if ((g = ssd->guild) != NULL) { int i; @@ -9349,6 +9399,12 @@ static void clif_pcname_ack(int fd, struct block_list *bl) memcpy(packet.guild_name, g->name,NAME_LENGTH); memcpy(packet.position_name, g->position[ps].name, NAME_LENGTH); } + else if (ssd->status.clan_id != 0) { + struct clan *c = clan->search(ssd->status.clan_id); + if (c != 0) { + memcpy(packet.position_name, c->name, NAME_LENGTH); + } + } } clif->send_selforarea(fd, bl, &packet, len); @@ -9482,7 +9538,8 @@ static void clif_mobname_normal_ack(int fd, struct block_list *bl) struct PACKET_ZC_ACK_REQNAME_TITLE packet = { 0 }; packet.packet_id = HEADER_ZC_ACK_REQNAME_TITLE; packet.gid = bl->id; - memcpy(packet.name, BL_UCCAST(BL_MOB, bl)->db->name, NAME_LENGTH); + const struct mob_data *md = BL_UCCAST(BL_MOB, bl); + memcpy(packet.name, md->name, NAME_LENGTH); #if PACKETVER_MAIN_NUM >= 20180207 || PACKETVER_RE_NUM >= 20171129 || PACKETVER_ZERO_NUM >= 20171130 struct unit_data *ud = unit->bl2ud(bl); if (ud != NULL) { @@ -10712,7 +10769,7 @@ static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) if( map->list[sd->bl.m].flag.allowks && !map_flag_ks(sd->bl.m) ) { char output[128]; - sprintf(output, "[ Kill Steal Protection Disabled. KS is allowed in this map ]"); + sprintf(output, "%s", msg_sd(sd, 893)); // [ Kill Steal Protection Disabled. KS is allowed in this map ] clif->broadcast(&sd->bl, output, (int)strlen(output) + 1, BC_BLUE, SELF); } @@ -10825,7 +10882,7 @@ static void clif_hotkeysAll_send(struct map_session_data *sd) { #ifdef HOTKEY_SAVING clif->hotkeys(sd, 0); -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 // send second tab only if data exists for (int i = MAX_HOTKEYS; i < MAX_HOTKEYS * 2; i++) { if (sd->status.hotkeys[i].type != 0 || sd->status.hotkeys[i].id != 0 || sd->status.hotkeys[i].lv != 0) { @@ -10854,7 +10911,7 @@ static void clif_hotkeys_send(struct map_session_data *sd, int tab) else p.rotate = sd->status.hotkey_rowshift2; #endif -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 p.tab = tab; #endif const int offset = tab * MAX_HOTKEYS; @@ -10879,7 +10936,7 @@ static void clif_parse_HotkeyRowShift1(int fd, struct map_session_data *sd) static void clif_parse_HotkeyRowShift2(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_HotkeyRowShift2(int fd, struct map_session_data *sd) { -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 const struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE2 *p = RFIFOP(fd, 0); if (p->tab == 0) sd->status.hotkey_rowshift = p->rowshift; @@ -10911,7 +10968,7 @@ static void clif_parse_Hotkey2(int fd, struct map_session_data *sd) __attribute_ static void clif_parse_Hotkey2(int fd, struct map_session_data *sd) { #ifdef HOTKEY_SAVING -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 const struct PACKET_CZ_SHORTCUT_KEY_CHANGE2 *p = RFIFOP(fd, 0); const unsigned short idx = p->index + p->tab * MAX_HOTKEYS; Assert_retv(idx < MAX_HOTKEYS_DB); @@ -10982,9 +11039,13 @@ static void clif_parse_progressbar(int fd, struct map_session_data *sd) __attrib /// 02f1 static void clif_parse_progressbar(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int npc_id = sd->progressbar.npc_id; + Assert_retv(npc_id != 0); - if( timer->gettick() < sd->progressbar.timeout && sd->st ) + if (timer->gettick() < sd->progressbar.timeout && sd->st) sd->st->state = END; sd->progressbar.timeout = sd->state.workinprogress = sd->progressbar.npc_id = 0; @@ -11009,7 +11070,7 @@ static void clif_parse_WalkToXY(int fd, struct map_session_data *sd) ; //You CAN walk on this OPT1 value. /*else if( sd->progressbar.npc_id ) clif->progressbar_abort(sd);*/ - else if (pc_cant_act(sd)) + else if (pc_cant_act(sd) || pc_isvending(sd)) return; if(sd->sc.data[SC_RUN] || sd->sc.data[SC_WUGDASH]) @@ -11089,13 +11150,13 @@ static void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd) sc = status->get_sc(bl); if (sc && sc->option&OPTION_INVISIBLE && !clif->isdisguised(bl) && bl->type != BL_NPC && //Skip hidden NPCs which can be seen using Maya Purple - pc_get_group_level(sd) < battle_config.hack_info_GM_level + !pc_has_permission(sd, PC_PERM_RECEIVE_HACK_INFO) ) { char gm_msg[256]; sprintf(gm_msg, "Hack on NameRequest: character '%s' (account: %d) requested the name of an invisible target (id: %d).\n", sd->status.name, sd->status.account_id, id); ShowWarning(gm_msg); // information is sent to all online GMs - intif->wis_message_to_gm(map->wisp_server_name, battle_config.hack_info_GM_level, gm_msg); + pc->wis_message_to_gm(map->wisp_server_name, PC_PERM_RECEIVE_HACK_INFO, gm_msg); return; } #endif // 0 @@ -11169,7 +11230,10 @@ static void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) timer->settick(sd->fontcolor_tid, td->tick+5000); } - color = channel->config->colors[sd->fontcolor - 1]; + int fontColor = sd->fontcolor - 1; + if (fontColor < 0 || fontColor >= channel->config->colors_count) + fontColor = 0; + color = channel->config->colors[fontColor]; WFIFOHEAD(fd, outlen + 12); WFIFOW(fd,0) = 0x2C1; WFIFOW(fd,2) = outlen + 12; @@ -11374,10 +11438,10 @@ static void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action return; } - if( pc_cant_act(sd) || pc_issit(sd) || sd->sc.option&OPTION_HIDE ) + if (pc_cant_act(sd) || pc_issit(sd) || sd->sc.option&OPTION_HIDE || pc_isvending(sd)) return; - if( sd->sc.option&OPTION_COSTUME ) + if (sd->sc.option & OPTION_COSTUME) return; if (!battle_config.sdelay_attack_enable && pc->checkskill(sd, SA_FREECAST) <= 0 && (skill->get_inf2(sd->ud.skill_id) & (INF2_FREE_CAST_REDUCED | INF2_FREE_CAST_NORMAL)) == 0) { @@ -11555,8 +11619,8 @@ static void clif_parse_WisMessage(int fd, struct map_session_data *sd) script->set_var(sd,output,(char *) split_data[i]); } - sprintf(output, "%s::OnWhisperGlobal", nd->exname); - npc->event(sd,output,0); // Calls the NPC label + safesnprintf(output, 255, "%s::OnWhisperGlobal", nd->exname); + npc->event(sd,output, 0); // Calls the NPC label return; } @@ -11580,15 +11644,11 @@ static void clif_parse_WisMessage(int fd, struct map_session_data *sd) } // searching destination character - dstsd = map->nick2sd(target); + dstsd = map->nick2sd(target, false); - if (dstsd == NULL || strcmp(dstsd->status.name, target) != 0) { - // player is not on this map-server - // At this point, don't send wisp/page if it's not exactly the same name, because (example) - // if there are 'Test' player on an other map-server and 'test' player on this map-server, - // and if we ask for 'Test', we must not contact 'test' player - // so, we send information to inter-server, which is the only one which decide (and copy correct name). - intif->wis_message(sd, target, message, (int)strlen(message)); + if (dstsd == NULL) { + // Character not found (or found through partial match). + clif->wis_end(sd->fd, 1); return; } @@ -11604,7 +11664,7 @@ static void clif_parse_WisMessage(int fd, struct map_session_data *sd) // if player is autotrading if (dstsd->state.autotrade) { char output[256]; - sprintf(output, "%s is in autotrade mode and cannot receive whispered messages.", dstsd->status.name); + sprintf(output, msg_fd(fd, 894), dstsd->status.name); // %s is in autotrade mode and cannot receive whispered messages. clif->wis_message(fd, map->wisp_server_name, output, (int)strlen(output)); return; } @@ -11635,7 +11695,7 @@ static void clif_parse_Broadcast(int fd, struct map_session_data *sd) char command[sizeof commandname + 2 + CHAT_SIZE_MAX] = ""; // '@' command + ' ' + message + NUL int len = (int)RFIFOW(fd,2) - 4; - if (len < 0) + if (len <= 0) return; sprintf(command, "%c%s ", atcommand->at_symbol, commandname); @@ -11735,6 +11795,9 @@ static void clif_parse_UseItem(int fd, struct map_session_data *sd) { int n; + if (pc_isvending(sd)) + return; + if (pc_isdead(sd)) { clif->clearunit_area(&sd->bl, CLR_DEAD); return; @@ -11760,15 +11823,17 @@ static void clif_parse_EquipItem(int fd, struct map_session_data *sd) __attribut static void clif_parse_EquipItem(int fd, struct map_session_data *sd) { const struct packet_equip_item *p = RP2PTR(fd); - int index = 0; - if(pc_isdead(sd)) { + if (pc_isvending(sd)) + return; + + if (pc_isdead(sd)) { clif->clearunit_area(&sd->bl,CLR_DEAD); return; } - index = p->index - 2; - if (index >= sd->status.inventorySize) + int index = p->index - 2; + if (index < 0 || index >= sd->status.inventorySize) return; //Out of bounds check. if( sd->npc_id ) { @@ -11779,15 +11844,15 @@ static void clif_parse_EquipItem(int fd, struct map_session_data *sd) else if ( pc_cant_act2(sd) || sd->state.prerefining ) return; - if(!sd->status.inventory[index].identify) { - clif->equipitemack(sd, index, 0, EIA_FAIL);// fail + if (!sd->status.inventory[index].identify) { + clif->equipitemack(sd, index, 0, EIA_FAIL); // fail return; } - if(!sd->inventory_data[index]) + if (!sd->inventory_data[index]) return; - if(sd->inventory_data[index]->type == IT_PETARMOR){ + if (sd->inventory_data[index]->type == IT_PETARMOR) { pet->equipitem(sd, index); return; } @@ -11795,7 +11860,7 @@ static void clif_parse_EquipItem(int fd, struct map_session_data *sd) pc->update_idle_time(sd, BCIDLE_USEITEM); //Client doesn't send the position for ammo. - if(sd->inventory_data[index]->type == IT_AMMO) + if (sd->inventory_data[index]->type == IT_AMMO) pc->equipitem(sd, index, EQP_AMMO); else pc->equipitem(sd, index, p->wearLocation); @@ -11808,6 +11873,9 @@ static void clif_parse_UnequipItem(int fd, struct map_session_data *sd) { int index; + if (pc_isvending(sd)) + return; + if(pc_isdead(sd)) { clif->clearunit_area(&sd->bl,CLR_DEAD); return; @@ -11880,7 +11948,7 @@ static void clif_parse_NpcBuySellSelected(int fd, struct map_session_data *sd) _ /// 1 = sell static void clif_parse_NpcBuySellSelected(int fd, struct map_session_data *sd) { - if (sd->state.trading) + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) return; npc->buysellsel(sd, RFIFOL(fd,2), RFIFOB(fd,6)); } @@ -11916,9 +11984,12 @@ static void clif_parse_NpcBuyListSend(int fd, struct map_session_data *sd) __att /// 00c8 <packet len>.W { <amount>.W <name id>.W }* static void clif_parse_NpcBuyListSend(int fd, struct map_session_data *sd) { - int n = ((int)RFIFOW(fd, 2) - sizeof(struct PACKET_CZ_PC_PURCHASE_ITEMLIST)) / sizeof(struct PACKET_CZ_PC_PURCHASE_ITEMLIST_sub); - int result; + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_PC_PURCHASE_ITEMLIST *p = RFIFOP(fd, 0); + int n = ((int)p->packetLength - sizeof(struct PACKET_CZ_PC_PURCHASE_ITEMLIST)) / sizeof(struct PACKET_CZ_PC_PURCHASE_ITEMLIST_sub); + int result; Assert_retv(n >= 0); @@ -11976,7 +12047,7 @@ static void clif_parse_NpcSellListSend(int fd, struct map_session_data *sd) Assert_retv(n >= 0); - if (sd->state.trading || !sd->npc_shopid) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd) || !sd->npc_shopid) { fail = 1; } else { struct itemlist item_list = { 0 }; @@ -12011,6 +12082,9 @@ static void clif_parse_CreateChatRoom(int fd, struct map_session_data *sd) __att /// 1 = public static void clif_parse_CreateChatRoom(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int len = (int)RFIFOW(fd, 2) - 15; int limit; bool pub; @@ -12027,6 +12101,9 @@ static void clif_parse_CreateChatRoom(int fd, struct map_session_data *sd) password = RFIFOP(fd, 7); //not zero-terminated title = RFIFOP(fd, 15); // not zero-terminated + if (limit < 0) + return; + if (pc_ismuted(&sd->sc, MANNER_NOROOM)) return; if(battle_config.basic_skill_check && !pc->check_basicskill(sd, 4)) { @@ -12053,6 +12130,9 @@ static void clif_parse_ChatAddMember(int fd, struct map_session_data *sd) __attr /// 00d9 <chat ID>.L <passwd>.8B static void clif_parse_ChatAddMember(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int chatid = RFIFOL(fd,2); const char *password = RFIFOP(fd,6); // not zero-terminated @@ -12067,6 +12147,9 @@ static void clif_parse_ChatRoomStatusChange(int fd, struct map_session_data *sd) /// 1 = public static void clif_parse_ChatRoomStatusChange(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int len = (int)RFIFOW(fd, 2) - 15; int limit; bool pub; @@ -12079,6 +12162,8 @@ static void clif_parse_ChatRoomStatusChange(int fd, struct map_session_data *sd) return; limit = RFIFOW(fd, 4); + if (limit < 0) + return; pub = (RFIFOB(fd, 6) != 0); password = RFIFOP(fd, 7); // not zero-terminated title = RFIFOP(fd, 15); // not zero-terminated @@ -12097,6 +12182,9 @@ static void clif_parse_ChangeChatOwner(int fd, struct map_session_data *sd) __at /// 1 = normal static void clif_parse_ChangeChatOwner(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + chat->change_owner(sd, RFIFOP(fd,6)); // non null terminated } @@ -12105,6 +12193,9 @@ static void clif_parse_KickFromChat(int fd, struct map_session_data *sd) __attri /// 00e2 <name>.24B static void clif_parse_KickFromChat(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + chat->kick(sd, RFIFOP(fd,2)); // non null terminated } @@ -12113,6 +12204,9 @@ static void clif_parse_ChatLeave(int fd, struct map_session_data *sd) __attribut /// 00e3 static void clif_parse_ChatLeave(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + chat->leave(sd, false); } @@ -12137,9 +12231,10 @@ static void clif_parse_TradeRequest(int fd, struct map_session_data *sd) __attri /// 00e4 <account id>.L static void clif_parse_TradeRequest(int fd, struct map_session_data *sd) { - struct map_session_data *t_sd; + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; - t_sd = map->id2sd(RFIFOL(fd,2)); + struct map_session_data *t_sd = map->id2sd(RFIFOL(fd, 2)); if (sd->chat_id == 0 && pc_cant_act(sd)) return; //You can trade while in a chatroom. @@ -12166,6 +12261,9 @@ static void clif_parse_TradeAck(int fd, struct map_session_data *sd) __attribute /// 4 = rejected static void clif_parse_TradeAck(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + trade->ack(sd,RFIFOB(fd,2)); } @@ -12174,6 +12272,9 @@ static void clif_parse_TradeAddItem(int fd, struct map_session_data *sd) __attri /// 00e8 <index>.W <amount>.L static void clif_parse_TradeAddItem(int fd, struct map_session_data *sd) { + if (!sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + short index = RFIFOW(fd,2); int amount = RFIFOL(fd,4); @@ -12188,6 +12289,8 @@ static void clif_parse_TradeOk(int fd, struct map_session_data *sd) __attribute_ /// 00eb static void clif_parse_TradeOk(int fd, struct map_session_data *sd) { + if (pc_isdead(sd) || pc_isvending(sd)) + return; trade->ok(sd); } @@ -12196,6 +12299,9 @@ static void clif_parse_TradeCancel(int fd, struct map_session_data *sd) __attrib /// 00ed static void clif_parse_TradeCancel(int fd, struct map_session_data *sd) { + if (pc_isdead(sd) || pc_isvending(sd)) + return; + trade->cancel(sd); } @@ -12204,6 +12310,9 @@ static void clif_parse_TradeCommit(int fd, struct map_session_data *sd) __attrib /// 00ef static void clif_parse_TradeCommit(int fd, struct map_session_data *sd) { + if (pc_isdead(sd) || pc_isvending(sd)) + return; + trade->commit(sd); } @@ -12632,7 +12741,7 @@ static void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uin return; } //You can't use Graffiti/TalkieBox AND have a vending open, so this is safe. - safestrncpy(sd->message, RFIFOP(fd,skillmoreinfo), MESSAGE_SIZE); + safestrncpy(sd->message, RFIFOP(fd, skillmoreinfo), TALKBOX_MESSAGE_SIZE); } if( sd->ud.skilltimer != INVALID_TIMER ) @@ -12766,7 +12875,7 @@ static void clif_parse_ProduceMix(int fd, struct map_session_data *sd) default: return; } - if (pc_istrading(sd)) { + if (pc_istrading(sd) || pc_isdead(sd) || pc_isvending(sd)) { //Make it fail to avoid shop exploits where you sell something different than you see. clif->skill_fail(sd, sd->ud.skill_id, USESKILL_FAIL_LEVEL, 0, 0); clif_menuskill_clear(sd); @@ -12797,7 +12906,7 @@ static void clif_parse_Cooking(int fd, struct map_session_data *sd) if (type == 6 && sd->menuskill_id != GN_MIX_COOKING && sd->menuskill_id != GN_S_PHARMACY) return; - if (pc_istrading(sd)) { + if (pc_istrading(sd) || pc_isdead(sd) || pc_isvending(sd)) { //Make it fail to avoid shop exploits where you sell something different than you see. clif->skill_fail(sd, sd->ud.skill_id, USESKILL_FAIL_LEVEL, 0, 0); clif_menuskill_clear(sd); @@ -12817,7 +12926,7 @@ static void clif_parse_RepairItem(int fd, struct map_session_data *sd) if (sd->menuskill_id != BS_REPAIRWEAPON) return; - if (pc_istrading(sd)) { + if (pc_istrading(sd) || pc_isdead(sd) || pc_isvending(sd)) { //Make it fail to avoid shop exploits where you sell something different than you see. clif->skill_fail(sd, sd->ud.skill_id, USESKILL_FAIL_LEVEL, 0, 0); clif_menuskill_clear(sd); @@ -12832,19 +12941,17 @@ static void clif_parse_WeaponRefine(int fd, struct map_session_data *sd) __attri /// 0222 <index>.L static void clif_parse_WeaponRefine(int fd, struct map_session_data *sd) { - int idx; - sd->state.prerefining = 0; if (sd->menuskill_id != WS_WEAPONREFINE) //Packet exploit? return; - if (pc_istrading(sd)) { + if (pc_istrading(sd) || pc_isdead(sd) || pc_isvending(sd)) { //Make it fail to avoid shop exploits where you sell something different than you see. clif->skill_fail(sd, sd->ud.skill_id, USESKILL_FAIL_LEVEL, 0, 0); clif_menuskill_clear(sd); return; } - idx = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]); + int idx = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]); skill->weaponrefine(sd, idx-2); clif_menuskill_clear(sd); } @@ -12859,6 +12966,9 @@ static void clif_parse_NpcSelectMenu(int fd, struct map_session_data *sd) __attr /// overflows to choice%256. static void clif_parse_NpcSelectMenu(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int npc_id = RFIFOL(fd,2); uint8 select = RFIFOB(fd,6); @@ -12884,6 +12994,9 @@ static void clif_parse_NpcNextClicked(int fd, struct map_session_data *sd) __att /// 00b9 <npc id>.L static void clif_parse_NpcNextClicked(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + npc->scriptcont(sd,RFIFOL(fd,2), false); } @@ -12892,6 +13005,9 @@ static void clif_parse_NpcAmountInput(int fd, struct map_session_data *sd) __att /// 0143 <npc id>.L <value>.L static void clif_parse_NpcAmountInput(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int npcid = RFIFOL(fd,2); int amount = RFIFOL(fd,6); @@ -12916,6 +13032,9 @@ static void clif_parse_NpcStringInput(int fd, struct map_session_data *sd) __att /// 01d5 <packet len>.W <npc id>.L <string>.?B static void clif_parse_NpcStringInput(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int len = RFIFOW(fd, 2); // [4144] can't confirm exact client version. At least >= correct for 20150513 #if PACKETVER >= 20151029 @@ -12943,6 +13062,8 @@ static void clif_parse_NpcCloseClicked(int fd, struct map_session_data *sd) { if (!sd->npc_id) //Avoid parsing anything when the script was done with. [Skotlex] return; + if (sd->state.trading || pc_isvending(sd)) + return; sd->state.dialog = 0; npc->scriptcont(sd, RFIFOL(fd,2), true); } @@ -12954,6 +13075,9 @@ static void clif_parse_ItemIdentify(int fd, struct map_session_data *sd) __attri /// -1 = cancel static void clif_parse_ItemIdentify(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + short idx = RFIFOW(fd,2); if (sd->menuskill_id != MC_IDENTIFY) @@ -12972,6 +13096,9 @@ static void clif_parse_ItemIdentify(int fd, struct map_session_data *sd) /// 0A35 <index>.W static void clif_parse_OneClick_ItemIdentify(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int cmd = RFIFOW(fd,0); short idx = RFIFOW(fd, packet_db[cmd].pos[0]) - 2; int n; @@ -12979,7 +13106,7 @@ static void clif_parse_OneClick_ItemIdentify(int fd, struct map_session_data *sd if (idx < 0 || idx >= sd->status.inventorySize || sd->inventory_data[idx] == NULL || sd->status.inventory[idx].nameid <= 0) return; - if ((n = pc->have_magnifier(sd) ) != INDEX_NOT_FOUND && + if ((n = pc->have_magnifier(sd)) != INDEX_NOT_FOUND && pc->delitem(sd, n, 1, 0, DELITEM_NORMAL, LOG_TYPE_CONSUME) == 0) skill->identify(sd, idx); } @@ -12990,7 +13117,7 @@ static void clif_parse_SelectArrow(int fd, struct map_session_data *sd) __attrib static void clif_parse_SelectArrow(int fd, struct map_session_data *sd) { int itemId; - if (pc_istrading(sd)) { + if (pc_istrading(sd) || pc_isdead(sd) || pc_isvending(sd)) { //Make it fail to avoid shop exploits where you sell something different than you see. clif->skill_fail(sd, sd->ud.skill_id, USESKILL_FAIL_LEVEL, 0, 0); clif_menuskill_clear(sd); @@ -13027,6 +13154,9 @@ static void clif_parse_AutoSpell(int fd, struct map_session_data *sd) __attribut /// 01ce <skill id>.L static void clif_parse_AutoSpell(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + uint16 skill_id = RFIFOL(fd,2); sd->state.workinprogress = 0; @@ -13046,6 +13176,9 @@ static void clif_parse_UseCard(int fd, struct map_session_data *sd) __attribute_ /// 017a <card index>.W static void clif_parse_UseCard(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + clif->use_card(sd,RFIFOW(fd,2)-2); } @@ -13054,6 +13187,9 @@ static void clif_parse_InsertCard(int fd, struct map_session_data *sd) __attribu /// 017c <card index>.W <equip index>.W static void clif_parse_InsertCard(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + pc->insert_card(sd,RFIFOW(fd,2)-2,RFIFOW(fd,4)-2); } @@ -13079,6 +13215,9 @@ static void clif_parse_ResetChar(int fd, struct map_session_data *sd) __attribut /// 1 = skill static void clif_parse_ResetChar(int fd, struct map_session_data *sd) { + if (pc_istrading(sd) || pc_isvending(sd)) + return; + char cmd[15]; if( RFIFOW(fd,2) ) @@ -13264,6 +13403,9 @@ static void clif_parse_CreateParty(int fd, struct map_session_data *sd) __attrib /// 01e8 <party name>.24B <item pickup rule>.B <item share rule>.B (CZ_MAKE_GROUP2) static void clif_parse_CreateParty(int fd, struct map_session_data *sd) { + if (pc_istrading(sd) || pc_isvending(sd)) + return; + char name[NAME_LENGTH]; safestrncpy(name, RFIFOP(fd,2), NAME_LENGTH); @@ -13284,6 +13426,9 @@ static void clif_parse_CreateParty(int fd, struct map_session_data *sd) static void clif_parse_CreateParty2(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_CreateParty2(int fd, struct map_session_data *sd) { + if (pc_istrading(sd) || pc_isvending(sd)) + return; + char name[NAME_LENGTH]; int item1 = RFIFOB(fd,26); int item2 = RFIFOB(fd,27); @@ -13309,6 +13454,9 @@ static void clif_parse_PartyInvite(int fd, struct map_session_data *sd) __attrib /// 02c4 <char name>.24B (CZ_PARTY_JOIN_REQ) static void clif_parse_PartyInvite(int fd, struct map_session_data *sd) { + if (pc_istrading(sd) || pc_isvending(sd)) + return; + struct map_session_data *t_sd; if(map->list[sd->bl.m].flag.partylock) { @@ -13330,6 +13478,9 @@ static void clif_parse_PartyInvite(int fd, struct map_session_data *sd) static void clif_parse_PartyInvite2(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_PartyInvite2(int fd, struct map_session_data *sd) { + if (pc_istrading(sd) || pc_isvending(sd)) + return; + struct map_session_data *t_sd; char name[NAME_LENGTH]; @@ -13341,7 +13492,7 @@ static void clif_parse_PartyInvite2(int fd, struct map_session_data *sd) return; } - t_sd = map->nick2sd(name); + t_sd = map->nick2sd(name, true); if(t_sd && t_sd->state.noask) { // @noask [LuzZza] clif->noask_sub(sd, t_sd, 1); @@ -13360,13 +13511,23 @@ static void clif_parse_ReplyPartyInvite(int fd, struct map_session_data *sd) __a /// 1 = accept static void clif_parse_ReplyPartyInvite(int fd, struct map_session_data *sd) { - party->reply_invite(sd,RFIFOL(fd,2),RFIFOL(fd,6)); + if (pc_istrading(sd) || pc_isvending(sd)) { + party->reply_invite(sd, RFIFOL(fd, 2), 0); + return; + } + + party->reply_invite(sd, RFIFOL(fd, 2), RFIFOL(fd, 6)); } static void clif_parse_ReplyPartyInvite2(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_ReplyPartyInvite2(int fd, struct map_session_data *sd) { - party->reply_invite(sd,RFIFOL(fd,2),RFIFOB(fd,6)); + if (pc_istrading(sd) || pc_isvending(sd)) { + party->reply_invite(sd, RFIFOL(fd, 2), 0); + return; + } + + party->reply_invite(sd, RFIFOL(fd, 2), RFIFOB(fd, 6)); } static void clif_parse_LeaveParty(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); @@ -13374,7 +13535,10 @@ static void clif_parse_LeaveParty(int fd, struct map_session_data *sd) __attribu /// 0100 static void clif_parse_LeaveParty(int fd, struct map_session_data *sd) { - if(map->list[sd->bl.m].flag.partylock) { + if (pc_istrading(sd) || pc_isvending(sd)) + return; + + if (map->list[sd->bl.m].flag.partylock) { // Party locked. clif->message(fd, msg_fd(fd,227)); // Party modification is disabled in this map. return; @@ -13387,12 +13551,15 @@ static void clif_parse_RemovePartyMember(int fd, struct map_session_data *sd) __ /// 0103 <account id>.L <char name>.24B static void clif_parse_RemovePartyMember(int fd, struct map_session_data *sd) { - if(map->list[sd->bl.m].flag.partylock) { + if (pc_istrading(sd) || pc_isvending(sd)) + return; + + if (map->list[sd->bl.m].flag.partylock) { // Party locked. clif->message(fd, msg_fd(fd,227)); // Party modification is disabled in this map. return; } - party->removemember(sd, RFIFOL(fd,2), RFIFOP(fd,6)); + party->removemember(sd, RFIFOL(fd, 2), RFIFOP(fd, 6)); } static void clif_parse_PartyChangeOption(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); @@ -13401,6 +13568,9 @@ static void clif_parse_PartyChangeOption(int fd, struct map_session_data *sd) __ /// 07d7 <exp share rule>.L <item pickup rule>.B <item share rule>.B (CZ_GROUPINFO_CHANGE_V2) static void clif_parse_PartyChangeOption(int fd, struct map_session_data *sd) { + if (pc_istrading(sd) || pc_isvending(sd)) + return; + struct party_data *p; int i; @@ -13453,6 +13623,9 @@ static void clif_parse_PartyChangeLeader(int fd, struct map_session_data *sd) __ /// 07da <account id>.L static void clif_parse_PartyChangeLeader(int fd, struct map_session_data *sd) { + if (pc_istrading(sd) || pc_isvending(sd)) + return; + party->changeleader(sd, map->id2sd(RFIFOL(fd,2))); } @@ -13465,6 +13638,9 @@ static void clif_parse_PartyBookingRegisterReq(int fd, struct map_session_data * static void clif_parse_PartyBookingRegisterReq(int fd, struct map_session_data *sd) { #ifndef PARTY_RECRUIT + if (pc_istrading(sd) || pc_isvending(sd)) + return; + short level = RFIFOW(fd,2); short mapid = RFIFOW(fd,4); short job[PARTY_BOOKING_JOBS]; @@ -13507,6 +13683,9 @@ static void clif_parse_PartyBookingSearchReq(int fd, struct map_session_data *sd static void clif_parse_PartyBookingSearchReq(int fd, struct map_session_data *sd) { #ifndef PARTY_RECRUIT + if (pc_istrading(sd) || pc_isvending(sd)) + return; + short level = RFIFOW(fd,2); short mapid = RFIFOW(fd,4); short job = RFIFOW(fd,6); @@ -13558,7 +13737,10 @@ static void clif_parse_PartyBookingDeleteReq(int fd, struct map_session_data *sd static void clif_parse_PartyBookingDeleteReq(int fd, struct map_session_data *sd) { #ifndef PARTY_RECRUIT - if(party->booking_delete(sd)) + if (pc_istrading(sd) || pc_isvending(sd)) + return; + + if (party->booking_delete(sd)) clif->PartyBookingDeleteAck(sd, 0); #else return; @@ -13594,11 +13776,13 @@ static void clif_parse_PartyBookingUpdateReq(int fd, struct map_session_data *sd static void clif_parse_PartyBookingUpdateReq(int fd, struct map_session_data *sd) { #ifndef PARTY_RECRUIT + if (pc_istrading(sd) || pc_isvending(sd)) + return; + short job[PARTY_BOOKING_JOBS]; - int i; - for(i=0; i<PARTY_BOOKING_JOBS; i++) - job[i] = RFIFOW(fd,2+i*2); + for (int i = 0; i < PARTY_BOOKING_JOBS; i++) + job[i] = RFIFOW(fd, 2 + i * 2); party->booking_update(sd, job); #else @@ -13611,8 +13795,11 @@ static void clif_parse_PartyBookingUpdateReq(int fd, struct map_session_data *sd static void clif_PartyBookingInsertNotify(struct map_session_data *sd, struct party_booking_ad_info *pb_ad) { #ifndef PARTY_RECRUIT + if (pc_istrading(sd) || pc_isvending(sd)) + return; + int i; - uint8 buf[38+PARTY_BOOKING_JOBS*2]; + uint8 buf[38 + PARTY_BOOKING_JOBS * 2]; nullpo_retv(sd); if(pb_ad == NULL) return; @@ -13679,7 +13866,10 @@ static void clif_parse_PartyRecruitRegisterReq(int fd, struct map_session_data * static void clif_parse_PartyRecruitRegisterReq(int fd, struct map_session_data *sd) { #ifdef PARTY_RECRUIT - short level = RFIFOW(fd,2); + if (pc_istrading(sd) || pc_isvending(sd)) + return; + + short level = RFIFOW(fd, 2); const char *notice = RFIFOP(fd, 4); party->recruit_register(sd, level, notice); @@ -13750,6 +13940,9 @@ static void clif_parse_PartyRecruitSearchReq(int fd, struct map_session_data *sd static void clif_parse_PartyRecruitSearchReq(int fd, struct map_session_data *sd) { #ifdef PARTY_RECRUIT + if (pc_istrading(sd) || pc_isvending(sd)) + return; + short level = RFIFOW(fd, 2); short mapid = RFIFOW(fd, 4); unsigned long lastindex = RFIFOL(fd, 6); @@ -13767,7 +13960,10 @@ static void clif_parse_PartyRecruitDeleteReq(int fd, struct map_session_data *sd static void clif_parse_PartyRecruitDeleteReq(int fd, struct map_session_data *sd) { #ifdef PARTY_RECRUIT - if(party->booking_delete(sd)) + if (pc_istrading(sd) || pc_isvending(sd)) + return; + + if (party->booking_delete(sd)) clif->PartyRecruitDeleteAck(sd, 0); #else return; @@ -13803,6 +13999,9 @@ static void clif_parse_PartyRecruitUpdateReq(int fd, struct map_session_data *sd static void clif_parse_PartyRecruitUpdateReq(int fd, struct map_session_data *sd) { #ifdef PARTY_RECRUIT + if (pc_istrading(sd) || pc_isvending(sd)) + return; + const char *notice = RFIFOP(fd, 2); party->recruit_update(sd, notice); @@ -13876,6 +14075,9 @@ static void clif_parse_PartyBookingAddFilteringList(int fd, struct map_session_d static void clif_parse_PartyBookingAddFilteringList(int fd, struct map_session_data *sd) { #ifdef PARTY_RECRUIT + if (pc_istrading(sd) || pc_isvending(sd)) + return; + int index = RFIFOL(fd, 2); clif->PartyBookingAddFilteringList(index, sd); @@ -13890,6 +14092,9 @@ static void clif_parse_PartyBookingSubFilteringList(int fd, struct map_session_d static void clif_parse_PartyBookingSubFilteringList(int fd, struct map_session_data *sd) { #ifdef PARTY_RECRUIT + if (pc_istrading(sd) || pc_isvending(sd)) + return; + int gid = RFIFOL(fd, 2); clif->PartyBookingSubFilteringList(gid, sd); @@ -13904,6 +14109,9 @@ static void clif_parse_PartyBookingReqVolunteer(int fd, struct map_session_data static void clif_parse_PartyBookingReqVolunteer(int fd, struct map_session_data *sd) { #ifdef PARTY_RECRUIT + if (pc_istrading(sd) || pc_isvending(sd)) + return; + int index = RFIFOL(fd, 2); clif->PartyBookingVolunteerInfo(index, sd); @@ -13980,6 +14188,9 @@ static void clif_parse_PartyBookingRefuseVolunteer(int fd, struct map_session_da static void clif_parse_PartyBookingRefuseVolunteer(int fd, struct map_session_data *sd) { #ifdef PARTY_RECRUIT + if (pc_istrading(sd) || pc_isvending(sd)) + return; + unsigned int aid = RFIFOL(fd, 2); clif->PartyBookingRefuseVolunteer(aid, sd); @@ -14009,6 +14220,9 @@ static void clif_parse_PartyBookingCancelVolunteer(int fd, struct map_session_da static void clif_parse_PartyBookingCancelVolunteer(int fd, struct map_session_data *sd) { #ifdef PARTY_RECRUIT + if (pc_istrading(sd) || pc_isvending(sd)) + return; + int index = RFIFOL(fd, 2); clif->PartyBookingCancelVolunteer(index, sd); @@ -14084,6 +14298,9 @@ static void clif_parse_CloseVending(int fd, struct map_session_data *sd) __attri /// 012e static void clif_parse_CloseVending(int fd, struct map_session_data *sd) { + if (pc_istrading(sd) || pc_isdead(sd)) + return; + vending->close(sd); } @@ -14092,6 +14309,9 @@ static void clif_parse_VendingListReq(int fd, struct map_session_data *sd) __att /// 0130 <account id>.L static void clif_parse_VendingListReq(int fd, struct map_session_data *sd) { + if (pc_istrading(sd) || pc_isdead(sd)) + return; + if( sd->npc_id ) {// using an NPC return; } @@ -14103,6 +14323,9 @@ static void clif_parse_PurchaseReq(int fd, struct map_session_data *sd) __attrib /// 0134 <packet len>.W <account id>.L { <amount>.W <index>.W }* static void clif_parse_PurchaseReq(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int len = (int)RFIFOW(fd, 2) - 8; int id; const uint8 *data; @@ -14124,6 +14347,9 @@ static void clif_parse_PurchaseReq2(int fd, struct map_session_data *sd) __attri /// 0801 <packet len>.W <account id>.L <unique id>.L { <amount>.W <index>.W }* static void clif_parse_PurchaseReq2(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int len = (int)RFIFOW(fd, 2) - 12; int aid; int uid; @@ -14150,25 +14376,25 @@ static void clif_parse_OpenVending(int fd, struct map_session_data *sd) __attrib /// 1 = open static void clif_parse_OpenVending(int fd, struct map_session_data *sd) { + if (pc_istrading(sd) || pc_isdead(sd) || sd->state.vending || sd->state.buyingstore) + return; + int len = (int)RFIFOW(fd, 2) - 85; - const char *message; - bool flag; - const uint8 *data; if (len < 0) return; - message = RFIFOP(fd,4); - flag = (RFIFOB(fd,84) != 0) ? true : false; - data = RFIFOP(fd,85); + const char *message = RFIFOP(fd, 4); + bool flag = (RFIFOB(fd, 84) != 0) ? true : false; + const uint8 *data = RFIFOP(fd, 85); - if( !flag ) + if (!flag) sd->state.prevend = sd->state.workinprogress = 0; - if(pc_ismuted(&sd->sc, MANNER_NOROOM)) + if (pc_ismuted(&sd->sc, MANNER_NOROOM)) return; - if( map->list[sd->bl.m].flag.novending ) { - clif->message (sd->fd, msg_sd(sd,276)); // "You can't open a shop on this map" + if (map->list[sd->bl.m].flag.novending) { + clif->message (sd->fd, msg_sd(sd, 276)); // "You can't open a shop on this map" return; } if (map->getcell(sd->bl.m, &sd->bl, sd->bl.x, sd->bl.y, CELL_CHKNOVENDING)) { @@ -14187,11 +14413,14 @@ static void clif_parse_CreateGuild(int fd, struct map_session_data *sd) __attrib /// 0165 <char id>.L <guild name>.24B static void clif_parse_CreateGuild(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + char name[NAME_LENGTH]; safestrncpy(name, RFIFOP(fd,6), NAME_LENGTH); - if(map->list[sd->bl.m].flag.guildlock) { - clif->message(fd, msg_fd(fd,228)); // Guild modification is disabled in this map. + if (map->list[sd->bl.m].flag.guildlock) { + clif->message(fd, msg_fd(fd, 228)); // Guild modification is disabled in this map. return; } @@ -14226,6 +14455,7 @@ static void clif_parse_GuildRequestInfo(int fd, struct map_session_data *sd) case 0: // Basic Information Guild, hostile alliance information clif->guild_basicinfo(sd); clif->guild_allianceinfo(sd); + clif->guild_castlelist(sd); break; case 1: // Members list, list job title clif->guild_positionnamelist(sd); @@ -14252,6 +14482,9 @@ static void clif_parse_GuildChangePositionInfo(int fd, struct map_session_data * /// 0161 <packet len>.W { <position id>.L <mode>.L <ranking>.L <pay rate>.L <name>.24B }* static void clif_parse_GuildChangePositionInfo(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int i; int count = (RFIFOW(fd, 2) - 4) / 40; @@ -14269,6 +14502,9 @@ static void clif_parse_GuildChangeMemberPosition(int fd, struct map_session_data /// 0155 <packet len>.W { <account id>.L <char id>.L <position id>.L }* static void clif_parse_GuildChangeMemberPosition(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int i; int len = RFIFOW(fd, 2); int count = (len - 4) / 12; @@ -14434,10 +14670,13 @@ static void clif_parse_GuildChangeEmblem(int fd, struct map_session_data *sd) __ /// 0153 <packet len>.W <emblem data>.?B static void clif_parse_GuildChangeEmblem(int fd, struct map_session_data *sd) { - unsigned int emblem_len = RFIFOW(fd,2)-4; - const uint8* emblem = RFIFOP(fd,4); + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; - if( !emblem_len || !sd->state.gmaster_flag ) + unsigned int emblem_len = RFIFOW(fd, 2) - 4; + const uint8* emblem = RFIFOP(fd, 4); + + if (!emblem_len || !sd->state.gmaster_flag) return; if (!clif->validate_emblem(emblem, emblem_len)) { @@ -14454,7 +14693,10 @@ static void clif_parse_GuildChangeNotice(int fd, struct map_session_data *sd) __ /// 016e <guild id>.L <msg1>.60B <msg2>.120B static void clif_parse_GuildChangeNotice(int fd, struct map_session_data *sd) { - int guild_id = RFIFOL(fd,2); + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + + int guild_id = RFIFOL(fd, 2); char *msg1 = NULL, *msg2 = NULL; if (!sd->state.gmaster_flag) @@ -14506,6 +14748,9 @@ static void clif_parse_GuildInvite(int fd, struct map_session_data *sd) __attrib /// 0168 <account id>.L <inviter account id>.L <inviter char id>.L static void clif_parse_GuildInvite(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + struct map_session_data *t_sd = map->id2sd(RFIFOL(fd,2)); if (!clif_sub_guild_invite(fd, sd, t_sd)) @@ -14521,7 +14766,7 @@ static void clif_parse_GuildInvite2(int fd, struct map_session_data *sd) struct map_session_data *t_sd = NULL; safestrncpy(nick, RFIFOP(fd, 2), NAME_LENGTH); - t_sd = map->nick2sd(nick); + t_sd = map->nick2sd(nick, true); clif_sub_guild_invite(fd, sd, t_sd); } @@ -14534,7 +14779,7 @@ static void clif_parse_GuildReplyInvite(int fd, struct map_session_data *sd) __a /// 1 = accept static void clif_parse_GuildReplyInvite(int fd, struct map_session_data *sd) { - guild->reply_invite(sd,RFIFOL(fd,2),RFIFOL(fd,6)); + guild->reply_invite(sd, RFIFOL(fd, 2), RFIFOL(fd, 6)); } static void clif_parse_GuildLeave(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); @@ -14542,16 +14787,19 @@ static void clif_parse_GuildLeave(int fd, struct map_session_data *sd) __attribu /// 0159 <guild id>.L <account id>.L <char id>.L <reason>.40B static void clif_parse_GuildLeave(int fd, struct map_session_data *sd) { - if(map->list[sd->bl.m].flag.guildlock) { - clif->message(fd, msg_fd(fd,228)); // Guild modification is disabled in this map. + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + + if (map->list[sd->bl.m].flag.guildlock) { + clif->message(fd, msg_fd(fd, 228)); // Guild modification is disabled in this map. return; } - if( sd->bg_id ) { - clif->message(fd, msg_fd(fd,870)); //"You can't leave battleground guilds." + if (sd->bg_id) { + clif->message(fd, msg_fd(fd, 870)); //"You can't leave battleground guilds." return; } - guild->leave(sd,RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOP(fd,14)); + guild->leave(sd, RFIFOL(fd, 2), RFIFOL(fd, 6), RFIFOL(fd, 10), RFIFOP(fd, 14)); } static void clif_parse_GuildExpulsion(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); @@ -14559,11 +14807,14 @@ static void clif_parse_GuildExpulsion(int fd, struct map_session_data *sd) __att /// 015b <guild id>.L <account id>.L <char id>.L <reason>.40B static void clif_parse_GuildExpulsion(int fd, struct map_session_data *sd) { - if( map->list[sd->bl.m].flag.guildlock || sd->bg_id ) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + + if (map->list[sd->bl.m].flag.guildlock || sd->bg_id) { clif->message(fd, msg_fd(fd,228)); // Guild modification is disabled in this map. return; } - guild->expulsion(sd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOP(fd,14)); + guild->expulsion(sd, RFIFOL(fd, 2), RFIFOL(fd, 6), RFIFOL(fd, 10), RFIFOP(fd, 14)); } /** @@ -14596,6 +14847,9 @@ static void clif_parse_GuildRequestAlliance(int fd, struct map_session_data *sd) /// 0170 <account id>.L <inviter account id>.L <inviter char id>.L static void clif_parse_GuildRequestAlliance(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + struct map_session_data *t_sd; if(!sd->state.gmaster_flag) @@ -14636,6 +14890,9 @@ static void clif_parse_GuildDelAlliance(int fd, struct map_session_data *sd) __a /// 1 = Enemy static void clif_parse_GuildDelAlliance(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + if(!sd->state.gmaster_flag) return; @@ -14651,6 +14908,9 @@ static void clif_parse_GuildOpposition(int fd, struct map_session_data *sd) __at /// 0180 <account id>.L static void clif_parse_GuildOpposition(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + struct map_session_data *t_sd; if(!sd->state.gmaster_flag) @@ -14680,6 +14940,9 @@ static void clif_parse_GuildBreak(int fd, struct map_session_data *sd) __attribu /// field name and size is same as the one in CH_DELETE_CHAR. static void clif_parse_GuildBreak(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + char key[40]; if( map->list[sd->bl.m].flag.guildlock ) { clif->message(fd, msg_fd(fd,228)); // Guild modification is disabled in this map. @@ -14703,7 +14966,10 @@ static void clif_parse_PetMenu(int fd, struct map_session_data *sd) __attribute_ /// 4 = unequip accessory static void clif_parse_PetMenu(int fd, struct map_session_data *sd) { - pet->menu(sd,RFIFOB(fd,2)); + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + + pet->menu(sd, RFIFOB(fd, 2)); } static void clif_parse_CatchPet(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); @@ -14711,7 +14977,10 @@ static void clif_parse_CatchPet(int fd, struct map_session_data *sd) __attribute /// 019f <id>.L static void clif_parse_CatchPet(int fd, struct map_session_data *sd) { - pet->catch_process2(sd,RFIFOL(fd,2)); + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + + pet->catch_process2(sd, RFIFOL(fd, 2)); } static void clif_parse_SelectEgg(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); @@ -14719,10 +14988,13 @@ static void clif_parse_SelectEgg(int fd, struct map_session_data *sd) __attribut /// 01a7 <index>.W static void clif_parse_SelectEgg(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + if (sd->menuskill_id != SA_TAMINGMONSTER || sd->menuskill_val != -1) { return; } - pet->select_egg(sd,RFIFOW(fd,2)-2); + pet->select_egg(sd, RFIFOW(fd, 2) - 2); clif_menuskill_clear(sd); } @@ -14762,6 +15034,9 @@ static void clif_parse_ChangePetName(int fd, struct map_session_data *sd) __attr /// 01a5 <name>.24B static void clif_parse_ChangePetName(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + pet->change_name(sd, RFIFOP(fd,2)); } @@ -14770,6 +15045,9 @@ static void clif_parse_pet_evolution(int fd, struct map_session_data *sd) __attr /// 09fb <Length>.W <EvolvedPetEggID>.W {<index>.W <amount>.W}*items static void clif_parse_pet_evolution(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_PET_EVOLUTION *p = RP2PTR(fd); int i = 0, idx, petIndex; @@ -14958,7 +15236,7 @@ static void clif_parse_GMShift(int fd, struct map_session_data *sd) { // FIXME: remove is supposed to receive account name for clients prior 20100803RE char player_name[NAME_LENGTH]; - char command[NAME_LENGTH+8]; + char command[NAME_LENGTH + 20]; safestrncpy(player_name, RFIFOP(fd,2), NAME_LENGTH); @@ -14977,7 +15255,7 @@ static void clif_parse_GMRemove2(int fd, struct map_session_data *sd) account_id = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]); if( (pl_sd = map->id2sd(account_id)) != NULL ) { - char command[NAME_LENGTH+8]; + char command[NAME_LENGTH + 20]; sprintf(command, "%cjumpto %s", atcommand->at_symbol, pl_sd->status.name); atcommand->exec(fd, sd, command, true); } @@ -15014,7 +15292,7 @@ static void clif_parse_GMRecall2(int fd, struct map_session_data *sd) account_id = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]); if( (pl_sd = map->id2sd(account_id)) != NULL ) { - char command[NAME_LENGTH+8]; + char command[NAME_LENGTH + 20]; sprintf(command, "%crecall %s", atcommand->at_symbol, pl_sd->status.name); atcommand->exec(fd, sd, command, true); } @@ -15045,7 +15323,7 @@ static void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd) safestrncpy(item_monster_name, p->str, sizeof(item_monster_name)); - if ( (count=itemdb->search_name_array(item_array, 10, item_monster_name, 1)) > 0 ) { + if ( (count=itemdb->search_name_array(item_array, 10, item_monster_name, IT_SEARCH_NAME_EXACT)) > 0 ) { for(i = 0; i < count; i++) { if( !item_array[i] ) continue; @@ -15345,6 +15623,9 @@ static void clif_parse_NoviceDoriDori(int fd, struct map_session_data *sd) __att /// 01e7 static void clif_parse_NoviceDoriDori(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + if (sd->state.doridori) return; switch (sd->job & MAPID_UPPERMASK) { @@ -15371,6 +15652,9 @@ static void clif_parse_NoviceExplosionSpirits(int fd, struct map_session_data *s /// "Help me out~ Please~ T_T" static void clif_parse_NoviceExplosionSpirits(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + /* [Ind/Hercules] */ /* game client is currently broken on this (not sure the packetver range) */ /* it sends the request when the criteria doesn't match (and of course we let it fail) */ @@ -15514,13 +15798,16 @@ static void clif_parse_FriendsListAdd(int fd, struct map_session_data *sd) __att /// 0202 <name>.24B static void clif_parse_FriendsListAdd(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + struct map_session_data *f_sd; int i; char nick[NAME_LENGTH]; safestrncpy(nick, RFIFOP(fd,2), NAME_LENGTH); - f_sd = map->nick2sd(nick); + f_sd = map->nick2sd(nick, true); // ensure that the request player's friend list is not full ARR_FIND(0, MAX_FRIENDS, i, sd->status.friends[i].char_id == 0); @@ -15635,6 +15922,9 @@ static void clif_parse_FriendsListRemove(int fd, struct map_session_data *sd) __ /// 0203 <account id>.L <char id>.L static void clif_parse_FriendsListRemove(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + struct map_session_data *f_sd = NULL; int account_id, char_id; int i, j; @@ -15724,60 +16014,95 @@ static void clif_parse_PVPInfo(int fd, struct map_session_data *sd) /// Ranking list /// ranking pointlist { <name>.24B <point>.L }*10 -static void clif_ranklist_sub(unsigned char *buf, enum fame_list_type type) +static void clif_ranklist_sub(struct PACKET_ZC_ACK_RANKING_sub *ranks, enum fame_list_type type) { - const char* name; - struct fame_list* list; - int i; +#if !(PACKETVER_MAIN_NUM >= 20190731 || PACKETVER_RE_NUM >= 20190703 || PACKETVER_ZERO_NUM >= 20190724) + nullpo_retv(ranks); - nullpo_retv(buf); - switch( type ) { + struct fame_list* list; + switch (type) { case RANKTYPE_BLACKSMITH: list = pc->smith_fame_list; break; case RANKTYPE_ALCHEMIST: list = pc->chemist_fame_list; break; case RANKTYPE_TAEKWON: list = pc->taekwon_fame_list; break; default: return; // Unsupported } + int i; // Packet size limits this list to 10 elements. [Skotlex] - for( i = 0; i < 10 && i < MAX_FAME_LIST; i++ ) { - if( list[i].id > 0 ) { - if( strcmp(list[i].name, "-") == 0 && (name = map->charid2nick(list[i].id)) != NULL ) { - strncpy(WBUFP(buf, 24 * i), name, NAME_LENGTH); + for (i = 0; i < 10 && i < MAX_FAME_LIST; i++) { + if (list[i].id > 0) { + const char* name; + if (strcmp(list[i].name, "-") == 0 && (name = map->charid2nick(list[i].id)) != NULL) { + strncpy(ranks->names[i].name, name, NAME_LENGTH); } else { - strncpy(WBUFP(buf, 24 * i), list[i].name, NAME_LENGTH); + strncpy(ranks->names[i].name, list[i].name, NAME_LENGTH); } } else { - strncpy(WBUFP(buf, 24 * i), "None", 5); + strncpy(ranks->names[i].name, "None", 5); + } + ranks->points[i].points = list[i].fame; //points + } + for (;i < 10; i++) { // In case the MAX is less than 10. + strncpy(ranks->names[i].name, "Unavailable", 12); + ranks->points[i].points = 0; + } +#endif +} + +static void clif_ranklist_sub2(uint32 *chars, uint32 *points, enum fame_list_type type) +{ +#if PACKETVER_MAIN_NUM >= 20190731 || PACKETVER_RE_NUM >= 20190703 || PACKETVER_ZERO_NUM >= 20190724 + nullpo_retv(chars); + nullpo_retv(points); + + struct fame_list* list; + switch (type) { + case RANKTYPE_BLACKSMITH: list = pc->smith_fame_list; break; + case RANKTYPE_ALCHEMIST: list = pc->chemist_fame_list; break; + case RANKTYPE_TAEKWON: list = pc->taekwon_fame_list; break; + default: return; // Unsupported + } + + int i; + // Packet size limits this list to 10 elements. [Skotlex] + for (i = 0; i < 10 && i < MAX_FAME_LIST; i++) { + if (list[i].id > 0) { + chars[i] = list[i].id; + } else { + chars[i] = 0; } - WBUFL(buf, 24 * 10 + i * 4) = list[i].fame; //points + points[i] = list[i].fame; //points } - for( ;i < 10; i++ ) { // In case the MAX is less than 10. - strncpy(WBUFP(buf, 24 * i), "Unavailable", 12); - WBUFL(buf, 24 * 10 + i * 4) = 0; + for (;i < 10; i++) { // In case the MAX is less than 10. + chars[i] = 0; + points[i] = 0; } +#endif } /// 097d <RankingType>.W {<CharName>.24B <point>L}*10 <mypoint>L (ZC_ACK_RANKING) static void clif_ranklist(struct map_session_data *sd, enum fame_list_type type) { -#if PACKETVER >= 20120502 - int fd; - int len = packet_len(0x97d); - +#if PACKETVER_MAIN_NUM >= 20130605 || PACKETVER_RE_NUM >= 20130529 || defined(PACKETVER_ZERO) nullpo_retv(sd); - fd = sd->fd; - WFIFOHEAD(fd, len); - WFIFOW(fd, 0) = 0x97d; - WFIFOW(fd, 2) = type; - clif_ranklist_sub(WFIFOP(fd,4), type); + int fd = sd->fd; + WFIFOHEAD(fd, sizeof(struct PACKET_ZC_ACK_RANKING)); + struct PACKET_ZC_ACK_RANKING *p = WFIFOP(fd, 0); + p->packetType = HEADER_ZC_ACK_RANKING; + p->rankType = type; +#if PACKETVER_MAIN_NUM >= 20190731 || PACKETVER_RE_NUM >= 20190703 || PACKETVER_ZERO_NUM >= 20190724 + clif->ranklist_sub2(p->chars, p->points, type); +#else + clif->ranklist_sub(&p->ranks, type); +#endif if (pc->famelist_type(sd->job) == type) { - WFIFOL(fd, 284) = sd->status.fame; //mypoint + p->myPoints = sd->status.fame; //mypoint } else { - WFIFOL(fd, 284) = 0; //mypoint + p->myPoints = 0; //mypoint } - WFIFOSET(fd, len); + WFIFOSET(fd, sizeof(struct PACKET_ZC_ACK_RANKING)); #endif } @@ -15827,14 +16152,16 @@ static void clif_update_rankingpoint(struct map_session_data *sd, enum fame_list /// 0219 { <name>.24B }*10 { <point>.L }*10 static void clif_blacksmith(struct map_session_data *sd) { +#if !(PACKETVER_MAIN_NUM >= 20130605 || PACKETVER_RE_NUM >= 20130529 || defined(PACKETVER_ZERO)) int fd; nullpo_retv(sd); fd = sd->fd; WFIFOHEAD(fd,packet_len(0x219)); WFIFOW(fd,0) = 0x219; - clif_ranklist_sub(WFIFOP(fd, 2), RANKTYPE_BLACKSMITH); + clif->ranklist_sub(WFIFOP(fd, 2), RANKTYPE_BLACKSMITH); WFIFOSET(fd, packet_len(0x219)); +#endif } static void clif_parse_Blacksmith(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); @@ -15864,14 +16191,16 @@ static void clif_fame_blacksmith(struct map_session_data *sd, int points) /// 021a { <name>.24B }*10 { <point>.L }*10 static void clif_alchemist(struct map_session_data *sd) { +#if !(PACKETVER_MAIN_NUM >= 20130605 || PACKETVER_RE_NUM >= 20130529 || defined(PACKETVER_ZERO)) int fd; nullpo_retv(sd); fd = sd->fd; WFIFOHEAD(fd,packet_len(0x21a)); WFIFOW(fd,0) = 0x21a; - clif_ranklist_sub(WFIFOP(fd,2), RANKTYPE_ALCHEMIST); + clif->ranklist_sub(WFIFOP(fd,2), RANKTYPE_ALCHEMIST); WFIFOSET(fd, packet_len(0x21a)); +#endif } static void clif_parse_Alchemist(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); @@ -15901,14 +16230,16 @@ static void clif_fame_alchemist(struct map_session_data *sd, int points) /// 0226 { <name>.24B }*10 { <point>.L }*10 static void clif_taekwon(struct map_session_data *sd) { +#if !(PACKETVER_MAIN_NUM >= 20130605 || PACKETVER_RE_NUM >= 20130529 || defined(PACKETVER_ZERO)) int fd; nullpo_retv(sd); fd = sd->fd; WFIFOHEAD(fd,packet_len(0x226)); WFIFOW(fd,0) = 0x226; - clif_ranklist_sub(WFIFOP(fd,2), RANKTYPE_TAEKWON); + clif->ranklist_sub(WFIFOP(fd,2), RANKTYPE_TAEKWON); WFIFOSET(fd, packet_len(0x226)); +#endif } static void clif_parse_Taekwon(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); @@ -15968,6 +16299,9 @@ static void clif_parse_FeelSaveOk(int fd, struct map_session_data *sd) __attribu /// 2 = star static void clif_parse_FeelSaveOk(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int i; if (sd->menuskill_id != SG_FEEL) return; @@ -16009,6 +16343,9 @@ static void clif_parse_ChangeHomunculusName(int fd, struct map_session_data *sd) /// 0231 <name>.24B static void clif_parse_ChangeHomunculusName(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + homun->change_name(sd, RFIFOP(fd,2)); } @@ -16017,6 +16354,9 @@ static void clif_parse_HomMoveToMaster(int fd, struct map_session_data *sd) __at /// 0234 <id>.L static void clif_parse_HomMoveToMaster(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int id = RFIFOL(fd,2); // Mercenary or Homunculus struct block_list *bl = NULL; struct unit_data *ud = NULL; @@ -16038,6 +16378,9 @@ static void clif_parse_HomMoveTo(int fd, struct map_session_data *sd) __attribut /// 0232 <id>.L <position data>.3B static void clif_parse_HomMoveTo(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int id = RFIFOL(fd,2); // Mercenary or Homunculus struct block_list *bl = NULL; short x, y; @@ -16061,6 +16404,9 @@ static void clif_parse_HomAttack(int fd, struct map_session_data *sd) __attribut /// always 0 static void clif_parse_HomAttack(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + struct block_list *bl = NULL; int id = RFIFOL(fd,2), target_id = RFIFOL(fd,6), @@ -16087,6 +16433,9 @@ static void clif_parse_HomMenu(int fd, struct map_session_data *sd) __attribute_ /// 2 = delete static void clif_parse_HomMenu(int fd, struct map_session_data *sd) { //[orn] + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int cmd; cmd = RFIFOW(fd,0); @@ -16102,7 +16451,16 @@ static void clif_parse_AutoRevive(int fd, struct map_session_data *sd) __attribu /// 0292 static void clif_parse_AutoRevive(int fd, struct map_session_data *sd) { - int item_position = pc->search_inventory(sd, ITEMID_TOKEN_OF_SIEGFRIED); + if (pc_istrading(sd) || pc_isvending(sd)) + return; + + if (!pc_isdead(sd)) + return; + + if (sd->sc.data[SC_HELLPOWER]) //Cannot res while under the effect of SC_HELLPOWER. + return; + + int item_position = pc->have_item_chain(sd, ECC_SIEGFRIED); int hpsp = 100; if (item_position == INDEX_NOT_FOUND) { @@ -16112,18 +16470,15 @@ static void clif_parse_AutoRevive(int fd, struct map_session_data *sd) return; } - if (sd->sc.data[SC_HELLPOWER]) //Cannot res while under the effect of SC_HELLPOWER. - return; - if (!status->revive(&sd->bl, hpsp, hpsp)) return; if (item_position == INDEX_NOT_FOUND) - status_change_end(&sd->bl,SC_LIGHT_OF_REGENE,INVALID_TIMER); + status_change_end(&sd->bl, SC_LIGHT_OF_REGENE, INVALID_TIMER); else pc->delitem(sd, item_position, 1, 0, DELITEM_SKILLUSE, LOG_TYPE_CONSUME); - clif->skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1); + clif->skill_nodamage(&sd->bl, &sd->bl, ALL_RESURRECTION, 4, 1); } /// Information about character's status values (ZC_ACK_STATUS_GM). @@ -16173,6 +16528,9 @@ static void clif_parse_Check(int fd, struct map_session_data *sd) __attribute__( /// 0213 <char name>.24B static void clif_parse_Check(int fd, struct map_session_data *sd) { + if (pc_istrading(sd) || pc_isvending(sd)) + return; + char charname[NAME_LENGTH]; struct map_session_data* pl_sd; @@ -16181,7 +16539,7 @@ static void clif_parse_Check(int fd, struct map_session_data *sd) safestrncpy(charname, RFIFOP(fd,packet_db[RFIFOW(fd,0)].pos[0]), sizeof(charname)); - if( ( pl_sd = map->nick2sd(charname) ) == NULL || pc_get_group_level(sd) < pc_get_group_level(pl_sd) ) { + if ((pl_sd = map->nick2sd(charname, true)) == NULL || pc_get_group_level(sd) < pc_get_group_level(pl_sd)) { return; } @@ -16325,7 +16683,7 @@ static void clif_Mail_refreshinbox(struct map_session_data *sd) if( md->full ) {// TODO: is this official? char output[100]; - sprintf(output, "Inbox is full (Max %d). Delete some mails.", MAIL_MAX_INBOX); + sprintf(output, msg_sd(sd, 511), MAIL_MAX_INBOX); // Inbox is full (Max %d). Delete some mails. clif_disp_onlyself(sd, output); } } @@ -16335,6 +16693,9 @@ static void clif_parse_Mail_refreshinbox(int fd, struct map_session_data *sd) __ /// 023f static void clif_parse_Mail_refreshinbox(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + struct mail_data* md = &sd->mail.inbox; if( md->amount < MAIL_MAX_INBOX && (md->full || sd->mail.changed) ) @@ -16418,6 +16779,9 @@ static void clif_parse_Mail_read(int fd, struct map_session_data *sd) __attribut /// 0241 <mail id>.L static void clif_parse_Mail_read(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int mail_id = RFIFOL(fd,2); if( mail_id <= 0 ) @@ -16433,6 +16797,9 @@ static void clif_parse_Mail_getattach(int fd, struct map_session_data *sd) __att /// 0244 <mail id>.L static void clif_parse_Mail_getattach(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int mail_id = RFIFOL(fd,2); int i; @@ -16501,6 +16868,9 @@ static void clif_parse_Mail_delete(int fd, struct map_session_data *sd) __attrib /// 0243 <mail id>.L static void clif_parse_Mail_delete(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int mail_id = RFIFOL(fd,2); int i; @@ -16532,6 +16902,9 @@ static void clif_parse_Mail_return(int fd, struct map_session_data *sd) __attrib /// 0273 <mail id>.L <receive name>.24B static void clif_parse_Mail_return(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int mail_id = RFIFOL(fd,2); int i; @@ -16556,6 +16929,9 @@ static void clif_parse_Mail_setattach(int fd, struct map_session_data *sd) __att /// 0247 <index>.W <amount>.L static void clif_parse_Mail_setattach(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int idx = RFIFOW(fd,2); int amount = RFIFOL(fd,4); unsigned char flag; @@ -16578,6 +16954,9 @@ static void clif_parse_Mail_winopen(int fd, struct map_session_data *sd) __attri /// 2 = remove zeny static void clif_parse_Mail_winopen(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int flag = RFIFOW(fd,2); if (flag == 0 || flag == 1) @@ -16592,6 +16971,9 @@ static void clif_parse_Mail_send(int fd, struct map_session_data *sd) __attribut static void clif_parse_Mail_send(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + struct mail_message msg; int body_len; int len = RFIFOW(fd, 2); @@ -16748,7 +17130,10 @@ static void clif_parse_Auction_cancelreg(int fd, struct map_session_data *sd) __ /// ? = junk, uninitialized value (ex. when switching between list filters) static void clif_parse_Auction_cancelreg(int fd, struct map_session_data *sd) { - if( sd->auction.amount > 0 ) + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + + if (sd->auction.amount > 0) clif->additem(sd, sd->auction.index, sd->auction.amount, 0); sd->auction.amount = 0; @@ -16759,8 +17144,11 @@ static void clif_parse_Auction_setitem(int fd, struct map_session_data *sd) __at /// 024c <index>.W <count>.L static void clif_parse_Auction_setitem(int fd, struct map_session_data *sd) { - int idx = RFIFOW(fd,2) - 2; - int amount = RFIFOL(fd,4); // Always 1 + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + + int idx = RFIFOW(fd, 2) - 2; + int amount = RFIFOL(fd, 4); // Always 1 struct item_data *item; if( !battle_config.feature_auction ) @@ -16838,6 +17226,9 @@ static void clif_parse_Auction_register(int fd, struct map_session_data *sd) __a /// 024d <now money>.L <max money>.L <delete hour>.W static void clif_parse_Auction_register(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + struct auction_data auction; struct item_data *item; @@ -16933,7 +17324,10 @@ static void clif_parse_Auction_cancel(int fd, struct map_session_data *sd) __att /// 024e <auction id>.L static void clif_parse_Auction_cancel(int fd, struct map_session_data *sd) { - unsigned int auction_id = RFIFOL(fd,2); + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + + unsigned int auction_id = RFIFOL(fd, 2); intif->Auction_cancel(sd->status.char_id, auction_id); } @@ -16943,6 +17337,9 @@ static void clif_parse_Auction_close(int fd, struct map_session_data *sd) __attr /// 025d <auction id>.L static void clif_parse_Auction_close(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + unsigned int auction_id = RFIFOL(fd,2); intif->Auction_close(sd->status.char_id, auction_id); @@ -16953,8 +17350,11 @@ static void clif_parse_Auction_bid(int fd, struct map_session_data *sd) __attrib /// 024f <auction id>.L <money>.L static void clif_parse_Auction_bid(int fd, struct map_session_data *sd) { - unsigned int auction_id = RFIFOL(fd,2); - int bid = RFIFOL(fd,6); + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + + unsigned int auction_id = RFIFOL(fd, 2); + int bid = RFIFOL(fd, 6); if( !pc_can_give_items(sd) ) { //They aren't supposed to give zeny [Inkfish] clif->message(sd->fd, msg_sd(sd,246)); // Your GM level doesn't authorize you to perform this action. @@ -16985,9 +17385,12 @@ static void clif_parse_Auction_search(int fd, struct map_session_data *sd) __att /// 5 = auction id search static void clif_parse_Auction_search(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + char search_text[NAME_LENGTH]; - short type = RFIFOW(fd,2), page = RFIFOW(fd,32); - int price = RFIFOL(fd,4); // FIXME: bug #5071 + short type = RFIFOW(fd, 2), page = RFIFOW(fd, 32); + int price = RFIFOL(fd, 4); // FIXME: bug #5071 if( !battle_config.feature_auction ) return; @@ -17006,7 +17409,10 @@ static void clif_parse_Auction_buysell(int fd, struct map_session_data *sd) __at /// 1 = buy (own bids) static void clif_parse_Auction_buysell(int fd, struct map_session_data *sd) { - short type = RFIFOW(fd,2) + 6; + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + + short type = RFIFOW(fd, 2) + 6; if( !battle_config.feature_auction ) return; @@ -17116,6 +17522,9 @@ static void clif_parse_cashshop_buy(int fd, struct map_session_data *sd) __attri /// 0288 <packet len>.W <kafra points>.L <count>.W { <amount>.W <name id>.W }.4B*count (PACKETVER >= 20100803) static void clif_parse_cashshop_buy(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int fail = 0; const struct PACKET_CZ_PC_BUY_CASH_POINT_ITEM *p = RFIFOP(fd, 0); @@ -17208,6 +17617,9 @@ static void clif_parse_Adopt_request(int fd, struct map_session_data *sd) __attr /// 01f9 <account id>.L static void clif_parse_Adopt_request(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + struct map_session_data *tsd = map->id2sd(RFIFOL(fd,2)), *p_sd = map->charid2sd(sd->status.partner_id); if( pc->can_Adopt(sd, p_sd, tsd) ) { @@ -17224,6 +17636,9 @@ static void clif_parse_Adopt_reply(int fd, struct map_session_data *sd) __attrib /// 1 = accepted static void clif_parse_Adopt_reply(int fd, struct map_session_data *sd) { + if (pc_isdead(sd)) + return; + int p1_id = RFIFOL(fd,2); int p2_id = RFIFOL(fd,6); int result = RFIFOL(fd,10); @@ -17291,6 +17706,9 @@ static void clif_parse_ViewPlayerEquip(int fd, struct map_session_data *sd) __at /// 02d6 <account id>.L static void clif_parse_ViewPlayerEquip(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int charid = RFIFOL(fd, 2); struct map_session_data* tsd = map->id2sd(charid); @@ -17318,6 +17736,9 @@ static void clif_parse_cz_config(int fd, struct map_session_data *sd) __attribut /// 1 = enabled static void clif_parse_cz_config(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + enum CZ_CONFIG type = RFIFOL(fd, 2); int flag = RFIFOL(fd, 6); @@ -17633,6 +18054,9 @@ static void clif_parse_questStateAck(int fd, struct map_session_data *sd) __attr /// 02b6 <quest id>.L <active>.B static void clif_parse_questStateAck(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + quest->update_status(sd, RFIFOL(fd,2), RFIFOB(fd,6)?Q_ACTIVE:Q_INACTIVE); } @@ -17852,6 +18276,9 @@ static void clif_parse_mercenary_action(int fd, struct map_session_data *sd) __a /// 2 = delete static void clif_parse_mercenary_action(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int option = RFIFOB(fd,2); if (sd->md == NULL) return; @@ -18320,6 +18747,9 @@ static void clif_parse_ItemListWindowSelected(int fd, struct map_session_data *s /// S 07e4 <length>.w <option>.l <val>.l {<index>.w <amount>.w).4b* static void clif_parse_ItemListWindowSelected(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int n = ((int)RFIFOW(fd, 2) - 12) / 4; int type = RFIFOL(fd,4); int flag = RFIFOL(fd,8); // Button clicked: 0 = Cancel, 1 = OK @@ -18449,6 +18879,9 @@ static void clif_parse_ReqOpenBuyingStore(int fd, struct map_session_data *sd) _ /// 1 = open static void clif_parse_ReqOpenBuyingStore(int fd, struct map_session_data *sd) { + if (pc_istrading(sd) || pc_isdead(sd)) + return; + const unsigned int blocksize = sizeof(struct PACKET_CZ_REQ_OPEN_BUYING_STORE_sub); const struct PACKET_CZ_REQ_OPEN_BUYING_STORE_sub *itemlist; char storename[MESSAGE_SIZE]; @@ -18612,6 +19045,9 @@ static void clif_buyingstore_disappear_entry_single(struct map_session_data *sd, /// 0817 <account id>.L static void clif_parse_ReqClickBuyingStore(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int account_id; account_id = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]); @@ -18656,6 +19092,9 @@ static void clif_parse_ReqTradeBuyingStore(int fd, struct map_session_data *sd) /// 0819 <packet len>.W <account id>.L <store id>.L { <index>.W <name id>.W <amount>.W }* static void clif_parse_ReqTradeBuyingStore(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const unsigned int blocksize = sizeof(struct PACKET_CZ_REQ_TRADE_BUYING_STORE_sub); const struct PACKET_CZ_REQ_TRADE_BUYING_STORE_sub *itemlist; int account_id; @@ -18794,6 +19233,9 @@ static void clif_parse_SearchStoreInfo(int fd, struct map_session_data *sd) __at /// cannot be searched. static void clif_parse_SearchStoreInfo(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const unsigned int blocksize = sizeof(struct PACKET_CZ_SEARCH_STORE_INFO_item); const struct PACKET_CZ_SEARCH_STORE_INFO_item* itemlist; const struct PACKET_CZ_SEARCH_STORE_INFO_item* cardlist; @@ -18942,6 +19384,9 @@ static void clif_parse_SearchStoreInfoNextPage(int fd, struct map_session_data * /// 0838 static void clif_parse_SearchStoreInfoNextPage(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + searchstore->next(sd); } @@ -18980,6 +19425,9 @@ static void clif_parse_SearchStoreInfoListItemClick(int fd, struct map_session_d /// 083c <account id>.L <store id>.L <nameid>.W static void clif_parse_SearchStoreInfoListItemClick(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_SSILIST_ITEM_CLICK *p = RFIFOP(fd, 0); searchstore->click(sd, p->AID, p->storeId, p->itemId); } @@ -19029,27 +19477,30 @@ static void clif_parse_debug(int fd, struct map_session_data *sd) *------------------------------------------*/ static int clif_elementalconverter_list(struct map_session_data *sd) { - int i,c,view,fd; - nullpo_ret(sd); /// Main client packet processing function - fd=sd->fd; - WFIFOHEAD(fd, MAX_SKILL_PRODUCE_DB *2+4); - WFIFOW(fd, 0)=0x1ad; + int fd = sd->fd; + int len = MAX_SKILL_ARROW_DB * sizeof(struct PACKET_ZC_MAKINGARROW_LIST_sub) + sizeof(struct PACKET_ZC_MAKINGARROW_LIST); + WFIFOHEAD(fd, len); + struct PACKET_ZC_MAKINGARROW_LIST *p = WFIFOP(fd, 0); + p->packetType = HEADER_ZC_MAKINGARROW_LIST; - for(i=0,c=0;i<MAX_SKILL_PRODUCE_DB;i++){ - if( skill->can_produce_mix(sd,skill->dbs->produce_db[i].nameid,23, 1) ){ - if((view = itemdb_viewid(skill->dbs->produce_db[i].nameid)) > 0) - WFIFOW(fd,c*2+ 4)= view; + int c = 0; + for (int i = 0; i < MAX_SKILL_PRODUCE_DB; i++) { + if (skill->can_produce_mix(sd,skill->dbs->produce_db[i].nameid,23, 1) ) { + int view = itemdb_viewid(skill->dbs->produce_db[i].nameid); + if (view > 0) + p->items[c].itemId = view; else - WFIFOW(fd,c*2+ 4)= skill->dbs->produce_db[i].nameid; + p->items[c].itemId = skill->dbs->produce_db[i].nameid; c++; } } - WFIFOW(fd,2) = c*2+4; - WFIFOSET(fd, WFIFOW(fd,2)); if (c > 0) { + len = c * sizeof(struct PACKET_ZC_MAKINGARROW_LIST_sub) + sizeof(struct PACKET_ZC_MAKINGARROW_LIST); + p->packetLength = len; + WFIFOSET(fd, len); sd->menuskill_id = SA_CREATECON; sd->menuskill_val = c; } @@ -19080,33 +19531,33 @@ static void clif_millenniumshield(struct block_list *bl, short shields) *------------------------------------------*/ static int clif_spellbook_list(struct map_session_data *sd) { - int i, c; - int fd; - nullpo_ret(sd); - fd = sd->fd; - WFIFOHEAD(fd, 8 * 8 + 8); - WFIFOW(fd,0) = 0x1ad; + int fd = sd->fd; + int len = MAX_SKILL_ARROW_DB * sizeof(struct PACKET_ZC_MAKINGARROW_LIST_sub) + sizeof(struct PACKET_ZC_MAKINGARROW_LIST); + WFIFOHEAD(fd, len); + struct PACKET_ZC_MAKINGARROW_LIST *p = WFIFOP(fd, 0); + p->packetType = HEADER_ZC_MAKINGARROW_LIST; - for (i = 0, c = 0; i < sd->status.inventorySize; i ++ ) + int c = 0; + for (int i = 0; i < sd->status.inventorySize; i ++ ) { - if( itemdb_is_spellbook(sd->status.inventory[i].nameid) ) + if (itemdb_is_spellbook(sd->status.inventory[i].nameid)) { - WFIFOW(fd, c * 2 + 4) = sd->status.inventory[i].nameid; + p->items[c].itemId = sd->status.inventory[i].nameid; c++; } } - if( c > 0 ) + if (c > 0) { - WFIFOW(fd,2) = c * 2 + 4; - WFIFOSET(fd, WFIFOW(fd, 2)); + len = c * sizeof(struct PACKET_ZC_MAKINGARROW_LIST_sub) + sizeof(struct PACKET_ZC_MAKINGARROW_LIST); + p->packetLength = len; + WFIFOSET(fd, len); sd->menuskill_id = WL_READING_SB; sd->menuskill_val = c; - } - else{ - status_change_end(&sd->bl,SC_STOP,INVALID_TIMER); + } else { + status_change_end(&sd->bl, SC_STOP, INVALID_TIMER); clif->skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK, 0, 0); } @@ -19121,17 +19572,18 @@ static int clif_spellbook_list(struct map_session_data *sd) static int clif_magicdecoy_list(struct map_session_data *sd, uint16 skill_lv, short x, short y) { int i, c; - int fd; nullpo_ret(sd); - fd = sd->fd; - WFIFOHEAD(fd, 8 * 8 + 8); - WFIFOW(fd,0) = 0x1ad; // This is the official packet. [pakpil] + int fd = sd->fd; + int len = MAX_SKILL_ARROW_DB * sizeof(struct PACKET_ZC_MAKINGARROW_LIST_sub) + sizeof(struct PACKET_ZC_MAKINGARROW_LIST); + WFIFOHEAD(fd, len); + struct PACKET_ZC_MAKINGARROW_LIST *p = WFIFOP(fd, 0); + p->packetType = HEADER_ZC_MAKINGARROW_LIST; for (i = 0, c = 0; i < sd->status.inventorySize; i ++) { - if( itemdb_is_element(sd->status.inventory[i].nameid) ) { - WFIFOW(fd, c * 2 + 4) = sd->status.inventory[i].nameid; + if (itemdb_is_element(sd->status.inventory[i].nameid)) { + p->items[c].itemId = sd->status.inventory[i].nameid; c ++; } } @@ -19140,8 +19592,10 @@ static int clif_magicdecoy_list(struct map_session_data *sd, uint16 skill_lv, sh sd->menuskill_val = skill_lv; sd->sc.comet_x = x; sd->sc.comet_y = y; - WFIFOW(fd,2) = c * 2 + 4; - WFIFOSET(fd, WFIFOW(fd, 2)); + + len = c * sizeof(struct PACKET_ZC_MAKINGARROW_LIST_sub) + sizeof(struct PACKET_ZC_MAKINGARROW_LIST); + p->packetLength = len; + WFIFOSET(fd, len); } else { clif->skill_fail(sd, NC_MAGICDECOY, USESKILL_FAIL_LEVEL, 0, 0); return 0; @@ -19158,25 +19612,28 @@ static int clif_magicdecoy_list(struct map_session_data *sd, uint16 skill_lv, sh static int clif_poison_list(struct map_session_data *sd, uint16 skill_lv) { int i, c; - int fd; nullpo_ret(sd); - fd = sd->fd; - WFIFOHEAD(fd, 8 * 8 + 8); - WFIFOW(fd,0) = 0x1ad; // This is the official packet. [pakpil] + int fd = sd->fd; + int len = MAX_SKILL_ARROW_DB * sizeof(struct PACKET_ZC_MAKINGARROW_LIST_sub) + sizeof(struct PACKET_ZC_MAKINGARROW_LIST); + WFIFOHEAD(fd, len); + struct PACKET_ZC_MAKINGARROW_LIST *p = WFIFOP(fd, 0); + p->packetType = HEADER_ZC_MAKINGARROW_LIST; for (i = 0, c = 0; i < sd->status.inventorySize; i ++) { if( itemdb_is_poison(sd->status.inventory[i].nameid) ) { - WFIFOW(fd, c * 2 + 4) = sd->status.inventory[i].nameid; + p->items[c].itemId = sd->status.inventory[i].nameid; c ++; } } - if( c > 0 ) { + if (c > 0) { sd->menuskill_id = GC_POISONINGWEAPON; sd->menuskill_val = skill_lv; - WFIFOW(fd,2) = c * 2 + 4; - WFIFOSET(fd, WFIFOW(fd, 2)); + + len = c * sizeof(struct PACKET_ZC_MAKINGARROW_LIST_sub) + sizeof(struct PACKET_ZC_MAKINGARROW_LIST); + p->packetLength = len; + WFIFOSET(fd, len); } else { clif->skill_fail(sd, GC_POISONINGWEAPON, USESKILL_FAIL_GUILLONTINE_POISON, 0, 0); return 0; @@ -19254,8 +19711,10 @@ static void clif_parse_SkillSelectMenu(int fd, struct map_session_data *sd) __at *------------------------------------------*/ static void clif_parse_SkillSelectMenu(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; - if( sd->menuskill_id != SC_AUTOSHADOWSPELL ) + if (sd->menuskill_id != SC_AUTOSHADOWSPELL) return; if (pc_istrading(sd) || sd->state.prevend) { @@ -19301,9 +19760,8 @@ static void clif_parse_MoveItem(int fd, struct map_session_data *sd) int index; /* can't move while dead. */ - if(pc_isdead(sd)) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) return; - } index = RFIFOW(fd,2)-2; @@ -19454,6 +19912,8 @@ static void clif_parse_dull(int fd, struct map_session_data *sd) static void clif_parse_CashShopOpen(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_CashShopOpen(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; if (map->list[sd->bl.m].flag.nocashshop) { clif->messagecolor_self(fd, COLOR_RED, msg_fd(fd,1489)); //Cash Shop is disabled in this map @@ -19476,6 +19936,9 @@ static void clif_parse_CashShopClose(int fd, struct map_session_data *sd) static void clif_parse_CashShopSchedule(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_CashShopSchedule(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + clif->cashShopSchedule(fd, sd); } @@ -19513,6 +19976,9 @@ void clif_cashShopSchedule(int fd, struct map_session_data *sd) static void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int len = RFIFOW(fd, 2); unsigned short limit, i, j; unsigned int kafra_pay; @@ -19633,6 +20099,9 @@ static void clif_parse_CashShopReqTab(int fd, struct map_session_data *sd) { // [4144] packet exists only in 2011 and was dropped after #if PACKETVER >= 20110222 && PACKETVER < 20120000 + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + short tab = RFIFOW(fd, 2); int j; @@ -19787,6 +20256,9 @@ static void clif_bgqueue_notice_delete(struct map_session_data *sd, enum BATTLEG static void clif_parse_bgqueue_register(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_bgqueue_register(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct packet_bgqueue_register *p = RP2PTR(fd); struct bg_arena *arena = NULL; if( !bg->queue_on ) return; /* temp, until feature is complete */ @@ -19827,6 +20299,9 @@ static void clif_bgqueue_update_info(struct map_session_data *sd, unsigned char static void clif_parse_bgqueue_checkstate(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_bgqueue_checkstate(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct packet_bgqueue_checkstate *p = RP2PTR(fd); if (sd->bg_queue.arena && sd->bg_queue.type) { @@ -19839,6 +20314,9 @@ static void clif_parse_bgqueue_checkstate(int fd, struct map_session_data *sd) static void clif_parse_bgqueue_revoke_req(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_bgqueue_revoke_req(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct packet_bgqueue_revoke_req *p = RP2PTR(fd); if( sd->bg_queue.arena ) @@ -19850,6 +20328,9 @@ static void clif_parse_bgqueue_revoke_req(int fd, struct map_session_data *sd) static void clif_parse_bgqueue_battlebegin_ack(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_bgqueue_battlebegin_ack(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct packet_bgqueue_battlebegin_ack *p = RP2PTR(fd); struct bg_arena *arena; @@ -19914,7 +20395,11 @@ static void clif_package_item_announce(struct map_session_data *sd, int nameid, nullpo_retv(sd); p.PacketType = package_item_announceType; - p.PacketLength = 11 + NAME_LENGTH; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + p.PacketLength = 7 + 4 + 4 + NAME_LENGTH; +#else + p.PacketLength = 7 + 2 + 2 + NAME_LENGTH; +#endif p.type = 0x0; p.ItemID = nameid; p.len = NAME_LENGTH; @@ -19922,7 +20407,7 @@ static void clif_package_item_announce(struct map_session_data *sd, int nameid, p.unknown = 0x2; // some strange byte, IDA shows.. BYTE3(BoxItemIDLength) = 2; p.BoxItemID = containerid; - clif->send(&p,sizeof(p), &sd->bl, ALL_CLIENT); + clif->send(&p, p.PacketLength, &sd->bl, ALL_CLIENT); } /* Made Possible Thanks to Yommy! */ @@ -19940,12 +20425,13 @@ static void clif_item_drop_announce(struct map_session_data *sd, int nameid, cha if (monsterName == NULL) { // message: MSG_BROADCASTING_SPECIAL_ITEM_OBTAIN2 p.type = 0x2; + p.PacketLength -= NAME_LENGTH; } else { // message: MSG_BROADCASTING_SPECIAL_ITEM_OBTAIN p.type = 0x1; safestrncpy(p.monsterName, monsterName, sizeof(p.monsterName)); } - clif->send(&p, sizeof(p), &sd->bl, ALL_CLIENT); + clif->send(&p, p.PacketLength, &sd->bl, ALL_CLIENT); } /* [Ind/Hercules] special thanks to Yommy~! */ @@ -20005,6 +20491,9 @@ static void clif_cart_additem_ack(struct map_session_data *sd, int flag) static void clif_parse_BankDeposit(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_BankDeposit(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct packet_banking_deposit_req *p = RP2PTR(fd); int money; @@ -20021,6 +20510,9 @@ static void clif_parse_BankDeposit(int fd, struct map_session_data *sd) static void clif_parse_BankWithdraw(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_BankWithdraw(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct packet_banking_withdraw_req *p = RP2PTR(fd); int money; @@ -20038,6 +20530,9 @@ static void clif_parse_BankCheck(int fd, struct map_session_data *sd) __attribut static void clif_parse_BankCheck(int fd, struct map_session_data *sd) { #if PACKETVER >= 20130320 + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + struct packet_banking_check p; p.PacketType = banking_checkType; @@ -20104,7 +20599,7 @@ static void clif_show_modifiers(struct map_session_data *sd) if( sd->status.mod_exp != 100 || sd->status.mod_drop != 100 || sd->status.mod_death != 100 ) { char output[128]; - snprintf(output,128,"Base EXP : %d%% | Base Drop: %d%% | Base Death Penalty: %d%%", + snprintf(output,128, msg_sd(sd, 896), // Base EXP : %d%% | Base Drop: %d%% | Base Death Penalty: %d%% sd->status.mod_exp,sd->status.mod_drop,sd->status.mod_death); clif->broadcast2(&sd->bl, output, (int)strlen(output) + 1, 0xffbc90, 0x190, 12, 0, 0, SELF); } @@ -20169,7 +20664,7 @@ static int clif_delay_damage_sub(int tid, int64 tick, int id, intptr_t data) * * @return clif->calc_walkdelay used in further processing **/ -static int clif_delay_damage(int64 tick, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, unsigned char type) +static int clif_delay_damage(int64 tick, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, enum battle_dmg_type type) { struct cdelayed_damage *dd; struct status_change *sc; @@ -20281,40 +20776,43 @@ static void clif_parse_NPCBarterClosed(int fd, struct map_session_data *sd) sd->npc_shopid = 0; } -static void clif_npc_market_purchase_ack(struct map_session_data *sd, const struct itemlist *item_list, unsigned char response) +static void clif_npc_market_purchase_ack(struct map_session_data *sd, const struct itemlist *item_list, enum market_buy_result response) { -#if PACKETVER >= 20131223 - unsigned short c = 0; - +#if PACKETVER_MAIN_NUM >= 20131120 || PACKETVER_RE_NUM >= 20130911 || defined(PACKETVER_ZERO) nullpo_retv(sd); nullpo_retv(item_list); - npcmarket_result.PacketType = npcmarketresultackType; - npcmarket_result.result = response == 0 ? 1 : 0;/* find other values */ + struct PACKET_ZC_NPC_MARKET_PURCHASE_RESULT *p = (struct PACKET_ZC_NPC_MARKET_PURCHASE_RESULT *)packet_buf; + p->PacketType = HEADER_ZC_NPC_MARKET_PURCHASE_RESULT; + p->result = response; - if (npcmarket_result.result) { + unsigned short c = 0; + if (response == MARKET_BUY_RESULT_SUCCESS) { + int vectorLen = VECTOR_LENGTH(*item_list); + int maxCount = (sizeof(packet_buf) - sizeof(struct PACKET_ZC_NPC_MARKET_PURCHASE_RESULT)) / sizeof(struct PACKET_ZC_NPC_MARKET_PURCHASE_RESULT_sub); + if (maxCount > vectorLen) + maxCount = vectorLen; struct npc_data *nd = map->id2nd(sd->npc_shopid); struct npc_item_list *shop = nd->u.scr.shop->item; unsigned short shop_size = nd->u.scr.shop->items; - int i; - for (i = 0; i < VECTOR_LENGTH(*item_list); i++) { + for (int i = 0; i < maxCount; i++) { const struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i); int j; - npcmarket_result.list[i].ITID = entry->id; - npcmarket_result.list[i].qty = entry->amount; + p->list[i].ITID = entry->id; + p->list[i].qty = entry->amount; - ARR_FIND( 0, shop_size, j, entry->id == shop[j].nameid); + ARR_FIND(0, shop_size, j, entry->id == shop[j].nameid); - npcmarket_result.list[i].price = (j != shop_size) ? shop[j].value : 0; + p->list[i].price = (j != shop_size) ? shop[j].value : 0; c++; } } - npcmarket_result.PacketLength = 5 + ( sizeof(npcmarket_result.list[0]) * c );; + p->PacketLength = sizeof(struct PACKET_ZC_NPC_MARKET_PURCHASE_RESULT) + (sizeof(struct PACKET_ZC_NPC_MARKET_PURCHASE_RESULT_sub) * c); - clif->send(&npcmarket_result,npcmarket_result.PacketLength,&sd->bl,SELF); + clif->send(p, p->PacketLength, &sd->bl, SELF); #endif } @@ -20322,8 +20820,10 @@ static void clif_parse_NPCMarketPurchase(int fd, struct map_session_data *sd) __ static void clif_parse_NPCMarketPurchase(int fd, struct map_session_data *sd) { #if PACKETVER >= 20131223 + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct packet_npc_market_purchase *p = RP2PTR(fd); - int response = 0, i; int count = (p->PacketLength - 4) / sizeof p->list[0]; struct itemlist item_list; @@ -20332,7 +20832,7 @@ static void clif_parse_NPCMarketPurchase(int fd, struct map_session_data *sd) VECTOR_INIT(item_list); VECTOR_ENSURE(item_list, count, 1); - for (i = 0; i < count; i++) { + for (int i = 0; i < count; i++) { struct itemlist_entry entry = { 0 }; entry.id = p->list[i].ITID; @@ -20341,7 +20841,7 @@ static void clif_parse_NPCMarketPurchase(int fd, struct map_session_data *sd) VECTOR_PUSH(item_list, entry); } - response = npc->market_buylist(sd, &item_list); + enum market_buy_result response = npc->market_buylist(sd, &item_list); clif->npc_market_purchase_ack(sd, &item_list, response); VECTOR_CLEAR(item_list); @@ -20366,6 +20866,9 @@ static void clif_parse_RouletteOpen(int fd, struct map_session_data *sd) __attri static void clif_parse_RouletteOpen(int fd, struct map_session_data *sd) { #if PACKETVER >= 20140612 + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + struct packet_roulette_open_ack p; if( !battle_config.feature_roulette ) { @@ -20391,6 +20894,9 @@ static void clif_parse_RouletteInfo(int fd, struct map_session_data *sd) __attri static void clif_parse_RouletteInfo(int fd, struct map_session_data *sd) { #if PACKETVER >= 20140612 + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + struct packet_roulette_info_ack p; unsigned short i, j, count = 0; @@ -20436,6 +20942,9 @@ static void clif_parse_RouletteClose(int fd, struct map_session_data *sd) static void clif_parse_RouletteGenerate(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_RouletteGenerate(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + unsigned char result = GENERATE_ROULETTE_SUCCESS; short stage = sd->roulette.stage; @@ -20495,6 +21004,8 @@ static void clif_parse_RouletteRecvItem(int fd, struct map_session_data *sd) __a static void clif_parse_RouletteRecvItem(int fd, struct map_session_data *sd) { #if PACKETVER >= 20140612 + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; struct packet_roulette_itemrecv_ack p; if( !battle_config.feature_roulette ) { @@ -21232,6 +21743,9 @@ static void clif_achievement_send_update(int fd, struct map_session_data *sd, co static void clif_parse_achievement_get_reward(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_achievement_get_reward(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int ach_id = RFIFOL(fd, 2); const struct achievement_data *ad = NULL; struct achievement *ach = NULL; @@ -21274,6 +21788,9 @@ static void clif_achievement_reward_ack(int fd, struct map_session_data *sd, con static void clif_parse_change_title(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_change_title(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + int title_id = RFIFOL(fd, 2); if (title_id == sd->status.title_id) { // Same Title @@ -21321,6 +21838,9 @@ static void clif_change_title_ack(int fd, struct map_session_data *sd, int title static void clif_parse_rodex_open_write_mail(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_rodex_open_write_mail(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_REQ_OPEN_WRITE_MAIL *rPacket = RFIFOP(fd, 0); int8 result = (rodex->isenabled() == true && sd->npc_id == 0) ? 1 : 0; @@ -21346,6 +21866,9 @@ static void clif_rodex_open_write_mail(int fd, const char *receiver_name, int8 r static void clif_parse_rodex_add_item(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_rodex_add_item(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_ADD_ITEM_TO_MAIL *rPacket = RFIFOP(fd, 0); int16 idx = rPacket->index - 2; @@ -21399,6 +21922,9 @@ static void clif_rodex_add_item_result(struct map_session_data *sd, int16 idx, i static void clif_parse_rodex_remove_item(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_rodex_remove_item(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_REQ_REMOVE_ITEM_MAIL *rPacket = RFIFOP(fd, 0); int16 idx = rPacket->index - 2; @@ -21471,6 +21997,9 @@ static void clif_rodex_checkname_result(struct map_session_data *sd, int char_id static void clif_parse_rodex_send_mail(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_rodex_send_mail(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_SEND_MAIL *rPacket = RFIFOP(fd, 0); int8 result; @@ -21701,6 +22230,9 @@ static void clif_rodex_send_refresh(int fd, struct map_session_data *sd, int8 op static void clif_parse_rodex_next_maillist(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_rodex_next_maillist(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_REQ_NEXT_MAIL_LIST *packet = RFIFOP(fd, 0); rodex->next_page(sd, packet->opentype, packet->Lower_MailID); @@ -21709,6 +22241,9 @@ static void clif_parse_rodex_next_maillist(int fd, struct map_session_data *sd) static void clif_parse_rodex_read_mail(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_rodex_read_mail(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_REQ_READ_MAIL *rPacket = RFIFOP(fd, 0); rodex->read_mail(sd, rPacket->MailID); @@ -21778,6 +22313,9 @@ static void clif_rodex_read_mail(struct map_session_data *sd, int8 opentype, str static void clif_parse_rodex_delete_mail(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_rodex_delete_mail(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_REQ_DELETE_MAIL *rPacket = RFIFOP(fd, 0); rodex->delete_mail(sd, rPacket->MailID); @@ -21805,6 +22343,9 @@ static void clif_rodex_delete_mail(struct map_session_data *sd, int8 opentype, i static void clif_parse_rodex_request_zeny(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_rodex_request_zeny(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_REQ_ZENY_FROM_MAIL *rPacket = RFIFOP(fd, 0); rodex->get_zeny(sd, rPacket->opentype, rPacket->MailID); @@ -21833,6 +22374,9 @@ static void clif_rodex_request_zeny(struct map_session_data *sd, int8 opentype, static void clif_parse_rodex_request_items(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_rodex_request_items(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_REQ_ITEM_FROM_MAIL *rPacket = RFIFOP(fd, 0); rodex->get_items(sd, rPacket->opentype, rPacket->MailID); @@ -21872,6 +22416,9 @@ static void clif_rodex_icon(int fd, bool show) static void clif_parse_rodex_refresh_maillist(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_rodex_refresh_maillist(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_REQ_REFRESH_MAIL_LIST *packet = RFIFOP(fd, 0); #if PACKETVER >= 20170419 rodex->refresh(sd, RODEX_OPENTYPE_UNSET, packet->Upper_MailID); @@ -21883,6 +22430,9 @@ static void clif_parse_rodex_refresh_maillist(int fd, struct map_session_data *s static void clif_parse_rodex_open_mailbox(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_rodex_open_mailbox(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_REQ_OPEN_MAIL *packet = RFIFOP(fd, 0); #if PACKETVER >= 20170419 rodex->open(sd, RODEX_OPENTYPE_UNSET, packet->char_Upper_MailID); @@ -21895,6 +22445,9 @@ static void clif_parse_rodex_open_mailbox(int fd, struct map_session_data *sd) static void clif_parse_rodex_close_mailbox(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_rodex_close_mailbox(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + rodex->clean(sd, 0); intif->rodex_checkhasnew(sd); } @@ -21902,6 +22455,9 @@ static void clif_parse_rodex_close_mailbox(int fd, struct map_session_data *sd) static void clif_parse_rodex_cancel_write_mail(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_rodex_cancel_write_mail(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + rodex->clean(sd, 1); } @@ -21935,53 +22491,47 @@ static void clif_skill_scale(struct block_list *bl, int src_id, int x, int y, ui /// 0A3B <Length>.W <AID>.L <Status>.B { <HatEffectId>.W } static void clif_hat_effect(struct block_list *bl, struct block_list *tbl, enum send_target target) { -#if PACKETVER >= 20150422 - unsigned char *buf; - int len, i; - struct map_session_data *sd; - +#if PACKETVER_MAIN_NUM >= 20150507 || PACKETVER_RE_NUM >= 20150429 || defined(PACKETVER_ZERO) nullpo_retv(bl); - - sd = BL_CAST(BL_PC, bl); - + struct map_session_data *sd = BL_CAST(BL_PC, bl); nullpo_retv(sd); - len = 9 + VECTOR_LENGTH(sd->hatEffectId) * 2; - - buf = (unsigned char*)aMalloc(len); + const int len = sizeof(struct PACKET_ZC_HAT_EFFECT) + VECTOR_LENGTH(sd->hatEffectId) * 2; + struct PACKET_ZC_HAT_EFFECT *p = aMalloc(len); - WBUFW(buf, 0) = 0xa3b; - WBUFW(buf, 2) = len; - WBUFL(buf, 4) = bl->id; - WBUFB(buf, 8) = 1; + p->packetType = HEADER_ZC_HAT_EFFECT; + p->packetLength = len; + p->aid = bl->id; + p->status = 1; - for( i = 0; i < VECTOR_LENGTH(sd->hatEffectId); i++ ){ - WBUFW(buf, 9 + i * 2) = VECTOR_INDEX(sd->hatEffectId, i); + for (int i = 0; i < VECTOR_LENGTH(sd->hatEffectId); i++) { + p->effects[i] = VECTOR_INDEX(sd->hatEffectId, i); } if (tbl != NULL) { - clif->send(buf, len, tbl, target); + clif->send(p, len, tbl, target); } else { - clif->send(buf, len, bl, target); + clif->send(p, len, bl, target); } - - aFree(buf); + aFree(p); #endif } static void clif_hat_effect_single(struct block_list *bl, uint16 effectId, bool enable){ -#if PACKETVER >= 20150422 - unsigned char buf[13]; - +#if PACKETVER_MAIN_NUM >= 20150507 || PACKETVER_RE_NUM >= 20150429 || defined(PACKETVER_ZERO) nullpo_retv(bl); - WBUFW(buf,0) = 0xa3b; - WBUFW(buf,2) = 13; - WBUFL(buf,4) = bl->id; - WBUFB(buf,8) = enable; - WBUFL(buf,9) = effectId; + const int len = sizeof(struct PACKET_ZC_HAT_EFFECT) + 2; + struct PACKET_ZC_HAT_EFFECT *p = aMalloc(len); - clif->send(buf, 13, bl, AREA); + p->packetType = HEADER_ZC_HAT_EFFECT; + p->packetLength = len; + p->aid = bl->id; + p->status = enable; + p->effects[0] = effectId; + + clif->send(p, len, bl, AREA); + aFree(p); #endif } @@ -22066,8 +22616,10 @@ static time_t clif_attendance_getendtime(void) static void clif_parse_open_ui_request(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_open_ui_request(int fd, struct map_session_data *sd) { - const struct PACKET_CZ_OPEN_UI *p = RP2PTR(fd); + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_OPEN_UI *p = RP2PTR(fd); clif->open_ui(sd, p->UIType); } @@ -22138,6 +22690,8 @@ static void clif_parse_attendance_reward_request(int fd, struct map_session_data static void clif_parse_attendance_reward_request(int fd, struct map_session_data *sd) { #if PACKETVER_RE_NUM >= 20180307 || PACKETVER_MAIN_NUM >= 20180404 || PACKETVER_ZERO_NUM >= 20180411 + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; struct rodex_message msg = { 0 }; struct attendance_entry *entry; @@ -22219,6 +22773,9 @@ static void clif_parse_private_airship_request(int fd, struct map_session_data * static void clif_parse_private_airship_request(int fd, struct map_session_data *sd) { #if PACKETVER_RE_NUM >= 20180321 || PACKETVER_MAIN_NUM >= 20180620 || defined(PACKETVER_ZERO) + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + char evname[EVENT_NAME_LENGTH]; struct event_data *ev = NULL; const struct PACKET_CZ_PRIVATE_AIRSHIP_REQUEST *p = RP2PTR(fd); @@ -22260,6 +22817,9 @@ static void clif_private_airship_response(struct map_session_data *sd, uint32 fl static void clif_parse_cz_req_style_change(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_cz_req_style_change(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_REQ_STYLE_CHANGE *p = RP2PTR(fd); if (p->HeadStyle > 0) @@ -22281,6 +22841,9 @@ static void clif_parse_cz_req_style_change(int fd, struct map_session_data *sd) static void clif_parse_cz_req_style_change2(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_cz_req_style_change2(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_REQ_STYLE_CHANGE2 *p = RP2PTR(fd); if (p->HeadStyle > 0) @@ -22343,6 +22906,9 @@ static void clif_parse_changeDress(int fd, struct map_session_data *sd) __attrib /// 0ae8 <packet len>.W static void clif_parse_changeDress(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const char commandname[] = "changedress"; char command[sizeof commandname + 3] = ""; // '@' command + ' ' + NUL @@ -22367,6 +22933,9 @@ static void clif_party_dead_notification(struct map_session_data *sd) static void clif_parse_memorial_dungeon_command(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_memorial_dungeon_command(int fd, struct map_session_data *sd) { + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_MEMORIALDUNGEON_COMMAND *p = RP2PTR(fd); switch (p->command) { @@ -22407,6 +22976,9 @@ static void clif_parse_cameraInfo(int fd, struct map_session_data *sd) __attribu static void clif_parse_cameraInfo(int fd, struct map_session_data *sd) { #if PACKETVER >= 20160525 + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_CAMERA_INFO *const p = RFIFOP(fd, 0); char command[100]; if (p->action == 1) { @@ -22495,6 +23067,9 @@ static void clif_parse_NPCBarterPurchase(int fd, struct map_session_data *sd) __ static void clif_parse_NPCBarterPurchase(int fd, struct map_session_data *sd) { #if PACKETVER_MAIN_NUM >= 20190116 || PACKETVER_RE_NUM >= 20190116 || PACKETVER_ZERO_NUM >= 20181226 + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + const struct PACKET_CZ_NPC_BARTER_PURCHASE *p = RP2PTR(fd); int count = (p->packetLength - sizeof(struct PACKET_CZ_NPC_BARTER_PURCHASE)) / sizeof p->list[0]; struct barteritemlist item_list; @@ -22598,6 +23173,9 @@ static void clif_parse_AddItemRefineryUI(int fd, struct map_session_data *sd) __ static void clif_parse_AddItemRefineryUI(int fd, struct map_session_data *sd) { #if PACKETVER_MAIN_NUM >= 20161005 || PACKETVER_RE_NUM >= 20161005 || defined(PACKETVER_ZERO) + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + if (battle_config.enable_refinery_ui == 0) return; @@ -22639,6 +23217,9 @@ static void clif_parse_RefineryUIRefine(int fd, struct map_session_data *sd) __a static void clif_parse_RefineryUIRefine(int fd, struct map_session_data *sd) { #if PACKETVER_MAIN_NUM >= 20161005 || PACKETVER_RE_NUM >= 20161005 || defined(PACKETVER_ZERO) + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + if (battle_config.enable_refinery_ui == 0) return; @@ -22651,6 +23232,9 @@ static void clif_parse_RefineryUIClose(int fd, struct map_session_data *sd) __at static void clif_parse_RefineryUIClose(int fd, struct map_session_data *sd) { #if PACKETVER_MAIN_NUM >= 20161130 || PACKETVER_RE_NUM >= 20161109 || defined(PACKETVER_ZERO) + if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + return; + if (battle_config.enable_refinery_ui == 0) return; @@ -22676,6 +23260,181 @@ static void clif_announce_refine_status(struct map_session_data *sd, int item_id #endif } +static void clif_parse_GuildCastleTeleportRequest(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); +static void clif_parse_GuildCastleTeleportRequest(int fd, struct map_session_data *sd) +{ +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190522 || PACKETVER_ZERO_NUM >= 20190515 + const struct PACKET_CZ_CASTLE_TELEPORT_REQUEST *p = RFIFO2PTR(fd); + struct guild *g = sd->guild; + + if (g == NULL) + return; + + struct guild_castle *gc = guild->castle_search(p->castle_id); + if (gc == NULL) + return; + if (gc->enable_client_warp == false) + return; + if (gc->guild_id != g->guild_id) + return; + + if (map->list[sd->bl.m].flag.gvg_castle == 1) + return; + + int zeny = gc->client_warp.zeny; + if (gc->siege_type == SIEGE_TYPE_FE && map->agit_flag == 1) { + zeny = gc->client_warp.zeny_siege; + } else if (gc->siege_type == SIEGE_TYPE_SE && map->agit2_flag == 1) { + zeny = gc->client_warp.zeny_siege; + } else if (gc->siege_type == SIEGE_TYPE_TE) { + clif->guild_castleteleport_res(sd, SIEGE_TP_INVALID_MODE); + return; + } + + if (sd->status.zeny < zeny) { + clif->guild_castleteleport_res(sd, SIEGE_TP_NOT_ENOUGH_ZENY); + return; + } + sd->status.zeny -= zeny; + clif->updatestatus(sd, SP_ZENY); + pc->setpos(sd, gc->mapindex, gc->client_warp.x, gc->client_warp.y, CLR_OUTSIGHT); +#endif +} + +static void clif_guild_castleteleport_res(struct map_session_data *sd, enum siege_teleport_result result) +{ +#if PACKETVER_MAIN_NUM >= 20190731 || PACKETVER_RE_NUM >= 20190717 || PACKETVER_ZERO_NUM >= 20190814 + + nullpo_retv(sd); + + struct PACKET_ZC_CASTLE_TELEPORT_RESPONSE p = { 0 }; + p.packetType = HEADER_ZC_CASTLE_TELEPORT_RESPONSE; + p.result = (int16)result; + clif->send(&p, sizeof(p), &sd->bl, SELF); +#endif +} +static void clif_parse_GuildCastleInfoRequest(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); +static void clif_parse_GuildCastleInfoRequest(int fd, struct map_session_data *sd) +{ +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190522 || PACKETVER_ZERO_NUM >= 20190515 + const struct PACKET_CZ_CASTLE_INFO_REQUEST *p = RFIFO2PTR(fd); + struct guild *g = sd->guild; + + if (g == NULL) + return; + + struct guild_castle *gc = guild->castle_search(p->castle_id); + if (gc == NULL) + return; + if (gc->guild_id != g->guild_id) + return; + clif->guild_castleinfo(sd, gc); +#endif +} + +static bool clif_lapineDdukDdak_open(struct map_session_data *sd, int item_id) +{ +#if PACKETVER_MAIN_NUM >= 20160601 || PACKETVER_RE_NUM >= 20160525 || defined(PACKETVER_ZERO) + nullpo_retr(false, sd); + nullpo_retr(false, itemdb->exists(item_id)); + struct PACKET_ZC_LAPINEDDUKDDAK_OPEN p; + + p.packetType = HEADER_ZC_LAPINEDDUKDDAK_OPEN; + p.itemId = item_id; + clif->send(&p, sizeof(p), &sd->bl, SELF); + + sd->state.lapine_ui = 1; + return true; +#else + return false; +#endif // PACKETVER_MAIN_NUM >= 20160601 || PACKETVER_RE_NUM >= 20160525 || defined(PACKETVER_ZERO) +} + +static bool clif_lapineDdukDdak_result(struct map_session_data *sd, enum lapineddukddak_result result) +{ +#if PACKETVER_MAIN_NUM >= 20160601 || PACKETVER_RE_NUM >= 20160525 || defined(PACKETVER_ZERO) + nullpo_retr(false, sd); + struct PACKET_ZC_LAPINEDDUKDDAK_RESULT p; + + p.packetType = HEADER_ZC_LAPINEDDUKDDAK_RESULT; + p.result = result; + clif->send(&p, sizeof(p), &sd->bl, SELF); + return true; +#else + return false; +#endif // PACKETVER_MAIN_NUM >= 20160601 || PACKETVER_RE_NUM >= 20160525 || defined(PACKETVER_ZERO) +} + +static void clif_parse_lapineDdukDdak_ack(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); +static void clif_parse_lapineDdukDdak_ack(int fd, struct map_session_data *sd) +{ +#if PACKETVER >= 20160302 + const struct PACKET_CZ_LAPINEDDUKDDAK_ACK *p = RP2PTR(fd); + struct item_data *it = itemdb->exists(p->itemId); + + if (it == NULL || it->lapineddukddak == NULL) + return; + if (pc_cant_act(sd)) + return; + if (pc->search_inventory(sd, it->nameid) == INDEX_NOT_FOUND) + return; + + if (((p->packetLength - sizeof(struct PACKET_CZ_LAPINEDDUKDDAK_ACK)) / sizeof(struct PACKET_CZ_LAPINEDDUKDDAK_ACK_sub)) != it->lapineddukddak->NeedCount) + return; + + for (int i = 0; i < it->lapineddukddak->NeedCount; ++i) { + int16 idx = p->items[i].index - 2; + Assert_retv(idx >= 0 && idx < sd->status.inventorySize); + + struct item itr = sd->status.inventory[idx]; + int j = 0; + for (j = 0; j < VECTOR_LENGTH(it->lapineddukddak->SourceItems); ++j) { + if (itr.nameid == VECTOR_INDEX(it->lapineddukddak->SourceItems, j).id) { + // Validate that the amount sent in the packet is matching the database + if (p->items[i].count != VECTOR_INDEX(it->lapineddukddak->SourceItems, j).amount) { + clif->lapineDdukDdak_result(sd, LAPINEDDKUKDDAK_INSUFFICIENT_AMOUNT); + return; + } + + // Validate that the player have enough of the item + if (itr.amount < VECTOR_INDEX(it->lapineddukddak->SourceItems, j).amount) { + clif->lapineDdukDdak_result(sd, LAPINEDDKUKDDAK_INSUFFICIENT_AMOUNT); + return; + } + + // Validate refine rate requirement + if ((itemdb_type(itr.nameid) == IT_ARMOR || itemdb_type(itr.nameid) == IT_WEAPON) + && (itr.refine < it->lapineddukddak->NeedRefineMin || itr.refine > it->lapineddukddak->NeedRefineMax)) + return; + + // All requirements are met, move to the next one + break; + } + } + // The item is not in sources list + if (j == VECTOR_LENGTH(it->lapineddukddak->SourceItems)) { + clif->lapineDdukDdak_result(sd, LAPINEDDKUKDDAK_INVALID_ITEM); + return; + } + } + + for (int i = 0; i < it->lapineddukddak->NeedCount; ++i) + pc->delitem(sd, p->items[i].index - 2, p->items[i].count, 0, DELITEM_NORMAL, LOG_TYPE_SCRIPT); + if (it->lapineddukddak->script != NULL) + script->run_item_lapineddukddak_script(sd, it, npc->fake_nd->bl.id); + clif->lapineDdukDdak_result(sd, LAPINEDDKUKDDAK_SUCCESS); + return; +#endif // PACKETVER >= 20160302 +} + +static void clif_parse_lapineDdukDdak_close(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); +static void clif_parse_lapineDdukDdak_close(int fd, struct map_session_data *sd) +{ +#if PACKETVER >= 20160504 + sd->state.lapine_ui = 0; +#endif // PACKETVER >= 20160504 +} + /*========================================== * Main client packet processing function *------------------------------------------*/ @@ -23119,6 +23878,8 @@ void clif_defaults(void) clif->fame_alchemist = clif_fame_alchemist; clif->fame_taekwon = clif_fame_taekwon; clif->ranklist = clif_ranklist; + clif->ranklist_sub = clif_ranklist_sub; + clif->ranklist_sub2 = clif_ranklist_sub2; clif->pRanklist = clif_parse_ranklist; clif->update_rankingpoint = clif_update_rankingpoint; clif->hotkeys = clif_hotkeys_send; @@ -23334,6 +24095,7 @@ void clif_defaults(void) clif->skillinfo = clif_skillinfo; clif->addskill = clif_addskill; clif->deleteskill = clif_deleteskill; + clif->playerSkillToPacket = clif_playerSkillToPacket; /* party-specific */ clif->party_created = clif_party_created; clif->party_member_info = clif_party_member_info; @@ -23357,6 +24119,8 @@ void clif_defaults(void) clif->guild_masterormember = clif_guild_masterormember; clif->guild_basicinfo = clif_guild_basicinfo; clif->guild_allianceinfo = clif_guild_allianceinfo; + clif->guild_castlelist = clif_guild_castlelist; + clif->guild_castleinfo = clif_guild_castleinfo; clif->guild_memberlist = clif_guild_memberlist; clif->guild_skillinfo = clif_guild_skillinfo; clif->guild_send_onlineinfo = clif_guild_send_onlineinfo; @@ -23898,4 +24662,11 @@ void clif_defaults(void) clif->pRefineryUIClose = clif_parse_RefineryUIClose; clif->pRefineryUIRefine = clif_parse_RefineryUIRefine; clif->announce_refine_status = clif_announce_refine_status; + clif->pGuildCastleTeleportRequest = clif_parse_GuildCastleTeleportRequest; + clif->pGuildCastleInfoRequest = clif_parse_GuildCastleInfoRequest; + clif->guild_castleteleport_res = clif_guild_castleteleport_res; + clif->lapineDdukDdak_open = clif_lapineDdukDdak_open; + clif->lapineDdukDdak_result = clif_lapineDdukDdak_result; + clif->plapineDdukDdak_ack = clif_parse_lapineDdukDdak_ack; + clif->plapineDdukDdak_close = clif_parse_lapineDdukDdak_close; } diff --git a/src/map/clif.h b/src/map/clif.h index 5c28f80dd..4bc3abdeb 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -56,7 +56,10 @@ struct unit_data; struct view_data; struct achievement_data; // map/achievement.h struct s_refine_requirement; +struct PACKET_ZC_ACK_RANKING_sub; +struct SKILLDATA; +enum battle_dmg_type; enum clif_messages; enum rodex_add_item; enum rodex_get_zeny; @@ -630,6 +633,13 @@ enum inventory_type { INVTYPE_GUILD_STORAGE = 3, }; +/** Guild Teleport Results */ +enum siege_teleport_result { + SIEGE_TP_SUCCESS = 0x0, + SIEGE_TP_NOT_ENOUGH_ZENY = 0x1, + SIEGE_TP_INVALID_MODE = 0x2 +}; + /** * Structures **/ @@ -697,6 +707,32 @@ enum expand_inventory_result { EXPAND_INVENTORY_RESULT_MAX_SIZE = 4 }; +#if PACKETVER_RE_NUM >= 20190807 || PACKETVER_ZERO_NUM >= 20190814 +enum market_buy_result { + MARKET_BUY_RESULT_ERROR = 0xffff, // -1 + MARKET_BUY_RESULT_SUCCESS = 0, + MARKET_BUY_RESULT_NO_ZENY = 1, + MARKET_BUY_RESULT_OVER_WEIGHT = 2, + MARKET_BUY_RESULT_OUT_OF_SPACE = 3, + MARKET_BUY_RESULT_AMOUNT_TOO_BIG = 9 +}; +#else +enum market_buy_result { + MARKET_BUY_RESULT_ERROR = 0, + MARKET_BUY_RESULT_SUCCESS = 1, + MARKET_BUY_RESULT_NO_ZENY = 0, + MARKET_BUY_RESULT_OVER_WEIGHT = 0, + MARKET_BUY_RESULT_OUT_OF_SPACE = 0, + MARKET_BUY_RESULT_AMOUNT_TOO_BIG = 0 +}; +#endif + +enum lapineddukddak_result { + LAPINEDDKUKDDAK_SUCCESS = 0, + LAPINEDDKUKDDAK_INSUFFICIENT_AMOUNT = 5, + LAPINEDDKUKDDAK_INVALID_ITEM = 7, +}; + /** * Clif.c Interface **/ @@ -839,7 +875,7 @@ struct clif_interface { void (*scriptclear) (struct map_session_data *sd, int npcid); /* client-user-interface-related */ void (*viewpoint) (struct map_session_data *sd, int npc_id, int type, int x, int y, int id, int color); - int (*damage) (struct block_list* src, struct block_list* dst, int sdelay, int ddelay, int64 damage, short div, unsigned char type, int64 damage2); + int (*damage) (struct block_list* src, struct block_list* dst, int sdelay, int ddelay, int64 damage, short div, enum battle_dmg_type type, int64 damage2); void (*sitting) (struct block_list* bl); void (*standing) (struct block_list* bl); void (*arrow_create_list) (struct map_session_data *sd); @@ -849,6 +885,8 @@ struct clif_interface { void (*fame_alchemist) (struct map_session_data *sd, int points); void (*fame_taekwon) (struct map_session_data *sd, int points); void (*ranklist) (struct map_session_data *sd, enum fame_list_type type); + void (*ranklist_sub) (struct PACKET_ZC_ACK_RANKING_sub *ranks, enum fame_list_type type); + void (*ranklist_sub2) (uint32 *chars, uint32 *points, enum fame_list_type type); void (*update_rankingpoint) (struct map_session_data *sd, enum fame_list_type type, int points); void (*pRanklist) (int fd, struct map_session_data *sd); void (*hotkeys) (struct map_session_data *sd, int tab); @@ -963,7 +1001,7 @@ struct clif_interface { void (*wedding_effect) (struct block_list *bl); void (*divorced) (struct map_session_data* sd, const char* name); void (*callpartner) (struct map_session_data *sd); - int (*skill_damage) (struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int64 damage, int div, uint16 skill_id, uint16 skill_lv, int type); + int (*skill_damage) (struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int64 damage, int div, uint16 skill_id, uint16 skill_lv, enum battle_dmg_type type); int (*skill_nodamage) (struct block_list *src,struct block_list *dst,uint16 skill_id,int heal,int fail); void (*skill_poseffect) (struct block_list *src, uint16 skill_id, int val, int x, int y, int64 tick); void (*skill_estimation) (struct map_session_data *sd,struct block_list *dst); @@ -1065,6 +1103,7 @@ struct clif_interface { void (*skillinfo) (struct map_session_data *sd,int skill_id, int inf); void (*addskill) (struct map_session_data *sd, int id); void (*deleteskill) (struct map_session_data *sd, int id); + void (*playerSkillToPacket) (struct map_session_data *sd, struct SKILLDATA *skillData, int skillId, int idx, bool newSkill); /* party-specific */ void (*party_created) (struct map_session_data *sd,int result); void (*party_member_info) (struct party_data *p, struct map_session_data *sd); @@ -1088,6 +1127,8 @@ struct clif_interface { void (*guild_masterormember) (struct map_session_data *sd); void (*guild_basicinfo) (struct map_session_data *sd); void (*guild_allianceinfo) (struct map_session_data *sd); + void (*guild_castlelist) (struct map_session_data *sd); + void (*guild_castleinfo) (struct map_session_data *sd, struct guild_castle *gc); void (*guild_memberlist) (struct map_session_data *sd); void (*guild_skillinfo) (struct map_session_data* sd); void (*guild_send_onlineinfo) (struct map_session_data *sd); //[LuzZza] @@ -1257,11 +1298,11 @@ struct clif_interface { /* */ void (*notify_bounditem) (struct map_session_data *sd, unsigned short index); /* */ - int (*delay_damage) (int64 tick, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, unsigned char type); + int (*delay_damage) (int64 tick, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, enum battle_dmg_type type); int (*delay_damage_sub) (int tid, int64 tick, int id, intptr_t data); /* NPC Market */ void (*npc_market_open) (struct map_session_data *sd, struct npc_data *nd); - void (*npc_market_purchase_ack) (struct map_session_data *sd, const struct itemlist *item_list, unsigned char response); + void (*npc_market_purchase_ack) (struct map_session_data *sd, const struct itemlist *item_list, enum market_buy_result response); /* */ bool (*parse_roulette_db) (void); void (*roulette_generate_ack) (struct map_session_data *sd, enum GENERATE_ROULETTE_ACK result, short stage, short prizeIdx, int bonusItemID); @@ -1621,6 +1662,13 @@ struct clif_interface { void (*pRefineryUIClose) (int fd, struct map_session_data *sd); void (*pRefineryUIRefine) (int fd, struct map_session_data *sd); void (*announce_refine_status) (struct map_session_data *sd, int item_id, int refine_level, bool success, enum send_target target); + void (*pGuildCastleTeleportRequest) (int fd, struct map_session_data *sd); + void (*pGuildCastleInfoRequest) (int fd, struct map_session_data *sd); + void (*guild_castleteleport_res) (struct map_session_data *sd, enum siege_teleport_result result); + bool (*lapineDdukDdak_open) (struct map_session_data *sd, int item_id); + bool (*lapineDdukDdak_result) (struct map_session_data *sd, enum lapineddukddak_result result); + void (*plapineDdukDdak_ack) (int fd, struct map_session_data *sd); + void (*plapineDdukDdak_close) (int fd, struct map_session_data *sd); }; #ifdef HERCULES_CORE diff --git a/src/map/guild.c b/src/map/guild.c index ae76b22a3..2faf60e2b 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -38,6 +38,7 @@ #include "map/storage.h" #include "common/HPM.h" #include "common/cbasetypes.h" +#include "common/conf.h" #include "common/ers.h" #include "common/memmgr.h" #include "common/mapindex.h" @@ -147,26 +148,125 @@ static int guild_check_skill_require(struct guild *g, int id) return 1; } -static bool guild_read_castledb(char *str[], int columns, int current) -{// <castle id>,<map name>,<castle name>,<castle event>[,<reserved/unused switch flag>] - struct guild_castle *gc; - int index; +static bool guild_read_castledb_libconfig(void) +{ + struct config_t castle_conf; + struct config_setting_t *castle_db = NULL, *it = NULL; + const char *config_filename = "db/castle_db.conf"; // FIXME hardcoded name + int i = 0; + + if (libconfig->load_file(&castle_conf, config_filename) == 0) + return false; - nullpo_retr(false, str); - index = mapindex->name2id(str[1]); - if (map->mapindex2mapid(index) < 0) // Map not found or on another map-server + if ((castle_db = libconfig->setting_get_member(castle_conf.root, "castle_db")) == NULL) { + libconfig->destroy(&castle_conf); + ShowError("guild_read_castledb_libconfig: can't read %s\n", config_filename); return false; + } + + while ((it = libconfig->setting_get_elem(castle_db, i++)) != NULL) { + guild->read_castledb_libconfig_sub(it, i - 1, config_filename); + } + + libconfig->destroy(&castle_conf); + ShowStatus("Done reading '"CL_WHITE"%u"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", db_size(guild->castle_db), config_filename); + return true; +} + +static bool guild_read_castledb_libconfig_sub(struct config_setting_t *it, int idx, const char *source) +{ + nullpo_ret(it); + nullpo_ret(source); + struct guild_castle *gc = NULL; + const char *name = NULL; + int i32 = 0; CREATE(gc, struct guild_castle, 1); - gc->castle_id = atoi(str[0]); + + if (libconfig->setting_lookup_int(it, "CastleID", &i32) == CONFIG_FALSE) { + aFree(gc); + ShowWarning("guild_read_castledb_libconfig_sub: Invalid or missing CastleID (%d) in \"%s\", entry #%d, skipping.\n", i32, source, idx); + return false; + } + gc->castle_id = i32; + + if (libconfig->setting_lookup_string(it, "MapName", &name) == CONFIG_FALSE) { + aFree(gc); + ShowWarning("guild_read_castledb_libconfig_sub: Invalid or missing MapName in \"%s\", entry #%d, skipping.\n", source, idx); + return false; + } + int index = mapindex->name2id(name); + if (map->mapindex2mapid(index) < 0) { + aFree(gc); + ShowWarning("guild_read_castledb_libconfig_sub: Invalid MapName (%s) in \"%s\", entry #%d, skipping.\n", name, source, idx); + return false; + } gc->mapindex = index; - safestrncpy(gc->castle_name, str[2], sizeof(gc->castle_name)); - safestrncpy(gc->castle_event, str[3], sizeof(gc->castle_event)); - idb_put(guild->castle_db,gc->castle_id,gc); + if (libconfig->setting_lookup_string(it, "CastleName", &name) == CONFIG_FALSE) { + aFree(gc); + ShowWarning("guild_read_castledb_libconfig_sub: Invalid CastleName in \"%s\", entry #%d, skipping.\n", source, idx); + return false; + } + safestrncpy(gc->castle_name, name, sizeof(gc->castle_name)); + + if (libconfig->setting_lookup_string(it, "OnGuildBreakEventName", &name) == CONFIG_FALSE){ + aFree(gc); + ShowWarning("guild_read_castledb_libconfig_sub: Invalid OnGuildBreakEventName in \"%s\", entry #%d, skipping.\n", source, idx); + return false; + } + safestrncpy(gc->castle_event, name, sizeof(gc->castle_event)); + + if (itemdb->lookup_const(it, "SiegeType", &i32) && (i32 >= SIEGE_TYPE_MAX || i32 < 0)) { + ShowWarning("guild_read_castledb_libconfig_sub: Invalid SiegeType in \"%s\", entry #%d, defaulting to SIEGE_TYPE_FE.\n", source, idx); + gc->siege_type = SIEGE_TYPE_FE; + } else { + gc->siege_type = i32; + } + + libconfig->setting_lookup_bool_real(it, "EnableClientWarp", &gc->enable_client_warp); + if (gc->enable_client_warp == true) { + struct config_setting_t *wd = libconfig->setting_get_member(it, "ClientWarp"); + guild->read_castledb_libconfig_sub_warp(wd, source, gc); + } + idb_put(guild->castle_db, gc->castle_id, gc); + return true; +} - //intif->guild_castle_info(gc->castle_id); +static bool guild_read_castledb_libconfig_sub_warp(struct config_setting_t *wd, const char *source, struct guild_castle *gc) +{ + nullpo_retr(false, wd); + nullpo_retr(false, gc); + nullpo_retr(false, source); + + int64 i64 = 0; + struct config_setting_t *it = libconfig->setting_get_member(wd, "Position"); + if (config_setting_is_list(it)) { + int m = map->mapindex2mapid(gc->mapindex); + + gc->client_warp.x = libconfig->setting_get_int_elem(it, 0); + gc->client_warp.y = libconfig->setting_get_int_elem(it, 1); + if (gc->client_warp.x < 0 || gc->client_warp.x >= map->list[m].xs || gc->client_warp.y < 0 || gc->client_warp.y >= map->list[m].ys) { + ShowWarning("guild_read_castledb_libconfig_sub_warp: Invalid Position in \"%s\", for castle (%d).\n", source, gc->castle_id); + return false; + } + } else { + ShowWarning("guild_read_castledb_libconfig_sub_warp: Invalid format for Position in \"%s\", for castle (%d).\n", source, gc->castle_id); + return false; + } + if (libconfig->setting_lookup_int64(wd, "ZenyCost", &i64)) { + if (i64 > MAX_ZENY) { + ShowWarning("guild_read_castledb_libconfig_sub_warp: ZenyCost is too big in \"%s\", for castle (%d), capping to MAX_ZENY.\n", source, gc->castle_id); + } + gc->client_warp.zeny = cap_value((int)i64, 0, MAX_ZENY); + } + if (libconfig->setting_lookup_int64(wd, "ZenyCostSiegeTime", &i64)) { + if (i64 > MAX_ZENY) { + ShowWarning("guild_read_castledb_libconfig_sub_warp: ZenyCostSiegeTime is too big in \"%s\", for castle (%d), capping to MAX_ZENY.\n", source, gc->castle_id); + } + gc->client_warp.zeny_siege = cap_value((int)i64, 0, MAX_ZENY); + } return true; } @@ -554,7 +654,7 @@ static int guild_recv_info(const struct guild *sg) before=*sg; //Perform the check on the user because the first load guild->check_member(sg); - if ((sd = map->nick2sd(sg->master)) != NULL) { + if ((sd = map->nick2sd(sg->master, false)) != NULL) { //If the guild master is online the first time the guild_info is received, //that means he was the first to join, so apply guild skill blocking here. if( battle_config.guild_skill_relog_delay == 1) @@ -1086,13 +1186,14 @@ static int guild_recv_memberinfoshort(int guild_id, int account_id, int char_id, *---------------------------------------------------*/ static int guild_send_message(struct map_session_data *sd, const char *mes) { - int len = (int)strlen(mes); nullpo_ret(sd); - if (sd->status.guild_id == 0) + if (sd->status.guild_id == 0 || sd->guild == NULL) return 0; - intif->guild_message(sd->status.guild_id, sd->status.account_id, mes, len); - guild->recv_message(sd->status.guild_id, sd->status.account_id, mes, len); + + int len = (int)strlen(mes); + + clif->guild_message(sd->guild, sd->status.account_id, mes, len); // Chat logging type 'G' / Guild Chat logs->chat(LOG_CHAT_GUILD, sd->status.guild_id, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, mes); @@ -1101,18 +1202,6 @@ static int guild_send_message(struct map_session_data *sd, const char *mes) } /*==================================================== - * Guild receive a message, will be displayed to whole member - *---------------------------------------------------*/ -static int guild_recv_message(int guild_id, int account_id, const char *mes, int len) -{ - struct guild *g; - if( (g=guild->search(guild_id))==NULL) - return 0; - clif->guild_message(g,account_id,mes,len); - return 0; -} - -/*==================================================== * Member changing position in guild *---------------------------------------------------*/ static int guild_change_memberposition(int guild_id, int account_id, int char_id, short idx) @@ -2321,8 +2410,7 @@ static void do_init_guild(bool minimal) guild->infoevent_db = idb_alloc(DB_OPT_BASE); guild->expcache_ers = ers_new(sizeof(struct guild_expcache),"guild.c::expcache_ers",ERS_OPT_NONE); - sv->readdb(map->db_path, "castle_db.txt", ',', 4, 5, -1, guild->read_castledb); - + guild->read_castledb_libconfig(); sv->readdb(map->db_path, "guild_skill_tree.txt", ',', 2+MAX_GUILD_SKILL_REQUIRE*2, 2+MAX_GUILD_SKILL_REQUIRE*2, -1, guild->read_guildskill_tree_db); //guild skill tree [Komurka] timer->add_func_list(guild->payexp_timer,"guild_payexp_timer"); @@ -2430,7 +2518,6 @@ void guild_defaults(void) guild->change_emblem = guild_change_emblem; guild->emblem_changed = guild_emblem_changed; guild->send_message = guild_send_message; - guild->recv_message = guild_recv_message; guild->send_dot_remove = guild_send_dot_remove; guild->skillupack = guild_skillupack; guild->dobreak = guild_break; @@ -2457,7 +2544,9 @@ void guild_defaults(void) guild->payexp_timer = guild_payexp_timer; guild->sd_check = guild_sd_check; guild->read_guildskill_tree_db = guild_read_guildskill_tree_db; - guild->read_castledb = guild_read_castledb; + guild->read_castledb_libconfig = guild_read_castledb_libconfig; + guild->read_castledb_libconfig_sub = guild_read_castledb_libconfig_sub; + guild->read_castledb_libconfig_sub_warp = guild_read_castledb_libconfig_sub_warp; guild->payexp_timer_sub = guild_payexp_timer_sub; guild->send_xy_timer_sub = guild_send_xy_timer_sub; guild->send_xy_timer = guild_send_xy_timer; diff --git a/src/map/guild.h b/src/map/guild.h index 396cbda86..41f52711d 100644 --- a/src/map/guild.h +++ b/src/map/guild.h @@ -136,7 +136,6 @@ struct guild_interface { int (*change_emblem) (struct map_session_data *sd,int len,const char *data); int (*emblem_changed) (int len,int guild_id,int emblem_id,const char *data); int (*send_message) (struct map_session_data *sd, const char *mes); - int (*recv_message) (int guild_id,int account_id,const char *mes,int len); int (*send_dot_remove) (struct map_session_data *sd); int (*skillupack) (int guild_id,uint16 skill_id,int account_id); int (*dobreak) (struct map_session_data *sd, const char *name); @@ -165,7 +164,9 @@ struct guild_interface { int (*payexp_timer) (int tid, int64 tick, int id, intptr_t data); struct map_session_data *(*sd_check) (int guild_id, int account_id, int char_id); bool (*read_guildskill_tree_db) (char* split[], int columns, int current); - bool (*read_castledb) (char* str[], int columns, int current); + bool (*read_castledb_libconfig) (void); + bool (*read_castledb_libconfig_sub) (struct config_setting_t *it, int idx, const char *source); + bool (*read_castledb_libconfig_sub_warp) (struct config_setting_t *wd, const char *source, struct guild_castle *gc); int (*payexp_timer_sub) (union DBKey key, struct DBData *data, va_list ap); int (*send_xy_timer_sub) (union DBKey key, struct DBData *data, va_list ap); int (*send_xy_timer) (int tid, int64 tick, int id, intptr_t data); diff --git a/src/map/homunculus.c b/src/map/homunculus.c index f3a4c559a..fbb94334c 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -172,7 +172,7 @@ static int homunculus_dead(struct homun_data *hd) } //Vaporize a character's homun. If flag, HP needs to be 80% or above. -static int homunculus_vaporize(struct map_session_data *sd, enum homun_state flag) +static int homunculus_vaporize(struct map_session_data *sd, enum homun_state state, bool force) { struct homun_data *hd; @@ -185,13 +185,13 @@ static int homunculus_vaporize(struct map_session_data *sd, enum homun_state fla if (status->isdead(&hd->bl)) return 0; //Can't vaporize a dead homun. - if (flag == HOM_ST_REST && get_percentage(hd->battle_status.hp, hd->battle_status.max_hp) < 80) + if (!force && get_percentage(hd->battle_status.hp, hd->battle_status.max_hp) < 80) return 0; hd->regen.state.block = 3; //Block regen while vaporized. //Delete timers when vaporized. homun->hunger_timer_delete(hd); - hd->homunculus.vaporize = flag; + hd->homunculus.vaporize = state; if(battle_config.hom_setting&0x40) memset(hd->blockskill, 0, sizeof(hd->blockskill)); clif->hominfo(sd, sd->hd, 0); @@ -258,7 +258,7 @@ static int homunculus_calc_skilltree(struct homun_data *hd, int flag_evolve) for( i = 0; i < MAX_SKILL_TREE && ( id = homun->dbs->skill_tree[c][i].id ) > 0; i++ ) { if( hd->homunculus.hskill[ id - HM_SKILLBASE ].id ) continue; //Skill already known. - j = ( flag_evolve ) ? 10 : hd->homunculus.intimacy; + j = ( flag_evolve ) ? 1000 : hd->homunculus.intimacy; if( j < homun->dbs->skill_tree[c][i].intimacylv ) continue; if(!battle_config.skillfree) { @@ -401,7 +401,7 @@ static bool homunculus_levelup(struct homun_data *hd) if ( battle_config.homunculus_show_growth ) { char output[256] ; sprintf(output, - "Growth: hp:%d sp:%d str(%.2f) agi(%.2f) vit(%.2f) int(%.2f) dex(%.2f) luk(%.2f) ", + msg_sd(hd->master, 892), // Growth: hp:%d sp:%d str(%.2f) agi(%.2f) vit(%.2f) int(%.2f) dex(%.2f) luk(%.2f) growth_max_hp, growth_max_sp, growth_str/10.0, growth_agi/10.0, growth_vit/10.0, growth_int/10.0, growth_dex/10.0, growth_luk/10.0); @@ -525,6 +525,21 @@ static bool homunculus_mutate(struct homun_data *hd, int homun_id) return true; } +static int homunculus_gainexp_real(struct homun_data *hd, unsigned int exp) +{ + nullpo_ret(hd); + nullpo_ret(hd->master); + + hd->homunculus.exp += exp; + + if (hd->master->state.showexp && hd->exp_next > 0) { + char output[256]; + sprintf(output, msg_fd(hd->master->fd, 449), exp, ((float)exp / (float)hd->exp_next * (float)100)); + clif_disp_onlyself(hd->master, output); + } + return 1; +} + static int homunculus_gainexp(struct homun_data *hd, unsigned int exp) { enum homun_type htype; @@ -550,10 +565,10 @@ static int homunculus_gainexp(struct homun_data *hd, unsigned int exp) break; } - hd->homunculus.exp += exp; + homun->gainexp_real(hd, exp); - if(hd->homunculus.exp < hd->exp_next) { - clif->hominfo(hd->master,hd,0); + if (hd->homunculus.exp < hd->exp_next) { + clif->hominfo(hd->master, hd, 0); return 0; } @@ -820,7 +835,7 @@ static int homunculus_db_search(int key, int type) * @param hom The homunculus source data. * @retval false in case of errors. */ -static bool homunculus_create(struct map_session_data *sd, const struct s_homunculus *hom) +static bool homunculus_create(struct map_session_data *sd, const struct s_homunculus *hom, bool is_new) { struct homun_data *hd; int i = 0; @@ -864,7 +879,9 @@ static bool homunculus_create(struct map_session_data *sd, const struct s_homunc map->addiddb(&hd->bl); status_calc_homunculus(hd,SCO_FIRST); - status_percent_heal(&hd->bl, 100, 100); + if (is_new) { + status_percent_heal(&hd->bl, 100, 100); + } hd->hungry_timer = INVALID_TIMER; return true; @@ -921,6 +938,7 @@ static bool homunculus_recv_data(int account_id, const struct s_homunculus *sh, { struct map_session_data *sd; struct homun_data *hd; + bool is_new = false; nullpo_retr(false, sh); @@ -936,15 +954,17 @@ static bool homunculus_recv_data(int account_id, const struct s_homunculus *sh, if (sd->status.char_id != sh->char_id && sd->status.hom_id != sh->hom_id) return false; - if (sd->status.hom_id == 0) //Hom just created. + if (sd->status.hom_id == 0) { // Hom just created. sd->status.hom_id = sh->hom_id; + is_new = true; + } if (sd->hd != NULL) { //uh? Overwrite the data. memcpy(&sd->hd->homunculus, sh, sizeof sd->hd->homunculus); sd->hd->homunculus.char_id = sd->status.char_id; // Correct char id if necessary. } else { - homun->create(sd, sh); + homun->create(sd, sh, is_new); } hd = sd->hd; @@ -1306,7 +1326,7 @@ static bool homunculus_read_skill_db_sub(char *split[], int columns, int current homun->dbs->skill_tree[classid][j].need[k].lv = atoi(split[3+k*2+minJobLevelPresent+1]); } - homun->dbs->skill_tree[classid][j].intimacylv = atoi(split[13+minJobLevelPresent]); + homun->dbs->skill_tree[classid][j].intimacylv = atoi(split[13+minJobLevelPresent]) * 100; return true; } @@ -1369,7 +1389,7 @@ static void homunculus_exp_db_read(void) homun->dbs->exptable[MAX_LEVEL - 1] = 0; } fclose(fp); - ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' levels in '"CL_WHITE"%s"CL_RESET"'.\n", j, filename[i]); + ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' levels in '"CL_WHITE"%s/%s"CL_RESET"'.\n", j, map->db_path, filename[i]); } } @@ -1433,6 +1453,7 @@ void homunculus_defaults(void) homun->evolve = homunculus_evolve; homun->mutate = homunculus_mutate; homun->gainexp = homunculus_gainexp; + homun->gainexp_real = homunculus_gainexp_real; homun->add_intimacy = homunculus_add_intimacy; homun->consume_intimacy = homunculus_consume_intimacy; homun->healed = homunculus_healed; diff --git a/src/map/homunculus.h b/src/map/homunculus.h index 745c7cd84..2914a26cc 100644 --- a/src/map/homunculus.h +++ b/src/map/homunculus.h @@ -133,7 +133,7 @@ struct homun_skill_tree_entry { short id; unsigned char max; unsigned char joblv; - short intimacylv; + int intimacylv; struct { short id; unsigned char lv; @@ -167,7 +167,7 @@ struct homunculus_interface { enum homun_type (*class2type) (int class_); void (*damaged) (struct homun_data *hd); int (*dead) (struct homun_data *hd); - int (*vaporize) (struct map_session_data *sd, enum homun_state flag); + int (*vaporize) (struct map_session_data *sd, enum homun_state state, bool force); int (*delete) (struct homun_data *hd, int emote); int (*checkskill) (struct homun_data *hd, uint16 skill_id); int (*calc_skilltree) (struct homun_data *hd, int flag_evolve); @@ -178,6 +178,7 @@ struct homunculus_interface { bool (*evolve) (struct homun_data *hd); bool (*mutate) (struct homun_data *hd, int homun_id); int (*gainexp) (struct homun_data *hd, unsigned int exp); + int (*gainexp_real) (struct homun_data *hd, unsigned int exp); unsigned int (*add_intimacy) (struct homun_data * hd, unsigned int value); unsigned int (*consume_intimacy) (struct homun_data *hd, unsigned int value); void (*healed) (struct homun_data *hd); @@ -189,7 +190,7 @@ struct homunculus_interface { int (*change_name) (struct map_session_data *sd, const char *name); bool (*change_name_ack) (struct map_session_data *sd, const char *name, int flag); int (*db_search) (int key,int type); - bool (*create) (struct map_session_data *sd, const struct s_homunculus *hom); + bool (*create) (struct map_session_data *sd, const struct s_homunculus *hom, bool is_new); void (*init_timers) (struct homun_data * hd); bool (*call) (struct map_session_data *sd); bool (*recv_data) (int account_id, const struct s_homunculus *sh, int flag); diff --git a/src/map/intif.c b/src/map/intif.c index e25f56b63..5a62f9644 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -153,158 +153,6 @@ static int intif_rename(struct map_session_data *sd, int type, const char *name) return 0; } -// GM Send a message -static int intif_broadcast(const char *mes, int len, int type) -{ - int lp = (type&BC_COLOR_MASK) ? 4 : 0; - - nullpo_ret(mes); - Assert_ret(len < 32000); - // Send to the local players - clif->broadcast(NULL, mes, len, type, ALL_CLIENT); - - if (intif->CheckForCharServer()) - return 0; - - if (chrif->other_mapserver_count < 1) - return 0; //No need to send. - - WFIFOHEAD(inter_fd, 16 + lp + len); - WFIFOW(inter_fd,0) = 0x3000; - WFIFOW(inter_fd,2) = 16 + lp + len; - WFIFOL(inter_fd,4) = 0xFF000000; // 0xFF000000 color signals standard broadcast - WFIFOW(inter_fd,8) = 0; // fontType not used with standard broadcast - WFIFOW(inter_fd,10) = 0; // fontSize not used with standard broadcast - WFIFOW(inter_fd,12) = 0; // fontAlign not used with standard broadcast - WFIFOW(inter_fd,14) = 0; // fontY not used with standard broadcast - if (type&BC_BLUE) - WFIFOL(inter_fd,16) = 0x65756c62; //If there's "blue" at the beginning of the message, game client will display it in blue instead of yellow. - else if (type&BC_WOE) - WFIFOL(inter_fd,16) = 0x73737373; //If there's "ssss", game client will recognize message as 'WoE broadcast'. - memcpy(WFIFOP(inter_fd,16 + lp), mes, len); - WFIFOSET(inter_fd, WFIFOW(inter_fd,2)); - return 0; -} - -static int intif_broadcast2(const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY) -{ - nullpo_ret(mes); - Assert_ret(len < 32000); - // Send to the local players - clif->broadcast2(NULL, mes, len, fontColor, fontType, fontSize, fontAlign, fontY, ALL_CLIENT); - - if (intif->CheckForCharServer()) - return 0; - - if (chrif->other_mapserver_count < 1) - return 0; //No need to send. - - WFIFOHEAD(inter_fd, 16 + len); - WFIFOW(inter_fd,0) = 0x3000; - WFIFOW(inter_fd,2) = 16 + len; - WFIFOL(inter_fd,4) = fontColor; - WFIFOW(inter_fd,8) = fontType; - WFIFOW(inter_fd,10) = fontSize; - WFIFOW(inter_fd,12) = fontAlign; - WFIFOW(inter_fd,14) = fontY; - memcpy(WFIFOP(inter_fd,16), mes, len); - WFIFOSET(inter_fd, WFIFOW(inter_fd,2)); - return 0; -} - -/// send a message using the main chat system -/// <sd> the source of message -/// <message> the message that was sent -static int intif_main_message(struct map_session_data *sd, const char *message) -{ - char output[256]; - - nullpo_ret(sd); - nullpo_ret(message); - - // format the message for main broadcasting - snprintf( output, sizeof(output), msg_txt(386), sd->status.name, message ); - - // send the message using the inter-server broadcast service - intif->broadcast2(output, (int)strlen(output) + 1, 0xFE000000, 0, 0, 0, 0); - - // log the chat message - logs->chat( LOG_CHAT_MAINCHAT, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message ); - - return 0; -} - -// The transmission of Wisp/Page to inter-server (player not found on this server) -static int intif_wis_message(struct map_session_data *sd, const char *nick, const char *mes, int mes_len) -{ - if (intif->CheckForCharServer()) - return 0; - nullpo_ret(sd); - nullpo_ret(nick); - nullpo_ret(mes); - - if (chrif->other_mapserver_count < 1) { - //Character not found. - clif->wis_end(sd->fd, 1); - return 0; - } - - WFIFOHEAD(inter_fd,mes_len + 52); - WFIFOW(inter_fd,0) = 0x3001; - WFIFOW(inter_fd,2) = mes_len + 52; - memcpy(WFIFOP(inter_fd,4), sd->status.name, NAME_LENGTH); - memcpy(WFIFOP(inter_fd,4+NAME_LENGTH), nick, NAME_LENGTH); - memcpy(WFIFOP(inter_fd,4+2*NAME_LENGTH), mes, mes_len); - WFIFOSET(inter_fd, WFIFOW(inter_fd,2)); - - if (battle_config.etc_log) - ShowInfo("intif_wis_message from %s to %s (message: '%s')\n", sd->status.name, nick, mes); - - return 0; -} - -// The reply of Wisp/page -static int intif_wis_replay(int id, int flag) -{ - if (intif->CheckForCharServer()) - return 0; - WFIFOHEAD(inter_fd,7); - WFIFOW(inter_fd,0) = 0x3002; - WFIFOL(inter_fd,2) = id; - WFIFOB(inter_fd,6) = flag; // flag: 0: success to send whisper, 1: target character is not logged in?, 2: ignored by target - WFIFOSET(inter_fd,7); - - if (battle_config.etc_log) - ShowInfo("intif_wis_replay: id: %d, flag:%d\n", id, flag); - - return 0; -} - -// The transmission of GM only Wisp/Page from server to inter-server -static int intif_wis_message_to_gm(char *wisp_name, int permission, char *mes) -{ - int mes_len; - if (intif->CheckForCharServer()) - return 0; - nullpo_ret(wisp_name); - nullpo_ret(mes); - mes_len = (int)strlen(mes) + 1; // + null - Assert_ret(mes_len > 0 && mes_len <= INT16_MAX - 32); - - WFIFOHEAD(inter_fd, mes_len + 32); - WFIFOW(inter_fd,0) = 0x3003; - WFIFOW(inter_fd,2) = mes_len + 32; - memcpy(WFIFOP(inter_fd,4), wisp_name, NAME_LENGTH); - WFIFOL(inter_fd,4+NAME_LENGTH) = permission; - memcpy(WFIFOP(inter_fd,8+NAME_LENGTH), mes, mes_len); - WFIFOSET(inter_fd, WFIFOW(inter_fd,2)); - - if (battle_config.etc_log) - ShowNotice("intif_wis_message_to_gm: from: '%s', required permission: %d, message: '%s'.\n", wisp_name, permission, mes); - - return 0; -} - //Request for saving registry values. static int intif_saveregistry(struct map_session_data *sd) { @@ -714,27 +562,6 @@ static int intif_break_party(int party_id) return 0; } -// Sending party chat -static int intif_party_message(int party_id, int account_id, const char *mes, int len) -{ - if (intif->CheckForCharServer()) - return 0; - - if (chrif->other_mapserver_count < 1) - return 0; //No need to send. - - nullpo_ret(mes); - Assert_ret(len > 0 && len < 32000); - WFIFOHEAD(inter_fd,len + 12); - WFIFOW(inter_fd,0)=0x3027; - WFIFOW(inter_fd,2)=len+12; - WFIFOL(inter_fd,4)=party_id; - WFIFOL(inter_fd,8)=account_id; - memcpy(WFIFOP(inter_fd,12),mes,len); - WFIFOSET(inter_fd,len+12); - return 0; -} - // Request a new leader for party static int intif_party_leaderchange(int party_id, int account_id, int char_id) { @@ -931,28 +758,6 @@ static int intif_guild_break(int guild_id) return 0; } -// Send a guild message -static int intif_guild_message(int guild_id, int account_id, const char *mes, int len) -{ - if (intif->CheckForCharServer()) - return 0; - - if (chrif->other_mapserver_count < 1) - return 0; //No need to send. - - nullpo_ret(mes); - Assert_ret(len > 0 && len < 32000); - WFIFOHEAD(inter_fd, len + 12); - WFIFOW(inter_fd,0)=0x3037; - WFIFOW(inter_fd,2)=len+12; - WFIFOL(inter_fd,4)=guild_id; - WFIFOL(inter_fd,8)=account_id; - memcpy(WFIFOP(inter_fd,12),mes,len); - WFIFOSET(inter_fd,len+12); - - return 0; -} - /** * Requests to change a basic guild information, it is parsed via mapif_parse_GuildBasicInfoChange * To see the information types that can be changed see mmo.h::guild_basic_info @@ -1166,98 +971,6 @@ static int intif_homunculus_requestdelete(int homun_id) //----------------------------------------------------------------- // Packets receive from inter server -// Wisp/Page reception // rewritten by [Yor] -static void intif_parse_WisMessage(int fd) -{ - struct map_session_data* sd; - const char *wisp_source; - char name[NAME_LENGTH]; - int id, i; - - id=RFIFOL(fd,4); - - safestrncpy(name, RFIFOP(fd,32), NAME_LENGTH); - sd = map->nick2sd(name); - if(sd == NULL || strcmp(sd->status.name, name) != 0) { - //Not found - intif_wis_replay(id,1); - return; - } - if(sd->state.ignoreAll) { - intif_wis_replay(id, 2); - return; - } - wisp_source = RFIFOP(fd,8); // speed up [Yor] - for(i=0; i < MAX_IGNORE_LIST && - sd->ignore[i].name[0] != '\0' && - strcmp(sd->ignore[i].name, wisp_source) != 0 - ; i++); - - if (i < MAX_IGNORE_LIST && sd->ignore[i].name[0] != '\0') { - //Ignored - intif_wis_replay(id, 2); - return; - } - //Success to send whisper. - clif->wis_message(sd->fd, wisp_source, RFIFOP(fd,56),RFIFOW(fd,2)-57); - intif_wis_replay(id,0); // success -} - -// Wisp/page transmission result reception -static void intif_parse_WisEnd(int fd) -{ - struct map_session_data* sd; - const char *playername = RFIFOP(fd, 2); - - if (battle_config.etc_log) - ShowInfo("intif_parse_wisend: player: %s, flag: %d\n", playername, RFIFOB(fd,26)); // flag: 0: success to send whisper, 1: target character is not logged in?, 2: ignored by target - sd = map->nick2sd(playername); - if (sd != NULL) - clif->wis_end(sd->fd, RFIFOB(fd,26)); - - return; -} - -static int intif_parse_WisToGM_sub(struct map_session_data *sd, va_list va) -{ - int permission = va_arg(va, int); - char *wisp_name; - char *message; - int len; - - nullpo_ret(sd); - if (!pc_has_permission(sd, permission)) - return 0; - wisp_name = va_arg(va, char*); - message = va_arg(va, char*); - len = va_arg(va, int); - clif->wis_message(sd->fd, wisp_name, message, len); - return 1; -} - -// Received wisp message from map-server via char-server for ALL gm -// 0x3003/0x3803 <packet_len>.w <wispname>.24B <permission>.l <message>.?B -static void intif_parse_WisToGM(int fd) -{ - int permission, mes_len; - char Wisp_name[NAME_LENGTH]; - char mbuf[255] = { 0 }; - char *message; - - mes_len = RFIFOW(fd,2) - 33; // Length not including the NUL terminator - Assert_retv(mes_len > 0 && mes_len < 32000); - message = (mes_len >= 255 ? aMalloc(mes_len + 1) : mbuf); - - permission = RFIFOL(fd,28); - safestrncpy(Wisp_name, RFIFOP(fd,4), NAME_LENGTH); - safestrncpy(message, RFIFOP(fd,32), mes_len + 1); - // information is sent to all online GM - map->foreachpc(intif->pWisToGM_sub, permission, Wisp_name, message, mes_len); - - if (message != mbuf) - aFree(message); -} - // Request player registre static void intif_parse_Registers(int fd) { @@ -1464,12 +1177,6 @@ static void intif_parse_PartyMove(int fd) party->recv_movemap(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOW(fd,14),RFIFOB(fd,16),RFIFOW(fd,17)); } -// ACK party messages -static void intif_parse_PartyMessage(int fd) -{ - party->recv_message(RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12); -} - // ACK guild creation static void intif_parse_GuildCreated(int fd) { @@ -1619,12 +1326,6 @@ static void intif_parse_GuildEmblem(int fd) guild->emblem_changed(RFIFOW(fd,2)-12, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12)); } -// ACK guild message -static void intif_parse_GuildMessage(int fd) -{ - guild->recv_message(RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12); -} - // Reply guild castle data request static void intif_parse_GuildCastleDataLoad(int fd) { @@ -2915,15 +2616,6 @@ static int intif_parse(int fd) } // Processing branch switch(cmd){ - case 0x3800: - if (RFIFOL(fd,4) == 0xFF000000) //Normal announce. - clif->broadcast(NULL, RFIFOP(fd,16), packet_len-16, BC_DEFAULT, ALL_CLIENT); - else //Color announce. - clif->broadcast2(NULL, RFIFOP(fd,16), packet_len-16, RFIFOL(fd,4), RFIFOW(fd,8), RFIFOW(fd,10), RFIFOW(fd,12), RFIFOW(fd,14), ALL_CLIENT); - break; - case 0x3801: intif->pWisMessage(fd); break; - case 0x3802: intif->pWisEnd(fd); break; - case 0x3803: intif->pWisToGM(fd); break; case 0x3804: intif->pRegisters(fd); break; case 0x3805: intif->pAccountStorage(fd); break; case 0x3806: intif->pChangeNameOk(fd); break; @@ -2939,14 +2631,12 @@ static int intif_parse(int fd) case 0x3824: intif->pPartyMemberWithdraw(fd); break; case 0x3825: intif->pPartyMove(fd); break; case 0x3826: intif->pPartyBroken(fd); break; - case 0x3827: intif->pPartyMessage(fd); break; case 0x3830: intif->pGuildCreated(fd); break; case 0x3831: intif->pGuildInfo(fd); break; case 0x3832: intif->pGuildMemberAdded(fd); break; case 0x3834: intif->pGuildMemberWithdraw(fd); break; case 0x3835: intif->pGuildMemberInfoShort(fd); break; case 0x3836: intif->pGuildBroken(fd); break; - case 0x3837: intif->pGuildMessage(fd); break; case 0x3839: intif->pGuildBasicInfoChanged(fd); break; case 0x383a: intif->pGuildMemberInfoChanged(fd); break; case 0x383b: intif->pGuildPosition(fd); break; @@ -3028,10 +2718,10 @@ static int intif_parse(int fd) void intif_defaults(void) { const int packet_len_table [INTIF_PACKET_LEN_TABLE_SIZE] = { - -1,-1,27,-1, -1,-1,37,-1, 7, 0, 0, 0, 0, 0, 0, 0, //0x3800-0x380f + 0, 0, 0, 0, -1,-1,37,-1, 7, 0, 0, 0, 0, 0, 0, 0, //0x3800-0x380f -1, 0, 0, 0, 0, 0, 0, 0, -1,11, 0, 0, 0, 0, 0, 0, //0x3810 Achievements [Smokexyz/Hercules] - 39,-1,15,15, 14,19, 7,-1, 0, 0, 0, 0, 0, 0, 0, 0, //0x3820 - 10,-1,15, 0, 79,25, 7,-1, 0,-1,-1,-1, 14,67,186,-1, //0x3830 + 39,-1,15,15, 14,19, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3820 + 10,-1,15, 0, 79,25, 7, 0, 0,-1,-1,-1, 14,67,186,-1, //0x3830 -1, 0, 0,14, 0, 0, 0, 0, -1,74,-1,11, 11,-1, 0, 0, //0x3840 -1,-1, 7, 7, 7,11, 8, 0, 10, 0, 0, 0, 0, 0, 0, 0, //0x3850 Auctions [Zephyrus] itembound[Akinari] Clan System[Murilo BiO] -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3860 Quests [Kevin] [Inkfish] @@ -3048,11 +2738,6 @@ void intif_defaults(void) /* funcs */ intif->parse = intif_parse; intif->create_pet = intif_create_pet; - intif->broadcast = intif_broadcast; - intif->broadcast2 = intif_broadcast2; - intif->main_message = intif_main_message; - intif->wis_message = intif_wis_message; - intif->wis_message_to_gm = intif_wis_message_to_gm; intif->saveregistry = intif_saveregistry; intif->request_registry = intif_request_registry; intif->request_account_storage = intif_request_account_storage; @@ -3066,7 +2751,6 @@ void intif_defaults(void) intif->party_leave = intif_party_leave; intif->party_changemap = intif_party_changemap; intif->break_party = intif_break_party; - intif->party_message = intif_party_message; intif->party_leaderchange = intif_party_leaderchange; intif->guild_create = intif_guild_create; intif->guild_request_info = intif_guild_request_info; @@ -3074,7 +2758,6 @@ void intif_defaults(void) intif->guild_leave = intif_guild_leave; intif->guild_memberinfoshort = intif_guild_memberinfoshort; intif->guild_break = intif_guild_break; - intif->guild_message = intif_guild_message; intif->guild_change_gm = intif_guild_change_gm; intif->guild_change_basicinfo = intif_guild_change_basicinfo; intif->guild_change_memberinfo = intif_guild_change_memberinfo; @@ -3138,10 +2821,6 @@ void intif_defaults(void) intif->achievements_request = intif_achievements_request; intif->achievements_save = intif_achievements_save; /* parse functions */ - intif->pWisMessage = intif_parse_WisMessage; - intif->pWisEnd = intif_parse_WisEnd; - intif->pWisToGM_sub = intif_parse_WisToGM_sub; - intif->pWisToGM = intif_parse_WisToGM; intif->pRegisters = intif_parse_Registers; intif->pChangeNameOk = intif_parse_ChangeNameOk; intif->pMessageToFD = intif_parse_MessageToFD; @@ -3156,14 +2835,12 @@ void intif_defaults(void) intif->pPartyMemberWithdraw = intif_parse_PartyMemberWithdraw; intif->pPartyMove = intif_parse_PartyMove; intif->pPartyBroken = intif_parse_PartyBroken; - intif->pPartyMessage = intif_parse_PartyMessage; intif->pGuildCreated = intif_parse_GuildCreated; intif->pGuildInfo = intif_parse_GuildInfo; intif->pGuildMemberAdded = intif_parse_GuildMemberAdded; intif->pGuildMemberWithdraw = intif_parse_GuildMemberWithdraw; intif->pGuildMemberInfoShort = intif_parse_GuildMemberInfoShort; intif->pGuildBroken = intif_parse_GuildBroken; - intif->pGuildMessage = intif_parse_GuildMessage; intif->pGuildBasicInfoChanged = intif_parse_GuildBasicInfoChanged; intif->pGuildMemberInfoChanged = intif_parse_GuildMemberInfoChanged; intif->pGuildPosition = intif_parse_GuildPosition; diff --git a/src/map/intif.h b/src/map/intif.h index 8df669217..ffac4a1c9 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -60,11 +60,6 @@ struct intif_interface { int (*parse) (int fd); int (*create_pet)(int account_id, int char_id, int pet_type, int pet_lv, int pet_egg_id, int pet_equip, short intimate, short hungry, char rename_flag, char incubate, char *pet_name); - int (*broadcast) (const char *mes, int len, int type); - int (*broadcast2) (const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY); - int (*main_message) (struct map_session_data* sd, const char* message); - int (*wis_message) (struct map_session_data *sd, const char *nick, const char *mes, int mes_len); - int (*wis_message_to_gm) (char *Wisp_name, int permission, char *mes); int (*saveregistry) (struct map_session_data *sd); int (*request_registry) (struct map_session_data *sd, int flag); void (*request_account_storage) (const struct map_session_data *sd); @@ -78,7 +73,6 @@ struct intif_interface { int (*party_leave) (int party_id,int account_id, int char_id); int (*party_changemap) (struct map_session_data *sd, int online); int (*break_party) (int party_id); - int (*party_message) (int party_id, int account_id, const char *mes,int len); int (*party_leaderchange) (int party_id,int account_id,int char_id); int (*guild_create) (const char *name, const struct guild_member *master); int (*guild_request_info) (int guild_id); @@ -86,7 +80,6 @@ struct intif_interface { int (*guild_leave) (int guild_id, int account_id, int char_id, int flag, const char *mes); int (*guild_memberinfoshort) (int guild_id, int account_id, int char_id, int online, int lv, int class); int (*guild_break) (int guild_id); - int (*guild_message) (int guild_id, int account_id, const char *mes, int len); int (*guild_change_gm) (int guild_id, const char *name, int len); int (*guild_change_basicinfo) (int guild_id, int type, const void *data, int len); int (*guild_change_memberinfo) (int guild_id, int account_id, int char_id, int type, const void *data, int len); @@ -151,10 +144,6 @@ struct intif_interface { void(*achievements_request) (struct map_session_data *sd); void(*achievements_save) (struct map_session_data *sd); /* */ - void (*pWisMessage) (int fd); - void (*pWisEnd) (int fd); - int (*pWisToGM_sub) (struct map_session_data* sd,va_list va); - void (*pWisToGM) (int fd); void (*pRegisters) (int fd); void (*pAccountStorage) (int fd); void (*pChangeNameOk) (int fd); @@ -169,14 +158,12 @@ struct intif_interface { void (*pPartyMemberWithdraw) (int fd); void (*pPartyMove) (int fd); void (*pPartyBroken) (int fd); - void (*pPartyMessage) (int fd); void (*pGuildCreated) (int fd); void (*pGuildInfo) (int fd); void (*pGuildMemberAdded) (int fd); void (*pGuildMemberWithdraw) (int fd); void (*pGuildMemberInfoShort) (int fd); void (*pGuildBroken) (int fd); - void (*pGuildMessage) (int fd); void (*pGuildBasicInfoChanged) (int fd); void (*pGuildMemberInfoChanged) (int fd); void (*pGuildPosition) (int fd); diff --git a/src/map/irc-bot.c b/src/map/irc-bot.c index 996107fea..a0c7276a9 100644 --- a/src/map/irc-bot.c +++ b/src/map/irc-bot.c @@ -396,7 +396,7 @@ static void irc_userjoin(int fd, char *cmd, char *source, char *target, char *ms ircbot->parse_source(source,source_nick,source_ident,source_host); if( ircbot->channel ) { - snprintf(send_string, 150, "[ #%s ] User IRC.%s joined the channel.",ircbot->channel->name,source_nick); + snprintf(send_string, 150, msg_txt(468), ircbot->channel->name, source_nick); // [ #%s ] User IRC.%s joined the channel. clif->channel_msg2(ircbot->channel,send_string); } } @@ -414,9 +414,9 @@ static void irc_userleave(int fd, char *cmd, char *source, char *target, char *m if( ircbot->channel ) { if (!strcmpi(cmd, "QUIT")) - snprintf(send_string, 150, "[ #%s ] User IRC.%s left the channel. [Quit: %s]",ircbot->channel->name,source_nick,msg); + snprintf(send_string, 150, msg_txt(465), ircbot->channel->name, source_nick, msg); // [ #%s ] User IRC.%s left the channel. [Quit: %s] else - snprintf(send_string, 150, "[ #%s ] User IRC.%s left the channel. [%s]",ircbot->channel->name,source_nick,msg); + snprintf(send_string, 150, msg_txt(466), ircbot->channel->name, source_nick, msg); // [ #%s ] User IRC.%s left the channel. [%s] clif->channel_msg2(ircbot->channel,send_string); } } @@ -433,7 +433,7 @@ static void irc_usernick(int fd, char *cmd, char *source, char *target, char *ms ircbot->parse_source(source,source_nick,source_ident,source_host); if( ircbot->channel ) { - snprintf(send_string, 150, "[ #%s ] User IRC.%s is now known as IRC.%s",ircbot->channel->name,source_nick,msg); + snprintf(send_string, 150, msg_txt(467), ircbot->channel->name, source_nick, msg); // [ #%s ] User IRC.%s is now known as IRC.%s clif->channel_msg2(ircbot->channel,send_string); } } diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 8caf88a4e..a97325e57 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -117,73 +117,105 @@ static struct item_data *itemdb_name2id(const char *str) */ static int itemdb_searchname_array_sub(union DBKey key, struct DBData data, va_list ap) { - struct item_data *item = DB->data2ptr(&data); - char *str; - str=va_arg(ap,char *); + struct item_data *itd = DB->data2ptr(&data); + const char *str = va_arg(ap, const char *); + enum item_name_search_flag flag = va_arg(ap, enum item_name_search_flag); + nullpo_ret(str); - if (item == &itemdb->dummy) + + if (itd == &itemdb->dummy) return 1; //Invalid item. - if(stristr(item->jname,str)) - return 0; - if(battle_config.case_sensitive_aegisnames && strstr(item->name,str)) - return 0; - if(!battle_config.case_sensitive_aegisnames && stristr(item->name,str)) + + if ( + (flag == IT_SEARCH_NAME_PARTIAL + && (stristr(itd->jname, str) != NULL + || (battle_config.case_sensitive_aegisnames && strstr(itd->name, str)) + || (!battle_config.case_sensitive_aegisnames && stristr(itd->name, str)) + )) + || (flag == IT_SEARCH_NAME_EXACT + && (strcmp(itd->jname, str) == 0 + || (battle_config.case_sensitive_aegisnames && strcmp(itd->name, str) == 0) + || (!battle_config.case_sensitive_aegisnames && strcasecmp(itd->name, str) == 0) + )) + ) { + return 0; - return strcmpi(item->jname,str); + } else { + return 1; + } } -/*========================================== - * Founds up to N matches. Returns number of matches [Skotlex] - * search flag : - * 0 - approximate match - * 1 - exact match - *------------------------------------------*/ -static int itemdb_searchname_array(struct item_data **data, int size, const char *str, int flag) +/** + * Finds up to passed size matches + * @param data array of struct item_data for returning the results in + * @param size size of the array + * @param str string used in this search + * @param flag search mode refer to enum item_name_search_flag for possible values + * @return returns all found matches in the database which could be bigger than size + **/ +static int itemdb_searchname_array(struct item_data **data, const int size, const char *str, enum item_name_search_flag flag) { - struct item_data* item; - int i; - int count=0; - nullpo_ret(data); nullpo_ret(str); - // Search in the array - for( i = 0; i < ARRAYLENGTH(itemdb->array); ++i ) - { - item = itemdb->array[i]; - if( item == NULL ) + Assert_ret(flag >= IT_SEARCH_NAME_PARTIAL && flag < IT_SEARCH_NAME_MAX); + Assert_ret(size > 0); + + int + results_count = 0, + length = 0; + + // Search in array + for (int i = 0; i < ARRAYLENGTH(itemdb->array); ++i) { + struct item_data *itd = itemdb->array[i]; + + if (itd == NULL) continue; - if( - (!flag - && (stristr(item->jname,str) - || (battle_config.case_sensitive_aegisnames && strstr(item->name,str)) - || (!battle_config.case_sensitive_aegisnames && stristr(item->name,str)) - )) - || (flag - && (strcmp(item->jname,str) == 0 - || (battle_config.case_sensitive_aegisnames && strcmp(item->name,str) == 0) - || (!battle_config.case_sensitive_aegisnames && strcasecmp(item->name,str) == 0) - )) - ) { - if( count < size ) - data[count] = item; - ++count; + if ( + (flag == IT_SEARCH_NAME_PARTIAL + && (stristr(itd->jname, str) != NULL + || (battle_config.case_sensitive_aegisnames && strstr(itd->name, str)) + || (!battle_config.case_sensitive_aegisnames && stristr(itd->name, str)) + )) + || (flag == IT_SEARCH_NAME_EXACT + && (strcmp(itd->jname, str) == 0 + || (battle_config.case_sensitive_aegisnames && strcmp(itd->name, str) == 0) + || (!battle_config.case_sensitive_aegisnames && strcasecmp(itd->name, str) == 0) + )) + ) { + if (length < size) { + data[length] = itd; + ++length; + } + + ++results_count; } } - // search in the db - if( count < size ) - { - struct DBData *db_data[MAX_SEARCH]; - int db_count = 0; - size -= count; - db_count = itemdb->other->getall(itemdb->other, (struct DBData**)&db_data, size, itemdb->searchname_array_sub, str); - for (i = 0; i < db_count; i++) - data[count++] = DB->data2ptr(db_data[i]); - count += db_count; + // Search in dbmap + int dbmap_size = size - length; + if (dbmap_size > 0) { + struct DBData **dbmap_data = NULL; + int dbmap_count = 0; + CREATE(dbmap_data, struct DBData *, dbmap_size); + + dbmap_count = itemdb->other->getall(itemdb->other, dbmap_data, dbmap_size, itemdb->searchname_array_sub, str, flag); + dbmap_size = min(dbmap_count, dbmap_size); + + for (int i = 0; i < dbmap_size; ++i) { + data[length] = DB->data2ptr(dbmap_data[i]); + ++length; + } + + results_count += dbmap_count; + aFree(dbmap_data); + } else { // We got all matches we can return, so we only need to count now. + results_count += itemdb->other->getall(itemdb->other, NULL, 0, itemdb->searchname_array_sub, str, flag); } - return count; + + return results_count; } + /* [Ind/Hercules] */ static int itemdb_chain_item(unsigned short chain_id, int *rate) { @@ -1523,141 +1555,107 @@ static void itemdb_read_chains(void) else itemdb->chain_cache[ECC_ORE] = i; + if (!script->get_constant("ITMCHAIN_SIEGFRIED", &i)) + ShowWarning("itemdb_read_chains: failed to find 'ITMCHAIN_SIEGFRIED' chain to link to cache!\n"); + else + itemdb->chain_cache[ECC_SIEGFRIED] = i; + ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, config_filename); } -/** - * @return: amount of retrieved entries. - **/ -static int itemdb_combo_split_atoi(char *str, int *val) +static bool itemdb_read_combodb_libconfig(void) { - int i; - - nullpo_ret(val); + struct config_t combo_conf; + char filepath[256]; + safesnprintf(filepath, sizeof(filepath), "%s/%s/%s", map->db_path, DBPATH, "item_combo_db.conf"); - for (i=0; i<MAX_ITEMS_PER_COMBO; i++) { - if (!str) break; + if (libconfig->load_file(&combo_conf, filepath) == CONFIG_FALSE) { + ShowError("itemdb_read_combodb_libconfig: can't read %s\n", filepath); + return false; + } - val[i] = atoi(str); - str = strchr(str,':'); - if (str) - *str++=0; + struct config_setting_t *combo_db = NULL; + if ((combo_db = libconfig->setting_get_member(combo_conf.root, "combo_db")) == NULL) { + ShowError("itemdb_read_combodb_libconfig: can't read %s\n", filepath); + return false; } - if( i == 0 ) //No data found. - return 0; + int i = 0; + int count = 0; + struct config_setting_t *it = NULL; - return i; + while ((it = libconfig->setting_get_elem(combo_db, i++)) != NULL) { + if (itemdb->read_combodb_libconfig_sub(it, i - 1, filepath)) + ++count; + } + + libconfig->destroy(&combo_conf); + ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filepath); + return true; } -/** - * <combo{:combo{:combo:{..}}}>,<{ script }> - **/ -static void itemdb_read_combos(void) + +static bool itemdb_read_combodb_libconfig_sub(struct config_setting_t *it, int idx, const char *source) { - uint32 lines = 0, count = 0; - char line[1024]; - char filepath[256]; - FILE* fp; + nullpo_retr(false, it); + nullpo_retr(false, source); - safesnprintf(filepath, 256, "%s/%s", map->db_path, DBPATH"item_combo_db.txt"); + struct config_setting_t *t = NULL; - if ((fp = fopen(filepath, "r")) == NULL) { - ShowError("itemdb_read_combos: File not found \"%s\".\n", filepath); - return; + if ((t = libconfig->setting_get_member(it, "Items")) == NULL) { + ShowWarning("itemdb_read_combodb_libconfig_sub: invalid item list for combo (%d), in (%s), skipping..\n", idx, source); + return false; } - // process rows one by one - while(fgets(line, sizeof(line), fp)) { - char *str[2], *p; - - lines++; - - if (line[0] == '/' && line[1] == '/') - continue; - - memset(str, 0, sizeof(str)); + if (!config_setting_is_array(t)) { + ShowWarning("itemdb_read_combodb_libconfig_sub: the combo (%d) item list must be an array, in (%s), skipping..\n", idx, source); + return false; + } - p = line; - p = trim(p); - if (*p == '\0') - continue;// empty line + int len = libconfig->setting_length(t); + if (len > MAX_ITEMS_PER_COMBO) { + ShowWarning("itemdb_read_combodb_libconfig_sub: the size of combo (%d) item list is too big (%d, max = %d), in (%s), skipping..\n", idx, len, MAX_ITEMS_PER_COMBO, source); + return false; + } - if (!strchr(p,',')) { - /* is there even a single column? */ - ShowError("itemdb_read_combos: Insufficient columns in line %u of \"%s\", skipping.\n", lines, filepath); - continue; - } + struct item_combo *combo = NULL; + RECREATE(itemdb->combos, struct item_combo *, ++itemdb->combo_count); + CREATE(combo, struct item_combo, 1); - str[0] = p; - p = strchr(p,','); - *p = '\0'; - p++; + combo->id = itemdb->combo_count - 1; + combo->count = len; - str[1] = p; - p = strchr(p,','); - p++; + for (int i = 0; i < len; i++) { + struct item_data *item = NULL; + const char *name = libconfig->setting_get_string_elem(t, i); - if (str[1][0] != '{') { - ShowError("itemdb_read_combos(#1): Invalid format (Script column) in line %u of \"%s\", skipping.\n", lines, filepath); - continue; + if ((item = itemdb->name2id(name)) == NULL) { + ShowWarning("itemdb_read_combodb_libconfig_sub: unknown item '%s', in (%s), skipping..\n", name, source); + --itemdb->combo_count; + aFree(combo); + return false; } + combo->nameid[i] = item->nameid; + } - /* no ending key anywhere (missing \}\) */ - if ( str[1][strlen(str[1])-1] != '}' ) { - ShowError("itemdb_read_combos(#2): Invalid format (Script column) in line %u of \"%s\", skipping.\n", lines, filepath); - continue; - } else { - int items[MAX_ITEMS_PER_COMBO]; - int v = 0, retcount = 0; - struct item_combo *combo = NULL; - - if((retcount = itemdb->combo_split_atoi(str[0], items)) < 2) { - ShowError("itemdb_read_combos: line %u of \"%s\" doesn't have enough items to make for a combo (min:2), skipping.\n", lines, filepath); - continue; - } - - /* validate */ - for(v = 0; v < retcount; v++) { - if( !itemdb->exists(items[v]) ) { - ShowError("itemdb_read_combos: line %u of \"%s\" contains unknown item ID %d, skipping.\n", lines, filepath, items[v]); - break; - } - } - /* failed at some item */ - if( v < retcount ) - continue; - - RECREATE(itemdb->combos, struct item_combo*, ++itemdb->combo_count); - - CREATE(combo, struct item_combo, 1); - - combo->count = retcount; - combo->script = script->parse(str[1], filepath, lines, 0, NULL); - combo->id = itemdb->combo_count - 1; - /* populate ->nameid field */ - for( v = 0; v < retcount; v++ ) { - combo->nameid[v] = items[v]; - } - - itemdb->combos[itemdb->combo_count - 1] = combo; + const char *str = NULL; + if (libconfig->setting_lookup_string(it, "Script", &str) == CONFIG_TRUE) { + combo->script = *str ? script->parse(str, source, -idx, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL; + } else { + ShowWarning("itemdb_read_combodb_libconfig_sub: invalid script for combo (%d) in (%s), skipping..\n", idx, source); + --itemdb->combo_count; + aFree(combo); + return false; + } - /* populate the items to refer to this combo */ - for( v = 0; v < retcount; v++ ) { - struct item_data * it; - int index; + itemdb->combos[combo->id] = combo; - it = itemdb->exists(items[v]); - index = it->combos_count; - RECREATE(it->combos, struct item_combo*, ++it->combos_count); - it->combos[index] = combo; - } - } - count++; + /* populate the items to refer to this combo */ + for (int i = 0; i < len; i++) { + struct item_data *item = itemdb->exists(combo->nameid[i]); + RECREATE(item->combos, struct item_combo *, ++item->combos_count); + item->combos[item->combos_count - 1] = combo; } - fclose(fp); - ShowStatus("Done reading '"CL_WHITE"%"PRIu32""CL_RESET"' entries in '"CL_WHITE"item_combo_db"CL_RESET"'.\n", count); - - return; + return true; } /*====================================== @@ -1721,6 +1719,14 @@ static int itemdb_validate_entry(struct item_data *entry, int n, const char *sou script->free_code(entry->unequip_script); entry->unequip_script = NULL; } + if (entry->rental_start_script != NULL) { + script->free_code(entry->rental_start_script); + entry->rental_start_script = NULL; + } + if (entry->rental_end_script != NULL) { + script->free_code(entry->rental_end_script); + entry->rental_end_script = NULL; + } return 0; #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 } @@ -1751,6 +1757,14 @@ static int itemdb_validate_entry(struct item_data *entry, int n, const char *sou script->free_code(entry->unequip_script); entry->unequip_script = NULL; } + if (entry->rental_start_script != NULL) { + script->free_code(entry->rental_start_script); + entry->rental_start_script = NULL; + } + if (entry->rental_end_script != NULL) { + script->free_code(entry->rental_end_script); + entry->rental_end_script = NULL; + } return 0; } } @@ -1878,7 +1892,14 @@ static int itemdb_validate_entry(struct item_data *entry, int n, const char *sou script->free_code(item->unequip_script); item->unequip_script = NULL; } - + if (item->rental_start_script != NULL && item->rental_start_script != entry->rental_start_script) { // Don't free if it's inheriting the same script + script->free_code(item->rental_start_script); + item->rental_start_script = NULL; + } + if (item->rental_end_script != NULL && item->rental_end_script != entry->rental_end_script) { // Don't free if it's inheriting the same script + script->free_code(item->rental_end_script); + item->rental_end_script = NULL; + } *item = *entry; return item->nameid; } @@ -1994,6 +2015,8 @@ static int itemdb_readdb_libconfig_sub(struct config_setting_t *it, int n, const * "> * OnEquipScript: <" OnEquip Script "> * OnUnequipScript: <" OnUnequip Script "> + * OnRentalStartScript: <" on renting script "> + * OnRentalEndScript: <" on renting end script "> * Inherit: inherit or override */ if( !itemdb->lookup_const(it, "Id", &i32) ) { @@ -2271,6 +2294,12 @@ static int itemdb_readdb_libconfig_sub(struct config_setting_t *it, int n, const if( libconfig->setting_lookup_string(it, "OnUnequipScript", &str) ) id.unequip_script = *str ? script->parse(str, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL; + if (libconfig->setting_lookup_string(it, "OnRentalStartScript", &str) != CONFIG_FALSE) + id.rental_start_script = (*str != '\0') ? script->parse(str, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL; + + if (libconfig->setting_lookup_string(it, "OnRentalEndScript", &str) != CONFIG_FALSE) + id.rental_end_script = (*str != '\0') ? script->parse(str, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL; + return itemdb->validate_entry(&id, n, source); } @@ -2407,7 +2436,7 @@ static int itemdb_readdb_libconfig(const char *filename) } db_destroy(duplicate_db); libconfig->destroy(&item_db_conf); - ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filename); + ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filepath); return count; } @@ -2422,6 +2451,98 @@ static uint64 itemdb_unique_id(struct map_session_data *sd) return ((uint64)sd->status.char_id << 32) | sd->status.uniqueitem_counter++; } +static bool itemdb_read_libconfig_lapineddukddak(void) +{ + struct config_t item_lapineddukddak; + struct config_setting_t *it = NULL; + char filepath[256]; + + int i = 0; + int count = 0; + + safesnprintf(filepath, sizeof(filepath), "%s/%s", map->db_path, DBPATH"item_lapineddukddak.conf"); + if (libconfig->load_file(&item_lapineddukddak, filepath) == CONFIG_FALSE) + return false; + + while ((it = libconfig->setting_get_elem(item_lapineddukddak.root, i++)) != NULL) { + if (itemdb->read_libconfig_lapineddukddak_sub(it, filepath)) + ++count; + } + + libconfig->destroy(&item_lapineddukddak); + ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filepath); + return true; +} + +static bool itemdb_read_libconfig_lapineddukddak_sub(struct config_setting_t *it, const char *source) +{ + nullpo_retr(false, it); + nullpo_retr(false, source); + + struct item_data *data = NULL; + const char *name = config_setting_name(it); + const char *str = NULL; + int i32 = 0; + + if ((data = itemdb->name2id(name)) == NULL) { + ShowWarning("itemdb_read_libconfig_lapineddukddak_sub: unknown item '%s', skipping..\n", name); + return false; + } + + data->lapineddukddak = aCalloc(1, sizeof(struct item_lapineddukddak)); + if (libconfig->setting_lookup_int(it, "NeedCount", &i32) == CONFIG_TRUE) + data->lapineddukddak->NeedCount = (int16)i32; + + if (libconfig->setting_lookup_int(it, "NeedRefineMin", &i32) == CONFIG_TRUE) + data->lapineddukddak->NeedRefineMin = (int8)i32; + + if (libconfig->setting_lookup_int(it, "NeedRefineMax", &i32) == CONFIG_TRUE) + data->lapineddukddak->NeedRefineMax = (int8)i32; + + struct config_setting_t *sources = libconfig->setting_get_member(it, "SourceItems"); + itemdb->read_libconfig_lapineddukddak_sub_sources(sources, data); + + if (libconfig->setting_lookup_string(it, "Script", &str) == CONFIG_TRUE) + data->lapineddukddak->script = *str ? script->parse(str, source, -data->nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL; + return true; +} + +static bool itemdb_read_libconfig_lapineddukddak_sub_sources(struct config_setting_t *sources, struct item_data *data) +{ + nullpo_retr(false, data); + nullpo_retr(false, data->lapineddukddak); + + int i = 0; + struct config_setting_t *entry = NULL; + + if (sources == NULL || !config_setting_is_group(sources)) + return false; + + VECTOR_INIT(data->lapineddukddak->SourceItems); + while ((entry = libconfig->setting_get_elem(sources, i++)) != NULL) { + struct item_data *edata = NULL; + struct itemlist_entry item = { 0 }; + const char *name = config_setting_name(entry); + int i32 = 0; + + if ((edata = itemdb->name2id(name)) == NULL) { + ShowWarning("itemdb_read_libconfig_lapineddukddak_sub: unknown item '%s', skipping..\n", name); + continue; + } + item.id = edata->nameid; + + if ((i32 = libconfig->setting_get_int(entry)) == CONFIG_TRUE && (i32 <= 0 || i32 > MAX_AMOUNT)) { + ShowWarning("itemdb_read_libconfig_lapineddukddak_sub: invalid amount (%d) for source item '%s', skipping..\n", i32, name); + continue; + } + item.amount = i32; + + VECTOR_ENSURE(data->lapineddukddak->SourceItems, 1, 1); + VECTOR_PUSH(data->lapineddukddak->SourceItems, item); + } + return true; +} + /** * Reads all item-related databases. */ @@ -2456,10 +2577,11 @@ static void itemdb_read(bool minimal) itemdb->name_constants(); - itemdb->read_combos(); + itemdb->read_combodb_libconfig(); itemdb->read_groups(); itemdb->read_chains(); itemdb->read_packages(); + itemdb->read_libconfig_lapineddukddak(); } /** @@ -2514,8 +2636,18 @@ static void destroy_item_data(struct item_data *self, int free_self) script->free_code(self->equip_script); if( self->unequip_script ) script->free_code(self->unequip_script); + if (self->rental_start_script != NULL) + script->free_code(self->rental_start_script); + if (self->rental_end_script != NULL) + script->free_code(self->rental_end_script); if( self->combos ) aFree(self->combos); + if (self->lapineddukddak != NULL) { + if (self->lapineddukddak->script != NULL) + script->free_code(self->lapineddukddak->script); + VECTOR_CLEAR(self->lapineddukddak->SourceItems); + aFree(self->lapineddukddak); + } HPM->data_store_destroy(&self->hdata); #if defined(DEBUG) // trash item @@ -2800,8 +2932,8 @@ void itemdb_defaults(void) itemdb->isrestricted = itemdb_isrestricted; itemdb->isidentified = itemdb_isidentified; itemdb->isidentified2 = itemdb_isidentified2; - itemdb->combo_split_atoi = itemdb_combo_split_atoi; - itemdb->read_combos = itemdb_read_combos; + itemdb->read_combodb_libconfig = itemdb_read_combodb_libconfig; + itemdb->read_combodb_libconfig_sub = itemdb_read_combodb_libconfig_sub; itemdb->gendercheck = itemdb_gendercheck; itemdb->validate_entry = itemdb_validate_entry; itemdb->readdb_options_additional_fields = itemdb_readdb_options_additional_fields; @@ -2820,4 +2952,7 @@ void itemdb_defaults(void) itemdb->lookup_const = itemdb_lookup_const; itemdb->lookup_const_mask = itemdb_lookup_const_mask; itemdb->addname_sub = itemdb_addname_sub; + itemdb->read_libconfig_lapineddukddak = itemdb_read_libconfig_lapineddukddak; + itemdb->read_libconfig_lapineddukddak_sub = itemdb_read_libconfig_lapineddukddak_sub; + itemdb->read_libconfig_lapineddukddak_sub_sources = itemdb_read_libconfig_lapineddukddak_sub_sources; } diff --git a/src/map/itemdb.h b/src/map/itemdb.h index e032def0c..14ead7707 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -39,7 +39,7 @@ struct hplugin_data_store; #ifndef MAX_ITEM_ID #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 -#define MAX_ITEM_ID 0x20000 +#define MAX_ITEM_ID INT32_MAX #else #define MAX_ITEM_ID 0xFFFF #endif @@ -139,7 +139,6 @@ enum item_itemid { ITEMID_COATING_BOTTLE = 7139, ITEMID_FRAGMENT_OF_CRYSTAL = 7321, ITEMID_SKULL_ = 7420, - ITEMID_TOKEN_OF_SIEGFRIED = 7621, ITEMID_SPECIAL_ALLOY_TRAP = 7940, ITEMID_CATNIP_FRUIT = 11602, ITEMID_RED_POUCH_OF_SURPRISE = 12024, @@ -359,6 +358,7 @@ enum geneticist_item_list { // enum e_chain_cache { ECC_ORE, + ECC_SIEGFRIED, /* */ ECC_MAX, }; @@ -412,6 +412,16 @@ enum ItemOptionTypes { IT_OPT_MAX }; +/** + * Item name search flags + **/ + +enum item_name_search_flag { + IT_SEARCH_NAME_PARTIAL, + IT_SEARCH_NAME_EXACT, + IT_SEARCH_NAME_MAX, +}; + /** Convenience item list (entry) used in various functions */ struct itemlist_entry { int id; ///< Item ID or (inventory) index @@ -482,6 +492,14 @@ struct itemdb_option { struct script_code *script; }; +struct item_lapineddukddak { + int16 NeedCount; + int8 NeedRefineMin; + int8 NeedRefineMax; + VECTOR_DECL(struct itemlist_entry) SourceItems; + struct script_code *script; +}; + struct item_data { int nameid; char name[ITEM_NAME_LENGTH],jname[ITEM_NAME_LENGTH]; @@ -516,12 +534,15 @@ struct item_data { struct script_code *script; ///< Default script for everything. struct script_code *equip_script; ///< Script executed once when equipping. struct script_code *unequip_script; ///< Script executed once when unequipping. + struct script_code *rental_start_script; ///< Script executed once this item get rented + struct script_code *rental_end_script; ///< Script executed once this item rent ends struct { unsigned available : 1; unsigned no_refine : 1; // [celest] unsigned delay_consume : 1; ///< Signifies items that are not consumed immediately upon double-click [Skotlex] unsigned trade_restriction : 9; ///< Item trade restrictions mask (@see enum ItemTradeRestrictions) - unsigned autoequip: 1; + unsigned autoequip : 1; + unsigned auto_favorite : 1; unsigned buyingstore : 1; unsigned bindonequip : 1; unsigned keepafteruse : 1; @@ -548,6 +569,7 @@ struct item_data { /* TODO add a pointer to some sort of (struct extra) and gather all the not-common vals into it to save memory */ struct item_group *group; struct item_package *package; + struct item_lapineddukddak *lapineddukddak; struct hplugin_data_store *hdata; ///< HPM Plugin Data Store }; @@ -632,7 +654,7 @@ struct itemdb_interface { /* */ struct item_data* (*name2id) (const char *str); struct item_data* (*search_name) (const char *name); - int (*search_name_array) (struct item_data** data, int size, const char *str, int flag); + int (*search_name_array) (struct item_data **data, const int size, const char *str, enum item_name_search_flag flag); struct item_data* (*load)(int nameid); struct item_data* (*search)(int nameid); struct item_data* (*exists) (int nameid); @@ -665,8 +687,8 @@ struct itemdb_interface { int (*isrestricted) (struct item *item, int gmlv, int gmlv2, int(*func)(struct item_data *, int, int)); int (*isidentified) (int nameid); int (*isidentified2) (struct item_data *data); - int (*combo_split_atoi) (char *str, int *val); - void (*read_combos) (void); + bool (*read_combodb_libconfig) (void); + bool (*read_combodb_libconfig_sub) (struct config_setting_t *it, int idx, const char *source); int (*gendercheck) (struct item_data *id); int (*validate_entry) (struct item_data *entry, int n, const char *source); void (*readdb_options_additional_fields) (struct itemdb_option *ito, struct config_setting_t *t, const char *source); @@ -685,6 +707,9 @@ struct itemdb_interface { bool (*lookup_const) (const struct config_setting_t *it, const char *name, int *value); bool (*lookup_const_mask) (const struct config_setting_t *it, const char *name, int *value); int (*addname_sub) (union DBKey key, struct DBData *data, va_list ap); + bool (*read_libconfig_lapineddukddak) (void); + bool (*read_libconfig_lapineddukddak_sub) (struct config_setting_t *it, const char *source); + bool (*read_libconfig_lapineddukddak_sub_sources) (struct config_setting_t *sources, struct item_data *data); }; #ifdef HERCULES_CORE diff --git a/src/map/log.c b/src/map/log.c index 5bbca02a9..aa2f5f8f3 100644 --- a/src/map/log.c +++ b/src/map/log.c @@ -511,7 +511,7 @@ static void log_sql_final(void) /** * Initializes logs->config variables */ -void log_set_defaults(void) +static void log_set_defaults(void) { memset(&logs->config, 0, sizeof(logs->config)); @@ -540,7 +540,7 @@ void log_set_defaults(void) * * @retval false in case of error. */ -bool log_config_read_database(const char *filename, struct config_t *config, bool imported) +static bool log_config_read_database(const char *filename, struct config_t *config, bool imported) { struct config_setting_t *setting = NULL; @@ -596,7 +596,7 @@ bool log_config_read_database(const char *filename, struct config_t *config, boo * * @retval false in case of error. */ -bool log_config_read_filter_item(const char *filename, struct config_t *config, bool imported) +static bool log_config_read_filter_item(const char *filename, struct config_t *config, bool imported) { struct config_setting_t *setting = NULL; @@ -625,7 +625,7 @@ bool log_config_read_filter_item(const char *filename, struct config_t *config, * * @retval false in case of error. */ -bool log_config_read_filter_chat(const char *filename, struct config_t *config, bool imported) +static bool log_config_read_filter_chat(const char *filename, struct config_t *config, bool imported) { struct config_setting_t *setting = NULL; @@ -651,7 +651,7 @@ bool log_config_read_filter_chat(const char *filename, struct config_t *config, * * @retval false in case of error. */ -bool log_config_read_filter(const char *filename, struct config_t *config, bool imported) +static bool log_config_read_filter(const char *filename, struct config_t *config, bool imported) { bool retval = true; @@ -674,7 +674,7 @@ bool log_config_read_filter(const char *filename, struct config_t *config, bool * * @retval false in case of error. */ -bool log_config_read(const char *filename, bool imported) +static bool log_config_read(const char *filename, bool imported) { struct config_t config; struct config_setting_t *setting = NULL; @@ -755,7 +755,7 @@ bool log_config_read(const char *filename, bool imported) return retval; } -void log_config_complete(void) +static void log_config_complete(void) { if( logs->config.sql_logs ) { logs->pick_sub = log_pick_sub_sql; diff --git a/src/map/map.c b/src/map/map.c index f92be52e9..332bbe75f 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -2268,30 +2268,25 @@ static struct map_session_data *map_charid2sd(int charid) * (without sensitive case if necessary) * return map_session_data pointer or NULL *------------------------------------------*/ -static struct map_session_data *map_nick2sd(const char *nick) +static struct map_session_data *map_nick2sd(const char *nick, bool allow_partial) { - struct map_session_data* sd; - struct map_session_data* found_sd; - struct s_mapiterator* iter; - size_t nicklen; - int qty = 0; - - if( nick == NULL ) + if (nick == NULL) return NULL; - nicklen = strlen(nick); - iter = mapit_getallusers(); + struct s_mapiterator *iter = mapit_getallusers(); + struct map_session_data *found_sd = NULL; + + if (battle_config.partial_name_scan && allow_partial) { + int nicklen = (int)strlen(nick); + int qty = 0; - found_sd = NULL; - for (sd = BL_UCAST(BL_PC, mapit->first(iter)); mapit->exists(iter); sd = BL_UCAST(BL_PC, mapit->next(iter))) { - if( battle_config.partial_name_scan ) - {// partial name search - if( strnicmp(sd->status.name, nick, nicklen) == 0 ) - { + // partial name search + for (struct map_session_data *sd = BL_UCAST(BL_PC, mapit->first(iter)); mapit->exists(iter); sd = BL_UCAST(BL_PC, mapit->next(iter))) { + if (strnicmp(sd->status.name, nick, nicklen) == 0) { found_sd = sd; - if( strcmp(sd->status.name, nick) == 0 ) - {// Perfect Match + if (strcmp(sd->status.name, nick) == 0) { + // Perfect Match qty = 1; break; } @@ -2299,17 +2294,20 @@ static struct map_session_data *map_nick2sd(const char *nick) qty++; } } - else if( strcasecmp(sd->status.name, nick) == 0 ) - {// exact search only - found_sd = sd; - break; + + if (qty != 1) + found_sd = NULL; + } else { + // exact search only + for (struct map_session_data *sd = BL_UCAST(BL_PC, mapit->first(iter)); mapit->exists(iter); sd = BL_UCAST(BL_PC, mapit->next(iter))) { + if (strcasecmp(sd->status.name, nick) == 0) { + found_sd = sd; + break; + } } } mapit->free(iter); - if( battle_config.partial_name_scan && qty != 1 ) - found_sd = NULL; - return found_sd; } diff --git a/src/map/map.h b/src/map/map.h index 39eb07e4c..6b360e1bc 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -1208,7 +1208,7 @@ END_ZEROED_BLOCK; void (*addiddb) (struct block_list *bl); void (*deliddb) (struct block_list *bl); /* */ - struct map_session_data * (*nick2sd) (const char *nick); + struct map_session_data * (*nick2sd) (const char *nick, bool allow_partial); struct mob_data * (*getmob_boss) (int16 m); struct mob_data * (*id2boss) (int id); uint32 (*race_id2mask) (int race); diff --git a/src/map/mapdefines.h b/src/map/mapdefines.h index df9e9bccb..348ca98fd 100644 --- a/src/map/mapdefines.h +++ b/src/map/mapdefines.h @@ -21,6 +21,8 @@ #ifndef MAP_MAPDEFINES_H #define MAP_MAPDEFINES_H +#include "common/mmo.h" // packet versions + #define MAX_NPC_PER_MAP 512 #define AREA_SIZE (battle->bc->area_size) #define CHAT_AREA_SIZE (battle->bc->chat_area_size) @@ -57,8 +59,14 @@ #define MAPID_UPPERMASK 0x0fff #define MAPID_THIRDMASK (JOBL_THIRD|MAPID_UPPERMASK) -// Max size for inputs to Graffiti, Talkie Box and Vending text prompts +// Max size for inputs to Vending text prompts #define MESSAGE_SIZE (79 + 1) +// Max size for inputs to Graffiti, Talkie Box text prompts +#if PACKETVER_MAIN_NUM >= 20190904 || PACKETVER_RE_NUM >= 20190904 || PACKETVER_ZERO_NUM >= 20190828 +#define TALKBOX_MESSAGE_SIZE 21 +#else +#define TALKBOX_MESSAGE_SIZE (79 + 1) +#endif // String length you can write in the 'talking box' #define CHATBOX_SIZE (70 + 1) // Chatroom-related string sizes diff --git a/src/map/messages_main.h b/src/map/messages_main.h index b9458e374..1ef24d6ab 100644 --- a/src/map/messages_main.h +++ b/src/map/messages_main.h @@ -24,7 +24,7 @@ /* This file is autogenerated, please do not commit manual changes -Latest version: 20190522 +Latest version: 20190918 */ enum clif_messages { @@ -21708,10 +21708,17 @@ AP 상업도/방어도 확인 */ MSG_ID_E2E = 0xe2e, -/*20190522 to latest +/*20190522 to 20190605 관리영지 "%s"(으)로 이동하시겠습니까? (1회 이동 시 마다 1,000제니가 소모됩니다. 공성전 시간에는 제니의 소모가 100배로 증가합니다.) +20190619 to 20190619 +관리영지 "%s"(으)로 이동하시겠습니까? +이동 시 마다 %d제니가 소모됩니다. +20190703 to latest +관리영지 "%s"(으)로 이동하시겠습니까? +이동 시 마다 %d제니가 소모됩니다. +(공성전 시간에는 %d제니가 소모됩니다.) */ MSG_ID_E2F = 0xe2f, /*20190522 to latest @@ -21722,11 +21729,238 @@ AP 상업도: %d / %d */ MSG_ID_E30 = 0xe30, -/*20190522 to latest +/*20190522 to 20190717 공성 영지 내에서는 다른 공성 영지로 이동 할 수 없습니다. +20190717 to latest +공성 영지에서는 사용할 수 없는 기능입니다. */ MSG_ID_E31 = 0xe31, #endif +#if PACKETVER >= 20190619 +/*20190619 to latest +기본 기능 스킬을 습득하지 않은 캐릭터입니다. +*/ + MSG_ID_E32 = 0xe32, +#endif +#if PACKETVER >= 20190703 +/*20190703 to latest +접속하신 IP는 라그나로크 제로 이용이 불가능합니다. +고객센터 또는 홈페이지로 문의해 주십시오. +*/ + MSG_ID_E33 = 0xe33, +#endif +#if PACKETVER >= 20190717 +/*20190717 to latest +탑승/장착 해제 +*/ + MSG_ID_E34 = 0xe34, +/*20190717 to latest +가져오기 +*/ + MSG_ID_E35 = 0xe35, +/*20190717 to latest +직전 노점에 등록된 아이템 정보를 가져옵니다. +*/ + MSG_ID_E36 = 0xe36, +/*20190717 to latest +서버 이슈로 인해 로그인이 제한되고 있습니다. +*/ + MSG_ID_E37 = 0xe37, +/*20190717 to latest +메시지 +*/ + MSG_ID_E38 = 0xe38, +/*20190717 to latest ++18 이상만 플레이가 가능합니다. +*/ + MSG_ID_E39 = 0xe39, +/*20190717 to latest +3시간 이상의 게임 플레이를 권장하지 않습니다. +*/ + MSG_ID_E3A = 0xe3a, +/*20190717 to latest +AP가 부족합니다. +*/ + MSG_ID_E3B = 0xe3b, +#endif +#if PACKETVER >= 20190731 +/*20190731 to latest +제련도가 높아서 조합할 수 없습니다. +*/ + MSG_ID_E3C = 0xe3c, +/*20190731 to latest +제련도가 조합에 필요한 요구치보다 높습니다. +*/ + MSG_ID_E3D = 0xe3d, +/*20190731 to latest +'카드가 끼워져있거나 인챈트 되어 있습니다. +*/ + MSG_ID_E3E = 0xe3e, +/*20190731 to latest +∞ +*/ + MSG_ID_E3F = 0xe3f, +/*20190731 to latest +Z +*/ + MSG_ID_E40 = 0xe40, +/*20190731 to latest +Total : %s Zeny +*/ + MSG_ID_E41 = 0xe41, +#endif +#if PACKETVER >= 20190821 +/*20190821 to latest +계정한정판매 등록창 +*/ + MSG_ID_E42 = 0xe42, +/*20190821 to latest +아이템 DB명 +Item DB Name +*/ + MSG_ID_E43 = 0xe43, +/*20190821 to latest +아이템 DB번호 +Item DB Number +*/ + MSG_ID_E44 = 0xe44, +/*20190821 to latest +판매 갯수 +Number of Sale +*/ + MSG_ID_E45 = 0xe45, +/*20190821 to latest +판매 시작시간 +Sale Start Time +*/ + MSG_ID_E46 = 0xe46, +/*20190821 to latest +판매 종료시간 +*/ + MSG_ID_E47 = 0xe47, +/*20190821 to latest +계정 한정 +*/ + MSG_ID_E48 = 0xe48, +/*20190821 to latest +판매기간 : %d월 %d일 %d시 %d분 +*/ + MSG_ID_E49 = 0xe49, +/*20190821 to latest +구입가능 %d개 +*/ + MSG_ID_E4A = 0xe4a, +/*20190821 to latest +%d개 한정 +*/ + MSG_ID_E4B = 0xe4b, +/*20190821 to latest +>> ItemName : %s / 수량 : %d / 판매기간 : %d월:%d일:%d시:%d분 ~ %d월:%d일:%d시:%d분 +*/ + MSG_ID_E4C = 0xe4c, +/*20190821 to latest +Sold Out +*/ + MSG_ID_E4D = 0xe4d, +/*20190821 to latest +[%s]은(는) 현재 소환할 수 없는 지역에 있습니다. +*/ + MSG_ID_E4E = 0xe4e, +/*20190821 to latest +~ %d월 %d일 %d시 %d분 +*/ + MSG_ID_E4F = 0xe4f, +/*20190821 to latest +상품을 더이상 추가할 수 없습니다 +*/ + MSG_ID_E50 = 0xe50, +#endif +#if PACKETVER >= 20190828 +/*20190828 to latest +장착 중인 아이템은 교환할 수 없습니다. 장착을 해제한 뒤 시도해 주시길 바랍니다. +*/ + MSG_ID_E51 = 0xe51, +#endif +#if PACKETVER >= 20190904 +/*20190904 to latest +길드 창고 이용 중엔 캐릭터 선택창으로 이동 할 수 없습니다. +*/ + MSG_ID_E52 = 0xe52, +/*20190904 to latest +아이템 태그가 포함되어 있어 사용할 수 없습니다. +*/ + MSG_ID_E53 = 0xe53, +/*20190904 to latest +Monster +*/ + MSG_ID_E54 = 0xe54, +/*20190904 to latest +Unknown +*/ + MSG_ID_E55 = 0xe55, +/*20190904 to latest +Undead +*/ + MSG_ID_E56 = 0xe56, +/*20190904 to latest +Animal +*/ + MSG_ID_E57 = 0xe57, +/*20190904 to latest +Plant +*/ + MSG_ID_E58 = 0xe58, +/*20190904 to latest +Insect +*/ + MSG_ID_E59 = 0xe59, +/*20190904 to latest +Marine +*/ + MSG_ID_E5A = 0xe5a, +/*20190904 to latest +Devil +*/ + MSG_ID_E5B = 0xe5b, +/*20190904 to latest +Human +*/ + MSG_ID_E5C = 0xe5c, +/*20190904 to latest +Angel +*/ + MSG_ID_E5D = 0xe5d, +/*20190904 to latest +Dragon +*/ + MSG_ID_E5E = 0xe5e, +#endif +#if PACKETVER >= 20190918 +/*20190918 to latest +Balance: %s %c +*/ + MSG_ID_E5F = 0xe5f, +/*20190918 to latest + ^ff0000본 아이템을 구매 후 7일 이내에는 청약 철회가 가능합니다. 다만, 7일이 지났거나 아이템을 개봉하시면 청약 철회 대상에서 제외 됩니다.또한 구매시 사용된 무료캐시는 청약철회시 반환되지 않습니다.^000000 정말로 아이템을 구매하시겠습니까? 구매하실 경우 %s캐시가 차감됩니다. +*/ + MSG_ID_E60 = 0xe60, +/*20190918 to latest + ^ff0000본 아이템을 구매 후 7일 이내에는 청약 철회가 가능합니다. 다만, 7일이 지났거나 아이템을 개봉하시면 청약 철회 대상에서 제외 됩니다.또한 구매시 사용된 무료캐시는 청약철회시 반환되지 않습니다.^000000 정말로 아이템을 구매하시겠습니까? 구매하실 경우 일반 %s캐시, 무료 %s캐시가 차감됩니다. +*/ + MSG_ID_E61 = 0xe61, +/*20190918 to latest +[%s]의 호출이 거부되었습니다. +*/ + MSG_ID_E62 = 0xe62, +/*20190918 to latest +구매 한도액은 소지액을 초과할 수 없습니다. +*/ + MSG_ID_E63 = 0xe63, +/*20190918 to latest +노점을 여는데 실패하였습니다. 구매노점 개설을 닫아주시기 바랍니다. +*/ + MSG_ID_E64 = 0xe64, +#endif }; #endif /* MAP_MESSAGES_MAIN_H */ diff --git a/src/map/messages_re.h b/src/map/messages_re.h index 3a434ca29..4ae3dee1d 100644 --- a/src/map/messages_re.h +++ b/src/map/messages_re.h @@ -24,7 +24,7 @@ /* This file is autogenerated, please do not commit manual changes -Latest version: 20190522 +Latest version: 20190918 */ enum clif_messages { @@ -21187,10 +21187,17 @@ AP 상업도/방어도 확인 */ MSG_ID_E2E = 0xe2e, -/*20190522 to latest +/*20190522 to 20190605 관리영지 "%s"(으)로 이동하시겠습니까? (1회 이동 시 마다 1,000제니가 소모됩니다. 공성전 시간에는 제니의 소모가 100배로 증가합니다.) +20190619 to 20190626 +관리영지 "%s"(으)로 이동하시겠습니까? +이동 시 마다 %d제니가 소모됩니다. +20190703 to latest +관리영지 "%s"(으)로 이동하시겠습니까? +이동 시 마다 %d제니가 소모됩니다. +(공성전 시간에는 %d제니가 소모됩니다.) */ MSG_ID_E2F = 0xe2f, /*20190522 to latest @@ -21201,11 +21208,238 @@ AP 상업도: %d / %d */ MSG_ID_E30 = 0xe30, -/*20190522 to latest +/*20190522 to 20190703 공성 영지 내에서는 다른 공성 영지로 이동 할 수 없습니다. +20190717 to latest +공성 영지에서는 사용할 수 없는 기능입니다. */ MSG_ID_E31 = 0xe31, #endif +#if PACKETVER >= 20190619 +/*20190619 to latest +기본 기능 스킬을 습득하지 않은 캐릭터입니다. +*/ + MSG_ID_E32 = 0xe32, +#endif +#if PACKETVER >= 20190703 +/*20190703 to latest +접속하신 IP는 라그나로크 제로 이용이 불가능합니다. +고객센터 또는 홈페이지로 문의해 주십시오. +*/ + MSG_ID_E33 = 0xe33, +#endif +#if PACKETVER >= 20190717 +/*20190717 to latest +탑승/장착 해제 +*/ + MSG_ID_E34 = 0xe34, +/*20190717 to latest +가져오기 +*/ + MSG_ID_E35 = 0xe35, +/*20190717 to latest +직전 노점에 등록된 아이템 정보를 가져옵니다. +*/ + MSG_ID_E36 = 0xe36, +/*20190717 to latest +서버 이슈로 인해 로그인이 제한되고 있습니다. +*/ + MSG_ID_E37 = 0xe37, +/*20190717 to latest +메시지 +*/ + MSG_ID_E38 = 0xe38, +/*20190717 to latest ++18 이상만 플레이가 가능합니다. +*/ + MSG_ID_E39 = 0xe39, +/*20190717 to latest +3시간 이상의 게임 플레이를 권장하지 않습니다. +*/ + MSG_ID_E3A = 0xe3a, +/*20190717 to latest +AP가 부족합니다. +*/ + MSG_ID_E3B = 0xe3b, +#endif +#if PACKETVER >= 20190731 +/*20190731 to latest +제련도가 높아서 조합할 수 없습니다. +*/ + MSG_ID_E3C = 0xe3c, +/*20190731 to latest +제련도가 조합에 필요한 요구치보다 높습니다. +*/ + MSG_ID_E3D = 0xe3d, +/*20190731 to latest +'카드가 끼워져있거나 인챈트 되어 있습니다. +*/ + MSG_ID_E3E = 0xe3e, +/*20190731 to latest +∞ +*/ + MSG_ID_E3F = 0xe3f, +/*20190731 to latest +Z +*/ + MSG_ID_E40 = 0xe40, +/*20190731 to latest +Total : %s Zeny +*/ + MSG_ID_E41 = 0xe41, +#endif +#if PACKETVER >= 20190821 +/*20190821 to latest +계정한정판매 등록창 +*/ + MSG_ID_E42 = 0xe42, +/*20190821 to latest +아이템 DB명 +Item DB Name +*/ + MSG_ID_E43 = 0xe43, +/*20190821 to latest +아이템 DB번호 +Item DB Number +*/ + MSG_ID_E44 = 0xe44, +/*20190821 to latest +판매 갯수 +Number of Sale +*/ + MSG_ID_E45 = 0xe45, +/*20190821 to latest +판매 시작시간 +Sale Start Time +*/ + MSG_ID_E46 = 0xe46, +/*20190821 to latest +판매 종료시간 +*/ + MSG_ID_E47 = 0xe47, +/*20190821 to latest +계정 한정 +*/ + MSG_ID_E48 = 0xe48, +/*20190821 to latest +판매기간 : %d월 %d일 %d시 %d분 +*/ + MSG_ID_E49 = 0xe49, +/*20190821 to latest +구입가능 %d개 +*/ + MSG_ID_E4A = 0xe4a, +/*20190821 to latest +%d개 한정 +*/ + MSG_ID_E4B = 0xe4b, +/*20190821 to latest +>> ItemName : %s / 수량 : %d / 판매기간 : %d월:%d일:%d시:%d분 ~ %d월:%d일:%d시:%d분 +*/ + MSG_ID_E4C = 0xe4c, +/*20190821 to latest +Sold Out +*/ + MSG_ID_E4D = 0xe4d, +/*20190821 to latest +[%s]은(는) 현재 소환할 수 없는 지역에 있습니다. +*/ + MSG_ID_E4E = 0xe4e, +/*20190821 to latest +~ %d월 %d일 %d시 %d분 +*/ + MSG_ID_E4F = 0xe4f, +/*20190821 to latest +상품을 더이상 추가할 수 없습니다 +*/ + MSG_ID_E50 = 0xe50, +#endif +#if PACKETVER >= 20190828 +/*20190828 to latest +장착 중인 아이템은 교환할 수 없습니다. 장착을 해제한 뒤 시도해 주시길 바랍니다. +*/ + MSG_ID_E51 = 0xe51, +#endif +#if PACKETVER >= 20190904 +/*20190904 to latest +길드 창고 이용 중엔 캐릭터 선택창으로 이동 할 수 없습니다. +*/ + MSG_ID_E52 = 0xe52, +/*20190904 to latest +아이템 태그가 포함되어 있어 사용할 수 없습니다. +*/ + MSG_ID_E53 = 0xe53, +/*20190904 to latest +Monster +*/ + MSG_ID_E54 = 0xe54, +/*20190904 to latest +Unknown +*/ + MSG_ID_E55 = 0xe55, +/*20190904 to latest +Undead +*/ + MSG_ID_E56 = 0xe56, +/*20190904 to latest +Animal +*/ + MSG_ID_E57 = 0xe57, +/*20190904 to latest +Plant +*/ + MSG_ID_E58 = 0xe58, +/*20190904 to latest +Insect +*/ + MSG_ID_E59 = 0xe59, +/*20190904 to latest +Marine +*/ + MSG_ID_E5A = 0xe5a, +/*20190904 to latest +Devil +*/ + MSG_ID_E5B = 0xe5b, +/*20190904 to latest +Human +*/ + MSG_ID_E5C = 0xe5c, +/*20190904 to latest +Angel +*/ + MSG_ID_E5D = 0xe5d, +/*20190904 to latest +Dragon +*/ + MSG_ID_E5E = 0xe5e, +#endif +#if PACKETVER >= 20190918 +/*20190918 to latest +Balance: %s %c +*/ + MSG_ID_E5F = 0xe5f, +/*20190918 to latest + ^ff0000본 아이템을 구매 후 7일 이내에는 청약 철회가 가능합니다. 다만, 7일이 지났거나 아이템을 개봉하시면 청약 철회 대상에서 제외 됩니다.또한 구매시 사용된 무료캐시는 청약철회시 반환되지 않습니다.^000000 정말로 아이템을 구매하시겠습니까? 구매하실 경우 %s캐시가 차감됩니다. +*/ + MSG_ID_E60 = 0xe60, +/*20190918 to latest + ^ff0000본 아이템을 구매 후 7일 이내에는 청약 철회가 가능합니다. 다만, 7일이 지났거나 아이템을 개봉하시면 청약 철회 대상에서 제외 됩니다.또한 구매시 사용된 무료캐시는 청약철회시 반환되지 않습니다.^000000 정말로 아이템을 구매하시겠습니까? 구매하실 경우 일반 %s캐시, 무료 %s캐시가 차감됩니다. +*/ + MSG_ID_E61 = 0xe61, +/*20190918 to latest +호출이 거부되었습니다. +*/ + MSG_ID_E62 = 0xe62, +/*20190918 to latest +구매 한도액은 소지액을 초과할 수 없습니다. +*/ + MSG_ID_E63 = 0xe63, +/*20190918 to latest +노점을 여는데 실패하였습니다. 구매노점 개설을 닫아주시기 바랍니다. +*/ + MSG_ID_E64 = 0xe64, +#endif }; #endif /* MAP_MESSAGES_RE_H */ diff --git a/src/map/messages_zero.h b/src/map/messages_zero.h index 43f8b4f31..039d215ac 100644 --- a/src/map/messages_zero.h +++ b/src/map/messages_zero.h @@ -24,7 +24,7 @@ /* This file is autogenerated, please do not commit manual changes -Latest version: 20190515 +Latest version: 20190918 */ enum clif_messages { @@ -17793,10 +17793,14 @@ AP 상업도/방어도 확인 */ MSG_ID_E2E = 0xe2e, -/*20190515 to latest +/*20190515 to 20190605 관리영지 "%s"(으)로 이동하시겠습니까? (1회 이동 시 마다 1,000제니가 소모됩니다. 공성전 시간에는 제니의 소모가 100배로 증가합니다.) +20190626 to latest +관리영지 "%s"(으)로 이동하시겠습니까? +이동 시 마다 %d제니가 소모됩니다. +(공성전 시간에는 %d제니가 소모됩니다.) */ MSG_ID_E2F = 0xe2f, /*20190515 to latest @@ -17807,11 +17811,240 @@ AP 상업도: %d / %d */ MSG_ID_E30 = 0xe30, -/*20190515 to latest +/*20190515 to 20190717 공성 영지 내에서는 다른 공성 영지로 이동 할 수 없습니다. +20190724 to latest +공성 영지에서는 사용할 수 없는 기능입니다. */ MSG_ID_E31 = 0xe31, #endif +#if PACKETVER >= 20190626 +/*20190626 to latest +기본 기능 스킬을 습득하지 않은 캐릭터입니다. +*/ + MSG_ID_E32 = 0xe32, +/*20190626 to latest +접속하신 IP는 라그나로크 제로 이용이 불가능합니다. +고객센터 또는 홈페이지로 문의해 주십시오. +*/ + MSG_ID_E33 = 0xe33, +#endif +#if PACKETVER >= 20190709 +/*20190709 to latest +탑승/장착 해제 +*/ + MSG_ID_E34 = 0xe34, +/*20190709 to latest +가져오기 +*/ + MSG_ID_E35 = 0xe35, +/*20190709 to latest +직전 노점에 등록된 아이템 정보를 가져옵니다. +*/ + MSG_ID_E36 = 0xe36, +/*20190709 to latest +서버 이슈로 인해 로그인이 제한되고 있습니다. +*/ + MSG_ID_E37 = 0xe37, +/*20190709 to latest +메시지 +*/ + MSG_ID_E38 = 0xe38, +/*20190709 to latest ++18 이상만 플레이가 가능합니다. +*/ + MSG_ID_E39 = 0xe39, +/*20190709 to latest +3시간 이상의 게임 플레이를 권장하지 않습니다. +*/ + MSG_ID_E3A = 0xe3a, +/*20190709 to latest +AP가 부족합니다. +*/ + MSG_ID_E3B = 0xe3b, +#endif +#if PACKETVER >= 20190724 +/*20190724 to latest +제련도가 높아서 조합할 수 없습니다. +*/ + MSG_ID_E3C = 0xe3c, +/*20190724 to latest +제련도가 조합에 필요한 요구치보다 높습니다. +*/ + MSG_ID_E3D = 0xe3d, +/*20190724 to latest +'카드가 끼워져있거나 인챈트 되어 있습니다. +*/ + MSG_ID_E3E = 0xe3e, +#endif +#if PACKETVER >= 20190814 +/*20190814 to latest +∞ +*/ + MSG_ID_E3F = 0xe3f, +/*20190814 to latest +Z +*/ + MSG_ID_E40 = 0xe40, +/*20190814 to latest +Total : %s Zeny +*/ + MSG_ID_E41 = 0xe41, +/*20190814 to latest +계정한정판매 등록창 +*/ + MSG_ID_E42 = 0xe42, +/*20190814 to latest +아이템 DB명 +Item DB Name +*/ + MSG_ID_E43 = 0xe43, +/*20190814 to latest +아이템 DB번호 +Item DB Number +*/ + MSG_ID_E44 = 0xe44, +/*20190814 to latest +판매 갯수 +Number of Sale +*/ + MSG_ID_E45 = 0xe45, +/*20190814 to latest +판매 시작시간 +Sale Start Time +*/ + MSG_ID_E46 = 0xe46, +/*20190814 to latest +판매 종료시간 +*/ + MSG_ID_E47 = 0xe47, +/*20190814 to latest +계정 한정 +*/ + MSG_ID_E48 = 0xe48, +/*20190814 to 20190814 +판매기간 : %d월 %d일 ~ %d월 %d일 +20190828 to latest +판매기간 : %d월 %d일 %d시 %d분 +*/ + MSG_ID_E49 = 0xe49, +/*20190814 to latest +구입가능 %d개 +*/ + MSG_ID_E4A = 0xe4a, +/*20190814 to latest +%d개 한정 +*/ + MSG_ID_E4B = 0xe4b, +/*20190814 to latest +>> ItemName : %s / 수량 : %d / 판매기간 : %d월:%d일:%d시:%d분 ~ %d월:%d일:%d시:%d분 +*/ + MSG_ID_E4C = 0xe4c, +/*20190814 to latest +Sold Out +*/ + MSG_ID_E4D = 0xe4d, +/*20190814 to latest +[%s]은(는) 현재 소환할 수 없는 지역에 있습니다. +*/ + MSG_ID_E4E = 0xe4e, +#endif +#if PACKETVER >= 20190828 +/*20190828 to latest +~ %d월 %d일 %d시 %d분 +*/ + MSG_ID_E4F = 0xe4f, +/*20190828 to latest +상품을 더이상 추가할 수 없습니다 +*/ + MSG_ID_E50 = 0xe50, +/*20190828 to latest +장착 중인 아이템은 교환할 수 없습니다. 장착을 해제한 뒤 시도해 주시길 바랍니다. +*/ + MSG_ID_E51 = 0xe51, +#endif +#if PACKETVER >= 20190911 +/*20190911 to latest +길드 창고 이용 중엔 캐릭터 선택창으로 이동 할 수 없습니다. +*/ + MSG_ID_E52 = 0xe52, +/*20190911 to latest +아이템 태그가 포함되어 있어 사용할 수 없습니다. +*/ + MSG_ID_E53 = 0xe53, +/*20190911 to latest +Monster +*/ + MSG_ID_E54 = 0xe54, +/*20190911 to latest +Unknown +*/ + MSG_ID_E55 = 0xe55, +/*20190911 to latest +Undead +*/ + MSG_ID_E56 = 0xe56, +/*20190911 to latest +Animal +*/ + MSG_ID_E57 = 0xe57, +/*20190911 to latest +Plant +*/ + MSG_ID_E58 = 0xe58, +/*20190911 to latest +Insect +*/ + MSG_ID_E59 = 0xe59, +/*20190911 to latest +Marine +*/ + MSG_ID_E5A = 0xe5a, +/*20190911 to latest +Devil +*/ + MSG_ID_E5B = 0xe5b, +/*20190911 to latest +Human +*/ + MSG_ID_E5C = 0xe5c, +/*20190911 to latest +Angel +*/ + MSG_ID_E5D = 0xe5d, +/*20190911 to latest +Dragon +*/ + MSG_ID_E5E = 0xe5e, +/*20190911 to latest +Balance: %s %c +*/ + MSG_ID_E5F = 0xe5f, +/*20190911 to latest + ^ff0000본 아이템을 구매 후 7일 이내에는 청약 철회가 가능합니다. 다만, 7일이 지났거나 아이템을 개봉하시면 청약 철회 대상에서 제외 됩니다.또한 구매시 사용된 무료캐시는 청약철회시 반환되지 않습니다.^000000 정말로 아이템을 구매하시겠습니까? 구매하실 경우 %s캐시가 차감됩니다. +*/ + MSG_ID_E60 = 0xe60, +/*20190911 to latest + ^ff0000본 아이템을 구매 후 7일 이내에는 청약 철회가 가능합니다. 다만, 7일이 지났거나 아이템을 개봉하시면 청약 철회 대상에서 제외 됩니다.또한 구매시 사용된 무료캐시는 청약철회시 반환되지 않습니다.^000000 정말로 아이템을 구매하시겠습니까? 구매하실 경우 일반 %s캐시, 무료 %s캐시가 차감됩니다. +*/ + MSG_ID_E61 = 0xe61, +/*20190911 to 20190911 +호출이 거부되었습니다. +20190918 to latest +[%s]의 호출이 거부되었습니다. +*/ + MSG_ID_E62 = 0xe62, +#endif +#if PACKETVER >= 20190918 +/*20190918 to latest +구매 한도액은 소지액을 초과할 수 없습니다. +*/ + MSG_ID_E63 = 0xe63, +/*20190918 to latest +노점을 여는데 실패하였습니다. 구매노점 개설을 닫아주시기 바랍니다. +*/ + MSG_ID_E64 = 0xe64, +#endif }; #endif /* MAP_MESSAGES_ZERO_H */ diff --git a/src/map/mob.c b/src/map/mob.c index 8511f8523..215f82f5f 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -239,6 +239,14 @@ static void mvptomb_destroy(struct mob_data *md) m = nd->bl.m; + struct s_mapiterator *iter = mapit_geteachpc(); + for (struct map_session_data *sd = BL_UCAST(BL_PC, mapit->first(iter)); mapit->exists(iter); sd = BL_UCAST(BL_PC, mapit->next(iter))) { + if (sd->npc_id == nd->bl.id) { + sd->state.npc_unloaded = 1; + } + } + mapit->free(iter); + clif->clearunit_area(&nd->bl,CLR_OUTSIGHT); map->delblock(&nd->bl); @@ -471,7 +479,7 @@ static bool mob_ksprotected(struct block_list *src, struct block_list *target) // Message to KS if( DIFF_TICK(sd->ks_floodprotect_tick, tick) <= 0 ) { - sprintf(output, "[KS Warning!! - Owner : %s]", pl_sd->status.name); + sprintf(output, msg_sd(sd, 890), pl_sd->status.name); // [KS Warning!! - Owner : %s] clif_disp_onlyself(sd, output); sd->ks_floodprotect_tick = tick + 2000; @@ -480,7 +488,7 @@ static bool mob_ksprotected(struct block_list *src, struct block_list *target) // Message to Owner if( DIFF_TICK(pl_sd->ks_floodprotect_tick, tick) <= 0 ) { - sprintf(output, "[Watch out! %s is trying to KS you!]", sd->status.name); + sprintf(output, msg_sd(pl_sd, 891), sd->status.name); // [Watch out! %s is trying to KS you!] clif_disp_onlyself(pl_sd, output); pl_sd->ks_floodprotect_tick = tick + 2000; @@ -2570,7 +2578,7 @@ static int mob_dead(struct mob_data *md, struct block_list *src, int type) // Announce first, or else ditem will be freed. [Lance] // By popular demand, use base drop rate for autoloot code. [Skotlex] - mob->item_drop(md, dlist, ditem, 0, md->db->dropitem[i].p, homkillonly); + mob->item_drop(md, dlist, ditem, 0, battle_config.autoloot_adjust ? drop_rate : md->db->dropitem[i].p, homkillonly); } // Ore Discovery [Celest] @@ -4604,6 +4612,7 @@ static int mob_read_db_sub(struct config_setting_t *mobt, int n, const char *sou * AttackMotion: attack motion * DamageMotion: damage motion * MvpExp: mvp experience + * DamageTakenRate: damage taken rate * MvpDrops: { * AegisName: chance * ... @@ -4837,6 +4846,12 @@ static int mob_read_db_sub(struct config_setting_t *mobt, int n, const char *sou } } + if (mob->lookup_const(mobt, "DamageTakenRate", &i32) && i32 >= 0) { + md.dmg_taken_rate = cap_value(i32, 1, INT_MAX); + } else if (!inherit) { + md.dmg_taken_rate = 100; + } + mob->read_db_additional_fields(&md, mobt, n, source); return mob->db_validate_entry(&md, n, source); @@ -4952,7 +4967,7 @@ static int mob_read_libconfig(const char *filename, bool ignore_missing) } } libconfig->destroy(&mob_db_conf); - ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filename); + ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filepath); return count; } @@ -5075,7 +5090,7 @@ static int mob_read_randommonster(void) summon[i].qty = 1; } fclose(fp); - ShowStatus("Done reading '"CL_WHITE"%u"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n",count,mobfile[i]); + ShowStatus("Done reading '"CL_WHITE"%u"CL_RESET"' entries in '"CL_WHITE"%s/%s"CL_RESET"'.\n",count, map->db_path, mobfile[i]); } return 0; } @@ -5192,7 +5207,7 @@ static void mob_readchatdb(void) count++; } fclose(fp); - ShowStatus("Done reading '"CL_WHITE"%"PRIu32""CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, arc); + ShowStatus("Done reading '"CL_WHITE"%"PRIu32""CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filepath); } /*========================================== @@ -5547,6 +5562,29 @@ static int mob_final_ratio_sub(union DBKey key, struct DBData *data, va_list ap) return 0; } +static int mob_reload_sub_mob(struct mob_data *md, va_list args) +{ + nullpo_ret(md); + md->db = mob_db(md->class_); + + status_calc_mob(md, SCO_FIRST); + + // If the view data was not overwritten manually + if (md->vd != NULL) { + // Get the new view data from the mob database + md->vd = mob_get_viewdata(md->class_); + + // If they are spawned right now + if (md->bl.prev != NULL) { + // Respawn all mobs on client side so that they are displayed correctly(if their view id changed) + clif->clearunit_area(&md->bl, CLR_OUTSIGHT); + clif->spawn(&md->bl); + } + } + + return 0; +} + static void mob_reload(void) { int i; @@ -5570,6 +5608,7 @@ static void mob_reload(void) mob->destroy_drop_groups(); mob->load(false); + map->foreachmob(mob->reload_sub_mob); } /** @@ -5726,6 +5765,7 @@ void mob_defaults(void) /* */ mob->reload = mob_reload; + mob->reload_sub_mob = mob_reload_sub_mob; mob->init = do_init_mob; mob->final = do_final_mob; /* */ diff --git a/src/map/mob.h b/src/map/mob.h index b63efd272..a48c4cc74 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -206,6 +206,7 @@ struct mob_db { unsigned int option; int summonper[MAX_RANDOMMONSTER]; int maxskill; + int dmg_taken_rate; struct mob_skill skill[MAX_MOBSKILL]; struct spawn_info spawn[10]; struct hplugin_data_store *hdata; ///< HPM Plugin Data Store @@ -244,6 +245,7 @@ struct mob_data { unsigned int dmg; unsigned int flag : 2; //0: Normal. 1: Homunc exp. 2: Pet exp } dmglog[DAMAGELOG_SIZE]; + int dmg_taken_rate; struct spawn_data *spawn; //Spawn data. int spawn_timer; //Required for Convex Mirror struct item *lootitem; @@ -488,6 +490,7 @@ struct mob_interface { int (*init) (bool mimimal); int (*final) (void); void (*reload) (void); + int (*reload_sub_mob) (struct mob_data *md, va_list args); /* */ struct mob_db* (*db) (int index); struct mob_chat* (*chat) (short id); diff --git a/src/map/npc.c b/src/map/npc.c index c7fc7e133..868b8711a 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1258,6 +1258,9 @@ static void run_tomb(struct map_session_data *sd, struct npc_data *nd) char time[10]; nullpo_retv(nd); + + sd->npc_id = nd->bl.id; + strftime(time, sizeof(time), "%H:%M", localtime(&nd->u.tomb.kill_time)); // TODO: Find exact color? @@ -1349,8 +1352,10 @@ static int npc_scriptcont(struct map_session_data *sd, int id, bool closing) return 1; } - if(id != npc->fake_nd->bl.id) { // Not item script - if ((npc->checknear(sd,target)) == NULL){ + if (id != npc->fake_nd->bl.id) { // Not item script + if (sd->state.npc_unloaded != 0) { + sd->state.npc_unloaded = 0; + } else if ((npc->checknear(sd,target)) == NULL) { ShowWarning("npc_scriptcont: failed npc->checknear test.\n"); return 1; } @@ -1371,8 +1376,10 @@ static int npc_scriptcont(struct map_session_data *sd, int id, bool closing) if( sd->progressbar.npc_id && DIFF_TICK(sd->progressbar.timeout,timer->gettick()) > 0 ) return 1; - if( !sd->st ) + if( !sd->st ) { + sd->npc_id = 0; return 1; + } if( closing && sd->st->state == CLOSE ) sd->st->state = END; @@ -2115,7 +2122,7 @@ static int npc_buylist(struct map_session_data *sd, struct itemlist *item_list) /** * Processes incoming npc market purchase list **/ -static int npc_market_buylist(struct map_session_data *sd, struct itemlist *item_list) +static enum market_buy_result npc_market_buylist(struct map_session_data *sd, struct itemlist *item_list) { struct npc_data* nd; struct npc_item_list *shop = NULL; @@ -2129,7 +2136,7 @@ static int npc_market_buylist(struct map_session_data *sd, struct itemlist *item nd = npc->checknear(sd,map->id2bl(sd->npc_shopid)); if (nd == NULL || nd->subtype != SCRIPT || VECTOR_LENGTH(*item_list) == 0 || !nd->u.scr.shop || nd->u.scr.shop->type != NST_MARKET) - return 1; + return MARKET_BUY_RESULT_ERROR; shop = nd->u.scr.shop->item; shop_size = nd->u.scr.shop->items; @@ -2149,18 +2156,18 @@ static int npc_market_buylist(struct map_session_data *sd, struct itemlist *item entry->id == itemdb_viewid(shop[j].nameid) //item_avail replacement ); if (j == shop_size) /* TODO find official response for this */ - return 1; // no such item in shop + return MARKET_BUY_RESULT_ERROR; // no such item in shop entry->id = shop[j].nameid; //item_avail replacement if (entry->amount > (int)shop[j].qty) - return 1; + return MARKET_BUY_RESULT_AMOUNT_TOO_BIG; value = shop[j].value; npc_market_qty[i] = j; if (!itemdb->exists(entry->id)) /* TODO find official response for this */ - return 1; // item no longer in itemdb + return MARKET_BUY_RESULT_ERROR; // item no longer in itemdb if (!itemdb->isstackable(entry->id) && entry->amount > 1) { //Exploit? You can't buy more than 1 of equipment types o.O @@ -2184,13 +2191,13 @@ static int npc_market_buylist(struct map_session_data *sd, struct itemlist *item } if (z > sd->status.zeny) /* TODO find official response for this */ - return 1; // Not enough Zeny + return MARKET_BUY_RESULT_NO_ZENY; // Not enough Zeny if( w + sd->weight > sd->max_weight ) /* TODO find official response for this */ - return 1; // Too heavy + return MARKET_BUY_RESULT_OVER_WEIGHT; // Too heavy if( pc->inventoryblank(sd) < new_ ) /* TODO find official response for this */ - return 1; // Not enough space to store items + return MARKET_BUY_RESULT_OUT_OF_SPACE; // Not enough space to store items pc->payzeny(sd,(int)z,LOG_TYPE_NPC, NULL); @@ -2200,7 +2207,7 @@ static int npc_market_buylist(struct map_session_data *sd, struct itemlist *item j = npc_market_qty[i]; if (entry->amount > (int)shop[j].qty) /* wohoo someone tampered with the packet. */ - return 1; + return MARKET_BUY_RESULT_AMOUNT_TOO_BIG; shop[j].qty -= entry->amount; @@ -2218,7 +2225,7 @@ static int npc_market_buylist(struct map_session_data *sd, struct itemlist *item } } - return 0; + return MARKET_BUY_RESULT_SUCCESS; } /** @@ -4368,8 +4375,7 @@ static const char *npc_parse_mapflag(const char *w1, const char *w2, const char if (!strcmpi(w3, "nosave")) { char savemap[32]; int savex, savey; - if (state == 0) - ; //Map flag disabled. + if (state == 0); //Map flag disabled. else if (w4 && !strcmpi(w4, "SavePoint")) { map->list[m].save.map = 0; map->list[m].save.x = -1; @@ -4662,7 +4668,8 @@ static const char *npc_parse_mapflag(const char *w1, const char *w2, const char } } - if( modifier[0] == '\0' ) { + if (state == 0); //Map flag disabled. + else if (modifier[0] == '\0') { ShowWarning("npc_parse_mapflag: Missing 5th param for 'adjust_unit_duration' flag! removing flag from %s in file '%s', line '%d'.\n", map->list[m].name, filepath, strline(buffer,start-buffer)); if (retval) *retval = EXIT_FAILURE; } else if( !( skill_id = skill->name2id(skill_name) ) || !skill->get_unit_id( skill->name2id(skill_name), 0) ) { @@ -4721,7 +4728,8 @@ static const char *npc_parse_mapflag(const char *w1, const char *w2, const char } } - if( modifier[0] == '\0' ) { + if (state == 0); //Map flag disabled. + else if (modifier[0] == '\0') { ShowWarning("npc_parse_mapflag: Missing 5th param for 'adjust_skill_damage' flag! removing flag from %s in file '%s', line '%d'.\n", map->list[m].name, filepath, strline(buffer,start-buffer)); if (retval) *retval = EXIT_FAILURE; } else if( !( skill_id = skill->name2id(skill_name) ) ) { diff --git a/src/map/npc.h b/src/map/npc.h index 2819cbd87..5ff63532d 100644 --- a/src/map/npc.h +++ b/src/map/npc.h @@ -34,6 +34,8 @@ struct hplugin_data_store; struct itemlist; // map/itemdb.h struct view_data; +enum market_buy_result; + enum npc_parse_options { NPO_NONE = 0x0, NPO_ONINIT = 0x1, @@ -149,7 +151,7 @@ enum actor_classes { #define MAX_NPC_CLASS 1000 // New NPC range #define MAX_NPC_CLASS2_START 10001 -#define MAX_NPC_CLASS2_END 10310 +#define MAX_NPC_CLASS2_END 10344 //Script NPC events. enum npce_event { @@ -310,7 +312,7 @@ struct npc_interface { void (*trader_count_funds) (struct npc_data *nd, struct map_session_data *sd); bool (*trader_pay) (struct npc_data *nd, struct map_session_data *sd, int price, int points); void (*trader_update) (int master); - int (*market_buylist) (struct map_session_data *sd, struct itemlist *item_list); + enum market_buy_result (*market_buylist) (struct map_session_data *sd, struct itemlist *item_list); int (*barter_buylist) (struct map_session_data *sd, struct barteritemlist *item_list); bool (*trader_open) (struct map_session_data *sd, struct npc_data *nd); void (*market_fromsql) (void); diff --git a/src/map/packets.h b/src/map/packets.h index 45b47c921..8fb47eb7a 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -1949,9 +1949,22 @@ packet(0x96e,clif->ackmergeitems); packet(0x0b1c,clif->pPing); #endif -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 packet(0x0b21,clif->pHotkey2); packet(0x0b22,clif->pHotkeyRowShift2); // CZ_SHORTCUTKEYBAR_ROTATE #endif +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190522 || PACKETVER_ZERO_NUM >= 20190515 + packet(0x0b28,clif->pGuildCastleTeleportRequest); + packet(0x0b2c,clif->pGuildCastleInfoRequest); +#endif + +#if PACKETVER >= 20160302 + packet(0x0a4f,clif->plapineDdukDdak_ack); +#endif + +#if PACKETVER >= 20160504 + packet(0x0a70,clif->plapineDdukDdak_close); +#endif + #endif /* MAP_PACKETS_H */ diff --git a/src/map/packets_keys_main.h b/src/map/packets_keys_main.h index 6c1cc151a..b7f25a83d 100644 --- a/src/map/packets_keys_main.h +++ b/src/map/packets_keys_main.h @@ -37,7 +37,7 @@ packetKeys(0x49357d72,0x22c370a1,0x5f836591); #endif -// 2010-11-23aRagexeRE, 2010-11-24aRagexeRE, 2010-11-24bRagexeRE, 2010-11-25aRagexeRE, 2010-11-26aRagexeRE, 2010-11-30aRagexeRE, 2010-12-07aRagexeRE, 2010-12-14aRagexeRE, 2010-12-21aRagexeRE, 2010-12-23aRagexeRE, 2010-12-28aRagexeRE, 2011-01-04aRagexeRE, 2011-01-05aRagexeRE, 2011-01-11aRagexeRE, 2011-01-18aRagexeRE, 2011-01-25aRagexeRE, 2011-01-26aRagexeRE, 2011-01-26bRagexeRE, 2011-01-31aRagexeRE, 2011-01-31bRagexeRE, 2011-01-31cRagexeRE, 2011-02-08aRagexeRE, 2011-02-15aRagexeRE, 2011-02-22aRagexeRE, 2011-02-23aRagexeRE, 2011-02-23bRagexeRE, 2011-02-24aRagexeRE, 2011-02-25aRagexeRE, 2011-02-28aRagexeRE, 2011-03-08aRagexeRE, 2011-03-09aRagexeRE, 2011-03-09bRagexeRE, 2011-03-09cRagexeRE, 2011-03-09dRagexeRE, 2011-03-15aRagexeRE, 2011-03-22aRagexeRE, 2011-03-29aRagexeRE, 2011-03-30aRagexeRE, 2011-03-30cRagexeRE, 2011-04-05aRagexeRE, 2011-04-12aRagexeRE, 2011-04-19aRagexeRE, 2011-04-20aRagexeRE, 2011-04-26aRagexeRE, 2011-04-27aRagexeRE, 2011-05-03aRagexeRE, 2011-05-11aRagexeRE, 2011-05-17bRagexeRE, 2011-05-24aRagexeRE, 2011-05-26aRagexeRE, 2011-05-31aRagexeRE, 2011-06-07aRagexeRE, 2011-06-08aRagexeRE, 2011-06-08bRagexeRE, 2011-06-08cRagexeRE, 2011-06-09aRagexeRE, 2011-06-14bRagexeRE, 2011-06-22aRagexeRE, 2011-06-28aRagexeRE, 2011-07-06aRagexeRE, 2011-07-13aRagexeRE, 2011-07-13bRagexeRE, 2011-07-13cRagexeRE, 2011-07-19aRagexeRE, 2011-07-26aRagexeRE, 2011-08-03aRagexeRE, 2011-08-03bRagexeRE, 2011-08-10aRagexeRE, 2013-12-23aRagexeRE, 2014-05-08aRagexe, 2014-05-08aRagexeRE, 2014-06-11eRagexe, 2015-02-25hRagexe, 2018-03-15aRagexe, 2018-03-21aRagexe, 2018-03-21aRagexeRE, 2018-03-28bRagexe, 2018-03-28bRagexeRE, 2018-04-04bRagexe, 2018-04-04cRagexeRE, 2018-04-18aRagexe, 2018-04-18bRagexeRE, 2018-04-25cRagexe, 2018-04-25cRagexeRE, 2018-05-02bRagexe, 2018-05-02bRagexeRE, 2018-05-02dRagexeRE, 2018-05-09aRagexe, 2018-05-16cRagexe, 2018-05-16cRagexeRE, 2018-05-23aRagexe, 2018-05-23aRagexeRE, 2018-05-30aRagexe, 2018-05-30bRagexeRE, 2018-05-30cRagexeRE, 2018-06-05bRagexe, 2018-06-05bRagexeRE, 2018-06-12aRagexeRE, 2018-06-12bRagexeRE, 2018-06-20cRagexe, 2018-06-20dRagexeRE, 2018-06-20eRagexe, 2018-06-20eRagexeRE, 2018-06-21aRagexe, 2018-06-21aRagexeRE, 2018-07-04aRagexe, 2018-07-04aRagexeRE, 2018-07-11aRagexeRE, 2018-07-18bRagexe, 2018-07-18bRagexeRE, 2018-07-18bRagexeRE1, 2018-07-18cRagexe, 2018-07-18cRagexeRE, 2018-08-01cRagexe, 2018-08-01cRagexeRE, 2018-08-08bRagexe, 2018-08-08bRagexeRE, 2018-08-22cRagexe, 2018-08-22cRagexeRE, 2018-08-29aRagexe, 2018-08-29aRagexeRE, 2018-08-29bRagexeRE, 2018-08-31aRagexe, 2018-09-12dRagexe, 2018-09-12dRagexeRE, 2018-09-19aRagexe, 2018-09-19aRagexeRE, 2018-10-02aRagexe, 2018-10-02aRagexeRE, 2018-10-02bRagexe, 2018-10-02bRagexeRE, 2018-10-17_02aRagexe, 2018-10-17_02aRagexeRE, 2018-10-17_03aRagexe, 2018-10-17_03aRagexeRE, 2018-10-17bRagexe, 2018-10-17bRagexeRE, 2018-10-24bRagexe, 2018-10-31aRagexe, 2018-10-31bRagexe, 2018-10-31cRagexeRE, 2018-11-07aRagexe, 2018-11-07aRagexeRE, 2018-11-14cRagexe, 2018-11-14cRagexeRE, 2018-11-14dRagexe, 2018-11-14dRagexeRE, 2018-11-21bRagexe, 2018-11-21cRagexeRE, 2018-11-28aRagexe, 2018-11-28aRagexeRE, 2018-11-28bRagexe, 2018-11-28cRagexe, 2018-12-05aRagexe, 2018-12-05bRagexeRE, 2018-12-12aRagexe, 2018-12-12aRagexeRE, 2018-12-12bRagexe, 2018-12-12bRagexeRE, 2018-12-19bRagexe, 2018-12-19bRagexeRE, 2018-12-26aRagexe, 2018-12-26aRagexeRE, 2019-01-09aRagexe, 2019-01-09bRagexeRE, 2019-01-16bRagexe, 2019-01-16bRagexeRE, 2019-01-16cRagexe, 2019-01-16cRagexeRE, 2019-01-23dRagexe, 2019-01-23dRagexeRE, 2019-02-13IRagexeRE, 2019-02-13bRagexe, 2019-02-13eRagexe, 2019-02-20aRagexeRE, 2019-02-27aRagexe, 2019-02-27bRagexeRE, 2019-02-28aRagexe, 2019-02-28aRagexeRE, 2019-03-06bRagexe, 2019-03-06bRagexeRE, 2019-03-06cRagexe, 2019-03-06cRagexeRE, 2019-03-13aRagexe, 2019-03-20aRagexe, 2019-03-20aRagexeRE, 2019-03-22aRagexe, 2019-03-22aRagexeRE, 2019-03-27bRagexe, 2019-03-27bRagexeRE, 2019-04-03aRagexe, 2019-04-03bRagexeRE, 2019-04-03cRagexeRE, 2019-04-17aRagexe, 2019-04-17cRagexeRE, 2019-04-18aRagexe, 2019-04-18aRagexeRE, 2019-05-08cRagexe, 2019-05-08dRagexeRE, 2019-05-08eRagexeRE, 2019-05-22bRagexe, 2019-05-22bRagexeRE, 2019-05-22cRagexe, 2019-05-22cRagexeRE, 2019-05-23aRagexe, 2019-05-29aRagexe, 2019-05-29bRagexeRE, 2019-05-29cRagexe, 2019-05-29cRagexeRE, 2019-05-30aRagexe, 2019-05-30aRagexeRE +// 2010-11-23aRagexeRE, 2010-11-24aRagexeRE, 2010-11-24bRagexeRE, 2010-11-25aRagexeRE, 2010-11-26aRagexeRE, 2010-11-30aRagexeRE, 2010-12-07aRagexeRE, 2010-12-14aRagexeRE, 2010-12-21aRagexeRE, 2010-12-23aRagexeRE, 2010-12-28aRagexeRE, 2011-01-04aRagexeRE, 2011-01-05aRagexeRE, 2011-01-11aRagexeRE, 2011-01-18aRagexeRE, 2011-01-25aRagexeRE, 2011-01-26aRagexeRE, 2011-01-26bRagexeRE, 2011-01-31aRagexeRE, 2011-01-31bRagexeRE, 2011-01-31cRagexeRE, 2011-02-08aRagexeRE, 2011-02-15aRagexeRE, 2011-02-22aRagexeRE, 2011-02-23aRagexeRE, 2011-02-23bRagexeRE, 2011-02-24aRagexeRE, 2011-02-25aRagexeRE, 2011-02-28aRagexeRE, 2011-03-08aRagexeRE, 2011-03-09aRagexeRE, 2011-03-09bRagexeRE, 2011-03-09cRagexeRE, 2011-03-09dRagexeRE, 2011-03-15aRagexeRE, 2011-03-22aRagexeRE, 2011-03-29aRagexeRE, 2011-03-30aRagexeRE, 2011-03-30cRagexeRE, 2011-04-05aRagexeRE, 2011-04-12aRagexeRE, 2011-04-19aRagexeRE, 2011-04-20aRagexeRE, 2011-04-26aRagexeRE, 2011-04-27aRagexeRE, 2011-05-03aRagexeRE, 2011-05-11aRagexeRE, 2011-05-17bRagexeRE, 2011-05-24aRagexeRE, 2011-05-26aRagexeRE, 2011-05-31aRagexeRE, 2011-06-07aRagexeRE, 2011-06-08aRagexeRE, 2011-06-08bRagexeRE, 2011-06-08cRagexeRE, 2011-06-09aRagexeRE, 2011-06-14bRagexeRE, 2011-06-22aRagexeRE, 2011-06-28aRagexeRE, 2011-07-06aRagexeRE, 2011-07-13aRagexeRE, 2011-07-13bRagexeRE, 2011-07-13cRagexeRE, 2011-07-19aRagexeRE, 2011-07-26aRagexeRE, 2011-08-03aRagexeRE, 2011-08-03bRagexeRE, 2011-08-10aRagexeRE, 2013-12-23aRagexeRE, 2014-05-08aRagexe, 2014-05-08aRagexeRE, 2014-06-11eRagexe, 2015-02-25hRagexe, 2018-03-15aRagexe, 2018-03-21aRagexe, 2018-03-21aRagexeRE, 2018-03-28bRagexe, 2018-03-28bRagexeRE, 2018-04-04bRagexe, 2018-04-04cRagexeRE, 2018-04-18aRagexe, 2018-04-18bRagexeRE, 2018-04-25cRagexe, 2018-04-25cRagexeRE, 2018-05-02bRagexe, 2018-05-02bRagexeRE, 2018-05-02dRagexeRE, 2018-05-09aRagexe, 2018-05-16cRagexe, 2018-05-16cRagexeRE, 2018-05-23aRagexe, 2018-05-23aRagexeRE, 2018-05-30aRagexe, 2018-05-30bRagexeRE, 2018-05-30cRagexeRE, 2018-06-05bRagexe, 2018-06-05bRagexeRE, 2018-06-12aRagexeRE, 2018-06-12bRagexeRE, 2018-06-20cRagexe, 2018-06-20dRagexeRE, 2018-06-20eRagexe, 2018-06-20eRagexeRE, 2018-06-21aRagexe, 2018-06-21aRagexeRE, 2018-07-04aRagexe, 2018-07-04aRagexeRE, 2018-07-11aRagexeRE, 2018-07-18bRagexe, 2018-07-18bRagexeRE, 2018-07-18bRagexeRE1, 2018-07-18cRagexe, 2018-07-18cRagexeRE, 2018-08-01cRagexe, 2018-08-01cRagexeRE, 2018-08-08bRagexe, 2018-08-08bRagexeRE, 2018-08-22cRagexe, 2018-08-22cRagexeRE, 2018-08-29aRagexe, 2018-08-29aRagexeRE, 2018-08-29bRagexeRE, 2018-08-31aRagexe, 2018-09-12dRagexe, 2018-09-12dRagexeRE, 2018-09-19aRagexe, 2018-09-19aRagexeRE, 2018-10-02aRagexe, 2018-10-02aRagexeRE, 2018-10-02bRagexe, 2018-10-02bRagexeRE, 2018-10-17_02aRagexe, 2018-10-17_02aRagexeRE, 2018-10-17_03aRagexe, 2018-10-17_03aRagexeRE, 2018-10-17bRagexe, 2018-10-17bRagexeRE, 2018-10-24bRagexe, 2018-10-31aRagexe, 2018-10-31bRagexe, 2018-10-31cRagexeRE, 2018-11-07aRagexe, 2018-11-07aRagexeRE, 2018-11-14cRagexe, 2018-11-14cRagexeRE, 2018-11-14dRagexe, 2018-11-14dRagexeRE, 2018-11-21bRagexe, 2018-11-21cRagexeRE, 2018-11-28aRagexe, 2018-11-28aRagexeRE, 2018-11-28bRagexe, 2018-11-28cRagexe, 2018-12-05aRagexe, 2018-12-05bRagexeRE, 2018-12-12aRagexe, 2018-12-12aRagexeRE, 2018-12-12bRagexe, 2018-12-12bRagexeRE, 2018-12-19bRagexe, 2018-12-19bRagexeRE, 2018-12-26aRagexe, 2018-12-26aRagexeRE, 2019-01-09aRagexe, 2019-01-09bRagexeRE, 2019-01-16bRagexe, 2019-01-16bRagexeRE, 2019-01-16cRagexe, 2019-01-16cRagexeRE, 2019-01-23dRagexe, 2019-01-23dRagexeRE, 2019-02-13IRagexeRE, 2019-02-13bRagexe, 2019-02-13eRagexe, 2019-02-20aRagexeRE, 2019-02-27aRagexe, 2019-02-27bRagexeRE, 2019-02-28aRagexe, 2019-02-28aRagexeRE, 2019-03-06bRagexe, 2019-03-06bRagexeRE, 2019-03-06cRagexe, 2019-03-06cRagexeRE, 2019-03-13aRagexe, 2019-03-20aRagexe, 2019-03-20aRagexeRE, 2019-03-22aRagexe, 2019-03-22aRagexeRE, 2019-03-27bRagexe, 2019-03-27bRagexeRE, 2019-04-03aRagexe, 2019-04-03bRagexeRE, 2019-04-03cRagexeRE, 2019-04-17aRagexe, 2019-04-17cRagexeRE, 2019-04-18aRagexe, 2019-04-18aRagexeRE, 2019-05-08cRagexe, 2019-05-08dRagexeRE, 2019-05-08eRagexeRE, 2019-05-22bRagexe, 2019-05-22bRagexeRE, 2019-05-22cRagexe, 2019-05-22cRagexeRE, 2019-05-23aRagexe, 2019-05-29aRagexe, 2019-05-29bRagexeRE, 2019-05-29cRagexe, 2019-05-29cRagexeRE, 2019-05-30aRagexe, 2019-05-30aRagexeRE, 2019-06-05JRagexeRE, 2019-06-05KRagexe, 2019-06-05LRagexeRE, 2019-06-05fRagexe, 2019-06-05hRagexeRE, 2019-06-19bRagexe, 2019-06-19cRagexeRE, 2019-06-19eRagexe, 2019-06-19hRagexe, 2019-06-26bRagexeRE, 2019-07-03aRagexe, 2019-07-03bRagexeRE, 2019-07-17aRagexe, 2019-07-17cRagexeRE, 2019-07-17dRagexe, 2019-07-17dRagexeRE, 2019-07-24aRagexe, 2019-07-24bRagexeRE, 2019-07-31bRagexe, 2019-07-31bRagexeRE, 2019-08-02aRagexe, 2019-08-02aRagexeRE, 2019-08-07aRagexe, 2019-08-07dRagexeRE, 2019-08-21aRagexe, 2019-08-21cRagexeRE, 2019-08-21dRagexeRE, 2019-08-28aRagexe, 2019-08-28aRagexeRE, 2019-09-04aRagexe, 2019-09-04bRagexe, 2019-09-04bRagexeRE, 2019-09-18bRagexe, 2019-09-18cRagexeRE #if PACKETVER == 20101123 || \ PACKETVER == 20101124 || \ PACKETVER == 20101125 || \ @@ -152,7 +152,20 @@ PACKETVER == 20190522 || \ PACKETVER == 20190523 || \ PACKETVER == 20190529 || \ - PACKETVER >= 20190530 + PACKETVER == 20190530 || \ + PACKETVER == 20190605 || \ + PACKETVER == 20190619 || \ + PACKETVER == 20190626 || \ + PACKETVER == 20190703 || \ + PACKETVER == 20190717 || \ + PACKETVER == 20190724 || \ + PACKETVER == 20190731 || \ + PACKETVER == 20190802 || \ + PACKETVER == 20190807 || \ + PACKETVER == 20190821 || \ + PACKETVER == 20190828 || \ + PACKETVER == 20190904 || \ + PACKETVER >= 20190918 packetKeys(0x00000000,0x00000000,0x00000000); #endif diff --git a/src/map/packets_keys_zero.h b/src/map/packets_keys_zero.h index c9a1a1ff0..2708d11e1 100644 --- a/src/map/packets_keys_zero.h +++ b/src/map/packets_keys_zero.h @@ -30,7 +30,7 @@ /* This file is autogenerated, please do not commit manual changes */ -// 2017-10-18aRagexe_zero, 2017-10-19aRagexe_zero, 2017-10-23aRagexe_zero, 2017-10-23bRagexe_zero, 2017-10-23cRagexe_zero, 2017-10-24aRagexe_2_zero, 2017-10-24aRagexe_zero, 2017-10-25bRagexe_zero, 2017-10-27aRagexe_zero, 2017-10-27bRagexe_zero, 2017-10-30aRagexe_zero, 2017-10-31aRagexe_zero, 2017-11-09aRagexe_zero, 2017-11-13aRagexe_zero, 2017-11-13bRagexe_zero, 2018-03-15aRagexe_zero, 2018-03-21aRagexe_zero, 2018-03-21bRagexe_zero, 2018-03-28_1aRagexe_zero, 2018-03-28cRagexe_zero, 2018-04-11aRagexe_zero, 2018-04-25_3aRagexe_zero, 2018-05-09_3aRagexe_zero, 2018-05-23aRagexe_zero, 2018-06-05bRagexe_zero, 2018-06-05cRagexe_zero, 2018-06-27aRagexe_zero, 2018-07-03aRagexe_zero, 2018-07-11_2aRagexe_zero, 2018-07-25_2aRagexe_zero, 2018-08-01aRagexe_zero, 2018-08-08_2aRagexe_zero, 2018-08-22aRagexe_zero, 2018-08-29aRagexe_zero, 2018-09-05aRagexe_zero, 2018-09-12aRagexe_zero, 2018-09-19aRagexe_zero, 2018-09-28aRagexe_zero, 2018-10-10_2aRagexe_zero, 2018-10-24_2aRagexe_zero, 2018-11-14aRagexe_zero, 2018-11-20aRagexe_zero, 2018-11-28aRagexe_zero, 2018-12-12aRagexe_zero, 2018-12-19aRagexe_zero, 2018-12-26_2aRagexe_zero, 2019-01-16_2aRagexe_zero, 2019-01-17_1aRagexe_zero, 2019-01-30_2aRagexe_zero, 2019-02-13aRagexe_zero, 2019-02-20aRagexe_zero, 2019-02-27aRagexe_zero, 2019-03-13aRagexe_zero, 2019-03-27_2aRagexe_zero, 2019-03-27_3aRagexe_zero, 2019-04-03aRagexe_zero, 2019-04-10bRagexe_zero, 2019-04-24aRagexe_zero, 2019-05-02aRagexe_zero, 2019-05-08_2aRagexe_zero, 2019-05-08aRagexe_zero, 2019-05-15aRagexe_zero, 2019-05-29aRagexe_zero, 2019-05-30aRagexe_zero +// 2017-10-18aRagexe_zero, 2017-10-19aRagexe_zero, 2017-10-23aRagexe_zero, 2017-10-23bRagexe_zero, 2017-10-23cRagexe_zero, 2017-10-24aRagexe_2_zero, 2017-10-24aRagexe_zero, 2017-10-25bRagexe_zero, 2017-10-27aRagexe_zero, 2017-10-27bRagexe_zero, 2017-10-30aRagexe_zero, 2017-10-31aRagexe_zero, 2017-11-09aRagexe_zero, 2017-11-13aRagexe_zero, 2017-11-13bRagexe_zero, 2018-03-15aRagexe_zero, 2018-03-21aRagexe_zero, 2018-03-21bRagexe_zero, 2018-03-28_1aRagexe_zero, 2018-03-28cRagexe_zero, 2018-04-11aRagexe_zero, 2018-04-25_3aRagexe_zero, 2018-05-09_3aRagexe_zero, 2018-05-23aRagexe_zero, 2018-06-05bRagexe_zero, 2018-06-05cRagexe_zero, 2018-06-27aRagexe_zero, 2018-07-03aRagexe_zero, 2018-07-11_2aRagexe_zero, 2018-07-25_2aRagexe_zero, 2018-08-01aRagexe_zero, 2018-08-08_2aRagexe_zero, 2018-08-22aRagexe_zero, 2018-08-29aRagexe_zero, 2018-09-05aRagexe_zero, 2018-09-12aRagexe_zero, 2018-09-19aRagexe_zero, 2018-09-28aRagexe_zero, 2018-10-10_2aRagexe_zero, 2018-10-24_2aRagexe_zero, 2018-11-14aRagexe_zero, 2018-11-20aRagexe_zero, 2018-11-28aRagexe_zero, 2018-12-12aRagexe_zero, 2018-12-19aRagexe_zero, 2018-12-26_2aRagexe_zero, 2019-01-16_2aRagexe_zero, 2019-01-17_1aRagexe_zero, 2019-01-30_2aRagexe_zero, 2019-02-13aRagexe_zero, 2019-02-20aRagexe_zero, 2019-02-27aRagexe_zero, 2019-03-13aRagexe_zero, 2019-03-27_2aRagexe_zero, 2019-03-27_3aRagexe_zero, 2019-04-03aRagexe_zero, 2019-04-10bRagexe_zero, 2019-04-24aRagexe_zero, 2019-05-02aRagexe_zero, 2019-05-08_2aRagexe_zero, 2019-05-08aRagexe_zero, 2019-05-15aRagexe_zero, 2019-05-29aRagexe_zero, 2019-05-30aRagexe_zero, 2019-06-05_2aRagexe_zero, 2019-06-26_2aRagexe_zero, 2019-06-26_3aRagexe_zero, 2019-07-09aRagexe_zero, 2019-07-10_3aRagexe_zero, 2019-07-17aRagexe_zero, 2019-07-24aRagexe_zero, 2019-08-14_3aRagexe_zero, 2019-08-28_2aRagexe_zero, 2019-08-28_3aRagexe_zero, 2019-09-11aRagexe_zero, 2019-09-18_2aRagexe_zero, 2019-09-18aRagexe_zero #if PACKETVER == 20171018 || \ PACKETVER == 20171019 || \ PACKETVER == 20171023 || \ @@ -84,7 +84,17 @@ PACKETVER == 20190508 || \ PACKETVER == 20190515 || \ PACKETVER == 20190529 || \ - PACKETVER >= 20190530 + PACKETVER == 20190530 || \ + PACKETVER == 20190605 || \ + PACKETVER == 20190626 || \ + PACKETVER == 20190709 || \ + PACKETVER == 20190710 || \ + PACKETVER == 20190717 || \ + PACKETVER == 20190724 || \ + PACKETVER == 20190814 || \ + PACKETVER == 20190828 || \ + PACKETVER == 20190911 || \ + PACKETVER >= 20190918 packetKeys(0x00000000,0x00000000,0x00000000); #endif diff --git a/src/map/packets_shuffle_main.h b/src/map/packets_shuffle_main.h index 016de4e26..e3e798dd1 100644 --- a/src/map/packets_shuffle_main.h +++ b/src/map/packets_shuffle_main.h @@ -9727,7 +9727,7 @@ packet(0x0967,clif->pSolveCharName,2); // CZ_REQNAME_BYGID // 6 #endif -// 2018-11-21bRagexe, 2018-11-28aRagexe, 2018-11-28bRagexe, 2018-11-28cRagexe, 2018-12-05aRagexe, 2018-12-12aRagexe, 2018-12-12bRagexe, 2018-12-19bRagexe, 2018-12-26aRagexe, 2019-01-09aRagexe, 2019-01-16bRagexe, 2019-01-16cRagexe, 2019-01-23dRagexe, 2019-02-13bRagexe, 2019-02-13eRagexe, 2019-02-27aRagexe, 2019-02-28aRagexe, 2019-03-06bRagexe, 2019-03-06cRagexe, 2019-03-13aRagexe, 2019-03-20aRagexe, 2019-03-22aRagexe, 2019-03-27bRagexe, 2019-04-03aRagexe, 2019-04-17aRagexe, 2019-04-18aRagexe, 2019-05-08cRagexe, 2019-05-22bRagexe, 2019-05-22cRagexe, 2019-05-23aRagexe, 2019-05-29aRagexe, 2019-05-29cRagexe, 2019-05-30aRagexe +// 2018-11-21bRagexe, 2018-11-28aRagexe, 2018-11-28bRagexe, 2018-11-28cRagexe, 2018-12-05aRagexe, 2018-12-12aRagexe, 2018-12-12bRagexe, 2018-12-19bRagexe, 2018-12-26aRagexe, 2019-01-09aRagexe, 2019-01-16bRagexe, 2019-01-16cRagexe, 2019-01-23dRagexe, 2019-02-13bRagexe, 2019-02-13eRagexe, 2019-02-27aRagexe, 2019-02-28aRagexe, 2019-03-06bRagexe, 2019-03-06cRagexe, 2019-03-13aRagexe, 2019-03-20aRagexe, 2019-03-22aRagexe, 2019-03-27bRagexe, 2019-04-03aRagexe, 2019-04-17aRagexe, 2019-04-18aRagexe, 2019-05-08cRagexe, 2019-05-22bRagexe, 2019-05-22cRagexe, 2019-05-23aRagexe, 2019-05-29aRagexe, 2019-05-29cRagexe, 2019-05-30aRagexe, 2019-06-05fRagexe, 2019-06-05KRagexe, 2019-06-19bRagexe, 2019-06-19eRagexe, 2019-06-19hRagexe, 2019-07-03aRagexe, 2019-07-17aRagexe, 2019-07-17dRagexe, 2019-07-24aRagexe, 2019-07-31bRagexe, 2019-08-02aRagexe, 2019-08-07aRagexe, 2019-08-21aRagexe, 2019-08-28aRagexe #if PACKETVER == 20181121 || \ PACKETVER == 20181128 || \ PACKETVER == 20181205 || \ @@ -9752,7 +9752,17 @@ PACKETVER == 20190522 || \ PACKETVER == 20190523 || \ PACKETVER == 20190529 || \ - PACKETVER >= 20190530 + PACKETVER == 20190530 || \ + PACKETVER == 20190605 || \ + PACKETVER == 20190619 || \ + PACKETVER == 20190703 || \ + PACKETVER == 20190717 || \ + PACKETVER == 20190724 || \ + PACKETVER == 20190731 || \ + PACKETVER == 20190802 || \ + PACKETVER == 20190807 || \ + PACKETVER == 20190821 || \ + PACKETVER >= 20190828 packet(0x0202,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS // 26 packet(0x022d,clif->pHomMenu,2,4); // CZ_COMMAND_MER // 5 packet(0x023b,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD // 36 @@ -9784,5 +9794,39 @@ packet(0x083c,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK // 14 #endif +// 2019-09-04aRagexe, 2019-09-04bRagexe, 2019-09-18bRagexe +#if PACKETVER == 20190904 || \ + PACKETVER == 20190918 + packet(0x0202,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS // 26 + packet(0x022d,clif->pHomMenu,2,4); // CZ_COMMAND_MER // 5 + packet(0x023b,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD // 36 + packet(0x0281,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK // 4 + packet(0x02c4,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ // 26 + packet(0x035f,clif->pWalkToXY,2); // CZ_REQUEST_MOVE // 5 + packet(0x0360,clif->pTickSend,2); // CZ_REQUEST_TIME // 6 + packet(0x0361,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION // 5 + packet(0x0362,clif->pTakeItem,2); // CZ_ITEM_PICKUP // 6 + packet(0x0363,clif->pDropItem,2,4); // CZ_ITEM_THROW // 6 + packet(0x0364,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE // 8 + packet(0x0365,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY // 8 + packet(0x0366,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND // 10 + packet(0x0367,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX // 31 + packet(0x0368,clif->pGetCharNameRequest,2); // CZ_REQNAME // 6 + packet(0x0369,clif->pSolveCharName,2); // CZ_REQNAME_BYGID // 6 + packet(0x0436,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER // 19 + packet(0x0437,clif->pActionRequest,2,6); // CZ_REQUEST_ACT // 7 + packet(0x0438,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL // 10 + packet(0x07e4,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES // -1 + packet(0x07ec,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD // 8 + packet(0x0802,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER // 18 + packet(0x0811,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE // -1 + packet(0x0815,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE // 2 + packet(0x0817,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE // 6 + packet(0x0819,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE // -1 + packet(0x0835,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO // -1 + packet(0x0838,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE // 2 + packet(0x083c,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK // 14 +#endif + #endif /* MAP_PACKETS_SHUFFLE_MAIN_H */ diff --git a/src/map/packets_shuffle_re.h b/src/map/packets_shuffle_re.h index 9c02161ff..f2a1b96ad 100644 --- a/src/map/packets_shuffle_re.h +++ b/src/map/packets_shuffle_re.h @@ -9663,7 +9663,7 @@ packet(0x083c,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK // 12 #endif -// 2018-07-04aRagexeRE, 2018-07-11aRagexeRE, 2018-07-18bRagexeRE, 2018-07-18bRagexeRE1, 2018-07-18cRagexeRE, 2018-08-01cRagexeRE, 2018-08-08bRagexeRE, 2018-08-22cRagexeRE, 2018-08-29aRagexeRE, 2018-08-29bRagexeRE, 2018-09-12dRagexeRE, 2018-09-19aRagexeRE, 2018-10-02aRagexeRE, 2018-10-02bRagexeRE, 2018-10-17_02aRagexeRE, 2018-10-17_03aRagexeRE, 2018-10-17bRagexeRE, 2018-10-31cRagexeRE, 2018-11-07aRagexeRE, 2018-11-14cRagexeRE, 2018-11-14dRagexeRE, 2018-11-21cRagexeRE, 2018-11-28aRagexeRE, 2018-12-05bRagexeRE, 2018-12-12aRagexeRE, 2018-12-12bRagexeRE, 2018-12-19bRagexeRE, 2018-12-26aRagexeRE, 2019-01-09bRagexeRE, 2019-01-16bRagexeRE, 2019-01-16cRagexeRE, 2019-01-23dRagexeRE, 2019-02-13IRagexeRE, 2019-02-20aRagexeRE, 2019-02-27bRagexeRE, 2019-02-28aRagexeRE, 2019-03-06bRagexeRE, 2019-03-06cRagexeRE, 2019-03-20aRagexeRE, 2019-03-22aRagexeRE, 2019-03-27bRagexeRE, 2019-04-03bRagexeRE, 2019-04-03cRagexeRE, 2019-04-17cRagexeRE, 2019-04-18aRagexeRE, 2019-05-08dRagexeRE, 2019-05-08eRagexeRE, 2019-05-22bRagexeRE, 2019-05-22cRagexeRE, 2019-05-29bRagexeRE, 2019-05-29cRagexeRE, 2019-05-30aRagexeRE +// 2018-07-04aRagexeRE, 2018-07-11aRagexeRE, 2018-07-18bRagexeRE, 2018-07-18bRagexeRE1, 2018-07-18cRagexeRE, 2018-08-01cRagexeRE, 2018-08-08bRagexeRE, 2018-08-22cRagexeRE, 2018-08-29aRagexeRE, 2018-08-29bRagexeRE, 2018-09-12dRagexeRE, 2018-09-19aRagexeRE, 2018-10-02aRagexeRE, 2018-10-02bRagexeRE, 2018-10-17_02aRagexeRE, 2018-10-17_03aRagexeRE, 2018-10-17bRagexeRE, 2018-10-31cRagexeRE, 2018-11-07aRagexeRE, 2018-11-14cRagexeRE, 2018-11-14dRagexeRE, 2018-11-21cRagexeRE, 2018-11-28aRagexeRE, 2018-12-05bRagexeRE, 2018-12-12aRagexeRE, 2018-12-12bRagexeRE, 2018-12-19bRagexeRE, 2018-12-26aRagexeRE, 2019-01-09bRagexeRE, 2019-01-16bRagexeRE, 2019-01-16cRagexeRE, 2019-01-23dRagexeRE, 2019-02-13IRagexeRE, 2019-02-20aRagexeRE, 2019-02-27bRagexeRE, 2019-02-28aRagexeRE, 2019-03-06bRagexeRE, 2019-03-06cRagexeRE, 2019-03-20aRagexeRE, 2019-03-22aRagexeRE, 2019-03-27bRagexeRE, 2019-04-03bRagexeRE, 2019-04-03cRagexeRE, 2019-04-17cRagexeRE, 2019-04-18aRagexeRE, 2019-05-08dRagexeRE, 2019-05-08eRagexeRE, 2019-05-22bRagexeRE, 2019-05-22cRagexeRE, 2019-05-29bRagexeRE, 2019-05-29cRagexeRE, 2019-05-30aRagexeRE, 2019-06-05hRagexeRE, 2019-06-05JRagexeRE, 2019-06-05LRagexeRE, 2019-06-19cRagexeRE, 2019-06-26bRagexeRE, 2019-07-03bRagexeRE, 2019-07-17cRagexeRE, 2019-07-17dRagexeRE, 2019-07-24bRagexeRE, 2019-07-31bRagexeRE, 2019-08-02aRagexeRE, 2019-08-07dRagexeRE, 2019-08-21cRagexeRE, 2019-08-21dRagexeRE, 2019-08-28aRagexeRE #if PACKETVER == 20180704 || \ PACKETVER == 20180711 || \ PACKETVER == 20180718 || \ @@ -9701,7 +9701,18 @@ PACKETVER == 20190508 || \ PACKETVER == 20190522 || \ PACKETVER == 20190529 || \ - PACKETVER >= 20190530 + PACKETVER == 20190530 || \ + PACKETVER == 20190605 || \ + PACKETVER == 20190619 || \ + PACKETVER == 20190626 || \ + PACKETVER == 20190703 || \ + PACKETVER == 20190717 || \ + PACKETVER == 20190724 || \ + PACKETVER == 20190731 || \ + PACKETVER == 20190802 || \ + PACKETVER == 20190807 || \ + PACKETVER == 20190821 || \ + PACKETVER >= 20190828 packet(0x0202,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS // 26 packet(0x022d,clif->pHomMenu,2,4); // CZ_COMMAND_MER // 5 packet(0x023b,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD // 36 @@ -9733,5 +9744,39 @@ packet(0x083c,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK // 14 #endif +// 2019-09-04bRagexeRE, 2019-09-18cRagexeRE +#if PACKETVER == 20190904 || \ + PACKETVER == 20190918 + packet(0x0202,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS // 26 + packet(0x022d,clif->pHomMenu,2,4); // CZ_COMMAND_MER // 5 + packet(0x023b,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD // 36 + packet(0x0281,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK // 4 + packet(0x02c4,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ // 26 + packet(0x035f,clif->pWalkToXY,2); // CZ_REQUEST_MOVE // 5 + packet(0x0360,clif->pTickSend,2); // CZ_REQUEST_TIME // 6 + packet(0x0361,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION // 5 + packet(0x0362,clif->pTakeItem,2); // CZ_ITEM_PICKUP // 6 + packet(0x0363,clif->pDropItem,2,4); // CZ_ITEM_THROW // 6 + packet(0x0364,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE // 8 + packet(0x0365,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY // 8 + packet(0x0366,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND // 10 + packet(0x0367,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX // 31 + packet(0x0368,clif->pGetCharNameRequest,2); // CZ_REQNAME // 6 + packet(0x0369,clif->pSolveCharName,2); // CZ_REQNAME_BYGID // 6 + packet(0x0436,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER // 19 + packet(0x0437,clif->pActionRequest,2,6); // CZ_REQUEST_ACT // 7 + packet(0x0438,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL // 10 + packet(0x07e4,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES // -1 + packet(0x07ec,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD // 8 + packet(0x0802,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER // 18 + packet(0x0811,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE // -1 + packet(0x0815,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE // 2 + packet(0x0817,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE // 6 + packet(0x0819,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE // -1 + packet(0x0835,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO // -1 + packet(0x0838,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE // 2 + packet(0x083c,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK // 14 +#endif + #endif /* MAP_PACKETS_SHUFFLE_RE_H */ diff --git a/src/map/packets_shuffle_zero.h b/src/map/packets_shuffle_zero.h index bbf44cbc8..4d6da7a8a 100644 --- a/src/map/packets_shuffle_zero.h +++ b/src/map/packets_shuffle_zero.h @@ -742,7 +742,7 @@ packet(0x0968,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD // 36 #endif -// 2018-11-14aRagexe_zero, 2018-11-20aRagexe_zero, 2018-11-28aRagexe_zero, 2018-12-12aRagexe_zero, 2018-12-19aRagexe_zero, 2018-12-26_2aRagexe_zero, 2019-01-16_2aRagexe_zero, 2019-01-17_1aRagexe_zero, 2019-01-30_2aRagexe_zero, 2019-02-13aRagexe_zero, 2019-02-20aRagexe_zero, 2019-02-27aRagexe_zero, 2019-03-13aRagexe_zero, 2019-03-27_2aRagexe_zero, 2019-03-27_3aRagexe_zero, 2019-04-03aRagexe_zero, 2019-04-10bRagexe_zero, 2019-04-24aRagexe_zero, 2019-05-02aRagexe_zero, 2019-05-08_2aRagexe_zero, 2019-05-08aRagexe_zero, 2019-05-15aRagexe_zero, 2019-05-29aRagexe_zero, 2019-05-30aRagexe_zero +// 2018-11-14aRagexe_zero, 2018-11-20aRagexe_zero, 2018-11-28aRagexe_zero, 2018-12-12aRagexe_zero, 2018-12-19aRagexe_zero, 2018-12-26_2aRagexe_zero, 2019-01-16_2aRagexe_zero, 2019-01-17_1aRagexe_zero, 2019-01-30_2aRagexe_zero, 2019-02-13aRagexe_zero, 2019-02-20aRagexe_zero, 2019-02-27aRagexe_zero, 2019-03-13aRagexe_zero, 2019-03-27_2aRagexe_zero, 2019-03-27_3aRagexe_zero, 2019-04-03aRagexe_zero, 2019-04-10bRagexe_zero, 2019-04-24aRagexe_zero, 2019-05-02aRagexe_zero, 2019-05-08_2aRagexe_zero, 2019-05-08aRagexe_zero, 2019-05-15aRagexe_zero, 2019-05-29aRagexe_zero, 2019-05-30aRagexe_zero, 2019-06-05_2aRagexe_zero, 2019-06-26_2aRagexe_zero, 2019-06-26_3aRagexe_zero, 2019-07-09aRagexe_zero, 2019-07-10_3aRagexe_zero, 2019-07-17aRagexe_zero, 2019-07-24aRagexe_zero, 2019-08-14_3aRagexe_zero #if PACKETVER == 20181114 || \ PACKETVER == 20181120 || \ PACKETVER == 20181128 || \ @@ -764,7 +764,14 @@ PACKETVER == 20190508 || \ PACKETVER == 20190515 || \ PACKETVER == 20190529 || \ - PACKETVER >= 20190530 + PACKETVER == 20190530 || \ + PACKETVER == 20190605 || \ + PACKETVER == 20190626 || \ + PACKETVER == 20190709 || \ + PACKETVER == 20190710 || \ + PACKETVER == 20190717 || \ + PACKETVER == 20190724 || \ + PACKETVER >= 20190814 packet(0x0202,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS // 26 packet(0x022d,clif->pHomMenu,2,4); // CZ_COMMAND_MER // 5 packet(0x023b,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD // 36 @@ -796,5 +803,40 @@ packet(0x083c,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK // 14 #endif +// 2019-08-28_2aRagexe_zero, 2019-08-28_3aRagexe_zero, 2019-09-11aRagexe_zero, 2019-09-18_2aRagexe_zero, 2019-09-18aRagexe_zero +#if PACKETVER == 20190828 || \ + PACKETVER == 20190911 || \ + PACKETVER == 20190918 + packet(0x0202,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS // 26 + packet(0x022d,clif->pHomMenu,2,4); // CZ_COMMAND_MER // 5 + packet(0x023b,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD // 36 + packet(0x0281,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK // 4 + packet(0x02c4,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ // 26 + packet(0x035f,clif->pWalkToXY,2); // CZ_REQUEST_MOVE // 5 + packet(0x0360,clif->pTickSend,2); // CZ_REQUEST_TIME // 6 + packet(0x0361,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION // 5 + packet(0x0362,clif->pTakeItem,2); // CZ_ITEM_PICKUP // 6 + packet(0x0363,clif->pDropItem,2,4); // CZ_ITEM_THROW // 6 + packet(0x0364,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE // 8 + packet(0x0365,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY // 8 + packet(0x0366,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND // 10 + packet(0x0367,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX // 31 + packet(0x0368,clif->pGetCharNameRequest,2); // CZ_REQNAME // 6 + packet(0x0369,clif->pSolveCharName,2); // CZ_REQNAME_BYGID // 6 + packet(0x0436,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER // 19 + packet(0x0437,clif->pActionRequest,2,6); // CZ_REQUEST_ACT // 7 + packet(0x0438,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL // 10 + packet(0x07e4,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES // -1 + packet(0x07ec,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD // 8 + packet(0x0802,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER // 18 + packet(0x0811,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE // -1 + packet(0x0815,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE // 2 + packet(0x0817,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE // 6 + packet(0x0819,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE // -1 + packet(0x0835,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO // -1 + packet(0x0838,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE // 2 + packet(0x083c,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK // 14 +#endif + #endif /* MAP_PACKETS_SHUFFLE_ZERO_H */ diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 2da1ece9e..9c8c93865 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -300,7 +300,6 @@ enum packet_headers { notifybindonequip = 0x2d3, monsterhpType = 0x977, maptypeproperty2Type = 0x99b, - npcmarketresultackType = 0x9d7, #if PACKETVER >= 20131223 // version probably can be 20131030 [4144] wisendType = 0x9df, #else @@ -1362,22 +1361,6 @@ struct packet_npc_market_purchase { } list[]; // Note: We assume this should be <= MAX_INVENTORY (since you can't hold more than MAX_INVENTORY items thus cant buy that many at once). } __attribute__((packed)); -struct packet_npc_market_result_ack { - int16 PacketType; - int16 PacketLength; - uint8 result; - struct { -#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 - uint32 ITID; -#else - uint16 ITID; -#endif - uint16 qty; - uint32 price; - // [4144] need remove MAX_INVENTORY from here - } list[MAX_INVENTORY];/* assuming MAX_INVENTORY is max since you can't hold more than MAX_INVENTORY items thus cant buy that many at once. */ -} __attribute__((packed)); - #if PACKETVER_MAIN_NUM >= 20131120 || PACKETVER_RE_NUM >= 20131106 || defined(PACKETVER_ZERO) /* inner struct figured by Ind after some annoying hour of debugging (data Thanks to Yommy) */ struct PACKET_ZC_NPC_MARKET_OPEN_sub { @@ -1423,7 +1406,7 @@ struct hotkey_data { int16 count; // Item Quantity/Skill Level } __attribute__((packed)); -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 #define MAX_HOTKEYS_PACKET 38 struct PACKET_ZC_SHORTCUT_KEY_LIST { int16 packetType; @@ -1472,7 +1455,7 @@ struct PACKET_CZ_SHORTCUT_KEY_CHANGE1 { DEFINE_PACKET_HEADER(CZ_SHORTCUT_KEY_CHANGE1, 0x02ba); #endif -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 struct PACKET_CZ_SHORTCUT_KEY_CHANGE2 { int16 packetType; uint16 tab; @@ -1490,7 +1473,7 @@ struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE1 { DEFINE_PACKET_HEADER(CZ_SHORTCUTKEYBAR_ROTATE1, 0x0a01); #endif -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE2 { int16 packetType; uint16 tab; @@ -2326,7 +2309,35 @@ struct PACKET_ZC_ACK_WEAPONREFINE { #endif } __attribute__((packed)); -#if PACKETVER_MAIN_NUM >= 20131230 || PACKETVER_RE_NUM >= 20131230 || defined(PACKETVER_ZERO) +#if PACKETVER_MAIN_NUM >= 20190619 || PACKETVER_RE_NUM >= 20190605 || PACKETVER_ZERO_NUM >= 20190626 +// PACKET_ZC_PROPERTY_HOMUN3 +struct PACKET_ZC_PROPERTY_HOMUN { + int16 packetType; + char name[NAME_LENGTH]; + // Bit field, bit 0 : rename_flag (1 = already renamed), bit 1 : homunc vaporized (1 = true), bit 2 : homunc dead (1 = true) + uint8 flags; + uint16 level; + uint16 hunger; + uint16 intimacy; + uint16 atk2; + uint16 matk; + uint16 hit; + uint16 crit; + uint16 def; + uint16 mdef; + uint16 flee; + uint16 amotion; + uint32 hp; + uint32 maxHp; + uint16 sp; + uint16 maxSp; + uint32 exp; + uint32 expNext; + uint16 skillPoints; + uint16 range; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_PROPERTY_HOMUN, 0x0b2f); +#elif PACKETVER_MAIN_NUM >= 20131230 || PACKETVER_RE_NUM >= 20131230 || defined(PACKETVER_ZERO) // PACKET_ZC_PROPERTY_HOMUN2 struct PACKET_ZC_PROPERTY_HOMUN { int16 packetType; @@ -2651,6 +2662,7 @@ struct PACKET_ZC_MAKINGARROW_LIST { int16 packetLength; struct PACKET_ZC_MAKINGARROW_LIST_sub items[]; } __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_MAKINGARROW_LIST, 0x01ad); struct PACKET_ZC_REPAIRITEMLIST_sub { int16 index; @@ -2697,13 +2709,10 @@ struct PACKET_ZC_MAKINGITEM_LIST_sub { struct PACKET_ZC_MAKINGITEM_LIST { int16 packetType; int16 packetLength; -#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 - uint32 makeItem; -#else uint16 makeItem; -#endif struct PACKET_ZC_MAKINGITEM_LIST_sub items[]; } __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_MAKINGITEM_LIST, 0x025a); struct PACKET_ZC_PC_CASH_POINT_ITEMLIST_sub { uint32 price; @@ -3451,6 +3460,253 @@ struct PACKET_ZC_REFINE_STATUS { DEFINE_PACKET_HEADER(ZC_REFINE_STATUS, 0x0ada); #endif +struct PACKET_ZC_ACK_RANKING_name { + char name[NAME_LENGTH]; +} __attribute__((packed)); + +struct PACKET_ZC_ACK_RANKING_points { + uint32 points; +} __attribute__((packed)); + +#if PACKETVER_MAIN_NUM >= 20190731 || PACKETVER_RE_NUM >= 20190703 || PACKETVER_ZERO_NUM >= 20190724 +struct PACKET_ZC_ACK_RANKING_sub { + char name[NAME_LENGTH]; + uint32 points; +} __attribute__((packed)); + +struct PACKET_ZC_ACK_RANKING { + int16 packetType; + int16 rankType; + uint32 chars[10]; + uint32 points[10]; + uint32 myPoints; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ACK_RANKING, 0x0af6); +#elif PACKETVER_MAIN_NUM >= 20130605 || PACKETVER_RE_NUM >= 20130529 || defined(PACKETVER_ZERO) +struct PACKET_ZC_ACK_RANKING_sub { + struct PACKET_ZC_ACK_RANKING_name names[10]; + struct PACKET_ZC_ACK_RANKING_points points[10]; +} __attribute__((packed)); + +struct PACKET_ZC_ACK_RANKING { + int16 packetType; + int16 rankType; + struct PACKET_ZC_ACK_RANKING_sub ranks; + uint32 myPoints; +} __attribute__((packed)); + +DEFINE_PACKET_HEADER(ZC_ACK_RANKING, 0x097d); +#else +struct PACKET_ZC_ACK_RANKING_sub { + struct PACKET_ZC_ACK_RANKING_name names[10]; + struct PACKET_ZC_ACK_RANKING_points points[10]; +} __attribute__((packed)); +#endif + +struct PACKET_ZC_STATUS_CHANGE_ACK { + int16 packetType; + uint16 sp; + uint8 ok; + uint8 value; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_STATUS_CHANGE_ACK, 0x00bc); + +#if PACKETVER_MAIN_NUM >= 20150507 || PACKETVER_RE_NUM >= 20150429 || defined(PACKETVER_ZERO) +struct PACKET_ZC_HAT_EFFECT { + int16 packetType; + int16 packetLength; + uint32 aid; + int8 status; + uint16 effects[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_HAT_EFFECT, 0x0a3b); +#endif + +// [4144] this struct updated not in all packets in client +#if PACKETVER_RE_NUM >= 20190807 +struct SKILLDATA { + uint16 id; + int inf; + uint16 level; + uint16 sp; + uint16 range2; + uint8 upFlag; + uint16 level2; +} __attribute__((packed)); +#else +struct SKILLDATA { + uint16 id; + int inf; + uint16 level; + uint16 sp; + uint16 range2; + char name[NAME_LENGTH]; + uint8 upFlag; +} __attribute__((packed)); +#endif + +struct PACKET_ZC_ADD_SKILL { + int16 packetType; + struct SKILLDATA skill; +} __attribute__((packed)); +#if PACKETVER_RE_NUM >= 20190807 +DEFINE_PACKET_HEADER(ZC_ADD_SKILL, 0x0b31); +#else +DEFINE_PACKET_HEADER(ZC_ADD_SKILL, 0x0111); +#endif + +struct PACKET_ZC_SKILLINFO_LIST { + int16 packetType; + int16 packetLength; + struct SKILLDATA skills[]; +} __attribute__((packed)); +#if PACKETVER_RE_NUM >= 20190807 +DEFINE_PACKET_HEADER(ZC_SKILLINFO_LIST, 0x0b32); +#else +DEFINE_PACKET_HEADER(ZC_SKILLINFO_LIST, 0x010f); +#endif + +#if PACKETVER_RE_NUM >= 20190807 +struct PACKET_ZC_SKILLINFO_UPDATE2 { + int16 packetType; + uint16 id; + int inf; + uint16 level; + uint16 sp; + uint16 range2; + uint8 upFlag; + uint16 level2; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_SKILLINFO_UPDATE2, 0x0b33); +#else +struct PACKET_ZC_SKILLINFO_UPDATE2 { + int16 packetType; + uint16 id; + int inf; + uint16 level; + uint16 sp; + uint16 range2; + uint8 upFlag; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_SKILLINFO_UPDATE2, 0x07e1); +#endif + +struct PACKET_ZC_NPC_MARKET_PURCHASE_RESULT_sub { +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 ITID; +#else + uint16 ITID; +#endif + uint16 qty; + uint32 price; +} __attribute__((packed)); + +#if PACKETVER_MAIN_NUM >= 20190807 || PACKETVER_RE_NUM >= 20190807 || PACKETVER_ZERO_NUM >= 20190814 +struct PACKET_ZC_NPC_MARKET_PURCHASE_RESULT { + int16 PacketType; + int16 PacketLength; + uint16 result; + struct PACKET_ZC_NPC_MARKET_PURCHASE_RESULT_sub list[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_NPC_MARKET_PURCHASE_RESULT, 0x0b4e); +#elif PACKETVER_MAIN_NUM >= 20131120 || PACKETVER_RE_NUM >= 20130911 || defined(PACKETVER_ZERO) +struct PACKET_ZC_NPC_MARKET_PURCHASE_RESULT { + int16 PacketType; + int16 PacketLength; + uint8 result; + struct PACKET_ZC_NPC_MARKET_PURCHASE_RESULT_sub list[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_NPC_MARKET_PURCHASE_RESULT, 0x09d7); +#endif + +struct PACKET_ZC_TALKBOX_CHATCONTENTS { + int16 PacketType; + uint32 aid; + char message[TALKBOX_MESSAGE_SIZE]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_TALKBOX_CHATCONTENTS, 0x0191); + +#if PACKETVER_MAIN_NUM >= 20190731 || PACKETVER_RE_NUM >= 20190717 || PACKETVER_ZERO_NUM >= 20190814 +struct PACKET_ZC_GUILD_CASTLE_LIST { + int16 packetType; + int16 packetLength; + int8 castle_list[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_GUILD_CASTLE_LIST, 0x0b27); +#endif + +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190522 || PACKETVER_ZERO_NUM >= 20190515 +struct PACKET_CZ_CASTLE_TELEPORT_REQUEST { + int16 packetType; + int8 castle_id; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_CASTLE_TELEPORT_REQUEST, 0x0b28); +#endif + +#if PACKETVER_MAIN_NUM >= 20190731 || PACKETVER_RE_NUM >= 20190717 || PACKETVER_ZERO_NUM >= 20190814 +struct PACKET_ZC_CASTLE_TELEPORT_RESPONSE { + int16 packetType; + int16 result; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_CASTLE_TELEPORT_RESPONSE, 0x0b2e); +#endif + +#if PACKETVER_MAIN_NUM >= 20190731 || PACKETVER_RE_NUM >= 20190717 || PACKETVER_ZERO_NUM >= 20190814 +struct PACKET_ZC_CASTLE_INFO { + int16 packetType; + int8 castle_id; + int32 economy; + int32 defense; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_CASTLE_INFO, 0x0b2d); +#endif + +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190522 || PACKETVER_ZERO_NUM >= 20190515 +struct PACKET_CZ_CASTLE_INFO_REQUEST { + int16 packetType; + int8 castle_id; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_CASTLE_INFO_REQUEST, 0x0b2c); +#endif + +#if PACKETVER_MAIN_NUM >= 20160601 || PACKETVER_RE_NUM >= 20160525 || defined(PACKETVER_ZERO) +struct PACKET_ZC_LAPINEDDUKDDAK_OPEN { + int16 packetType; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + int32 itemId; +#else + int16 itemId; +#endif +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_LAPINEDDUKDDAK_OPEN, 0x0a4e); +#endif // PACKETVER_MAIN_NUM >= 20160601 || PACKETVER_RE_NUM >= 20160525 || defined(PACKETVER_ZERO) + +#if PACKETVER >= 20160302 +struct PACKET_CZ_LAPINEDDUKDDAK_ACK_sub { + int16 index; + int16 count; +} __attribute__((packed)); + +struct PACKET_CZ_LAPINEDDUKDDAK_ACK { + int16 packetType; + int16 packetLength; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + int32 itemId; +#else + int16 itemId; +#endif + struct PACKET_CZ_LAPINEDDUKDDAK_ACK_sub items[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_LAPINEDDUKDDAK_ACK, 0x0a4f); +#endif // PACKETVER >= 20160302 + +#if PACKETVER_MAIN_NUM >= 20160601 || PACKETVER_RE_NUM >= 20160525 || defined(PACKETVER_ZERO) +struct PACKET_ZC_LAPINEDDUKDDAK_RESULT { + int16 packetType; + int16 result; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_LAPINEDDUKDDAK_RESULT, 0x0a50); +#endif // PACKETVER_MAIN_NUM >= 20160601 || PACKETVER_RE_NUM >= 20160525 || defined(PACKETVER_ZERO) #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) diff --git a/src/map/party.c b/src/map/party.c index dc330d92d..9fbe915f3 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -886,17 +886,20 @@ static int party_send_logout(struct map_session_data *sd) static int party_send_message(struct map_session_data *sd, const char *mes) { - int len; - nullpo_ret(sd); nullpo_ret(mes); - len = (int)strlen(mes); - if (sd->status.party_id == 0) return 0; - intif->party_message(sd->status.party_id, sd->status.account_id, mes, len); - party->recv_message(sd->status.party_id, sd->status.account_id, mes, len); + + struct party_data *p = party->search(sd->status.party_id); + + if (p == NULL) + return 0; + + int len = (int)strlen(mes); + + clif->party_message(p, sd->status.account_id, mes, len); // Chat logging type 'P' / Party Chat logs->chat(LOG_CHAT_PARTY, sd->status.party_id, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, mes); @@ -904,15 +907,6 @@ static int party_send_message(struct map_session_data *sd, const char *mes) return 0; } -static int party_recv_message(int party_id, int account_id, const char *mes, int len) -{ - struct party_data *p; - if( (p=party->search(party_id))==NULL) - return 0; - clif->party_message(p,account_id,mes,len); - return 0; -} - static int party_skill_check(struct map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv) { struct party_data *p; @@ -1532,7 +1526,6 @@ void party_defaults(void) party->send_levelup = party_send_levelup; party->send_logout = party_send_logout; party->send_message = party_send_message; - party->recv_message = party_recv_message; party->skill_check = party_skill_check; party->send_xy_clear = party_send_xy_clear; party->exp_share = party_exp_share; diff --git a/src/map/party.h b/src/map/party.h index 28e16dff7..1831da414 100644 --- a/src/map/party.h +++ b/src/map/party.h @@ -118,7 +118,6 @@ struct party_interface { void (*send_levelup) (struct map_session_data *sd); int (*send_logout) (struct map_session_data *sd); int (*send_message) (struct map_session_data *sd, const char *mes); - int (*recv_message) (int party_id,int account_id,const char *mes,int len); int (*skill_check) (struct map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv); int (*send_xy_clear) (struct party_data *p); int (*exp_share) (struct party_data *p,struct block_list *src,unsigned int base_exp,unsigned int job_exp,int zeny); diff --git a/src/map/pc.c b/src/map/pc.c index 5416fbec2..5eccfbaf6 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -565,72 +565,8 @@ static int pc_inventory_rental_clear(struct map_session_data *sd) /* assumes i is valid (from default areas where it is called, it is) */ static void pc_rental_expire(struct map_session_data *sd, int i) { - int nameid; - nullpo_retv(sd); Assert_retv(i >= 0 && i < sd->status.inventorySize); - nameid = sd->status.inventory[i].nameid; - - /* Soon to be dropped, we got plans to integrate it with item db */ - switch( nameid ) { - case ITEMID_BOARDING_HALTER: - status_change_end(&sd->bl,SC_ALL_RIDING,INVALID_TIMER); - break; - case ITEMID_LOVE_ANGEL: - if( sd->status.font == 1 ) { - sd->status.font = 0; - clif->font(sd); - } - break; - case ITEMID_SQUIRREL: - if( sd->status.font == 2 ) { - sd->status.font = 0; - clif->font(sd); - } - break; - case ITEMID_GOGO: - if( sd->status.font == 3 ) { - sd->status.font = 0; - clif->font(sd); - } - break; - case ITEMID_PICTURE_DIARY: - if( sd->status.font == 4 ) { - sd->status.font = 0; - clif->font(sd); - } - break; - case ITEMID_MINI_HEART: - if( sd->status.font == 5 ) { - sd->status.font = 0; - clif->font(sd); - } - break; - case ITEMID_NEWCOMER: - if( sd->status.font == 6 ) { - sd->status.font = 0; - clif->font(sd); - } - break; - case ITEMID_KID: - if( sd->status.font == 7 ) { - sd->status.font = 0; - clif->font(sd); - } - break; - case ITEMID_MAGIC_CASTLE: - if( sd->status.font == 8 ) { - sd->status.font = 0; - clif->font(sd); - } - break; - case ITEMID_BULGING_HEAD: - if( sd->status.font == 9 ) { - sd->status.font = 0; - clif->font(sd); - } - break; - } clif->rental_expired(sd->fd, i, sd->status.inventory[i].nameid); pc->delitem(sd, i, sd->status.inventory[i].amount, 0, DELITEM_NORMAL, LOG_TYPE_RENTAL); @@ -1536,17 +1472,16 @@ static int pc_reg_received(struct map_session_data *sd) if (sd->status.guild_id) guild->member_joined(sd); - // pet - if (sd->status.pet_id > 0) - intif->request_petdata(sd->status.account_id, sd->status.char_id, sd->status.pet_id); - - // Homunculus [albator] - if( sd->status.hom_id > 0 ) - intif->homunculus_requestload(sd->status.account_id, sd->status.hom_id); - if( sd->status.mer_id > 0 ) - intif->mercenary_request(sd->status.mer_id, sd->status.char_id); - if( sd->status.ele_id > 0 ) - intif->elemental_request(sd->status.ele_id, sd->status.char_id); + if (sd->state.standalone == 0 && sd->state.autotrade == 0) { // prevents loading pets, homunculi, mercenaries or elementals if the character doesn't have a client attached + if (sd->status.pet_id != 0) + intif->request_petdata(sd->status.account_id, sd->status.char_id, sd->status.pet_id); + if (sd->status.hom_id != 0) + intif->homunculus_requestload(sd->status.account_id, sd->status.hom_id); + if (sd->status.mer_id != 0) + intif->mercenary_request(sd->status.mer_id, sd->status.char_id); + if (sd->status.ele_id != 0) + intif->elemental_request(sd->status.ele_id, sd->status.char_id); + } map->addiddb(&sd->bl); map->delnickdb(sd->status.char_id, sd->status.name); @@ -2268,7 +2203,7 @@ static int pc_bonus_item_drop(struct s_add_drop *drop, const short max, int id, return 1; } -static int pc_addautobonus(struct s_autobonus *bonus, char max, const char *bonus_script, short rate, unsigned int dur, short flag, const char *other_script, unsigned short pos, bool onskill) +static int pc_addautobonus(struct s_autobonus *bonus, char max, const char *bonus_script, short rate, unsigned int dur, short flag, const char *other_script, unsigned int pos, bool onskill) { int i; @@ -4506,7 +4441,7 @@ static int pc_payzeny(struct map_session_data *sd, int zeny, enum e_log_pick_typ if (sd->state.showzeny) { char output[255]; - sprintf(output, "Removed %dz.", zeny); + sprintf(output, msg_sd(sd, 885), zeny); // Removed %dz. clif_disp_onlyself(sd, output); } } @@ -4645,7 +4580,7 @@ static int pc_getzeny(struct map_session_data *sd, int zeny, enum e_log_pick_typ if (sd->state.showzeny) { char output[255]; - sprintf(output, "Gained %dz.", zeny); + sprintf(output, msg_sd(sd, 886), zeny); // Gained %dz. clif_disp_onlyself(sd, output); } } @@ -4778,18 +4713,27 @@ static int pc_additem(struct map_session_data *sd, const struct item *item_data, sd->weight += w; clif->updatestatus(sd,SP_WEIGHT); + + // auto-favorite + if (data->flag.auto_favorite > 0) { + sd->status.inventory[i].favorite = 1; + clif->favorite_item(sd, i); + } + //Auto-equip if(data->flag.autoequip) pc->equipitem(sd, i, data->equip); /* rental item check */ - if( item_data->expire_time ) { - if( time(NULL) > item_data->expire_time ) { - pc->rental_expire(sd,i); + if (item_data->expire_time > 0) { + if (time(NULL) > item_data->expire_time) { + pc->rental_expire(sd, i); } else { - int seconds = (int)( item_data->expire_time - time(NULL) ); + int seconds = (int)(item_data->expire_time - time(NULL)); clif->rental_time(sd->fd, sd->status.inventory[i].nameid, seconds); pc->inventory_rental_add(sd, seconds); + if (data->rental_start_script != NULL) + script->run_item_rental_start_script(sd, data, 0); } } quest->questinfo_refresh(sd); @@ -4820,12 +4764,21 @@ static int pc_delitem(struct map_session_data *sd, int n, int amount, int type, sd->status.inventory[n].amount -= amount; sd->weight -= sd->inventory_data[n]->weight*amount ; + + // It's here because the data would most likely get zeroed in following if [Hemagx] + struct item_data *itd = sd->inventory_data[n]; + bool is_rental = (sd->status.inventory[n].expire_time > 0) ? true : false; + if( sd->status.inventory[n].amount <= 0 ){ if(sd->status.inventory[n].equip) pc->unequipitem(sd, n, PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE); memset(&sd->status.inventory[n],0,sizeof(sd->status.inventory[0])); sd->inventory_data[n] = NULL; } + + if (is_rental && itd->rental_end_script != NULL) + script->run_item_rental_end_script(sd, itd, 0); + if(!(type&1)) clif->delitem(sd,n,amount,reason); if(!(type&2)) @@ -5582,9 +5535,9 @@ static int pc_show_steal(struct block_list *bl, va_list ap) nullpo_ret(sd); if((item=itemdb->exists(itemid))==NULL) - sprintf(output,"%s stole an Unknown Item (id: %i).",sd->status.name, itemid); + sprintf(output, msg_sd(sd, 887), sd->status.name, itemid); // %s stole an Unknown Item (id: %i). else - sprintf(output,"%s stole %s.",sd->status.name,item->jname); + sprintf(output, msg_sd(sd, 888), sd->status.name, item->jname); // %s stole %s. clif->message(tsd->fd, output); return 0; @@ -7131,11 +7084,16 @@ static bool pc_gainexp(struct map_session_data *sd, struct block_list *src, uint if(sd->state.showexp) { char output[256]; sprintf(output, - "Experience Gained Base:%"PRIu64" (%.2f%%) Job:%"PRIu64" (%.2f%%)", + msg_sd(sd, 889), // Experience Gained Base:%"PRIu64" (%.2f%%) Job:%"PRIu64" (%.2f%%) base_exp, nextbp * (float)100, job_exp, nextjp * (float)100); clif_disp_onlyself(sd, output); } + // Share master EXP to homunculus + if (sd->hd != NULL && battle_config.hom_bonus_exp_from_master > 0) { + homun->gainexp(sd->hd, apply_percentrate((int)base_exp, battle_config.hom_bonus_exp_from_master, 100)); + } + return true; } @@ -7352,34 +7310,33 @@ static int pc_maxparameterincrease(struct map_session_data *sd, int type) */ static bool pc_statusup(struct map_session_data *sd, int type, int increase) { - int max_increase = 0, current = 0, needed_points = 0, final_value = 0; - nullpo_ret(sd); + int realIncrease = increase; // check conditions - if (type < SP_STR || type > SP_LUK || increase <= 0) { - clif->statusupack(sd, type, 0, 0); + if (type < SP_STR || type > SP_LUK || realIncrease <= 0) { + clif->statusupack(sd, type, 0, increase); return false; } // check limits - current = pc->getstat(sd, type); - max_increase = pc->maxparameterincrease(sd, type); - increase = cap_value(increase, 0, max_increase); // cap to the maximum status points available - if (increase <= 0 || current + increase > pc_maxparameter(sd)) { - clif->statusupack(sd, type, 0, 0); + int current = pc->getstat(sd, type); + int max_increase = pc->maxparameterincrease(sd, type); + realIncrease = cap_value(realIncrease, 0, max_increase); // cap to the maximum status points available + if (realIncrease <= 0 || current + realIncrease > pc_maxparameter(sd)) { + clif->statusupack(sd, type, 0, increase); return false; } // check status points - needed_points = pc->need_status_point(sd, type, increase); + int needed_points = pc->need_status_point(sd, type, realIncrease); if (needed_points < 0 || needed_points > sd->status.status_point) { // Sanity check - clif->statusupack(sd, type, 0, 0); + clif->statusupack(sd, type, 0, increase); return false; } // set new values - final_value = pc->setstat(sd, type, current + increase); + int final_value = pc->setstat(sd, type, current + realIncrease); sd->status.status_point -= needed_points; status_calc_pc(sd, SCO_NONE); @@ -7754,7 +7711,7 @@ static int pc_resetskill(struct map_session_data *sd, int flag) pc->setoption(sd, i); if( homun_alive(sd->hd) && pc->checkskill(sd, AM_CALLHOMUN) ) - homun->vaporize(sd, HOM_ST_REST); + homun->vaporize(sd, HOM_ST_REST, true); if ((sd->sc.data[SC_SPRITEMABLE] && pc->checkskill(sd, SU_SPRITEMABLE))) status_change_end(&sd->bl, SC_SPRITEMABLE, INVALID_TIMER); @@ -7995,7 +7952,7 @@ static void pc_damage(struct map_session_data *sd, struct block_list *src, unsig if( sd->status.pet_id > 0 && sd->pd && battle_config.pet_damage_support ) pet->target_check(sd,src,1); - if( sd->status.ele_id > 0 ) + if (sd->status.ele_id != 0 && sd->ed != NULL) elemental->set_target(sd,src); if (battle_config.prevent_logout_trigger & PLT_DAMAGE) @@ -8043,7 +8000,7 @@ static int pc_dead(struct map_session_data *sd, struct block_list *src) if (sd->status.hom_id > 0){ if(battle_config.homunculus_auto_vapor && sd->hd) - homun->vaporize(sd, HOM_ST_REST); + homun->vaporize(sd, HOM_ST_REST, true); } if( sd->md ) @@ -9058,7 +9015,7 @@ static int pc_jobchange(struct map_session_data *sd, int class, int upper) pc->setoption(sd, i); if(homun_alive(sd->hd) && !pc->checkskill(sd, AM_CALLHOMUN)) - homun->vaporize(sd, HOM_ST_REST); + homun->vaporize(sd, HOM_ST_REST, true); if ((sd->sc.data[SC_SPRITEMABLE] && pc->checkskill(sd, SU_SPRITEMABLE))) status_change_end(&sd->bl, SC_SPRITEMABLE, INVALID_TIMER); @@ -10979,7 +10936,7 @@ static int map_day_timer(int tid, int64 tick, int id, intptr_t data) map->night_flag = 0; // 0=day, 1=night [Yor] map->foreachpc(pc->daynight_timer_sub); safestrncpy(tmp_soutput, (data == 0) ? msg_txt(502) : msg_txt(60), sizeof(tmp_soutput)); // The day has arrived! - intif->broadcast(tmp_soutput, (int)strlen(tmp_soutput) + 1, BC_DEFAULT); + clif->broadcast(NULL, tmp_soutput, (int)strlen(tmp_soutput) + 1, BC_DEFAULT, ALL_CLIENT); return 0; } @@ -11000,7 +10957,7 @@ static int map_night_timer(int tid, int64 tick, int id, intptr_t data) map->night_flag = 1; // 0=day, 1=night [Yor] map->foreachpc(pc->daynight_timer_sub); safestrncpy(tmp_soutput, (data == 0) ? msg_txt(503) : msg_txt(59), sizeof(tmp_soutput)); // The night has fallen... - intif->broadcast(tmp_soutput, (int)strlen(tmp_soutput) + 1, BC_DEFAULT); + clif->broadcast(NULL, tmp_soutput, (int)strlen(tmp_soutput) + 1, BC_DEFAULT, ALL_CLIENT); return 0; } @@ -12204,6 +12161,29 @@ static int pc_have_magnifier(struct map_session_data *sd) } /** + * checks if player have any item that listed in item chain + * @param sd map_session_data of Player + * @param chain_id unsigned short of item chain id + * @return index of inventory, INDEX_NOT_FOUND if it is not found + */ +static int pc_have_item_chain(struct map_session_data *sd, unsigned short chain_id) +{ + if (chain_id >= itemdb->chain_count) { + ShowError("itemdb_chain_item: unknown chain id %d\n", chain_id); + return INDEX_NOT_FOUND; + } + + for (int n = 0; n < itemdb->chains[chain_id].qty; n++) { + struct item_chain_entry *entry = &itemdb->chains[chain_id].items[n]; + int index = pc->search_inventory(sd, entry->id); + if (index != INDEX_NOT_FOUND) + return index; + } + + return INDEX_NOT_FOUND; +} + +/** * Checks if player have basic skills learned. * @param sd Player Data * @param level Required Level of Novice Skill @@ -12300,6 +12280,54 @@ static void pc_check_supernovice_call(struct map_session_data *sd, const char *m } } +/** + * Sends a message t all online GMs having the specified permission. + * + * @param sender_name Sender character name. + * @param permission The required permission to receive this message. + * @param message The message body. + * + * @return The amount of characters the message was delivered to. + */ +// The transmission of GM only Wisp/Page from server to inter-server +static int pc_wis_message_to_gm(const char *sender_name, int permission, const char *message) +{ + nullpo_ret(sender_name); + nullpo_ret(message); + int mes_len = (int)strlen(message) + 1; // + null + int count = 0; + + // information is sent to all online GM + map->foreachpc(pc->wis_message_to_gm_sub, permission, sender_name, message, mes_len, &count); + + return count; +} + +/** + * Helper function for pc_wis_message_to_gm(). + */ +static int pc_wis_message_to_gm_sub(struct map_session_data *sd, va_list va) +{ + nullpo_ret(sd); + + int permission = va_arg(va, int); + if (!pc_has_permission(sd, permission)) + return 0; + + const char *sender_name = va_arg(va, const char *); + const char *message = va_arg(va, const char *); + int len = va_arg(va, int); + int *count = va_arg(va, int *); + + nullpo_ret(sender_name); + nullpo_ret(message); + nullpo_ret(count); + + clif->wis_message(sd->fd, sender_name, message, len); + ++*count; + return 1; +} + static void pc_update_job_and_level(struct map_session_data *sd) { nullpo_retv(sd); @@ -12747,6 +12775,8 @@ void pc_defaults(void) pc->check_supernovice_call = pc_check_supernovice_call; pc->process_chat_message = pc_process_chat_message; + pc->wis_message_to_gm = pc_wis_message_to_gm; + pc->wis_message_to_gm_sub = pc_wis_message_to_gm_sub; /** * Autotrade persistency [Ind/Hercules <3] @@ -12762,6 +12792,7 @@ void pc_defaults(void) pc->update_idle_time = pc_update_idle_time; pc->have_magnifier = pc_have_magnifier; + pc->have_item_chain = pc_have_item_chain; pc->check_basicskill = pc_check_basicskill; diff --git a/src/map/pc.h b/src/map/pc.h index 7c89f7f32..7a42be5be 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -238,6 +238,8 @@ struct map_session_data { unsigned int loggingout : 1; unsigned int warp_clean : 1; unsigned int refine_ui : 1; + unsigned int npc_unloaded : 1; ///< The player is talking with an unloaded NPCs (respawned tombstones) + unsigned int lapine_ui : 1; } state; struct { unsigned char no_weapon_damage, no_magic_damage, no_misc_damage; @@ -664,10 +666,10 @@ END_ZEROED_BLOCK; #define pc_issit(sd) ( (sd)->vd.dead_sit == 2 ) #define pc_isidle(sd) ( (sd)->chat_id != 0 || (sd)->state.vending || (sd)->state.buyingstore || DIFF_TICK(sockt->last_tick, (sd)->idletime) >= battle->bc->idle_no_share ) #define pc_istrading(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->state.trading ) -#define pc_cant_act(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1) +#define pc_cant_act(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1) /* equals pc_cant_act except it doesn't check for chat rooms */ -#define pc_cant_act2(sd) ( (sd)->npc_id || (sd)->state.buyingstore || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1) +#define pc_cant_act2(sd) ( (sd)->npc_id || (sd)->state.buyingstore || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1) #define pc_setdir(sd,b,h) ( (sd)->ud.dir = (b) ,(sd)->head_dir = (h) ) #define pc_setchatid(sd,n) ( (sd)->chat_id = (n) ) @@ -675,6 +677,7 @@ END_ZEROED_BLOCK; #define pc_iscloaking(sd) ( !((sd)->sc.option&OPTION_CHASEWALK) && ((sd)->sc.option&OPTION_CLOAK) ) #define pc_ischasewalk(sd) ( (sd)->sc.option&OPTION_CHASEWALK ) #define pc_ismuted(sc,type) ( (sc)->data[SC_NOCHAT] && (sc)->data[SC_NOCHAT]->val1&(type) ) +#define pc_isvending(sd) ((sd)->state.vending || (sd)->state.prevend || (sd)->state.buyingstore) #ifdef NEW_CARTS #define pc_iscarton(sd) ( (sd)->sc.data[SC_PUSH_CART] ) @@ -963,7 +966,7 @@ END_ZEROED_BLOCK; /* End */ int (*updateweightstatus) (struct map_session_data *sd); - int (*addautobonus) (struct s_autobonus *bonus,char max,const char *bonus_script,short rate,unsigned int dur,short atk_type,const char *o_script,unsigned short pos,bool onskill); + int (*addautobonus) (struct s_autobonus *bonus,char max,const char *bonus_script,short rate,unsigned int dur,short atk_type,const char *o_script,unsigned int pos,bool onskill); int (*exeautobonus) (struct map_session_data* sd,struct s_autobonus *bonus); int (*endautobonus) (int tid, int64 tick, int id, intptr_t data); int (*delautobonus) (struct map_session_data* sd,struct s_autobonus *bonus,char max,bool restore); @@ -1183,8 +1186,11 @@ END_ZEROED_BLOCK; /* End */ void (*update_idle_time) (struct map_session_data* sd, enum e_battle_config_idletime type); int (*have_magnifier) (struct map_session_data *sd); + int (*have_item_chain) (struct map_session_data *sd, unsigned short chain_id); bool (*process_chat_message) (struct map_session_data *sd, const char *message); + int (*wis_message_to_gm) (const char *sender_name, int permission, const char *message); + int (*wis_message_to_gm_sub) (struct map_session_data *sd, va_list va); void (*check_supernovice_call) (struct map_session_data *sd, const char *message); bool (*check_basicskill) (struct map_session_data *sd, int level); bool (*isDeathPenaltyJob) (uint16 job); diff --git a/src/map/pet.c b/src/map/pet.c index ce26b6cb1..b2b6d96f8 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -1321,7 +1321,7 @@ static int pet_read_db_libconfig(const char *filename, bool ignore_missing) count++; } libconfig->destroy(&pet_db_conf); - ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filename); + ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filepath); return count; } diff --git a/src/map/quest.c b/src/map/quest.c index 9540b411d..38ac88eea 100644 --- a/src/map/quest.c +++ b/src/map/quest.c @@ -585,7 +585,7 @@ static int quest_read_db(void) count++; } libconfig->destroy(&quest_db_conf); - ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filename); + ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filepath); return count; } diff --git a/src/map/refine.c b/src/map/refine.c index 4fe6e73c4..29d81c9b8 100644 --- a/src/map/refine.c +++ b/src/map/refine.c @@ -624,7 +624,7 @@ static int refine_readdb_refine_libconfig(const char *filename) } } libconfig->destroy(&refine_db_conf); - ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filename); + ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filepath); return count; } diff --git a/src/map/script.c b/src/map/script.c index ec553fa76..ab7513ede 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -105,7 +105,7 @@ static inline void SETVALUE(struct script_buf *buf, int i, int n) VECTOR_INDEX(*buf, i+2) = GetByte(n, 2); } -const char *script_op2name(int op) +static const char *script_op2name(int op) { #define RETURN_OP_NAME(type) case type: return #type switch( op ) { @@ -2813,7 +2813,7 @@ static struct map_session_data *script_charid2sd(struct script_state *st, int ch static struct map_session_data *script_nick2sd(struct script_state *st, const char *name) { struct map_session_data *sd; - if ((sd = map->nick2sd(name)) == NULL) { + if ((sd = map->nick2sd(name, false)) == NULL) { ShowWarning("script_nick2sd: Player name '%s' not found!\n", name); script->reportfunc(st); script->reportsrc(st); @@ -8822,7 +8822,7 @@ static BUILDIN(getcharid) struct map_session_data *sd; if (script_hasdata(st, 3)) - sd = map->nick2sd(script_getstr(st, 3)); + sd = map->nick2sd(script_getstr(st, 3), false); else sd = script->rid2sd(st); @@ -9578,27 +9578,29 @@ static BUILDIN(getequipisidentify) } /*========================================== - * Get the item refined value at pos - * return (npc) - * x : refine amount - * 0 : false (not refined) + * Get the total refine amount of equip at given pos + * return total refine amount *------------------------------------------*/ static BUILDIN(getequiprefinerycnt) { - int i = -1,num; - struct map_session_data *sd; + int total_refine = 0; + struct map_session_data* sd = script->rid2sd(st); - num = script_getnum(st,2); - sd = script->rid2sd(st); - if( sd == NULL ) - return true; + if (sd != NULL) + { + int count = script_lastdata(st); + int script_equip_size = ARRAYLENGTH(script->equip); + for (int n = 2; n <= count; n++) { + int i = -1; + int num = script_getnum(st, n); + if (num > 0 && num <= script_equip_size) + i = pc->checkequip(sd, script->equip[num - 1]); - if (num > 0 && num <= ARRAYLENGTH(script->equip)) - i=pc->checkequip(sd,script->equip[num-1]); - if(i >= 0) - script_pushint(st,sd->status.inventory[i].refine); - else - script_pushint(st,0); + if (i >= 0) + total_refine += sd->status.inventory[i].refine; + } + } + script_pushint(st, total_refine); return true; } @@ -11954,12 +11956,12 @@ static BUILDIN(announce) int fontAlign = script_hasdata(st,7) ? script_getnum(st,7) : 0; // default fontAlign int fontY = script_hasdata(st,8) ? script_getnum(st,8) : 0; // default fontY size_t len = strlen(mes); + send_target target = ALL_CLIENT; + struct block_list *bl = NULL; Assert_retr(false, len < INT_MAX); if( flag&(BC_TARGET_MASK|BC_SOURCE_MASK) ) { // Broadcast source or broadcast region defined - send_target target; - struct block_list *bl = NULL; if (flag&BC_NPC) { // If bc_npc flag is set, use NPC as broadcast source bl = map->id2bl(st->oid); @@ -11977,17 +11979,13 @@ static BUILDIN(announce) case BC_SELF: target = SELF; break; default: target = ALL_CLIENT; break; // BC_ALL } - - if (fontColor) - clif->broadcast2(bl, mes, (int)len+1, (unsigned int)strtoul(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY, target); - else - clif->broadcast(bl, mes, (int)len+1, flag&BC_COLOR_MASK, target); - } else { - if (fontColor) - intif->broadcast2(mes, (int)len+1, (unsigned int)strtoul(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY); - else - intif->broadcast(mes, (int)len+1, flag&BC_COLOR_MASK); } + + if (fontColor) + clif->broadcast2(bl, mes, (int)len+1, (unsigned int)strtoul(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY, target); + else + clif->broadcast(bl, mes, (int)len+1, flag&BC_COLOR_MASK, target); + return true; } /*========================================== @@ -12673,7 +12671,7 @@ static BUILDIN(homunculus_morphembryo) clif->additem(sd, 0, 0, i); clif->emotion(&sd->hd->bl, E_SWT); } else { - homun->vaporize(sd, HOM_ST_MORPH); + homun->vaporize(sd, HOM_ST_MORPH, true); success = true; } } else { @@ -14628,6 +14626,82 @@ static BUILDIN(getiteminfo) case ITEMINFO_TRADE: script_pushint(st, it->flag.trade_restriction); break; + case ITEMINFO_ELV_MAX: + script_pushint(st, it->elvmax); + break; + case ITEMINFO_DROPEFFECT_MODE: + script_pushint(st, it->dropeffectmode); + break; + case ITEMINFO_DELAY: + script_pushint(st, it->delay); + break; + case ITEMINFO_CLASS_BASE_1: + script_pushint(st, it->class_base[0]); + break; + case ITEMINFO_CLASS_BASE_2: + script_pushint(st, it->class_base[1]); + break; + case ITEMINFO_CLASS_BASE_3: + script_pushint(st, it->class_base[2]); + break; + case ITEMINFO_CLASS_UPPER: + script_pushint(st, it->class_upper); + break; + case ITEMINFO_FLAG_NO_REFINE: + script_pushint(st, it->flag.no_refine); + break; + case ITEMINFO_FLAG_DELAY_CONSUME: + script_pushint(st, it->flag.delay_consume); + break; + case ITEMINFO_FLAG_AUTOEQUIP: + script_pushint(st, it->flag.autoequip); + break; + case ITEMINFO_FLAG_AUTO_FAVORITE: + script_pushint(st, it->flag.auto_favorite); + break; + case ITEMINFO_FLAG_BUYINGSTORE: + script_pushint(st, it->flag.buyingstore); + break; + case ITEMINFO_FLAG_BINDONEQUIP: + script_pushint(st, it->flag.bindonequip); + break; + case ITEMINFO_FLAG_KEEPAFTERUSE: + script_pushint(st, it->flag.keepafteruse); + break; + case ITEMINFO_FLAG_FORCE_SERIAL: + script_pushint(st, it->flag.force_serial); + break; + case ITEMINFO_FLAG_NO_OPTIONS: + script_pushint(st, it->flag.no_options); + break; + case ITEMINFO_FLAG_DROP_ANNOUNCE: + script_pushint(st, it->flag.drop_announce); + break; + case ITEMINFO_FLAG_SHOWDROPEFFECT: + script_pushint(st, it->flag.showdropeffect); + break; + case ITEMINFO_STACK_AMOUNT: + script_pushint(st, it->stack.amount); + break; + case ITEMINFO_STACK_FLAG: + { + int stack_flag = 0; + if (it->stack.inventory != 0) stack_flag |= 1; + if (it->stack.cart != 0) stack_flag |= 2; + if (it->stack.storage != 0) stack_flag |= 4; + if (it->stack.guildstorage != 0) stack_flag |= 8; + script_pushint(st, stack_flag); + } + break; + case ITEMINFO_ITEM_USAGE_FLAG: + script_pushint(st, it->item_usage.flag); + break; + case ITEMINFO_ITEM_USAGE_OVERRIDE: + script_pushint(st, it->item_usage.override); + break; + case ITEMINFO_GM_LV_TRADE_OVERRIDE: + script_pushint(st, it->gm_lv_trade_override); + break; default: ShowError("buildin_getiteminfo: Invalid item type %d.\n", n); script_pushint(st,-1); @@ -14897,6 +14971,78 @@ static BUILDIN(setiteminfo) case ITEMINFO_TRADE: it->flag.trade_restriction = value; break; + case ITEMINFO_ELV_MAX: + it->elvmax = cap_value(value, 0, MAX_LEVEL); + break; + case ITEMINFO_DROPEFFECT_MODE: + it->dropeffectmode = value; + break; + case ITEMINFO_DELAY: + it->delay = value; + break; + case ITEMINFO_CLASS_BASE_1: + it->class_base[0] = value; + break; + case ITEMINFO_CLASS_BASE_2: + it->class_base[1] = value; + break; + case ITEMINFO_CLASS_BASE_3: + it->class_base[2] = value; + break; + case ITEMINFO_CLASS_UPPER: + it->class_upper = value; + break; + case ITEMINFO_FLAG_NO_REFINE: + it->flag.no_refine = cap_value(value, 0, MAX_REFINE); + break; + case ITEMINFO_FLAG_DELAY_CONSUME: + it->flag.delay_consume = value; + break; + case ITEMINFO_FLAG_AUTOEQUIP: + it->flag.autoequip = cap_value(value, 0, 1); + break; + case ITEMINFO_FLAG_AUTO_FAVORITE: + it->flag.auto_favorite = cap_value(value, 0, 1); + break; + case ITEMINFO_FLAG_BUYINGSTORE: + it->flag.buyingstore = cap_value(value, 0, 1); + break; + case ITEMINFO_FLAG_BINDONEQUIP: + it->flag.bindonequip = cap_value(value, 0, 1); + break; + case ITEMINFO_FLAG_KEEPAFTERUSE: + it->flag.keepafteruse = cap_value(value, 0, 1); + break; + case ITEMINFO_FLAG_FORCE_SERIAL: + it->flag.force_serial = cap_value(value, 0, 1); + break; + case ITEMINFO_FLAG_NO_OPTIONS: + it->flag.no_options = cap_value(value, 0, 1); + break; + case ITEMINFO_FLAG_DROP_ANNOUNCE: + it->flag.drop_announce = cap_value(value, 0, 1); + break; + case ITEMINFO_FLAG_SHOWDROPEFFECT: + it->flag.showdropeffect = cap_value(value, 0, 1); + break; + case ITEMINFO_STACK_AMOUNT: + it->stack.amount = cap_value(value, 0, USHRT_MAX); + break; + case ITEMINFO_STACK_FLAG: + it->stack.inventory = ((value & 1) != 0); + it->stack.cart = ((value & 2) != 0); + it->stack.storage = ((value & 4) != 0); + it->stack.guildstorage = ((value & 8) != 0); + break; + case ITEMINFO_ITEM_USAGE_FLAG: + it->item_usage.flag = cap_value(value, 0, 1); + break; + case ITEMINFO_ITEM_USAGE_OVERRIDE: + it->item_usage.override = value; + break; + case ITEMINFO_GM_LV_TRADE_OVERRIDE: + it->gm_lv_trade_override = value; + break; default: ShowError("buildin_setiteminfo: invalid type %d.\n", n); script_pushint(st,-1); @@ -16384,7 +16530,7 @@ static BUILDIN(getmapxy) case 0: //Get Character Position if (script_hasdata(st,6)) { if (script_isstringtype(st,6)) - sd = map->nick2sd(script_getstr(st,6)); + sd = map->nick2sd(script_getstr(st,6), false); else sd = map->id2sd(script_getnum(st,6)); } else { @@ -16411,7 +16557,7 @@ static BUILDIN(getmapxy) case 2: //Get Pet Position if (script_hasdata(st,6)) { if (script_isstringtype(st,6)) - sd = map->nick2sd(script_getstr(st,6)); + sd = map->nick2sd(script_getstr(st,6), false); else { bl = map->id2bl(script_getnum(st,6)); break; @@ -16433,7 +16579,7 @@ static BUILDIN(getmapxy) case 4: //Get Homun Position if (script_hasdata(st,6)) { if (script_isstringtype(st,6)) { - sd = map->nick2sd(script_getstr(st,6)); + sd = map->nick2sd(script_getstr(st,6), false); } else { bl = map->id2bl(script_getnum(st,6)); break; @@ -16448,7 +16594,7 @@ static BUILDIN(getmapxy) case 5: //Get Mercenary Position if (script_hasdata(st,6)) { if (script_isstringtype(st,6)) { - sd = map->nick2sd(script_getstr(st,6)); + sd = map->nick2sd(script_getstr(st,6), false); } else { bl = map->id2bl(script_getnum(st,6)); break; @@ -16463,7 +16609,7 @@ static BUILDIN(getmapxy) case 6: //Get Elemental Position if (script_hasdata(st,6)) { if (script_isstringtype(st,6)) { - sd = map->nick2sd(script_getstr(st,6)); + sd = map->nick2sd(script_getstr(st,6), false); } else { bl = map->id2bl(script_getnum(st,6)); break; @@ -16631,6 +16777,8 @@ static BUILDIN(isequippedcnt) if(j == EQI_HAND_R && sd->equip_index[EQI_HAND_L] == index) continue; if(j == EQI_HEAD_MID && sd->equip_index[EQI_HEAD_LOW] == index) continue; if(j == EQI_HEAD_TOP && (sd->equip_index[EQI_HEAD_MID] == index || sd->equip_index[EQI_HEAD_LOW] == index)) continue; + if(j == EQI_COSTUME_MID && sd->equip_index[EQI_COSTUME_LOW] == index) continue; + if(j == EQI_COSTUME_TOP && (sd->equip_index[EQI_COSTUME_MID] == index || sd->equip_index[EQI_COSTUME_LOW] == index)) continue; if(!sd->inventory_data[index]) continue; @@ -16684,6 +16832,8 @@ static BUILDIN(isequipped) if(j == EQI_HAND_R && sd->equip_index[EQI_HAND_L] == index) continue; if(j == EQI_HEAD_MID && sd->equip_index[EQI_HEAD_LOW] == index) continue; if(j == EQI_HEAD_TOP && (sd->equip_index[EQI_HEAD_MID] == index || sd->equip_index[EQI_HEAD_LOW] == index)) continue; + if(j == EQI_COSTUME_MID && sd->equip_index[EQI_COSTUME_LOW] == index) continue; + if(j == EQI_COSTUME_TOP && (sd->equip_index[EQI_COSTUME_MID] == index || sd->equip_index[EQI_COSTUME_LOW] == index)) continue; if(!sd->inventory_data[index]) continue; @@ -18386,10 +18536,12 @@ static BUILDIN(npcshopdelitem) unsigned int nameid = script_getnum(st,i); ARR_FIND(0, size, n, nd->u.shop.shop_item[n].nameid == nameid); - if (n < size) { - memmove(&nd->u.shop.shop_item[n], &nd->u.shop.shop_item[n+1], sizeof(nd->u.shop.shop_item[0])*(size-n)); - size--; + if (n == size) { + continue; + } else if (n < size - 1) { + memmove(&nd->u.shop.shop_item[n], &nd->u.shop.shop_item[n+1], sizeof(nd->u.shop.shop_item[0]) * (size - n - 1)); } + size--; } RECREATE(nd->u.shop.shop_item, struct npc_item_list, size); @@ -18622,6 +18774,7 @@ static BUILDIN(getmonsterinfo) case 20: script_pushint(st,monster->status.def_ele); break; case 21: script_pushint(st,monster->status.mode); break; case 22: script_pushint(st,monster->mexp); break; + case 23: script_pushint(st, monster->dmg_taken_rate); break; default: script_pushint(st,-1); //wrong Index } return true; @@ -18695,7 +18848,7 @@ static BUILDIN(searchitem) if ((items[0] = itemdb->exists(atoi(itemname)))) { count = 1; } else { - count = itemdb->search_name_array(items, ARRAYLENGTH(items), itemname, 0); + count = itemdb->search_name_array(items, ARRAYLENGTH(items), itemname, IT_SEARCH_NAME_PARTIAL); if (count > MAX_SEARCH) count = MAX_SEARCH; } @@ -19179,6 +19332,9 @@ static BUILDIN(setunitdata) script_pushint(st, 1); return true; } + case UDT_DAMAGE_TAKEN_RATE: + setunitdata_check_bounds(4, 1, INT_MAX); + break; default: break; } @@ -19353,6 +19509,9 @@ static BUILDIN(setunitdata) case UDT_DMOTION: md->status.dmotion = (unsigned short) val; break; + case UDT_DAMAGE_TAKEN_RATE: + md->dmg_taken_rate = (int) val; + break; default: ShowWarning("buildin_setunitdata: Invalid data type '%s' for mob unit.\n", udtype); script_pushint(st, 0); @@ -20200,6 +20359,7 @@ static BUILDIN(getunitdata) case UDT_AMOTION: script_pushint(st, md->status.amotion); break; case UDT_ADELAY: script_pushint(st, md->status.adelay); break; case UDT_DMOTION: script_pushint(st, md->status.dmotion); break; + case UDT_DAMAGE_TAKEN_RATE: script_pushint(st, md->dmg_taken_rate); break; default: ShowWarning("buildin_getunitdata: Invalid data type '%s' for Mob unit.\n", udtype); script_pushint(st, -1); @@ -22628,6 +22788,19 @@ static BUILDIN(setfont) return true; } +static BUILDIN(getfont) +{ + struct map_session_data *sd = script->rid2sd(st); + + if (sd == NULL) { + script_pushint(st, 0); + return true; + } + + script_pushint(st, sd->status.font); + return true; +} + static int buildin_mobuseskill_sub(struct block_list *bl, va_list ap) { struct mob_data *md = NULL; @@ -22954,7 +23127,7 @@ static BUILDIN(getcharip) /* check if a character name is specified */ if (script_hasdata(st, 2)) { if (script_isstringtype(st, 2)) { - sd = map->nick2sd(script_getstr(st, 2)); + sd = map->nick2sd(script_getstr(st, 2), false); } else { int id = script_getnum(st, 2); sd = (map->id2sd(id) ? map->id2sd(id) : map->charid2sd(id)); @@ -24890,6 +25063,49 @@ static BUILDIN(consolemes) return true; } +static BUILDIN(setfavoriteitemidx) +{ + struct map_session_data *sd = script_rid2sd(st); + int idx = script_getnum(st, 2); + int value = script_getnum(st, 3); + + if (sd == NULL) { + ShowError("buildin_setfavoriteitemidx: No player attached.\n"); + return false; + } + + if (idx < 0 || idx >= sd->status.inventorySize) { + ShowError("buildin_setfavoriteitemidx: Invalid inventory index %d (min: %d, max: %d).\n", idx, 0, (sd->status.inventorySize - 1)); + return false; + } else if (sd->inventory_data[idx] == NULL || sd->inventory_data[idx]->nameid <= 0) { + ShowWarning("buildin_setfavoriteitemidx: Current inventory index %d has no data.\n", idx); + return false; + } else if (sd->status.inventory[idx].equip > 0) { + ShowWarning("buildin_setfavoriteitemidx: Cant change favorite flag of an equipped item.\n"); + return false; + } else { + sd->status.inventory[idx].favorite = cap_value(value, 0, 1); + clif->favorite_item(sd, idx); + } + + return true; +} + +static BUILDIN(autofavoriteitem) +{ + int nameid = script_getnum(st, 2); + int flag = script_getnum(st, 3); + struct item_data *item_data; + + if ((item_data = itemdb->exists(nameid)) == NULL) { + ShowError("buildin_autofavoriteitem: Invalid item '%d'.\n", nameid); + return false; + } + + item_data->flag.auto_favorite = cap_value(flag, 0, 1); + return true; +} + /** place holder for the translation macro **/ static BUILDIN(_) { @@ -25515,6 +25731,94 @@ static BUILDIN(openrefineryui) } /** + * identify(<item id>) + * Identifies the first unidentified <item id> item on player's inventory. + * Returns -2 on error, -1 if no item to identify was found, identified idx otherwise. + */ +static BUILDIN(identify) +{ + struct map_session_data *sd = script_rid2sd(st); + + if (sd == NULL) { + script_pushint(st, -2); + return true; + } + + int itemid = script_getnum(st, 2); + if (itemdb->exists(itemid) == NULL) { + ShowError("buildin_identify: Invalid item ID (%d)\n", itemid); + script_pushint(st, -2); + return true; + } + + int idx = -1; + ARR_FIND(0, sd->status.inventorySize, idx, (sd->status.inventory[idx].nameid == itemid && sd->status.inventory[idx].identify == 0)); + + if (idx < 0 || idx >= sd->status.inventorySize) { + script_pushint(st, -1); + return true; + } + + sd->status.inventory[idx].identify = 1; + clif->item_identified(sd, idx, 0); + script_pushint(st, idx); + + return true; +} + +/** + * identifyidx(idx) + * Identifies item at idx. + * Returns true if item is identified, false otherwise. + */ +static BUILDIN(identifyidx) +{ + struct map_session_data *sd = script_rid2sd(st); + + if (sd == NULL) { + script_pushint(st, false); + return true; + } + + int idx = script_getnum(st, 2); + if (idx < 0 || idx >= sd->status.inventorySize) { + ShowError("buildin_identifyidx: Invalid inventory index (%d), expected a value between 0 and %d\n", idx, sd->status.inventorySize); + script_pushint(st, false); + return true; + } + + if (sd->status.inventory[idx].nameid <= 0 || sd->status.inventory[idx].identify != 0) { + script_pushint(st, false); + return true; + } + + sd->status.inventory[idx].identify = 1; + clif->item_identified(sd, idx, 0); + script_pushint(st, true); + + return true; +} + +static BUILDIN(openlapineddukddakboxui) +{ + struct map_session_data *sd = script_rid2sd(st); + if (sd == NULL) + return false; + const int item_id = script_getnum(st, 2); + struct item_data *it = itemdb->exists(item_id); + if (it == NULL) { + ShowError("buildin_openlapineddukddakboxui: Item %d is not valid\n", item_id); + script->reportfunc(st); + script->reportsrc(st); + script_pushint(st, false); + return true; + } + clif->lapineDdukDdak_open(sd, item_id); + script_pushint(st, true); + return true; +} + +/** * Adds a built-in script function. * * @param buildin Script function data @@ -25663,6 +25967,52 @@ static void script_run_item_unequip_script(struct map_session_data *sd, struct i script->current_item_id = 0; } +static void script_run_item_rental_start_script(struct map_session_data *sd, struct item_data *data, int oid) __attribute__((nonnull(1, 2))); + +/** + * Run item rental start script + * @param sd player session data. Must be correct and checked before. + * @param data rental item data. Must be correct and checked before. + * @param oid npc id. Can be also 0 or fake npc id. + **/ +static void script_run_item_rental_start_script(struct map_session_data *sd, struct item_data *data, int oid) +{ + script->current_item_id = data->nameid; + script->run(data->rental_start_script, 0, sd->bl.id, oid); + script->current_item_id = 0; +} + +static void script_run_item_rental_end_script(struct map_session_data *sd, struct item_data *data, int oid) __attribute__((nonnull(1, 2))); + +/** +* Run item rental end script +* @param sd player session data. Must be correct and checked before. +* @param data rental item data. Must be correct and checked before. +* @param oid npc id. Can be also 0 or fake npc id. +**/ +static void script_run_item_rental_end_script(struct map_session_data *sd, struct item_data *data, int oid) +{ + script->current_item_id = data->nameid; + script->run(data->rental_end_script, 0, sd->bl.id, oid); + script->current_item_id = 0; +} + +static void script_run_item_lapineddukddak_script(struct map_session_data *sd, struct item_data *data, int oid) __attribute__((nonnull (1, 2))); + +/** + * Run item lapineddukddak script for item. + * + * @param sd player session data. Must be correct and checked before. + * @param data unequipped item data. Must be correct and checked before. + * @param oid npc id. Can be also 0 or fake npc id. + */ +static void script_run_item_lapineddukddak_script(struct map_session_data *sd, struct item_data *data, int oid) +{ + script->current_item_id = data->nameid; + script->run(data->lapineddukddak->script, 0, sd->bl.id, oid); + script->current_item_id = 0; +} + #define BUILDIN_DEF(x,args) { buildin_ ## x , #x , args, false } #define BUILDIN_DEF2(x,x2,args) { buildin_ ## x , x2 , args, false } #define BUILDIN_DEF_DEPRECATED(x,args) { buildin_ ## x , #x , args, true } @@ -25755,7 +26105,7 @@ static void script_parse_builtin(void) BUILDIN_DEF(getequipisequiped,"i"), BUILDIN_DEF(getequipisenableref,"i"), BUILDIN_DEF(getequipisidentify,"i"), - BUILDIN_DEF(getequiprefinerycnt,"i"), + BUILDIN_DEF(getequiprefinerycnt,"i*"), BUILDIN_DEF(getequipweaponlv,"i"), BUILDIN_DEF(getequippercentrefinery,"i?"), BUILDIN_DEF(successrefitem,"i?"), @@ -26098,6 +26448,7 @@ static void script_parse_builtin(void) BUILDIN_DEF(mercenary_set_faith,"ii"), BUILDIN_DEF(readbook,"ii"), BUILDIN_DEF(setfont,"i"), + BUILDIN_DEF(getfont, ""), BUILDIN_DEF(areamobuseskill,"siiiiviiiii"), BUILDIN_DEF(progressbar,"si"), BUILDIN_DEF(progressbar_unit,"si?"), @@ -26272,6 +26623,12 @@ static void script_parse_builtin(void) BUILDIN_DEF(closeroulette, ""), BUILDIN_DEF(openrefineryui, ""), + BUILDIN_DEF(setfavoriteitemidx, "ii"), + BUILDIN_DEF(autofavoriteitem, "ii"), + + BUILDIN_DEF(identify, "i"), + BUILDIN_DEF(identifyidx, "i"), + BUILDIN_DEF(openlapineddukddakboxui, "i"), }; int i, len = ARRAYLENGTH(BUILDIN); RECREATE(script->buildin, char *, script->buildin_count + len); // Pre-alloc to speed up @@ -26605,6 +26962,29 @@ static void script_hardcoded_constants(void) script->set_constant("ITEMINFO_MATK", ITEMINFO_MATK, false, false); script->set_constant("ITEMINFO_VIEWSPRITE", ITEMINFO_VIEWSPRITE, false, false); script->set_constant("ITEMINFO_TRADE", ITEMINFO_TRADE, false, false); + script->set_constant("ITEMINFO_ELV_MAX", ITEMINFO_ELV_MAX, false, false); + script->set_constant("ITEMINFO_DROPEFFECT_MODE", ITEMINFO_DROPEFFECT_MODE, false, false); + script->set_constant("ITEMINFO_DELAY", ITEMINFO_DELAY, false, false); + script->set_constant("ITEMINFO_CLASS_BASE_1", ITEMINFO_CLASS_BASE_1, false, false); + script->set_constant("ITEMINFO_CLASS_BASE_2", ITEMINFO_CLASS_BASE_2, false, false); + script->set_constant("ITEMINFO_CLASS_BASE_3", ITEMINFO_CLASS_BASE_3, false, false); + script->set_constant("ITEMINFO_CLASS_UPPER", ITEMINFO_CLASS_UPPER, false, false); + script->set_constant("ITEMINFO_FLAG_NO_REFINE", ITEMINFO_FLAG_NO_REFINE, false, false); + script->set_constant("ITEMINFO_FLAG_DELAY_CONSUME", ITEMINFO_FLAG_DELAY_CONSUME, false, false); + script->set_constant("ITEMINFO_FLAG_AUTOEQUIP", ITEMINFO_FLAG_AUTOEQUIP, false, false); + script->set_constant("ITEMINFO_FLAG_AUTO_FAVORITE", ITEMINFO_FLAG_AUTO_FAVORITE, false, false); + script->set_constant("ITEMINFO_FLAG_BUYINGSTORE", ITEMINFO_FLAG_BUYINGSTORE, false, false); + script->set_constant("ITEMINFO_FLAG_BINDONEQUIP", ITEMINFO_FLAG_BINDONEQUIP, false, false); + script->set_constant("ITEMINFO_FLAG_KEEPAFTERUSE", ITEMINFO_FLAG_KEEPAFTERUSE, false, false); + script->set_constant("ITEMINFO_FLAG_FORCE_SERIAL", ITEMINFO_FLAG_FORCE_SERIAL, false, false); + script->set_constant("ITEMINFO_FLAG_NO_OPTIONS", ITEMINFO_FLAG_NO_OPTIONS, false, false); + script->set_constant("ITEMINFO_FLAG_DROP_ANNOUNCE", ITEMINFO_FLAG_DROP_ANNOUNCE, false, false); + script->set_constant("ITEMINFO_FLAG_SHOWDROPEFFECT", ITEMINFO_FLAG_SHOWDROPEFFECT, false, false); + script->set_constant("ITEMINFO_STACK_AMOUNT", ITEMINFO_STACK_AMOUNT, false, false); + script->set_constant("ITEMINFO_STACK_FLAG", ITEMINFO_STACK_FLAG, false, false); + script->set_constant("ITEMINFO_ITEM_USAGE_FLAG", ITEMINFO_ITEM_USAGE_FLAG, false, false); + script->set_constant("ITEMINFO_ITEM_USAGE_OVERRIDE", ITEMINFO_ITEM_USAGE_OVERRIDE, false, false); + script->set_constant("ITEMINFO_GM_LV_TRADE_OVERRIDE", ITEMINFO_GM_LV_TRADE_OVERRIDE, false, false); script->constdb_comment("getmercinfo options"); script->set_constant("MERCINFO_ID,", MERCINFO_ID, false, false); @@ -26815,12 +27195,18 @@ static void script_hardcoded_constants(void) script->set_constant("UDT_ROBE", UDT_ROBE, false, false); script->set_constant("UDT_BODY2", UDT_BODY2, false, false); script->set_constant("UDT_GROUP", UDT_GROUP, false, false); + script->set_constant("UDT_DAMAGE_TAKEN_RATE", UDT_DAMAGE_TAKEN_RATE, false, false); script->constdb_comment("getguildonline types"); script->set_constant("GUILD_ONLINE_ALL", GUILD_ONLINE_ALL, false, false); script->set_constant("GUILD_ONLINE_VENDOR", GUILD_ONLINE_VENDOR, false, false); script->set_constant("GUILD_ONLINE_NO_VENDOR", GUILD_ONLINE_NO_VENDOR, false, false); + script->constdb_comment("Siege Types"); + script->set_constant("SIEGE_TYPE_FE", SIEGE_TYPE_FE, false, false); + script->set_constant("SIEGE_TYPE_SE", SIEGE_TYPE_SE, false, false); + script->set_constant("SIEGE_TYPE_TE", SIEGE_TYPE_TE, false, false); + script->constdb_comment("Renewal"); #ifdef RENEWAL script->set_constant("RENEWAL", 1, false, false); @@ -27182,4 +27568,7 @@ void script_defaults(void) script->run_use_script = script_run_use_script; script->run_item_equip_script = script_run_item_equip_script; script->run_item_unequip_script = script_run_item_unequip_script; + script->run_item_rental_start_script = script_run_item_rental_start_script; + script->run_item_rental_end_script = script_run_item_rental_end_script; + script->run_item_lapineddukddak_script = script_run_item_lapineddukddak_script; } diff --git a/src/map/script.h b/src/map/script.h index 2aefaba4e..1cec02b97 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -434,6 +434,7 @@ enum script_unit_data_types { UDT_ROBE, UDT_BODY2, UDT_GROUP, + UDT_DAMAGE_TAKEN_RATE, UDT_MAX }; @@ -459,7 +460,30 @@ enum script_iteminfo_types { ITEMINFO_MATK, ITEMINFO_VIEWSPRITE, ITEMINFO_TRADE, - + ITEMINFO_ELV_MAX, + ITEMINFO_DROPEFFECT_MODE, + ITEMINFO_DELAY, + ITEMINFO_CLASS_BASE_1, + ITEMINFO_CLASS_BASE_2, + ITEMINFO_CLASS_BASE_3, + ITEMINFO_CLASS_UPPER, + // ITEMINFO_FLAG_AVAILABLE, + ITEMINFO_FLAG_NO_REFINE, + ITEMINFO_FLAG_DELAY_CONSUME, + ITEMINFO_FLAG_AUTOEQUIP, + ITEMINFO_FLAG_AUTO_FAVORITE, + ITEMINFO_FLAG_BUYINGSTORE, + ITEMINFO_FLAG_BINDONEQUIP, + ITEMINFO_FLAG_KEEPAFTERUSE, + ITEMINFO_FLAG_FORCE_SERIAL, + ITEMINFO_FLAG_NO_OPTIONS, + ITEMINFO_FLAG_DROP_ANNOUNCE, + ITEMINFO_FLAG_SHOWDROPEFFECT, + ITEMINFO_STACK_AMOUNT, + ITEMINFO_STACK_FLAG, + ITEMINFO_ITEM_USAGE_FLAG, + ITEMINFO_ITEM_USAGE_OVERRIDE, + ITEMINFO_GM_LV_TRADE_OVERRIDE, ITEMINFO_MAX }; @@ -518,6 +542,16 @@ enum pcblock_action_flag { }; /** + * Types of Siege (WoE) + */ +enum siege_type { + SIEGE_TYPE_FE, + SIEGE_TYPE_SE, + SIEGE_TYPE_TE, + SIEGE_TYPE_MAX +}; + +/** * Structures **/ @@ -1016,6 +1050,9 @@ struct script_interface { void (*run_use_script) (struct map_session_data *sd, struct item_data *data, int oid); void (*run_item_equip_script) (struct map_session_data *sd, struct item_data *data, int oid); void (*run_item_unequip_script) (struct map_session_data *sd, struct item_data *data, int oid); + void (*run_item_rental_end_script) (struct map_session_data *sd, struct item_data *data, int oid); + void (*run_item_rental_start_script) (struct map_session_data *sd, struct item_data *data, int oid); + void (*run_item_lapineddukddak_script) (struct map_session_data *sd, struct item_data *data, int oid); }; #ifdef HERCULES_CORE diff --git a/src/map/skill.c b/src/map/skill.c index a259829ef..60d5a397d 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -82,7 +82,7 @@ #endif static struct skill_interface skill_s; -struct s_skill_dbs skilldbs; +static struct s_skill_dbs skilldbs; struct skill_interface *skill; @@ -2906,6 +2906,18 @@ static int skill_attack(int attack_type, struct block_list *src, struct block_li } } + if (bl->type == BL_MOB) { + struct mob_data *md = BL_CAST(BL_MOB, bl); + if (md != NULL) { + if (md->db->dmg_taken_rate != 100) { + if (dmg.damage > 0) + dmg.damage = apply_percentrate64(dmg.damage, md->db->dmg_taken_rate, 100); + if (dmg.damage2 > 0) + dmg.damage2 = apply_percentrate64(dmg.damage2, md->db->dmg_taken_rate, 100); + } + } + } + damage = dmg.damage + dmg.damage2; if( (skill_id == AL_INCAGI || skill_id == AL_BLESSING || @@ -7193,7 +7205,7 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list * // custom hack to make the mob display the skill, because these skills don't show the skill use text themselves //NOTE: mobs don't have the sprite animation that is used when performing this skill (will cause glitches) char temp[70]; - snprintf(temp, sizeof(temp), "%s : %s !!", md->name, skill->get_desc(skill_id)); + snprintf(temp, sizeof(temp), msg_txt(882), md->name, skill->get_desc(skill_id)); // %s : %s !! clif->disp_overhead(&md->bl, temp, AREA_CHAT_WOC, NULL); } break; @@ -8698,7 +8710,7 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list * case AM_REST: if (sd) { - if (homun->vaporize(sd,HOM_ST_REST)) + if (homun->vaporize(sd, HOM_ST_REST, false)) clif->skill_nodamage(src, bl, skill_id, skill_lv, 1); else clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); @@ -14657,7 +14669,7 @@ static int skill_check_condition_castbegin(struct map_session_data *sd, uint16 s if (map->foreachinrange(mob->count_sub, &sd->bl, skill->get_splash(skill_id, skill_lv), BL_MOB, MOBID_EMPELIUM, MOBID_S_EMPEL_1, MOBID_S_EMPEL_2)) { char output[128]; - sprintf(output, "You're too close to a stone or emperium to do this skill"); /* TODO official response? or message.conf it */ + sprintf(output, "%s", msg_txt(883)); /* TODO official response */ // You are too close to a stone or emperium to do this skill clif->messagecolor_self(sd->fd, COLOR_RED, output); return 0; } @@ -15104,7 +15116,7 @@ static int skill_check_condition_castend(struct map_session_data *sd, uint16 ski return 0; } else if( sd->status.inventory[i].amount < require.ammo_qty ) { char e_msg[100]; - sprintf(e_msg,"Skill Failed. [%s] requires %dx %s.", + sprintf(e_msg, msg_txt(884), // Skill Failed. [%s] requires %dx %s. skill->get_desc(skill_id), require.ammo_qty, itemdb_jname(sd->status.inventory[i].nameid)); diff --git a/src/map/status.c b/src/map/status.c index 63e71c9dc..71cce28c5 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -8847,7 +8847,9 @@ static int status_change_start(struct block_list *src, struct block_list *bl, en case SC_KAIZEL: val2 = 10*val1; //% of life to be revived with break; - // case SC_ARMORPROPERTY: + case SC_ARMORPROPERTY: + clif->status_change(bl, (val1 > 0 ? SI_RESIST_PROPERTY_WATER : (val2 > 0 ? SI_RESIST_PROPERTY_GROUND : (val3 > 0 ? SI_RESIST_PROPERTY_FIRE : (val4 > 0 ? SI_RESIST_PROPERTY_WIND : SI_BLANK)))), 1, tick, 0, 0, 0); + break; // case SC_ARMOR_RESIST: // Mod your resistance against elements: // val1 = water | val2 = earth | val3 = fire | val4 = wind @@ -9070,7 +9072,7 @@ static int status_change_start(struct block_list *src, struct block_list *bl, en if (sd->status.pet_id > 0) pet->menu(sd, 3); if (homun_alive(sd->hd)) - homun->vaporize(sd,HOM_ST_REST); + homun->vaporize(sd, HOM_ST_REST, true); if (sd->md) mercenary->delete(sd->md,3); } @@ -11806,10 +11808,10 @@ static int status_change_timer(int tid, int64 tick, int id, intptr_t data) case SC_SPLASHER: #if 0 // custom Venom Splasher countdown timer - if (sce->val4 % 1000 == 0) { + if (sce->val4 % 1000 == 0 && bl && bl->type == BL_PC) { char counter[10]; snprintf (counter, 10, "%d", sce->val4/1000); - clif->message(bl, counter); + clif->message(BL_UCCAST(BL_PC, bl)->fd, counter); } #endif // 0 if((sce->val4 -= 500) > 0) { @@ -13395,25 +13397,104 @@ static bool status_readdb_sizefix(char *fields[], int columns, int current) return true; } -static bool status_readdb_scconfig(char *fields[], int columns, int current) +static bool status_read_scdb_libconfig(void) { - int val = 0; - char* type = fields[0]; + struct config_t status_conf; + char filepath[256]; + safesnprintf(filepath, sizeof(filepath), "%s/%s", map->db_path, "sc_config.conf"); - nullpo_retr(false, fields); - if( !script->get_constant(type, &val) ){ - ShowWarning("status_readdb_sc_conf: Invalid status type %s specified.\n", type); + if (libconfig->load_file(&status_conf, filepath) == CONFIG_FALSE) { + ShowError("status_read_scdb_libconfig: can't read %s\n", filepath); return false; } - status->dbs->sc_conf[val] = (int)strtol(fields[1], NULL, 0); - if (status->dbs->sc_conf[val] & SC_VISIBLE) - { - status->dbs->DisplayType[val] = true; + int i = 0; + int count = 0; + struct config_setting_t *it = NULL; + + while ((it = libconfig->setting_get_elem(status_conf.root, i++)) != NULL) { + if (status->read_scdb_libconfig_sub(it, i - 1, filepath)) + ++count; } + libconfig->destroy(&status_conf); + ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filepath); + return true; +} + +static bool status_read_scdb_libconfig_sub(struct config_setting_t *it, int idx, const char *source) +{ + nullpo_retr(false, it); + nullpo_retr(false, source); + + int i32; + const char *name = config_setting_name(it); + + if (!script->get_constant(name, &i32) || i32 <= SC_NONE || i32 >= SC_MAX) { + ShowWarning("status_read_scdb_libconfig_sub: Invalid status type (%s) in \"%s\" entry #%d, skipping.\n", name, source, idx); + return false; + } + + libconfig->setting_lookup_bool_real(it, "Visible", &status->dbs->DisplayType[i32]); + + struct config_setting_t *fg = libconfig->setting_get_member(it, "Flags"); + if (fg != NULL) + status->read_scdb_libconfig_sub_flag(fg, i32, source); + return true; } + +static bool status_read_scdb_libconfig_sub_flag(struct config_setting_t *it, int type, const char *source) +{ + nullpo_retr(false, it); + nullpo_retr(false, source); + Assert_retr(false, type > SC_NONE && type < SC_MAX); + + int i = 0; + struct config_setting_t *t = NULL; + while ((t = libconfig->setting_get_elem(it, i++)) != NULL) { + const char *flag = config_setting_name(t); + bool on = libconfig->setting_get_bool_real(t); + int j; + + struct { + const char *name; + enum sc_conf_type value; + } flags[] = { + { "NoDeathReset", SC_NO_REM_DEATH }, + { "NoSave", SC_NO_SAVE }, + { "NoDispelReset", SC_NO_DISPELL }, + { "NoClearanceReset", SC_NO_CLEARANCE }, + { "Buff", SC_BUFF }, + { "Debuff", SC_DEBUFF }, + { "NoMadoReset", SC_MADO_NO_RESET }, + { "NoAllReset", SC_NO_CLEAR } + }; + + ARR_FIND(0, ARRAYLENGTH(flags), j, strcmpi(flag, flags[j].name) == 0); + if (j != ARRAYLENGTH(flags)) { + if (strcmp(flag, flags[j].name) != 0) { + ShowWarning("status_read_scdb_libconfig_sub_flag: flag (%s) for status effect (%d) is casesensitive, correct it to (%s).", flag, type, flags[i].name); + } + if (on) { + status->dbs->sc_conf[type] |= flags[j].value; + } else { + status->dbs->sc_conf[type] &= ~flags[j].value; + } + } else { + if (!status->read_scdb_libconfig_sub_flag_additional(it, type, source)) + ShowWarning("status_read_scdb_libconfig_sub_flag: invalid flag (%s) for status effect (%d).", flag, type); + } + } + return true; +} + +static bool status_read_scdb_libconfig_sub_flag_additional(struct config_setting_t *it, int type, const char *source) +{ + // to be used by plugins + return false; +} + /** * Read status db * job1.txt @@ -13452,7 +13533,7 @@ static int status_readdb(void) // sv->readdb(map->db_path, "job_db2.txt", ',', 1, 1+MAX_LEVEL, -1, status->readdb_job2); sv->readdb(map->db_path, DBPATH"size_fix.txt", ',', MAX_SINGLE_WEAPON_TYPE, MAX_SINGLE_WEAPON_TYPE, ARRAYLENGTH(status->dbs->atkmods), status->readdb_sizefix); - sv->readdb(map->db_path, "sc_config.txt", ',', 2, 2, SC_MAX, status->readdb_scconfig); + status->read_scdb_libconfig(); status->read_job_db(); pc->validate_levels(); @@ -13642,7 +13723,10 @@ void status_defaults(void) status->natural_heal_timer = status_natural_heal_timer; status->readdb_job2 = status_readdb_job2; status->readdb_sizefix = status_readdb_sizefix; - status->readdb_scconfig = status_readdb_scconfig; + status->read_scdb_libconfig = status_read_scdb_libconfig; + status->read_scdb_libconfig_sub = status_read_scdb_libconfig_sub; + status->read_scdb_libconfig_sub_flag = status_read_scdb_libconfig_sub_flag; + status->read_scdb_libconfig_sub_flag_additional = status_read_scdb_libconfig_sub_flag_additional; status->read_job_db = status_read_job_db; status->read_job_db_sub = status_read_job_db_sub; status->set_sc = status_set_sc; diff --git a/src/map/status.h b/src/map/status.h index 853a7a1a6..536003d04 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -50,7 +50,7 @@ struct pet_data; /** * SC configuration type - * @see db/sc_config.txt for more information + * @see db/sc_config.conf for more information **/ typedef enum sc_conf_type { SC_NO_REM_DEATH = 0x001, @@ -1772,10 +1772,10 @@ enum si_type { //SI_ATTACK_PROPERTY_TELEKINESIS = 905, //SI_ATTACK_PROPERTY_UNDEAD = 906, //SI_RESIST_PROPERTY_NOTHING = 907, - //SI_RESIST_PROPERTY_WATER = 908, - //SI_RESIST_PROPERTY_GROUND = 909, - //SI_RESIST_PROPERTY_FIRE = 910, - //SI_RESIST_PROPERTY_WIND = 911, + SI_RESIST_PROPERTY_WATER = 908, + SI_RESIST_PROPERTY_GROUND = 909, + SI_RESIST_PROPERTY_FIRE = 910, + SI_RESIST_PROPERTY_WIND = 911, //SI_RESIST_PROPERTY_POISON = 912, //SI_RESIST_PROPERTY_SAINT = 913, //SI_RESIST_PROPERTY_DARKNESS = 914, @@ -2387,7 +2387,10 @@ struct status_interface { int (*natural_heal_timer) (int tid, int64 tick, int id, intptr_t data); bool (*readdb_job2) (char *fields[], int columns, int current); bool (*readdb_sizefix) (char *fields[], int columns, int current); - bool (*readdb_scconfig) (char *fields[], int columns, int current); + bool (*read_scdb_libconfig) (void); + bool (*read_scdb_libconfig_sub) (struct config_setting_t *it, int idx, const char *source); + bool (*read_scdb_libconfig_sub_flag) (struct config_setting_t *it, int type, const char *source); + bool (*read_scdb_libconfig_sub_flag_additional) (struct config_setting_t *it, int type, const char *source); void (*read_job_db) (void); void (*read_job_db_sub) (int idx, const char *name, struct config_setting_t *jdb); void (*set_sc) (uint16 skill_id, sc_type sc, int icon, unsigned int flag); diff --git a/src/map/trade.c b/src/map/trade.c index cef14ffe6..ff5c04fc3 100644 --- a/src/map/trade.c +++ b/src/map/trade.c @@ -50,6 +50,9 @@ static void trade_traderequest(struct map_session_data *sd, struct map_session_d { nullpo_retv(sd); + if (sd == target_sd) + return; + if (map->list[sd->bl.m].flag.notrade) { clif->message (sd->fd, msg_sd(sd,272)); // You can't trade in this map return; @@ -223,9 +226,9 @@ static int impossible_trade_check(struct map_session_data *sd) if (inventory[index].amount < sd->deal.item[i].amount) { // if more than the player have -> hack snprintf(message_to_gm, sizeof(message_to_gm), msg_txt(538), sd->status.name, sd->status.account_id); // Hack on trade: character '%s' (account: %d) try to trade more items that he has. - intif->wis_message_to_gm(map->wisp_server_name, PC_PERM_RECEIVE_HACK_INFO, message_to_gm); + pc->wis_message_to_gm(map->wisp_server_name, PC_PERM_RECEIVE_HACK_INFO, message_to_gm); snprintf(message_to_gm, sizeof(message_to_gm), msg_txt(539), inventory[index].amount, inventory[index].nameid, sd->deal.item[i].amount); // This player has %d of a kind of item (id: %d), and try to trade %d of them. - intif->wis_message_to_gm(map->wisp_server_name, PC_PERM_RECEIVE_HACK_INFO, message_to_gm); + pc->wis_message_to_gm(map->wisp_server_name, PC_PERM_RECEIVE_HACK_INFO, message_to_gm); // if we block people if (battle_config.ban_hack_trade < 0) { chrif->char_ask_name(-1, sd->status.name, CHAR_ASK_NAME_BLOCK, 0, 0, 0, 0, 0, 0); @@ -242,7 +245,7 @@ static int impossible_trade_check(struct map_session_data *sd) // message about the ban safestrncpy(message_to_gm, msg_txt(508), sizeof(message_to_gm)); // This player hasn't been banned (Ban option is disabled). - intif->wis_message_to_gm(map->wisp_server_name, PC_PERM_RECEIVE_HACK_INFO, message_to_gm); + pc->wis_message_to_gm(map->wisp_server_name, PC_PERM_RECEIVE_HACK_INFO, message_to_gm); return 1; } inventory[index].amount -= sd->deal.item[i].amount; // remove item from inventory diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 95c7869ac..b207e52ba 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -1276,8 +1276,8 @@ typedef void (*HPMHOOK_pre_clif_scriptclear) (struct map_session_data **sd, int typedef void (*HPMHOOK_post_clif_scriptclear) (struct map_session_data *sd, int npcid); typedef void (*HPMHOOK_pre_clif_viewpoint) (struct map_session_data **sd, int *npc_id, int *type, int *x, int *y, int *id, int *color); typedef void (*HPMHOOK_post_clif_viewpoint) (struct map_session_data *sd, int npc_id, int type, int x, int y, int id, int color); -typedef int (*HPMHOOK_pre_clif_damage) (struct block_list **src, struct block_list **dst, int *sdelay, int *ddelay, int64 *damage, short *div, unsigned char *type, int64 *damage2); -typedef int (*HPMHOOK_post_clif_damage) (int retVal___, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 damage, short div, unsigned char type, int64 damage2); +typedef int (*HPMHOOK_pre_clif_damage) (struct block_list **src, struct block_list **dst, int *sdelay, int *ddelay, int64 *damage, short *div, enum battle_dmg_type *type, int64 *damage2); +typedef int (*HPMHOOK_post_clif_damage) (int retVal___, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 damage, short div, enum battle_dmg_type type, int64 damage2); typedef void (*HPMHOOK_pre_clif_sitting) (struct block_list **bl); typedef void (*HPMHOOK_post_clif_sitting) (struct block_list *bl); typedef void (*HPMHOOK_pre_clif_standing) (struct block_list **bl); @@ -1296,6 +1296,10 @@ typedef void (*HPMHOOK_pre_clif_fame_taekwon) (struct map_session_data **sd, int typedef void (*HPMHOOK_post_clif_fame_taekwon) (struct map_session_data *sd, int points); typedef void (*HPMHOOK_pre_clif_ranklist) (struct map_session_data **sd, enum fame_list_type *type); typedef void (*HPMHOOK_post_clif_ranklist) (struct map_session_data *sd, enum fame_list_type type); +typedef void (*HPMHOOK_pre_clif_ranklist_sub) (struct PACKET_ZC_ACK_RANKING_sub **ranks, enum fame_list_type *type); +typedef void (*HPMHOOK_post_clif_ranklist_sub) (struct PACKET_ZC_ACK_RANKING_sub *ranks, enum fame_list_type type); +typedef void (*HPMHOOK_pre_clif_ranklist_sub2) (uint32 **chars, uint32 **points, enum fame_list_type *type); +typedef void (*HPMHOOK_post_clif_ranklist_sub2) (uint32 *chars, uint32 *points, enum fame_list_type type); typedef void (*HPMHOOK_pre_clif_update_rankingpoint) (struct map_session_data **sd, enum fame_list_type *type, int *points); typedef void (*HPMHOOK_post_clif_update_rankingpoint) (struct map_session_data *sd, enum fame_list_type type, int points); typedef void (*HPMHOOK_pre_clif_pRanklist) (int *fd, struct map_session_data **sd); @@ -1520,8 +1524,8 @@ typedef void (*HPMHOOK_pre_clif_divorced) (struct map_session_data **sd, const c typedef void (*HPMHOOK_post_clif_divorced) (struct map_session_data *sd, const char *name); typedef void (*HPMHOOK_pre_clif_callpartner) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_callpartner) (struct map_session_data *sd); -typedef int (*HPMHOOK_pre_clif_skill_damage) (struct block_list **src, struct block_list **dst, int64 *tick, int *sdelay, int *ddelay, int64 *damage, int *div, uint16 *skill_id, uint16 *skill_lv, int *type); -typedef int (*HPMHOOK_post_clif_skill_damage) (int retVal___, struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int64 damage, int div, uint16 skill_id, uint16 skill_lv, int type); +typedef int (*HPMHOOK_pre_clif_skill_damage) (struct block_list **src, struct block_list **dst, int64 *tick, int *sdelay, int *ddelay, int64 *damage, int *div, uint16 *skill_id, uint16 *skill_lv, enum battle_dmg_type *type); +typedef int (*HPMHOOK_post_clif_skill_damage) (int retVal___, struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int64 damage, int div, uint16 skill_id, uint16 skill_lv, enum battle_dmg_type type); typedef int (*HPMHOOK_pre_clif_skill_nodamage) (struct block_list **src, struct block_list **dst, uint16 *skill_id, int *heal, int *fail); typedef int (*HPMHOOK_post_clif_skill_nodamage) (int retVal___, struct block_list *src, struct block_list *dst, uint16 skill_id, int heal, int fail); typedef void (*HPMHOOK_pre_clif_skill_poseffect) (struct block_list **src, uint16 *skill_id, int *val, int *x, int *y, int64 *tick); @@ -1708,6 +1712,8 @@ typedef void (*HPMHOOK_pre_clif_addskill) (struct map_session_data **sd, int *id typedef void (*HPMHOOK_post_clif_addskill) (struct map_session_data *sd, int id); typedef void (*HPMHOOK_pre_clif_deleteskill) (struct map_session_data **sd, int *id); typedef void (*HPMHOOK_post_clif_deleteskill) (struct map_session_data *sd, int id); +typedef void (*HPMHOOK_pre_clif_playerSkillToPacket) (struct map_session_data **sd, struct SKILLDATA **skillData, int *skillId, int *idx, bool *newSkill); +typedef void (*HPMHOOK_post_clif_playerSkillToPacket) (struct map_session_data *sd, struct SKILLDATA *skillData, int skillId, int idx, bool newSkill); typedef void (*HPMHOOK_pre_clif_party_created) (struct map_session_data **sd, int *result); typedef void (*HPMHOOK_post_clif_party_created) (struct map_session_data *sd, int result); typedef void (*HPMHOOK_pre_clif_party_member_info) (struct party_data **p, struct map_session_data **sd); @@ -1750,6 +1756,10 @@ typedef void (*HPMHOOK_pre_clif_guild_basicinfo) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_guild_basicinfo) (struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_guild_allianceinfo) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_guild_allianceinfo) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_guild_castlelist) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_guild_castlelist) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_guild_castleinfo) (struct map_session_data **sd, struct guild_castle **gc); +typedef void (*HPMHOOK_post_clif_guild_castleinfo) (struct map_session_data *sd, struct guild_castle *gc); typedef void (*HPMHOOK_pre_clif_guild_memberlist) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_guild_memberlist) (struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_guild_skillinfo) (struct map_session_data **sd); @@ -2040,14 +2050,14 @@ typedef void (*HPMHOOK_pre_clif_show_modifiers) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_show_modifiers) (struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_notify_bounditem) (struct map_session_data **sd, unsigned short *index); typedef void (*HPMHOOK_post_clif_notify_bounditem) (struct map_session_data *sd, unsigned short index); -typedef int (*HPMHOOK_pre_clif_delay_damage) (int64 *tick, struct block_list **src, struct block_list **dst, int *sdelay, int *ddelay, int64 *in_damage, short *div, unsigned char *type); -typedef int (*HPMHOOK_post_clif_delay_damage) (int retVal___, int64 tick, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, unsigned char type); +typedef int (*HPMHOOK_pre_clif_delay_damage) (int64 *tick, struct block_list **src, struct block_list **dst, int *sdelay, int *ddelay, int64 *in_damage, short *div, enum battle_dmg_type *type); +typedef int (*HPMHOOK_post_clif_delay_damage) (int retVal___, int64 tick, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, enum battle_dmg_type type); typedef int (*HPMHOOK_pre_clif_delay_damage_sub) (int *tid, int64 *tick, int *id, intptr_t *data); typedef int (*HPMHOOK_post_clif_delay_damage_sub) (int retVal___, int tid, int64 tick, int id, intptr_t data); typedef void (*HPMHOOK_pre_clif_npc_market_open) (struct map_session_data **sd, struct npc_data **nd); typedef void (*HPMHOOK_post_clif_npc_market_open) (struct map_session_data *sd, struct npc_data *nd); -typedef void (*HPMHOOK_pre_clif_npc_market_purchase_ack) (struct map_session_data **sd, const struct itemlist **item_list, unsigned char *response); -typedef void (*HPMHOOK_post_clif_npc_market_purchase_ack) (struct map_session_data *sd, const struct itemlist *item_list, unsigned char response); +typedef void (*HPMHOOK_pre_clif_npc_market_purchase_ack) (struct map_session_data **sd, const struct itemlist **item_list, enum market_buy_result *response); +typedef void (*HPMHOOK_post_clif_npc_market_purchase_ack) (struct map_session_data *sd, const struct itemlist *item_list, enum market_buy_result response); typedef bool (*HPMHOOK_pre_clif_parse_roulette_db) (void); typedef bool (*HPMHOOK_post_clif_parse_roulette_db) (bool retVal___); typedef void (*HPMHOOK_pre_clif_roulette_generate_ack) (struct map_session_data **sd, enum GENERATE_ROULETTE_ACK *result, short *stage, short *prizeIdx, int *bonusItemID); @@ -2720,6 +2730,20 @@ typedef void (*HPMHOOK_pre_clif_pRefineryUIRefine) (int *fd, struct map_session_ typedef void (*HPMHOOK_post_clif_pRefineryUIRefine) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_announce_refine_status) (struct map_session_data **sd, int *item_id, int *refine_level, bool *success, enum send_target *target); typedef void (*HPMHOOK_post_clif_announce_refine_status) (struct map_session_data *sd, int item_id, int refine_level, bool success, enum send_target target); +typedef void (*HPMHOOK_pre_clif_pGuildCastleTeleportRequest) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pGuildCastleTeleportRequest) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_pGuildCastleInfoRequest) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pGuildCastleInfoRequest) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_guild_castleteleport_res) (struct map_session_data **sd, enum siege_teleport_result *result); +typedef void (*HPMHOOK_post_clif_guild_castleteleport_res) (struct map_session_data *sd, enum siege_teleport_result result); +typedef bool (*HPMHOOK_pre_clif_lapineDdukDdak_open) (struct map_session_data **sd, int *item_id); +typedef bool (*HPMHOOK_post_clif_lapineDdukDdak_open) (bool retVal___, struct map_session_data *sd, int item_id); +typedef bool (*HPMHOOK_pre_clif_lapineDdukDdak_result) (struct map_session_data **sd, enum lapineddukddak_result *result); +typedef bool (*HPMHOOK_post_clif_lapineDdukDdak_result) (bool retVal___, struct map_session_data *sd, enum lapineddukddak_result result); +typedef void (*HPMHOOK_pre_clif_plapineDdukDdak_ack) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_plapineDdukDdak_ack) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_plapineDdukDdak_close) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_plapineDdukDdak_close) (int fd, struct map_session_data *sd); #endif // MAP_CLIF_H #ifdef COMMON_CORE_H /* cmdline */ typedef void (*HPMHOOK_pre_cmdline_init) (void); @@ -3004,8 +3028,6 @@ typedef int (*HPMHOOK_pre_guild_emblem_changed) (int *len, int *guild_id, int *e typedef int (*HPMHOOK_post_guild_emblem_changed) (int retVal___, int len, int guild_id, int emblem_id, const char *data); typedef int (*HPMHOOK_pre_guild_send_message) (struct map_session_data **sd, const char **mes); typedef int (*HPMHOOK_post_guild_send_message) (int retVal___, struct map_session_data *sd, const char *mes); -typedef int (*HPMHOOK_pre_guild_recv_message) (int *guild_id, int *account_id, const char **mes, int *len); -typedef int (*HPMHOOK_post_guild_recv_message) (int retVal___, int guild_id, int account_id, const char *mes, int len); typedef int (*HPMHOOK_pre_guild_send_dot_remove) (struct map_session_data **sd); typedef int (*HPMHOOK_post_guild_send_dot_remove) (int retVal___, struct map_session_data *sd); typedef int (*HPMHOOK_pre_guild_skillupack) (int *guild_id, uint16 *skill_id, int *account_id); @@ -3050,8 +3072,12 @@ typedef struct map_session_data* (*HPMHOOK_pre_guild_sd_check) (int *guild_id, i typedef struct map_session_data* (*HPMHOOK_post_guild_sd_check) (struct map_session_data* retVal___, int guild_id, int account_id, int char_id); typedef bool (*HPMHOOK_pre_guild_read_guildskill_tree_db) (char **split[], int *columns, int *current); typedef bool (*HPMHOOK_post_guild_read_guildskill_tree_db) (bool retVal___, char *split[], int columns, int current); -typedef bool (*HPMHOOK_pre_guild_read_castledb) (char **str[], int *columns, int *current); -typedef bool (*HPMHOOK_post_guild_read_castledb) (bool retVal___, char *str[], int columns, int current); +typedef bool (*HPMHOOK_pre_guild_read_castledb_libconfig) (void); +typedef bool (*HPMHOOK_post_guild_read_castledb_libconfig) (bool retVal___); +typedef bool (*HPMHOOK_pre_guild_read_castledb_libconfig_sub) (struct config_setting_t **it, int *idx, const char **source); +typedef bool (*HPMHOOK_post_guild_read_castledb_libconfig_sub) (bool retVal___, struct config_setting_t *it, int idx, const char *source); +typedef bool (*HPMHOOK_pre_guild_read_castledb_libconfig_sub_warp) (struct config_setting_t **wd, const char **source, struct guild_castle **gc); +typedef bool (*HPMHOOK_post_guild_read_castledb_libconfig_sub_warp) (bool retVal___, struct config_setting_t *wd, const char *source, struct guild_castle *gc); typedef int (*HPMHOOK_pre_guild_payexp_timer_sub) (union DBKey *key, struct DBData **data, va_list ap); typedef int (*HPMHOOK_post_guild_payexp_timer_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap); typedef int (*HPMHOOK_pre_guild_send_xy_timer_sub) (union DBKey *key, struct DBData **data, va_list ap); @@ -3130,8 +3156,8 @@ typedef void (*HPMHOOK_pre_homun_damaged) (struct homun_data **hd); typedef void (*HPMHOOK_post_homun_damaged) (struct homun_data *hd); typedef int (*HPMHOOK_pre_homun_dead) (struct homun_data **hd); typedef int (*HPMHOOK_post_homun_dead) (int retVal___, struct homun_data *hd); -typedef int (*HPMHOOK_pre_homun_vaporize) (struct map_session_data **sd, enum homun_state *flag); -typedef int (*HPMHOOK_post_homun_vaporize) (int retVal___, struct map_session_data *sd, enum homun_state flag); +typedef int (*HPMHOOK_pre_homun_vaporize) (struct map_session_data **sd, enum homun_state *state, bool *force); +typedef int (*HPMHOOK_post_homun_vaporize) (int retVal___, struct map_session_data *sd, enum homun_state state, bool force); typedef int (*HPMHOOK_pre_homun_delete) (struct homun_data **hd, int *emote); typedef int (*HPMHOOK_post_homun_delete) (int retVal___, struct homun_data *hd, int emote); typedef int (*HPMHOOK_pre_homun_checkskill) (struct homun_data **hd, uint16 *skill_id); @@ -3152,6 +3178,8 @@ typedef bool (*HPMHOOK_pre_homun_mutate) (struct homun_data **hd, int *homun_id) typedef bool (*HPMHOOK_post_homun_mutate) (bool retVal___, struct homun_data *hd, int homun_id); typedef int (*HPMHOOK_pre_homun_gainexp) (struct homun_data **hd, unsigned int *exp); typedef int (*HPMHOOK_post_homun_gainexp) (int retVal___, struct homun_data *hd, unsigned int exp); +typedef int (*HPMHOOK_pre_homun_gainexp_real) (struct homun_data **hd, unsigned int *exp); +typedef int (*HPMHOOK_post_homun_gainexp_real) (int retVal___, struct homun_data *hd, unsigned int exp); typedef unsigned int (*HPMHOOK_pre_homun_add_intimacy) (struct homun_data **hd, unsigned int *value); typedef unsigned int (*HPMHOOK_post_homun_add_intimacy) (unsigned int retVal___, struct homun_data *hd, unsigned int value); typedef unsigned int (*HPMHOOK_pre_homun_consume_intimacy) (struct homun_data **hd, unsigned int *value); @@ -3174,8 +3202,8 @@ typedef bool (*HPMHOOK_pre_homun_change_name_ack) (struct map_session_data **sd, typedef bool (*HPMHOOK_post_homun_change_name_ack) (bool retVal___, struct map_session_data *sd, const char *name, int flag); typedef int (*HPMHOOK_pre_homun_db_search) (int *key, int *type); typedef int (*HPMHOOK_post_homun_db_search) (int retVal___, int key, int type); -typedef bool (*HPMHOOK_pre_homun_create) (struct map_session_data **sd, const struct s_homunculus **hom); -typedef bool (*HPMHOOK_post_homun_create) (bool retVal___, struct map_session_data *sd, const struct s_homunculus *hom); +typedef bool (*HPMHOOK_pre_homun_create) (struct map_session_data **sd, const struct s_homunculus **hom, bool *is_new); +typedef bool (*HPMHOOK_post_homun_create) (bool retVal___, struct map_session_data *sd, const struct s_homunculus *hom, bool is_new); typedef void (*HPMHOOK_pre_homun_init_timers) (struct homun_data **hd); typedef void (*HPMHOOK_post_homun_init_timers) (struct homun_data *hd); typedef bool (*HPMHOOK_pre_homun_call) (struct map_session_data **sd); @@ -3422,10 +3450,6 @@ typedef int (*HPMHOOK_pre_inter_init_sql) (const char **file); typedef int (*HPMHOOK_post_inter_init_sql) (int retVal___, const char *file); typedef int (*HPMHOOK_pre_inter_mapif_init) (int *fd); typedef int (*HPMHOOK_post_inter_mapif_init) (int retVal___, int fd); -typedef int (*HPMHOOK_pre_inter_check_ttl_wisdata_sub) (union DBKey *key, struct DBData **data, va_list ap); -typedef int (*HPMHOOK_post_inter_check_ttl_wisdata_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap); -typedef int (*HPMHOOK_pre_inter_check_ttl_wisdata) (void); -typedef int (*HPMHOOK_post_inter_check_ttl_wisdata) (int retVal___); typedef int (*HPMHOOK_pre_inter_check_length) (int *fd, int *length); typedef int (*HPMHOOK_post_inter_check_length) (int retVal___, int fd, int length); typedef int (*HPMHOOK_pre_inter_parse_frommap) (int *fd); @@ -3442,12 +3466,6 @@ typedef void (*HPMHOOK_pre_inter_accinfo) (int *u_fd, int *aid, int *castergroup typedef void (*HPMHOOK_post_inter_accinfo) (int u_fd, int aid, int castergroup, const char *query, int map_fd); typedef void (*HPMHOOK_pre_inter_accinfo2) (bool *success, int *map_fd, int *u_fd, int *u_aid, int *account_id, const char **userid, const char **user_pass, const char **email, const char **last_ip, const char **lastlogin, const char **pin_code, const char **birthdate, int *group_id, int *logincount, int *state); typedef void (*HPMHOOK_post_inter_accinfo2) (bool success, int map_fd, int u_fd, int u_aid, int account_id, const char *userid, const char *user_pass, const char *email, const char *last_ip, const char *lastlogin, const char *pin_code, const char *birthdate, int group_id, int logincount, int state); -typedef struct WisData* (*HPMHOOK_pre_inter_add_wisdata) (int *fd, const unsigned char **src, const unsigned char **dst, const unsigned char **msg, int *msg_len); -typedef struct WisData* (*HPMHOOK_post_inter_add_wisdata) (struct WisData* retVal___, int fd, const unsigned char *src, const unsigned char *dst, const unsigned char *msg, int msg_len); -typedef struct WisData* (*HPMHOOK_pre_inter_get_wisdata) (int *id); -typedef struct WisData* (*HPMHOOK_post_inter_get_wisdata) (struct WisData* retVal___, int id); -typedef void (*HPMHOOK_pre_inter_remove_wisdata) (int *id); -typedef void (*HPMHOOK_post_inter_remove_wisdata) (int id); #endif // CHAR_INTER_H #ifdef CHAR_INT_MAIL_H /* inter_mail */ typedef int (*HPMHOOK_pre_inter_mail_sql_init) (void); @@ -3620,16 +3638,6 @@ typedef int (*HPMHOOK_pre_intif_parse) (int *fd); typedef int (*HPMHOOK_post_intif_parse) (int retVal___, int fd); typedef int (*HPMHOOK_pre_intif_create_pet) (int *account_id, int *char_id, int *pet_type, int *pet_lv, int *pet_egg_id, int *pet_equip, short *intimate, short *hungry, char *rename_flag, char *incubate, char **pet_name); typedef int (*HPMHOOK_post_intif_create_pet) (int retVal___, int account_id, int char_id, int pet_type, int pet_lv, int pet_egg_id, int pet_equip, short intimate, short hungry, char rename_flag, char incubate, char *pet_name); -typedef int (*HPMHOOK_pre_intif_broadcast) (const char **mes, int *len, int *type); -typedef int (*HPMHOOK_post_intif_broadcast) (int retVal___, const char *mes, int len, int type); -typedef int (*HPMHOOK_pre_intif_broadcast2) (const char **mes, int *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY); -typedef int (*HPMHOOK_post_intif_broadcast2) (int retVal___, const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY); -typedef int (*HPMHOOK_pre_intif_main_message) (struct map_session_data **sd, const char **message); -typedef int (*HPMHOOK_post_intif_main_message) (int retVal___, struct map_session_data *sd, const char *message); -typedef int (*HPMHOOK_pre_intif_wis_message) (struct map_session_data **sd, const char **nick, const char **mes, int *mes_len); -typedef int (*HPMHOOK_post_intif_wis_message) (int retVal___, struct map_session_data *sd, const char *nick, const char *mes, int mes_len); -typedef int (*HPMHOOK_pre_intif_wis_message_to_gm) (char **Wisp_name, int *permission, char **mes); -typedef int (*HPMHOOK_post_intif_wis_message_to_gm) (int retVal___, char *Wisp_name, int permission, char *mes); typedef int (*HPMHOOK_pre_intif_saveregistry) (struct map_session_data **sd); typedef int (*HPMHOOK_post_intif_saveregistry) (int retVal___, struct map_session_data *sd); typedef int (*HPMHOOK_pre_intif_request_registry) (struct map_session_data **sd, int *flag); @@ -3656,8 +3664,6 @@ typedef int (*HPMHOOK_pre_intif_party_changemap) (struct map_session_data **sd, typedef int (*HPMHOOK_post_intif_party_changemap) (int retVal___, struct map_session_data *sd, int online); typedef int (*HPMHOOK_pre_intif_break_party) (int *party_id); typedef int (*HPMHOOK_post_intif_break_party) (int retVal___, int party_id); -typedef int (*HPMHOOK_pre_intif_party_message) (int *party_id, int *account_id, const char **mes, int *len); -typedef int (*HPMHOOK_post_intif_party_message) (int retVal___, int party_id, int account_id, const char *mes, int len); typedef int (*HPMHOOK_pre_intif_party_leaderchange) (int *party_id, int *account_id, int *char_id); typedef int (*HPMHOOK_post_intif_party_leaderchange) (int retVal___, int party_id, int account_id, int char_id); typedef int (*HPMHOOK_pre_intif_guild_create) (const char **name, const struct guild_member **master); @@ -3672,8 +3678,6 @@ typedef int (*HPMHOOK_pre_intif_guild_memberinfoshort) (int *guild_id, int *acco typedef int (*HPMHOOK_post_intif_guild_memberinfoshort) (int retVal___, int guild_id, int account_id, int char_id, int online, int lv, int class); typedef int (*HPMHOOK_pre_intif_guild_break) (int *guild_id); typedef int (*HPMHOOK_post_intif_guild_break) (int retVal___, int guild_id); -typedef int (*HPMHOOK_pre_intif_guild_message) (int *guild_id, int *account_id, const char **mes, int *len); -typedef int (*HPMHOOK_post_intif_guild_message) (int retVal___, int guild_id, int account_id, const char *mes, int len); typedef int (*HPMHOOK_pre_intif_guild_change_gm) (int *guild_id, const char **name, int *len); typedef int (*HPMHOOK_post_intif_guild_change_gm) (int retVal___, int guild_id, const char *name, int len); typedef int (*HPMHOOK_pre_intif_guild_change_basicinfo) (int *guild_id, int *type, const void **data, int *len); @@ -3780,14 +3784,6 @@ typedef void (*HPMHOOK_pre_intif_achievements_request) (struct map_session_data typedef void (*HPMHOOK_post_intif_achievements_request) (struct map_session_data *sd); typedef void (*HPMHOOK_pre_intif_achievements_save) (struct map_session_data **sd); typedef void (*HPMHOOK_post_intif_achievements_save) (struct map_session_data *sd); -typedef void (*HPMHOOK_pre_intif_pWisMessage) (int *fd); -typedef void (*HPMHOOK_post_intif_pWisMessage) (int fd); -typedef void (*HPMHOOK_pre_intif_pWisEnd) (int *fd); -typedef void (*HPMHOOK_post_intif_pWisEnd) (int fd); -typedef int (*HPMHOOK_pre_intif_pWisToGM_sub) (struct map_session_data **sd, va_list va); -typedef int (*HPMHOOK_post_intif_pWisToGM_sub) (int retVal___, struct map_session_data *sd, va_list va); -typedef void (*HPMHOOK_pre_intif_pWisToGM) (int *fd); -typedef void (*HPMHOOK_post_intif_pWisToGM) (int fd); typedef void (*HPMHOOK_pre_intif_pRegisters) (int *fd); typedef void (*HPMHOOK_post_intif_pRegisters) (int fd); typedef void (*HPMHOOK_pre_intif_pAccountStorage) (int *fd); @@ -3816,8 +3812,6 @@ typedef void (*HPMHOOK_pre_intif_pPartyMove) (int *fd); typedef void (*HPMHOOK_post_intif_pPartyMove) (int fd); typedef void (*HPMHOOK_pre_intif_pPartyBroken) (int *fd); typedef void (*HPMHOOK_post_intif_pPartyBroken) (int fd); -typedef void (*HPMHOOK_pre_intif_pPartyMessage) (int *fd); -typedef void (*HPMHOOK_post_intif_pPartyMessage) (int fd); typedef void (*HPMHOOK_pre_intif_pGuildCreated) (int *fd); typedef void (*HPMHOOK_post_intif_pGuildCreated) (int fd); typedef void (*HPMHOOK_pre_intif_pGuildInfo) (int *fd); @@ -3830,8 +3824,6 @@ typedef void (*HPMHOOK_pre_intif_pGuildMemberInfoShort) (int *fd); typedef void (*HPMHOOK_post_intif_pGuildMemberInfoShort) (int fd); typedef void (*HPMHOOK_pre_intif_pGuildBroken) (int *fd); typedef void (*HPMHOOK_post_intif_pGuildBroken) (int fd); -typedef void (*HPMHOOK_pre_intif_pGuildMessage) (int *fd); -typedef void (*HPMHOOK_post_intif_pGuildMessage) (int fd); typedef void (*HPMHOOK_pre_intif_pGuildBasicInfoChanged) (int *fd); typedef void (*HPMHOOK_post_intif_pGuildBasicInfoChanged) (int fd); typedef void (*HPMHOOK_pre_intif_pGuildMemberInfoChanged) (int *fd); @@ -4006,8 +3998,8 @@ typedef struct item_data* (*HPMHOOK_pre_itemdb_name2id) (const char **str); typedef struct item_data* (*HPMHOOK_post_itemdb_name2id) (struct item_data* retVal___, const char *str); typedef struct item_data* (*HPMHOOK_pre_itemdb_search_name) (const char **name); typedef struct item_data* (*HPMHOOK_post_itemdb_search_name) (struct item_data* retVal___, const char *name); -typedef int (*HPMHOOK_pre_itemdb_search_name_array) (struct item_data ***data, int *size, const char **str, int *flag); -typedef int (*HPMHOOK_post_itemdb_search_name_array) (int retVal___, struct item_data **data, int size, const char *str, int flag); +typedef int (*HPMHOOK_pre_itemdb_search_name_array) (struct item_data ***data, const int *size, const char **str, enum item_name_search_flag *flag); +typedef int (*HPMHOOK_post_itemdb_search_name_array) (int retVal___, struct item_data **data, const int size, const char *str, enum item_name_search_flag flag); typedef struct item_data* (*HPMHOOK_pre_itemdb_load) (int *nameid); typedef struct item_data* (*HPMHOOK_post_itemdb_load) (struct item_data* retVal___, int nameid); typedef struct item_data* (*HPMHOOK_pre_itemdb_search) (int *nameid); @@ -4072,10 +4064,10 @@ typedef int (*HPMHOOK_pre_itemdb_isidentified) (int *nameid); typedef int (*HPMHOOK_post_itemdb_isidentified) (int retVal___, int nameid); typedef int (*HPMHOOK_pre_itemdb_isidentified2) (struct item_data **data); typedef int (*HPMHOOK_post_itemdb_isidentified2) (int retVal___, struct item_data *data); -typedef int (*HPMHOOK_pre_itemdb_combo_split_atoi) (char **str, int **val); -typedef int (*HPMHOOK_post_itemdb_combo_split_atoi) (int retVal___, char *str, int *val); -typedef void (*HPMHOOK_pre_itemdb_read_combos) (void); -typedef void (*HPMHOOK_post_itemdb_read_combos) (void); +typedef bool (*HPMHOOK_pre_itemdb_read_combodb_libconfig) (void); +typedef bool (*HPMHOOK_post_itemdb_read_combodb_libconfig) (bool retVal___); +typedef bool (*HPMHOOK_pre_itemdb_read_combodb_libconfig_sub) (struct config_setting_t **it, int *idx, const char **source); +typedef bool (*HPMHOOK_post_itemdb_read_combodb_libconfig_sub) (bool retVal___, struct config_setting_t *it, int idx, const char *source); typedef int (*HPMHOOK_pre_itemdb_gendercheck) (struct item_data **id); typedef int (*HPMHOOK_post_itemdb_gendercheck) (int retVal___, struct item_data *id); typedef int (*HPMHOOK_pre_itemdb_validate_entry) (struct item_data **entry, int *n, const char **source); @@ -4112,6 +4104,12 @@ typedef bool (*HPMHOOK_pre_itemdb_lookup_const_mask) (const struct config_settin typedef bool (*HPMHOOK_post_itemdb_lookup_const_mask) (bool retVal___, const struct config_setting_t *it, const char *name, int *value); typedef int (*HPMHOOK_pre_itemdb_addname_sub) (union DBKey *key, struct DBData **data, va_list ap); typedef int (*HPMHOOK_post_itemdb_addname_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap); +typedef bool (*HPMHOOK_pre_itemdb_read_libconfig_lapineddukddak) (void); +typedef bool (*HPMHOOK_post_itemdb_read_libconfig_lapineddukddak) (bool retVal___); +typedef bool (*HPMHOOK_pre_itemdb_read_libconfig_lapineddukddak_sub) (struct config_setting_t **it, const char **source); +typedef bool (*HPMHOOK_post_itemdb_read_libconfig_lapineddukddak_sub) (bool retVal___, struct config_setting_t *it, const char *source); +typedef bool (*HPMHOOK_pre_itemdb_read_libconfig_lapineddukddak_sub_sources) (struct config_setting_t **sources, struct item_data **data); +typedef bool (*HPMHOOK_post_itemdb_read_libconfig_lapineddukddak_sub_sources) (bool retVal___, struct config_setting_t *sources, struct item_data *data); #endif // MAP_ITEMDB_H #ifdef LOGIN_LOGIN_H /* lchrif */ typedef void (*HPMHOOK_pre_lchrif_server_init) (int *id); @@ -4698,8 +4696,8 @@ typedef void (*HPMHOOK_pre_map_addiddb) (struct block_list **bl); typedef void (*HPMHOOK_post_map_addiddb) (struct block_list *bl); typedef void (*HPMHOOK_pre_map_deliddb) (struct block_list **bl); typedef void (*HPMHOOK_post_map_deliddb) (struct block_list *bl); -typedef struct map_session_data* (*HPMHOOK_pre_map_nick2sd) (const char **nick); -typedef struct map_session_data* (*HPMHOOK_post_map_nick2sd) (struct map_session_data* retVal___, const char *nick); +typedef struct map_session_data* (*HPMHOOK_pre_map_nick2sd) (const char **nick, bool *allow_partial); +typedef struct map_session_data* (*HPMHOOK_post_map_nick2sd) (struct map_session_data* retVal___, const char *nick, bool allow_partial); typedef struct mob_data* (*HPMHOOK_pre_map_getmob_boss) (int16 *m); typedef struct mob_data* (*HPMHOOK_post_map_getmob_boss) (struct mob_data* retVal___, int16 m); typedef struct mob_data* (*HPMHOOK_pre_map_id2boss) (int *id); @@ -4914,8 +4912,6 @@ typedef int (*HPMHOOK_pre_mapif_guild_memberinfoshort) (struct guild **g, int *i typedef int (*HPMHOOK_post_mapif_guild_memberinfoshort) (int retVal___, struct guild *g, int idx); typedef int (*HPMHOOK_pre_mapif_guild_broken) (int *guild_id, int *flag); typedef int (*HPMHOOK_post_mapif_guild_broken) (int retVal___, int guild_id, int flag); -typedef int (*HPMHOOK_pre_mapif_guild_message) (int *guild_id, int *account_id, const char **mes, int *len, int *sfd); -typedef int (*HPMHOOK_post_mapif_guild_message) (int retVal___, int guild_id, int account_id, const char *mes, int len, int sfd); typedef int (*HPMHOOK_pre_mapif_guild_basicinfochanged) (int *guild_id, int *type, const void **data, int *len); typedef int (*HPMHOOK_post_mapif_guild_basicinfochanged) (int retVal___, int guild_id, int type, const void *data, int len); typedef int (*HPMHOOK_pre_mapif_guild_memberinfochanged) (int *guild_id, int *account_id, int *char_id, int *type, const void **data, int *len); @@ -4946,8 +4942,6 @@ typedef int (*HPMHOOK_pre_mapif_parse_GuildChangeMemberInfoShort) (int *fd, int typedef int (*HPMHOOK_post_mapif_parse_GuildChangeMemberInfoShort) (int retVal___, int fd, int guild_id, int account_id, int char_id, int online, int lv, int class); typedef int (*HPMHOOK_pre_mapif_parse_BreakGuild) (int *fd, int *guild_id); typedef int (*HPMHOOK_post_mapif_parse_BreakGuild) (int retVal___, int fd, int guild_id); -typedef int (*HPMHOOK_pre_mapif_parse_GuildMessage) (int *fd, int *guild_id, int *account_id, const char **mes, int *len); -typedef int (*HPMHOOK_post_mapif_parse_GuildMessage) (int retVal___, int fd, int guild_id, int account_id, const char *mes, int len); typedef int (*HPMHOOK_pre_mapif_parse_GuildBasicInfoChange) (int *fd, int *guild_id, int *type, const void **data, int *len); typedef int (*HPMHOOK_post_mapif_parse_GuildBasicInfoChange) (int retVal___, int fd, int guild_id, int type, const void *data, int len); typedef int (*HPMHOOK_pre_mapif_parse_GuildMemberInfoChange) (int *fd, int *guild_id, int *account_id, int *char_id, int *type, const char **data, int *len); @@ -5042,8 +5036,6 @@ typedef int (*HPMHOOK_pre_mapif_party_membermoved) (struct party **p, int *idx); typedef int (*HPMHOOK_post_mapif_party_membermoved) (int retVal___, struct party *p, int idx); typedef int (*HPMHOOK_pre_mapif_party_broken) (int *party_id, int *flag); typedef int (*HPMHOOK_post_mapif_party_broken) (int retVal___, int party_id, int flag); -typedef int (*HPMHOOK_pre_mapif_party_message) (int *party_id, int *account_id, const char **mes, int *len, int *sfd); -typedef int (*HPMHOOK_post_mapif_party_message) (int retVal___, int party_id, int account_id, const char *mes, int len, int sfd); typedef int (*HPMHOOK_pre_mapif_parse_CreateParty) (int *fd, const char **name, int *item, int *item2, const struct party_member **leader); typedef int (*HPMHOOK_post_mapif_parse_CreateParty) (int retVal___, int fd, const char *name, int item, int item2, const struct party_member *leader); typedef void (*HPMHOOK_pre_mapif_parse_PartyInfo) (int *fd, int *party_id, int *char_id); @@ -5058,8 +5050,6 @@ typedef int (*HPMHOOK_pre_mapif_parse_PartyChangeMap) (int *fd, int *party_id, i typedef int (*HPMHOOK_post_mapif_parse_PartyChangeMap) (int retVal___, int fd, int party_id, int account_id, int char_id, unsigned short map, int online, unsigned int lv); typedef int (*HPMHOOK_pre_mapif_parse_BreakParty) (int *fd, int *party_id); typedef int (*HPMHOOK_post_mapif_parse_BreakParty) (int retVal___, int fd, int party_id); -typedef int (*HPMHOOK_pre_mapif_parse_PartyMessage) (int *fd, int *party_id, int *account_id, const char **mes, int *len); -typedef int (*HPMHOOK_post_mapif_parse_PartyMessage) (int retVal___, int fd, int party_id, int account_id, const char *mes, int len); typedef int (*HPMHOOK_pre_mapif_parse_PartyLeaderChange) (int *fd, int *party_id, int *account_id, int *char_id); typedef int (*HPMHOOK_post_mapif_parse_PartyLeaderChange) (int retVal___, int fd, int party_id, int account_id, int char_id); typedef int (*HPMHOOK_pre_mapif_pet_created) (int *fd, int *account_id, struct s_pet **p); @@ -5136,26 +5126,10 @@ typedef void (*HPMHOOK_pre_mapif_parse_ItemBoundRetrieve) (int *fd); typedef void (*HPMHOOK_post_mapif_parse_ItemBoundRetrieve) (int fd); typedef void (*HPMHOOK_pre_mapif_parse_accinfo) (int *fd); typedef void (*HPMHOOK_post_mapif_parse_accinfo) (int fd); -typedef int (*HPMHOOK_pre_mapif_broadcast) (const unsigned char **mes, int *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY, int *sfd); -typedef int (*HPMHOOK_post_mapif_broadcast) (int retVal___, const unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd); -typedef int (*HPMHOOK_pre_mapif_wis_message) (struct WisData **wd); -typedef int (*HPMHOOK_post_mapif_wis_message) (int retVal___, struct WisData *wd); -typedef void (*HPMHOOK_pre_mapif_wis_response) (int *fd, const unsigned char **src, int *flag); -typedef void (*HPMHOOK_post_mapif_wis_response) (int fd, const unsigned char *src, int flag); -typedef int (*HPMHOOK_pre_mapif_wis_end) (struct WisData **wd, int *flag); -typedef int (*HPMHOOK_post_mapif_wis_end) (int retVal___, struct WisData *wd, int flag); typedef int (*HPMHOOK_pre_mapif_account_reg_reply) (int *fd, int *account_id, int *char_id, int *type); typedef int (*HPMHOOK_post_mapif_account_reg_reply) (int retVal___, int fd, int account_id, int char_id, int type); typedef int (*HPMHOOK_pre_mapif_disconnectplayer) (int *fd, int *account_id, int *char_id, int *reason); typedef int (*HPMHOOK_post_mapif_disconnectplayer) (int retVal___, int fd, int account_id, int char_id, int reason); -typedef int (*HPMHOOK_pre_mapif_parse_broadcast) (int *fd); -typedef int (*HPMHOOK_post_mapif_parse_broadcast) (int retVal___, int fd); -typedef int (*HPMHOOK_pre_mapif_parse_WisRequest) (int *fd); -typedef int (*HPMHOOK_post_mapif_parse_WisRequest) (int retVal___, int fd); -typedef int (*HPMHOOK_pre_mapif_parse_WisReply) (int *fd); -typedef int (*HPMHOOK_post_mapif_parse_WisReply) (int retVal___, int fd); -typedef int (*HPMHOOK_pre_mapif_parse_WisToGM) (int *fd); -typedef int (*HPMHOOK_post_mapif_parse_WisToGM) (int retVal___, int fd); typedef int (*HPMHOOK_pre_mapif_parse_Registry) (int *fd); typedef int (*HPMHOOK_post_mapif_parse_Registry) (int retVal___, int fd); typedef int (*HPMHOOK_pre_mapif_parse_RegistryRequest) (int *fd); @@ -5298,6 +5272,8 @@ typedef int (*HPMHOOK_pre_mob_final) (void); typedef int (*HPMHOOK_post_mob_final) (int retVal___); typedef void (*HPMHOOK_pre_mob_reload) (void); typedef void (*HPMHOOK_post_mob_reload) (void); +typedef int (*HPMHOOK_pre_mob_reload_sub_mob) (struct mob_data **md, va_list args); +typedef int (*HPMHOOK_post_mob_reload_sub_mob) (int retVal___, struct mob_data *md, va_list args); typedef struct mob_db* (*HPMHOOK_pre_mob_db) (int *index); typedef struct mob_db* (*HPMHOOK_post_mob_db) (struct mob_db* retVal___, int index); typedef struct mob_chat* (*HPMHOOK_pre_mob_chat) (short *id); @@ -5774,8 +5750,8 @@ typedef bool (*HPMHOOK_pre_npc_trader_pay) (struct npc_data **nd, struct map_ses typedef bool (*HPMHOOK_post_npc_trader_pay) (bool retVal___, struct npc_data *nd, struct map_session_data *sd, int price, int points); typedef void (*HPMHOOK_pre_npc_trader_update) (int *master); typedef void (*HPMHOOK_post_npc_trader_update) (int master); -typedef int (*HPMHOOK_pre_npc_market_buylist) (struct map_session_data **sd, struct itemlist **item_list); -typedef int (*HPMHOOK_post_npc_market_buylist) (int retVal___, struct map_session_data *sd, struct itemlist *item_list); +typedef enum market_buy_result (*HPMHOOK_pre_npc_market_buylist) (struct map_session_data **sd, struct itemlist **item_list); +typedef enum market_buy_result (*HPMHOOK_post_npc_market_buylist) (enum market_buy_result retVal___, struct map_session_data *sd, struct itemlist *item_list); typedef int (*HPMHOOK_pre_npc_barter_buylist) (struct map_session_data **sd, struct barteritemlist **item_list); typedef int (*HPMHOOK_post_npc_barter_buylist) (int retVal___, struct map_session_data *sd, struct barteritemlist *item_list); typedef bool (*HPMHOOK_pre_npc_trader_open) (struct map_session_data **sd, struct npc_data **nd); @@ -5874,8 +5850,6 @@ typedef int (*HPMHOOK_pre_party_send_logout) (struct map_session_data **sd); typedef int (*HPMHOOK_post_party_send_logout) (int retVal___, struct map_session_data *sd); typedef int (*HPMHOOK_pre_party_send_message) (struct map_session_data **sd, const char **mes); typedef int (*HPMHOOK_post_party_send_message) (int retVal___, struct map_session_data *sd, const char *mes); -typedef int (*HPMHOOK_pre_party_recv_message) (int *party_id, int *account_id, const char **mes, int *len); -typedef int (*HPMHOOK_post_party_recv_message) (int retVal___, int party_id, int account_id, const char *mes, int len); typedef int (*HPMHOOK_pre_party_skill_check) (struct map_session_data **sd, int *party_id, uint16 *skill_id, uint16 *skill_lv); typedef int (*HPMHOOK_post_party_skill_check) (int retVal___, struct map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv); typedef int (*HPMHOOK_pre_party_send_xy_clear) (struct party_data **p); @@ -6066,8 +6040,8 @@ typedef bool (*HPMHOOK_pre_pc_adoption) (struct map_session_data **p1_sd, struct typedef bool (*HPMHOOK_post_pc_adoption) (bool retVal___, struct map_session_data *p1_sd, struct map_session_data *p2_sd, struct map_session_data *b_sd); typedef int (*HPMHOOK_pre_pc_updateweightstatus) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_updateweightstatus) (int retVal___, struct map_session_data *sd); -typedef int (*HPMHOOK_pre_pc_addautobonus) (struct s_autobonus **bonus, char *max, const char **bonus_script, short *rate, unsigned int *dur, short *atk_type, const char **o_script, unsigned short *pos, bool *onskill); -typedef int (*HPMHOOK_post_pc_addautobonus) (int retVal___, struct s_autobonus *bonus, char max, const char *bonus_script, short rate, unsigned int dur, short atk_type, const char *o_script, unsigned short pos, bool onskill); +typedef int (*HPMHOOK_pre_pc_addautobonus) (struct s_autobonus **bonus, char *max, const char **bonus_script, short *rate, unsigned int *dur, short *atk_type, const char **o_script, unsigned int *pos, bool *onskill); +typedef int (*HPMHOOK_post_pc_addautobonus) (int retVal___, struct s_autobonus *bonus, char max, const char *bonus_script, short rate, unsigned int dur, short atk_type, const char *o_script, unsigned int pos, bool onskill); typedef int (*HPMHOOK_pre_pc_exeautobonus) (struct map_session_data **sd, struct s_autobonus **bonus); typedef int (*HPMHOOK_post_pc_exeautobonus) (int retVal___, struct map_session_data *sd, struct s_autobonus *bonus); typedef int (*HPMHOOK_pre_pc_endautobonus) (int *tid, int64 *tick, int *id, intptr_t *data); @@ -6426,8 +6400,14 @@ typedef void (*HPMHOOK_pre_pc_update_idle_time) (struct map_session_data **sd, e typedef void (*HPMHOOK_post_pc_update_idle_time) (struct map_session_data *sd, enum e_battle_config_idletime type); typedef int (*HPMHOOK_pre_pc_have_magnifier) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_have_magnifier) (int retVal___, struct map_session_data *sd); +typedef int (*HPMHOOK_pre_pc_have_item_chain) (struct map_session_data **sd, unsigned short *chain_id); +typedef int (*HPMHOOK_post_pc_have_item_chain) (int retVal___, struct map_session_data *sd, unsigned short chain_id); typedef bool (*HPMHOOK_pre_pc_process_chat_message) (struct map_session_data **sd, const char **message); typedef bool (*HPMHOOK_post_pc_process_chat_message) (bool retVal___, struct map_session_data *sd, const char *message); +typedef int (*HPMHOOK_pre_pc_wis_message_to_gm) (const char **sender_name, int *permission, const char **message); +typedef int (*HPMHOOK_post_pc_wis_message_to_gm) (int retVal___, const char *sender_name, int permission, const char *message); +typedef int (*HPMHOOK_pre_pc_wis_message_to_gm_sub) (struct map_session_data **sd, va_list va); +typedef int (*HPMHOOK_post_pc_wis_message_to_gm_sub) (int retVal___, struct map_session_data *sd, va_list va); typedef void (*HPMHOOK_pre_pc_check_supernovice_call) (struct map_session_data **sd, const char **message); typedef void (*HPMHOOK_post_pc_check_supernovice_call) (struct map_session_data *sd, const char *message); typedef bool (*HPMHOOK_pre_pc_check_basicskill) (struct map_session_data **sd, int *level); @@ -7098,6 +7078,12 @@ typedef void (*HPMHOOK_pre_script_run_item_equip_script) (struct map_session_dat typedef void (*HPMHOOK_post_script_run_item_equip_script) (struct map_session_data *sd, struct item_data *data, int oid); typedef void (*HPMHOOK_pre_script_run_item_unequip_script) (struct map_session_data **sd, struct item_data **data, int *oid); typedef void (*HPMHOOK_post_script_run_item_unequip_script) (struct map_session_data *sd, struct item_data *data, int oid); +typedef void (*HPMHOOK_pre_script_run_item_rental_end_script) (struct map_session_data **sd, struct item_data **data, int *oid); +typedef void (*HPMHOOK_post_script_run_item_rental_end_script) (struct map_session_data *sd, struct item_data *data, int oid); +typedef void (*HPMHOOK_pre_script_run_item_rental_start_script) (struct map_session_data **sd, struct item_data **data, int *oid); +typedef void (*HPMHOOK_post_script_run_item_rental_start_script) (struct map_session_data *sd, struct item_data *data, int oid); +typedef void (*HPMHOOK_pre_script_run_item_lapineddukddak_script) (struct map_session_data **sd, struct item_data **data, int *oid); +typedef void (*HPMHOOK_post_script_run_item_lapineddukddak_script) (struct map_session_data *sd, struct item_data *data, int oid); #endif // MAP_SCRIPT_H #ifdef MAP_SEARCHSTORE_H /* searchstore */ typedef bool (*HPMHOOK_pre_searchstore_open) (struct map_session_data **sd, unsigned int *uses, unsigned short *effect); @@ -7986,8 +7972,14 @@ typedef bool (*HPMHOOK_pre_status_readdb_job2) (char **fields[], int *columns, i typedef bool (*HPMHOOK_post_status_readdb_job2) (bool retVal___, char *fields[], int columns, int current); typedef bool (*HPMHOOK_pre_status_readdb_sizefix) (char **fields[], int *columns, int *current); typedef bool (*HPMHOOK_post_status_readdb_sizefix) (bool retVal___, char *fields[], int columns, int current); -typedef bool (*HPMHOOK_pre_status_readdb_scconfig) (char **fields[], int *columns, int *current); -typedef bool (*HPMHOOK_post_status_readdb_scconfig) (bool retVal___, char *fields[], int columns, int current); +typedef bool (*HPMHOOK_pre_status_read_scdb_libconfig) (void); +typedef bool (*HPMHOOK_post_status_read_scdb_libconfig) (bool retVal___); +typedef bool (*HPMHOOK_pre_status_read_scdb_libconfig_sub) (struct config_setting_t **it, int *idx, const char **source); +typedef bool (*HPMHOOK_post_status_read_scdb_libconfig_sub) (bool retVal___, struct config_setting_t *it, int idx, const char *source); +typedef bool (*HPMHOOK_pre_status_read_scdb_libconfig_sub_flag) (struct config_setting_t **it, int *type, const char **source); +typedef bool (*HPMHOOK_post_status_read_scdb_libconfig_sub_flag) (bool retVal___, struct config_setting_t *it, int type, const char *source); +typedef bool (*HPMHOOK_pre_status_read_scdb_libconfig_sub_flag_additional) (struct config_setting_t **it, int *type, const char **source); +typedef bool (*HPMHOOK_post_status_read_scdb_libconfig_sub_flag_additional) (bool retVal___, struct config_setting_t *it, int type, const char *source); typedef void (*HPMHOOK_pre_status_read_job_db) (void); typedef void (*HPMHOOK_post_status_read_job_db) (void); typedef void (*HPMHOOK_pre_status_read_job_db_sub) (int *idx, const char **name, struct config_setting_t **jdb); diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc index 9302a8d19..a5f65654e 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc @@ -610,10 +610,6 @@ struct { struct HPMHookPoint *HP_inter_init_sql_post; struct HPMHookPoint *HP_inter_mapif_init_pre; struct HPMHookPoint *HP_inter_mapif_init_post; - struct HPMHookPoint *HP_inter_check_ttl_wisdata_sub_pre; - struct HPMHookPoint *HP_inter_check_ttl_wisdata_sub_post; - struct HPMHookPoint *HP_inter_check_ttl_wisdata_pre; - struct HPMHookPoint *HP_inter_check_ttl_wisdata_post; struct HPMHookPoint *HP_inter_check_length_pre; struct HPMHookPoint *HP_inter_check_length_post; struct HPMHookPoint *HP_inter_parse_frommap_pre; @@ -630,12 +626,6 @@ struct { struct HPMHookPoint *HP_inter_accinfo_post; struct HPMHookPoint *HP_inter_accinfo2_pre; struct HPMHookPoint *HP_inter_accinfo2_post; - struct HPMHookPoint *HP_inter_add_wisdata_pre; - struct HPMHookPoint *HP_inter_add_wisdata_post; - struct HPMHookPoint *HP_inter_get_wisdata_pre; - struct HPMHookPoint *HP_inter_get_wisdata_post; - struct HPMHookPoint *HP_inter_remove_wisdata_pre; - struct HPMHookPoint *HP_inter_remove_wisdata_post; struct HPMHookPoint *HP_inter_mail_sql_init_pre; struct HPMHookPoint *HP_inter_mail_sql_init_post; struct HPMHookPoint *HP_inter_mail_sql_final_pre; @@ -1032,8 +1022,6 @@ struct { struct HPMHookPoint *HP_mapif_guild_memberinfoshort_post; struct HPMHookPoint *HP_mapif_guild_broken_pre; struct HPMHookPoint *HP_mapif_guild_broken_post; - struct HPMHookPoint *HP_mapif_guild_message_pre; - struct HPMHookPoint *HP_mapif_guild_message_post; struct HPMHookPoint *HP_mapif_guild_basicinfochanged_pre; struct HPMHookPoint *HP_mapif_guild_basicinfochanged_post; struct HPMHookPoint *HP_mapif_guild_memberinfochanged_pre; @@ -1064,8 +1052,6 @@ struct { struct HPMHookPoint *HP_mapif_parse_GuildChangeMemberInfoShort_post; struct HPMHookPoint *HP_mapif_parse_BreakGuild_pre; struct HPMHookPoint *HP_mapif_parse_BreakGuild_post; - struct HPMHookPoint *HP_mapif_parse_GuildMessage_pre; - struct HPMHookPoint *HP_mapif_parse_GuildMessage_post; struct HPMHookPoint *HP_mapif_parse_GuildBasicInfoChange_pre; struct HPMHookPoint *HP_mapif_parse_GuildBasicInfoChange_post; struct HPMHookPoint *HP_mapif_parse_GuildMemberInfoChange_pre; @@ -1160,8 +1146,6 @@ struct { struct HPMHookPoint *HP_mapif_party_membermoved_post; struct HPMHookPoint *HP_mapif_party_broken_pre; struct HPMHookPoint *HP_mapif_party_broken_post; - struct HPMHookPoint *HP_mapif_party_message_pre; - struct HPMHookPoint *HP_mapif_party_message_post; struct HPMHookPoint *HP_mapif_parse_CreateParty_pre; struct HPMHookPoint *HP_mapif_parse_CreateParty_post; struct HPMHookPoint *HP_mapif_parse_PartyInfo_pre; @@ -1176,8 +1160,6 @@ struct { struct HPMHookPoint *HP_mapif_parse_PartyChangeMap_post; struct HPMHookPoint *HP_mapif_parse_BreakParty_pre; struct HPMHookPoint *HP_mapif_parse_BreakParty_post; - struct HPMHookPoint *HP_mapif_parse_PartyMessage_pre; - struct HPMHookPoint *HP_mapif_parse_PartyMessage_post; struct HPMHookPoint *HP_mapif_parse_PartyLeaderChange_pre; struct HPMHookPoint *HP_mapif_parse_PartyLeaderChange_post; struct HPMHookPoint *HP_mapif_pet_created_pre; @@ -1254,26 +1236,10 @@ struct { struct HPMHookPoint *HP_mapif_parse_ItemBoundRetrieve_post; struct HPMHookPoint *HP_mapif_parse_accinfo_pre; struct HPMHookPoint *HP_mapif_parse_accinfo_post; - struct HPMHookPoint *HP_mapif_broadcast_pre; - struct HPMHookPoint *HP_mapif_broadcast_post; - struct HPMHookPoint *HP_mapif_wis_message_pre; - struct HPMHookPoint *HP_mapif_wis_message_post; - struct HPMHookPoint *HP_mapif_wis_response_pre; - struct HPMHookPoint *HP_mapif_wis_response_post; - struct HPMHookPoint *HP_mapif_wis_end_pre; - struct HPMHookPoint *HP_mapif_wis_end_post; struct HPMHookPoint *HP_mapif_account_reg_reply_pre; struct HPMHookPoint *HP_mapif_account_reg_reply_post; struct HPMHookPoint *HP_mapif_disconnectplayer_pre; struct HPMHookPoint *HP_mapif_disconnectplayer_post; - struct HPMHookPoint *HP_mapif_parse_broadcast_pre; - struct HPMHookPoint *HP_mapif_parse_broadcast_post; - struct HPMHookPoint *HP_mapif_parse_WisRequest_pre; - struct HPMHookPoint *HP_mapif_parse_WisRequest_post; - struct HPMHookPoint *HP_mapif_parse_WisReply_pre; - struct HPMHookPoint *HP_mapif_parse_WisReply_post; - struct HPMHookPoint *HP_mapif_parse_WisToGM_pre; - struct HPMHookPoint *HP_mapif_parse_WisToGM_post; struct HPMHookPoint *HP_mapif_parse_Registry_pre; struct HPMHookPoint *HP_mapif_parse_Registry_post; struct HPMHookPoint *HP_mapif_parse_RegistryRequest_pre; @@ -2257,10 +2223,6 @@ struct { int HP_inter_init_sql_post; int HP_inter_mapif_init_pre; int HP_inter_mapif_init_post; - int HP_inter_check_ttl_wisdata_sub_pre; - int HP_inter_check_ttl_wisdata_sub_post; - int HP_inter_check_ttl_wisdata_pre; - int HP_inter_check_ttl_wisdata_post; int HP_inter_check_length_pre; int HP_inter_check_length_post; int HP_inter_parse_frommap_pre; @@ -2277,12 +2239,6 @@ struct { int HP_inter_accinfo_post; int HP_inter_accinfo2_pre; int HP_inter_accinfo2_post; - int HP_inter_add_wisdata_pre; - int HP_inter_add_wisdata_post; - int HP_inter_get_wisdata_pre; - int HP_inter_get_wisdata_post; - int HP_inter_remove_wisdata_pre; - int HP_inter_remove_wisdata_post; int HP_inter_mail_sql_init_pre; int HP_inter_mail_sql_init_post; int HP_inter_mail_sql_final_pre; @@ -2679,8 +2635,6 @@ struct { int HP_mapif_guild_memberinfoshort_post; int HP_mapif_guild_broken_pre; int HP_mapif_guild_broken_post; - int HP_mapif_guild_message_pre; - int HP_mapif_guild_message_post; int HP_mapif_guild_basicinfochanged_pre; int HP_mapif_guild_basicinfochanged_post; int HP_mapif_guild_memberinfochanged_pre; @@ -2711,8 +2665,6 @@ struct { int HP_mapif_parse_GuildChangeMemberInfoShort_post; int HP_mapif_parse_BreakGuild_pre; int HP_mapif_parse_BreakGuild_post; - int HP_mapif_parse_GuildMessage_pre; - int HP_mapif_parse_GuildMessage_post; int HP_mapif_parse_GuildBasicInfoChange_pre; int HP_mapif_parse_GuildBasicInfoChange_post; int HP_mapif_parse_GuildMemberInfoChange_pre; @@ -2807,8 +2759,6 @@ struct { int HP_mapif_party_membermoved_post; int HP_mapif_party_broken_pre; int HP_mapif_party_broken_post; - int HP_mapif_party_message_pre; - int HP_mapif_party_message_post; int HP_mapif_parse_CreateParty_pre; int HP_mapif_parse_CreateParty_post; int HP_mapif_parse_PartyInfo_pre; @@ -2823,8 +2773,6 @@ struct { int HP_mapif_parse_PartyChangeMap_post; int HP_mapif_parse_BreakParty_pre; int HP_mapif_parse_BreakParty_post; - int HP_mapif_parse_PartyMessage_pre; - int HP_mapif_parse_PartyMessage_post; int HP_mapif_parse_PartyLeaderChange_pre; int HP_mapif_parse_PartyLeaderChange_post; int HP_mapif_pet_created_pre; @@ -2901,26 +2849,10 @@ struct { int HP_mapif_parse_ItemBoundRetrieve_post; int HP_mapif_parse_accinfo_pre; int HP_mapif_parse_accinfo_post; - int HP_mapif_broadcast_pre; - int HP_mapif_broadcast_post; - int HP_mapif_wis_message_pre; - int HP_mapif_wis_message_post; - int HP_mapif_wis_response_pre; - int HP_mapif_wis_response_post; - int HP_mapif_wis_end_pre; - int HP_mapif_wis_end_post; int HP_mapif_account_reg_reply_pre; int HP_mapif_account_reg_reply_post; int HP_mapif_disconnectplayer_pre; int HP_mapif_disconnectplayer_post; - int HP_mapif_parse_broadcast_pre; - int HP_mapif_parse_broadcast_post; - int HP_mapif_parse_WisRequest_pre; - int HP_mapif_parse_WisRequest_post; - int HP_mapif_parse_WisReply_pre; - int HP_mapif_parse_WisReply_post; - int HP_mapif_parse_WisToGM_pre; - int HP_mapif_parse_WisToGM_post; int HP_mapif_parse_Registry_pre; int HP_mapif_parse_Registry_post; int HP_mapif_parse_RegistryRequest_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc index 60162c1a8..efd72b670 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc @@ -333,8 +333,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(inter->vlog, HP_inter_vlog) }, { HP_POP(inter->init_sql, HP_inter_init_sql) }, { HP_POP(inter->mapif_init, HP_inter_mapif_init) }, - { HP_POP(inter->check_ttl_wisdata_sub, HP_inter_check_ttl_wisdata_sub) }, - { HP_POP(inter->check_ttl_wisdata, HP_inter_check_ttl_wisdata) }, { HP_POP(inter->check_length, HP_inter_check_length) }, { HP_POP(inter->parse_frommap, HP_inter_parse_frommap) }, { HP_POP(inter->final, HP_inter_final) }, @@ -343,9 +341,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(inter->config_read_connection, HP_inter_config_read_connection) }, { HP_POP(inter->accinfo, HP_inter_accinfo) }, { HP_POP(inter->accinfo2, HP_inter_accinfo2) }, - { HP_POP(inter->add_wisdata, HP_inter_add_wisdata) }, - { HP_POP(inter->get_wisdata, HP_inter_get_wisdata) }, - { HP_POP(inter->remove_wisdata, HP_inter_remove_wisdata) }, /* inter_mail_interface */ { HP_POP(inter_mail->sql_init, HP_inter_mail_sql_init) }, { HP_POP(inter_mail->sql_final, HP_inter_mail_sql_final) }, @@ -554,7 +549,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mapif->guild_withdraw, HP_mapif_guild_withdraw) }, { HP_POP(mapif->guild_memberinfoshort, HP_mapif_guild_memberinfoshort) }, { HP_POP(mapif->guild_broken, HP_mapif_guild_broken) }, - { HP_POP(mapif->guild_message, HP_mapif_guild_message) }, { HP_POP(mapif->guild_basicinfochanged, HP_mapif_guild_basicinfochanged) }, { HP_POP(mapif->guild_memberinfochanged, HP_mapif_guild_memberinfochanged) }, { HP_POP(mapif->guild_skillupack, HP_mapif_guild_skillupack) }, @@ -570,7 +564,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mapif->parse_GuildLeave, HP_mapif_parse_GuildLeave) }, { HP_POP(mapif->parse_GuildChangeMemberInfoShort, HP_mapif_parse_GuildChangeMemberInfoShort) }, { HP_POP(mapif->parse_BreakGuild, HP_mapif_parse_BreakGuild) }, - { HP_POP(mapif->parse_GuildMessage, HP_mapif_parse_GuildMessage) }, { HP_POP(mapif->parse_GuildBasicInfoChange, HP_mapif_parse_GuildBasicInfoChange) }, { HP_POP(mapif->parse_GuildMemberInfoChange, HP_mapif_parse_GuildMemberInfoChange) }, { HP_POP(mapif->parse_GuildPosition, HP_mapif_parse_GuildPosition) }, @@ -618,7 +611,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mapif->party_withdraw, HP_mapif_party_withdraw) }, { HP_POP(mapif->party_membermoved, HP_mapif_party_membermoved) }, { HP_POP(mapif->party_broken, HP_mapif_party_broken) }, - { HP_POP(mapif->party_message, HP_mapif_party_message) }, { HP_POP(mapif->parse_CreateParty, HP_mapif_parse_CreateParty) }, { HP_POP(mapif->parse_PartyInfo, HP_mapif_parse_PartyInfo) }, { HP_POP(mapif->parse_PartyAddMember, HP_mapif_parse_PartyAddMember) }, @@ -626,7 +618,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mapif->parse_PartyLeave, HP_mapif_parse_PartyLeave) }, { HP_POP(mapif->parse_PartyChangeMap, HP_mapif_parse_PartyChangeMap) }, { HP_POP(mapif->parse_BreakParty, HP_mapif_parse_BreakParty) }, - { HP_POP(mapif->parse_PartyMessage, HP_mapif_parse_PartyMessage) }, { HP_POP(mapif->parse_PartyLeaderChange, HP_mapif_parse_PartyLeaderChange) }, { HP_POP(mapif->pet_created, HP_mapif_pet_created) }, { HP_POP(mapif->pet_info, HP_mapif_pet_info) }, @@ -665,16 +656,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mapif->itembound_ack, HP_mapif_itembound_ack) }, { HP_POP(mapif->parse_ItemBoundRetrieve, HP_mapif_parse_ItemBoundRetrieve) }, { HP_POP(mapif->parse_accinfo, HP_mapif_parse_accinfo) }, - { HP_POP(mapif->broadcast, HP_mapif_broadcast) }, - { HP_POP(mapif->wis_message, HP_mapif_wis_message) }, - { HP_POP(mapif->wis_response, HP_mapif_wis_response) }, - { HP_POP(mapif->wis_end, HP_mapif_wis_end) }, { HP_POP(mapif->account_reg_reply, HP_mapif_account_reg_reply) }, { HP_POP(mapif->disconnectplayer, HP_mapif_disconnectplayer) }, - { HP_POP(mapif->parse_broadcast, HP_mapif_parse_broadcast) }, - { HP_POP(mapif->parse_WisRequest, HP_mapif_parse_WisRequest) }, - { HP_POP(mapif->parse_WisReply, HP_mapif_parse_WisReply) }, - { HP_POP(mapif->parse_WisToGM, HP_mapif_parse_WisToGM) }, { HP_POP(mapif->parse_Registry, HP_mapif_parse_Registry) }, { HP_POP(mapif->parse_RegistryRequest, HP_mapif_parse_RegistryRequest) }, { HP_POP(mapif->namechange_ack, HP_mapif_namechange_ack) }, diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index 2b7e25e5d..7ce54d288 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc @@ -7851,66 +7851,6 @@ int HP_inter_mapif_init(int fd) { } return retVal___; } -int HP_inter_check_ttl_wisdata_sub(union DBKey key, struct DBData *data, va_list ap) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_inter_check_ttl_wisdata_sub_pre > 0) { - int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_ttl_wisdata_sub_pre; hIndex++) { - va_list ap___copy; va_copy(ap___copy, ap); - preHookFunc = HPMHooks.list.HP_inter_check_ttl_wisdata_sub_pre[hIndex].func; - retVal___ = preHookFunc(&key, &data, ap___copy); - va_end(ap___copy); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - va_list ap___copy; va_copy(ap___copy, ap); - retVal___ = HPMHooks.source.inter.check_ttl_wisdata_sub(key, data, ap___copy); - va_end(ap___copy); - } - if (HPMHooks.count.HP_inter_check_ttl_wisdata_sub_post > 0) { - int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap); - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_ttl_wisdata_sub_post; hIndex++) { - va_list ap___copy; va_copy(ap___copy, ap); - postHookFunc = HPMHooks.list.HP_inter_check_ttl_wisdata_sub_post[hIndex].func; - retVal___ = postHookFunc(retVal___, key, data, ap___copy); - va_end(ap___copy); - } - } - return retVal___; -} -int HP_inter_check_ttl_wisdata(void) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_inter_check_ttl_wisdata_pre > 0) { - int (*preHookFunc) (void); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_ttl_wisdata_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_inter_check_ttl_wisdata_pre[hIndex].func; - retVal___ = preHookFunc(); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.inter.check_ttl_wisdata(); - } - if (HPMHooks.count.HP_inter_check_ttl_wisdata_post > 0) { - int (*postHookFunc) (int retVal___); - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_ttl_wisdata_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_inter_check_ttl_wisdata_post[hIndex].func; - retVal___ = postHookFunc(retVal___); - } - } - return retVal___; -} int HP_inter_check_length(int fd, int length) { int hIndex = 0; int retVal___ = 0; @@ -8124,86 +8064,6 @@ void HP_inter_accinfo2(bool success, int map_fd, int u_fd, int u_aid, int accoun } return; } -struct WisData* HP_inter_add_wisdata(int fd, const unsigned char *src, const unsigned char *dst, const unsigned char *msg, int msg_len) { - int hIndex = 0; - struct WisData* retVal___ = NULL; - if (HPMHooks.count.HP_inter_add_wisdata_pre > 0) { - struct WisData* (*preHookFunc) (int *fd, const unsigned char **src, const unsigned char **dst, const unsigned char **msg, int *msg_len); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_add_wisdata_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_inter_add_wisdata_pre[hIndex].func; - retVal___ = preHookFunc(&fd, &src, &dst, &msg, &msg_len); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.inter.add_wisdata(fd, src, dst, msg, msg_len); - } - if (HPMHooks.count.HP_inter_add_wisdata_post > 0) { - struct WisData* (*postHookFunc) (struct WisData* retVal___, int fd, const unsigned char *src, const unsigned char *dst, const unsigned char *msg, int msg_len); - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_add_wisdata_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_inter_add_wisdata_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fd, src, dst, msg, msg_len); - } - } - return retVal___; -} -struct WisData* HP_inter_get_wisdata(int id) { - int hIndex = 0; - struct WisData* retVal___ = NULL; - if (HPMHooks.count.HP_inter_get_wisdata_pre > 0) { - struct WisData* (*preHookFunc) (int *id); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_get_wisdata_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_inter_get_wisdata_pre[hIndex].func; - retVal___ = preHookFunc(&id); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.inter.get_wisdata(id); - } - if (HPMHooks.count.HP_inter_get_wisdata_post > 0) { - struct WisData* (*postHookFunc) (struct WisData* retVal___, int id); - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_get_wisdata_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_inter_get_wisdata_post[hIndex].func; - retVal___ = postHookFunc(retVal___, id); - } - } - return retVal___; -} -void HP_inter_remove_wisdata(int id) { - int hIndex = 0; - if (HPMHooks.count.HP_inter_remove_wisdata_pre > 0) { - void (*preHookFunc) (int *id); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_remove_wisdata_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_inter_remove_wisdata_pre[hIndex].func; - preHookFunc(&id); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.inter.remove_wisdata(id); - } - if (HPMHooks.count.HP_inter_remove_wisdata_post > 0) { - void (*postHookFunc) (int id); - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_remove_wisdata_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_inter_remove_wisdata_post[hIndex].func; - postHookFunc(id); - } - } - return; -} /* inter_mail_interface */ int HP_inter_mail_sql_init(void) { int hIndex = 0; @@ -13498,33 +13358,6 @@ int HP_mapif_guild_broken(int guild_id, int flag) { } return retVal___; } -int HP_mapif_guild_message(int guild_id, int account_id, const char *mes, int len, int sfd) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_guild_message_pre > 0) { - int (*preHookFunc) (int *guild_id, int *account_id, const char **mes, int *len, int *sfd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_guild_message_pre[hIndex].func; - retVal___ = preHookFunc(&guild_id, &account_id, &mes, &len, &sfd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.guild_message(guild_id, account_id, mes, len, sfd); - } - if (HPMHooks.count.HP_mapif_guild_message_post > 0) { - int (*postHookFunc) (int retVal___, int guild_id, int account_id, const char *mes, int len, int sfd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_guild_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, guild_id, account_id, mes, len, sfd); - } - } - return retVal___; -} int HP_mapif_guild_basicinfochanged(int guild_id, int type, const void *data, int len) { int hIndex = 0; int retVal___ = 0; @@ -13930,33 +13763,6 @@ int HP_mapif_parse_BreakGuild(int fd, int guild_id) { } return retVal___; } -int HP_mapif_parse_GuildMessage(int fd, int guild_id, int account_id, const char *mes, int len) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_parse_GuildMessage_pre > 0) { - int (*preHookFunc) (int *fd, int *guild_id, int *account_id, const char **mes, int *len); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildMessage_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_parse_GuildMessage_pre[hIndex].func; - retVal___ = preHookFunc(&fd, &guild_id, &account_id, &mes, &len); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.parse_GuildMessage(fd, guild_id, account_id, mes, len); - } - if (HPMHooks.count.HP_mapif_parse_GuildMessage_post > 0) { - int (*postHookFunc) (int retVal___, int fd, int guild_id, int account_id, const char *mes, int len); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildMessage_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_parse_GuildMessage_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fd, guild_id, account_id, mes, len); - } - } - return retVal___; -} int HP_mapif_parse_GuildBasicInfoChange(int fd, int guild_id, int type, const void *data, int len) { int hIndex = 0; int retVal___ = 0; @@ -15195,33 +15001,6 @@ int HP_mapif_party_broken(int party_id, int flag) { } return retVal___; } -int HP_mapif_party_message(int party_id, int account_id, const char *mes, int len, int sfd) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_party_message_pre > 0) { - int (*preHookFunc) (int *party_id, int *account_id, const char **mes, int *len, int *sfd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_party_message_pre[hIndex].func; - retVal___ = preHookFunc(&party_id, &account_id, &mes, &len, &sfd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.party_message(party_id, account_id, mes, len, sfd); - } - if (HPMHooks.count.HP_mapif_party_message_post > 0) { - int (*postHookFunc) (int retVal___, int party_id, int account_id, const char *mes, int len, int sfd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_party_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, party_id, account_id, mes, len, sfd); - } - } - return retVal___; -} int HP_mapif_parse_CreateParty(int fd, const char *name, int item, int item2, const struct party_member *leader) { int hIndex = 0; int retVal___ = 0; @@ -15410,33 +15189,6 @@ int HP_mapif_parse_BreakParty(int fd, int party_id) { } return retVal___; } -int HP_mapif_parse_PartyMessage(int fd, int party_id, int account_id, const char *mes, int len) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_parse_PartyMessage_pre > 0) { - int (*preHookFunc) (int *fd, int *party_id, int *account_id, const char **mes, int *len); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyMessage_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_parse_PartyMessage_pre[hIndex].func; - retVal___ = preHookFunc(&fd, &party_id, &account_id, &mes, &len); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.parse_PartyMessage(fd, party_id, account_id, mes, len); - } - if (HPMHooks.count.HP_mapif_parse_PartyMessage_post > 0) { - int (*postHookFunc) (int retVal___, int fd, int party_id, int account_id, const char *mes, int len); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyMessage_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_parse_PartyMessage_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fd, party_id, account_id, mes, len); - } - } - return retVal___; -} int HP_mapif_parse_PartyLeaderChange(int fd, int party_id, int account_id, int char_id) { int hIndex = 0; int retVal___ = 0; @@ -16447,113 +16199,6 @@ void HP_mapif_parse_accinfo(int fd) { } return; } -int HP_mapif_broadcast(const unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_broadcast_pre > 0) { - int (*preHookFunc) (const unsigned char **mes, int *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY, int *sfd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_broadcast_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_broadcast_pre[hIndex].func; - retVal___ = preHookFunc(&mes, &len, &fontColor, &fontType, &fontSize, &fontAlign, &fontY, &sfd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.broadcast(mes, len, fontColor, fontType, fontSize, fontAlign, fontY, sfd); - } - if (HPMHooks.count.HP_mapif_broadcast_post > 0) { - int (*postHookFunc) (int retVal___, const unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_broadcast_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_broadcast_post[hIndex].func; - retVal___ = postHookFunc(retVal___, mes, len, fontColor, fontType, fontSize, fontAlign, fontY, sfd); - } - } - return retVal___; -} -int HP_mapif_wis_message(struct WisData *wd) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_wis_message_pre > 0) { - int (*preHookFunc) (struct WisData **wd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_wis_message_pre[hIndex].func; - retVal___ = preHookFunc(&wd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.wis_message(wd); - } - if (HPMHooks.count.HP_mapif_wis_message_post > 0) { - int (*postHookFunc) (int retVal___, struct WisData *wd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_wis_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, wd); - } - } - return retVal___; -} -void HP_mapif_wis_response(int fd, const unsigned char *src, int flag) { - int hIndex = 0; - if (HPMHooks.count.HP_mapif_wis_response_pre > 0) { - void (*preHookFunc) (int *fd, const unsigned char **src, int *flag); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_response_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_wis_response_pre[hIndex].func; - preHookFunc(&fd, &src, &flag); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.mapif.wis_response(fd, src, flag); - } - if (HPMHooks.count.HP_mapif_wis_response_post > 0) { - void (*postHookFunc) (int fd, const unsigned char *src, int flag); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_response_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_wis_response_post[hIndex].func; - postHookFunc(fd, src, flag); - } - } - return; -} -int HP_mapif_wis_end(struct WisData *wd, int flag) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_wis_end_pre > 0) { - int (*preHookFunc) (struct WisData **wd, int *flag); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_end_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_wis_end_pre[hIndex].func; - retVal___ = preHookFunc(&wd, &flag); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.wis_end(wd, flag); - } - if (HPMHooks.count.HP_mapif_wis_end_post > 0) { - int (*postHookFunc) (int retVal___, struct WisData *wd, int flag); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_end_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_wis_end_post[hIndex].func; - retVal___ = postHookFunc(retVal___, wd, flag); - } - } - return retVal___; -} int HP_mapif_account_reg_reply(int fd, int account_id, int char_id, int type) { int hIndex = 0; int retVal___ = 0; @@ -16608,114 +16253,6 @@ int HP_mapif_disconnectplayer(int fd, int account_id, int char_id, int reason) { } return retVal___; } -int HP_mapif_parse_broadcast(int fd) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_parse_broadcast_pre > 0) { - int (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_broadcast_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_parse_broadcast_pre[hIndex].func; - retVal___ = preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.parse_broadcast(fd); - } - if (HPMHooks.count.HP_mapif_parse_broadcast_post > 0) { - int (*postHookFunc) (int retVal___, int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_broadcast_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_parse_broadcast_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fd); - } - } - return retVal___; -} -int HP_mapif_parse_WisRequest(int fd) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_parse_WisRequest_pre > 0) { - int (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisRequest_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_parse_WisRequest_pre[hIndex].func; - retVal___ = preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.parse_WisRequest(fd); - } - if (HPMHooks.count.HP_mapif_parse_WisRequest_post > 0) { - int (*postHookFunc) (int retVal___, int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisRequest_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_parse_WisRequest_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fd); - } - } - return retVal___; -} -int HP_mapif_parse_WisReply(int fd) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_parse_WisReply_pre > 0) { - int (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisReply_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_parse_WisReply_pre[hIndex].func; - retVal___ = preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.parse_WisReply(fd); - } - if (HPMHooks.count.HP_mapif_parse_WisReply_post > 0) { - int (*postHookFunc) (int retVal___, int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisReply_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_parse_WisReply_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fd); - } - } - return retVal___; -} -int HP_mapif_parse_WisToGM(int fd) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_parse_WisToGM_pre > 0) { - int (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisToGM_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_parse_WisToGM_pre[hIndex].func; - retVal___ = preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.parse_WisToGM(fd); - } - if (HPMHooks.count.HP_mapif_parse_WisToGM_post > 0) { - int (*postHookFunc) (int retVal___, int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisToGM_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_parse_WisToGM_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fd); - } - } - return retVal___; -} int HP_mapif_parse_Registry(int fd) { int hIndex = 0; int retVal___ = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 224ed3ef1..6b3cee6b5 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -886,6 +886,10 @@ struct { struct HPMHookPoint *HP_clif_fame_taekwon_post; struct HPMHookPoint *HP_clif_ranklist_pre; struct HPMHookPoint *HP_clif_ranklist_post; + struct HPMHookPoint *HP_clif_ranklist_sub_pre; + struct HPMHookPoint *HP_clif_ranklist_sub_post; + struct HPMHookPoint *HP_clif_ranklist_sub2_pre; + struct HPMHookPoint *HP_clif_ranklist_sub2_post; struct HPMHookPoint *HP_clif_update_rankingpoint_pre; struct HPMHookPoint *HP_clif_update_rankingpoint_post; struct HPMHookPoint *HP_clif_pRanklist_pre; @@ -1298,6 +1302,8 @@ struct { struct HPMHookPoint *HP_clif_addskill_post; struct HPMHookPoint *HP_clif_deleteskill_pre; struct HPMHookPoint *HP_clif_deleteskill_post; + struct HPMHookPoint *HP_clif_playerSkillToPacket_pre; + struct HPMHookPoint *HP_clif_playerSkillToPacket_post; struct HPMHookPoint *HP_clif_party_created_pre; struct HPMHookPoint *HP_clif_party_created_post; struct HPMHookPoint *HP_clif_party_member_info_pre; @@ -1340,6 +1346,10 @@ struct { struct HPMHookPoint *HP_clif_guild_basicinfo_post; struct HPMHookPoint *HP_clif_guild_allianceinfo_pre; struct HPMHookPoint *HP_clif_guild_allianceinfo_post; + struct HPMHookPoint *HP_clif_guild_castlelist_pre; + struct HPMHookPoint *HP_clif_guild_castlelist_post; + struct HPMHookPoint *HP_clif_guild_castleinfo_pre; + struct HPMHookPoint *HP_clif_guild_castleinfo_post; struct HPMHookPoint *HP_clif_guild_memberlist_pre; struct HPMHookPoint *HP_clif_guild_memberlist_post; struct HPMHookPoint *HP_clif_guild_skillinfo_pre; @@ -2310,6 +2320,20 @@ struct { struct HPMHookPoint *HP_clif_pRefineryUIRefine_post; struct HPMHookPoint *HP_clif_announce_refine_status_pre; struct HPMHookPoint *HP_clif_announce_refine_status_post; + struct HPMHookPoint *HP_clif_pGuildCastleTeleportRequest_pre; + struct HPMHookPoint *HP_clif_pGuildCastleTeleportRequest_post; + struct HPMHookPoint *HP_clif_pGuildCastleInfoRequest_pre; + struct HPMHookPoint *HP_clif_pGuildCastleInfoRequest_post; + struct HPMHookPoint *HP_clif_guild_castleteleport_res_pre; + struct HPMHookPoint *HP_clif_guild_castleteleport_res_post; + struct HPMHookPoint *HP_clif_lapineDdukDdak_open_pre; + struct HPMHookPoint *HP_clif_lapineDdukDdak_open_post; + struct HPMHookPoint *HP_clif_lapineDdukDdak_result_pre; + struct HPMHookPoint *HP_clif_lapineDdukDdak_result_post; + struct HPMHookPoint *HP_clif_plapineDdukDdak_ack_pre; + struct HPMHookPoint *HP_clif_plapineDdukDdak_ack_post; + struct HPMHookPoint *HP_clif_plapineDdukDdak_close_pre; + struct HPMHookPoint *HP_clif_plapineDdukDdak_close_post; struct HPMHookPoint *HP_cmdline_init_pre; struct HPMHookPoint *HP_cmdline_init_post; struct HPMHookPoint *HP_cmdline_final_pre; @@ -2568,8 +2592,6 @@ struct { struct HPMHookPoint *HP_guild_emblem_changed_post; struct HPMHookPoint *HP_guild_send_message_pre; struct HPMHookPoint *HP_guild_send_message_post; - struct HPMHookPoint *HP_guild_recv_message_pre; - struct HPMHookPoint *HP_guild_recv_message_post; struct HPMHookPoint *HP_guild_send_dot_remove_pre; struct HPMHookPoint *HP_guild_send_dot_remove_post; struct HPMHookPoint *HP_guild_skillupack_pre; @@ -2614,8 +2636,12 @@ struct { struct HPMHookPoint *HP_guild_sd_check_post; struct HPMHookPoint *HP_guild_read_guildskill_tree_db_pre; struct HPMHookPoint *HP_guild_read_guildskill_tree_db_post; - struct HPMHookPoint *HP_guild_read_castledb_pre; - struct HPMHookPoint *HP_guild_read_castledb_post; + struct HPMHookPoint *HP_guild_read_castledb_libconfig_pre; + struct HPMHookPoint *HP_guild_read_castledb_libconfig_post; + struct HPMHookPoint *HP_guild_read_castledb_libconfig_sub_pre; + struct HPMHookPoint *HP_guild_read_castledb_libconfig_sub_post; + struct HPMHookPoint *HP_guild_read_castledb_libconfig_sub_warp_pre; + struct HPMHookPoint *HP_guild_read_castledb_libconfig_sub_warp_post; struct HPMHookPoint *HP_guild_payexp_timer_sub_pre; struct HPMHookPoint *HP_guild_payexp_timer_sub_post; struct HPMHookPoint *HP_guild_send_xy_timer_sub_pre; @@ -2712,6 +2738,8 @@ struct { struct HPMHookPoint *HP_homun_mutate_post; struct HPMHookPoint *HP_homun_gainexp_pre; struct HPMHookPoint *HP_homun_gainexp_post; + struct HPMHookPoint *HP_homun_gainexp_real_pre; + struct HPMHookPoint *HP_homun_gainexp_real_post; struct HPMHookPoint *HP_homun_add_intimacy_pre; struct HPMHookPoint *HP_homun_add_intimacy_post; struct HPMHookPoint *HP_homun_consume_intimacy_pre; @@ -2810,16 +2838,6 @@ struct { struct HPMHookPoint *HP_intif_parse_post; struct HPMHookPoint *HP_intif_create_pet_pre; struct HPMHookPoint *HP_intif_create_pet_post; - struct HPMHookPoint *HP_intif_broadcast_pre; - struct HPMHookPoint *HP_intif_broadcast_post; - struct HPMHookPoint *HP_intif_broadcast2_pre; - struct HPMHookPoint *HP_intif_broadcast2_post; - struct HPMHookPoint *HP_intif_main_message_pre; - struct HPMHookPoint *HP_intif_main_message_post; - struct HPMHookPoint *HP_intif_wis_message_pre; - struct HPMHookPoint *HP_intif_wis_message_post; - struct HPMHookPoint *HP_intif_wis_message_to_gm_pre; - struct HPMHookPoint *HP_intif_wis_message_to_gm_post; struct HPMHookPoint *HP_intif_saveregistry_pre; struct HPMHookPoint *HP_intif_saveregistry_post; struct HPMHookPoint *HP_intif_request_registry_pre; @@ -2846,8 +2864,6 @@ struct { struct HPMHookPoint *HP_intif_party_changemap_post; struct HPMHookPoint *HP_intif_break_party_pre; struct HPMHookPoint *HP_intif_break_party_post; - struct HPMHookPoint *HP_intif_party_message_pre; - struct HPMHookPoint *HP_intif_party_message_post; struct HPMHookPoint *HP_intif_party_leaderchange_pre; struct HPMHookPoint *HP_intif_party_leaderchange_post; struct HPMHookPoint *HP_intif_guild_create_pre; @@ -2862,8 +2878,6 @@ struct { struct HPMHookPoint *HP_intif_guild_memberinfoshort_post; struct HPMHookPoint *HP_intif_guild_break_pre; struct HPMHookPoint *HP_intif_guild_break_post; - struct HPMHookPoint *HP_intif_guild_message_pre; - struct HPMHookPoint *HP_intif_guild_message_post; struct HPMHookPoint *HP_intif_guild_change_gm_pre; struct HPMHookPoint *HP_intif_guild_change_gm_post; struct HPMHookPoint *HP_intif_guild_change_basicinfo_pre; @@ -2970,14 +2984,6 @@ struct { struct HPMHookPoint *HP_intif_achievements_request_post; struct HPMHookPoint *HP_intif_achievements_save_pre; struct HPMHookPoint *HP_intif_achievements_save_post; - struct HPMHookPoint *HP_intif_pWisMessage_pre; - struct HPMHookPoint *HP_intif_pWisMessage_post; - struct HPMHookPoint *HP_intif_pWisEnd_pre; - struct HPMHookPoint *HP_intif_pWisEnd_post; - struct HPMHookPoint *HP_intif_pWisToGM_sub_pre; - struct HPMHookPoint *HP_intif_pWisToGM_sub_post; - struct HPMHookPoint *HP_intif_pWisToGM_pre; - struct HPMHookPoint *HP_intif_pWisToGM_post; struct HPMHookPoint *HP_intif_pRegisters_pre; struct HPMHookPoint *HP_intif_pRegisters_post; struct HPMHookPoint *HP_intif_pAccountStorage_pre; @@ -3006,8 +3012,6 @@ struct { struct HPMHookPoint *HP_intif_pPartyMove_post; struct HPMHookPoint *HP_intif_pPartyBroken_pre; struct HPMHookPoint *HP_intif_pPartyBroken_post; - struct HPMHookPoint *HP_intif_pPartyMessage_pre; - struct HPMHookPoint *HP_intif_pPartyMessage_post; struct HPMHookPoint *HP_intif_pGuildCreated_pre; struct HPMHookPoint *HP_intif_pGuildCreated_post; struct HPMHookPoint *HP_intif_pGuildInfo_pre; @@ -3020,8 +3024,6 @@ struct { struct HPMHookPoint *HP_intif_pGuildMemberInfoShort_post; struct HPMHookPoint *HP_intif_pGuildBroken_pre; struct HPMHookPoint *HP_intif_pGuildBroken_post; - struct HPMHookPoint *HP_intif_pGuildMessage_pre; - struct HPMHookPoint *HP_intif_pGuildMessage_post; struct HPMHookPoint *HP_intif_pGuildBasicInfoChanged_pre; struct HPMHookPoint *HP_intif_pGuildBasicInfoChanged_post; struct HPMHookPoint *HP_intif_pGuildMemberInfoChanged_pre; @@ -3238,10 +3240,10 @@ struct { struct HPMHookPoint *HP_itemdb_isidentified_post; struct HPMHookPoint *HP_itemdb_isidentified2_pre; struct HPMHookPoint *HP_itemdb_isidentified2_post; - struct HPMHookPoint *HP_itemdb_combo_split_atoi_pre; - struct HPMHookPoint *HP_itemdb_combo_split_atoi_post; - struct HPMHookPoint *HP_itemdb_read_combos_pre; - struct HPMHookPoint *HP_itemdb_read_combos_post; + struct HPMHookPoint *HP_itemdb_read_combodb_libconfig_pre; + struct HPMHookPoint *HP_itemdb_read_combodb_libconfig_post; + struct HPMHookPoint *HP_itemdb_read_combodb_libconfig_sub_pre; + struct HPMHookPoint *HP_itemdb_read_combodb_libconfig_sub_post; struct HPMHookPoint *HP_itemdb_gendercheck_pre; struct HPMHookPoint *HP_itemdb_gendercheck_post; struct HPMHookPoint *HP_itemdb_validate_entry_pre; @@ -3278,6 +3280,12 @@ struct { struct HPMHookPoint *HP_itemdb_lookup_const_mask_post; struct HPMHookPoint *HP_itemdb_addname_sub_pre; struct HPMHookPoint *HP_itemdb_addname_sub_post; + struct HPMHookPoint *HP_itemdb_read_libconfig_lapineddukddak_pre; + struct HPMHookPoint *HP_itemdb_read_libconfig_lapineddukddak_post; + struct HPMHookPoint *HP_itemdb_read_libconfig_lapineddukddak_sub_pre; + struct HPMHookPoint *HP_itemdb_read_libconfig_lapineddukddak_sub_post; + struct HPMHookPoint *HP_itemdb_read_libconfig_lapineddukddak_sub_sources_pre; + struct HPMHookPoint *HP_itemdb_read_libconfig_lapineddukddak_sub_sources_post; struct HPMHookPoint *HP_libconfig_read_pre; struct HPMHookPoint *HP_libconfig_read_post; struct HPMHookPoint *HP_libconfig_write_pre; @@ -3866,6 +3874,8 @@ struct { struct HPMHookPoint *HP_mob_final_post; struct HPMHookPoint *HP_mob_reload_pre; struct HPMHookPoint *HP_mob_reload_post; + struct HPMHookPoint *HP_mob_reload_sub_mob_pre; + struct HPMHookPoint *HP_mob_reload_sub_mob_post; struct HPMHookPoint *HP_mob_db_pre; struct HPMHookPoint *HP_mob_db_post; struct HPMHookPoint *HP_mob_chat_pre; @@ -4430,8 +4440,6 @@ struct { struct HPMHookPoint *HP_party_send_logout_post; struct HPMHookPoint *HP_party_send_message_pre; struct HPMHookPoint *HP_party_send_message_post; - struct HPMHookPoint *HP_party_recv_message_pre; - struct HPMHookPoint *HP_party_recv_message_post; struct HPMHookPoint *HP_party_skill_check_pre; struct HPMHookPoint *HP_party_skill_check_post; struct HPMHookPoint *HP_party_send_xy_clear_pre; @@ -4976,8 +4984,14 @@ struct { struct HPMHookPoint *HP_pc_update_idle_time_post; struct HPMHookPoint *HP_pc_have_magnifier_pre; struct HPMHookPoint *HP_pc_have_magnifier_post; + struct HPMHookPoint *HP_pc_have_item_chain_pre; + struct HPMHookPoint *HP_pc_have_item_chain_post; struct HPMHookPoint *HP_pc_process_chat_message_pre; struct HPMHookPoint *HP_pc_process_chat_message_post; + struct HPMHookPoint *HP_pc_wis_message_to_gm_pre; + struct HPMHookPoint *HP_pc_wis_message_to_gm_post; + struct HPMHookPoint *HP_pc_wis_message_to_gm_sub_pre; + struct HPMHookPoint *HP_pc_wis_message_to_gm_sub_post; struct HPMHookPoint *HP_pc_check_supernovice_call_pre; struct HPMHookPoint *HP_pc_check_supernovice_call_post; struct HPMHookPoint *HP_pc_check_basicskill_pre; @@ -5598,6 +5612,12 @@ struct { struct HPMHookPoint *HP_script_run_item_equip_script_post; struct HPMHookPoint *HP_script_run_item_unequip_script_pre; struct HPMHookPoint *HP_script_run_item_unequip_script_post; + struct HPMHookPoint *HP_script_run_item_rental_end_script_pre; + struct HPMHookPoint *HP_script_run_item_rental_end_script_post; + struct HPMHookPoint *HP_script_run_item_rental_start_script_pre; + struct HPMHookPoint *HP_script_run_item_rental_start_script_post; + struct HPMHookPoint *HP_script_run_item_lapineddukddak_script_pre; + struct HPMHookPoint *HP_script_run_item_lapineddukddak_script_post; struct HPMHookPoint *HP_searchstore_open_pre; struct HPMHookPoint *HP_searchstore_open_post; struct HPMHookPoint *HP_searchstore_query_pre; @@ -6474,8 +6494,14 @@ struct { struct HPMHookPoint *HP_status_readdb_job2_post; struct HPMHookPoint *HP_status_readdb_sizefix_pre; struct HPMHookPoint *HP_status_readdb_sizefix_post; - struct HPMHookPoint *HP_status_readdb_scconfig_pre; - struct HPMHookPoint *HP_status_readdb_scconfig_post; + struct HPMHookPoint *HP_status_read_scdb_libconfig_pre; + struct HPMHookPoint *HP_status_read_scdb_libconfig_post; + struct HPMHookPoint *HP_status_read_scdb_libconfig_sub_pre; + struct HPMHookPoint *HP_status_read_scdb_libconfig_sub_post; + struct HPMHookPoint *HP_status_read_scdb_libconfig_sub_flag_pre; + struct HPMHookPoint *HP_status_read_scdb_libconfig_sub_flag_post; + struct HPMHookPoint *HP_status_read_scdb_libconfig_sub_flag_additional_pre; + struct HPMHookPoint *HP_status_read_scdb_libconfig_sub_flag_additional_post; struct HPMHookPoint *HP_status_read_job_db_pre; struct HPMHookPoint *HP_status_read_job_db_post; struct HPMHookPoint *HP_status_read_job_db_sub_pre; @@ -7675,6 +7701,10 @@ struct { int HP_clif_fame_taekwon_post; int HP_clif_ranklist_pre; int HP_clif_ranklist_post; + int HP_clif_ranklist_sub_pre; + int HP_clif_ranklist_sub_post; + int HP_clif_ranklist_sub2_pre; + int HP_clif_ranklist_sub2_post; int HP_clif_update_rankingpoint_pre; int HP_clif_update_rankingpoint_post; int HP_clif_pRanklist_pre; @@ -8087,6 +8117,8 @@ struct { int HP_clif_addskill_post; int HP_clif_deleteskill_pre; int HP_clif_deleteskill_post; + int HP_clif_playerSkillToPacket_pre; + int HP_clif_playerSkillToPacket_post; int HP_clif_party_created_pre; int HP_clif_party_created_post; int HP_clif_party_member_info_pre; @@ -8129,6 +8161,10 @@ struct { int HP_clif_guild_basicinfo_post; int HP_clif_guild_allianceinfo_pre; int HP_clif_guild_allianceinfo_post; + int HP_clif_guild_castlelist_pre; + int HP_clif_guild_castlelist_post; + int HP_clif_guild_castleinfo_pre; + int HP_clif_guild_castleinfo_post; int HP_clif_guild_memberlist_pre; int HP_clif_guild_memberlist_post; int HP_clif_guild_skillinfo_pre; @@ -9099,6 +9135,20 @@ struct { int HP_clif_pRefineryUIRefine_post; int HP_clif_announce_refine_status_pre; int HP_clif_announce_refine_status_post; + int HP_clif_pGuildCastleTeleportRequest_pre; + int HP_clif_pGuildCastleTeleportRequest_post; + int HP_clif_pGuildCastleInfoRequest_pre; + int HP_clif_pGuildCastleInfoRequest_post; + int HP_clif_guild_castleteleport_res_pre; + int HP_clif_guild_castleteleport_res_post; + int HP_clif_lapineDdukDdak_open_pre; + int HP_clif_lapineDdukDdak_open_post; + int HP_clif_lapineDdukDdak_result_pre; + int HP_clif_lapineDdukDdak_result_post; + int HP_clif_plapineDdukDdak_ack_pre; + int HP_clif_plapineDdukDdak_ack_post; + int HP_clif_plapineDdukDdak_close_pre; + int HP_clif_plapineDdukDdak_close_post; int HP_cmdline_init_pre; int HP_cmdline_init_post; int HP_cmdline_final_pre; @@ -9357,8 +9407,6 @@ struct { int HP_guild_emblem_changed_post; int HP_guild_send_message_pre; int HP_guild_send_message_post; - int HP_guild_recv_message_pre; - int HP_guild_recv_message_post; int HP_guild_send_dot_remove_pre; int HP_guild_send_dot_remove_post; int HP_guild_skillupack_pre; @@ -9403,8 +9451,12 @@ struct { int HP_guild_sd_check_post; int HP_guild_read_guildskill_tree_db_pre; int HP_guild_read_guildskill_tree_db_post; - int HP_guild_read_castledb_pre; - int HP_guild_read_castledb_post; + int HP_guild_read_castledb_libconfig_pre; + int HP_guild_read_castledb_libconfig_post; + int HP_guild_read_castledb_libconfig_sub_pre; + int HP_guild_read_castledb_libconfig_sub_post; + int HP_guild_read_castledb_libconfig_sub_warp_pre; + int HP_guild_read_castledb_libconfig_sub_warp_post; int HP_guild_payexp_timer_sub_pre; int HP_guild_payexp_timer_sub_post; int HP_guild_send_xy_timer_sub_pre; @@ -9501,6 +9553,8 @@ struct { int HP_homun_mutate_post; int HP_homun_gainexp_pre; int HP_homun_gainexp_post; + int HP_homun_gainexp_real_pre; + int HP_homun_gainexp_real_post; int HP_homun_add_intimacy_pre; int HP_homun_add_intimacy_post; int HP_homun_consume_intimacy_pre; @@ -9599,16 +9653,6 @@ struct { int HP_intif_parse_post; int HP_intif_create_pet_pre; int HP_intif_create_pet_post; - int HP_intif_broadcast_pre; - int HP_intif_broadcast_post; - int HP_intif_broadcast2_pre; - int HP_intif_broadcast2_post; - int HP_intif_main_message_pre; - int HP_intif_main_message_post; - int HP_intif_wis_message_pre; - int HP_intif_wis_message_post; - int HP_intif_wis_message_to_gm_pre; - int HP_intif_wis_message_to_gm_post; int HP_intif_saveregistry_pre; int HP_intif_saveregistry_post; int HP_intif_request_registry_pre; @@ -9635,8 +9679,6 @@ struct { int HP_intif_party_changemap_post; int HP_intif_break_party_pre; int HP_intif_break_party_post; - int HP_intif_party_message_pre; - int HP_intif_party_message_post; int HP_intif_party_leaderchange_pre; int HP_intif_party_leaderchange_post; int HP_intif_guild_create_pre; @@ -9651,8 +9693,6 @@ struct { int HP_intif_guild_memberinfoshort_post; int HP_intif_guild_break_pre; int HP_intif_guild_break_post; - int HP_intif_guild_message_pre; - int HP_intif_guild_message_post; int HP_intif_guild_change_gm_pre; int HP_intif_guild_change_gm_post; int HP_intif_guild_change_basicinfo_pre; @@ -9759,14 +9799,6 @@ struct { int HP_intif_achievements_request_post; int HP_intif_achievements_save_pre; int HP_intif_achievements_save_post; - int HP_intif_pWisMessage_pre; - int HP_intif_pWisMessage_post; - int HP_intif_pWisEnd_pre; - int HP_intif_pWisEnd_post; - int HP_intif_pWisToGM_sub_pre; - int HP_intif_pWisToGM_sub_post; - int HP_intif_pWisToGM_pre; - int HP_intif_pWisToGM_post; int HP_intif_pRegisters_pre; int HP_intif_pRegisters_post; int HP_intif_pAccountStorage_pre; @@ -9795,8 +9827,6 @@ struct { int HP_intif_pPartyMove_post; int HP_intif_pPartyBroken_pre; int HP_intif_pPartyBroken_post; - int HP_intif_pPartyMessage_pre; - int HP_intif_pPartyMessage_post; int HP_intif_pGuildCreated_pre; int HP_intif_pGuildCreated_post; int HP_intif_pGuildInfo_pre; @@ -9809,8 +9839,6 @@ struct { int HP_intif_pGuildMemberInfoShort_post; int HP_intif_pGuildBroken_pre; int HP_intif_pGuildBroken_post; - int HP_intif_pGuildMessage_pre; - int HP_intif_pGuildMessage_post; int HP_intif_pGuildBasicInfoChanged_pre; int HP_intif_pGuildBasicInfoChanged_post; int HP_intif_pGuildMemberInfoChanged_pre; @@ -10027,10 +10055,10 @@ struct { int HP_itemdb_isidentified_post; int HP_itemdb_isidentified2_pre; int HP_itemdb_isidentified2_post; - int HP_itemdb_combo_split_atoi_pre; - int HP_itemdb_combo_split_atoi_post; - int HP_itemdb_read_combos_pre; - int HP_itemdb_read_combos_post; + int HP_itemdb_read_combodb_libconfig_pre; + int HP_itemdb_read_combodb_libconfig_post; + int HP_itemdb_read_combodb_libconfig_sub_pre; + int HP_itemdb_read_combodb_libconfig_sub_post; int HP_itemdb_gendercheck_pre; int HP_itemdb_gendercheck_post; int HP_itemdb_validate_entry_pre; @@ -10067,6 +10095,12 @@ struct { int HP_itemdb_lookup_const_mask_post; int HP_itemdb_addname_sub_pre; int HP_itemdb_addname_sub_post; + int HP_itemdb_read_libconfig_lapineddukddak_pre; + int HP_itemdb_read_libconfig_lapineddukddak_post; + int HP_itemdb_read_libconfig_lapineddukddak_sub_pre; + int HP_itemdb_read_libconfig_lapineddukddak_sub_post; + int HP_itemdb_read_libconfig_lapineddukddak_sub_sources_pre; + int HP_itemdb_read_libconfig_lapineddukddak_sub_sources_post; int HP_libconfig_read_pre; int HP_libconfig_read_post; int HP_libconfig_write_pre; @@ -10655,6 +10689,8 @@ struct { int HP_mob_final_post; int HP_mob_reload_pre; int HP_mob_reload_post; + int HP_mob_reload_sub_mob_pre; + int HP_mob_reload_sub_mob_post; int HP_mob_db_pre; int HP_mob_db_post; int HP_mob_chat_pre; @@ -11219,8 +11255,6 @@ struct { int HP_party_send_logout_post; int HP_party_send_message_pre; int HP_party_send_message_post; - int HP_party_recv_message_pre; - int HP_party_recv_message_post; int HP_party_skill_check_pre; int HP_party_skill_check_post; int HP_party_send_xy_clear_pre; @@ -11765,8 +11799,14 @@ struct { int HP_pc_update_idle_time_post; int HP_pc_have_magnifier_pre; int HP_pc_have_magnifier_post; + int HP_pc_have_item_chain_pre; + int HP_pc_have_item_chain_post; int HP_pc_process_chat_message_pre; int HP_pc_process_chat_message_post; + int HP_pc_wis_message_to_gm_pre; + int HP_pc_wis_message_to_gm_post; + int HP_pc_wis_message_to_gm_sub_pre; + int HP_pc_wis_message_to_gm_sub_post; int HP_pc_check_supernovice_call_pre; int HP_pc_check_supernovice_call_post; int HP_pc_check_basicskill_pre; @@ -12387,6 +12427,12 @@ struct { int HP_script_run_item_equip_script_post; int HP_script_run_item_unequip_script_pre; int HP_script_run_item_unequip_script_post; + int HP_script_run_item_rental_end_script_pre; + int HP_script_run_item_rental_end_script_post; + int HP_script_run_item_rental_start_script_pre; + int HP_script_run_item_rental_start_script_post; + int HP_script_run_item_lapineddukddak_script_pre; + int HP_script_run_item_lapineddukddak_script_post; int HP_searchstore_open_pre; int HP_searchstore_open_post; int HP_searchstore_query_pre; @@ -13263,8 +13309,14 @@ struct { int HP_status_readdb_job2_post; int HP_status_readdb_sizefix_pre; int HP_status_readdb_sizefix_post; - int HP_status_readdb_scconfig_pre; - int HP_status_readdb_scconfig_post; + int HP_status_read_scdb_libconfig_pre; + int HP_status_read_scdb_libconfig_post; + int HP_status_read_scdb_libconfig_sub_pre; + int HP_status_read_scdb_libconfig_sub_post; + int HP_status_read_scdb_libconfig_sub_flag_pre; + int HP_status_read_scdb_libconfig_sub_flag_post; + int HP_status_read_scdb_libconfig_sub_flag_additional_pre; + int HP_status_read_scdb_libconfig_sub_flag_additional_post; int HP_status_read_job_db_pre; int HP_status_read_job_db_post; int HP_status_read_job_db_sub_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 7f53ee493..ad9e7e123 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -467,6 +467,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->fame_alchemist, HP_clif_fame_alchemist) }, { HP_POP(clif->fame_taekwon, HP_clif_fame_taekwon) }, { HP_POP(clif->ranklist, HP_clif_ranklist) }, + { HP_POP(clif->ranklist_sub, HP_clif_ranklist_sub) }, + { HP_POP(clif->ranklist_sub2, HP_clif_ranklist_sub2) }, { HP_POP(clif->update_rankingpoint, HP_clif_update_rankingpoint) }, { HP_POP(clif->pRanklist, HP_clif_pRanklist) }, { HP_POP(clif->hotkeys, HP_clif_hotkeys) }, @@ -673,6 +675,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->skillinfo, HP_clif_skillinfo) }, { HP_POP(clif->addskill, HP_clif_addskill) }, { HP_POP(clif->deleteskill, HP_clif_deleteskill) }, + { HP_POP(clif->playerSkillToPacket, HP_clif_playerSkillToPacket) }, { HP_POP(clif->party_created, HP_clif_party_created) }, { HP_POP(clif->party_member_info, HP_clif_party_member_info) }, { HP_POP(clif->party_info, HP_clif_party_info) }, @@ -694,6 +697,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->guild_masterormember, HP_clif_guild_masterormember) }, { HP_POP(clif->guild_basicinfo, HP_clif_guild_basicinfo) }, { HP_POP(clif->guild_allianceinfo, HP_clif_guild_allianceinfo) }, + { HP_POP(clif->guild_castlelist, HP_clif_guild_castlelist) }, + { HP_POP(clif->guild_castleinfo, HP_clif_guild_castleinfo) }, { HP_POP(clif->guild_memberlist, HP_clif_guild_memberlist) }, { HP_POP(clif->guild_skillinfo, HP_clif_guild_skillinfo) }, { HP_POP(clif->guild_send_onlineinfo, HP_clif_guild_send_onlineinfo) }, @@ -1179,6 +1184,13 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->pRefineryUIClose, HP_clif_pRefineryUIClose) }, { HP_POP(clif->pRefineryUIRefine, HP_clif_pRefineryUIRefine) }, { HP_POP(clif->announce_refine_status, HP_clif_announce_refine_status) }, + { HP_POP(clif->pGuildCastleTeleportRequest, HP_clif_pGuildCastleTeleportRequest) }, + { HP_POP(clif->pGuildCastleInfoRequest, HP_clif_pGuildCastleInfoRequest) }, + { HP_POP(clif->guild_castleteleport_res, HP_clif_guild_castleteleport_res) }, + { HP_POP(clif->lapineDdukDdak_open, HP_clif_lapineDdukDdak_open) }, + { HP_POP(clif->lapineDdukDdak_result, HP_clif_lapineDdukDdak_result) }, + { HP_POP(clif->plapineDdukDdak_ack, HP_clif_plapineDdukDdak_ack) }, + { HP_POP(clif->plapineDdukDdak_close, HP_clif_plapineDdukDdak_close) }, /* cmdline_interface */ { HP_POP(cmdline->init, HP_cmdline_init) }, { HP_POP(cmdline->final, HP_cmdline_final) }, @@ -1317,7 +1329,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(guild->change_emblem, HP_guild_change_emblem) }, { HP_POP(guild->emblem_changed, HP_guild_emblem_changed) }, { HP_POP(guild->send_message, HP_guild_send_message) }, - { HP_POP(guild->recv_message, HP_guild_recv_message) }, { HP_POP(guild->send_dot_remove, HP_guild_send_dot_remove) }, { HP_POP(guild->skillupack, HP_guild_skillupack) }, { HP_POP(guild->dobreak, HP_guild_dobreak) }, @@ -1340,7 +1351,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(guild->payexp_timer, HP_guild_payexp_timer) }, { HP_POP(guild->sd_check, HP_guild_sd_check) }, { HP_POP(guild->read_guildskill_tree_db, HP_guild_read_guildskill_tree_db) }, - { HP_POP(guild->read_castledb, HP_guild_read_castledb) }, + { HP_POP(guild->read_castledb_libconfig, HP_guild_read_castledb_libconfig) }, + { HP_POP(guild->read_castledb_libconfig_sub, HP_guild_read_castledb_libconfig_sub) }, + { HP_POP(guild->read_castledb_libconfig_sub_warp, HP_guild_read_castledb_libconfig_sub_warp) }, { HP_POP(guild->payexp_timer_sub, HP_guild_payexp_timer_sub) }, { HP_POP(guild->send_xy_timer_sub, HP_guild_send_xy_timer_sub) }, { HP_POP(guild->send_xy_timer, HP_guild_send_xy_timer) }, @@ -1391,6 +1404,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(homun->evolve, HP_homun_evolve) }, { HP_POP(homun->mutate, HP_homun_mutate) }, { HP_POP(homun->gainexp, HP_homun_gainexp) }, + { HP_POP(homun->gainexp_real, HP_homun_gainexp_real) }, { HP_POP(homun->add_intimacy, HP_homun_add_intimacy) }, { HP_POP(homun->consume_intimacy, HP_homun_consume_intimacy) }, { HP_POP(homun->healed, HP_homun_healed) }, @@ -1442,11 +1456,6 @@ struct HookingPointData HookingPoints[] = { /* intif_interface */ { HP_POP(intif->parse, HP_intif_parse) }, { HP_POP(intif->create_pet, HP_intif_create_pet) }, - { HP_POP(intif->broadcast, HP_intif_broadcast) }, - { HP_POP(intif->broadcast2, HP_intif_broadcast2) }, - { HP_POP(intif->main_message, HP_intif_main_message) }, - { HP_POP(intif->wis_message, HP_intif_wis_message) }, - { HP_POP(intif->wis_message_to_gm, HP_intif_wis_message_to_gm) }, { HP_POP(intif->saveregistry, HP_intif_saveregistry) }, { HP_POP(intif->request_registry, HP_intif_request_registry) }, { HP_POP(intif->request_account_storage, HP_intif_request_account_storage) }, @@ -1460,7 +1469,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(intif->party_leave, HP_intif_party_leave) }, { HP_POP(intif->party_changemap, HP_intif_party_changemap) }, { HP_POP(intif->break_party, HP_intif_break_party) }, - { HP_POP(intif->party_message, HP_intif_party_message) }, { HP_POP(intif->party_leaderchange, HP_intif_party_leaderchange) }, { HP_POP(intif->guild_create, HP_intif_guild_create) }, { HP_POP(intif->guild_request_info, HP_intif_guild_request_info) }, @@ -1468,7 +1476,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(intif->guild_leave, HP_intif_guild_leave) }, { HP_POP(intif->guild_memberinfoshort, HP_intif_guild_memberinfoshort) }, { HP_POP(intif->guild_break, HP_intif_guild_break) }, - { HP_POP(intif->guild_message, HP_intif_guild_message) }, { HP_POP(intif->guild_change_gm, HP_intif_guild_change_gm) }, { HP_POP(intif->guild_change_basicinfo, HP_intif_guild_change_basicinfo) }, { HP_POP(intif->guild_change_memberinfo, HP_intif_guild_change_memberinfo) }, @@ -1522,10 +1529,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(intif->CheckForCharServer, HP_intif_CheckForCharServer) }, { HP_POP(intif->achievements_request, HP_intif_achievements_request) }, { HP_POP(intif->achievements_save, HP_intif_achievements_save) }, - { HP_POP(intif->pWisMessage, HP_intif_pWisMessage) }, - { HP_POP(intif->pWisEnd, HP_intif_pWisEnd) }, - { HP_POP(intif->pWisToGM_sub, HP_intif_pWisToGM_sub) }, - { HP_POP(intif->pWisToGM, HP_intif_pWisToGM) }, { HP_POP(intif->pRegisters, HP_intif_pRegisters) }, { HP_POP(intif->pAccountStorage, HP_intif_pAccountStorage) }, { HP_POP(intif->pChangeNameOk, HP_intif_pChangeNameOk) }, @@ -1540,14 +1543,12 @@ struct HookingPointData HookingPoints[] = { { HP_POP(intif->pPartyMemberWithdraw, HP_intif_pPartyMemberWithdraw) }, { HP_POP(intif->pPartyMove, HP_intif_pPartyMove) }, { HP_POP(intif->pPartyBroken, HP_intif_pPartyBroken) }, - { HP_POP(intif->pPartyMessage, HP_intif_pPartyMessage) }, { HP_POP(intif->pGuildCreated, HP_intif_pGuildCreated) }, { HP_POP(intif->pGuildInfo, HP_intif_pGuildInfo) }, { HP_POP(intif->pGuildMemberAdded, HP_intif_pGuildMemberAdded) }, { HP_POP(intif->pGuildMemberWithdraw, HP_intif_pGuildMemberWithdraw) }, { HP_POP(intif->pGuildMemberInfoShort, HP_intif_pGuildMemberInfoShort) }, { HP_POP(intif->pGuildBroken, HP_intif_pGuildBroken) }, - { HP_POP(intif->pGuildMessage, HP_intif_pGuildMessage) }, { HP_POP(intif->pGuildBasicInfoChanged, HP_intif_pGuildBasicInfoChanged) }, { HP_POP(intif->pGuildMemberInfoChanged, HP_intif_pGuildMemberInfoChanged) }, { HP_POP(intif->pGuildPosition, HP_intif_pGuildPosition) }, @@ -1658,8 +1659,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(itemdb->isrestricted, HP_itemdb_isrestricted) }, { HP_POP(itemdb->isidentified, HP_itemdb_isidentified) }, { HP_POP(itemdb->isidentified2, HP_itemdb_isidentified2) }, - { HP_POP(itemdb->combo_split_atoi, HP_itemdb_combo_split_atoi) }, - { HP_POP(itemdb->read_combos, HP_itemdb_read_combos) }, + { HP_POP(itemdb->read_combodb_libconfig, HP_itemdb_read_combodb_libconfig) }, + { HP_POP(itemdb->read_combodb_libconfig_sub, HP_itemdb_read_combodb_libconfig_sub) }, { HP_POP(itemdb->gendercheck, HP_itemdb_gendercheck) }, { HP_POP(itemdb->validate_entry, HP_itemdb_validate_entry) }, { HP_POP(itemdb->readdb_options_additional_fields, HP_itemdb_readdb_options_additional_fields) }, @@ -1678,6 +1679,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(itemdb->lookup_const, HP_itemdb_lookup_const) }, { HP_POP(itemdb->lookup_const_mask, HP_itemdb_lookup_const_mask) }, { HP_POP(itemdb->addname_sub, HP_itemdb_addname_sub) }, + { HP_POP(itemdb->read_libconfig_lapineddukddak, HP_itemdb_read_libconfig_lapineddukddak) }, + { HP_POP(itemdb->read_libconfig_lapineddukddak_sub, HP_itemdb_read_libconfig_lapineddukddak_sub) }, + { HP_POP(itemdb->read_libconfig_lapineddukddak_sub_sources, HP_itemdb_read_libconfig_lapineddukddak_sub_sources) }, /* libconfig_interface */ { HP_POP(libconfig->read, HP_libconfig_read) }, { HP_POP(libconfig->write, HP_libconfig_write) }, @@ -1982,6 +1986,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mob->init, HP_mob_init) }, { HP_POP(mob->final, HP_mob_final) }, { HP_POP(mob->reload, HP_mob_reload) }, + { HP_POP(mob->reload_sub_mob, HP_mob_reload_sub_mob) }, { HP_POP(mob->db, HP_mob_db) }, { HP_POP(mob->chat, HP_mob_chat) }, { HP_POP(mob->makedummymobdb, HP_mob_makedummymobdb) }, @@ -2270,7 +2275,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(party->send_levelup, HP_party_send_levelup) }, { HP_POP(party->send_logout, HP_party_send_logout) }, { HP_POP(party->send_message, HP_party_send_message) }, - { HP_POP(party->recv_message, HP_party_recv_message) }, { HP_POP(party->skill_check, HP_party_skill_check) }, { HP_POP(party->send_xy_clear, HP_party_send_xy_clear) }, { HP_POP(party->exp_share, HP_party_exp_share) }, @@ -2546,7 +2550,10 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->check_job_name, HP_pc_check_job_name) }, { HP_POP(pc->update_idle_time, HP_pc_update_idle_time) }, { HP_POP(pc->have_magnifier, HP_pc_have_magnifier) }, + { HP_POP(pc->have_item_chain, HP_pc_have_item_chain) }, { HP_POP(pc->process_chat_message, HP_pc_process_chat_message) }, + { HP_POP(pc->wis_message_to_gm, HP_pc_wis_message_to_gm) }, + { HP_POP(pc->wis_message_to_gm_sub, HP_pc_wis_message_to_gm_sub) }, { HP_POP(pc->check_supernovice_call, HP_pc_check_supernovice_call) }, { HP_POP(pc->check_basicskill, HP_pc_check_basicskill) }, { HP_POP(pc->isDeathPenaltyJob, HP_pc_isDeathPenaltyJob) }, @@ -2865,6 +2872,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(script->run_use_script, HP_script_run_use_script) }, { HP_POP(script->run_item_equip_script, HP_script_run_item_equip_script) }, { HP_POP(script->run_item_unequip_script, HP_script_run_item_unequip_script) }, + { HP_POP(script->run_item_rental_end_script, HP_script_run_item_rental_end_script) }, + { HP_POP(script->run_item_rental_start_script, HP_script_run_item_rental_start_script) }, + { HP_POP(script->run_item_lapineddukddak_script, HP_script_run_item_lapineddukddak_script) }, /* searchstore_interface */ { HP_POP(searchstore->open, HP_searchstore_open) }, { HP_POP(searchstore->query, HP_searchstore_query) }, @@ -3309,7 +3319,10 @@ struct HookingPointData HookingPoints[] = { { HP_POP(status->natural_heal_timer, HP_status_natural_heal_timer) }, { HP_POP(status->readdb_job2, HP_status_readdb_job2) }, { HP_POP(status->readdb_sizefix, HP_status_readdb_sizefix) }, - { HP_POP(status->readdb_scconfig, HP_status_readdb_scconfig) }, + { HP_POP(status->read_scdb_libconfig, HP_status_read_scdb_libconfig) }, + { HP_POP(status->read_scdb_libconfig_sub, HP_status_read_scdb_libconfig_sub) }, + { HP_POP(status->read_scdb_libconfig_sub_flag, HP_status_read_scdb_libconfig_sub_flag) }, + { HP_POP(status->read_scdb_libconfig_sub_flag_additional, HP_status_read_scdb_libconfig_sub_flag_additional) }, { HP_POP(status->read_job_db, HP_status_read_job_db) }, { HP_POP(status->read_job_db_sub, HP_status_read_job_db_sub) }, { HP_POP(status->set_sc, HP_status_set_sc) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index a3816a0b9..6dd6cb34f 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -11278,11 +11278,11 @@ void HP_clif_viewpoint(struct map_session_data *sd, int npc_id, int type, int x, } return; } -int HP_clif_damage(struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 damage, short div, unsigned char type, int64 damage2) { +int HP_clif_damage(struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 damage, short div, enum battle_dmg_type type, int64 damage2) { int hIndex = 0; int retVal___ = 0; if (HPMHooks.count.HP_clif_damage_pre > 0) { - int (*preHookFunc) (struct block_list **src, struct block_list **dst, int *sdelay, int *ddelay, int64 *damage, short *div, unsigned char *type, int64 *damage2); + int (*preHookFunc) (struct block_list **src, struct block_list **dst, int *sdelay, int *ddelay, int64 *damage, short *div, enum battle_dmg_type *type, int64 *damage2); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_damage_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_damage_pre[hIndex].func; @@ -11297,7 +11297,7 @@ int HP_clif_damage(struct block_list *src, struct block_list *dst, int sdelay, i retVal___ = HPMHooks.source.clif.damage(src, dst, sdelay, ddelay, damage, div, type, damage2); } if (HPMHooks.count.HP_clif_damage_post > 0) { - int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 damage, short div, unsigned char type, int64 damage2); + int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 damage, short div, enum battle_dmg_type type, int64 damage2); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_damage_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_damage_post[hIndex].func; retVal___ = postHookFunc(retVal___, src, dst, sdelay, ddelay, damage, div, type, damage2); @@ -11539,6 +11539,58 @@ void HP_clif_ranklist(struct map_session_data *sd, enum fame_list_type type) { } return; } +void HP_clif_ranklist_sub(struct PACKET_ZC_ACK_RANKING_sub *ranks, enum fame_list_type type) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_ranklist_sub_pre > 0) { + void (*preHookFunc) (struct PACKET_ZC_ACK_RANKING_sub **ranks, enum fame_list_type *type); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ranklist_sub_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_ranklist_sub_pre[hIndex].func; + preHookFunc(&ranks, &type); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.ranklist_sub(ranks, type); + } + if (HPMHooks.count.HP_clif_ranklist_sub_post > 0) { + void (*postHookFunc) (struct PACKET_ZC_ACK_RANKING_sub *ranks, enum fame_list_type type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ranklist_sub_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_ranklist_sub_post[hIndex].func; + postHookFunc(ranks, type); + } + } + return; +} +void HP_clif_ranklist_sub2(uint32 *chars, uint32 *points, enum fame_list_type type) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_ranklist_sub2_pre > 0) { + void (*preHookFunc) (uint32 **chars, uint32 **points, enum fame_list_type *type); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ranklist_sub2_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_ranklist_sub2_pre[hIndex].func; + preHookFunc(&chars, &points, &type); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.ranklist_sub2(chars, points, type); + } + if (HPMHooks.count.HP_clif_ranklist_sub2_post > 0) { + void (*postHookFunc) (uint32 *chars, uint32 *points, enum fame_list_type type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ranklist_sub2_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_ranklist_sub2_post[hIndex].func; + postHookFunc(chars, points, type); + } + } + return; +} void HP_clif_update_rankingpoint(struct map_session_data *sd, enum fame_list_type type, int points) { int hIndex = 0; if (HPMHooks.count.HP_clif_update_rankingpoint_pre > 0) { @@ -14480,11 +14532,11 @@ void HP_clif_callpartner(struct map_session_data *sd) { } return; } -int HP_clif_skill_damage(struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int64 damage, int div, uint16 skill_id, uint16 skill_lv, int type) { +int HP_clif_skill_damage(struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int64 damage, int div, uint16 skill_id, uint16 skill_lv, enum battle_dmg_type type) { int hIndex = 0; int retVal___ = 0; if (HPMHooks.count.HP_clif_skill_damage_pre > 0) { - int (*preHookFunc) (struct block_list **src, struct block_list **dst, int64 *tick, int *sdelay, int *ddelay, int64 *damage, int *div, uint16 *skill_id, uint16 *skill_lv, int *type); + int (*preHookFunc) (struct block_list **src, struct block_list **dst, int64 *tick, int *sdelay, int *ddelay, int64 *damage, int *div, uint16 *skill_id, uint16 *skill_lv, enum battle_dmg_type *type); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_damage_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_skill_damage_pre[hIndex].func; @@ -14499,7 +14551,7 @@ int HP_clif_skill_damage(struct block_list *src, struct block_list *dst, int64 t retVal___ = HPMHooks.source.clif.skill_damage(src, dst, tick, sdelay, ddelay, damage, div, skill_id, skill_lv, type); } if (HPMHooks.count.HP_clif_skill_damage_post > 0) { - int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int64 damage, int div, uint16 skill_id, uint16 skill_lv, int type); + int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int64 damage, int div, uint16 skill_id, uint16 skill_lv, enum battle_dmg_type type); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_damage_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_skill_damage_post[hIndex].func; retVal___ = postHookFunc(retVal___, src, dst, tick, sdelay, ddelay, damage, div, skill_id, skill_lv, type); @@ -16928,6 +16980,32 @@ void HP_clif_deleteskill(struct map_session_data *sd, int id) { } return; } +void HP_clif_playerSkillToPacket(struct map_session_data *sd, struct SKILLDATA *skillData, int skillId, int idx, bool newSkill) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_playerSkillToPacket_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, struct SKILLDATA **skillData, int *skillId, int *idx, bool *newSkill); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_playerSkillToPacket_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_playerSkillToPacket_pre[hIndex].func; + preHookFunc(&sd, &skillData, &skillId, &idx, &newSkill); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.playerSkillToPacket(sd, skillData, skillId, idx, newSkill); + } + if (HPMHooks.count.HP_clif_playerSkillToPacket_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, struct SKILLDATA *skillData, int skillId, int idx, bool newSkill); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_playerSkillToPacket_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_playerSkillToPacket_post[hIndex].func; + postHookFunc(sd, skillData, skillId, idx, newSkill); + } + } + return; +} void HP_clif_party_created(struct map_session_data *sd, int result) { int hIndex = 0; if (HPMHooks.count.HP_clif_party_created_pre > 0) { @@ -17474,6 +17552,58 @@ void HP_clif_guild_allianceinfo(struct map_session_data *sd) { } return; } +void HP_clif_guild_castlelist(struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_guild_castlelist_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_castlelist_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_guild_castlelist_pre[hIndex].func; + preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.guild_castlelist(sd); + } + if (HPMHooks.count.HP_clif_guild_castlelist_post > 0) { + void (*postHookFunc) (struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_castlelist_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_guild_castlelist_post[hIndex].func; + postHookFunc(sd); + } + } + return; +} +void HP_clif_guild_castleinfo(struct map_session_data *sd, struct guild_castle *gc) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_guild_castleinfo_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, struct guild_castle **gc); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_castleinfo_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_guild_castleinfo_pre[hIndex].func; + preHookFunc(&sd, &gc); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.guild_castleinfo(sd, gc); + } + if (HPMHooks.count.HP_clif_guild_castleinfo_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, struct guild_castle *gc); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_castleinfo_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_guild_castleinfo_post[hIndex].func; + postHookFunc(sd, gc); + } + } + return; +} void HP_clif_guild_memberlist(struct map_session_data *sd) { int hIndex = 0; if (HPMHooks.count.HP_clif_guild_memberlist_pre > 0) { @@ -21254,11 +21384,11 @@ void HP_clif_notify_bounditem(struct map_session_data *sd, unsigned short index) } return; } -int HP_clif_delay_damage(int64 tick, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, unsigned char type) { +int HP_clif_delay_damage(int64 tick, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, enum battle_dmg_type type) { int hIndex = 0; int retVal___ = 0; if (HPMHooks.count.HP_clif_delay_damage_pre > 0) { - int (*preHookFunc) (int64 *tick, struct block_list **src, struct block_list **dst, int *sdelay, int *ddelay, int64 *in_damage, short *div, unsigned char *type); + int (*preHookFunc) (int64 *tick, struct block_list **src, struct block_list **dst, int *sdelay, int *ddelay, int64 *in_damage, short *div, enum battle_dmg_type *type); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_delay_damage_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_delay_damage_pre[hIndex].func; @@ -21273,7 +21403,7 @@ int HP_clif_delay_damage(int64 tick, struct block_list *src, struct block_list * retVal___ = HPMHooks.source.clif.delay_damage(tick, src, dst, sdelay, ddelay, in_damage, div, type); } if (HPMHooks.count.HP_clif_delay_damage_post > 0) { - int (*postHookFunc) (int retVal___, int64 tick, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, unsigned char type); + int (*postHookFunc) (int retVal___, int64 tick, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, enum battle_dmg_type type); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_delay_damage_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_delay_damage_post[hIndex].func; retVal___ = postHookFunc(retVal___, tick, src, dst, sdelay, ddelay, in_damage, div, type); @@ -21334,10 +21464,10 @@ void HP_clif_npc_market_open(struct map_session_data *sd, struct npc_data *nd) { } return; } -void HP_clif_npc_market_purchase_ack(struct map_session_data *sd, const struct itemlist *item_list, unsigned char response) { +void HP_clif_npc_market_purchase_ack(struct map_session_data *sd, const struct itemlist *item_list, enum market_buy_result response) { int hIndex = 0; if (HPMHooks.count.HP_clif_npc_market_purchase_ack_pre > 0) { - void (*preHookFunc) (struct map_session_data **sd, const struct itemlist **item_list, unsigned char *response); + void (*preHookFunc) (struct map_session_data **sd, const struct itemlist **item_list, enum market_buy_result *response); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_market_purchase_ack_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_npc_market_purchase_ack_pre[hIndex].func; @@ -21352,7 +21482,7 @@ void HP_clif_npc_market_purchase_ack(struct map_session_data *sd, const struct i HPMHooks.source.clif.npc_market_purchase_ack(sd, item_list, response); } if (HPMHooks.count.HP_clif_npc_market_purchase_ack_post > 0) { - void (*postHookFunc) (struct map_session_data *sd, const struct itemlist *item_list, unsigned char response); + void (*postHookFunc) (struct map_session_data *sd, const struct itemlist *item_list, enum market_buy_result response); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_market_purchase_ack_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_npc_market_purchase_ack_post[hIndex].func; postHookFunc(sd, item_list, response); @@ -30115,6 +30245,190 @@ void HP_clif_announce_refine_status(struct map_session_data *sd, int item_id, in } return; } +void HP_clif_pGuildCastleTeleportRequest(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pGuildCastleTeleportRequest_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildCastleTeleportRequest_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pGuildCastleTeleportRequest_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pGuildCastleTeleportRequest(fd, sd); + } + if (HPMHooks.count.HP_clif_pGuildCastleTeleportRequest_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildCastleTeleportRequest_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pGuildCastleTeleportRequest_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} +void HP_clif_pGuildCastleInfoRequest(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pGuildCastleInfoRequest_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildCastleInfoRequest_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pGuildCastleInfoRequest_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pGuildCastleInfoRequest(fd, sd); + } + if (HPMHooks.count.HP_clif_pGuildCastleInfoRequest_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildCastleInfoRequest_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pGuildCastleInfoRequest_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} +void HP_clif_guild_castleteleport_res(struct map_session_data *sd, enum siege_teleport_result result) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_guild_castleteleport_res_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, enum siege_teleport_result *result); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_castleteleport_res_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_guild_castleteleport_res_pre[hIndex].func; + preHookFunc(&sd, &result); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.guild_castleteleport_res(sd, result); + } + if (HPMHooks.count.HP_clif_guild_castleteleport_res_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, enum siege_teleport_result result); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_castleteleport_res_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_guild_castleteleport_res_post[hIndex].func; + postHookFunc(sd, result); + } + } + return; +} +bool HP_clif_lapineDdukDdak_open(struct map_session_data *sd, int item_id) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_clif_lapineDdukDdak_open_pre > 0) { + bool (*preHookFunc) (struct map_session_data **sd, int *item_id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_lapineDdukDdak_open_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_lapineDdukDdak_open_pre[hIndex].func; + retVal___ = preHookFunc(&sd, &item_id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clif.lapineDdukDdak_open(sd, item_id); + } + if (HPMHooks.count.HP_clif_lapineDdukDdak_open_post > 0) { + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int item_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_lapineDdukDdak_open_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_lapineDdukDdak_open_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, item_id); + } + } + return retVal___; +} +bool HP_clif_lapineDdukDdak_result(struct map_session_data *sd, enum lapineddukddak_result result) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_clif_lapineDdukDdak_result_pre > 0) { + bool (*preHookFunc) (struct map_session_data **sd, enum lapineddukddak_result *result); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_lapineDdukDdak_result_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_lapineDdukDdak_result_pre[hIndex].func; + retVal___ = preHookFunc(&sd, &result); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clif.lapineDdukDdak_result(sd, result); + } + if (HPMHooks.count.HP_clif_lapineDdukDdak_result_post > 0) { + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, enum lapineddukddak_result result); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_lapineDdukDdak_result_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_lapineDdukDdak_result_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, result); + } + } + return retVal___; +} +void HP_clif_plapineDdukDdak_ack(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_plapineDdukDdak_ack_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_plapineDdukDdak_ack_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_plapineDdukDdak_ack_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.plapineDdukDdak_ack(fd, sd); + } + if (HPMHooks.count.HP_clif_plapineDdukDdak_ack_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_plapineDdukDdak_ack_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_plapineDdukDdak_ack_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} +void HP_clif_plapineDdukDdak_close(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_plapineDdukDdak_close_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_plapineDdukDdak_close_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_plapineDdukDdak_close_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.plapineDdukDdak_close(fd, sd); + } + if (HPMHooks.count.HP_clif_plapineDdukDdak_close_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_plapineDdukDdak_close_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_plapineDdukDdak_close_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} /* cmdline_interface */ void HP_cmdline_init(void) { int hIndex = 0; @@ -33589,33 +33903,6 @@ int HP_guild_send_message(struct map_session_data *sd, const char *mes) { } return retVal___; } -int HP_guild_recv_message(int guild_id, int account_id, const char *mes, int len) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_guild_recv_message_pre > 0) { - int (*preHookFunc) (int *guild_id, int *account_id, const char **mes, int *len); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_guild_recv_message_pre[hIndex].func; - retVal___ = preHookFunc(&guild_id, &account_id, &mes, &len); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.guild.recv_message(guild_id, account_id, mes, len); - } - if (HPMHooks.count.HP_guild_recv_message_post > 0) { - int (*postHookFunc) (int retVal___, int guild_id, int account_id, const char *mes, int len); - for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_guild_recv_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, guild_id, account_id, mes, len); - } - } - return retVal___; -} int HP_guild_send_dot_remove(struct map_session_data *sd) { int hIndex = 0; int retVal___ = 0; @@ -34199,15 +34486,15 @@ bool HP_guild_read_guildskill_tree_db(char *split[], int columns, int current) { } return retVal___; } -bool HP_guild_read_castledb(char *str[], int columns, int current) { +bool HP_guild_read_castledb_libconfig(void) { int hIndex = 0; bool retVal___ = false; - if (HPMHooks.count.HP_guild_read_castledb_pre > 0) { - bool (*preHookFunc) (char **str[], int *columns, int *current); + if (HPMHooks.count.HP_guild_read_castledb_libconfig_pre > 0) { + bool (*preHookFunc) (void); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_guild_read_castledb_pre[hIndex].func; - retVal___ = preHookFunc(&str, &columns, ¤t); + for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_libconfig_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_guild_read_castledb_libconfig_pre[hIndex].func; + retVal___ = preHookFunc(); } if (*HPMforce_return) { *HPMforce_return = false; @@ -34215,13 +34502,67 @@ bool HP_guild_read_castledb(char *str[], int columns, int current) { } } { - retVal___ = HPMHooks.source.guild.read_castledb(str, columns, current); + retVal___ = HPMHooks.source.guild.read_castledb_libconfig(); } - if (HPMHooks.count.HP_guild_read_castledb_post > 0) { - bool (*postHookFunc) (bool retVal___, char *str[], int columns, int current); - for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_guild_read_castledb_post[hIndex].func; - retVal___ = postHookFunc(retVal___, str, columns, current); + if (HPMHooks.count.HP_guild_read_castledb_libconfig_post > 0) { + bool (*postHookFunc) (bool retVal___); + for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_libconfig_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_guild_read_castledb_libconfig_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +bool HP_guild_read_castledb_libconfig_sub(struct config_setting_t *it, int idx, const char *source) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_guild_read_castledb_libconfig_sub_pre > 0) { + bool (*preHookFunc) (struct config_setting_t **it, int *idx, const char **source); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_libconfig_sub_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_guild_read_castledb_libconfig_sub_pre[hIndex].func; + retVal___ = preHookFunc(&it, &idx, &source); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.guild.read_castledb_libconfig_sub(it, idx, source); + } + if (HPMHooks.count.HP_guild_read_castledb_libconfig_sub_post > 0) { + bool (*postHookFunc) (bool retVal___, struct config_setting_t *it, int idx, const char *source); + for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_libconfig_sub_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_guild_read_castledb_libconfig_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, it, idx, source); + } + } + return retVal___; +} +bool HP_guild_read_castledb_libconfig_sub_warp(struct config_setting_t *wd, const char *source, struct guild_castle *gc) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_guild_read_castledb_libconfig_sub_warp_pre > 0) { + bool (*preHookFunc) (struct config_setting_t **wd, const char **source, struct guild_castle **gc); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_libconfig_sub_warp_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_guild_read_castledb_libconfig_sub_warp_pre[hIndex].func; + retVal___ = preHookFunc(&wd, &source, &gc); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.guild.read_castledb_libconfig_sub_warp(wd, source, gc); + } + if (HPMHooks.count.HP_guild_read_castledb_libconfig_sub_warp_post > 0) { + bool (*postHookFunc) (bool retVal___, struct config_setting_t *wd, const char *source, struct guild_castle *gc); + for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_libconfig_sub_warp_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_guild_read_castledb_libconfig_sub_warp_post[hIndex].func; + retVal___ = postHookFunc(retVal___, wd, source, gc); } } return retVal___; @@ -35278,15 +35619,15 @@ int HP_homun_dead(struct homun_data *hd) { } return retVal___; } -int HP_homun_vaporize(struct map_session_data *sd, enum homun_state flag) { +int HP_homun_vaporize(struct map_session_data *sd, enum homun_state state, bool force) { int hIndex = 0; int retVal___ = 0; if (HPMHooks.count.HP_homun_vaporize_pre > 0) { - int (*preHookFunc) (struct map_session_data **sd, enum homun_state *flag); + int (*preHookFunc) (struct map_session_data **sd, enum homun_state *state, bool *force); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_vaporize_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_homun_vaporize_pre[hIndex].func; - retVal___ = preHookFunc(&sd, &flag); + retVal___ = preHookFunc(&sd, &state, &force); } if (*HPMforce_return) { *HPMforce_return = false; @@ -35294,13 +35635,13 @@ int HP_homun_vaporize(struct map_session_data *sd, enum homun_state flag) { } } { - retVal___ = HPMHooks.source.homun.vaporize(sd, flag); + retVal___ = HPMHooks.source.homun.vaporize(sd, state, force); } if (HPMHooks.count.HP_homun_vaporize_post > 0) { - int (*postHookFunc) (int retVal___, struct map_session_data *sd, enum homun_state flag); + int (*postHookFunc) (int retVal___, struct map_session_data *sd, enum homun_state state, bool force); for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_vaporize_post; hIndex++) { postHookFunc = HPMHooks.list.HP_homun_vaporize_post[hIndex].func; - retVal___ = postHookFunc(retVal___, sd, flag); + retVal___ = postHookFunc(retVal___, sd, state, force); } } return retVal___; @@ -35574,6 +35915,33 @@ int HP_homun_gainexp(struct homun_data *hd, unsigned int exp) { } return retVal___; } +int HP_homun_gainexp_real(struct homun_data *hd, unsigned int exp) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_homun_gainexp_real_pre > 0) { + int (*preHookFunc) (struct homun_data **hd, unsigned int *exp); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_gainexp_real_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_homun_gainexp_real_pre[hIndex].func; + retVal___ = preHookFunc(&hd, &exp); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.homun.gainexp_real(hd, exp); + } + if (HPMHooks.count.HP_homun_gainexp_real_post > 0) { + int (*postHookFunc) (int retVal___, struct homun_data *hd, unsigned int exp); + for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_gainexp_real_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_homun_gainexp_real_post[hIndex].func; + retVal___ = postHookFunc(retVal___, hd, exp); + } + } + return retVal___; +} unsigned int HP_homun_add_intimacy(struct homun_data *hd, unsigned int value) { int hIndex = 0; unsigned int retVal___ = 0; @@ -35868,15 +36236,15 @@ int HP_homun_db_search(int key, int type) { } return retVal___; } -bool HP_homun_create(struct map_session_data *sd, const struct s_homunculus *hom) { +bool HP_homun_create(struct map_session_data *sd, const struct s_homunculus *hom, bool is_new) { int hIndex = 0; bool retVal___ = false; if (HPMHooks.count.HP_homun_create_pre > 0) { - bool (*preHookFunc) (struct map_session_data **sd, const struct s_homunculus **hom); + bool (*preHookFunc) (struct map_session_data **sd, const struct s_homunculus **hom, bool *is_new); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_create_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_homun_create_pre[hIndex].func; - retVal___ = preHookFunc(&sd, &hom); + retVal___ = preHookFunc(&sd, &hom, &is_new); } if (*HPMforce_return) { *HPMforce_return = false; @@ -35884,13 +36252,13 @@ bool HP_homun_create(struct map_session_data *sd, const struct s_homunculus *hom } } { - retVal___ = HPMHooks.source.homun.create(sd, hom); + retVal___ = HPMHooks.source.homun.create(sd, hom, is_new); } if (HPMHooks.count.HP_homun_create_post > 0) { - bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const struct s_homunculus *hom); + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const struct s_homunculus *hom, bool is_new); for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_create_post; hIndex++) { postHookFunc = HPMHooks.list.HP_homun_create_post[hIndex].func; - retVal___ = postHookFunc(retVal___, sd, hom); + retVal___ = postHookFunc(retVal___, sd, hom, is_new); } } return retVal___; @@ -36890,141 +37258,6 @@ int HP_intif_create_pet(int account_id, int char_id, int pet_type, int pet_lv, i } return retVal___; } -int HP_intif_broadcast(const char *mes, int len, int type) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_intif_broadcast_pre > 0) { - int (*preHookFunc) (const char **mes, int *len, int *type); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_broadcast_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_broadcast_pre[hIndex].func; - retVal___ = preHookFunc(&mes, &len, &type); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.intif.broadcast(mes, len, type); - } - if (HPMHooks.count.HP_intif_broadcast_post > 0) { - int (*postHookFunc) (int retVal___, const char *mes, int len, int type); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_broadcast_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_broadcast_post[hIndex].func; - retVal___ = postHookFunc(retVal___, mes, len, type); - } - } - return retVal___; -} -int HP_intif_broadcast2(const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_intif_broadcast2_pre > 0) { - int (*preHookFunc) (const char **mes, int *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_broadcast2_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_broadcast2_pre[hIndex].func; - retVal___ = preHookFunc(&mes, &len, &fontColor, &fontType, &fontSize, &fontAlign, &fontY); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.intif.broadcast2(mes, len, fontColor, fontType, fontSize, fontAlign, fontY); - } - if (HPMHooks.count.HP_intif_broadcast2_post > 0) { - int (*postHookFunc) (int retVal___, const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_broadcast2_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_broadcast2_post[hIndex].func; - retVal___ = postHookFunc(retVal___, mes, len, fontColor, fontType, fontSize, fontAlign, fontY); - } - } - return retVal___; -} -int HP_intif_main_message(struct map_session_data *sd, const char *message) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_intif_main_message_pre > 0) { - int (*preHookFunc) (struct map_session_data **sd, const char **message); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_main_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_main_message_pre[hIndex].func; - retVal___ = preHookFunc(&sd, &message); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.intif.main_message(sd, message); - } - if (HPMHooks.count.HP_intif_main_message_post > 0) { - int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *message); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_main_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_main_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, sd, message); - } - } - return retVal___; -} -int HP_intif_wis_message(struct map_session_data *sd, const char *nick, const char *mes, int mes_len) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_intif_wis_message_pre > 0) { - int (*preHookFunc) (struct map_session_data **sd, const char **nick, const char **mes, int *mes_len); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_wis_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_wis_message_pre[hIndex].func; - retVal___ = preHookFunc(&sd, &nick, &mes, &mes_len); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.intif.wis_message(sd, nick, mes, mes_len); - } - if (HPMHooks.count.HP_intif_wis_message_post > 0) { - int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *nick, const char *mes, int mes_len); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_wis_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_wis_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, sd, nick, mes, mes_len); - } - } - return retVal___; -} -int HP_intif_wis_message_to_gm(char *Wisp_name, int permission, char *mes) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_intif_wis_message_to_gm_pre > 0) { - int (*preHookFunc) (char **Wisp_name, int *permission, char **mes); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_wis_message_to_gm_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_wis_message_to_gm_pre[hIndex].func; - retVal___ = preHookFunc(&Wisp_name, &permission, &mes); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.intif.wis_message_to_gm(Wisp_name, permission, mes); - } - if (HPMHooks.count.HP_intif_wis_message_to_gm_post > 0) { - int (*postHookFunc) (int retVal___, char *Wisp_name, int permission, char *mes); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_wis_message_to_gm_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_wis_message_to_gm_post[hIndex].func; - retVal___ = postHookFunc(retVal___, Wisp_name, permission, mes); - } - } - return retVal___; -} int HP_intif_saveregistry(struct map_session_data *sd) { int hIndex = 0; int retVal___ = 0; @@ -37374,33 +37607,6 @@ int HP_intif_break_party(int party_id) { } return retVal___; } -int HP_intif_party_message(int party_id, int account_id, const char *mes, int len) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_intif_party_message_pre > 0) { - int (*preHookFunc) (int *party_id, int *account_id, const char **mes, int *len); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_party_message_pre[hIndex].func; - retVal___ = preHookFunc(&party_id, &account_id, &mes, &len); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.intif.party_message(party_id, account_id, mes, len); - } - if (HPMHooks.count.HP_intif_party_message_post > 0) { - int (*postHookFunc) (int retVal___, int party_id, int account_id, const char *mes, int len); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_party_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, party_id, account_id, mes, len); - } - } - return retVal___; -} int HP_intif_party_leaderchange(int party_id, int account_id, int char_id) { int hIndex = 0; int retVal___ = 0; @@ -37590,33 +37796,6 @@ int HP_intif_guild_break(int guild_id) { } return retVal___; } -int HP_intif_guild_message(int guild_id, int account_id, const char *mes, int len) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_intif_guild_message_pre > 0) { - int (*preHookFunc) (int *guild_id, int *account_id, const char **mes, int *len); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_guild_message_pre[hIndex].func; - retVal___ = preHookFunc(&guild_id, &account_id, &mes, &len); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.intif.guild_message(guild_id, account_id, mes, len); - } - if (HPMHooks.count.HP_intif_guild_message_post > 0) { - int (*postHookFunc) (int retVal___, int guild_id, int account_id, const char *mes, int len); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_guild_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, guild_id, account_id, mes, len); - } - } - return retVal___; -} int HP_intif_guild_change_gm(int guild_id, const char *name, int len) { int hIndex = 0; int retVal___ = 0; @@ -39041,117 +39220,6 @@ void HP_intif_achievements_save(struct map_session_data *sd) { } return; } -void HP_intif_pWisMessage(int fd) { - int hIndex = 0; - if (HPMHooks.count.HP_intif_pWisMessage_pre > 0) { - void (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisMessage_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_pWisMessage_pre[hIndex].func; - preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.intif.pWisMessage(fd); - } - if (HPMHooks.count.HP_intif_pWisMessage_post > 0) { - void (*postHookFunc) (int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisMessage_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_pWisMessage_post[hIndex].func; - postHookFunc(fd); - } - } - return; -} -void HP_intif_pWisEnd(int fd) { - int hIndex = 0; - if (HPMHooks.count.HP_intif_pWisEnd_pre > 0) { - void (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisEnd_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_pWisEnd_pre[hIndex].func; - preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.intif.pWisEnd(fd); - } - if (HPMHooks.count.HP_intif_pWisEnd_post > 0) { - void (*postHookFunc) (int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisEnd_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_pWisEnd_post[hIndex].func; - postHookFunc(fd); - } - } - return; -} -int HP_intif_pWisToGM_sub(struct map_session_data *sd, va_list va) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_intif_pWisToGM_sub_pre > 0) { - int (*preHookFunc) (struct map_session_data **sd, va_list va); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisToGM_sub_pre; hIndex++) { - va_list va___copy; va_copy(va___copy, va); - preHookFunc = HPMHooks.list.HP_intif_pWisToGM_sub_pre[hIndex].func; - retVal___ = preHookFunc(&sd, va___copy); - va_end(va___copy); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - va_list va___copy; va_copy(va___copy, va); - retVal___ = HPMHooks.source.intif.pWisToGM_sub(sd, va___copy); - va_end(va___copy); - } - if (HPMHooks.count.HP_intif_pWisToGM_sub_post > 0) { - int (*postHookFunc) (int retVal___, struct map_session_data *sd, va_list va); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisToGM_sub_post; hIndex++) { - va_list va___copy; va_copy(va___copy, va); - postHookFunc = HPMHooks.list.HP_intif_pWisToGM_sub_post[hIndex].func; - retVal___ = postHookFunc(retVal___, sd, va___copy); - va_end(va___copy); - } - } - return retVal___; -} -void HP_intif_pWisToGM(int fd) { - int hIndex = 0; - if (HPMHooks.count.HP_intif_pWisToGM_pre > 0) { - void (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisToGM_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_pWisToGM_pre[hIndex].func; - preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.intif.pWisToGM(fd); - } - if (HPMHooks.count.HP_intif_pWisToGM_post > 0) { - void (*postHookFunc) (int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisToGM_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_pWisToGM_post[hIndex].func; - postHookFunc(fd); - } - } - return; -} void HP_intif_pRegisters(int fd) { int hIndex = 0; if (HPMHooks.count.HP_intif_pRegisters_pre > 0) { @@ -39516,32 +39584,6 @@ void HP_intif_pPartyBroken(int fd) { } return; } -void HP_intif_pPartyMessage(int fd) { - int hIndex = 0; - if (HPMHooks.count.HP_intif_pPartyMessage_pre > 0) { - void (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMessage_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_pPartyMessage_pre[hIndex].func; - preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.intif.pPartyMessage(fd); - } - if (HPMHooks.count.HP_intif_pPartyMessage_post > 0) { - void (*postHookFunc) (int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMessage_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_pPartyMessage_post[hIndex].func; - postHookFunc(fd); - } - } - return; -} void HP_intif_pGuildCreated(int fd) { int hIndex = 0; if (HPMHooks.count.HP_intif_pGuildCreated_pre > 0) { @@ -39698,32 +39740,6 @@ void HP_intif_pGuildBroken(int fd) { } return; } -void HP_intif_pGuildMessage(int fd) { - int hIndex = 0; - if (HPMHooks.count.HP_intif_pGuildMessage_pre > 0) { - void (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMessage_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_pGuildMessage_pre[hIndex].func; - preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.intif.pGuildMessage(fd); - } - if (HPMHooks.count.HP_intif_pGuildMessage_post > 0) { - void (*postHookFunc) (int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMessage_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_pGuildMessage_post[hIndex].func; - postHookFunc(fd); - } - } - return; -} void HP_intif_pGuildBasicInfoChanged(int fd) { int hIndex = 0; if (HPMHooks.count.HP_intif_pGuildBasicInfoChanged_pre > 0) { @@ -41685,11 +41701,11 @@ struct item_data* HP_itemdb_search_name(const char *name) { } return retVal___; } -int HP_itemdb_search_name_array(struct item_data **data, int size, const char *str, int flag) { +int HP_itemdb_search_name_array(struct item_data **data, const int size, const char *str, enum item_name_search_flag flag) { int hIndex = 0; int retVal___ = 0; if (HPMHooks.count.HP_itemdb_search_name_array_pre > 0) { - int (*preHookFunc) (struct item_data ***data, int *size, const char **str, int *flag); + int (*preHookFunc) (struct item_data ***data, const int *size, const char **str, enum item_name_search_flag *flag); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_name_array_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_itemdb_search_name_array_pre[hIndex].func; @@ -41704,7 +41720,7 @@ int HP_itemdb_search_name_array(struct item_data **data, int size, const char *s retVal___ = HPMHooks.source.itemdb.search_name_array(data, size, str, flag); } if (HPMHooks.count.HP_itemdb_search_name_array_post > 0) { - int (*postHookFunc) (int retVal___, struct item_data **data, int size, const char *str, int flag); + int (*postHookFunc) (int retVal___, struct item_data **data, const int size, const char *str, enum item_name_search_flag flag); for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_name_array_post; hIndex++) { postHookFunc = HPMHooks.list.HP_itemdb_search_name_array_post[hIndex].func; retVal___ = postHookFunc(retVal___, data, size, str, flag); @@ -42584,15 +42600,15 @@ int HP_itemdb_isidentified2(struct item_data *data) { } return retVal___; } -int HP_itemdb_combo_split_atoi(char *str, int *val) { +bool HP_itemdb_read_combodb_libconfig(void) { int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_itemdb_combo_split_atoi_pre > 0) { - int (*preHookFunc) (char **str, int **val); + bool retVal___ = false; + if (HPMHooks.count.HP_itemdb_read_combodb_libconfig_pre > 0) { + bool (*preHookFunc) (void); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_combo_split_atoi_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_itemdb_combo_split_atoi_pre[hIndex].func; - retVal___ = preHookFunc(&str, &val); + for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_combodb_libconfig_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_itemdb_read_combodb_libconfig_pre[hIndex].func; + retVal___ = preHookFunc(); } if (*HPMforce_return) { *HPMforce_return = false; @@ -42600,42 +42616,43 @@ int HP_itemdb_combo_split_atoi(char *str, int *val) { } } { - retVal___ = HPMHooks.source.itemdb.combo_split_atoi(str, val); + retVal___ = HPMHooks.source.itemdb.read_combodb_libconfig(); } - if (HPMHooks.count.HP_itemdb_combo_split_atoi_post > 0) { - int (*postHookFunc) (int retVal___, char *str, int *val); - for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_combo_split_atoi_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_itemdb_combo_split_atoi_post[hIndex].func; - retVal___ = postHookFunc(retVal___, str, val); + if (HPMHooks.count.HP_itemdb_read_combodb_libconfig_post > 0) { + bool (*postHookFunc) (bool retVal___); + for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_combodb_libconfig_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_itemdb_read_combodb_libconfig_post[hIndex].func; + retVal___ = postHookFunc(retVal___); } } return retVal___; } -void HP_itemdb_read_combos(void) { +bool HP_itemdb_read_combodb_libconfig_sub(struct config_setting_t *it, int idx, const char *source) { int hIndex = 0; - if (HPMHooks.count.HP_itemdb_read_combos_pre > 0) { - void (*preHookFunc) (void); + bool retVal___ = false; + if (HPMHooks.count.HP_itemdb_read_combodb_libconfig_sub_pre > 0) { + bool (*preHookFunc) (struct config_setting_t **it, int *idx, const char **source); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_combos_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_itemdb_read_combos_pre[hIndex].func; - preHookFunc(); + for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_combodb_libconfig_sub_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_itemdb_read_combodb_libconfig_sub_pre[hIndex].func; + retVal___ = preHookFunc(&it, &idx, &source); } if (*HPMforce_return) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.itemdb.read_combos(); + retVal___ = HPMHooks.source.itemdb.read_combodb_libconfig_sub(it, idx, source); } - if (HPMHooks.count.HP_itemdb_read_combos_post > 0) { - void (*postHookFunc) (void); - for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_combos_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_itemdb_read_combos_post[hIndex].func; - postHookFunc(); + if (HPMHooks.count.HP_itemdb_read_combodb_libconfig_sub_post > 0) { + bool (*postHookFunc) (bool retVal___, struct config_setting_t *it, int idx, const char *source); + for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_combodb_libconfig_sub_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_itemdb_read_combodb_libconfig_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, it, idx, source); } } - return; + return retVal___; } int HP_itemdb_gendercheck(struct item_data *id) { int hIndex = 0; @@ -43135,6 +43152,87 @@ int HP_itemdb_addname_sub(union DBKey key, struct DBData *data, va_list ap) { } return retVal___; } +bool HP_itemdb_read_libconfig_lapineddukddak(void) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_itemdb_read_libconfig_lapineddukddak_pre > 0) { + bool (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_libconfig_lapineddukddak_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_itemdb_read_libconfig_lapineddukddak_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.itemdb.read_libconfig_lapineddukddak(); + } + if (HPMHooks.count.HP_itemdb_read_libconfig_lapineddukddak_post > 0) { + bool (*postHookFunc) (bool retVal___); + for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_libconfig_lapineddukddak_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_itemdb_read_libconfig_lapineddukddak_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +bool HP_itemdb_read_libconfig_lapineddukddak_sub(struct config_setting_t *it, const char *source) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_itemdb_read_libconfig_lapineddukddak_sub_pre > 0) { + bool (*preHookFunc) (struct config_setting_t **it, const char **source); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_libconfig_lapineddukddak_sub_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_itemdb_read_libconfig_lapineddukddak_sub_pre[hIndex].func; + retVal___ = preHookFunc(&it, &source); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.itemdb.read_libconfig_lapineddukddak_sub(it, source); + } + if (HPMHooks.count.HP_itemdb_read_libconfig_lapineddukddak_sub_post > 0) { + bool (*postHookFunc) (bool retVal___, struct config_setting_t *it, const char *source); + for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_libconfig_lapineddukddak_sub_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_itemdb_read_libconfig_lapineddukddak_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, it, source); + } + } + return retVal___; +} +bool HP_itemdb_read_libconfig_lapineddukddak_sub_sources(struct config_setting_t *sources, struct item_data *data) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_itemdb_read_libconfig_lapineddukddak_sub_sources_pre > 0) { + bool (*preHookFunc) (struct config_setting_t **sources, struct item_data **data); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_libconfig_lapineddukddak_sub_sources_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_itemdb_read_libconfig_lapineddukddak_sub_sources_pre[hIndex].func; + retVal___ = preHookFunc(&sources, &data); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.itemdb.read_libconfig_lapineddukddak_sub_sources(sources, data); + } + if (HPMHooks.count.HP_itemdb_read_libconfig_lapineddukddak_sub_sources_post > 0) { + bool (*postHookFunc) (bool retVal___, struct config_setting_t *sources, struct item_data *data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_libconfig_lapineddukddak_sub_sources_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_itemdb_read_libconfig_lapineddukddak_sub_sources_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sources, data); + } + } + return retVal___; +} /* libconfig_interface */ int HP_libconfig_read(struct config_t *config, FILE *stream) { int hIndex = 0; @@ -47740,15 +47838,15 @@ void HP_map_deliddb(struct block_list *bl) { } return; } -struct map_session_data* HP_map_nick2sd(const char *nick) { +struct map_session_data* HP_map_nick2sd(const char *nick, bool allow_partial) { int hIndex = 0; struct map_session_data* retVal___ = NULL; if (HPMHooks.count.HP_map_nick2sd_pre > 0) { - struct map_session_data* (*preHookFunc) (const char **nick); + struct map_session_data* (*preHookFunc) (const char **nick, bool *allow_partial); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_nick2sd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_nick2sd_pre[hIndex].func; - retVal___ = preHookFunc(&nick); + retVal___ = preHookFunc(&nick, &allow_partial); } if (*HPMforce_return) { *HPMforce_return = false; @@ -47756,13 +47854,13 @@ struct map_session_data* HP_map_nick2sd(const char *nick) { } } { - retVal___ = HPMHooks.source.map.nick2sd(nick); + retVal___ = HPMHooks.source.map.nick2sd(nick, allow_partial); } if (HPMHooks.count.HP_map_nick2sd_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, const char *nick); + struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, const char *nick, bool allow_partial); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_nick2sd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_nick2sd_post[hIndex].func; - retVal___ = postHookFunc(retVal___, nick); + retVal___ = postHookFunc(retVal___, nick, allow_partial); } } return retVal___; @@ -51154,6 +51252,39 @@ void HP_mob_reload(void) { } return; } +int HP_mob_reload_sub_mob(struct mob_data *md, va_list args) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_mob_reload_sub_mob_pre > 0) { + int (*preHookFunc) (struct mob_data **md, va_list args); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_reload_sub_mob_pre; hIndex++) { + va_list args___copy; va_copy(args___copy, args); + preHookFunc = HPMHooks.list.HP_mob_reload_sub_mob_pre[hIndex].func; + retVal___ = preHookFunc(&md, args___copy); + va_end(args___copy); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + va_list args___copy; va_copy(args___copy, args); + retVal___ = HPMHooks.source.mob.reload_sub_mob(md, args___copy); + va_end(args___copy); + } + if (HPMHooks.count.HP_mob_reload_sub_mob_post > 0) { + int (*postHookFunc) (int retVal___, struct mob_data *md, va_list args); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_reload_sub_mob_post; hIndex++) { + va_list args___copy; va_copy(args___copy, args); + postHookFunc = HPMHooks.list.HP_mob_reload_sub_mob_post[hIndex].func; + retVal___ = postHookFunc(retVal___, md, args___copy); + va_end(args___copy); + } + } + return retVal___; +} struct mob_db* HP_mob_db(int index) { int hIndex = 0; struct mob_db* retVal___ = NULL; @@ -57609,11 +57740,12 @@ void HP_npc_trader_update(int master) { } return; } -int HP_npc_market_buylist(struct map_session_data *sd, struct itemlist *item_list) { +enum market_buy_result HP_npc_market_buylist(struct map_session_data *sd, struct itemlist *item_list) { +/* Unknown return type 'enum market_buy_result'. Initializing to '0'. */ int hIndex = 0; - int retVal___ = 0; + enum market_buy_result retVal___ = 0; if (HPMHooks.count.HP_npc_market_buylist_pre > 0) { - int (*preHookFunc) (struct map_session_data **sd, struct itemlist **item_list); + enum market_buy_result (*preHookFunc) (struct map_session_data **sd, struct itemlist **item_list); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_buylist_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_market_buylist_pre[hIndex].func; @@ -57628,7 +57760,7 @@ int HP_npc_market_buylist(struct map_session_data *sd, struct itemlist *item_lis retVal___ = HPMHooks.source.npc.market_buylist(sd, item_list); } if (HPMHooks.count.HP_npc_market_buylist_post > 0) { - int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct itemlist *item_list); + enum market_buy_result (*postHookFunc) (enum market_buy_result retVal___, struct map_session_data *sd, struct itemlist *item_list); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_buylist_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_market_buylist_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd, item_list); @@ -58859,33 +58991,6 @@ int HP_party_send_message(struct map_session_data *sd, const char *mes) { } return retVal___; } -int HP_party_recv_message(int party_id, int account_id, const char *mes, int len) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_party_recv_message_pre > 0) { - int (*preHookFunc) (int *party_id, int *account_id, const char **mes, int *len); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_party_recv_message_pre[hIndex].func; - retVal___ = preHookFunc(&party_id, &account_id, &mes, &len); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.party.recv_message(party_id, account_id, mes, len); - } - if (HPMHooks.count.HP_party_recv_message_post > 0) { - int (*postHookFunc) (int retVal___, int party_id, int account_id, const char *mes, int len); - for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_party_recv_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, party_id, account_id, mes, len); - } - } - return retVal___; -} int HP_party_skill_check(struct map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv) { int hIndex = 0; int retVal___ = 0; @@ -61380,11 +61485,11 @@ int HP_pc_updateweightstatus(struct map_session_data *sd) { } return retVal___; } -int HP_pc_addautobonus(struct s_autobonus *bonus, char max, const char *bonus_script, short rate, unsigned int dur, short atk_type, const char *o_script, unsigned short pos, bool onskill) { +int HP_pc_addautobonus(struct s_autobonus *bonus, char max, const char *bonus_script, short rate, unsigned int dur, short atk_type, const char *o_script, unsigned int pos, bool onskill) { int hIndex = 0; int retVal___ = 0; if (HPMHooks.count.HP_pc_addautobonus_pre > 0) { - int (*preHookFunc) (struct s_autobonus **bonus, char *max, const char **bonus_script, short *rate, unsigned int *dur, short *atk_type, const char **o_script, unsigned short *pos, bool *onskill); + int (*preHookFunc) (struct s_autobonus **bonus, char *max, const char **bonus_script, short *rate, unsigned int *dur, short *atk_type, const char **o_script, unsigned int *pos, bool *onskill); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_addautobonus_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_addautobonus_pre[hIndex].func; @@ -61399,7 +61504,7 @@ int HP_pc_addautobonus(struct s_autobonus *bonus, char max, const char *bonus_sc retVal___ = HPMHooks.source.pc.addautobonus(bonus, max, bonus_script, rate, dur, atk_type, o_script, pos, onskill); } if (HPMHooks.count.HP_pc_addautobonus_post > 0) { - int (*postHookFunc) (int retVal___, struct s_autobonus *bonus, char max, const char *bonus_script, short rate, unsigned int dur, short atk_type, const char *o_script, unsigned short pos, bool onskill); + int (*postHookFunc) (int retVal___, struct s_autobonus *bonus, char max, const char *bonus_script, short rate, unsigned int dur, short atk_type, const char *o_script, unsigned int pos, bool onskill); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_addautobonus_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_addautobonus_post[hIndex].func; retVal___ = postHookFunc(retVal___, bonus, max, bonus_script, rate, dur, atk_type, o_script, pos, onskill); @@ -66224,6 +66329,33 @@ int HP_pc_have_magnifier(struct map_session_data *sd) { } return retVal___; } +int HP_pc_have_item_chain(struct map_session_data *sd, unsigned short chain_id) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_pc_have_item_chain_pre > 0) { + int (*preHookFunc) (struct map_session_data **sd, unsigned short *chain_id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_have_item_chain_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_have_item_chain_pre[hIndex].func; + retVal___ = preHookFunc(&sd, &chain_id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pc.have_item_chain(sd, chain_id); + } + if (HPMHooks.count.HP_pc_have_item_chain_post > 0) { + int (*postHookFunc) (int retVal___, struct map_session_data *sd, unsigned short chain_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_have_item_chain_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_have_item_chain_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, chain_id); + } + } + return retVal___; +} bool HP_pc_process_chat_message(struct map_session_data *sd, const char *message) { int hIndex = 0; bool retVal___ = false; @@ -66251,6 +66383,66 @@ bool HP_pc_process_chat_message(struct map_session_data *sd, const char *message } return retVal___; } +int HP_pc_wis_message_to_gm(const char *sender_name, int permission, const char *message) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_pc_wis_message_to_gm_pre > 0) { + int (*preHookFunc) (const char **sender_name, int *permission, const char **message); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_wis_message_to_gm_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_wis_message_to_gm_pre[hIndex].func; + retVal___ = preHookFunc(&sender_name, &permission, &message); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pc.wis_message_to_gm(sender_name, permission, message); + } + if (HPMHooks.count.HP_pc_wis_message_to_gm_post > 0) { + int (*postHookFunc) (int retVal___, const char *sender_name, int permission, const char *message); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_wis_message_to_gm_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_wis_message_to_gm_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sender_name, permission, message); + } + } + return retVal___; +} +int HP_pc_wis_message_to_gm_sub(struct map_session_data *sd, va_list va) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_pc_wis_message_to_gm_sub_pre > 0) { + int (*preHookFunc) (struct map_session_data **sd, va_list va); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_wis_message_to_gm_sub_pre; hIndex++) { + va_list va___copy; va_copy(va___copy, va); + preHookFunc = HPMHooks.list.HP_pc_wis_message_to_gm_sub_pre[hIndex].func; + retVal___ = preHookFunc(&sd, va___copy); + va_end(va___copy); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + va_list va___copy; va_copy(va___copy, va); + retVal___ = HPMHooks.source.pc.wis_message_to_gm_sub(sd, va___copy); + va_end(va___copy); + } + if (HPMHooks.count.HP_pc_wis_message_to_gm_sub_post > 0) { + int (*postHookFunc) (int retVal___, struct map_session_data *sd, va_list va); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_wis_message_to_gm_sub_post; hIndex++) { + va_list va___copy; va_copy(va___copy, va); + postHookFunc = HPMHooks.list.HP_pc_wis_message_to_gm_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, va___copy); + va_end(va___copy); + } + } + return retVal___; +} void HP_pc_check_supernovice_call(struct map_session_data *sd, const char *message) { int hIndex = 0; if (HPMHooks.count.HP_pc_check_supernovice_call_pre > 0) { @@ -74695,6 +74887,84 @@ void HP_script_run_item_unequip_script(struct map_session_data *sd, struct item_ } return; } +void HP_script_run_item_rental_end_script(struct map_session_data *sd, struct item_data *data, int oid) { + int hIndex = 0; + if (HPMHooks.count.HP_script_run_item_rental_end_script_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, struct item_data **data, int *oid); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_rental_end_script_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_script_run_item_rental_end_script_pre[hIndex].func; + preHookFunc(&sd, &data, &oid); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.run_item_rental_end_script(sd, data, oid); + } + if (HPMHooks.count.HP_script_run_item_rental_end_script_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, struct item_data *data, int oid); + for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_rental_end_script_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_script_run_item_rental_end_script_post[hIndex].func; + postHookFunc(sd, data, oid); + } + } + return; +} +void HP_script_run_item_rental_start_script(struct map_session_data *sd, struct item_data *data, int oid) { + int hIndex = 0; + if (HPMHooks.count.HP_script_run_item_rental_start_script_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, struct item_data **data, int *oid); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_rental_start_script_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_script_run_item_rental_start_script_pre[hIndex].func; + preHookFunc(&sd, &data, &oid); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.run_item_rental_start_script(sd, data, oid); + } + if (HPMHooks.count.HP_script_run_item_rental_start_script_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, struct item_data *data, int oid); + for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_rental_start_script_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_script_run_item_rental_start_script_post[hIndex].func; + postHookFunc(sd, data, oid); + } + } + return; +} +void HP_script_run_item_lapineddukddak_script(struct map_session_data *sd, struct item_data *data, int oid) { + int hIndex = 0; + if (HPMHooks.count.HP_script_run_item_lapineddukddak_script_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, struct item_data **data, int *oid); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_lapineddukddak_script_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_script_run_item_lapineddukddak_script_pre[hIndex].func; + preHookFunc(&sd, &data, &oid); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.run_item_lapineddukddak_script(sd, data, oid); + } + if (HPMHooks.count.HP_script_run_item_lapineddukddak_script_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, struct item_data *data, int oid); + for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_lapineddukddak_script_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_script_run_item_lapineddukddak_script_post[hIndex].func; + postHookFunc(sd, data, oid); + } + } + return; +} /* searchstore_interface */ bool HP_searchstore_open(struct map_session_data *sd, unsigned int uses, unsigned short effect) { int hIndex = 0; @@ -86620,15 +86890,15 @@ bool HP_status_readdb_sizefix(char *fields[], int columns, int current) { } return retVal___; } -bool HP_status_readdb_scconfig(char *fields[], int columns, int current) { +bool HP_status_read_scdb_libconfig(void) { int hIndex = 0; bool retVal___ = false; - if (HPMHooks.count.HP_status_readdb_scconfig_pre > 0) { - bool (*preHookFunc) (char **fields[], int *columns, int *current); + if (HPMHooks.count.HP_status_read_scdb_libconfig_pre > 0) { + bool (*preHookFunc) (void); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_scconfig_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_status_readdb_scconfig_pre[hIndex].func; - retVal___ = preHookFunc(&fields, &columns, ¤t); + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_read_scdb_libconfig_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_status_read_scdb_libconfig_pre[hIndex].func; + retVal___ = preHookFunc(); } if (*HPMforce_return) { *HPMforce_return = false; @@ -86636,13 +86906,94 @@ bool HP_status_readdb_scconfig(char *fields[], int columns, int current) { } } { - retVal___ = HPMHooks.source.status.readdb_scconfig(fields, columns, current); + retVal___ = HPMHooks.source.status.read_scdb_libconfig(); } - if (HPMHooks.count.HP_status_readdb_scconfig_post > 0) { - bool (*postHookFunc) (bool retVal___, char *fields[], int columns, int current); - for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_scconfig_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_status_readdb_scconfig_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fields, columns, current); + if (HPMHooks.count.HP_status_read_scdb_libconfig_post > 0) { + bool (*postHookFunc) (bool retVal___); + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_read_scdb_libconfig_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_status_read_scdb_libconfig_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +bool HP_status_read_scdb_libconfig_sub(struct config_setting_t *it, int idx, const char *source) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_status_read_scdb_libconfig_sub_pre > 0) { + bool (*preHookFunc) (struct config_setting_t **it, int *idx, const char **source); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_read_scdb_libconfig_sub_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_status_read_scdb_libconfig_sub_pre[hIndex].func; + retVal___ = preHookFunc(&it, &idx, &source); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.status.read_scdb_libconfig_sub(it, idx, source); + } + if (HPMHooks.count.HP_status_read_scdb_libconfig_sub_post > 0) { + bool (*postHookFunc) (bool retVal___, struct config_setting_t *it, int idx, const char *source); + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_read_scdb_libconfig_sub_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_status_read_scdb_libconfig_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, it, idx, source); + } + } + return retVal___; +} +bool HP_status_read_scdb_libconfig_sub_flag(struct config_setting_t *it, int type, const char *source) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_status_read_scdb_libconfig_sub_flag_pre > 0) { + bool (*preHookFunc) (struct config_setting_t **it, int *type, const char **source); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_read_scdb_libconfig_sub_flag_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_status_read_scdb_libconfig_sub_flag_pre[hIndex].func; + retVal___ = preHookFunc(&it, &type, &source); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.status.read_scdb_libconfig_sub_flag(it, type, source); + } + if (HPMHooks.count.HP_status_read_scdb_libconfig_sub_flag_post > 0) { + bool (*postHookFunc) (bool retVal___, struct config_setting_t *it, int type, const char *source); + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_read_scdb_libconfig_sub_flag_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_status_read_scdb_libconfig_sub_flag_post[hIndex].func; + retVal___ = postHookFunc(retVal___, it, type, source); + } + } + return retVal___; +} +bool HP_status_read_scdb_libconfig_sub_flag_additional(struct config_setting_t *it, int type, const char *source) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_status_read_scdb_libconfig_sub_flag_additional_pre > 0) { + bool (*preHookFunc) (struct config_setting_t **it, int *type, const char **source); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_read_scdb_libconfig_sub_flag_additional_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_status_read_scdb_libconfig_sub_flag_additional_pre[hIndex].func; + retVal___ = preHookFunc(&it, &type, &source); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.status.read_scdb_libconfig_sub_flag_additional(it, type, source); + } + if (HPMHooks.count.HP_status_read_scdb_libconfig_sub_flag_additional_post > 0) { + bool (*postHookFunc) (bool retVal___, struct config_setting_t *it, int type, const char *source); + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_read_scdb_libconfig_sub_flag_additional_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_status_read_scdb_libconfig_sub_flag_additional_post[hIndex].func; + retVal___ = postHookFunc(retVal___, it, type, source); } } return retVal___; diff --git a/src/plugins/constdb2doc.c b/src/plugins/constdb2doc.c index 3f681ea1a..ebaf7a833 100644 --- a/src/plugins/constdb2doc.c +++ b/src/plugins/constdb2doc.c @@ -22,7 +22,8 @@ /// db/constants.conf -> doc/constants.md generator plugin #include "common/hercules.h" -//#include "common/memmgr.h" +#include "common/db.h" +#include "common/memmgr.h" #include "common/nullpo.h" #include "common/strlib.h" #include "map/itemdb.h" @@ -143,17 +144,26 @@ struct item_data *constdb2doc_itemdb_search(int nameid) void constdb2doc_itemdb(void) { - int i; - nullpo_retv(out_fp); fprintf(out_fp, "## Items (db/"DBPATH"item_db.conf)\n"); - for (i = 0; i < ARRAYLENGTH(itemdb->array); i++) { + for (int i = 0; i < ARRAYLENGTH(itemdb->array); i++) { struct item_data *id = constdb2doc_itemdb_search(i); if (id == NULL || id->name[0] == '\0') continue; fprintf(out_fp, "- `%s`: %d\n", id->name, id->nameid); } + + if (db_size(itemdb->other) > 0) { + struct DBIterator *iter = db_iterator(itemdb->other); + for (struct item_data *itd = dbi_first(iter); dbi_exists(iter); itd = dbi_next(iter)) { + if (itd == &itemdb->dummy) + continue; + fprintf(out_fp, "- `%s`: %d\n", itd->name, itd->nameid); + } + dbi_destroy(iter); + } + fprintf(out_fp, "\n"); } |