From 9e2b0b4a4d66f54c761e32c8c8d69c3a6e52233f Mon Sep 17 00:00:00 2001 From: eppc0330 <47050704+eppc0330@users.noreply.github.com> Date: Sun, 26 May 2024 22:43:32 +0900 Subject: [PATCH] New pcblock flag PCBLOCK_EQUIP (#8367) --- doc/script_commands.txt | 3 ++- src/map/clif.cpp | 4 ++-- src/map/script.hpp | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 95973a8971..122f2fb00b 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -6608,7 +6608,8 @@ Available : PCBLOCK_COMMANDS Prevent the player from using atcommands/charcommands. PCBLOCK_NPCCLICK Prevent the player from clicking/touching any NPC/shop/warp. PCBLOCK_EMOTION Prevent the player from using emotions. - PCBLOCK_NPC Simulate NPC interaction. Useful for NPC with no mes window. Sum of PCBLOCK_MOVE|PCBLOCK_SKILL|PCBLOCK_USEITEM|PCBLOCK_COMMANDS|PCBLOCK_NPCCLICK. + PCBLOCK_EQUIP Prevent the player from replacing equipment. + PCBLOCK_NPC Simulate NPC interaction. Useful for NPC with no mes window. Sum of PCBLOCK_MOVE|PCBLOCK_SKILL|PCBLOCK_USEITEM|PCBLOCK_COMMANDS|PCBLOCK_NPCCLICK|PCBLOCK_EQUIP. PCBLOCK_ALL Sum of all the flags. Examples: diff --git a/src/map/clif.cpp b/src/map/clif.cpp index e7cf0d1101..75d8c0c18c 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -12075,7 +12075,7 @@ void clif_parse_EquipItem(int fd,map_session_data *sd) if (index < 0 || index >= MAX_INVENTORY) return; //Out of bounds check. - if(sd->npc_id && !sd->npc_item_flag) { + if((sd->npc_id && !sd->npc_item_flag) || (sd->state.block_action & PCBLOCK_EQUIP)) { clif_msg_color( sd, CAN_NOT_EQUIP_ITEM, color_table[COLOR_RED] ); return; } else if (sd->state.storage_flag || sd->sc.opt1) @@ -12130,7 +12130,7 @@ void clif_parse_UnequipItem(int fd,map_session_data *sd) return; } - if (sd->npc_id && !sd->npc_item_flag) { + if((sd->npc_id && !sd->npc_item_flag) || (sd->state.block_action & PCBLOCK_EQUIP)) { clif_msg_color( sd, CAN_NOT_EQUIP_ITEM, color_table[COLOR_RED] ); return; } else if (sd->state.storage_flag || sd->sc.opt1) diff --git a/src/map/script.hpp b/src/map/script.hpp index 81fd2919fe..c2f46c782e 100644 --- a/src/map/script.hpp +++ b/src/map/script.hpp @@ -2155,9 +2155,10 @@ enum e_pcblock_action_flag : uint16 { PCBLOCK_SITSTAND = 0x040, PCBLOCK_COMMANDS = 0x080, PCBLOCK_NPCCLICK = 0x100, - PCBLOCK_NPC = 0x18D, PCBLOCK_EMOTION = 0x200, - PCBLOCK_ALL = 0x3FF, + PCBLOCK_EQUIP = 0x400, + PCBLOCK_NPC = 0x58D, + PCBLOCK_ALL = 0x7FF, }; /* getiteminfo/setiteminfo script commands */