Example #1
0
        public override ItemLevelInfo ConvertTo(byte[] rawData, ref int id)
        {
            int           num5;
            ItemLevelInfo info = new ItemLevelInfo();
            int           num  = 0;

            id         = num5 = DBCRecordConverter.GetInt32(rawData, num++);
            info.Level = (uint)num5;
            for (int i = 0; i < 5; i++)
            {
                info.EpicPoints[i] = DBCRecordConverter.GetUInt32(rawData, num++);
            }

            for (int j = 0; j < 5; j++)
            {
                info.RarePoints[j] = DBCRecordConverter.GetUInt32(rawData, num++);
            }

            for (int k = 0; k < 5; k++)
            {
                info.UncommonPoints[k] = DBCRecordConverter.GetUInt32(rawData, num++);
            }

            return(info);
        }
        public override void Convert(byte[] rawData)
        {
            MapDifficultyEntry mapDifficultyEntry = new MapDifficultyEntry();

            mapDifficultyEntry.Id                = (uint)DBCRecordConverter.GetInt32(rawData, 0);
            mapDifficultyEntry.MapId             = (MapId)DBCRecordConverter.GetUInt32(rawData, 1);
            mapDifficultyEntry.Index             = DBCRecordConverter.GetUInt32(rawData, 2);
            mapDifficultyEntry.RequirementString = this.GetString(rawData, 3);
            mapDifficultyEntry.ResetTime         = DBCRecordConverter.GetInt32(rawData, 20);
            mapDifficultyEntry.MaxPlayerCount    = DBCRecordConverter.GetInt32(rawData, 21);
            MapTemplate mapTemplate = WCell.RealmServer.Global.World.GetMapTemplate(mapDifficultyEntry.MapId);

            if (mapTemplate == null)
            {
                return;
            }
            if ((double)mapDifficultyEntry.Index >= 4.0)
            {
                LogManager.GetCurrentClassLogger().Warn("Invalid MapDifficulty for {0} with Index {1}.",
                                                        (object)mapDifficultyEntry.MapId, (object)mapDifficultyEntry.Index);
            }
            else
            {
                if (mapDifficultyEntry.MaxPlayerCount == 0)
                {
                    mapDifficultyEntry.MaxPlayerCount = mapTemplate.MaxPlayerCount;
                }
                if (mapTemplate.Difficulties == null)
                {
                    mapTemplate.Difficulties = new MapDifficultyEntry[4];
                }
                mapDifficultyEntry.Finalize(mapTemplate);
                mapTemplate.Difficulties[mapDifficultyEntry.Index] = mapDifficultyEntry;
            }
        }
Example #3
0
        public override VehicleEntry ConvertTo(byte[] rawData, ref int id)
        {
            id = DBCRecordConverter.GetInt32(rawData, 0);
            VehicleEntry vehicleEntry = new VehicleEntry()
            {
                Id         = DBCRecordConverter.GetUInt32(rawData, 0),
                Flags      = (VehicleFlags)DBCRecordConverter.GetUInt32(rawData, 1),
                TurnSpeed  = DBCRecordConverter.GetFloat(rawData, 2),
                PitchSpeed = DBCRecordConverter.GetFloat(rawData, 3),
                PitchMin   = DBCRecordConverter.GetFloat(rawData, 4),
                PitchMax   = DBCRecordConverter.GetFloat(rawData, 5)
            };
            int num1 = 0;
            int num2 = 0;

            for (int index = 0; index < vehicleEntry.Seats.Length; ++index)
            {
                uint uint32 = DBCRecordConverter.GetUInt32(rawData, 6 + index);
                if (uint32 > 0U)
                {
                    VehicleSeatEntry vehicleSeatEntry = NPCMgr.GetVehicleSeatEntry(uint32);
                    vehicleEntry.Seats[index] = vehicleSeatEntry;
                    ++num2;
                    num1 = index;
                }
            }

            vehicleEntry.SeatCount = num2;
            if (num1 < 7)
            {
                Array.Resize <VehicleSeatEntry>(ref vehicleEntry.Seats, num1 + 1);
            }
            vehicleEntry.PowerType = (VehiclePowerType)DBCRecordConverter.GetInt32(rawData, 37);
            return(vehicleEntry);
        }
Example #4
0
        public override ItemRandomSuffixEntry ConvertTo(byte[] rawData, ref int id)
        {
            ItemRandomSuffixEntry entry = new ItemRandomSuffixEntry();
            uint num = 5;
            int field = 0;
            entry.Id = id = DBCRecordConverter.GetInt32(rawData, field++);
            field += 0x12;
            entry.Enchants = new ItemEnchantmentEntry[num];
            entry.Values = new int[num];
            for (int i = 0; i < num; i++)
            {
                uint num4 = DBCRecordConverter.GetUInt32(rawData, field);
                if (num4 != 0)
                {
                    ItemEnchantmentEntry enchantmentEntry = EnchantMgr.GetEnchantmentEntry(num4);
                    if (enchantmentEntry != null)
                    {
                        entry.Enchants[i] = enchantmentEntry;
                        entry.Values[i] = DBCRecordConverter.GetInt32(rawData, field + ((int) num));
                    }
                }

                field++;
            }

            ArrayUtil.Trunc<ItemEnchantmentEntry>(ref entry.Enchants);
            ArrayUtil.TruncVals<int>(ref entry.Values);
            return entry;
        }
