Browse Source

removed non-gold drops form safehold mobs

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

21
src/engine/gameManager/LootManager.java

@ -117,6 +117,7 @@ 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
if(mob.parentZone.getSafeZone() == 0) {
GenerateLootDrop(mob, 1300); GenerateLootDrop(mob, 1300);
if(ThreadLocalRandom.current().nextInt(1, 10000) == 5000) { if(ThreadLocalRandom.current().nextInt(1, 10000) == 5000) {
MobLoot extraLoot = rollForGlass(mob); MobLoot extraLoot = rollForGlass(mob);
@ -124,10 +125,11 @@ public enum LootManager {
mob.getCharItemManager().addItemToInventory(extraLoot); 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);
@ -135,8 +137,7 @@ public enum LootManager {
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) {
@ -153,7 +154,6 @@ public enum LootManager {
} }
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