{
  IF ( INT_GAME_TURN == 0 )
  {
    SET $0                                     0
    DO SET_ATTACK_VARIABLE                     $0
    DO SET_DRUM_TOWER_POS                      174 168
    DO STATE_CONSTRUCT_BUILDING                ON
    DO STATE_FETCH_WOOD                        ON
    SET INT_ATTR_ATTACK_PERCENTAGE             15
    SET INT_ATTR_PREF_SPY_TRAINS               0
    SET INT_ATTR_PREF_RELIGIOUS_TRAINS         0
    SET INT_ATTR_PREF_WARRIOR_TRAINS           0
    SET INT_ATTR_PREF_FIREWARRIOR_TRAINS       0
    SET INT_ATTR_PREF_BOAT_HUTS                0
    SET INT_ATTR_PREF_BALLOON_HUTS             0
    SET INT_ATTR_MAX_BUILDINGS_ON_GO           1
    SET INT_ATTR_HOUSE_PERCENTAGE              0
    DO STATE_SHAMAN_GET_WILDS                  OFF
    SET INT_ATTR_EXPANSION                     20
    DO STATE_HOUSE_A_PERSON                    ON
    DO STATE_STATE_BRING_NEW_PEOPLE_BACK       ON
    DO STATE_POPULATE_DRUM_TOWER               ON
    DO STATE_DEFEND                            ON
    DO STATE_DEFEND_BASE                       ON
    SET INT_ATTR_DEFENSE_RAD_INCR              1
    SET INT_ATTR_MAX_DEFENSIVE_ACTIONS         1
    SET INT_ATTR_USE_PREACHER_FOR_DEFENCE      0
    DO STATE_PREACH                            ON
    SET INT_ATTR_SHAMEN_BLAST                  128
    DO STATE_SPELL_DEFENCE                     174 168 ON
    DO SET_SPELL_ENTRY 0 INT_LIGHTNING 300000 128 3 0
    DO SET_SPELL_ENTRY 1 INT_SWARM 225000 128 4 0
    SET INT_ATTR_SPY_CHECK_FREQUENCY           128
    SET INT_ATTR_RETREAT_VALUE                 20
    SET INT_ATTR_RANDOM_BUILD_SIDE             0
    DO STATE_TRAIN_PEOPLE                      ON
    SET INT_ATTR_PREF_SPY_PEOPLE               0
    SET INT_ATTR_PREF_RELIGIOUS_PEOPLE         10
    SET INT_ATTR_PREF_WARRIOR_PEOPLE           10
    SET INT_ATTR_PREF_FIREWARRIOR_PEOPLE       0
    SET INT_ATTR_MAX_TRAIN_AT_ONCE             1
    SET INT_ATTR_GROUP_OPTION                  0
    DO STATE_AUTO_ATTACK                       ON
    SET INT_ATTR_COUNT_PREACH_DAMAGE           1
    SET INT_ATTR_MAX_ATTACKS                   1
    SET INT_ATTR_AWAY_BRAVE                    10
    SET INT_ATTR_AWAY_WARRIOR                  50
    SET INT_ATTR_AWAY_RELIGIOUS                40
    SET INT_ATTR_AWAY_SPY                      0
    SET INT_ATTR_AWAY_FIREWARRIOR              0
    SET INT_ATTR_AWAY_SHAMAN                   100
    SET INT_ATTR_BASE_UNDER_ATTACK_RETREAT     1
    DO SET_MARKER_ENTRY                        1 1 -1 0 0 0 1
    DO SET_MARKER_ENTRY                        2 2 -1 0 1 0 0
    DO SET_MARKER_ENTRY                        3 3 -1 0 0 0 1
    DO SET_MARKER_ENTRY                        4 4 5 0 3 0 0
    DO SET_MARKER_ENTRY                        5 6 7 0 2 0 2
    DO SET_MARKER_ENTRY                        6 8 9 0 3 0 4
    DO SET_MARKER_ENTRY                        7 5 8 0 1 0 0
    DO SET_MARKER_ENTRY                        8 12 13 0 2 0 1
    DO MARKER_ENTRIES                          1 2 3 4
    DO MARKER_ENTRIES                          5 6 7 8
    SET $1                                     0
    SET $2                                     0
    SET $3                                     0
    SET $4                                     0
    SET $5                                     0
    SET $6                                     0
    SET $7                                     1
    SET $8                                     0
    SET $9                                     0
    SET $10                                    0
    SET $11                                    0
    SET $12                                    0
    SET $13                                    0
    SET $14                                    0
    SET $15                                    0
    SET $16                                    1
    SET $17                                    1
    DO GIVE_MANA_TO_PLAYER RED 150000
    DO FIX_WILD_IN_AREA                        216 58 12
    DO DISABLE_USER_INPUTS
    DO ZOOM_TO                                 166 130 1096
    SET $10                                    1
    DO CREATE_MSG_NARRATIVE                    74
    DO SET_MSG_AUTO_OPEN_DLG
    DO GIVE_ONE_SHOT INT_BLAST BLUE
    DO GIVE_ONE_SHOT INT_SWARM BLUE
    DO GIVE_ONE_SHOT INT_BLAST BLUE
    DO GIVE_ONE_SHOT INT_SWARM BLUE
    DO GIVE_ONE_SHOT INT_BLAST BLUE
    DO GIVE_ONE_SHOT INT_SWARM BLUE
  }
  ELSE
  {
    EVERY 256
    {
      IF ( INT_MY_NUM_PEOPLE < 73 )
      {
        DO SET_BUCKET_USAGE                      ON
        DO SET_BUCKET_COUNT_FOR_SPELL INT_BLAST                 8
        DO SET_BUCKET_COUNT_FOR_SPELL INT_CONVERT               8
        DO SET_BUCKET_COUNT_FOR_SPELL INT_SWARM                 32
        DO SET_BUCKET_COUNT_FOR_SPELL INT_INVISIBILITY          40
        DO SET_BUCKET_COUNT_FOR_SPELL INT_SHIELD                48
        DO SET_BUCKET_COUNT_FOR_SPELL INT_LAND_BRIDGE           66
        DO SET_BUCKET_COUNT_FOR_SPELL INT_LIGHTNING             64
        DO SET_BUCKET_COUNT_FOR_SPELL INT_HYPNOTISM             70
        DO SET_BUCKET_COUNT_FOR_SPELL INT_TORNADO               72
        DO SET_BUCKET_COUNT_FOR_SPELL INT_SWAMP                 80
        DO SET_BUCKET_COUNT_FOR_SPELL INT_FLATTEN               100
        DO SET_BUCKET_COUNT_FOR_SPELL INT_EARTHQUAKE            140
        DO SET_BUCKET_COUNT_FOR_SPELL INT_EROSION               168
        DO SET_BUCKET_COUNT_FOR_SPELL INT_FIRESTORM             320
        DO SET_BUCKET_COUNT_FOR_SPELL INT_ANGEL_OF_DEATH        408
        DO SET_BUCKET_COUNT_FOR_SPELL INT_VOLCANO               640
      }
      ELSE
      {
        DO SET_BUCKET_USAGE                      ON
        DO SET_BUCKET_COUNT_FOR_SPELL INT_BLAST                 4
        DO SET_BUCKET_COUNT_FOR_SPELL INT_CONVERT               4
        DO SET_BUCKET_COUNT_FOR_SPELL INT_SWARM                 16
        DO SET_BUCKET_COUNT_FOR_SPELL INT_INVISIBILITY          20
        DO SET_BUCKET_COUNT_FOR_SPELL INT_SHIELD                24
        DO SET_BUCKET_COUNT_FOR_SPELL INT_LAND_BRIDGE           33
        DO SET_BUCKET_COUNT_FOR_SPELL INT_LIGHTNING             32
        DO SET_BUCKET_COUNT_FOR_SPELL INT_HYPNOTISM             35
        DO SET_BUCKET_COUNT_FOR_SPELL INT_TORNADO               36
        DO SET_BUCKET_COUNT_FOR_SPELL INT_SWAMP                 40
        DO SET_BUCKET_COUNT_FOR_SPELL INT_FLATTEN               50
        DO SET_BUCKET_COUNT_FOR_SPELL INT_EARTHQUAKE            70
        DO SET_BUCKET_COUNT_FOR_SPELL INT_EROSION               84
        DO SET_BUCKET_COUNT_FOR_SPELL INT_FIRESTORM             180
        DO SET_BUCKET_COUNT_FOR_SPELL INT_ANGEL_OF_DEATH        204
        DO SET_BUCKET_COUNT_FOR_SPELL INT_VOLCANO               320
      }
      ENDIF
      IF ( $1 == 0 )
      {
        DO MARKER_ENTRIES                        1 2 3 4
        SET $1                                   1
      }
      ELSE
      {
        DO MARKER_ENTRIES                        5 6 7 8
        SET $1                                   0
      }
      ENDIF
    }
    EVERY 32
    {
      IF ( INT_MY_NUM_PEOPLE < 8 && INT_MY_NUM_KILLED_BY_HUMAN > 10 )
      {
        DO GIVE_UP_AND_SULK                      ON
      }
      ENDIF
      IF ( $13 == 0 )
      {
        DO COUNT_ANGELS 0 $6
        IF ( $6 > 0 && INT_M_PERSON_SHAMAN < 1 )
        {
          SET $13                                 1
        }
        ENDIF
      }
      ELSE
      {
        IF ( $13 < 4 )
        {
          INCREMENT $13 1
        }
        ELSE
        {
          IF ( $13 == 4 )
          {
            DO TRIGGER_LEVEL_WON
            SET $13                                9
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
      DO COUNT_PEOPLE_IN_MARKER BLUE 10 1 $8
      IF ( $8 > 0 && $3 == 0 )
      {
        DO GET_HEAD_TRIGGER_COUNT 166 130 $17
        IF ( INT_CP_FREE_ENTRIES > 0 && $17 > 0 )
        {
          SET $3                                  1
          SET INT_ATTR_AWAY_BRAVE                 50
          SET INT_ATTR_AWAY_WARRIOR               50
          SET INT_ATTR_AWAY_RELIGIOUS             0
          SET INT_ATTR_AWAY_SPY                   0
          SET INT_ATTR_AWAY_FIREWARRIOR           0
          SET INT_ATTR_AWAY_SHAMAN                100
          DO ATTACK BLUE 2 ATTACK_PERSON INT_SHAMAN 6 INT_SWARM INT_BLAST INT_BLAST ATTACK_NORMAL 0 -1 -1 -1
          SET INT_ATTR_AWAY_BRAVE                 10
          SET INT_ATTR_AWAY_WARRIOR               50
          SET INT_ATTR_AWAY_RELIGIOUS             40
          SET INT_ATTR_AWAY_SPY                   0
          SET INT_ATTR_AWAY_FIREWARRIOR           0
          SET INT_ATTR_AWAY_SHAMAN                100
        }
        ENDIF
      }
      ENDIF
      IF ( $3 > 0 )
      {
        INCREMENT $3 1
        IF ( $3 > 4 )
        {
          SET $3                                  0
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 16 4
    {
      IF ( $15 == 0 )
      {
        DO GET_HEAD_TRIGGER_COUNT 214 58 $16
        IF ( $16 == 0 )
        {
          DO CREATE_MSG_INFORMATION_ZOOM          130 222 50 1800
          DO SET_MSG_DELETE_ON_OK
          DO SET_MSG_TIMEOUT                      512
          SET $15                                 1
        }
        ENDIF
      }
      ENDIF
      IF ( $14 == 0 )
      {
        DO GET_HEAD_TRIGGER_COUNT 166 130 $7
        IF ( $7 == 0 )
        {
          DO DISABLE_USER_INPUTS
          DO REMOVE_TIMER
          DO AUTO_MESSAGES                        OFF
          DO FLYBY_CREATE_NEW
          DO FLYBY_ALLOW_INTERRUPT                OFF
          DO FLYBY_SET_EVENT_POS                  166 130 1 20
          DO FLYBY_SET_EVENT_ZOOM                 -20 1 30
          DO FLYBY_SET_EVENT_ANGLE                1096 1 20
          DO FLYBY_SET_EVENT_ANGLE                300 21 129
          DO FLYBY_SET_EVENT_POS                  174 136 80 35
          DO FLYBY_SET_EVENT_ZOOM                 -60 35 55
          DO FLYBY_SET_EVENT_ZOOM                 0 95 75
          DO FLYBY_START
          SET $14                                 1
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 256 128
    {
      DO PUT_PERSON_IN_DT INT_RELIGIOUS 194 178
      DO GET_HEAD_TRIGGER_COUNT 166 130 $7
      IF ( $7 == 0 && $5 == 0 )
      {
        DO COUNT_ANGELS 0 $6
        IF ( $6 > 0 )
        {
          IF ( INT_M_PERSON_SHAMAN > 0 )
          {
            SET $4                                 INT_MY_NUM_PEOPLE
            DIVIDE $4 $4 2
            DO DEFEND_SHAMEN                       $4
            SET $5                                 1
          }
          ELSE
          {
            IF ( $11 == 0 )
            {
              DO SEND_ALL_PEOPLE_TO_MARKER          3
              SET $11                               1
            }
            ENDIF
          }
          ENDIF
        }
        ENDIF
      }
      ELSE
      {
        IF ( $7 == 0 && $5 > 0 )
        {
          DO COUNT_ANGELS 0 $6
          IF ( $6 == 0 )
          {
            DO SEND_SHAMEN_DEFENDERS_HOME
            SET $5                                 0
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
      IF ( $10 > 4 )
      {
        DO HAS_TIMER_REACHED_ZERO                $12
        IF ( $12 > 0 && INT_CP_FREE_ENTRIES > 0 )
        {
          DO PRAY_AT_HEAD                         1 11
          DO STATE_SPELL_DEFENCE                  166 134 ON
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 64
    {
      IF ( $10 == 4 )
      {
        DO SET_TIMER_GOING                       900
        SET $10                                  5
      }
      ENDIF
      IF ( $10 == 3 && INT_GAME_TURN > 30 )
      {
        SET $10                                  4
      }
      ENDIF
      IF ( $10 == 2 )
      {
        SET $10                                  3
      }
      ENDIF
    }
    EVERY 16
    {
      IF ( $10 == 1 )
      {
        DO ENABLE_USER_INPUTS
        DO FLYBY_CREATE_NEW
        DO FLYBY_ALLOW_INTERRUPT                 ON
        DO FLYBY_SET_END_TARGET                  254 0 1500 0
        DO FLYBY_SET_EVENT_POS                   166 130 1 10
        DO FLYBY_SET_EVENT_ANGLE                 300 1 60
        DO FLYBY_SET_EVENT_ZOOM                  -80 1 50
        DO FLYBY_SET_EVENT_POS                   218 20 51 40
        DO FLYBY_SET_EVENT_ANGLE                 1996 61 40
        DO FLYBY_SET_EVENT_ZOOM                  30 55 70
        DO FLYBY_SET_EVENT_POS                   214 58 110 30
        DO FLYBY_SET_EVENT_ANGLE                 300 130 45
        DO FLYBY_SET_EVENT_ZOOM                  -80 130 55
        DO FLYBY_SET_EVENT_ZOOM                  0 190 30
        DO FLYBY_SET_EVENT_ANGLE                 1500 190 30
        DO FLYBY_SET_EVENT_POS                   254 0 190 30
        DO FLYBY_START
        SET $10                                  2
      }
      ENDIF
    }
  }
  ENDIF
}
SCRIPT_END
