Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            try
            {
                Print("This program will use ID's {0}+ for CreatureDisplayInfo and CreatureModelInfo.", DBCStartingEntry);
                Print("This program will use creature ID's {0}+ for creature_template.", CTStartingEntry);
                Print("This program will spawn the creatures on map {0}.", MapEntry);

                Print("Loading Import\\SPELLS folder...");
                if (!Directory.Exists("Import/SPELLS"))
                    throw new Exception("Spells folder does not exist!");

                DirectoryInfo dir = new DirectoryInfo("Import/SPELLS");
                loadAllSpells(dir);

                Print("Loaded {0} spells. Loading Import\\CreatureModelData.dbc...", paths.Count);
                CreatureModelData modelData = new CreatureModelData();
                Print("Loaded {0} models from CreatureModelData.", modelData.header.RecordCount);

                Print("Loading Input\\CreatureDisplayInfo.dbc...");
                CreatureDisplayInfo displayInfo = new CreatureDisplayInfo();
                Print("Loaded {0} display ID's from CreatureDisplayInfo.", displayInfo.header.RecordCount);

                Print("Creating {0} new entries in both DBC's...", paths.Count);
                populateNewEntries(modelData, displayInfo);

                Print("Creating Export\\CreatureModelData.dbc...");
                modelData.SaveDBCFile();

                Print("Creating Export\\CreatureDisplayInfo.dbc...");
                displayInfo.SaveDBCFile();

                Print("Creating creature_template queries...");
                generateTemplateQueries();

                Print("Creating creature queries...");
                generateSpawnQueries();

                Print("Program finished successfully.");
            }
            catch (Exception e)
            {
                Print("ERROR: " + e.Message);
            }
        }
Ejemplo n.º 2
0
 private static void populateNewEntries(CreatureModelData modelData, CreatureDisplayInfo displayInfo)
 {
     // CreatureModelData
     int index = (int)modelData.header.RecordCount;
     int newSize = index + paths.Count;
     Array.Resize(ref modelData.body.records, newSize);
     Array.Resize(ref modelData.body.pathStrings, newSize);
     modelData.header.RecordCount = (uint)newSize;
     String[] stringPaths = paths.ToArray();
     uint entry = DBCStartingEntry;
     for (int i = index; i < newSize; ++i)
     {
         CreatureModelData.DBC_Record newRecord = new CreatureModelData.DBC_Record();
         newRecord.ID = entry++;
         newRecord.Flags = 0;
         newRecord.AlternateModel = 0;
         newRecord.sizeClass = 1;
         newRecord.modelScale = 1;
         newRecord.BloodLevel = 0;
         newRecord.Footprint = 0;
         newRecord.footprintTextureLength = 0;
         newRecord.footprintTextureWidth = 0;
         newRecord.footstepShakeSize = 0;
         newRecord.footprintParticleScale = 0;
         newRecord.foleyMaterialId = 0;
         newRecord.deathThudShakeSize = 0;
         newRecord.SoundData = 0;
         newRecord.CollisionHeight = 0;
         newRecord.CollisionWidth = 0;
         newRecord.mountHeight = 0;
         newRecord.geoBoxMaxF1 = 0;
         newRecord.geoBoxMinF1 = 0;
         newRecord.geoBoxMaxF2 = 0;
         newRecord.geoBoxMinF2 = 0;
         newRecord.geoBoxMaxF3 = 0;
         newRecord.geoBoxMinF3 = 0;
         newRecord.worldEffectScale = 1;
         newRecord.Unknown6 = 0;
         newRecord.Unknown5 = 0;
         newRecord.attachedEffectScale = 0;
         modelData.body.pathStrings[i] = stringPaths[i - index];
         modelData.body.records[i] = newRecord;
     }
     // CreatureDisplayInfo
     index = (int)displayInfo.header.RecordCount;
     newSize = index + paths.Count;
     Array.Resize(ref displayInfo.body.records, newSize);
     displayInfo.header.RecordCount = (uint)newSize;
     entry = DBCStartingEntry;
     for (int i = index; i < newSize; ++i)
     {
         CreatureDisplayInfo.DBC_Record newRecord = new CreatureDisplayInfo.DBC_Record();
         newRecord.Model = entry;
         newRecord.ID = entry++;
         newRecord.blood = 0;
         newRecord.bloodLevel = 0;
         newRecord.creatureGeosetData = 0;
         newRecord.ExtraDisplayInfo = 0;
         newRecord.NPCSounds = 0;
         newRecord.objectEffectPackageID = 0;
         newRecord.Opacity = 255;
         newRecord.Particles = 0;
         newRecord.portraitTextureName = 0;
         newRecord.Scale = 1;
         newRecord.Skin1 = 0;
         newRecord.Skin2 = 0;
         newRecord.Skin3 = 0;
         newRecord.Sound = 0;
         displayInfo.body.records[i] = newRecord;
     }
 }