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

<quests>

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

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

    <sub_quests>

      <!-- talk -->
      <talk holder="parents">
        <dialog>
          <phrase
            talker="parents"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="parents"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="parents"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="parents"
          />
          <phrase
            talker="headmaster"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="headmaster"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="headmaster"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="headmaster"
          />
        </dialog>
        <actions>
          <set_quest_status status="done" />
        </actions>
      </talk>

    </sub_quests>

  </after_exams>

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

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

    <sub_quests>

      <!-- task1 -->
      <task1 holder="traveller">
        <dialog>
          <phrase
            talker="traveller"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="traveller"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <enable_bug_item count="30" item="snail_shell" />
          <next_sub_quest name="task1_wait" />
          <add_quest person="traveller" quest_name="afterparty" />
          <add_task_count count="30" item="snail_shell" quest_name="afterparty" />
        </actions>
      </task1>

      <!-- task1_wait -->
      <task1_wait holder="traveller">
        <dialog>
          <question
            talker="traveller"
          >
            <answer>
              <active_if>
                <have_items count="30" name="snail_shell" />
              </active_if>
              <dialog>
                <phrase
                  talker="traveller"
                />
              </dialog>
              <actions>
                <add_items count="1000" name="money" />
                <remove_items count="30" name="snail_shell" />
                <next_sub_quest name="task2" />
                <remove_all_task quest_name="afterparty" />
                <add_task item="talk" quest_name="afterparty" />
              </actions>
            </answer>
            <answer>
              <dialog>
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </task1_wait>

      <!-- task2 -->
      <task2 holder="traveller">
        <dialog>
          <phrase
            talker="traveller"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <next_sub_quest name="task2_wait" />
          <remove_all_task quest_name="afterparty" />
          <add_task_count count="10" item="p_romashka_3" quest_name="afterparty" />
        </actions>
      </task2>

      <!-- task2_wait -->
      <task2_wait holder="traveller">
        <dialog>
          <question
            talker="traveller"
          >
            <answer>
              <active_if>
                <have_items count="10" name="p_romashka_3" />
              </active_if>
              <dialog>
                <phrase
                  talker="traveller"
                />
              </dialog>
              <actions>
                <remove_items count="10" name="p_romashka_3" />
                <set_quest_status status="done" />
              </actions>
            </answer>
            <answer>
              <dialog>
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </task2_wait>

    </sub_quests>

  </afterparty>

  <!-- //////////////////// anniversary //////////////////// -->
  <anniversary enabled_sub_quests="t1">

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

    <sub_quests>

      <!-- t1 -->
      <t1 holder="old_servant">
        <dialog>
          <phrase
            talker="old_servant"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="old_servant"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="old_servant"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="old_servant"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="t1" />
          <enable_sub_quest name="t1w" />
          <add_quest person="old_servant" quest_name="anniversary" />
          <add_task_count count="15" item="p_romashka_1" quest_name="anniversary" />
          <add_task_count count="10" item="p_romashka_2" quest_name="anniversary" />
          <add_task_count count="5" item="p_romashka_3" quest_name="anniversary" />
        </actions>
      </t1>

      <!-- t1w -->
      <t1w holder="old_servant">
        <dialog>
          <question
            talker="old_servant"
          >
            <answer>
              <active_if>
                <have_items count="15" name="p_romashka_1" />
                <have_items count="10" name="p_romashka_2" />
                <have_items count="5" name="p_romashka_3" />
              </active_if>
              <dialog>
                <phrase
                  talker="old_servant"
                />
              </dialog>
              <actions>
                <remove_items count="15" name="p_romashka_1" />
                <remove_items count="10" name="p_romashka_2" />
                <remove_items count="5" name="p_romashka_3" />
                <disable_sub_quest name="t1w" />
                <enable_sub_quest name="t2" />
                <remove_all_task quest_name="anniversary" />
                <add_task item="talk" quest_name="anniversary" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="old_servant"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </t1w>

      <!-- t2 -->
      <t2 holder="old_servant">
        <dialog>
          <phrase
            talker="old_servant"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="old_servant"
          />
        </dialog>
        <actions>
          <disable_sub_quest name="t2" />
          <enable_sub_quest name="t2w" />
          <remove_all_task quest_name="anniversary" />
          <add_task_count count="5000" item="money" quest_name="anniversary" />
        </actions>
      </t2>

      <!-- t2w -->
      <t2w holder="old_servant">
        <dialog>
          <question
            talker="old_servant"
          >
            <answer>
              <active_if>
                <have_items count="5000" name="money" />
              </active_if>
              <dialog>
                <phrase
                  talker="old_servant"
                />
              </dialog>
              <actions>
                <remove_items count="5000" name="money" />
                <set_quest_status status="done" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="old_servant"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </t2w>

    </sub_quests>

  </anniversary>

  <!-- //////////////////// anniversary2 //////////////////// -->
  <anniversary2 enabled_sub_quests="t1">

    <enable_condition>
      <quest_status name="anniversary" status="done" />
      <day_delay delay="1" id="cake_baking" />
    </enable_condition>

    <sub_quests>

      <!-- t1 -->
      <t1 holder="old_servant">
        <dialog>
          <phrase
            talker="old_servant"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="parents"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="parents"
          />
        </dialog>
        <actions>
          <set_quest_status status="done" />
        </actions>
      </t1>

    </sub_quests>

  </anniversary2>

  <!-- //////////////////// detective //////////////////// -->
  <detective enabled_sub_quests="arrive">

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

    <sub_quests>

      <!-- arrive -->
      <arrive holder="detective">
        <dialog>
          <phrase
            talker="detective"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="detective"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <next_sub_quest name="travel_to_town" />
          <add_quest person="detective" quest_name="detective" />
          <add_task_count count="400" item="money" quest_name="detective" />
        </actions>
      </arrive>

      <!-- travel_to_town -->
      <travel_to_town holder="detective">
        <dialog>
          <question
            talker="detective"
          >
            <answer>
              <active_if>
                <have_items count="400" name="money" />
              </active_if>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <enable_town name="location_2" />
                <remove_items count="400" name="money" />
                <set_quest_status status="done" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </travel_to_town>

    </sub_quests>

  </detective>

  <!-- //////////////////// detective_arrive_hardcore //////////////////// -->
  <detective_arrive_hardcore enabled_sub_quests="q">

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

    <sub_quests>

      <!-- q -->
      <q holder="old_servant">
        <dialog>
          <phrase
            talker="old_servant"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="old_servant"
          />
        </dialog>
        <actions>
          <next_sub_quest name="w" />
          <add_quest person="old_servant" quest_name="detective_arrive_hardcore" />
          <add_task_count count="3" item="p_rose_1" quest_name="detective_arrive_hardcore" />
        </actions>
      </q>

      <!-- w -->
      <w holder="old_servant">
        <dialog>
          <question
            talker="old_servant"
          >
            <answer>
              <active_if>
                <have_items count="3" name="p_rose_1" />
              </active_if>
              <dialog>
                <phrase
                  talker="old_servant"
                />
              </dialog>
              <actions>
                <set_quest_status status="done" />
                <remove_items count="3" name="p_rose_1" />
                <set_mark mark="detective_arrive" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="old_servant"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </w>

    </sub_quests>

  </detective_arrive_hardcore>

  <!-- //////////////////// dragon_egg //////////////////// -->
  <dragon_egg enabled_sub_quests="t1">

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

    <sub_quests>

      <!-- t1 -->
      <t1 holder="traveller">
        <dialog>
          <phrase
            talker="hero"
          />
          <phrase
            talker="traveller"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <set_quest_status status="done" />
          <set_mark mark="know_george_egg" />
          <add_quest person="pirate_leader" quest_name="george1" location ="location_4"/>
          <add_task item="talk" quest_name="george1" location ="location_4"/>
        </actions>
      </t1>

    </sub_quests>

  </dragon_egg>

  <!-- //////////////////// dragon_food //////////////////// -->
  <dragon_food enabled_sub_quests="t1">

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

    <sub_quests>

      <!-- t1 -->
      <t1 holder="traveller">
        <dialog>
          <phrase
            talker="hero"
          />
          <phrase
            talker="traveller"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="traveller"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <set_quest_status status="done" />
          <set_mark mark="know_george_food" />
          <add_quest person="pirate_leader" quest_name="george1" location ="location_4"/>
          <add_task item="talk" quest_name="george1" location ="location_4"/>
        </actions>
      </t1>

    </sub_quests>

  </dragon_food>

  <!-- //////////////////// dragon_sick //////////////////// -->
  <dragon_sick enabled_sub_quests="ds1">

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

    <sub_quests>

      <!-- ds1 -->
      <ds1 holder="traveller">
        <dialog>
          <phrase
            talker="hero"
          />
          <phrase
            talker="traveller"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="traveller"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <next_sub_quest name="ds1w" />
          <remove_all_task quest_name="dragon_sick" />
          <add_task_count count="30" item="p_rose_3" quest_name="dragon_sick" />
        </actions>
      </ds1>

      <!-- ds1w -->
      <ds1w holder="traveller">
        <dialog>
          <question
            talker="traveller"
          >
            <answer>
              <active_if>
                <have_items count="30" name="p_rose_3" />
              </active_if>
              <dialog>
                <phrase
                  talker="traveller"
                />
              </dialog>
              <actions>
                <enable_helper not_used="" />
                <set_quest_status status="done" />
                <remove_items count="30" name="p_rose_3" />
                <set_mark mark="dragon_cured" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="traveller"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </ds1w>

    </sub_quests>

  </dragon_sick>

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

    <enable_condition>
      <have_mark mark="statue_of_dragon_1" />
      <day_delay delay="3" id="id_day_3" />
    </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="dragon_statue_2" />
          <add_task_count count="500000" item="money" quest_name="dragon_statue_2" />
        </actions>
      </talk>

      <!-- wait -->
      <wait holder="trademan">
        <dialog>
          <question
            talker="trademan"
          >
            <answer>
              <active_if>
                <have_items count="500000" name="money" />
              </active_if>
              <actions>
                <disable_sub_quest name="wait" />
                <set_quest_status status="done" />
                <remove_items count="500000" name="money" />
                <set_mark mark="statue_of_dragon_2" />
                <add_dragon_medal no_param="" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="trademan"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </wait>

    </sub_quests>

  </dragon_statue_2>

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

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

    <sub_quests>

      <!-- c0 -->
      <c0 holder="detective">
        <dialog>
          <phrase
            talker="detective"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="detective"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="detective"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="detective"
          />
        </dialog>
        <actions>
          <next_sub_quest name="c1b" />
        </actions>
      </c0>

      <!-- c1b -->
      <c1b holder="detective">
        <dialog>
          <question
            talker="detective"
          >
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <next_sub_quest name="c1e" />
                <store_state />
                <disable_town name="location_2" />
                <disable_town name="location_3" />
                <disable_town name="location_4" />
                <set_money count="150" />
                <remove_all_vegetations />
                <clear_bouquets />
                <remove_items count="100" name="p_romashka_1;p_romashka_2;p_romashka_3;p_tree_1;p_tree_2;p_tree_3;p_rose_1;p_rose_2;p_rose_3" />
                <add_quest person="detective" quest_name="exams" />
                <add_task_count count="3000" item="money" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c1b>

      <!-- c1e -->
      <c1e holder="detective">
        <dialog>
          <question
            talker="detective"
          >
            <answer>
              <active_if>
                <have_items count="3000" name="money" />
              </active_if>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <remove_items count="3000" name="money" />
                <next_sub_quest name="c2b" />
                <restore_state />
                <remove_quest location="location_1" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <next_sub_quest name="c1b" />
                <restore_state />
                <remove_quest location="location_1" quest_name="exams" />
              </actions>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c1e>

      <!-- c2b -->
      <c2b holder="detective">
        <dialog>
          <question
            talker="detective"
          >
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <next_sub_quest name="c2e" />
                <store_state />
                <disable_town name="location_2" />
                <disable_town name="location_3" />
                <disable_town name="location_4" />
                <disable_buy_vegetation name="romashka" />
                <disable_buy_vegetation name="rose" />
                <set_money count="200" />
                <remove_all_vegetations />
                <clear_bouquets />
                <remove_items count="100" name="p_romashka_1" />
                <remove_items count="100" name="p_romashka_2" />
                <remove_items count="100" name="p_romashka_3" />
                <remove_items count="100" name="p_tree_1" />
                <remove_items count="100" name="p_tree_2" />
                <remove_items count="100" name="p_tree_3" />
                <remove_items count="100" name="p_rose_1" />
                <remove_items count="100" name="p_rose_2" />
                <remove_items count="100" name="p_rose_3" />
                <add_quest person="detective" quest_name="exams" />
                <add_task_count count="30" item="p_tree_3" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c2b>

      <!-- c2e -->
      <c2e holder="detective">
        <dialog>
          <question
            talker="detective"
          >
            <answer>
              <active_if>
                <have_items count="30" name="p_tree_3" />
              </active_if>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <remove_items count="30" name="p_tree_3" />
                <next_sub_quest name="c3b" />
                <restore_state />
                <disable_buy_vegetation name="romashka; tree; rose" />
                <enable_buy_vegetation name="romashka; tree; rose" />
                <remove_quest location="location_1" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <next_sub_quest name="c2b" />
                <restore_state />
                <disable_buy_vegetation name="romashka; tree; rose" />
                <enable_buy_vegetation name="romashka; tree; rose" />
                <remove_quest location="location_1" quest_name="exams" />
              </actions>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c2e>

      <!-- c3b -->
      <c3b holder="detective">
        <dialog>
          <question
            talker="detective"
          >
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <next_sub_quest name="c3e" />
                <store_state />
                <disable_town name="location_2" />
                <disable_town name="location_3" />
                <disable_town name="location_4" />
                <set_money count="100" />
                <remove_all_vegetations />
                <clear_bouquets />
                <remove_items count="100" name="p_romashka_1" />
                <remove_items count="100" name="p_romashka_2" />
                <remove_items count="100" name="p_romashka_3" />
                <remove_items count="100" name="p_tree_1" />
                <remove_items count="100" name="p_tree_2" />
                <remove_items count="100" name="p_tree_3" />
                <remove_items count="100" name="p_rose_1" />
                <remove_items count="100" name="p_rose_2" />
                <remove_items count="100" name="p_rose_3" />
                <add_quest person="detective" quest_name="exams" />
                <add_task_count count="6" item="p_romashka_1" quest_name="exams" />
                <add_task_count count="6" item="p_romashka_2" quest_name="exams" />
                <add_task_count count="6" item="p_romashka_3" quest_name="exams" />
                <add_task_count count="6" item="p_tree_1" quest_name="exams" />
                <add_task_count count="6" item="p_tree_2" quest_name="exams" />
                <add_task_count count="6" item="p_tree_3" quest_name="exams" />
                <add_task_count count="6" item="p_rose_1" quest_name="exams" />
                <add_task_count count="6" item="p_rose_2" quest_name="exams" />
                <add_task_count count="6" item="p_rose_3" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c3b>

      <!-- c3e -->
      <c3e holder="detective">
        <dialog>
          <question
            talker="detective"
          >
            <answer>
              <active_if>
                <have_items count="6" name="p_romashka_1" />
                <have_items count="6" name="p_romashka_2" />
                <have_items count="6" name="p_romashka_3" />
                <have_items count="6" name="p_tree_1" />
                <have_items count="6" name="p_tree_2" />
                <have_items count="6" name="p_tree_3" />
                <have_items count="6" name="p_rose_1" />
                <have_items count="6" name="p_rose_2" />
                <have_items count="6" name="p_rose_3" />
              </active_if>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <remove_items count="6" name="p_romashka_1" />
                <remove_items count="6" name="p_romashka_2" />
                <remove_items count="6" name="p_romashka_3" />
                <remove_items count="6" name="p_tree_1" />
                <remove_items count="6" name="p_tree_2" />
                <remove_items count="6" name="p_tree_3" />
                <remove_items count="6" name="p_rose_1" />
                <remove_items count="6" name="p_rose_2" />
                <remove_items count="6" name="p_rose_3" />
                <next_sub_quest name="c4b" />
                <restore_state />
                <remove_quest location="location_1" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <next_sub_quest name="c3b" />
                <restore_state />
                <remove_quest location="location_1" quest_name="exams" />
              </actions>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c3e>

      <!-- c4b -->
      <c4b holder="detective">
        <dialog>
          <question
            talker="detective"
          >
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <next_sub_quest name="c4e" />
                <store_state />
                <disable_town name="location_2" />
                <disable_town name="location_3" />
                <disable_town name="location_4" />
                <disable_buy_vegetation name="tree" />
                <set_money count="50" />
                <remove_all_vegetations />
                <clear_bouquets />
                <remove_items count="100" name="p_romashka_1" />
                <remove_items count="100" name="p_romashka_2" />
                <remove_items count="100" name="p_romashka_3" />
                <remove_items count="100" name="p_tree_1" />
                <remove_items count="100" name="p_tree_2" />
                <remove_items count="100" name="p_tree_3" />
                <remove_items count="100" name="p_rose_1" />
                <remove_items count="100" name="p_rose_2" />
                <remove_items count="100" name="p_rose_3" />
                <add_quest person="detective" quest_name="exams" />
                <add_task_count count="20" item="p_rose_1" quest_name="exams" />
                <add_task_count count="20" item="p_rose_2" quest_name="exams" />
                <add_task_count count="20" item="p_rose_3" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c4b>

      <!-- c4e -->
      <c4e holder="detective">
        <dialog>
          <question
            talker="detective"
          >
            <answer>
              <active_if>
                <have_items count="20" name="p_rose_1" />
                <have_items count="20" name="p_rose_2" />
                <have_items count="20" name="p_rose_3" />
              </active_if>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <remove_items count="20" name="p_rose_1" />
                <remove_items count="20" name="p_rose_2" />
                <remove_items count="20" name="p_rose_3" />
                <next_sub_quest name="c5b" />
                <restore_state />
                <disable_buy_vegetation name="romashka; tree; rose" />
                <enable_buy_vegetation name="romashka; tree; rose" />
                <remove_quest location="location_1" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <next_sub_quest name="c4b" />
                <restore_state />
                <disable_buy_vegetation name="romashka; tree; rose" />
                <enable_buy_vegetation name="romashka; tree; rose" />
                <remove_quest location="location_1" quest_name="exams" />
              </actions>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c4e>

      <!-- c5b -->
      <c5b holder="detective">
        <dialog>
          <question
            talker="detective"
          >
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <next_sub_quest name="c5e" />
                <store_state />
                <disable_town name="location_2" />
                <disable_town name="location_3" />
                <disable_town name="location_4" />
                <set_money count="0" />
                <remove_all_vegetations />
                <clear_bouquets />
                <remove_items count="100" name="p_romashka_1" />
                <remove_items count="100" name="p_romashka_2" />
                <remove_items count="100" name="p_romashka_3" />
                <remove_items count="100" name="p_tree_1" />
                <remove_items count="100" name="p_tree_2" />
                <remove_items count="100" name="p_tree_3" />
                <remove_items count="100" name="p_rose_1" />
                <remove_items count="100" name="p_rose_2" />
                <remove_items count="100" name="p_rose_3" />
                <add_quest person="detective" quest_name="exams" />
                <add_task_count count="20" item="p_rose_3" quest_name="exams" />
                <add_task_count count="20" item="p_romashka_3" quest_name="exams" />
                <add_task_count count="20" item="p_tree_3" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c5b>

      <!-- c5e -->
      <c5e holder="detective">
        <dialog>
          <question
            talker="detective"
          >
            <answer>
              <active_if>
                <have_items count="20" name="p_rose_3" />
                <have_items count="20" name="p_romashka_3" />
                <have_items count="20" name="p_tree_3" />
              </active_if>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <remove_items count="20" name="p_rose_3" />
                <remove_items count="20" name="p_romashka_3" />
                <remove_items count="20" name="p_tree_3" />
                <restore_state />
                <set_quest_status status="done" />
                <set_mark mark="exam1_complete" />
                <remove_quest location="location_1" quest_name="exams" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="detective"
                />
              </dialog>
              <actions>
                <next_sub_quest name="c5b" />
                <restore_state />
                <remove_quest location="location_1" quest_name="exams" />
              </actions>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </c5e>

    </sub_quests>

  </exams>

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

    <enable_condition>
      <quest_status name="old_servant" status="done" />
      <have_mark mark="detective_arrive" />
    </enable_condition>

    <sub_quests>

      <!-- talk -->
      <talk holder="old_servant">
        <dialog>
          <phrase
            talker="old_servant"
          />
          <phrase
            talker="old_servant"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="old_servant"
          />
        </dialog>
        <actions>
          <set_quest_status status="done" />
          <enable_helper not_used="" />
        </actions>
      </talk>

    </sub_quests>

  </helper>

  <!-- //////////////////// magic_statue //////////////////// -->
  <magic_statue enabled_sub_quests="q">

    <enable_condition>
      <quest_status name="helper" status="done" />
      <day_delay delay="2" id="se_2" />
    </enable_condition>

    <sub_quests>

      <!-- q -->
      <q holder="old_servant">
        <dialog>
          <phrase
            talker="old_servant"
          />
          <phrase
            talker="old_servant"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <enable_sub_quest name="w" />
          <disable_sub_quest name="q" />
          <add_quest person="old_servant" quest_name="magic_statue" />
          <add_task_count count="3" item="p_romashka_2" quest_name="magic_statue" />
        </actions>
      </q>

      <!-- w -->
      <w holder="old_servant">
        <dialog>
          <question
            talker="old_servant"
          >
            <answer>
              <active_if>
                <have_items count="3" name="p_romashka_2" />
              </active_if>
              <dialog>
                <phrase
                  talker="old_servant"
                />
              </dialog>
              <actions>
                <set_quest_status status="done" />
                <add_owl />
                <set_mark mark="shop_owl_2" />
                <set_mark mark="shop_owl_3" />
                <remove_items count="3" name="p_romashka_2" />
                <disable_sub_quest name="w" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="old_servant"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </w>

    </sub_quests>

  </magic_statue>

  <!-- //////////////////// old_servant //////////////////// -->
  <old_servant enabled_sub_quests="introduction">

    <enable_condition>
    </enable_condition>

    <sub_quests>

      <!-- introduction -->
      <introduction holder="old_servant">
        <dialog>
          <phrase
            talker="hero"
          />
          <phrase
            talker="old_servant"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="old_servant"
          />
          <phrase
            talker="hero"
          />
          <phrase
            talker="old_servant"
          />
          <phrase
            talker="hero"
          />
        </dialog>
        <actions>
          <enable_farm name="location_1" />
          <next_sub_quest name="wait_money" />
          <add_quest person="old_servant" quest_name="old_servant" />
          <add_task_count count="50" item="money" quest_name="old_servant" />
        </actions>
      </introduction>

      <!-- wait_money -->
      <wait_money holder="old_servant">
        <dialog>
          <question
            talker="old_servant"
          >
            <answer>
              <active_if>
                <have_items count="50" name="money" />
              </active_if>
              <dialog>
                <phrase
                  talker="old_servant"
                />
              </dialog>
              <actions>
                <set_quest_status status="done" />
                <remove_items count="50" name="money" />
                <set_mark_if_mark condition_mark="casual" mark="detective_arrive" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="old_servant"
                />
              </dialog>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </wait_money>

    </sub_quests>

  </old_servant>

  <!-- //////////////////// open_all_locations //////////////////// -->
  <open_all_locations enabled_sub_quests="open_all">

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

    <sub_quests>

      <!-- open_all -->
      <open_all holder="opener">
        <dialog>
          <question
            talker="opener"
          >
            <answer>
              <dialog>
              </dialog>
              <actions>
                <enable_farm name="location_1" />
                <enable_farm name="location_2" />
                <enable_farm name="location_3" />
                <enable_farm name="location_4" />
                <enable_farm name="location_5" />
                <enable_town name="location_1" />
                <enable_town name="location_2" />
                <enable_town name="location_3" />
                <enable_town name="location_4" />
                <enable_town name="location_5" />
                <set_mark mark="shop_well" />
                <set_mark mark="shop_barrel" />
                <set_mark mark="shop_box" />
                <set_mark mark="shop_ridges" />
                <set_mark mark="shop_vegetation" />
                <add_items count="50000" name="money" />
              </actions>
            </answer>
            <answer>
              <dialog>
              </dialog>
              <actions>
                <enable_farm name="location_2" />
                <set_pests_key key="challenge" />
              </actions>
            </answer>
            <answer>
              <dialog>
              </dialog>
              <actions>
                <enable_farm name="location_3" />
                <set_pests_key key="" />
              </actions>
            </answer>
            <answer>
              <dialog>
              </dialog>
              <actions>
                <enable_farm name="location_4" />
              </actions>
            </answer>
            <answer>
              <dialog>
              </dialog>
              <actions>
                <enable_town name="location_1" />
              </actions>
            </answer>
            <answer>
              <dialog>
              </dialog>
              <actions>
                <enable_town name="location_2" />
              </actions>
            </answer>
            <answer>
              <dialog>
              </dialog>
              <actions>
                <enable_town name="location_3" />
              </actions>
            </answer>
            <answer>
              <dialog>
              </dialog>
              <actions>
                <enable_town name="location_4" />
              </actions>
            </answer>
            <answer>
              <dialog>
              </dialog>
              <actions>
                <enable_helper not_used="" />
              </actions>
            </answer>
            <answer>
              <dialog>
              </dialog>
              <actions>
                <add_items count="100000" name="money" />
                <store_state />
              </actions>
            </answer>
            <answer>
              <dialog>
              </dialog>
              <actions>
                <add_items count="200000" name="money" />
                <restore_state />
              </actions>
            </answer>
            <answer>
              <dialog>
              </dialog>
              <actions>
                <set_mark mark="win" />
              </actions>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </open_all>

    </sub_quests>

  </open_all_locations>

  <!-- //////////////////// secret_weapon //////////////////// -->
  <secret_weapon enabled_sub_quests="t">

    <enable_condition>
      <day_delay delay="10" id="day_12" />
    </enable_condition>

    <sub_quests>

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

      <!-- t -->
      <t holder="trademan">
        <dialog>
          <phrase
            talker="trademan"
          />
        </dialog>
        <actions>
          <enable_bug_item count="5" item="snail_shell" />
          <next_sub_quest name="w" />
          <add_quest person="trademan" quest_name="secret_weapon" />
          <add_task_count count="5" item="snail_shell" quest_name="secret_weapon" />
        </actions>
      </t>

      <!-- w -->
      <w holder="trademan">
        <dialog>
          <question
            talker="trademan"
          >
            <answer>
              <active_if>
                <have_items count="5" name="snail_shell" />
              </active_if>
              <dialog>
                <phrase
                  talker="trademan"
                />
              </dialog>
              <actions>
                <remove_items count="5" name="snail_shell" />
                <open_next_sub_quest name="e" />
                <add_weapon name="lopata" />
                <set_mark mark="weapon_1" />
              </actions>
            </answer>
            <answer>
              <dialog>
                <phrase
                  talker="trademan"
                />
              </dialog>
              <actions>
                <set_pests_key key="" />
              </actions>
            </answer>
          </question>
        </dialog>
        <actions>
        </actions>
      </w>

    </sub_quests>

  </secret_weapon>

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

    <enable_condition>
      <have_mark mark="exams_disabled" />
      <have_mark mark="win" />
      <quest_status name="anniversary2" status="done" />
      <have_mark mark="found_parrot" />
    </enable_condition>

    <sub_quests>

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

    </sub_quests>

  </start_exams>


</quests>