Example #5
0
            public override SkillAbility ConvertTo(byte[] rawData, ref int id)
            {
                SkillAbility ability = new SkillAbility();
                int          field   = 0;

                id            = (int)(ability.AbilityId = DBCRecordConverter.GetUInt32(rawData, field++));
                ability.Skill = SkillHandler.ById[DBCRecordConverter.GetUInt32(rawData, field++)];
                SpellId spellId = (SpellId)DBCRecordConverter.GetUInt32(rawData, field++);

                if (spellId > SpellId.None)
                {
                    Spell spell = SpellHandler.Get(spellId);
                    if (spell != null)
                    {
                        ability.Spell = spell;
                    }
                }

                ability.RaceMask  = (RaceMask)DBCRecordConverter.GetUInt32(rawData, field++);
                ability.ClassMask = (ClassMask)DBCRecordConverter.GetUInt32(rawData, field++);
                DBCRecordConverter.GetUInt32(rawData, field++);
                DBCRecordConverter.GetUInt32(rawData, field++);
                DBCRecordConverter.GetInt32(rawData, field++);
                ability.NextSpellId   = (SpellId)DBCRecordConverter.GetUInt32(rawData, field++);
                ability.AcquireMethod = (SkillAcquireMethod)DBCRecordConverter.GetInt32(rawData, field++);
                ability.GreyValue     = DBCRecordConverter.GetUInt32(rawData, field++);
                ability.YellowValue   = DBCRecordConverter.GetUInt32(rawData, field);
                uint num2 = ability.GreyValue - ability.YellowValue;
                int  num3 = (int)(ability.YellowValue - (num2 / 2));

                ability.RedValue     = (num3 < 0) ? 0 : ((uint)num3);
                ability.GreenValue   = ability.YellowValue + (num2 / 2);
                ability.CanGainSkill = ability.GreenValue > 0;
                return(ability);
            }
Example #6
0
        public override FactionEntry ConvertTo(byte[] rawData, ref int id)
        {
            FactionEntry factionEntry = new FactionEntry();

            id = (int)(factionEntry.Id = (FactionId)DBCRecordConverter.GetUInt32(rawData, 0));
            factionEntry.FactionIndex = (FactionReputationIndex)DBCRecordConverter.GetInt32(rawData, 1);
            factionEntry.RaceMask     = new RaceMask[4];
            for (int index = 0; index < factionEntry.RaceMask.Length; ++index)
            {
                factionEntry.RaceMask[index] = (RaceMask)DBCRecordConverter.GetUInt32(rawData, 2 + index);
            }
            factionEntry.ClassMask = new ClassMask[4];
            for (int index = 0; index < factionEntry.ClassMask.Length; ++index)
            {
                factionEntry.ClassMask[index] = (ClassMask)DBCRecordConverter.GetUInt32(rawData, 6 + index);
            }
            factionEntry.BaseRepValue = new int[4];
            for (int index = 0; index < factionEntry.BaseRepValue.Length; ++index)
            {
                factionEntry.BaseRepValue[index] = DBCRecordConverter.GetInt32(rawData, 10 + index);
            }
            factionEntry.BaseFlags = new FactionFlags[4];
            for (int index = 0; index < factionEntry.BaseFlags.Length; ++index)
            {
                factionEntry.BaseFlags[index] = (FactionFlags)DBCRecordConverter.GetInt32(rawData, 14 + index);
            }
            factionEntry.ParentId = (FactionId)DBCRecordConverter.GetUInt32(rawData, 18);
            factionEntry.Name     = this.GetString(rawData, 23);
            return(factionEntry);
        }
Example #7
0
        public override void Convert(byte[] rawData)
        {
            uint       uint32    = DBCRecordConverter.GetUInt32(rawData, 1);
            RaceId     race      = (RaceId)((int)uint32 & (int)byte.MaxValue);
            ClassId    clssId    = (ClassId)((uint32 & 65280U) >> 8);
            GenderType gender    = (GenderType)((uint32 & 16711680U) >> 16);
            Archetype  archetype = ArchetypeMgr.GetArchetype(race, clssId);

            if (archetype == null)
            {
                return;
            }
            List <ItemStack> initialItems = archetype.GetInitialItems(gender);

            for (int field = 2; field <= 25; ++field)
            {
                int itemId = DBCRecordConverter.GetInt32(rawData, field);
                if (itemId > 0)
                {
                    ItemTemplate template = ItemMgr.GetTemplate((Asda2ItemId)itemId);
                    if (template == null)
                    {
                        LogManager.GetCurrentClassLogger()
                        .Warn("Missing initial Item in DB: " + (object)itemId + " (" + (object)(uint)itemId +
                              ")");
                    }
                    else if (template.IsStackable)
                    {
                        int index = initialItems.FindIndex((Predicate <ItemStack>)(stack =>
                                                                                   (long)stack.Template.Id == (long)itemId));
                        if (index > -1)
                        {
                            initialItems[index] = new ItemStack()
                            {
                                Template = template,
                                Amount   = initialItems[index].Amount + 1
                            }
                        }
                        ;
                        else
                        {
                            initialItems.Add(new ItemStack()
                            {
                                Template = template,
                                Amount   = template.IsAmmo ? template.MaxAmount : 1
                            });
                        }
                    }
                    else
                    {
                        initialItems.Add(new ItemStack()
                        {
                            Template = template,
                            Amount   = 1
                        });
                    }
                }
            }
        }
