summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2025-08-15 13:36:00 +0200
committerFedja Beader <fedja@protonmail.ch>2025-08-15 14:39:40 +0200
commit0190656d75fc8164655c07fc51a2a1c02a593898 (patch)
tree5e3e42b042d00520d49b74f0e85d6905f72c0d02
parent59578953e21d0e3bc989918b8d62ddb9fedb37f0 (diff)
downloadserverdata-fix_rate_boost_stacking.tar.gz
serverdata-fix_rate_boost_stacking.tar.bz2
serverdata-fix_rate_boost_stacking.tar.xz
serverdata-fix_rate_boost_stacking.zip
Don't lose an hour when extending a rate boostfix_rate_boost_stacking
<tmw2-server> [ ThinkSome ] : 7h57mins left now <tmw2-server> ThinkSome has sponsored a Server Happy Hour using tax money! <tmw2-server> Experience Rate was modified to 274% for 10 hour(s)! <tmw2-server> [ ThinkSome ] : 9h59 left 7h57 + 3 = 10h57 9h57 with no timer reset 10h57 with no -1
-rw-r--r--npc/commands/rate-management.txt26
1 files changed, 14 insertions, 12 deletions
diff --git a/npc/commands/rate-management.txt b/npc/commands/rate-management.txt
index e19ba5ae3..a71201e68 100644
--- a/npc/commands/rate-management.txt
+++ b/npc/commands/rate-management.txt
@@ -123,11 +123,9 @@ OnPlayerCall:
$@EXP_EVENT_TIME=limit(1, $@EXP_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) {
- $@EXP_EVENT_TIME+=max(0, .max_hours-.hours-1);
- }
+ // If another rate-up is active, we will sum the time, too.
+ if (.hours || .max_hours)
+ $@EXP_EVENT_TIME += max(0, .max_hours - .hours);
// Default duration is one hour, or whatever $@EXP_EVENT_TIME is
.hours = 0;
@@ -137,7 +135,10 @@ OnPlayerCall:
setbattleflag("job_exp_rate", expRecalc($@EXP_EVENT));
charcommand("@reloadmobdb");
SeasonReload(1);
- initnpctimer; // start counting
+
+ // <3600> 1 <3600> 2 <3600> 3 <STOP>
+ if (getnpctimer(0) == 0)
+ initnpctimer; // start counting
.@msg$="Experience Rate was modified to "+$@EXP_EVENT+"% for "+$@EXP_EVENT_TIME+" hour(s)!";
@@ -326,11 +327,9 @@ OnPlayerCall:
$@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);
- }
+ // If another rate-up is active, we will sum the time, too.
+ if (.hours || .max_hours)
+ $@DROP_EVENT_TIME += max(0, .max_hours - .hours);
// Default duration is one hour, or whatever $@EXP_EVENT_TIME is
.hours = 0;
@@ -349,7 +348,10 @@ OnPlayerCall:
setbattleflag("item_rate_card_boss", dropRecalc(.@new_rate));
charcommand("@reloadmobdb");
SeasonReload(1);
- initnpctimer; // start counting
+
+ // <3600> 1 <3600> 2 <3600> 3 <STOP>
+ if (getnpctimer(0) == 0)
+ initnpctimer; // start counting
.@msg$="Drop Rate was modified to "+$@DROP_EVENT+"% for "+$@DROP_EVENT_TIME+" hour(s)!";