Browse Source

hotzone roll tweaks

master
FatBoy-DOTC 1 year ago
parent
commit
93359ae147
  1. 30
      src/engine/loot/LootManager.java

30
src/engine/loot/LootManager.java

@ -78,7 +78,7 @@ public class LootManager {
} }
private static void RunBootySet(ArrayList<BootySetEntry> entries, Mob mob, float multiplier, boolean inHotzone, boolean fromDeath) { private static void RunBootySet(ArrayList<BootySetEntry> entries, Mob mob, float multiplier, boolean inHotzone, boolean fromDeath) {
if (fromDeath) { if (fromDeath) {
DropEquipment(mob,multiplier); DropEquipment(mob, multiplier);
return; return;
} }
Boolean hasRolledForGlass = false; Boolean hasRolledForGlass = false;
@ -87,17 +87,16 @@ public class LootManager {
for (BootySetEntry bse : entries) { for (BootySetEntry bse : entries) {
switch (bse.bootyType) { switch (bse.bootyType) {
case "GOLD": case "GOLD":
GenerateGoldDrop(mob,bse,multiplier); GenerateGoldDrop(mob, bse, multiplier);
break; break;
case "LOOT": case "LOOT":
GenerateNormalLootDrop(mob,bse,multiplier,false); GenerateNormalLootDrop(mob, bse, multiplier, false);
if (inHotzone && mob.level < 80) { if (inHotzone && mob.level < 80) {
if (generalItemTables.containsKey(bse.lootTable + 1)) { if (generalItemTables.containsKey(bse.lootTable + 1)) {
//GenerateHotzoneLootDrop(mob, bse, multiplier);
hotzoneTable = bse.lootTable + 1; hotzoneTable = bse.lootTable + 1;
} }
} }
if(mob.level < 80){ if (mob.level < 80) {
if (inHotzone && hasExtraRolled == false) { if (inHotzone && hasExtraRolled == false) {
RollLootTableForHotzone(mob, bse); RollLootTableForHotzone(mob, bse);
hasExtraRolled = true; hasExtraRolled = true;
@ -105,11 +104,11 @@ public class LootManager {
} }
break; break;
case "ITEM": case "ITEM":
GenerateItemLootDrop(mob,bse,multiplier); GenerateItemLootDrop(mob, bse, multiplier);
break; break;
} }
} }
if(inHotzone && hasRolledForGlass == false){ if (inHotzone && hasRolledForGlass == false) {
RollForGlass(mob); RollForGlass(mob);
} }
if (hotzoneTable != 0) { if (hotzoneTable != 0) {
@ -131,11 +130,11 @@ public class LootManager {
} }
MobLoot outItem; MobLoot outItem;
int genRoll; int genRoll;
if(isHotzone){ //if(isHotzone){
genRoll = ThreadLocalRandom.current().nextInt(32) + 77; // genRoll = ThreadLocalRandom.current().nextInt(32) + 77;
} else { //} else {
genRoll = new Random().nextInt(100) + 1; genRoll = new Random().nextInt(100) + 1;
} //}
GenTableRow selectedRow = generalItemTables.get(genTableID).getRowForRange(genRoll); GenTableRow selectedRow = generalItemTables.get(genTableID).getRowForRange(genRoll);
if (selectedRow == null) { if (selectedRow == null) {
return null; return null;
@ -212,7 +211,7 @@ public class LootManager {
} }
public static void GenerateGoldDrop(Mob mob, BootySetEntry bse, float multiplier){ public static void GenerateGoldDrop(Mob mob, BootySetEntry bse, float multiplier){
int chanceRoll = ThreadLocalRandom.current().nextInt(100) + 1; int chanceRoll = ThreadLocalRandom.current().nextInt(100) + 1;
if (chanceRoll > bse.dropChance) { if (chanceRoll > bse.dropChance * multiplier) {
//early exit, failed to hit minimum chance roll OR booty was generated from mob's death //early exit, failed to hit minimum chance roll OR booty was generated from mob's death
return; return;
} }
@ -233,7 +232,7 @@ public class LootManager {
return; return;
} }
//iterate the booty tables and add items to mob inventory //iterate the booty tables and add items to mob inventory
MobLoot toAdd = getGenTableItem(bse.lootTable, mob,inHotzone); MobLoot toAdd = getGenTableItem(bse.lootTable, mob,false);
if (toAdd != null) { if (toAdd != null) {
if(toAdd.getPrefix() == null && toAdd.getSuffix() == null){ if(toAdd.getPrefix() == null && toAdd.getSuffix() == null){
toAdd.setIsID(true); toAdd.setIsID(true);
@ -248,11 +247,6 @@ public class LootManager {
} }
public static void GenerateHotzoneLootDrop(Mob mob, int tableID, float multiplier){ public static void GenerateHotzoneLootDrop(Mob mob, int tableID, float multiplier){
int lootTableID = tableID; int lootTableID = tableID;
//int chanceRoll = ThreadLocalRandom.current().nextInt(100) + 1;
//if (chanceRoll > bse.dropChance * multiplier) {
//early exit, failed to hit minimum chance roll
// return;
//}
MobLoot toAdd = getGenTableItem(lootTableID, mob, false); MobLoot toAdd = getGenTableItem(lootTableID, mob, false);
if (toAdd != null) { if (toAdd != null) {
if (toAdd.getPrefix() != null && toAdd.getPrefix().isEmpty() == true && toAdd.getSuffix() != null && toAdd.getSuffix().isEmpty() == true) { if (toAdd.getPrefix() != null && toAdd.getPrefix().isEmpty() == true && toAdd.getSuffix() != null && toAdd.getSuffix().isEmpty() == true) {

Loading…
Cancel
Save