// item_db.txt
// ..... { callfunc( "item_announce",<amount> ); },{},{}
- script item_announce {
set .@amount,getarg(0);
if( .@amount ){
setarray .@itemlist,501,502,503,504;
setarray .@amount,1,2,3,4;
setarray .@rate,10,20,40,50;
set .@itemlist_size,getarraysize( .@itemlist );
do{
set .@random_rate,rand( 100 );
set .@random,rand( .@itemlist_size );
}while( .@random_rate > .@rate[.@random] );
getitem .@itemlist[.@random],.@amount[.@random];
announce strcharinfo(0)+" gained "+.@amount[.@random]+"x "+getitemname( .@itemlist[.@random] )+" - ( "+.@rate[.@random]+"%)",bc_all;
}
return;
}