/*
 *
 *  Iter Vehemens ad Necem (IVAN)
 *  Copyright (C) Timo Kiviluoto
 *  Released under the GNU General
 *  Public License
 *
 *  See LICENSING which should be included
 *  along with this file for more details
 *
 */

/*
 * NOTICE!!!
 *
 * This file contains SPOILERS, which might ruin your IVAN experience
 * totally. Also, editing anything can DESTROY GAME BALANCE or CAUSE
 * OBSCURE BUGS if you don't know what you're doing. So from here on,
 * proceed at your own risk!
 */

/* Team and dungeon data for the game */

Dungeons = 4;
Teams = 12;

/*
 * Description of hard-coded teams:
 * 0 == PLAYER_TEAM == Player and pets
 * 1 == MONSTER_TEAM == Monsters, default relation to other teams == hostile
 * 2 == ATTNAM_TEAM == Residents of Attnam
 * 3 == SUMO_TEAM == Huang Ming Pong during an arena figth
 * 7 == NEW_ATTNAM_TEAM == natives and ostriches of New Attnam
 * 8 == COLONIST_TEAM == colonists of New Attnam
 * 9 == TOURIST_GUIDE_TEAM == dummy team which holds the village elder, who tourists follow
 * 10 == TOURIST_TEAM == tourists of New Attnam
 * 11 == BETRAYED_TEAM == pets which the player has angered
 */

Team ATTNAM_TEAM;
{
  Relation 0, FRIEND;
  KillEvilness = 50;
}

Team SUMO_TEAM;
{
  Relation 0, HOSTILE;
}

Team 4; /* Spawned hostile angels */
{
  Relation 0, HOSTILE;
  Relation 1, UNCARING;
}

Team 5; /* Dungeon shopkeepers */
{
  Relation 1, UNCARING;
  KillEvilness = 100;
}

Team IVAN_TEAM;
{
  KillEvilness = 100;
}

Team NEW_ATTNAM_TEAM;
{
  KillEvilness = 50;
}

Team COLONIST_TEAM;
{
  Relation 7, FRIEND;
}

Team TOURIST_GUIDE_TEAM;
{
  Relation 7, FRIEND;
  Relation 8, FRIEND;
  KillEvilness = 50;
}

Team TOURIST_TEAM;
{
  Relation 7, FRIEND;
  Relation 8, FRIEND;
  KillEvilness = 10;
}

Team BETRAYED_TEAM;
{
  Relation 0, HOSTILE;
  KillEvilness = 10;
}

