Browse Source

Refactor lootTable/itemtable for client alignment.

master
MagicBot 1 year ago
parent
commit
67bcb9aeea
  1. 8
      src/engine/devcmd/cmds/SimulateBootyCmd.java
  2. 6
      src/engine/gameManager/LootManager.java
  3. 4
      src/engine/objects/BootySetEntry.java

8
src/engine/devcmd/cmds/SimulateBootyCmd.java

@ -120,12 +120,12 @@ public class SimulateBootyCmd extends AbstractDevCmd {
for (BootySetEntry entry : NPCManager._bootySetMap.get(mob.getMobBase().bootySet)) { for (BootySetEntry entry : NPCManager._bootySetMap.get(mob.getMobBase().bootySet)) {
if (entry.bootyType.equals("GOLD")) if (entry.bootyType.equals("GOLD"))
output += "NORMAL TABLE [" + entry.bootyType + "] " + entry.lootTable + ": " + entry.dropChance + newline; output += "NORMAL TABLE [" + entry.bootyType + "] " + entry.itemTable + ": " + entry.dropChance + newline;
else else
output += "NORMAL TABLE [" + entry.bootyType + "] " + entry.lootTable + ": " + entry.dropChance * dropRate + newline; output += "NORMAL TABLE [" + entry.bootyType + "] " + entry.itemTable + ": " + entry.dropChance * dropRate + newline;
if (hotZoneRan == false && ZoneManager.inHotZone(mob.getLoc()) && LootManager.generalItemTables.containsKey(entry.lootTable + 1)) { if (hotZoneRan == false && ZoneManager.inHotZone(mob.getLoc()) && LootManager.generalItemTables.containsKey(entry.itemTable + 1)) {
output += "HOTZONE TABLE [" + entry.bootyType + "] " + (entry.lootTable + 1) + ": " + entry.dropChance * dropRate + newline; output += "HOTZONE TABLE [" + entry.bootyType + "] " + (entry.itemTable + 1) + ": " + entry.dropChance * dropRate + newline;
hotZoneRan = true; hotZoneRan = true;
} }
} }

6
src/engine/gameManager/LootManager.java

@ -120,14 +120,14 @@ public enum LootManager {
dropRate = LootManager.NORMAL_DROP_RATE; dropRate = LootManager.NORMAL_DROP_RATE;
if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate))
GenerateLootDrop(mob, bse.lootTable, false); //generate normal loot drop GenerateLootDrop(mob, bse.itemTable, false); //generate normal loot drop
// Generate hotzone loot if in hotzone // Generate hotzone loot if in hotzone
// Only one bite at the hotzone apple per bootyset. // Only one bite at the hotzone apple per bootyset.
if (inHotzone == true && hotzoneWasRan == false) if (inHotzone == true && hotzoneWasRan == false)
if (generalItemTables.containsKey(bse.lootTable + 1) && ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) { if (generalItemTables.containsKey(bse.itemTable + 1) && ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) {
GenerateLootDrop(mob, bse.lootTable + 1, true); //generate loot drop from hotzone table GenerateLootDrop(mob, bse.itemTable + 1, true); //generate loot drop from hotzone table
hotzoneWasRan = true; hotzoneWasRan = true;
} }

4
src/engine/objects/BootySetEntry.java

@ -18,7 +18,7 @@ public class BootySetEntry {
public int lowGold; public int lowGold;
public int highGold; public int highGold;
public int itemBase; public int itemBase;
public int lootTable; public int itemTable;
public float dropChance; public float dropChance;
/** /**
@ -30,7 +30,7 @@ public class BootySetEntry {
this.lowGold = (rs.getInt("lowGold")); this.lowGold = (rs.getInt("lowGold"));
this.highGold = (rs.getInt("highGold")); this.highGold = (rs.getInt("highGold"));
this.itemBase = (rs.getInt("itemBase")); this.itemBase = (rs.getInt("itemBase"));
this.lootTable = (rs.getInt("lootTable")); this.itemTable = (rs.getInt("itemTable"));
this.dropChance = (rs.getFloat("dropChance")); this.dropChance = (rs.getFloat("dropChance"));
} }

Loading…
Cancel
Save