|
|
@ -796,7 +796,7 @@ public class Item extends AbstractWorldObject { |
|
|
|
// Removes all ownership of item and 'orphans' it.
|
|
|
|
// Removes all ownership of item and 'orphans' it.
|
|
|
|
protected synchronized void junk() { |
|
|
|
protected synchronized void junk() { |
|
|
|
|
|
|
|
|
|
|
|
DbManager.ItemQueries.UPDATE_OWNER(this, 0, false, false, false, ItemContainerType.NONE, 0); |
|
|
|
DbManager.ItemQueries.UPDATE_OWNER(this, 0, ItemContainerType.NONE, EquipSlotType.NONE); |
|
|
|
this.zeroItem(); |
|
|
|
this.zeroItem(); |
|
|
|
|
|
|
|
|
|
|
|
//cleanup item from server.
|
|
|
|
//cleanup item from server.
|
|
|
@ -808,11 +808,11 @@ public class Item extends AbstractWorldObject { |
|
|
|
|
|
|
|
|
|
|
|
if (!DbManager.ItemQueries.UPDATE_OWNER(this, |
|
|
|
if (!DbManager.ItemQueries.UPDATE_OWNER(this, |
|
|
|
pc.getObjectUUID(), //tableID
|
|
|
|
pc.getObjectUUID(), //tableID
|
|
|
|
false, //isNPC
|
|
|
|
//isNPC
|
|
|
|
true, //isPlayer
|
|
|
|
//isPlayer
|
|
|
|
false, //isAccount
|
|
|
|
//isAccount
|
|
|
|
ItemContainerType.INVENTORY, |
|
|
|
ItemContainerType.INVENTORY, |
|
|
|
0)) //Slot
|
|
|
|
EquipSlotType.NONE)) //Slot
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
this.ownerID = pc.getObjectUUID(); |
|
|
|
this.ownerID = pc.getObjectUUID(); |
|
|
@ -824,15 +824,15 @@ public class Item extends AbstractWorldObject { |
|
|
|
|
|
|
|
|
|
|
|
protected synchronized boolean moveItemToInventory(NPC npc) { |
|
|
|
protected synchronized boolean moveItemToInventory(NPC npc) { |
|
|
|
if (npc.isStatic()) { |
|
|
|
if (npc.isStatic()) { |
|
|
|
if (!DbManager.ItemQueries.UPDATE_OWNER(this, 0, false, false, false, ItemContainerType.INVENTORY, 0)) |
|
|
|
if (!DbManager.ItemQueries.UPDATE_OWNER(this, 0, ItemContainerType.INVENTORY, EquipSlotType.NONE)) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} else if (!DbManager.ItemQueries.UPDATE_OWNER(this, |
|
|
|
} else if (!DbManager.ItemQueries.UPDATE_OWNER(this, |
|
|
|
npc.getObjectUUID(), //UUID
|
|
|
|
npc.getObjectUUID(), //UUID
|
|
|
|
true, //isNPC
|
|
|
|
//isNPC
|
|
|
|
false, //isPlayer
|
|
|
|
//isPlayer
|
|
|
|
false, //isAccount
|
|
|
|
//isAccount
|
|
|
|
ItemContainerType.INVENTORY, |
|
|
|
ItemContainerType.INVENTORY, |
|
|
|
0)) //Slot
|
|
|
|
EquipSlotType.NONE)) //Slot
|
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
this.zeroItem(); |
|
|
|
this.zeroItem(); |
|
|
@ -846,11 +846,11 @@ public class Item extends AbstractWorldObject { |
|
|
|
protected synchronized boolean moveItemToInventory(Corpse corpse) { |
|
|
|
protected synchronized boolean moveItemToInventory(Corpse corpse) { |
|
|
|
if (!DbManager.ItemQueries.UPDATE_OWNER(this, |
|
|
|
if (!DbManager.ItemQueries.UPDATE_OWNER(this, |
|
|
|
0, //no ID for corpse
|
|
|
|
0, //no ID for corpse
|
|
|
|
false, //isNPC
|
|
|
|
//isNPC
|
|
|
|
true, //isPlayer
|
|
|
|
//isPlayer
|
|
|
|
false, //isAccount
|
|
|
|
//isAccount
|
|
|
|
ItemContainerType.INVENTORY, |
|
|
|
ItemContainerType.INVENTORY, |
|
|
|
0)) //Slot
|
|
|
|
EquipSlotType.NONE)) //Slot
|
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
this.zeroItem(); |
|
|
|
this.zeroItem(); |
|
|
@ -864,11 +864,11 @@ public class Item extends AbstractWorldObject { |
|
|
|
protected synchronized boolean moveItemToBank(PlayerCharacter pc) { |
|
|
|
protected synchronized boolean moveItemToBank(PlayerCharacter pc) { |
|
|
|
if (!DbManager.ItemQueries.UPDATE_OWNER(this, |
|
|
|
if (!DbManager.ItemQueries.UPDATE_OWNER(this, |
|
|
|
pc.getObjectUUID(), //UUID
|
|
|
|
pc.getObjectUUID(), //UUID
|
|
|
|
false, //isNPC
|
|
|
|
//isNPC
|
|
|
|
true, //isPlayer
|
|
|
|
//isPlayer
|
|
|
|
false, //isAccount
|
|
|
|
//isAccount
|
|
|
|
ItemContainerType.BANK, |
|
|
|
ItemContainerType.BANK, |
|
|
|
0)) //Slot
|
|
|
|
EquipSlotType.NONE)) //Slot
|
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
this.zeroItem(); |
|
|
|
this.zeroItem(); |
|
|
@ -882,11 +882,11 @@ public class Item extends AbstractWorldObject { |
|
|
|
protected synchronized boolean moveItemToBank(NPC npc) { |
|
|
|
protected synchronized boolean moveItemToBank(NPC npc) { |
|
|
|
if (!DbManager.ItemQueries.UPDATE_OWNER(this, |
|
|
|
if (!DbManager.ItemQueries.UPDATE_OWNER(this, |
|
|
|
npc.getObjectUUID(), //UUID
|
|
|
|
npc.getObjectUUID(), //UUID
|
|
|
|
true, //isNPC
|
|
|
|
//isNPC
|
|
|
|
false, //isPlayer
|
|
|
|
//isPlayer
|
|
|
|
false, //isAccount
|
|
|
|
//isAccount
|
|
|
|
ItemContainerType.BANK, |
|
|
|
ItemContainerType.BANK, |
|
|
|
0)) //Slot
|
|
|
|
EquipSlotType.NONE)) //Slot
|
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
this.zeroItem(); |
|
|
|
this.zeroItem(); |
|
|
@ -900,11 +900,11 @@ public class Item extends AbstractWorldObject { |
|
|
|
protected synchronized boolean moveItemToVault(Account a) { |
|
|
|
protected synchronized boolean moveItemToVault(Account a) { |
|
|
|
if (!DbManager.ItemQueries.UPDATE_OWNER(this, |
|
|
|
if (!DbManager.ItemQueries.UPDATE_OWNER(this, |
|
|
|
a.getObjectUUID(), //UUID
|
|
|
|
a.getObjectUUID(), //UUID
|
|
|
|
false, //isNPC
|
|
|
|
//isNPC
|
|
|
|
false, //isPlayer
|
|
|
|
//isPlayer
|
|
|
|
true, //isAccount
|
|
|
|
//isAccount
|
|
|
|
ItemContainerType.VAULT, |
|
|
|
ItemContainerType.VAULT, |
|
|
|
0)) //Slot
|
|
|
|
EquipSlotType.NONE)) //Slot
|
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
this.zeroItem(); |
|
|
|
this.zeroItem(); |
|
|
@ -919,11 +919,11 @@ public class Item extends AbstractWorldObject { |
|
|
|
|
|
|
|
|
|
|
|
if (!DbManager.ItemQueries.UPDATE_OWNER(this, |
|
|
|
if (!DbManager.ItemQueries.UPDATE_OWNER(this, |
|
|
|
pc.getObjectUUID(), //tableID
|
|
|
|
pc.getObjectUUID(), //tableID
|
|
|
|
false, //isNPC
|
|
|
|
//isNPC
|
|
|
|
true, //isPlayer
|
|
|
|
//isPlayer
|
|
|
|
false, //isAccount
|
|
|
|
//isAccount
|
|
|
|
ItemContainerType.EQUIPPED, |
|
|
|
ItemContainerType.EQUIPPED, |
|
|
|
slot.ordinal())) //Slot
|
|
|
|
slot)) //Slot
|
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
this.zeroItem(); |
|
|
|
this.zeroItem(); |
|
|
@ -937,11 +937,11 @@ public class Item extends AbstractWorldObject { |
|
|
|
protected synchronized boolean equipItem(NPC npc, Enum.EquipSlotType slot) { |
|
|
|
protected synchronized boolean equipItem(NPC npc, Enum.EquipSlotType slot) { |
|
|
|
if (!DbManager.ItemQueries.UPDATE_OWNER(this, |
|
|
|
if (!DbManager.ItemQueries.UPDATE_OWNER(this, |
|
|
|
npc.getObjectUUID(), //UUID
|
|
|
|
npc.getObjectUUID(), //UUID
|
|
|
|
true, //isNPC
|
|
|
|
//isNPC
|
|
|
|
false, //isPlayer
|
|
|
|
//isPlayer
|
|
|
|
false, //isAccount
|
|
|
|
//isAccount
|
|
|
|
ItemContainerType.EQUIPPED, |
|
|
|
ItemContainerType.EQUIPPED, |
|
|
|
slot.ordinal())) //Slot
|
|
|
|
slot)) //Slot
|
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
this.zeroItem(); |
|
|
|
this.zeroItem(); |
|
|
|