// // [==================================================] // [=========== Ranker ===========] // [==================================================] // [ Versión 3 ] // [==================================================] // [ Script original: Ivion ] // [==================================================] // [ Descripción: ] // [--------------------------------------------------] // [ ] // [ - Ranking de nivel ingame. ] // [ - Ranking de PK ingame. ] // [ - Ranking de MVPs ingame. ] // [ - Funciona en servers sql y txt. ] // [ - Reset whispeando a NPC:CPfunc . (gms) ] // [ - Múltiples opciones de configuración. ] // [==================================================] // [ 5 últimas actualizaciones: ] // [--------------------------------------------------] // [ ] // [ v1: [Ivion] ] // [ ] // [ v2: [Ivion] ] // [ - Reescrito todo el funcionamiento interno. ] // [ - Nuevo sistema de variables. ] // [ - Se actualiza al desloguearte. ] // [ - Configuración para gms. ] // [ - Añadidos duplicados. ] // [ - Conf para cambiar el nombre de todos los NPCs. ] // [ - Nuevas conversaciones y controles. ] // [ - Nueva opción para gms de resetear el ranking. ] // [ - Conf para reseteo automático del ranking. ] // [ - Conf para rango de nivel en PK. ] // [ - Ranking de MVPs. ] // [ ] // [ v3: [Ivion] ] // [ - Bugfix: Ordenamiento de los Rankings. ] // [==================================================] - script CPfunc -1,{ OnInit: // [==================================================] // [ Configuración: ] // [--------------------------------------------------] set .@n$,"Ranker"; // Nombre del NPC. set $@CP1,1; // Ranking de Nivel. (booleano) set $@CP2,1; // Ranking de PK. (booleano) set $@CP3,1; // Ranking de MVPs. (booleano) set $@CPgm,100; // Nivel de gm requerido para evitar el ranking. set $@CPgm2,60; // Nivel de gm requerido para entrar en el Panel de Control whispeando a NPC:CPfunc . set $@CPpk,10; // Rango de nivel necesario para sumar puntos en el Ranking de PK. (rango | 0 = desactivado) // Periodo para que el Ranking se resetee automáticamente. (días | 0 = desactivado) // Esta opción permite resetear el Ranking automáticamente, evitando así que se acumulen en él jugadores inactivos. // Los Rankings se resetearán a las 5 de la mañana. Para cambiar la hora, ver Nota 1. set $@CPrt,0; // [--------------------------------------------------] // [ Final de la configuración. ] // [==================================================] set .@t,gettimetick(2) / (60 * 60 * 24); if($@CPrt && !($CPrt)) set $CPrt,$@CPrt + .@t; // Nombre de los NPCs: set .@a,1; while(!setnpcdisplay("CP#"+.@a,.@n$+"#"+.@a)) set .@a,.@a + 1; set $@CPn$,"^008888"+.@n$+"^000000"; end; // $CP{id} : Id en el ranking. // $CPn : Número de jugadores en el ranking. // $CP0x# : CharId. // $CP1x#$ : Nombre. // $CP2x# : Job (eaclass). // $CP3x# : Base lvl. // $CP4x# : Job lvl. // $CP5x# : Posición en el ranking de nivel. // $CP6x# : Ranking de nivel. // $CP7x# : Kills. // $CP8x# : Deaths. // $CP9x# : Posición en el ranking de pk. // $CP10x# : Ranking de pk. // $CP11x# : Mvps killed. // $CP12x# : Bosses killed. // $CP13x# : Posición en el ranking de mvps. // $CP14x# : Ranking de mvps. OnPCLoginEvent: if(getgmlevel() >= $@CPgm) end; if(!getd("$CP"+getcharid(0))) { callsub OnNew; if($@CP1) callsub OnRank,3; if($@CP2) callsub OnRank,7; if($@CP3) callsub OnRank,11; } end; // Level Ranking: OnPCLogoutEvent: OnPCBaseLvUpEvent: OnPCJobLvUpEvent: if(getgmlevel() >= $@CPgm) end; set .@a,getd("$CP"+getcharid(0)); if(!.@a) { callsub OnNew; if($@CP1) callsub OnRank,3; if($@CP2) callsub OnRank,7; if($@CP3) callsub OnRank,11; } else { set getd("$CP2x"+.@a),eaclass(); if($@CP1) { set getd("$CP3x"+.@a),BaseLevel; set getd("$CP4x"+.@a),JobLevel; callsub OnRank,3; } } end; OnPCKillEvent: // PK Ranking: if(!($@CP2)) end; if(getgmlevel() >= $@CPgm) end; set .@a,getcharid(3); set .@b,killedrid; if(.@a == .@b) end; set .@c,BaseLevel; if(!attachrid(.@b)) end; // Killed: if(getgmlevel() >= $@CPgm) end; if($@CPpk && (.@c > (BaseLevel + $@CPpk))) end; set .@b,getd("$CP"+getcharid(0)); if(!.@b) { callsub OnNew; if($@CP1) callsub OnRank,3; if($@CP3) callsub OnRank,11; set .@b,getd("$CP"+getcharid(0)); } set getd("$CP8x"+.@b),getd("$CP8x"+.@b) - 1; callsub OnRank,7; if(!attachrid(.@a)) end; // Killer: set .@a,getd("$CP"+getcharid(0)); if(!.@a) { callsub OnNew; if($@CP1) callsub OnRank,3; if($@CP3) callsub OnRank,11; set .@a,getd("$CP"+getcharid(0)); } set getd("$CP7x"+.@a),getd("$CP7x"+.@a) + 1; callsub OnRank,7; end; OnNPCKillEvent: // MVP Ranking: if(!($@CP3)) end; if(!(getmonsterinfo(killedrid,21) & 0x0020)) end; if(getgmlevel() >= $@CPgm) end; set .@a,getd("$CP"+getcharid(0)); if(!.@a) { callsub OnNew; if($@CP1) callsub OnRank,3; if($@CP2) callsub OnRank,7; set .@a,getd("$CP"+getcharid(0)); } if(getmonsterinfo(killedrid,22)) set getd("$CP11x"+.@a),getd("$CP11x"+.@a) + 1; else set getd("$CP12x"+.@a),getd("$CP12x"+.@a) + 1; callsub OnRank,11; end; OnNew: // Nuevo jugador: set .@a,getcharid(0); set $CPn,$CPn + 1; set .@n,$CPn; set getd("$CP"+.@a),.@n; set getd("$CP0x"+.@n),.@a; set getd("$CP1x"+.@n+"$"),strcharinfo(0); set getd("$CP2x"+.@n),eaclass(); if($@CP1) { // Ranking de Nivel. set getd("$CP3x"+.@n),BaseLevel; set getd("$CP4x"+.@n),JobLevel; set getd("$CP5x"+.@n),.@n; set getd("$CP6x"+.@n),.@n; } if($@CP2) { // Ranking de PK. set getd("$CP7x"+.@n),0; set getd("$CP8x"+.@n),0; set getd("$CP9x"+.@n),.@n; set getd("$CP10x"+.@n),.@n; } if($@CP3) { // Ranking de MVPs. set getd("$CP11x"+.@n),0; set getd("$CP12x"+.@n),0; set getd("$CP13x"+.@n),.@n; set getd("$CP14x"+.@n),.@n; } return; OnRank: // Ordenación de los Rankings: // getarg(0) : Primera variable del ranking. // getarg(1) : Id. (Opcional) set .@z,getarg(0); set .@n,getd("$CP"+getcharid(0)); set .@a,getd("$CP"+.@z+"x"+.@n); set .@b,getd("$CP"+(.@z + 1)+"x"+.@n); set .@c,getd("$CP"+(.@z + 2)+"x"+.@n); set .@e,getd("$CP"+(.@z + 3)+"x"+(.@c + 1)); set getd("$CP"+.@z+"x"+.@n),getd("$CP"+.@z+"x"+.@e); set getd("$CP"+(.@z + 1)+"x"+.@n),getd("$CP"+(.@z + 1)+"x"+.@e); while(.@d < $CPn) { set .@d,.@d + 1; set .@e,getd("$CP"+(.@z + 3)+"x"+.@d); set .@f,getd("$CP"+.@z+"x"+.@e); set .@g,getd("$CP"+(.@z + 1)+"x"+.@e); if((.@a > .@f) || ((.@a == .@f) && (.@b >= .@g))) break; } while(.@d > .@c) { set .@e,getd("$CP"+(.@z + 3)+"x"+(.@c + 1)); set getd("$CP"+(.@z + 3)+"x"+.@c),.@e; set getd("$CP"+(.@z + 2)+"x"+.@e),.@c; set .@c,.@c + 1; } while(.@d < .@c) { set .@e,getd("$CP"+(.@z + 3)+"x"+(.@c - 1)); set getd("$CP"+(.@z + 3)+"x"+.@c),.@e; set getd("$CP"+(.@z + 2)+"x"+.@e),.@c; set .@c,.@c - 1; } set getd("$CP"+.@z+"x"+.@n),.@a; set getd("$CP"+(.@z + 1)+"x"+.@n),.@b; set getd("$CP"+(.@z + 2)+"x"+.@n),.@d; set getd("$CP"+(.@z + 3)+"x"+.@d),.@n; return; OnWhisperGlobal: // Panel de Control para gms. if(getgmlevel() < $@CPgm2) end; mes $@CPn$; mes "Hola "+strcharinfo(0)+"."; mes "Este es el Panel de Control del Ranking del servidor."; mes "¿En que te puedo ayudar?"; next; set .@a,select("^880000Salir^000000","Resetear Ranking"); if(.@a == 2) { callsub OnReset; mes $@CPn$; mes "El Ranking ha sido reseteado satisfactoriamente."; } mes "Que pases un buen día."; close; OnClock0500: // Nota 1: Hora de reseteo automático de los Rankings. set .@t,gettimetick(2) / (60 * 60 * 24); if(!$@CPrt || (.@t < $CPrt)) end; set $CPrt,$@CPrt + .@t; callsub OnReset; end; OnReset: while(.@a < $CPn) { set .@a,.@a + 1; set getd("$CP"+getd("$CP0x"+.@a)),0; getd("$CP0x"+.@a),0; getd("$CP1x"+.@a+"$"),""; getd("$CP2x"+.@a),0; getd("$CP3x"+.@a),0; getd("$CP4x"+.@a),0; getd("$CP5x"+.@a),0; getd("$CP6x"+.@a),0; getd("$CP7x"+.@a),0; getd("$CP8x"+.@a),0; getd("$CP9x"+.@a),0; getd("$CP10x"+.@a),0; getd("$CP11x"+.@a),0; getd("$CP12x"+.@a),0; getd("$CP13x"+.@a),0; getd("$CP14x"+.@a),0; } set $CPn,0; return; } // Npcs: - script CP#0::CP -1,{ mes $@CPn$; mes "Hola "+strcharinfo(0)+"."; mes "Desde aquí puedes consultar las estadísticas del servidor."; mes "Dime, ¿qué información deseas conocer?"; next; // Opciones del menú: set .@a$[0],"Ranking de Nivel"; set .@a$[1],"Ranking de PK"; set .@a$[2],"Ranking de MVPs"; // Ver Nota 2. while(.@a < getarraysize(.@a$)) { set .@a,.@a + 1; if(getd("$@CP"+.@a)) { set .@b$[.@b],.@a$[.@a - 1]; set .@b,.@b + 1; } } set .@b,select("^880000Salir^000000",.@b$[0],.@b$[1],.@b$[2]); // Nota 2: Añadir tantas variables al menú como sean necesarias. mes $@CPn$; if(.@b == 1) set .@a,1; else { set .@a,2; while(.@a$[.@a - 2] != .@b$[.@b - 2]) set .@a,.@a + 1; mes "Selecciona un filtro:"; next; set .@b,select("^880000Todos los jugadores^000000","Jugadores online","Renacidos","Babies","Por Clase"); if (.@b == 5) { mes $@CPn$; mes "Selecciona una clase:"; next; set .@c,(select("Novice","Swordman","Mage","Archer","Acolyte","Merchant","Thief","Taekwon","Gunslinger","Ninja","Super Novice","Knight","Crussader","Wizard","Sage","Hunter","Bard/Dancer","Priest","Monk","Blacksmith","Alchemist","Assassin","Rogue","Star Gladiator","Soul Linker") - 1); if(.@c > 10) { set .@c,.@c - 9; if(.@c % 2) set .@c,(.@c / 2) | 0x200; else set .@c,(.@c / 2) | 0x100; } if(.@c == 8) set .@c,0x9; if(.@c == 9) set .@c,0x0A; if(.@c == 10) set .@c,0x100; } mes $@CPn$; mes "Selecciona la cantidad de datos que serán mostrados:"; mes "(Marca ^8800000^000000 para ver el Ranking completo)"; next; input .@n; mes $@CPn$; mes "Muy bien."; mes "Enviaré los datos a tu cuadro de mensajes."; } mes "Que pases un buen día."; close2; emotion 12; if (.@a > 1) { set .@a,(.@a * 4) - 5; set .@h,getcharid(0); while (.@d < $CPn) { set .@d,(.@d + 1); set .@e,getd("$CP"+(.@a + 3)+"x"+.@d); set .@f,getd("$CP2x"+.@e); if((.@b == 1) || ((.@b == 2) && getcharid(0,getd("$CP1x"+.@e+"$"))) || ((.@b == 3) && (.@f & 0x1000)) || ((.@b == 4) && (.@f & 0x2000)) || ((.@b == 5) && ((.@f & 0x0fff) == .@c))) { set .@g,.@g + 1; if((.@g <= .@n) || !(.@n) || (getd("$CP0x"+.@e) == .@h)) { if((.@g % 20) == 1) { if(.@a == 3) announce "[ TOP ] [ Base / Job ] - Nombre - (Job)",bc_self,0xFF8800; if(.@a == 7) announce "[ TOP ] [ Kills / Deaths ] - Nombre - (Job)",bc_self,0xFF8800; if(.@a == 11) announce "[ TOP ] [ MVPs / Bosses ] - Nombre - (Job)",bc_self,0xFF8800; } if(getd("$CP0x"+.@e) == .@h) set .@c$,"0x00CC99"; else set .@c$,"0xCC9900"; if(.@a == 3) announce "[ "+.@g+" ] [ "+getd("$CP3x"+.@e)+" / "+getd("$CP4x"+.@e)+" ] - "+getd("$CP1x"+.@e+"$")+" - ("+jobname(roclass(.@f))+")",bc_self,.@c$; if(.@a == 7) announce "[ "+.@g+" ] [ "+getd("$CP7x"+.@e)+" / "+((-1) * getd("$CP8x"+.@e))+" ] - "+getd("$CP1x"+.@e+"$")+" - ("+jobname(roclass(.@f))+")",bc_self,.@c$; if(.@a == 11) announce "[ "+.@g+" ] [ "+getd("$CP11x"+.@e)+" / "+getd("$CP12x"+.@e)+" ] - "+getd("$CP1x"+.@e+"$")+" - ("+jobname(roclass(.@f))+")",bc_self,.@c$; } } } if(.@g == 0) announce "No se ha encontrado ninguna coincidencia.",bc_self,0xFF8800; else announce "----------",bc_self,0xFF8800; } end; } alberta,195,138,4 duplicate(CP) CP#1 859 alberta,51,250,5 duplicate(CP) CP#2 859 aldebaran,133,116,6 duplicate(CP) CP#3 859 aldebaran,133,236,6 duplicate(CP) CP#4 859 alde_gld,234,150,4 duplicate(CP) CP#5 859 amatsu,242,279,6 duplicate(CP) CP#6 859 amatsu,99,260,4 duplicate(CP) CP#7 859 amatsu,207,100,4 duplicate(CP) CP#8 859 ayothaya,212,204,4 duplicate(CP) CP#9 859 ayothaya,157,78,4 duplicate(CP) CP#10 859 comodo,180,329,4 duplicate(CP) CP#11 859 comodo,205,112,4 duplicate(CP) CP#12 859 comodo,316,181,4 duplicate(CP) CP#13 859 comodo,36,221,6 duplicate(CP) CP#14 859 einbech,65,92,6 duplicate(CP) CP#15 859 einbech,131,245,6 duplicate(CP) CP#16 859 einbech,42,201,8 duplicate(CP) CP#17 859 einbroch,74,187,2 duplicate(CP) CP#18 859 einbroch,149,315,6 duplicate(CP) CP#19 859 einbroch,152,49,4 duplicate(CP) CP#20 859 einbroch,249,239,2 duplicate(CP) CP#21 859 geffen,123,69,4 duplicate(CP) CP#22 859 geffen,41,107,6 duplicate(CP) CP#23 859 geffen,124,177,4 duplicate(CP) CP#24 859 geffen,171,123,6 duplicate(CP) CP#25 859 gef_fild13,197,227,4 duplicate(CP) CP#26 859 gonryun,152,110,6 duplicate(CP) CP#27 859 gonryun,168,180,2 duplicate(CP) CP#28 859 gonryun,153,16,6 duplicate(CP) CP#29 859 hugel,101,130,4 duplicate(CP) CP#30 859 hugel,178,170,4 duplicate(CP) CP#31 859 izlude,121,94,6 duplicate(CP) CP#32 859 yuno,175,89,4 duplicate(CP) CP#33 859 yuno,68,203,4 duplicate(CP) CP#34 859 sch_gld,291,123,4 duplicate(CP) CP#35 859 lighthalzen,209,95,6 duplicate(CP) CP#36 859 lighthalzen,218,322,4 duplicate(CP) CP#37 859 lighthalzen,311,299,4 duplicate(CP) CP#38 859 louyang,203,104,6 duplicate(CP) CP#39 859 louyang,71,219,4 duplicate(CP) CP#40 859 xmas,139,306,6 duplicate(CP) CP#41 859 xmas,161,108,4 duplicate(CP) CP#42 859 morocc,166,76,4 duplicate(CP) CP#43 859 morocc,47,174,4 duplicate(CP) CP#44 859 morocc,166,289,4 duplicate(CP) CP#45 859 morocc,279,197,8 duplicate(CP) CP#46 859 morocc,35,290,4 duplicate(CP) CP#47 859 moscovia,238,198,4 duplicate(CP) CP#48 859 moscovia,159,62,4 duplicate(CP) CP#49 859 niflheim,29,158,6 duplicate(CP) CP#50 859 niflheim,199,188,4 duplicate(CP) CP#51 859 payon,213,72,6 duplicate(CP) CP#52 859 payon,160,49,2 duplicate(CP) CP#53 859 payon,232,316,4 duplicate(CP) CP#54 859 payon,63,120,6 duplicate(CP) CP#55 859 pay_gld,201,157,4 duplicate(CP) CP#56 859 prontera,165,71,4 duplicate(CP) CP#57 859 prontera,40,212,6 duplicate(CP) CP#58 859 prontera,164,170,4 duplicate(CP) CP#59 859 prontera,259,213,4 duplicate(CP) CP#60 859 prontera,161,312,4 duplicate(CP) CP#61 859 prt_gld,166,75,4 duplicate(CP) CP#62 859 rachel,264,136,4 duplicate(CP) CP#63 859 rachel,150,144,4 duplicate(CP) CP#64 859 rachel,135,45,4 duplicate(CP) CP#65 859 rachel,39,131,6 duplicate(CP) CP#66 859 aru_gld,179,326,6 duplicate(CP) CP#67 859 umbala,121,128,8 duplicate(CP) CP#68 859 umbala,163,249,4 duplicate(CP) CP#69 859 veins,209,234,4 duplicate(CP) CP#70 859 veins,222,352,4 duplicate(CP) CP#71 859 veins,157,62,6 duplicate(CP) CP#72 859 mid_camp,219,287,4 duplicate(CP) CP#73 859 mid_camp,138,235,6 duplicate(CP) CP#74 859 mid_camp,252,232,8 duplicate(CP) CP#75 859 // El nombre de los NPCs debe continuar el modelo dado.