Added pcblock and checkpcblock script commands. (#3951)

* Added getpcblock and setpcblock script commands.
* Added the docs
* Added the message 'This action is currently blocked.' when the player attempts to perform the following blocked actions
* PCBLOCK_USEITEM
* PCBLOCK_SITSTAND
* PCBLOCK_NPCCLICK
* The actions blocked are saved in state.block_action
* Click to the npc returns the WORK_IN_PROGRESS message when PCBLOCK_NPCCLICK is enabled
* Blocked action and reload script.
The player will return to his/her original state after reload script.

Thanks to @aleos89, @Lemongrass3110, @secretdataz
This commit is contained in:
Atemo
2019-03-26 16:18:59 +01:00
committed by Jittapan Pluemsumran
parent 7cc8c96467
commit 3e0d3d2fe6
14 changed files with 169 additions and 19 deletions

View File

@@ -984,6 +984,9 @@ int npc_touch_areanpc(struct map_session_data* sd, int16 m, int16 x, int16 y)
//if(sd->npc_id)
// return 1;
if (sd->state.block_action & PCBLOCK_NPCCLICK)
return 0;
struct map_data *mapdata = map_getmapdata(m);
for(i=0;i<mapdata->npc_num;i++)
@@ -1284,7 +1287,12 @@ int npc_click(struct map_session_data* sd, struct npc_data* nd)
//Hidden/Disabled npc.
if (nd->class_ < 0 || nd->sc.option&(OPTION_INVISIBLE|OPTION_HIDE))
return 1;
if (sd->state.block_action & PCBLOCK_NPCCLICK) {
clif_msg(sd, WORK_IN_PROGRESS);
return 1;
}
switch(nd->subtype) {
case NPCTYPE_SHOP:
clif_npcbuysell(sd,nd->bl.id);