public static void HandleWrapperObjectDissociateRequest(WrapperObjectDissociateRequestMessage message, WorldClient client)
        {
            CharacterItemRecord item = client.Character.Inventory.GetItem(message.hostUID);

            if (item != null)
            {
                client.Character.Inventory.DissociateCompatibility(item,
                                                                   (CharacterInventoryPositionEnum)message.hostPos);
            }
        }
Beispiel #2
0
        public void WrapperObjectDissociateRequestMessageFrame(WorldClient client, WrapperObjectDissociateRequestMessage wrapperObjectDissociateRequestMessage)
        {
            if (client.ActiveCharacter == null)
            {
                return;
            }

            InventoryRepository.Instance.DissociateApparat(client, (int)wrapperObjectDissociateRequestMessage.hostUID);

            //update du skin
            this.SendInventoryWeight(client);
        }
Beispiel #3
0
        public static void HandleWrapperObjectDissociateRequestMessage(WorldClient client, WrapperObjectDissociateRequestMessage message)
        {
            if (client.Character.IsInFight() || client.Character.IsInExchange())
            {
                return;
            }

            var host = client.Character.Inventory.TryGetItem(message.hostUID);

            if (host == null)
            {
                return;
            }

            var apparenceWrapper = host.Effects.FirstOrDefault(x => x.EffectId == EffectsEnum.Effect_Apparence_Wrapper) as EffectInteger;

            if (apparenceWrapper == null)
            {
                return;
            }

            var wrapperItemTemplate = ItemManager.Instance.TryGetTemplate(apparenceWrapper.Value);

            host.Effects.RemoveAll(x => x.EffectId == EffectsEnum.Effect_Apparence_Wrapper);

            host.Invalidate();
            client.Character.Inventory.RefreshItem(host);
            host.OnObjectModified();

            var wrapperItem = ItemManager.Instance.CreatePlayerItem(client.Character, wrapperItemTemplate, 1);

            client.Character.Inventory.AddItem(wrapperItem);
            client.Character.UpdateLook();

            SendInventoryWeightMessage(client);
        }