Example #8
0
 public override ItemMgr.TotemCategoryInfo ConvertTo(byte[] rawData, ref int id)
 {
     return(new ItemMgr.TotemCategoryInfo()
     {
         Id = id = DBCRecordConverter.GetInt32(rawData, 0),
         Name = this.GetString(rawData, 1)
     });
 }
 public override BattlemasterList ConvertTo(byte[] rawData, ref int bgId)
 {
     bgId = DBCRecordConverter.GetInt32(rawData, 0);
     return(new BattlemasterList()
     {
         BGId = (BattlegroundId)bgId,
         MapId = (MapId)DBCRecordConverter.GetUInt32(rawData, 1)
     });
 }
        public override void Convert(byte[] rawData)
        {
            QuestHonorInfo questHonorInfo = new QuestHonorInfo()
            {
                Level    = DBCRecordConverter.GetInt32(rawData, 0) - 1,
                RewHonor = DBCRecordConverter.GetInt32(rawData, 1)
            };

            QuestMgr.QuestHonorInfos[(uint)questHonorInfo.Level] = questHonorInfo;
        }
Example #11
0
        public override ItemEnchantmentCondition ConvertTo(byte[] rawData, ref int id)
        {
            int num2;
            ItemEnchantmentCondition condition = new ItemEnchantmentCondition();
            int num = 0;

            id           = num2 = DBCRecordConverter.GetInt32(rawData, num++);
            condition.Id = (uint)num2;
            return(condition);
        }
        public override GemProperties ConvertTo(byte[] rawData, ref int id)
        {
            GemProperties gemProperties = new GemProperties();

            gemProperties.Id = (uint)(id = DBCRecordConverter.GetInt32(rawData, 0));
            uint uint32 = DBCRecordConverter.GetUInt32(rawData, 1);

            gemProperties.Enchantment = EnchantMgr.GetEnchantmentEntry(uint32);
            gemProperties.Color       = (SocketColor)DBCRecordConverter.GetUInt32(rawData, 4);
            return(gemProperties);
        }
 public override PvPDifficultyEntry ConvertTo(byte[] rawData, ref int id)
 {
     return(new PvPDifficultyEntry()
     {
         Id = id = DBCRecordConverter.GetInt32(rawData, 0),
         mapId = (MapId)DBCRecordConverter.GetInt32(rawData, 1),
         bracketId = DBCRecordConverter.GetInt32(rawData, 2),
         minLevel = DBCRecordConverter.GetInt32(rawData, 3),
         maxLevel = DBCRecordConverter.GetInt32(rawData, 4)
     });
 }
 public override BarberShopStyleEntry ConvertTo(byte[] rawData, ref int id)
 {
     return(new BarberShopStyleEntry()
     {
         Id = DBCRecordConverter.GetInt32(rawData, 0),
         Type = DBCRecordConverter.GetInt32(rawData, 1),
         Race = (RaceId)DBCRecordConverter.GetUInt32(rawData, 37),
         Gender = (GenderType)DBCRecordConverter.GetUInt32(rawData, 38),
         HairId = DBCRecordConverter.GetInt32(rawData, 39)
     });
 }
Example #15
0
        public override void Convert(byte[] rawData)
        {
            MapTemplate val = new MapTemplate();

            val.Id = (MapId)DBCRecordConverter.GetUInt32(rawData, 0);
            int         num1         = 2;
            MapTemplate mapTemplate1 = val;

            byte[] data1    = rawData;
            int    field1   = num1;
            int    num2     = field1 + 1;
            int    uint32_1 = (int)DBCRecordConverter.GetUInt32(data1, field1);

            mapTemplate1.Type = (MapType)uint32_1;
            int         num3         = num2 + 1;
            MapTemplate mapTemplate2 = val;

            byte[] data2  = rawData;
            int    field2 = num3;
            int    num4   = field2 + 1;
            int    num5   = DBCRecordConverter.GetUInt32(data2, field2) != 0U ? 1 : 0;

            mapTemplate2.HasTwoSides = num5 != 0;
            MapTemplate mapTemplate3 = val;

            byte[] data3        = rawData;
            int    stringOffset = num4;
            int    num6         = stringOffset + 1;
            string str          = this.GetString(data3, stringOffset);

            mapTemplate3.Name = str;
            int         num7         = num6 + 16 + 1;
            MapTemplate mapTemplate4 = val;

            byte[] data4    = rawData;
            int    field3   = num7;
            int    num8     = field3 + 1;
            int    uint32_2 = (int)DBCRecordConverter.GetUInt32(data4, field3);

            mapTemplate4.AreaTableId = (uint)uint32_2;
            val.ParentMapId          = (MapId)DBCRecordConverter.GetUInt32(rawData, 59);
            val.RepopMapId           = val.ParentMapId;
            val.RepopPosition        = new Vector3(DBCRecordConverter.GetFloat(rawData, 60),
                                                   DBCRecordConverter.GetFloat(rawData, 61), 500f);
            val.RequiredClientId = (ClientId)DBCRecordConverter.GetUInt32(rawData, 63);
            val.DefaultResetTime = DBCRecordConverter.GetInt32(rawData, 64);
            val.MaxPlayerCount   = DBCRecordConverter.GetInt32(rawData, 65);
            ArrayUtil.Set <MapTemplate>(ref WCell.RealmServer.Global.World.s_MapTemplates, (uint)val.Id, val);
        }
