Browse Source

removed non-gold drops form safehold mobs

lakebane-master
FatBoy-DOTC 9 months ago
parent
commit
dcc92fd89d
  1. 63
      src/engine/gameManager/LootManager.java

63
src/engine/gameManager/LootManager.java

@ -117,43 +117,43 @@ public enum LootManager {
float dropRate = NORMAL_DROP_RATE; float dropRate = NORMAL_DROP_RATE;
//roll the geenric world drop table //roll the geenric world drop table
GenerateLootDrop(mob, 1300); if(mob.parentZone.getSafeZone() == 0) {
if(ThreadLocalRandom.current().nextInt(1, 10000) == 5000) { GenerateLootDrop(mob, 1300);
MobLoot extraLoot = rollForGlass(mob); if(ThreadLocalRandom.current().nextInt(1, 10000) == 5000) {
if (extraLoot != null) { MobLoot extraLoot = rollForGlass(mob);
mob.getCharItemManager().addItemToInventory(extraLoot); if (extraLoot != null) {
mob.getCharItemManager().addItemToInventory(extraLoot);
}
} }
} }
// Iterate all entries in this bootySet and process accordingly // Iterate all entries in this bootySet and process accordingly
boolean hasExtraRolled = false; boolean hasExtraRolled = false;
for (BootySetEntry bse : entries) { for (BootySetEntry bse : entries) {
switch (bse.bootyType) { switch (bse.bootyType) {
case "GOLD": case "GOLD":
GenerateGoldDrop(mob, bse); GenerateGoldDrop(mob, bse);
break; break;
case "LOOT": case "LOOT":
if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate))
GenerateLootDrop(mob, bse.genTable); //generate normal loot drop GenerateLootDrop(mob, bse.genTable); //generate normal loot drop
if(mob.parentZone.getSafeZone() == 0) { if (mob.parentZone.getSafeZone() == 0 && hasExtraRolled == false && ThreadLocalRandom.current().nextInt(1, 10000) < 5 * dropRate) {
if (hasExtraRolled == false && ThreadLocalRandom.current().nextInt(1, 10000) < 5 * dropRate) { int roll = ThreadLocalRandom.current().nextInt(1, 101);
int roll = ThreadLocalRandom.current().nextInt(1, 101); MobLoot extraLoot = null;
MobLoot extraLoot = null; if (roll >= 1 && roll <= 50) {
if (roll >= 1 && roll <= 50) { extraLoot = rollForContract(bse.genTable, mob);
extraLoot = rollForContract(bse.genTable, mob); }
} if (roll >= 51 && roll <= 94) {
if (roll >= 51 && roll <= 94) { extraLoot = rollForRune(bse.genTable, mob);
extraLoot = rollForRune(bse.genTable, mob); }
} //if (roll >= 95) {
//if (roll >= 95) { // extraLoot = rollForGlass(mob);
// extraLoot = rollForGlass(mob); //}
//} if (extraLoot != null) {
if (extraLoot != null) { mob.getCharItemManager().addItemToInventory(extraLoot);
mob.getCharItemManager().addItemToInventory(extraLoot); }
}
hasExtraRolled = true; hasExtraRolled = true;
} }
}
break; break;
case "ITEM": case "ITEM":
GenerateInventoryDrop(mob, bse); GenerateInventoryDrop(mob, bse);
@ -338,7 +338,9 @@ public enum LootManager {
public static void GenerateLootDrop(Mob mob, int tableID) { public static void GenerateLootDrop(Mob mob, int tableID) {
try { try {
if(mob.parentZone.getSafeZone() == 1) {
return;
}
MobLoot toAdd = getGenTableItem(tableID, mob); MobLoot toAdd = getGenTableItem(tableID, mob);
if(toAdd.getItemBase().getType().equals(Enum.ItemType.CONTRACT) || toAdd.getItemBase().getType().equals(Enum.ItemType.RUNE)) if(toAdd.getItemBase().getType().equals(Enum.ItemType.CONTRACT) || toAdd.getItemBase().getType().equals(Enum.ItemType.RUNE))
return;//block all contracts and runes that drop outside the confines of the new system return;//block all contracts and runes that drop outside the confines of the new system
@ -354,6 +356,10 @@ public enum LootManager {
public static void GenerateEquipmentDrop(Mob mob) { public static void GenerateEquipmentDrop(Mob mob) {
if(mob.parentZone.getSafeZone() == 1) {
return;
}
//do equipment here //do equipment here
int dropCount = 0; int dropCount = 0;
if (mob.getEquip() != null) if (mob.getEquip() != null)
@ -403,6 +409,10 @@ public enum LootManager {
public static void GenerateInventoryDrop(Mob mob, BootySetEntry bse) { public static void GenerateInventoryDrop(Mob mob, BootySetEntry bse) {
if(mob.parentZone.getSafeZone() == 1) {
return;
}
int chanceRoll = ThreadLocalRandom.current().nextInt(1, 100 + 1); int chanceRoll = ThreadLocalRandom.current().nextInt(1, 100 + 1);
//early exit, failed to hit minimum chance roll //early exit, failed to hit minimum chance roll
@ -501,6 +511,7 @@ public enum LootManager {
} }
public static MobLoot rollForContract(int table, Mob mob){ public static MobLoot rollForContract(int table, Mob mob){
int roll = 99; int roll = 99;
if (table == 1900 || table == 1500) if (table == 1900 || table == 1500)
roll = 73; roll = 73;

Loading…
Cancel
Save