Jump to content

sader1992

Content Moderator
  • Posts

    1678
  • Joined

  • Last visited

  • Days Won

    72

Everything posted by sader1992

  1. for client side , you need to edit it manually or create a program to do that for you for the server side , you can do it with some src edit , or you edit your item db txt manually or you use sql and create a sql script that does this for you , or you create a program to do that for you
  2. sader1992

    Storage Items

    from the item db table in sql that mean if the user did not use the sql db >> https://github.com/rathena/rathena/blob/a3fc44ef8aecf55789165b18dd64aa36ad8ecbac/conf/inter_athena.conf#L155 and did not import it to sql flux wont see the items also this might interest you too https://github.com/rathena/FluxCP/blob/master/modules/item/iteminfo.php which convert the iteminfo.lua to a file that flux can read to get the description of the items
  3. - script respawnMvp -1,{ OnInit: setarray .mob_id[0],1857,1002,1031,1113,1613,1836; .monster = .mob_id[rand(getarraysize(.mob_id))]; monster "prontera",154,172,"--en--", .monster, 1, "respawnMvp::OnKill"; announce "MVP "+getmonsterinfo(.monster, 0)+" has spawned!",0; end; OnKill: announce getmonsterinfo(.monster, 0)+ " was killed by "+strcharinfo(0)+".",0; .monster = .mob_id[rand(getarraysize(.mob_id))]; monster "prontera",154,172,"--en--", .monster, 1, "respawnMvp::OnKill"; announce "MVP "+getmonsterinfo(.monster, 0)+" has spawned!",0; end; }
  4. you can edit the item script , check for the battle conf of exp and on use get new item and display a message
  5. i would suggest to ask in nemo repo, you might get your fix there
  6. just before you delete the zeny set Zeny, Zeny-.s_zeny; add if(!countitem(7716)){ mes "you need 1 " + getitemname(7716) + " to complete the enchantment."; end; } delitem 7716,1;
  7. it look for me in the video your script all about chances , so i am not sure what you are asking about its as simple as if(rand(1,100) < 76){ //75% chance (the result is between and includes 1 and 75) }else{ //25% chance (the result is else) }
  8. it's not recommended . but you can use this command *classchange(<view id>{,"<NPC name>","<flag>"}); read the command info to know why it's not recommended also you will need to do a lot of extra code to keep your npc the way you want the player to see (read the command information) --------------------------------------- *classchange(<view id>{,"<NPC name>","<flag>"}); This command is very ancient, its origins are clouded in mystery. It will send a 'display id change' packet to everyone in the immediate area of the NPC object, which will supposedly make the NPC look like a different sprite, an NPC sprite ID, or a monster ID. This effect is not stored anywhere and will not persist (Which is odd, cause it would be relatively easy to make it do so) and most importantly, will not work at all since this command was broken with the introduction of advanced classes. The code is written with the assumption that the lowest sprite IDs are the job sprites and the anything beyond them is monster and NPC sprites, but since the advanced classes rolled in, they got the ID numbers on the other end of the number pool where monster sprites float. As a result it is currently impossible to call this command with a valid view id. It will do nothing whatsoever if the view ID is below 4047. Getting it to run will actually just crash the client. It could be a real gem if it can be gotten to actually do what it's supposed to do, but this will only happen in a later SVN revision. Empty <NPC name> means attached NPC. Target for <flag>: - bc_area : Sprite is sent to players in the vicinity of the source (default value). - bc_self : Sprite is sent only to player attached. ---------------------------------------
  9. i see you used the same photo in the post just to make sure you are using the last rAthena without switching to pre-re so your server is renewal and you get this problem , right ?
  10. you don't need to define the variable before you use it, any new variable you use by default is int 0 string "" so you can right away if(#var < 11){ //your code #var++; }
  11. you need to get the inventory list and check for the item that the player selected , than get all it information delete the item than give the player new item using getitem2 or getitem3 if you use random options system getinventorylist {<char_id>}; getitem2 and getitem3
  12. what you need is a global variable "$var" this variable is for the server and will be saved in sql i suggest you read more about rAthena's variables here https://github.com/rathena/rathena/blob/4ba54838fe78d86fd5e03ebe5ffcd650e092cac9/doc/script_commands.txt#L428
  13. i tested on clean rathena just now and everything fine i would suggest you check the client files you have try with renewal files
  14. if(.s_all_loc[.@s_all_selected] == EQI_HAND_L && getiteminfo(getequipid(.s_all_loc[.@s_all_selected]),2) != 4){ mes "you can't enchant weapon from your left hand"; end; }
  15. there is already a config for that in the script i think , as long as you don't have a Shield in the EQI_HAND_R or two hand Shield you should not get the problem you are getting if you configure the script right
  16. than you can replace all the codes with getinventorylist; for(.@i = 0;.@i<@inventorylist_count;.@i++){ if(@inventorylist_equip[.@i] == .@part){ .@ndx = .@i; break; } } if( (@inventorylist_card1[.@ndx] && getiteminfo(@inventorylist_card1[.@ndx],2) != 6) || (@inventorylist_card2[.@ndx] && getiteminfo(@inventorylist_card2[.@ndx],2) != 6) || (@inventorylist_card3[.@ndx] && getiteminfo(@inventorylist_card3[.@ndx],2) != 6) || (@inventorylist_card4[.@ndx] && getiteminfo(@inventorylist_card4[.@ndx],2) != 6) ){ mes "enchantment detected!"; end; }
  17. you use the random options system ? this command is for the random options system you should have it if you if you use the system there is no other way to get item with random options
  18. replace the if((.@ndx = inarray(@inventorylist_equip,.@part)) != -1){ (don't forget the "}") with for(.@i = 0;.@i<@inventorylist_count;.@i++){ if(@inventorylist_equip[.@i] == .@part){ .@ndx = .@i; break; } }
  19. i didn't test it , i am sure i have some syntax not right xD test it first prt_in,28,73,4 script Velha Sábia 78,{ set .vip_needed, 5; //Nível necessário de VIP para acessar os recursos especias do NPC if (getgroupid() < .vip_needed) { mes "^00B2EE[Velha Sábia]^000000"; mes "Eu tenho o poder de remover cartas que já foram usadas nos seus equipamentos. Essa idéia pode ajudá-lo?"; next; switch(select("^3CB371[»]^000000 Continuar:^FFA500[»]^000000 Informaçoes:^ff0000[»]^000000 Desistir")) { case 1: mes "^00B2EE[Velha Sábia]^000000"; mes "Tudo bem. Qual ítem quer que eu examine para voce?"; next; setarray .@position$[1], "Acessório (Direita)","Sapatos","Capa","Cabeça (Baixo)","Cabeça (Meio)","Cabeça (Topo)","Armadura","Mao Direita","Mao Esquerda","Visual","Visual","Visual"; set .@menu$,""; for( set .@i,1; .@i <= 10; set .@i,.@i+1 ) { if( getequipisequiped(.@i) ) set .@menu$, .@menu$ + .@position$[.@i] + " - " + "[" + getequipname(.@i) + "]"; set .@menu$, .@menu$ + ":"; } set .@part,select(.@menu$); mes "^00B2EE[Velha Sábia]^000000"; if(!getequipisequiped(.@part)) { mes "Meu jovem, equipe algo para que eu possa trabalhar. nao posso fazer nada por voce assim."; close; } set .@cardcount,getequipcardcnt(.@part); if(!.@cardcount) { mes "Meu jovem, nao há cartas equipadas neste ítem. nao posso trabalhar assim!"; close; } if ( !checkweight(1202,(.@cardcount+1)) ) { mes "^3355FFAguarde um momento!"; mes "Eu nao posso oferecer meus serviços a voce pois está com excesso de peso ou itens no iventário."; close; } mes "Esse ítem tem " + .@cardcount + " cartas equipadas."; mes "Para melhorar minha magia, sao necessários " + (200000+(.@cardcount * 25000)) + " zeny,"; mes "um ^0000FFFragmento Estelar^000000, e uma ^0000FFGema Amarela^000000."; next; mes "^00B2EE[Velha Sábia]^000000"; if(select("^3CB371[»]^000000 Continuar:^ff0000[»]^000000 Desistir") == 2) { mes "Muito bem, agradeço por utilizar os meus serviços!"; close; } if((Zeny < (200000+(.@cardcount * 25000))) || (countitem(1000) < 1) || (countitem(715) < 1)) { next; mes "Voce nao tem tudo que é necessário para a minha mágica, garot"+(sex > 0 ? "o" : "a")+". Volte quando conseguí-los."; close; } next; mes "^00B2EE[Velha Sábia]^000000"; mes "Muito vem, vamos começar!."; getinventorylist; if((.@ndx = inarray(@inventorylist_equip,.@part)) != -1){ if(getiteminfo(@inventorylist_card1[.@ndx],2) == 6){ .@cards[1] = 0; .@gets[1] = @inventorylist_card1[.@ndx]; }else{//card slot 1 is not a card so there is no cards in this item. mes "you don't have cards in this item"; end; } if(getiteminfo(@inventorylist_card2[.@ndx],2) == 6){ .@cards[2] = 0; .@gets[2] = @inventorylist_card2[.@ndx]; }else .@cards[2] = @inventorylist_card2[.@ndx]; if(getiteminfo(@inventorylist_card3[.@ndx],2) == 6){ .@cards[3] = 0; .@gets[3] = @inventorylist_card3[.@ndx]; }else .@cards[3] = @inventorylist_card3[.@ndx]; if(getiteminfo(@inventorylist_card4[.@ndx],2) == 6){ .@cards[4] = 0; .@gets[4] = @inventorylist_card4[.@ndx]; }else .@cards[4] = @inventorylist_card4[.@ndx]; //card detected so we get the requirment first before we go on. set Zeny,Zeny - (200000+(.@cardcount * 25000)); delitem 1000,1; delitem 715,1; delequip .@part;//delete the equipment //building the random options setarray .@ids,@inventorylist_option_id1[.@ndx],@inventorylist_option_id2[.@ndx],@inventorylist_option_id3[.@ndx],@inventorylist_option_id4[.@ndx],@inventorylist_option_id5[.@ndx]; setarray .@values,@inventorylist_option_value1[.@ndx],@inventorylist_option_value2[.@ndx],@inventorylist_option_value3[.@ndx],@inventorylist_option_value4[.@ndx],@inventorylist_option_value5[.@ndx]; setarray .@parameters,@inventorylist_option_parameter1[.@ndx],@inventorylist_option_parameter2[.@ndx],@inventorylist_option_parameter3[.@ndx],@inventorylist_option_parameter4[.@ndx],@inventorylist_option_parameter5[.@ndx]; //get new equipment getitem3 @inventorylist_id[.@ndx],1,@inventorylist_identify[.@ndx],@inventorylist_refine[.@ndx],@inventorylist_attribute[.@ndx], .@cards[1],.@cards[2],.@cards[3],.@cards[4],.@ids,.@values,.@parameters; for(.@i=0;.@i<getarraysize(.@gets);.@i++){ if(.@gets[.@i]){ getitem .@gets[.@i],1; } } next; mes "^00B2EE[Velha Sábia]^000000"; mes "O processo foi um grande sucesso. Tome suas cartas e seus ítens."; close; } end; case 2: next; mes "^00B2EE[Velha Sábia]^000000"; mes "Eu preciso de 200000 zeny, mais 25000 zeny para cada carta removida de seus ítens. E adicionalmente, preciso de um Fragmento Estelar e uma Gema Amarela para trabalhar com a minha mágica."; close; case 3: next; mes "^00B2EE[Velha Sábia]^000000"; mes "Muito bem, volte quando precisar dos meus serviços."; close; } } else { mes "^00B2EE[Velha Sábia]^000000"; mes "Eu tenho o poder de remover cartas que já foram usadas nos seus equipamentos. Essa idéia pode ajudá-lo?"; next; switch(select("^3CB371[»]^000000 Continuar:^ff0000[»]^000000 Desistir")) { case 1: mes "^00B2EE[Velha Sábia]^000000"; mes "Tudo bem. Qual ítem quer que eu examine para voce?"; next; setarray .@position$[1], "Acessório (Direita)","Sapatos","Capa","Cabeça (Baixo)","Cabeça (Meio)","Cabeça (Topo)","Armadura","Mao Direita","Mao Esquerda","Visual","Visual","Visual"; set .@menu$,""; for( set .@i,1; .@i <= 10; set .@i,.@i+1 ) { if( getequipisequiped(.@i) ) set .@menu$, .@menu$ + .@position$[.@i] + " - " + "[" + getequipname(.@i) + "]"; set .@menu$, .@menu$ + ":"; } set .@part,select(.@menu$); mes "^00B2EE[Velha Sábia]^000000"; if(!getequipisequiped(.@part)) { mes "Meu jovem, equipe algo para que eu possa trabalhar. nao posso fazer nada por voce assim."; close; } set .@cardcount,getequipcardcnt(.@part); if(!.@cardcount) { mes "Meu jovem, nao há cartas equipadas neste ítem. nao posso trabalhar assim!"; close; } if ( !checkweight(1202,(.@cardcount+1)) ) { mes "^3355FFAguarde um momento!"; mes "Eu nao posso oferecer meus serviços a voce pois está com excesso de peso ou itens no iventário."; close; } mes "Esse ítem tem " + .@cardcount + " cartas equipadas."; next; mes "^00B2EE[Velha Sábia]^000000"; if(select("^3CB371[»]^000000 Continuar:^ff0000[»]^000000 Desistir") == 2) { mes "Muito bem, agradeço por utilizar os meus serviços!"; close; } next; mes "^00B2EE[Velha Sábia]^000000"; mes "Muito vem, vamos começar!."; getinventorylist; if((.@ndx = inarray(@inventorylist_equip,.@part)) != -1){ if(getiteminfo(@inventorylist_card1[.@ndx],2) == 6){ .@cards[1] = 0; .@gets[1] = @inventorylist_card1[.@ndx]; }else{//card slot 1 is not a card so there is no cards in this item. mes "you don't have cards in this item"; end; } if(getiteminfo(@inventorylist_card2[.@ndx],2) == 6){ .@cards[2] = 0; .@gets[2] = @inventorylist_card2[.@ndx]; }else .@cards[2] = @inventorylist_card2[.@ndx]; if(getiteminfo(@inventorylist_card3[.@ndx],2) == 6){ .@cards[3] = 0; .@gets[3] = @inventorylist_card3[.@ndx]; }else .@cards[3] = @inventorylist_card3[.@ndx]; if(getiteminfo(@inventorylist_card4[.@ndx],2) == 6){ .@cards[4] = 0; .@gets[4] = @inventorylist_card4[.@ndx]; }else .@cards[4] = @inventorylist_card4[.@ndx]; delequip .@part;//delete the equipment //building the random options setarray .@ids,@inventorylist_option_id1[.@ndx],@inventorylist_option_id2[.@ndx],@inventorylist_option_id3[.@ndx],@inventorylist_option_id4[.@ndx],@inventorylist_option_id5[.@ndx]; setarray .@values,@inventorylist_option_value1[.@ndx],@inventorylist_option_value2[.@ndx],@inventorylist_option_value3[.@ndx],@inventorylist_option_value4[.@ndx],@inventorylist_option_value5[.@ndx]; setarray .@parameters,@inventorylist_option_parameter1[.@ndx],@inventorylist_option_parameter2[.@ndx],@inventorylist_option_parameter3[.@ndx],@inventorylist_option_parameter4[.@ndx],@inventorylist_option_parameter5[.@ndx]; //get new equipment getitem3 @inventorylist_id[.@ndx],1,@inventorylist_identify[.@ndx],@inventorylist_refine[.@ndx],@inventorylist_attribute[.@ndx], .@cards[1],.@cards[2],.@cards[3],.@cards[4],.@ids,.@values,.@parameters; for(.@i=0;.@i<getarraysize(.@gets);.@i++){ if(.@gets[.@i]){ getitem .@gets[.@i],1; } } next; mes "^00B2EE[Velha Sábia]^000000"; mes "O processo foi um grande sucesso. Tome suas cartas e seus ítens."; close; } end; case 2: mes "^00B2EE[Velha Sábia]^000000"; mes "Muito bem, volte quando precisar dos meus serviços."; close; } } } prontera,133,201,5 duplicate(Velha Sábia) Velha Sábia#2 78 just so you know this the edit getinventorylist; if((.@ndx = inarray(@inventorylist_equip,.@part)) != -1){ if(getiteminfo(@inventorylist_card1[.@ndx],2) == 6){ .@cards[1] = 0; .@gets[1] = @inventorylist_card1[.@ndx]; }else{//card slot 1 is not a card so there is no cards in this item. mes "you don't have cards in this item"; end; } if(getiteminfo(@inventorylist_card2[.@ndx],2) == 6){ .@cards[2] = 0; .@gets[2] = @inventorylist_card2[.@ndx]; }else .@cards[2] = @inventorylist_card2[.@ndx]; if(getiteminfo(@inventorylist_card3[.@ndx],2) == 6){ .@cards[3] = 0; .@gets[3] = @inventorylist_card3[.@ndx]; }else .@cards[3] = @inventorylist_card3[.@ndx]; if(getiteminfo(@inventorylist_card4[.@ndx],2) == 6){ .@cards[4] = 0; .@gets[4] = @inventorylist_card4[.@ndx]; }else .@cards[4] = @inventorylist_card4[.@ndx]; //card detected so we get the requirment first before we go on. set Zeny,Zeny - (200000+(.@cardcount * 25000)); delitem 1000,1; delitem 715,1; delequip .@part;//delete the equipment //building the random options setarray .@ids,@inventorylist_option_id1[.@ndx],@inventorylist_option_id2[.@ndx],@inventorylist_option_id3[.@ndx],@inventorylist_option_id4[.@ndx],@inventorylist_option_id5[.@ndx]; setarray .@values,@inventorylist_option_value1[.@ndx],@inventorylist_option_value2[.@ndx],@inventorylist_option_value3[.@ndx],@inventorylist_option_value4[.@ndx],@inventorylist_option_value5[.@ndx]; setarray .@parameters,@inventorylist_option_parameter1[.@ndx],@inventorylist_option_parameter2[.@ndx],@inventorylist_option_parameter3[.@ndx],@inventorylist_option_parameter4[.@ndx],@inventorylist_option_parameter5[.@ndx]; //get new equipment getitem3 @inventorylist_id[.@ndx],1,@inventorylist_identify[.@ndx],@inventorylist_refine[.@ndx],@inventorylist_attribute[.@ndx], .@cards[1],.@cards[2],.@cards[3],.@cards[4],.@ids,.@values,.@parameters; for(.@i=0;.@i<getarraysize(.@gets);.@i++){ if(.@gets[.@i] != 0){ getitem .@gets[.@i],1; } } end; } so basically we get the inventory list , search for the item , check for it's card slots , if it's type 6 than it's a card , we remove it if it's else , we leave it that we delete the equipment and getitem3 the new equipment to the player , and we give him the cards we removed this just given me an idea for rathena command ?
  20. that depend on what you want to do do you want that people can't put enchantment on the card slot if exist or you want the players to not be able to remove the enchantment but still can put it in empty card slot ? you can do both to not allow the enchantment to be in an empty card slot , you get the slot number of the enchantment npc and check if it's a card slot or it's no slot to not allow to remove the enchantment you need to edit the card removal to check if the item the player want to remove is a card or not (item type 6)
  21. https://github.com/rathena/rathena/wiki/Custom-Items https://github.com/rathena/rathena/blob/master/doc/item_db.txt
  22. https://github.com/rathena/rathena/blob/7ad1b32d7d44fd1c5d927228528cc607f61da001/doc/script_commands.txt#L9773 --------------------------------------- *getpartymember <party id>{,<type>{,<array_variable>}}; This command will find all members of a specified party and returns their names (or character id or account id depending on the value of "type") into an array of temporary global variables. There's actually quite a few commands like this which will fill a special variable with data upon execution and not do anything else. Upon executing this, $@partymembername$[] is a global temporary string array which contains all the names of these party members (only set when type is 0 or not specified) $@partymembercid[] is a global temporary number array which contains the character id of these party members. (only set when type is 1) $@partymemberaid[] is a global temporary number array which contains the account id of these party members. (only set when type is 2) $@partymembercount is the number of party members that were found. The party members will (apparently) be found regardless of whether they are online or offline. Note that the names come in no particular order. Be sure to use $@partymembercount to go through this array, and not 'getarraysize', because it is not cleared between runs of 'getpartymember'. If someone with 7 party members invokes this script, the array would have 7 elements. But if another person calls up the NPC, and he has a party of 5, the server will not clear the array for you, overwriting the values instead. So in addition to returning the 5 member names, the 6th and 7th elements from the last call remain, and you will get 5+2 members, of which the last 2 don't belong to the new guy's party. $@partymembercount will always contain the correct number, (5) unlike 'getarraysize()' which will return 7 in this case. If 'array_variable' is set, the result will be stored to that variable instead using global variable. Example 1: list party member names // get the party member names getpartymember getcharid(1),0; // It's a good idea to copy the global temporary $@partymember***** // variables to your own scope variables because if you have pauses in this // script (sleep, sleep2, next, close2, input, menu, select, or prompt), // another player could click this NPC, trigger 'getpartymember', and // overwrite the $@partymember***** variables. .@count = $@partymembercount; copyarray .@name$[0], $@partymembername$[0], $@partymembercount; // list the party member names for (.@i = 0; .@i < .@count; .@i++) mes (.@i +1) + ". ^0000FF" + .@name$[.@i] + "^000000"; close; Example 2: check party count (with a 'next' pause), before warping to event .register_num = 5; // How many party members are required? // get the charID and accountID of character's party members getpartymember getcharid(1), 1; getpartymember getcharid(1), 2; if ( $@partymembercount != .register_num ) { mes "Please form a party of " + .register_num + " to continue"; close; } // loop through both and use 'isloggedin' to count online party members for ( .@i = 0; .@i < $@partymembercount; .@i++ ) if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) .@count_online++; // We search accountID & charID because a single party can have multiple // characters from the same account. Without searching through the charID, // if a player has 2 characters from the same account inside the party but // only 1 char online, it would count their online char twice. if ( .@count_online != .register_num ) { mes "All your party members must be online to continue"; close; } // copy the array to prevent players cheating the system copyarray .@partymembercid, $@partymembercid, .register_num; mes "Are you ready ?"; next; // careful here select("Yes"); // When a script hits a next, menu, sleep or input that pauses the script, // players can invite or /leave and make changes in their party. To prevent // this, we call getpartymember again and compare with the original values. getpartymember getcharid(1), 1; if ( $@partymembercount != .register_num ) { mes "You've made changes to your party !"; close; } for ( .@i = 0; .@i < $@partymembercount; .@i++ ) { if ( .@partymembercid[.@i] != $@partymembercid[.@i] ) { mes "You've made changes to your party !"; close; } } // Finally, it's safe to start the event! warpparty "event_map", 0,0, getcharid(1); ---------------------------------------
×
×
  • Create New...