summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmistry Haoyan <equinox1991@gmail.com>2018-10-02 22:13:14 +0800
committerEmistry Haoyan <equinox1991@gmail.com>2018-10-02 23:06:22 +0800
commit0dda2c717349d11742285c09e73f4ee7a01a1149 (patch)
treea4e4d32a41ac3db60909ef721ff3627fd36398ca
parent852c13305f67948531bd0277eb1922dbd02b1f26 (diff)
downloadhercules-0dda2c717349d11742285c09e73f4ee7a01a1149.tar.gz
hercules-0dda2c717349d11742285c09e73f4ee7a01a1149.tar.bz2
hercules-0dda2c717349d11742285c09e73f4ee7a01a1149.tar.xz
hercules-0dda2c717349d11742285c09e73f4ee7a01a1149.zip
Update idle criteria
- remove idle when interact with scripts.
-rw-r--r--conf/map/battle/player.conf1
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/clif.c14
3 files changed, 16 insertions, 0 deletions
diff --git a/conf/map/battle/player.conf b/conf/map/battle/player.conf
index 25ac24d6b..c7bb13e88 100644
--- a/conf/map/battle/player.conf
+++ b/conf/map/battle/player.conf
@@ -211,6 +211,7 @@ snovice_call_type: 0
// 0x080 - Emotion Request
// 0x100 - DropItem Request
// 0x200 - @/#Command Request
+// 0x400 - NPC Script Interaction
// Please note that at least 1 option has to be enabled.
// Be mindful that the more options used, the easier it becomes to cheat features that rely on idletime (e.g. checkidle()).
// Default: walk ( 0x1 ) + useskilltoid ( 0x2 ) + useskilltopos ( 0x4 ) + useitem ( 0x8 ) + attack ( 0x10 ) = 0x1F
diff --git a/src/map/battle.h b/src/map/battle.h
index 9f5207e95..3458a72dd 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -584,6 +584,7 @@ enum e_battle_config_idletime {
BCIDLE_EMOTION = 0x080,
BCIDLE_DROPITEM = 0x100,
BCIDLE_ATCOMMAND = 0x200,
+ BCIDLE_SCRIPT = 0x400,
};
// Damage delayed info
diff --git a/src/map/clif.c b/src/map/clif.c
index 76625f0ba..b9942d72c 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -2215,6 +2215,8 @@ static void clif_scriptmes(struct map_session_data *sd, int npcid, const char *m
slen = (int)strlen(mes) + 9;
Assert_retv(slen <= INT16_MAX);
+ pc->update_idle_time(sd, BCIDLE_SCRIPT);
+
sd->state.dialog = 1;
WFIFOHEAD(fd, slen);
@@ -2251,6 +2253,8 @@ static void clif_scriptnext(struct map_session_data *sd, int npcid)
nullpo_retv(sd);
+ pc->update_idle_time(sd, BCIDLE_SCRIPT);
+
fd=sd->fd;
WFIFOHEAD(fd, packet_len(0xb5));
WFIFOW(fd,0)=0xb5;
@@ -2279,6 +2283,8 @@ static void clif_scriptclose(struct map_session_data *sd, int npcid)
nullpo_retv(sd);
+ pc->update_idle_time(sd, BCIDLE_SCRIPT);
+
fd=sd->fd;
WFIFOHEAD(fd, packet_len(0xb6));
WFIFOW(fd,0)=0xb6;
@@ -2350,6 +2356,8 @@ static void clif_scriptmenu(struct map_session_data *sd, int npcid, const char *
bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1))))
clif->sendfakenpc(sd, npcid);
+ pc->update_idle_time(sd, BCIDLE_SCRIPT);
+
WFIFOHEAD(fd, slen);
WFIFOW(fd,0) = 0xb7;
WFIFOW(fd,2) = slen;
@@ -2381,6 +2389,8 @@ static void clif_scriptinput(struct map_session_data *sd, int npcid)
bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1))))
clif->sendfakenpc(sd, npcid);
+ pc->update_idle_time(sd, BCIDLE_SCRIPT);
+
fd=sd->fd;
WFIFOHEAD(fd, packet_len(0x142));
WFIFOW(fd,0)=0x142;
@@ -2411,6 +2421,8 @@ static void clif_scriptinputstr(struct map_session_data *sd, int npcid)
bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1))))
clif->sendfakenpc(sd, npcid);
+ pc->update_idle_time(sd, BCIDLE_SCRIPT);
+
fd=sd->fd;
WFIFOHEAD(fd, packet_len(0x1d4));
WFIFOW(fd,0)=0x1d4;
@@ -11372,6 +11384,7 @@ static void clif_npc_buy_result(struct map_session_data *sd, unsigned char resul
int fd;
nullpo_retv(sd);
+ pc->update_idle_time(sd, BCIDLE_SCRIPT);
fd = sd->fd;
WFIFOHEAD(fd,packet_len(0xca));
WFIFOW(fd,0) = 0xca;
@@ -11425,6 +11438,7 @@ static void clif_npc_sell_result(struct map_session_data *sd, unsigned char resu
int fd;
nullpo_retv(sd);
+ pc->update_idle_time(sd, BCIDLE_SCRIPT);
fd = sd->fd;
WFIFOHEAD(fd,packet_len(0xcb));
WFIFOW(fd,0) = 0xcb;