{
  IF ( INT_GAME_TURN == 0 )
  {
    SET $0                                     0
    DO SET_ATTACK_VARIABLE                     $0
    DO STATE_STATE_BRING_NEW_PEOPLE_BACK       ON
    DO STATE_SHAMAN_GET_WILDS                  ON
    DO STATE_CONSTRUCT_BUILDING                ON
    DO DELAY_MAIN_DRUM_TOWER
    DO SET_DRUM_TOWER_POS                      230 46
    DO STATE_SPELL_DEFENCE                     230 46 ON
    DO SET_SPELL_ENTRY 0 INT_LIGHTNING INT_M_SPELL_TORNADO_COST 64 6 0
    DO SET_SPELL_ENTRY 1 INT_SWARM INT_M_SPELL_SWARM_COST 64 2 1
    DO SET_DEFENCE_RADIUS                      7
    DO STATE_FETCH_WOOD                        ON
    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           2
    SET INT_ATTR_HOUSE_PERCENTAGE              10
    SET INT_ATTR_EXPANSION                     28
    DO STATE_POPULATE_DRUM_TOWER               ON
    DO STATE_HOUSE_A_PERSON                    ON
    SET INT_ATTR_SPY_DISCOVER_CHANCE           20
    SET INT_ATTR_SPY_CHECK_FREQUENCY           128
    SET INT_ATTR_ENEMY_SPY_MAX_STAND           255
    SET INT_ATTR_SHAMEN_BLAST                  128
    SET INT_ATTR_RETREAT_VALUE                 25
    SET INT_ATTR_BASE_UNDER_ATTACK_RETREAT     1
    SET INT_ATTR_RANDOM_BUILD_SIDE             1
    SET INT_ATTR_MAX_TRAIN_AT_ONCE             5
    SET INT_ATTR_GROUP_OPTION                  0
    DO STATE_DEFEND                            ON
    DO STATE_DEFEND_BASE                       ON
    SET INT_ATTR_DEFENSE_RAD_INCR              2
    SET INT_ATTR_MAX_DEFENSIVE_ACTIONS         2
    SET INT_ATTR_ATTACK_PERCENTAGE             90
    SET INT_ATTR_USE_PREACHER_FOR_DEFENCE      1
    DO STATE_PREACH                            ON
    DO STATE_FIREWARRIOR_DEFEND                ON
    DO STATE_TRAIN_PEOPLE                      ON
    SET INT_ATTR_PREF_WARRIOR_PEOPLE           18
    SET INT_ATTR_PREF_FIREWARRIOR_PEOPLE       33
    SET INT_ATTR_PREF_RELIGIOUS_PEOPLE         12
    DO SET_MARKER_ENTRY                        0 28 29 0 4 0 0
    DO SET_MARKER_ENTRY                        1 35 36 0 2 0 0
    DO SET_MARKER_ENTRY                        2 37 -1 0 0 0 1
    DO STATE_AUTO_ATTACK                       ON
    SET INT_ATTR_MAX_ATTACKS                   2
    SET INT_ATTR_AWAY_BRAVE                    0
    SET INT_ATTR_AWAY_WARRIOR                  35
    SET INT_ATTR_AWAY_RELIGIOUS                10
    SET INT_ATTR_AWAY_SPY                      0
    SET INT_ATTR_AWAY_FIREWARRIOR              55
    SET INT_ATTR_AWAY_SHAMAN                   0
    DO CREATE_MSG_NARRATIVE                    52
    DO SET_MSG_AUTO_OPEN_DLG
    DO TARGET_FIREWARRIORS
    DO TARGET_BLUE_SHAMAN
    DO TARGET_BLUE_DRUM_TOWERS
    SET $1                                     0
    SET $2                                     0
    SET $3                                     0
    SET $4                                     4
    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
    SET $17                                    0
    SET $18                                    0
    SET $19                                    0
    SET $20                                    0
    SET $21                                    0
    SET $22                                    0
    SET $23                                    0
    SET $24                                    0
    SET $25                                    0
    SET $26                                    0
    SET $27                                    0
    SET $28                                    0
    SET $29                                    0
    SET $30                                    0
    SET $31                                    0
    SET $32                                    0
    SET $33                                    0
    SET $34                                    0
    SET $35                                    0
    SET $36                                    0
    SET $37                                    0
    SET $38                                    INT_M_SPELL_TORNADO_COST
    INCREMENT $38 INT_M_SPELL_TORNADO_COST
  }
  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_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
    }
    EVERY 8
    {
      IF ( INT_GAME_TURN > 5 )
      {
        IF ( $32 == 0 )
        {
          SET $32                                 1
          DO FLYBY_CREATE_NEW
          DO FLYBY_ALLOW_INTERRUPT                ON
          DO FLYBY_SET_EVENT_POS                  218 16 2 55
          DO FLYBY_SET_EVENT_POS                  194 14 58 22
          DO FLYBY_SET_EVENT_POS                  246 24 81 28
          DO FLYBY_SET_EVENT_POS                  204 168 110 65
          DO FLYBY_SET_EVENT_ANGLE                8 3 8
          DO FLYBY_SET_EVENT_ANGLE                1185 53 30
          DO FLYBY_SET_EVENT_ANGLE                825 86 20
          DO FLYBY_SET_EVENT_ANGLE                2033 140 30
          DO FLYBY_SET_EVENT_ZOOM                 -50 1 55
          DO FLYBY_SET_EVENT_ZOOM                 50 57 28
          DO FLYBY_SET_EVENT_ZOOM                 -70 88 57
          DO FLYBY_SET_EVENT_ZOOM                 0 146 28
          DO FLYBY_SET_END_TARGET                 204 168 2033 0
          DO FLYBY_START
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 512 33
    {
      IF ( $31 < 10 )
      {
        DO MARKER_ENTRIES                        0 1 2 -1
        INCREMENT $31 1
      }
      ENDIF
    }
    EVERY 256
    {
      SET $39                                   INT_MY_NUM_PEOPLE
      DECREMENT $39 INT_BLUE_PEOPLE
      IF ( $39 > 4 )
      {
        SET $39                                  4
      }
      ENDIF
    }
    EVERY 512
    {
      IF ( INT_MY_NUM_PEOPLE < 13 )
      {
        SET INT_ATTR_MAX_BUILDINGS_ON_GO         2
      }
      ELSE
      {
        SET INT_ATTR_MAX_BUILDINGS_ON_GO         3
      }
      ENDIF
      IF ( INT_M_BUILDING_SMALL_HUT > 1 )
      {
        SET INT_ATTR_PREF_SPY_TRAINS             0
        SET INT_ATTR_PREF_WARRIOR_TRAINS         0
        SET INT_ATTR_PREF_FIREWARRIOR_TRAINS     1
        SET INT_ATTR_PREF_RELIGIOUS_TRAINS       0
        SET INT_ATTR_PREF_BOAT_HUTS              0
        SET INT_ATTR_PREF_BALLOON_HUTS           0
        IF ( $23 == 0 )
        {
          DO BUILD_MAIN_DRUM_TOWER
          DO SET_DRUM_TOWER_POS                   230 46
          SET $40                                 1
        }
        ELSE
        {
          DO STATE_SPELL_DEFENCE                  230 46 ON
          DO SET_SPELL_ENTRY 0 INT_LIGHTNING INT_M_SPELL_TORNADO_COST 64 6 0
          DO SET_SPELL_ENTRY 1 INT_SWARM INT_M_SPELL_SWARM_COST 64 2 1
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 512 40
    {
      IF ( INT_M_BUILDING_FIREWARRIOR_TRAIN > 0 )
      {
        SET INT_ATTR_PREF_SPY_TRAINS             0
        SET INT_ATTR_PREF_WARRIOR_TRAINS         0
        SET INT_ATTR_PREF_FIREWARRIOR_TRAINS     1
        SET INT_ATTR_PREF_RELIGIOUS_TRAINS       1
        SET INT_ATTR_PREF_BOAT_HUTS              0
        SET INT_ATTR_PREF_BALLOON_HUTS           0
        IF ( INT_CP_FREE_ENTRIES < 9 )
        {
          IF ( $9 == 0 )
          {
            DO BUILD_DRUM_TOWER                    222 10
            INCREMENT $9 1
          }
          ELSE
          {
            DO PREACH_AT_MARKER                    28
          }
          ENDIF
        }
        ENDIF
        IF ( INT_CP_FREE_ENTRIES < 9 )
        {
          IF ( $10 == 0 )
          {
            DO BUILD_DRUM_TOWER                    212 10
            INCREMENT $10 1
          }
          ELSE
          {
            DO PREACH_AT_MARKER                    29
          }
          ENDIF
        }
        ENDIF
        IF ( INT_M_PERSON_WARRIOR > 0 )
        {
          DO SET_MARKER_ENTRY                     1 28 29 0 7 4 0
          DO SET_MARKER_ENTRY                     2 10 11 0 4 0 0
          DO SET_MARKER_ENTRY                     3 10 12 0 4 0 0
          IF ( $10 != 0 && $9 != 0 )
          {
            IF ( INT_CP_FREE_ENTRIES < 4 )
            {
              IF ( $16 == 0 )
              {
                DO MARKER_ENTRIES                    1 2 3 -1
                DO PREACH_AT_MARKER                  7
                DO PREACH_AT_MARKER                  8
                DO PREACH_AT_MARKER                  9
                DO BUILD_DRUM_TOWER                  198 72
                DO PREACH_AT_MARKER                  10
                SET $16                              1
              }
              ENDIF
            }
            ENDIF
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 512 80
    {
      IF ( INT_M_BUILDING_TEMPLE > 0 )
      {
        SET INT_ATTR_PREF_SPY_TRAINS             0
        SET INT_ATTR_PREF_WARRIOR_TRAINS         1
        SET INT_ATTR_PREF_FIREWARRIOR_TRAINS     1
        SET INT_ATTR_PREF_RELIGIOUS_TRAINS       1
        SET INT_ATTR_PREF_BOAT_HUTS              0
        SET INT_ATTR_PREF_BALLOON_HUTS           0
      }
      ENDIF
    }
    EVERY 512 120
    {
      IF ( INT_M_PERSON_FIREWARRIOR > 4 && INT_B_BUILDING_WARRIOR_TRAIN > 0 )
      {
        IF ( $3 < 3 )
        {
          DO SET_ATTACK_VARIABLE                  $0
          DO ATTACK BLUE $4 ATTACK_BUILDING INT_WARRIOR_TRAIN 100 INT_LIGHTNING INT_BLAST INT_BLAST ATTACK_NORMAL 0 -1 -1 -1
          INCREMENT $3 1
          INCREMENT $4 1
          INCREMENT $30 1
        }
        ENDIF
        IF ( $0 != 0 && $3 < 3 )
        {
          IF ( $0 > 50 )
          {
            INCREMENT $3 1
          }
          ELSE
          {
            DECREMENT $3 1
          }
          ENDIF
          SET $0                                  0
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 512 160
    {
      IF ( $29 == 0 )
      {
        SET $41                                  INT_M_BUILDING_SMALL_HUT
        INCREMENT $41 INT_M_BUILDING_MEDIUM_HUT
        INCREMENT $41 INT_M_BUILDING_LARGE_HUT
        IF ( INT_MY_NUM_PEOPLE > 10 && INT_MY_NUM_PEOPLE < 15 )
        {
          SET INT_ATTR_HOUSE_PERCENTAGE           15
        }
        ELSE
        {
          IF ( INT_MY_NUM_PEOPLE > 14 && INT_MY_NUM_PEOPLE < 26 )
          {
            IF ( $41 > 2 )
            {
              SET INT_ATTR_HOUSE_PERCENTAGE         25
            }
            ENDIF
          }
          ELSE
          {
            IF ( INT_MY_NUM_PEOPLE > 25 && INT_MY_NUM_PEOPLE < 39 )
            {
              IF ( $41 > 4 )
              {
                SET INT_ATTR_HOUSE_PERCENTAGE        30
              }
              ENDIF
            }
            ELSE
            {
              IF ( INT_MY_NUM_PEOPLE > 38 && INT_M_BUILDING_LARGE_HUT > 3 )
              {
                IF ( $41 > 5 )
                {
                  SET INT_ATTR_HOUSE_PERCENTAGE       10
                  SET $29                             1
                }
                ENDIF
              }
              ENDIF
            }
            ENDIF
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 128 200
    {
      IF ( INT_MY_MANA > $38 )
      {
        DO GET_SPELLS_CAST BLUE INT_LAND_BRIDGE $28
        IF ( $28 > 0 )
        {
          DO GET_HEIGHT_AT_POS                    30 $27
          IF ( $27 < 350 )
          {
            SET INT_ATTR_AWAY_SHAMAN               0
          }
          ENDIF
        }
        ELSE
        {
          SET INT_ATTR_AWAY_SHAMAN                1
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 128 266
    {
      IF ( $30 > 2 )
      {
        SET INT_ATTR_AWAY_SHAMAN                 1
      }
      ELSE
      {
        SET INT_ATTR_AWAY_SHAMAN                 0
      }
      ENDIF
    }
    EVERY 512 240
    {
      IF ( INT_B_BUILDING_DRUM_TOWER > 1 )
      {
        DO I_HAVE_ONE_SHOT SPELL_TYPE INT_TORNADO $14
        IF ( $14 > 0 )
        {
          IF ( $39 > 2 )
          {
            DO ATTACK BLUE $39 ATTACK_BUILDING INT_DRUM_TOWER 50 INT_TORNADO INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 -1 -1 -1
            INCREMENT $30 1
          }
          ENDIF
        }
        ELSE
        {
          IF ( $39 > 2 )
          {
            DO ATTACK BLUE $39 ATTACK_BUILDING INT_DRUM_TOWER 50 INT_LIGHTNING INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 -1 -1 -1
            INCREMENT $30 1
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 512 280
    {
      IF ( INT_M_PERSON_FIREWARRIOR > 7 && INT_MY_NUM_PEOPLE > 25 )
      {
        IF ( $11 < 3 )
        {
          DO I_HAVE_ONE_SHOT SPELL_TYPE INT_TORNADO $15
          IF ( $15 > 0 )
          {
            IF ( $39 > 2 )
            {
              DO SET_ATTACK_VARIABLE                $0
              SET INT_ATTR_AWAY_SHAMAN              1
              DO ATTACK BLUE $39 ATTACK_BUILDING INT_NO_SPECIFIC_BUILDING 900 INT_TORNADO INT_LIGHTNING INT_BLAST ATTACK_NORMAL 0 -1 -1 -1
              INCREMENT $30 1
              SET INT_ATTR_AWAY_SHAMAN              0
            }
            ENDIF
          }
          ELSE
          {
            IF ( $39 > 2 )
            {
              DO SET_ATTACK_VARIABLE                $0
              SET INT_ATTR_AWAY_SHAMAN              1
              DO ATTACK BLUE $39 ATTACK_BUILDING INT_NO_SPECIFIC_BUILDING 900 INT_LIGHTNING INT_LIGHTNING INT_BLAST ATTACK_NORMAL 0 -1 -1 -1
              INCREMENT $30 1
              SET INT_ATTR_AWAY_SHAMAN              0
            }
            ENDIF
          }
          ENDIF
        }
        ENDIF
        IF ( $0 != 0 && $11 < 3 )
        {
          IF ( $0 > 50 )
          {
            INCREMENT $11 1
          }
          ELSE
          {
            DECREMENT $11 1
          }
          ENDIF
          SET $0                                  0
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 512 360
    {
      IF ( INT_B_BUILDING_SPY_TRAIN > 0 )
      {
        DO I_HAVE_ONE_SHOT SPELL_TYPE INT_TORNADO $13
        IF ( $13 > 0 )
        {
          IF ( $39 > 2 )
          {
            SET INT_ATTR_AWAY_SHAMAN               1
            DO ATTACK BLUE $39 ATTACK_BUILDING INT_SPY_TRAIN 50 INT_TORNADO INT_LIGHTNING INT_BLAST ATTACK_NORMAL 0 -1 -1 -1
            INCREMENT $30 1
            SET INT_ATTR_AWAY_SHAMAN               0
          }
          ENDIF
        }
        ELSE
        {
          IF ( $39 > 2 )
          {
            SET INT_ATTR_AWAY_SHAMAN               1
            DO ATTACK BLUE $39 ATTACK_BUILDING INT_SPY_TRAIN 50 INT_LIGHTNING INT_LIGHTNING INT_BLAST ATTACK_NORMAL 0 -1 -1 -1
            INCREMENT $30 1
            SET INT_ATTR_AWAY_SHAMAN               0
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 256 23
    {
      IF ( INT_M_PERSON_FIREWARRIOR > 3 && $22 < 3 )
      {
        DO COUNT_PEOPLE_IN_MARKER BLUE 3 4 $1
        IF ( $1 > 3 )
        {
          DO ATTACK BLUE $1 ATTACK_MARKER 3 70 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 -1 -1 -1
          INCREMENT $30 1
          INCREMENT $22 1
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 256 46
    {
      IF ( INT_M_PERSON_FIREWARRIOR > 3 && $21 < 3 )
      {
        DO COUNT_PEOPLE_IN_MARKER BLUE 4 4 $2
        IF ( $2 > 3 )
        {
          DO ATTACK BLUE $2 ATTACK_MARKER 4 70 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 -1 -1 -1
          INCREMENT $30 1
          INCREMENT $21 1
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 256 88
    {
      IF ( $20 < 3 )
      {
        DO COUNT_PEOPLE_IN_MARKER BLUE 13 7 $12
        IF ( $12 > 5 )
        {
          IF ( INT_MY_MANA > INT_M_SPELL_LIGHTNING_COST )
          {
            SET INT_ATTR_AWAY_SHAMAN               1
            INCREMENT $12 2
            DO ATTACK BLUE $12 ATTACK_MARKER 13 25 INT_LIGHTNING INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 -1 -1 -1
            INCREMENT $30 1
            SET INT_ATTR_AWAY_SHAMAN               0
            INCREMENT $20 1
          }
          ELSE
          {
            INCREMENT $12 3
            DO ATTACK BLUE $12 ATTACK_MARKER 13 25 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 -1 -1 -1
            INCREMENT $30 1
            INCREMENT $20 1
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 1024 3
    {
      DO GET_SPELLS_CAST BLUE INT_LAND_BRIDGE $25
      IF ( $25 > 0 )
      {
        DO GET_HEIGHT_AT_POS                     30 $24
        IF ( $24 > 350 )
        {
          IF ( INT_MY_MANA > INT_M_SPELL_LAND_BRIDGE_COST && INT_CP_FREE_ENTRIES > 2 )
          {
            IF ( $26 == 0 )
            {
              SET INT_ATTR_AWAY_BRAVE               0
              SET INT_ATTR_AWAY_WARRIOR             0
              SET INT_ATTR_AWAY_RELIGIOUS           0
              SET INT_ATTR_AWAY_SPY                 0
              SET INT_ATTR_AWAY_FIREWARRIOR         100
              SET INT_ATTR_AWAY_SHAMAN              1
              DO ATTACK BLUE 6 ATTACK_BUILDING INT_NO_SPECIFIC_BUILDING 99 INT_LAND_BRIDGE INT_LIGHTNING INT_BLAST ATTACK_NORMAL -1 31 32 0
              INCREMENT $30 1
              SET $26                               1
              SET INT_ATTR_AWAY_BRAVE               0
              SET INT_ATTR_AWAY_WARRIOR             35
              SET INT_ATTR_AWAY_RELIGIOUS           8
              SET INT_ATTR_AWAY_SPY                 0
              SET INT_ATTR_AWAY_FIREWARRIOR         55
              SET INT_ATTR_AWAY_SHAMAN              0
            }
            ELSE
            {
              IF ( $26 == 1 )
              {
                SET INT_ATTR_AWAY_BRAVE              0
                SET INT_ATTR_AWAY_WARRIOR            0
                SET INT_ATTR_AWAY_RELIGIOUS          0
                SET INT_ATTR_AWAY_SPY                0
                SET INT_ATTR_AWAY_FIREWARRIOR        100
                SET INT_ATTR_AWAY_SHAMAN             1
                DO ATTACK BLUE 6 ATTACK_BUILDING INT_NO_SPECIFIC_BUILDING 99 INT_LAND_BRIDGE INT_LIGHTNING INT_BLAST ATTACK_NORMAL -1 33 34 0
                SET $26                              2
                SET INT_ATTR_AWAY_BRAVE              0
                SET INT_ATTR_AWAY_WARRIOR            35
                SET INT_ATTR_AWAY_RELIGIOUS          8
                SET INT_ATTR_AWAY_SPY                0
                SET INT_ATTR_AWAY_FIREWARRIOR        55
                SET INT_ATTR_AWAY_SHAMAN             0
              }
              ENDIF
            }
            ENDIF
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 128 120
    {
      IF ( INT_B_BUILDING_TEMPLE > 0 )
      {
        SET INT_ATTR_PREF_RELIGIOUS_TRAINS       1
      }
      ENDIF
    }
    EVERY 64 55
    {
      IF ( INT_MY_NUM_PEOPLE < 8 && INT_MY_NUM_KILLED_BY_BLUE > 5 )
      {
        SET $42                                  INT_M_BUILDING_SMALL_HUT
        INCREMENT $42 INT_M_BUILDING_MEDIUM_HUT
        INCREMENT $42 INT_M_BUILDING_LARGE_HUT
        IF ( $42 == 0 )
        {
          DO GIVE_UP_AND_SULK                     ON
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 256 37
    {
      IF ( INT_B_PERSON_RELIGIOUS > 7 && $35 == 0 )
      {
        DO GET_HEAD_TRIGGER_COUNT 200 128 $34
        IF ( $34 < 4 )
        {
          SET $33                                 1
          DO CREATE_MSG_INFORMATION               53
          SET $35                                 1
          SET $33                                 0
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 256 57
    {
      DO GET_HEIGHT_AT_POS                      30 $24
      IF ( $24 < 350 )
      {
        IF ( $36 == 0 && INT_MY_NUM_KILLED_BY_BLUE > 5 )
        {
          DIVIDE $37 INT_MY_NUM_KILLED_BY_BLUE 2
          INCREMENT $37 INT_MY_NUM_KILLED_BY_BLUE
          IF ( INT_RED_KILLED_BY_ME > $37 )
          {
            SET $33                                1
            DO CREATE_MSG_INFORMATION              146
            SET $36                                1
            SET $33                                0
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
    }
  }
  ENDIF
}
SCRIPT_END
