summaryrefslogtreecommitdiff
path: root/npc/functions/scoreboards.txt
blob: 442cacd7fce4242c92cf90b5af2f76bb11a3dd4b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
// Moubootaur Legends Script
// Author:
//    Jesusalva
// Description:
//    Leaderboards

// Scoreboard functions
function	script	HallOfGuild	{
    mes "";
	mes l("##BHall Of Guild Level: TOP5##b");
	mesf("1. %s (%d)", $@hoguild_name$[0], $@hoguild_value[0]);
	mesf("2. %s (%d)", $@hoguild_name$[1], $@hoguild_value[1]);
	mesf("3. %s (%d)", $@hoguild_name$[2], $@hoguild_value[2]);
	mesf("4. %s (%d)", $@hoguild_name$[3], $@hoguild_value[3]);
	mesf("5. %s (%d)", $@hoguild_name$[4], $@hoguild_value[4]);
    return;
}

function	script	HallOfFortune	{
    mes "";
	mes l("##BHall Of Fortune: TOP15##b");
	mesf("1. %s (%s GP)", $@hofortune_name$[0], fnum($@hofortune_value[0]));
	mesf("2. %s (%s GP)", $@hofortune_name$[1], fnum($@hofortune_value[1]));
	mesf("3. %s (%s GP)", $@hofortune_name$[2], fnum($@hofortune_value[2]));
	mesf("4. %s (%s GP)", $@hofortune_name$[3], fnum($@hofortune_value[3]));
	mesf("5. %s (%s GP)", $@hofortune_name$[4], fnum($@hofortune_value[4]));
	mesf("6. %s (%s GP)", $@hofortune_name$[5], fnum($@hofortune_value[5]));
	mesf("7. %s (%s GP)", $@hofortune_name$[6], fnum($@hofortune_value[6]));
	mesf("8. %s (%s GP)", $@hofortune_name$[7], fnum($@hofortune_value[7]));
	mesf("9. %s (%s GP)", $@hofortune_name$[8], fnum($@hofortune_value[8]));
	mesf("10. %s (%s GP)", $@hofortune_name$[9], fnum($@hofortune_value[9]));
	mesf("11. %s (%s GP)", $@hofortune_name$[10], fnum($@hofortune_value[10]));
	mesf("12. %s (%s GP)", $@hofortune_name$[11], fnum($@hofortune_value[11]));
	mesf("13. %s (%s GP)", $@hofortune_name$[12], fnum($@hofortune_value[12]));
	mesf("14. %s (%s GP)", $@hofortune_name$[13], fnum($@hofortune_value[13]));
	mesf("15. %s (%s GP)", $@hofortune_name$[14], fnum($@hofortune_value[14]));
    return;
}

function	script	HallOfLevel	{
    mes "";
	mes l("##BHall Of Level: TOP15##b");
	mesf("1. %s (%d)", $@hoblvl_name$[0], $@hoblvl_value[0]);
	mesf("2. %s (%d)", $@hoblvl_name$[1], $@hoblvl_value[1]);
	mesf("3. %s (%d)", $@hoblvl_name$[2], $@hoblvl_value[2]);
	mesf("4. %s (%d)", $@hoblvl_name$[3], $@hoblvl_value[3]);
	mesf("5. %s (%d)", $@hoblvl_name$[4], $@hoblvl_value[4]);
	mesf("6. %s (%d)", $@hoblvl_name$[5], $@hoblvl_value[5]);
	mesf("7. %s (%d)", $@hoblvl_name$[6], $@hoblvl_value[6]);
	mesf("8. %s (%d)", $@hoblvl_name$[7], $@hoblvl_value[7]);
	mesf("9. %s (%d)", $@hoblvl_name$[8], $@hoblvl_value[8]);
	mesf("10. %s (%d)", $@hoblvl_name$[9], $@hoblvl_value[9]);
	mesf("11. %s (%d)", $@hoblvl_name$[10], $@hoblvl_value[10]);
	mesf("12. %s (%d)", $@hoblvl_name$[11], $@hoblvl_value[11]);
	mesf("13. %s (%d)", $@hoblvl_name$[12], $@hoblvl_value[12]);
	mesf("14. %s (%d)", $@hoblvl_name$[13], $@hoblvl_value[13]);
	mesf("15. %s (%d)", $@hoblvl_name$[14], $@hoblvl_value[14]);
    return;
}

