LEVEL_VERSION(1)
SET_GENERATE_SPEED(400)
START_MONEY(ALL_PLAYERS,2500)
MAX_CREATURES(ALL_PLAYERS,25)
SET_GAME_RULE(MapCreatureLimit,1000)

QUICK_OBJECTIVE(1,"Find a way to establish your Dungeon.But be careful what path you choose some are more Dangerous then others!",PLAYER5)






ADD_CREATURE_TO_POOL(AACOLYTE,40)
ADD_CREATURE_TO_POOL(AASSASSIN,40)
ADD_CREATURE_TO_POOL(AEXECUTIONER,40)
ADD_CREATURE_TO_POOL(AMERCENARY,40)
ADD_CREATURE_TO_POOL(ANECROMANCER,40)
ADD_CREATURE_TO_POOL(ANECROMANCERZOMBIE,40)
ADD_CREATURE_TO_POOL(APLAGUEDOCTOR,40)
ADD_CREATURE_TO_POOL(ASERVANT,40)
ADD_CREATURE_TO_POOL(AWARLOCK,40)
ADD_CREATURE_TO_POOL(AWITCH,40)
ADD_CREATURE_TO_POOL(ATYRANT,40)
ADD_CREATURE_TO_POOL(AVIXEN,40)
ADD_CREATURE_TO_POOL(DBBLACKKNIGHT,40)


CREATURE_AVAILABLE(PLAYER5,AACOLYTE,1,0)
CREATURE_AVAILABLE(PLAYER5,AASSASSIN,1,0)
CREATURE_AVAILABLE(PLAYER5,AEXECUTIONER,1,0)
CREATURE_AVAILABLE(PLAYER5,AMERCENARY,1,0)
CREATURE_AVAILABLE(PLAYER5,ANECROMANCER,1,0)
CREATURE_AVAILABLE(PLAYER5,ANECROMANCERZOMBIE,1,0)
CREATURE_AVAILABLE(PLAYER5,APLAGUEDOCTOR,1,0)
CREATURE_AVAILABLE(PLAYER5,ASERVANT,1,0)
CREATURE_AVAILABLE(PLAYER5,AWARLOCK,1,0)
CREATURE_AVAILABLE(PLAYER5,AWITCH,1,0)
CREATURE_AVAILABLE(PLAYER5,ATYRANT,1,0)
CREATURE_AVAILABLE(PLAYER5,AVIXEN,1,0)
CREATURE_AVAILABLE(PLAYER5,DBBLACKKNIGHT,1,0)


MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_POSSESS,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_OBEY,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_PROTECT,1,0)

TRAP_AVAILABLE(ALL_PLAYERS,ALARM,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,1,0)

DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)


REM PARTY PARTY

