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];
}