Dungeon ELPURI_CAVE;
{
  Levels = 13;
  Description = "gloomy cave";
  ShortDescription = "GC";

  LevelDefault
  {
    FillSquare = solidterrain(GROUND), GNEISS earth;
    TunnelSquare = solidterrain(GROUND), 0;
    Size = 64, 36;
    Rooms = 10:30;
    Items = 25:50;
    GenerateMonsters = true;
    IsOnGround = false;
    TeamDefault = MONSTER_TEAM;
    LOSModifier = 16;
    IgnoreDefaultSpecialSquares = false;
    DifficultyBase = 50;
    DifficultyDelta = 10;
    MonsterAmountBase = 10;
    MonsterAmountDelta = 2;
    MonsterGenerationIntervalBase = 140;
    MonsterGenerationIntervalDelta = -10;
    CanGenerateBone = true;
    ItemMinPriceBase = 20;
    ItemMinPriceDelta = 10;
    EnchantmentMinusChanceBase = 0;
    EnchantmentMinusChanceDelta = 0;
    EnchantmentPlusChanceBase = 5;
    EnchantmentPlusChanceDelta = 5;
    BackGroundType = GRAY_FRACTAL;

    Square, Random NOT_WALKABLE|NOT_IN_ROOM;
    {
      Items == stone;
      Times = 25:50;
    }

    Square, Random;
    {
      Items == mine { Team = MONSTER_TEAM; IsActive = true; }
      Times = 0:3;
    }

    Square, Random;
    {
      Items == beartrap { Team = MONSTER_TEAM; IsActive = true; }
      Times = 0:3;
    }

    Square, Random NOT_WALKABLE|ATTACHABLE;
    {
      OTerrain = stairs(STAIRS_UP);
      EntryIndex = STAIRS_UP;
      AttachRequired = true;
    }

    Square, Random NOT_WALKABLE|ATTACHABLE;
    {
      OTerrain = stairs(STAIRS_DOWN);
      EntryIndex = STAIRS_DOWN;
      AttachRequired = true;
    }

    RoomDefault
    {
      Pos = 2:XSize-5,2:YSize-5;
      Size = 4:11,4:11;
      AltarPossible = true;
      WallSquare = solidterrain(GROUND), GRANITE wall(BRICK_OLD);
      FloorSquare = solidterrain(PARQUET), 0;
      DoorSquare = solidterrain(PARQUET), GRANITE door;
      GenerateDoor = true;
      DivineMaster = 0;
      GenerateTunnel = true;
      GenerateLanterns = true;
      Type = ROOM_NORMAL;
      GenerateFountains = true;
      AllowLockedDoors = true;
      AllowBoobyTrappedDoors = true;
      Shape = RECTANGLE;
      IsInside = true;
      GenerateWindows = false;
      UseFillSquareWalls = false;
      Flags = 0;
    }
  }

  Level 0;
  {
    FillSquare = solidterrain(GROUND), MORAINE earth;

    RoomDefault
    {
      Pos = 2:XSize-5,2:YSize-5;
      WallSquare = solidterrain(GROUND), FIR_WOOD wall(BRICK_OLD);
      FloorSquare = solidterrain(PARQUET), 0;
      DoorSquare = solidterrain(PARQUET), FIR_WOOD door;
    }
  }

  RandomLevel 1:3;
  {
    Size = 80, 60;

    RoomDefault
    {
      Pos = 2:XSize-5,2:YSize-5;
      Size = 10:20,10:20;
    }

    Room
    {
      AltarPossible = false;
      Size = 30,30;
      Flags = NO_MONSTER_GENERATION;

      Square, Random;
      {
        OTerrain = STEEL sign { Text = "Experimental dwarven mine field. Thank you for participating in testing!"; }
      }

      Square, Random;
      {
        Items == Random { MinPrice = 100; Chance = 50; }
        Times = 20;
      }

      Square, Random;
      {
        Items == Random { MinPrice = 500; Chance = 50; }
        Times = 4;
      }

      Square, Random;
      {
        Items == mine { Team = MONSTER_TEAM; IsActive = true; Chance = 25; }
        Times = 40;
      }

      Square, Random;
      {
        Items == mine(BIG_MINE) { Team = MONSTER_TEAM; IsActive = true; Chance = 25; }
        Times = 20;
      }

      Square, Random;
      {
        Items == backpack { Chance = 25; }
        Times = 4;
      }
    }
  }

  RandomLevel 1:2;
  {
    LevelMessage = "You hear many wolves howling. You shiver.";

    Room
    {
      Size = 7,6;
      AltarPossible = false;
      Shape = ROUND_CORNERS;

      CharacterMap
      {
        Pos = 1,1;
        Size = 5,4;

        Types
        {
          w = wolf;
          W = werewolfhuman { Inventory = { 2, scrollofenchantweapon, scrollofenchantarmor; } }
        }
      }
      {
        .www.
        wwWww
        wwwww
        .www.
      }
    }
  }

  RandomLevel 1:3;
  {
    CanGenerateBone = false;

    Room
    {
      Size = 5,9;
      AltarPossible = false;
      DivineMaster = MELLIS;
      Type = ROOM_SHOP;
      GenerateFountains = false;

      CharacterMap
      {
        Pos = 1, 1;
        Size = 3, 7;

        Types
        {
          g = guard(SHOP) { Team = 5; }
          s = shopkeeper(ELPURI_CAVE) { Team = 5; Flags = IS_MASTER; }
        }
      }
      {
        g.g
        ...
        ...
        .s.
        ...
        ...
        g.g
      }

      ItemMap
      {
        Pos = 1,1;
        Size = 3,7;

        Types
        {
          g == Random { MinPrice = 100; MaxPrice = 10000; Category = GAUNTLET|BOOT; }
          b == Random { MinPrice = 100; MaxPrice = 10000; Category = GAUNTLET|BOOT; }
          a == Random { MinPrice = 500; MaxPrice = 10000; Category = HELMET|CLOAK|BODY_ARMOR|BELT; }
          d == Random { MinPrice = 200; MaxPrice = 10000; Category = RING|AMULET; }
          w == Random { MinPrice = 500; MaxPrice = 10000; Category = WEAPON|SHIELD; }
          e == Random { MinPrice = 50; MaxPrice = 10000; Category = FOOD|POTION; }
          u == Random { MinPrice = 200; MaxPrice = 10000; Category = WAND|TOOL; }
          r == Random { MinPrice = 200; MaxPrice = 10000; Category = SCROLL|BOOK; }
          s == wand(WAND_OF_STRIKING);
        }
      }
      {
        .g.
        ddb
        err
        e.w
        auw
        auw
        .s.
      }
    }
  }

  RandomLevel 0:11;
  {
    /* I'm Evil, Bwahaha */

    Square, Random;
    {
      Items == VALPURIUM VALPURIUM flamingsword { Enchantment = 10; LifeExpectancy = 1000:10000; Chance = 5; }
    }
  }

  RandomLevel 0:11;
  {
    /* I'm Evil, Bwahaha */

    Square, Random;
    {
      Items == itemcontainer(LARGE_CHEST) { LifeExpectancy = 100:10000; Chance = 5; ItemsInside == Random { MinPrice = 1500; Times = 10; Category = HELMET|AMULET|CLOAK|BODY_ARMOR|WEAPON|SHIELD|RING|GAUNTLET|BELT|BOOT|TOOL|VALUABLE; LifeExpectancy = 100:10000; } }
    }
  }

  RandomLevel 1:4;
  {
    CanGenerateBone = false;

    Room
    {
      Size = 9,9;
      AltarPossible = false;
      GenerateFountains = false;

      OTerrainMap
      {
        Size = 3,3;
        Pos = 3,3;
        Types
        {
          # = METEORIC_STEEL wall(BRICK_OLD);
        }
      }
      {
        ###
        #.#
        ###
      }

      Square, Pos 4,4;
      {
        Items = { 2, MITHRIL beartrap { Team = MONSTER_TEAM; IsActive = true; Chance = 25; }, METEORIC_STEEL itemcontainer(CHEST|OCTAGONAL_LOCK) { Parameters = LOCKED; ItemsInside == Random { MinPrice = 1250; Times = 2; } } }
      }
    }
  }

  Level ENNER_BEAST_LEVEL;
  {
    LevelMessage = "You hear a wailing scream in the distance. An enner beast must dwell in the level!";
    IgnoreDefaultSpecialSquares = true;
    Items = 35:70;

    Square, Random;
    {
      Items == mine(BIG_MINE) { Team = MONSTER_TEAM; IsActive = true; }
    }

    Square, Random;
    {
      Items == METEORIC_STEEL beartrap { Team = MONSTER_TEAM; IsActive = true; }
      Times = 2:6;
    }

    Square, Random NOT_WALKABLE|NOT_IN_ROOM;
    {
      Items == stone;
      Times = 25:50;
    }

    Square, Random NOT_WALKABLE|ATTACHABLE;
    {
      OTerrain = stairs(STAIRS_UP);
      EntryIndex = STAIRS_UP;
      AttachRequired = true;
    }

    Square, Random NOT_WALKABLE|ATTACHABLE;
    {
      OTerrain = stairs(STAIRS_DOWN);
      EntryIndex = STAIRS_DOWN;
      AttachRequired = true;
    }

    Square, Random;
    {
      Items == bone;
      Times = 20;
    }

    Square, Random;
    {
      Items == skull;
      Times = 5;
    }

    Square, Random NOT_IN_ROOM;
    {
      Character = ennerbeast;
    }
  }

  Level ZOMBIE_LEVEL;
  {
    Rooms = 1;
    IgnoreDefaultSpecialSquares = true;
    MonsterAmountBase = 20;
    LOSModifier = 24;
    FillSquare = FLINT solidterrain(GROUND), GNEISS earth;

    Room
    {
      Pos = 2,2;
      Size = 60,32;
      AltarPossible = false;
      WallSquare = FLINT solidterrain(GROUND), 0;
      FloorSquare = FLINT solidterrain(GROUND), 0;
      GenerateDoor = false;
      GenerateTunnel = false;
      GenerateLanterns = false;
      GenerateFountains = false;

      Square, BoundedRandom 1, 1, 25, 58, HAS_NO_OTERRAIN;
      {
        OTerrain = stairs(STAIRS_UP);
        EntryIndex = STAIRS_UP;
      }

      Square, BoundedRandom 35, 1, 58, 58, HAS_NO_OTERRAIN;
      {
        OTerrain = stairs(STAIRS_DOWN);
        EntryIndex = STAIRS_DOWN;
      }

      Square, BoundedRandom 35, 1, 58, 58, 0;
      {
        Character = veterankamikazedwarf;
      }
    }

    Square, Random;
    {
      Character = zombie;
      Times = 30;
    }
  }

  RandomLevel 1:4;
  {
    Room /* vault */
    {
      GenerateLanterns = false;
      GenerateFountains = false;
      GenerateDoor = false;
      GenerateTunnel = false;
      AltarPossible = false;
      Size = 7,7;
      UseFillSquareWalls = true;
      Flags = NO_MONSTER_GENERATION;

      OTerrainMap
      {
        Pos = 1,1;
        Size = 5,5;
        Types
        {
          x = IRON wall(BRICK_OLD);
        }
      }
      {
        xxxxx
        x...x
        x...x
        x...x
        xxxxx
      }

      Square, Random;
      {
        Items == mine { Team = MONSTER_TEAM; IsActive = true; Chance = 50; }
      }

      Square, Random;
      {
        Items == mine(BIG_MINE) { Team = MONSTER_TEAM; IsActive = true; Chance = 50; }
      }

      Square, Random;
      {
        Items == MITHRIL beartrap { Team = MONSTER_TEAM; IsActive = true; Chance = 50; }
        Times = 2;
      }

      Square, Pos 3,3;
      {
        Items == METEORIC_STEEL itemcontainer(CHEST|OCTAGONAL_LOCK)
        {
          Parameters = LOCKED;
          ItemsInside = { 2,  Random { MinPrice = 1250; Times = 2; },
                              stone { Chance = 75; Times = 3; } }
        }
      }
    }
  }

  Level 6;
  {
    IgnoreDefaultSpecialSquares = true;
    FillSquare = solidterrain(GROUND), QUARTZITE earth;

    RoomDefault
    {
      WallSquare = solidterrain(GROUND), COPPER wall(BRICK_OLD);
      FloorSquare = solidterrain(PARQUET), 0;
      DoorSquare = solidterrain(PARQUET), COPPER door;
    }

    Square, Random NOT_WALKABLE|NOT_IN_ROOM;
    {
      Items == stone;
      Times = 25:50;
    }

    Square, Random;
    {
      Items == mine { Team = MONSTER_TEAM; IsActive = true; }
      Times = 0:3;
    }

    Square, Random;
    {
      Items == mine(BIG_MINE) { Team = MONSTER_TEAM; IsActive = true; Chance = 50; }
    }

    Square, Random;
    {
      Items == METEORIC_STEEL beartrap { Team = MONSTER_TEAM; IsActive = true; }
      Times = 2:6;
    }

    Square, Random NOT_WALKABLE|ATTACHABLE;
    {
      OTerrain = stairs(STAIRS_UP);
      EntryIndex = STAIRS_UP;
      AttachRequired = true;
    }

    Room
    {
      Size = 7,7;
      AltarPossible = false;
      GenerateFountains = false;
      GenerateDoor = false;
      GenerateLanterns = false;
      WallSquare = solidterrain(GROUND),IRON wall(BRICK_OLD);
      FloorSquare = IRON solidterrain(PARQUET), 0;
      DoorSquare = IRON solidterrain(PARQUET),IRON door { Parameters = LOCKED; }

      Square, Pos 3,6;
      {
        GTerrain = solidterrain(PARQUET);
        OTerrain = IRON door { Parameters = LOCKED; }
        AttachRequired = true;
      }

      Square, Pos 3,3;
      {
        Character = mysticfrog(DARK);
        OTerrain = stairs(STAIRS_DOWN);
        EntryIndex = STAIRS_DOWN;
      }

      Square, Random;
      {
        Character = frog(GREATER_DARK);
        Times = 2;
      }

      Square, Random;
      {
        Character = frog(DARK);
        Times = 4;
      }
    }
  }

  Level IVAN_LEVEL;
  {
    LevelMessage = "You hear someone singing loudly: \"Uncle Lenin lives in Russia...\"";
    FillSquare = solidterrain(GROUND), QUARTZITE earth;

    RoomDefault
    {
      WallSquare = solidterrain(GROUND), BRONZE wall(BRICK_OLD);
      FloorSquare = solidterrain(PARQUET), 0;
      DoorSquare = solidterrain(PARQUET), BRONZE door;
    }

    Square, Random;
    {
      Items == mine(BIG_MINE) { Team = MONSTER_TEAM; IsActive = true; }
      Times = 0:2;
    }

    Square, Random NOT_IN_ROOM;
    {
      Character = communist { Team = IVAN_TEAM; Flags = IS_LEADER; }
    }

    Square, Random;
    {
      Character = vladimir { Team = IVAN_TEAM; }
    }
  }

  RandomLevel 6:8;
  {
    Room /* vault */
    {
      GenerateLanterns = false;
      GenerateFountains = false;
      GenerateDoor = false;
      GenerateTunnel = false;
      AltarPossible = false;
      Size = 7,7;
      UseFillSquareWalls = true;
      Flags = NO_MONSTER_GENERATION;

      OTerrainMap
      {
        Pos = 1,1;
        Size = 5,5;
        Types
        {
          x = STEEL wall(BRICK_OLD);
        }
      }
      {
        xxxxx
        x...x
        x...x
        x...x
        xxxxx
      }

      Square, Random;
      {
        Items == mine { Team = MONSTER_TEAM; IsActive = true; }
      }

      Square, Random;
      {
        Items == mine(BIG_MINE) { Team = MONSTER_TEAM; IsActive = true; Chance = 75; }
      }

      Square, Random;
      {
        Items == OCTIRON beartrap { Team = MONSTER_TEAM; IsActive = true; Chance = 50; }
        Times = 4;
      }

      Square, Pos 3,3;
      {
        Items == ADAMANT itemcontainer(CHEST|OCTAGONAL_LOCK)
        {
          Parameters = LOCKED;
          ItemsInside == Random { MinPrice = 2000; Times = 2; }
        }
      }
    }
  }

  Level DARK_LEVEL;
  {
    Description = "dark level";
    ShortDescription = "DarkLevel";
    LevelMessage = "You shudder as you sense a being of pure darkness nearby. Your goal is near.";
    FillSquare = STEEL solidterrain(FLOOR), STEEL wall(BRICK_OLD);
    TunnelSquare = STEEL solidterrain(FLOOR), 0;
    Items = 0;
    IgnoreDefaultSpecialSquares = true;

    Square, Random;
    {
      Items == mine(BIG_MINE) { Team = MONSTER_TEAM; IsActive = true; }
      Times = 1:3;
    }

    RoomDefault
    {
      AltarPossible = false;
      FloorSquare = STEEL solidterrain(PARQUET), 0;
      WallSquare = STEEL solidterrain(FLOOR), STEEL wall(BRICK_OLD);
      DoorSquare = STEEL solidterrain(PARQUET), STEEL door;
      GenerateLanterns = false;
      GenerateFountains = false;
    }

    Room
    {
      Size = 11, 11;
      DivineMaster = SCABIES;

      Square, Pos 5, 5;
      {
        OTerrain = portal(DARK_LEVEL) { AttachedArea = DARK_LEVEL + 1; AttachedEntry = STAIRS_UP; }
        Character = elpuri;
      }

      Square, Random;
      {
        Character = frog(DARK);
        Times = 8;
      }

      Square, Random;
      {
        Character = frog(GREATER_DARK);
        Times = 4;
      }

      Square, Random;
      {
        Character = frog(GIANT_DARK);
        Times = 2;
      }

      Square, Random;
      {
        Character = mysticfrog(DARK);
      }

      Square, Random;
      {
        Items == HUMAN_FLESH lump;
        Times = 5;
      }

      Square, Random;
      {
        Items == bone;
        Times = 10;
      }

      Square, Random;
      {
        Items == skull;
        Times = 5;
      }
    }

    Square, Random NOT_WALKABLE|ATTACHABLE;
    {
      OTerrain = stairs(STAIRS_UP);
      EntryIndex = STAIRS_UP;
      AttachRequired = true;
    }
  }

  RandomLevel 6:10;
  {
    Room
    {
      Size = 7,7;
      AltarPossible = false;
      Shape = ROUND_CORNERS;

      CharacterMap
      {
        Pos = 1,1;
        Size = 5,5;

        Types
        {
          G = golem;
          V = golem(VALPURIUM) { Inventory = { 2, scrollofgolemcreation, scrollofgolemcreation { Chance = 10; Times = 4; } } }
        }
      }
      {
        .GGG.
        GGGGG
        GGVGG
        GGGGG
        .GGG.
      }
    }
  }

  RandomLevel 6:10;
  {
    Room
    {
      Size = 9,7;
      AltarPossible = false;
      GenerateFountains = false;
      Shape = ROUND_CORNERS;

      CharacterMap
      {
        Pos = 1,1;
        Size = 7,5;

        Types
        {
          G = orc(GENERAL) { Inventory = { 2, Random { MinPrice = 100; Category = POTION; Times = 4; }, Random { MinPrice = 200; Category = POTION; Times = 2; } } }
          O = orc(OFFICER) { Inventory == Random { MinPrice = 100; Category = POTION; Times = 2; } }
          S = orc(SQUAD_LEADER);
          s = orc(SLAUGHTERER);
          o = orc;
        }
      }
      {
        .ooooo.
        osSOSso
        ossGsso
        osSOSso
        .ooooo.
      }
    }
  }

  RandomLevel 10:11;
  {
    Room
    {
      Size = 5,12;
      AltarPossible = false;
      GenerateFountains = false;
      GenerateDoor = false;
      GenerateTunnel = false;
      FloorSquare = ARCANITE solidterrain(PARQUET), 0;
      WallSquare = ARCANITE solidterrain(FLOOR), OCTIRON wall(BRICK_OLD);

      CharacterMap
      {
        Pos = 1,1;
        Size = 3,10;

        Types
        {
          E = darkmage(ELDER) { Inventory == Random { MinPrice = 750; Category = WAND|SCROLL; } }
          B = darkmage(BATTLE_MAGE);
          A = darkmage(APPRENTICE);
          M = mysticfrog(DARK);
          N = necromancer(MASTER_NECROMANCER);
          n = necromancer(APPRENTICE_NECROMANCER);
          a = golem(ARCANITE);
          O = golem(OCTIRON);
        }
      }
      {
        aOa
        nnn
        AAA
        BMB
        NEN
        NEN
        BMB
        AAA
        nnn
        aOa
      }

      Square, Pos 2, 0;
      {
        GTerrain = ARCANITE solidterrain(PARQUET);
        OTerrain = OCTIRON door(OCTAGONAL_LOCK) { Parameters = LOCKED; }
        AttachRequired = true;
      }

      Square, Pos 2, 11;
      {
        GTerrain = ARCANITE solidterrain(PARQUET);
        OTerrain = OCTIRON door(OCTAGONAL_LOCK) { Parameters = LOCKED; }
        AttachRequired = true;
      }
    }
  }

  Level 9;
  {
    Size = 20, 100;
    IgnoreDefaultSpecialSquares = true;
    DifficultyBase = 60;
    MonsterAmountBase = 12;
    ItemMinPriceBase = 30;
    Rooms = 20:40;
    FillSquare = MILKY_QUARTZ solidterrain(GROUND), ROCK_CRYSTAL earth;
    TunnelSquare = MILKY_QUARTZ solidterrain(GROUND), 0;
    BackGroundType = RED_FRACTAL;

    RoomDefault
    {
      Pos = 2:XSize-5,2:YSize-5;
      Size = 3:5,3:5;
      WallSquare = ROSE_QUARTZ solidterrain(GROUND), ROSE_QUARTZ wall(BRICK_OLD);
      FloorSquare = ROSE_QUARTZ solidterrain(GROUND), 0;
      DoorSquare = ROSE_QUARTZ solidterrain(GROUND), ROSE_QUARTZ door;
    }

    Room
    {
      Pos = 2:XSize-5, 2:YSize/4-5;

      Square, Random;
      {
        EntryIndex = STAIRS_UP;
      }
    }

    Square, Random;
    {
      Items == mine(BIG_MINE) { Team = MONSTER_TEAM; IsActive = true; }
      Times = 2:6;
    }

    Square, Random;
    {
      Items == MITHRIL beartrap { Team = MONSTER_TEAM; IsActive = true; }
      Times = 2:6;
    }

    Square, BoundedRandom 1, YSize * 3 / 4, XSize - 2, YSize - 2, NOT_WALKABLE|ATTACHABLE;
    {
      OTerrain = stairs(STAIRS_DOWN);
      EntryIndex = STAIRS_DOWN;
      AttachRequired = true;
    }
  }

  Level 10;
  {
    Size = 20, 100;
    IgnoreDefaultSpecialSquares = true;
    DifficultyBase = 70;
    MonsterAmountBase = 14;
    ItemMinPriceBase = 40;
    Rooms = 20:40;
    Items = 35:70;
    FillSquare = MILKY_QUARTZ solidterrain(GROUND), ROCK_CRYSTAL earth;
    TunnelSquare = MILKY_QUARTZ solidterrain(GROUND), 0;
    BackGroundType = BLUE_FRACTAL;

    RoomDefault
    {
      Pos = 2:XSize-5,2:YSize-5;
      Size = 3:5,3:5;
      WallSquare = AMETHYST solidterrain(GROUND), AMETHYST wall(BRICK_OLD);
      FloorSquare = AMETHYST solidterrain(GROUND), 0;
      DoorSquare = AMETHYST solidterrain(GROUND), AMETHYST door;
    }

    Square, Random;
    {
      Items == mine(BIG_MINE) { Team = MONSTER_TEAM; IsActive = true; }
      Times = 2:6;
    }

    Square, Random;
    {
      Items == MITHRIL beartrap { Team = MONSTER_TEAM; IsActive = true; }
      Times = 2:6;
    }

    Square, BoundedRandom 1, YSize * 3 / 4, XSize - 2, YSize - 2, NOT_WALKABLE|ATTACHABLE;
    {
      OTerrain = stairs(STAIRS_UP);
      EntryIndex = STAIRS_UP;
      AttachRequired = true;
    }

    Square, BoundedRandom 1, 1, XSize - 2, YSize/4 - 2, NOT_WALKABLE|ATTACHABLE;
    {
      OTerrain = stairs(STAIRS_DOWN);
      EntryIndex = STAIRS_DOWN;
      AttachRequired = true;
    }
  }

  Level 11;
  {
    Size = 64,36;
    IgnoreDefaultSpecialSquares = true;
    DifficultyBase = 80;
    MonsterAmountBase = 100;
    MonsterAmountDelta = 0;
    ItemMinPriceBase = 50;
    Items = 45:90;
    FillSquare = ARCANITE solidterrain(GROUND), ARCANITE earth;
    TunnelSquare = ARCANITE solidterrain(GROUND), 0;
    BackGroundType = YELLOW_FRACTAL;

    RoomDefault
    {
      Pos = 2:XSize-5,2:YSize-5;
      Size = 6:20,6:20;
      WallSquare = ARCANITE solidterrain(GROUND), OCTIRON wall(BRICK_OLD);
      FloorSquare = ARCANITE solidterrain(PARQUET), 0;
      DoorSquare = ARCANITE solidterrain(PARQUET), OCTIRON door;
    }

    Square, Random;
    {
      Items == mine(BIG_MINE) { Team = MONSTER_TEAM; IsActive = true; }
      Times = 2:6;
    }

    Square, Random;
    {
      Items == MITHRIL beartrap { Team = MONSTER_TEAM; IsActive = true; }
      Times = 2:6;
    }

    Square, Random NOT_WALKABLE|ATTACHABLE;
    {
      OTerrain = stairs(STAIRS_UP);
      EntryIndex = STAIRS_UP;
      AttachRequired = true;
    }

    Room
    {
      Size = 21,21;
      GenerateFountains = false;
      AltarPossible = false;

      Square, Pos 10,10;
      {
        OTerrain = portal(OREE_LAIR_ENTRY) { AttachedArea = OREE_LAIR; AttachedEntry = STAIRS_UP; }
      }

      Square, Pos 10,10;
      {
        EntryIndex = STAIRS_DOWN;
      }
    }

    Square, Random;
    {
      Items == pickaxe;
    }

    Room /* vault */
    {
      GenerateLanterns = false;
      GenerateFountains = false;
      GenerateDoor = false;
      GenerateTunnel = false;
      AltarPossible = false;
      Size = 7,7;
      UseFillSquareWalls = true;
      Flags = NO_MONSTER_GENERATION;

      OTerrainMap
      {
        Pos = 1,1;
        Size = 5,5;
        Types
        {
          x = ADAMANT wall(BRICK_OLD);
        }
      }
      {
        xxxxx
        x...x
        x...x
        x...x
        xxxxx
      }

      Square, Random;
      {
        Items == mine(BIG_MINE) { Team = MONSTER_TEAM; IsActive = true; Chance = 75; }
        Times = 3;
      }

      Square, Random;
      {
        Items == ADAMANT beartrap { Team = MONSTER_TEAM; IsActive = true; Chance = 75; }
        Times = 4;
      }

      Square, Pos 3,3;
      {
        Items == ADAMANT itemcontainer(CHEST|OCTAGONAL_LOCK)
        {
          Parameters = LOCKED;
          ItemsInside == Random { MinPrice = 3000; Times = 2; }
        }
      }
    }
  }

  Level OREE_LAIR;
  {
    Description = "Oree's lair";
    ShortDescription = "OreeLair";
    LevelMessage = "\"Welcome to my lair, mortal! There's no escape now!\"";
    FillSquare = BLOOD liquidterrain(UNDERGROUND_LAKE), 0;
    TunnelSquare = solidterrain(GROUND), 0;
    Rooms = 5;
    GenerateMonsters = false;
    Items = 0;
    IgnoreDefaultSpecialSquares = true;
    CanGenerateBone = false;
    DifficultyBase = 90;
    BackGroundType = RED_FRACTAL;

    RoomDefault
    {
      Pos = 2:XSize-5,2:YSize-5;
      Size = 5:7,5:7;
      WallSquare = RUBY solidterrain(PARQUET), RUBY wall(BRICK_FINE);
      FloorSquare = RUBY solidterrain(PARQUET), 0;
      DoorSquare = RUBY solidterrain(PARQUET), RUBY door(OCTAGONAL_LOCK);
      Shape = ROUND_CORNERS;
      AltarPossible = false;
      DivineMaster = CRUENTUS;
      GenerateFountains = false;
      GenerateLanterns = false;
      AllowLockedDoors = false;
      IsInside = false;
    }

    Room
    {
      Size = 9,9;
      GenerateDoor = false;

      Square, Pos 4,0;
      {
        OTerrain = RUBY door(OCTAGONAL_LOCK) { Parameters = LOCKED; }
        AttachRequired = true;
      }

      Square, Pos 4,4;
      {
        EntryIndex = STAIRS_UP;
      }

      CharacterMap
      {
        Pos = 1,1;
        Size = 7,7;

        Types
        {
          B = darkknight(ELITE);
          G = golem(ACIDOUS_BLOOD);
        }
      }
      {
        ..G.G..
        .......
        G..B..G
        ..B.B..
        G..B..G
        .......
        ..G.G..
      }
    }

    Room
    {
      Size = 9,9;
      DivineMaster = CRUENTUS;

      Square, Pos 4,1;
      {
        OTerrain = STEEL altar(CRUENTUS);
      }

      Square, Pos 1,4;
      {
        OTerrain = portal(OREE_LAIR_EXIT) { AttachedArea = 0; AttachedEntry = RANDOM; }
      }

      Square, Pos 7,4;
      {
        OTerrain = monsterportal;
      }

      CharacterMap
      {
        Pos = 1,1;
        Size = 7,7;

        Types
        {
          O = oree;
          A = angel(CRUENTUS);
        }
      }
      {
        ..O.A..
        .......
        .......
        .......
        .......
        .......
        .......
      }
    }

    Square, Random NOT_IN_ROOM;
    {
      Character = darkknight(ELITE);
      Times = 4;
    }

    Square, Random NOT_IN_ROOM;
    {
      Character = frog(GIANT_DARK);
      Times = 2;
    }

    Square, Random NOT_IN_ROOM;
    {
      Character = mysticfrog(DARK);
      Times = 1;
    }

    Square, Random NOT_IN_ROOM;
    {
      Character = darkmage(APPRENTICE);
      Times = 4;
    }

    Square, Random NOT_IN_ROOM;
    {
      Character = darkmage(BATTLE_MAGE);
      Times = 2;
    }

    Square, Random NOT_IN_ROOM;
    {
      Character = darkmage(ELDER);
      Times = 1;
    }
  }
}