function	script	HallOfJob	{
    mes "";
	mes l("##BHall Of Job Level: TOP15##b");
	mesf("1. %s (%d)", $@hojlvl_name$[0], $@hojlvl_value[0]);
	mesf("2. %s (%d)", $@hojlvl_name$[1], $@hojlvl_value[1]);
	mesf("3. %s (%d)", $@hojlvl_name$[2], $@hojlvl_value[2]);
	mesf("4. %s (%d)", $@hojlvl_name$[3], $@hojlvl_value[3]);
	mesf("5. %s (%d)", $@hojlvl_name$[4], $@hojlvl_value[4]);
	mesf("6. %s (%d)", $@hojlvl_name$[5], $@hojlvl_value[5]);
	mesf("7. %s (%d)", $@hojlvl_name$[6], $@hojlvl_value[6]);
	mesf("8. %s (%d)", $@hojlvl_name$[7], $@hojlvl_value[7]);
	mesf("9. %s (%d)", $@hojlvl_name$[8], $@hojlvl_value[8]);
	mesf("10. %s (%d)", $@hojlvl_name$[9], $@hojlvl_value[9]);
	mesf("11. %s (%d)", $@hojlvl_name$[10], $@hojlvl_value[10]);
	mesf("12. %s (%d)", $@hojlvl_name$[11], $@hojlvl_value[11]);
	mesf("13. %s (%d)", $@hojlvl_name$[12], $@hojlvl_value[12]);
	mesf("14. %s (%d)", $@hojlvl_name$[13], $@hojlvl_value[13]);
	mesf("15. %s (%d)", $@hojlvl_name$[14], $@hojlvl_value[14]);
    return;
}

function	script	HallOfAcorns	{
    mes "";
	mes l("##BHall Of Acorns: TOP15##b");
    mesc l("Only %s in storage will be counted.", getitemlink(Acorn));
	mesf("1. %s (%d)", $@hoa_name$[0], $@hoa_value[0]);
	mesf("2. %s (%d)", $@hoa_name$[1], $@hoa_value[1]);
	mesf("3. %s (%d)", $@hoa_name$[2], $@hoa_value[2]);
	mesf("4. %s (%d)", $@hoa_name$[3], $@hoa_value[3]);
	mesf("5. %s (%d)", $@hoa_name$[4], $@hoa_value[4]);
	mesf("6. %s (%d)", $@hoa_name$[5], $@hoa_value[5]);
	mesf("7. %s (%d)", $@hoa_name$[6], $@hoa_value[6]);
	mesf("8. %s (%d)", $@hoa_name$[7], $@hoa_value[7]);
	mesf("9. %s (%d)", $@hoa_name$[8], $@hoa_value[8]);
	mesf("10. %s (%d)", $@hoa_name$[9], $@hoa_value[9]);
	mesf("11. %s (%d)", $@hoa_name$[10], $@hoa_value[10]);
	mesf("12. %s (%d)", $@hoa_name$[11], $@hoa_value[11]);
	mesf("13. %s (%d)", $@hoa_name$[12], $@hoa_value[12]);
	mesf("14. %s (%d)", $@hoa_name$[13], $@hoa_value[13]);
	mesf("15. %s (%d)", $@hoa_name$[14], $@hoa_value[14]);
    return;
}

function	script	HallOfLethality	{
    mes "";
	mes l("##BHall Of Lethality: TOP15##b");
	mesc l("Special monsters are not counted.");
	mesf("1. %s (%d)", $@hol_name$[0], $@hol_value[0]);
	mesf("2. %s (%d)", $@hol_name$[1], $@hol_value[1]);
	mesf("3. %s (%d)", $@hol_name$[2], $@hol_value[2]);
	mesf("4. %s (%d)", $@hol_name$[3], $@hol_value[3]);
	mesf("5. %s (%d)", $@hol_name$[4], $@hol_value[4]);
	mesf("6. %s (%d)", $@hol_name$[5], $@hol_value[5]);
	mesf("7. %s (%d)", $@hol_name$[6], $@hol_value[6]);
	mesf("8. %s (%d)", $@hol_name$[7], $@hol_value[7]);
	mesf("9. %s (%d)", $@hol_name$[8], $@hol_value[8]);
	mesf("10. %s (%d)", $@hol_name$[9], $@hol_value[9]);
	mesf("11. %s (%d)", $@hol_name$[10], $@hol_value[10]);
	mesf("12. %s (%d)", $@hol_name$[11], $@hol_value[11]);
	mesf("13. %s (%d)", $@hol_name$[12], $@hol_value[12]);
	mesf("14. %s (%d)", $@hol_name$[13], $@hol_value[13]);
	mesf("15. %s (%d)", $@hol_name$[14], $@hol_value[14]);
    return;
}

