コード例 #1
0
        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);
        }
コード例 #2
0
        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();
            }
        }