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

2
src/engine/gameManager/LootManager.java

@ -369,7 +369,7 @@ public enum LootManager {
if (chanceRoll > bse.dropChance) if (chanceRoll > bse.dropChance)
return; 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) if (lootItem != null)
mob.getCharItemManager().addItemToInventory(lootItem); mob.getCharItemManager().addItemToInventory(lootItem);

4
src/engine/loot/BootySetEntry.java

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

2
src/engine/objects/MobBase.java

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

Loading…
Cancel
Save