CREATE_PARTY(Medium2)
	ADD_TO_PARTY(Medium2,KNIGHT,8,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(Medium2,FAIRY,8,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(Medium2,FAIRY,8,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(Medium2,ARCHER,8,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(Medium2,ARCHER,8,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(Medium2,SAMURAI,8,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(Medium2,SAMURAI,8,250,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(hard)
	ADD_TO_PARTY(hard,KNIGHT,9,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(hard,FAIRY,9,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(hard,FAIRY,9,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(hard,ARCHER,9,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(hard,ARCHER,9,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(hard,SAMURAI,9,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(hard,SAMURAI,9,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(hard,TIME_MAGE,9,250,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(hard1)
	ADD_TO_PARTY(hard1,KNIGHT,10,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(hard1,FAIRY,10,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(hard1,FAIRY,10,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(hard1,ARCHER,10,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(hard1,ARCHER,10,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(hard1,SAMURAI,10,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(hard1,SAMURAI,10,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(hard1,BARBARIAN,10,250,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(hard1,BARBARIAN,10,250,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(defense)
	ADD_TO_PARTY(defense,AVATAR,10,250,DEFEND_HEART,0)
	ADD_TO_PARTY(defense,KNIGHT,10,250,DEFEND_HEART,0)
	ADD_TO_PARTY(defense,KNIGHT,10,250,DEFEND_HEART,0)
	ADD_TO_PARTY(defense,ARCHER,10,250,DEFEND_HEART,0)
	ADD_TO_PARTY(defense,ARCHER,10,250,DEFEND_HEART,0)
	ADD_TO_PARTY(defense,SAMURAI,10,250,DEFEND_HEART,0)
	ADD_TO_PARTY(defense,SAMURAI,10,250,DEFEND_HEART,0)
	ADD_TO_PARTY(defense,FAIRY,10,250,DEFEND_HEART,0)
	ADD_TO_PARTY(defense,WITCH,10,250,DEFEND_HEART,0)
	ADD_TO_PARTY(defense,WITCH,10,250,DEFEND_HEART,0)
	ADD_TO_PARTY(defense,FAIRY,10,250,DEFEND_HEART,0)
	ADD_TO_PARTY(defense,HORNY,10,250,DEFEND_HEART,0)
	ADD_TO_PARTY(defense,HORNY,10,250,DEFEND_HEART,0)
	ADD_TO_PARTY(defense,GIANT,10,250,DEFEND_HEART,0)
	ADD_TO_PARTY(defense,GIANT,10,250,DEFEND_HEART,0)
	ADD_TO_PARTY(defense,WIZARD,10,250,DEFEND_HEART,0)
	ADD_TO_PARTY(defense,WIZARD,10,250,DEFEND_HEART,0)



IF_ACTION_POINT(1,PLAYER5)
	CHANGE_SLAB_TYPE(35,84,PATH,NONE)
	CHANGE_SLAB_TYPE(35,85,PATH,NONE)
	CHANGE_SLAB_TYPE(35,86,PATH,NONE)
	CHANGE_SLAB_TYPE(36,86,PATH,NONE)
	CHANGE_SLAB_TYPE(37,86,PATH,NONE)
	CHANGE_SLAB_TYPE(38,86,PATH,NONE)
	CHANGE_SLAB_TYPE(39,86,PATH,NONE)
	CHANGE_SLAB_TYPE(40,86,PATH,NONE)
	CHANGE_SLAB_TYPE(41,86,PATH,NONE)
	CHANGE_SLAB_TYPE(42,86,PATH,NONE)
	CHANGE_SLAB_TYPE(43,86,PATH,NONE)
	CHANGE_SLAB_TYPE(44,86,PATH,NONE)
	CHANGE_SLAB_TYPE(45,86,PATH,NONE)
ENDIF

REM ROOMS

IF(PLAYER5,LAIR >= 1)
	ROOM_AVAILABLE(PLAYER5,LAIR,1,1)
ENDIF

IF(PLAYER5,GARDEN >= 1)
	ROOM_AVAILABLE(PLAYER5,GARDEN,1,1)
ENDIF

IF(PLAYER5,TRAINING >= 1)
	ROOM_AVAILABLE(PLAYER5,TRAINING,1,1)
ENDIF

IF(PLAYER5,TREASURE >= 1)
	ROOM_AVAILABLE(PLAYER5,TREASURE,1,1)
ENDIF

IF(PLAYER5,RESEARCH >= 1)
	ROOM_AVAILABLE(PLAYER5,RESEARCH,1,1)
ENDIF

IF(PLAYER5,WORKSHOP >= 1)
	ROOM_AVAILABLE(PLAYER5,WORKSHOP,1,1)
ENDIF

IF(PLAYER5,TORTURE >= 1)
	ROOM_AVAILABLE(PLAYER5,TORTURE,1,1)
ENDIF

IF(PLAYER5,TEMPLE >= 1)
	ROOM_AVAILABLE(PLAYER5,TEMPLE,1,1)
ENDIF

IF(PLAYER5,PRISON >= 1)
	ROOM_AVAILABLE(PLAYER5,PRISON,1,1)
ENDIF

IF(PLAYER5,BARRACKS >= 1)
	ROOM_AVAILABLE(PLAYER5,BARRACKS,1,1)
ENDIF

IF(PLAYER5,ENTRANCE >= 1)
	SET_TIMER(PLAYER0,TIMER0)
ENDIF

IF(PLAYER0,TIMER0 >= 14000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,Medium2,-1,1)
	SET_TIMER(PLAYER0,TIMER1)
ENDIF


IF(PLAYER0,TIMER1 >= 7000)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,Medium2,-2,1)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,Medium2,-3,1)
SET_TIMER(PLAYER0,TIMER2)
ENDIF

IF(PLAYER0,TIMER2 >= 7500)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,hard,-1,1)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,hard,-2,1)
SET_TIMER(PLAYER0,TIMER3)
ENDIF

IF(PLAYER0,TIMER3 >= 5500)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,hard,-1,1)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,hard1,-3,1)
SET_TIMER(PLAYER0,TIMER4)
ENDIF

IF(PLAYER0,TIMER4 >= 7500)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,hard1,-2,1)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,hard1,-3,1)
SET_TIMER(PLAYER0,TIMER5)
ENDIF


IF(PLAYER0,TIMER5 >= 7500)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,hard1,-1,1)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,hard1,-2,1)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,hard1,-3,1)
NEXT_COMMAND_REUSABLE
SET_TIMER(PLAYER0,TIMER5)
ENDIF


IF_SLAB_TYPE(40,8,PRETTY_PATH)
	ADD_TO_FLAG(PLAYER0,FLAG0,1)
ENDIF

IF_SLAB_TYPE(34,8,PRETTY_PATH)
	ADD_TO_FLAG(PLAYER0,FLAG0,1)
ENDIF


IF(PLAYER0,FLAG0 >= 1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,defense,2,1)
ENDIF




REM IMP LIMITATION


IF_CONTROLS(PLAYER5,IMP < 30)
  NEXT_COMMAND_REUSABLE
  MAGIC_AVAILABLE(PLAYER5,POWER_IMP,1,1)
 ENDIF

IF_CONTROLS(PLAYER5,IMP >= 30)
  NEXT_COMMAND_REUSABLE
  MAGIC_AVAILABLE(PLAYER5,POWER_IMP,0,0)
ENDIF


IF(PLAYER5,ALL_DUNGEONS_DESTROYED == 1)
	WIN_GAME
ENDIF
