|
|
@ -37,6 +37,8 @@ public class MobEquipment extends AbstractGameObject { |
|
|
|
private int magicValue; |
|
|
|
private int magicValue; |
|
|
|
|
|
|
|
|
|
|
|
private float dropChance = 0; |
|
|
|
private float dropChance = 0; |
|
|
|
|
|
|
|
public int templateID; |
|
|
|
|
|
|
|
public ItemTemplate template; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* No Id Constructor |
|
|
|
* No Id Constructor |
|
|
@ -44,6 +46,8 @@ public class MobEquipment extends AbstractGameObject { |
|
|
|
public MobEquipment(ItemBase itemBase, int slot, int parentID) { |
|
|
|
public MobEquipment(ItemBase itemBase, int slot, int parentID) { |
|
|
|
super(MobEquipment.getNewID()); |
|
|
|
super(MobEquipment.getNewID()); |
|
|
|
this.itemBase = itemBase; |
|
|
|
this.itemBase = itemBase; |
|
|
|
|
|
|
|
this.templateID = this.itemBase.getUUID(); |
|
|
|
|
|
|
|
this.template = ItemTemplate.itemTemplates.get(templateID); |
|
|
|
this.slot = slot; |
|
|
|
this.slot = slot; |
|
|
|
this.parentID = parentID; |
|
|
|
this.parentID = parentID; |
|
|
|
this.enchanted = false; |
|
|
|
this.enchanted = false; |
|
|
@ -57,6 +61,8 @@ public class MobEquipment extends AbstractGameObject { |
|
|
|
public MobEquipment(ItemBase itemBase, int slot, int parentID, String pIDString, String sIDString, int pValue, int sValue) { |
|
|
|
public MobEquipment(ItemBase itemBase, int slot, int parentID, String pIDString, String sIDString, int pValue, int sValue) { |
|
|
|
super(MobEquipment.getNewID()); |
|
|
|
super(MobEquipment.getNewID()); |
|
|
|
this.itemBase = itemBase; |
|
|
|
this.itemBase = itemBase; |
|
|
|
|
|
|
|
this.templateID = this.itemBase.getUUID(); |
|
|
|
|
|
|
|
this.template = ItemTemplate.itemTemplates.get(templateID); |
|
|
|
this.slot = slot; |
|
|
|
this.slot = slot; |
|
|
|
this.parentID = parentID; |
|
|
|
this.parentID = parentID; |
|
|
|
|
|
|
|
|
|
|
@ -77,6 +83,8 @@ public class MobEquipment extends AbstractGameObject { |
|
|
|
super(MobEquipment.getNewID()); |
|
|
|
super(MobEquipment.getNewID()); |
|
|
|
int itemBaseID = rs.getInt("ItemID"); |
|
|
|
int itemBaseID = rs.getInt("ItemID"); |
|
|
|
this.itemBase = ItemBase.getItemBase(itemBaseID); |
|
|
|
this.itemBase = ItemBase.getItemBase(itemBaseID); |
|
|
|
|
|
|
|
this.templateID = this.itemBase.getUUID(); |
|
|
|
|
|
|
|
this.template = ItemTemplate.itemTemplates.get(itemBaseID); |
|
|
|
this.slot = rs.getInt("slot"); |
|
|
|
this.slot = rs.getInt("slot"); |
|
|
|
this.parentID = rs.getInt("mobID"); |
|
|
|
this.parentID = rs.getInt("mobID"); |
|
|
|
setMagicValue(); |
|
|
|
setMagicValue(); |
|
|
@ -86,6 +94,7 @@ public class MobEquipment extends AbstractGameObject { |
|
|
|
public MobEquipment(int itemBaseID, float dropChance) { |
|
|
|
public MobEquipment(int itemBaseID, float dropChance) { |
|
|
|
super(MobEquipment.getNewID()); |
|
|
|
super(MobEquipment.getNewID()); |
|
|
|
this.itemBase = ItemBase.getItemBase(itemBaseID); |
|
|
|
this.itemBase = ItemBase.getItemBase(itemBaseID); |
|
|
|
|
|
|
|
this.template = ItemTemplate.itemTemplates.get(itemBaseID); |
|
|
|
|
|
|
|
|
|
|
|
if (this.itemBase != null) |
|
|
|
if (this.itemBase != null) |
|
|
|
this.slot = this.itemBase.getValidSlot(); |
|
|
|
this.slot = this.itemBase.getValidSlot(); |
|
|
@ -144,8 +153,8 @@ public class MobEquipment extends AbstractGameObject { |
|
|
|
writer.putInt(0); // Unknown. pad?
|
|
|
|
writer.putInt(0); // Unknown. pad?
|
|
|
|
writer.put((byte) 1); // End Datablock byte
|
|
|
|
writer.put((byte) 1); // End Datablock byte
|
|
|
|
|
|
|
|
|
|
|
|
writer.putFloat(mobEquipment.itemBase.getDurability()); |
|
|
|
writer.putFloat(mobEquipment.template.item_health_full); |
|
|
|
writer.putFloat(mobEquipment.itemBase.getDurability()); |
|
|
|
writer.putFloat(mobEquipment.template.item_health_full); |
|
|
|
|
|
|
|
|
|
|
|
writer.put((byte) 1); // End Datablock byte
|
|
|
|
writer.put((byte) 1); // End Datablock byte
|
|
|
|
|
|
|
|
|
|
|
|