summaryrefslogtreecommitdiff
path: root/npc/commands
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-03-06 12:45:34 -0300
committerJesusaves <cpntb1@ymail.com>2019-03-06 12:45:34 -0300
commitd71340676d65ccf522b844b27b49c2f9e84f29bc (patch)
tree0fb73a996b178b1d6788a8f2d7b0cc9b1ac388cd /npc/commands
parentb88361918970a261683cf84e841ddd0b9cd94137 (diff)
downloadserverdata-d71340676d65ccf522b844b27b49c2f9e84f29bc.tar.gz
serverdata-d71340676d65ccf522b844b27b49c2f9e84f29bc.tar.bz2
serverdata-d71340676d65ccf522b844b27b49c2f9e84f29bc.tar.xz
serverdata-d71340676d65ccf522b844b27b49c2f9e84f29bc.zip
$@EXP_EVENT + "@exprate::OnPlayerCall" allows scripts to change experience ratio
for a hour (capped range 1~120%)
Diffstat (limited to 'npc/commands')
-rw-r--r--npc/commands/rate-management.txt24
1 files changed, 24 insertions, 0 deletions
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) {