bose Posted May 11, 2012 Posted May 11, 2012 nid help on how to make random item on this script prontera,155,181,5 script Freebies 2035,{ if(#dailytimer < gettimetick(2)) { mes "Here's your prize, you'll get another one after 24 hours."; getitem 7528,1; //remove <id> and add your own ids for item set #dailytimer,gettimetick(2) + 86400; //24 hours. close; } end; } Quote
Arcenciel Posted May 11, 2012 Posted May 11, 2012 Set an array with the IDs of the items you want and then use rand to generate a number to be used setarray .@var[0],1234,5678,8901; getitem .@var[rand(0,3)],1; Test the second line out. I haven't scripted in a while and not quite sure if rand will work inside. Quote
Arcenciel Posted May 12, 2012 Posted May 12, 2012 Lets say you have a pool of 10 different items which means 10 items = 10% chance for each one to appear. If you want to say increase item 1234's chances, you just have to use 2 of those 10 slots so now items 1234 has 20% of appearing compared to the rest. I haven't done a random item drawing with different chances for each item, so I'm not exactly sure how to do it either besides what I just mentioned. Quote
Question
bose
nid help on how to make random item on this script
prontera,155,181,5 script Freebies 2035,{
if(#dailytimer < gettimetick(2)) {
mes "Here's your prize, you'll get another one after 24 hours.";
getitem 7528,1; //remove <id> and add your own ids for item
set #dailytimer,gettimetick(2) + 86400; //24 hours.
close;
}
end;
}
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.