REM ********************************************
REM  Ancient Keeper campaign for KeeperFX
REM  Script for Level 6, Save the Heroes
REM  Version 2.00
REM  Created 1998-07-13 by P.Simbierowicz & D.Kay
REM  Updated 2012-07-02 by Mefistotelis
REM ********************************************

SET_GENERATE_SPEED(400)

COMPUTER_PLAYER(PLAYER1,0)
COMPUTER_PLAYER(PLAYER2,0)

MAX_CREATURES(PLAYER1,25)
MAX_CREATURES(PLAYER2,35)

START_MONEY(PLAYER1,20000)
START_MONEY(PLAYER2,40000)

ADD_CREATURE_TO_POOL(DARK_MISTRESS,25)
ADD_CREATURE_TO_POOL(VAMPIRE,35)

CREATURE_AVAILABLE(PLAYER1,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(PLAYER2,VAMPIRE,1,1)

ROOM_AVAILABLE(PLAYER1,TREASURE,1,1)
ROOM_AVAILABLE(PLAYER1,WORKSHOP,1,1)
ROOM_AVAILABLE(PLAYER2,TREASURE,1,1)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(PLAYER1,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_SIGHT,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_OBEY,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_CALL_TO_ARMS,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_HEAL_CREATURE,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_SPEED,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_LIGHTNING,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_PROTECT,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_CONCEAL,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_CAVE_IN,1,1)
MAGIC_AVAILABLE(PLAYER2,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER2,POWER_SIGHT,1,1)
MAGIC_AVAILABLE(PLAYER2,POWER_OBEY,1,1)
MAGIC_AVAILABLE(PLAYER2,POWER_CALL_TO_ARMS,1,1)
MAGIC_AVAILABLE(PLAYER2,POWER_HEAL_CREATURE,1,1)
MAGIC_AVAILABLE(PLAYER2,POWER_SPEED,1,1)
MAGIC_AVAILABLE(PLAYER2,POWER_LIGHTNING,1,1)
MAGIC_AVAILABLE(PLAYER2,POWER_PROTECT,1,1)
MAGIC_AVAILABLE(PLAYER2,POWER_CONCEAL,1,1)
MAGIC_AVAILABLE(PLAYER2,POWER_CAVE_IN,1,1)

IF(PLAYER0,BATTLES_WON>2)
  DOOR_AVAILABLE(PLAYER0,MAGIC,1,8)
ENDIF
DOOR_AVAILABLE(PLAYER1,MAGIC,1,0)
DOOR_AVAILABLE(PLAYER2,MAGIC,1,100)

TRAP_AVAILABLE(PLAYER1,BOULDER,1,0)

DISPLAY_OBJECTIVE(16,PLAYER0)

IF(PLAYER_GOOD,AVATAR == 0)
  ADD_CREATURE_TO_LEVEL(PLAYER0,AVATAR,PLAYER_GOOD,1,10,0)
  SET_TIMER(PLAYER0,TIMER0)
  DISPLAY_OBJECTIVE(17,PLAYER0)
ENDIF

REM limited time to destroy white heart
IF(PLAYER0,TIMER0 > 10000)
  IF(PLAYER_GOOD,DUNGEON_DESTROYED != 1)
    DISPLAY_OBJECTIVE(29,PLAYER0)
    LOSE_GAME
  ENDIF
ENDIF

IF(PLAYER_GOOD,DUNGEON_DESTROYED==1)
  DISPLAY_OBJECTIVE(30,PLAYER0)
ENDIF

IF(PLAYER1,DUNGEON_DESTROYED==1)
  DISPLAY_OBJECTIVE(32,PLAYER0)
ENDIF

IF(PLAYER0,ALL_DUNGEONS_DESTROYED == 1)
  DISPLAY_OBJECTIVE(31,PLAYER0)
  WIN_GAME
ENDIF
