Пример #1
0
        public void Load(ByteBuffer buff, int statsyesno)
        {
            uint  previousEquipted = 0;
            ulong previousCount    = 0;

            //ch(hdddqhhhdhhdddhhhhhhhhhhhhd)
            ID       = buff.ReadUInt32();
            ItemID   = buff.ReadUInt32();
            Location = buff.ReadUInt32(); //Location slot

            if (statsyesno == 1)
            {
                foreach (InventoryInfo inv_inf in Globals.gamedata.inventory.Values)
                {
                    if (Util.GetInventoryItemID(inv_inf.ID) == ItemID || inv_inf.ID == ID)
                    {
                        previousEquipted = inv_inf.isEquipped;
                        previousCount    = inv_inf.Count;
                        break;
                    }
                }
            }

            Count      = buff.ReadUInt64();
            Type2      = buff.ReadUInt16();
            Type3      = buff.ReadUInt16();
            isEquipped = buff.ReadUInt16();
            Slot       = (InventorySlots)buff.ReadUInt32();
            Enchant    = buff.ReadUInt16();
            Type4      = buff.ReadUInt16();
            AugID      = buff.ReadUInt32();
            Mana       = buff.ReadUInt32();
            lease_time = buff.ReadInt32();

            buff.ReadUInt16();

            attack_element   = (InventoryElement)buff.ReadUInt16();
            attack_magnitude = buff.ReadInt16();
            fire_defense     = buff.ReadInt16();
            water_defense    = buff.ReadInt16();
            wind_defense     = buff.ReadInt16();
            earth_defense    = buff.ReadInt16();
            unholy_defense   = buff.ReadInt16();
            holy_defense     = buff.ReadInt16();
            //enchant_effect_0 = buff.ReadUInt16();
            //enchant_effect_1 = buff.ReadUInt16();
            //enchant_effect_2 = buff.ReadUInt16();

            buff.ReadUInt32();

            //stats stuff
            if (statsyesno == 1)
            {
                updateStats(ID, ItemID, previousEquipted, isEquipped, previousCount, Count);
            }
        }
Пример #2
0
        public void Load_Images()
        {
            string   sk;
            ShortCut sc;

            //need to grab all the crap on this page and set the background pics
            for (int i = 0; i < Globals.Skills_PerPage; i++)
            {
                sc = ((ShortCut)Globals.gamedata.ShortCuts[i + page * Globals.Skills_PerPage]);

                try
                {
                    switch (sc.Type)
                    {
                    case ShortCut_Types.ITEM:
                        //need to go thru the inventory and find the item, then put its id or w/e
                        Set_Image(i, Util.GetItemImagePath(Util.GetInventoryItemID(sc.ID)));
                        break;

                    case ShortCut_Types.SKILL:
                        sk = sc.ID.ToString();
                        while (sk.Length < 4)
                        {
                            sk = "0" + sk;
                        }

                        Set_Image(i, Globals.PATH + "\\Icons\\skill" + sk + "_0.BMP");
                        break;

                    case ShortCut_Types.ACTION:
                        Set_Image(i, Globals.PATH + "\\Icons\\" + ((Actions)Globals.actionlist[sc.ID]).Icon + "_0.BMP");
                        break;

                    case ShortCut_Types.MACRO:
                        Set_Image(i, Util.GetItemImagePath(sc.ID));
                        break;

                    case ShortCut_Types.RECIPE:
                        Set_Image(i, Util.GetItemImagePath(sc.ID));
                        break;

                    default:
                        //lol?
                        //either no button, or something fcked up
                        Clear_Image(i);
                        break;
                    }                    //switch
                }
                catch
                {
                    //something broke... meh
                }
            }
        }