Example #16
0
 public override ZoneTemplate ConvertTo(byte[] rawData, ref int id)
 {
     id = DBCRecordConverter.GetInt32(rawData, 0);
     return(new ZoneTemplate()
     {
         Id = (ZoneId)DBCRecordConverter.GetUInt32(rawData, 0),
         m_MapId = (MapId)DBCRecordConverter.GetUInt32(rawData, 1),
         m_parentZoneId = (ZoneId)DBCRecordConverter.GetUInt32(rawData, 2),
         ExplorationBit = DBCRecordConverter.GetInt32(rawData, 3),
         Flags = (ZoneFlags)DBCRecordConverter.GetUInt32(rawData, 4),
         AreaLevel = DBCRecordConverter.GetInt32(rawData, 10),
         Name = this.GetString(rawData, 11),
         Ownership = (FactionGroupMask)DBCRecordConverter.GetUInt32(rawData, 28)
     });
 }
Example #17
0
        public override void Convert(byte[] rawData)
        {
            AchievementEntry achievementEntry = new AchievementEntry();

            achievementEntry.ID          = DBCRecordConverter.GetUInt32(rawData, 0);
            achievementEntry.FactionFlag = DBCRecordConverter.GetInt32(rawData, 1);
            achievementEntry.MapID       = (MapId)DBCRecordConverter.GetUInt32(rawData, 2);
            achievementEntry.Names       = this.GetStrings(rawData, 4);
            AchievementCategoryEntryId uint32 = (AchievementCategoryEntryId)DBCRecordConverter.GetUInt32(rawData, 38);

            achievementEntry.Category       = AchievementMgr.GetCategoryEntry(uint32);
            achievementEntry.Points         = DBCRecordConverter.GetUInt32(rawData, 39);
            achievementEntry.Flags          = (AchievementFlags)DBCRecordConverter.GetUInt32(rawData, 41);
            achievementEntry.Count          = DBCRecordConverter.GetUInt32(rawData, 60);
            achievementEntry.RefAchievement = DBCRecordConverter.GetUInt32(rawData, 61);
            AchievementMgr.AchievementEntries[achievementEntry.ID] = achievementEntry;
        }
Example #18
0
        public override ItemRandomPropertyEntry ConvertTo(byte[] rawData, ref int id)
        {
            int num4;
            ItemRandomPropertyEntry entry = new ItemRandomPropertyEntry();
            int num = 0;

            id       = num4 = DBCRecordConverter.GetInt32(rawData, num++);
            entry.Id = (uint)num4;
            num++;
            for (int i = 0; i < entry.Enchants.Length; i++)
            {
                uint num3 = DBCRecordConverter.GetUInt32(rawData, num++);
                entry.Enchants[i] = EnchantMgr.GetEnchantmentEntry(num3);
            }

            return(entry);
        }
        public override ScalingStatValues ConvertTo(byte[] rawData, ref int id)
        {
            int num5;
            ScalingStatValues values = new ScalingStatValues();
            int num = 0;

            id           = num5 = DBCRecordConverter.GetInt32(rawData, num++);
            values.Id    = (uint)num5;
            values.Level = DBCRecordConverter.GetUInt32(rawData, num++);
            int index = 0;

            while (index < 4)
            {
                values.SsdMultiplier[index] = DBCRecordConverter.GetUInt32(rawData, num++);
                index++;
            }

            int num3 = 0;

            while (num3 < 5)
            {
                values.ArmorMod[num3] = DBCRecordConverter.GetUInt32(rawData, num++);
                num3++;
            }

            for (int i = 0; i < 6; i++)
            {
                values.DpsMod[i] = DBCRecordConverter.GetUInt32(rawData, num++);
            }

            values.SpellBonus = DBCRecordConverter.GetUInt32(rawData, num++);
            while (index < 6)
            {
                values.SsdMultiplier[index] = DBCRecordConverter.GetUInt32(rawData, num++);
                index++;
            }

            while (num3 < 8)
            {
                values.ArmorMod[num3] = DBCRecordConverter.GetUInt32(rawData, num++);
                num3++;
            }

            return(values);
        }
        public override CreatureFamily ConvertTo(byte[] rawData, ref int id)
        {
            CreatureFamily creatureFamily = new CreatureFamily()
            {
                Id            = (CreatureFamilyId)(id = (int)DBCRecordConverter.GetUInt32(rawData, 0)),
                MinScale      = DBCRecordConverter.GetFloat(rawData, 1),
                MaxScale      = DBCRecordConverter.GetFloat(rawData, 3),
                MaxScaleLevel = DBCRecordConverter.GetInt32(rawData, 4),
                SkillLine     = SkillHandler.Get(DBCRecordConverter.GetUInt32(rawData, 5)),
                PetFoodMask   = (PetFoodMask)DBCRecordConverter.GetUInt32(rawData, 7),
                PetTalentType = (PetTalentType)DBCRecordConverter.GetUInt32(rawData, 8),
                Name          = this.GetString(rawData, 10)
            };

            creatureFamily.ScaleStep = (creatureFamily.MaxScale - creatureFamily.MinScale) /
                                       (float)creatureFamily.MaxScaleLevel;
            return(creatureFamily);
        }
