Esempio n. 1
0
        public ItemProto GetItemProto(UInt32 _entry)
        {
            ItemProto _ip = new ItemProto();
            foreach (KeyValuePair<UInt32, ItemProto> o in ItemProtoMap)
            {
                if (o.Value.Id == _entry)
                {
                    return o.Value;

                }
            }
            return _ip;
        }
Esempio n. 2
0
 public void Add(ItemProto _proto)
 {
     ItemProtoMap.Add(_proto.Id, _proto);
 }
Esempio n. 3
0
        public void _ItemQuerySingleResponse(PacketIn packet)
        {
            UInt32 ItemID;
              //  UInt32 unk;
               // uint unk8;
              //  string s;

            ItemID = packet.ReadUInt32();

            if (!(ItemID == 0x80000000)) // invalid item flag?
            {
                ItemProto proto = new ItemProto();
                proto.Id = ItemID;
                proto.Class = packet.ReadUInt32();
                proto.SubClass = packet.ReadUInt32();
                packet.ReadUInt32();
                proto.Name = packet.ReadString();
                packet.ReadByte();
                packet.ReadByte();
                packet.ReadByte();
                proto.DisplayInfoID = packet.ReadUInt32();
                proto.Quality = packet.ReadUInt32();
                proto.Flags = packet.ReadUInt32();
                proto.Faction = packet.ReadUInt32();
                proto.BuyPrice = packet.ReadUInt32();
                proto.SellPrice = packet.ReadUInt32();
                proto.InventoryType = packet.ReadUInt32();
                proto.AllowableClass = packet.ReadUInt32();
                proto.AllowableRace = packet.ReadUInt32();
                proto.ItemLevel = packet.ReadUInt32();
                proto.RequiredLevel = packet.ReadUInt32();
                proto.RequiredSkill = packet.ReadUInt32();
                proto.RequiredSkillRank = packet.ReadUInt32();
                proto.RequiredSpell = packet.ReadUInt32();
                proto.RequiredHonorRank = packet.ReadUInt32();
                proto.RequiredCityRank = packet.ReadUInt32();
                proto.RequiredReputationFaction = packet.ReadUInt32();
                proto.RequiredReputationRank = packet.ReadUInt32();
                proto.MaxCount = packet.ReadUInt32();
                proto.Stackable = packet.ReadUInt32();
                proto.ContainerSlots = packet.ReadUInt32();
                proto.StatsCount = packet.ReadUInt32();
                for (UInt32 i = 0; i<proto.StatsCount; i++)
                {
                    proto.ItemStat = new _ItemStat[10];
                    proto.ItemStat[i].ItemStatType = packet.ReadUInt32();
                    proto.ItemStat[i].ItemStatValue = packet.ReadUInt32();
                }
                proto.ScalingStatDistribution = packet.ReadUInt32();
                proto.ScalingStatValue = packet.ReadUInt32();
                for (int i = 0; i < 2; i++)
                {
                    proto.Damage = new _ItemDamage[2];
                    proto.Damage[i].DamageMin = packet.ReadFloat();
                    proto.Damage[i].DamageMax = packet.ReadFloat();
                    proto.Damage[i].DamageType = packet.ReadUInt32();
                }
                proto.Armor = packet.ReadUInt32();
                proto.HolyRes = packet.ReadUInt32();
                proto.FireRes = packet.ReadUInt32();
                proto.NatureRes = packet.ReadUInt32();
                proto.FrostRes = packet.ReadUInt32();
                proto.ShadowRes = packet.ReadUInt32();
                proto.ArcaneRes = packet.ReadUInt32();
                proto.Delay = packet.ReadUInt32();
                proto.Ammo_type = packet.ReadUInt32();
                proto.RangedModRange = packet.ReadFloat();
                for (int i = 0; i < 5; i++)
                {
                    proto.Spells = new _ItemSpell[5];
                    proto.Spells[i].SpellId = packet.ReadUInt32();
                    proto.Spells[i].SpellTrigger = packet.ReadUInt32();
                    proto.Spells[i].SpellCharges = packet.ReadUInt32();
                    proto.Spells[i].SpellCooldown = packet.ReadUInt32();
                    proto.Spells[i].SpellCategory = packet.ReadUInt32();
                    proto.Spells[i].SpellCategoryCooldown = packet.ReadUInt32();
                }
                proto.Bonding = packet.ReadUInt32();
                proto.Description = packet.ReadString();
                proto.PageText = packet.ReadUInt32();
                proto.LanguageID = packet.ReadUInt32();
                proto.PageMaterial = packet.ReadUInt32();
                proto.StartQuest = packet.ReadUInt32();
                proto.LockID = packet.ReadUInt32();
                proto.Material = packet.ReadUInt32();
                proto.Sheath = packet.ReadUInt32();
                proto.RandomProperty = packet.ReadUInt32();
                proto.RandomSuffix = packet.ReadUInt32();
                proto.Block = packet.ReadUInt32();
                proto.ItemSet = packet.ReadUInt32();
                proto.MaxDurability = packet.ReadUInt32();
                proto.Area = packet.ReadUInt32();
                proto.Map = packet.ReadUInt32();
                proto.BagFamily = packet.ReadUInt32();
                proto.TotemCategory = packet.ReadUInt32();
                for (UInt32 i = 0; i < 3; i++)
                {
                    proto.Socket = new _ItemSocket[3];
                    proto.Socket[i].Color = packet.ReadUInt32();
                    proto.Socket[i].Content = packet.ReadUInt32();
                }
                proto.socketBonus = packet.ReadUInt32();
                proto.GemProperties = packet.ReadUInt32();
                proto.RequiredDisenchantSkill = packet.ReadUInt32();
                proto.ArmorDamageModifier = packet.ReadFloat();
                proto.Duration = packet.ReadInt32();
                proto.ItemLimitCategory = packet.ReadUInt32();
                proto.HolidayId = packet.ReadUInt32();

                //TODO
               /* objmgr.Add(proto);
                objmgr.AssignNameToObj(proto->Id, TYPEID_ITEM, proto->Name);
                objmgr.AssignNameToObj(proto->Id, TYPEID_CONTAINER, proto->Name);*/

            }
        }