diff options
author | Jesusaves <cpntb1@ymail.com> | 2025-08-10 23:41:13 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2025-08-10 23:41:13 -0300 |
commit | 2fa0779fd6c02fced1fa5324f282876157f5d77d (patch) | |
tree | 4c9e3d4d509504b8b775a21fdf6074bb02c9d894 | |
parent | d74fadc9b4110be133a7fbc07883d275b6f461df (diff) | |
download | serverdata-2fa0779fd6c02fced1fa5324f282876157f5d77d.tar.gz serverdata-2fa0779fd6c02fced1fa5324f282876157f5d77d.tar.bz2 serverdata-2fa0779fd6c02fced1fa5324f282876157f5d77d.tar.xz serverdata-2fa0779fd6c02fced1fa5324f282876157f5d77d.zip |
Add Aurora Event Calendar
-rw-r--r-- | npc/003-0-1/statues.txt | 50 | ||||
-rw-r--r-- | npc/functions/aurora.txt | 42 |
2 files changed, 92 insertions, 0 deletions
diff --git a/npc/003-0-1/statues.txt b/npc/003-0-1/statues.txt index 481e75723..3e26df099 100644 --- a/npc/003-0-1/statues.txt +++ b/npc/003-0-1/statues.txt @@ -149,6 +149,56 @@ OnInit: mes l("Thanksgiving: November 1 - 29"); mes l("Christmas: December 19 - January 2"); mesc l("Winter starts on December 21"), 3; + next; + mes l("The following Aurora Events happen when no annual event is happening:"); + mesc l("Annual events will take precedence, postponing this schedule."), 1; + // Magic to emulate a calendar + .@wkd = (gettime(GETTIME_WEEKDAY) - 1) % 7; + .@day = gettime(GETTIME_DAYOFMONTH) - .@wkd; + .@mon = gettime(GETTIME_MONTH); + .@year= gettime(GETTIME_YEAR); + .@evi = 0; // The current event + do + { + // Total days in this month + switch (.@mon) { + case JANUARY: + case MARCH: + case MAY: + case JULY: + case AUGUST: + case OCTOBER: + case DECEMBER: + .@mdy = 31; break; + case APRIL: + case JUNE: + case SEPTEMBER: + case NOVEMBER: + .@mdy = 30; break; + case FEBRUARY: + .@mdy = ((.@year % 100 && !(.@year % 400)) ? 28 : (gettime(GETTIME_YEAR) % 4 ? 28 : 29)); break; + default: + .@mdy = 0; + } + // Advance the month? + if (.@day > .@mdy) { + .@day -= .@mdy; + .@mon += 1; + } + // Advance the year? + if (.@mon > 12) { + .@mon -= 12; + .@year += 1; + //break; + } + // Print current/next event + mes l("%04d-%02d-%02d: %s", .@year, .@mon, .@day, FYEventName(.@evi)); + // Advance the dayschedule + .@evi += 1; + .@day += 7; + // Loop until 12 events were shown + } while (.@evi < 12); + mesc l("* Aurora Event calendar are tentative dates."); close; OnInit: diff --git a/npc/functions/aurora.txt b/npc/functions/aurora.txt index 462a34e8b..7a923eaa5 100644 --- a/npc/functions/aurora.txt +++ b/npc/functions/aurora.txt @@ -168,6 +168,48 @@ function script FYNewEvent { +// Returns the Human Readable event name - FYEventName( add=0 ) +function script FYEventName { + .@id = (getarg(0, 0) + $FYEVENT_CYCLE) % 12; + // Select the event + switch (.@id) { + case 1: + return l("Kamelot Season"); + case 2: + return l("World Expo"); + case 3: + return l("Regnum's Blessing"); + case 4: + return l("Boss Raid"); + case 5: + return l("Candor Battle Season"); + case 6: + return l("Miners Union Research Request"); + case 7: + return l("Celestia Season"); + case 8: + return l("Magic Olympics"); + break; + case 9: + if ($GAME_STORYLINE < 5) + return l("Rebirth Season"); + else + return l("Siege Season"); + case 10: + return l("Catch the Golden Fish"); + case 11: + return l("Gemini Season"); + default: + return l("Dream Towers"); + } + return "ERROR, REPORT ME! _NOFYID"; +} + + + + + + // Returns an item: (type, lv). Used by the function below (FYE_Autoset) // types: misc, bp, warp, pot, heal, ore, magic, gift // maxlv: 3 5 2 3 - 6 - 5 |