Example #21
0
            public override SkillLine ConvertTo(byte[] rawData, ref int id)
            {
                SkillLine line   = new SkillLine();
                int       offset = 0;

                id                    = (int)(line.Id = (SkillId)DBCRecordConverter.GetUInt32(rawData, offset++));
                line.Category         = (SkillCategory)DBCRecordConverter.GetInt32(rawData, offset++);
                line.SkillCostsDataId = DBCRecordConverter.GetInt32(rawData, offset++);
                line.Name             = base.GetString(rawData, ref offset);
                base.GetString(rawData, ref offset);
                DBCRecordConverter.GetInt32(rawData, offset++);
                base.GetString(rawData, ref offset);
                DBCRecordConverter.GetInt32(rawData, offset);
                if (line.Category == SkillCategory.Profession)
                {
                    line.Abandonable = 1;
                }

                return(line);
            }
Example #22
0
        public override void Convert(byte[] rawData)
        {
            QuestXPInfo questXpInfo = new QuestXPInfo()
            {
                Level = DBCRecordConverter.GetInt32(rawData, 0),
                RewXP = new int[8]
                {
                    DBCRecordConverter.GetInt32(rawData, 2),
                    DBCRecordConverter.GetInt32(rawData, 3),
                    DBCRecordConverter.GetInt32(rawData, 4),
                    DBCRecordConverter.GetInt32(rawData, 5),
                    DBCRecordConverter.GetInt32(rawData, 6),
                    DBCRecordConverter.GetInt32(rawData, 7),
                    DBCRecordConverter.GetInt32(rawData, 8),
                    DBCRecordConverter.GetInt32(rawData, 9)
                }
            };

            QuestMgr.QuestXpInfos[(uint)questXpInfo.Level] = questXpInfo;
        }
Example #23
0
        public override ScalingStatDistributionEntry ConvertTo(byte[] rawData, ref int id)
        {
            int num4;
            ScalingStatDistributionEntry entry = new ScalingStatDistributionEntry();
            int num = 0;

            id       = num4 = DBCRecordConverter.GetInt32(rawData, num++);
            entry.Id = (uint)num4;
            for (int i = 0; i < 10; i++)
            {
                entry.StatMod[i] = DBCRecordConverter.GetInt32(rawData, num++);
            }

            for (int j = 0; j < 10; j++)
            {
                entry.Modifier[j] = DBCRecordConverter.GetUInt32(rawData, num++);
            }

            entry.MaxLevel = DBCRecordConverter.GetUInt32(rawData, num++);
            return(entry);
        }
