|
|
@ -52,7 +52,6 @@ public class Item extends AbstractWorldObject { |
|
|
|
public int chargesRemaining; |
|
|
|
public int chargesRemaining; |
|
|
|
private byte equipSlot; |
|
|
|
private byte equipSlot; |
|
|
|
private boolean canDestroy; |
|
|
|
private boolean canDestroy; |
|
|
|
private boolean rentable; |
|
|
|
|
|
|
|
private boolean isRandom = false; |
|
|
|
private boolean isRandom = false; |
|
|
|
private int value; |
|
|
|
private int value; |
|
|
|
public OwnerType ownerType; |
|
|
|
public OwnerType ownerType; |
|
|
@ -101,7 +100,6 @@ public class Item extends AbstractWorldObject { |
|
|
|
this.durabilityCurrent = (short) itemBase.getDurability(); |
|
|
|
this.durabilityCurrent = (short) itemBase.getDurability(); |
|
|
|
this.containerType = containerType; |
|
|
|
this.containerType = containerType; |
|
|
|
this.canDestroy = canDestroy; |
|
|
|
this.canDestroy = canDestroy; |
|
|
|
this.rentable = rentable; |
|
|
|
|
|
|
|
this.equipSlot = equipSlot; |
|
|
|
this.equipSlot = equipSlot; |
|
|
|
this.enchants = enchants; |
|
|
|
this.enchants = enchants; |
|
|
|
this.flags = 1; |
|
|
|
this.flags = 1; |
|
|
@ -134,7 +132,6 @@ public class Item extends AbstractWorldObject { |
|
|
|
this.durabilityMax = (short) itemBase.getDurability(); |
|
|
|
this.durabilityMax = (short) itemBase.getDurability(); |
|
|
|
this.durabilityCurrent = (short) itemBase.getDurability(); |
|
|
|
this.durabilityCurrent = (short) itemBase.getDurability(); |
|
|
|
this.canDestroy = canDestroy; |
|
|
|
this.canDestroy = canDestroy; |
|
|
|
this.rentable = rentable; |
|
|
|
|
|
|
|
this.equipSlot = equipSlot; |
|
|
|
this.equipSlot = equipSlot; |
|
|
|
this.enchants = enchants; |
|
|
|
this.enchants = enchants; |
|
|
|
this.flags = 1; |
|
|
|
this.flags = 1; |
|
|
@ -433,7 +430,7 @@ public class Item extends AbstractWorldObject { |
|
|
|
item.containerType = Enum.ItemContainerType.INVENTORY; |
|
|
|
item.containerType = Enum.ItemContainerType.INVENTORY; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
item = DbManager.ItemQueries.ADD_ITEM(item); |
|
|
|
item = DbManager.ItemQueries.PERSIST(item); |
|
|
|
itemWorked = true; |
|
|
|
itemWorked = true; |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
Logger.error(e); |
|
|
|
Logger.error(e); |
|
|
@ -604,7 +601,7 @@ public class Item extends AbstractWorldObject { |
|
|
|
true, false, Enum.ItemContainerType.INVENTORY, (byte) 0, |
|
|
|
true, false, Enum.ItemContainerType.INVENTORY, (byte) 0, |
|
|
|
new ArrayList<>(), ""); |
|
|
|
new ArrayList<>(), ""); |
|
|
|
try { |
|
|
|
try { |
|
|
|
item = DbManager.ItemQueries.ADD_ITEM(temp); |
|
|
|
item = DbManager.ItemQueries.PERSIST(temp); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
Logger.error(e); |
|
|
|
Logger.error(e); |
|
|
|
} |
|
|
|
} |
|
|
@ -624,7 +621,7 @@ public class Item extends AbstractWorldObject { |
|
|
|
true, false, Enum.ItemContainerType.BANK, (byte) 0, |
|
|
|
true, false, Enum.ItemContainerType.BANK, (byte) 0, |
|
|
|
new ArrayList<>(), ""); |
|
|
|
new ArrayList<>(), ""); |
|
|
|
try { |
|
|
|
try { |
|
|
|
item = DbManager.ItemQueries.ADD_ITEM(temp); |
|
|
|
item = DbManager.ItemQueries.PERSIST(temp); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
} |
|
|
|
} |
|
|
|
return item; |
|
|
|
return item; |
|
|
@ -642,7 +639,7 @@ public class Item extends AbstractWorldObject { |
|
|
|
true, false, Enum.ItemContainerType.INVENTORY, (byte) 0, |
|
|
|
true, false, Enum.ItemContainerType.INVENTORY, (byte) 0, |
|
|
|
new ArrayList<>(), ""); |
|
|
|
new ArrayList<>(), ""); |
|
|
|
try { |
|
|
|
try { |
|
|
|
item = DbManager.ItemQueries.ADD_ITEM(temp); |
|
|
|
item = DbManager.ItemQueries.PERSIST(temp); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
Logger.error(e); |
|
|
|
Logger.error(e); |
|
|
|
} |
|
|
|
} |
|
|
@ -681,7 +678,7 @@ public class Item extends AbstractWorldObject { |
|
|
|
|
|
|
|
|
|
|
|
if (persist) { |
|
|
|
if (persist) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
newGold = DbManager.ItemQueries.ADD_ITEM(newGold); |
|
|
|
newGold = DbManager.ItemQueries.PERSIST(newGold); |
|
|
|
if (newGold != null) { |
|
|
|
if (newGold != null) { |
|
|
|
synchronized (newGold) { |
|
|
|
synchronized (newGold) { |
|
|
|
newGold.numberOfItems = 0; |
|
|
|
newGold.numberOfItems = 0; |
|
|
@ -742,7 +739,7 @@ public class Item extends AbstractWorldObject { |
|
|
|
|
|
|
|
|
|
|
|
if (persist) { |
|
|
|
if (persist) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
newGold = DbManager.ItemQueries.ADD_ITEM(newGold); |
|
|
|
newGold = DbManager.ItemQueries.PERSIST(newGold); |
|
|
|
if (newGold != null) { |
|
|
|
if (newGold != null) { |
|
|
|
synchronized (newGold) { |
|
|
|
synchronized (newGold) { |
|
|
|
newGold.numberOfItems = 0; |
|
|
|
newGold.numberOfItems = 0; |
|
|
@ -834,18 +831,6 @@ public class Item extends AbstractWorldObject { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isOwnerNPC() { |
|
|
|
|
|
|
|
return (ownerType == OwnerType.Npc); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isOwnerCharacter() { |
|
|
|
|
|
|
|
return (ownerType == OwnerType.PlayerCharacter); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isOwnerAccount() { |
|
|
|
|
|
|
|
return (ownerType == OwnerType.Account); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public byte getChargesMax() { |
|
|
|
public byte getChargesMax() { |
|
|
|
return chargesMax; |
|
|
|
return chargesMax; |
|
|
|
} |
|
|
|
} |
|
|
@ -862,17 +847,10 @@ public class Item extends AbstractWorldObject { |
|
|
|
return canDestroy; |
|
|
|
return canDestroy; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isRentable() { |
|
|
|
|
|
|
|
return rentable; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public byte getEquipSlot() { |
|
|
|
public byte getEquipSlot() { |
|
|
|
return equipSlot; |
|
|
|
return equipSlot; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ArrayList<EnchantmentBase> getEnchants() { |
|
|
|
|
|
|
|
return enchants; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int getNumOfItems() { |
|
|
|
public int getNumOfItems() { |
|
|
|
return this.numberOfItems; |
|
|
|
return this.numberOfItems; |
|
|
|