Ejemplo n.º 1
0
        public static RDungeon LoadRDungeon(int dungeonNum)
        {
            RDungeon dungeon = new RDungeon(dungeonNum);
            string FilePath = IO.Paths.RDungeonsFolder + "rdungeon" + dungeonNum.ToString() + ".dat";
            using (System.IO.StreamReader reader = new System.IO.StreamReader(FilePath)) {
                while (!(reader.EndOfStream)) {
                    string[] parse = reader.ReadLine().Split('|');
                    switch (parse[0].ToLower()) {
                        case "rdungeondata":
                            if (parse[1].ToLower() != "v4") {
                                reader.Close();
                                reader.Dispose();
                                return null;
                            }
                            break;
                        case "data":
                            dungeon.DungeonName = parse[1];
                            dungeon.Direction = (Enums.Direction)parse[2].ToInt();
                            dungeon.MaxFloors = parse[3].ToInt();
                            dungeon.Recruitment = parse[4].ToBool();
                            dungeon.Exp = parse[5].ToBool();
                            dungeon.WindTimer = parse[6].ToInt();
                            dungeon.RDungeonIndex = parse[7].ToInt();
                            break;
                        case "floor": {
                                RDungeonFloor floor = new RDungeonFloor();
                                floor.Options.TrapMin = parse[1].ToInt();
                                floor.Options.TrapMax = parse[2].ToInt();
                                floor.Options.ItemMin = parse[3].ToInt();
                                floor.Options.ItemMax = parse[4].ToInt();
                                floor.Options.Intricacy = parse[5].ToInt();
                                floor.Options.RoomWidthMin = parse[6].ToInt();
                                floor.Options.RoomWidthMax = parse[7].ToInt();
                                floor.Options.RoomLengthMin = parse[8].ToInt();
                                floor.Options.RoomLengthMax = parse[9].ToInt();
                                floor.Options.HallTurnMin = parse[10].ToInt();
                                floor.Options.HallTurnMax = parse[11].ToInt();
                                floor.Options.HallVarMin = parse[12].ToInt();
                                floor.Options.HallVarMax = parse[13].ToInt();
                                floor.Options.WaterFrequency = parse[14].ToInt();
                                floor.Options.Craters = parse[15].ToInt();
                                floor.Options.CraterMinLength = parse[16].ToInt();
                                floor.Options.CraterMaxLength = parse[17].ToInt();
                                floor.Options.CraterFuzzy = parse[18].ToBool();
                                floor.Options.MinChambers = parse[19].ToInt();
                                floor.Options.MaxChambers = parse[20].ToInt();

                                floor.Darkness = parse[21].ToInt();
                                floor.GoalType = (Enums.RFloorGoalType)parse[22].ToInt();
                                floor.GoalMap = parse[23].ToInt();
                                floor.GoalX = parse[24].ToInt();
                                floor.GoalY = parse[25].ToInt();
                                floor.Music = parse[26];

                                #region terrain

                                #region wall
                                floor.StairsX = parse[27].ToInt();
                                floor.StairsSheet = parse[28].ToInt();

                                floor.mGroundX = parse[29].ToInt();
                                floor.mGroundSheet = parse[30].ToInt();

                                floor.mTopLeftX = parse[31].ToInt();
                                floor.mTopLeftSheet = parse[32].ToInt();
                                floor.mTopCenterX = parse[33].ToInt();
                                floor.mTopCenterSheet = parse[34].ToInt();
                                floor.mTopRightX = parse[35].ToInt();
                                floor.mTopRightSheet = parse[36].ToInt();

                                floor.mCenterLeftX = parse[37].ToInt();
                                floor.mCenterLeftSheet = parse[38].ToInt();
                                floor.mCenterCenterX = parse[39].ToInt();
                                floor.mCenterCenterSheet = parse[40].ToInt();
                                floor.mCenterRightX = parse[41].ToInt();
                                floor.mCenterRightSheet = parse[42].ToInt();

                                floor.mBottomLeftX = parse[43].ToInt();
                                floor.mBottomLeftSheet = parse[44].ToInt();
                                floor.mBottomCenterX = parse[45].ToInt();
                                floor.mBottomCenterSheet = parse[46].ToInt();
                                floor.mBottomRightX = parse[47].ToInt();
                                floor.mBottomRightSheet = parse[48].ToInt();

                                floor.mInnerTopLeftX = parse[49].ToInt();
                                floor.mInnerTopLeftSheet = parse[50].ToInt();
                                floor.mInnerBottomLeftX = parse[51].ToInt();
                                floor.mInnerBottomLeftSheet = parse[52].ToInt();

                                floor.mInnerTopRightX = parse[53].ToInt();
                                floor.mInnerTopRightSheet = parse[54].ToInt();
                                floor.mInnerBottomRightX = parse[55].ToInt();
                                floor.mInnerBottomRightSheet = parse[56].ToInt();

                                floor.mColumnTopX = parse[57].ToInt();
                                floor.mColumnTopSheet = parse[58].ToInt();
                                floor.mColumnCenterX = parse[59].ToInt();
                                floor.mColumnCenterSheet = parse[60].ToInt();
                                floor.mColumnBottomX = parse[61].ToInt();
                                floor.mColumnBottomSheet = parse[62].ToInt();

                                floor.mRowLeftX = parse[63].ToInt();
                                floor.mRowLeftSheet = parse[64].ToInt();
                                floor.mRowCenterX = parse[65].ToInt();
                                floor.mRowCenterSheet = parse[66].ToInt();
                                floor.mRowRightX = parse[67].ToInt();
                                floor.mRowRightSheet = parse[68].ToInt();

                                floor.mIsolatedWallX = parse[69].ToInt();
                                floor.mIsolatedWallSheet = parse[70].ToInt();

                                floor.mGroundAltX = parse[71].ToInt();
                                floor.mGroundAltSheet = parse[72].ToInt();
                                floor.mGroundAlt2X = parse[73].ToInt();
                                floor.mGroundAlt2Sheet = parse[74].ToInt();

                                floor.mTopLeftAltX = parse[75].ToInt();
                                floor.mTopLeftAltSheet = parse[76].ToInt();
                                floor.mTopCenterAltX = parse[77].ToInt();
                                floor.mTopCenterAltSheet = parse[78].ToInt();
                                floor.mTopRightAltX = parse[79].ToInt();
                                floor.mTopRightAltSheet = parse[80].ToInt();

                                floor.mCenterLeftAltX = parse[81].ToInt();
                                floor.mCenterLeftAltSheet = parse[82].ToInt();
                                floor.mCenterCenterAltX = parse[83].ToInt();
                                floor.mCenterCenterAltSheet = parse[84].ToInt();
                                floor.mCenterCenterAlt2X = parse[85].ToInt();
                                floor.mCenterCenterAlt2Sheet = parse[86].ToInt();
                                floor.mCenterRightAltX = parse[87].ToInt();
                                floor.mCenterRightAltSheet = parse[88].ToInt();

                                floor.mBottomLeftAltX = parse[89].ToInt();
                                floor.mBottomLeftAltSheet = parse[90].ToInt();
                                floor.mBottomCenterAltX = parse[91].ToInt();
                                floor.mBottomCenterAltSheet = parse[92].ToInt();
                                floor.mBottomRightAltX = parse[93].ToInt();
                                floor.mBottomRightAltSheet = parse[94].ToInt();

                                floor.mInnerTopLeftAltX = parse[95].ToInt();
                                floor.mInnerTopLeftAltSheet = parse[96].ToInt();
                                floor.mInnerBottomLeftAltX = parse[97].ToInt();
                                floor.mInnerBottomLeftAltSheet = parse[98].ToInt();

                                floor.mInnerTopRightAltX = parse[99].ToInt();
                                floor.mInnerTopRightAltSheet = parse[100].ToInt();
                                floor.mInnerBottomRightAltX = parse[101].ToInt();
                                floor.mInnerBottomRightAltSheet = parse[102].ToInt();

                                floor.mColumnTopAltX = parse[103].ToInt();
                                floor.mColumnTopAltSheet = parse[104].ToInt();
                                floor.mColumnCenterAltX = parse[105].ToInt();
                                floor.mColumnCenterAltSheet = parse[106].ToInt();
                                floor.mColumnBottomAltX = parse[107].ToInt();
                                floor.mColumnBottomAltSheet = parse[108].ToInt();

                                floor.mRowLeftAltX = parse[109].ToInt();
                                floor.mRowLeftAltSheet = parse[110].ToInt();
                                floor.mRowCenterAltX = parse[111].ToInt();
                                floor.mRowCenterAltSheet = parse[112].ToInt();
                                floor.mRowRightAltX = parse[113].ToInt();
                                floor.mRowRightAltSheet = parse[114].ToInt();

                                floor.mIsolatedWallAltX = parse[115].ToInt();
                                floor.mIsolatedWallAltSheet = parse[116].ToInt();

                                #endregion

                                #region water

                                floor.mWaterX = parse[117].ToInt();
                                floor.mWaterSheet = parse[118].ToInt();
                                floor.mWaterAnimX = parse[119].ToInt();
                                floor.mWaterAnimSheet = parse[120].ToInt();

                                floor.mShoreTopLeftX = parse[121].ToInt();
                                floor.mShoreTopLeftSheet = parse[122].ToInt();
                                floor.mShoreTopRightX = parse[123].ToInt();
                                floor.mShoreTopRightSheet = parse[124].ToInt();
                                floor.mShoreBottomRightX = parse[125].ToInt();
                                floor.mShoreBottomRightSheet = parse[126].ToInt();
                                floor.mShoreBottomLeftX = parse[127].ToInt();
                                floor.mShoreBottomLeftSheet = parse[128].ToInt();
                                floor.mShoreDiagonalForwardX = parse[129].ToInt();
                                floor.mShoreDiagonalForwardSheet = parse[130].ToInt();
                                floor.mShoreDiagonalBackX = parse[131].ToInt();
                                floor.mShoreDiagonalBackSheet = parse[132].ToInt();

                                floor.mShoreTopX = parse[133].ToInt();
                                floor.mShoreTopSheet = parse[134].ToInt();
                                floor.mShoreRightX = parse[135].ToInt();
                                floor.mShoreRightSheet = parse[136].ToInt();
                                floor.mShoreBottomX = parse[137].ToInt();
                                floor.mShoreBottomSheet = parse[138].ToInt();
                                floor.mShoreLeftX = parse[139].ToInt();
                                floor.mShoreLeftSheet = parse[140].ToInt();
                                floor.mShoreVerticalX = parse[141].ToInt();
                                floor.mShoreVerticalSheet = parse[142].ToInt();
                                floor.mShoreHorizontalX = parse[143].ToInt();
                                floor.mShoreHorizontalSheet = parse[144].ToInt();

                                floor.mShoreInnerTopLeftX = parse[145].ToInt();
                                floor.mShoreInnerTopLeftSheet = parse[146].ToInt();
                                floor.mShoreInnerTopRightX = parse[147].ToInt();
                                floor.mShoreInnerTopRightSheet = parse[148].ToInt();
                                floor.mShoreInnerBottomRightX = parse[149].ToInt();
                                floor.mShoreInnerBottomRightSheet = parse[150].ToInt();
                                floor.mShoreInnerBottomLeftX = parse[151].ToInt();
                                floor.mShoreInnerBottomLeftSheet = parse[152].ToInt();

                                floor.mShoreInnerTopX = parse[153].ToInt();
                                floor.mShoreInnerTopSheet = parse[154].ToInt();
                                floor.mShoreInnerRightX = parse[155].ToInt();
                                floor.mShoreInnerRightSheet = parse[156].ToInt();
                                floor.mShoreInnerBottomX = parse[157].ToInt();
                                floor.mShoreInnerBottomSheet = parse[158].ToInt();
                                floor.mShoreInnerLeftX = parse[159].ToInt();
                                floor.mShoreInnerLeftSheet = parse[160].ToInt();

                                floor.mShoreSurroundedX = parse[161].ToInt();
                                floor.mShoreSurroundedSheet = parse[162].ToInt();

                                floor.mShoreTopLeftAnimX = parse[163].ToInt();
                                floor.mShoreTopLeftAnimSheet = parse[164].ToInt();
                                floor.mShoreTopRightAnimX = parse[165].ToInt();
                                floor.mShoreTopRightAnimSheet = parse[166].ToInt();
                                floor.mShoreBottomRightAnimX = parse[167].ToInt();
                                floor.mShoreBottomRightAnimSheet = parse[168].ToInt();
                                floor.mShoreBottomLeftAnimX = parse[169].ToInt();
                                floor.mShoreBottomLeftAnimSheet = parse[170].ToInt();
                                floor.mShoreDiagonalForwardAnimX = parse[171].ToInt();
                                floor.mShoreDiagonalForwardAnimSheet = parse[172].ToInt();
                                floor.mShoreDiagonalBackAnimX = parse[173].ToInt();
                                floor.mShoreDiagonalBackAnimSheet = parse[174].ToInt();

                                floor.mShoreTopAnimX = parse[175].ToInt();
                                floor.mShoreTopAnimSheet = parse[176].ToInt();
                                floor.mShoreRightAnimX = parse[177].ToInt();
                                floor.mShoreRightAnimSheet = parse[178].ToInt();
                                floor.mShoreBottomAnimX = parse[179].ToInt();
                                floor.mShoreBottomAnimSheet = parse[180].ToInt();
                                floor.mShoreLeftAnimX = parse[181].ToInt();
                                floor.mShoreLeftAnimSheet = parse[182].ToInt();
                                floor.mShoreVerticalAnimX = parse[183].ToInt();
                                floor.mShoreVerticalAnimSheet = parse[184].ToInt();
                                floor.mShoreHorizontalAnimX = parse[185].ToInt();
                                floor.mShoreHorizontalAnimSheet = parse[186].ToInt();

                                floor.mShoreInnerTopLeftAnimX = parse[187].ToInt();
                                floor.mShoreInnerTopLeftAnimSheet = parse[188].ToInt();
                                floor.mShoreInnerTopRightAnimX = parse[189].ToInt();
                                floor.mShoreInnerTopRightAnimSheet = parse[190].ToInt();
                                floor.mShoreInnerBottomRightAnimX = parse[191].ToInt();
                                floor.mShoreInnerBottomRightAnimSheet = parse[192].ToInt();
                                floor.mShoreInnerBottomLeftAnimX = parse[193].ToInt();
                                floor.mShoreInnerBottomLeftAnimSheet = parse[194].ToInt();

                                floor.mShoreInnerTopAnimX = parse[195].ToInt();
                                floor.mShoreInnerTopAnimSheet = parse[196].ToInt();
                                floor.mShoreInnerRightAnimX = parse[197].ToInt();
                                floor.mShoreInnerRightAnimSheet = parse[198].ToInt();
                                floor.mShoreInnerBottomAnimX = parse[199].ToInt();
                                floor.mShoreInnerBottomAnimSheet = parse[200].ToInt();
                                floor.mShoreInnerLeftAnimX = parse[201].ToInt();
                                floor.mShoreInnerLeftAnimSheet = parse[202].ToInt();

                                floor.mShoreSurroundedAnimX = parse[203].ToInt();
                                floor.mShoreSurroundedAnimSheet = parse[204].ToInt();

                                #endregion
                                #endregion

                                floor.GroundTile.Type = (Enums.TileType)parse[205].ToInt();
                                floor.GroundTile.Data1 = parse[206].ToInt();
                                floor.GroundTile.Data2 = parse[207].ToInt();
                                floor.GroundTile.Data3 = parse[208].ToInt();
                                floor.GroundTile.String1 = parse[209];
                                floor.GroundTile.String2 = parse[210];
                                floor.GroundTile.String3 = parse[211];

                                floor.HallTile.Type = (Enums.TileType)parse[212].ToInt();
                                floor.HallTile.Data1 = parse[213].ToInt();
                                floor.HallTile.Data2 = parse[214].ToInt();
                                floor.HallTile.Data3 = parse[215].ToInt();
                                floor.HallTile.String1 = parse[216];
                                floor.HallTile.String2 = parse[217];
                                floor.HallTile.String3 = parse[218];

                                floor.WaterTile.Type = (Enums.TileType)parse[219].ToInt();
                                floor.WaterTile.Data1 = parse[220].ToInt();
                                floor.WaterTile.Data2 = parse[221].ToInt();
                                floor.WaterTile.Data3 = parse[222].ToInt();
                                floor.WaterTile.String1 = parse[223];
                                floor.WaterTile.String2 = parse[224];
                                floor.WaterTile.String3 = parse[225];

                                floor.WallTile.Type = (Enums.TileType)parse[226].ToInt();
                                floor.WallTile.Data1 = parse[227].ToInt();
                                floor.WallTile.Data2 = parse[228].ToInt();
                                floor.WallTile.Data3 = parse[229].ToInt();
                                floor.WallTile.String1 = parse[230];
                                floor.WallTile.String2 = parse[231];
                                floor.WallTile.String3 = parse[232];

                                floor.NpcSpawnTime = parse[233].ToInt();
                                floor.NpcMin = parse[234].ToInt();
                                floor.NpcMax = parse[235].ToInt();

                                int maxItems = parse[236].ToInt();
                                int maxNpcs = parse[237].ToInt();
                                int maxSpecialTiles = parse[238].ToInt();
                                int maxWeather = parse[239].ToInt();
                                int maxChambers = parse[240].ToInt();

                                int n = 241;

                                RDungeonItem item;
                                MapNpcPreset npc;
                                RDungeonTrap specialTile;
                                Server.RDungeons.RDungeonPresetChamber presetChamber;

                                for (int i = 0; i < maxItems; i++) {
                                        item = new RDungeonItem();
                                    item.ItemNum = parse[n].ToInt();
                                    item.MinAmount = parse[n+1].ToInt();
                                    item.MaxAmount = parse[n+2].ToInt();
                                    item.AppearanceRate = parse[n+3].ToInt();
                                    item.StickyRate = parse[n+4].ToInt();
                                    item.Tag = parse[n+5];
                                    item.Hidden = parse[n+6].ToBool();
                                    item.OnGround = parse[n+7].ToBool();
                                    item.OnWater = parse[n+8].ToBool();
                                    item.OnWall = parse[n+9].ToBool();
                                    floor.Items.Add(item);
                                    n += 10;
                                }

                                for (int i = 0; i < maxNpcs; i++) {
                                    npc = new MapNpcPreset();
                                    npc.NpcNum = parse[n].ToInt();
                                    npc.MinLevel = parse[n + 1].ToInt();
                                    npc.MaxLevel = parse[n + 2].ToInt();
                                    npc.AppearanceRate = parse[n + 3].ToInt();
                                    npc.StartStatus = (Enums.StatusAilment)parse[n + 4].ToInt();
                                    npc.StartStatusCounter = parse[n + 5].ToInt();
                                    npc.StartStatusChance = parse[n + 6].ToInt();
                                    floor.Npcs.Add(npc);
                                    n+= 7;
                                }

                                for (int i = 0; i < maxSpecialTiles; i++) {
                                        specialTile = new RDungeonTrap();
                                        specialTile.SpecialTile.Type = (Enums.TileType)parse[n].ToInt();
                                        specialTile.SpecialTile.Data1 = parse[n + 1].ToInt();
                                        specialTile.SpecialTile.Data2 = parse[n + 2].ToInt();
                                        specialTile.SpecialTile.Data3 = parse[n + 3].ToInt();
                                        specialTile.SpecialTile.String1 = parse[n + 4];
                                        specialTile.SpecialTile.String2 = parse[n + 5];
                                        specialTile.SpecialTile.String3 = parse[n + 6];
                                        specialTile.SpecialTile.Ground = parse[n + 7].ToInt();
                                        specialTile.SpecialTile.GroundSet = parse[n + 8].ToInt();
                                        specialTile.SpecialTile.GroundAnim = parse[n + 9].ToInt();
                                        specialTile.SpecialTile.GroundAnimSet = parse[n + 10].ToInt();
                                        specialTile.SpecialTile.Mask = parse[n + 11].ToInt();
                                        specialTile.SpecialTile.MaskSet = parse[n + 12].ToInt();
                                        specialTile.SpecialTile.Anim	 = parse[n + 13].ToInt();
                                        specialTile.SpecialTile.AnimSet = parse[n + 14].ToInt();
                                        specialTile.SpecialTile.Mask2 = parse[n + 15].ToInt();
                                        specialTile.SpecialTile.Mask2Set = parse[n + 16].ToInt();
                                        specialTile.SpecialTile.M2Anim = parse[n + 17].ToInt();
                                        specialTile.SpecialTile.M2AnimSet = parse[n + 18].ToInt();
                                        specialTile.SpecialTile.Fringe = parse[n + 19].ToInt();
                                        specialTile.SpecialTile.FringeSet = parse[n + 20].ToInt();
                                        specialTile.SpecialTile.FAnim = parse[n + 21].ToInt();
                                        specialTile.SpecialTile.FAnimSet = parse[n + 22].ToInt();
                                        specialTile.SpecialTile.Fringe2 = parse[n + 23].ToInt();
                                        specialTile.SpecialTile.Fringe2Set = parse[n + 24].ToInt();
                                        specialTile.SpecialTile.F2Anim = parse[n + 25].ToInt();
                                        specialTile.SpecialTile.F2AnimSet = parse[n + 26].ToInt();
                                        specialTile.SpecialTile.RDungeonMapValue = parse[n + 27].ToInt();
                                        specialTile.AppearanceRate = parse[n + 28].ToInt();
                                        floor.SpecialTiles.Add(specialTile);
                                    n+= 29;
                                }

                                for (int i = 0; i < maxWeather; i++) {
                                    floor.Weather.Add((Enums.Weather)parse[n].ToInt());
                                    n++;
                                }
                                for (int i = 0; i < maxChambers; i++)
                                {
                                    presetChamber = new Server.RDungeons.RDungeonPresetChamber();
                                    presetChamber.ChamberNum = parse[n].ToInt();
                                    presetChamber.String1 = parse[n + 1];
                                    presetChamber.String2 = parse[n + 2];
                                    presetChamber.String3 = parse[n + 3];
                                    n += 3;
                                }
                                dungeon.Floors.Add(floor);
                            }
                            break;

                    }
                }
            }
            return dungeon;
        }
