{
  IF ( INT_GAME_TURN == 0 )
  {
    DO SET_REINCARNATION                       OFF
    DO SET_NO_BLUE_REINC
    DO SET_DRUM_TOWER_POS                      56 30
    SET $0                                     0
    DO SET_ATTACK_VARIABLE                     $0
    DO STATE_STATE_BRING_NEW_PEOPLE_BACK       ON
    DO STATE_TRAIN_PEOPLE                      ON
    DO STATE_SHAMAN_GET_WILDS                  OFF
    DO STATE_CONSTRUCT_BUILDING                ON
    DO STATE_FETCH_WOOD                        ON
    DO STATE_SEND_GHOSTS                       OFF
    DO STATE_FETCH_LOST_PEOPLE                 ON
    DO STATE_FETCH_FAR_VEHICLE                 OFF
    DO STATE_FETCH_LOST_VEHICLE                OFF
    SET INT_ATTR_PREF_BOAT_DRIVERS             0
    DO SET_TIMER_GOING                         450
    SET INT_ATTR_SHAMEN_BLAST                  128
    SET INT_ATTR_MAX_TRAIN_AT_ONCE             5
    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              15
    SET INT_ATTR_EXPANSION                     8
    DO STATE_POPULATE_DRUM_TOWER               ON
    DO GIVE_ONE_SHOT INT_SHIELD YELLOW
    DO GIVE_ONE_SHOT INT_LIGHTNING YELLOW
    DO STATE_DEFEND                            OFF
    DO STATE_DEFEND_BASE                       ON
    SET INT_ATTR_DEFENSE_RAD_INCR              2
    SET INT_ATTR_MAX_DEFENSIVE_ACTIONS         0
    SET INT_ATTR_ATTACK_PERCENTAGE             45
    DO STATE_SPELL_DEFENCE                     56 30 ON
    DO SET_SPELL_ENTRY 0 INT_BLAST INT_M_SPELL_BLAST_COST 512 6 0
    DO STATE_HOUSE_A_PERSON                    ON
    DO STATE_AUTO_ATTACK                       ON
    SET INT_ATTR_MAX_ATTACKS                   1
    SET INT_ATTR_AWAY_BRAVE                    0
    SET INT_ATTR_AWAY_WARRIOR                  33
    SET INT_ATTR_AWAY_RELIGIOUS                33
    SET INT_ATTR_AWAY_SPY                      10
    SET INT_ATTR_AWAY_FIREWARRIOR              33
    SET INT_ATTR_AWAY_SHAMAN                   1
    SET INT_ATTR_RETREAT_VALUE                 50
    SET INT_ATTR_SPY_CHECK_FREQUENCY           128
    SET INT_ATTR_SPY_DISCOVER_CHANCE           5
    SET INT_ATTR_ENEMY_SPY_MAX_STAND           128
    DO SET_MARKER_ENTRY                        0 0 -1 0 4 0 1
    DO SET_MARKER_ENTRY                        1 1 -1 0 4 0 1
    DO SET_MARKER_ENTRY                        2 3 4 0 3 0 0
    DO SET_MARKER_ENTRY                        3 2 3 0 3 0 0
    DO SET_MARKER_ENTRY                        4 3 -1 0 0 0 1
    DO SET_MARKER_ENTRY                        5 2 -1 0 0 0 1
    DO SET_MARKER_ENTRY                        6 4 -1 0 0 0 1
    DO SET_MARKER_ENTRY                        7 7 -1 0 0 0 1
    DO SET_MARKER_ENTRY                        8 2 7 0 2 0 0
    DO SET_MARKER_ENTRY                        9 7 4 0 2 0 0
    DO MARKER_ENTRIES                          2 3 4 7
    DO MARKER_ENTRIES                          0 1 5 6
    DO MARKER_ENTRIES                          8 9 -1 -1
    DO CREATE_MSG_NARRATIVE                    148
    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                                    1
  }
  ELSE
  {
    EVERY 256 133
    {
      IF ( INT_MY_NUM_PEOPLE < 80 )
      {
        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_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_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
    }
    EVERY 64
    {
      DO MARKER_ENTRIES                         0 1 -1 -1
    }
    EVERY 128 33
    {
      IF ( $2 < 8 )
      {
        DO MARKER_ENTRIES                        2 3 4 5
        DO MARKER_ENTRIES                        6 7 8 9
        INCREMENT $2 1
      }
      ENDIF
    }
    EVERY 256 100
    {
      IF ( INT_MY_MANA > INT_M_SPELL_SHIELD_COST )
      {
        IF ( $1 == 0 )
        {
          DO SPELL_ATTACK INT_SHIELD 0 -1
          SET $1                                  1
          DO GIVE_ONE_SHOT INT_SHIELD YELLOW
        }
        ELSE
        {
          IF ( $1 == 1 )
          {
            DO SPELL_ATTACK INT_SHIELD 1 -1
            SET $1                                 0
            DO GIVE_ONE_SHOT INT_SHIELD YELLOW
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 16 35
    {
      IF ( $10 == 1 && INT_B_PERSON_SHAMAN == 1 )
      {
        DO HAS_TIMER_REACHED_ZERO                $4
        IF ( $4 == 1 )
        {
          DO DISABLE_USER_INPUTS
          SET INT_ATTR_AWAY_SHAMAN                100
          DO SPELL_ATTACK INT_LIGHTNING 8 0
          IF ( $9 == 0 )
          {
            DO FLYBY_CREATE_NEW
            DO FLYBY_ALLOW_INTERRUPT               OFF
            DO FLYBY_SET_EVENT_POS                 116 18 1 60
            DO FLYBY_SET_EVENT_ANGLE               1534 5 59
            DO FLYBY_SET_END_TARGET                116 18 1534 0
            DO FLYBY_START
            SET $9                                 1
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 16 23
    {
      IF ( INT_B_PERSON_SHAMAN == 0 )
      {
        DO TRIGGER_LEVEL_LOST
      }
      ENDIF
    }
    EVERY 16 11
    {
      IF ( $6 == 0 )
      {
        DO GET_SPELLS_CAST BLUE INT_VOLCANO $5
        IF ( $5 > 0 )
        {
          DO TRIGGER_THING                        20
          SET $6                                  1
          DO CLEAR_GUARDING_FROM                  2 3 4 5
          DO CLEAR_GUARDING_FROM                  6 7 8 9
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 8
    {
      IF ( INT_GAME_TURN > 5 )
      {
        IF ( $7 == 0 )
        {
          SET $7                                  1
          DO FLYBY_CREATE_NEW
          DO FLYBY_ALLOW_INTERRUPT                ON
          DO FLYBY_SET_EVENT_POS                  208 24 30 50
          DO FLYBY_SET_EVENT_POS                  248 24 80 20
          DO FLYBY_SET_EVENT_POS                  208 22 105 20
          DO FLYBY_SET_EVENT_ANGLE                1031 4 20
          DO FLYBY_SET_EVENT_ANGLE                1546 25 10
          DO FLYBY_SET_EVENT_ANGLE                407 95 25
          DO FLYBY_SET_EVENT_ZOOM                 100 1 15
          DO FLYBY_SET_EVENT_ZOOM                 -80 20 20
          DO FLYBY_SET_EVENT_ZOOM                 0 50 15
          DO FLYBY_SET_EVENT_ZOOM                 -50 90 20
          DO FLYBY_SET_EVENT_ZOOM                 0 115 10
          DO FLYBY_SET_END_TARGET                 238 22 407 0
          DO FLYBY_START
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 16 1
    {
      IF ( $10 == 1 )
      {
        DO IS_PRISON_ON_LEVEL $10
        IF ( $10 == 0 )
        {
          DO REMOVE_TIMER
          DO CLEAR_GUARDING_FROM                  2 3 4 7
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 64 55
    {
      IF ( INT_MY_NUM_PEOPLE < 8 && INT_MY_NUM_KILLED_BY_BLUE > 5 )
      {
        DO GIVE_UP_AND_SULK                      ON
      }
      ENDIF
    }
  }
  ENDIF
}
SCRIPT_END
