summaryrefslogtreecommitdiff
path: root/npc/commands
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2023-12-09 13:49:10 -0300
committerJesusaves <cpntb1@ymail.com>2023-12-09 13:49:10 -0300
commit91611102940c34aaf1d94dc31981f5210579c60b (patch)
tree8d61ae9da90438e10307cc4fac6ef08a756d34d4 /npc/commands
parentad8fa7f99177ced2dfbabf4678f4710ce7a35362 (diff)
downloadserverdata-91611102940c34aaf1d94dc31981f5210579c60b.tar.gz
serverdata-91611102940c34aaf1d94dc31981f5210579c60b.tar.bz2
serverdata-91611102940c34aaf1d94dc31981f5210579c60b.tar.xz
serverdata-91611102940c34aaf1d94dc31981f5210579c60b.zip
Theoretically, Drop Rate events can now happen. Except they don't. Untested.
Diffstat (limited to 'npc/commands')
-rw-r--r--npc/commands/rate-management.txt51
1 files changed, 51 insertions, 0 deletions
diff --git a/npc/commands/rate-management.txt b/npc/commands/rate-management.txt
index 52151777b..14c45509d 100644
--- a/npc/commands/rate-management.txt
+++ b/npc/commands/rate-management.txt
@@ -309,6 +309,57 @@ OnCall:
end;
+OnPlayerCall:
+ if ($@CI_MODE)
+ end;
+ /*
+ // GM calls take precedence at any time!
+ if (.max_hours > 0 || .hours > 0)
+ end;
+ */
+ // $@DROP_EVENT will determine the boost and should not be above 25%
+ // Default duration is one hour, or whatever $@DROP_EVENT_TIME is
+ $@DROP_EVENT=limit(0, $@DROP_EVENT, 100);
+ $@DROP_EVENT+=.current_rate;
+ if ($@DROP_EVENT_TIME > 6) {
+ consolewarn("Tried to set DROP Event Time to %d hours, but max is 6 (no exceptions allowed)", $@DROP_EVENT_TIME);
+ $@DROP_EVENT_TIME=limit(1, $@DROP_EVENT_TIME, 6);
+ }
+
+ // If a GM rate-up was running, we will sum the time, too.
+ // It'll be rounded down. (so 1h + 30m = 1h) FIXME average is better
+ if (.hours || .max_hours) {
+ $@DROP_EVENT_TIME+=max(0, .max_hours-.hours-1);
+ }
+
+ // Default duration is one hour, or whatever $@EXP_EVENT_TIME is
+ .hours = 0;
+ .max_hours = $@DROP_EVENT_TIME;
+ .current_rate = $@DROP_EVENT;
+ .@new_rate = $@DROP_EVENT;
+ setbattleflag("item_rate_common", dropRecalc(.@new_rate));
+ setbattleflag("item_rate_common_boss", dropRecalc(.@new_rate));
+ setbattleflag("item_rate_heal", dropRecalc(.@new_rate));
+ setbattleflag("item_rate_heal_boss", dropRecalc(.@new_rate));
+ setbattleflag("item_rate_use", dropRecalc(.@new_rate));
+ setbattleflag("item_rate_use_boss", dropRecalc(.@new_rate));
+ setbattleflag("item_rate_equip", dropRecalc(.@new_rate));
+ setbattleflag("item_rate_equip_boss", dropRecalc(.@new_rate));
+ setbattleflag("item_rate_card", dropRecalc(.@new_rate));
+ setbattleflag("item_rate_card_boss", dropRecalc(.@new_rate));
+ charcommand("@reloadmobdb");
+ SeasonReload(1);
+ initnpctimer; // start counting
+
+ .@msg$="Drop Rate was modified to "+$@DROP_EVENT+"% for "+$@DROP_EVENT_TIME+" hour(s)!";
+
+ announce .@msg$, bc_all;
+ channelmes("#world", .@msg$);
+
+ $@DROP_EVENT=0;
+ $@DROP_EVENT_TIME=0;
+ end;
+
OnTimer3600000:
// runs every hour
if (++.hours == .max_hours) {