Ejemplo n.º 2
0
        public static void ConvertV3ToV4(int num)
        {
            DataConverter.RDungeons.V4.RDungeon rdungeonV4 = new Server.DataConverter.RDungeons.V4.RDungeon(num);

            DataConverter.RDungeons.V3.RDungeon rdungeonV3 = Server.DataConverter.RDungeons.V3.RDungeonManager.LoadRDungeon(num);

            rdungeonV4.DungeonName = rdungeonV3.DungeonName;
            rdungeonV4.Direction = rdungeonV3.Direction;
            rdungeonV4.MaxFloors = rdungeonV3.MaxFloors;
            rdungeonV4.Recruitment = rdungeonV3.Recruitment;
            rdungeonV4.Exp = rdungeonV3.Exp;
            rdungeonV4.WindTimer = rdungeonV3.WindTimer;
            rdungeonV4.DungeonIndex = 0;

            for (int i = 0; i < rdungeonV3.Floors.Count; i++)
            {
                DataConverter.RDungeons.V4.RDungeonFloor floor = new DataConverter.RDungeons.V4.RDungeonFloor();

                floor.Options.TrapMin = rdungeonV3.Floors[i].Options.TrapMin;
                floor.Options.TrapMax = rdungeonV3.Floors[i].Options.TrapMax;
                floor.Options.ItemMin = 5;
                floor.Options.ItemMax = 8;
                floor.Options.Intricacy = 6;
                floor.Options.RoomWidthMin = rdungeonV3.Floors[i].Options.RoomWidthMin;
                floor.Options.RoomWidthMax = rdungeonV3.Floors[i].Options.RoomWidthMax;
                floor.Options.RoomLengthMin = rdungeonV3.Floors[i].Options.RoomLengthMin;
                floor.Options.RoomLengthMax = rdungeonV3.Floors[i].Options.RoomLengthMax;
                floor.Options.HallTurnMin = rdungeonV3.Floors[i].Options.HallTurnMin;
                floor.Options.HallTurnMax = rdungeonV3.Floors[i].Options.HallTurnMax;
                floor.Options.HallVarMin = rdungeonV3.Floors[i].Options.HallVarMin;
                floor.Options.HallVarMax = rdungeonV3.Floors[i].Options.HallVarMax;
                floor.Options.WaterFrequency = rdungeonV3.Floors[i].Options.WaterFrequency;
                floor.Options.Craters = rdungeonV3.Floors[i].Options.Craters;
                floor.Options.CraterMinLength = rdungeonV3.Floors[i].Options.CraterMinLength;
                floor.Options.CraterMaxLength = rdungeonV3.Floors[i].Options.CraterMaxLength;
                floor.Options.CraterFuzzy = rdungeonV3.Floors[i].Options.CraterFuzzy;
                floor.Options.MinChambers = 0;
                floor.Options.MaxChambers = 0;

                floor.Darkness = -1;
                floor.GoalType = rdungeonV3.Floors[i].GoalType;
                floor.GoalMap = rdungeonV3.Floors[i].GoalMap;
                floor.GoalX = rdungeonV3.Floors[i].GoalX;
                floor.GoalY = rdungeonV3.Floors[i].GoalY;
                floor.Music = rdungeonV3.Floors[i].Music;

                floor.StairsX = rdungeonV3.Floors[i].StairsX;
                floor.StairsSheet = rdungeonV3.Floors[i].StairsSheet;

                floor.mGroundX = rdungeonV3.Floors[i].mGroundX;
                floor.mGroundSheet = rdungeonV3.Floors[i].mGroundSheet;

                floor.mTopLeftX = rdungeonV3.Floors[i].mTopLeftX;
                floor.mTopLeftSheet = rdungeonV3.Floors[i].mTopLeftSheet;
                floor.mTopCenterX = rdungeonV3.Floors[i].mTopCenterX;
                floor.mTopCenterSheet = rdungeonV3.Floors[i].mTopCenterSheet;
                floor.mTopRightX = rdungeonV3.Floors[i].mTopRightX;
                floor.mTopRightSheet = rdungeonV3.Floors[i].mTopRightSheet;

                floor.mCenterLeftX = rdungeonV3.Floors[i].mCenterLeftX;
                floor.mCenterLeftSheet = rdungeonV3.Floors[i].mCenterLeftSheet;
                floor.mCenterCenterX = rdungeonV3.Floors[i].mCenterCenterX;
                floor.mCenterCenterSheet = rdungeonV3.Floors[i].mCenterCenterSheet;
                floor.mCenterRightX = rdungeonV3.Floors[i].mCenterRightX;
                floor.mCenterRightSheet = rdungeonV3.Floors[i].mCenterRightSheet;

                floor.mBottomLeftX = rdungeonV3.Floors[i].mBottomLeftX;
                floor.mBottomLeftSheet = rdungeonV3.Floors[i].mBottomLeftSheet;
                floor.mBottomCenterX = rdungeonV3.Floors[i].mBottomCenterX;
                floor.mBottomCenterSheet = rdungeonV3.Floors[i].mBottomCenterSheet;
                floor.mBottomRightX = rdungeonV3.Floors[i].mBottomRightX;
                floor.mBottomRightSheet = rdungeonV3.Floors[i].mBottomRightSheet;

                floor.mInnerTopLeftX = rdungeonV3.Floors[i].mInnerTopLeftX;
                floor.mInnerTopLeftSheet = rdungeonV3.Floors[i].mInnerTopLeftSheet;
                floor.mInnerBottomLeftX = rdungeonV3.Floors[i].mInnerBottomLeftX;
                floor.mInnerBottomLeftSheet = rdungeonV3.Floors[i].mInnerBottomLeftSheet;
                floor.mInnerTopRightX = rdungeonV3.Floors[i].mInnerTopRightX;
                floor.mInnerTopRightSheet = rdungeonV3.Floors[i].mInnerTopRightSheet;
                floor.mInnerBottomRightX = rdungeonV3.Floors[i].mInnerBottomRightX;
                floor.mInnerBottomRightSheet = rdungeonV3.Floors[i].mInnerBottomRightSheet;

                floor.mIsolatedWallX = rdungeonV3.Floors[i].mIsolatedWallX;
                floor.mIsolatedWallSheet = rdungeonV3.Floors[i].mIsolatedWallSheet;

                floor.mColumnTopX = rdungeonV3.Floors[i].mColumnTopX;
                floor.mColumnTopSheet = rdungeonV3.Floors[i].mColumnTopSheet;
                floor.mColumnCenterX = rdungeonV3.Floors[i].mColumnCenterX;
                floor.mColumnCenterSheet = rdungeonV3.Floors[i].mColumnCenterSheet;
                floor.mColumnBottomX = rdungeonV3.Floors[i].mColumnBottomX;
                floor.mColumnBottomSheet = rdungeonV3.Floors[i].mColumnBottomSheet;

                floor.mRowLeftX = rdungeonV3.Floors[i].mRowLeftX;
                floor.mRowLeftSheet = rdungeonV3.Floors[i].mRowLeftSheet;
                floor.mRowCenterX = rdungeonV3.Floors[i].mRowCenterX;
                floor.mRowCenterSheet = rdungeonV3.Floors[i].mRowCenterSheet;
                floor.mRowRightX = rdungeonV3.Floors[i].mRowRightX;
                floor.mRowRightSheet = rdungeonV3.Floors[i].mRowRightSheet;

                floor.mGroundAltX= rdungeonV3.Floors[i].mGroundAltX;
                floor.mGroundAltSheet = rdungeonV3.Floors[i].mGroundAltSheet;
                floor.mGroundAlt2X = rdungeonV3.Floors[i].mGroundAlt2X;
                floor.mGroundAlt2Sheet = rdungeonV3.Floors[i].mGroundAlt2Sheet;

                floor.mTopLeftAltX= rdungeonV3.Floors[i].mTopLeftAltX;
                floor.mTopLeftAltSheet = rdungeonV3.Floors[i].mTopLeftAltSheet;
                floor.mTopCenterAltX= rdungeonV3.Floors[i].mTopCenterAltX;
                floor.mTopCenterAltSheet = rdungeonV3.Floors[i].mTopCenterAltSheet;
                floor.mTopRightAltX= rdungeonV3.Floors[i].mTopRightAltX;
                floor.mTopRightAltSheet = rdungeonV3.Floors[i].mTopRightAltSheet;

                floor.mCenterLeftAltX= rdungeonV3.Floors[i].mCenterLeftAltX;
                floor.mCenterLeftAltSheet = rdungeonV3.Floors[i].mCenterLeftAltSheet;
                floor.mCenterCenterAltX= rdungeonV3.Floors[i].mCenterCenterAltX;
                floor.mCenterCenterAltSheet = rdungeonV3.Floors[i].mCenterCenterAltSheet;
                floor.mCenterCenterAlt2X = rdungeonV3.Floors[i].mCenterCenterAlt2X;
                floor.mCenterCenterAlt2Sheet = rdungeonV3.Floors[i].mCenterCenterAlt2Sheet;
                floor.mCenterRightAltX= rdungeonV3.Floors[i].mCenterRightAltX;
                floor.mCenterRightAltSheet = rdungeonV3.Floors[i].mCenterRightAltSheet;

                floor.mBottomLeftAltX= rdungeonV3.Floors[i].mBottomLeftAltX;
                floor.mBottomLeftAltSheet = rdungeonV3.Floors[i].mBottomLeftAltSheet;
                floor.mBottomCenterAltX= rdungeonV3.Floors[i].mBottomCenterAltX;
                floor.mBottomCenterAltSheet = rdungeonV3.Floors[i].mBottomCenterAltSheet;
                floor.mBottomRightAltX= rdungeonV3.Floors[i].mBottomRightAltX;
                floor.mBottomRightAltSheet = rdungeonV3.Floors[i].mBottomRightAltSheet;

                floor.mInnerTopLeftAltX= rdungeonV3.Floors[i].mInnerTopLeftAltX;
                floor.mInnerTopLeftAltSheet = rdungeonV3.Floors[i].mInnerTopLeftAltSheet;
                floor.mInnerBottomLeftAltX= rdungeonV3.Floors[i].mInnerBottomLeftAltX;
                floor.mInnerBottomLeftAltSheet = rdungeonV3.Floors[i].mInnerBottomLeftAltSheet;
                floor.mInnerTopRightAltX= rdungeonV3.Floors[i].mInnerTopRightAltX;
                floor.mInnerTopRightAltSheet = rdungeonV3.Floors[i].mInnerTopRightAltSheet;
                floor.mInnerBottomRightAltX= rdungeonV3.Floors[i].mInnerBottomRightAltX;
                floor.mInnerBottomRightAltSheet = rdungeonV3.Floors[i].mInnerBottomRightAltSheet;

                floor.mIsolatedWallAltX= rdungeonV3.Floors[i].mIsolatedWallAltX;
                floor.mIsolatedWallAltSheet = rdungeonV3.Floors[i].mIsolatedWallAltSheet;

                floor.mColumnTopAltX= rdungeonV3.Floors[i].mColumnTopAltX;
                floor.mColumnTopAltSheet = rdungeonV3.Floors[i].mColumnTopAltSheet;
                floor.mColumnCenterAltX= rdungeonV3.Floors[i].mColumnCenterAltX;
                floor.mColumnCenterAltSheet = rdungeonV3.Floors[i].mColumnCenterAltSheet;
                floor.mColumnBottomAltX= rdungeonV3.Floors[i].mColumnBottomAltX;
                floor.mColumnBottomAltSheet = rdungeonV3.Floors[i].mColumnBottomAltSheet;

                floor.mRowLeftAltX= rdungeonV3.Floors[i].mRowLeftAltX;
                floor.mRowLeftAltSheet = rdungeonV3.Floors[i].mRowLeftAltSheet;
                floor.mRowCenterAltX= rdungeonV3.Floors[i].mRowCenterAltX;
                floor.mRowCenterAltSheet = rdungeonV3.Floors[i].mRowCenterAltSheet;
                floor.mRowRightAltX= rdungeonV3.Floors[i].mRowRightAltX;
                floor.mRowRightAltSheet = rdungeonV3.Floors[i].mRowRightAltSheet;

                floor.mWaterX = rdungeonV3.Floors[i].mWaterX;
                floor.mWaterSheet = rdungeonV3.Floors[i].mWaterSheet;
                floor.mWaterAnimX = rdungeonV3.Floors[i].mWaterAnimX;
                floor.mWaterAnimSheet = rdungeonV3.Floors[i].mWaterAnimSheet;

                floor.mShoreTopLeftX = rdungeonV3.Floors[i].mShoreTopLeftX;
                floor.mShoreTopLeftSheet = rdungeonV3.Floors[i].mShoreTopLeftSheet;
                floor.mShoreTopRightX = rdungeonV3.Floors[i].mShoreTopRightX;
                floor.mShoreTopRightSheet = rdungeonV3.Floors[i].mShoreTopRightSheet;
                floor.mShoreBottomRightX = rdungeonV3.Floors[i].mShoreBottomRightX;
                floor.mShoreBottomRightSheet = rdungeonV3.Floors[i].mShoreBottomRightSheet;
                floor.mShoreBottomLeftX = rdungeonV3.Floors[i].mShoreBottomLeftX;
                floor.mShoreBottomLeftSheet = rdungeonV3.Floors[i].mShoreBottomLeftSheet;
                floor.mShoreDiagonalForwardX = rdungeonV3.Floors[i].mShoreDiagonalForwardX;
                floor.mShoreDiagonalForwardSheet = rdungeonV3.Floors[i].mShoreDiagonalForwardSheet;
                floor.mShoreDiagonalBackX = rdungeonV3.Floors[i].mShoreDiagonalBackX;
                floor.mShoreDiagonalBackSheet = rdungeonV3.Floors[i].mShoreDiagonalBackSheet;
                floor.mShoreTopX = rdungeonV3.Floors[i].mShoreTopX;
                floor.mShoreTopSheet = rdungeonV3.Floors[i].mShoreTopSheet;
                floor.mShoreRightX = rdungeonV3.Floors[i].mShoreRightX;
                floor.mShoreRightSheet = rdungeonV3.Floors[i].mShoreRightSheet;
                floor.mShoreBottomX = rdungeonV3.Floors[i].mShoreBottomX;
                floor.mShoreBottomSheet = rdungeonV3.Floors[i].mShoreBottomSheet;
                floor.mShoreLeftX = rdungeonV3.Floors[i].mShoreLeftX;
                floor.mShoreLeftSheet = rdungeonV3.Floors[i].mShoreLeftSheet;
                floor.mShoreVerticalX = rdungeonV3.Floors[i].mShoreVerticalX;
                floor.mShoreVerticalSheet = rdungeonV3.Floors[i].mShoreVerticalSheet;
                floor.mShoreHorizontalX = rdungeonV3.Floors[i].mShoreHorizontalX;
                floor.mShoreHorizontalSheet = rdungeonV3.Floors[i].mShoreHorizontalSheet;
                floor.mShoreInnerTopLeftX = rdungeonV3.Floors[i].mShoreInnerTopLeftX;
                floor.mShoreInnerTopLeftSheet = rdungeonV3.Floors[i].mShoreInnerTopLeftSheet;
                floor.mShoreInnerTopRightX = rdungeonV3.Floors[i].mShoreInnerTopRightX;
                floor.mShoreInnerTopRightSheet = rdungeonV3.Floors[i].mShoreInnerTopRightSheet;
                floor.mShoreInnerBottomRightX = rdungeonV3.Floors[i].mShoreInnerBottomRightX;
                floor.mShoreInnerBottomRightSheet = rdungeonV3.Floors[i].mShoreInnerBottomRightSheet;
                floor.mShoreInnerBottomLeftX = rdungeonV3.Floors[i].mShoreInnerBottomLeftX;
                floor.mShoreInnerBottomLeftSheet = rdungeonV3.Floors[i].mShoreInnerBottomLeftSheet;
                floor.mShoreInnerTopX = rdungeonV3.Floors[i].mShoreInnerTopX;
                floor.mShoreInnerTopSheet = rdungeonV3.Floors[i].mShoreInnerTopSheet;
                floor.mShoreInnerRightX = rdungeonV3.Floors[i].mShoreInnerRightX;
                floor.mShoreInnerRightSheet = rdungeonV3.Floors[i].mShoreInnerRightSheet;
                floor.mShoreInnerBottomX = rdungeonV3.Floors[i].mShoreInnerBottomX;
                floor.mShoreInnerBottomSheet = rdungeonV3.Floors[i].mShoreInnerBottomSheet;
                floor.mShoreInnerLeftX = rdungeonV3.Floors[i].mShoreInnerLeftX;
                floor.mShoreInnerLeftSheet = rdungeonV3.Floors[i].mShoreInnerLeftSheet;
                floor.mShoreSurroundedX = rdungeonV3.Floors[i].mShoreSurroundedX;
                floor.mShoreSurroundedSheet = rdungeonV3.Floors[i].mShoreSurroundedSheet;

                floor.mShoreTopLeftAnimX = rdungeonV3.Floors[i].mShoreTopLeftAnimX;
                floor.mShoreTopLeftAnimSheet = rdungeonV3.Floors[i].mShoreTopLeftAnimSheet;
                floor.mShoreTopRightAnimX = rdungeonV3.Floors[i].mShoreTopRightAnimX;
                floor.mShoreTopRightAnimSheet = rdungeonV3.Floors[i].mShoreTopRightAnimSheet;
                floor.mShoreBottomRightAnimX = rdungeonV3.Floors[i].mShoreBottomRightAnimX;
                floor.mShoreBottomRightAnimSheet = rdungeonV3.Floors[i].mShoreBottomRightAnimSheet;
                floor.mShoreBottomLeftAnimX = rdungeonV3.Floors[i].mShoreBottomLeftAnimX;
                floor.mShoreBottomLeftAnimSheet = rdungeonV3.Floors[i].mShoreBottomLeftAnimSheet;
                floor.mShoreDiagonalForwardAnimX = rdungeonV3.Floors[i].mShoreDiagonalForwardAnimX;
                floor.mShoreDiagonalForwardAnimSheet = rdungeonV3.Floors[i].mShoreDiagonalForwardAnimSheet;
                floor.mShoreDiagonalBackAnimX = rdungeonV3.Floors[i].mShoreDiagonalBackAnimX;
                floor.mShoreDiagonalBackAnimSheet = rdungeonV3.Floors[i].mShoreDiagonalBackAnimSheet;
                floor.mShoreTopAnimX = rdungeonV3.Floors[i].mShoreTopAnimX;
                floor.mShoreTopAnimSheet = rdungeonV3.Floors[i].mShoreTopAnimSheet;
                floor.mShoreRightAnimX = rdungeonV3.Floors[i].mShoreRightAnimX;
                floor.mShoreRightAnimSheet = rdungeonV3.Floors[i].mShoreRightAnimSheet;
                floor.mShoreBottomAnimX = rdungeonV3.Floors[i].mShoreBottomAnimX;
                floor.mShoreBottomAnimSheet = rdungeonV3.Floors[i].mShoreBottomAnimSheet;
                floor.mShoreLeftAnimX = rdungeonV3.Floors[i].mShoreLeftAnimX;
                floor.mShoreLeftAnimSheet = rdungeonV3.Floors[i].mShoreLeftAnimSheet;
                floor.mShoreVerticalAnimX = rdungeonV3.Floors[i].mShoreVerticalAnimX;
                floor.mShoreVerticalAnimSheet = rdungeonV3.Floors[i].mShoreVerticalAnimSheet;
                floor.mShoreHorizontalAnimX = rdungeonV3.Floors[i].mShoreHorizontalAnimX;
                floor.mShoreHorizontalAnimSheet = rdungeonV3.Floors[i].mShoreHorizontalAnimSheet;
                floor.mShoreInnerTopLeftAnimX = rdungeonV3.Floors[i].mShoreInnerTopLeftAnimX;
                floor.mShoreInnerTopLeftAnimSheet = rdungeonV3.Floors[i].mShoreInnerTopLeftAnimSheet;
                floor.mShoreInnerTopRightAnimX = rdungeonV3.Floors[i].mShoreInnerTopRightAnimX;
                floor.mShoreInnerTopRightAnimSheet = rdungeonV3.Floors[i].mShoreInnerTopRightAnimSheet;
                floor.mShoreInnerBottomRightAnimX = rdungeonV3.Floors[i].mShoreInnerBottomRightAnimX;
                floor.mShoreInnerBottomRightAnimSheet = rdungeonV3.Floors[i].mShoreInnerBottomRightAnimSheet;
                floor.mShoreInnerBottomLeftAnimX = rdungeonV3.Floors[i].mShoreInnerBottomLeftAnimX;
                floor.mShoreInnerBottomLeftAnimSheet = rdungeonV3.Floors[i].mShoreInnerBottomLeftAnimSheet;
                floor.mShoreInnerTopAnimX = rdungeonV3.Floors[i].mShoreInnerTopAnimX;
                floor.mShoreInnerTopAnimSheet = rdungeonV3.Floors[i].mShoreInnerTopAnimSheet;
                floor.mShoreInnerRightAnimX = rdungeonV3.Floors[i].mShoreInnerRightAnimX;
                floor.mShoreInnerRightAnimSheet = rdungeonV3.Floors[i].mShoreInnerRightAnimSheet;
                floor.mShoreInnerBottomAnimX = rdungeonV3.Floors[i].mShoreInnerBottomAnimX;
                floor.mShoreInnerBottomAnimSheet = rdungeonV3.Floors[i].mShoreInnerBottomAnimSheet;
                floor.mShoreInnerLeftAnimX = rdungeonV3.Floors[i].mShoreInnerLeftAnimX;
                floor.mShoreInnerLeftAnimSheet = rdungeonV3.Floors[i].mShoreInnerLeftAnimSheet;
                floor.mShoreSurroundedAnimX = rdungeonV3.Floors[i].mShoreSurroundedAnimX;
                floor.mShoreSurroundedAnimSheet = rdungeonV3.Floors[i].mShoreSurroundedAnimSheet;

                floor.GroundTile = rdungeonV3.Floors[i].GroundTile;
                floor.HallTile = rdungeonV3.Floors[i].HallTile;
                floor.WaterTile = rdungeonV3.Floors[i].WaterTile;
                floor.WallTile = rdungeonV3.Floors[i].WallTile;

                floor.NpcSpawnTime = rdungeonV3.Floors[i].NpcSpawnTime;
                floor.NpcMin = rdungeonV3.Floors[i].NpcMin;
                floor.NpcMax = rdungeonV3.Floors[i].NpcMax;

                RDungeons.V4.RDungeonItem item;
                MapNpcPreset npc;
                RDungeons.V4.RDungeonTrap specialTile;

                for (int j = 0; j < rdungeonV3.Floors[i].Items.Count; j++)
                {
                    if (rdungeonV3.Floors[i].Items[j].ItemNum > 0)
                    {
                        item = new RDungeons.V4.RDungeonItem();
                        item.ItemNum = rdungeonV3.Floors[i].Items[j].ItemNum;
                        item.MinAmount = rdungeonV3.Floors[i].Items[j].MinAmount;
                        item.MaxAmount = rdungeonV3.Floors[i].Items[j].MaxAmount;
                        item.AppearanceRate = rdungeonV3.Floors[i].Items[j].AppearanceRate;
                        item.StickyRate = rdungeonV3.Floors[i].Items[j].StickyRate;
                        item.Tag = rdungeonV3.Floors[i].Items[j].Tag;
                        item.Hidden = rdungeonV3.Floors[i].Items[j].Hidden;
                        item.OnGround = rdungeonV3.Floors[i].Items[j].OnGround;
                        item.OnWater = rdungeonV3.Floors[i].Items[j].OnWater;
                        item.OnWall = rdungeonV3.Floors[i].Items[j].OnWall;
                        floor.Items.Add(item);
                    }

                }
                for (int j = 0; j < rdungeonV3.Floors[i].Npcs.Count; j++)
                {
                    if (rdungeonV3.Floors[i].Npcs[j].NpcNum > 0)
                    {
                        npc = new MapNpcPreset();
                        npc.NpcNum = rdungeonV3.Floors[i].Npcs[j].NpcNum;
                        npc.MinLevel = rdungeonV3.Floors[i].Npcs[j].MinLevel;
                        npc.MaxLevel = rdungeonV3.Floors[i].Npcs[j].MinLevel;
                        npc.AppearanceRate = rdungeonV3.Floors[i].Npcs[j].AppearanceRate;
                        floor.Npcs.Add(npc);
                    }

                }
                foreach (Tile j in rdungeonV3.Floors[i].SpecialTiles)
                {
                    specialTile = new RDungeons.V4.RDungeonTrap();
                    specialTile.SpecialTile = j;
                    specialTile.AppearanceRate = 100;
                    floor.SpecialTiles.Add(specialTile);
                }

                foreach (Enums.Weather j in rdungeonV3.Floors[i].Weather)
                {
                    floor.Weather.Add(j);
                }

                rdungeonV4.Floors.Add(floor);
            }

            Server.DataConverter.RDungeons.V4.RDungeonManager.SaveRDungeon(rdungeonV4, num);
        }