Kido Posted October 18, 2013 Group: Members Topic Count: 127 Topics Per Day: 0.03 Content Count: 1445 Reputation: 164 Joined: 08/17/13 Last Seen: July 11, 2019 Share Posted October 18, 2013 Hello, i would love to add to my pvp script the next features PVP no heal: can not use any healing item PVP no custom: any custom item will be unequiped this is my script, i do not understand it at all /* [====================================================] SCRIPT: Battle, Ranking y Premiador. DISEÑADOR: TitanOz~ DESCRIPCION: NPC pvp, con ranking. Premiador por muertes ( Basado en el script de beck ) Anuncia al matar y al entrar. Restricciones de clases y nivel mínimo. PARA: Uso público. [====================================================] MEJORAS: 1.0 : NONE! 2.0 : - Agregado menú con consumibles. - Agregada opción de premiar en otros mapas. - Variable castigar. 2.5 : - Agregada opcion de quitar buff a elección. - Al listar ranking, se ve mas ordenado. Se lista de 5 posiciones. - Eliminado anuncio al cancelar el warp. - Anuncios de entrar a battle, se da solo en la ciudad del jugador que entró. - Se quitó la opción de premiar al que mate al jugador mas de 2 veces. - Script actualizado a EaMod. 2.6 : - Corregidos bugs menores. 3.0 : - Ranking SQL. - Opción de reinicializar ranking. Da pm a 'npc:RankRestart' con '-reset' - Optimización para quitar los buff. [====================================================] ADVERTENCIA: - CUALQUIER MODIFICACIÓN QUE SE REALIZE AL NPC QUE NO TENGA QUE VER CON LA CONFIGURACIÓN GENERAL, ES A SU PROPIO RIESGO. AGALO SI ESTÁ SEGURO DE LOS CAMBIOS QUE REALIZARÁ. [====================================================] */ - script BattleFunc -1,{ function BattMap; function BattleMap; OnInit: /* [ ============================ CONFIGURACIONES GENERALES ============================ ] */ // Para añadir más mapas, debes seguir el siguiente estructura. // BattleMap("<Nombre del mapa>","<Mapa>",<Usuarios permitidos>,<Restricción>,<Quitar Buff>); // <Restricción> : 0 = Todos , 1 = Baby Class , 2 = Second Class , 3 = Third Class , 4 o mas = Error. // <Quitar Buff> = 0 : Nada , 1 : All Spirits, 2 : Full Chemical Protection , 4 : Increase Agility y Blessing , 8 : Assumptio , 16 : Kyrie Eleison. // Suma los numeros para quitar varios, por ejemplo 7 : All Spirit, Full Chemical Protection, Increase Agility y Blessing // El maximo permitido para agregar mapas es de 120. Si se agregan más puede dar BUG. BattleMap("Room 1","guild_vs2",30,0,0); BattleMap("Room 2","bat_c03",30,0,0); BattleMap("Room 3","guild_vs1",30,0,0); BattleMap("Room 4","guild_vs4",30,0,0); BattleMap("1 VS 1","guild_vs5",2,0,0); // Para agregár otros mapas donde quieras que se ganen y/o pierdan puntos, debe serguir la siguiente estructura. // BattMap("<Mapa>"); BattMap("prtg_cas01"); BattMap("prtg_cas02"); BattMap("schg_cas01"); BattMap("schg_cas02"); BattMap("payg_cas04"); BattMap("prtg_cas04"); // Otras configuraciones. set $@LvlMin , 99 ; // Nivel minimo para entrar a pvp. set $@Size , 20 ; // Tamaño de ranking [ Maximo = 120 ] set $@nB$ , "Tairyu PvP" ; // Nombre Warper. set $@nR$ , "PvP Ranking" ; // Nombre Rank. set $@nP$ , "Kill Shop"; // Nombre Premiador. set $@Prem , 1 ; // Si se quiere premiar con puntos al matar a un jugador [ 1 = Si ] set $@Desc , 0 ; // Si se quiere descontar puntos [ 1 = Si ] // Premiador. setarray $@BattEquip[0],2280,10,5181,10,5172,50,5170,100,5058,100,5137,100,5374,100,5518,300;// Equipo que se ganan por algun precio en puntos. [ID1,Valor1,ID2,Valor2,ID3,Valor3...] setarray $@BattConsu[0],12085,1,3,12090,1,3,12095,1,3,12080,1,3,12075,1,3,12100,1,3,12028,1,3,12033,1,3,12032,1,3,12030,1,3,12029,1,3,12031,1,3,606,1,3,7072,20,1,7157,20,1,7156,20,1,7112,20,1,963,20,1,7024,1,20,675,5,1;// Consumible que se ganan y la cantidad que se da. [ID1,Cant1,Valor1,ID2,Cant2,Valor2,ID3,Cant3,Valor3...] /* [ =================================================================================== ] */ query_sql("CREATE TABLE IF NOT EXISTS `battle_npc` (`name_btl` varchar(30) NOT NULL default '' , `kill_btl` int(5) NOT NULL default '0' , `dead_btl` int(5) NOT NULL default '0' ) ENGINE=MyISAM;"); end; // Mapas. // getarg(0) : Nombre. // getarg(1) : Mapa. // getarg(2) : Usuarios permitidos. // getarg(3) : Restricciones. // getarg(4) : Buff. function BattleMap { set .a , .a + 1; set $@Battle$[ .a ] , getarg(0); set $@MapBat$[ .a ] , getarg(1); set $@UsuPerm[ .a ] , getarg(2); set $@Restric[ .a ] , getarg(3); set $@QuitBuf[ .a ] , getarg(4); return; } // Mapas. // getarg(0) : Mapa. function BattMap { set .b , .b + 1; set $@OtrMap$[ .b ] , getarg(0) ; return; } // Anuncios y puntos. OnPCKillEvent: set .@size, getarraysize($@MapBat$) ; for ( set .@i , 0 ; .@i < .@size ; set .@i , .@i + 1 ) if ( strcharinfo(3) == $@MapBat$[ .@i ] ) { set @DeadCount , @DeadCount + 1 ; switch( @DeadCount ) { case 1: mapannounce strcharinfo(3),"[ " + strcharinfo(0) + " ] Simple Kill!",bc_blue; break; case 2: mapannounce strcharinfo(3),"[ " + strcharinfo(0) + " ] Double Kill!",bc_blue; break; case 3: mapannounce strcharinfo(3),"[ " + strcharinfo(0) + " ] Triple Kill!",bc_blue; break; case 4: mapannounce strcharinfo(3),"[ " + strcharinfo(0) + " ] Super Kill!",bc_blue; break; case 5: mapannounce strcharinfo(3),"[ " + strcharinfo(0) + " ] Mega Kill!",bc_blue; break; case 6: mapannounce strcharinfo(3),"[ " + strcharinfo(0) + " ] Ultra Kill!",bc_blue; break; case 7: mapannounce strcharinfo(3),"[ " + strcharinfo(0) + " ] Monster Kill!",bc_blue; break; default: mapannounce strcharinfo(3),"[ " + strcharinfo(0) + " ] God of Dead!",bc_blue; break; } if ( $@Prem == 1 ) { set #BattlePoints , #BattlePoints + 1 ; dispbottom "[ " + $@nB$ + " ] : Ganas 1 punto."; } set .@existe , query_sql("SELECT `kill_btl` FROM `battle_npc` WHERE `name_btl` = '" + strcharinfo(0) + "'" , .@a ); if ( .@existe ) { set .@a , .@a + 1 ; query_sql("UPDATE `battle_npc` SET `kill_btl` = " + .@a + " WHERE `name_btl` = '" + strcharinfo(0) + "';"); } else query_sql("INSERT INTO `battle_npc` (`name_btl`,`kill_btl`,`dead_btl`) VALUES ('" + strcharinfo(0) + "',1,0);"); end; } set .@size , getarraysize($@OtrMap$) ; for ( set .@i , 0 ; .@i < .@size ; set .@i , .@i + 1 ) if ( strcharinfo(3) == $@OtrMap$[ .@i ] ) { if ( $@Prem == 1 ) { set #BattlePoints , #BattlePoints + 1 ; dispbottom "[ " + $@nB$ + " ] : Ganas 1 punto."; } end; } end; OnPCDieEvent: set .@size , getarraysize($@MapBat$) ; for ( set .@i , 0 ; .@i < .@size ; set .@i , .@i + 1 ) if ( strcharinfo(3) == $@MapBat$[ .@i ] ) { set @DeadCount , 0; if ( $@Prem == 1 && $@Desc == 1 ) { set #BattlePoints , #BattlePoints - 1 ; if ( #BattlePoints < 0 ) set #BattlePoints , 0 ; dispbottom "[ " + $@nB$ + " ] : Pierdes 1 punto."; } set .@existe , query_sql("SELECT `dead_btl` FROM `battle_npc` WHERE `name_btl` = '" + strcharinfo(0) + "'" , .@a ); if ( .@existe ) { set .@a , .@a + 1 ; query_sql("UPDATE `battle_npc` SET `dead_btl` = " + .@a + " WHERE `name_btl` = '" + strcharinfo(0) + "';"); } else query_sql("INSERT INTO `battle_npc` (`name_btl`,`kill_btl`,`dead_btl`) VALUES ('" + strcharinfo(0) + "',0,1);"); end; } set .@size , getarraysize($@OtrMap$) ; for ( set .@i , 0 ; .@i < .@size ; set .@i , .@i + 1 ) if ( strcharinfo(3) == $@OtrMap$[ .@i ] ) { if ( $@Prem == 1 && $@Desc == 1 ) { set #BattlePoints , #BattlePoints - 1 ; if ( #BattlePoints < 0 ) set #BattlePoints , 0 ; dispbottom "[ " + $@nB$ + " ] : Pierdes 1 punto."; } end; } end; } /* [ ======================= ] Reset Rank [ ======================= ] */ - script RankRestart -1,{ OnWhisperGlobal: if ( getgmlevel() > 80 ) if ( @whispervar0$ == "-reset" ) { query_sql("TRUNCATE TABLE `battle_npc`;"); dispbottom "Ranking reiniciado."; } else dispbottom "Ingresa '-reset' para reiniciar el ranking."; else dispbottom "No tienes cuenta de Administrador."; end; } /* [ ======================= ] Cartel Ranking [ ======================= ] */ prontera,147,166,5 script Ranking 837,{ mes "[^008888 " + $@nR$ + " ^000000]"; set .@j , 1 ; set .@a , query_sql("SELECT `name_btl`,`kill_btl`,`dead_btl` FROM `battle_npc` ORDER BY `kill_btl` DESC LIMIT 0," + $@Size , .@a$ , .@b , .@c ) ; if ( .@a < $@Size ) set .@size , .@a ; else set .@size , $@Size ; for ( set .@i , 0 ; .@i < .@size ; set .@i , .@i + 1) { mes ( .@i + 1 ) + ".- ^1352AF" + .@a$[ .@i ] + "^000000 con ^1352AF" + .@b[ .@i ] + "^000000 muertes."; if ( .@i + 1 == 5 * .@j ) { next; mes "[^008888 " + $@nR$ + " ^000000]"; set .@j , .@j + 1 ; } } if ( .@a < $@Size ) mes "^FF0000No hay mas datos^000000"; if ( .@j == 1 || .@i % 5 != 0 ) { next; mes "[^008888 " + $@nR$ + " ^000000]"; } set .@existe , query_sql("SELECT `kill_btl`,`dead_btl` FROM `battle_npc` WHERE `name_btl` = '" + strcharinfo(0) + "'", .@a , .@b ) ; mes "Tus datos son:"; mes "Nombre : ^000088" + strcharinfo(0) + "^000000."; mes "Profeción : ^000088" + jobname(Class) + "^000000."; if ( !.@existe ) { set .@a , 0 ; set .@b , 0 ; } mes "Muertes : ^000088" + .@a + "^000000."; mes "Muerto : ^000088" + .@b + "^000000."; close; } /* [ ======================= ] Warper [ ======================= ] */ prontera,147,172,5 script Battle::Battle 420,{ function Restrict; function QuitarBuff; mes "[^008888 " + $@nB$ + " ^000000]"; cutin "ins_cata_pri_n",2; if ( BaseLevel < $@LvlMin ) { mes "No puedes entrar a " + $@nB$ + ", entrena un poco mas " + strcharinfo(0); close2; cutin "",255; end; } mes "Bienvenido " + strcharinfo(0) + ", a " + $@nB$; mes "¿Estas listo para demostrar quien eres en verdad?"; next; mes "[^008888 " + $@nB$ + " ^000000]"; mes "Selecciona a que sala quieres entrar."; set .@menu$ , "^880000Salir^000000"; set .@size , getarraysize($@Battle$) ; for ( set .@i , 1 ; .@i <= .@size ; set .@i , .@i + 1 ) set .@menu$ , .@menu$ + ":" + $@Battle$[ .@i ] + " ^0B2161[ " + getmapusers($@MapBat$[ .@i ]) + " / " + $@UsuPerm[ .@i ] + " ]^000000"; set .@z , select(.@menu$) - 1 ; next; mes "[^008888 " + $@nB$ + " ^000000]"; if ( .@z == 0 ) { mes "Sabia que no podrias, lo vi en tus ojos!"; close2; cutin "",255; } else if ( Restrict($@Restric[ .@z ]) == -1 ) { mes "^FF0000ERROR^000000, comuniqueselo a un administrador sobre el problema con las restricciones."; close2; cutin "",255; } else if ( Restrict($@Restric[ .@z ]) == 1 ) { mes "Siendo ^0B2161" + jobname(Class) + "^000000, no puedes ingresar al mapa, prueba con otro."; close2; cutin "",255; } else if ( getmapusers($@MapBat$[ .@z ]) >= $@UsuPerm[ .@z ] ) { mes "El mapa está lleno, intentalo mas tarde"; close2; cutin "",255; } else { mes "En ^0000FF" + $@Battle$[ .@z ] + "^000000 hay ^0000FF" + getmapusers($@MapBat$[ .@z ]) + "^000000 usuario" + ((getmapusers($@MapBat$[ .@z ]) != 1)?"s":"") + " en este momento."; mes "¿Seguro que quieres viajar?"; if ( select("Si:No") == 1 ) { mes " "; mes "Preparate, aqui vamos!"; close2; cutin "",255; sleep2 200; mapannounce strcharinfo(3),"El jugador [ " + strcharinfo(0) + " ] entro a " + $@nB$ + " " + $@Battle$[ .@z ] + ".",bc_blue; QuitarBuff($@QuitBuf[ .@z ]); warp $@MapBat$[ .@z ],0,0; } else { close2; cutin "",255; } } end; // Restricciones. // getarg(0) : Restricciones ( 0 = Todos , 1 = Baby Class , 2 = Second Class , 3 = Third Class ). function Restrict { switch ( getarg(0) ) { case 0: set .@res , 0 ; // Si. break; case 1: if ( Class >= 4023 && Class <=4043 || Class >= 4096 && Class <= 4108 ) // Solo Baby. set .@res , 0 ; // Si. else set .@res , 1 ; // No. break; case 2: if ( Class >= 4054 && Class <= 4087 || Class >= 4023 && Class <= 4043 || Class >= 4096 && Class <=4108 ) // Third y Baby. set .@res , 1 ; // No. else set .@res , 0 ; // Si. break; case 3: if ( Class >= 4054 && Class <= 4087 ) // Solo Third. set .@res , 0 ; // Si. else set .@res , 1 ; // No. break; default: set .@res , -1 ; // Error. } return .@res; } // Quitar Buffs. // getarg(0) : Buffs. function QuitarBuff { if ( getarg(0) == 0 ) return; else { set .@z , getarg(0) ; while ( .@z > 0 ) { if ( .@z <= 32 && .@z >= 16 ) { sc_end SC_ASSUMPTIO; set .@z , .@z - 16 ; } else if ( .@z <= 15 && .@z >= 8 ) { sc_end SC_KYRIE; set .@z , .@z - 8 ; } else if ( .@z <= 7 && .@z >= 4 ) { sc_end SC_INCREASEAGI; sc_end SC_BLESSING; set .@z , .@z - 4 ; } else if ( .@z == 3 || .@z == 2 ) { sc_end SC_CP_WEAPON; sc_end SC_CP_SHIELD; sc_end SC_CP_ARMOR; sc_end SC_CP_HELM; set .@z , .@z - 2 ; } else if ( .@z == 1 ) { sc_end SC_SPIRIT; set .@z , .@z - 1 ; } } } return; } end; } /* [ ======================= ] Premiador [ ======================= ] */ prontera,147,169,5 script Premios 123,{ mes "[^008888 " + $@nP$ + " ^000000]"; mes "Vaya que te haces de reputacion en " + $@nB$ + ". Por tu gran esfuerzo puedo darte premios por algunos puntos."; mes "¿Que te gustaria obtener?"; switch ( select("^000088Salir^000000:Ver Puntos:Canjear Equipo:Canjear Consumibles") ) { case 1: next; mes "[^008888 " + $@nB$ + " ^000000]"; mes "Que tengas un buen dia"; break; case 2: next; mes "[^008888 " + $@nB$ + " ^000000]"; mes "Tienes [ ^0B2161" + #BattlePoints + "^000000 ] Puntos. Recuerda seguir matando para ganar más."; break; case 3: next; mes "[^008888 " + $@nB$ + " ^000000]"; mes "Por favor, selecciona el objeto que deseas."; mes " "; mes "Objeto ^0B2161[<Valor>]^000000"; set .@size , getarraysize($@BattEquip) ; for ( set .@i , 0 ; .@i < .@size ; set .@i , .@i + 2 ) if ( .@i < 1 ) set .@menu$ , getitemname($@BattEquip[ .@i ]) + " ^0B2161[" + $@BattEquip[ .@i + 1 ] + "]^000000"; else set .@menu$, .@menu$ + ":" + getitemname($@BattEquip[ .@i ]) + " ^0B2161[" + $@BattEquip[ .@i + 1 ] + "]^000000"; set .@a , select( .@menu$ ) - 1; set .@j , .@a * 2 ; next; mes "[^008888 " + $@nB$ + " ^000000]"; mes "¿Seguro que quieres ^0B2161" + getitemname($@BattEquip[ .@j ]) + "^000000?"; mes "Este cuesta ^0B2161" + $@BattEquip[ .@j + 1 ] + "^000000 puntos"; if ( select("No:Si") == 1 ) { mes " "; mes "Vuelve cuando desees."; } else { if ( #BattlePoints < $@BattEquip[ .@j + 1 ] ) { mes " "; mes "No tienes " + $@BattEquip[ .@j + 1 ] + " puntos, vuelve cuando los tengas."; } else { next; mes "[^008888 " + $@nB$ + " ^000000]"; mes "Aqui tienes " + strcharinfo(0) + " Vuelve pronto."; set #BattlePoints , #BattlePoints - $@BattEquip[ .@j + 1 ]; getitem $@BattEquip[ .@j ] , 1 ; } } break; case 4: next; mes "[^008888 " + $@nB$ + " ^000000]"; mes "Por favor, selecciona el objeto que deseas."; mes " "; mes "<Cantidad> Objeto ^0B2161[<Valor>]^000000"; set .@size , getarraysize($@BattConsu) ; for ( set .@i , 0 ; .@i < .@size ; set .@i , .@i + 3 ) if ( .@i < 1 ) set .@menu$ , $@BattConsu[ .@i + 1 ] + " " + getitemname($@BattConsu[ .@i ]) + " ^0B2161[" + $@BattConsu[ .@i + 2 ] + "]^000000"; else set .@menu$, .@menu$ + ":" + $@BattConsu[ .@i + 1 ] + " " + getitemname($@BattConsu[ .@i ]) + " ^0B2161[" + $@BattConsu[ .@i + 2 ] + "]^000000"; set .@a , select( .@menu$ ) - 1; set .@j , .@a * 3 ; next; mes "[^008888 " + $@nB$ + " ^000000]"; mes "Ingresa cuantas unidades de ^0B2161" + $@BattConsu[ .@j + 1 ] + " " + getitemname($@BattConsu[ .@j ]) + "^000000 te llebaras."; mes "Cada unidad cuesta ^0B2161" + $@BattConsu[ .@j + 2 ] + "^000000 puntos."; mes " "; mes "^FF00000 para cancelar^000000"; input .@u; if ( .@u == 0 ) close; next; mes "[^008888 " + $@nB$ + " ^000000]"; mes "¿Seguro que quieres " + .@u + " unidades de ^0B2161" + $@BattConsu[ .@j + 1 ] + " " + getitemname($@BattConsu[ .@j ]) + "^000000?" ; if ( select("No:Si") == 1 ) { mes " "; mes "Vuelve cuando desees."; } else { if ( #BattlePoints < ( $@BattConsu[ .@j + 2 ] * .@u ) ) { mes " "; mes "No tienes " + ( $@BattConsu[ .@j + 2 ] * .@u ) + " puntos, vuelve cuando los tengas."; } else { if ( checkweight($@BattConsu[ .@j ],( .@u * $@BattConsu[ .@j + 1 ] ) ) == 0 ) { mes " "; mes "No tienes suficiente peso para llevar ^0B2161" + ( .@u * $@BattConsu[ .@j + 1 ] ) + " " + $@BattConsu[ .@j ] + "^000000."; } else { next; mes "[^008888 " + $@nB$ + " ^000000]"; mes "Aqui tienes " + strcharinfo(0) + " Vuelve pronto."; set #BattlePoints , #BattlePoints - ( $@BattConsu[ .@j + 2 ] * .@u ) ; getitem $@BattConsu[ .@j ] , ( $@BattConsu[ .@j + 1 ] * .@u ) ; } } } break; } close; } /* [ ======================= ] Duplicados [ ======================= ] */ morocc,170,102,3 duplicate(Battle) Battle#01 412 geffen,125,104,3 duplicate(Battle) Battle#02 412 payon,162,230,5 duplicate(Battle) Battle#03 412 alberta,53,250,3 duplicate(Battle) Battle#04 412 izlude,136,91,3 duplicate(Battle) Battle#05 412 aldebaran,147,121,3 duplicate(Battle) Battle#06 412 comodo,193,168,3 duplicate(Battle) Battle#07 412 amatsu,203,97,3 duplicate(Battle) Battle#08 412 ayothaya,154,120,3 duplicate(Battle) Battle#09 412 brasilis,199,185,3 duplicate(Battle) Battle#10 412 dewata,205,186,3 duplicate(Battle) Battle#11 412 einbech,67,96,5 duplicate(Battle) Battle#12 412 einbroch,67,196,3 duplicate(Battle) Battle#13 412 gonryun,155,122,5 duplicate(Battle) Battle#14 412 hugel,102,150,3 duplicate(Battle) Battle#15 412 jawaii,199,243,3 duplicate(Battle) Battle#16 412 yuno,162,90,3 duplicate(Battle) Battle#17 412 lighthalzen,220,206,3 duplicate(Battle) Battle#18 412 louyang,222,120,3 duplicate(Battle) Battle#19 412 xmas,153,123,3 duplicate(Battle) Battle#20 412 malangdo,171,141,3 duplicate(Battle) Battle#21 412 manuk,270,143,3 duplicate(Battle) Battle#22 412 mid_camp,201,283,6 duplicate(Battle) Battle#23 412 mora,103,66,6 duplicate(Battle) Battle#24 412 moscovia,230,199,3 duplicate(Battle) Battle#25 412 niflheim,189,179,6 duplicate(Battle) Battle#26 412 rachel,121,106,6 duplicate(Battle) Battle#27 412 splendide,181,144,6 duplicate(Battle) Battle#28 412 umbala,118,143,5 duplicate(Battle) Battle#29 412 veins,190,228,6 duplicate(Battle) Battle#30 412 thanks i hope it is enought information ! Quote Link to comment Share on other sites More sharing options...
Question
Kido
Hello, i would love to add to my pvp script the next features
PVP no heal: can not use any healing item
PVP no custom: any custom item will be unequiped
this is my script, i do not understand it at all
thanks i hope it is enought information !
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.