Jump to content
  • 0
IsabelaFernandez

enchantment script to require item in place of zeny.

Question

hi partners.
I would like this script instead of needing zeny to require items in this case the item ID 7420 (skull) in order to be enchanting.

Spoiler

prontera,161,173,3    script    Encantador    933,{
mes "eu posso encantar "+getitemname( .faw_itemid );
mes " ";
if( getequipid( EQI_GARMENT ) == .faw_itemid ){

    [email protected] = getequiprefinerycnt( EQI_GARMENT );
    for( [email protected] = 0; [email protected] < 4; [email protected]++ )
        [email protected][[email protected]] = getequipcardid( EQI_GARMENT,[email protected] );
        
    switch( select( "Encantar o item.","Resetar encantamentos." ) ){
        case 1:
            mes "Escolha um slot para encantar.";
            mes "Você pode encantar mais slots quando tiver um refinamento superior.";
            [email protected] = select(
                ( .[email protected][1] || [email protected] < 7 )?"":"Enchant Slot 1",
                ( [email protected][2] || [email protected] < 8 )?"":"Enchant Slot 2",
                ( [email protected][3] || [email protected] < 9 )?"":"Enchant Slot 3",
                "Cancel"
            );
            if( [email protected] < 4 ){
                mes "Pick Enchant Type";
                [email protected] = select( .enchant_type_menu$ ) - 1;
                [email protected] = .enchant_list_size[[email protected]];
                if( [email protected] ){
                    copyarray [email protected]_list[0],getd( ".enchant_list_"+( [email protected]+1 )+"[0]" ),[email protected];
                    if( [email protected] >= 9 ){
                        [email protected]_list[[email protected]] = .special_enchant[[email protected]];
                        [email protected]++;
                    }
                    delequip EQI_GARMENT;
                    if( rand( 100 ) < .success_rate ){
                        setd( "[email protected]["[email protected]+"]" ),[email protected]_list[ rand( [email protected] ) ];
                        mes "Pronto, item encantado com sucesso.";
                        getitem2 .faw_itemid,1,1,[email protected],0,[email protected][0],[email protected][1],[email protected][2],[email protected][3];
                        equip .faw_itemid;
                    }else{
                        mes "Que pena, não conseguimos encantar o item.";
                    }
                }
            }
            break;
        case 2:
            mes "Você precisa "+.enchant_reset_Zeny+" Zeny.";
            if( Zeny >= .enchant_reset_Zeny ){
                if( select( "Confirmar para resetar todos os encantamentos?","Cancelar" ) == 1 ){
                    if( [email protected][1] && [email protected][2] && [email protected][3] ){
                        mes "Seu item não tem nenhum item encantado.";
                    }else{
                        Zeny -= .enchant_reset_Zeny;
                        delequip EQI_GARMENT;
                        getitem2 .faw_itemid,1,1,[email protected],0,[email protected][0],0,0,0;
                        equip .faw_itemid;
                        mes "Concluído removido todos os itens encantados.";
                    }
                }
            }
        default: break;
    }
    
}else{
    mes "Certifique-se de estar equipado com "+getitemname( .faw_itemid );
}
close;


OnInit:
// FAW item id
.faw_itemid = 2589;

// enchant success rate
.success_rate = 100;

// enchant reset cost
.enchant_reset_Zeny = 1000000;

// enchant type category
setarray .enchant_type$,"Espírito do Lutador","Pedra Mágica","Mira Apurada","Crítico","MaxHP","MaxSP","ASPD","STR","AGI","DEX","VIT","INT","LUK";

// enchant list ( Fighting Spirit )
setarray .enchant_list_1,4810,4809,4808;
// enchant list ( Magic )
setarray .enchant_list_2,4812,4827,4826;
// enchant list ( Archer )
setarray .enchant_list_3,4832,4833,4834;
// enchant list ( Critical )
setarray .enchant_list_4,4764,4765;
// enchant list ( Max HP )
setarray .enchant_list_5,4797,4798,4799;
// enchant list ( Max SP )
setarray .enchant_list_6,4870,4800,4801;
// enchant list ( ASPD )
setarray .enchant_list_7,4807,4842;
// enchant list ( STR )
setarray .enchant_list_8,4702,4703,4704;
// enchant list ( AGI )
setarray .enchant_list_9,4732,4733,4734;
// enchant list ( DEX )
setarray .enchant_list_10,4722,4723,4724;
// enchant list ( VIT )
setarray .enchant_list_11,4742,4743,4744;
// enchant list ( INT )
setarray .enchant_list_12,4712,4713,4714;
// enchant list ( LUK )
setarray .enchant_list_13,4752,4753,4754;

// extra 1 special enchant for 3rd slot if refine above 9 ( follow by category sequences )
//setarray .special_enchant,4821,4828,4835,4765,4868,4801,4807,4853,4854,4857,4855,4856,4858;


.enchant_type_size = getarraysize( .enchant_type$ );
for( [email protected] = 0; [email protected] < .enchant_type_size; [email protected]++ ){
    .enchant_list_size[[email protected]] = getarraysize( getd( ".enchant_list_"+( [email protected]+1 ) ) );
    if( !.enchant_list_size[[email protected]] ){
        .enchant_type$[[email protected]] = "";
    }
    else{
        .enchant_type_menu$ = .enchant_type_menu$ + .enchant_type$[[email protected]];
    }
    .enchant_type_menu$ = .enchant_type_menu$ + ":";
}
end;
}

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
7 minutes ago, IsabelaFernandez said:

