From ef81f7a84e17a2ae8b295c94bec1a2799bc5ff80 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 16 Jun 2021 15:04:33 -0300 Subject: Add patch --- npc/functions/scoreboards.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/npc/functions/scoreboards.txt b/npc/functions/scoreboards.txt index 36a61f310..8cbcd888d 100644 --- a/npc/functions/scoreboards.txt +++ b/npc/functions/scoreboards.txt @@ -38,6 +38,24 @@ function script ScoreboardsReload { return; } +function script Special2021 { + if (gettime(7) != 2021) return; + if (gettime(6) != JUNE) return; + if (gettime(5) != 21) return; + if (gettime(3) != 5) return; + debugmes "Special 2021 PROC"; + /* *** EXPENSIVE QUERY *** */ + .@nb = query_sql("SELECT MIN(`char_id`) FROM `char` WHERE `last_login` > 1619838000 GROUP BY `account_id` ORDER BY MAX(`last_login`) DESC", $@tmw2_giftday); + freeloop(true); + for (.@i=0; .@i < getarraysize($@tmw2_giftday); .@i++) { + rodex_sendmail($@tmw2_giftday, "TMW2 Team", "TMW2 Gift Day", "You are within the 120 most active players. Thanks for staying with us.", 0, StrangeCoin, (400-.@i)); + } + freeloop(false); + debugmes "Sent %d rodex mails out of %d users.", .@i, getarraysize($@tmw2_giftday); + return; +} + + - script scoreboardsGen NPC_HIDDEN,{ end; @@ -96,6 +114,7 @@ OnHour22: OnHour23: OnInit: ScoreboardsReload(); + Special2021(); deletearray $@FORT_BLACKLIST; end; } -- cgit v1.2.3-60-g2f50