Beispiel #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 uint ConvertTo(byte[] rawData, ref int id)
        {
            List <Spell> spellList = new List <Spell>(4);

            id = (int)DBCRecordConverter.GetUInt32(rawData, 0);
            return(rawData.GetUInt32(1U));
        }
Beispiel #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);
        }
Beispiel #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;
        }
Beispiel #5
0
        public override void Convert(byte[] rawData)
        {
            WorldMapOverlayEntry val = new WorldMapOverlayEntry();

            val.WorldMapOverlayId = (WorldMapOverlayId)DBCRecordConverter.GetUInt32(rawData, 0);
            for (int index = 0; index < val.ZoneTemplateId.Length; ++index)
            {
                ZoneId uint32 = (ZoneId)DBCRecordConverter.GetUInt32(rawData, 2 + index);
                if (uint32 != ZoneId.None)
                {
                    val.ZoneTemplateId[index] = uint32;
                    ZoneTemplate zoneTemplate = WCell.RealmServer.Global.World.s_ZoneTemplates[(int)uint32];
                    if (zoneTemplate == null)
                    {
                        LogManager.GetCurrentClassLogger().Warn(string.Format(
                                                                    "Invalid ZoneId #{0} found at WorldMapOverlay #{1} during the DBC loading.",
                                                                    (object)uint32, (object)val.WorldMapOverlayId));
                    }
                    else
                    {
                        zoneTemplate.WorldMapOverlays.Add(val.WorldMapOverlayId);
                    }
                }
                else
                {
                    break;
                }
            }

            ArrayUtil.Set <WorldMapOverlayEntry>(ref WCell.RealmServer.Global.World.s_WorldMapOverlayEntries,
                                                 (uint)val.WorldMapOverlayId, val);
        }
Beispiel #6
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);
            }
Beispiel #7
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);
        }
        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;
            }
        }
Beispiel #9
0
        public override FactionTemplateEntry ConvertTo(byte[] rawData, ref int id)
        {
            FactionTemplateEntry entry = new FactionTemplateEntry();
            int num = 0;

            id = (int)(entry.Id = DBCRecordConverter.GetUInt32(rawData, num++));
            entry.FactionId     = (FactionId)DBCRecordConverter.GetUInt32(rawData, num++);
            entry.Flags         = (FactionTemplateFlags)DBCRecordConverter.GetUInt32(rawData, num++);
            entry.FactionGroup  = (FactionGroupMask)DBCRecordConverter.GetUInt32(rawData, num++);
            entry.FriendGroup   = (FactionGroupMask)DBCRecordConverter.GetUInt32(rawData, num++);
            entry.EnemyGroup    = (FactionGroupMask)DBCRecordConverter.GetUInt32(rawData, num++);
            entry.EnemyFactions = new FactionId[4];
            for (uint i = 0; i < entry.EnemyFactions.Length; i++)
            {
                entry.EnemyFactions[i] = (FactionId)DBCRecordConverter.GetUInt32(rawData, num++);
            }

            entry.FriendlyFactions = new FactionId[4];
            for (uint j = 0; j < entry.FriendlyFactions.Length; j++)
            {
                entry.FriendlyFactions[j] = (FactionId)DBCRecordConverter.GetUInt32(rawData, num++);
            }

            return(entry);
        }
Beispiel #10
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
                        });
                    }
                }
            }
        }
Beispiel #11
0
        public override void Convert(byte[] rawData)
        {
            GlyphSlotEntry glyphSlotEntry = new GlyphSlotEntry();

            glyphSlotEntry.Id        = DBCRecordConverter.GetUInt32(rawData, 0);
            glyphSlotEntry.TypeFlags = DBCRecordConverter.GetUInt32(rawData, 1);
            glyphSlotEntry.Order     = DBCRecordConverter.GetUInt32(rawData, 2);
            GlyphInfoHolder.GlyphSlots.Add(glyphSlotEntry.Id, glyphSlotEntry);
        }
 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)
        {
            GlyphPropertiesEntry glyphPropertiesEntry = new GlyphPropertiesEntry();

            glyphPropertiesEntry.Id        = DBCRecordConverter.GetUInt32(rawData, 0);
            glyphPropertiesEntry.SpellId   = DBCRecordConverter.GetUInt32(rawData, 1);
            glyphPropertiesEntry.TypeFlags = DBCRecordConverter.GetUInt32(rawData, 2);
            glyphPropertiesEntry.Unk1      = DBCRecordConverter.GetUInt32(rawData, 3);
            GlyphInfoHolder.GlyphProperties.Add(glyphPropertiesEntry.Id, glyphPropertiesEntry);
        }
        public override void Convert(byte[] rawData)
        {
            AchievementCategoryEntry achievementCategoryEntry = new AchievementCategoryEntry()
            {
                ID             = (AchievementCategoryEntryId)DBCRecordConverter.GetUInt32(rawData, 0),
                ParentCategory = (AchievementCategoryEntryId)DBCRecordConverter.GetUInt32(rawData, 1)
            };

            AchievementMgr.AchievementCategoryEntries[achievementCategoryEntry.ID] = achievementCategoryEntry;
        }