hi partners.
I would like this script instead of needing zeny to require items in this case the item ID 7420 (skull) in order to be enchanting.

  Hide contents

prontera,161,173,3    script    Encantador    933,{
mes "eu posso encantar "+getitemname( .faw_itemid );
mes " ";
if( getequipid( EQI_GARMENT ) == .faw_itemid ){

    [email protected] = getequiprefinerycnt( EQI_GARMENT );
    for( [email protected] = 0; [email protected] < 4; [email protected]++ )
        [email protected][[email protected]] = getequipcardid( EQI_GARMENT,[email protected] );
        
    switch( select( "Encantar o item.","Resetar encantamentos." ) ){
        case 1:
            mes "Escolha um slot para encantar.";
            mes "Você pode encantar mais slots quando tiver um refinamento superior.";
            [email protected] = select(
                ( [email protected][1] || [email protected] < 7 )?"":"Enchant Slot 1",
                ( [email protected][2] || [email protected] < 8 )?"":"Enchant Slot 2",
                ( [email protected][3] || [email protected] < 9 )?"":"Enchant Slot 3",
                "Cancel"
            );
            if( [email protected] < 4 ){
                mes "Pick Enchant Type";
                [email protected] = select( .enchant_type_menu$ ) - 1;
                [email protected] = .enchant_list_size[[email protected]];
                if( [email protected] ){
                    copyarray [email protected]_list[0],getd( ".enchant_list_"+( [email protected]+1 )+"[0]" ),[email protected];
                    if( [email protected] >= 9 ){
                        [email protected]_list[[email protected]] = .special_enchant[[email protected]];
                        [email protected]++;
                    }
                    delequip EQI_GARMENT;
                    if( rand( 100 ) < .success_rate ){
                        setd( "[email protected]["[email protected]+"]" ),[email protected]_list[ rand( [email protected] ) ];
                        mes "Pronto, item encantado com sucesso.";
                        getitem2 .faw_itemid,1,1,[email protected],0,[email protected][0],[email protected][1],[email protected][2],[email protected][3];
                        equip .faw_itemid;
                    }else{
                        mes "Que pena, não conseguimos encantar o item.";
                    }
                }
            }
            break;
        case 2:
            mes "Você precisa "+.enchant_reset_Zeny+" Zeny.";
            if( Zeny >= .enchant_reset_Zeny ){
                if( select( "Confirmar para resetar todos os encantamentos?","Cancelar" ) == 1 ){
                    if( [email protected][1] && [email protected][2] && [email protected][3] ){
                        mes "Seu item não tem nenhum item encantado.";
                    }else{
                        Zeny -= .enchant_reset_Zeny;
                        delequip EQI_GARMENT;
                        getitem2 .faw_itemid,1,1,[email protected],0,[email protected][0],0,0,0;
                        equip .faw_itemid;
                        mes "Concluído removido todos os itens encantados.";
                    }
                }
            }
        default: break;
    }
    
}else{
    mes "Certifique-se de estar equipado com "+getitemname( .faw_itemid );
}
close;


OnInit:
// FAW item id
.faw_itemid = 2589;

// enchant success rate
.success_rate = 100;

// enchant reset cost
.enchant_reset_Zeny = 1000000;

// enchant type category
setarray .enchant_type$,"Espírito do Lutador","Pedra Mágica","Mira Apurada","Crítico","MaxHP","MaxSP","ASPD","STR","AGI","DEX","VIT","INT","LUK";

// enchant list ( Fighting Spirit )
setarray .enchant_list_1,4810,4809,4808;
// enchant list ( Magic )
setarray .enchant_list_2,4812,4827,4826;
// enchant list ( Archer )
setarray .enchant_list_3,4832,4833,4834;
// enchant list ( Critical )
setarray .enchant_list_4,4764,4765;
// enchant list ( Max HP )
setarray .enchant_list_5,4797,4798,4799;
// enchant list ( Max SP )
setarray .enchant_list_6,4870,4800,4801;
// enchant list ( ASPD )
setarray .enchant_list_7,4807,4842;
// enchant list ( STR )
setarray .enchant_list_8,4702,4703,4704;
// enchant list ( AGI )
setarray .enchant_list_9,4732,4733,4734;
// enchant list ( DEX )
setarray .enchant_list_10,4722,4723,4724;
// enchant list ( VIT )
setarray .enchant_list_11,4742,4743,4744;
// enchant list ( INT )
setarray .enchant_list_12,4712,4713,4714;
// enchant list ( LUK )
setarray .enchant_list_13,4752,4753,4754;

// extra 1 special enchant for 3rd slot if refine above 9 ( follow by category sequences )
//setarray .special_enchant,4821,4828,4835,4765,4868,4801,4807,4853,4854,4857,4855,4856,4858;


.enchant_type_size = getarraysize( .enchant_type$ );
for( [email protected] = 0; [email protected] < .enchant_type_size; [email protected]++ ){
    .enchant_list_size[[email protected]] = getarraysize( getd( ".enchant_list_"+( [email protected]+1 ) ) );
    if( !.enchant_list_size[[email protected]] ){
        .enchant_type$[[email protected]] = "";
    }
    else{
        .enchant_type_menu$ = .enchant_type_menu$ + .enchant_type$[[email protected]];
    }
    .enchant_type_menu$ = .enchant_type_menu$ + ":";
}
end;
}

 

