Esempio n. 1
0
 public static void LoadClassesEditorFiles()
 {
     try
     {
         DbcStores.InitFiles();
         ChrClasses.LoadData();
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 2
0
 public static void LoadCharStartOutfit()
 {
     try
     {
         DbcStores.InitFiles();
         CharStartOutfit.LoadData();
         ChrRaces.LoadData();
         ChrClasses.LoadData();
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 3
0
 public static void LoadRacesClassCombosEditorFiles()
 {
     try
     {
         DbcStores.InitFiles();
         CharBaseInfo.LoadData();
         ChrClasses.LoadData();
         ChrRaces.LoadData();
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 4
0
        public override void Setup()
        {
            ChrRaces   Race  = this.Session.Core.DBC.GetDBC <ChrRaces>().SingleOrDefault(cr => cr.RaceID == this.Character.race);
            ChrClasses Class = this.Session.Core.DBC.GetDBC <ChrClasses>().SingleOrDefault(cr => cr.ClassID == this.Character.@class);

            this.Info          = new PlayerInfo(this.ObjectGUID, this.Character, Race, Class);
            this.PacketBuilder = new PlayerPacketBuilder(this);

            Location.X           = Character.position_x;
            Location.Y           = Character.position_y;
            Location.Z           = Character.position_z;
            Location.Orientation = Character.orientation;
            Location.MapID       = (int)Character.map;

            base.Setup();
        }
Esempio n. 5
0
 public static void LoadFactionsEditorFiles()
 {
     try
     {
         DbcStores.InitFiles();
         ChrClasses.LoadData();
         ChrRaces.LoadData();
         Faction.LoadData();
         FactionGroup.LoadData();
         FactionTemplate.LoadData();
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 6
0
 public static void LoadTalentsEditorFiles()
 {
     try
     {
         DbcStores.InitFiles();
         ChrClasses.LoadData();
         ChrRaces.LoadData();
         Spell.LoadData();
         SpellIcon.LoadData();
         Talent.LoadData();
         TalentTab.LoadData();
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 7
0
 public static void LoadProfessionEditorFiles()
 {
     try
     {
         DbcStores.InitFiles();
         Spell.LoadData();
         SkillLine.LoadData();
         SkillLineAbility.LoadData();
         SkillRaceClassInfo.LoadData();
         SpellFocusObject.LoadData();
         ChrRaces.LoadData();
         ChrClasses.LoadData();
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 8
0
        public PlayerInfo(ObjectGUID guid, character databaseCharacter, ChrRaces race, ChrClasses chrClass) : base(guid)
        {
            this.Class   = chrClass;
            this.ClassID = this.Class.ClassID;
            this.Gender  = databaseCharacter.gender;
            this.Power   = (byte)this.Class.PowerType;

            this.Race            = race;
            this.RaceID          = race.RaceID;
            this.FactionTemplate = race.FactionID;
            this.DisplayID       = this.NativeDisplayID = (int)(this.Gender == 0 ? race.ModelM : race.ModelF);
            this.Health          = (int)databaseCharacter.health;

            //Level = databaseCharacter.Level;
            this.XP          = (int)databaseCharacter.xp;
            this.NextLevelXP = 400;

            Byte[] playerBytes  = BitConverter.GetBytes(databaseCharacter.playerBytes);
            Byte[] playerBytes2 = BitConverter.GetBytes(databaseCharacter.playerBytes2);

            this.Skin      = playerBytes[0];
            this.Face      = playerBytes[1];
            this.HairStyle = playerBytes[2];
            this.HairColor = playerBytes[3];
            this.Accessory = playerBytes2[0];

            FactionTemplate     = race.FactionID;
            UnitFlag            = (int)UnitFlags.UNIT_FLAG_PVP;
            FlagUnk             = 0x08 | 0x20;
            WatchedFactionIndex = (int)databaseCharacter.watchedFaction;


            this.Money = (int)databaseCharacter.money;

/*
 *
 *          item_template[] equipment = ItemUtils.GenerateInventoryByIDs(Utils.CSVStringToIntArray(databaseCharacter.equipmentCache));
 *          VisualItems = new Item[19];
 *          for (byte itemSlot = 0; itemSlot < 19; itemSlot++)
 *          {
 *              if (equipment == null) return;
 *              if (equipment[itemSlot] != null)
 *              {
 *                  VisualItems[itemSlot] = new Item()
 *                                              {
 *                                                  Creator = guid.RawGUID,
 *                                                  EnchantmentIDs = new[] { 0, 0 },
 *                                                  Entry = equipment[itemSlot].entry,
 *                                                  RandomPropertyID = equipment[itemSlot].RandomProperty,
 *                                                  ItemSuffixFactor = 3
 *                                              };
 *
 *              }
 *              else
 *              {
 *                  VisualItems[itemSlot] = new Item()
 *                                              {
 *                                                  Creator = 0,
 *                                                  EnchantmentIDs = new[] { 0, 0 },
 *                                                  Entry = 0,
 *                                                  RandomPropertyID = 0,
 *                                                  ItemSuffixFactor = 0
 *                                              };
 *              }
 *          }*/

            Type |= (int)TypeMask.TYPEMASK_PLAYER;
        }
Esempio n. 9
0
        static void Backup()
        {
            var dbcd = new DBCD.DBCD(new DBCProvider(), new DBDProvider());

            ChrClasses = dbcd.Load($"{DB2Path}/ChrClasses.db2");

            var classInfo = new List <ClassInformation>();

            foreach (var id in ChrClasses.Keys)
            {
                var defaultSpec = ChrClasses.GetField <ushort>(id, "DefaultSpec");
                var powerType   = ChrClasses.GetField <byte>(id, "DisplayPower");

                classInfo.Add(new ClassInformation
                {
                    ClassID      = id,
                    DefaultSpec  = defaultSpec,
                    DisplayPower = powerType,
                });
            }

            WriteRecords("ClassInformation.csv", classInfo);

            var raceDict = new Dictionary <uint, byte>
            {
                { 1, 1 },
                { 2, 2 },
                { 4, 3 },
                { 8, 4 },
                { 16, 5 },
                { 32, 6 },
                { 64, 7 },
                { 128, 8 },
                { 256, 9 },
                { 512, 10 },
                { 1024, 11 },
                { 2097152, 22 },
                { 8388608, 24 },
                { 16777216, 25 },
                { 33554432, 26 },
                { 67108864, 27 },
                { 134217728, 28 },
                { 268435456, 29 },
                { 536870912, 30 },
                { 1073741824, 31 },
                { 2147483648, 32 },
                { 2048, 34 },
                { 4096, 35 },
                { 8192, 36 },
                { 16384, 37 }
            };

            CharacterLoadout     = dbcd.Load($"{DB2Path}/CharacterLoadout.db2");
            CharacterLoadoutItem = dbcd.Load($"{DB2Path}/CharacterLoadoutItem.db2");

            var charLoadout = new Dictionary <(byte, int), List <uint> >();

            foreach (var id in CharacterLoadoutItem.Keys)
            {
                var loadoutId = CharacterLoadoutItem.GetField <int>(id, "CharacterLoadoutID");
                if (loadoutId == 0)
                {
                    continue;
                }

                var purpose = CharacterLoadout.GetField <int>(loadoutId, "Purpose");
                if (purpose != 9)
                {
                    continue;
                }

                var raceMask = CharacterLoadout.GetField <uint>(loadoutId, "Racemask");
                if (!raceDict.TryGetValue(raceMask, out var raceId))
                {
                    Console.WriteLine($"Unknown Racemask: {raceMask}");
                    continue;
                }

                var itemId = CharacterLoadoutItem.GetField <uint>(id, "ItemID");
                if (itemId == 0)
                {
                    continue;
                }

                var classId = CharacterLoadout.GetField <int>(loadoutId, "ChrClassID");
                if (!charLoadout.ContainsKey((raceId, classId)))
                {
                    charLoadout.Add((raceId, classId), new List <uint>());
                }

                charLoadout[(raceId, classId)].Add(itemId);