Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static boolean shouldDrop(Player p,NPC npc, double drops,NpcDropItem[] c, boolean[] b, DropChance chance,
- boolean ringOfWealth, boolean ringOfWealth1, boolean ringOfWealth2, boolean ringOfWealth3, boolean ringOfWealthLucky, boolean amuletOfInsanity, boolean ringOfGods, boolean extreme, PlayerRights rights) {
- int x = 0;
- double random = chance.getRandom(); //pull the chance from the table
- double oldRandom = chance.getRandom();
- double drBoost = NPCDrops.getDroprate(p);
- double oldDrBoost = NPCDrops.getDroprate(p);
- System.out.printLn("Testing Rates: Random: " + random + " - Dr Boost: " + drBoost);
- System.out.printLn("Testing Rates: OldRandom: " + oldRandom+ " - Old Dr Boost: " + oldDrBoost);
- for (int i = 0; i < drops; i++) {
- if (random == c[i].getChance().getRandom()) {
- x++;
- }
- }
- System.out.printLn("Testing Rates: Random: " + random + " - Old Random: " + oldRandom);
- random *= x;
- System.out.printLn("Testing Rates: Random: " + random + " - Old Random: " + oldRandom);
- p.setDroprate(drBoost);
- //p.setDroprate(NPCDrops.getDroprate(p));
- if (p.getTransform() == npc.getId()) {
- drBoost += 5;
- p.sendMessage("Your soul boosted your droprate by 5% on this npc!");
- }
- if (p.getSlayer().getSlayerTask().getNpcId() == npc.getId()) {
- if(p.getEquipment().get(Equipment.HEAD_SLOT).getId() == 11550){
- drBoost += 1;
- p.sendMessage("Your slayer helm boosted your droprate by 1%");
- }if(p.getEquipment().get(Equipment.HEAD_SLOT).getId() == 11549){
- drBoost += 3;
- p.sendMessage("Your slayer helm boosted your droprate by 2%");
- }if(p.getEquipment().get(Equipment.HEAD_SLOT).getId() == 11546){
- drBoost += 5;
- p.sendMessage("Your slayer helm boosted your droprate by 3%");
- }if(p.getEquipment().get(Equipment.HEAD_SLOT).getId() == 11547){
- drBoost += 10;
- p.sendMessage("Your slayer helm boosted your droprate by 4%");
- }if(p.getEquipment().get(Equipment.HEAD_SLOT).getId() == 11548){
- drBoost += 15;
- p.sendMessage("Your slayer helm boosted your droprate by 5%");
- }
- }
- System.out.printLn("Testing Rates: Random: " + random + " - Dr Boost: " + drBoost);
- System.out.printLn("Testing Rates: OldRandom: " + oldRandom+ " - Old Dr Boost: " + oldDrBoost);
- random = (int)random * ((100-drBoost)/100);
- System.out.printLn("Testing Rates: Random: " + random + " - Dr Boost: " + drBoost);
- System.out.printLn("Testing Rates: OldRandom: " + oldRandom+ " - Old Dr Boost: " + oldDrBoost);
- System.out.printLn("Testing Final Rates: " + !b[chance.ordinal()] && Misc.getRandom((int) random) == 0);
- return !b[chance.ordinal()] && Misc.getRandom((int) random) == 0; //return true if random between 0 & table value is 1.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement