From d71340676d65ccf522b844b27b49c2f9e84f29bc Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 6 Mar 2019 12:45:34 -0300 Subject: $@EXP_EVENT + "@exprate::OnPlayerCall" allows scripts to change experience ratio for a hour (capped range 1~120%) --- npc/commands/rate-management.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/npc/commands/rate-management.txt b/npc/commands/rate-management.txt index 8d5daa2e7..fc0af91fe 100644 --- a/npc/commands/rate-management.txt +++ b/npc/commands/rate-management.txt @@ -74,6 +74,30 @@ OnCall: end; +OnPlayerCall: + // GM calls take precedence at any time! + if (.max_hours > 0 || .hours > 0) + end; + // $@EXP_EVENT will determine the boost and shall NEVER be above 20% + if ($@EXP_EVENT <= 0 || $@EXP_EVENT > 120) { + announce "##1##BSEVERE ERROR: Misformatted command, $@EXP_EVENT cannot be over 20% bonus and must be valid.", bc_all; + } + .hours = 0; + .max_hours = 1; // Always one hour - never more than that + .current_rate = $@EXP_EVENT; + setbattleflag("base_exp_rate", $@EXP_EVENT); + charcommand("@reloadmobdb"); + SeasonReload(1); + initnpctimer; // start counting + + .@msg$="Experience Rate was modified to "+$@EXP_EVENT+"%!"; + + announce .@msg$, bc_all; + channelmes("#world", .@msg$); + + $@EXP_EVENT=0; + end; + OnTimer3600000: // runs every hour if (++.hours == .max_hours) { -- cgit v1.2.3-70-g09d2