diff options
-rw-r--r-- | db/pre-re/item_db.conf | 5 | ||||
-rw-r--r-- | npc/annuals/fathertime.txt | 16 | ||||
-rw-r--r-- | npc/functions/global_event_handler.txt | 1 |
3 files changed, 21 insertions, 1 deletions
diff --git a/db/pre-re/item_db.conf b/db/pre-re/item_db.conf index 4bc6cc2a..a5cd0e9b 100644 --- a/db/pre-re/item_db.conf +++ b/db/pre-re/item_db.conf @@ -13478,7 +13478,10 @@ item_db: ( Refine: false ViewSprite: 5235 Script: <" - callfunc "TMWBirthdayGift"; + // 5231..5234 + .@it=callfunc("any", + RedPresentHat, GreenPresentHat, BluePresentHat, YellowPresentHat); + getitem .@it, 1; "> }, { diff --git a/npc/annuals/fathertime.txt b/npc/annuals/fathertime.txt index d33dc4f8..6a92e7dc 100644 --- a/npc/annuals/fathertime.txt +++ b/npc/annuals/fathertime.txt @@ -14,3 +14,19 @@ OnTimer20000: //initnpctimer; end; } + +function script TMWBirthday { + if (gettime(GETTIME_MONTH) != APRIL) return; + if (gettime(GETTIME_DAYOFMONTH) != 11) return; + .@age=gettime(GETTIME_YEAR)-2004; + .@end=(.@age % 10); + .@mo$=(.@end == 1 ? "st" : (.@end == 2 ? "nd" : (.@end == 3 ? "rd" : "th"))); + dispbottom l("It is TMW's %d%s birthday!", .@age, .@mo$); + // Handle gifts + if (#TMWBDAY < .@age) { + #TMWBDAY=.@age; + getitem TMWBirthdayGift, 1; + } + return; +} + diff --git a/npc/functions/global_event_handler.txt b/npc/functions/global_event_handler.txt index bc8f6742..69972292 100644 --- a/npc/functions/global_event_handler.txt +++ b/npc/functions/global_event_handler.txt @@ -8,6 +8,7 @@ OnPCLoginEvent: //callfunc "fixHeadStyles"; // convert headstyles ClearVariables(); // removes / converts old variables DisplayMOTD(); // send the motd to the client, if enabled + TMWBirthday(); // add more here vaultOnLogin(); @login_event = 2; |