From 0f15d957cc0bb17415f85d26d2198ed248494e2f Mon Sep 17 00:00:00 2001 From: Emistry Haoyan Date: Thu, 27 Oct 2016 23:45:43 +0800 Subject: 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. --- src/map/atcommand.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/map/atcommand.c') 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; } -- cgit v1.2.3-70-g09d2