prontera,148,170,6 script MVP Ladder 891,{ mes "[MVP Ladder]"; mes "Hello!"; mes "What are you doing here?"; next; switch(select("Check rankings.:My stats.:Nothing...")) { case 1: mes "[MVP Ladder]"; query_sql("SELECT char_id,CAST(`value` AS SIGNED) FROM `global_reg_value` WHERE `str` = 'MVP_Rank' ORDER BY CAST(`value` AS SIGNED) DESC LIMIT 20",.@cid,.@value); for(set .@i,0; .@i query_sql("SELECT `name` FROM `char` WHERE char_id = "+.@cid[.@i]+";",.@j$); set .@name$[.@i], .@j$; } if (!getarraysize(.@cid)) mes "The rankings are empty."; else for(set .@i,0; .@i mes "["+(.@i+1)+"] "+.@name$[.@i]+" ~ "+.@value[.@i]+" kills"; close; case 2: mes "[MVP Ladder]"; mes "You have killed "+((MVP_Rank)?"^0055FF"+MVP_Rank:"no")+"^000000 MVP"+((MVP_Rank == 1)?".":"s."); close; case 3: close; }
OnNPCKillEvent: if (getmonsterinfo(killedrid,22)) { set MVP_Rank, MVP_Rank+1; if (MVP_Rank == 1) query_sql("INSERT INTO `global_reg_value` (`char_id`,`str`,`value`,`type`,`account_id`) VALUES ("+getcharid(0)+",'MVP_Rank','1',3,0)"); else query_sql("UPDATE `global_reg_value` SET `value` = '"+MVP_Rank+"' WHERE char_id = "+getcharid(0)+" AND `str` ='MVP_Rank'"); dispbottom "~ You've killed "+MVP_Rank+" MVP"+((MVP_Rank == 1)?"":"s")+". ~"; specialeffect2 313; } end; }
Can someone enhance this script. The Idea is to maximize the used of it by giving rewards to TOP 10 Players. And the rewards will be given every month or maybe every week(much better if the setting is configurable.). The rewards amount will defend on ranking. Also limit the ranking display to 10.
After the reward was given, the ranking will be reset automatically.
It's perfect if the previous month ranking are still view-able as menu.
This MVP Ladder Script is createb by Euphy's.
Source: http://rathena.org/board/topic/90971-euphys-mvp-ladder-bug-npc-hides/#entry237968
prontera,148,170,6 script MVP Ladder 891,{
mes "[MVP Ladder]";
mes "Hello!";
mes "What are you doing here?";
next;
switch(select("Check rankings.:My stats.:Nothing...")) {
case 1:
mes "[MVP Ladder]";
query_sql("SELECT char_id,CAST(`value` AS SIGNED) FROM `global_reg_value` WHERE `str` = 'MVP_Rank' ORDER BY CAST(`value` AS SIGNED) DESC LIMIT 20",.@cid,.@value);
for(set .@i,0; .@i query_sql("SELECT `name` FROM `char` WHERE char_id = "+.@cid[.@i]+";",.@j$);
set .@name$[.@i], .@j$;
}
if (!getarraysize(.@cid))
mes "The rankings are empty.";
else for(set .@i,0; .@i mes "["+(.@i+1)+"] "+.@name$[.@i]+" ~ "+.@value[.@i]+" kills";
close;
case 2:
mes "[MVP Ladder]";
mes "You have killed "+((MVP_Rank)?"^0055FF"+MVP_Rank:"no")+"^000000 MVP"+((MVP_Rank == 1)?".":"s.");
close;
case 3:
close;
}
OnNPCKillEvent:
if (getmonsterinfo(killedrid,22)) {
set MVP_Rank, MVP_Rank+1;
if (MVP_Rank == 1)
query_sql("INSERT INTO `global_reg_value` (`char_id`,`str`,`value`,`type`,`account_id`) VALUES ("+getcharid(0)+",'MVP_Rank','1',3,0)");
else
query_sql("UPDATE `global_reg_value` SET `value` = '"+MVP_Rank+"' WHERE char_id = "+getcharid(0)+" AND `str` ='MVP_Rank'");
dispbottom "~ You've killed "+MVP_Rank+" MVP"+((MVP_Rank == 1)?"":"s")+". ~";
specialeffect2 313;
}
end;
}
Can someone enhance this script.
The Idea is to maximize the used of it by giving rewards to TOP 10 Players. And the rewards will be given every month or maybe every week(much better if the setting is configurable.). The rewards amount will defend on ranking. Also limit the ranking display to 10.
After the reward was given, the ranking will be reset automatically.
It's perfect if the previous month ranking are still view-able as menu.
Edited by HadeszeusShare this post
Link to post
Share on other sites