Browse Source

Itembase removed from interface

combat-2
MagicBot 8 months ago
parent
commit
2e05ba243f
  1. 38
      src/engine/db/handlers/dbContractHandler.java
  2. 6
      src/engine/objects/MobEquipment.java

38
src/engine/db/handlers/dbContractHandler.java

@ -12,7 +12,7 @@ package engine.db.handlers; @@ -12,7 +12,7 @@ package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager;
import engine.objects.Contract;
import engine.objects.ItemBase;
import engine.objects.ItemTemplate;
import engine.objects.MobEquipment;
import org.pmw.tinylog.Logger;
@ -63,33 +63,29 @@ public class dbContractHandler extends dbHandlerBase { @@ -63,33 +63,29 @@ public class dbContractHandler extends dbHandlerBase {
while (rs.next()) {
//handle item base
int itemBaseID = rs.getInt("itembaseID");
int templateID = rs.getInt("itembaseID");
ItemBase ib = ItemBase.getItemBase(itemBaseID);
MobEquipment me = new MobEquipment(ItemTemplate.templates.get(templateID), Enum.EquipSlotType.NONE, 0);
contract.getSellInventory().add(me);
if (ib != null) {
//handle magic effects
MobEquipment me = new MobEquipment(ib, Enum.EquipSlotType.NONE, 0);
contract.getSellInventory().add(me);
String prefix = rs.getString("prefix");
int pRank = rs.getInt("pRank");
//handle magic effects
String prefix = rs.getString("prefix");
int pRank = rs.getInt("pRank");
String suffix = rs.getString("suffix");
int sRank = rs.getInt("sRank");
String suffix = rs.getString("suffix");
int sRank = rs.getInt("sRank");
if (prefix != null) {
me.setPrefix(prefix, pRank);
me.setIsID(true);
}
if (suffix != null) {
me.setSuffix(suffix, sRank);
me.setIsID(true);
}
if (prefix != null) {
me.setPrefix(prefix, pRank);
me.setIsID(true);
}
if (suffix != null) {
me.setSuffix(suffix, sRank);
me.setIsID(true);
}
}
} catch (SQLException e) {
Logger.error(e);

6
src/engine/objects/MobEquipment.java

@ -41,11 +41,11 @@ public class MobEquipment extends AbstractGameObject { @@ -41,11 +41,11 @@ public class MobEquipment extends AbstractGameObject {
/**
* No Id Constructor
*/
public MobEquipment(ItemBase itemBase, Enum.EquipSlotType slot, int parentID) {
public MobEquipment(ItemTemplate template, Enum.EquipSlotType slot, int parentID) {
super(MobEquipment.getNewID());
this.itemBase = itemBase;
this.templateID = this.itemBase.getUUID();
this.templateID = template.template_id;
this.template = ItemTemplate.templates.get(templateID);
this.itemBase = ItemBase.getItemBase(templateID);
this.slot = slot;
this.parentID = parentID;
this.enchanted = false;

Loading…
Cancel
Save