Handler created for equip message.

This commit is contained in:
2024-03-08 13:39:38 -05:00
parent caf708bed6
commit 20cb8ef94d
4 changed files with 27 additions and 29 deletions
+8 -8
View File
@@ -956,7 +956,7 @@ public class Item extends AbstractWorldObject {
return true;
}
protected synchronized boolean equipItem(PlayerCharacter pc, byte slot) {
protected synchronized boolean equipItem(PlayerCharacter pc, Enum.EquipSlotType slot) {
if (!DbManager.ItemQueries.UPDATE_OWNER(this,
pc.getObjectUUID(), //tableID
@@ -964,42 +964,42 @@ public class Item extends AbstractWorldObject {
true, //isPlayer
false, //isAccount
ItemContainerType.EQUIPPED,
slot)) //Slot
slot.ordinal())) //Slot
return false;
this.zeroItem();
this.ownerID = pc.getObjectUUID();
this.ownerType = OwnerType.PlayerCharacter;
this.containerType = Enum.ItemContainerType.EQUIPPED;
this.equipSlot = EquipSlotType.values()[slot];
this.equipSlot = slot;
return true;
}
protected synchronized boolean equipItem(NPC npc, byte slot) {
protected synchronized boolean equipItem(NPC npc, Enum.EquipSlotType slot) {
if (!DbManager.ItemQueries.UPDATE_OWNER(this,
npc.getObjectUUID(), //UUID
true, //isNPC
false, //isPlayer
false, //isAccount
ItemContainerType.EQUIPPED,
slot)) //Slot
slot.ordinal())) //Slot
return false;
this.zeroItem();
this.ownerID = npc.getObjectUUID();
this.ownerType = OwnerType.Npc;
this.containerType = Enum.ItemContainerType.EQUIPPED;
this.equipSlot = EquipSlotType.values()[slot];
this.equipSlot = slot;
return true;
}
protected synchronized boolean equipItem(Mob npc, byte slot) {
protected synchronized boolean equipItem(Mob npc, Enum.EquipSlotType slot) {
this.zeroItem();
this.ownerID = npc.getObjectUUID();
this.ownerType = OwnerType.Mob;
this.containerType = Enum.ItemContainerType.EQUIPPED;
this.equipSlot = EquipSlotType.values()[slot];
this.equipSlot = slot;
return true;
}