From 0c80171d1d5354a6dc5ac2efa5a5451bf28b7a02 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 16 Mar 2019 20:09:47 -0300 Subject: Change how Easter Leaderboard work (leaderboard is reset with server btw) --- npc/001-4/lilica.txt | 28 ++++++++++++++++------------ npc/003-1/events.txt | 24 +++++++++++------------- npc/commands/event.txt | 1 + 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/npc/001-4/lilica.txt b/npc/001-4/lilica.txt index c41c75e51..aa1bb6722 100644 --- a/npc/001-4/lilica.txt +++ b/npc/001-4/lilica.txt @@ -30,18 +30,17 @@ L_Golden: close; L_Leader: - .@nb = query_sql("SELECT c.name, i.amount FROM `inventory` AS i, `char` AS c WHERE i.nameid=834 AND i.char_id=c.char_id ORDER BY i.amount DESC LIMIT 10", .@name$, .@value); - - mes("1."+.@name$[0]+" ("+.@value[0]+")"); - mes("2."+.@name$[1]+" ("+.@value[1]+")"); - mes("3."+.@name$[2]+" ("+.@value[2]+")"); - mes("4."+.@name$[3]+" ("+.@value[3]+")"); - mes("5."+.@name$[4]+" ("+.@value[4]+")"); - mes("6."+.@name$[5]+" ("+.@value[5]+")"); - mes("7."+.@name$[6]+" ("+.@value[6]+")"); - mes("8."+.@name$[7]+" ("+.@value[7]+")"); - mes("9."+.@name$[8]+" ("+.@value[8]+")"); - mes("10."+.@name$[9]+" ("+.@value[9]+")"); + mesc l("Leaderboard is refresh daily at 1 AM!"); + mes("1."+$@easter_name$[0]+" ("+$@easter_value[0]+")"); + mes("2."+$@easter_name$[1]+" ("+$@easter_value[1]+")"); + mes("3."+$@easter_name$[2]+" ("+$@easter_value[2]+")"); + mes("4."+$@easter_name$[3]+" ("+$@easter_value[3]+")"); + mes("5."+$@easter_name$[4]+" ("+$@easter_value[4]+")"); + mes("6."+$@easter_name$[5]+" ("+$@easter_value[5]+")"); + mes("7."+$@easter_name$[6]+" ("+$@easter_value[6]+")"); + mes("8."+$@easter_name$[7]+" ("+$@easter_value[7]+")"); + mes("9."+$@easter_name$[8]+" ("+$@easter_value[8]+")"); + mes("10."+$@easter_name$[9]+" ("+$@easter_value[9]+")"); close; L_Quest: @@ -81,6 +80,11 @@ L_Unlucky: mes l("Better luck next time!\""); close; +OnClock0100: + if ($EVENT$ == "Easter") + .@nb = query_sql("SELECT c.name, i.amount FROM `inventory` AS i, `char` AS c WHERE i.nameid=834 AND i.char_id=c.char_id ORDER BY i.amount DESC LIMIT 10", $@easter_name$, $@easter_value); + end; + OnInit: .sex = G_OTHER; .distance = 5; diff --git a/npc/003-1/events.txt b/npc/003-1/events.txt index 806725fb2..8b83e0512 100644 --- a/npc/003-1/events.txt +++ b/npc/003-1/events.txt @@ -27,19 +27,17 @@ L_Golden: close; L_Leader: - .@nb = query_sql("SELECT c.name, i.amount FROM `inventory` AS i, `char` AS c WHERE i.nameid=834 AND i.char_id=c.char_id ORDER BY i.amount DESC LIMIT 10", .@name$, .@value); - - mesn l("Players who still have Golden Eggs"); - mes("1."+.@name$[0]+" ("+.@value[0]+")"); - mes("2."+.@name$[1]+" ("+.@value[1]+")"); - mes("3."+.@name$[2]+" ("+.@value[2]+")"); - mes("4."+.@name$[3]+" ("+.@value[3]+")"); - mes("5."+.@name$[4]+" ("+.@value[4]+")"); - mes("6."+.@name$[5]+" ("+.@value[5]+")"); - mes("7."+.@name$[6]+" ("+.@value[6]+")"); - mes("8."+.@name$[7]+" ("+.@value[7]+")"); - mes("9."+.@name$[8]+" ("+.@value[8]+")"); - mes("10."+.@name$[9]+" ("+.@value[9]+")"); + mesn l("Easter @@", gettime(GETTIME_YEAR)); + mes("1."+$@easter_name$[0]+" ("+$@easter_value[0]+")"); + mes("2."+$@easter_name$[1]+" ("+$@easter_value[1]+")"); + mes("3."+$@easter_name$[2]+" ("+$@easter_value[2]+")"); + mes("4."+$@easter_name$[3]+" ("+$@easter_value[3]+")"); + mes("5."+$@easter_name$[4]+" ("+$@easter_value[4]+")"); + mes("6."+$@easter_name$[5]+" ("+$@easter_value[5]+")"); + mes("7."+$@easter_name$[6]+" ("+$@easter_value[6]+")"); + mes("8."+$@easter_name$[7]+" ("+$@easter_value[7]+")"); + mes("9."+$@easter_name$[8]+" ("+$@easter_value[8]+")"); + mes("10."+$@easter_name$[9]+" ("+$@easter_value[9]+")"); close; OnInit: diff --git a/npc/commands/event.txt b/npc/commands/event.txt index fe5c39b78..559198fef 100644 --- a/npc/commands/event.txt +++ b/npc/commands/event.txt @@ -16,6 +16,7 @@ function script sClear { DelItemFromEveryPlayer(OpenedChristmasBox); disablenpc "Lilica#final"; } else { + .@nb = query_sql("SELECT c.name, i.amount FROM `inventory` AS i, `char` AS c WHERE i.nameid=834 AND i.char_id=c.char_id ORDER BY i.amount DESC LIMIT 10", $@easter_name$, $@easter_value); enablenpc "Lilica#final"; } -- cgit v1.2.3-70-g09d2