{
  IF ( INT_GAME_TURN == 0 )
  {
    DO SET_REINCARNATION                       OFF
    DO RESET_BASE_MARKER
    DO SET_BASE_MARKER                         30
    DO SET_BASE_RADIUS                         6
    DO SET_NO_BLUE_REINC
    DO CREATE_MSG_NARRATIVE                    166
    DO SET_MSG_AUTO_OPEN_DLG
    SET $0                                     0
    DO SET_DRUM_TOWER_POS                      70 42
    DO SET_ATTACK_VARIABLE                     $0
    DO STATE_CONSTRUCT_BUILDING                ON
    DO STATE_FETCH_WOOD                        ON
    SET INT_ATTR_ATTACK_PERCENTAGE             80
    SET INT_ATTR_PREF_SPY_TRAINS               1
    SET INT_ATTR_PREF_RELIGIOUS_TRAINS         1
    SET INT_ATTR_PREF_WARRIOR_TRAINS           1
    SET INT_ATTR_PREF_FIREWARRIOR_TRAINS       1
    SET INT_ATTR_PREF_BOAT_HUTS                0
    SET INT_ATTR_PREF_BALLOON_HUTS             0
    SET INT_ATTR_MAX_BUILDINGS_ON_GO           4
    SET INT_ATTR_HOUSE_PERCENTAGE              10
    DO STATE_SHAMAN_GET_WILDS                  ON
    SET INT_ATTR_EXPANSION                     65
    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_FIREWARRIOR_DEFEND                ON
    DO STATE_DEFEND_BASE                       ON
    SET INT_ATTR_DEFENSE_RAD_INCR              2
    SET INT_ATTR_MAX_DEFENSIVE_ACTIONS         2
    SET INT_ATTR_USE_PREACHER_FOR_DEFENCE      1
    DO STATE_PREACH                            ON
    SET INT_ATTR_SHAMEN_BLAST                  0
    DO STATE_SPELL_DEFENCE                     36 54 OFF
    SET INT_ATTR_SPY_CHECK_FREQUENCY           128
    SET INT_ATTR_SPY_DISCOVER_CHANCE           50
    SET INT_ATTR_ENEMY_SPY_MAX_STAND           128
    SET INT_ATTR_RETREAT_VALUE                 20
    SET INT_ATTR_RANDOM_BUILD_SIDE             0
    DO DONT_TARGET_BLUE_SHAMAN
    DO STATE_BUILD_VEHICLE                     ON
    DO STATE_FETCH_LOST_PEOPLE                 ON
    DO STATE_FETCH_LOST_VEHICLE                OFF
    DO STATE_FETCH_FAR_VEHICLE                 ON
    SET INT_ATTR_PEOPLE_PER_BOAT               8
    SET INT_ATTR_PREF_BOAT_DRIVERS             7
    DO STATE_TRAIN_PEOPLE                      ON
    SET INT_ATTR_PREF_SPY_PEOPLE               8
    SET INT_ATTR_PREF_RELIGIOUS_PEOPLE         18
    SET INT_ATTR_PREF_WARRIOR_PEOPLE           18
    SET INT_ATTR_PREF_FIREWARRIOR_PEOPLE       18
    DO SET_MARKER_ENTRY                        1 1 2 0 2 1 1
    DO SET_MARKER_ENTRY                        2 2 3 0 2 1 1
    DO SET_MARKER_ENTRY                        3 4 -1 0 1 0 1
    DO SET_MARKER_ENTRY                        5 10 -1 0 0 3 0
    DO SET_MARKER_ENTRY                        6 11 -1 0 0 3 0
    DO SET_MARKER_ENTRY                        8 7 8 0 2 2 0
    DO SET_MARKER_ENTRY                        9 8 9 0 2 2 0
    DO SET_MARKER_ENTRY                        10 20 24 0 1 1 1
    SET INT_ATTR_MAX_TRAIN_AT_ONCE             10
    SET INT_ATTR_GROUP_OPTION                  2
    DO STATE_AUTO_ATTACK                       ON
    SET INT_ATTR_COUNT_PREACH_DAMAGE           0
    SET INT_ATTR_MAX_ATTACKS                   4
    SET INT_ATTR_AWAY_BRAVE                    0
    SET INT_ATTR_AWAY_WARRIOR                  50
    SET INT_ATTR_AWAY_RELIGIOUS                60
    SET INT_ATTR_AWAY_SPY                      0
    SET INT_ATTR_AWAY_FIREWARRIOR              0
    SET INT_ATTR_AWAY_SHAMAN                   0
    SET INT_ATTR_BASE_UNDER_ATTACK_RETREAT     0
    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
    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                                    1
    SET $35                                    1
    SET $36                                    60
    SET $37                                    1
    SET $38                                    1
  }
  ELSE
  {
    EVERY 256 133
    {
      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
    }
    EVERY 32
    {
      IF ( $1 == 0 )
      {
        DO FLYBY_CREATE_NEW
        DO FLYBY_ALLOW_INTERRUPT                 ON
        DO FLYBY_SET_EVENT_POS                   82 54 1 15
        DO FLYBY_SET_EVENT_POS                   82 54 16 40
        DO FLYBY_SET_EVENT_POS                   6 2 71 40
        DO FLYBY_SET_EVENT_POS                   50 224 121 40
        DO FLYBY_SET_EVENT_POS                   78 198 171 30
        DO FLYBY_SET_EVENT_ANGLE                 1500 1 70
        DO FLYBY_SET_EVENT_ANGLE                 1000 71 35
        DO FLYBY_SET_EVENT_ANGLE                 250 106 25
        DO FLYBY_SET_EVENT_ANGLE                 1250 131 25
        DO FLYBY_SET_EVENT_ANGLE                 1750 156 30
        DO FLYBY_SET_EVENT_ANGLE                 0 186 30
        DO FLYBY_SET_EVENT_ZOOM                  -50 1 40
        DO FLYBY_SET_EVENT_ZOOM                  0 41 19
        DO FLYBY_SET_END_TARGET                  78 198 750 0
        DO FLYBY_START
        SET $1                                   1
      }
      ENDIF
    }
    EVERY 64
    {
      SET $23                                   INT_M_BUILDING_SMALL_HUT
      INCREMENT $23 INT_M_BUILDING_MEDIUM_HUT
      INCREMENT $23 INT_M_BUILDING_LARGE_HUT
      SET $24                                   $23
      INCREMENT $24 INT_M_BUILDING_SMALL_HUT
      INCREMENT $24 INT_M_BUILDING_SMALL_HUT
      INCREMENT $24 INT_M_BUILDING_MEDIUM_HUT
      INCREMENT $24 INT_M_BUILDING_MEDIUM_HUT
      INCREMENT $24 INT_M_BUILDING_MEDIUM_HUT
      INCREMENT $24 INT_M_BUILDING_MEDIUM_HUT
      INCREMENT $24 INT_M_BUILDING_LARGE_HUT
      INCREMENT $24 INT_M_BUILDING_LARGE_HUT
      INCREMENT $24 INT_M_BUILDING_LARGE_HUT
      INCREMENT $24 INT_M_BUILDING_LARGE_HUT
      INCREMENT $24 INT_M_BUILDING_LARGE_HUT
      INCREMENT $24 INT_M_BUILDING_LARGE_HUT
      IF ( INT_ATTR_PREF_RELIGIOUS_TRAINS == 1 && $24 > 40 )
      {
        SET INT_ATTR_PREF_RELIGIOUS_TRAINS       1
      }
      ENDIF
      IF ( INT_ATTR_PREF_FIREWARRIOR_TRAINS == 1 && $24 > 60 )
      {
        SET INT_ATTR_PREF_FIREWARRIOR_TRAINS     1
      }
      ENDIF
      IF ( INT_ATTR_PREF_WARRIOR_TRAINS == 1 && $24 > 60 )
      {
        SET INT_ATTR_PREF_WARRIOR_TRAINS         1
      }
      ENDIF
      IF ( INT_ATTR_PREF_BOAT_HUTS == 0 && $24 > 35 )
      {
        SET INT_ATTR_PREF_BOAT_HUTS              0
      }
      ENDIF
      IF ( INT_ATTR_PREF_SPY_TRAINS == 0 && $24 > 50 )
      {
        SET INT_ATTR_PREF_SPY_TRAINS             1
      }
      ENDIF
      IF ( INT_ATTR_PREF_BALLOON_HUTS == 0 && $24 > 60 )
      {
        SET INT_ATTR_PREF_BALLOON_HUTS           0
      }
      ENDIF
      IF ( $37 == 1 )
      {
        IF ( INT_B_BUILDING_TEMPLE > 0 && INT_ATTR_PREF_RELIGIOUS_TRAINS == 0 )
        {
          SET INT_ATTR_PREF_RELIGIOUS_TRAINS      1
        }
        ENDIF
        IF ( INT_B_BUILDING_WARRIOR_TRAIN > 0 && INT_ATTR_PREF_WARRIOR_TRAINS == 0 )
        {
          SET INT_ATTR_PREF_WARRIOR_TRAINS        1
        }
        ENDIF
        IF ( INT_B_BUILDING_FIREWARRIOR_TRAIN > 0 && INT_ATTR_PREF_FIREWARRIOR_TRAINS == 0 )
        {
          SET INT_ATTR_PREF_FIREWARRIOR_TRAINS    1
        }
        ENDIF
        IF ( INT_B_BUILDING_SPY_TRAIN > 0 && INT_ATTR_PREF_SPY_TRAINS == 0 )
        {
          SET INT_ATTR_PREF_SPY_TRAINS            1
        }
        ENDIF
        IF ( INT_B_BUILDING_AIRSHIP_HUT > 0 && INT_ATTR_PREF_BALLOON_HUTS == 0 )
        {
          SET INT_ATTR_PREF_BALLOON_HUTS          0
        }
        ENDIF
        IF ( INT_B_BUILDING_BOAT_HUT > 0 && INT_ATTR_PREF_BOAT_HUTS == 0 )
        {
          SET INT_ATTR_PREF_BOAT_HUTS             0
        }
        ENDIF
      }
      ENDIF
      IF ( $28 == $35 && INT_ATTR_HOUSE_PERCENTAGE < $36 )
      {
        INCREMENT INT_ATTR_HOUSE_PERCENTAGE $34
        SET $28                                  0
      }
      ELSE
      {
        INCREMENT $28 1
      }
      ENDIF
      IF ( $38 == 1 )
      {
        IF ( $25 < $23 )
        {
          DECREMENT $25 $23
          DECREMENT $36 $25
          IF ( INT_ATTR_HOUSE_PERCENTAGE > $36 )
          {
            SET INT_ATTR_HOUSE_PERCENTAGE          $36
          }
          ENDIF
        }
        ENDIF
        SET $25                                  $23
      }
      ENDIF
      IF ( INT_MY_NUM_PEOPLE > 29 )
      {
        DO STATE_SHAMAN_GET_WILDS                OFF
      }
      ELSE
      {
        IF ( INT_MY_NUM_PEOPLE < 20 )
        {
          DO STATE_SHAMAN_GET_WILDS               ON
        }
        ENDIF
      }
      ENDIF
      IF ( INT_ATTR_EXPANSION < 40 )
      {
        INCREMENT INT_ATTR_EXPANSION 1
      }
      ENDIF
    }
    EVERY 256 8
    {
      IF ( $24 > 30 && INT_CP_FREE_ENTRIES > 1 )
      {
        IF ( INT_M_PERSON_FIREWARRIOR > 5 )
        {
          DO PUT_PERSON_IN_DT INT_RELIGIOUS 54 22
          DO PUT_PERSON_IN_DT INT_FIREWARRIOR 50 28
          DO PUT_PERSON_IN_DT INT_FIREWARRIOR 58 28
        }
        ENDIF
      }
      ENDIF
      IF ( $24 > 45 && INT_CP_FREE_ENTRIES > 1 )
      {
        IF ( INT_M_PERSON_FIREWARRIOR > 5 )
        {
          DO PUT_PERSON_IN_DT INT_FIREWARRIOR 30 32
          DO PUT_PERSON_IN_DT INT_FIREWARRIOR 60 30
          DO PUT_PERSON_IN_DT INT_FIREWARRIOR 84 48
          DO PUT_PERSON_IN_DT INT_FIREWARRIOR 80 48
          DO PUT_PERSON_IN_DT INT_SPY 36 54
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 256 16
    {
      IF ( INT_MY_NUM_PEOPLE > 60 )
      {
        SET INT_ATTR_PREF_RELIGIOUS_PEOPLE       20
        SET INT_ATTR_PREF_WARRIOR_PEOPLE         20
        SET INT_ATTR_PREF_FIREWARRIOR_PEOPLE     20
      }
      ENDIF
      DO COUNT_PEOPLE_IN_MARKER BLUE 12 6 $22
      IF ( $22 > 8 && INT_MY_NUM_PEOPLE < 25 )
      {
        DO TRAIN_PEOPLE_NOW 1 INT_WARRIOR
        DO TRAIN_PEOPLE_NOW 4 INT_RELIGIOUS
        DO TRAIN_PEOPLE_NOW 1 INT_FIREWARRIOR
      }
      ELSE
      {
        IF ( $22 > 8 && INT_MY_NUM_PEOPLE > 25 )
        {
          SET $20                                 1
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 256 16
    {
      IF ( INT_M_PERSON_WARRIOR > 5 )
      {
        IF ( $27 > 2 )
        {
          DO MARKER_ENTRIES                       1 2 3 -1
        }
        ENDIF
      }
      ENDIF
      IF ( INT_M_PERSON_WARRIOR > 14 )
      {
        DO MARKER_ENTRIES                        4 5 6 7
        DO MARKER_ENTRIES                        8 9 10 -1
      }
      ENDIF
      IF ( $7 == 1 )
      {
        DO CLEAR_GUARDING_FROM                   8 9 7 -1
        DO TARGET_BLUE_SHAMAN
      }
      ENDIF
    }
    EVERY 128
    {
      DO COUNT_PEOPLE_IN_MARKER BLUE 20 6 $2
      DO COUNT_PEOPLE_IN_MARKER BLUE 21 6 $3
      DO COUNT_PEOPLE_IN_MARKER BLUE 22 6 $4
      DO COUNT_PEOPLE_IN_MARKER BLUE 23 6 $5
      DO COUNT_PEOPLE_IN_MARKER BLUE 12 6 $6
      IF ( INT_MY_NUM_PEOPLE > 40 && INT_CP_FREE_ENTRIES > 1 )
      {
        IF ( INT_M_PERSON_WARRIOR > 6 && INT_M_PERSON_RELIGIOUS > 6 )
        {
          IF ( INT_M_PERSON_FIREWARRIOR > 6 )
          {
            IF ( $2 > 1 )
            {
              DO ATTACK BLUE 6 ATTACK_MARKER 20 999 INT_BLAST INT_BLAST INT_BLAST ATTACK_NORMAL 0 -1 -1 -1
              SET $2                                0
            }
            ELSE
            {
              IF ( $3 > 1 )
              {
                DO ATTACK BLUE 2 ATTACK_MARKER 21 999 INT_BLAST INT_BLAST INT_BLAST ATTACK_NORMAL 0 -1 -1 -1
                SET $3                               0
              }
              ELSE
              {
                IF ( $4 > 1 )
                {
                  DO ATTACK BLUE 2 ATTACK_MARKER 22 999 INT_BLAST INT_BLAST INT_BLAST ATTACK_NORMAL 0 -1 -1 -1
                  SET $4                              0
                }
                ELSE
                {
                  IF ( $5 > 1 )
                  {
                    DO ATTACK BLUE 2 ATTACK_MARKER 23 999 INT_BLAST INT_BLAST INT_BLAST ATTACK_NORMAL 0 -1 -1 -1
                    SET $5                             0
                  }
                  ELSE
                  {
                    IF ( $6 > 2 )
                    {
                      DO ATTACK BLUE 2 ATTACK_MARKER 12 999 INT_BLAST INT_BLAST INT_BLAST ATTACK_NORMAL 0 -1 -1 -1
                      SET $6                            0
                    }
                    ENDIF
                  }
                  ENDIF
                }
                ENDIF
              }
              ENDIF
            }
            ENDIF
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 1024
    {
      IF ( $19 == 0 )
      {
        DO ATTACK BLUE 2 ATTACK_MARKER 16 991 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 10 -1 -1
        SET $19                                  1
      }
      ENDIF
      IF ( $18 == 0 && INT_CP_FREE_ENTRIES > 1 )
      {
        IF ( INT_M_PERSON_RELIGIOUS > 8 && INT_M_PERSON_FIREWARRIOR > 8 )
        {
          IF ( INT_M_PERSON_WARRIOR > 8 )
          {
            DO SET_ATTACK_VARIABLE                 $0
            DO ATTACK BLUE 6 ATTACK_MARKER 16 991 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 10 -1 -1
            SET INT_ATTR_AWAY_WARRIOR              0
            SET INT_ATTR_AWAY_RELIGIOUS            0
            SET INT_ATTR_AWAY_SPY                  0
            SET INT_ATTR_AWAY_FIREWARRIOR          80
            DO ATTACK BLUE 2 ATTACK_BUILDING INT_NO_SPECIFIC_BUILDING 981 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 14 -1 -1
            SET INT_ATTR_AWAY_WARRIOR              50
            SET INT_ATTR_AWAY_RELIGIOUS            70
            SET INT_ATTR_AWAY_SPY                  0
            SET INT_ATTR_AWAY_FIREWARRIOR          0
            SET $18                                1
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
      IF ( $18 == 1 && $0 != 0 )
      {
        IF ( $0 > 50 )
        {
          SET $18                                 2
        }
        ELSE
        {
          SET $18                                 0
        }
        ENDIF
        SET $0                                   0
      }
      ENDIF
      IF ( $18 == 2 && INT_CP_FREE_ENTRIES > 1 )
      {
        IF ( INT_M_PERSON_RELIGIOUS > 8 && INT_M_PERSON_FIREWARRIOR > 8 )
        {
          IF ( INT_M_PERSON_WARRIOR > 8 )
          {
            DO SET_ATTACK_VARIABLE                 $0
            DO ATTACK BLUE 8 ATTACK_MARKER 16 992 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 15 -1 -1
            SET INT_ATTR_AWAY_WARRIOR              0
            SET INT_ATTR_AWAY_RELIGIOUS            0
            SET INT_ATTR_AWAY_SPY                  0
            SET INT_ATTR_AWAY_FIREWARRIOR          100
            DO ATTACK BLUE 2 ATTACK_BUILDING INT_NO_SPECIFIC_BUILDING 981 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 14 -1 -1
            SET INT_ATTR_AWAY_WARRIOR              50
            SET INT_ATTR_AWAY_RELIGIOUS            50
            SET INT_ATTR_AWAY_SPY                  0
            SET INT_ATTR_AWAY_FIREWARRIOR          0
            SET $18                                3
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
      IF ( $18 == 3 && $0 != 0 )
      {
        IF ( $0 > 50 )
        {
          SET $18                                 4
        }
        ELSE
        {
          SET $18                                 2
        }
        ENDIF
        SET $0                                   0
      }
      ENDIF
      IF ( $18 == 4 && INT_CP_FREE_ENTRIES > 1 )
      {
        IF ( INT_M_PERSON_RELIGIOUS > 8 && INT_M_PERSON_FIREWARRIOR > 8 )
        {
          IF ( INT_M_PERSON_WARRIOR > 8 )
          {
            DO SET_ATTACK_VARIABLE                 $0
            DO ATTACK BLUE 10 ATTACK_MARKER 16 993 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 10 -1 -1
            SET INT_ATTR_AWAY_WARRIOR              0
            SET INT_ATTR_AWAY_RELIGIOUS            0
            SET INT_ATTR_AWAY_SPY                  50
            SET INT_ATTR_AWAY_FIREWARRIOR          50
            DO ATTACK BLUE 4 ATTACK_BUILDING INT_NO_SPECIFIC_BUILDING 981 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 14 -1 -1
            SET INT_ATTR_AWAY_WARRIOR              50
            SET INT_ATTR_AWAY_RELIGIOUS            50
            SET INT_ATTR_AWAY_SPY                  0
            SET INT_ATTR_AWAY_FIREWARRIOR          0
            SET $18                                5
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
      IF ( $18 == 5 && $0 != 0 )
      {
        IF ( $0 > 50 )
        {
          SET $18                                 6
        }
        ELSE
        {
          SET $18                                 4
        }
        ENDIF
        SET $0                                   0
      }
      ENDIF
      IF ( $18 == 6 && INT_CP_FREE_ENTRIES > 1 )
      {
        IF ( INT_M_PERSON_RELIGIOUS > 8 && INT_M_PERSON_FIREWARRIOR > 8 )
        {
          IF ( INT_M_PERSON_WARRIOR > 8 )
          {
            DO SET_ATTACK_VARIABLE                 $0
            DO ATTACK BLUE 8 ATTACK_BUILDING INT_WARRIOR_TRAIN 994 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 14 -1 -1
            DO ATTACK BLUE 12 ATTACK_MARKER 16 994 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 10 -1 -1
            SET $18                                7
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
      IF ( $18 == 7 && $0 != 0 )
      {
        IF ( $0 > 50 )
        {
          SET $18                                 8
        }
        ELSE
        {
          SET $18                                 6
        }
        ENDIF
        SET $0                                   0
      }
      ENDIF
      IF ( $18 == 8 && INT_CP_FREE_ENTRIES > 1 )
      {
        IF ( INT_M_PERSON_RELIGIOUS > 8 && INT_M_PERSON_FIREWARRIOR > 8 )
        {
          IF ( INT_M_PERSON_WARRIOR > 8 )
          {
            DO SET_ATTACK_VARIABLE                 $0
            DO ATTACK BLUE 14 ATTACK_MARKER 16 995 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 1 10 -1 -1
            SET INT_ATTR_AWAY_WARRIOR              0
            SET INT_ATTR_AWAY_RELIGIOUS            0
            SET INT_ATTR_AWAY_SPY                  50
            SET INT_ATTR_AWAY_FIREWARRIOR          50
            DO ATTACK BLUE 4 ATTACK_BUILDING INT_NO_SPECIFIC_BUILDING 981 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 14 -1 -1
            SET INT_ATTR_AWAY_WARRIOR              50
            SET INT_ATTR_AWAY_RELIGIOUS            50
            SET INT_ATTR_AWAY_SPY                  0
            SET INT_ATTR_AWAY_FIREWARRIOR          0
            SET $18                                9
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
      IF ( $18 == 9 && $0 != 0 )
      {
        IF ( $0 > 50 )
        {
          SET $18                                 0
        }
        ELSE
        {
          SET $18                                 8
        }
        ENDIF
        SET $0                                   0
      }
      ENDIF
    }
    EVERY 64 16
    {
      DO IS_SHAMAN_IN_AREA BLUE  52 1 $10
      IF ( $10 != 0 && INT_BLUE_PEOPLE == 1 )
      {
        IF ( $12 == 0 )
        {
          DO TRIGGER_THING                        40
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 32 10
    {
      IF ( $15 == 0 )
      {
        IF ( INT_RED_PEOPLE == 0 && $8 == 1 )
        {
          DO TRIGGER_LEVEL_WON
          SET $15                                 1
        }
        ELSE
        {
          IF ( INT_BLUE_PEOPLE == 0 && $7 == 1 )
          {
            DO TRIGGER_LEVEL_LOST
            SET $15                                1
          }
          ENDIF
        }
        ENDIF
        IF ( INT_RED_PEOPLE < 10 && $8 == 0 )
        {
          IF ( INT_R_PERSON_BRAVE == 0 && INT_R_PERSON_WARRIOR == 0 )
          {
            IF ( INT_R_PERSON_RELIGIOUS == 0 && INT_R_PERSON_SPY == 0 )
            {
              IF ( INT_R_PERSON_FIREWARRIOR == 0 )
              {
                DO TRIGGER_LEVEL_WON
                SET $15                              1
              }
              ENDIF
            }
            ENDIF
          }
          ENDIF
        }
        ELSE
        {
          IF ( INT_BLUE_PEOPLE == 1 && $7 == 0 )
          {
            DO TRIGGER_LEVEL_LOST
            SET $15                                1
          }
          ENDIF
        }
        ENDIF
        IF ( $8 == 1 && INT_R_PERSON_SHAMAN == 0 )
        {
          IF ( INT_RED_PEOPLE != 0 && $29 > 5 )
          {
            DO TRIGGER_THING                       50
            SET $39                                0
          }
          ENDIF
        }
        ENDIF
        IF ( INT_B_PERSON_SHAMAN == 0 )
        {
          DO TRIGGER_LEVEL_LOST
          SET $15                                 1
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 256 33
    {
      IF ( INT_R_PERSON_SHAMAN == 0 && $29 < 6 )
      {
        INCREMENT $29 1
      }
      ENDIF
    }
    EVERY 64 69
    {
      DO IS_SHAMAN_AVAILABLE_FOR_ATTACK         $9
      DO IS_SHAMAN_IN_AREA RED  30 6 $13
      IF ( $13 != 0 && $9 != 0 )
      {
        SET $18                                  10
      }
      ENDIF
    }
    EVERY 512 16
    {
      IF ( $18 == 10 && INT_CP_FREE_ENTRIES > 1 )
      {
        IF ( INT_M_PERSON_RELIGIOUS > 8 && INT_M_PERSON_FIREWARRIOR > 8 )
        {
          IF ( INT_M_PERSON_WARRIOR > 8 )
          {
            DO SET_ATTACK_VARIABLE                 $0
            DO ATTACK BLUE 10 ATTACK_MARKER 16 991 INT_SHIELD INT_FIRESTORM INT_FIRESTORM ATTACK_NORMAL 0 14 -1 -1
            SET INT_ATTR_AWAY_WARRIOR              0
            SET INT_ATTR_AWAY_RELIGIOUS            0
            SET INT_ATTR_AWAY_SPY                  50
            SET INT_ATTR_AWAY_FIREWARRIOR          50
            DO ATTACK BLUE 2 ATTACK_BUILDING INT_NO_SPECIFIC_BUILDING 981 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 14 -1 -1
            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 $18                                11
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
      IF ( $18 == 11 && $0 != 0 )
      {
        IF ( $0 > 50 )
        {
          SET $18                                 12
        }
        ELSE
        {
          SET $18                                 10
        }
        ENDIF
        SET $0                                   0
      }
      ENDIF
      IF ( $18 == 12 && INT_CP_FREE_ENTRIES > 1 )
      {
        IF ( INT_M_PERSON_RELIGIOUS > 8 && INT_M_PERSON_FIREWARRIOR > 8 )
        {
          IF ( INT_M_PERSON_WARRIOR > 8 )
          {
            DO SET_ATTACK_VARIABLE                 $0
            DO ATTACK BLUE 10 ATTACK_BUILDING INT_WARRIOR_TRAIN 992 INT_SHIELD INT_ANGEL_OF_DEATH INT_TORNADO ATTACK_NORMAL 0 2 -1 -1
            SET INT_ATTR_AWAY_WARRIOR              0
            SET INT_ATTR_AWAY_RELIGIOUS            0
            SET INT_ATTR_AWAY_SPY                  50
            SET INT_ATTR_AWAY_FIREWARRIOR          50
            DO ATTACK BLUE 4 ATTACK_BUILDING INT_NO_SPECIFIC_BUILDING 981 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 14 -1 -1
            SET INT_ATTR_AWAY_WARRIOR              50
            SET INT_ATTR_AWAY_RELIGIOUS            60
            SET INT_ATTR_AWAY_SPY                  0
            SET INT_ATTR_AWAY_FIREWARRIOR          0
            SET $18                                13
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
      IF ( $18 == 13 && $0 != 0 )
      {
        IF ( $0 > 50 )
        {
          SET $18                                 14
        }
        ELSE
        {
          SET $18                                 12
        }
        ENDIF
        SET $0                                   0
      }
      ENDIF
      IF ( $18 == 14 && INT_CP_FREE_ENTRIES > 1 )
      {
        IF ( INT_M_PERSON_RELIGIOUS > 8 && INT_M_PERSON_FIREWARRIOR > 8 )
        {
          IF ( INT_M_PERSON_WARRIOR > 8 )
          {
            DO SET_ATTACK_VARIABLE                 $0
            DO ATTACK BLUE 12 ATTACK_BUILDING INT_TEMPLE 993 INT_SHIELD INT_HYPNOTISM INT_HYPNOTISM ATTACK_NORMAL 0 2 -1 -1
            SET INT_ATTR_AWAY_WARRIOR              0
            SET INT_ATTR_AWAY_RELIGIOUS            0
            SET INT_ATTR_AWAY_SPY                  50
            SET INT_ATTR_AWAY_FIREWARRIOR          50
            DO ATTACK BLUE 4 ATTACK_BUILDING INT_NO_SPECIFIC_BUILDING 981 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 14 -1 -1
            SET INT_ATTR_AWAY_WARRIOR              50
            SET INT_ATTR_AWAY_RELIGIOUS            50
            SET INT_ATTR_AWAY_SPY                  0
            SET INT_ATTR_AWAY_FIREWARRIOR          0
            SET $18                                15
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
      IF ( $18 == 15 && $0 != 0 )
      {
        IF ( $0 > 50 )
        {
          SET $18                                 16
        }
        ELSE
        {
          SET $18                                 14
        }
        ENDIF
        SET $0                                   0
      }
      ENDIF
      IF ( $18 == 16 && INT_CP_FREE_ENTRIES > 1 )
      {
        IF ( INT_M_PERSON_RELIGIOUS > 8 && INT_M_PERSON_FIREWARRIOR > 8 )
        {
          IF ( INT_M_PERSON_WARRIOR > 8 )
          {
            DO SET_ATTACK_VARIABLE                 $0
            DO ATTACK BLUE 10 ATTACK_BUILDING INT_WARRIOR_TRAIN 994 INT_HYPNOTISM INT_HYPNOTISM INT_TORNADO ATTACK_NORMAL 0 14 -1 -1
            DO ATTACK BLUE 14 ATTACK_MARKER 16 994 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 2 -1 -1
            SET $18                                17
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
      IF ( $18 == 17 && $0 != 0 )
      {
        IF ( $0 > 50 )
        {
          SET $18                                 18
        }
        ELSE
        {
          SET $18                                 16
        }
        ENDIF
        SET $0                                   0
      }
      ENDIF
      IF ( $18 == 18 && INT_CP_FREE_ENTRIES > 1 )
      {
        IF ( INT_M_PERSON_RELIGIOUS > 8 && INT_M_PERSON_FIREWARRIOR > 8 )
        {
          IF ( INT_M_PERSON_WARRIOR > 8 )
          {
            DO SET_ATTACK_VARIABLE                 $0
            DO ATTACK BLUE 10 ATTACK_BUILDING INT_NO_SPECIFIC_BUILDING 995 INT_SHIELD INT_SHIELD INT_INVISIBILITY ATTACK_NORMAL 1 15 -1 -1
            SET INT_ATTR_AWAY_WARRIOR              0
            SET INT_ATTR_AWAY_RELIGIOUS            0
            SET INT_ATTR_AWAY_SPY                  50
            SET INT_ATTR_AWAY_FIREWARRIOR          50
            DO ATTACK BLUE 4 ATTACK_BUILDING INT_NO_SPECIFIC_BUILDING 981 INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL INT_NO_SPECIFIC_SPELL ATTACK_NORMAL 0 14 -1 -1
            SET INT_ATTR_AWAY_WARRIOR              50
            SET INT_ATTR_AWAY_RELIGIOUS            60
            SET INT_ATTR_AWAY_SPY                  0
            SET INT_ATTR_AWAY_FIREWARRIOR          0
            SET $18                                19
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
      IF ( $18 == 19 && $0 != 0 )
      {
        IF ( $0 > 50 )
        {
          SET $18                                 10
        }
        ELSE
        {
          SET $18                                 18
        }
        ENDIF
        SET $0                                   0
      }
      ENDIF
    }
    EVERY 256
    {
      IF ( $16 == 0 )
      {
        DO PUT_PERSON_IN_DT INT_R_PERSON_SHAMAN 70 42
      }
      ENDIF
      IF ( $16 == 0 && $8 == 1 )
      {
        SET $16                                  1
      }
      ELSE
      {
        IF ( $16 == 1 && $8 == 1 )
        {
          DO STATE_SPELL_DEFENCE                  36 34 ON
          SET $16                                 2
        }
        ELSE
        {
          IF ( $16 == 2 && $8 == 1 )
          {
            DO STATE_SPELL_DEFENCE                 30 32 ON
            SET $16                                3
          }
          ELSE
          {
            IF ( $16 == 3 && $8 == 1 )
            {
              DO STATE_SPELL_DEFENCE                70 42 ON
              SET $16                               1
            }
            ENDIF
          }
          ENDIF
        }
        ENDIF
      }
      ENDIF
    }
    EVERY 32
    {
      IF ( $11 == 0 )
      {
        DO IS_SHAMAN_IN_AREA BLUE  52 1 $17
        IF ( $17 == 0 )
        {
          SET $7                                  1
          DO CREATE_MSG_INFORMATION               167
          SET $11                                 1
        }
        ENDIF
      }
      ENDIF
      IF ( $12 == 0 )
      {
        DO STATE_SPELL_DEFENCE                   70 42 ON
        DO IS_SHAMAN_IN_AREA RED  16 1 $14
        IF ( $14 == 0 )
        {
          DO STATE_SPELL_DEFENCE                  70 42 ON
          DO SET_SPELL_ENTRY 0 INT_SWARM INT_M_SPELL_SWARM_COST 128 2 1
          DO SET_SPELL_ENTRY 1 INT_SWARM INT_M_SPELL_SWARM_COST 128 2 1
          DO GIVE_MANA_TO_PLAYER RED 1000000
          DO DEFEND_SHAMEN                        10
          DO GIVE_ONE_SHOT INT_VOLCANO RED
          DO GIVE_ONE_SHOT INT_FIRESTORM RED
          SET INT_ATTR_AWAY_SHAMAN                100
          SET INT_ATTR_SHAMEN_BLAST               64
          SET $8                                  1
          DO TRIGGER_THING                        53
          SET $14                                 100
          SET $12                                 1
        }
        ENDIF
      }
      ENDIF
    }
  }
  ENDIF
}
SCRIPT_END
