From c564106e55cd9f850df74dbde6beae82c936b38e Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 17 May 2020 14:29:36 -0300 Subject: I'm forced to declare FYEventUsesRanking() in scoreboards.txt but anyway. This should fix some ugliness. --- npc/functions/aurora.txt | 3 ++- npc/functions/scoreboards.txt | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'npc/functions') diff --git a/npc/functions/aurora.txt b/npc/functions/aurora.txt index e0d9aa5ef..1eca1f6a8 100644 --- a/npc/functions/aurora.txt +++ b/npc/functions/aurora.txt @@ -7,7 +7,7 @@ // // Controls weekly events so Saulc, seeds and I can take vacations. // See also: seasons.txt, command/event.txt, event.txt, 003-1/events.txt -// soulmenhir.txt and, of course, the event maps (if any). +// soulmenhir.txt, scoreboards.txt and, of course, the event maps (if any). // Aurora Event Framework functions are called by event.txt // specs override and is overriden by those defined in commands/event.txt @@ -188,6 +188,7 @@ function script FYStopEvent { return; } + // Handle the ending of Aurora Events function script FYRewardEvent { setarray .@av$, "Expo", "Fishing"; diff --git a/npc/functions/scoreboards.txt b/npc/functions/scoreboards.txt index 083723b05..3c501653e 100644 --- a/npc/functions/scoreboards.txt +++ b/npc/functions/scoreboards.txt @@ -4,6 +4,16 @@ // Description: // Leaderboards + GM Command Log +// Returns if an event is a ranked Aurora Event or not +// (Had to be moved from functions/aurora.txt) +function script FYEventUsesRanking { + setarray .@av$, "Expo", "Fishing"; + if (array_find(.@av$, $EVENT$) >= 0) { + return true; + } + return false; +} + 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); @@ -25,7 +35,7 @@ function script ScoreboardsReload { .@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); } - if ($EVENT$ == "Expo" || $EVENT$ == "Fishing") { + if (FYEventUsesRanking()) { .@nb = query_sql("SELECT c.name, i.count2 FROM `quest` AS i, `char` AS c WHERE i.quest_id="+Q_AuroraEvent+" AND i.char_id=c.char_id ORDER BY i.count2 DESC LIMIT 10", $@aurora_name$, $@aurora_value); } debugmes "Scoreboards reloaded"; -- cgit v1.2.3-60-g2f50