// HallOfGame()
function	script	HallOfGame	{
    mes l("Players Killed in PvP: %s", format_number($PLAYERS_KILLED));
    mes l("Monsters Killed in PvE: %s", format_number($MONSTERS_KILLED));
    mes "";
    // season ; weather ; game time ; world story ; etc.
    mes "";
    mes l("Notable mentions and thanks for our [@@https://www.patreon.com/themanaworld|sponsors@@] for their continued support.");
    mes "";
    return;
}


// Main script handler for scoreboards
-	script	@scoreboard	NPC_HIDDEN,{
    end;
OnHour00:
OnHour01:
OnHour02:
OnHour03:
OnHour04:
OnHour05:
OnHour06:
OnHour07:
OnHour08:
OnHour09:
OnHour10:
OnHour11:
OnHour12:
OnHour13:
OnHour14:
OnHour15:
OnHour16:
OnHour17:
OnHour18:
OnHour19:
OnHour20:
OnHour21:
OnHour22:
OnHour23:
OnInit:
    consolemes(CONSOLEMES_DEBUG, "Reloading scoreboards...");
	.@nb = query_sql("select name, zeny from `char` ORDER BY zeny DESC LIMIT 15", $@hofortune_name$, $@hofortune_value);
	.@nb = query_sql("select name, base_level from `char` ORDER BY base_level DESC LIMIT 15", $@hoblvl_name$, $@hoblvl_value);
	.@nb = query_sql("select name, job_level from `char` ORDER BY job_level DESC LIMIT 15", $@hojlvl_name$, $@hojlvl_value);
	.@nb = query_sql("select name, guild_lv from `guild` ORDER BY guild_lv DESC LIMIT 5", $@hoguild_name$, $@hoguild_value);
	.@nb = query_sql("SELECT c.name, i.amount FROM `storage` AS i, `char` AS c WHERE i.nameid="+Acorn+" AND i.account_id=c.account_id AND c.char_num = 0 ORDER BY i.amount DESC LIMIT 15", $@hoa_name$, $@hoa_value);
	.@nb = query_sql("SELECT c.name, i.value FROM `char_reg_num_db` AS i, `char` AS c WHERE i.key='MONSTERS_KILLED' AND i.char_id=c.char_id ORDER BY i.value DESC LIMIT 15", $@hol_name$, $@hol_value);
    consolemes(CONSOLEMES_DEBUG, "Scoreboards reloaded");
    if (!$@SCOREBOARD_BIND) {
        bindatcmd "scoreboard", "@scoreboard::OnCall", 0, 100, 0;
        bindatcmd "scoreboards", "@scoreboard::OnCall", 0, 100, 0;
        $@SCOREBOARD_BIND=true;
    }
    end;

OnCall:
    do {
        clear;
        mes l("The Mana World - Legacy");
        mesc l("All scoreboards are updated hourly."), 1;
        mes "";
        select
            l("Hall Of Fortune"),
            l("Hall Of Base Level"),
            l("Hall Of Job Level"),
            l("Hall Of Guilds"),
            l("Hall Of Lethality"),
            l("Hall Of Acorns"),
            l("Game Statistics"),
            l("Personal Information"),
            l("Quit");
        mes "";
        switch (@menu) {
        case 1:
            HallOfFortune();
            next;
            break;
        case 2:
            HallOfLevel();
            next;
            break;
        case 3:
            HallOfJob();
            next;
            break;
        case 4:
            HallOfGuild();
            next;
            break;
        case 5:
            HallOfLethality();
            next;
            break;
        case 6:
            HallOfAcorns();
            next;
            break;
        case 7:
            HallOfGame();
            next;
            break;
        case 8:
            ShowAbizit(true);
            mes "";
            mesc l("Total deaths: %s", fnum(PC_DIE_COUNTER));
            mesc l("Boss points: %s", fnum(BOSS_POINTS));
            mesc l("Mob points: %s", fnum(Mobpt));
            mesc l("Total Gold: %s", fnum((Zeny+BankVault)));
            next;
            break;
        default:
            close;
        }
    } while (true);
    end;
}