From c092c8711beef4630c8c9894a3763c7176960b03 Mon Sep 17 00:00:00 2001 From: Atemo Date: Mon, 14 Feb 2022 16:04:47 +0100 Subject: [PATCH] Changes the default value of the conf item_enabled_npc to no (#6574) * Split pre-re/re setting ** Changing of equipment while interacting with NPCs is allowed on pre-renewal by default ** Changing of equipment while interacting with NPCs is not allowed on renewal by default * Added a message when the player tries to change the equipment while talking to npc Fixed #6566 Thanks to @aleos89, @Lemongrass3110 and @Balferian ! --- conf/battle/items.conf | 4 ++-- src/map/battle.cpp | 4 ++++ src/map/clif.cpp | 2 ++ src/map/clif.hpp | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/conf/battle/items.conf b/conf/battle/items.conf index 24da604c68..692c355bc1 100644 --- a/conf/battle/items.conf +++ b/conf/battle/items.conf @@ -90,8 +90,8 @@ allow_consume_restricted_item: no allow_equip_restricted_item: yes // Allow changing of equipment while interacting with NPCs? (Note 1) -// Default: yes -item_enabled_npc: yes +// Default on official servers: yes for Pre-renewal, no for Renewal +//item_enabled_npc: yes // Allow map_flooritem to check if item is droppable? (Note 1) // If yes, undroppable items will be destroyed instead of appearing on the map when a player's inventory is full. diff --git a/src/map/battle.cpp b/src/map/battle.cpp index c4b307e812..69f0262e87 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -9909,7 +9909,11 @@ static const struct _battle_data { { "allow_consume_restricted_item", &battle_config.allow_consume_restricted_item, 1, 0, 1, }, { "allow_equip_restricted_item", &battle_config.allow_equip_restricted_item, 1, 0, 1, }, { "max_walk_path", &battle_config.max_walk_path, 17, 1, MAX_WALKPATH, }, +#ifdef RENEWAL + { "item_enabled_npc", &battle_config.item_enabled_npc, 0, 0, 1, }, +#else { "item_enabled_npc", &battle_config.item_enabled_npc, 1, 0, 1, }, +#endif { "item_flooritem_check", &battle_config.item_onfloor, 1, 0, 1, }, { "bowling_bash_area", &battle_config.bowling_bash_area, 0, 0, 20, }, { "drop_rateincrease", &battle_config.drop_rateincrease, 0, 0, 1, }, diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 418b45607f..606d4c97d5 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -12147,6 +12147,7 @@ void clif_parse_EquipItem(int fd,struct map_session_data *sd) return; //Out of bounds check. if(sd->npc_id && !sd->npc_item_flag) { + clif_msg_color( sd, C_ITEM_NOEQUIP, color_table[COLOR_RED] ); return; } else if (sd->state.storage_flag || sd->sc.opt1) ; //You can equip/unequip stuff while storage is open/under status changes @@ -12201,6 +12202,7 @@ void clif_parse_UnequipItem(int fd,struct map_session_data *sd) } if (sd->npc_id && !sd->npc_item_flag) { + clif_msg_color( sd, C_ITEM_NOEQUIP, color_table[COLOR_RED] ); return; } else if (sd->state.storage_flag || sd->sc.opt1) ; //You can equip/unequip stuff while storage is open/under status changes diff --git a/src/map/clif.hpp b/src/map/clif.hpp index b8c364fab0..c968128c63 100644 --- a/src/map/clif.hpp +++ b/src/map/clif.hpp @@ -552,6 +552,7 @@ enum clif_messages : uint16_t { // Unofficial names C_ITEM_EQUIP_SWITCH = 0xbc7, + C_ITEM_NOEQUIP = 0x174, /// <"You can't put this item on." }; enum e_personalinfo : uint8_t {