Explorar o código

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 !
Atemo %!s(int64=3) %!d(string=hai) anos
pai
achega
c092c8711b
Modificáronse 4 ficheiros con 9 adicións e 2 borrados
  1. 2 2
      conf/battle/items.conf
  2. 4 0
      src/map/battle.cpp
  3. 2 0
      src/map/clif.cpp
  4. 1 0
      src/map/clif.hpp

+ 2 - 2
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.

+ 4 - 0
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,              },

+ 2 - 0
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

+ 1 - 0
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 {