<?xml version="1.0" encoding="windows-1251"?>

<quests>

  <!-- //////////////////// afterparty //////////////////// -->
  <afterparty enabled_sub_quests="c1">

    <enable_condition>
      <have_mark mark="win" />
    </enable_condition>

    <sub_quests>

      <!-- c1 -->
      <c1 holder="farmer">
        <dialog>
          <phrase
            talker="farmer"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="farmer"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="farmer"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <enable_sub_quest name="c1w" />
          <disable_sub_quest name="c1" />
          <add_quest person="farmer" quest_name="afterparty" />
          <add_task_count count="30" item="p_bell_1" quest_name="afterparty" />
        </actions>
      </c1>

      <!-- c1w -->
      <c1w holder="farmer">
        <dialog>
          <question
            talker="farmer"
          >
            <answer>
              <active_if>
                <have_items count="30" name="p_bell_1" />
              </active_if>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <remove_items count="30" name="p_bell_1" />
                <disable_sub_quest name="c1w" />
                <enable_sub_quest name="c2" />
                <remove_all_task quest_name="afterparty" />
                <add_task item="talk" quest_name="afterparty" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c1w>

      <!-- c2 -->
      <c2 holder="farmer">
        <dialog>
          <phrase
            talker="farmer"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="farmer"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="c2" />
          <enable_sub_quest name="c2w" />
          <remove_all_task quest_name="afterparty" />
          <add_task_count count="10" item="p_heart_1" quest_name="afterparty" />
          <add_task_count count="10" item="p_heart_2" quest_name="afterparty" />
          <add_task_count count="10" item="p_heart_3" quest_name="afterparty" />
        </actions>
      </c2>

      <!-- c2w -->
      <c2w holder="farmer">
        <dialog>
          <question
            talker="farmer"
          >
            <answer>
              <active_if>
                <have_items count="10" name="p_heart_1" />
                <have_items count="10" name="p_heart_2" />
                <have_items count="10" name="p_heart_3" />
              </active_if>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <remove_items count="10" name="p_heart_1" />
                <remove_items count="10" name="p_heart_2" />
                <remove_items count="10" name="p_heart_3" />
                <enable_sub_quest name="c3" />
                <disable_sub_quest name="c2w" />
                <remove_all_task quest_name="afterparty" />
                <add_task item="talk" quest_name="afterparty" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c2w>

      <!-- c3 -->
      <c3 holder="farmer">
        <dialog>
          <phrase
            talker="farmer"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="farmer"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="c3" />
          <enable_sub_quest name="c3w" />
          <remove_all_task quest_name="afterparty" />
          <add_task_count count="15" item="p_klubnika_3" quest_name="afterparty" />
          <add_task_count count="15" item="p_bell_3" quest_name="afterparty" />
          <add_task_count count="15" item="p_heart_3" quest_name="afterparty" />
        </actions>
      </c3>

      <!-- c3w -->
      <c3w holder="farmer">
        <dialog>
          <question
            talker="farmer"
          >
            <answer>
              <active_if>
                <have_items count="15" name="p_bell_3" />
                <have_items count="15" name="p_klubnika_3" />
                <have_items count="15" name="p_heart_3" />
              </active_if>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <remove_items count="15" name="p_bell_3" />
                <remove_items count="15" name="p_heart_3" />
                <remove_items count="15" name="p_klubnika_3" />
                <disable_sub_quest name="c3w" />
                <enable_sub_quest name="c4" />
                <remove_all_task quest_name="afterparty" />
                <add_task item="talk" quest_name="afterparty" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c3w>

      <!-- c4 -->
      <c4 holder="farmer">
        <dialog>
          <phrase
            talker="farmer"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="c4" />
          <set_quest_status status="done" />
          <add_items count="5000" name="money" />
        </actions>
      </c4>

    </sub_quests>

  </afterparty>

  <!-- //////////////////// captain //////////////////// -->
  <captain enabled_sub_quests="talk">

    <enable_condition>
      <quest_status name="detective_second" status="done" />
    </enable_condition>

    <sub_quests>

      <!-- talk -->
      <talk holder="captain">
        <dialog>
          <phrase
            talker="captain"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="captain"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="captain"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="captain"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="talk" />
          <set_quest_status status="done" />
        </actions>
      </talk>

      <!-- travel -->
      <travel holder="captain">
        <dialog>
          <question
            talker="captain"
          >
            <answer>
              <dialog>
                <phrase
                  talker="captain"
                />
              </dialog>
              <actions>
                <set_quest_status status="done" />
                <disable_sub_quest name="travel" />
                <enable_town name="location_3" />
                <set_money count="50" />
                <disable_farm name="location_1" />
                <disable_farm name="location_2" />
                <disable_town name="location_1" />
                <disable_town name="location_2" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="captain"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </travel>

      <!-- wait -->
      <wait holder="captain">
        <dialog>
          <question
            talker="captain"
          >
            <answer>
              <active_if>
                <have_items count="5000" name="money" />
              </active_if>
              <dialog>
                <phrase
                  talker="captain"
                />
              </dialog>
              <actions>
                <disable_sub_quest name="wait" />
                <enable_sub_quest name="travel" />
                <remove_items count="5000" name="money" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="captain"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </wait>

    </sub_quests>

  </captain>

  <!-- //////////////////// captain_2 //////////////////// -->
  <captain_2 enabled_sub_quests="cap_west">

    <enable_condition>
      <quest_status name="detective_3" status="done" />
    </enable_condition>

    <sub_quests>

      <!-- cap_west -->
      <cap_west holder="captain">
        <dialog>
          <phrase
            talker="captain"
          />
          <phrase
            talker="captain"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="cap_west" />
          <enable_sub_quest name="wait" />
          <add_quest person="captain" quest_name="captain_2" />
          <add_task_count count="5000" item="money" quest_name="captain_2" />
        </actions>
      </cap_west>

      <!-- wait -->
      <wait holder="captain">
        <dialog>
          <question
            talker="captain"
          >
            <answer>
              <active_if>
                <have_items count="5000" name="money" />
              </active_if>
              <dialog>
                <phrase
                  talker="captain"
                />
              </dialog>
              <actions>
                <remove_items count="5000" name="money" />
                <disable_sub_quest name="wait" />
                <set_mark_if_mark condition_mark="casual" mark="ready_to_go" />
                <set_quest_status status="done" />
                <reset_mark mark="captain_go" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="captain"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </wait>

    </sub_quests>

  </captain_2>

  <!-- //////////////////// captain_3 //////////////////// -->
  <captain_3 enabled_sub_quests="travel">

    <enable_condition>
      <have_mark mark="ready_to_go" />
    </enable_condition>

    <sub_quests>

      <!-- travel -->
      <travel holder="captain">
        <dialog>
          <question
            talker="captain"
          >
            <answer>
              <dialog>
                <phrase
                  talker="captain"
                />
              </dialog>
              <actions>
                <set_quest_status status="done" />
                <disable_sub_quest name="travel" />
                <enable_town name="location_3" />
                <set_money count="0" />
                <disable_farm name="location_1" />
                <disable_farm name="location_2" />
                <disable_town name="location_1" />
                <disable_town name="location_2" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="captain"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </travel>

    </sub_quests>

  </captain_3>

  <!-- //////////////////// detective_3 //////////////////// -->
  <detective_3 enabled_sub_quests="talk">

    <enable_condition>
      <quest_status name="captain" status="done" />
    </enable_condition>

    <sub_quests>

      <!-- talk -->
      <talk holder="detective">
        <dialog>
          <phrase
            talker="detective"
          />
          <phrase
            talker="detective"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="talk" />
          <enable_sub_quest name="wait" />
          <add_quest person="detective" quest_name="detective_3" />
          <add_task_count count="9" item="p_klubnika_2" quest_name="detective_3" />
        </actions>
      </talk>

      <!-- wait -->
      <wait holder="detective">
        <dialog>
          <question
            talker="detective"
          >
            <answer>
              <active_if>
                <have_items count="9" name="p_klubnika_2" />
              </active_if>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <remove_items count="9" name="p_klubnika_2" />
                <disable_sub_quest name="wait" />
                <set_quest_status status="done" />
                <set_mark_if_mark condition_mark="casual" mark="captain_go" />
              </actions>
            </answer>
            <answer>
              <dialog>
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </wait>

    </sub_quests>

  </detective_3>

  <!-- //////////////////// detective_first //////////////////// -->
  <detective_first enabled_sub_quests="first_time_in_city">

    <enable_condition>
    </enable_condition>

    <sub_quests>

      <!-- first_time_in_city -->
      <first_time_in_city holder="detective">
        <dialog>
          <phrase
            talker="detective"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="detective"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="first_time_in_city" />
          <set_quest_status status="done" />
        </actions>
      </first_time_in_city>

    </sub_quests>

  </detective_first>

  <!-- //////////////////// detective_second //////////////////// -->
  <detective_second enabled_sub_quests="catch_thief">

    <enable_condition>
      <quest_status name="farm_sale" status="done" />
    </enable_condition>

    <sub_quests>

      <!-- catch_thief -->
      <catch_thief holder="detective">
        <dialog>
          <phrase
            talker="detective"
          />
          <phrase
            talker="detective"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="catch_thief" />
          <enable_sub_quest name="wait_strawberry" />
          <add_quest person="detective" quest_name="detective_second" />
          <add_task_count count="9" item="p_klubnika_1" quest_name="detective_second" />
        </actions>
      </catch_thief>

      <!-- info_about_parents -->
      <info_about_parents holder="detective">
        <dialog>
          <phrase
            talker="detective"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="detective"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="info_about_parents" />
          <set_quest_status status="done" />
        </actions>
      </info_about_parents>

      <!-- new_investigation -->
      <new_investigation holder="detective">
        <dialog>
          <phrase
            talker="detective"
          />
          <phrase
            talker="detective"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="detective"
          />
          <phrase
            talker="detective"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="new_investigation" />
          <enable_sub_quest name="wait_money" />
          <add_neptun />
          <set_mark mark="shop_neptun_2" />
          <set_mark mark="shop_neptun_3" />
          <remove_all_task quest_name="detective_second" />
          <add_task_count count="800" item="money" quest_name="detective_second" />
        </actions>
      </new_investigation>

      <!-- wait_money -->
      <wait_money holder="detective">
        <dialog>
          <question
            talker="detective"
          >
            <answer>
              <active_if>
                <have_items count="800" name="money" />
              </active_if>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <remove_items count="800" name="money" />
                <enable_sub_quest name="info_about_parents" />
                <disable_sub_quest name="wait_money" />
                <remove_all_task quest_name="detective_second" />
                <add_task item="talk" quest_name="detective_second" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </wait_money>

      <!-- wait_strawberry -->
      <wait_strawberry holder="detective">
        <dialog>
          <question
            talker="detective"
          >
            <answer>
              <active_if>
                <have_items count="9" name="p_klubnika_1" />
              </active_if>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <disable_sub_quest name="wait_strawberry" />
                <remove_items count="9" name="p_klubnika_1" />
                <enable_sub_quest name="new_investigation" />
                <remove_all_task quest_name="detective_second" />
                <add_task item="talk" quest_name="detective_second" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </wait_strawberry>

    </sub_quests>

  </detective_second>

  <!-- //////////////////// exams //////////////////// -->
  <exams enabled_sub_quests="c0">

    <enable_condition>
      <have_mark mark="exam1_complete" />
    </enable_condition>

    <sub_quests>

      <!-- c0 -->
      <c0 holder="farmer">
        <dialog>
          <phrase
            talker="farmer"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="farmer"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="farmer"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="farmer"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="c0" />
          <enable_sub_quest name="c1b" />
        </actions>
      </c0>

      <!-- c1b -->
      <c1b holder="farmer">
        <dialog>
          <question
            talker="farmer"
          >
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <disable_sub_quest name="c1b" />
                <enable_sub_quest name="c1e" />
                <store_state />
                <disable_town name="location_1; location_3; location_4" />
                <set_money count="1000" />
                <set_barrels count="1" />
                <set_boxes count="1" />
                <remove_well count="1" />
                <remove_all_vegetations />
                <clear_bouquets />
                <remove_items count="100" name="p_klubnika_1; p_klubnika_2; p_klubnika_3; p_bell_1; p_bell_2; p_bell_3; p_heart_1; p_heart_2; p_heart_3" />
                <add_quest person="farmer" quest_name="exams" />
                <add_task_count count="10000" item="money" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c1b>

      <!-- c1e -->
      <c1e holder="farmer">
        <dialog>
          <question
            talker="farmer"
          >
            <answer>
              <active_if>
                <have_items count="10000" name="money" />
              </active_if>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <remove_items count="10000" name="money" />
                <disable_sub_quest name="c1e" />
                <enable_sub_quest name="c2b" />
                <restore_state />
                <remove_quest location="location_2" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <disable_sub_quest name="c1e" />
                <enable_sub_quest name="c1b" />
                <restore_state />
                <remove_quest location="location_2" quest_name="exams" />
              </actions>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c1e>

      <!-- c2b -->
      <c2b holder="farmer">
        <dialog>
          <question
            talker="farmer"
          >
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <disable_sub_quest name="c2b" />
                <enable_sub_quest name="c2e" />
                <store_state />
                <set_pests_key key="stage2" />
                <disable_town name="location_1; location_3; location_4" />
                <set_money count="3000" />
                <remove_well />
                <set_barrels count="1" />
                <set_boxes count="1" />
                <remove_all_vegetations />
                <clear_bouquets />
                <remove_items count="100" name="p_klubnika_1; p_klubnika_2; p_klubnika_3; p_bell_1; p_bell_2; p_bell_3; p_heart_1; p_heart_2; p_heart_3" />
                <add_quest person="farmer" quest_name="exams" />
                <add_task_count count="20" item="p_bell_2" quest_name="exams" />
                <add_task_count count="20" item="p_heart_2" quest_name="exams" />
                <add_task_count count="20" item="p_klubnika_2" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c2b>

      <!-- c2e -->
      <c2e holder="farmer">
        <dialog>
          <question
            talker="farmer"
          >
            <answer>
              <active_if>
                <have_items count="20" name="p_bell_2" />
                <have_items count="20" name="p_heart_2" />
                <have_items count="20" name="p_klubnika_2" />
              </active_if>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <remove_items count="20" name="p_bell_2" />
                <remove_items count="20" name="p_heart_2" />
                <remove_items count="20" name="p_klubnika_2" />
                <disable_sub_quest name="c2e" />
                <enable_sub_quest name="c3b" />
                <restore_state />
                <remove_quest location="location_2" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <disable_sub_quest name="c2e" />
                <enable_sub_quest name="c2b" />
                <restore_state />
                <remove_quest location="location_2" quest_name="exams" />
              </actions>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c2e>

      <!-- c3b -->
      <c3b holder="farmer">
        <dialog>
          <question
            talker="farmer"
          >
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <disable_sub_quest name="c3b" />
                <enable_sub_quest name="c3e" />
                <store_state />
                <disable_town name="location_1; location_3; location_4" />
                <set_money count="1000" />
                <remove_all_vegetations />
                <set_max_barrels count="1" />
                <remove_well />
                <disable_helper />
                <clear_bouquets />
                <remove_items count="100" name="p_klubnika_1; p_klubnika_2; p_klubnika_3; p_bell_1; p_bell_2; p_bell_3; p_heart_1; p_heart_2; p_heart_3" />
                <add_quest person="farmer" quest_name="exams" />
                <add_task_count count="2" item="heart_3" quest_name="exams" />
                <add_task_count count="2" item="bell_3" quest_name="exams" />
                <add_task_count count="2" item="klubnika_3" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c3b>

      <!-- c3e -->
      <c3e holder="farmer">
        <dialog>
          <question
            talker="farmer"
          >
            <answer>
              <active_if>
                <have_items count="2" name="heart_3" />
                <have_items count="2" name="klubnika_3" />
                <have_items count="2" name="bell_3" />
              </active_if>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <disable_sub_quest name="c3e" />
                <enable_sub_quest name="c4b" />
                <restore_state />
                <remove_quest location="location_2" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <disable_sub_quest name="c3e" />
                <enable_sub_quest name="c3b" />
                <restore_state />
                <remove_quest location="location_2" quest_name="exams" />
              </actions>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c3e>

      <!-- c4b -->
      <c4b holder="farmer">
        <dialog>
          <question
            talker="farmer"
          >
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <disable_sub_quest name="c4b" />
                <enable_sub_quest name="c4e" />
                <store_state />
                <disable_town name="location_1; location_3; location_4" />
                <set_money count="0" />
                <set_barrels count="3" />
                <enable_buy_water enable="false" />
                <enable_buy_well enable="false" />
                <disable_helper />
                <remove_all_vegetations />
                <add_vegetation name="heart_1;heart_1;heart_1" />
                <clear_bouquets />
                <remove_items count="100" name="p_klubnika_1; p_klubnika_2; p_klubnika_3; p_bell_1; p_bell_2; p_bell_3; p_heart_1; p_heart_2; p_heart_3" />
                <add_quest person="farmer" quest_name="exams" />
                <add_task_count count="6" item="p_heart_1" quest_name="exams" />
                <add_task_count count="3" item="p_heart_2" quest_name="exams" />
                <add_task_count count="1" item="p_heart_3" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c4b>

      <!-- c4e -->
      <c4e holder="farmer">
        <dialog>
          <question
            talker="farmer"
          >
            <answer>
              <active_if>
                <have_items count="6" name="p_heart_1" />
                <have_items count="3" name="p_heart_2" />
                <have_items count="1" name="p_heart_3" />
              </active_if>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <remove_items count="6" name="p_heart_1" />
                <remove_items count="3" name="p_heart_2" />
                <remove_items count="1" name="p_heart_3" />
                <disable_sub_quest name="c4e" />
                <enable_sub_quest name="c5b" />
                <restore_state />
                <remove_quest location="location_2" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <disable_sub_quest name="c4e" />
                <enable_sub_quest name="c4b" />
                <restore_state />
                <remove_quest location="location_2" quest_name="exams" />
              </actions>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c4e>

      <!-- c5b -->
      <c5b holder="farmer">
        <dialog>
          <question
            talker="farmer"
          >
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <disable_sub_quest name="c5b" />
                <enable_sub_quest name="c5e" />
                <store_state />
                <disable_town name="location_1; location_3; location_4" />
                <disable_buy_vegetation name="klubnika_1; bell_1; heart_1" />
                <set_money count="2000" />
                <remove_all_vegetations />
                <add_vegetation name="fire_1; fire_1; fire_1; fire_1; fire_1; fire_1" />
                <set_pests_key key="stage2" />
                <remove_items count="1" name="simple_sword" />
                <clear_bouquets />
                <add_weapon name="magic_sword" />
                <add_weapon name="magic_sword" />
                <add_quest person="farmer" quest_name="exams" />
                <add_task_count count="10" item="p_fire_1" quest_name="exams" />
                <add_task_count count="10" item="p_fire_2" quest_name="exams" />
                <add_task_count count="10" item="p_fire_3" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c5b>

      <!-- c5e -->
      <c5e holder="farmer">
        <dialog>
          <question
            talker="farmer"
          >
            <answer>
              <active_if>
                <have_items count="10" name="p_fire_1" />
                <have_items count="10" name="p_fire_2" />
                <have_items count="10" name="p_fire_3" />
              </active_if>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <remove_items count="100" name="p_fire_1; p_fire_2; p_fire_3" />
                <disable_sub_quest name="c5e" />
                <set_quest_status status="done" />
                <set_mark mark="exam2_complete" />
                <enable_buy_vegetation name="klubnika_1; bell_1; heart_1" />
                <remove_all_vegetations />
                <restore_state />
                <remove_quest location="location_2" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <disable_sub_quest name="c5e" />
                <enable_sub_quest name="c5b" />
                <remove_items count="1" name="magic_sword" />
                <add_items count="1" name="simple_sword" />
                <remove_items count="100" name="p_fire_1; p_fire_2; p_fire_3" />
                <enable_buy_vegetation name="klubnika_1; bell_1; heart_1" />
                <remove_all_vegetations />
                <restore_state />
                <remove_quest location="location_2" quest_name="exams" />
              </actions>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c5e>

    </sub_quests>

  </exams>

  <!-- //////////////////// farm_sale //////////////////// -->
  <farm_sale enabled_sub_quests="find_farm">

    <enable_condition>
      <quest_status name="detective_first" status="done" />
    </enable_condition>

    <sub_quests>

      <!-- buy_farm -->
      <buy_farm holder="farmer">
        <dialog>
          <question
            talker="farmer"
          >
            <answer>
              <active_if>
                <have_items count="2000" name="money" />
              </active_if>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
              <actions>
                <disable_sub_quest name="buy_farm" />
                <set_quest_status status="done" />
                <enable_farm name="location_2" />
                <remove_items count="2000" name="money" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="farmer"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </buy_farm>

      <!-- find_farm -->
      <find_farm holder="farmer">
        <dialog>
          <phrase
            talker="farmer"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="farmer"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="find_farm" />
          <enable_sub_quest name="buy_farm" />
          <add_quest person="farmer" quest_name="farm_sale" />
          <add_task_count count="2000" item="money" quest_name="farm_sale" />
        </actions>
      </find_farm>

    </sub_quests>

  </farm_sale>

  <!-- //////////////////// george_food_pack //////////////////// -->
  <george_food_pack enabled_sub_quests="start">

    <enable_condition>
      <have_mark mark="know_george_food" />
    </enable_condition>

    <sub_quests>

      <!-- start -->
      <start holder="captain">
        <dialog>
          <phrase
            talker="captain"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="captain"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="captain"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="captain"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="captain"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="start" />
          <enable_sub_quest name="wait1" />
          <add_quest person="captain" quest_name="george_food_pack" />
          <add_task_count count="30" item="p_heart_3" quest_name="george_food_pack" />
        </actions>
      </start>

      <!-- wait1 -->
      <wait1 holder="captain">
        <dialog>
          <question
            talker="captain"
          >
            <answer>
              <active_if>
                <have_items count="30" name="p_heart_3" />
              </active_if>
              <dialog>
                <phrase
                  talker="captain"
                />
              </dialog>
              <actions>
                <disable_sub_quest name="wait1" />
                <enable_sub_quest name="wait2" />
                <remove_items count="30" name="p_heart_3" />
                <remove_all_task quest_name="george_food_pack" />
                <add_task_count count="1000" item="money" quest_name="george_food_pack" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="captain"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </wait1>

      <!-- wait2 -->
      <wait2 holder="captain">
        <dialog>
          <question
            talker="captain"
          >
            <answer>
              <active_if>
                <have_items count="1000" name="money" />
              </active_if>
              <dialog>
                <phrase
                  talker="captain"
                />
              </dialog>
              <actions>
                <set_mark mark="george_food_packed" />
                <disable_sub_quest name="wait2" />
                <set_quest_status status="done" />
                <remove_items count="1000" name="money" />
                <add_quest person="pirate_leader" quest_name="george1" location="location_4"/>
                <update_quest_title quest_name="george1" location ="location_4" title_from="t4"/>
                <add_task item="talk" quest_name="george1" location ="location_4"/>
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="captain"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </wait2>

    </sub_quests>

  </george_food_pack>

  <!-- //////////////////// hard_cap_2 //////////////////// -->
  <hard_cap_2 enabled_sub_quests="new_dress">

    <enable_condition>
      <quest_status name="captain_2" status="done" />
      <have_mark mark="hardcore" />
    </enable_condition>

    <sub_quests>

      <!-- need_heart -->
      <need_heart holder="captain">
        <dialog>
          <question
            talker="captain"
          >
            <answer>
              <active_if>
                <have_items count="10" name="p_heart_1" />
                <have_items count="6" name="p_klubnika_2" />
              </active_if>
              <dialog>
                <phrase
                  talker="captain"
                />
              </dialog>
              <actions>
                <remove_items count="10" name="p_heart_1" />
                <remove_items count="6" name="p_klubnika_2" />
                <disable_sub_quest name="need_heart" />
                <set_mark mark="captain_go" />
                <set_quest_status status="done" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="captain"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </need_heart>

      <!-- new_dress -->
      <new_dress holder="captain">
        <dialog>
          <phrase
            talker="captain"
          />
          <phrase
            talker="captain"
          />
          <phrase
            talker="captain"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="new_dress" />
          <enable_sub_quest name="need_heart" />
          <add_quest person="captain" quest_name="hard_cap_2" />
          <add_task_count count="10" item="p_heart_1" quest_name="hard_cap_2" />
          <add_task_count count="6" item="p_klubnika_2" quest_name="hard_cap_2" />
        </actions>
      </new_dress>

    </sub_quests>

  </hard_cap_2>

  <!-- //////////////////// hard_cap_3 //////////////////// -->
  <hard_cap_3 enabled_sub_quests="storm">

    <enable_condition>
      <have_mark mark="hardcore" />
      <quest_status name="hard_cap_2" status="done" />
    </enable_condition>

    <sub_quests>

      <!-- amulets -->
      <amulets holder="captain">
        <dialog>
          <question
            talker="captain"
          >
            <answer>
              <active_if>
                <have_items count="15" name="kloun_lutt" />
                <have_items count="7500" name="money" />
              </active_if>
              <dialog>
                <phrase
                  talker="captain"
                />
              </dialog>
              <actions>
                <set_mark mark="ready_to_go" />
                <disable_sub_quest name="amulets" />
                <set_quest_status status="done" />
                <remove_items count="15" name="kloun_lutt" />
                <remove_items count="7500" name="money" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="captain"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </amulets>

      <!-- storm -->
      <storm holder="captain">
        <dialog>
          <phrase
            talker="captain"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="captain"
          />
          <phrase
            talker="captain"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="storm" />
          <enable_sub_quest name="amulets" />
          <enable_bug_item count="15" item="kloun_lutt" />
          <add_quest person="captain" quest_name="hard_cap_3" />
          <add_task_count count="7500" item="money" quest_name="hard_cap_3" />
          <add_task_count count="15" item="kloun_lutt" quest_name="hard_cap_3" />
        </actions>
      </storm>

    </sub_quests>

  </hard_cap_3>

  <!-- //////////////////// sell_man //////////////////// -->
  <sell_man enabled_sub_quests="sword; talk">

    <enable_condition>
      <quest_status name="farm_sale" status="done" />
      <day_delay delay="6" id="day_6" />
    </enable_condition>

    <sub_quests>

      <!-- talk -->
      <talk holder="trademan">
        <dialog>
          <phrase
            talker="trademan"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="talk" />
          <enable_sub_quest name="wait" />
          <add_quest person="trademan" quest_name="sell_man" />
          <add_task_count count="1000" item="money" quest_name="sell_man" />
        </actions>
      </talk>

      <!-- talk_2 -->
      <talk_2 holder="trademan">
        <dialog>
          <phrase
            talker="hero"
          />
          <phrase
            talker="trademan"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="talk_2" />
          <set_quest_status status="done" />
        </actions>
      </talk_2>

      <!-- wait -->
      <wait holder="trademan">
        <dialog>
          <question
            talker="trademan"
          >
            <answer>
              <active_if>
                <have_items count="1000" name="money" />
              </active_if>
              <dialog>
                <phrase
                  talker="trademan"
                />
              </dialog>
              <actions>
                <remove_items count="1000" name="money" />
                <disable_sub_quest name="wait" />
                <open_next_sub_quest name="talk_2" />
                <add_weapon name="sword" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="trademan"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </wait>

    </sub_quests>

  </sell_man>


</quests>