From d1f8b19b79b558c999e2893df695416e7be582c8 Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Fri, 9 Dec 2022 11:09:57 -0800 Subject: [PATCH] Inlude karma & money when calculating HoF best players scores References: - https://github.com/arianne/stendhal/issues/453 - https://stendhalgame.org/chat/2022-07-05.html --- data/script/halloffame.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/script/halloffame.sql b/data/script/halloffame.sql index 51da09d07c6..6a26ba17d12 100644 --- a/data/script/halloffame.sql +++ b/data/script/halloffame.sql @@ -8,7 +8,7 @@ -- X XP -- B Best (xp and online age) -- @ Achievement score --- R Role play score (xp and achievement) +-- R Role play score (xp, achievement, karma, & money) (TODO: add maze score, deathmatch score, visited zones, & completed quests) -- O -- 0 -- 3,4,5,6,7,8,9 Paper Chase 2013 and newer @@ -108,7 +108,7 @@ ORDER BY points DESC, nmb DESC, xp DESC) As scoretable, INSERT INTO halloffame_archive_recent (charname, fametype, halloffame_archive_recent.rank, points, day) SELECT scoretable.name, 'R', @rownum:=@rownum+1 as rankX, scoretable.points, CURRENT_DATE() FROM ( - SELECT name, round(ln(xp*(ifnull(sum(1/reached)*1000,0)+0.0001))*1000) As points, sum(1/reached) + SELECT name, round(ln((xp+karma+money)*(ifnull(sum(1/reached)*1000,0)+0.0001))*1000) As points, sum(1/reached) FROM achievement JOIN reached_achievement ra ON (ra.achievement_id=achievement.id) RIGHT JOIN character_stats ON name = charname @@ -207,7 +207,7 @@ ORDER BY points DESC, nmb DESC, xp DESC) As scoretable, INSERT INTO halloffame_archive_alltimes (charname, fametype, halloffame_archive_alltimes.rank, points, day) SELECT scoretable.name, 'R', @rownum:=@rownum+1 as rankX, scoretable.points, CURRENT_DATE() FROM ( - SELECT name, round(ln(xp*(ifnull(sum(1/reached)*1000,0)+0.0001))*1000) As points, sum(1/reached) + SELECT name, round(ln((xp+karma+money)*(ifnull(sum(1/reached)*1000,0)+0.0001))*1000) As points, sum(1/reached) FROM achievement JOIN reached_achievement ra ON (ra.achievement_id=achievement.id) RIGHT JOIN character_stats ON name = charname