hello how can i add announce on specific item if get and make it have amount value?
function script boxrandom {
setarray .@reward, 607, 60,
612, 10,
611, 10,
608, 10,
678, 5,
675, 5;
set .@size, getarraysize( .@reward );
for( set .@i, 1; .@i < .@size; .@i += 2 ) {
.@percent[.@i] = .@total + .@reward[.@i];
.@total += .@reward[.@i];
}
.@r = rand( .@total +1 );
for( set .@i, 1; .@i < .@size; .@i += 2 )
if( .@percent[.@i] > .@r )
break;
getitem .@reward[ .@i-1 ], 1;
end;
}
how can i add also on what amount per item? example since 612 - id name and 10 is the chance. please help me to make it 612,1->amount,10->chance
Example i want the id number 678 if get to be announce" char name got 1x Poison bottle "
function script boxrandom {
setarray .@reward, 607, 60,
612, 10,
611, 10,
608, 10,
678, 5,
675, 5;
set .@size, getarraysize( .@reward );
for( set .@i, 1; .@i < .@size; .@i += 2 ) {
.@percent[.@i] = .@total + .@reward[.@i];
.@total += .@reward[.@i];
}
.@r = rand( .@total +1 );
for( set .@i, 1; .@i < .@size; .@i += 2 )
if( .@percent[.@i] > .@r )
break;
getitem .@reward[ .@i-1 ], 1;
end;
}
how can i add also on what amount per item? example since 612 - id name and 10 is the chance. please help me to make it 612,1->amount,10->chance
Example i want the id number 678 if get to be announce" char name got 1x Poison bottle "