REM ********************************************
REM  Ancient Keeper campaign for KeeperFX
REM  Script for Level 9
REM  Version 1.00
REM ********************************************

SET_TIMER(PLAYER0,TIMER0)

MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_OBEY,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_PROTECT,1,0)

DOOR_AVAILABLE(PLAYER0,MAGIC,1,0)

DISPLAY_OBJECTIVE(43,PLAYER0)

IF(PLAYER_GOOD,DUNGEON_DESTROYED != 1)
  IF(PLAYER0,TIMER0 > 8000)
    DISPLAY_OBJECTIVE(44,PLAYER0)
    NEXT_COMMAND_REUSABLE
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,KNIGHT,PLAYER_GOOD,10,10,100)
    NEXT_COMMAND_REUSABLE
    SET_TIMER(PLAYER0,TIMER0)
  ENDIF
ENDIF

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

IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
  IF(PLAYER_GOOD,TOTAL_CREATURES < 1)
    DISPLAY_OBJECTIVE(46,PLAYER0)
    WIN_GAME
  ENDIF
ENDIF
