public static void HandleObjectUseMultiple(ObjectUseMultipleMessage message, WorldClient client) { var item = client.Character.Inventory.GetItem(message.objectUID); for (int i = 0; i < message.quantity; i++) { ItemUseEffectsProvider.HandleEffects(client, item); } client.Character.Inventory.RemoveItem(item.UID, message.quantity); }
public static void HandleObjectUse(ObjectUseMessage message, WorldClient client) { var item = client.Character.Inventory.GetItem(message.objectUID); if (item != null) { if (CustomObjectUseHandler.CustomHandlerExist(item.GID)) { CustomObjectUseHandler.Handle(client, item); client.Character.RefreshShortcuts(); return; } if (ItemUseEffectsProvider.HandleEffects(client, item)) { client.Character.Inventory.RemoveItem(item.UID, 1); } client.Character.RefreshShortcuts(); } }