![]() |
Probability - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Probability (/Thread-Probability) |
Probability - larmc20 - 12-22-2013 08:02 AM Hello Guys. I'd like to know how to add a probability for an iten to appear on a loot. For Example: I've got Balron Loot PHP Code: [TEMPLATE loot_BALRON] If I want to add an iten with 10% of chance to appear I know it making an spawn with 9 normal balrons and 1 with the iten. So in the game I make a respawn with this spawn spanwing one balron at time... Is there a Easier way to do that working on the loot script? RE: Probability - Crusader - 12-22-2013 08:35 AM ITEM=id_of_the_item,R90 // as far as i know should mean that 10% of time it will drop id_of_the_item RE: Probability - amonvangrell - 12-22-2013 08:43 AM You should read the tutorial it has what you are asking well explained. http://wiki.sphere.torfo.org/index.php/Chapter_1 Code: There are two types of random selectors: weighted random and ranged random. Weighted random makes a statement like this: "Ok, 1 out of 10 times pick Number A, 3 out of 10 times pick Number B, and 6 out of 10 times pick number C". Ranged random makes a statement like this: "Pick any number between the two numbers I give you". then Code: { random_food 1 0 3} - This tells SPHERE, "Ok, 1 out of four times, I want you to pick random_food, and 3 out of four times, I want you to pick zero." You can even have random sets within random sets. or Code: ITEM=i_sword_long,R11 - R11 means "one out of 11 chance of finding this item better read the tutorial. cya RE: Probability - larmc20 - 12-23-2013 01:12 AM Thank so much |