New pcblock flag PCBLOCK_EQUIP (#8367)

This commit is contained in:
eppc0330 2024-05-26 22:43:32 +09:00 committed by GitHub
parent 05ced985e3
commit 9e2b0b4a4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

View File

@ -6608,7 +6608,8 @@ Available <type>:
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:

View File

@ -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)

View File

@ -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 */