prontera,161,173,3    script    Encantador    933,{
mes "eu posso encantar "+getitemname( .faw_itemid );
mes " ";
if( getequipid( EQI_GARMENT ) == .faw_itemid ){

    [email protected] = getequiprefinerycnt( EQI_GARMENT );
    for( [email protected] = 0; [email protected] < 4; [email protected]++ )
        [email protected][[email protected]] = getequipcardid( EQI_GARMENT,[email protected] );
        
    switch( select( "Encantar o item.","Resetar encantamentos." ) ){
        case 1:
            mes "Escolha um slot para encantar.";
            mes "Você pode encantar mais slots quando tiver um refinamento superior.";
            [email protected] = select(
                ( [email protected][1] || [email protected] < 7 )?"":"Enchant Slot 1",
                ( [email protected][2] || [email protected] < 8 )?"":"Enchant Slot 2",
                ( [email protected][3] || [email protected] < 9 )?"":"Enchant Slot 3",
                "Cancel"
            );
            if( [email protected] < 4 ){
                mes "Pick Enchant Type";
                [email protected] = select( .enchant_type_menu$ ) - 1;
                [email protected] = .enchant_list_size[[email protected]];
                if( [email protected] ){
                    copyarray [email protected]_list[0],getd( ".enchant_list_"+( [email protected]+1 )+"[0]" ),[email protected];
                    if( [email protected] >= 9 ){
                        [email protected]_list[[email protected]] = .special_enchant[[email protected]];
                        [email protected]++;
                    }
                    delequip EQI_GARMENT;
                    if( rand( 100 ) < .success_rate ){
                        setd( "[email protected]["[email protected]+"]" ),[email protected]_list[ rand( [email protected] ) ];
                        mes "Pronto, item encantado com sucesso.";
                        getitem2 .faw_itemid,1,1,[email protected],0,[email protected][0],[email protected][1],[email protected][2],[email protected][3];
                        equip .faw_itemid;
                    }else{
                        mes "Que pena, não conseguimos encantar o item.";
                    }
                }
            }
            break;
        case 2:
            mes "Você precisa "+.enchant_reset_skull+" Skulls.";
            if(countitem(7420) >= .enchant_reset_skull) {
                if( select( "Confirmar para resetar todos os encantamentos?","Cancelar" ) == 1 ){
                    if( [email protected][1] && [email protected][2] && [email protected][3] ){
                        mes "Seu item não tem nenhum item encantado.";
                    }else{
              			getitem 7420, .enchant_reset_skull;
                        delequip EQI_GARMENT;
                        getitem2 .faw_itemid,1,1,[email protected],0,[email protected][0],0,0,0;
                        equip .faw_itemid;
                        mes "Concluído removido todos os itens encantados.";
                    }
                }
            }
        default: break;
    }
    
}else{
    mes "Certifique-se de estar equipado com "+getitemname( .faw_itemid );
}
close;


OnInit:
// FAW item id
.faw_itemid = 2589;

// enchant success rate
.success_rate = 100;

// enchant reset cost
.enchant_reset_Zeny = 1000000;
              
// enchant reset cost (skull)
.enchant_reset_skull = 10;              

// enchant type category
setarray .enchant_type$,"Espírito do Lutador","Pedra Mágica","Mira Apurada","Crítico","MaxHP","MaxSP","ASPD","STR","AGI","DEX","VIT","INT","LUK";

// enchant list ( Fighting Spirit )
setarray .enchant_list_1,4810,4809,4808;
// enchant list ( Magic )
setarray .enchant_list_2,4812,4827,4826;
// enchant list ( Archer )
setarray .enchant_list_3,4832,4833,4834;
// enchant list ( Critical )
setarray .enchant_list_4,4764,4765;
// enchant list ( Max HP )
setarray .enchant_list_5,4797,4798,4799;
// enchant list ( Max SP )
setarray .enchant_list_6,4870,4800,4801;
// enchant list ( ASPD )
setarray .enchant_list_7,4807,4842;
// enchant list ( STR )
setarray .enchant_list_8,4702,4703,4704;
// enchant list ( AGI )
setarray .enchant_list_9,4732,4733,4734;
// enchant list ( DEX )
setarray .enchant_list_10,4722,4723,4724;
// enchant list ( VIT )
setarray .enchant_list_11,4742,4743,4744;
// enchant list ( INT )
setarray .enchant_list_12,4712,4713,4714;
// enchant list ( LUK )
setarray .enchant_list_13,4752,4753,4754;

// extra 1 special enchant for 3rd slot if refine above 9 ( follow by category sequences )
//setarray .special_enchant,4821,4828,4835,4765,4868,4801,4807,4853,4854,4857,4855,4856,4858;


.enchant_type_size = getarraysize( .enchant_type$ );
for( [email protected] = 0; [email protected] < .enchant_type_size; [email protected]++ ){
    .enchant_list_size[[email protected]] = getarraysize( getd( ".enchant_list_"+( [email protected]+1 ) ) );
    if( !.enchant_list_size[[email protected]] ){
        .enchant_type$[[email protected]] = "";
    }
    else{
        .enchant_type_menu$ = .enchant_type_menu$ + .enchant_type$[[email protected]];
    }
    .enchant_type_menu$ = .enchant_type_menu$ + ":";
}
end;
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

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