Browse Source

More refactor out itembase

combat-2
MagicBot 8 months ago
parent
commit
e323c80fba
  1. 4
      src/engine/devcmd/cmds/SimulateBootyCmd.java
  2. 2
      src/engine/gameManager/LootManager.java
  3. 4
      src/engine/loot/BootySetEntry.java
  4. 2
      src/engine/objects/MobBase.java

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

@ -34,7 +34,7 @@ public class SimulateBootyCmd extends AbstractDevCmd { @@ -34,7 +34,7 @@ public class SimulateBootyCmd extends AbstractDevCmd {
if (mob.bootySet != 0) {
for (BootySetEntry entry : LootManager._bootySetMap.get(mob.bootySet)) {
ItemTemplate template = ItemTemplate.itemTemplates.get(entry.itemBase);
ItemTemplate template = ItemTemplate.itemTemplates.get(entry.templateID);
if (template != null)
output += "[" + entry.bootyType + "] " + template.item_base_name + " [Chance] " + entry.dropChance + newline;
@ -71,7 +71,7 @@ public class SimulateBootyCmd extends AbstractDevCmd { @@ -71,7 +71,7 @@ public class SimulateBootyCmd extends AbstractDevCmd {
Runes.add(lootItem);
break;
case WEAPON: //WEAPON
if (lootItem.getItemBase().isGlass())
if (lootItem.getName().toUpperCase().contains("GLASS"))
GlassItems.add(lootItem);
else
OtherDrops.add(lootItem);

2
src/engine/gameManager/LootManager.java

@ -369,7 +369,7 @@ public enum LootManager { @@ -369,7 +369,7 @@ public enum LootManager {
if (chanceRoll > bse.dropChance)
return;
MobLoot lootItem = new MobLoot(mob, ItemTemplate.itemTemplates.get(bse.itemBase), true);
MobLoot lootItem = new MobLoot(mob, ItemTemplate.itemTemplates.get(bse.templateID), true);
if (lootItem != null)
mob.getCharItemManager().addItemToInventory(lootItem);

4
src/engine/loot/BootySetEntry.java

@ -17,7 +17,7 @@ public class BootySetEntry { @@ -17,7 +17,7 @@ public class BootySetEntry {
public String bootyType;
public int lowGold;
public int highGold;
public int itemBase;
public int templateID;
public int genTable;
public float dropChance;
@ -29,7 +29,7 @@ public class BootySetEntry { @@ -29,7 +29,7 @@ public class BootySetEntry {
this.bootyType = (rs.getString("bootyType"));
this.lowGold = (rs.getInt("lowGold"));
this.highGold = (rs.getInt("highGold"));
this.itemBase = (rs.getInt("itemBase"));
this.templateID = (rs.getInt("itemBase"));
this.genTable = (rs.getInt("genTable"));
this.dropChance = (rs.getFloat("dropChance"));
}

2
src/engine/objects/MobBase.java

@ -125,7 +125,7 @@ public class MobBase extends AbstractGameObject { @@ -125,7 +125,7 @@ public class MobBase extends AbstractGameObject {
for (BootySetEntry equipmentSetEntry : equipList) {
MobEquipment mobEquipment = new MobEquipment(equipmentSetEntry.itemBase, equipmentSetEntry.dropChance);
MobEquipment mobEquipment = new MobEquipment(equipmentSetEntry.templateID, equipmentSetEntry.dropChance);
ItemBase itemBase = mobEquipment.getItemBase();
// if (itemBase.getType().equals(Enum.ItemType.WEAPON))

Loading…
Cancel
Save