Пример #1
0
 public void SetToItem(InventoryObject Item)
 {
     buttonType    = ActionButtonType.Item;
     name          = Item.Name;
     Data          = Item;
     numOfSameName = Item.NumOfSameName;
 }
        public override int ReadFrom(byte[] Buffer, int StartIndex = 0)
        {
            int cursor = StartIndex;

            cursor += base.ReadFrom(Buffer, cursor);

            NewInventoryObject = new InventoryObject(Buffer, cursor);
            cursor += NewInventoryObject.ByteLength;

            return cursor - StartIndex;
        }
Пример #3
0
        public void SetToItem(InventoryObject Item)
        {
            if (Item == null)
            {
                return;
            }

            RemoveListener();

            buttonType    = ActionButtonType.Item;
            name          = Item.Name;
            numOfSameName = Item.NumOfSameName;

            Data = Item;
            Item.PropertyChanged += OnObjectPropertyChanged;
        }
Пример #4
0
        public override int ReadFrom(byte[] Buffer, int StartIndex = 0)
        {
            int cursor = StartIndex;

            cursor += base.ReadFrom(Buffer, cursor);

            ushort len = BitConverter.ToUInt16(Buffer, cursor);
            cursor += TypeSizes.SHORT;

            InventoryObjects = new InventoryObject[len];
            for (int i = 0; i < len; i++)
            {
                InventoryObjects[i] = new InventoryObject(Buffer, cursor);
                cursor += InventoryObjects[i].ByteLength;
            }

            return cursor - StartIndex;
        }
Пример #5
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="InventoryItem"></param>
        /// <param name="UnsetMode"></param>
        protected void ParseItem(InventoryObject InventoryItem, bool UnsetMode = false)
        {
            uint id = 0;
            if (!UnsetMode)
                id = InventoryItem.ID;

            switch (InventoryItem.Name)
            {
                // robes
                case ResourceStrings.Items.Equipment.DISCIPLEROBES:                  
                    
                    switch(InventoryItem.ColorTranslation)  
                    {
                        case RobesColors.WHITE1:
                        case RobesColors.WHITE2:
                        case RobesColors.WHITE3:
                            ShaRobe = InventoryItem;
                            break;

                        case RobesColors.GREY1:
                        case RobesColors.GREY2:
                        case RobesColors.GREY3:
                            QorRobe = InventoryItem;
                            break;

                        case RobesColors.BLUE1:
                        case RobesColors.BLUE2:
                        case RobesColors.BLUE3:
                            KraRobe = InventoryItem;
                            break;

                        case RobesColors.RED1:
                        case RobesColors.RED2:
                        case RobesColors.RED3:
                            FarRobe = InventoryItem;
                            break;

                        case RobesColors.PURPLE1:
                        case RobesColors.PURPLE2:
                        case RobesColors.PURPLE3:
                            RijRobe = InventoryItem;
                            break;

                        case RobesColors.GREEN1:
                        case RobesColors.GREEN2:
                        case RobesColors.GREEN3:
                            JalRobe = InventoryItem;
                            break;
                    }
                    break;

                // armor
                case ResourceStrings.Items.Armor.PLATE:
                    Plate = InventoryItem;
                    break;

                case ResourceStrings.Items.Armor.SCALE:
                    Scale = InventoryItem;
                    break;

                // head
                case ResourceStrings.Items.Helms.IVYCIRCLET:
                    Ivy = InventoryItem;
                    break;

                case ResourceStrings.Items.Helms.MSH:
                    MSH = InventoryItem;
                    break;

                case ResourceStrings.Items.Helms.HELM:
                    Helm = InventoryItem;
                    break;

                // other
                case ResourceStrings.Items.Equipment.PANTS:
                    Pants = InventoryItem;
                    break;

                case ResourceStrings.Items.Equipment.LIGHTJERKIN:
                    Jerkin = InventoryItem;
                    break;

                case ResourceStrings.Items.Equipment.GAUNTLETS:
                    Gauntlets = InventoryItem;
                    break;

                case ResourceStrings.Items.Equipment.JALANECKLACE:
                    JalaNecklace = InventoryItem;
                    break;

                case ResourceStrings.Items.Equipment.TRUELUTE:
                    TrueLute = InventoryItem;  
                    break;

                case ResourceStrings.Items.Equipment.JEWELOFFROZ:
                    FrozJewel = InventoryItem;
                    break;

                case ResourceStrings.Items.Weapons.RIIJASWORD:
                    RiijaSword = InventoryItem;
                    break;
            }
        }
Пример #6
0
        public override unsafe void ReadFrom(ref byte* Buffer)
        {
            base.ReadFrom(ref Buffer);

            ushort len = *((ushort*)Buffer);
            Buffer += TypeSizes.SHORT;

            InventoryObjects = new InventoryObject[len];
            for (int i = 0; i < len; i++)
                InventoryObjects[i] = new InventoryObject(ref Buffer);

        }
Пример #7
0
 public InventoryMessage(InventoryObject[] InventoryObjects) 
     : base(MessageTypeGameMode.Inventory)
 {           
     this.InventoryObjects = InventoryObjects;
 }
 public InventoryAddMessage(InventoryObject InventoryObject) 
     : base(MessageTypeGameMode.InventoryAdd)
 {         
     this.NewInventoryObject = InventoryObject;                      
 }
Пример #9
0
 public void SetToItem(InventoryObject Item)
 {
     buttonType = ActionButtonType.Item;
     name = Item.Name;
     Data = Item;
     numOfSameName = Item.NumOfSameName;
 }
 public InventoryObjectEventArgs(InventoryObject InventoryObject)
 {
     this.InventoryObject = InventoryObject;
 }