# Thread: [RUSE] Help Please

1. Can somebody please show me how to turn this into a 1/10 chance for a clue scroll?
I have no idea what I'm reading... lol

Code:
``````public static void clueDrop(Player player, int combat, Position pos) {
int chance = (6 + (combat / 4));
if (RandomUtility.getRandom(combat <= 80 ? 1300 : 1000) < chance) {
int clueId = CLUESBOY[Misc.getRandom(CLUESBOY.length - 1)];
GroundItemManager.spawnGroundItem(player, new GroundItem(new Item(clueId), pos, player.getUsername(), false, 150, true, 200));
player.getPacketSender().sendMessage("@[email protected] have received a Clue scroll!");
}
}``````
What does chance = 6 + combat/4 mean?

I just simply want it to be a 1/10 chance... just simple writing, no need for this shit lol  2. What does chance = 6 + combat/4 mean?

it literally means what it says the value of chance = 6 + (plus) the value of combat (divided) / 4.

public static void clueDrop(Player player, int combat, Position pos) {
int chance = Misc.random(10);
if (chance == 10 ) {
int clueId = CLUESBOY[Misc.getRandom(CLUESBOY.length - 1)];
GroundItemManager.spawnGroundItem(player, new GroundItem(new Item(clueId), pos, player.getUsername(), false, 150, true, 200));
player.getPacketSender().sendMessage("@[email protected] have received a Clue scroll!");
}
}

that should be 1:10 chance  3. Originally Posted by Wells Fargo What does chance = 6 + combat/4 mean?

it literally means what it says the value of chance = 6 + (plus) the value of combat (divided) / 4.

public static void clueDrop(Player player, int combat, Position pos) {
int chance = Misc.random(10);
if (chance == 10 ) {
int clueId = CLUESBOY[Misc.getRandom(CLUESBOY.length - 1)];
GroundItemManager.spawnGroundItem(player, new GroundItem(new Item(clueId), pos, player.getUsername(), false, 150, true, 200));
player.getPacketSender().sendMessage("@[email protected] have received a Clue scroll!");
}
}

that should be 1:10 chance
I've done that already & I've killed hundreds and not received a single one...

Also, what does this part mean?

Code:
``if (RandomUtility.getRandom(combat <= 80 ? 1300 : 1000) < chance) {``  4. Originally Posted by ServerNoob I've done that already & I've killed hundreds and not received a single one...

Also, what does this part mean?

Code:
``if (RandomUtility.getRandom(combat <= 80 ? 1300 : 1000) < chance) {``
If the value 'combat' is below or equal to 80 it set a value to 1300 otherwise 1000 and then if it is below the value 'chance' it return true.
I suggest you look up the basics and get a understanding from that   5. Originally Posted by arch337 If the value 'combat' is below or equal to 80 it set a value to 1300 otherwise 1000.
Code:
``````int chance = (6 + (combat / 4));
if (RandomUtility.getRandom(combat <= 80 ? 1300 : 1000) < chance) {``````

so, if I have
Code:
``````int chance = (100 + (combat / 2));
if (RandomUtility.getRandom(combat >= 50 ? 10 : 15) < chance) {``````
My chance of receiving said item will be 100 + combat level of monster divided by 2...
what the hell does this next line do?
Code:
``if (RandomUtility.getRandom(combat >= 50 ? 10 : 15) < chance) {``
Makes it so if the combat level of the monster killed is above 50 the rate of receiving said item will be out of 10, but if it's less than level 50 it will be 15? and then my <chance? what does all of this mean? lol
can't it be simplified so much?
This is crazy hahahha  6. Originally Posted by ServerNoob Code:
``````int chance = (6 + (combat / 4));
if (RandomUtility.getRandom(combat <= 80 ? 1300 : 1000) < chance) {``````

so, if I have
Code:
``````int chance = (100 + (combat / 2));
if (RandomUtility.getRandom(combat >= 50 ? 10 : 15) < chance) {``````
My chance of receiving said item will be 100 + combat level of monster divided by 2...
what the hell does this next line do?
Code:
``if (RandomUtility.getRandom(combat >= 50 ? 10 : 15) < chance) {``
Makes it so if the combat level of the monster killed is above 50 the rate of receiving said item will be out of 10, but if it's less than level 50 it will be 15? and then my <chance? what does all of this mean? lol
can't it be simplified so much?
This is crazy hahahha
I am just going to assume the getRandom is from 0 - whatever value you set. So in your case with 'combat >= 50 ? 10 : 15' it will go from 0 - 10 if the combat is equal or over 50 otherwise it will be 0 - 15.
And if then the chance you have set as variable to be lower than the chance, which in your case should be true all the time then it send whatever is below the if statement.

I do not understand however why you consistantly try ask about the code since it is not what you desire, so just remove it.
Also someone already gave you a sample code and that should work, as long as you send it upon death!  7. Originally Posted by ServerNoob I've done that already & I've killed hundreds and not received a single one...

Also, what does this part mean?

Code:
``if (RandomUtility.getRandom(combat <= 80 ? 1300 : 1000) < chance) {``
add a System.out.println("Chance: " + chance);

to see if you ever actually roll a 10 while killing.  Thread Information
##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

## User Tag List

 Posting Permissions
 You may not post new threads You may not post replies You may not post attachments You may not edit your posts   BB code is On Smilies are On [IMG] code is On [VIDEO] code is On HTML code is Off Trackbacks are Off Pingbacks are Off Refbacks are On Forum Rules