From 039a18fa891a78f17dd89e4f92874060cc996fe0 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 21 Feb 2022 05:03:38 -0300 Subject: Fix some bad Olympics code --- npc/functions/aurora.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'npc/functions') diff --git a/npc/functions/aurora.txt b/npc/functions/aurora.txt index bcd50376a..d9dcd9580 100644 --- a/npc/functions/aurora.txt +++ b/npc/functions/aurora.txt @@ -130,7 +130,6 @@ function script FYNewEvent { kamibroadcast("Kamelot Season is now open!", "Aurora Events"); break; case 8: - // FIXME: PLACEHOLDER => Magic Olympics $EVENT$="Olympics"; callfunc("FYEConf_Olympics"); kamibroadcast("Magic Olympics are now open!", "Aurora Events"); @@ -738,7 +737,17 @@ function script FYRewardEvent { if (FYEventUsesRanking()) { debugmes("Rewards are due"); // This code absolutely can't fail: - .@nb = query_sql("SELECT c.name, i.count2, c.char_id 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, $@aurora_charid); + if ($EVENT$ == "Olympics") { + callfunc("HocusScoreNew"); + copyarray $@aurora_name$, $@moly_n$, 10; + copyarray $@aurora_value, $@moly_v, 10; + for (.@i=0; .@i < 10; .@i++) { + if ($@aurora_name$[.@i] == "") break; + $@aurora_charid[.@i] = gf_charnameid($@aurora_name$[.@i]); + } + } else { + .@nb = query_sql("SELECT c.name, i.count2, c.char_id 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, $@aurora_charid); + } $MOST_HEROIC$=$@aurora_name$[0]; for (.@i=0;.@i < getarraysize($@aurora_charid);.@i++) { switch (.@i+1) { -- cgit v1.2.3-70-g09d2