From 692a195e2e973f7ee81fbb4848c85198d74face5 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 22 Feb 2020 15:51:07 -0300 Subject: Every day 1st of every month, the 10 most honored (PvP) and best at Candor Battle will receive 15 [Strange Coin]s as reward. Currently only those, and no, I have not tested. --- npc/functions/scoreboards.txt | 73 ++++++++++++++++++++++++++++++------------- 1 file changed, 52 insertions(+), 21 deletions(-) diff --git a/npc/functions/scoreboards.txt b/npc/functions/scoreboards.txt index fa1734ea4..7a3379aa1 100644 --- a/npc/functions/scoreboards.txt +++ b/npc/functions/scoreboards.txt @@ -4,8 +4,59 @@ // Description: // Leaderboards + GM Command Log +function script ScoreboardsReload { + debugmes "Reloading scoreboards..."; + .@nb = query_sql("select name, zeny from `char` WHERE `guild_id`!=1 ORDER BY zeny DESC LIMIT 15", $@hofortune_name$, $@hofortune_value); + .@nb = query_sql("select name, base_level from `char` WHERE `guild_id`!=1 ORDER BY base_level DESC LIMIT 15", $@hoblvl_name$, $@hoblvl_value); + .@nb = query_sql("select name, job_level from `char` WHERE `guild_id`!=1 ORDER BY job_level DESC LIMIT 15", $@hojlvl_name$, $@hojlvl_value); + .@nb = query_sql("SELECT c.name, i.amount FROM `inventory` AS i, `char` AS c WHERE i.nameid="+StrangeCoin+" AND i.char_id=c.char_id ORDER BY i.amount DESC LIMIT 15", $@hoc_name$, $@hoc_value); + .@nb = query_sql("select char_name, command from `atcommandlog` ORDER BY atcommand_id DESC LIMIT 15", $@hogm_name$, $@hogm_value$); + .@nb = query_sql("select name, guild_lv from `guild` WHERE `guild_id`!=1 ORDER BY guild_lv DESC LIMIT 5", $@hoguild_name$, $@hoguild_value); + .@nb = query_sql("SELECT c.name, i.value FROM `char_reg_num_db` AS i, `char` AS c WHERE i.key='CRAZYPOINTS' AND i.char_id=c.char_id ORDER BY i.value DESC LIMIT 10", $@cfefe_name$, $@cfefe_value); + .@nb = query_sql("SELECT c.name, i.value FROM `char_reg_num_db` AS i, `char` AS c WHERE i.key='UDTRANK' AND i.char_id=c.char_id ORDER BY i.value DESC LIMIT 10", $@udt_name$, $@udt_value); + .@nb = query_sql("SELECT c.name, i.value FROM `char_reg_num_db` AS i, `char` AS c WHERE i.key='AFKING' AND i.char_id=c.char_id ORDER BY i.value DESC LIMIT 10", $@afk_name$, $@afk_value); + .@nb = query_sql("SELECT c.name, i.value FROM `char_reg_num_db` AS i, `char` AS c WHERE i.key='HONOR' AND i.char_id=c.char_id ORDER BY i.value DESC LIMIT 10", $@hof_name$, $@hof_value); + + // Seasonal Scoreboards + if (season() == SUMMER || season() == AUTUMN) { + .@nb = query_sql("SELECT c.name, i.count2 FROM `quest` AS i, `char` AS c WHERE i.quest_id=305 AND i.char_id=c.char_id AND i.count1="+(gettime(GETTIME_YEAR)-2000)+" ORDER BY i.count2 DESC LIMIT 10", $@ched_name$, $@ched_value); + } + if (season() == WINTER || season() == AUTUMN) { + .@nb = query_sql("SELECT c.name, i.count2 FROM `quest` AS i, `char` AS c WHERE i.quest_id="+SQuest_Christmas+" AND i.char_id=c.char_id ORDER BY i.count2 DESC LIMIT 5", $@xmas_box_name$, $@xmas_box_value); + .@nb = query_sql("SELECT c.name, i.count3 FROM `quest` AS i, `char` AS c WHERE i.quest_id="+SQuest_Christmas+" AND i.char_id=c.char_id ORDER BY i.count3 DESC LIMIT 5", $@xmas_gp_name$, $@xmas_gp_value); + } + debugmes "Scoreboards reloaded"; + return; +} + - script scoreboardsGen NPC_HIDDEN,{ end; + +// Monthly Scoreboards Rewards +OnDay0101: +OnDay0201: +OnDay0301: +OnDay0401: +OnDay0501: +OnDay0601: +OnDay0701: +OnDay0801: +OnDay0901: +OnDay1001: +OnDay1101: +OnDay1201: + ScoreboardsReload(); // Ensure + + for (.@i=0; .@i < getarraysize($@hof_name$); .@i++) { + rodex_sendmail(gf_charnameid($@hof_name$[.@i]), "Scoreboards", "Hall Of Honor: TOP 10", "For being on the TOP 10 of this hall, you're getting some Strange Coins.", 0, StrangeCoin, 15); + } + + for (.@i=0; .@i < getarraysize($@cfefe_name$); .@i++) { + rodex_sendmail(gf_charnameid($@cfefe_name$[.@i]), "Scoreboards", "Hall Of Candor Battle: TOP 10", "For being on the TOP 10 of this hall, you're getting some Strange Coins.", 0, StrangeCoin, 15); + } + + end; + OnHour00: OnHour01: OnHour02: @@ -31,27 +82,7 @@ OnHour21: OnHour22: OnHour23: OnInit: - debugmes "Reloading scoreboards..."; - .@nb = query_sql("select name, zeny from `char` WHERE `guild_id`!=1 ORDER BY zeny DESC LIMIT 15", $@hofortune_name$, $@hofortune_value); - .@nb = query_sql("select name, base_level from `char` WHERE `guild_id`!=1 ORDER BY base_level DESC LIMIT 15", $@hoblvl_name$, $@hoblvl_value); - .@nb = query_sql("select name, job_level from `char` WHERE `guild_id`!=1 ORDER BY job_level DESC LIMIT 15", $@hojlvl_name$, $@hojlvl_value); - .@nb = query_sql("SELECT c.name, i.amount FROM `inventory` AS i, `char` AS c WHERE i.nameid="+StrangeCoin+" AND i.char_id=c.char_id ORDER BY i.amount DESC LIMIT 15", $@hoc_name$, $@hoc_value); - .@nb = query_sql("select char_name, command from `atcommandlog` ORDER BY atcommand_id DESC LIMIT 15", $@hogm_name$, $@hogm_value$); - .@nb = query_sql("select name, guild_lv from `guild` WHERE `guild_id`!=1 ORDER BY guild_lv DESC LIMIT 5", $@hoguild_name$, $@hoguild_value); - .@nb = query_sql("SELECT c.name, i.value FROM `char_reg_num_db` AS i, `char` AS c WHERE i.key='CRAZYPOINTS' AND i.char_id=c.char_id ORDER BY i.value DESC LIMIT 10", $@cfefe_name$, $@cfefe_value); - .@nb = query_sql("SELECT c.name, i.value FROM `char_reg_num_db` AS i, `char` AS c WHERE i.key='UDTRANK' AND i.char_id=c.char_id ORDER BY i.value DESC LIMIT 10", $@udt_name$, $@udt_value); - .@nb = query_sql("SELECT c.name, i.value FROM `char_reg_num_db` AS i, `char` AS c WHERE i.key='AFKING' AND i.char_id=c.char_id ORDER BY i.value DESC LIMIT 10", $@afk_name$, $@afk_value); - .@nb = query_sql("SELECT c.name, i.value FROM `char_reg_num_db` AS i, `char` AS c WHERE i.key='HONOR' AND i.char_id=c.char_id ORDER BY i.value DESC LIMIT 10", $@hof_name$, $@hof_value); - - // Seasonal Scoreboards - if (season() == SUMMER || season() == AUTUMN) { - .@nb = query_sql("SELECT c.name, i.count2 FROM `quest` AS i, `char` AS c WHERE i.quest_id=305 AND i.char_id=c.char_id AND i.count1="+(gettime(GETTIME_YEAR)-2000)+" ORDER BY i.count2 DESC LIMIT 10", $@ched_name$, $@ched_value); - } - if (season() == WINTER || season() == AUTUMN) { - .@nb = query_sql("SELECT c.name, i.count2 FROM `quest` AS i, `char` AS c WHERE i.quest_id="+SQuest_Christmas+" AND i.char_id=c.char_id ORDER BY i.count2 DESC LIMIT 5", $@xmas_box_name$, $@xmas_box_value); - .@nb = query_sql("SELECT c.name, i.count3 FROM `quest` AS i, `char` AS c WHERE i.quest_id="+SQuest_Christmas+" AND i.char_id=c.char_id ORDER BY i.count3 DESC LIMIT 5", $@xmas_gp_name$, $@xmas_gp_value); - } - debugmes "Scoreboards reloaded"; + ScoreboardsReload(); end; } -- cgit v1.2.3-60-g2f50