summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-03-20 22:18:46 -0300
committerJesusaves <cpntb1@ymail.com>2018-03-20 22:18:46 -0300
commit46af75f95a875c1fe1c3b3418af65da536abe51d (patch)
treec146ada92311b1c3179c5205919ad6e6bb16a49a
parent90ee46e6ae9b556db1c8968fdfe6018c23055416 (diff)
downloadserverdata-46af75f95a875c1fe1c3b3418af65da536abe51d.tar.gz
serverdata-46af75f95a875c1fe1c3b3418af65da536abe51d.tar.bz2
serverdata-46af75f95a875c1fe1c3b3418af65da536abe51d.tar.xz
serverdata-46af75f95a875c1fe1c3b3418af65da536abe51d.zip
The first step is moving the hall functions to a separe function.
-rw-r--r--npc/003-1/michel.txt42
-rw-r--r--npc/functions/scoreboards.txt54
-rw-r--r--npc/scripts.conf1
3 files changed, 60 insertions, 37 deletions
diff --git a/npc/003-1/michel.txt b/npc/003-1/michel.txt
index 736aa2424..58bf0f947 100644
--- a/npc/003-1/michel.txt
+++ b/npc/003-1/michel.txt
@@ -9,52 +9,20 @@
mesn;
mesq l("All hail the ones who proven their worth before the whole Alliance!");
- mes "";
- .@nb = query_sql("select name, karma from `char` ORDER BY karma DESC LIMIT 5", .@name$, .@value);
- mes l("##BHall Of Fame: TOP5##b");
- 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]+")");
+ HallOfFame();
next;
- mes "";
- .@nb = query_sql("select name, zeny from `char` ORDER BY zeny DESC LIMIT 5", .@name$, .@value);
- mes l("##BHall Of Fortune: TOP5##b");
- 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]+")");
+ HallOfFortune();
next;
- mes "";
- .@nb = query_sql("select name, base_level from `char` WHERE `guild_id`!=1 ORDER BY base_level DESC LIMIT 5", .@name$, .@value);
- mes l("##BHall Of Level: TOP5##b");
- 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]+")");
+ HallOfLevel();
next;
// Anyone with GM Level, staff or not, is allowed to latest GM logs
if (!getgmlevel()) close;
- mes "";
- .@nb = query_sql("select char_name, command from `atcommandlog` ORDER BY atcommand_id DESC LIMIT 10", .@name$, .@value$);
- mes l("##BLatest GM Commands##b");
- 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]+")");
+ HallOfGMLog();
+ next;
// Only Admins are allowed to change the HoF Scoreboard
if (!is_admin()) close;
diff --git a/npc/functions/scoreboards.txt b/npc/functions/scoreboards.txt
new file mode 100644
index 000000000..bdc1a554d
--- /dev/null
+++ b/npc/functions/scoreboards.txt
@@ -0,0 +1,54 @@
+// TMW-2 Script
+// Author:
+// Jesusalva
+// Description:
+// Leaderboards + GM Command Log
+
+function script HallOfFame {
+ mes "";
+ .@nb = query_sql("select name, karma from `char` ORDER BY karma DESC LIMIT 5", .@name$, .@value);
+ mes l("##BHall Of Fame: TOP5##b");
+ 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]+")");
+}
+
+function script HallOfFortune {
+ mes "";
+ .@nb = query_sql("select name, zeny from `char` ORDER BY zeny DESC LIMIT 5", .@name$, .@value);
+ mes l("##BHall Of Fortune: TOP5##b");
+ 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]+")");
+}
+
+function script HallOfLevel {
+ mes "";
+ .@nb = query_sql("select name, base_level from `char` WHERE `guild_id`!=1 ORDER BY base_level DESC LIMIT 5", .@name$, .@value);
+ mes l("##BHall Of Level: TOP5##b");
+ 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]+")");
+}
+
+function script HallOfGMLog {
+ mes "";
+ .@nb = query_sql("select char_name, command from `atcommandlog` ORDER BY atcommand_id DESC LIMIT 10", .@name$, .@value$);
+ mes l("##BLatest GM Commands##b");
+ 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]+")");
+}
diff --git a/npc/scripts.conf b/npc/scripts.conf
index ff49c4080..e7e8e35d9 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -47,6 +47,7 @@
"npc/functions/riddle.txt",
"npc/functions/confused-tree-dict.txt",
"npc/functions/soul_menhir.txt",
+"npc/functions/scoreboards.txt",
// quest debug
"npc/functions/quest-debug/functions.txt",