{
  IF ( INT_GAME_TURN == 0 )
  {
    DO SET_REINCARNATION                       OFF
    DO SET_NO_BLUE_REINC
    DO DELAY_MAIN_DRUM_TOWER
    SET $0                                     0
    DO SET_ATTACK_VARIABLE                     $0
    DO STATE_STATE_BRING_NEW_PEOPLE_BACK       OFF
    DO STATE_TRAIN_PEOPLE                      OFF
    DO STATE_SHAMAN_GET_WILDS                  OFF
    DO STATE_CONSTRUCT_BUILDING                OFF
    DO STATE_FETCH_WOOD                        OFF
    DO STATE_SEND_GHOSTS                       OFF
    DO STATE_FETCH_LOST_PEOPLE                 OFF
    DO STATE_FETCH_FAR_VEHICLE                 OFF
    DO STATE_FETCH_LOST_VEHICLE                OFF
    SET INT_ATTR_PREF_BOAT_DRIVERS             0
    DO SET_BASE_MARKER                         11
    DO GIVE_ONE_SHOT INT_EROSION GREEN
    SET INT_ATTR_SHAMEN_BLAST                  128
    SET INT_ATTR_MAX_TRAIN_AT_ONCE             1
    SET INT_ATTR_GROUP_OPTION                  0
    SET INT_ATTR_BASE_UNDER_ATTACK_RETREAT     1
    DO SET_DEFENCE_RADIUS                      7
    SET INT_ATTR_PREF_SPY_TRAINS               0
    SET INT_ATTR_PREF_WARRIOR_TRAINS           0
    SET INT_ATTR_PREF_FIREWARRIOR_TRAINS       0
    SET INT_ATTR_PREF_RELIGIOUS_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              12
    SET INT_ATTR_EXPANSION                     12
    DO STATE_POPULATE_DRUM_TOWER               ON
    DO STATE_DEFEND                            OFF
    DO STATE_DEFEND_BASE                       OFF
    SET INT_ATTR_DEFENSE_RAD_INCR              0
    SET INT_ATTR_MAX_DEFENSIVE_ACTIONS         0
    SET INT_ATTR_ATTACK_PERCENTAGE             45
    SET INT_ATTR_SHAMEN_BLAST                  32
    DO STATE_SPELL_DEFENCE                     18 250 ON
    DO TARGET_FIREWARRIORS
    DO STATE_HOUSE_A_PERSON                    ON
    DO STATE_AUTO_ATTACK                       ON
    SET INT_ATTR_MAX_ATTACKS                   1
    SET INT_ATTR_AWAY_BRAVE                    100
    SET INT_ATTR_AWAY_WARRIOR                  34
    SET INT_ATTR_AWAY_RELIGIOUS                33
    SET INT_ATTR_AWAY_SPY                      0
    SET INT_ATTR_AWAY_FIREWARRIOR              20
    SET INT_ATTR_AWAY_SHAMAN                   0
    SET INT_ATTR_RETREAT_VALUE                 50
    SET INT_ATTR_SPY_DISCOVER_CHANCE           30
    SET INT_ATTR_ENEMY_SPY_MAX_STAND           255
    DO SET_MARKER_ENTRY                        0 12 13 0 2 0 0
    DO SET_MARKER_ENTRY                        1 15 16 0 0 4 0
    DO SET_MARKER_ENTRY                        2 17 18 0 3 0 0
    DO SET_MARKER_ENTRY                        3 19 -1 0 0 0 1
    DO SET_MARKER_ENTRY                        4 15 16 0 0 2 0
    DO MARKER_ENTRIES                          0 1 2 3
    DO PUT_PERSON_IN_DT INT_RELIGIOUS 36 54
    DO CREATE_MSG_NARRATIVE                    57
    DO SET_MSG_AUTO_OPEN_DLG
    SET $1                                     0
    SET $2                                     0
    SET $3                                     0
    SET $4                                     0
    SET $5                                     0
    SET $6                                     0
    SET $7                                     0
    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                                    0
  }
  ELSE
  {
    EVERY 8
    {
      IF ( INT_GAME_TURN > 128 && $2 == 0 )
      {
        DO SPELL_ATTACK INT_EROSION 0 0
        SET $2                                   1
        DO GIVE_ONE_SHOT INT_EROSION GREEN
      }
      ENDIF
    }
    EVERY 16
    {
      DO GET_SPELLS_CAST GREEN INT_EROSION $1
      IF ( $1 > $3 )
      {
        INCREMENT $3 1
        SET $17                                  64
      }
      ENDIF
    }
    IF ( $17 > 0 )
    {
      DECREMENT $17 1
      IF ( $17 == 0 )
      {
        IF ( $3 < 11 )
        {
          DO SPELL_ATTACK INT_EROSION $3 0
          DO GIVE_ONE_SHOT INT_EROSION GREEN
        }
        ENDIF
      }
      ENDIF
    }
    ENDIF
    EVERY 32 1
    {
      IF ( $11 == 0 )
      {
        IF ( $3 > 9 )
        {
          SET $12                                 1
          DO CREATE_MSG_INFORMATION_ZOOM          58 36 58 1398
          SET $11                                 1
          SET $12                                 0
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 16 57
    {
      DO GET_HEAD_TRIGGER_COUNT 36 58 $5
      IF ( $5 < 1 )
      {
        DO STATE_SPELL_DEFENCE                   2 200 ON
        DO SET_BASE_MARKER                       21
        DO CLEAR_GUARDING_FROM                   1 -1 -1 -1
        DO MARKER_ENTRIES                        4 -1 -1 -1
        IF ( $7 == 0 )
        {
          DO PUT_PERSON_IN_DT INT_FIREWARRIOR 18 250
          DO PUT_PERSON_IN_DT INT_FIREWARRIOR 242 248
          SET $7                                  1
        }
        ENDIF
        IF ( $9 == 0 )
        {
          DO FLYBY_CREATE_NEW
          DO FLYBY_ALLOW_INTERRUPT                ON
          DO FLYBY_SET_EVENT_POS                  246 60 3 82
          DO FLYBY_SET_EVENT_POS                  248 80 90 60
          DO FLYBY_SET_EVENT_POS                  20 80 155 35
          DO FLYBY_SET_EVENT_POS                  36 54 195 27
          DO FLYBY_SET_EVENT_ANGLE                352 1 79
          DO FLYBY_SET_EVENT_ANGLE                808 83 57
          DO FLYBY_SET_EVENT_ANGLE                1646 145 65
          DO FLYBY_SET_EVENT_ZOOM                 100 15 60
          DO FLYBY_SET_EVENT_ZOOM                 -70 80 80
          DO FLYBY_SET_EVENT_ZOOM                 0 165 50
          DO FLYBY_SET_END_TARGET                 36 54 1646 0
          DO FLYBY_START
          DO SET_TIMER_GOING                      480
          SET $9                                  1
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 16 31
    {
      IF ( $9 == 1 )
      {
        IF ( $6 == 0 )
        {
          DO GET_HEAD_TRIGGER_COUNT 2 226 $4
          IF ( $4 < 1 )
          {
            SET $18                                64
            SET $6                                 1
            DO REMOVE_TIMER
            DO FLYBY_CREATE_NEW
            DO FLYBY_ALLOW_INTERRUPT               OFF
            DO FLYBY_SET_EVENT_POS                 0 192 2 30
            DO FLYBY_SET_EVENT_POS                 14 196 32 30
            DO FLYBY_SET_EVENT_POS                 2 224 63 30
            DO FLYBY_SET_EVENT_ANGLE               186 1 34
            DO FLYBY_SET_EVENT_ANGLE               1497 36 30
            DO FLYBY_SET_EVENT_ANGLE               1009 66 28
            DO FLYBY_SET_END_TARGET                2 224 1009 0
            DO FLYBY_START
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
    }
    IF ( $18 > 0 )
    {
      DECREMENT $18 1
      IF ( $18 == 0 )
      {
        DO TRIGGER_THING                         20
      }
      ENDIF
    }
    ENDIF
    EVERY 16 23
    {
      IF ( INT_B_PERSON_SHAMAN == 0 )
      {
        DO TRIGGER_LEVEL_LOST
      }
      ENDIF
    }
    EVERY 16 13
    {
      DO HAS_TIMER_REACHED_ZERO                 $8
      IF ( $8 == 1 )
      {
        DO CREATE_MSG_INFORMATION                131
        DO SET_MSG_AUTO_OPEN_DLG
        DO SET_MSG_DELETE_ON_OK
        DO AUTO_MESSAGES                         OFF
        DO TRIGGER_THING                         24
        DO TRIGGER_THING                         25
        DO TRIGGER_THING                         26
        IF ( $9 == 1 )
        {
          DO FLYBY_CREATE_NEW
          DO FLYBY_ALLOW_INTERRUPT                OFF
          DO FLYBY_SET_EVENT_POS                  2 66 2 23
          DO FLYBY_SET_EVENT_ANGLE                1632 1 15
          DO FLYBY_SET_EVENT_ANGLE                296 17 6
          DO FLYBY_SET_END_TARGET                 36 54 1646 0
          DO FLYBY_START
          SET $9                                  2
          DO TRIGGER_LEVEL_LOST
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 64 57
    {
      IF ( $14 == 0 )
      {
        SET $13                                  INT_B_BUILDING_MEDIUM_HUT
        INCREMENT $13 INT_B_BUILDING_SMALL_HUT
        INCREMENT $13 INT_B_BUILDING_LARGE_HUT
        IF ( $9 == 1 && $13 > 2 )
        {
          DO CREATE_MSG_INFORMATION_ZOOM          59 2 226 1164
          SET $14                                 1
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 128 61
    {
      IF ( $15 == 0 )
      {
        IF ( $9 == 1 )
        {
          DO COUNT_PEOPLE_IN_MARKER BLUE 40 4 $16
          IF ( $16 == 0 )
          {
            DO TRIGGER_THING                       41
            SET $15                                1
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 64 55
    {
      IF ( INT_MY_NUM_PEOPLE < 8 && INT_MY_NUM_KILLED_BY_BLUE > 5 )
      {
        SET $10                                  INT_M_BUILDING_SMALL_HUT
        INCREMENT $10 INT_M_BUILDING_MEDIUM_HUT
        INCREMENT $10 INT_M_BUILDING_LARGE_HUT
        IF ( $10 == 0 )
        {
          DO GIVE_UP_AND_SULK                     ON
        }
        ENDIF
      }
      ENDIF
    }
  }
  ENDIF
}
SCRIPT_END
