sader1992

Content Moderator
  • Content Count

    1,140
  • Avg. Content Per Day

    1
  • Joined

  • Last visited

  • Days Won

    42

Everything posted by sader1992

  1. 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;
  2. 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) }
  3. 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. ---------------------------------------
  4. 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 ?
  5. 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++; }
  6. 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
  7. 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
  8. i tested on clean rathena just now and everything fine i would suggest you check the client files you have try with renewal files
  9. if(.s_all_loc[[email protected]_all_selected] == EQI_HAND_L && getiteminfo(getequipid(.s_all_loc[[email protected]_all_selected]),2) != 4){ mes "you can't enchant weapon from your left hand"; end; }
  10. 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
  11. than you can replace all the codes with getinventorylist; for([email protected] = 0;[email protected]<@inventorylist_count;[email protected]++){ if(@inventorylist_equip[[email protected]] == [email protected]){ [email protected] = [email protected]; break; } } if( (@inventorylist_card1[[email protected]] && getiteminfo(@inventorylist_card1[[email protected]],2) != 6) || (@inventorylist_card2[[email protected]] && getiteminfo(@inventorylist_card2[[email protected]],2) != 6) || (@inventorylist_card3[[email protected]] && getiteminfo(@inventorylist_card3[[email protected]],2) != 6) || (@inventorylist_card4[[email protected]] && getiteminfo(@inventorylist_card4[[email protected]],2) != 6) ){ mes "enchantment detected!"; end; }
  12. 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
  13. replace the if(([email protected] = inarray(@inventorylist_equip,[email protected])) != -1){ (don't forget the "}") with for([email protected] = 0;[email protected]<@inventorylist_count;[email protected]++){ if(@inventorylist_equip[[email protected]] == [email protected]){ [email protected] = [email protected]; break; } }
  14. 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 [email protected]$[1], "Acessório (Direita)","Sapatos","Capa","Cabeça (Baixo)","Cabeça (Meio)","Cabeça (Topo)","Armadura","Mao Direita","Mao Esquerda","Visual","Visual","Visual"; set [email protected]$,""; for( set [email protected],1; [email protected] <= 10; set [email protected],[email protected]+1 ) { if( getequipisequiped([email protected]) ) set [email protected]$, [email protected]$ + [email protected]$[[email protected]] + " - " + "[" + getequipname([email protected]) + "]"; set [email protected]$, [email protected]$ + ":"; } set [email protected],select([email protected]$); mes "^00B2EE[Velha Sábia]^000000"; if(!getequipisequiped([email protected])) { mes "Meu jovem, equipe algo para que eu possa trabalhar. nao posso fazer nada por voce assim."; close; } set [email protected],getequipcardcnt([email protected]); if([email protected]) { mes "Meu jovem, nao há cartas equipadas neste ítem. nao posso trabalhar assim!"; close; } if ( !checkweight(1202,([email protected]+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 " + [email protected] + " cartas equipadas."; mes "Para melhorar minha magia, sao necessários " + (200000+([email protected] * 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+([email protected] * 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(([email protected] = inarray(@inventorylist_equip,[email protected])) != -1){ if(getiteminfo(@inventorylist_card1[[email protected]],2) == 6){ [email protected][1] = 0; [email protected][1] = @inventorylist_card1[[email protected]]; }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[[email protected]],2) == 6){ [email protected][2] = 0; [email protected][2] = @inventorylist_card2[[email protected]]; }else [email protected][2] = @inventorylist_card2[[email protected]]; if(getiteminfo(@inventorylist_card3[[email protected]],2) == 6){ [email protected][3] = 0; [email protected][3] = @inventorylist_card3[[email protected]]; }else [email protected][3] = @inventorylist_card3[[email protected]]; if(getiteminfo(@inventorylist_card4[[email protected]],2) == 6){ [email protected][4] = 0; [email protected][4] = @inventorylist_card4[[email protected]]; }else [email protected][4] = @inventorylist_card4[[email protected]]; //card detected so we get the requirment first before we go on. set Zeny,Zeny - (200000+([email protected] * 25000)); delitem 1000,1; delitem 715,1; delequip [email protected];//delete the equipment //building the random options setarray [email protected]ds,@inventorylist_option_id1[[email protected]],@inventorylist_option_id2[[email protected]],@inventorylist_option_id3[[email protected]],@inventorylist_option_id4[[email protected]],@inventorylist_option_id5[[email protected]]; setarray [email protected],@inventorylist_option_value1[[email protected]],@inventorylist_option_value2[[email protected]],@inventorylist_option_value3[[email protected]],@inventorylist_option_value4[[email protected]],@inventorylist_option_value5[[email protected]]; setarray [email protected],@inventorylist_option_parameter1[[email protected]],@inventorylist_option_parameter2[[email protected]],@inventorylist_option_parameter3[[email protected]],@inventorylist_option_parameter4[[email protected]],@inventorylist_option_parameter5[[email protected]]; //get new equipment getitem3 @inventorylist_id[[email protected]],1,@inventorylist_identify[[email protected]],@inventorylist_refine[[email protected]],@inventorylist_attribute[[email protected]], [email protected][1],[email protected][2],[email protected][3],[email protected][4],[email protected],[email protected],[email protected]; for([email protected]=0;[email protected]<getarraysize([email protected]);[email protected]++){ if([email protected][[email protected]]){ getitem [email protected][[email protected]],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 [email protected]$[1], "Acessório (Direita)","Sapatos","Capa","Cabeça (Baixo)","Cabeça (Meio)","Cabeça (Topo)","Armadura","Mao Direita","Mao Esquerda","Visual","Visual","Visual"; set [email protected]$,""; for( set [email protected],1; [email protected] <= 10; set [email protected],[email protected]+1 ) { if( getequipisequiped([email protected]) ) set [email protected]$, [email protected]$ + [email protected]$[[email protected]] + " - " + "[" + getequipname([email protected]) + "]"; set [email protected]$, [email protected]$ + ":"; } set [email protected],select([email protected]$); mes "^00B2EE[Velha Sábia]^000000"; if(!getequipisequiped([email protected])) { mes "Meu jovem, equipe algo para que eu possa trabalhar. nao posso fazer nada por voce assim."; close; } set [email protected],getequipcardcnt([email protected]); if([email protected]) { mes "Meu jovem, nao há cartas equipadas neste ítem. nao posso trabalhar assim!"; close; } if ( !checkweight(1202,([email protected]+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 " + [email protected] + " 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(([email protected] = inarray(@inventorylist_equip,[email protected])) != -1){ if(getiteminfo(@inventorylist_card1[[email protected]],2) == 6){ [email protected][1] = 0; [email protected][1] = @inventorylist_card1[[email protected]]; }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[[email protected]],2) == 6){ [email protected][2] = 0; [email protected][2] = @inventorylist_card2[[email protected]]; }else [email protected][2] = @inventorylist_card2[[email protected]]; if(getiteminfo(@inventorylist_card3[[email protected]],2) == 6){ [email protected][3] = 0; [email protected][3] = @inventorylist_card3[[email protected]]; }else [email protected][3] = @inventorylist_card3[[email protected]]; if(getiteminfo(@inventorylist_card4[[email protected]],2) == 6){ [email protected][4] = 0; [email protected][4] = @inventorylist_card4[[email protected]]; }else [email protected][4] = @inventorylist_card4[[email protected]]; delequip [email protected];//delete the equipment //building the random options setarray [email protected],@inventorylist_option_id1[[email protected]],@inventorylist_option_id2[[email protected]],@inventorylist_option_id3[[email protected]],@inventorylist_option_id4[[email protected]],@inventorylist_option_id5[[email protected]]; setarray [email protected],@inventorylist_option_value1[[email protected]],@inventorylist_option_value2[[email protected]],@inventorylist_option_value3[[email protected]],@inventorylist_option_value4[[email protected]],@inventorylist_option_value5[[email protected]]; setarray [email protected],@inventorylist_option_parameter1[[email protected]],@inventorylist_option_parameter2[[email protected]],@inventorylist_option_parameter3[[email protected]],@inventorylist_option_parameter4[[email protected]],@inventorylist_option_parameter5[[email protected]]; //get new equipment getitem3 @inventorylist_id[[email protected]],1,@inventorylist_identify[[email protected]],@inventorylist_refine[[email protected]],@inventorylist_attribute[[email protected]], [email protected][1],[email protected][2],[email protected][3],[email protected][4],[email protected],[email protected],[email protected]; for([email protected]=0;[email protected]<getarraysize([email protected]);[email protected]++){ if([email protected][[email protected]]){ getitem [email protected][[email protected]],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(([email protected] = inarray(@inventorylist_equip,[email protected])) != -1){ if(getiteminfo(@inventorylist_card1[[email protected]],2) == 6){ [email protected][1] = 0; [email protected][1] = @inventorylist_card1[[email protected]]; }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[[email protected]],2) == 6){ [email protected][2] = 0; [email protected][2] = @inventorylist_card2[[email protected]]; }else [email protected][2] = @inventorylist_card2[[email protected]]; if(getiteminfo(@inventorylist_card3[[email protected]],2) == 6){ [email protected][3] = 0; [email protected][3] = @inventorylist_card3[[email protected]]; }else [email protected][3] = @inventorylist_card3[[email protected]]; if(getiteminfo(@inventorylist_card4[[email protected]],2) == 6){ [email protected][4] = 0; [email protected][4] = @inventorylist_card4[[email protected]]; }else [email protected][4] = @inventorylist_card4[[email protected]]; //card detected so we get the requirment first before we go on. set Zeny,Zeny - (200000+([email protected] * 25000)); delitem 1000,1; delitem 715,1; delequip [email protected];//delete the equipment //building the random options setarray [email protected],@inventorylist_option_id1[[email protected]],@inventorylist_option_id2[[email protected]],@inventorylist_option_id3[[email protected]],@inventorylist_option_id4[[email protected]],@inventorylist_option_id5[[email protected]]; setarray [email protected],@inventorylist_option_value1[[email protected]],@inventorylist_option_value2[[email protected]],@inventorylist_option_value3[[email protected]],@inventorylist_option_value4[[email protected]],@inventorylist_option_value5[[email protected]]; setarray [email protected],@inventorylist_option_parameter1[[email protected]],@inventorylist_option_parameter2[[email protected]],@inventorylist_option_parameter3[[email protected]],@inventorylist_option_parameter4[[email protected]],@inventorylist_option_parameter5[[email protected]]; //get new equipment getitem3 @inventorylist_id[[email protected]],1,@inventorylist_identify[[email protected]],@inventorylist_refine[[email protected]],@inventorylist_attribute[[email protected]], [email protected][1],[email protected][2],[email protected][3],[email protected][4],[email protected],[email protected],[email protected]; for([email protected]=0;[email protected]<getarraysize([email protected]);[email protected]++){ if([email protected][[email protected]] != 0){ getitem [email protected][[email protected]],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
  15. 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)
  16. https://github.com/rathena/rathena/wiki/Custom-Items https://github.com/rathena/rathena/blob/master/doc/item_db.txt
  17. 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, [email protected]$[] is a global temporary string array which contains all the names of these party members (only set when type is 0 or not specified) [email protected][] is a global temporary number array which contains the character id of these party members. (only set when type is 1) [email protected][] is a global temporary number array which contains the account id of these party members. (only set when type is 2) [email protected] 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 [email protected] 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. [email protected] 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 [email protected]***** // 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 [email protected]***** variables. [email protected] = [email protected]; copyarray [email protected]$[0], [email protected]$[0], [email protected]; // list the party member names for ([email protected] = 0; [email protected] < [email protected]; [email protected]++) mes ([email protected] +1) + ". ^0000FF" + [email protected]$[[email protected]] + "^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 ( [email protected] != .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 ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) if ( isloggedin( [email protected][[email protected]], [email protected][[email protected]] ) ) [email protected]_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 ( [email protected]_online != .register_num ) { mes "All your party members must be online to continue"; close; } // copy the array to prevent players cheating the system copyarray [email protected], [email protected], .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 ( [email protected] != .register_num ) { mes "You've made changes to your party !"; close; } for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) { if ( [email protected][[email protected]] != [email protected][[email protected]] ) { mes "You've made changes to your party !"; close; } } // Finally, it's safe to start the event! warpparty "event_map", 0,0, getcharid(1); ---------------------------------------
  18. you mean that you can't drag the icon to the hotkey bar ?
  19. you should get the homunculus S information from the renewal database (db/re/)
  20. you should follow the Pull Request , as it's not rAthena official update yet if you have any problem with the Pull Request it self , you are welcome to give your feedback on rAthena's Github
  21. https://github.com/rathena/rathena/blob/120ffc122bf8b0d36ba2a9b6f7ad62ac75e2513e/doc/script_commands.txt#L8930 --------------------------------------- *instance_mapname("<map name>"{,<instance id>}) Returns the unique name of the instanced map. If no instance ID is specified, the instance the script is attached to is used. If that fails, the command returns an empty string instead. ---------------------------------------
  22. it use v2 for the invisible , i don't know