So I want to make people with item 773 have a lower drop chance than a player without, I have no errors in eclipse but just want someone to tell me if this code would work properly?
Code:
public static void casketDrop(Player player, int hitpoints, Position pos) {
int chance = (int) (1 + hitpoints);
if (player.getEquipment().contains(773)) {
chance = (int) (1 + hitpoints / 3);
}
if (Misc.getRandom(hitpoints <= 25000 ? 50000000 : 250000000) < chance) {
GroundItemManager.spawnGroundItem(player, new GroundItem(new Item(15522), pos, player.getUsername(), false, 150, true, 200));
World.sendMessage("@bla@" +
player.getUsername() + "@red@ has received a @blu@ Tier 1 upgrade token @red@ as a Global drop!");
}
}
Or Could I just use
please try to tell my why I would use one rather than the other or a better way to do it o I can actually learn, Thanks