<name>Merlin</name>
<profession>Expert Teacher of Grey Magic</profession>
<faction>Serenity</faction>
<dialogue>
  <greeting>
    <reply>
      <if>
        <reputation>70</reputation>
      </if>
      <text>Seeking the crown of kingship? No wait - you are the new heroes, right?</text>
      <return>main</return>
    </reply>
    <reply>
      <text>Bothering an old man, are you?</text>
      <return>main</return>
    </reply>
  </greeting>
  <main>
    <option>
      <text>Can you teach us about Grey Magic?</text>
      <npc>
        <reply>
          <text>It is the way of the great Runemasters of old. As a Grey Magic user, you have ways to be secretive, or to turn the land into confusion, if you need to. There are only few who follow the path of the Stars in this age.</text>
          <return>main</return> 
        </reply>
      </npc>
    </option>
    <option>
      <text>I would like to become a Grey Magic Expert.</text>
      <npc>
        <reply>
          <if><grandmaster>Grey Magic</grandmaster></if>
          <text>You already are a grandmaster!!</text>
          <return>main</return> 
        </reply>
        <reply>
          <if><master>Grey Magic</master></if>
          <text>You already are a master!</text>
          <return>main</return> 
        </reply>
        <reply>
          <if><expert>Grey Magic</expert></if>
          <text>You already are an expert, [name].</text>
          <return>main</return> 
        </reply>
        <reply>
          <if><skill>!Grey Magic</skill></if>
          <text>You do not know the skill, [name].</text>
          <return>main</return> 
        </reply>
        <reply>
        <reply>
          <if><expertlevel>!Grey Magic</expertlevel></if>
          <text>You are not good enough yet.</text>
          <return>main</return> 
        </reply>
        <reply>
          <if><gold>!1000</gold></if>
          <text>You cannot afford the fee.</text>
          <return>main</return> 
        </reply>
        <reply>
          <text>Congratulations, [name]!</text>
          <return>main</return> 
          <script>
            <gold>-1000</gold>
            <expert>Grey Magic</expert>
            <log>[name] Grey Magic Expert</log>
          </script>
        </reply>
      </npc>
    </option>
    <option>
      <text>Where can the Master Teacher of Grey Magic be found?</text>
      <npc>
        <reply>
          <text>Go all the way north to the capital of Terrax, and seek Florimel the Fair.</text>
          <return>main</return> 
        </reply>
      </npc>
    </option>
    <option>
      <if><key>swordinstonetouched</key></if>
      <text>What's the deal with those swords in stone?</text>
      <npc>
        <reply>
          <text>They're there to test your destiny, I mean, ahem, your strength, or your wits of the month, as it comes to pass. Pull one out and you can keep it, of course.</text>
          <return>main</return> 
        </reply>
      </npc>
    </option>
    <option>
      <text>Goodbye!</text>
      <npc>
        <reply>
          <return>exit</return> 
        </reply>
      </npc>
    </option>
  </main> 
</dialogue>