Beispiel #15
0
        public override void Convert(byte[] rawData)
        {
            CharacterTitleEntry characterTitleEntry = new CharacterTitleEntry()
            {
                TitleId  = (TitleId)DBCRecordConverter.GetUInt32(rawData, 0),
                Names    = this.GetStrings(rawData, 2),
                BitIndex = (TitleBitId)DBCRecordConverter.GetUInt32(rawData, 36)
            };

            TitleMgr.CharacterTitleEntries[characterTitleEntry.TitleId] = characterTitleEntry;
        }
        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 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)
     });
 }
Beispiel #18
0
            public override TalentTree ConvertTo(byte[] rawData, ref int id)
            {
                TalentTree talentTree = new TalentTree();

                id = (int)(talentTree.Id = (TalentTreeId)DBCRecordConverter.GetUInt32(rawData, 0));
                talentTree.Name = this.GetString(rawData, 1);
                ClassMask uint32 = (ClassMask)DBCRecordConverter.GetUInt32(rawData, 20);

                talentTree.Class       = WCellConstants.ClassTypesByMask[uint32];
                talentTree.PetTabIndex = DBCRecordConverter.GetUInt32(rawData, 21);
                talentTree.TabIndex    = DBCRecordConverter.GetUInt32(rawData, 22);
                return(talentTree);
            }
Beispiel #19
0
 public override BaseRace ConvertTo(byte[] rawData, ref int id)
 {
     return(new BaseRace()
     {
         Id = (RaceId)(id = (int)DBCRecordConverter.GetUInt32(rawData, 0)),
         FactionTemplateId = (FactionTemplateId)DBCRecordConverter.GetUInt32(rawData, 8),
         MaleDisplayId = DBCRecordConverter.GetUInt32(rawData, 4),
         FemaleDisplayId = DBCRecordConverter.GetUInt32(rawData, 5),
         Scale = DBCRecordConverter.GetFloat(rawData, 7),
         Name = this.GetString(rawData, 14),
         ClientId = (ClientId)DBCRecordConverter.GetUInt32(rawData, 68)
     });
 }
        public override PathNode ConvertTo(byte[] rawData, ref int id)
        {
            PathNode node   = new PathNode();
            int      offset = 0;

            id                   = (int)(node.Id = DBCRecordConverter.GetUInt32(rawData, offset++));
            node.mapId           = (MapId)DBCRecordConverter.GetUInt32(rawData, offset++);
            node.Position        = rawData.GetLocation((uint)offset);
            offset              += 3;
            node.Name            = base.GetString(rawData, ref offset);
            node.HordeMountId    = (NPCId)DBCRecordConverter.GetUInt32(rawData, offset++);
            node.AllianceMountId = (NPCId)DBCRecordConverter.GetUInt32(rawData, offset);
            return(node);
        }
Beispiel #21
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);
        }
Beispiel #22
0
            public override TalentEntry ConvertTo(byte[] rawData, ref int id)
            {
                TalentEntry talentEntry = new TalentEntry();

                id = (int)(talentEntry.Id = (TalentId)DBCRecordConverter.GetUInt32(rawData, 0));
                TalentTreeId uint32_1 = (TalentTreeId)DBCRecordConverter.GetUInt32(rawData, 1);

                talentEntry.Tree = TalentMgr.TalentTrees.Get <TalentTree>((uint)uint32_1);
                if (talentEntry.Tree == null)
                {
                    return((TalentEntry)null);
                }
                talentEntry.Row = DBCRecordConverter.GetUInt32(rawData, 2);
                talentEntry.Col = DBCRecordConverter.GetUInt32(rawData, 3);
                List <Spell> spellList = new List <Spell>(5);

                for (int index = 0; index < 9; ++index)
                {
                    uint  uint32_2 = DBCRecordConverter.GetUInt32(rawData, index + 4);
                    Spell triggerSpell;
                    if (uint32_2 != 0U && (triggerSpell = SpellHandler.Get(uint32_2)) != null)
                    {
                        if (triggerSpell.IsTeachSpell)
                        {
                            triggerSpell =
                                triggerSpell.GetEffectsWhere(
                                    (Predicate <SpellEffect>)(effect => effect.TriggerSpell != null))[0].TriggerSpell;
                        }
                        if (triggerSpell != null)
                        {
                            spellList.Add(triggerSpell);
                        }
                        else
                        {
                            TalentMgr.log.Warn("Talent has invalid Spell: {0} ({1})", (object)talentEntry.Id,
                                               (object)uint32_2);
                        }
                    }
                    else
                    {
                        break;
                    }
                }

                talentEntry.Spells       = spellList.ToArray();
                talentEntry.RequiredId   = (TalentId)DBCRecordConverter.GetUInt32(rawData, 13);
                talentEntry.RequiredRank = DBCRecordConverter.GetUInt32(rawData, 16);
                return(talentEntry);
            }
Beispiel #23
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)
     });
 }
Beispiel #24
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 Spell[] ConvertTo(byte[] rawData, ref int id)
        {
            List <Spell> spellList = new List <Spell>(4);

            id = (int)DBCRecordConverter.GetUInt32(rawData, 0);
            for (int field = 1; field <= 4; ++field)
            {
                uint  uint32 = DBCRecordConverter.GetUInt32(rawData, field);
                Spell spell;
                if (uint32 != 0U && (spell = SpellHandler.Get(uint32)) != null)
                {
                    spellList.Add(spell);
                }
            }

            return(spellList.ToArray());
        }
Beispiel #26
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;
        }
        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);
        }
Beispiel #29
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);
            }
Beispiel #30
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);
        }