summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorEmistry Haoyan <Equinox1991@gmail.com>2016-10-27 23:45:43 +0800
committerHaru <haru@dotalux.com>2020-02-09 16:40:14 +0100
commit0f15d957cc0bb17415f85d26d2198ed248494e2f (patch)
treed862f2b600670db7b71adf3eb7d65e0bfa97fa4c /src/map/atcommand.c
parent3687a79c5ab173abf6263a003d9473d9c2938309 (diff)
downloadhercules-0f15d957cc0bb17415f85d26d2198ed248494e2f.tar.gz
hercules-0f15d957cc0bb17415f85d26d2198ed248494e2f.tar.bz2
hercules-0f15d957cc0bb17415f85d26d2198ed248494e2f.tar.xz
hercules-0f15d957cc0bb17415f85d26d2198ed248494e2f.zip
Update Duel System Cooldown
- Able to set cooldown in "seconds" format. - New `duel_time_interval` value will be applied to any existing cooldown if new value is reloaded in-game using `@reloadbattleconf`. - Display the cooldown tick before can create new duel.
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 3cd26079d..5d95e2c14 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -8048,10 +8048,11 @@ ACMD(duel)
return false;
}
- if (!duel->checktime(sd)) {
+ int64 diff = duel->difftime(sd);
+ if (diff > 0) {
char output[CHAT_SIZE_MAX];
- // "Duel: You can take part in duel only one time per %d minutes."
- sprintf(output, msg_fd(fd,356), battle_config.duel_time_interval);
+ // "Duel: You can take part in duel again after %d secconds."
+ sprintf(output, msg_fd(fd,356), (int)diff);
clif->message(fd, output);
return false;
}
@@ -8101,10 +8102,11 @@ ACMD(leave)
ACMD(accept)
{
- if (!duel->checktime(sd)) {
+ int64 diff = duel->difftime(sd);
+ if (diff > 0) {
char output[CHAT_SIZE_MAX];
- // "Duel: You can take part in duel only one time per %d minutes."
- sprintf(output, msg_fd(fd,356), battle_config.duel_time_interval);
+ // "Duel: You can take part in duel again after %d seconds."
+ sprintf(output, msg_fd(fd,356), (int)diff);
clif->message(fd, output);
return false;
}