public static void HandleObjectSetPosition(ObjectSetPositionMessage message, WorldClient client) { if (!client.Character.Fighting && !client.Character.Busy) { client.Character.Inventory.SetItemPosition(message.objectUID, (CharacterInventoryPositionEnum)message.position, message.quantity); } }
public void EquipItem(int uid) { if (ItemExists(uid) && ItemQuantity(uid) > 0) { ObjectSetPositionMessage msg = new ObjectSetPositionMessage(uid, (byte)GetPosition(GetItemFromUID(uid).Type), 1); Account.SocketManager.Send(msg); Account.Log(new ActionTextInformation(GetItemFromUID(uid).Name + " équipé."), 2); } }
public static void HandleObjectSetPositionMessage(WorldClient client, ObjectSetPositionMessage message) { if (System.Enum.IsDefined(typeof(CharacterInventoryPositionEnum), (int)message.position)) { BasePlayerItem basePlayerItem = client.Character.Inventory.TryGetItem((int)message.objectUID); if (basePlayerItem != null) { client.Character.Inventory.MoveItem(basePlayerItem, (CharacterInventoryPositionEnum)message.position); } } }
public void ObjectSetPositionMessageFrame(WorldClient client, ObjectSetPositionMessage objectSetPositionMessage) { var character = client.ActiveCharacter; var item = InventoryRepository.Instance.GetItemFromUID(character.Inventory, (int)objectSetPositionMessage.objectUID); if (item == null) { return; } switch ((CharacterInventoryPositionEnum)objectSetPositionMessage.position) { case CharacterInventoryPositionEnum.INVENTORY_POSITION_COSTUME: if (item.typeId != 199) { return; } InventoryRepository.Instance.MoveItemToPosition(client, (int)objectSetPositionMessage.objectUID, (int)objectSetPositionMessage.position); break; case CharacterInventoryPositionEnum.ACCESSORY_POSITION_BELT: if (item.typeId == 10) { InventoryRepository.Instance.MoveItemToPosition(client, (int)objectSetPositionMessage.objectUID, (int)objectSetPositionMessage.position, item.typeId == 177 ? true : false); } break; case CharacterInventoryPositionEnum.ACCESSORY_POSITION_HAT: if (item.typeId == 16 || item.typeId == 177) //chapeau et apparat { InventoryRepository.Instance.MoveItemToPosition(client, (int)objectSetPositionMessage.objectUID, (int)objectSetPositionMessage.position, item.typeId == 177 ? true : false); } break; case CharacterInventoryPositionEnum.ACCESSORY_POSITION_CAPE: if (item.typeId == 81 || item.typeId == 17) //cape et sac { InventoryRepository.Instance.MoveItemToPosition(client, (int)objectSetPositionMessage.objectUID, (int)objectSetPositionMessage.position); } break; case CharacterInventoryPositionEnum.INVENTORY_POSITION_NOT_EQUIPED: InventoryRepository.Instance.UnequipItem(client, client.ActiveCharacter.Inventory, (int)objectSetPositionMessage.objectUID); break; } //update du skin this.SendInventoryWeight(client); }
public static void HandleObjectSetPositionMessage(WorldClient client, ObjectSetPositionMessage message) { if (!Enum.IsDefined(typeof(CharacterInventoryPositionEnum), (int)message.position)) { return; } var item = client.Character.Inventory.TryGetItem(message.objectUID); if (item == null) { return; } client.Character.Inventory.MoveItem(item, (CharacterInventoryPositionEnum)message.position); }
public static void HandleObjectSetPosition(ObjectSetPositionMessage message, WorldClient client) { client.Character.Inventory.MoveItem(message.objectUID, message.position, message.quantity); }