diff --git a/src/map/clif.c b/src/map/clif.c index 7986fce60c..301c6846c1 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1919,6 +1919,22 @@ void clif_scriptclose(struct map_session_data *sd, int npcid) WFIFOSET(fd,packet_len(0xb6)); } +/// [Ind/Hercules] +/// Close script when player is idle +/// 08d6 .L +void clif_scriptclear(struct map_session_data *sd, int npcid) +{ + int fd; + + nullpo_retv(sd); + + fd=sd->fd; + WFIFOHEAD(fd, packet_len(0x8d6)); + WFIFOW(fd,0)=0x8d6; + WFIFOL(fd,2)=npcid; + WFIFOSET(fd,packet_len(0x8d6)); + } + /*========================================== * *------------------------------------------*/ @@ -17541,7 +17557,7 @@ void packetdb_readdb(void) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //#0x08C0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, - 9, 7, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 9, 7, 10, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //#0x0900 diff --git a/src/map/clif.h b/src/map/clif.h index 8c42ac85de..8c0a3a2ac7 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -392,6 +392,7 @@ void clif_selllist(struct map_session_data *sd); //self void clif_scriptmes(struct map_session_data *sd, int npcid, const char *mes); //self void clif_scriptnext(struct map_session_data *sd,int npcid); //self void clif_scriptclose(struct map_session_data *sd, int npcid); //self +void clif_scriptclear(struct map_session_data *sd, int npcid); //self void clif_scriptmenu(struct map_session_data* sd, int npcid, const char* mes); //self void clif_scriptinput(struct map_session_data *sd, int npcid); //self void clif_scriptinputstr(struct map_session_data *sd, int npcid); // self diff --git a/src/map/pc.c b/src/map/pc.c index d1eb8fcb2e..c85469b858 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -6750,6 +6750,7 @@ void pc_close_npc(struct map_session_data *sd,int flag) sd->npc_idle_timer = INVALID_TIMER; #endif clif_scriptclose(sd,sd->npc_id); + clif_scriptclear(sd,sd->npc_id); // [Ind/Hercules] if(sd->st && sd->st->state == END ) {// free attached scripts that are waiting script_free_state(sd->st); sd->st = NULL;