Exemplo n.º 1
0
        public void SetDungeon(DFLocation location, bool importEnemies = true)
        {
            if (!ReadyCheck())
            {
                return;
            }

            // Validate
            if (this.isSet)
            {
                throw new Exception("This location has already been set.");
            }
            if (!location.Loaded)
            {
                throw new Exception("DFLocation not loaded.");
            }
            if (!location.HasDungeon)
            {
                throw new Exception("DFLocation does not contain a dungeon.");
            }

            // Set summary
            summary              = new DungeonSummary();
            summary.ID           = location.MapTableData.MapId;
            summary.RegionName   = location.RegionName;
            summary.LocationName = location.Name;
            summary.LocationData = location;
            summary.LocationType = location.MapTableData.LocationType;
            summary.DungeonType  = location.MapTableData.DungeonType;

            // Set texture table from location
            if (DungeonTextureUse == DaggerfallWorkshop.DungeonTextureUse.UseLocation_PartiallyImplemented)
            {
                UseLocationDungeonTextureTable();
            }

            // Perform layout
            startMarker = null;
            if (location.MapTableData.MapId == 19021260)
            {
                LayoutOrsinium(ref location, importEnemies);
            }
            else
            {
                LayoutDungeon(ref location, importEnemies);
            }

            // Seal location
            isSet = true;
            RaiseOnSetDungeonEvent();
        }
        public void SetDungeon(DFLocation location)
        {
            if (!ReadyCheck())
                return;

            // Validate
            if (this.isSet)
                throw new Exception("This location has already been set.");
            if (!location.Loaded)
                throw new Exception("DFLocation not loaded.");
            if (!location.HasDungeon)
                throw new Exception("DFLocation does not contain a dungeon.");

            // Set summary
            summary = new DungeonSummary();
            summary.ID = location.MapTableData.MapId;
            summary.RegionName = location.RegionName;
            summary.LocationName = location.Name;
            summary.LocationData = location;
            summary.LocationType = location.MapTableData.LocationType;
            summary.DungeonType = location.MapTableData.DungeonType;

            // Set texture table from location
            if (DungeonTextureUse == DaggerfallWorkshop.DungeonTextureUse.UseLocation_PartiallyImplemented)
                UseLocationDungeonTextureTable();

            // Perform layout
            startMarker = null;
            if (location.Name == "Orsinium")
                LayoutOrsinium(ref location);
            else
                LayoutDungeon(ref location);

            // Seal location
            isSet = true;
        }