Thread: [RUSE] Help Please

Results 1 to 7 of 7
  1. #1 [RUSE] Help Please 
    Registered Member
    Join Date
    Apr 2020
    Posts
    10
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    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
    Reply With Quote  
     

  2. #2  
    → 1StopServiceShop ←

    Wells Fargo's Avatar
    Join Date
    May 2016
    Age
    52
    Posts
    1,108
    Thanks given
    543
    Thanks received
    554
    Rep Power
    5000
    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
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Apr 2020
    Posts
    10
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Wells Fargo View Post
    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) {
    Reply With Quote  
     

  4. #4  
    Community Veteran


    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,833
    Thanks given
    187
    Thanks received
    306
    Rep Power
    770
    Quote Originally Posted by ServerNoob View Post
    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


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Apr 2020
    Posts
    10
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by arch337 View Post
    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
    Reply With Quote  
     

  6. #6  
    Community Veteran


    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,833
    Thanks given
    187
    Thanks received
    306
    Rep Power
    770
    Quote Originally Posted by ServerNoob View Post
    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!


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  7. #7  
    → 1StopServiceShop ←

    Wells Fargo's Avatar
    Join Date
    May 2016
    Age
    52
    Posts
    1,108
    Thanks given
    543
    Thanks received
    554
    Rep Power
    5000
    Quote Originally Posted by ServerNoob View Post
    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.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. [317] [Ruse] Help please!
    By OmegaX in forum Help
    Replies: 7
    Last Post: 05-08-2018, 05:40 PM
  2. [Ruse] Help please!
    By OmegaX in forum Help
    Replies: 4
    Last Post: 04-11-2018, 02:09 PM
  3. [RUSE] Help please Mod glow for Ruse?
    By schokk1337 in forum Requests
    Replies: 6
    Last Post: 07-28-2016, 11:03 PM
  4. [RUSE] Help please Mod glow for Ruse?
    By schokk1337 in forum Help
    Replies: 0
    Last Post: 07-28-2016, 09:52 PM
  5. Ruse Help - Please No Haterino
    By OraclePS in forum Help
    Replies: 6
    Last Post: 09-25-2015, 08:12 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •