Your variable is a int not a double.
((c.prestige * 100) - 100) this makes it 0 because your variable is 1 only.
And as you mention once it is 200 it become 2.
((c.prestige * 100) - 100) this then become 100.
|
Alright so first things first i'll show you the code, this is what is in player.java for a public int:
Then what im doing is for bonus experience, so next to any experience gaining code this is what i get:Code:public int prestige = (prestigePoints / 200) + 1;
So what's that's doing is multiplying the experience i get for smithing for example by the public int in player.java. Now in game i made an npc return back the amount of xp after noticing my xp isn't increasing until my prestige points gets to 200 (guessing because im dividing it by 200???) by doing this:Code:c.getPA().addSkillXP(exp * (c.getMode().getType().equals(ModeType.OSRS) ? 1 : Config.SMITHING_EXPERIENCE * c.prestige), Player.playerSmithing, true);
Now let's say i have 59 prestige points, what it should do is (59/200) + 1, which should be 1.295 meaning i should get 29.5% bonus experience, but it's returning 0 until my prestige points reaches 200. That's why i added the npc to show your exp rate because i noticed it was not working. I then changed the prestigepoints / 200 to prestigepoints / 25 and then everything rounded to the nearest 25's after that. Sorry for my extremely sloppy way of explaining...Code:Case 1428: c.getDH().sendNpcChat3("Prestiging will increase your drop rate.", "Experience rate: " + ((c.prestige * 100) - 100) + "%", "Your current prestige points: " + c.prestigePoints, 2989, "Ak-Haranu"); c.nextChat = -1;
Your variable is a int not a double.
((c.prestige * 100) - 100) this makes it 0 because your variable is 1 only.
And as you mention once it is 200 it become 2.
((c.prestige * 100) - 100) this then become 100.
Your code won't work for multiple reasons:
1. prestige is an integer, not a double.
2. You're setting the value of prestige when the Player object is created, prestigePoints will always have the default value (which is probably 0).
3. prestige will always remain the same value unless you reset it everytime someone prestiges, which seems a bit unnecessary.
You could do it as easily as this:
Code:public double prestige() { return (prestigePoints / (double) 200) + 1; }Test:Code:c.getPA().addSkillXP(exp * (c.getMode().getType().equals(ModeType.OSRS) ? 1 : Config.SMITHING_EXPERIENCE * c.prestige()), Player.playerSmithing, true);
PrintsCode:public class Test { public static void main(String[] args) { int points = 59; System.out.println(prestige(points)); } public static double prestige(int points) { return (points / (double) 200) + 1; } }
Code:1.295
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |