Skip to content

Commit

Permalink
Factor maze & deathmatch scores when calculating best players
Browse files Browse the repository at this point in the history
  • Loading branch information
AntumDeluge committed Dec 11, 2022
1 parent d1f8b19 commit 77725ad
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions data/script/halloffame.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
-- X XP
-- B Best (xp and online age)
-- @ Achievement score
-- R Role play score (xp, achievement, karma, & money) (TODO: add maze score, deathmatch score, visited zones, & completed quests)
-- R Role play score (xp, achievement, karma, money, maze score, & deathmatch score) (TODO: visited zones & completed quests)
-- O
-- 0
-- 3,4,5,6,7,8,9 Paper Chase 2013 and newer
Expand Down Expand Up @@ -108,7 +108,14 @@ 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+karma+money)*(ifnull(sum(1/reached)*1000,0)+0.0001))*1000) As points, sum(1/reached)
SELECT
name,
round(ln(
(xp+karma+money
+ifnull((SELECT points FROM halloffame WHERE fametype='M' AND charname=name LIMIT 1), 0)
+ifnull((SELECT points FROM halloffame WHERE fametype='D' AND charname=name LIMIT 1), 0)
)*(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
Expand Down Expand Up @@ -207,7 +214,14 @@ 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+karma+money)*(ifnull(sum(1/reached)*1000,0)+0.0001))*1000) As points, sum(1/reached)
SELECT
name,
round(ln(
(xp+karma+money
+ifnull((SELECT points FROM halloffame WHERE fametype='M' AND charname=name LIMIT 1), 0)
+ifnull((SELECT points FROM halloffame WHERE fametype='D' AND charname=name LIMIT 1), 0)
)*(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
Expand Down

0 comments on commit 77725ad

Please sign in to comment.