Dungeon ATTNAM;
{
  Levels = 1;

  Level 0;
  {
    Description = Attnam;
    ShortDescription = Attnam;
    FillSquare = solidterrain(SNOW_TERRAIN), 0;
    Size = 61, 67;
    GenerateMonsters = false;
    Rooms = 20:25;
    Items = 0;
    IsOnGround = true;
    TeamDefault = ATTNAM_TEAM;
    LOSModifier = 48;
    IgnoreDefaultSpecialSquares = false;
    CanGenerateBone = false;
    DifficultyBase = 150;
    DifficultyDelta = 0;
    EnchantmentMinusChanceBase = 0;
    EnchantmentMinusChanceDelta = 0;
    EnchantmentPlusChanceBase = 0;
    EnchantmentPlusChanceDelta = 0;
    BackGroundType = GRAY_FRACTAL;

    RoomDefault
    {
      Pos = 2:XSize-5,2:51;
      Size = 4:11,4:11;
      AltarPossible = false;
      WallSquare = solidterrain(SNOW_TERRAIN),wall(BRICK_FINE);
      FloorSquare = solidterrain(PARQUET), 0;
      DoorSquare = solidterrain(PARQUET),door;
      GenerateDoor = true;
      DivineMaster = 0;
      GenerateTunnel = false;
      GenerateLanterns = true;
      Type = ROOM_NORMAL;
      GenerateFountains = false;
      AllowLockedDoors = false;
      AllowBoobyTrappedDoors = false;
      Shape = RECTANGLE;
      IsInside = true;
      GenerateWindows = true;
      UseFillSquareWalls = false;
      Flags = 0;
    }

    Square, Pos 0, 0;
    {
      Character = guard(PATROL) { WayPoint = { 4, 0, 0, XSize - 1, 0, XSize - 1, YSize - 1, 0, YSize - 1; } }
    }

    Square, Pos 4, 59; { Character = guard(VETERAN); }
    Square, Pos 6, 59; { Character = guard(VETERAN); }
    Square, Pos 23, 59; { Character = guard(VETERAN); }
    Square, Pos 25, 59; { Character = guard(VETERAN); }
    Square, Pos 35, 59; { Character = guard(VETERAN); }
    Square, Pos 37, 59; { Character = guard(VETERAN); }
    Square, Pos 54, 59; { Character = guard(VETERAN); }
    Square, Pos 56, 59; { Character = guard(VETERAN); }

    Square, Random NOT_IN_ROOM|HAS_NO_OTERRAIN;
    {
      OTerrain = decoration(SNOW_PINE);
      Times = 200;
    }

    Square, Random NOT_IN_ROOM;
    {
      Character = hunter;
      Times = 10;
    }

    Square, Random NOT_IN_ROOM;
    {
      Character = bear(POLAR_BEAR);
    }

    Square, Random NOT_IN_ROOM;
    {
      Character = farmer;
      Times = 5;
    }

    Square, Random NOT_IN_ROOM;
    {
      Character = housewife;
      Times = 5;
    }

    Square, Pos 30,YSize - 1;
    {
      EntryIndex = STAIRS_UP;
    }

    Room
    {
      Pos = 10,10;
      Size = 41,42;
      WallSquare = solidterrain(SNOW_TERRAIN), GRANITE wall(BRICK_FINE);
      FloorSquare = solidterrain(SNOW_TERRAIN), 0;
      GenerateDoor = false;
      DivineMaster = VALPURUS;
      GenerateLanterns = false;
      Type = ROOM_CATHEDRAL;
      IsInside = false;
      GenerateWindows = false;

      Square, Pos 1, 1;
      {
        Character = floatingeye { WayPoint = { 4, 11, 11, 49, 11, 49, 50, 11, 50; } }
      }

      Square, Pos 19, 41;
      {
        OTerrain = 0;
      }

      Square, Pos 20, 41;
      {
        OTerrain = 0;
      }

      Square, Pos 21, 41;
      {
        OTerrain = 0;
      }

      GTerrainMap
      {
        Pos = 4,4;
        Size = 33,34;
        Types
        {
          # = MARBLE solidterrain(FLOOR) { IsInside = true; }
          - = MARBLE solidterrain(FLOOR) { IsInside = true; }
          ~ = liquidterrain(POOL) { IsInside = true; }
        }
      }
      {
        ............#########............
        ............#-------#............
        ####......###-------###......####
        #--#......#-----------#......#--#
        #--#....###-----------###....#--#
        #--#....#---------------#....#--#
        #--###..#---------------#..###--#
        #----#..#---------------#..#----#
        #----#..#---------------#..#----#
        ###--#..###-----------###..#--###
        ..#--###..#-----------#..###--#..
        ..#----#..#-----------#..#----#..
        ..###--####-----------####--###..
        ....#-----#-----------#-----#....
        ....#-----#-----------#-----#....
        ....####--#-----------#--####....
        .......#--#-----------#--#.......
        ......###-#-----------#-###......
        ..#####-#-#-----------#-#-#####..
        .##-------#-----------#-------##.
        .#---~~~#-#-----------#-#------#.
        .#---~~~#-#-----------#-#------#.
        .##--~~~#-#-----------#-#-----##.
        ..##-~~~#-#-----------#-#----##..
        ...##~~~#-######-######-#---##...
        ....#~~~#---------------#---#....
        ....#~~~#---------------#---#....
        ...#######---###-###---#######...
        ####---------#.....#---------####
        #--------#####.....#####--------#
        #--------#.............#--------#
        ##---#####.............#####---##
        .##--#.....................#--##.
        ..####.....................####..
      }

      OTerrainMap
      {
        Pos = 1,1;
        Size = 39,40;
        Types
        {
          # = MARBLE wall(BRICK_FINE);
          @ = MARBLE wall(BRICK_PROPAGANDA);
          T = throne;
          | = decoration(CARPET);
          A = VALPURIUM altar(VALPURUS);
          D = MARBLE door(HEXAGONAL_LOCK);
          L = MARBLE door(HEXAGONAL_LOCK) { Parameters = LOCKED; }
          b = decoration(SNOW_FIR);
          1 = decoration(POOL_CORNER) { VisualEffects = NONE; }
          2 = decoration(POOL_CORNER) { VisualEffects = MIRROR; }
          3 = decoration(POOL_CORNER) { VisualEffects = MIRROR | FLIP; }
          4 = decoration(POOL_CORNER) { VisualEffects = FLIP; }
          5 = decoration(POOL_BORDER) { VisualEffects = NONE; }
          6 = decoration(POOL_BORDER) { VisualEffects = ROTATE; }
          7 = decoration(POOL_BORDER) { VisualEffects = FLIP; }
          8 = decoration(POOL_BORDER) { VisualEffects = MIRROR | ROTATE; }
          s = decoration(COUCH);
          f = fountain { SecondaryMaterial = ICE; }
          d = decoration(DOUBLE_BED);
          B = GOLD boulder(1);
        }
      }
      {
        b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b
        .......................................
        b...b...b..b...b.b.b.b.b...b..b...b...b
        ..b...b........#########........b...b..
        b....b.......bb#.......#bb.......b....b
        ...####b..b..###.......###..b..b####...
        b.b#..#.b....#...........#....b.#.B#b.b
        ...#..#....###...........###....#..#...
        b.b#..#b..b#...............#b..b#..#b.b
        ...#..###..#.....T...T.....#..###.B#...
        b.b#....#.b#.......|.......#b.#....#b.b
        ...#....#..#.......|.......#..#B...#...
        b.b###..#b.###.....|.....###.b#..###b.b
        ....b#..#@#.b#.....|.....#b.#@#.B#b....
        b....#....#..#.....|.....#..#..B.#....b
        ..bb.###..####.....|.....####..###.bb..
        b.....b#.....#.....|.....#...B.#b.....b
        .b..b..#.....#.....|.....#.B...#..b..b.
        b..b...####..#.....|.....#..####...b..b
        b....b....#..#.....|.....#.B#....b....b
        .b.b....b###D#.....|.....#D###b....b.b.
        b...b#####.#.#.....|.....#.#.#####b.b.b
        ....##.....D.#.....|.....#.D.....##....
        b..b#.s.152#.#.....|.....#.#......#b..b
        .b..#...8.6#.#.....|.....#.#..A...#..b.
        b...##..8.6#.#.....|.....#.#.....##...b
        ....b##.8.6#.#...........#.#....##b....
        b.b..b##8.6#.######D######.#...##b..b.b
        .......#8.6#...............#...#.......
        b...b.b#473#...............#...#b.b...b
        .b....##@####...###D###...####@##....b.
        b..####.s.s.D...#.b.b.#...L.....####..b
        ..b#.d......#####.f.f.#####........#b..
        b..#....s.s.#b..b.....b..b#........#..b
        .b.##...#####.bb..b.b..bb.#####...##.b.
        b..b##s.#b.b......f.f......b.b#..##b..b
        ....b####....b...........b....####b....
        b.b...b...b.......b.b.......b...b...b.b
        ...............bb.f.f.bb...............
        b.b.b.b.b.b.b.b..b...b..b.b.b.b.b.b.b.b
      }

      ItemMap
      {
        Pos = 4,4;
        Size = 33,34;
        Types
        {
          # == 0;
          a == avatarofvalpurus;
          b == banana;
          k == kiwi;
          p == pineapple;
          e == backpack;
          g == GOLD stone;
          i == SILVER stone;
          h == SAPPHIRE stone;
          r == RUBY stone;
          d == DIAMOND stone;
          1 == lantern { SquarePosition = UP; }
          2 == lantern { SquarePosition = DOWN; }
          3 == lantern { SquarePosition = RIGHT; }
          4 == lantern { SquarePosition = LEFT; }
          C == GOLD itemcontainer(CHEST) { ItemsInside = { 3, GOLD helmet, stone { Times = 10; }, GOLD banana; } }
          F == ring(RING_OF_FIRE_RESISTANCE);
          I == ring(RING_OF_INVISIBILITY);
          E == amulet(AMULET_OF_ESP);
          S == GOLD GOLD meleeweapon(LONG_SWORD);
          U == DIAMOND helmet(HELM_OF_UNDERSTANDING);
          A == GOLD helmet(HELM_OF_ATTRACTIVITY);
          L == oillamp;
          P == GOLD bodyarmor(PLATE_MAIL);
          O == GOLD cloak;
          W == wand(WAND_OF_POLYMORPH);
          w == Random { MinPrice = 350; Category = WEAPON|SHIELD; ConfigFlags = NO_BROKEN; Enchantment = 1; }
          c == Random { MinPrice = 700; Category = WEAPON|SHIELD; ConfigFlags = NO_BROKEN; Enchantment = 3; }
          m == Random { MinPrice = 350; Category = HELMET|CLOAK|BODY_ARMOR|BELT|BOOT|GAUNTLET; ConfigFlags = NO_BROKEN; Enchantment = 1; }
        }
      }
      {
        ............##2###2##............
        ............#.......#............
        ####......###.......###......####
        #..#......#...........#......#r.#
        #..#....###...........###....#gi#
        #..#....#...r.......r...#....#hC#
        #..###..#.........a.....#..###I.#
        #...e#..#......b.b......#..#EOLF#
        #...e#..#......k.k......#..#.dPS#
        ##1.e#..##1.h..p.p..h.1##..#Ug1##
        ..#.e4##..#....b.b....#..##3r.#..
        ..#....#..#....k.k....#..#Wh.L#..
        ..###..4###....p.p....###3Fi###..
        ....#.....3.d..b.b..d.4P.A.I#....
        ....#.....#....k.k....#r.gEd#....
        ....###3..#....p.p....#Sd4###....
        .......#..#....b.b....#h.#.......
        ......###.3.g..k.k..g.4.###......
        ..#####.#.#....p.p....#.#.#####..
        .##.......#....b.b....#.......##.
        .#......3.#....k.k....#.4......#.
        .#......#.3.i..p.p..i.4.#......#.
        .##.....4.#....b.b....#.3.....##.
        ..##....#.#...........#.#....##..
        ...##...#.##2###.###2##.#...##...
        ....#...4...............3...#....
        ....#...#...............#...#....
        ...###2###...##2.2##...###2###...
        ####.........#.....#....wwwwc####
        #........#####.....#####.....mmm#
        #........#.............#wwww...m#
        ##...#####.............#####mm.##
        .##..#.....................#mm##.
        ..####.....................####..
      }

      CharacterMap
      {
        Pos = 4,4;
        Size = 33,34;
        Types
        {
          # = 0;
          P = petrus { Flags = IS_MASTER; }
          g = guard(VETERAN);
          e = guard(EUNUCH);
          E = guard(ELITE);
          m = guard(MASTER);
          p = priest(VALPURUS);
          d = dolphin;
          l = frog(LIGHT);
          f = frog(GREATER_LIGHT);
          i = frog(GIANT_LIGHT);
          y = mysticfrog(LIGHT);
          s = femaleslave(ATTNAM);
          1 = petrusswife(1);
          2 = petrusswife(2);
          3 = petrusswife(3);
          4 = petrusswife(4);
          5 = petrusswife(5);
          6 = petrusswife(6);
          k = kamikazedwarf(VALPURUS);
          K = veterankamikazedwarf(VALPURUS);
        }
      }
      {
        ............#########............
        ............#g.....g#............
        ####......###..ymy..###......####
        #.K#......#g....l....g#......#..#
        #..#....###...........###....#..#
        #k.#....#E.............E#....#..#
        #k.###..#....sPs.s.s....#..###..#
        #k...#..#..f....i....f..#..#....#
        #k...#..#E.............E#..#....#
        ###..#..###...........###..#..###
        ..#..###..#...........#..###..#..
        ..#....#..#g.l.....l.g#..#....#..
        ..###k.####...........####..###..
        ....#k...k#...........#.E...#....
        ....#k...k#...........#.....#....
        ....####.k#g.........g#..####....
        .......#..#...........#..#.......
        ......###.#...........#.###......
        ..#####E#.#...........#.#.#####..
        .##.......#g.........g#.......##.
        .#......#.#...........#.#..p...#.
        .#....d.#.#...........#.#......#.
        .##...d.#.#...........#.#.....##.
        ..##.d.d#.#g.........g#.#....##..
        ...##.d.#.######.######.#...##...
        ....#.d.#......g.g......#...#....
        ....#...#...............#...#....
        ...#######...###.###..g#######...
        ####e3.5.....#g...g#..g......####
        #.1......#####.....#####........#
        #....4.6.#.............#........#
        ##...#####.............#####...##
        .##2.#.....................#..##.
        ..####.....................####..
      }
    }

    Room
    {
      Pos = 33,53;
      Size = 7,6;
      WallSquare = solidterrain(SNOW_TERRAIN),wall(BRICK_FINE);
      FloorSquare = solidterrain(PARQUET), 0;
      GenerateDoor = false;
      DivineMaster = MELLIS;
      Type = ROOM_SHOP;
      GenerateLanterns = false;
      GenerateWindows = false;

      Square, Pos 3, 5;
      {
        GTerrain = solidterrain(PARQUET);
        OTerrain = door;
      }

      Square, Pos 1, 1;
      {
        Character = slave;
      }

      Square, Pos 1, 4;
      {
        Items == banana;
        Times = 100;
      }

      Square, Pos 5, 1;
      {
        Character = shopkeeper(ATTNAM) { Flags = IS_MASTER; }
      }

      Square, Pos 3, 0;
      {
        OTerrain = GRANITE wall(BRICK_PROPAGANDA);
      }

      ItemMap
      {
        Pos = 0,0;
        Size = 7,6;
        Types
        {
          # == 0;
          a == Random { MinPrice = 250; MaxPrice = 2000; Category = HELMET|CLOAK|BODY_ARMOR|BELT|BOOT|GAUNTLET; }
          d == Random { MinPrice = 50; MaxPrice = 2000; Category = RING|AMULET; }
          w == Random { MinPrice = 250; MaxPrice = 2000; Category = WEAPON|SHIELD; }
          e == Random { MinPrice = 10; MaxPrice = 2000; Category = FOOD|POTION; }
          u == Random { MinPrice = 50; MaxPrice = 2000; Category = WAND|TOOL; }
          v == Random { MinPrice = 500; MaxPrice = 2000; }
          p == lump { MainMaterial = BEAR_FLESH { Volume = 20000; } }
          l == lantern;
          2 == lantern { SquarePosition = DOWN; }
          3 == lantern { SquarePosition = RIGHT; }
          4 == lantern { SquarePosition = LEFT; }
        }
      }
      {
        ##2#2##
        #.aaa.#
        #edduw#
        3eeluw4
        #.epvw#
        2##.##2
      }
    }

    Room
    {
      Pos = 52,53;
      Size = 7,6;
      WallSquare = solidterrain(SNOW_TERRAIN),wall(BRICK_FINE);
      FloorSquare = solidterrain(PARQUET), 0;
      GenerateDoor = false;
      DivineMaster = SOPHOS;
      Type = ROOM_LIBRARY;
      GenerateLanterns = false;
      GenerateWindows = false;

      Square, Pos 3, 5;
      {
        GTerrain = solidterrain(PARQUET);
        OTerrain = door;
      }

      Square, Pos 3, 0;
      {
        OTerrain = GRANITE wall(BRICK_PROPAGANDA);
      }

      Square, Pos 3, 3;
      {
        Character = librarian { Flags = IS_MASTER; }
      }

      Square, Pos 3, 0;
      {
        Items == lantern { SquarePosition = DOWN; }
      }

      Square, Pos 0, 5;
      {
        Items == lantern { SquarePosition = DOWN; }
      }

      Square, Pos 6, 5;
      {
        Items == lantern { SquarePosition = DOWN; }
      }

      OTerrainMap
      {
        Pos = 1,1;
        Size = 5,4;
        Types
        {
          = = olterraincontainer(BOOK_CASE) { ItemsInside = { 2, Random { MaxPrice = 500; Category = SCROLL|BOOK; }, Random { MaxPrice = 500; Category = SCROLL|BOOK; } } }
        }
      }
      {
        =====
        =...=
        =...=
        =...=
      }
    }

    Room
    {
      Pos = 21,53;
      Size = 7,6;
      AltarPossible = false;
      WallSquare = solidterrain(SNOW_TERRAIN),wall(BRICK_FINE);
      FloorSquare = solidterrain(FLOOR), 0;
      DoorSquare = solidterrain(FLOOR), door;
      GenerateDoor = false;
      DivineMaster = LORICATUS;
      GenerateLanterns = false;
      GenerateWindows = false;

      Square, Pos 3, 5;
      {
        GTerrain = solidterrain(FLOOR);
        OTerrain = door;
      }

      Square, Pos 3, 0;
      {
        OTerrain = GRANITE wall(BRICK_PROPAGANDA);
      }

      Square, Pos 0, 3;
      {
        Items == lantern { SquarePosition = RIGHT; }
      }

      Square, Pos 6, 3;
      {
        Items == lantern { SquarePosition = LEFT; }
      }

      Square, Pos 2, 0;
      {
        Items == lantern { SquarePosition = DOWN; }
      }

      Square, Pos 4, 0;
      {
        Items == lantern { SquarePosition = DOWN; }
      }

      Square, Pos 0, 5;
      {
        Items == lantern { SquarePosition = DOWN; }
      }

      Square, Pos 6, 5;
      {
        Items == lantern { SquarePosition = DOWN; }
      }

      Square, Pos 3, 2;
      {
        Character = smith { Flags = IS_MASTER; }
      }

      Square, Pos 3, 3;
      {
        OTerrain = decoration(ANVIL);
      }
    }

    Room
    {
      Pos = 2,53;
      Size = 7,6;
      AltarPossible = false;
      WallSquare = solidterrain(SNOW_TERRAIN),wall(BRICK_FINE);
      FloorSquare = solidterrain(PARQUET), 0;
      GenerateDoor = false;
      DivineMaster = LORICATUS;
      GenerateLanterns = false;
      GenerateWindows = false;

      Square, Pos 3, 5;
      {
        GTerrain = solidterrain(PARQUET);
        OTerrain = door;
      }

      Square, Pos 3, 0;
      {
        OTerrain = GRANITE wall(BRICK_PROPAGANDA);
      }

      Square, Pos 0, 3;
      {
        Items == lantern { SquarePosition = RIGHT; }
      }

      Square, Pos 6, 3;
      {
        Items == lantern { SquarePosition = LEFT; }
      }

      Square, Pos 2, 0;
      {
        Items == lantern { SquarePosition = DOWN; }
      }

      Square, Pos 4, 0;
      {
        Items == lantern { SquarePosition = DOWN; }
      }

      Square, Pos 0, 5;
      {
        Items == lantern { SquarePosition = DOWN; }
      }

      Square, Pos 6, 5;
      {
        Items == lantern { SquarePosition = DOWN; }
      }

      Square, Pos 3, 2;
      {
        Character = tailor { Flags = IS_MASTER; }
      }
    }

    Room
    {
      FloorSquare = solidterrain(FLOOR), 0;
      WallSquare = solidterrain(SNOW_TERRAIN), FIR_WOOD wall(BRICK_FINE);
      DoorSquare = solidterrain(FLOOR), door;
    }

    Room
    {
      FloorSquare = solidterrain(FLOOR), 0;
      WallSquare = solidterrain(SNOW_TERRAIN), FIR_WOOD wall(BRICK_FINE);
      DoorSquare = solidterrain(FLOOR), door;
    }

    Room
    {
      FloorSquare = solidterrain(FLOOR), 0;
      WallSquare = solidterrain(SNOW_TERRAIN), FIR_WOOD wall(BRICK_FINE);
      DoorSquare = solidterrain(FLOOR), door;
    }

    /*Square, Random;
    {
      Character = communist { Team = IVAN_TEAM; }
      Times = 3;
    }

    Square, Random;
    {
      Character = vladimir { Team = IVAN_TEAM; }
      Times = 3;
    }

    Square, Random;
    {
      Character = imperialist { Team = ATTNAM_TEAM; }
      Times = 3;
    }

    Square, Random;
    {
      Character = mistress(QUEEN) { Team = ATTNAM_TEAM; }
      Times = 3;
    }

    Square, Random;
    {
      Character = genetrixvesana { Team = ATTNAM_TEAM; }
      Times = 10;
    }

    Square, Random;
    {
      Character = golem(VALPURIUM) { Team = ATTNAM_TEAM; }
      Times = 3;
    }

    Square, Random;
    {
      Character = kobold(PATRIARCH) { Team = MONSTER_TEAM; }
      Times = 3;
    }

    Square, Random;
    {
      Character = goblin(KING) { Team = MONSTER_TEAM; }
      Times = 3;
    }

    Square, Random;
    {
      Character = ennerbeast { Team = MONSTER_TEAM; }
      Times = 3;
    }

    Square, Random;
    {
      Character = eddy { Team = MONSTER_TEAM; }
      Times = 25;
    }

    Square, Random;
    {
      Character = skunk { Team = MONSTER_TEAM; }
      Times = 50;
    }

    Square, Random;
    {
      Character = orc(MARSHAL) { Team = MONSTER_TEAM; }
      Times = 3;
    }

    Square, Random;
    {
      Character = darkknight(GRAND_MASTER) { Team = MONSTER_TEAM; }
      Times = 3;
    }

    Square, Random;
    {
      Character = oree { Team = MONSTER_TEAM; }
      Times = 3;
    }

    Square, Random;
    {
      Character = elpuri { Team = MONSTER_TEAM; }
      Times = 3;
    }

    Square, Random;
    {
      Character = darkmage(ARCH_MAGE) { Team = MONSTER_TEAM; }
      Times = 10;
    }

    Square, Random;
    {
      Character = skeleton(WAR_LORD) { Team = MONSTER_TEAM; }
      Times = 3;
    }

    Square, Random;
    {
      Character = spider { Team = MONSTER_TEAM; }
      Times = 3;
    }*/
  }
}

