viewing paste Unknown #11030 | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
    for( .@i = 0; .@i < .item_id_size; .@i++ ){
        mes .item_amount[.@i]+" x "+getitemname( .item_id[.@i] );
        if( countitem( .item_id[.@i] ) < .item_amount[.@i] )
            .@failed = 1;
    }
    if( !.@failed ){
        mes "Please wait...";
        progressbar "FFFFFF",10;
        for( .@i = 0; .@i < .item_id_size; .@i++ )
            delitem .item_id[.@i],.item_amount[.@i];
        if( rand( 100 ) < .craft_rate ){
            mes "Gained 1 items.";
            callfunc "valkyrie_armor";
        }else{
            mes "Failed";
        }
    }
    close;
OnInit:
    // craft settings
    .craft_rate = 50;
    setarray .item_id,30005;
    setarray .item_amount,10;
    .item_id_size = getarraysize( .item_id );
    end;
}
function script valkyrie_armor {
    getinventorylist;
    for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) {
        if ( @inventorylist_id[.@i] == 2357 ) {
            delitem2 @inventorylist_id[.@i], 1, @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i];
            getitem2 30101 + @inventorylist_refine[.@i], 1, 1, 0, 0, @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i];
            end;
        }
    }
    dispbottom "You don't have "+ getitemname(2357) +" in your inventory";
    end;
}
function script get_valkyrie_armor {
    getitem2 2357, 1, 1, getarg(1), 0, @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i];
}
Viewed 600 times, submitted by leloush.