Example #24
0
        public override void Convert(byte[] rawData)
        {
            QuestRewRepInfo questRewRepInfo = new QuestRewRepInfo()
            {
                Id     = DBCRecordConverter.GetInt32(rawData, 0),
                RewRep = new int[9]
                {
                    DBCRecordConverter.GetInt32(rawData, 2),
                    DBCRecordConverter.GetInt32(rawData, 3),
                    DBCRecordConverter.GetInt32(rawData, 4),
                    DBCRecordConverter.GetInt32(rawData, 5),
                    DBCRecordConverter.GetInt32(rawData, 6),
                    DBCRecordConverter.GetInt32(rawData, 7),
                    DBCRecordConverter.GetInt32(rawData, 8),
                    DBCRecordConverter.GetInt32(rawData, 9),
                    DBCRecordConverter.GetInt32(rawData, 10)
                }
            };

            QuestMgr.QuestRewRepInfos[(uint)(questRewRepInfo.Id - 1)] = questRewRepInfo;
        }
 public override VehicleSeatEntry ConvertTo(byte[] rawData, ref int id)
 {
     id = DBCRecordConverter.GetInt32(rawData, 0);
     return(new VehicleSeatEntry()
     {
         Id = DBCRecordConverter.GetUInt32(rawData, 0),
         Flags = (VehicleSeatFlags)DBCRecordConverter.GetUInt32(rawData, 1),
         AttachmentId = DBCRecordConverter.GetInt32(rawData, 2),
         AttachmentOffset = new Vector3(DBCRecordConverter.GetFloat(rawData, 3),
                                        DBCRecordConverter.GetFloat(rawData, 4), DBCRecordConverter.GetFloat(rawData, 5)),
         EnterPreDelay = DBCRecordConverter.GetFloat(rawData, 6),
         EnterSpeed = DBCRecordConverter.GetFloat(rawData, 7),
         EnterGravity = DBCRecordConverter.GetFloat(rawData, 8),
         EnterMinDuration = DBCRecordConverter.GetFloat(rawData, 9),
         EnterMaxDuration = DBCRecordConverter.GetFloat(rawData, 10),
         EnterMinArcHeight = DBCRecordConverter.GetFloat(rawData, 11),
         EnterMaxArcHeight = DBCRecordConverter.GetFloat(rawData, 12),
         EnterAnimStart = DBCRecordConverter.GetInt32(rawData, 13),
         EnterAnimLoop = DBCRecordConverter.GetInt32(rawData, 14),
         RideAnimStart = DBCRecordConverter.GetInt32(rawData, 15),
         RideAnimLoop = DBCRecordConverter.GetInt32(rawData, 16),
         RideUpperAnimStart = DBCRecordConverter.GetInt32(rawData, 17),
         RideUpperAnimLoop = DBCRecordConverter.GetInt32(rawData, 18),
         ExitPreDelay = DBCRecordConverter.GetFloat(rawData, 19),
         ExitSpeed = DBCRecordConverter.GetFloat(rawData, 20),
         ExitGravity = DBCRecordConverter.GetFloat(rawData, 21),
         ExitMinDuration = DBCRecordConverter.GetFloat(rawData, 22),
         ExitMaxDuration = DBCRecordConverter.GetFloat(rawData, 23),
         ExitMinArcHeight = DBCRecordConverter.GetFloat(rawData, 24),
         ExitMaxArcHeight = DBCRecordConverter.GetFloat(rawData, 25),
         ExitAnimStart = DBCRecordConverter.GetInt32(rawData, 26),
         ExitAnimLoop = DBCRecordConverter.GetInt32(rawData, 27),
         ExitAnimEnd = DBCRecordConverter.GetInt32(rawData, 28),
         PassengerYaw = DBCRecordConverter.GetFloat(rawData, 29),
         PassengerPitch = DBCRecordConverter.GetFloat(rawData, 30),
         PassengerRoll = DBCRecordConverter.GetFloat(rawData, 31),
         PassengerAttachmentId = DBCRecordConverter.GetInt32(rawData, 32),
         FlagsB = (VehicleSeatFlagsB)DBCRecordConverter.GetUInt32(rawData, 45)
     });
 }
