diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/atcommand.c | 34 | ||||
-rw-r--r-- | src/map/battle.c | 4 | ||||
-rw-r--r-- | src/map/battle.h | 5 | ||||
-rw-r--r-- | src/map/clif.c | 75 | ||||
-rw-r--r-- | src/map/clif.h | 51 | ||||
-rw-r--r-- | src/map/itemdb.c | 3 | ||||
-rw-r--r-- | src/map/itemdb.h | 66 | ||||
-rw-r--r-- | src/map/map.h | 1 | ||||
-rw-r--r-- | src/map/mob.c | 29 | ||||
-rw-r--r-- | src/map/npc.h | 3 | ||||
-rw-r--r-- | src/map/packets.h | 1635 | ||||
-rw-r--r-- | src/map/pc.c | 302 | ||||
-rw-r--r-- | src/map/pc.h | 8 | ||||
-rw-r--r-- | src/map/script.c | 1873 | ||||
-rw-r--r-- | src/map/script.h | 75 | ||||
-rw-r--r-- | src/map/status.c | 42 | ||||
-rw-r--r-- | src/map/status.h | 84 | ||||
-rw-r--r-- | src/map/unit.c | 10 |
18 files changed, 3885 insertions, 415 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index afdf180d5..9f37a754f 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -1714,7 +1714,21 @@ ACMD(bodystyle) memset(atcmd_output, '\0', sizeof(atcmd_output)); - if (!*message || sscanf(message, "%d", &body_style) < 1) { + if ((sd->job & MAPID_THIRDMASK) != MAPID_GUILLOTINE_CROSS + && (sd->job & MAPID_THIRDMASK) != MAPID_GENETIC + && (sd->job & MAPID_THIRDMASK) != MAPID_MECHANIC + && (sd->job & MAPID_THIRDMASK) != MAPID_ROYAL_GUARD + && (sd->job & MAPID_THIRDMASK) != MAPID_ARCH_BISHOP + && (sd->job & MAPID_THIRDMASK) != MAPID_RANGER + && (sd->job & MAPID_THIRDMASK) != MAPID_WARLOCK + && (sd->job & MAPID_THIRDMASK) != MAPID_SHADOW_CHASER + && (sd->job & MAPID_THIRDMASK) != MAPID_MINSTRELWANDERER + ) { + clif->message(fd, msg_fd(fd, 35)); // This job has no alternate body styles. + return false; + } + + if (*message == '\0' || sscanf(message, "%d", &body_style) < 1) { sprintf(atcmd_output, "Please, enter a body style (usage: @bodystyle <body ID: %d-%d>).", MIN_BODY_STYLE, MAX_BODY_STYLE); clif->message(fd, atcmd_output); return false; @@ -1722,9 +1736,9 @@ ACMD(bodystyle) if (body_style >= MIN_BODY_STYLE && body_style <= MAX_BODY_STYLE) { pc->changelook(sd, LOOK_BODY2, body_style); - clif->message(fd, msg_txt(36)); // Appearence changed. + clif->message(fd, msg_fd(fd, 36)); // Appearence changed. } else { - clif->message(fd, msg_txt(37)); // An invalid number was specified. + clif->message(fd, msg_fd(fd, 37)); // An invalid number was specified. return false; } @@ -8420,22 +8434,24 @@ ACMD(charcommands) return true; } -/* for new mounts */ +/* For new mounts */ ACMD(cashmount) { if (pc_hasmount(sd)) { - clif->message(fd, msg_fd(fd,1476)); // You are already mounting something else + clif->message(fd, msg_fd(fd, 1476)); // You are already mounting something else return false; } - clif->message(sd->fd,msg_fd(fd,1362)); // NOTICE: If you crash with mount your LUA is outdated. + clif->message(sd->fd, msg_fd(fd, 1362)); // NOTICE: If you crash with mount your LUA is outdated. + if (!sd->sc.data[SC_ALL_RIDING]) { - clif->message(sd->fd,msg_fd(fd,1363)); // You have mounted. - sc_start(NULL, &sd->bl, SC_ALL_RIDING, 100, 25, INFINITE_DURATION); + clif->message(sd->fd, msg_fd(fd, 1363)); // You have mounted. + sc_start(NULL, &sd->bl, SC_ALL_RIDING, 100, battle_config.boarding_halter_speed, INFINITE_DURATION); } else { - clif->message(sd->fd,msg_fd(fd,1364)); // You have released your mount. + clif->message(sd->fd, msg_fd(fd, 1364)); // You have released your mount. status_change_end(&sd->bl, SC_ALL_RIDING, INVALID_TIMER); } + return true; } diff --git a/src/map/battle.c b/src/map/battle.c index 349a71f4b..11425d4a9 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7036,7 +7036,6 @@ static const struct battle_data { { "combo_delay_rate", &battle_config.combo_delay_rate, 100, 0, INT_MAX, }, { "item_check", &battle_config.item_check, 0, 0, 1, }, { "item_use_interval", &battle_config.item_use_interval, 100, 0, INT_MAX, }, - { "cashfood_use_interval", &battle_config.cashfood_use_interval, 60000, 0, INT_MAX, }, { "wedding_modifydisplay", &battle_config.wedding_modifydisplay, 0, 0, 1, }, { "wedding_ignorepalette", &battle_config.wedding_ignorepalette, 0, 0, 1, }, { "xmas_ignorepalette", &battle_config.xmas_ignorepalette, 0, 0, 1, }, @@ -7212,7 +7211,6 @@ static const struct battle_data { { "mob_npc_event_type", &battle_config.mob_npc_event_type, 1, 0, 1, }, { "character_size", &battle_config.character_size, 1|2, 0, 1|2, }, { "retaliate_to_master", &battle_config.retaliate_to_master, 1, 0, 1, }, - { "rare_drop_announce", &battle_config.rare_drop_announce, 0, 0, 10000, }, { "duel_allow_pvp", &battle_config.duel_allow_pvp, 0, 0, 1, }, { "duel_allow_gvg", &battle_config.duel_allow_gvg, 0, 0, 1, }, { "duel_allow_teleport", &battle_config.duel_allow_teleport, 0, 0, 1, }, @@ -7335,6 +7333,8 @@ static const struct battle_data { { "max_summoner_parameter", &battle_config.max_summoner_parameter, 120, 10, 10000, }, { "mvp_exp_reward_message", &battle_config.mvp_exp_reward_message, 0, 0, 1, }, { "monster_eye_range_bonus", &battle_config.mob_eye_range_bonus, 0, 0, 10, }, + { "prevent_logout_trigger", &battle_config.prevent_logout_trigger, 0xE, 0, 0xF, }, + { "boarding_halter_speed", &battle_config.boarding_halter_speed, 25, 0, 100, }, }; #ifndef STATS_OPT_OUT /** diff --git a/src/map/battle.h b/src/map/battle.h index 4ec1be98d..a73c6dc44 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -240,7 +240,6 @@ struct Battle_Config { int combo_delay_rate; int item_check; int item_use_interval; //[Skotlex] - int cashfood_use_interval; int wedding_modifydisplay; int wedding_ignorepalette; //[Skotlex] int xmas_ignorepalette; // [Valaris] @@ -409,7 +408,6 @@ struct Battle_Config { int mob_npc_event_type; //Determines on who the npc_event is executed. [Skotlex] int character_size; // if riders have size=2, and baby class riders size=1 [Lupus] - int rare_drop_announce; // chance <= to show rare drops global announces int retaliate_to_master; //Whether when a mob is attacked by another mob, it will retaliate versus the mob or the mob's master. [Skotlex] @@ -554,6 +552,9 @@ struct Battle_Config { int mvp_exp_reward_message; int mob_eye_range_bonus; //Vulture's Eye and Snake's Eye range bonus + + int prevent_logout_trigger; + int boarding_halter_speed; }; /* criteria for battle_config.idletime_critera */ diff --git a/src/map/clif.c b/src/map/clif.c index 09a14f2c2..e70857ab6 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -4176,7 +4176,7 @@ void clif_storageitemadded(struct map_session_data* sd, struct item* i, int inde WFIFOB(fd,12+offset) = i->refine; //refine clif->addcards(WFIFOP(fd,13+offset), i); #if PACKETVER >= 20150226 - clif->add_item_options(WFIFOP(fd,21+offset), i); + clif->add_item_options(WFIFOP(fd, 21 + offset), i); #endif WFIFOSET(fd,packet_len(storageaddType)); } @@ -6250,7 +6250,7 @@ void clif_cart_additem(struct map_session_data *sd,int n,int amount,int fail) WBUFB(buf,12+offset)=sd->status.cart[n].refine; clif->addcards(WBUFP(buf,13+offset), &sd->status.cart[n]); #if PACKETVER >= 20150226 - clif->add_item_options(WBUFP(buf,21+offset), &sd->status.cart[n]); + clif->add_item_options(WBUFP(buf, 21 + offset), &sd->status.cart[n]); #endif WFIFOSET(fd,packet_len(cartaddType)); } @@ -6378,7 +6378,7 @@ void clif_vendinglist(struct map_session_data* sd, unsigned int id, struct s_ven WFIFOB(fd,offset+13+i*item_length) = vsd->status.cart[index].refine; clif->addcards(WFIFOP(fd,offset+14+i*item_length), &vsd->status.cart[index]); #if PACKETVER >= 20150226 - clif->add_item_options(WFIFOP(fd,offset+22+i*item_length), &vsd->status.cart[index]); + clif->add_item_options(WFIFOP(fd, offset + 22 + i * item_length), &vsd->status.cart[index]); #endif } WFIFOSET(fd,WFIFOW(fd,2)); @@ -6444,7 +6444,7 @@ void clif_openvending(struct map_session_data* sd, int id, struct s_vending* ven WFIFOB(fd,21+i*item_length) = sd->status.cart[index].refine; clif->addcards(WFIFOP(fd,22+i*item_length), &sd->status.cart[index]); #if PACKETVER >= 20150226 - clif->add_item_options(WFIFOP(fd,30+22+i*item_length), &sd->status.cart[index]); + clif->add_item_options(WFIFOP(fd, 30 + i * item_length), &sd->status.cart[index]); #endif } WFIFOSET(fd,WFIFOW(fd,2)); @@ -10634,9 +10634,11 @@ void clif_parse_NpcClicked(int fd,struct map_session_data *sd) clif->clearunit_area(&sd->bl,CLR_DEAD); return; } - if( sd->npc_id || sd->state.workinprogress&2 ){ -#ifdef RENEWAL - clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS); // TODO look for the client date that has this message. + if (sd->npc_id || sd->state.workinprogress & 2) { +#if PACKETVER >= 20110309 + clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS); +#else + clif->messagecolor_self(fd, COLOR_WHITE, msg_fd(fd, 48)); #endif return; } @@ -10649,9 +10651,11 @@ void clif_parse_NpcClicked(int fd,struct map_session_data *sd) clif->pActionRequest_sub(sd, 0x07, bl->id, timer->gettick()); break; case BL_NPC: - if( sd->ud.skill_id < RK_ENCHANTBLADE && sd->ud.skilltimer != INVALID_TIMER ) {// TODO: should only work with none 3rd job skills -#ifdef RENEWAL + if (sd->ud.skill_id < RK_ENCHANTBLADE && sd->ud.skilltimer != INVALID_TIMER) { // TODO: should only work with none 3rd job skills +#if PACKETVER >= 20110309 clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS); +#else + clif->messagecolor_self(fd, COLOR_WHITE, msg_fd(fd, 48)); #endif break; } @@ -11027,39 +11031,38 @@ void clif_parse_RemoveOption(int fd,struct map_session_data *sd) void clif_parse_ChangeCart(int fd,struct map_session_data *sd) __attribute__((nonnull (2))); /// Request to change cart's visual look (CZ_REQ_CHANGECART). /// 01af <num>.W -void clif_parse_ChangeCart(int fd,struct map_session_data *sd) +void clif_parse_ChangeCart(int fd, struct map_session_data *sd) {// TODO: State tracking? int type; - if( pc->checkskill(sd, MC_CHANGECART) < 1 ) + if (pc->checkskill(sd, MC_CHANGECART) == 0) return; -#ifdef RENEWAL - if( sd->npc_id || sd->state.workinprogress&1 ){ + if (sd->npc_id || sd->state.workinprogress & 1) { +#if PACKETVER >= 20110309 clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS); +#else + clif->messagecolor_self(fd, COLOR_WHITE, msg_fd(fd, 48)); +#endif return; } -#endif - type = RFIFOW(fd,2); + type = RFIFOW(fd, 2); + + if ( #ifdef NEW_CARTS - if( (type == 9 && sd->status.base_level > 131) || - (type == 8 && sd->status.base_level > 121) || - (type == 7 && sd->status.base_level > 111) || - (type == 6 && sd->status.base_level > 101) || + (type == 9 && sd->status.base_level > 130) || + (type == 8 && sd->status.base_level > 120) || + (type == 7 && sd->status.base_level > 110) || + (type == 6 && sd->status.base_level > 100) || +#endif (type == 5 && sd->status.base_level > 90) || (type == 4 && sd->status.base_level > 80) || (type == 3 && sd->status.base_level > 65) || (type == 2 && sd->status.base_level > 40) || (type == 1)) -#else - if( (type == 5 && sd->status.base_level > 90) || - (type == 4 && sd->status.base_level > 80) || - (type == 3 && sd->status.base_level > 65) || - (type == 2 && sd->status.base_level > 40) || - (type == 1)) -#endif - pc->setcart(sd,type); + + pc->setcart(sd, type); } /// Request to select cart's visual look for new cart design (CZ_SELECTCART). @@ -11246,9 +11249,11 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd) // Whether skill fails or not is irrelevant, the char ain't idle. [Skotlex] pc->update_idle_time(sd, BCIDLE_USESKILLTOID); - if( sd->npc_id || sd->state.workinprogress&1 ){ -#ifdef RENEWAL - clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS); // TODO look for the client date that has this message. + if (sd->npc_id || sd->state.workinprogress & 1) { +#if PACKETVER >= 20110309 + clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS); +#else + clif->messagecolor_self(fd, COLOR_WHITE, msg_fd(fd, 48)); #endif return; } @@ -11343,12 +11348,14 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uint16 ski return; } -#ifdef RENEWAL - if( sd->state.workinprogress&1 ){ - clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS); // TODO look for the client date that has this message. + if (sd->state.workinprogress & 1) { +#if PACKETVER >= 20110309 + clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS); +#else + clif->messagecolor_self(fd, COLOR_WHITE, msg_fd(fd, 48)); +#endif return; } -#endif //Whether skill fails or not is irrelevant, the char ain't idle. [Skotlex] pc->update_idle_time(sd, BCIDLE_USESKILLTOPOS); diff --git a/src/map/clif.h b/src/map/clif.h index e16655c1a..ccb227267 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -69,6 +69,7 @@ struct view_data; #define COLOR_RED 0xff0000U #define COLOR_GREEN 0x00ff00U #define COLOR_WHITE 0xffffffU +#define COLOR_YELLOW 0xffff00U #define COLOR_DEFAULT COLOR_GREEN /** @@ -358,30 +359,32 @@ typedef enum useskill_fail_cause { // clif_skill_fail }useskill_fail_cause; enum clif_messages { - MSG_ITEM_CANT_OBTAIN_WEIGHT = 0x034, ///< You cannot carry more items because you are overweight. - MSG_ITEM_NEED_STANDING = 0x297, ///< You cannot use this item while sitting. - MSG_MERCENARY_EXPIRED = 0x4f2, ///< The mercenary contract has expired. - MSG_MERCENARY_DIED = 0x4f3, ///< The mercenary has died. - MSG_MERCENARY_RELEASED = 0x4f4, ///< You have released the mercenary. - MSG_MERCENARY_ESCAPED = 0x4f5, ///< The mercenary has run away. - MSG_SKILL_CANT_USE_AREA = 0x536, ///< This skill cannot be used within this area - MSG_ITEM_CANT_USE_AREA = 0x537, ///< This item cannot be used within this area. - MSG_EQUIP_NOT_PUBLIC = 0x54d, ///< This character's equipment information is not open to the public. - MSG_ITEM_NEED_MADO = 0x59b, ///< Item can only be used when Mado Gear is mounted. - MSG_ITEM_NEED_CART = 0x5ef, ///< Usable only when cart is put on - MSG_RUNE_STONE_MAX_AMOUNT = 0x61b, ///< Cannot create Rune stone more than the maximum amount. - MSG_SKILL_POINTS_LEFT_JOB1 = 0x61e, ///< You must consume all '%d' remaining points in your 1st Job tab. - MSG_SKILL_POINTS_LEFT_JOB2 = 0x61f, ///< You must consume all '%d' remaining points in your 2nd Job tab. 1st Tab is already done. - MSG_SKILL_ITEM_NOT_FOUND = 0x623, // FIXME[Haru]: This seems to be 0x622 in the msgstringtable files I found. - MSG_SKILL_SUCCESS = 0x627, // FIXME[Haru]: This seems to be 0x626 in the msgstringtable files I found. - MSG_SKILL_FAILURE = 0x628, // FIXME[Haru]: This seems to be 0x627 in the msgstringtable files I found. - MSG_SKILL_ITEM_NEED_IDENTIFY = 0x62d, ///< Unable to use unchecked items as materials. - MSG_ITEM_CANT_EQUIP_LVL = 0x6ed, // FIXME[Haru]: This seems to be 0x6ee in the msgstringtable files I found. - MSG_ITEM_CANT_USE_LVL = 0x6ee, // FIXME[Haru]: This seems to be 0x6ef in the msgstringtable files I found. - MSG_COOKING_LIST_FAIL = 0x625, // FIXME[Haru]: This might be a wrong message ID. Not sure what it should be. - MSG_SECONDS_UNTIL_USE = 0x746, ///< %d seconds left until you can use - MSG_NPC_WORK_IN_PROGRESS = 0x783, // FIXME[Haru]: This seems to be 0x784 in the msgstringtable files I found. - MSG_REINS_CANT_USE_MOUNTED = 0x78b, // FIXME[Haru]: This seems to be 0x785 in the msgstringtalbe files I found. + MSG_ITEM_CANT_OBTAIN_WEIGHT = 0x034, ///< You cannot carry more items because you are overweight. + MSG_ITEM_NEED_STANDING = 0x297, ///< You cannot use this item while sitting. + MSG_MERCENARY_EXPIRED = 0x4f2, ///< The mercenary contract has expired. + MSG_MERCENARY_DIED = 0x4f3, ///< The mercenary has died. + MSG_MERCENARY_RELEASED = 0x4f4, ///< You have released the mercenary. + MSG_MERCENARY_ESCAPED = 0x4f5, ///< The mercenary has run away. + MSG_PARTY_MEMBER_NOT_SUMMONED = 0x4c5, ///< The party member was not summoned because you are not the party leader. + MSG_PARTY_NO_MEMBER_IN_MAP = 0x4c6, ///< There is no party member to summon in the current map. + MSG_SKILL_CANT_USE_AREA = 0x536, ///< This skill cannot be used within this area + MSG_ITEM_CANT_USE_AREA = 0x537, ///< This item cannot be used within this area. + MSG_EQUIP_NOT_PUBLIC = 0x54d, ///< This character's equipment information is not open to the public. + MSG_ITEM_NEED_MADO = 0x59b, ///< Item can only be used when Mado Gear is mounted. + MSG_ITEM_NEED_CART = 0x5ef, ///< Usable only when cart is put on + MSG_RUNE_STONE_MAX_AMOUNT = 0x61b, ///< Cannot create Rune stone more than the maximum amount. + MSG_SKILL_POINTS_LEFT_JOB1 = 0x61e, ///< You must consume all '%d' remaining points in your 1st Job tab. + MSG_SKILL_POINTS_LEFT_JOB2 = 0x61f, ///< You must consume all '%d' remaining points in your 2nd Job tab. 1st Tab is already done. + MSG_SKILL_ITEM_NOT_FOUND = 0x623, // FIXME[Haru]: This seems to be 0x622 in the msgstringtable files I found. + MSG_SKILL_SUCCESS = 0x627, // FIXME[Haru]: This seems to be 0x626 in the msgstringtable files I found. + MSG_SKILL_FAILURE = 0x628, // FIXME[Haru]: This seems to be 0x627 in the msgstringtable files I found. + MSG_SKILL_ITEM_NEED_IDENTIFY = 0x62d, ///< Unable to use unchecked items as materials. + MSG_ITEM_CANT_EQUIP_LVL = 0x6ed, // FIXME[Haru]: This seems to be 0x6ee in the msgstringtable files I found. + MSG_ITEM_CANT_USE_LVL = 0x6ee, // FIXME[Haru]: This seems to be 0x6ef in the msgstringtable files I found. + MSG_COOKING_LIST_FAIL = 0x625, // FIXME[Haru]: This might be a wrong message ID. Not sure what it should be. + MSG_SECONDS_UNTIL_USE = 0x746, ///< %d seconds left until you can use + MSG_NPC_WORK_IN_PROGRESS = 0x783, // FIXME[Haru]: This seems to be 0x784 in the msgstringtable files I found. + MSG_REINS_CANT_USE_MOUNTED = 0x78b, // FIXME[Haru]: This seems to be 0x785 in the msgstringtalbe files I found. }; /** diff --git a/src/map/itemdb.c b/src/map/itemdb.c index a35aa67f1..4076e295c 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -2073,6 +2073,9 @@ int itemdb_readdb_libconfig_sub(struct config_setting_t *it, int n, const char * if ((t = libconfig->setting_get_member(it, "KeepAfterUse"))) id.flag.keepafteruse = libconfig->setting_get_bool(t) ? 1 : 0; + if ((t = libconfig->setting_get_member(it, "DropAnnounce"))) + id.flag.drop_announce = libconfig->setting_get_bool(t) ? 1 : 0; + if (itemdb->lookup_const(it, "Delay", &i32) && i32 >= 0) id.delay = i32; diff --git a/src/map/itemdb.h b/src/map/itemdb.h index 618111d2a..35cd154cb 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -111,8 +111,6 @@ enum item_itemid { ITEMID_FRAGMENT_OF_CRYSTAL = 7321, ITEMID_SKULL_ = 7420, ITEMID_TOKEN_OF_SIEGFRIED = 7621, - ITEMID_GOLD_KEY77 = 7782, - ITEMID_SILVER_KEY77 = 7783, ITEMID_SPECIAL_ALLOY_TRAP = 7940, ITEMID_CATNIP_FRUIT = 11602, ITEMID_RED_POUCH_OF_SURPRISE = 12024, @@ -147,6 +145,23 @@ enum item_itemid { ITEMID_BLACK_THING = 12435, ITEMID_BOARDING_HALTER = 12622, ITEMID_NOBLE_NAMEPLATE = 12705, + ITEMID_POISON_PARALYSIS = 12717, + ITEMID_POISON_LEECH = 12718, + ITEMID_POISON_OBLIVION = 12719, + ITEMID_POISON_CONTAMINATION = 12720, + ITEMID_POISON_NUMB = 12721, + ITEMID_POISON_FEVER = 12722, + ITEMID_POISON_LAUGHING = 12723, + ITEMID_POISON_FATIGUE = 12724, + ITEMID_NAUTHIZ = 12725, + ITEMID_RAIDO = 12726, + ITEMID_BERKANA = 12727, + ITEMID_ISA = 12728, + ITEMID_OTHILA = 12729, + ITEMID_URUZ = 12730, + ITEMID_THURISAZ = 12731, + ITEMID_WYRD = 12732, + ITEMID_HAGALAZ = 12733, ITEMID_DUN_TELE_SCROLL1 = 14527, ITEMID_BATTLE_MANUAL25 = 14532, ITEMID_BATTLE_MANUAL100 = 14533, @@ -161,6 +176,7 @@ enum item_itemid { ITEMID_PILEBUNCKER_S = 16030, ITEMID_PILEBUNCKER_P = 16031, ITEMID_PILEBUNCKER_T = 16032, + ITEMID_LUX_ANIMA = 22540, }; enum cards_item_list { @@ -250,49 +266,6 @@ enum mercenary_scroll_item_list { }; /** - * Cash Food - */ -enum cash_food_item_list { - ITEMID_STR_DISH10_ = 12202, - ITEMID_AGI_DISH10_, // 12203 - ITEMID_INT_DISH10_, // 12204 - ITEMID_DEX_DISH10_, // 12205 - ITEMID_LUK_DISH10_, // 12206 - ITEMID_VIT_DISH10_, // 12207 -}; - -/** - * GC Poison - */ -enum poison_item_list { - ITEMID_POISON_PARALYSIS = 12717, - ITEMID_POISON_LEECH, // 12718 - ITEMID_POISON_OBLIVION, // 12719 - ITEMID_POISON_CONTAMINATION, // 12720 - ITEMID_POISON_NUMB, // 12721 - ITEMID_POISON_FEVER, // 12722 - ITEMID_POISON_LAUGHING, // 12723 - ITEMID_POISON_FATIGUE, // 12724 -}; - - -/** - * Rune Knight - **/ -enum rune_item_list { - ITEMID_NAUTHIZ = 12725, - ITEMID_RAIDO, // 12726 - ITEMID_BERKANA, // 12727 - ITEMID_ISA, // 12728 - ITEMID_OTHILA, // 12729 - ITEMID_URUZ, // 12730 - ITEMID_THURISAZ, // 12731 - ITEMID_WYRD, // 12732 - ITEMID_HAGALAZ, // 12733 - ITEMID_LUX_ANIMA = 22540, -}; - -/** * Geneticist */ enum geneticist_item_list { @@ -523,6 +496,7 @@ struct item_data { unsigned keepafteruse : 1; unsigned force_serial : 1; unsigned no_options: 1; // < disallows use of item options on the item. (non-equippable items are automatically flagged) [Smokexyz] + unsigned drop_announce : 1; // Official Drop Announce [Jedzkie] } flag; struct {// item stacking limitation unsigned short amount; @@ -566,12 +540,10 @@ struct item_data { #define itemdb_canrefine(n) (!itemdb->search(n)->flag.no_refine) #define itemdb_allowoption(n) (!itemdb->search(n)->flag.no_options) -#define itemdb_is_rune(n) (((n) >= ITEMID_NAUTHIZ && (n) <= ITEMID_HAGALAZ) || (n) == ITEMID_LUX_ANIMA) #define itemdb_is_element(n) ((n) >= ITEMID_SCARLET_PTS && (n) <= ITEMID_LIME_GREEN_PTS) #define itemdb_is_spellbook(n) ((n) >= ITEMID_MAGIC_BOOK_FB && (n) <= ITEMID_MAGIC_BOOK_DL) #define itemdb_is_poison(n) ((n) >= ITEMID_POISON_PARALYSIS && (n) <= ITEMID_POISON_FATIGUE) #define itemid_isgemstone(n) ((n) >= ITEMID_YELLOW_GEMSTONE && (n) <= ITEMID_BLUE_GEMSTONE) -#define itemdb_iscashfood(n) ((n) >= ITEMID_STR_DISH10_ && (n) <= ITEMID_VIT_DISH10_) #define itemdb_is_GNbomb(n) ((n) >= ITEMID_APPLE_BOMB && (n) <= ITEMID_VERY_HARD_LUMP) #define itemdb_is_GNthrowable(n) ((n) >= ITEMID_MYSTERIOUS_POWDER && (n) <= ITEMID_BLACK_THING_TO_THROW) #define itemid_is_pilebunker(n) ((n) == ITEMID_PILEBUNCKER || (n) == ITEMID_PILEBUNCKER_P || (n) == ITEMID_PILEBUNCKER_S || (n) == ITEMID_PILEBUNCKER_T) diff --git a/src/map/map.h b/src/map/map.h index 8c5372093..d4284b3f7 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -553,6 +553,7 @@ enum status_point_types { //we better clean up this enum and change it name [Hem SP_MOD_EXP=125, SP_MOD_DROP=126, SP_MOD_DEATH=127, + SP_BANKVAULT=128, // Mercenaries SP_MERCFLEE=165, SP_MERCKILLS=189, SP_MERCFAITH=190, diff --git a/src/map/mob.c b/src/map/mob.c index 74d25b805..52705cf4d 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2151,6 +2151,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) { struct map_session_data *sd = BL_CAST(BL_PC, src); struct map_session_data *tmpsd[DAMAGELOG_SIZE] = { NULL }; struct map_session_data *mvp_sd = sd, *second_sd = NULL, *third_sd = NULL; + struct item_data *id = NULL; struct { struct party_data *p; @@ -2439,23 +2440,13 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) { ditem = mob->setdropitem(md->db->dropitem[i].nameid, 1, it); - //A Rare Drop Global Announce by Lupus - if( mvp_sd && drop_rate <= battle_config.rare_drop_announce ) { - char message[128]; - sprintf (message, msg_txt(541), mvp_sd->status.name, md->name, it->jname, (float)drop_rate/100); - //MSG: "'%s' won %s's %s (chance: %0.02f%%)" - intif->broadcast(message, (int)strlen(message)+1, BC_DEFAULT); + // Official Drop Announce [Jedzkie] + if (mvp_sd != NULL) { + if ((id = itemdb->search(it->nameid)) != NULL && id->flag.drop_announce) { + clif->item_drop_announce(mvp_sd, it->nameid, md->name); + } } - /* heres the thing we got the feature set up however we're still discussing how to best define the ids, - * so while we discuss, for a small period of time, the list is hardcoded (yes officially only those 2 use it, - * thus why we're unsure on how to best place the setting) */ - /* temp, will not be hardcoded for long thudu. */ - // TODO: This should be a field in the item db. - if (mvp_sd != NULL - && (it->nameid == ITEMID_GOLD_KEY77 || it->nameid == ITEMID_SILVER_KEY77)) /* for when not hardcoded: add a check on mvp bonus drop as well */ - clif->item_drop_announce(mvp_sd, it->nameid, md->name); - // 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); @@ -2592,14 +2583,6 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) { clif->mvp_item(mvp_sd, item.nameid); log_mvp[0] = item.nameid; - //A Rare MVP Drop Global Announce by Lupus - if (rate <= battle_config.rare_drop_announce) { - char message[128]; - sprintf(message, msg_txt(541), mvp_sd->status.name, md->name, data->jname, rate/100.); - //MSG: "'%s' won %s's %s (chance: %0.02f%%)" - intif->broadcast(message, (int)strlen(message)+1, BC_DEFAULT); - } - if((temp = pc->additem(mvp_sd,&item,1,LOG_TYPE_PICKDROP_PLAYER)) != 0) { clif->additem(mvp_sd,0,0,temp); map->addflooritem(&md->bl, &item, 1, mvp_sd->bl.m, mvp_sd->bl.x, mvp_sd->bl.y, mvp_sd->status.char_id, (second_sd?second_sd->status.char_id : 0), (third_sd ? third_sd->status.char_id : 0), 1); diff --git a/src/map/npc.h b/src/map/npc.h index 6180e9765..3bd11d536 100644 --- a/src/map/npc.h +++ b/src/map/npc.h @@ -125,7 +125,6 @@ struct npc_data { struct hplugin_data_store *hdata; ///< HPM Plugin Data Store }; - #define START_NPC_NUM 110000000 enum actor_classes { @@ -142,7 +141,7 @@ enum actor_classes { #define MAX_NPC_CLASS 1000 // New NPC range #define MAX_NPC_CLASS2_START 10001 -#define MAX_NPC_CLASS2_END 10203 +#define MAX_NPC_CLASS2_END 10248 //Script NPC events. enum npce_event { diff --git a/src/map/packets.h b/src/map/packets.h index 418beb41a..d1875f2f0 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -2222,6 +2222,44 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x0436,4,clif->pDull); // CZ_GANGSI_RANK #endif +// 2012-09-25aRagexe +#if PACKETVER >= 20120925 +// new packets (not all) + packet(0x0998,8,clif->pEquipItem,2,4); +#endif + +// 2013-02-06aRagexe +#if PACKETVER >= 20130206 +// new packets + packet(0x09a4,18); // ZC_DISPATCH_TIMING_INFO_CHN +// changed packet sizes +#endif + +// 2013-03-06aRagexe +#if PACKETVER >= 20130306 +// new packets + packet(0x09a6,12); // ZC_BANKING_CHECK + packet(0x09a7,14,clif->pDull/*,XXX*/); // CZ_REQ_BANKING_DEPOSIT + packet(0x09a8,4); // ZC_ACK_BANKING_DEPOSIT + packet(0x09a9,14,clif->pDull/*,XXX*/); // CZ_REQ_BANKING_WITHDRAW + packet(0x09aa,4); // ZC_ACK_BANKING_WITHDRAW +// changed packet sizes +#endif + +// 2013-03-13aRagexe +#if PACKETVER >= 20130313 +// new packets + packet(0x09ab,-1,clif->pDull/*,XXX*/); // CZ_REQ_BANKING_CHECK + packet(0x09ac,20,clif->pDull/*,XXX*/); // CZ_REQ_CASH_BARGAIN_SALE_ITEM_INFO + packet(0x09ad,6); // ZC_ACK_CASH_BARGAIN_SALE_ITEM_INFO + packet(0x09ae,-1,clif->pDull/*,XXX*/); // CZ_REQ_APPLY_BARGAIN_SALE_ITEM + packet(0x09af,-1); // ZC_ACK_APPLY_BARGAIN_SALE_ITEM + packet(0x09b0,8,clif->pDull/*,XXX*/); // CZ_REQ_REMOVE_BARGAIN_SALE_ITEM + packet(0x09b1,6); // ZC_ACK_REMOVE_BARGAIN_SALE_ITEM + packet(0x09b2,-1); // ZC_NOTIFY_BARGAIN_SALE_SELLING +// changed packet sizes +#endif + //2013-03-20Ragexe (Judas + Yommy) #if PACKETVER >= 20130320 // Shuffle Start @@ -2260,13 +2298,36 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x095a,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD // Shuffle End - // New Packets - packet(0x0998,8,clif->pEquipItem,2,4); + // New Packets (wrong version or packet not exists) packet(0x0447,2); // PACKET_CZ_BLOCKING_PLAY_CANCEL packet(0x099f,24); // New Packets End #endif +#if PACKETVER >= 20130320 +// new packets +// changed packet sizes + packet(0x09a7,10,clif->pBankDeposit,2,4,6); // CZ_REQ_BANKING_DEPOSIT + packet(0x09a8,12); // ZC_ACK_BANKING_DEPOSIT + packet(0x09a9,10,clif->pBankWithdraw,2,4,6); // CZ_REQ_BANKING_WITHDRAW + packet(0x09aa,12); // ZC_ACK_BANKING_WITHDRAW + packet(0x09ab,6,clif->pBankCheck,2,4); // CZ_REQ_BANKING_CHECK +#endif + +// 2013-03-27bRagexe +#if PACKETVER >= 20130327 +// new packets + packet(0x09ac,-1,clif->pDull/*,XXX*/); // CZ_REQ_CASH_BARGAIN_SALE_ITEM_INFO + packet(0x09ad,10); // ZC_ACK_CASH_BARGAIN_SALE_ITEM_INFO + packet(0x09ae,17,clif->pDull/*,XXX*/); // CZ_REQ_APPLY_BARGAIN_SALE_ITEM + packet(0x09af,4); // ZC_ACK_APPLY_BARGAIN_SALE_ITEM + packet(0x09b0,8,clif->pDull/*,XXX*/); // CZ_REQ_REMOVE_BARGAIN_SALE_ITEM + packet(0x09b1,4); // ZC_ACK_REMOVE_BARGAIN_SALE_ITEM + packet(0x09b2,6); // ZC_NOTIFY_BARGAIN_SALE_SELLING + packet(0x09b3,6); // ZC_NOTIFY_BARGAIN_SALE_CLOSE +// changed packet sizes +#endif + //2013-05-15aRagexe (Shakto) #if PACKETVER >= 20130515 // Shuffle Start @@ -2529,20 +2590,74 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x0436,4,clif->pDull); // CZ_GANGSI_RANK #endif -/* Bank System [Yommy/Hercules] */ -#if PACKETVER >= 20130724 -// shuffle packets not added - packet(0x09A6,12); // ZC_BANKING_CHECK - packet(0x09A7,10,clif->pBankDeposit,2,4,6); - packet(0x09A8,16); // ZC_ACK_BANKING_DEPOSIT - packet(0x09A9,10,clif->pBankWithdraw,2,4,6); - packet(0x09AA,16); // ZC_ACK_BANKING_WITHDRAW - packet(0x09AB,6,clif->pBankCheck,2,4); - //// - packet(0x09B6,6,clif->pBankOpen,2,4); - packet(0x09B7,4); // ZC_ACK_OPEN_BANKING - packet(0x09B8,6,clif->pBankClose,2,4); - packet(0x09B9,4); // ZC_ACK_CLOSE_BANKING +// 2013-04-17aRagexe +#if PACKETVER >= 20130417 +// new packets + packet(0x09b4,6,clif->pDull/*,XXX*/); // CZ_OPEN_BARGAIN_SALE_TOOL + packet(0x09b5,2); // ZC_OPEN_BARGAIN_SALE_TOOL + packet(0x09b6,6,clif->pBankOpen,2,4); // CZ_REQ_OPEN_BANKING + packet(0x09b7,4); // ZC_ACK_OPEN_BANKING + packet(0x09b8,6,clif->pBankClose,2,4); // CZ_REQ_CLOSE_BANKING + packet(0x09b9,4); // ZC_ACK_CLOSE_BANKING +// changed packet sizes +#endif + +// 2013-04-24aRagexe +#if PACKETVER >= 20130424 +// new packets + packet(0x09ba,6,clif->pDull/*,XXX*/); // CZ_REQ_OPEN_GUILD_STORAGE + packet(0x09bb,4); // ZC_ACK_OPEN_GUILD_STORAGE + packet(0x09bc,6,clif->pDull/*,XXX*/); // CZ_CLOSE_BARGAIN_SALE_TOOL + packet(0x09bd,2); // ZC_CLOSE_BARGAIN_SALE_TOOL +// changed packet sizes +#endif + +// 2013-05-02aRagexe +#if PACKETVER >= 20130502 +// new packets + packet(0x09be,6,clif->pDull/*,XXX*/); // CZ_REQ_CLOSE_GUILD_STORAGE + packet(0x09bf,4); // ZC_ACK_CLOSE_GUILD_STORAGE +// changed packet sizes + packet(0x09bb,6); // ZC_ACK_OPEN_GUILD_STORAGE +#endif + +// 2013-05-15aRagexe +#if PACKETVER >= 20130515 +// new packets + packet(0x09c0,11); // ZC_ACTION_MOVE + packet(0x09c1,11); // ZC_C_MARKERINFO +// changed packet sizes + packet(0x09a8,16); // ZC_ACK_BANKING_DEPOSIT + packet(0x09aa,16); // ZC_ACK_BANKING_WITHDRAW +#endif + +// 2013-05-29Ragexe +#if PACKETVER >= 20130529 +// new packets + packet(0x09c3,8,clif->pDull/*,XXX*/); // CZ_REQ_COUNT_BARGAIN_SALE_ITEM +// changed packet sizes +#endif + +// 2013-06-05Ragexe +#if PACKETVER >= 20130605 +// new packets + packet(0x09c4,8); // ZC_ACK_COUNT_BARGAIN_SALE_ITEM +#endif + +// 2013-06-18aRagexe +#if PACKETVER >= 20130618 +// new packets + packet(0x09ca,23); // ZC_SKILL_ENTRY5 +// changed packet sizes +#endif + +// 2013-07-17cRagexe +#if PACKETVER >= 20130717 +// new packets + packet(0x09cb,17); // ZC_USE_SKILL2 + packet(0x09cc,-1); // ZC_SECRETSCAN_DATA +// changed packet sizes + packet(0x09c1,10); // ZC_C_MARKERINFO #endif //2013-08-07Ragexe (Shakto) @@ -2582,6 +2697,13 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x0436,4,clif->pDull); // CZ_GANGSI_RANK #endif +// 2013-08-07aRagexe +#if PACKETVER >= 20130807 +// new packets + packet(0x09cd,8); // ZC_MSG_COLOR +// changed packet sizes +#endif + //2013-08-14aRagexe - Themon #if PACKETVER >= 20130814 packet(0x0874,7,clif->pActionRequest,2,6); @@ -2619,6 +2741,84 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x0896,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD #endif +// 2013-08-14aRagexe +#if PACKETVER >= 20130814 +// new packets + packet(0x09ce,102,clif->pGM_Monster_Item,2); // CZ_ITEM_CREATE_EX + packet(0x09cf,-1); // ZC_NPROTECTGAMEGUARDCSAUTH + packet(0x09d0,-1,clif->pDull/*,XXX*/); // CZ_NPROTECTGAMEGUARDCSAUTH +// changed packet sizes +#endif + +// 2013-08-21bRagexe +#if PACKETVER >= 20130821 +// new packets + packet(0x09d1,14); // ZC_PROGRESS_ACTOR +// changed packet sizes +#endif + +// 2013-08-28bRagexe +#if PACKETVER >= 20130828 +// new packets + packet(0x09d2,-1); // ZC_GUILDSTORAGE_ITEMLIST_NORMAL_V5 + packet(0x09d3,-1); // ZC_GUILDSTORAGE_ITEMLIST_EQUIP_V5 +// changed packet sizes + packet(0x09ba,2,clif->pDull/*,XXX*/); // CZ_REQ_OPEN_GUILD_STORAGE + packet(0x09be,2,clif->pDull/*,XXX*/); // CZ_REQ_CLOSE_GUILD_STORAGE +#endif + +// 2013-09-04aRagexe +#if PACKETVER >= 20130904 +// new packets +// changed packet sizes + packet(0x09ca,-1); // ZC_SKILL_ENTRY5 +#endif + +// 2013-09-11aRagexe +#if PACKETVER >= 20130911 +// new packets + packet(0x09d4,2,clif->pNPCShopClosed); // CZ_NPC_TRADE_QUIT + packet(0x09d5,-1); // ZC_NPC_MARKET_OPEN + packet(0x09d6,-1,clif->pNPCMarketPurchase); // CZ_NPC_MARKET_PURCHASE + packet(0x09d7,-1); // ZC_NPC_MARKET_PURCHASE_RESULT + packet(0x09d8,2,clif->pNPCMarketClosed); // CZ_NPC_MARKET_CLOSE + packet(0x09d9,2,clif->pDull/*,XXX*/); // CZ_REQ_GUILDSTORAGE_LOG + packet(0x09da,2); // ZC_ACK_GUILDSTORAGE_LOG +// changed packet sizes +#endif + +// 2013-09-25aRagexe +#if PACKETVER >= 20130925 +// new packets +// changed packet sizes + packet(0x09da,10); // ZC_ACK_GUILDSTORAGE_LOG +#endif + +// 2013-10-02aRagexe +#if PACKETVER >= 20131002 +// new packets +// changed packet sizes + packet(0x09d9,4,clif->pDull/*,XXX*/); // CZ_REQ_GUILDSTORAGE_LOG + packet(0x09da,-1); // ZC_ACK_GUILDSTORAGE_LOG +#endif + +// 2013-10-16aRagexe +#if PACKETVER >= 20131016 +// new packets +// changed packet sizes + packet(0x09d9,6,clif->pDull/*,XXX*/); // CZ_REQ_GUILDSTORAGE_LOG +#endif + +// 2013-10-23aRagexe +#if PACKETVER >= 20131023 +// new packets + packet(0x09db,-1); // ZC_NOTIFY_MOVEENTRY10 + packet(0x09dc,-1); // ZC_NOTIFY_NEWENTRY10 + packet(0x09dd,-1); // ZC_NOTIFY_STANDENTRY10 +// changed packet sizes + packet(0x09d9,4,clif->pDull/*,XXX*/); // CZ_REQ_GUILDSTORAGE_LOG +#endif + // 2013-10-30aRagexe #if PACKETVER >= 20131030 // new packets @@ -2627,6 +2827,43 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x09e0,-1); // SC_LOGIN_ANSWER_WITH_ID #endif +// 2013-11-06aRagexe +#if PACKETVER >= 20131106 +// new packets + packet(0x09e1,8,clif->pDull/*,XXX*/); // CZ_MOVE_ITEM_FROM_BODY_TO_GUILDSTORAGE + packet(0x09e2,8,clif->pDull/*,XXX*/); // CZ_MOVE_ITEM_FROM_GUILDSTORAGE_TO_BODY + packet(0x09e3,8,clif->pDull/*,XXX*/); // CZ_MOVE_ITEM_FROM_CART_TO_GUILDSTORAGE + packet(0x09e4,8,clif->pDull/*,XXX*/); // CZ_MOVE_ITEM_FROM_GUILDSTORAGE_TO_CART +// changed packet sizes +#endif + +// 2013-11-20dRagexe +#if PACKETVER >= 20131120 +// new packets + packet(0x09e5,14); // ZC_DELETEITEM_FROM_MCSTORE2 + packet(0x09e6,18); // ZC_UPDATE_ITEM_FROM_BUYING_STORE2 +// changed packet sizes +#endif + +// 2013-11-27bRagexe +#if PACKETVER >= 20131127 +// new packets +// changed packet sizes + packet(0x09e5,18); // ZC_DELETEITEM_FROM_MCSTORE2 + packet(0x09e6,22); // ZC_UPDATE_ITEM_FROM_BUYING_STORE2 +#endif + +// 2013-12-11dRagexe +#if PACKETVER >= 20131211 +// new packets + packet(0x09e7,2); // ZC_NOTIFY_UNREAD_RODEX + packet(0x09e8,18,clif->pDull/*,XXX*/); // CZ_OPEN_RODEXBOX + packet(0x09e9,2,clif->pDull/*,XXX*/); // CZ_CLOSE_RODEXBOX + packet(0x09ed,-1); // ZC_ACK_SEND_RODEX + packet(0x09ee,-1,clif->pDull/*,XXX*/); // CZ_REQ_NEXT_RODEX +// changed packet sizes +#endif + // 2013-12-18bRagexe - Yommy #if PACKETVER >= 20131218 packet(0x0369,7,clif->pActionRequest,2,6); @@ -2658,12 +2895,20 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x085C,36,clif->pStoragePassword,0); packet(0x0363,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD packet(0x087b,4,clif->pDull); // CZ_GANGSI_RANK - /* New */ - packet(0x09d4,2,clif->pNPCShopClosed); - packet(0x09ce,102,clif->pGM_Monster_Item,2); - /* NPC Market */ - packet(0x09d8,2,clif->pNPCMarketClosed); - packet(0x09d6,-1,clif->pNPCMarketPurchase); +#endif + +// 2013-12-18bRagexe +#if PACKETVER >= 20131218 +// new packets + packet(0x09ea,10,clif->pDull/*,XXX*/); // CZ_REQ_READ_RODEX + packet(0x09eb,14); // ZC_ACK_READ_RODEX + packet(0x09ef,11,clif->pDull/*,XXX*/); // CZ_REQ_REFRESH_RODEX + packet(0x09f0,-1); // ZC_ACK_RODEX_LIST + packet(0x09f5,11,clif->pDull/*,XXX*/); // CZ_REQ_DELETE_RODEX + packet(0x09f6,11); // ZC_ACK_DELETE_RODEX +// changed packet sizes + packet(0x09e8,10,clif->pDull/*,XXX*/); // CZ_OPEN_RODEXBOX + packet(0x09ee,11,clif->pDull/*,XXX*/); // CZ_REQ_NEXT_RODEX #endif // 2013-12-23cRagexe - Yommy @@ -2697,7 +2942,14 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x08A4,36,clif->pStoragePassword,0); packet(0x0363,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD packet(0x0436,4,clif->pDull); // CZ_GANGSI_RANK - packet(0x09cb,17); +#endif + +// 2013-12-23bRagexe +#if PACKETVER >= 20131223 +// new packets +// changed packet sizes + packet(0x09ea,11,clif->pDull/*,XXX*/); // CZ_REQ_READ_RODEX + packet(0x09eb,24); // ZC_ACK_READ_RODEX #endif // 2013-12-30aRagexe - Yommy @@ -2733,6 +2985,16 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x093e,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD #endif +// 2013-12-30aRagexe +#if PACKETVER >= 20131230 +// new packets + packet(0x09ec,-1,clif->pDull/*,XXX*/); // CZ_REQ_SEND_RODEX + packet(0x09ed,3); // ZC_ACK_SEND_RODEX + packet(0x09f7,75); // ZC_PROPERTY_HOMUN_2 +// changed packet sizes + packet(0x09eb,23); // ZC_ACK_READ_RODEX +#endif + // 2014 Packet Data // 2014-01-15eRagexe @@ -3213,8 +3475,6 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x0936,36,clif->pStoragePassword,0); packet(0x0363,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD packet(0x0922,4,clif->pDull); // CZ_GANGSI_RANK - packet(0x09e5,18); // ZC_DELETEITEM_FROM_MCSTORE2 - packet(0x09e6,22); // ZC_UPDATE_ITEM_FROM_BUYING_STORE2 #endif // 2014-10-22bRagexe - YomRawr @@ -3730,7 +3990,6 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x0817,5,clif->pHomMenu,2,4); packet(0x0923,36,clif->pStoragePassword,0); packet(0x0a27,8); // ZC_RECOVERY2 - packet(0x09f7,75); // ZC_PROPERTY_HOMUN_2 #endif // 2015-05-20aRagexeRE @@ -4305,6 +4564,1229 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x0967,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK #endif +// 2016-01-27aRagexeRE +#if PACKETVER >= 20160127 +// new packets + packet(0x0a4d,-1); +// changed packet sizes +#endif + +// 2016-01-27bRagexeRE +#if PACKETVER == 20160127 +// shuffle packets + packet(0x022d,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0436,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x085e,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x0922,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x095a,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x0961,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME +#endif + +// 2016-02-03aRagexeRE +#if PACKETVER == 20160203 +// shuffle packets + packet(0x0202,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0361,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0436,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0437,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x07e4,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0811,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0819,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0835,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x086c,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0872,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x0873,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x088c,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x0918,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x093e,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x0940,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0947,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0954,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x095a,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x095d,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME +#endif + +// 2016-02-17cRagexeRE +#if PACKETVER == 20160217 +// shuffle packets + packet(0x0202,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x023b,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0362,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x0365,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x0864,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x0870,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x0873,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x087a,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0888,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x088d,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x088f,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0899,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x08a0,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x08a9,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x08ac,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x08ad,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x091d,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0920,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0926,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x092e,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x093b,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x093e,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0941,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x094a,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x094f,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x095e,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x0966,6,clif->pGetCharNameRequest,2); // CZ_REQNAME + packet(0x0967,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0969,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE +#endif + +// 2016-03-02bRagexeRE +#if PACKETVER == 20160302 +// shuffle packets + packet(0x022d,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x0367,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0802,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0819,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x085b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x0864,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0865,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0867,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0868,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x0873,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x0875,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x087a,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x087d,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x0883,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x08a6,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x08a9,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x091a,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0927,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x092d,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x092f,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0945,6,clif->pGetCharNameRequest,2); // CZ_REQNAME + packet(0x094e,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x0950,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0957,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x095a,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0960,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x0961,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0967,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0968,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT +#endif + +// 2016-03-02bRagexeRE +#if PACKETVER >= 20160302 +// new packets + packet(0x0a4e,4); + packet(0x0a4f,-1,clif->pDull/*,XXX*/); + packet(0x0a50,6); + packet(0x0a51,34); +// changed packet sizes +#endif + +// 2016-03-09aRagexeRE +#if PACKETVER == 20160309 +// shuffle packets + packet(0x023b,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0281,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0361,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x0364,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0819,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x0838,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x083c,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x085a,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x085f,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x0866,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x086a,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0873,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x087c,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x087e,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x089b,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x089d,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x08a7,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x091d,6,clif->pGetCharNameRequest,2); // CZ_REQNAME + packet(0x0920,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x0922,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0929,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x092a,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x092e,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0932,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x094f,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0956,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x095e,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x096a,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP +#endif + +// 2016-03-16aRagexeRE +#if PACKETVER >= 20160316 +// new packets + packet(0x0a52,20,clif->pDull/*,XXX*/); + packet(0x0a53,10); + packet(0x0a54,-1); + packet(0x0a55,2); + packet(0x0a56,6,clif->pDull/*,XXX*/); + packet(0x0a57,6); + packet(0x0a58,8); + packet(0x0a59,-1); + packet(0x0a5a,2,clif->pDull/*,XXX*/); + packet(0x0a5b,7); + packet(0x0a5c,18,clif->pDull/*,XXX*/); + packet(0x0a5d,6); +// changed packet sizes +#endif + +// 2016-03-23aRagexeRE +#if PACKETVER >= 20160323 +// new packets + packet(0x0a68,3); + packet(0x0a69,6); + packet(0x0a6a,12); + packet(0x0a6b,-1); +// changed packet sizes +#endif + +// 2016-03-30aRagexeRE +#if PACKETVER == 20160330 +// shuffle packets + packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0365,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x0867,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x086d,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x0878,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x087f,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x0889,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x088b,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x088d,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x0918,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x0925,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x092a,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x092c,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0930,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x0939,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x093b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME +#endif + +// 2016-03-30aRagexeRE +#if PACKETVER >= 20160330 +// new packets + packet(0x0a6c,7,clif->pDull/*,XXX*/); + packet(0x0a6d,-1); + packet(0x0a6e,-1); + packet(0x0a6f,-1); +// changed packet sizes +#endif + +// 2016-04-20aRagexeRE +#if PACKETVER == 20160420 +// shuffle packets + packet(0x022d,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x02c4,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x035f,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0819,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x0864,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x0870,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x0872,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x0874,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x0884,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0888,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x088b,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x08a5,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x092f,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0935,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x094e,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x095c,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME +#endif + +// 2016-04-27aRagexeRE +#if PACKETVER >= 20160427 +// new packets +// changed packet sizes + packet(0x0a50,4); +#endif + +// 2016-05-04aRagexeRE +#if PACKETVER >= 20160504 +// new packets + packet(0x0a70,2,clif->pDull/*,XXX*/); + packet(0x0a71,-1); + packet(0x0a72,61); +// changed packet sizes +#endif + +// 2016-05-11aRagexeRE +#if PACKETVER == 20160511 +// shuffle packets + packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x085e,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x0894,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x089b,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x0918,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x0920,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0940,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME +#endif + +// 2016-05-11aRagexeRE +#if PACKETVER >= 20160511 +// new packets + packet(0x0a73,6); + packet(0x0a74,8); +// changed packet sizes +#endif + +// 2016-05-18aRagexeRE +#if PACKETVER >= 20160518 +// new packets + packet(0x0a76,80); +// changed packet sizes + packet(0x0a73,2); +#endif + +// 2016-05-25aRagexeRE +#if PACKETVER == 20160525 +// shuffle packets + packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x085a,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x085e,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0867,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x086a,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0899,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x089c,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x091d,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x092c,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0937,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x0945,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x094a,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x094e,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0951,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x0956,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME +#endif + +// 2016-05-25aRagexeRE +#if PACKETVER >= 20160525 +// new packets + packet(0x0a77,15); + packet(0x0a78,15); +// changed packet sizes +#endif + +// 2016-06-01aRagexeRE +#if PACKETVER >= 20160601 +// new packets + packet(0x0a79,-1); + packet(0x0a7b,-1); + packet(0x0a7c,-1); + packet(0x0a7d,-1); +// changed packet sizes +#endif + +// 2016-06-08aRagexeRE +#if PACKETVER == 20160608 +// shuffle packets + packet(0x022d,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x02c4,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x035f,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0436,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0437,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x07ec,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x0802,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x085c,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0885,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0889,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0899,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x089b,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x08a6,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x093b,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x094d,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0958,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x095b,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x0969,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME +#endif + +// 2016-06-15aRagexeRE +#if PACKETVER == 20160615 +// shuffle packets + packet(0x0281,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x0363,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0364,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x0369,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x083c,6,clif->pGetCharNameRequest,2); // CZ_REQNAME + packet(0x0866,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0870,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x087d,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x087e,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x087f,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0884,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0887,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0888,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x088a,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x088d,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x0891,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x0898,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x092f,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x093e,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x0947,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0948,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x094a,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x094b,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0954,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x0957,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x0958,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x095c,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x095e,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0961,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK +#endif + +// 2016-06-15aRagexeRE +#if PACKETVER >= 20160615 +// new packets + packet(0x0a7e,4); + packet(0x0a7f,-1); + packet(0x0a80,2); + packet(0x0a81,3); +// changed packet sizes +#endif + +// 2016-06-22aRagexeRE +#if PACKETVER >= 20160622 +// new packets + packet(0x0a82,46); + packet(0x0a83,46); + packet(0x0a84,94); + packet(0x0a85,82); + packet(0x0a86,-1); + packet(0x0a87,4); + packet(0x0a88,2); +// changed packet sizes +#endif + +// 2016-06-29aRagexeRE +#if PACKETVER >= 20160629 +// new packets + packet(0x0a89,32); + packet(0x0a8a,6); + packet(0x0a8b,2); + packet(0x0a8c,2); + packet(0x0a8d,-1); +// changed packet sizes + packet(0x0a80,6); +#endif + +// 2016-06-30aRagexeRE +#if PACKETVER == 20160630 +// shuffle packets + packet(0x0202,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x022d,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x035f,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x0363,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0368,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x085c,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x085e,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0860,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0861,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0863,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0867,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x086b,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0881,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0885,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x088e,6,clif->pGetCharNameRequest,2); // CZ_REQNAME + packet(0x0893,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x091e,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0922,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x0925,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x0926,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x093e,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0946,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0948,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x094a,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x0957,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x095a,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0968,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x0969,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x096a,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE +#endif + +// 2016-07-06cRagexeRE +#if PACKETVER == 20160706 +// shuffle packets + packet(0x0362,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0436,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x085f,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x0860,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0869,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x086b,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0884,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x0886,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x0889,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0892,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x0899,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x08a4,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x08a5,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x08a8,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0918,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x091b,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x0924,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x0926,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x0927,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0929,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x092d,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0939,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x093d,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0944,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0945,6,clif->pGetCharNameRequest,2); // CZ_REQNAME + packet(0x094c,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x0952,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0957,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x0958,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP +#endif + +// 2016-07-06cRagexeRE +#if PACKETVER >= 20160706 +// new packets + packet(0x0a81,3); +// changed packet sizes + packet(0x0a7e,-1); + packet(0x0a89,57); +#endif + +// 2016-07-13bRagexeRE +#if PACKETVER == 20160713 +// shuffle packets + packet(0x022d,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x0363,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x0364,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x0838,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x0860,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0865,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0869,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0875,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0877,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x087b,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0883,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x088d,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0892,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x089a,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x089f,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x08a2,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x08a4,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x091c,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x091d,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0921,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0922,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x092c,6,clif->pGetCharNameRequest,2); // CZ_REQNAME + packet(0x0931,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x0939,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x0944,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0945,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0947,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x0957,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x095b,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD +#endif + +// 2016-07-13aRagexeRE +#if PACKETVER >= 20160713 +// new packets +// changed packet sizes + packet(0x0a87,-1); +#endif + +// 2016-07-20aRagexeRE +#if PACKETVER == 20160720 +// shuffle packets + packet(0x0362,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0363,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x0365,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x07e4,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0819,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0838,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x085b,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x086a,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x086d,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x087f,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0883,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x0887,6,clif->pGetCharNameRequest,2); // CZ_REQNAME + packet(0x0897,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x089a,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x089c,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x089e,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x08a0,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x08aa,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x0917,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x091c,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x092a,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x093b,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x093e,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0946,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x094d,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0953,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x095b,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0960,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x0969,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ +#endif + +// 2016-07-20aRagexeRE +#if PACKETVER >= 20160720 +// new packets + packet(0x0a8e,2); + packet(0x0a8f,2); + packet(0x0a90,3); +// changed packet sizes +#endif + +// 2016-07-27aRagexeRE +#if PACKETVER >= 20160727 +// new packets + packet(0x0a91,-1); + packet(0x0a92,-1); + packet(0x0a93,3); +// changed packet sizes +#endif + +// 2016-07-27bRagexeRE +#if PACKETVER == 20160727 +// shuffle packets + packet(0x0202,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x023b,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0362,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0363,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x0436,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0438,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x07ec,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0866,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x0868,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x0869,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x0874,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0877,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0883,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0887,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x088e,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x0891,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x089f,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x08a2,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x08a4,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x08a7,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x092e,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0936,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x0941,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0946,6,clif->pGetCharNameRequest,2); // CZ_REQNAME + packet(0x0949,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x0951,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x095f,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0966,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0969,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES +#endif + +// 2016-08-03bRagexeRE +#if PACKETVER >= 20160803 +// new packets + packet(0x0a94,2); +// changed packet sizes + packet(0x0a81,4); +#endif + +// 2016-08-31bRagexeRE +#if PACKETVER == 20160831 +// shuffle packets + packet(0x022d,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0366,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x07ec,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0835,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0865,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x086d,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0870,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0874,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x0876,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0878,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x087c,6,clif->pGetCharNameRequest,2); // CZ_REQNAME + packet(0x08a8,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x08a9,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0917,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x091b,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x092c,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x092e,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x0938,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x093a,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x0946,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x094a,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x094f,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x0950,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0954,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x0957,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x095e,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x0960,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x0964,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x0967,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL +#endif + +// 2016-09-07aRagexeRE +#if PACKETVER == 20160907 +// shuffle packets + packet(0x0202,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x022d,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x023b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0361,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0436,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x091c,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME +#endif + +// 2016-09-07aRagexeRE +#if PACKETVER >= 20160907 +// new packets + packet(0x0a95,4); +// changed packet sizes +#endif + +// 2016-09-21bRagexeRE +#if PACKETVER == 20160921 +// shuffle packets + packet(0x0202,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x022d,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x023b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0361,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0436,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x094a,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME +#endif + +// 2016-09-21bRagexeRE +#if PACKETVER >= 20160921 +// new packets + packet(0x0a96,51); +// changed packet sizes + packet(0x0a37,59); // ZC_ITEM_PICKUP_ACK_V7 +#endif + +// 2016-09-28cRagexeRE +#if PACKETVER >= 20160928 +// new packets + packet(0x0a97,8); + packet(0x0a98,12); + packet(0x0a99,8); + packet(0x0a9a,10); + packet(0x0a9b,-1); + packet(0x0a9c,2); + packet(0x0a9d,4); + packet(0x0a9e,2); + packet(0x0a9f,2); +// changed packet sizes +#endif + +// 2016-10-05aRagexeRE +#if PACKETVER >= 20161005 +// new packets + packet(0x0aa0,2,clif->pDull/*,XXX*/); + packet(0x0aa1,4); + packet(0x0aa2,-1); + packet(0x0aa3,7); + packet(0x0aa4,2); +// changed packet sizes +#endif + +// 2016-10-12aRagexeRE +#if PACKETVER == 20161012 +// shuffle packets + packet(0x023b,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0364,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x0365,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0369,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x07ec,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0819,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x085b,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x085e,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0863,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0868,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x086d,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0872,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x0875,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0880,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x0893,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x08a0,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x092d,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0936,6,clif->pGetCharNameRequest,2); // CZ_REQNAME + packet(0x0937,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0939,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0943,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0944,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x094f,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0951,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x095c,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x0962,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x0966,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0967,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD +#endif + +// 2016-10-26bRagexeRE +#if PACKETVER == 20161026 +// shuffle packets + packet(0x0363,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x0438,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0802,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x085a,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x085f,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0861,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0862,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x086a,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x086c,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x086e,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x087a,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x087c,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x087f,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x0886,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0891,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0894,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x0898,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x091a,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x091b,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x0926,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x092c,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x092e,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x092f,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0930,6,clif->pGetCharNameRequest,2); // CZ_REQNAME + packet(0x094b,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x0953,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x095c,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x095e,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0962,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION +#endif + +// 2016-10-26bRagexeRE +#if PACKETVER >= 20161026 +// new packets + packet(0x0aa5,-1); + packet(0x0aa6,36); +// changed packet sizes +#endif + +// 2016-11-09bRagexeRE +#if PACKETVER == 20161109 +// shuffle packets + packet(0x02c4,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0361,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0362,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x0365,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0366,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0835,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x085d,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x085e,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0865,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x086a,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x086d,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x0870,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0876,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x087a,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0881,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x088e,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x0891,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x0898,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x089a,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x089d,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x089f,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x08a7,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x08ad,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0927,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x0937,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x093c,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x093f,6,clif->pGetCharNameRequest,2); // CZ_REQNAME + packet(0x0954,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x0956,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION +#endif + +// 2016-11-30aRagexeRE +#if PACKETVER >= 20161130 +// new packets + packet(0x0aa7,6); + packet(0x0aa8,5); + packet(0x0aa9,-1); + packet(0x0aaa,-1); + packet(0x0aab,-1); +// changed packet sizes +#endif + +// 2016-12-07eRagexeRE +#if PACKETVER == 20161207 +// shuffle packets + packet(0x023b,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0361,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x0867,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x0868,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0875,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x087e,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x0886,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x08a1,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x08a2,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x08ad,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0918,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x091d,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x0943,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x095d,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x0965,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME +#endif + +// 2016-12-07cRagexeRE +#if PACKETVER >= 20161207 +// new packets + packet(0x0aac,67); +// changed packet sizes +#endif + +// 2016-12-14bRagexeRE +#if PACKETVER == 20161214 +// shuffle packets + packet(0x022d,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0281,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x02c4,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0360,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x0364,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0369,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0436,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0819,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x085a,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x0862,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x086d,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x0887,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0895,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0899,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x08a6,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x092e,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x093d,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME +#endif + +// 2016-12-21aRagexeRE +#if PACKETVER == 20161221 +// shuffle packets + packet(0x035f,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0366,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0438,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0817,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x085b,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0866,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0876,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x0881,6,clif->pGetCharNameRequest,2); // CZ_REQNAME + packet(0x0884,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0885,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x088c,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0890,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x0899,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x089a,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x089b,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x08aa,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x091e,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0926,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x0928,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x092c,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x092e,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0930,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x0943,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x0946,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x094b,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x095a,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0964,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0965,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION +#endif + +// 2016-12-21aRagexeRE +#if PACKETVER >= 20161221 +// new packets + packet(0x0aad,47); + packet(0x0aae,2); + packet(0x0aaf,6); + packet(0x0ab0,6); + packet(0x0ab1,10); +// changed packet sizes +#endif + +// 2016-12-28aRagexeRE +#if PACKETVER >= 20161228 +// new packets +// changed packet sizes + packet(0x0ab1,14); +#endif + +// 2017-01-04bRagexeRE +#if PACKETVER >= 20170104 +// new packets + packet(0x0ab2,7); + packet(0x0ab3,15); +// changed packet sizes +#endif + +// 2017-01-11aRagexeRE +#if PACKETVER >= 20170111 +// new packets + packet(0x0ab4,4); + packet(0x0ab5,2); + packet(0x0ab6,6); + packet(0x0ab7,4); + packet(0x0ab8,2); + packet(0x0ab9,39); +// changed packet sizes +#endif + +// 2017-01-18aRagexeRE +#if PACKETVER >= 20170118 +// new packets + packet(0x0aba,2); + packet(0x0abb,2); +// changed packet sizes + packet(0x0aad,51); + packet(0x0ab3,19); +#endif + +// 2017-02-01aRagexeRE +#if PACKETVER >= 20170201 +// new packets + packet(0x0abc,-1); +// changed packet sizes +#endif + +// 2017-02-15aRagexeRE +#if PACKETVER >= 20170215 +// new packets + packet(0x0abd,10); +// changed packet sizes +#endif + +// 2017-02-22aRagexeRE +#if PACKETVER >= 20170222 +// new packets + packet(0x0abe,116); + packet(0x0abf,114); +// changed packet sizes +#endif + +// 2017-02-28aRagexeRE +#if PACKETVER >= 20170228 +// new packets + packet(0x0ac0,26); + packet(0x0ac1,26); + packet(0x0ac2,-1); + packet(0x0ac3,2); + packet(0x0ac4,-1); + packet(0x0ac5,156,clif->pDull/*,XXX*/); + packet(0x0ac6,156); + packet(0x0ac7,156); +// changed packet sizes + packet(0x0abe,-1); + packet(0x0abf,-1); +#endif + +// 2017-03-08bRagexeRE +#if PACKETVER >= 20170308 +// new packets + packet(0x0ac8,2); + packet(0x0ac9,-1); +// changed packet sizes +#endif + +// 2017-03-22aRagexeRE +#if PACKETVER >= 20170322 +// new packets + packet(0x0aca,3); +// changed packet sizes +#endif + +// 2017-03-29cRagexeRE +#if PACKETVER >= 20170329 +// new packets +// changed packet sizes + packet(0x0aac,69); +#endif + +// 2017-04-05bRagexeRE +#if PACKETVER >= 20170405 +// new packets + packet(0x0acb,12); + packet(0x0acc,18); +// changed packet sizes +#endif + +// 2017-04-19bRagexeRE +#if PACKETVER >= 20170419 +// new packets + packet(0x0acd,23); +// changed packet sizes + packet(0x0a99,4); +#endif + /* PacketKeys: http://herc.ws/board/topic/1105-hercules-wpe-free-june-14th-patch/ */ #if PACKETVER >= 20110817 packetKeys(0x053D5CED,0x3DED6DED,0x6DED6DED); /* Thanks to Shakto */ @@ -4658,6 +6140,107 @@ packet(0x96e,-1,clif->ackmergeitems); packetKeys(0x347D68D0,0x2C705320,0x7B4A199D); /* 4144 */ #endif +#if PACKETVER == 20160127 + packetKeys(0x6B1E7146,0x612C47E6,0x274E56EE); /* 4144 */ +#endif + +#if PACKETVER == 20160203 + packetKeys(0x3E1411AF,0x6C744497,0x7CFA1BDE); /* 4144 */ +#endif + +#if PACKETVER == 20160217 + packetKeys(0x25895A8E,0x09421C19,0x763A2D7A); /* 4144 */ +#endif + +#if PACKETVER == 20160302 + packetKeys(0x7B4441B9,0x5BBC63AF,0x45DA0E71); /* 4144 */ +#endif + +#if PACKETVER == 20160309 + packetKeys(0x21587520,0x353A7706,0x1B722B25); /* 4144 */ +#endif + +#if PACKETVER == 20160330 + packetKeys(0x02050940,0x545336FF,0x7E7D4902); /* 4144 */ +#endif + +#if PACKETVER == 20160420 + packetKeys(0x67D2163A,0x3068215B,0x4835474D); /* 4144 */ +#endif + +#if PACKETVER == 20160511 + packetKeys(0x3C666FE2,0x27E84E3E,0x53E11BA5); /* 4144 */ +#endif + +#if PACKETVER == 20160525 + packetKeys(0x485C45B6,0x47DC6192,0x76B34A36); /* 4144 */ +#endif + +#if PACKETVER == 20160608 + packetKeys(0x11D74609,0x77C43E8A,0x44290F53); /* 4144 */ +#endif + +#if PACKETVER == 20160615 + packetKeys(0x062C5C26,0x6CF47E82,0x4DD53480); /* 4144 */ +#endif + +#if PACKETVER == 20160630 + packetKeys(0x0DF31CCC,0x54281606,0x5C4C6855); /* 4144 */ +#endif + +#if PACKETVER == 20160706 + packetKeys(0x33A766D0,0x743F04F8,0x0FA0276C); /* 4144 */ +#endif + +#if PACKETVER == 20160713 + packetKeys(0x714F2495,0x7DDC6F32,0x3FD8533D); /* 4144 */ +#endif + +#if PACKETVER == 20160720 + packetKeys(0x4F8A19C0,0x2D8E085C,0x37BB67D6); /* 4144 */ +#endif + +#if PACKETVER == 20160727 + packetKeys(0x3C6952AB,0x26E4077F,0x37E25DF7); /* 4144 */ +#endif + +#if PACKETVER == 20160831 + packetKeys(0x564E13B0,0x7F680549,0x382D273B); /* 4144 */ +#endif + +#if PACKETVER == 20160907 + packetKeys(0x32E5237D,0x57BD4DBD,0x5DBD5DBD); /* 4144 */ +#endif + +#if PACKETVER == 20160921 + packetKeys(0x11CD15CD,0x15CD15CD,0x15CD15CD); /* 4144 */ +#endif + +#if PACKETVER == 20161012 + packetKeys(0x5E2311F2,0x14FD012C,0x76EB64F6); /* 4144 */ +#endif + +#if PACKETVER == 20161026 + packetKeys(0x2CB86AE6,0x7D12660E,0x1B004DEB); /* 4144 */ +#endif + +#if PACKETVER == 20161109 + packetKeys(0x0A5277C0,0x2DB17506,0x0E8F26DA); /* 4144 */ +#endif + +#if PACKETVER == 20161207 + packetKeys(0x52D267AA,0x4FE42156,0x1292153E); /* 4144 */ +#endif + +#if PACKETVER == 20161214 + packetKeys(0x4DDE217B,0x07863AE0,0x5B591656); /* 4144 */ +#endif + +#if PACKETVER == 20161221 + packetKeys(0x69CB4F56,0x793C165E,0x673A2354); /* 4144 */ +#endif + + #if defined(OBFUSCATIONKEY1) && defined(OBFUSCATIONKEY2) && defined(OBFUSCATIONKEY3) packetKeys(OBFUSCATIONKEY1,OBFUSCATIONKEY2,OBFUSCATIONKEY3); #endif diff --git a/src/map/pc.c b/src/map/pc.c index e9855c16d..f40fba8ae 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -741,7 +741,8 @@ int pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int lo sd->client_tick = client_tick; sd->state.active = 0; //to be set to 1 after player is fully authed and loaded. sd->bl.type = BL_PC; - sd->canlog_tick = timer->gettick(); + if (battle_config.prevent_logout_trigger & PLT_LOGIN) + sd->canlog_tick = timer->gettick(); //Required to prevent homunculus copuing a base speed of 0. sd->battle_status.speed = sd->base_status.speed = DEFAULT_WALK_SPEED; sd->state.warp_clean = 1; @@ -4840,17 +4841,43 @@ int pc_isUseitem(struct map_session_data *sd,int n) switch( nameid ) { // TODO: Is there no better way to handle this, other than hardcoding item IDs? case ITEMID_ANODYNE: - if( map_flag_gvg2(sd->bl.m) ) - return 0; - /* Fall through */ - case ITEMID_ALOEBERA: - if( pc_issit(sd) ) + if (map_flag_gvg2(sd->bl.m)) return 0; break; + + case ITEMID_GIANT_FLY_WING: { + struct party_data *p; + + if (!sd->status.party_id) { + clif->msgtable(sd, MSG_PARTY_MEMBER_NOT_SUMMONED); + break; + } + + if ((p = party->search(sd->status.party_id)) != NULL) { + int i; + int16 m; + + ARR_FIND(0, MAX_PARTY, i, p->data[i].sd == sd); + + if (i == MAX_PARTY || !p->party.member[i].leader) { + clif->msgtable(sd, MSG_PARTY_MEMBER_NOT_SUMMONED); + break; + } + + m = sd->bl.m; + + ARR_FIND(0, MAX_PARTY, i, p->data[i].sd && p->data[i].sd != sd && p->data[i].sd->bl.m == m); + + if (i == MAX_PARTY || pc_isdead(p->data[i].sd)) { + clif->msgtable(sd, MSG_PARTY_NO_MEMBER_IN_MAP); + break; + } + } + } + FALLTHROUGH case ITEMID_WING_OF_FLY: - case ITEMID_GIANT_FLY_WING: - if( map->list[sd->bl.m].flag.noteleport || map_flag_gvg2(sd->bl.m) ) { - clif->skill_mapinfomessage(sd,0); + if (map->list[sd->bl.m].flag.noteleport || map_flag_gvg2(sd->bl.m)) { + clif->skill_mapinfomessage(sd, 0); return 0; } /* Fall through */ @@ -4876,25 +4903,6 @@ int pc_isUseitem(struct map_session_data *sd,int n) if( map->list[sd->bl.m].flag.nobranch || map_flag_gvg2(sd->bl.m) ) return 0; break; - case ITEMID_BUBBLE_GUM: - case ITEMID_COMP_BUBBLE_GUM: - if( sd->sc.data[SC_CASH_RECEIVEITEM] ) - return 0; - break; - case ITEMID_BATTLE_MANUAL: - case ITEMID_COMP_BATTLE_MANUAL: - case ITEMID_THICK_MANUAL50: - case ITEMID_NOBLE_NAMEPLATE: - case ITEMID_BATTLE_MANUAL25: - case ITEMID_BATTLE_MANUAL100: - case ITEMID_BATTLE_MANUAL_X3: - if( sd->sc.data[SC_CASH_PLUSEXP] ) - return 0; - break; - case ITEMID_JOB_MANUAL50: - if( sd->sc.data[SC_CASH_PLUSONLYJOBEXP] ) - return 0; - break; // Mercenary Items case ITEMID_MERCENARY_RED_POTION: @@ -4921,17 +4929,6 @@ int pc_isUseitem(struct map_session_data *sd,int n) if( nameid >= ITEMID_BOW_MERCENARY_SCROLL1 && nameid <= ITEMID_SPEARMERCENARY_SCROLL10 && sd->md != NULL ) // Mercenary Scrolls return 0; - /** - * Only Rune Knights may use runes - **/ - if (itemdb_is_rune(nameid) && (sd->job & MAPID_THIRDMASK) != MAPID_RUNE_KNIGHT) - return 0; - /** - * Only GCross may use poisons - **/ - else if (itemdb_is_poison(nameid) && (sd->job & MAPID_THIRDMASK) != MAPID_GUILLOTINE_CROSS) - return 0; - if( item->package || item->group ) { if (pc_is90overweight(sd)) { clif->msgtable(sd, MSG_ITEM_CANT_OBTAIN_WEIGHT); @@ -5019,10 +5016,11 @@ int pc_useitem(struct map_session_data *sd,int n) { nullpo_ret(sd); Assert_ret(n >= 0 && n < MAX_INVENTORY); - if( sd->npc_id || sd->state.workinprogress&1 ){ - /* TODO: add to clif->messages enum */ -#ifdef RENEWAL - clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS); // TODO look for the client date that has this message. + if (sd->npc_id || sd->state.workinprogress & 1) { +#if PACKETVER >= 20110309 + clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS); +#else + clif->messagecolor_self(sd->fd, COLOR_WHITE, msg_sd(sd, 48)); #endif return 0; } @@ -5058,10 +5056,8 @@ int pc_useitem(struct map_session_data *sd,int n) { )) return 0; - //Prevent mass item usage. [Skotlex] - if( DIFF_TICK(sd->canuseitem_tick, tick) > 0 || - (itemdb_iscashfood(nameid) && DIFF_TICK(sd->canusecashfood_tick, tick) > 0) - ) + // Prevent mass item usage. [Skotlex] + if (DIFF_TICK(sd->canuseitem_tick, tick) > 0) return 0; /* Items with delayed consume are not meant to work while in mounts except reins of mount(12622) */ @@ -5078,15 +5074,22 @@ int pc_useitem(struct map_session_data *sd,int n) { if( sd->inventory_data[n]->flag.delay_consume && ( sd->ud.skilltimer != INVALID_TIMER /*|| !status->check_skilluse(&sd->bl, &sd->bl, ALL_RESURRECTION, 0)*/ ) ) return 0; - if( sd->inventory_data[n]->delay > 0 ) { - ARR_FIND(0, MAX_ITEMDELAYS, i, sd->item_delay[i].nameid == nameid ); - if( i == MAX_ITEMDELAYS ) /* item not found. try first empty now */ - ARR_FIND(0, MAX_ITEMDELAYS, i, !sd->item_delay[i].nameid ); - if( i < MAX_ITEMDELAYS ) { - if( sd->item_delay[i].nameid ) {// found - if( DIFF_TICK(sd->item_delay[i].tick, tick) > 0 ) { - int e_tick = (int)(DIFF_TICK(sd->item_delay[i].tick, tick)/1000); - clif->msgtable_num(sd, MSG_SECONDS_UNTIL_USE, e_tick + 1); // [%d] seconds left until you can use + if (sd->inventory_data[n]->delay > 0) { + ARR_FIND(0, MAX_ITEMDELAYS, i, sd->item_delay[i].nameid == nameid); + if (i == MAX_ITEMDELAYS) /* item not found. try first empty now */ + ARR_FIND(0, MAX_ITEMDELAYS, i, sd->item_delay[i].nameid == 0); + if (i < MAX_ITEMDELAYS) { + if (sd->item_delay[i].nameid != 0) {// found + if (DIFF_TICK(sd->item_delay[i].tick, tick) > 0) { + int delay_tick = (int)(DIFF_TICK(sd->item_delay[i].tick, tick) / 1000); +#if PACKETVER >= 20101123 + clif->msgtable_num(sd, MSG_SECONDS_UNTIL_USE, delay_tick + 1); // [%d] seconds left until you can use +#else + char delay_msg[100]; + clif->msgtable_num(sd, MSG_SECONDS_UNTIL_USE, delay_tick + 1); // [%d] seconds left until you can use + sprintf(delay_msg, msg_sd(sd, 26), delay_tick + 1); + clif->messagecolor_self(sd->fd, COLOR_YELLOW, delay_msg); +#endif return 0; // Delay has not expired yet } } else {// not yet used item (all slots are initially empty) @@ -5147,10 +5150,8 @@ int pc_useitem(struct map_session_data *sd,int n) { script->potion_flag = 3; //Even more effective potions. } - //Update item use time. + // Update item use time. sd->canuseitem_tick = tick + battle_config.item_use_interval; - if( itemdb_iscashfood(nameid) ) - sd->canusecashfood_tick = tick + battle_config.cashfood_use_interval; script->run_use_script(sd, sd->inventory_data[n], npc->fake_nd->bl.id); script->potion_flag = 0; @@ -5467,13 +5468,6 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil //Logs items, Stolen from mobs [Lupus] logs->pick_mob(md, LOG_TYPE_STEAL, -1, &tmp_item, data); - //A Rare Steal Global Announce by Lupus - if(md->db->dropitem[i].p<=battle_config.rare_drop_announce) { - char message[128]; - sprintf (message, msg_txt(542), sd->status.name, md->db->jname, data->jname, (float)md->db->dropitem[i].p / 100); - //MSG: "'%s' stole %s's %s (chance: %0.02f%%)" - intif->broadcast(message, (int)strlen(message)+1, BC_DEFAULT); - } return 1; } @@ -7619,22 +7613,42 @@ int pc_skillatk_bonus(struct map_session_data *sd, uint16 skill_id) return bonus; } -int pc_skillheal_bonus(struct map_session_data *sd, uint16 skill_id) { +int pc_skillheal_bonus(struct map_session_data *sd, uint16 skill_id) +{ int i, bonus = sd->bonus.add_heal_rate; - if( bonus ) { - switch( skill_id ) { - case AL_HEAL: if( !(battle_config.skill_add_heal_rate&1) ) bonus = 0; break; - case PR_SANCTUARY: if( !(battle_config.skill_add_heal_rate&2) ) bonus = 0; break; - case AM_POTIONPITCHER: if( !(battle_config.skill_add_heal_rate&4) ) bonus = 0; break; - case CR_SLIMPITCHER: if( !(battle_config.skill_add_heal_rate&8) ) bonus = 0; break; - case BA_APPLEIDUN: if( !(battle_config.skill_add_heal_rate&16)) bonus = 0; break; + if (bonus) { + switch (skill_id) { + case AL_HEAL: + if ((battle_config.skill_add_heal_rate & 1) == 0) + bonus = 0; + break; + case PR_SANCTUARY: + if ((battle_config.skill_add_heal_rate & 2) == 0) + bonus = 0; + break; + case AM_POTIONPITCHER: + if ((battle_config.skill_add_heal_rate & 4) == 0) + bonus = 0; + break; + case CR_SLIMPITCHER: + if ((battle_config.skill_add_heal_rate & 8) == 0) + bonus = 0; + break; + case BA_APPLEIDUN: + if ((battle_config.skill_add_heal_rate & 16) == 0) + bonus = 0; + break; + case AB_HIGHNESSHEAL: + if ((battle_config.skill_add_heal_rate & 32) == 0) + bonus = 0; + break; } } ARR_FIND(0, ARRAYLENGTH(sd->skillheal), i, sd->skillheal[i].id == skill_id); - if( i < ARRAYLENGTH(sd->skillheal) ) + if (i < ARRAYLENGTH(sd->skillheal)) bonus += sd->skillheal[i].val; return bonus; @@ -7703,7 +7717,8 @@ void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int h if( sd->status.ele_id > 0 ) elemental->set_target(sd,src); - sd->canlog_tick = timer->gettick(); + if (battle_config.prevent_logout_trigger & PLT_DAMAGE) + sd->canlog_tick = timer->gettick(); } /*========================================== @@ -8096,6 +8111,7 @@ int pc_readparam(const struct map_session_data *sd, int type) case SP_SKILLPOINT: val = sd->status.skill_point; break; case SP_STATUSPOINT: val = sd->status.status_point; break; case SP_ZENY: val = sd->status.zeny; break; + case SP_BANKVAULT: val = sd->status.bank_vault; break; case SP_BASELEVEL: val = sd->status.base_level; break; case SP_JOBLEVEL: val = sd->status.job_level; break; case SP_CLASS: val = sd->status.class; break; @@ -8240,6 +8256,7 @@ int pc_readparam(const struct map_session_data *sd, int type) *------------------------------------------*/ int pc_setparam(struct map_session_data *sd,int type,int val) { + int delta; nullpo_ret(sd); switch(type){ @@ -8290,6 +8307,19 @@ int pc_setparam(struct map_session_data *sd,int type,int val) logs->zeny(sd, LOG_TYPE_SCRIPT, sd, -(sd->status.zeny - cap_value(val, 0, MAX_ZENY))); sd->status.zeny = cap_value(val, 0, MAX_ZENY); break; + case SP_BANKVAULT: + val = cap_value(val, 0, MAX_BANK_ZENY); + delta = (val - sd->status.bank_vault); + sd->status.bank_vault = val; + if (map->save_settings & 256) { + chrif->save(sd, 0); // send to char server + } + if (delta > 0) { + clif->bank_deposit(sd, BDA_SUCCESS); + } else if (delta < 0) { + clif->bank_withdraw(sd, BWA_SUCCESS); + } + return 1; // the vault uses a different packet case SP_BASEEXP: if(pc->nextbaseexp(sd) > 0) { sd->status.base_exp = val; @@ -9985,51 +10015,51 @@ void pc_unequipitem_pos(struct map_session_data *sd, int n, int pos) *------------------------------------------*/ int pc_unequipitem(struct map_session_data *sd,int n,int flag) { - int i,iflag; - bool status_cacl = false; + int i, iflag; + bool status_calc = false; int pos; + nullpo_ret(sd); - if( n < 0 || n >= MAX_INVENTORY ) { - clif->unequipitemack(sd,0,0,UIA_FAIL); + if (n < 0 || n >= MAX_INVENTORY) { + clif->unequipitemack(sd, 0, 0, UIA_FAIL); return 0; } // if player is berserk then cannot unequip - if (!(flag&PCUNEQUIPITEM_FORCE) && sd->sc.count && (sd->sc.data[SC_BERSERK] || sd->sc.data[SC_NO_SWITCH_EQUIP]) ) - { - clif->unequipitemack(sd,n,0,UIA_FAIL); + if (!(flag & PCUNEQUIPITEM_FORCE) && sd->sc.count && (sd->sc.data[SC_BERSERK] || sd->sc.data[SC_NO_SWITCH_EQUIP])) { + clif->unequipitemack(sd, n, 0, UIA_FAIL); return 0; } - if( !(flag&PCUNEQUIPITEM_FORCE) && sd->sc.count && sd->sc.data[SC_KYOUGAKU] ) - { - clif->unequipitemack(sd,n,0,UIA_FAIL); + if (!(flag & PCUNEQUIPITEM_FORCE) && sd->sc.count && sd->sc.data[SC_KYOUGAKU]) { + clif->unequipitemack(sd, n, 0, UIA_FAIL); return 0; } - if(battle_config.battle_log) + if (battle_config.battle_log) ShowInfo("unequip %d %x:%x\n", n, (unsigned int)(pc->equippoint(sd, n)), sd->status.inventory[n].equip); - if(!sd->status.inventory[n].equip){ //Nothing to unequip - clif->unequipitemack(sd,n,0,UIA_FAIL); + if (sd->status.inventory[n].equip == 0) { //Nothing to unequip + clif->unequipitemack(sd, n, 0, UIA_FAIL); return 0; } - for(i=0;i<EQI_MAX;i++) { - if(sd->status.inventory[n].equip & pc->equip_pos[i]) + + for (i = 0; i < EQI_MAX; i++) { + if (sd->status.inventory[n].equip & pc->equip_pos[i]) sd->equip_index[i] = -1; } pos = sd->status.inventory[n].equip; pc->unequipitem_pos(sd, n, pos); - clif->unequipitemack(sd,n,pos,UIA_SUCCESS); + clif->unequipitemack(sd, n, pos, UIA_SUCCESS); - if((pos & EQP_ARMS) && - sd->weapontype1 == 0 && sd->weapontype2 == 0 && (!sd->sc.data[SC_TK_SEVENWIND] || sd->sc.data[SC_ASPERSIO])) //Check for seven wind (but not level seven!) - skill->enchant_elemental_end(&sd->bl,-1); + if ((pos & EQP_ARMS) && + sd->weapontype1 == 0 && sd->weapontype2 == 0 && (sd->sc.data[SC_TK_SEVENWIND] == 0 || sd->sc.data[SC_ASPERSIO])) //Check for seven wind (but not level seven!) + skill->enchant_elemental_end(&sd->bl, -1); - if(pos & EQP_ARMOR) { + if (pos & EQP_ARMOR) { // On Armor Change... status_change_end(&sd->bl, SC_BENEDICTIO, INVALID_TIMER); status_change_end(&sd->bl, SC_ARMOR_RESIST, INVALID_TIMER); @@ -10043,74 +10073,84 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) if( sd->state.autobonus&pos ) sd->state.autobonus &= ~sd->status.inventory[n].equip; //Check for activated autobonus [Inkfish] - sd->status.inventory[n].equip=0; + sd->status.inventory[n].equip = 0; iflag = sd->npc_item_flag; /* check for combos (MUST be before status_calc_pc) */ - if ( sd->inventory_data[n] ) { - if( sd->inventory_data[n]->combos_count ) { - if( pc->removecombo(sd,sd->inventory_data[n]) ) - status_cacl = true; - } if(itemdb_isspecial(sd->status.inventory[n].card[0])) - ; //No cards - else { - for( i = 0; i < sd->inventory_data[n]->slot; i++ ) { + if (sd->inventory_data[n] != NULL) { + if (sd->inventory_data[n]->combos_count) { + if (pc->removecombo(sd, sd->inventory_data[n])) + status_calc = true; + } + if (itemdb_isspecial(sd->status.inventory[n].card[0]) == false) { + for (i = 0; i < sd->inventory_data[n]->slot; i++) { struct item_data *data; - if (!sd->status.inventory[n].card[i]) + if (sd->status.inventory[n].card[i] == 0) continue; - if ( ( data = itemdb->exists(sd->status.inventory[n].card[i]) ) != NULL ) { - if( data->combos_count ) { - if( pc->removecombo(sd,data) ) - status_cacl = true; + if ((data = itemdb->exists(sd->status.inventory[n].card[i])) != NULL) { + if (data->combos_count) { + if (pc->removecombo(sd, data)) + status_calc = true; } } } } + /* Item Options checking */ + for (i = 0; i < MAX_ITEM_OPTIONS; i++) { + struct item_option *ito = NULL; + int16 item_option = sd->status.inventory[n].option[i].index; + + if (item_option <= 0) + continue; + if ((ito = itemdb->option_exists(sd->status.inventory[n].option[i].index)) == NULL) + continue; + + status_calc = true; + } } - if(flag&PCUNEQUIPITEM_RECALC || status_cacl) { + if (flag & PCUNEQUIPITEM_RECALC || status_calc) { pc->checkallowskill(sd); - status_calc_pc(sd,SCO_NONE); + status_calc_pc(sd, SCO_NONE); } - if(sd->sc.data[SC_CRUCIS] && !battle->check_undead(sd->battle_status.race,sd->battle_status.def_ele)) + if (sd->sc.data[SC_CRUCIS] && battle->check_undead(sd->battle_status.race, sd->battle_status.def_ele) == false) status_change_end(&sd->bl, SC_CRUCIS, INVALID_TIMER); //OnUnEquip script [Skotlex] - if (sd->inventory_data[n]) { - if (sd->inventory_data[n]->unequip_script) { - if ( battle_config.unequip_restricted_equipment & 1 ) { - ARR_FIND(0, map->list[sd->bl.m].zone->disabled_items_count, i, map->list[sd->bl.m].zone->disabled_items[i] == sd->status.inventory[n].nameid); - if ( i == map->list[sd->bl.m].zone->disabled_items_count ) + if (sd->inventory_data[n] != NULL) { + if (sd->inventory_data[n]->unequip_script != NULL) { + if (battle_config.unequip_restricted_equipment & 1) { + ARR_FIND(0, map->list[sd->bl.m].zone->disabled_items_count, i, map->list[sd->bl.m].zone->disabled_items[i] == sd->status.inventory[n].nameid); + if (i == map->list[sd->bl.m].zone->disabled_items_count) script->run_item_unequip_script(sd, sd->inventory_data[n], npc->fake_nd->bl.id); } else script->run_item_unequip_script(sd, sd->inventory_data[n], npc->fake_nd->bl.id); } - if(itemdb_isspecial(sd->status.inventory[n].card[0])) - ; //No cards - else { - for( i = 0; i < sd->inventory_data[n]->slot; i++ ) { - struct item_data *data; - if (!sd->status.inventory[n].card[i]) + if (itemdb_isspecial(sd->status.inventory[n].card[0]) == false) { + for (i = 0; i < sd->inventory_data[n]->slot; i++) { + struct item_data *data = NULL; + if (sd->status.inventory[n].card[i] == 0) continue; - if ( ( data = itemdb->exists(sd->status.inventory[n].card[i]) ) != NULL ) { - if ( data->unequip_script ) { - if ( battle_config.unequip_restricted_equipment & 2 ) { + if ((data = itemdb->exists(sd->status.inventory[n].card[i])) != NULL) { + if (data->unequip_script) { + if (battle_config.unequip_restricted_equipment & 2) { int j; - ARR_FIND(0, map->list[sd->bl.m].zone->disabled_items_count, j, map->list[sd->bl.m].zone->disabled_items[j] == sd->status.inventory[n].card[i]); - if ( j == map->list[sd->bl.m].zone->disabled_items_count ) + ARR_FIND(0, map->list[sd->bl.m].zone->disabled_items_count, j, map->list[sd->bl.m].zone->disabled_items[j] == sd->status.inventory[n].card[i]); + if (j == map->list[sd->bl.m].zone->disabled_items_count) script->run_item_unequip_script(sd, data, npc->fake_nd->bl.id); - } - else + } else { script->run_item_unequip_script(sd, data, npc->fake_nd->bl.id); + } } } } } } + sd->npc_item_flag = iflag; return 1; diff --git a/src/map/pc.h b/src/map/pc.h index 0e4f1affd..482e30c41 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -73,6 +73,14 @@ enum equip_index { EQI_MAX }; +enum prevent_logout_trigger { + PLT_NONE = 0x0, + PLT_LOGIN = 0x1, + PLT_ATTACK = 0x2, + PLT_SKILL = 0x4, + PLT_DAMAGE = 0x8 +}; + enum pc_unequipitem_flag { PCUNEQUIPITEM_NONE = 0x0, ///< Just unequip PCUNEQUIPITEM_RECALC = 0x1, ///< Recalculate status after unequipping diff --git a/src/map/script.c b/src/map/script.c index bea0fe47c..b0922e3f8 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -2384,6 +2384,7 @@ void script_load_parameters(void) {"SkillPoint", SP_SKILLPOINT}, {"Class", SP_CLASS}, {"Zeny", SP_ZENY}, + {"BankVault", SP_BANKVAULT}, {"Sex", SP_SEX}, {"NextBaseExp", SP_NEXTBASEEXP}, {"NextJobExp", SP_NEXTJOBEXP}, @@ -6690,9 +6691,10 @@ BUILDIN(warpchar) { return true; } /*========================================== - * Warpparty - [Fredzilla] [Paradox924X] - * Syntax: warpparty "to_mapname",x,y,Party_ID,{"from_mapname"}; + * Warpparty - [Fredzilla] [Paradox924X] [Jedzkie] [Dastgir] + * Syntax: warpparty("<to_mapname>", <x>, <y>, <party_id>, "<from_mapname>", <include_leader>) * If 'from_mapname' is specified, only the party members on that map will be warped + * If 'include_leader' option is set to false, the leader will be warped too. *------------------------------------------*/ BUILDIN(warpparty) { @@ -6702,78 +6704,84 @@ BUILDIN(warpparty) int type; int map_index; int i; + bool include_leader = true; - const char* str = script_getstr(st,2); - int x = script_getnum(st,3); - int y = script_getnum(st,4); - int p_id = script_getnum(st,5); + const char* str = script_getstr(st, 2); + int x = script_getnum(st, 3); + int y = script_getnum(st, 4); + int p_id = script_getnum(st, 5); const char* str2 = NULL; - if ( script_hasdata(st,6) ) - str2 = script_getstr(st,6); + + if (script_hasdata(st, 6)) + str2 = script_getstr(st, 6); + if (script_hasdata(st, 7)) + include_leader = script_getnum(st, 7); p = party->search(p_id); - if(!p) + + if (p == NULL) return true; - type = ( strcmp(str,"Random")==0 ) ? 0 - : ( strcmp(str,"SavePointAll")==0 ) ? 1 - : ( strcmp(str,"SavePoint")==0 ) ? 2 - : ( strcmp(str,"Leader")==0 ) ? 3 + type = (strcmp(str, "Random") == 0) ? 0 + : (strcmp(str, "SavePointAll") == 0) ? 1 + : (strcmp(str, "SavePoint") == 0) ? 2 + : (strcmp(str, "Leader") == 0) ? 3 : 4; - switch (type) - { - case 3: - for(i = 0; i < MAX_PARTY && !p->party.member[i].leader; i++); - if (i == MAX_PARTY || !p->data[i].sd) //Leader not found / not online - return true; - pl_sd = p->data[i].sd; - map_index = pl_sd->mapindex; - x = pl_sd->bl.x; - y = pl_sd->bl.y; - break; - case 4: - map_index = script->mapindexname2id(st,str); - break; - case 2: - //"SavePoint" uses save point of the currently attached player - if (( sd = script->rid2sd(st) ) == NULL ) - return true; - /* Fall through */ - default: - map_index = 0; - break; + switch (type) { + case 3: + ARR_FIND(0, MAX_PARTY, i, p->party.member[i].leader); + if (i == MAX_PARTY || !p->data[i].sd) // Leader not found / not online + return true; + pl_sd = p->data[i].sd; + map_index = pl_sd->mapindex; + x = pl_sd->bl.x; + y = pl_sd->bl.y; + break; + case 4: + map_index = script->mapindexname2id(st, str); + break; + case 2: + // "SavePoint" uses save point of the currently attached player + if ((sd = script->rid2sd(st)) == NULL) + return true; + /* Fall through */ + default: + map_index = 0; + break; } for (i = 0; i < MAX_PARTY; i++) { - if( !(pl_sd = p->data[i].sd) || pl_sd->status.party_id != p_id ) + if (!(pl_sd = p->data[i].sd) || pl_sd->status.party_id != p_id) continue; - if( str2 && strcmp(str2, map->list[pl_sd->bl.m].name) != 0 ) + if (str2 && strcmp(str2, map->list[pl_sd->bl.m].name) != 0) continue; - if( pc_isdead(pl_sd) ) + if (pc_isdead(pl_sd)) continue; - switch( type ) - { - case 0: // Random - if(!map->list[pl_sd->bl.m].flag.nowarp) - pc->randomwarp(pl_sd,CLR_TELEPORT); - break; - case 1: // SavePointAll - if(!map->list[pl_sd->bl.m].flag.noreturn) - pc->setpos(pl_sd,pl_sd->status.save_point.map,pl_sd->status.save_point.x,pl_sd->status.save_point.y,CLR_TELEPORT); - break; - case 2: // SavePoint - if(!map->list[pl_sd->bl.m].flag.noreturn) - pc->setpos(pl_sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT); - break; - case 3: // Leader - case 4: // m,x,y - if(!map->list[pl_sd->bl.m].flag.noreturn && !map->list[pl_sd->bl.m].flag.nowarp) - pc->setpos(pl_sd,map_index,x,y,CLR_TELEPORT); - break; + if (include_leader == false && p->party.member[i].leader) + continue; + + switch( type ) { + case 0: // Random + if (!map->list[pl_sd->bl.m].flag.nowarp) + pc->randomwarp(pl_sd, CLR_TELEPORT); + break; + case 1: // SavePointAll + if (!map->list[pl_sd->bl.m].flag.noreturn) + pc->setpos(pl_sd, pl_sd->status.save_point.map, pl_sd->status.save_point.x, pl_sd->status.save_point.y, CLR_TELEPORT); + break; + case 2: // SavePoint + if (!map->list[pl_sd->bl.m].flag.noreturn) + pc->setpos(pl_sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT); + break; + case 3: // Leader + case 4: // m,x,y + if (!map->list[pl_sd->bl.m].flag.noreturn && !map->list[pl_sd->bl.m].flag.nowarp) + pc->setpos(pl_sd, map_index, x, y, CLR_TELEPORT); + break; } } @@ -9950,7 +9958,13 @@ BUILDIN(end) { BUILDIN(checkoption) { int option; - struct map_session_data *sd = script->rid2sd(st); + struct map_session_data *sd; + + if (script_hasdata(st, 3)) + sd = map->id2sd(script_getnum(st, 3)); + else + sd = script->rid2sd(st); + if (sd == NULL) return true;// no player attached, report source @@ -9969,7 +9983,13 @@ BUILDIN(checkoption) BUILDIN(checkoption1) { int opt1; - struct map_session_data *sd = script->rid2sd(st); + struct map_session_data *sd; + + if (script_hasdata(st, 3)) + sd = map->id2sd(script_getnum(st, 3)); + else + sd = script->rid2sd(st); + if (sd == NULL) return true;// no player attached, report source @@ -9988,7 +10008,13 @@ BUILDIN(checkoption1) BUILDIN(checkoption2) { int opt2; - struct map_session_data *sd = script->rid2sd(st); + struct map_session_data *sd; + + if (script_hasdata(st, 3)) + sd = map->id2sd(script_getnum(st, 3)); + else + sd = script->rid2sd(st); + if (sd == NULL) return true;// no player attached, report source @@ -10012,7 +10038,13 @@ BUILDIN(setoption) { int option; int flag = 1; - struct map_session_data *sd = script->rid2sd(st); + struct map_session_data *sd; + + if (script_hasdata(st, 4)) + sd = map->id2sd(script_getnum(st, 4)); + else + sd = script->rid2sd(st); + if (sd == NULL) return true;// no player attached, report source @@ -17744,6 +17776,1592 @@ BUILDIN(getunittype) { return true; } +/** + * Sets real-time unit data for a game object. + * Setunitdata <GUID>,<DataType>,<Val1>{,<Val2>,<Val3>} + * @param1 GUID GID of the unit. + * @param2 DataType Type of Data to be set for the unit. + * @param3 Value#1 Value to be passed as change in data. + * @param4 Value#2 Optional int value to be passed for certain data types. + * @param5 Value#3 Optional int value to be passed for certain data types. + * @return 1 on success, 0 on failure. + */ +BUILDIN(setunitdata) +{ + struct block_list *bl = NULL; + const char *mapname = NULL, *udtype = NULL; + int type = 0, val = 0, val2 = 0, val3 = 0; + struct map_session_data *tsd = NULL; + + bl = map->id2bl(script_getnum(st, 2)); + + if (bl == NULL) { + ShowWarning("buildin_setunitdata: Error in finding object with given GID %d!\n", script_getnum(st, 2)); + script_pushint(st, 0); + return false; + } + + type = script_getnum(st, 3); + + /* type bounds */ + if (type < UDT_SIZE || type >= UDT_MAX) { // Note: UDT_TYPE is not valid here + ShowError("buildin_setunitdata: Invalid unit data type %d provided.\n", type); + script_pushint(st, 0); + return false; + } + + /* Mandatory Argument 3 */ + if (type == UDT_MAPIDXY) { + if (!script_isstringtype(st, 4)) { + ShowError("buildin_setunitdata: Invalid data type for argument #3.\n"); + script_pushint(st, 0); + return false; + } + mapname = script_getstr(st, 4); + } else { + if (script_isstringtype(st, 4)) { + ShowError("buildin_setunitdata: Invalid data type for argument #3.\n"); + script_pushint(st, 0); + return false; + } + val = script_getnum(st, 4); + } +/* checks if value is out of bounds. */ +#define setunitdata_check_bounds(arg, min, max) \ + do { \ + if (script_getnum(st, (arg)) < (min) || script_getnum(st, (arg)) > (max)) { \ + ShowError("buildin_setunitdata: Invalid value %d for argument #%d. (min: %d, max: %d)\n", script_getnum(st, (arg)), (arg)-1, (min), (max)); \ + script_pushint(st, 0); \ + return false; \ + } \ + } while(0); +/* checks if value is out of bounds. */ +#define setunitdata_check_min(arg, min) \ + do { \ + if (script_getnum(st, (arg)) < (min)) { \ + ShowError("buildin_setunitdata: Invalid value %d for argument #%d. (min: %d)\n", script_getnum(st, (arg)), (arg)-1, (min)); \ + script_pushint(st, 0); \ + return false; \ + } \ + } while(0); +/* checks if the argument doesn't exist, if required. + * also checks if the argument exists, if not required. */ +#define setunitdata_assert_arg(arg, required) \ + do { \ + if (required && !script_hasdata(st, (arg))) { \ + ShowError("buildin_setunitdata: Type %d reqires argument #%d.\n", type, (arg)-1); \ + script_pushint(st, 0); \ + return false; \ + } else if (!required && script_hasdata(st, arg)) { \ + ShowError("buildin_setunitdata: Argument %d is not required for type %d.\n", (arg)-1, type); \ + script_pushint(st, 0); \ + return false; \ + } \ + } while (0); +/* checks if the data is an integer. */ +#define setunitdata_check_int(arg) \ + do { \ + setunitdata_assert_arg((arg), true); \ + if (script_isstringtype(st, (arg))) { \ + ShowError("buildin_setunitdata: Argument #%d expects integer, string given.\n", (arg)-1); \ + script_pushint(st, 0); \ + return false; \ + } \ + } while(0); +/* checks if the data is a string. */ +#define setunitdata_check_string(arg) \ + do { \ + setunitdata_assert_arg((arg), true); \ + if (script_isinttype(st, (arg))) { \ + ShowError("buildin_setunitdata: Argument #%d expects string, integer given.\n", (arg)-1); \ + script_pushint(st, 0); \ + return false; \ + } \ + } while(0); + + if (type != UDT_MAPIDXY && type != UDT_WALKTOXY) { + setunitdata_assert_arg(5, false); + setunitdata_assert_arg(6, false); + } + + switch (type) + { + case UDT_SIZE: + setunitdata_check_bounds(4, SZ_SMALL, SZ_BIG); + break; + case UDT_LEVEL: + case UDT_HP: + case UDT_MAXHP: + case UDT_SP: + case UDT_MAXSP: + case UDT_CLASS: + case UDT_HEADBOTTOM: + case UDT_HEADMIDDLE: + case UDT_HEADTOP: + case UDT_CLOTHCOLOR: + case UDT_SHIELD: + case UDT_WEAPON: + case UDT_INTIMACY: + case UDT_LIFETIME: + case UDT_MERC_KILLCOUNT: + setunitdata_check_min(4, 0); + break; + case UDT_MASTERAID: + setunitdata_check_min(4, 0); + tsd = map->id2sd(val); + if (tsd == NULL) { + ShowWarning("buildin_setunitdata: Account ID %d not found for master change!\n",val); + script_pushint(st, 0); + return false; + } + break; + case UDT_MASTERCID: + setunitdata_check_min(4, 0); + tsd = map->charid2sd(val); + if (tsd == NULL) { + ShowWarning("buildin_setunitdata: Character ID %d not found for master change!\n",val); + script_pushint(st, 0); + return false; + } + break; + case UDT_MAPIDXY: + if ((val = map->mapname2mapid(mapname)) == -1) { + ShowError("buildin_setunitdata: Non-existent map %s provided.\n", mapname); + return false; + } + setunitdata_check_int(5); + setunitdata_check_int(6); + setunitdata_check_bounds(5, 0, MAX_MAP_SIZE/2); + setunitdata_check_bounds(6, 0, MAX_MAP_SIZE/2); + val2 = script_getnum(st, 5); + val3 = script_getnum(st, 6); + break; + case UDT_WALKTOXY: + setunitdata_assert_arg(6, false); + setunitdata_check_int(5); + val2 = script_getnum(st, 5); + setunitdata_check_bounds(4, 0, MAX_MAP_SIZE/2); + setunitdata_check_bounds(5, 0, MAX_MAP_SIZE/2); + break; + case UDT_SPEED: + setunitdata_check_bounds(4, 0, MAX_WALK_SPEED); + break; + case UDT_MODE: + setunitdata_check_bounds(4, MD_NONE, MD_MASK); + break; + case UDT_AI: + setunitdata_check_bounds(4, AI_NONE, AI_MAX-1); + break; + case UDT_SCOPTION: + setunitdata_check_bounds(4, OPTION_NOTHING, OPTION_COSTUME); + break; + case UDT_SEX: + setunitdata_check_bounds(4, SEX_FEMALE, SEX_MALE); + break; + case UDT_HAIRSTYLE: + setunitdata_check_bounds(4, 0, battle->bc->max_hair_style); + break; + case UDT_HAIRCOLOR: + setunitdata_check_bounds(4, 0, battle->bc->max_hair_color); + break; + case UDT_LOOKDIR: + setunitdata_check_bounds(4, 0, 7); + break; + case UDT_CANMOVETICK: + setunitdata_check_min(4, 0); + break; + case UDT_STR: + case UDT_AGI: + case UDT_VIT: + case UDT_INT: + case UDT_DEX: + case UDT_LUK: + case UDT_STATPOINT: + case UDT_ATKRANGE: + case UDT_ATKMIN: + case UDT_ATKMAX: + case UDT_MATKMIN: + case UDT_MATKMAX: + case UDT_AMOTION: + case UDT_ADELAY: + case UDT_DMOTION: + setunitdata_check_bounds(4, 0, USHRT_MAX); + break; + case UDT_DEF: + case UDT_MDEF: + case UDT_HIT: + case UDT_FLEE: + case UDT_PDODGE: + case UDT_CRIT: + setunitdata_check_bounds(4, 0, SHRT_MAX); + break; + case UDT_HUNGER: + setunitdata_check_bounds(4, 0, 99); + break; + case UDT_RACE: + case UDT_ELETYPE: + case UDT_ELELEVEL: + setunitdata_check_bounds(4, 0, CHAR_MAX); + break; + default: + break; + } + +#undef setunitdata_check_bounds +#undef setunitdata_assert_arg +#undef setunitdata_check_int +#undef setunitdata_check_string + + /* Set the values */ + switch (bl->type) { + case BL_MOB: + { + struct mob_data *md = BL_UCAST(BL_MOB, bl); + nullpo_retr(false, md); + + switch (type) + { + case UDT_SIZE: + md->status.size = (unsigned char) val; + break; + case UDT_LEVEL: + md->level = val; + break; + case UDT_HP: + status->set_hp(bl, (unsigned int) val, 0); + clif->charnameack(0, &md->bl); + break; + case UDT_MAXHP: + md->status.max_hp = (unsigned int) val; + clif->charnameack(0, &md->bl); + break; + case UDT_SP: + status->set_sp(bl, (unsigned int) val, 0); + break; + case UDT_MAXSP: + md->status.max_sp = (unsigned int) val; + break; + case UDT_MASTERAID: + md->master_id = val; + break; + case UDT_MAPIDXY: + unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT); + break; + case UDT_WALKTOXY: + if (!unit->walktoxy(bl, (short) val, (short) val2, 2)) + unit->movepos(bl, (short) val, (short) val2, 0, 0); + break; + case UDT_SPEED: + md->status.speed = (unsigned short) val; + status->calc_misc(bl, &md->status, md->level); + break; + case UDT_MODE: + md->status.mode = (enum e_mode) val; + break; + case UDT_AI: + md->special_state.ai = (enum ai) val; + break; + case UDT_SCOPTION: + md->sc.option = (unsigned int) val; + break; + case UDT_SEX: + md->vd->sex = (char) val; + break; + case UDT_CLASS: + mob->class_change(md, val); + break; + case UDT_HAIRSTYLE: + clif->changelook(bl, LOOK_HAIR, val); + break; + case UDT_HAIRCOLOR: + clif->changelook(bl, LOOK_HAIR_COLOR, val); + break; + case UDT_HEADBOTTOM: + clif->changelook(bl, LOOK_HEAD_BOTTOM, val); + break; + case UDT_HEADMIDDLE: + clif->changelook(bl, LOOK_HEAD_MID, val); + break; + case UDT_HEADTOP: + clif->changelook(bl, LOOK_HEAD_TOP, val); + break; + case UDT_CLOTHCOLOR: + clif->changelook(bl, LOOK_CLOTHES_COLOR, val); + break; + case UDT_SHIELD: + clif->changelook(bl, LOOK_SHIELD, val); + break; + case UDT_WEAPON: + clif->changelook(bl, LOOK_WEAPON, val); + break; + case UDT_LOOKDIR: + unit->setdir(bl, (uint8) val); + break; + case UDT_CANMOVETICK: + md->ud.canmove_tick = val; + break; + case UDT_STR: + md->status.str = (unsigned short) val; + status->calc_misc(bl, &md->status, md->level); + break; + case UDT_AGI: + md->status.agi = (unsigned short) val; + status->calc_misc(bl, &md->status, md->level); + break; + case UDT_VIT: + md->status.vit = (unsigned short) val; + status->calc_misc(bl, &md->status, md->level); + break; + case UDT_INT: + md->status.int_ = (unsigned short) val; + status->calc_misc(bl, &md->status, md->level); + break; + case UDT_DEX: + md->status.dex = (unsigned short) val; + status->calc_misc(bl, &md->status, md->level); + break; + case UDT_LUK: + md->status.luk = (unsigned short) val; + status->calc_misc(bl, &md->status, md->level); + break; + case UDT_ATKRANGE: + md->status.rhw.range = (unsigned short) val; + break; + case UDT_ATKMIN: + md->status.rhw.atk = (unsigned short) val; + break; + case UDT_ATKMAX: + md->status.rhw.atk2 = (unsigned short) val; + break; + case UDT_MATKMIN: + md->status.matk_min = (unsigned short) val; + break; + case UDT_MATKMAX: + md->status.matk_max = (unsigned short) val; + break; + case UDT_DEF: + md->status.def = (defType) val; + break; + case UDT_MDEF: + md->status.mdef = (defType) val; + break; + case UDT_HIT: + md->status.hit = (short) val; + break; + case UDT_FLEE: + md->status.flee = (short) val; + break; + case UDT_PDODGE: + md->status.flee2 = (short) val; + break; + case UDT_CRIT: + md->status.cri = (short) val; + break; + case UDT_RACE: + md->status.race = (unsigned char) val; + break; + case UDT_ELETYPE: + md->status.def_ele = (unsigned char) val; + break; + case UDT_ELELEVEL: + md->status.ele_lv = (unsigned char) val; + break; + case UDT_AMOTION: + md->status.amotion = (unsigned short) val; + break; + case UDT_ADELAY: + md->status.adelay = (unsigned short) val; + break; + case UDT_DMOTION: + md->status.dmotion = (unsigned short) val; + break; + default: + ShowWarning("buildin_setunitdata: Invalid data type '%s' for mob unit.\n", udtype); + script_pushint(st, 0); + return false; + } + } + break; + case BL_HOM: + { + struct homun_data *hd = BL_UCAST(BL_HOM, bl); + + nullpo_retr(false, hd); + + switch (type) + { + case UDT_SIZE: + hd->base_status.size = (unsigned char) val; + break; + case UDT_LEVEL: + hd->homunculus.level = (short) val; + break; + case UDT_HP: + status->set_hp(bl, (unsigned int) val, 0); + break; + case UDT_MAXHP: + hd->homunculus.max_hp = val; + break; + case UDT_SP: + status->set_sp(bl, (unsigned int) val, 0); + break; + case UDT_MAXSP: + hd->homunculus.max_sp = val; + break; + case UDT_MASTERCID: + hd->homunculus.char_id = val; + hd->master = tsd; + break; + case UDT_MAPIDXY: + unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT); + break; + case UDT_WALKTOXY: + if (!unit->walktoxy(bl, (short) val, (short) val2, 2)) + unit->movepos(bl, (short) val, (short) val2, 0, 0); + break; + case UDT_SPEED: + hd->base_status.speed = (unsigned short) val; + status->calc_misc(bl, &hd->base_status, hd->homunculus.level); + break; + case UDT_LOOKDIR: + unit->setdir(bl, (unsigned char) val); + break; + case UDT_CANMOVETICK: + hd->ud.canmove_tick = val; + break; + case UDT_STR: + hd->base_status.str = (unsigned short) val; + status->calc_misc(bl, &hd->base_status, hd->homunculus.level); + break; + case UDT_AGI: + hd->base_status.agi = (unsigned short) val; + status->calc_misc(bl, &hd->base_status, hd->homunculus.level); + break; + case UDT_VIT: + hd->base_status.vit = (unsigned short) val; + status->calc_misc(bl, &hd->base_status, hd->homunculus.level); + break; + case UDT_INT: + hd->base_status.int_ = (unsigned short) val; + status->calc_misc(bl, &hd->base_status, hd->homunculus.level); + break; + case UDT_DEX: + hd->base_status.dex = (unsigned short) val; + status->calc_misc(bl, &hd->base_status, hd->homunculus.level); + break; + case UDT_LUK: + hd->base_status.luk = (unsigned short) val; + status->calc_misc(bl, &hd->base_status, hd->homunculus.level); + break; + case UDT_ATKRANGE: + hd->base_status.rhw.range = (unsigned short) val; + break; + case UDT_ATKMIN: + hd->base_status.rhw.atk = (unsigned short) val; + break; + case UDT_ATKMAX: + hd->base_status.rhw.atk2 = (unsigned short) val; + break; + case UDT_MATKMIN: + hd->base_status.matk_min = (unsigned short) val; + break; + case UDT_MATKMAX: + hd->base_status.matk_max = (unsigned short) val; + break; + case UDT_DEF: + hd->base_status.def = (defType) val; + break; + case UDT_MDEF: + hd->base_status.mdef = (defType) val; + break; + case UDT_HIT: + hd->base_status.hit = (short) val; + break; + case UDT_FLEE: + hd->base_status.flee = (short) val; + break; + case UDT_PDODGE: + hd->base_status.flee2 = (short) val; + break; + case UDT_CRIT: + hd->base_status.cri = (short) val; + break; + case UDT_RACE: + hd->base_status.race = (unsigned char) val; + break; + case UDT_ELETYPE: + hd->base_status.def_ele = (unsigned char) val; + break; + case UDT_ELELEVEL: + hd->base_status.ele_lv = (unsigned char) val; + break; + case UDT_AMOTION: + hd->base_status.amotion = (unsigned short) val; + break; + case UDT_ADELAY: + hd->base_status.adelay = (unsigned short) val; + break; + case UDT_DMOTION: + hd->base_status.dmotion = (unsigned short) val; + break; + case UDT_HUNGER: + hd->homunculus.hunger = (short) val; + clif->send_homdata(hd->master, SP_HUNGRY, hd->homunculus.hunger); + break; + case UDT_INTIMACY: + homun->add_intimacy(hd, (unsigned int) val); + clif->send_homdata(hd->master, SP_INTIMATE, hd->homunculus.intimacy / 100); + break; + default: + ShowWarning("buildin_setunitdata: Invalid data type '%s' for homunculus unit.\n", udtype); + script_pushint(st, 0); + return false; + } + + clif->send_homdata(hd->master, SP_ACK, 0); // send homun data + } + break; + case BL_PET: + { + struct pet_data *pd = BL_UCAST(BL_PET, bl); + + nullpo_retr(false, pd); + + switch (type) + { + case UDT_SIZE: + pd->status.size = (unsigned char) val; + break; + case UDT_LEVEL: + pd->pet.level = (short) val; + break; + case UDT_HP: + status->set_hp(bl, (unsigned int) val, 0); + break; + case UDT_MAXHP: + pd->status.max_hp = (unsigned int) val; + break; + case UDT_SP: + status->set_sp(bl, (unsigned int) val, 0); + break; + case UDT_MAXSP: + pd->status.max_sp = (unsigned int) val; + break; + case UDT_MASTERAID: + pd->pet.account_id = val; + pd->msd = tsd; + break; + case UDT_MAPIDXY: + unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT); + break; + case UDT_WALKTOXY: + if (!unit->walktoxy(bl, (short) val, (short) val2, 2)) + unit->movepos(bl, (short) val, (short) val2, 0, 0); + break; + case UDT_SPEED: + pd->status.speed = (unsigned short) val; + status->calc_misc(bl, &pd->status, pd->pet.level); + break; + case UDT_LOOKDIR: + unit->setdir(bl, (unsigned char) val); + break; + case UDT_CANMOVETICK: + pd->ud.canmove_tick = val; + break; + case UDT_STR: + pd->status.str = (unsigned short) val; + status->calc_misc(bl, &pd->status, pd->pet.level); + break; + case UDT_AGI: + pd->status.agi = (unsigned short) val; + status->calc_misc(bl, &pd->status, pd->pet.level); + break; + case UDT_VIT: + pd->status.vit = (unsigned short) val; + status->calc_misc(bl, &pd->status, pd->pet.level); + break; + case UDT_INT: + pd->status.int_ = (unsigned short) val; + status->calc_misc(bl, &pd->status, pd->pet.level); + break; + case UDT_DEX: + pd->status.dex = (unsigned short) val; + status->calc_misc(bl, &pd->status, pd->pet.level); + break; + case UDT_LUK: + pd->status.luk = (unsigned short) val; + status->calc_misc(bl, &pd->status, pd->pet.level); + break; + case UDT_ATKRANGE: + pd->status.rhw.range = (unsigned short) val; + break; + case UDT_ATKMIN: + pd->status.rhw.atk = (unsigned short) val; + break; + case UDT_ATKMAX: + pd->status.rhw.atk2 = (unsigned short) val; + break; + case UDT_MATKMIN: + pd->status.matk_min = (unsigned short) val; + break; + case UDT_MATKMAX: + pd->status.matk_max = (unsigned short) val; + break; + case UDT_DEF: + pd->status.def = (defType) val; + break; + case UDT_MDEF: + pd->status.mdef = (defType) val; + break; + case UDT_HIT: + pd->status.hit = (short) val; + break; + case UDT_FLEE: + pd->status.flee = (short) val; + break; + case UDT_PDODGE: + pd->status.flee2 = (short) val; + break; + case UDT_CRIT: + pd->status.cri = (short) val; + break; + case UDT_RACE: + pd->status.race = (unsigned char) val; + break; + case UDT_ELETYPE: + pd->status.def_ele = (unsigned char) val; + break; + case UDT_ELELEVEL: + pd->status.ele_lv = (unsigned char) val; + break; + case UDT_AMOTION: + pd->status.amotion = (unsigned short) val; + break; + case UDT_ADELAY: + pd->status.adelay = (unsigned short) val; + break; + case UDT_DMOTION: + pd->status.dmotion = (unsigned short) val; + break; + case UDT_INTIMACY: + pet->set_intimate(pd, val); + clif->send_petdata(pd->msd, pd, 1, pd->pet.intimate); + break; + case UDT_HUNGER: + pd->pet.hungry = (short) val; + break; + default: + ShowWarning("buildin_setunitdata: Invalid data type '%s' for pet unit.\n", udtype); + script_pushint(st, 0); + return false; + } + clif->send_petstatus(pd->msd); // send pet data + } + break; + case BL_MER: + { + struct mercenary_data *mc = BL_UCAST(BL_MER, bl); + + nullpo_retr(false, mc); + + switch (type) + { + case UDT_SIZE: + mc->base_status.size = (unsigned char) val; + break; + case UDT_HP: + status->set_hp(bl, (unsigned int) val, 0); + break; + case UDT_MAXHP: + mc->base_status.max_hp = (unsigned int) val; + break; + case UDT_SP: + status->set_sp(bl, (unsigned int) val, 0); + break; + case UDT_MAXSP: + mc->base_status.max_sp = (unsigned int) val; + break; + case UDT_MASTERCID: + mc->mercenary.char_id = val; + break; + case UDT_MAPIDXY: + unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT); + break; + case UDT_WALKTOXY: + if (!unit->walktoxy(bl, (short) val, (short) val2, 2)) + unit->movepos(bl, (short) val, (short) val2, 0, 0); + break; + case UDT_SPEED: + mc->base_status.size = (unsigned char) val; + status->calc_misc(bl, &mc->base_status, mc->db->lv); + break; + case UDT_LOOKDIR: + unit->setdir(bl, (unsigned char) val); + break; + case UDT_CANMOVETICK: + mc->ud.canmove_tick = val; + break; + case UDT_STR: + mc->base_status.str = (unsigned short) val; + status->calc_misc(bl, &mc->base_status, mc->db->lv); + break; + case UDT_AGI: + mc->base_status.agi = (unsigned short) val; + status->calc_misc(bl, &mc->base_status, mc->db->lv); + break; + case UDT_VIT: + mc->base_status.vit = (unsigned short) val; + status->calc_misc(bl, &mc->base_status, mc->db->lv); + break; + case UDT_INT: + mc->base_status.int_ = (unsigned short) val; + status->calc_misc(bl, &mc->base_status, mc->db->lv); + break; + case UDT_DEX: + mc->base_status.dex = (unsigned short) val; + status->calc_misc(bl, &mc->base_status, mc->db->lv); + break; + case UDT_LUK: + mc->base_status.luk = (unsigned short) val; + status->calc_misc(bl, &mc->base_status, mc->db->lv); + break; + case UDT_ATKRANGE: + mc->base_status.rhw.range = (unsigned short) val; + break; + case UDT_ATKMIN: + mc->base_status.rhw.atk = (unsigned short) val; + break; + case UDT_ATKMAX: + mc->base_status.rhw.atk2 = (unsigned short) val; + break; + case UDT_MATKMIN: + mc->base_status.matk_min = (unsigned short) val; + break; + case UDT_MATKMAX: + mc->base_status.matk_max = (unsigned short) val; + break; + case UDT_DEF: + mc->base_status.def = (defType) val; + break; + case UDT_MDEF: + mc->base_status.mdef = (defType) val; + break; + case UDT_HIT: + mc->base_status.hit = (short) val; + break; + case UDT_FLEE: + mc->base_status.flee = (short) val; + break; + case UDT_PDODGE: + mc->base_status.flee2 = (short) val; + break; + case UDT_CRIT: + mc->base_status.cri = (short) val; + break; + case UDT_RACE: + mc->base_status.race = (unsigned char) val; + break; + case UDT_ELETYPE: + mc->base_status.def_ele = (unsigned char) val; + break; + case UDT_ELELEVEL: + mc->base_status.ele_lv = (unsigned char) val; + break; + case UDT_AMOTION: + mc->base_status.amotion = (unsigned short) val; + break; + case UDT_ADELAY: + mc->base_status.adelay = (unsigned short) val; + break; + case UDT_DMOTION: + mc->base_status.dmotion = (unsigned short) val; + break; + case UDT_MERC_KILLCOUNT: + mc->mercenary.kill_count = (unsigned int) val; + break; + case UDT_LIFETIME: + mc->mercenary.life_time = (unsigned int) val; + break; + default: + ShowWarning("buildin_setunitdata: Invalid data type '%s' for mercenary unit.\n", udtype); + script_pushint(st, 0); + return false; + } + + clif->mercenary_info(map->charid2sd(mc->mercenary.char_id)); + clif->mercenary_skillblock(map->charid2sd(mc->mercenary.char_id)); + } + break; + case BL_ELEM: + { + struct elemental_data *ed = BL_UCAST(BL_ELEM, bl); + + nullpo_retr(false, ed); + + switch (type) + { + case UDT_SIZE: + ed->base_status.size = (unsigned char) val; + break; + case UDT_HP: + status->set_hp(bl, (unsigned int) val, 0); + break; + case UDT_MAXHP: + ed->base_status.max_hp = (unsigned int) val; + break; + case UDT_SP: + status->set_sp(bl, (unsigned int) val, 0); + break; + case UDT_MAXSP: + ed->base_status.max_sp = (unsigned int) val; + break; + case UDT_MASTERCID: + ed->elemental.char_id = val; + break; + case UDT_MAPIDXY: + unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT); + break; + case UDT_WALKTOXY: + if (!unit->walktoxy(bl, (short) val, (short) val2, 2)) + unit->movepos(bl, (short) val, (short) val2, 0, 0); + break; + case UDT_SPEED: + ed->base_status.speed = (unsigned short) val; + status->calc_misc(bl, &ed->base_status, ed->db->lv); + break; + case UDT_LOOKDIR: + unit->setdir(bl, (unsigned char) val); + break; + case UDT_CANMOVETICK: + ed->ud.canmove_tick = val; + break; + case UDT_STR: + ed->base_status.str = (unsigned short) val; + status->calc_misc(bl, &ed->base_status, ed->db->lv); + break; + case UDT_AGI: + ed->base_status.agi = (unsigned short) val; + status->calc_misc(bl, &ed->base_status, ed->db->lv); + break; + case UDT_VIT: + ed->base_status.vit = (unsigned short) val; + status->calc_misc(bl, &ed->base_status, ed->db->lv); + break; + case UDT_INT: + ed->base_status.int_ = (unsigned short) val; + status->calc_misc(bl, &ed->base_status, ed->db->lv); + break; + case UDT_DEX: + ed->base_status.dex = (unsigned short) val; + status->calc_misc(bl, &ed->base_status, ed->db->lv); + break; + case UDT_LUK: + ed->base_status.luk = (unsigned short) val; + status->calc_misc(bl, &ed->base_status, ed->db->lv); + break; + case UDT_ATKRANGE: + ed->base_status.rhw.range = (unsigned short) val; + break; + case UDT_ATKMIN: + ed->base_status.rhw.atk = (unsigned short) val; + break; + case UDT_ATKMAX: + ed->base_status.rhw.atk2 = (unsigned short) val; + break; + case UDT_MATKMIN: + ed->base_status.matk_min = (unsigned short) val; + break; + case UDT_MATKMAX: + ed->base_status.matk_max = (unsigned short) val; + break; + case UDT_DEF: + ed->base_status.def = (defType) val; + break; + case UDT_MDEF: + ed->base_status.mdef = (defType) val; + break; + case UDT_HIT: + ed->base_status.hit = (short) val; + break; + case UDT_FLEE: + ed->base_status.flee = (short) val; + break; + case UDT_PDODGE: + ed->base_status.flee2 = (short) val; + break; + case UDT_CRIT: + ed->base_status.cri = (short) val; + break; + case UDT_RACE: + ed->base_status.race = (unsigned char) val; + break; + case UDT_ELETYPE: + ed->base_status.def_ele = (unsigned char) val; + break; + case UDT_ELELEVEL: + ed->base_status.ele_lv = (unsigned char) val; + break; + case UDT_AMOTION: + ed->base_status.amotion = (unsigned short) val; + break; + case UDT_ADELAY: + ed->base_status.adelay = (unsigned short) val; + break; + case UDT_DMOTION: + ed->base_status.dmotion = (unsigned short) val; + break; + case UDT_LIFETIME: + ed->elemental.life_time = val; + break; + default: + ShowWarning("buildin_setunitdata: Invalid data type '%s' for elemental unit.\n", udtype); + script_pushint(st, 0); + return false; + } + clif->elemental_info(ed->master); + } + break; + case BL_NPC: + { + struct npc_data *nd = BL_UCAST(BL_NPC, bl); + + nullpo_retr(false, nd); + + switch (type) + { + case UDT_SIZE: + nd->status.size = (unsigned char) val; + break; + case UDT_LEVEL: + nd->level = (unsigned short) val; + break; + case UDT_HP: + status->set_hp(bl, (unsigned int) val, 0); + break; + case UDT_MAXHP: + nd->status.max_hp = (unsigned int) val; + break; + case UDT_SP: + status->set_sp(bl, (unsigned int) val, 0); + break; + case UDT_MAXSP: + nd->status.max_sp = (unsigned int) val; + break; + case UDT_MAPIDXY: + unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT); + break; + case UDT_WALKTOXY: + if (!unit->walktoxy(bl, (short) val, (short) val2, 2)) + unit->movepos(bl, (short) val, (short) val2, 0, 0); + break; + case UDT_CLASS: + npc->setclass(nd, (short) val); + break; + case UDT_SPEED: + nd->speed = (short) val; + status->calc_misc(bl, &nd->status, nd->level); + break; + case UDT_LOOKDIR: + unit->setdir(bl, (unsigned char) val); + break; + case UDT_STR: + nd->status.str = (unsigned short) val; + status->calc_misc(bl, &nd->status, nd->level); + break; + case UDT_AGI: + nd->status.agi = (unsigned short) val; + status->calc_misc(bl, &nd->status, nd->level); + break; + case UDT_VIT: + nd->status.vit = (unsigned short) val; + status->calc_misc(bl, &nd->status, nd->level); + break; + case UDT_INT: + nd->status.int_ = (unsigned short) val; + status->calc_misc(bl, &nd->status, nd->level); + break; + case UDT_DEX: + nd->status.dex = (unsigned short) val; + status->calc_misc(bl, &nd->status, nd->level); + break; + case UDT_LUK: + nd->status.luk = (unsigned short) val; + status->calc_misc(bl, &nd->status, nd->level); + break; + case UDT_STATPOINT: + nd->stat_point = (unsigned short) val; + break; + case UDT_ATKRANGE: + nd->status.rhw.range = (unsigned short) val; + break; + case UDT_ATKMIN: + nd->status.rhw.atk = (unsigned short) val; + break; + case UDT_ATKMAX: + nd->status.rhw.atk2 = (unsigned short) val; + break; + case UDT_MATKMIN: + nd->status.matk_min = (unsigned short) val; + break; + case UDT_MATKMAX: + nd->status.matk_max = (unsigned short) val; + break; + case UDT_DEF: + nd->status.def = (defType) val; + break; + case UDT_MDEF: + nd->status.mdef = (defType) val; + break; + case UDT_HIT: + nd->status.hit = (short) val; + break; + case UDT_FLEE: + nd->status.flee = (short) val; + break; + case UDT_PDODGE: + nd->status.flee2 = (short) val; + break; + case UDT_CRIT: + nd->status.cri = (short) val; + break; + case UDT_RACE: + nd->status.race = (unsigned char) val; + break; + case UDT_ELETYPE: + nd->status.def_ele = (unsigned char) val; + break; + case UDT_ELELEVEL: + nd->status.ele_lv = (unsigned char) val; + break; + case UDT_AMOTION: + nd->status.amotion = (unsigned short) val; + break; + case UDT_ADELAY: + nd->status.adelay = (unsigned short) val; + break; + case UDT_DMOTION: + nd->status.dmotion = (unsigned short) val; + break; + default: + ShowWarning("buildin_setunitdata: Invalid data type '%s' for NPC unit.\n", udtype); + script_pushint(st, 0); + return false; + } + } + break; + default: + ShowError("buildin_setunitdata: Unknown object!\n"); + script_pushint(st, 0); + return false; + } // end of bl->type switch + + script_pushint(st, 1); + return true; +} + +/** + * Retrieves real-time data for a game object. + * Getunitdata <GUID>,<DataType>{,<Variable>} + * @param1 GUID Game object unique Id. + * @param2 DataType Type of Data to be set for the unit. + * @param3 Variable array reference to store data into. (used for UDT_MAPIDXY) + * @return 0 on failure, <value> on success + */ +BUILDIN(getunitdata) +{ + struct block_list *bl; + const char *udtype = NULL; + const struct map_session_data *sd = NULL; + int type = 0; + char* name = NULL; + struct script_data *data = script_hasdata(st,4)?script_getdata(st, 4):NULL; + + bl = map->id2bl(script_getnum(st, 2)); + + if (bl == NULL) { + ShowWarning("buildin_getunitdata: Error in finding object with given GID %d!\n", script_getnum(st, 2)); + script_pushint(st, 0); + return false; + } + + type = script_getnum(st, 3); + + /* Type check */ + if (type < UDT_TYPE || type >= UDT_MAX) { + ShowError("buildin_getunitdata: Invalid unit data type %d provided.\n", type); + script_pushint(st, 0); + return false; + } + + /* Argument checks */ + if (type == UDT_MAPIDXY) { + if (data == NULL || !data_isreference(data)) { + ShowWarning("buildin_getunitdata: Error in argument 3. Please provide a reference variable to store values in.\n"); + script_pushint(st, 0); + return false; + } + + name = reference_getname(data); + + if (not_server_variable(*name)) { + sd = script->rid2sd(st); + if (sd == NULL) { + ShowWarning("buildin_getunitdata: Player not attached! Cannot use player variable %s.\n",name); + script_pushint(st, 0); + return true;// no player attached + } + } + } + +#define getunitdata_sub(idx__,var__) script->setd_sub(st,NULL,name,(idx__),(void *)h64BPTRSIZE((int)(var__)),data->ref); + + switch (bl->type) { + case BL_MOB: + { + const struct mob_data *md = BL_UCAST(BL_MOB, bl); + + nullpo_retr(false, md); + + switch (type) + { + case UDT_TYPE: script_pushint(st, BL_MOB); break; + case UDT_SIZE: script_pushint(st, md->status.size); break; + case UDT_LEVEL: script_pushint(st, md->level); break; + case UDT_HP: script_pushint(st, md->status.hp); break; + case UDT_MAXHP: script_pushint(st, md->status.max_hp); break; + case UDT_SP: script_pushint(st, md->status.sp); break; + case UDT_MAXSP: script_pushint(st, md->status.max_sp); break; + case UDT_MAPIDXY: + getunitdata_sub(0, md->bl.m); + getunitdata_sub(1, md->bl.x); + getunitdata_sub(2, md->bl.y); + break; + case UDT_SPEED: script_pushint(st, md->status.speed); break; + case UDT_MODE: script_pushint(st, md->status.mode); break; + case UDT_AI: script_pushint(st, md->special_state.ai); break; + case UDT_SCOPTION: script_pushint(st, md->sc.option); break; + case UDT_SEX: script_pushint(st, md->vd->sex); break; + case UDT_CLASS: script_pushint(st, md->vd->class); break; + case UDT_HAIRSTYLE: script_pushint(st, md->vd->hair_style); break; + case UDT_HAIRCOLOR: script_pushint(st, md->vd->hair_color); break; + case UDT_HEADBOTTOM: script_pushint(st, md->vd->head_bottom); break; + case UDT_HEADMIDDLE: script_pushint(st, md->vd->head_mid); break; + case UDT_HEADTOP: script_pushint(st, md->vd->head_top); break; + case UDT_CLOTHCOLOR: script_pushint(st, md->vd->cloth_color); break; + case UDT_SHIELD: script_pushint(st, md->vd->shield); break; + case UDT_WEAPON: script_pushint(st, md->vd->weapon); break; + case UDT_LOOKDIR: script_pushint(st, md->ud.dir); break; + case UDT_CANMOVETICK: script_pushint(st, md->ud.canmove_tick); break; + case UDT_STR: script_pushint(st, md->status.str); break; + case UDT_AGI: script_pushint(st, md->status.agi); break; + case UDT_VIT: script_pushint(st, md->status.vit); break; + case UDT_INT: script_pushint(st, md->status.int_); break; + case UDT_DEX: script_pushint(st, md->status.dex); break; + case UDT_LUK: script_pushint(st, md->status.luk); break; + case UDT_ATKRANGE: script_pushint(st, md->status.rhw.range); break; + case UDT_ATKMIN: script_pushint(st, md->status.rhw.atk); break; + case UDT_ATKMAX: script_pushint(st, md->status.rhw.atk2); break; + case UDT_MATKMIN: script_pushint(st, md->status.matk_min); break; + case UDT_MATKMAX: script_pushint(st, md->status.matk_max); break; + case UDT_DEF: script_pushint(st, md->status.def); break; + case UDT_MDEF: script_pushint(st, md->status.mdef); break; + case UDT_HIT: script_pushint(st, md->status.hit); break; + case UDT_FLEE: script_pushint(st, md->status.flee); break; + case UDT_PDODGE: script_pushint(st, md->status.flee2); break; + case UDT_CRIT: script_pushint(st, md->status.cri); break; + case UDT_RACE: script_pushint(st, md->status.race); break; + case UDT_ELETYPE: script_pushint(st, md->status.def_ele); break; + case UDT_ELELEVEL: script_pushint(st, md->status.ele_lv); break; + 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; + default: + ShowWarning("buildin_getunitdata: Invalid data type '%s' for Mob unit.\n", udtype); + script_pushint(st, 0); + return false; + } + } + break; + case BL_HOM: + { + const struct homun_data *hd = BL_UCAST(BL_HOM, bl); + + nullpo_retr(false, hd); + + switch (type) + { + case UDT_TYPE: script_pushint(st, BL_HOM); break; + case UDT_SIZE: script_pushint(st, hd->base_status.size); break; + case UDT_LEVEL: script_pushint(st, hd->homunculus.level); break; + case UDT_HP: script_pushint(st, hd->base_status.hp); break; + case UDT_MAXHP: script_pushint(st, hd->base_status.max_hp); break; + case UDT_SP: script_pushint(st, hd->base_status.sp); break; + case UDT_MAXSP: script_pushint(st, hd->base_status.max_sp); break; + case UDT_MAPIDXY: + getunitdata_sub(0, hd->bl.m); + getunitdata_sub(1, hd->bl.x); + getunitdata_sub(2, hd->bl.y); + break; + case UDT_SPEED: script_pushint(st, hd->base_status.speed); break; + case UDT_LOOKDIR: script_pushint(st, hd->ud.dir); break; + case UDT_CANMOVETICK: script_pushint(st, hd->ud.canmove_tick); break; + case UDT_MODE: script_pushint(st, hd->base_status.mode); break; + case UDT_STR: script_pushint(st, hd->base_status.str); break; + case UDT_AGI: script_pushint(st, hd->base_status.agi); break; + case UDT_VIT: script_pushint(st, hd->base_status.vit); break; + case UDT_INT: script_pushint(st, hd->base_status.int_); break; + case UDT_DEX: script_pushint(st, hd->base_status.dex); break; + case UDT_LUK: script_pushint(st, hd->base_status.luk); break; + case UDT_ATKRANGE: script_pushint(st, hd->base_status.rhw.range); break; + case UDT_ATKMIN: script_pushint(st, hd->base_status.rhw.atk); break; + case UDT_ATKMAX: script_pushint(st, hd->base_status.rhw.atk2); break; + case UDT_MATKMIN: script_pushint(st, hd->base_status.matk_min); break; + case UDT_MATKMAX: script_pushint(st, hd->base_status.matk_max); break; + case UDT_DEF: script_pushint(st, hd->base_status.def); break; + case UDT_MDEF: script_pushint(st, hd->base_status.mdef); break; + case UDT_HIT: script_pushint(st, hd->base_status.hit); break; + case UDT_FLEE: script_pushint(st, hd->base_status.flee); break; + case UDT_PDODGE: script_pushint(st, hd->base_status.flee2); break; + case UDT_CRIT: script_pushint(st, hd->base_status.cri); break; + case UDT_RACE: script_pushint(st, hd->base_status.race); break; + case UDT_ELETYPE: script_pushint(st, hd->base_status.def_ele); break; + case UDT_ELELEVEL: script_pushint(st, hd->base_status.ele_lv); break; + case UDT_AMOTION: script_pushint(st, hd->base_status.amotion); break; + case UDT_ADELAY: script_pushint(st, hd->base_status.adelay); break; + case UDT_DMOTION: script_pushint(st, hd->base_status.dmotion); break; + case UDT_MASTERCID: script_pushint(st, hd->homunculus.char_id); break; + case UDT_HUNGER: script_pushint(st, hd->homunculus.hunger); break; + case UDT_INTIMACY: script_pushint(st, hd->homunculus.intimacy); break; + default: + ShowWarning("buildin_getunitdata: Invalid data type '%s' for Homunculus unit.\n", udtype); + script_pushint(st, 0); + return false; + } + } + break; + case BL_PET: + { + const struct pet_data *pd = BL_UCAST(BL_PET, bl); + + nullpo_retr(false, pd); + + switch (type) + { + case UDT_TYPE: script_pushint(st, BL_PET); break; + case UDT_SIZE: script_pushint(st, pd->status.size); break; + case UDT_LEVEL: script_pushint(st, pd->pet.level); break; + case UDT_HP: script_pushint(st, pd->status.hp); break; + case UDT_MAXHP: script_pushint(st, pd->status.max_hp); break; + case UDT_SP: script_pushint(st, pd->status.sp); break; + case UDT_MAXSP: script_pushint(st, pd->status.max_sp); break; + case UDT_MAPIDXY: + getunitdata_sub(0, pd->bl.m); + getunitdata_sub(1, pd->bl.x); + getunitdata_sub(2, pd->bl.y); + break; + case UDT_SPEED: script_pushint(st, pd->status.speed); break; + case UDT_LOOKDIR: script_pushint(st, pd->ud.dir); break; + case UDT_CANMOVETICK: script_pushint(st, pd->ud.canmove_tick); break; + case UDT_MODE: script_pushint(st, pd->status.mode); break; + case UDT_STR: script_pushint(st, pd->status.str); break; + case UDT_AGI: script_pushint(st, pd->status.agi); break; + case UDT_VIT: script_pushint(st, pd->status.vit); break; + case UDT_INT: script_pushint(st, pd->status.int_); break; + case UDT_DEX: script_pushint(st, pd->status.dex); break; + case UDT_LUK: script_pushint(st, pd->status.luk); break; + case UDT_ATKRANGE: script_pushint(st, pd->status.rhw.range); break; + case UDT_ATKMIN: script_pushint(st, pd->status.rhw.atk); break; + case UDT_ATKMAX: script_pushint(st, pd->status.rhw.atk2); break; + case UDT_MATKMIN: script_pushint(st, pd->status.matk_min); break; + case UDT_MATKMAX: script_pushint(st, pd->status.matk_max); break; + case UDT_DEF: script_pushint(st, pd->status.def); break; + case UDT_MDEF: script_pushint(st, pd->status.mdef); break; + case UDT_HIT: script_pushint(st, pd->status.hit); break; + case UDT_FLEE: script_pushint(st, pd->status.flee); break; + case UDT_PDODGE: script_pushint(st, pd->status.flee2); break; + case UDT_CRIT: script_pushint(st, pd->status.cri); break; + case UDT_RACE: script_pushint(st, pd->status.race); break; + case UDT_ELETYPE: script_pushint(st, pd->status.def_ele); break; + case UDT_ELELEVEL: script_pushint(st, pd->status.ele_lv); break; + case UDT_AMOTION: script_pushint(st, pd->status.amotion); break; + case UDT_ADELAY: script_pushint(st, pd->status.adelay); break; + case UDT_DMOTION: script_pushint(st, pd->status.dmotion); break; + case UDT_MASTERAID: script_pushint(st, pd->pet.account_id); break; + case UDT_HUNGER: script_pushint(st, pd->pet.hungry); break; + case UDT_INTIMACY: script_pushint(st, pd->pet.intimate); break; + default: + ShowWarning("buildin_getunitdata: Invalid data type '%s' for Pet unit.\n", udtype); + script_pushint(st, 0); + return false; + } + } + break; + case BL_MER: + { + const struct mercenary_data *mc = BL_UCAST(BL_MER, bl); + + nullpo_retr(false, mc); + + switch (type) + { + case UDT_TYPE: script_pushint(st, BL_MER); break; + case UDT_SIZE: script_pushint(st, mc->base_status.size); break; + case UDT_HP: script_pushint(st, mc->base_status.hp); break; + case UDT_MAXHP: script_pushint(st, mc->base_status.max_hp); break; + case UDT_SP: script_pushint(st, mc->base_status.sp); break; + case UDT_MAXSP: script_pushint(st, mc->base_status.max_sp); break; + case UDT_MAPIDXY: + getunitdata_sub(0, mc->bl.m); + getunitdata_sub(1, mc->bl.x); + getunitdata_sub(2, mc->bl.y); + break; + case UDT_SPEED: script_pushint(st, mc->base_status.speed); break; + case UDT_LOOKDIR: script_pushint(st, mc->ud.dir); break; + case UDT_CANMOVETICK: script_pushint(st, mc->ud.canmove_tick); break; + case UDT_MODE: script_pushint(st, mc->base_status.mode); break; + case UDT_STR: script_pushint(st, mc->base_status.str); break; + case UDT_AGI: script_pushint(st, mc->base_status.agi); break; + case UDT_VIT: script_pushint(st, mc->base_status.vit); break; + case UDT_INT: script_pushint(st, mc->base_status.int_); break; + case UDT_DEX: script_pushint(st, mc->base_status.dex); break; + case UDT_LUK: script_pushint(st, mc->base_status.luk); break; + case UDT_ATKRANGE: script_pushint(st, mc->base_status.rhw.range); break; + case UDT_ATKMIN: script_pushint(st, mc->base_status.rhw.atk); break; + case UDT_ATKMAX: script_pushint(st, mc->base_status.rhw.atk2); break; + case UDT_MATKMIN: script_pushint(st, mc->base_status.matk_min); break; + case UDT_MATKMAX: script_pushint(st, mc->base_status.matk_max); break; + case UDT_DEF: script_pushint(st, mc->base_status.def); break; + case UDT_MDEF: script_pushint(st, mc->base_status.mdef); break; + case UDT_HIT: script_pushint(st, mc->base_status.hit); break; + case UDT_FLEE: script_pushint(st, mc->base_status.flee); break; + case UDT_PDODGE: script_pushint(st, mc->base_status.flee2); break; + case UDT_CRIT: script_pushint(st, mc->base_status.cri); break; + case UDT_RACE: script_pushint(st, mc->base_status.race); break; + case UDT_ELETYPE: script_pushint(st, mc->base_status.def_ele); break; + case UDT_ELELEVEL: script_pushint(st, mc->base_status.ele_lv); break; + case UDT_AMOTION: script_pushint(st, mc->base_status.amotion); break; + case UDT_ADELAY: script_pushint(st, mc->base_status.adelay); break; + case UDT_DMOTION: script_pushint(st, mc->base_status.dmotion); break; + case UDT_MASTERCID: script_pushint(st, mc->mercenary.char_id); break; + case UDT_MERC_KILLCOUNT: script_pushint(st, mc->mercenary.kill_count); break; + case UDT_LIFETIME: script_pushint(st, mc->mercenary.life_time); break; + default: + ShowWarning("buildin_getunitdata: Invalid data type '%s' for Mercenary unit.\n", udtype); + script_pushint(st, 0); + return false; + } + } + break; + case BL_ELEM: + { + const struct elemental_data *ed = BL_UCAST(BL_ELEM, bl); + + nullpo_retr(false, ed); + + switch (type) + { + case UDT_TYPE: script_pushint(st, BL_ELEM); break; + case UDT_SIZE: script_pushint(st, ed->base_status.size); break; + case UDT_HP: script_pushint(st, ed->base_status.hp); break; + case UDT_MAXHP: script_pushint(st, ed->base_status.max_hp); break; + case UDT_SP: script_pushint(st, ed->base_status.sp); break; + case UDT_MAXSP: script_pushint(st, ed->base_status.max_sp); break; + case UDT_MAPIDXY: + getunitdata_sub(0, ed->bl.m); + getunitdata_sub(1, ed->bl.x); + getunitdata_sub(2, ed->bl.y); + break; + case UDT_SPEED: script_pushint(st, ed->base_status.speed); break; + case UDT_LOOKDIR: script_pushint(st, ed->ud.dir); break; + case UDT_CANMOVETICK: script_pushint(st, ed->ud.canmove_tick); break; + case UDT_MODE: script_pushint(st, ed->base_status.mode); break; + case UDT_STR: script_pushint(st, ed->base_status.str); break; + case UDT_AGI: script_pushint(st, ed->base_status.agi); break; + case UDT_VIT: script_pushint(st, ed->base_status.vit); break; + case UDT_INT: script_pushint(st, ed->base_status.int_); break; + case UDT_DEX: script_pushint(st, ed->base_status.dex); break; + case UDT_LUK: script_pushint(st, ed->base_status.luk); break; + case UDT_ATKRANGE: script_pushint(st, ed->base_status.rhw.range); break; + case UDT_ATKMIN: script_pushint(st, ed->base_status.rhw.atk); break; + case UDT_ATKMAX: script_pushint(st, ed->base_status.rhw.atk2); break; + case UDT_MATKMIN: script_pushint(st, ed->base_status.matk_min); break; + case UDT_MATKMAX: script_pushint(st, ed->base_status.matk_max); break; + case UDT_DEF: script_pushint(st, ed->base_status.def); break; + case UDT_MDEF: script_pushint(st, ed->base_status.mdef); break; + case UDT_HIT: script_pushint(st, ed->base_status.hit); break; + case UDT_FLEE: script_pushint(st, ed->base_status.flee); break; + case UDT_PDODGE: script_pushint(st, ed->base_status.flee2); break; + case UDT_CRIT: script_pushint(st, ed->base_status.cri); break; + case UDT_RACE: script_pushint(st, ed->base_status.race); break; + case UDT_ELETYPE: script_pushint(st, ed->base_status.def_ele); break; + case UDT_ELELEVEL: script_pushint(st, ed->base_status.ele_lv); break; + case UDT_AMOTION: script_pushint(st, ed->base_status.amotion); break; + case UDT_ADELAY: script_pushint(st, ed->base_status.adelay); break; + case UDT_DMOTION: script_pushint(st, ed->base_status.dmotion); break; + case UDT_MASTERCID: script_pushint(st, ed->elemental.char_id); break; + default: + ShowWarning("buildin_getunitdata: Invalid data type '%s' for Elemental unit.\n", udtype); + script_pushint(st, 0); + return false; + } + } + break; + case BL_NPC: + { + const struct npc_data *nd = BL_UCAST(BL_NPC, bl); + + nullpo_retr(false, nd); + + switch (type) + { + case UDT_TYPE: script_pushint(st, BL_NPC); break; + case UDT_SIZE: script_pushint(st, nd->status.size); break; + case UDT_HP: script_pushint(st, nd->status.hp); break; + case UDT_MAXHP: script_pushint(st, nd->status.max_hp); break; + case UDT_SP: script_pushint(st, nd->status.sp); break; + case UDT_MAXSP: script_pushint(st, nd->status.max_sp); break; + case UDT_MAPIDXY: + getunitdata_sub(0, bl->m); + getunitdata_sub(1, bl->x); + getunitdata_sub(2, bl->y); + break; + case UDT_SPEED: script_pushint(st, nd->status.speed); break; + case UDT_LOOKDIR: script_pushint(st, nd->ud->dir); break; + case UDT_CANMOVETICK: script_pushint(st, nd->ud->canmove_tick); break; + case UDT_MODE: script_pushint(st, nd->status.mode); break; + case UDT_STR: script_pushint(st, nd->status.str); break; + case UDT_AGI: script_pushint(st, nd->status.agi); break; + case UDT_VIT: script_pushint(st, nd->status.vit); break; + case UDT_INT: script_pushint(st, nd->status.int_); break; + case UDT_DEX: script_pushint(st, nd->status.dex); break; + case UDT_LUK: script_pushint(st, nd->status.luk); break; + case UDT_ATKRANGE: script_pushint(st, nd->status.rhw.range); break; + case UDT_ATKMIN: script_pushint(st, nd->status.rhw.atk); break; + case UDT_ATKMAX: script_pushint(st, nd->status.rhw.atk2); break; + case UDT_MATKMIN: script_pushint(st, nd->status.matk_min); break; + case UDT_MATKMAX: script_pushint(st, nd->status.matk_max); break; + case UDT_DEF: script_pushint(st, nd->status.def); break; + case UDT_MDEF: script_pushint(st, nd->status.mdef); break; + case UDT_HIT: script_pushint(st, nd->status.hit); break; + case UDT_FLEE: script_pushint(st, nd->status.flee); break; + case UDT_PDODGE: script_pushint(st, nd->status.flee2); break; + case UDT_CRIT: script_pushint(st, nd->status.cri); break; + case UDT_RACE: script_pushint(st, nd->status.race); break; + case UDT_ELETYPE: script_pushint(st, nd->status.def_ele); break; + case UDT_ELELEVEL: script_pushint(st, nd->status.ele_lv); break; + case UDT_AMOTION: script_pushint(st, nd->status.amotion); break; + case UDT_ADELAY: script_pushint(st, nd->status.adelay); break; + case UDT_DMOTION: script_pushint(st, nd->status.dmotion); break; + default: + ShowWarning("buildin_getunitdata: Invalid data type '%s' for NPC unit.\n", udtype); + script_pushint(st, 0); + return false; + } + } + break; + default: + ShowError("buildin_getunitdata: Unknown object!\n"); + script_pushint(st, 0); + return false; + } // end of bl->type switch + +#undef getunitdata_sub + + return false; +} + +/** + * Gets the name of a Unit. + * Supported types are [MOB|HOM|PET|NPC]. + * MER and ELEM don't support custom names. + * + * @command getunitname <GUID>; + * @param GUID Game Object Unique ID. + * @return boolean or Name of the game object. + */ +BUILDIN(getunitname) +{ + const struct block_list* bl = NULL; + + bl = map->id2bl(script_getnum(st, 2)); + + if (bl == NULL) { + ShowWarning("buildin_getunitname: Error in finding object with given game ID %d!\n", script_getnum(st, 2)); + script_pushconststr(st, "Unknown"); + return false; + } + + script_pushstrcopy(st, status->get_name(bl)); + + return true; +} + +/** + * Changes the name of a bl. + * Supported types are [MOB|HOM|PET]. + * For NPC see 'setnpcdisplay', MER and ELEM don't support custom names. + * + * @command setunitname <GUID>,<name>; + * @param GUID Game object unique ID. + * @param Name as string. + * @return boolean. + */ +BUILDIN(setunitname) +{ + struct block_list* bl = map->id2bl(script_getnum(st, 2)); + + if (bl == NULL) { + ShowWarning("buildin_setunitname: Game object with ID %d was not found!\n", script_getnum(st, 2)); + script_pushint(st, 0); + return false; + } + + switch (bl->type) { + case BL_MOB: + { + struct mob_data *md = BL_UCAST(BL_MOB, bl); + if (md == NULL) { + ShowWarning("buildin_setunitname: Error in finding object BL_MOB!\n"); + script_pushint(st, 0); + return false; + } + safestrncpy(md->name, script_getstr(st, 3), NAME_LENGTH); + } + break; + case BL_HOM: + { + struct homun_data *hd = BL_UCAST(BL_HOM, bl); + if (hd == NULL) { + ShowWarning("buildin_setunitname: Error in finding object BL_HOM!\n"); + script_pushint(st, 0); + return false; + } + safestrncpy(hd->homunculus.name, script_getstr(st, 3), NAME_LENGTH); + } + break; + case BL_PET: + { + struct pet_data *pd = BL_UCAST(BL_PET, bl); + if (pd == NULL) { + ShowWarning("buildin_setunitname: Error in finding object BL_PET!\n"); + script_pushint(st, 0); + return false; + } + safestrncpy(pd->pet.name, script_getstr(st, 3), NAME_LENGTH); + } + break; + default: + script_pushint(st, 0); + ShowWarning("buildin_setunitname: Unknown object type!\n"); + return false; + } + + script_pushint(st, 1); + clif->charnameack(0, bl); // Send update to client. + + return true; +} + /// Makes the unit walk to target position or target id /// Returns if it was successfull /// @@ -19682,12 +21300,16 @@ BUILDIN(makerune) BUILDIN(hascashmount) { struct map_session_data *sd = script->rid2sd(st); + if (sd == NULL) return true; - if( sd->sc.data[SC_ALL_RIDING] ) - script_pushint(st,1); - else - script_pushint(st,0); + + if (sd->sc.data[SC_ALL_RIDING]) { + script_pushint(st, 1); + } else { + script_pushint(st, 0); + } + return true; } @@ -19701,18 +21323,22 @@ BUILDIN(hascashmount) BUILDIN(setcashmount) { struct map_session_data *sd = script->rid2sd(st); + if (sd == NULL) return true; + if (pc_hasmount(sd)) { clif->msgtable(sd, MSG_REINS_CANT_USE_MOUNTED); - script_pushint(st,0);//can't mount with one of these + script_pushint(st, 0); // Can't mount with one of these } else { - if (sd->sc.data[SC_ALL_RIDING]) + if (sd->sc.data[SC_ALL_RIDING]) { status_change_end(&sd->bl, SC_ALL_RIDING, INVALID_TIMER); - else - sc_start(NULL, &sd->bl, SC_ALL_RIDING, 100, 25, INFINITE_DURATION); - script_pushint(st,1);//in both cases, return 1. + } else { + sc_start(NULL, &sd->bl, SC_ALL_RIDING, 100, battle_config.boarding_halter_speed, INFINITE_DURATION); + } + script_pushint(st, 1); // In both cases, return 1. } + return true; } @@ -19999,6 +21625,67 @@ BUILDIN(useatcmd) return true; } +BUILDIN(has_permission) +{ + struct map_session_data *sd; + enum e_pc_permission perm; + + if (script_hasdata(st, 3)) { + sd = map->id2sd(script_getnum(st, 3)); + } else { + sd = script->rid2sd(st); + } + + if (sd == NULL) { + script_pushint(st, 0); + return false; + } + + if (script_isstringtype(st, 2)) { + // to check for plugin permissions + int i = 0, j = -1; + const char *name = script_getstr(st, 2); + for (; i < pcg->permission_count; ++i) { + if (strcmp(pcg->permissions[i].name, name) == 0) { + j = i; + break; + } + } + if (j < 0) { + ShowError("script:has_permission: unknown permission: %s\n", name); + script_pushint(st, 0); + return false; + } + script_pushint(st, pc_has_permission(sd, pcg->permissions[j].permission)); + return true; + } + + // to ckeck for built-in permission + perm = script_getnum(st, 2); + script_pushint(st, pc_has_permission(sd, perm)); + return true; +} + +BUILDIN(can_use_command) +{ + struct map_session_data *sd; + const char *cmd = script_getstr(st, 2); + + if (script_hasdata(st, 3)) { + sd = map->id2sd(script_getnum(st, 3)); + } else { + sd = script->rid2sd(st); + } + + if (sd == NULL) { + script_pushint(st, 0); + return false; + } + + script_pushint(st, pc->can_use_command(sd, cmd)); + return true; +} + /* getrandgroupitem <container_item_id>,<quantity> */ BUILDIN(getrandgroupitem) { @@ -21524,7 +23211,7 @@ void script_parse_builtin(void) { BUILDIN_DEF(warp,"sii?"), BUILDIN_DEF(areawarp,"siiiisii??"), BUILDIN_DEF(warpchar,"siii"), // [LuzZza] - BUILDIN_DEF(warpparty,"siii?"), // [Fredzilla] [Paradox924X] + BUILDIN_DEF(warpparty,"siii??"), // [Fredzilla] [Paradox924X] [Jedzkie] [Dastgir] BUILDIN_DEF(warpguild,"siii?"), // [Fredzilla] BUILDIN_DEF(setlook,"ii"), BUILDIN_DEF(changelook,"ii"), // Simulates but don't Store it @@ -21604,8 +23291,8 @@ void script_parse_builtin(void) { BUILDIN_DEF(setgroupid, "i?"), BUILDIN_DEF(getgroupid,""), BUILDIN_DEF(end,""), - BUILDIN_DEF(checkoption,"i"), - BUILDIN_DEF(setoption,"i?"), + BUILDIN_DEF(checkoption,"i?"), + BUILDIN_DEF(setoption,"i??"), BUILDIN_DEF(setcart,"?"), BUILDIN_DEF(checkcart,""), BUILDIN_DEF(setfalcon,"?"), @@ -21755,8 +23442,8 @@ void script_parse_builtin(void) { BUILDIN_DEF(setnpcdir,"*"), // [4144] BUILDIN_DEF(getnpcclass,"?"), // [4144] BUILDIN_DEF(getmapxy,"rrri?"), //by Lorky [Lupus] - BUILDIN_DEF(checkoption1,"i"), - BUILDIN_DEF(checkoption2,"i"), + BUILDIN_DEF(checkoption1,"i?"), + BUILDIN_DEF(checkoption2,"i?"), BUILDIN_DEF(guildgetexp,"i"), BUILDIN_DEF(guildchangegm,"is"), BUILDIN_DEF(logmes,"s"), //this command actls as MES but rints info into LOG file either SQL/TXT [Lupus] @@ -21857,6 +23544,11 @@ void script_parse_builtin(void) { // <--- [zBuffer] List of player cont commands // [zBuffer] List of mob control commands ---> BUILDIN_DEF(getunittype,"i"), + /* Unit Data */ + BUILDIN_DEF(setunitdata,"iiv??"), + BUILDIN_DEF(getunitdata,"ii?"), + BUILDIN_DEF(getunitname,"i"), + BUILDIN_DEF(setunitname,"is"), BUILDIN_DEF(unitwalk,"ii?"), BUILDIN_DEF(unitkill,"i"), BUILDIN_DEF(unitwarp,"isii"), @@ -21968,6 +23660,8 @@ void script_parse_builtin(void) { BUILDIN_DEF(bindatcmd, "ss???"), BUILDIN_DEF(unbindatcmd, "s"), BUILDIN_DEF(useatcmd, "s"), + BUILDIN_DEF(has_permission, "v?"), + BUILDIN_DEF(can_use_command, "s?"), /** * Item bound [Xantara] [Akinari] [Mhalicot/Hercules] @@ -22073,6 +23767,7 @@ void script_hardcoded_constants(void) script->set_constant("MAX_CART",MAX_INVENTORY,false, false); script->set_constant("MAX_INVENTORY",MAX_INVENTORY,false, false); script->set_constant("MAX_ZENY",MAX_ZENY,false, false); + script->set_constant("MAX_BANK_ZENY", MAX_BANK_ZENY, false, false); script->set_constant("MAX_BG_MEMBERS",MAX_BG_MEMBERS,false, false); script->set_constant("MAX_CHAT_USERS",MAX_CHAT_USERS,false, false); script->set_constant("MAX_REFINE",MAX_REFINE,false, false); @@ -22213,6 +23908,34 @@ void script_hardcoded_constants(void) script->set_constant("BL_CHAR",BL_CHAR,false, false); script->set_constant("BL_ALL",BL_ALL,false, false); + script->constdb_comment("Player permissions"); + script->set_constant("PERM_TRADE", PC_PERM_TRADE, false, false); + script->set_constant("PERM_PARTY", PC_PERM_PARTY, false, false); + script->set_constant("PERM_ALL_SKILL", PC_PERM_ALL_SKILL, false, false); + script->set_constant("PERM_USE_ALL_EQUIPMENT", PC_PERM_USE_ALL_EQUIPMENT, false, false); + script->set_constant("PERM_SKILL_UNCONDITIONAL", PC_PERM_SKILL_UNCONDITIONAL, false, false); + script->set_constant("PERM_JOIN_ALL_CHAT", PC_PERM_JOIN_ALL_CHAT, false, false); + script->set_constant("PERM_NO_CHAT_KICK", PC_PERM_NO_CHAT_KICK, false, false); + script->set_constant("PERM_HIDE_SESSION", PC_PERM_HIDE_SESSION, false, false); + script->set_constant("PERM_RECEIVE_HACK_INFO", PC_PERM_RECEIVE_HACK_INFO, false, false); + script->set_constant("PERM_WARP_ANYWHERE", PC_PERM_WARP_ANYWHERE, false, false); + script->set_constant("PERM_VIEW_HPMETER", PC_PERM_VIEW_HPMETER, false, false); + script->set_constant("PERM_VIEW_EQUIPMENT", PC_PERM_VIEW_EQUIPMENT, false, false); + script->set_constant("PERM_USE_CHECK", PC_PERM_USE_CHECK, false, false); + script->set_constant("PERM_USE_CHANGEMAPTYPE", PC_PERM_USE_CHANGEMAPTYPE, false, false); + script->set_constant("PERM_USE_ALL_COMMANDS", PC_PERM_USE_ALL_COMMANDS, false, false); + script->set_constant("PERM_RECEIVE_REQUESTS", PC_PERM_RECEIVE_REQUESTS, false, false); + script->set_constant("PERM_SHOW_BOSS", PC_PERM_SHOW_BOSS, false, false); + script->set_constant("PERM_DISABLE_PVM", PC_PERM_DISABLE_PVM, false, false); + script->set_constant("PERM_DISABLE_PVP", PC_PERM_DISABLE_PVP, false, false); + script->set_constant("PERM_DISABLE_CMD_DEAD", PC_PERM_DISABLE_CMD_DEAD, false, false); + script->set_constant("PERM_HCHSYS_ADMIN", PC_PERM_HCHSYS_ADMIN, false, false); + script->set_constant("PERM_TRADE_BOUND", PC_PERM_TRADE_BOUND, false, false); + script->set_constant("PERM_DISABLE_PICK_UP", PC_PERM_DISABLE_PICK_UP, false, false); + script->set_constant("PERM_DISABLE_STORE", PC_PERM_DISABLE_STORE, false, false); + script->set_constant("PERM_DISABLE_EXP", PC_PERM_DISABLE_EXP, false, false); + script->set_constant("PERM_DISABLE_SKILL_USAGE", PC_PERM_DISABLE_SKILL_USAGE, false, false); + script->constdb_comment("Renewal"); #ifdef RENEWAL script->set_constant("RENEWAL", 1, false, false); diff --git a/src/map/script.h b/src/map/script.h index 0c967a94e..8caec961a 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -350,6 +350,81 @@ enum navigation_service { }; /** + * Unit Types for script handling. + */ +enum script_unit_types { + UNIT_PC = 0, + UNIT_NPC, + UNIT_PET, + UNIT_MOB, + UNIT_HOM, + UNIT_MER, + UNIT_ELEM, +}; + +/** + * Unit Data Types for script handling. + */ +enum script_unit_data_types { + UDT_TYPE = 0, + UDT_SIZE, + UDT_LEVEL, + UDT_HP, + UDT_MAXHP, + UDT_SP, + UDT_MAXSP, + UDT_MASTERAID, + UDT_MASTERCID, + UDT_MAPIDXY, + UDT_WALKTOXY, + UDT_SPEED, + UDT_MODE, + UDT_AI, + UDT_SCOPTION, + UDT_SEX, + UDT_CLASS, + UDT_HAIRSTYLE, + UDT_HAIRCOLOR, + UDT_HEADBOTTOM, + UDT_HEADMIDDLE, + UDT_HEADTOP, + UDT_CLOTHCOLOR, + UDT_SHIELD, + UDT_WEAPON, + UDT_LOOKDIR, + UDT_CANMOVETICK, + UDT_STR, + UDT_AGI, + UDT_VIT, + UDT_INT, + UDT_DEX, + UDT_LUK, + UDT_ATKRANGE, + UDT_ATKMIN, + UDT_ATKMAX, + UDT_MATKMIN, + UDT_MATKMAX, + UDT_DEF, + UDT_MDEF, + UDT_HIT, + UDT_FLEE, + UDT_PDODGE, + UDT_CRIT, + UDT_RACE, + UDT_ELETYPE, + UDT_ELELEVEL, + UDT_AMOTION, + UDT_ADELAY, + UDT_DMOTION, + UDT_HUNGER, + UDT_INTIMACY, + UDT_LIFETIME, + UDT_MERC_KILLCOUNT, + UDT_STATPOINT, + UDT_MAX +}; + +/** * Structures **/ diff --git a/src/map/status.c b/src/map/status.c index 1f068fdbc..c3e5a3f40 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -7766,30 +7766,6 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t if (sc->data[SC_FOOD_LUK_CASH] && sc->data[SC_FOOD_LUK_CASH]->val1 > val1) return 0; break; - case SC_FOOD_STR_CASH: - if (sc->data[SC_FOOD_STR] && sc->data[SC_FOOD_STR]->val1 > val1) - return 0; - break; - case SC_FOOD_AGI_CASH: - if (sc->data[SC_FOOD_AGI] && sc->data[SC_FOOD_AGI]->val1 > val1) - return 0; - break; - case SC_FOOD_VIT_CASH: - if (sc->data[SC_FOOD_VIT] && sc->data[SC_FOOD_VIT]->val1 > val1) - return 0; - break; - case SC_FOOD_INT_CASH: - if (sc->data[SC_FOOD_INT] && sc->data[SC_FOOD_INT]->val1 > val1) - return 0; - break; - case SC_FOOD_DEX_CASH: - if (sc->data[SC_FOOD_DEX] && sc->data[SC_FOOD_DEX]->val1 > val1) - return 0; - break; - case SC_FOOD_LUK_CASH: - if (sc->data[SC_FOOD_LUK] && sc->data[SC_FOOD_LUK]->val1 > val1) - return 0; - break; case SC_CAMOUFLAGE: if( sd && pc->checkskill(sd, RA_CAMOUFLAGE) < 3 && !skill->check_camouflage(bl,NULL) ) return 0; @@ -8008,40 +7984,46 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t status_change_end(bl, SC_INC_AGI, INVALID_TIMER); break; case SC_FOOD_STR: - status_change_end(bl, SC_FOOD_STR_CASH, INVALID_TIMER); + status_change_end(bl, SC_FOOD_STR, INVALID_TIMER); break; case SC_FOOD_AGI: - status_change_end(bl, SC_FOOD_AGI_CASH, INVALID_TIMER); + status_change_end(bl, SC_FOOD_AGI, INVALID_TIMER); break; case SC_FOOD_VIT: - status_change_end(bl, SC_FOOD_VIT_CASH, INVALID_TIMER); + status_change_end(bl, SC_FOOD_VIT, INVALID_TIMER); break; case SC_FOOD_INT: - status_change_end(bl, SC_FOOD_INT_CASH, INVALID_TIMER); + status_change_end(bl, SC_FOOD_INT, INVALID_TIMER); break; case SC_FOOD_DEX: - status_change_end(bl, SC_FOOD_DEX_CASH, INVALID_TIMER); + status_change_end(bl, SC_FOOD_DEX, INVALID_TIMER); break; case SC_FOOD_LUK: - status_change_end(bl, SC_FOOD_LUK_CASH, INVALID_TIMER); + status_change_end(bl, SC_FOOD_LUK, INVALID_TIMER); break; case SC_FOOD_STR_CASH: status_change_end(bl, SC_FOOD_STR, INVALID_TIMER); + status_change_end(bl, SC_FOOD_STR_CASH, INVALID_TIMER); break; case SC_FOOD_AGI_CASH: status_change_end(bl, SC_FOOD_AGI, INVALID_TIMER); + status_change_end(bl, SC_FOOD_AGI_CASH, INVALID_TIMER); break; case SC_FOOD_VIT_CASH: status_change_end(bl, SC_FOOD_VIT, INVALID_TIMER); + status_change_end(bl, SC_FOOD_VIT_CASH, INVALID_TIMER); break; case SC_FOOD_INT_CASH: status_change_end(bl, SC_FOOD_INT, INVALID_TIMER); + status_change_end(bl, SC_FOOD_INT_CASH, INVALID_TIMER); break; case SC_FOOD_DEX_CASH: status_change_end(bl, SC_FOOD_DEX, INVALID_TIMER); + status_change_end(bl, SC_FOOD_DEX_CASH, INVALID_TIMER); break; case SC_FOOD_LUK_CASH: status_change_end(bl, SC_FOOD_LUK, INVALID_TIMER); + status_change_end(bl, SC_FOOD_LUK_CASH, INVALID_TIMER); break; case SC_GM_BATTLE: status_change_end(bl, SC_GM_BATTLE2, INVALID_TIMER); diff --git a/src/map/status.h b/src/map/status.h index 17585e6a1..1496429a8 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -1761,10 +1761,10 @@ enum si_type { //SI_HEALTHSTATE_HEAVYPOISON = 890, //SI_HEALTHSTATE_FEAR = 891, //SI_CHERRY_BLOSSOM_CAKE = 892, - SI_SU_STOOP = 893, - SI_CATNIPPOWDER = 894, + SI_SU_STOOP = 893, + SI_CATNIPPOWDER = 894, SI_BLOSSOM_FLUTTERING = 895, - SI_SV_ROOTTWIST = 896, + SI_SV_ROOTTWIST = 896, //SI_ATTACK_PROPERTY_NOTHING = 897, //SI_ATTACK_PROPERTY_WATER = 898, //SI_ATTACK_PROPERTY_GROUND = 899, @@ -1786,11 +1786,11 @@ enum si_type { //SI_RESIST_PROPERTY_DARKNESS = 914, //SI_RESIST_PROPERTY_TELEKINESIS = 915, //SI_RESIST_PROPERTY_UNDEAD = 916, - SI_BITESCAR = 917, - SI_ARCLOUSEDASH = 918, - SI_TUNAPARTY = 919, - SI_SHRIMP = 920, - SI_FRESHSHRIMP = 921, + SI_BITESCAR = 917, + SI_ARCLOUSEDASH = 918, + SI_TUNAPARTY = 919, + SI_SHRIMP = 920, + SI_FRESHSHRIMP = 921, //SI_PERIOD_RECEIVEITEM = 922, //SI_PERIOD_PLUSEXP = 923, //SI_PERIOD_PLUSJOBEXP = 924, @@ -1802,14 +1802,78 @@ enum si_type { //SI_HELM_ISIA = 930, //SI_HELM_ASIR = 931, //SI_HELM_URJ = 932, - SI_SUHIDE = 933, + SI_SUHIDE = 933, //SI_ = 934, //SI_DORAM_BUF_01 = 935, //SI_DORAM_BUF_02 = 936, - SI_SPRITEMABLE = 937, + SI_SPRITEMABLE = 937, + //SI_AID_PERIOD_RECEIVEITEM = 938, + //SI_AID_PERIOD_PLUSEXP = 939, + //SI_AID_PERIOD_PLUSJOBEXP = 940, + //SI_AID_PERIOD_DEADPENALTY = 941, + //SI_AID_PERIOD_ADDSTOREITEMCOUNT = 942, + //SI_ = 943, + //SI_ = 944, + //SI_ = 945, + //SI_ = 946, + //SI_ = 947, + //SI_ = 948, + //SI_ = 949, + //SI_HISS = 950, + //SI_ = 951, + //SI_NYANGGRASS = 952, + //SI_CHATTERING = 953, + //SI_ = 954, + //SI_ = 955, + //SI_ = 956, + //SI_ = 957, + //SI_ = 958, + //SI_ = 959, + //SI_ = 960, + //SI_GROOMING = 961, + //SI_PROTECTIONOFSHRIMP = 962, //SI_EP16_2_BUFF_SS = 963, //SI_EP16_2_BUFF_SC = 964, //SI_EP16_2_BUFF_AC = 965, + //SI_GS_MAGICAL_BULLET = 966, + //SI_ = 967, + //SI_ = 968, + //SI_ = 969, + //SI_ = 970, + //SI_ = 971, + //SI_ = 972, + //SI_ = 973, + //SI_ = 974, + //SI_ = 975, + //SI_FALLEN_ANGEL = 976, + //SI_ = 977, + //SI_ = 978, + //SI_BLAZE_BEAD = 979, + //SI_FROZEN_BEAD = 980, + //SI_BREEZE_BEAD = 981, + //SI_ = 982, + //SI_AID_PERIOD_RECEIVEITEM_2ND = 983, + //SI_AID_PERIOD_PLUSEXP_2ND = 984, + //SI_AID_PERIOD_PLUSJOBEXP_2ND = 985, + //SI_PRONTERA_JP = 986, + //SI_ = 987, + //SI_GLOOM_CARD = 988, + //SI_PHARAOH_CARD = 989, + //SI_KIEL_CARD = 990, + //SI_ = 991, + //SI_CHEERUP = 992, + //SI_ = 993, + //SI_ = 994, + //SI_S_MANAPOTION = 995, + //SI_M_DEFSCROLL = 996, + //SI_ = 997, + //SI_ = 998, + //SI_ = 999, + //SI_AS_RAGGED_GOLEM_CARD = 1000, + //SI_LHZ_DUN_N1 = 1001, + //SI_LHZ_DUN_N2 = 1002, + //SI_LHZ_DUN_N3 = 1003, + //SI_LHZ_DUN_N4 = 1004, #ifndef SI_MAX SI_MAX, #endif diff --git a/src/map/unit.c b/src/map/unit.c index 7d68bef66..79abb8c6a 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1667,6 +1667,9 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui } else skill->castend_id(ud->skilltimer,tick,src->id,0); + if (sd != NULL && battle_config.prevent_logout_trigger & PLT_SKILL) + sd->canlog_tick = timer->gettick(); + return 1; } @@ -1813,6 +1816,10 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, ui ud->skilltimer = INVALID_TIMER; skill->castend_pos(ud->skilltimer,tick,src->id,0); } + + if (sd != NULL && battle_config.prevent_logout_trigger & PLT_SKILL) + sd->canlog_tick = timer->gettick(); + return 1; } @@ -2253,6 +2260,9 @@ int unit_attack_timer_sub(struct block_list* src, int tid, int64 tick) ud->attacktimer = timer->add(ud->attackabletime,unit->attack_timer,src->id,0); } + if (sd != NULL && battle_config.prevent_logout_trigger & PLT_ATTACK) + sd->canlog_tick = timer->gettick(); + return 1; } |