|
@@ -21014,6 +21014,7 @@ BUILDIN_FUNC(progressbar)
|
|
* progressbar_npc "<color>",<seconds>{,<"NPC Name">};
|
|
* progressbar_npc "<color>",<seconds>{,<"NPC Name">};
|
|
*/
|
|
*/
|
|
BUILDIN_FUNC(progressbar_npc){
|
|
BUILDIN_FUNC(progressbar_npc){
|
|
|
|
+ map_session_data *sd = map_id2sd(st->rid);
|
|
struct npc_data* nd = NULL;
|
|
struct npc_data* nd = NULL;
|
|
|
|
|
|
if( script_hasdata(st, 4) ){
|
|
if( script_hasdata(st, 4) ){
|
|
@@ -21042,8 +21043,10 @@ BUILDIN_FUNC(progressbar_npc){
|
|
return SCRIPT_CMD_FAILURE;
|
|
return SCRIPT_CMD_FAILURE;
|
|
}
|
|
}
|
|
|
|
|
|
- // detach the player
|
|
|
|
- script_detach_rid(st);
|
|
|
|
|
|
+ if (sd) { // Player attached - keep them from doing other things
|
|
|
|
+ sd->state.workinprogress = WIP_DISABLE_ALL;
|
|
|
|
+ sd->state.block_action |= (PCBLOCK_MOVE | PCBLOCK_ATTACK | PCBLOCK_SKILL);
|
|
|
|
+ }
|
|
|
|
|
|
// sleep for the target amount of time
|
|
// sleep for the target amount of time
|
|
st->state = RERUNLINE;
|
|
st->state = RERUNLINE;
|
|
@@ -21055,6 +21058,11 @@ BUILDIN_FUNC(progressbar_npc){
|
|
// Second call(by timer after sleeping time is over)
|
|
// Second call(by timer after sleeping time is over)
|
|
} else {
|
|
} else {
|
|
// Continue the script
|
|
// Continue the script
|
|
|
|
+ if (sd) { // Player attached - remove restrictions
|
|
|
|
+ sd->state.workinprogress = WIP_DISABLE_NONE;
|
|
|
|
+ sd->state.block_action &= ~(PCBLOCK_MOVE | PCBLOCK_ATTACK | PCBLOCK_SKILL);
|
|
|
|
+ }
|
|
|
|
+
|
|
st->state = RUN;
|
|
st->state = RUN;
|
|
st->sleep.tick = 0;
|
|
st->sleep.tick = 0;
|
|
nd->progressbar.timeout = nd->progressbar.color = 0;
|
|
nd->progressbar.timeout = nd->progressbar.color = 0;
|