Dungeon NEW_ATTNAM;
{
  Levels = 2;

  Level 0;
  {
    LevelMessage = "You hear someone shouting: \"Faster! Faster! The Empire wants yer bananas!\"";
    Description = "New Attnam";
    ShortDescription = "New Attnam";
    FillSquare = solidterrain(GRASS_TERRAIN), 0;
    Size = 55, 55;
    GenerateMonsters = false;
    Rooms = 6:10;
    Items = 0;
    IsOnGround = true;
    TeamDefault = NEW_ATTNAM_TEAM;
    LOSModifier = 48;
    IgnoreDefaultSpecialSquares = false;
    AutoReveal = true;
    CanGenerateBone = false;
    DifficultyBase = 50;
    DifficultyDelta = 0;
    EnchantmentMinusChanceBase = -15;
    EnchantmentMinusChanceDelta = 0;
    EnchantmentPlusChanceBase = 0;
    EnchantmentPlusChanceDelta = 0;
    BackGroundType = GREEN_FRACTAL;

    RoomDefault
    {
      Pos = 2:36,2:36;
      Size = 4:6,4:6;
      AltarPossible = false;
      WallSquare = solidterrain(GRASS_TERRAIN), wall(BRICK_PRIMITIVE);
      FloorSquare = solidterrain(GRASS_TERRAIN), 0;
      DoorSquare = solidterrain(GRASS_TERRAIN), BALSA_WOOD door;
      GenerateDoor = true;
      DivineMaster = 0;
      GenerateTunnel = false;
      GenerateLanterns = false;
      Type = ROOM_NORMAL;
      GenerateFountains = false;
      AllowLockedDoors = false;
      AllowBoobyTrappedDoors = false;
      Shape = ROUND_CORNERS;
      IsInside = true;
      GenerateWindows = true;
      UseFillSquareWalls = false;
      Flags = 0;
    }

    Room
    {
      Type = ROOM_BANANA_DROP_AREA;
      Pos = 4,4;
      Size = 17,19;
      WallSquare = solidterrain(GRASS_TERRAIN), EBONY_WOOD wall(BRICK_FINE);
      FloorSquare = BALSA_WOOD solidterrain(PARQUET), 0;
      GenerateDoor = false;
      DivineMaster = SILVA;
      GenerateLanterns = false;
      GenerateWindows = false;

      OTerrainMap
      {
        Pos = 0,0;
        Size = 17,19;
        Types
        {
          _ = 0;
          # = 0;
          p = GOLD wall(BRICK_PROPAGANDA);
          $ = GOLD wall(BRICK_FINE);
          ^ = decoration(HOLY_TREE);
          c = decoration(COUCH);
          d = EBONY_WOOD door;
          o = EBONY_WOOD wall(BRICK_FINE|WINDOW);
        }
      }
      {
        .#o##o##o##o##o#.
        ##.............##
        o...............o
        #.....$$p$$.....#
        #...$$$___$$$...#
        #..$$_______$$..#
        o..$____c____$..o
        #..$___^_^___$..#
        #..$_________$..#
        o..$$_______$$..o
        #...$$_____$$...#
        #....$$___$$....#
        o.....$___$.....o
        #.....$___$.....#
        #.....$___$.....#
        #.....$___$.....#
        o...............o
        ##.............##
        .#o##o##d##o##o#.
      }

      CharacterMap
      {
        Pos = 3,3;
        Size = 11,13;
        Types
        {
          _ = 0;
          # = 0;
          I = imperialist { Team = COLONIST_TEAM; Flags = IS_MASTER; }
          g = guard(ROOKIE) { Team = COLONIST_TEAM; }
          f = femaleslave(NEW_ATTNAM);
        }
      }
      {
        ...#####...
        .###_g_###.
        ##_______##
        #g__fIf__g#
        #_________#
        #g_______g#
        ##_______##
        .##_____##.
        ..##g_g##..
        ...#___#...
        ...#___#...
        ...#___#...
        ...#g_g#...
      }

      GTerrainMap
      {
        Pos = 3,3;
        Size = 11,16;
        Types
        {
          # = SILVER solidterrain(FLOOR);
          _ = SILVER solidterrain(FLOOR);
          - = BALSA_WOOD solidterrain(PARQUET);
        }
      }
      {
        ...#####...
        .###___###.
        ##_______##
        #_________#
        #_________#
        #_________#
        ##_______##
        .##_____##.
        ..##___##..
        ...#___#...
        ...#___#...
        ...#___#...
        ...#___#...
        ...........
        ...........
        .....-.....
      }

      ItemMap
      {
        Pos = 3,3;
        Size = 11,13;
        Types
        {
          # == 0;
          _ == 0;
          2 == lantern { SquarePosition = DOWN; }
          3 == lantern { SquarePosition = RIGHT; }
          4 == lantern { SquarePosition = LEFT; }
        }
      }
      {
        ...#2#2#...
        .###___###.
        ##_______##
        #_________#
        3_________4
        #_________#
        #3_______4#
        .##_____##.
        ..##___##..
        ...#___#...
        ...#___#...
        ...#___#...
        ...2___2...
      }
    }

    Room
    {
      Type = ROOM_BANANA_DROP_AREA;
      Size = 3, 3;
      Pos = 44, 44;
      AltarPossible = false;
      WallSquare = solidterrain(GRASS_TERRAIN), decoration(PALM);
      FloorSquare = solidterrain(LANDING_SITE), 0;
      GenerateDoor = false;
      GenerateTunnel = false;
      GenerateLanterns = false;
      GenerateFountains = false;
      GenerateWindows = false;
      Shape = RECTANGLE;

      Square, Pos 1, 1;
      {
        Items == banana { Times = 10; }
      }
    }

    Room
    {
      Size = 4, 4;
      Pos = 25, 35;
      GenerateDoor = false;
      Type = ROOM_BANANA_DROP_AREA;
      FloorSquare = solidterrain(FLOOR), 0;
      GenerateWindows = false;

      Square, Pos 1, 1;
      {
        Character = sumowrestler { Flags = IS_MASTER; }
      }

      Square, Pos 2, 1;
      {
        OTerrain = stairs(SUMO_ARENA_ENTRY) { AttachedArea = 1; AttachedEntry = STAIRS_UP; }
        EntryIndex = STAIRS_DOWN;
      }

      Square, Pos 1, 3;
      {
        GTerrain = solidterrain(FLOOR);
      }

      OTerrainMap
      {
        Pos = 0,0;
        Size = 4,4;
        Types
        {
          # = 0;
          p = wall(BRICK_PRIMITIVE_PROPAGANDA);
          o = wall(BRICK_PRIMITIVE|WINDOW);
          d = BALSA_WOOD door(BROKEN_LOCK);
        }
      }
      {
        #p##
        #..#
        #..#
        #do#
      }
    }

    Room
    {
      Pos = 9,33;
      Size = 7,7;
      WallSquare = solidterrain(GRASS_TERRAIN), TEAK_WOOD wall(BRICK_PRIMITIVE);
      FloorSquare = solidterrain(FLOOR), 0;
      GenerateDoor = false;
      DivineMaster = MELLIS;
      Type = ROOM_SHOP;
      GenerateWindows = false;

      Square, Pos 3, 3;
      {
        Character = shopkeeper(NEW_ATTNAM) { Team = COLONIST_TEAM; Flags = IS_MASTER; }
      }

      Square, Pos 3, 6;
      {
        GTerrain = solidterrain(FLOOR);
      }

      OTerrainMap
      {
        Pos = 0,0;
        Size = 7,7;
        Types
        {
          # = 0;
          p = TEAK_WOOD wall(BRICK_PRIMITIVE_PROPAGANDA);
          o = TEAK_WOOD wall(BRICK_PRIMITIVE|WINDOW);
          d = TEAK_WOOD door;
        }
      }
      {
        .##p##.
        ##...##
        #.....#
        o.....o
        #.....#
        ##...##
        .##d##.
      }

      ItemMap
      {
        Pos = 0,0;
        Size = 7,7;
        Types
        {
          # == 0;
          b == banana { Chance = 50; SpoilPercentage = 49; Times = 10; }
          k == kiwi { Times = 10; }
          p == pineapple { Times = 3; }
          2 == lantern { SquarePosition = DOWN; }
          3 == lantern { SquarePosition = RIGHT; }
          4 == lantern { SquarePosition = LEFT; }
        }
      }
      {
        .##2##.
        ##bbb##
        #bbbbb#
        #bk.pb#
        3bbbbb4
        ##bbb##
        .#####.
      }
    }

    Room
    {
      Pos = 25,20;
      Size = 4,3;
      GenerateDoor = false;
      DivineMaster = SILVA;
      GenerateWindows = false;

      Square, Pos 2, 1;
      {
        Character = priest(SILVA) { Flags = IS_MASTER; }
      }

      OTerrainMap
      {
        Pos = 0,0;
        Size = 4,3;
        Types
        {
          # = 0;
          p = wall(BRICK_PRIMITIVE_PROPAGANDA);
          o = wall(BRICK_PRIMITIVE|WINDOW);
          d = BALSA_WOOD door;
        }
      }
      {
        #p##
        #..o
        #d##
      }
    }

    Square, Pos 0, 33;
    {
      EntryIndex = STAIRS_UP;
    }

    Square, Random NOT_IN_ROOM|HAS_NO_OTERRAIN;
    {
      OTerrain = boulder(1);
      Times = 10;
    }

    Square, Random NOT_IN_ROOM|HAS_NO_OTERRAIN;
    {
      OTerrain = boulder(2);
      Times = 10;
    }

    Square, Random NOT_IN_ROOM|HAS_NO_OTERRAIN;
    {
      OTerrain = decoration(PALM);
      Times = 100;
    }

    Square, Pos 20, 44;
    {
      Character = encourager { Team = COLONIST_TEAM; }
    }

    Square, Pos 0, 45;
    {
      Character = bananagrower;
    }

    Square, Pos 10, 45;
    {
      Character = bananagrower;
    }

    Square, Pos 20, 45;
    {
      Character = bananagrower;
    }

    Square, Pos 30, 45;
    {
      Character = bananagrower;
    }

    Square, Pos 40, 45;
    {
      Character = bananagrower;
    }

    Square, Pos 45, 0;
    {
      Character = ostrich;
    }

    Square, Pos 45, 15;
    {
      Character = ostrich;
    }

    Square, Pos 45, 30;
    {
      Character = ostrich;
    }

    Square, Pos 12, 50;
    {
      Character = elder { Team = TOURIST_GUIDE_TEAM; Flags = IS_LEADER; }
    }

    Square, Pos 10, 50;
    {
      Character = tourist(HUSBAND) { Team = TOURIST_TEAM; }
    }

    Square, Pos 14, 50;
    {
      Character = tourist(WIFE) { Team = TOURIST_TEAM; Flags = IS_LEADER; }
    }

    Square, Pos 12, 52;
    {
      Character = tourist(CHILD) { Team = TOURIST_TEAM; }
    }

    Square, Pos 11, 23;
    {
      OTerrain = sign { Text = "The mansion of Viceroy Richel Decos, formerly a temple of nature."; }
    }

    Square, Pos 11, 40;
    {
      OTerrain = sign { Text = "Zulko's wholesale banana market. We offer quality bananas straight from the jungle at a bargain price and even some other exotic fruits for most demanding customers."; }
    }

    Square, Pos 25, 39;
    {
      OTerrain = sign { Text = "The home of Huang Ming Pong, the guardian of the natives' sacred and mysterious sumo fighting techniques."; }
    }

    Square, Pos 25, 23;
    {
      OTerrain = sign { Text = "The village's new temple of nature."; }
    }

    Square, Pos 43, 43;
    {
      OTerrain = sign { Text = "New Attnam's main ostrich landing site. The delicious fruits of Decos Bananas Co. are gathered here by native professionals and then distributed aerially all over the civilized world."; }
    }
  }

  Level 1;
  {
    Description = "New Attnam's sumo wrestling arena";
    ShortDescription = "SumoArena";
    FillSquare = solidterrain(GROUND), MORAINE earth;
    Size = 55, 55;
    Rooms = 1;
    Items = 0;
    GenerateMonsters = false;
    IsOnGround = false;
    TeamDefault = NEW_ATTNAM_TEAM;
    LOSModifier = 32;
    IgnoreDefaultSpecialSquares = false;
    CanGenerateBone = false;
    DifficultyBase = 50;
    DifficultyDelta = 0;
    EnchantmentMinusChanceBase = -15;
    EnchantmentMinusChanceDelta = 0;
    EnchantmentPlusChanceBase = 0;
    EnchantmentPlusChanceDelta = 0;
    BackGroundType = GREEN_FRACTAL;

    Room
    {
      Pos = 19,12;
      Size = 13,13;
      WallSquare = solidterrain(GROUND), BALSA_WOOD wall(BRICK_FINE);
      FloorSquare = solidterrain(GROUND), 0;
      GenerateDoor = false;
      DivineMaster = ATHEIST;
      GenerateLanterns = false;
      Type = ROOM_SUMO_ARENA;
      GenerateFountains = false;
      AltarPossible = false;
      Shape = RECTANGLE;
      GenerateTunnel = false;
      GenerateWindows = false;
      IsInside = true;
      UseFillSquareWalls = false;
      Flags = 0;

      Square, Pos 6, 6;
      {
        OTerrain = stairs(SUMO_ARENA_EXIT) { AttachedArea = 0; AttachedEntry = STAIRS_DOWN; }
        EntryIndex = STAIRS_UP;
      }

      Square, Pos 6, 0;
      {
        OTerrain = wall(BRICK_PRIMITIVE_PROPAGANDA);
        Items == lantern { SquarePosition = DOWN; }
      }

      Square, Pos 0, 6;
      {
        Items == lantern { SquarePosition = RIGHT; }
      }

      Square, Pos 12, 6;
      {
        Items == lantern { SquarePosition = LEFT; }
      }

      Square, Pos 6, 12;
      {
        Items == lantern { SquarePosition = UP; }
      }

      OTerrainMap
      {
        Pos = 3, 3;
        Size = 7, 7;
        Types
        {
          # = GLASS wall(BRICK_FINE);
        }
      }
      {
        #######
        #.....#
        #.....#
        #.....#
        #.....#
        #.....#
        #######
      }
    }
  }
}

