summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2023-12-16 00:15:12 -0300
committerJesusaves <cpntb1@ymail.com>2023-12-16 00:15:12 -0300
commit50018c7e8c186a9f12e2a48b1036ae262449870b (patch)
tree08167bcc4e96fa5a96bdda4e98fe4cd43ea66205 /npc
parent39763f33ec62464ff30abbb550c05e4e3758dcfd (diff)
downloadserverdata-50018c7e8c186a9f12e2a48b1036ae262449870b.tar.gz
serverdata-50018c7e8c186a9f12e2a48b1036ae262449870b.tar.bz2
serverdata-50018c7e8c186a9f12e2a48b1036ae262449870b.tar.xz
serverdata-50018c7e8c186a9f12e2a48b1036ae262449870b.zip
This should in theory track your anniversary (365 days, NOT a year). Prizeless.
NO reward is given whatsoever, as it is easily cheat-able.
Diffstat (limited to 'npc')
-rw-r--r--npc/functions/clientversion.txt1
-rw-r--r--npc/functions/daily.txt18
2 files changed, 19 insertions, 0 deletions
diff --git a/npc/functions/clientversion.txt b/npc/functions/clientversion.txt
index 3058ce524..ea089d602 100644
--- a/npc/functions/clientversion.txt
+++ b/npc/functions/clientversion.txt
@@ -1161,6 +1161,7 @@ function script clientupdater {
dispbottom l("You received the @@ from @@.", getitemlink(Lightbringer), l("The Mana Source"));
}
}
+ // TODO: Anniversary (leap years disregarded)
// :// End of Regular Update System
////////////////////////////////////
diff --git a/npc/functions/daily.txt b/npc/functions/daily.txt
index 2c7ff08f3..694da2af4 100644
--- a/npc/functions/daily.txt
+++ b/npc/functions/daily.txt
@@ -135,6 +135,24 @@ function script daily_login_bonus_handler {
dispbottom l("##2Daily login bonus: ##B%d Job Exp.##b", .@value);
}
+ // TODO: Handle player anniversary? Prism Gift on day, warning a day before
+ // But what about multiple chars? This is why, for now, no prize is given.
+ // A year has 31,536,000 seconds
+ // TUT_VAR or #REG_DATE ? Both seem to be fed...
+ .@cur_yr = gettimetick(2) / 31536000;
+ .@org_yr = TUT_VAR / 31536000;
+ .@diff = gettimetick(2) - (.@cur_yr * 31536000); // secs since 1970-01-01
+ .@doff = TUT_VAR - (.@org_yr * 31536000); // secs since 1970-01-01
+ // NOTE: This ignore leap years altogether and tracks "a full year".
+ // This means the anniversary is not "a year" but "365 days".
+ // Each leap year shall throw the anniversary a day behind, Julian style.
+ if (legendaryTimeCheck(.@diff, .@doff)) {
+ //getitem PrismGift, 1;
+ dispbottom l("Happy %dth anniversary!", (.@cur_yr - .@org_yr));
+ }
+ // Client_updater: if #REG_DATE < gettimetick(2) - 31536000 then gift
+ // Should go live on 01-01-2024 for sake of fairness?
+
// Handle event login bonus
if (gettime(6) == JANUARY) {
if (#TMW2_LOGINBONUS != gettime(GETTIME_YEAR) && gettime(5) == 13) {