Example #26
0
            public override SkillRaceClassInfo ConvertTo(byte[] rawData, ref int id)
            {
                id = DBCRecordConverter.GetInt32(rawData, 0);
                int num1 = 0;
                SkillRaceClassInfo skillRaceClassInfo1 = new SkillRaceClassInfo();
                SkillRaceClassInfo skillRaceClassInfo2 = skillRaceClassInfo1;

                byte[] data1    = rawData;
                int    field1   = num1;
                int    num2     = field1 + 1;
                int    uint32_1 = (int)DBCRecordConverter.GetUInt32(data1, field1);

                skillRaceClassInfo2.Id = (uint)uint32_1;
                byte[]             data2               = rawData;
                int                field2              = num2;
                int                num3                = field2 + 1;
                SkillId            uint32_2            = (SkillId)DBCRecordConverter.GetUInt32(data2, field2);
                SkillRaceClassInfo skillRaceClassInfo3 = skillRaceClassInfo1;

                byte[] data3    = rawData;
                int    field3   = num3;
                int    num4     = field3 + 1;
                int    uint32_3 = (int)DBCRecordConverter.GetUInt32(data3, field3);

                skillRaceClassInfo3.RaceMask = (RaceMask)uint32_3;
                SkillRaceClassInfo skillRaceClassInfo4 = skillRaceClassInfo1;

                byte[] data4    = rawData;
                int    field4   = num4;
                int    num5     = field4 + 1;
                int    uint32_4 = (int)DBCRecordConverter.GetUInt32(data4, field4);

                skillRaceClassInfo4.ClassMask = (ClassMask)uint32_4;
                SkillRaceClassInfo skillRaceClassInfo5 = skillRaceClassInfo1;

                byte[] data5    = rawData;
                int    field5   = num5;
                int    num6     = field5 + 1;
                int    uint32_5 = (int)DBCRecordConverter.GetUInt32(data5, field5);

                skillRaceClassInfo5.Flags = (SkillRaceClassFlags)uint32_5;
                SkillRaceClassInfo skillRaceClassInfo6 = skillRaceClassInfo1;

                byte[] data6    = rawData;
                int    field6   = num6;
                int    num7     = field6 + 1;
                int    uint32_6 = (int)DBCRecordConverter.GetUInt32(data6, field6);

                skillRaceClassInfo6.MinimumLevel = (uint)uint32_6;
                byte[] data7  = rawData;
                int    field7 = num7;
                int    field8 = field7 + 1;
                int    int32  = DBCRecordConverter.GetInt32(data7, field7);

                if (int32 > 0)
                {
                    SkillHandler.TierReader.Entries.TryGetValue(int32, out skillRaceClassInfo1.Tiers);
                }
                skillRaceClassInfo1.SkillCostIndex = DBCRecordConverter.GetUInt32(rawData, field8);
                skillRaceClassInfo1.SkillLine      = SkillHandler.ById.Get <SkillLine>((uint)uint32_2);
                if (skillRaceClassInfo1.SkillLine != null)
                {
                    foreach (ClassId allClassId in WCellConstants.AllClassIds)
                    {
                        if (allClassId < ClassId.End)
                        {
                            ClassMask mask = allClassId.ToMask();
                            foreach (RaceMask key in WCellConstants.RaceTypesByMask.Keys)
                            {
                                RaceId raceType = WCellConstants.GetRaceType(key);
                                if (skillRaceClassInfo1.RaceMask.HasAnyFlag(key) &&
                                    skillRaceClassInfo1.ClassMask.HasAnyFlag(mask))
                                {
                                    Dictionary <SkillId, SkillRaceClassInfo>[] dictionaryArray =
                                        SkillHandler.RaceClassInfos[(int)raceType];
                                    if (dictionaryArray == null)
                                    {
                                        SkillHandler.RaceClassInfos[(int)raceType] = dictionaryArray =
                                            new Dictionary <SkillId, SkillRaceClassInfo> [WCellConstants.ClassTypeLength];
                                    }
                                    Dictionary <SkillId, SkillRaceClassInfo> dictionary =
                                        dictionaryArray[(int)allClassId];
                                    if (dictionary == null)
                                    {
                                        dictionaryArray[(int)allClassId] =
                                            dictionary = new Dictionary <SkillId, SkillRaceClassInfo>();
                                    }
                                    SkillRaceClassInfo skillRaceClassInfo7;
                                    if (dictionary.TryGetValue(uint32_2, out skillRaceClassInfo7))
                                    {
                                        skillRaceClassInfo1.RaceMask  |= skillRaceClassInfo7.RaceMask;
                                        skillRaceClassInfo1.ClassMask |= skillRaceClassInfo7.ClassMask;
                                    }
                                    else if (skillRaceClassInfo1.SkillLine.Tiers.Id == 0U &&
                                             skillRaceClassInfo1.Tiers.Id != 0U)
                                    {
                                        skillRaceClassInfo1.SkillLine.Tiers = skillRaceClassInfo1.Tiers;
                                    }

                                    dictionary[uint32_2] = skillRaceClassInfo1;
                                }
                            }
                        }
                    }
                }

                return(skillRaceClassInfo1);
            }
Example #27
0
        public override void Convert(byte[] rawData)
        {
            ShapeshiftEntry shapeshiftEntry1 = new ShapeshiftEntry();
            int             num1             = 0;
            ShapeshiftEntry shapeshiftEntry2 = shapeshiftEntry1;

            byte[] data1   = rawData;
            int    field1  = num1;
            int    num2    = field1 + 1;
            int    int32_1 = DBCRecordConverter.GetInt32(data1, field1);

            shapeshiftEntry2.Id = (ShapeshiftForm)int32_1;
            ShapeshiftEntry shapeshiftEntry3 = shapeshiftEntry1;

            byte[] data2    = rawData;
            int    field2   = num2;
            int    offset   = field2 + 1;
            int    uint32_1 = (int)DBCRecordConverter.GetUInt32(data2, field2);

            shapeshiftEntry3.BarOrder = (uint)uint32_1;
            shapeshiftEntry1.Name     = this.GetString(rawData, ref offset);
            ShapeshiftEntry shapeshiftEntry4 = shapeshiftEntry1;

            byte[] data3    = rawData;
            int    field3   = offset;
            int    num3     = field3 + 1;
            int    uint32_2 = (int)DBCRecordConverter.GetUInt32(data3, field3);

            shapeshiftEntry4.Flags = (ShapeshiftInfoFlags)uint32_2;
            ShapeshiftEntry shapeshiftEntry5 = shapeshiftEntry1;

            byte[] data4   = rawData;
            int    field4  = num3;
            int    num4    = field4 + 1;
            int    int32_2 = DBCRecordConverter.GetInt32(data4, field4);

            shapeshiftEntry5.CreatureType = (CreatureType)int32_2;
            int             num5             = num4 + 1;
            ShapeshiftEntry shapeshiftEntry6 = shapeshiftEntry1;

            byte[] data5   = rawData;
            int    field5  = num5;
            int    num6    = field5 + 1;
            int    int32_3 = DBCRecordConverter.GetInt32(data5, field5);

            shapeshiftEntry6.AttackTime = int32_3;
            ShapeshiftEntry shapeshiftEntry7 = shapeshiftEntry1;

            byte[] data6    = rawData;
            int    field6   = num6;
            int    num7     = field6 + 1;
            int    uint32_3 = (int)DBCRecordConverter.GetUInt32(data6, field6);

            shapeshiftEntry7.ModelIdAlliance = (uint)uint32_3;
            ShapeshiftEntry shapeshiftEntry8 = shapeshiftEntry1;

            byte[] data7    = rawData;
            int    field7   = num7;
            int    num8     = field7 + 1;
            int    uint32_4 = (int)DBCRecordConverter.GetUInt32(data7, field7);

            shapeshiftEntry8.ModelIdHorde = (uint)uint32_4;
            int num9 = num8 + 2;

            shapeshiftEntry1.DefaultActionBarSpells = new SpellId[8];
            for (int index = 0; index < 8; ++index)
            {
                shapeshiftEntry1.DefaultActionBarSpells[index] = (SpellId)DBCRecordConverter.GetInt32(rawData, num9++);
            }
            SpellHandler.ShapeshiftEntries[(int)shapeshiftEntry1.Id] = shapeshiftEntry1;
        }
