Browse Source

glass chance is 10/100,000

lakebane-strongholds
FatBoy-DOTC 4 months ago
parent
commit
7fabd6554d
  1. 27
      src/engine/gameManager/LootManager.java

27
src/engine/gameManager/LootManager.java

@ -125,15 +125,22 @@ public enum LootManager {
boolean hotzoneWasRan = false; boolean hotzoneWasRan = false;
float dropRate; float dropRate;
//1 in 1,000 chance to drop glass if(!mob.getSafeZone()) {
if(ThreadLocalRandom.current().nextInt(1,1000) == 500){ //10 in 100,000 chance to drop glass
int glassID = rollRandomItem(126); int levelBonusForRoll = 50 - mob.level;
ItemBase glassItem = ItemBase.getItemBase(glassID);
if(glassItem != null) { if (levelBonusForRoll < 0)
MobLoot toAdd = new MobLoot(mob, glassItem, false); levelBonusForRoll = 0;
if (toAdd != null) if (ThreadLocalRandom.current().nextInt(1, 100000) >= ((10 + levelBonusForRoll) * NORMAL_DROP_RATE)) {
mob.getCharItemManager().addItemToInventory(toAdd); int glassID = rollRandomItem(126);
ItemBase glassItem = ItemBase.getItemBase(glassID);
if (glassItem != null) {
MobLoot toAddGlass = new MobLoot(mob, glassItem, false);
if (toAddGlass != null)
mob.getCharItemManager().addItemToInventory(toAddGlass);
}
} }
} }
@ -194,7 +201,6 @@ public enum LootManager {
//gets the 1-320 roll for this mob //gets the 1-320 roll for this mob
int itemTableRoll = 0; int itemTableRoll = 0;
int objectType = mob.getObjectType().ordinal();
if(mob.getObjectType().ordinal() == 52) { //52 = player character if(mob.getObjectType().ordinal() == 52) { //52 = player character
itemTableRoll = ThreadLocalRandom.current().nextInt(1,320 + 1); itemTableRoll = ThreadLocalRandom.current().nextInt(1,320 + 1);
} else{ } else{
@ -365,8 +371,7 @@ public enum LootManager {
public static void GenerateLootDrop(Mob mob, int tableID, Boolean inHotzone) { public static void GenerateLootDrop(Mob mob, int tableID, Boolean inHotzone) {
MobLoot toAdd = getGenTableItem(tableID, mob, inHotzone); MobLoot toAdd = getGenTableItem(tableID, mob, inHotzone);
if(toAdd != null){
if (toAdd != null) {
toAdd.setIsID(true); toAdd.setIsID(true);
mob.getCharItemManager().addItemToInventory(toAdd); mob.getCharItemManager().addItemToInventory(toAdd);
} }

Loading…
Cancel
Save