Jump to content

JohnyRox

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by JohnyRox

  1. Hi guys

     

    My emulator only understands this:

     

    set Zeny, Zeny - 1000;

     

    Now

     

    Zeny -= 1000;

    Zeny += 1000;

    Zeny = 1000;

     

    or

     

    .@qualquercoisa = 1000;

     

    He does not understand .

     

    Can anyone give me tips on how to add this feature or because it is not working , I'm scouring the script.c but it 's hard not to know where to start ?

     

     

    Função SET -

     

    rAthena Currently

    BUILDIN(__setr) {
        TBL_PC* sd = NULL;
        struct script_data* data;
        //struct script_data* datavalue;
        int64 num;
        const char* name;
        char prefix;
    
        data = script_getdata(st,2);
        //datavalue = script_getdata(st,3);
        if (!data_isreference(data) || reference_toconstant(data)) {
            ShowError("script:set: nao e uma variavel\n");
            script->reportdata(script_getdata(st,2));
            st->state = END;
            return false;
        }
    
        num = reference_getuid(data);
        name = reference_getname(data);
        prefix = *name;
    
        if (not_server_variable(prefix)) {
            sd = script->rid2sd(st);
            if (sd == NULL) {
                ShowError("script:set: nao existe jogador anexado para a variavel '%s'\n", name);
                return true;
            }
        }
    
    #if 0
        // TODO: see de43fa0f73be01080bd11c08adbfb7c158324c81
        if (data_isreference(datavalue)) {
            // the value being referenced is a variable
            const char* namevalue = reference_getname(datavalue);
    
            if (!not_array_variable(*namevalue)) {
                // array variable being copied into another array variable
                if (sd == NULL && not_server_variable(*namevalue) && (sd = script->rid2sd(st)) == NULL) {
                    // player must be attached in order to copy a player variable
                    ShowError("script:set: nao existe jogador anexado para a variavel '%s'\n", namevalue);
                    return true;
                }
    
                if (is_string_variable(namevalue) != is_string_variable(name)) {
                    // non-matching array value types
                    ShowWarning("script:set: duas variaveis arrays nao coicidem o mesmo tipo.\n");
                    return true;
                }
    
                // push the maximum number of array values to the stack
                script->push_val(st->stack, C_INT, SCRIPT_MAX_ARRAYSIZE,NULL);
    
                // call the copy array method directly
                return buildin_copyarray(st);
            }
        }
    #endif
    
        if (script_hasdata(st, 4)) {
            // Optional argument used by post-increment/post-decrement constructs to return the previous value
            if (is_string_variable(name)) {
                script_pushstrcopy(st, script_getstr(st, 4));
            } else {
                script_pushint(st, script_getnum(st, 4));
            }
        } else {
            // return a copy of the variable reference
            script_pushcopy(st,2);
        }
    
        if (is_string_variable(name))
            script->set_reg(st,sd,num,name,(void*)script_getstr(st,3),script_getref(st,2));
        else
            script->set_reg(st,sd,num,name,(void*)h64BPTRSIZE(script_getnum(st,3)),script_getref(st,2));
    
        return true;
    }
    
    
    
    

    My old rAthena.

    BUILDIN_FUNC(set)
    {
        TBL_PC* sd = NULL;
        struct script_data* data;
        int num;
        const char* name;
        char prefix;
    
        data = script_getdata(st,2);
        if( !data_isreference(data) )
        {
            ShowError("script:set: not a variable\n");
            script_reportdata(script_getdata(st,2));
            st->state = END;
            return 1;
        }
    
        num = reference_getuid(data);
        name = reference_getname(data);
        prefix = *name;
    
        if( not_server_variable(prefix) )
        {
            sd = script_rid2sd(st);
            if( sd == NULL )
            {
                ShowError("script:set: no player attached for player variable '%s'\n", name);
                return 0;
            }
        }
    
        if( is_string_variable(name) )
            set_reg(st,sd,num,name,(void*)script_getstr(st,3),script_getref(st,2));
        else
            set_reg(st,sd,num,name,(void*)script_getnum(st,3),script_getref(st,2));
    
        // return a copy of the variable reference
        script_pushcopy(st,2);
    
        return 0;
    }
    

     Ai eu tentei trocar toda função set pela setr, trocando em todos outros arquivos utilizavam ela

  2. Hi, i want to make next thing.

     

    As we all know we have at db/pre or re/skill_require_db.txt

    With next structure:

     

     

     

    SkillID,HPCost,MaxHPTrigger,SPCost,HPRateCost,SPRateCost,ZenyCost,RequiredWeapons,RequiredAmmoTypes,RequiredAmmoAmount,RequiredState,RequiredStatuses,SpiritSphereCost,RequiredItemID1,RequiredItemAmount1,RequiredItemID2,RequiredItemAmount2,RequiredItemID3,RequiredItemAmount3,RequiredItemID4,RequiredItemAmount4,RequiredItemID5,RequiredItemAmount5,RequiredItemID6,RequiredItemAmount6,RequiredItemID7,RequiredItemAmount7,RequiredItemID8,RequiredItemAmount8,RequiredItemID9,RequiredItemAmount9,RequiredItemID10,RequiredItemAmount10,RequiredEquipment

     

    I need to modify that to:

     

    SkillID,HPCost,MaxHPTrigger,SPCost,HPRateCost,SPRateCost,ZenyCost,RequiredWeapons,RequiredAmmoTypes,RequiredAmmoAmount,RequiredState,RequiredStatuses,SpiritSphereCost,RequiredItemID1:ORRequiredItemID1:ORRequiredItemID1,RequiredItemAmount1,RequiredItemID2,RequiredItemAmount2,RequiredItemID3,RequiredItemAmount3,RequiredItemID4,RequiredItemAmount4,RequiredItemID5,RequiredItemAmount5,RequiredItemID6,RequiredItemAmount6,RequiredItemID7,RequiredItemAmount7,RequiredItemID8,RequiredItemAmount8,RequiredItemID9,RequiredItemAmount9,RequiredItemID10,RequiredItemAmount10,RequiredEquipment

    EDIT: (code block do not modify text in block....)

     

    Original:

     

    RequiredItemID1,RequiredItemAmount1 

     

    I want to:

     

    RequiredItemID1 : ORRequiredItemID1 : ORRequiredItemID1,RequiredItemAmount1 

    If player don't have item in inventory -> player can use ANOTHER item for requirement after ":".

     

     

    EXAMPLES

     

    I need to modify sources & that db to next prototype:

     

    Original:

     

     

    289,0,0,1,0,0,0,99,0,0,none,0,0,715,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //SA_DISPELL

     

    Modified:

     

     

    289,0,0,1,0,0,0,99,0,0,none,0,0,715:505:506,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0     //SA_DISPELL

     

    What i want to get by this edit:

     

    1. IF player have itemID 715 (yellow gemstone) -> he can use spell and that item will be removed (like by default)
    2. IF player DON'T have itemID 715 map-server will be looking for player inventory for next value after ":", the next value in this example 505. So, if player Don't have 715, but have 505 -> the skill will require this item for skill.
    3. IF player don't have 715 or 505 in inventory -> server will looking for next item_id after ":", the next item is 506. So if player don't have 715 or 505 item in inventory (order is important) the skill will require and use 506 item id.
    4. IF player don't have any item of that list (715, 505, 506) in inventory -> skill will fail.
    5. Requirement Amount (715:505:506,1) is the same for all of this items.

     

     

    In few words:

    I want to make alternative require_db for spell in txt file which is divided by ":" (like weapon's (Spiral Pierce in renewal (it's required OR Spear or Sword))

  3. Acho que esse tópico seria encaixado melhor em Edições na Source, mas não consigo abrir um novo tópico naquela sessão.

     

     

    skill_require_db.txt (Original)

    479,0,0,40,0,0,0,99,0,0,none,0,7139,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0    //CR_FULLPROTECTION##

    Funciona perfeito e requer o item ID: 7139

    {
        Id: 7139
        AegisName: "Coating_Bottle"
        Name: "Frasco de Revestimento"
        Type: 3
        Buy: 200
        Weight: 10
    },


    Beleza... eu criei o item ID: 20509 e 20510 (Frasco BG/WOE)

    {
        Id: 20509
        AegisName: "BG_Coating_Bottle"
        Name: "BG Frasco de Revestimento"
        Type: 3
        Buy: 0
        Weight: 1
        Trade: {
            override: 99
            nodrop: true
            notrade: true
            partneroverride: true
            noselltonpc: true
            nocart: true
            nostorage: false
            nogstorage: true
            nomail: true
            noauction: true
        }
    },

    skill_require_db.txt (Editado) funciona perfeito, só que teria como ao invez de colocar o requerimento E, colocar OU aqui no skill_require_db.txt ?

    479,0,0,40,0,0,0,99,0,0,none,0,20509,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0    //CR_FULLPROTECTION##

    Pois se coloco dessa forma ele pede os dois itens e não um dos dois, em vez de ser E ser OU resolve meu problema porque o resto eu faço bloqueio com mapflags

    479,0,0,40,0,0,0,99,0,0,none,0,7139,1,20509,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0    //CR_FULLPROTECTION##


    Tentei ver alguma coisa na source, ve ai meus prints, procurei pela skill/id do item mas não achei nada relacionado ao item que será usado na skill em questão, achei algumas coisas relacionado a remoção, criação de poção, mas nada que requer o item para uso da skill.

    EStw9KV.png

    1cFtmGV.png

    Qualquer exemplo que me arrumarem(eu uso o Cronus Atual mas pode ser exemplo de qualquer emulador opensource) de qualquer skill que requer um item eu agradeço e me viro aqui para ajustar (pq esse é um exemplo, vou precisar dos outros itens tipo: Garrafa de Veneno e os outros Frascos do Alquemista)!

    OBS: não resolve em nada você tentar me ajudar falando para colocar um script no item custom e deixa-lo "usavel" com a skill em questão, isso eu sei fazer e não é isso que quero.

    Valeu galera.

  4. Ou vLw ! mesmo funcionou, pegando o embalo aqui você consegue identificar pq meu item não deleta?

    {
    	Id: 11553
    	AegisName: "Turmalina_Paraiba"
    	Name: "Turmalina Paraíba"
    	Type: 11
    	Trade:{
    		override: 99
    		nodrop: true
    		notrade: true
    		partneroverride: true
    		noselltonpc: true
    		nocart: true
    		nostorage: true
    		nogstorage: true
    		nomail: true
    		noauction: true
    	}
    	Buy: 300
    	Weight: 0
    	View: 1336
    	Script: <"	
    	query_sql "SELECT `Vip` FROM `login` WHERE `account_id`='"+getcharid(3)+"'",@Vip;	
    	if(@Vip<=0){delitem 11553,1,getcharid(3);}else{warp "vip",65,45;};	
    	">
    },
    
  5. Pessoal, boa tarde.

     

    Estou com a seguinte dificuldade preciso bloquear certos id's de itens para não poder ser dropavel ou negociavel. Sendo assim, alguem sabe como fazer?

    lembrando que meu emulador e mais novo é só possui os arquivos item_db.conf e item_group.conf.

    {
    	Id: 11552
    	AegisName: "Tick_Vip"
    	Name: "Tick Vip"
    	Type: 0
    	Buy: 1000
    	Weight: 0
    	View: 1335
    	Script: <"callfunc("AddVipTick",getcharid(3),1,1);">
    },
    
    

    Deve ficar assim .:

    Type..

    Trade:{

    xxx : true

    xxx : false

    yyy: true

    www: false

    }

     

    Porém, não sei esses comandos , ou syntax pra fazer no arquivo item_group.conf .

    Vlw pessoal !

×
×
  • Create New...