Example #28
0
 public override EmoteType ConvertTo(byte[] rawData, ref int id)
 {
     id = DBCRecordConverter.GetInt32(rawData, 0);
     return((EmoteType)DBCRecordConverter.GetUInt32(rawData, 2));
 }
Example #29
0
        public override ItemEnchantmentEntry ConvertTo(byte[] rawData, ref int id)
        {
            ItemEnchantmentEntry enchantmentEntry1 = new ItemEnchantmentEntry();

            enchantmentEntry1.Id          = (uint)(id = DBCRecordConverter.GetInt32(rawData, 0));
            enchantmentEntry1.Charges     = DBCRecordConverter.GetUInt32(rawData, 1);
            enchantmentEntry1.Description = this.GetString(rawData, 14);
            enchantmentEntry1.Effects     = new ItemEnchantmentEffect[3];
            for (int index = 0; index < 3; ++index)
            {
                ItemEnchantmentType uint32 = (ItemEnchantmentType)DBCRecordConverter.GetUInt32(rawData, 2 + index);
                if (uint32 != ItemEnchantmentType.None)
                {
                    ItemEnchantmentEffect enchantmentEffect = new ItemEnchantmentEffect();
                    enchantmentEntry1.Effects[index] = enchantmentEffect;
                    enchantmentEffect.Type           = uint32;
                    enchantmentEffect.MinAmount      = DBCRecordConverter.GetInt32(rawData, 5 + index);
                    enchantmentEffect.MaxAmount      = DBCRecordConverter.GetInt32(rawData, 8 + index);
                    enchantmentEffect.Misc           = DBCRecordConverter.GetUInt32(rawData, 11 + index);
                }
            }

            ArrayUtil.Prune <ItemEnchantmentEffect>(ref enchantmentEntry1.Effects);
            int num1 = 31;
            ItemEnchantmentEntry enchantmentEntry2 = enchantmentEntry1;

            byte[] data1    = rawData;
            int    field1   = num1;
            int    num2     = field1 + 1;
            int    uint32_1 = (int)DBCRecordConverter.GetUInt32(data1, field1);

            enchantmentEntry2.Visual = (uint)uint32_1;
            ItemEnchantmentEntry enchantmentEntry3 = enchantmentEntry1;

            byte[] data2    = rawData;
            int    field2   = num2;
            int    num3     = field2 + 1;
            int    uint32_2 = (int)DBCRecordConverter.GetUInt32(data2, field2);

            enchantmentEntry3.Flags = (uint)uint32_2;
            ItemEnchantmentEntry enchantmentEntry4 = enchantmentEntry1;

            byte[] data3    = rawData;
            int    field3   = num3;
            int    num4     = field3 + 1;
            int    uint32_3 = (int)DBCRecordConverter.GetUInt32(data3, field3);

            enchantmentEntry4.SourceItemId = (uint)uint32_3;
            byte[] data4    = rawData;
            int    field4   = num4;
            int    num5     = field4 + 1;
            uint   uint32_4 = DBCRecordConverter.GetUInt32(data4, field4);

            if (uint32_4 > 0U)
            {
                enchantmentEntry1.Condition = EnchantMgr.GetEnchantmentCondition(uint32_4);
            }
            ItemEnchantmentEntry enchantmentEntry5 = enchantmentEntry1;

            byte[] data5    = rawData;
            int    field5   = num5;
            int    field6   = field5 + 1;
            int    uint32_5 = (int)DBCRecordConverter.GetUInt32(data5, field5);

            enchantmentEntry5.RequiredSkillId     = (SkillId)uint32_5;
            enchantmentEntry1.RequiredSkillAmount = DBCRecordConverter.GetInt32(rawData, field6);
            return(enchantmentEntry1);
        }