Jump to content

jaBote

Community Contributors
  • Content Count

    2037
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by jaBote

  1. Try this, a mixture of what everybody said here: - script atcmd_example -1,{OnInit: bindatcmd "autoloot",strnpcinfo(3)+"::OnAtcommand"; end;OnAtcommand: if (BaseLevel >= 50) { dispbottom "You can't use this command."; } else { useatcmd .@atcmd_command$; } end;OnPCBaseLvUpEvent: if (BaseLevel >= 50) { atcommand "@autoloot 0"; } end;}
  2. Previo a probarlo en una instalación local de Hercules, he visto que había un error de scripting en el código. Ahora es obligatorio que todos los comandos de scripting estén en minúsculas. El validador de scripts de Haruna ha lanzado el siguiente error al copiar y pegar tu script: He solucionado ese error haciendo lo que la consola dice (cambiar playBGMall por playbgmall, esto es un error de estilo del scripter) y parece que el script con ese pequeño cambio ha pasado el validador sin ningún error más. Por favor, comprueba si el siguiente script funciona adecuadamente: //===== eAthena Script =======================================//= Lady-DJ//===== By: ==================================================//= Skipper http://roevolution.com//===== Current Version: =====================================//= 1.0//===== Compatible With: =====================================//= eAthena Trunk 143x SQL//===== Description: =========================================//= Simple Script que permite programar musica usando BGM//= Se basa en la Indexación te Temas Musicales en una Tabla//= Cuenta con un PlayList de 5 Canciones y Shuffle//= Los Temas Musicales deben ser tipo .MP3//===== Additional Comments: =================================//=//============================================================job_knt,43,165,4 script Lady-DJ 123,{ if (.reloj > 0) { mes "[ ^FF8000Lady DJ^000000 ]"; mes "Actualmente hay un Tema en mi Toca Discos :"; mes "^FFFFFF."; set @minu,.reloj / 60; set @segu,.reloj % 60; mes "^FF0080" + .tema$ + "^000000"; mes "Tiempo Restante : ^FF0000-" + @minu + " : " + @segu; next; }L_MENU: mes "[ ^FF8000Lady DJ^000000 ]"; mes "Dime... ¿Que necesecitas?"; next; switch(select(" ^FF0080Playlist: ^0000FFInformacion: ^8000FFComprar Poring Coin: ^800000Salir")) { case 1: goto PLAYLIST; case 2: mes "[ ^FF8000Lady DJ^000000 ]"; mes "Hola, yo soy la DJ de este Salon."; mes "Mi tarea es hacer trabajar mi Toca Discos para ustedes."; mes "Tu, puedes elegir el Tema que quieres Escuchar..."; next; mes "[ ^FF8000Lady DJ^000000 ]"; mes "Es muy Facil:"; mes "Cada Tema vale ^FF80001 Poring Coin"; mes "Solo vas a ^FF0080PlayList^000000 y programas la Cancion que deseas escuchar..."; next; mes "[ ^FF8000Lady DJ^000000 ]"; mes " Es importante que tengas tu opcion de ^FF0000BGM^000000 configurada en ^0000FFON^000000, del Contrario no podras escuchar ninguna Cancion."; close; case 3: mes "[ ^FF8000Lady DJ^000000 ]"; mes "^008040Los Poring Coin solo se consiguen por evento"; mes "¿Quieres mas informacion?"; next; goto COINS; case 4: close; }COINS:// menu "^8000FFComprar ",-,"^FF8000volver [-]",L_MENU;// if (zeny < 500000000) { mes "[ ^FF8000Lady DJ^000000 ]"; mes "^FF0080Cada 20 minutos hay evento automatico n.n."; close; }// getitem 7539,1;// set zeny,zeny-5000000; mes "[ ^FF8000Lady DJ^000000 ]"; mes "Ve a Conseguir Poring Coin para que puedas programar una Cancion ^^"; close;// ........................................................................................................LISTADO: set @indi,0; set @indi,getarraysize(@ID); if (@indi != 0) { deletearray @ID[0],@indi; deletearray @NAME2$[0],@indi; deletearray @ARTIST$[0],@indi; } set @ID,0; set @NAME$,""; set @ARTIST$,""; mes "--CATEGORIAS :"; mes "^8080C0Selecciona tu Genero Musical..."; next;/*Menu Musical---------------Las Categorias son agregas segun tu opcion dentro de la Tabla 'w_music'Recuerda que la Tabla contendra toda la Informacion de Cada tema musical que adiciones.*/switch(select(" Rock: Bailables: Regeton: Disco: Electronica: Rock Latino: Lentos: Hip Hop: Metal: Salir")) { case 1: query_sql("SELECT ID,NAME,ARTIST FROM w_music WHERE TYPE = 'ROCK'", @ID,@NAME$,@ARTIST$); goto LISTAR; case 2: query_sql("SELECT ID,NAME,ARTIST FROM w_music WHERE TYPE = 'BAILE'", @ID,@NAME$,@ARTIST$); goto LISTAR; case 3: query_sql("SELECT ID,NAME,ARTIST FROM w_music WHERE TYPE = 'REGGE'", @ID,@NAME$,@ARTIST$); goto LISTAR; case 4: query_sql("SELECT ID,NAME,ARTIST FROM w_music WHERE TYPE = 'DISCO'", @ID,@NAME$,@ARTIST$); goto LISTAR; case 5: query_sql("SELECT ID,NAME,ARTIST FROM w_music WHERE TYPE = 'ELEC'", @ID,@NAME$,@ARTIST$); goto LISTAR; case 6: query_sql("SELECT ID,NAME,ARTIST FROM w_music WHERE TYPE = 'ROCKL'", @ID,@NAME$,@ARTIST$); goto LISTAR; case 7: query_sql("SELECT ID,NAME,ARTIST FROM w_music WHERE TYPE = 'ROMAN'", @ID,@NAME$,@ARTIST$); goto LISTAR; case 8: query_sql("SELECT ID,NAME,ARTIST FROM w_music WHERE TYPE = 'HIPHOP'", @ID,@NAME$,@ARTIST$); goto LISTAR; case 9: query_sql("SELECT ID,NAME,ARTIST FROM w_music WHERE TYPE = 'METAL'", @ID,@NAME$,@ARTIST$); goto LISTAR; case 10: close;}LISTAR: mes "ID ----- Tema / Artista"; set @i,0;ID_IMPRO: if (@i < getarraysize(@ID)) { mes "^0000FF" + @ID[@i] +" ^000000[ ^FF0080"+ @NAME$[@i] + "^808080 / ^8080C0" + @ARTIST$[@i] + "^000000 ]"; set @i,@i+1; goto ID_IMPRO; }next; switch(select(" ^0080FFir a Playlist: ^FF8000Ver mas Temas: ^FF0000Salir")) { case 1: goto PLAYLIST; case 2: goto LISTAR; case 3: close; }// ........................................................................................................// CONTADOR DE SEGUNDOS PARA LOS TEMAS// -------------------------------------------------OnTimer1000: set .reloj,.reloj-1; if (.reloj == 0) { delwaitingroom; stopnpctimer; goto PLAYTEMA; end; } set .varA,.reloj / 60; set .varB,.reloj % 60; delwaitingroom; waitingroom .tema$+" -"+.varA+":"+.varB+"",0; initnpctimer; end;// -------------------------------------------------PLAYLIST: mes "^008000Playlist :^000000"; if (.reloj > 0) { mes "^0000FF[P] ^FF0000" + .tema$; mes "^FFFFFF."; } if (.lista$[0] == "") mes "^8000FF[1] ^808080vacio^000000"; else mes "^8000FF[1] ^0080C0" + .lista$[0] + "^000000"; if (.lista$[1] == "") mes "^8000FF[2] ^808080vacio^000000"; else mes "^8000FF[2] ^800040" + .lista$[1] + "^000000"; if (.lista$[2] == "") mes "^8000FF[3] ^808080vacio^000000"; else mes "^8000FF[3] ^800040" + .lista$[2] + "^000000"; next; switch(select(" ^0080C0Menu de Temas [0]: ^008000Agregar Tema [ + ]: ^FF0000Salir")) { case 1: goto LISTADO; case 2: if (getarraysize(.lista$) > 2) { mes "^FF8000Actualmente no hay Espacio para Agregar otro Tema, intenta mas tarde."; close; } else { goto AGREGAR_T; } case 3: close; }AGREGAR_T: if (countitem(7539) == 0) { mes "[ ^FF8000Lady DJ^000000 ]"; mes "Debes tener una ^FF0080Poring Coin^000000 para programar una cancion."; close;} mes "[ ^FF8000Lady DJ^000000 ]"; mes "Ingresa la #ID del Tema :"; mes "^808080Ingresa ^8080FFCero ^808080si deseas Salir."; next;L_INPU: input .@ID; if (.@ID == 0) close; query_sql("SELECT COUNT(ID) FROM w_music WHERE ID = '" + .@ID + "'", @punto); if (@punto == 0) { mes "ID NO EXISTE"; close; } // BUSCAMOS EL TEMA SEGUN ID query_sql("SELECT ID,NAME,ARTIST,TIME,FILE FROM w_music WHERE ID = '" + .@ID + "'", @ID,@NAME$,@ARTIST$,@TIME,@FILE$); mes "[ ^FF0000Landy DJ^000000 ]"; mes "^508050ID# : ^8080C0" + @ID[0]; mes "^508050Cancion : ^0000FF" + @NAME$[0]; mes "^508050Artista : ^008000" + @ARTIST$[0]; set @minu,@TIME[0] / 60; set @segu,@TIME[0] % 60; mes "^808080Duracion : ^FF0080" + @minu + "." + @segu; switch(select(" ^008000Agregar [ + ]: ^FF8000Ingresar Otro: ^FF0000Salir")) { case 1: goto L_ADDER; case 2: next; goto AGREGAR_T; case 3: close; }L_ADDER: mes "^FF0000 ------- AGREGADO -------"; // Revisa si alguien programo antes if (countitem(7539) == 0) { mes "[ ^FF8000Lady DJ^000000 ]"; mes "Debes tener una ^FF0080Poring Coin^000000 para programar una cancion."; close;} if (getarraysize(.lista$) > 2) { mes "^FF8000Actualmente no hay Espacio para Agregar otro Tema, intenta mas tarde."; close; } if (getarraysize(.lista$) == 0) set @indi,0; if (getarraysize(.lista$) == 1) set @indi,1; if (getarraysize(.lista$) == 2) set @indi,2; set .lista$[@indi],@NAME$[0] + " ^808080("+strcharinfo(0)+")"; set .play[@indi],@ID[0]; set .usere$[@indi],strcharinfo(0); delitem 7539,1; close2; if (.automa == 1) { set .automa,0; goto DIRECTO; }PLAYTEMA: if (.reloj == 0 && getarraysize(.lista$) == 0 && .shuffle == 0) { goto SHUFFLE; } if (.reloj == 0) {DIRECTO: query_sql("SELECT ID,NAME,ARTIST,TIME,FILE FROM w_music WHERE ID = '" + .play[0] + "'", .@ID,.@NAME$,.@ARTIST$,.@TIME,.@FILE$);// Correr el Tema// ---------------// El script funciona tomando el nombre de Archivo almacenado en la tabla 'w_music'// puedes cambiar el directorio que es lander quedando asi:// ROBGMlander// Mapa// --------------// Para que el tema musical sea escuchado por varios players// debes asiganar un rango de Area, ver : playBGMall playbgmall "lander/"+.@FILE$[0],"job_knt",20,167,67,122; set .tema$,.@NAME$[0]; set .@minu,.@TIME[0] / 60; set .@segu,.@TIME[0] % 60; areaannounce "job_knt",20,167,67,122,.@ARTIST$[0] + " : "+.@NAME$[0]+" ["+.@minu+":"+.@segu+"] ( programado por : " + .usere$[0] + " )",bc_map|bc_woe,"0x00CCFF",FW_BOLD,10; delwaitingroom; waitingroom .tema$ + " [ " + .@minu + ":" + .@segu + " ]",0; set .ultimo,.@ID; set .reloj,.@TIME[0]; deletearray .lista$[0],1; deletearray .play[0],1; deletearray .usere$[0],1; set .shufle,0; initnpctimer; end; } goto PLAYLIST; end;SHUFFLE: query_sql("SELECT ID FROM w_music LIMIT 126", .@ID);LANDA: set .@palo, rand (0,getarraysize(.@ID)); if (.@palo == 0) { set .@palo,0; } else { set .@palo,.@palo-1; } if (.ultimo == .@ID[.@palo]) goto LANDA; set .usere$[0],"~Lady DJ~"; set .play[0],.@ID[.@palo]; set .shufle,1; set .automa,1; goto DIRECTO; end;}
  3. I'd src edit it or complicate the NPC a bit, since you may have it enabled, reach to lvl 50 and this script would make it unable to disable it via the command, thus having autoloot till you relog. Also... Seems you never use the atcommand by the useatcmd script command?
  4. If I remember well, you can't set a piece of map so that a monster cannot teleport, you should set the whole map. Please refer to the mapflag monster_noteleport on the npc/mapflag folder (inside noteleport.txt) or the mf_monster_noteleport constant in db/const.txt.
  5. Simply put a waitingroom with capacity for 0 users . If you want to refresh it, just delete the previous waitingroom (with delwaitingroom) then make a new one.
  6. Try it first and post if you see errors, don't be lazy
  7. Find: OnInit: waitingroom "[ PVP ROOM ]",0; end; Add: delwaitingroom; Before: waitingroom "[ PVP ROOM ]",0;
  8. Last time I got that one was when I tried to ad the mouse freedom DLL (dinput.dll) to a recent client of a pserver. That editing of file detected window shown and didn't let me play. Could you see if you have that dll on your client folder and if your problem is solved by removing it?
  9. Please, keep the discussion in English outside of the International sections.
  10. Not good on SRC so I won't be able to give any support if this fails, but try this one: Find: src/map/clif.c:14625 clif->upgrademessage(sd->fd, 0,item->nameid); Change to: clif->messages(sd->fd, "+%d %s obtained.", item->refine, item->nameid); Haven't tested it, won't possibly work but this should get you nearer to your goal in any case.
  11. One of them uses Git and other uses Subversion (abbreviated as SVN). They both can be understood as Version Control Systema, but our main repo is based in Git and you'll get full advantages from it by using Git rather than SVN.
  12. In fact, using variables is slightly faster than doing all the queries right away. Variables are stored in memory until the player gets saved, that is when all the information goes straight into the database. This way you save some processing time
  13. Put freeloop(1); before the loops and freeloop(0); after them.
  14. If they are exactly level 1 players, why are you checking whether they are less than or more than level 1? You are in a void if a player is exactly at level 1. Your level 1 or greater operator should be this one: '>=', not '>'.
  15. Please don't save your scripts on UTF encoding, this is what causes these problems since first characters added on an UTF encoded files is the Byte-Order Mask (BOM). Try saving your scripts with ANSI encoding or as UTF without BOM and try loading your script again. You can know more about the BOM if you go look more information about the UTF file standard on Wikipedia.
  16. If I remember well, Hercules removed all the variable limitations around a couple months ago, so you can now use all permanent account, char or server variables you like without any problem. Look for any scripting engine update on our Repository News topics.
  17. Full client, as it says, is a full client side installation so you don't need anything extra for your client side. In case you meant something else sorry, I failed to understand you. Could you please elaborate in that case?
  18. I don't know if it could be on your msstringtable.txt client side file, or maybe it's on the server-side conf/messages.conf file...
  19. ¡Hola! Me encuentro desde el teléfono, no te puedo dar un script arreglado pero se te ve suficientemente apañado como para que te guíe yo y lo puedas resolver tú solo. Tras observar tu script, es obvio que presenta el problema que has descrito porque no tienes ningún mecanismo de control para evitarlo. De momento se me ocurren un par de formas de ayudarte a repararlo. Primera forma (sencilla pero algo chapucera): Que el NPC asigne una variable de personaje cuando lo renazca por primera vez. El NPC también tendría código para detectar esa variable y evitar que el personaje "renazca" dos veces. Segunda forma (un poco más profesional): Observa que el script command eaclass() devuelve el número de clase del PJ. Con él se pueden comprobar muchas cosas, entre ellas tienes la posibilidad de saber si tu PJ es renacido a través de operaciones de bits. en concreto lo que debes chequear en este caso es lo siguiente: if(eaclass()&EAJL_UPPER) // En caso afirmativo es un renacido. Con la segunda forma, además puedes saber sin lugar a dudas si el personaje ha renacido, sea con tu NPC o en cualquier otro lado (quest oficial, @command, etcétera). Tienes más información en doc/ea_job_system.txt si mal no recuerdo. Lo único malo de ambos métodos, es que tendrás que añadir comprobaciones adicionales si no quieres que tu NPC renazca a third class no renacidas (en caso de que las uses), aunque eso ya lo dejo a tu preferencia. ¡Un saludo!
  20. I'd also go for teaching these code standards in our scripting documentations or in another file, but making reference to it since they're good practice =)
  21. If you want to get started and you've grabbed one of the latest Hercules commits, you should try out the 2013-12-23 client by ossi0110, it works just out of the box on current Hercules: http://hercules.endlessro.net/
  22. Diff file is not put anywhere, it's a file so that some tools can automatically apply it on your files, but you can do so manually. You can manually perform these changes without the need of an automated tool. This diff is particularly simple to apply: On npc/guild/agit_main.txt look for: OnAgitBreak:Add after that: query_sql "update `char` set empbreak = empbreak +1 where char_id = "+ getcharid(0); On npc/guild/agit_main_se.txt look for: OnStartArena:Add after that: query_sql "update `char` set empbreak = empbreak +1 where char_id = "+ getcharid(0); And don't forget to add the SQL addition on your database that comes with the NPC!
  23. Charlog table is (inexplicably?) located at main database, so you should run it on the same database you have applied your main.sql before.
  24. Maybe you're using the same port on both servers?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.