REM ********************************************
REM  Ancient Keeper campaign for KeeperFX
REM  Script for Level 102 (Secret 3)
REM  Version 1.00
REM ********************************************

IF(PLAYER0,IMP < 1)
  NEXT_COMMAND_REUSABLE
  ADD_CREATURE_TO_LEVEL(PLAYER0,IMP,PLAYER0,1,9,0)
ENDIF

DISPLAY_OBJECTIVE(131,PLAYER0)

IF(PLAYER0,PRISON>0)
  SET_FLAG(PLAYER0,FLAG0,1)
  DISPLAY_INFORMATION(132,PLAYER0)
ENDIF

IF(PLAYER0,BATTLES_WON>3)
  DISPLAY_OBJECTIVE(133,PLAYER0)
ENDIF

IF(PLAYER_GOOD,AVATAR == 0)
  ADD_CREATURE_TO_LEVEL(PLAYER0,KNIGHT,PLAYER_GOOD,1,10,0)
  DISPLAY_INFORMATION(136,PLAYER0)
ENDIF

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

IF(PLAYER0,FLAG0 > 0)
  IF(PLAYER0,TOTAL_CREATURES<1)
    DISPLAY_OBJECTIVE(135,PLAYER0)
    LOSE_GAME
  ENDIF
ENDIF
