Jump to content

worn

Members
  • Posts

    40
  • Joined

  • Last visited

Posts posted by worn

  1. 6 minutos atrás, Rynbef disse:

    @desgastadoAqui, duas versões, a primeira com uma alteração e a segunda com uma depuração experimental estendida. Experimente o primeiro e depois o segundo.

    getItemByMapFunction v9.txt 4,51 kB  ·  0 downloads

     

    getItemByMapFunction v8 - Experimentell - Extended Debugging.txt 5,4 kB  ·  0 downloads

     

    Rynbef ~

     

     

    https://prnt.sc/25ncf98

    getItemByMapFunction v8 - Experimentell - Extended Debugging.txt5,4 kB · 0 downloads

    passa por discórdia 

  2. 40 minutes ago, Rynbef said:

    Pode ser parecido com:

        setarray . @ maps $ [0], "prontera", "prontera", "prontera";

        serarray . @ items [0], 501,4012,512;

        setarray . @ item _amounts [0], 100,1,5;

        setarray . @ item _chance [0], 1000,500,800;

     

    Mas o jogador receberá apenas um item. Se você definir os itens para 100%, ele obterá sempre o primeiro listado. É uma boa ideia mudar. Farei isso em breve se tudo funcionar ainda.

     

    Rynbef ~

     

    51 minutes ago, Rynbef said:

    Eu mudei uma declaração if. Espero que essa seja a solução final. Você pode adicionar o mesmo mapa quantas vezes quiser. 

      Revelar conteúdos ocultos
    /*
    rAthena Script
    Author: @Rynbef
    Create Date: 2021-19-12
    Last Updated: 2022-01-01
    
    Changelogs:
        2022-01-01:
            *changed OnNPCLoadEvent to OnNPCKillEvent
            *added check if killed enemie is player
            *removed space on callfunc after OnNPCKillEvent
            *fixed if statement syntax error
            *fixed if statement getarraysize of integer to getarraysize of specified getarg
            *removed callfunc OnInit
            *added console debugging can be disabled or enabled
            *changed variable types
            *fixed cant get item cause of wrong if statement
            *fixed for loop used array size instead random chance from argument getarg(3)
            *fixed player can't get item if random chance was equals to specified item chance
            *added argument amount to debug message
            *added map notification if player get lucky but not on a listed map. This can disabled or enabled seperat at OnInit below. Debugging needs to be enabled
            *added notification if everything works fine. Can be disabled or enabled on bottom of OnInit. Debugging needs to disabled
            #fixed wrong array output in for loop from getarg(0)[.i] to getelementofarray(getarg(0),.i)
            #changed .retval and .i vsriables to scope variables .@retval and .@i
    
    Feature planned:
        #Player get zeny if he get lucky
        #Player get zeny only if items disabled
        #Player get zeny or item if both enabled
    
    Description:
        Give a specified item getarg(1) of amount getarg(2) on specified map getarg(0) with a percentage of getarg(3) (0.1 to 100 percent) to a player
        
    IMPORTANT:
        All arrays needs to have the same sizes
        It's importent to set all 3 arguments to callfunc
    
    Terms:
        Dont name this as yours
        Dont sell this script
        Dont upload this script on download-/s section or share it otherwise for pay
        Modifications are included from this terms
        Otherwise feel free to edit
    
    Other:
        Don't hestiate to contact me at the forum as pm if u've any error,question,suggestion or want a modification
    
    Script:
    */
    
    -   script  GetItemByMap    -1,{
    
    OnNPCKillEvent:
        set .@retval,callfunc("F_GetItemByMap",.@maps$,.@items,.@item_amounts,.@item_chance);
        if(!.@debug)
            end;
        if(.@retval == 1)
            debugmes "[F_GetItemByMap]: Works fine! Player get item.";
        else if(.@retval == 2)
            debugmes "[F_GetItemByMap]: Works fine! Player is unlucky and get no item.";
        else if(.@retval == 3 && .@debugmap)
            debugmes "[F_GetItemByMap]: Player isn't on a listed map. Current map: "+strcharinfo(3);
        else if(.@retval == 4 && .@debugworking)
            debugmes "[F_GetItemByMap]: Everything works fine!";
        else
            debugmes "[F_GetItemByMap]: Causes in errors. Debug logs on top!";
        end;
    
    OnInit:
        setarray .@maps$[0],"prontera","alberta","izlude";
        serarray .@items[0],501,4012,512;
        setarray .@item_amounts[0],100,1,5;
        setarray .@item_chance[0],1000,500,800;//Chance begins by 0.1 percentage. 1 = 0.1 and 1000 = 100 percent
        set .@debug,1;//0 = disable debugging,1 = enable
        set .@debugmap,1;//0 = disable map notification,1 = enable
        set .@debugworking,1;//0 = disable notification if everything works fine,1 = enable
        end;
    }
    
    function    script    F_GetItemByMap    {
    
    if(getargcount() != 4 || getarraysize(getarg(0)) != getarraysize(getarg(1)) || getarraysize(getarg(0)) != getarraysize(getarg(2)) || getarraysize(getarg(0)) != getarraysize(getarg(3))){
        if(.@debug){
            debugmes "[F_GetItemByMap]: An error is occurupted";
            debugmes "[Function arguments]: Function arguments are empty or to short. Arguments: "+getargcount();
            debugmes "[Array sizes]: Maps:"+getarraysize(getarg(0))+" - Items:"+getarraysize(getarg(1))+" - Amounts:"+getarraysize(getarg(2))+" - Chances:"+getarraysize(getarg(3));
            debugmes "[Function arguments]: Maps:"+getarg(0)+" - Items:"+getarg(1)+" - Amounts:"+getarg(2)+" - Chances:"+getarg(3);
        }
        return 0;
    } else {
        for(.@i = 0; .@i<getarraysize(getarg(0)); .@i++){
            if(rand(1,1000) < getelementofarray(getarg(3),.@i))
                return 2;
            if(strcharinfo(3) == getelementofarray(getarg(0),.@i)){
                getitem getelementofarray(getarg(1),.@i),getelementofarray(getarg(2),.@i);
                return 1;
            } else {
                return 3;
            }
        }
        }
        return 4;
        
    OnInit:
        set .@debug,1;//0 = disable debugging,1 = enable
        end;
    }

    Download file below

    getItemByMapFunction v7.txt 4,33 kB · 1 download

     

    Rynbef ~

    Look, using the script, no error appears, but when killing monsters on the map, it still doesn't drop anything, nothing just happens,

  3. On 1/2/2022 at 9:37 AM, Rynbef said:

    Você ativou a depuração? O que o console depura?@desgastado

     

    Rynbef ~

    it doesn't show anything, the script in the debugger, it's just not dropping the item, and the drop is 100%

     

    On 1/2/2022 at 7:48 AM, sader1992 said:

    o que eu quis dizer são as outras variáveis também, se a variável é usada apenas dentro do npc, você deve usar a variável npc, também você pode ter problemas ao editar o npc e recarregar apenas esse npc porque $ @ é global

    a função retornará se alguma das chances falhar, (setarray $ @ item_chance [0], 1,1,1000;) [tente obter o terceiro item do terceiro mapa com esta chance]

    também não há necessidade da função se ela for chamada apenas uma vez.

    com outros erros no script, você pode verificar se testar o script (raramente testo meus scripts ao responder a uma postagem, então é xD compreensível)

     

    as mensagens de depuração são demais, mas essa é minha opinião

    com otimização este é o resultado

    
    

    este script otimizado não suporta a entrada do mesmo mapa duas vezes, você pode editá-lo para fazer isso se quiser

     

    if I want to repeat the map 2x to drop 2 different items how would it look?

  4. 3 minutes ago, Rynbef said:

    Eu editei alguns segundos atrás. Talvez funcione agora. Esqueci de adicionar todos os arrays ao callfunc.

     

    Atenciosamente,

    Rynbef ~

    well the script ran without errors, but the drop is not working

  5. 4 minutes ago, Rynbef said:

    @desgastadoLamento, mas não consigo testar o script porque estou apenas com o meu telemóvel. Se ainda não funcionar, desisto. Eu só quero ajudar.

      Revelar conteúdos ocultos
    
    
    
    
        
    
    
    
    
    
    
    
    
        

    Baixe o arquivo abaixo

     

     

    Rynbef ~

    ou helped a lot friend, a lot I know you can't test, but you created a base for the other to help me, I'm saying that I can't run your script, just the simplified @sader script

  6. Just now, Rynbef said:

    @sader1992I now understand what u mean. I've improved it now. The function is if someone whould call it another way.

    @worn

      Reveal hidden contents
    /*
    rAthena Script
    Author: @Rynbef
    Create Date: 2021-19-12
    Last Updated: 2022-01-01
    
    Changelogs:
        2022-01-01:
            *changed OnNPCLoadEvent to OnNPCKillEvent
            *added check if killed enemie is player
            *removed space on callfunc after OnNPCKillEvent
            *fixed if statement syntax error
            *fixed if statement getarraysize of integer to getarraysize of specified getarg
            *removed callfunc OnInit
            *added console debugging can be disabled or enabled
            *changed variable types
            *fixed cant get item cause of wrong if statement
            *fixed for loop used array size instead random chance from argument getarg(3)
            *fixed player can't get item if random chance was equals to specified item chance
            *added argument amount to debug message
            *added map notification if player get lucky but not on a listed map. This can disabled or enabled seperat at OnInit below. Debugging needs to be enabled
            *added notification if everything works fine. Can be disabled or enabled on bottom of OnInit. Debugging needs to disabled
            #fixed wrong array output in for loop from getarg(0)[.i] to getelementofarray(getarg(0),.i)
            #changed .retval and .i vsriables to scope variables .@retval and .@i
    
    Feature planned:
        #Player get zeny if he get lucky
        #Player get zeny only if items disabled
        #Player get zeny or item if both enabled
    
    Description:
        Give a specified item getarg(1) of amount getarg(2) on specified map getarg(0) with a percentage of getarg(3) (0.1 to 100 percent) to a player
        
    IMPORTANT:
        All arrays needs to have the same sizes
        It's importent to set all 3 arguments to callfunc
    
    Terms:
        Dont name this as yours
        Dont sell this script
        Dont upload this script on download-/s section or share it otherwise for pay
        Modifications are included from this terms
        Otherwise feel free to edit
    
    Other:
        Don't hestiate to contact me at the forum as pm if u've any error,question,suggestion or want a modification
    
    Script:
    */
    
    -   script  GetItemByMap    -1,{
    
    OnNPCKillEvent:
        if(killedrid >= 150000)
            end;
        set .@retval,callfunc("F_GetItemByMap",.@maps$,.@items,.@item_amounts);
        if(!.@debug)
            end;
        if(.@retval == 1)
            debugmes "[F_GetItemByMap]: Works fine! Player get item.";
        else if(.@retval == 2)
            debugmes "[F_GetItemByMap]: Works fine! Player is unlucky and get no item.";
        else if(.@retval == 3 && .@debugmap)
            debugmes "[F_GetItemByMap]: Player isn't on a listed map. Current map: "+strcharinfo(3);
        else if(.@retval == 4 && .@debugworking)
            debugmes "[F_GetItemByMap]: Everything works fine!";
        else
            debugmes "[F_GetItemByMap]: Causes in errors. Debug logs on top!";
        end;
    
    OnInit:
        setarray .@maps$[0],"prontera","alberta","izlude";
        serarray .@items[0],501,4012,512;
        setarray .@item_amounts[0],100,1,5;
        setarray .@item_chance[0],1000,500,800;//Chance begins by 0.1 percentage. 1 = 0.1 and 1000 = 100 percent
        set .@debug,1;//0 = disable debugging,1 = enable
        set .@debugmap,1;//0 = disable map notification,1 = enable
        set .@debugworking,1;//0 = disable notification if everything works fine,1 = enable
        end;
    }
    
    function    script    F_GetItemByMap    {
    
    if(!getarg(0) || !getarg(1) || !getarg(2) || !getarg(3) || getarraysize(getarg(0)) != getarraysize(getarg(1)) || getarraysize(getarg(0)) != getarraysize(getarg(2)) || getarraysize(getarg(0)) != getarraysize(getarg(3))){
        if(.@debug){
            debugmes "[F_GetItemByMap]: An error is occurupted";
            debugmes "[Function arguments]: Function arguments are empty or to short. Arguments: "+getargcount();
            debugmes "[Array sizes]: Maps:"+getarraysize(getarg(0))+" - Items:"+getarraysize(getarg(1))+" - Amounts:"+getarraysize(getarg(2))+" - Chances:"+getarraysize(getarg(3));
            debugmes "[Function arguments]: Maps:"+getarg(0)+" - Items:"+getarg(1)+" - Amounts:"+getarg(2)+" - Chances:"+getarg(3);
        }
        return 0;
    } else {
        for(.@i = 0; .@i<getarraysize(getarg(0)); .@i++){
            if(rand(1,1000) < getelementofarray(getarg(3),.@i))
                return 2;
            if(strcharinfo(3) == getelementofarray(getarg(0),.@i)){
                getitem getelementofarray(getarg(1),.@i),getelementofarray(getarg(2),.@i);
                return 1;
            } else {
                return 3;
            }
        }
        }
        return 4;
        
    OnInit:
        set .@debug,1;//0 = disable debugging,1 = enable
        end;
    }

    Download file below

    getItemByMapFunction v5.txt 4.39 kB · 0 downloads

     

    Rynbef~

    [Error]: script:op_1: argument is not a number (op=C_LNOT)
    [Debug]: Data: string value=""
    [Debug]: Source (NPC): GetItemByMap (invisible/not on a map)
    [Error]: script:op_1: argument is not a number (op=C_LNOT)
    [Debug]: Data: string value=""
    [Debug]: Source (NPC): GetItemByMap (invisible/not on a map)

  7. 31 minutes ago, sader1992 said:

    o que eu quis dizer são as outras variáveis também, se a variável é usada apenas dentro do npc, você deve usar a variável npc, também você pode ter problemas ao editar o npc e recarregar apenas esse npc porque $ @ é global

    a função retornará se alguma das chances falhar, (setarray $ @ item _chance [0], 1,1,1000;) [tente obter o terceiro item do terceiro mapa com esta chance]

    também não há necessidade da função se ela for chamada apenas uma vez.

    com outros erros no script, você pode verificar se testar o script (raramente testo meus scripts ao responder a uma postagem, então é xD compreensível)

     

    as mensagens de depuração são demais, mas essa é minha opinião

    com otimização este é o resultado

    
    
    

    este script otimizado não suporta a entrada do mesmo mapa duas vezes, você pode editá-lo para fazer isso se quiser

     

    Oops this one worked perfectly, can I add as many maps as I want? can you tell if in the future this could give a problem with normal monster drops?

     

  8. On 1/1/2022 at 9:41 AM, Rynbef said:

    Eu encontrei uma maneira de verificar as imagens. Eu atualizei hoje e adicionei um changelog. 

    NOTA: Você não precisa de loadevent. Agora você pode / deve removê-lo. 

    Só para dizer: escrevi este script com meu smartphone e, portanto, não há como testá-lo.

      Esconder o conteúdo
    
    
    
    
        
    
    
    
    
    
    
    
    

    Vou anexar um arquivo para download também

    getItemByMapFunction v2.txt 4,07 kB  ·  3 downloads

    Espero que isso te ajude e funcione bem agora.

     

    Rynbef ~

    agora deu isso

    https://prnt.sc/25lzasj

     

    On 12/31/2021 at 5:41 PM, Skorm said:

    @worn I think a more practical way to do this would be...

    https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L6663

    -	script	AllMobDrop	-1,{
    OnInit:
    	query_sql("SELECT `ID` FROM `mob_db_re` UNION SELECT `ID` FROM `mob_db2_re`;", .@mob_ids);
    	.@len = getarraysize(.@mob_ids);
    	for(.@a = 0; .@a < .@len; .@a++) {
    		addmonsterdrop .@mob_ids[.@a],501,100; //Red Potion at 1% drop. 
    	}
    	end;
    }

    or...
    https://github.com/rathena/rathena/blob/master/doc/item_bonus.txt#L465

    -	script	AllMobDrop	-1,{
    OnPCLoginEvent:
    	bonus_script "bonus2 bAddMonsterDropItem,501,100;",86400,8,0; //Red Potion at 1% drop for 24 hours.
    	end;
    }

     

    in this case it would be for all maps correct? I would like to put on some maps just not all

    example in pay_dun04 I want to drop x item on any monster that is killed on the map native monsters even on the map already in lhz I want another item to drop in all monsters on the map and so on with a percentage at the time of the drop, in addition to gaining the standard mob drops

  9. 14 hours ago, Rynbef said:

    I hope I can help u with my script I've written for u. It's a few time ago after I had an own server. The script isn't tested. 

    /*
    rAthena Script
    Author: @Rynbef
    Date: 2021-19-12
    
    Information:
        Dont forget to set "loadevent" mapflag for each map you will use this function
    
    Description:
        Give a specified item (getarg(1)) of amount getarg(2) on specified map getarg(0) with a percentage of getarg(3) (0.1 to 100 percent)
    
    Terms:
        Dont name this as yours
        Dont sell this script
        Dont upload this script on download-/s section
        Otherwise feel free to edit or contact me as pm
    
    Example:
    */
    -   script  GetItemByMap    -1,{
    
    OnNPCLoadEvent:
        set .retval,callfunc ("F_GetItemByMap",$#maps$,$#items,$#item_amounts);
        //You can debug if it causes error or not
        if(.retval == 1)
            debugmes "[F_GetItemByMap]: Works fine! Player get item.";
        else if(.retval == 2)
            debugmes "[F_GetItemByMap]: Works fine! Player is unlucky and get no item.";
        else
            debugmes "[F_GetItemByMap]: Causes in errors. Debug logs below!";
        end;
    
    OnInit:
        setarray $#maps$[0],"prontera","alberta","izlude";
        serarray $#items[0],501,4012,512;
        setarray $#item_amounts[0],100,1,5;
        setarray $#item_chance[0],1000,500,800;//Chance begins by 0.1 percentage. 1 = 0.1 and 1000 = 100 percent
        callfunc($#maps$,$#items,$#item_amounts,$#item_chance);
        end;
    }
    
    function    script    F_GetItemByMap    {
    
    if(((!getarg(0) || !getarg(1) || !getarg(2))) || ((getarraysize(getarg(0)) != getarraysize(getarg(1))) ||(getarraysize(getarg(0)) != getarraysize(2)) || (getarraysize(0)) != getarraysize(3))){
        debugmes "[F_GetItemByMap]: An error is occurupted";
        debugmes "[Function arguments]: Function arguments are empty or to short.";
        debugmes "[Array sizes]: Maps:"+getarraysize(getarg(0))+" - Items:"+getarraysize(getarg(1))+" - Amounts:"+getarraysize(getarg(2))+" - Chances:"+getarg(3);
        debugmes "[Function arguments]: Maps:"+getarg(0)+" - Items:"+getarg(1)+" - Amounts:"+getarg(2)+" - Chances:"+getarg(3);
        return 0;
    } else {
        for(.@i,0; getarraysize(getarg(0); .@i++){
            if(rand(1,1000) <= (getarraysize(getarg(3))-1)){
                debugmes "[F_GetItemByMap]: The player doesnt get item because hes an unlucky player";
                if(strcharinfo(3) == getarg(0)[.@i])
                    getitem getarg(1)[.@i],getarg(2)[.@i];
                return 1;
            }
            return 2;
          }
        }
    }
        set .retval,callfunc ("F_GetItemByMap",$#maps$,$#items,$#item_amounts);
        //You can debug if it causes error or not
        if(.retval == 1)
            debugmes "[F_GetItemByMap]: Works fine! Player get item."
        else if(.retval == 2)
            debugmes "[F_GetItemByMap]: Works fine! Player is unlucky and get no item."
        else
            debugmes "[F_GetItemByMap]: Causes in errors. Debug logs below!"
        end;
    
    OnInit:
        setarray $#maps$[0],"prontera","alberta","izlude";
        serarray $#items[0],501,4012,512;
        setarray $#item_amounts[0],100,1,5;
        setarray $#item_chance[0],1000,500,800;//Chance begins by 0.1 percentage. 1 = 0.1 and 1000 = 100 percent
        callfunc($#maps$,$#items,$#item_amounts,$#item_chance);
        end;
    }
    
    function    script    F_GetItemByMap    {
    
    if(((!getarg(0) || !getarg(1) || !getarg(2))) || ((getarraysize(getarg(0)) != getarraysize(getarg(1))) ||(getarraysize(getarg(0)) != getarraysize(2)) || (getarraysize(0)) != getarraysize(3))){
        debugmes "[F_Inarray]: Function arguments are empty or to short.";
        debugmes "[Array sizes]: Maps:"+getarraysize(getarg(0))+" - Items:"+getarraysize(getarg(1))+" - Amounts:"+getarraysize(getarg(2))+" - Chances:"+getarg(3);
        debugmes "[Function arrguments]: Maps:"+getarg(0)+" - Items:"+getarg(1)+" - Amounts:"+getarg(2)+" - Chances:"+getarg(3);
        return 0;
    } else {
        for(.@i,0; getarraysize(getarg(0); .@i++){
            if(rand(1,1000) <= (getarraysize(getarg(3))-1)){
                debugmes "[F_GetItemByMap]: The player doesnt get item because hes an unlucky player";
                if(strcharinfo(3) == getarg(0)[.@i])
                    getitem getarg(1)[.@i],getarg(2)[.@i];
                return 1;
            }
            return 2;
          }
        }
    }

     

    Rynbef~

    https://prnt.sc/255zzey

    gave error

    https://prnt.sc/25601yd

  10. Hey guys, I would like to know if there is a way to make all monsters drop a certain item with drop percentage, without putting it in drop one by one in mob_db I would also like to know if you can only put it on certain example maps lhz_dun03 all monsters from lhz drop this item and other maps do not

  11.  

    I am using hexed 2017 here with Kro plus I would like to know which hexed most updated to use it with the BRO, if I am not mistaken from certain hexed 2015 the use of KRO is required, have some hexed 2015 stable or superior that works with Bro in the Kro?

  12. Hello I was kind of outdated ragnarok and I want a lot of use rAthena eAmod emulator available on github

     

    https://github.com/zephyrus-cr/eamod

     

    as well I wanted to know about the patch see in Brazilian forums here in rathena people talking that needs to add patches to the emulator , could someone explain me what is this?

     

    How it works? is mandatory to add ?

     

    else I already used this emulator other times and he always gave the same bug appears negative status

     

    already posted here but no one managed to solve

     

    https://rathena.org/board/topic/104870-negative-status/

     

    I need to add some patch? someone uses this emulator and the same thing happens ?

    WNohsOh.pngn1oEHlT.pngn1oEHlT.png

  13. 5383,Hunting_Cap,Hunter's Cap,4,20,,250,,3,,1,0xFFFFFFFF,7,2,256,,1,1,389,{ if(BaseLevel=1) { bonus bMaxHP,1000; bonus bMaxSP,200; }  bonus bLuk,1; bonus2 bAddRace,RC_Brute,10; bonus2 bAddRace,RC_DemiHuman,5; bonus2 bAddRace,RC_Player,5; },{},{}

     

    Hmmm could only find this error. If you want to do a comparison you have to do == instead of =.

    more not only say this item, all other times of this bug that appears negative

  14. look is not only an item 1 or whatever (HUNTING HAT) Several items are with this problem, see for yourself the sinx image, it is using normal items without any change and this is occurring.

     

    olha não é só 1 um item ou seja o (CHAPÈU DE CAÇA) Vários itens estão com esse problema, veja você mesmo a imagem do sinx, ele está usando itens normais sem qualquer tipo de alteração e está ocorrendo isso.

  15. Does this still happen when they have nothing equipped? Any status changes?

     

     

     

     
    well looks'm just it normal when I use a device such hunting hat

    bem olha só estou com ele normal, quando eu uso um equipamento exemplo Chapéu de caça

     

    draSvql.png

    removo o equipamento, e depois coloco ele de novo

     

    remove the device, and then put it back

     

    Oq8N1RI.pngzwyKHlW.png

     

    dou @go e volta normal novamente

    dou @go normal and back again

×
×
  • Create New...