Dungeon UNDER_WATER_TUNNEL;
{
  Levels = 4;
  Description = "underwater tunnel";
  ShortDescription = "UT";

  LevelDefault
  {
    FillSquare = solidterrain(GROUND), SAND_STONE earth;
    TunnelSquare = solidterrain(GROUND), 0;
    Size = 80, 20;
    Rooms = 5:10;
    Items = 15:30;
    GenerateMonsters = true;
    IsOnGround = false;
    TeamDefault = MONSTER_TEAM;
    LOSModifier = 16;
    IgnoreDefaultSpecialSquares = false;
    DifficultyBase = 5;
    DifficultyDelta = 15;
    MonsterAmountDelta = 0;
    MonsterGenerationIntervalBase = 200;
    MonsterGenerationIntervalDelta = -25;
    CanGenerateBone = true;
    ItemMinPriceBase = 0;
    ItemMinPriceDelta = 5;
    EnchantmentMinusChanceBase = 10;
    EnchantmentMinusChanceDelta = -5;
    EnchantmentPlusChanceBase = 1;
    EnchantmentPlusChanceDelta = 1;
    BackGroundType = GRAY_FRACTAL;

    Square, Random;
    {
      Items == beartrap { Team = MONSTER_TEAM; IsActive = true; }
      Times = 0:3;
    }

    Square, Random;
    {
      Items == Random { Category = FOOD; }
      Times = 1:2;
    }

    RoomDefault
    {
      Pos = 2:XSize-5,2:YSize-5;
      Size = 4:11,4:11;
      AltarPossible = true;
      WallSquare = solidterrain(GROUND), BALSA_WOOD wall(BRICK_OLD);
      FloorSquare = BALSA_WOOD solidterrain(PARQUET), 0;
      DoorSquare = BALSA_WOOD solidterrain(PARQUET), BALSA_WOOD door;
      GenerateDoor = true;
      DivineMaster = 0;
      GenerateTunnel = true;
      GenerateLanterns = true;
      Type = ROOM_NORMAL;
      GenerateFountains = true;
      AllowLockedDoors = true;
      AllowBoobyTrappedDoors = true;
      Shape = RECTANGLE;
      IsInside = true;
      GenerateWindows = false;
      UseFillSquareWalls = false;
      Flags = 0;
    }
  }

  Level 0;
  {
    IgnoreDefaultSpecialSquares = true;
    MonsterAmountBase = 5;
    CanGenerateBone = false;

    RoomDefault
    {
      AltarPossible = false;
      AllowLockedDoors = false;
      AllowBoobyTrappedDoors = false;
    }

    Square, Random;
    {
      Character = spider(LARGE);
      Times = 2;
    }

    Square, Random;
    {
      Character = kobold;
      Times = 2;
    }

    Square, Random;
    {
      Character = zombie;
      Times = 2;
    }

    Square, Random;
    {
      Character = carnivorousplant;
      Times = 2;
    }

    Square, Random;
    {
      Character = hedgehog;
      Times = 2;
    }

    Square, BoundedRandom 61, 1, 78, 18, NOT_WALKABLE|ATTACHABLE;
    {
      OTerrain = stairs(STAIRS_DOWN);
      EntryIndex = STAIRS_DOWN;
      AttachRequired = true;
    }

    Room
    {
      Pos = 2:XSize/4-5,2:YSize-5;
      Size = 5,5;
      AllowLockedDoors = false;
      AllowBoobyTrappedDoors = false;
      Shape = ROUND_CORNERS;

      Square, Pos 2,2;
      {
        OTerrain = stairs(STAIRS_UP);
        EntryIndex = STAIRS_UP;
      }

      Square, Pos 2,1;
      {
        Items == lantern;
      }
    }

  }

  Level 1;
  {
    Size = 160, 20;
    MonsterAmountBase = 15;
    Items = 20:40;

    RoomDefault
    {
      Pos = 2:XSize-5,2:YSize-5;
    }

    Square, Random;
    {
      Items == Random { MinPrice = 50; MaxPrice = 500; Category = BODY_ARMOR; }
    }

    Square, Random;
    {
      Items == Random { MinPrice = 50; MaxPrice = 500; Category = HELMET|CLOAK|BELT|BOOT|GAUNTLET; }
    }

    Square, BoundedRandom 1, 1, 18, 18, NOT_WALKABLE|ATTACHABLE;
    {
      OTerrain = stairs(STAIRS_UP);
      EntryIndex = STAIRS_UP;
      AttachRequired = true;
    }

    Square, BoundedRandom 141, 1, 158, 18, NOT_WALKABLE|ATTACHABLE;
    {
      OTerrain = stairs(STAIRS_UP) { AttachedArea = 2; }
      EntryIndex = STAIRS_UP + 1;
      AttachRequired = true;
    }

    Room
    {
      Size = 11,11;
      AllowLockedDoors = true;
      AllowBoobyTrappedDoors = true;
      GenerateFountains = false;
      Shape = ROUND_CORNERS;
      WallSquare = solidterrain(GROUND), SAND_STONE earth;
      FloorSquare = solidterrain(GROUND), 0;
      GenerateDoor = false;
      GenerateLanterns = false;
      AltarPossible = false;

      OTerrainMap
      {
        Pos = 3,3;
        Size = 5,5;
        Types
        {
          # = SAND_STONE earth;
        }
      }
      {
        ..#..
        .###.
        ##.##
        .###.
        ..#..
      }

      Square, Pos 5,5;
      {
        OTerrain = stairs(STAIRS_DOWN) { AttachedArea = 3; }
        EntryIndex = STAIRS_DOWN;
      }

      Square, Pos 5,0;
      {
        OTerrain = 0;
        AttachRequired = true;
      }
    }
  }

  Level VESANA_LEVEL;
  {
    MonsterAmountBase = 10;
    LevelMessage = "This level seems to be somehow alive. You feel you want to leave it as soon as possible.";
    FillSquare = solidterrain(GROUND), LIME_STONE earth;

    Square, BoundedRandom 1, 1, 18, 18, NOT_WALKABLE|ATTACHABLE;
    {
      OTerrain = stairs(STAIRS_DOWN) { AttachedArea = 1; AttachedEntry = STAIRS_UP + 1; }
      EntryIndex = STAIRS_DOWN;
      AttachRequired = true;
    }

    Room
    {
      Size = 6,6;
      Pos = 3*XSize/4:XSize/4-5,2:YSize-5;
      FloorSquare = solidterrain(GRASS_TERRAIN), 0;
      GenerateFountains = false;
      AltarPossible = false;
      GenerateLanterns = false;
      GenerateDoor = false;

      Square, Pos 3,3;
      {
        OTerrain = stairs(STAIRS_UP) { AttachedArea = WORLD_MAP; AttachedEntry = UNDER_WATER_TUNNEL_EXIT; }
        EntryIndex = STAIRS_UP;
      }

      Square, Pos 0,1;
      {
        GTerrain = BALSA_WOOD solidterrain(PARQUET);
        OTerrain = BALSA_WOOD door;
        AttachRequired = true;
      }

      CharacterMap
      {
        Size = 4,4;
        Pos = 1,1;
        Types
        {
          c = carnivorousplant(GREATER);
          g = genetrixvesana;
        }
      }
      {
        .cc.
        cg.c
        c..c
        .cc.
      }
    }
  }

  Level CRYSTAL_LEVEL;
  {
    Rooms = 17:30;
    Size = 64, 36;
    LevelMessage = "The air feels thick and damp, and there are strange crystals sprouting from the ground, emitting soft glows of many colors.";
    FillSquare = solidterrain(DARK_GRASS_TERRAIN), BASALT earth;
    TunnelSquare = solidterrain(DARK_GRASS_TERRAIN), 0;
    DifficultyBase = 100;
    DifficultyDelta = 0;
    MonsterAmountBase = 25;
    MonsterGenerationIntervalBase = 60;
    MonsterGenerationIntervalDelta = 0;
    ItemMinPriceBase = 70;
    ItemMinPriceDelta = 0;
    EnchantmentMinusChanceBase = 0;
    EnchantmentMinusChanceDelta = 0;
    EnchantmentPlusChanceBase = 40;
    EnchantmentPlusChanceDelta = 0;
    BackGroundType = BLUE_FRACTAL;

    RoomDefault
    {
      Size = 8:17,8:17;
      Pos = 2:XSize-5,2:YSize-5;
      GenerateLanterns = false;
      Shape = ROUND_CORNERS;
      WallSquare = solidterrain(DARK_GRASS_TERRAIN), BASALT earth;
      FloorSquare = solidterrain(DARK_GRASS_TERRAIN), 0;
      DoorSquare = solidterrain(DARK_GRASS_TERRAIN), 0;
      AltarPossible = false;
    }

    Room
    {
      Square, Random IN_ROOM|HAS_NO_OTERRAIN;
      {
          OTerrain = stairs(STAIRS_UP) { AttachedArea = 1; }
          EntryIndex = STAIRS_UP;
      }

      /*Square, Random IN_ROOM|HAS_NO_OTERRAIN;
      {
          OTerrain = stairs(STAIRS_DOWN);
          EntryIndex = STAIRS_DOWN;
      }*/
    }

    Room
    {
      DivineMaster = TERRA;

      Square, Random HAS_NO_OTERRAIN;
      {
        OTerrain = BASALT altar(TERRA);
      }
    }

    Square, Random HAS_NO_OTERRAIN;
    {
      OTerrain = decoration(SHARD);
      Times = 10:30;
    }

    Square, Random NOT_IN_ROOM|HAS_NO_OTERRAIN;
    {
      OTerrain = boulder(1);
      Times = 5:15;
    }

    Square, Random NOT_IN_ROOM|HAS_NO_OTERRAIN;
    {
      OTerrain = boulder(2);
      Times = 5:15;
    }

    Square, Random;
    {
      Items == stone;
      Times = 0:10;
    }

    Square, Random IN_ROOM;
    {
      Character = golem(BLUE_CRYSTAL);
    }

    Square, Random IN_ROOM;
    {
      Character = golem(PURPLE_CRYSTAL);
    }

    Square, Random IN_ROOM;
    {
      Character = golem(GREEN_CRYSTAL);
    }

    Square, Random;
    {
      Character = spider(LARGE);
      Times = 15;
    }
  }

  /*Level SPIDER_LEVEL;
  {
  }*/
}
