XRWS          J]  · EŠext_01.cat ext_01.dat aiscripts/command.fight.enemies.xml 5070 1454987288 c9160b9372ab3cf9253dbd4018db4970
aiscripts/engineer.ai.xml 2228 1457301666 0966f605ee7f070b22ef2b2b1d71768f
aiscripts/fight.attack.object.capital.xml 6206 1456446980 76c2b82479182040560b0e77b019a55a
aiscripts/fight.attack.object.station.xml 2362 1456447188 719ace8155c8c06b7dd27a4cad02d6e6
aiscripts/mining.ship.collect.xml 15206 1454987330 c50a6929d18f6b2537571af230faf7f0
aiscripts/move.escort.capital.xml 10001 1454987365 43a1e6e76d8e31e174c63f3b969ff25a
aiscripts/move.escort.xml 10033 1454987383 008095d13349c44e425ff792299114a1
aiscripts/move.generic.xml 2381 1456775975 912b3d589d3d470ed105695b246d4e1d
aiscripts/move.patrol.xml 4844 1454987405 aef11757273215de91b31299ac1c4c9d
aiscripts/trade.performplayertraderun.xml 4835 1454987415 7305b631cf6e0fc036803fe87da05f70
aiscripts/trade.ship.xml 5120 1454987428 ae36cf66ddafc0ccea517f71c4ae21fe
aiscripts/trade.station.xml 7631 1454105425 a4910c80dd57af70414cb5aa89a16599
Extensions/AutoCrew/md/AutoCrewStation.xml 1709 1461442391 cc91276a07db9f00c7bfe9059355c212
md/Boarding.xml 3131 1454465331 cd3f54aeb75691e3ba0254420685ad19
md/NPC_Shiptrader.xml 2609 1453486180 50a2c1c3c67567516d85e62811a30adb
<?xml version="1.0" encoding="utf-8" ?>
<diff>
  <add sel="//attention[@min='unknown']/actions/do_while[@value='(not $endtime or player.age lt $endtime) and $targetzone.exists']" pos="after">

    <do_if value="(not @$atCount) or ($atCount gt player.age)">
      <set_value name="$atCount" exact="player.age" />
    </do_if>
  
    <!-- skill increase -->
    <do_if value="@this.ship.owner == faction.player and player.age gt ($atCount + 3min)">
      <set_value name="$incChance" exact="5" />
      <set_value name="$atCount" exact="player.age" />
      <do_if value="(@this.type == entitytype.pilot or @this.type == entitytype.commander)">
        <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m or @this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
          <do_if value="true" chance="$incChance">
            <do_any>
              <do_if value="@this.skill.navigation lt 5" weight="42">
                <add_skill entity="this" type="navigation" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.navigation + '* ' + skilltype.navigation.name" />
              </do_if>
              <do_if value="(@this.skill.leadership lt 5 and (@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl)) or (@this.skill.combat lt 5 and (@this.ship.isclass.ship_s or @this.ship.isclass.ship_m))" weight="29">
                <do_if value="@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
                  <add_skill entity="this" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m">
                  <add_skill entity="this" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
              </do_if>
              <do_if value="@this.skill.morale lt 5" weight="29">
                <add_skill entity="this" type="morale" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.morale + '* ' + skilltype.morale.name" />
              </do_if>
            </do_any>
          </do_if>
        </do_if>
      </do_if>

      <do_any>
        <!-- AutoTrain: DO -->
        <do_if value="true" chance="90">
          <do_if value="true" chance="$incChance">
            <do_if value="@this.ship.defencenpc.type == entitytype.defencecontrol">
              <do_any>
                <do_if value="@this.ship.defencenpc.skill.combat lt 5" weight="40">
                  <add_skill entity="this.ship.defencenpc" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.leadership lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.morale lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="morale" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.morale + '* ' + skilltype.morale.name" />
                </do_if>
              </do_any>
            </do_if>
          </do_if>
        </do_if>
        
        <do_if value="@this.ship.engineer.type == entitytype.engineer and @this.ship.engineer.skill.engineering lt 5">
          <do_if value="true" chance="69">
            <do_if value="true" chance="$incChance">
              <add_skill entity="this.ship.engineer" type="engineering" exact="1" />
              <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.engineer.type.name + ' ' + @this.ship.engineer.name + '@' + @this.ship.name + ' ' + this.ship.engineer.skill.engineering + '* ' + skilltype.engineering.name" />
            </do_if>
          </do_if>
        </do_if>
      </do_any>
    </do_if>
  </add>          
  
</diff><?xml version="1.0" encoding="UTF-8"?> 
<diff>
  <add sel="//set_object_hull[@object='$Defensible' and @exact='$Defensible.hullpercentage + $addedhullpercentage']" pos="before">

    <!-- skill increase -->
    <do_if value="true" chance="30">
      <do_if value="@this.ship.owner == faction.player and @this.type == entitytype.engineer">
        <do_if value="@this.skill.engineering lt 5">
          <do_if value="($Defensible.hullpercentage lt $hulldamagelimit) and ($hulldamagelimit le ($Defensible.hullpercentage + $addedhullpercentage))">
            <set_value name="$incChance" exact="(300f / (1 + @this.ship.summary.numturrets + @this.ship.summary.numshields)f)i" />
            <do_if value="true" chance="$incChance">
              <add_skill entity="this" type="engineering" exact="1" />
              <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.engineering + '* ' + skilltype.engineering.name" />
            </do_if>
          </do_if>
        </do_if>
      </do_if>
    </do_if>

  </add>

  
  
  <add sel="//set_object_hull[@object='$CurrentElement' and @exact='$CurrentElement.hullpercentage + $addedhullpercentage']" pos="before">

    <!-- skill increase -->
    <do_if value="true" chance="30">
      <do_if value="@this.ship.owner == faction.player and @this.type == entitytype.engineer">
        <do_if value="@this.skill.engineering lt 5">
          <do_if value="($CurrentElement.hullpercentage lt $hulldamagelimit) and ($hulldamagelimit le ($CurrentElement.hullpercentage + $addedhullpercentage))">
            <set_value name="$incChance" exact="(300f / (1 + @this.ship.summary.numturrets.all + @this.ship.summary.numshields.all)f)i" />
            <do_if value="true" chance="$incChance">
              <add_skill entity="this" type="engineering" exact="1" />
              <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.engineering + '* ' + skilltype.engineering.name" />
            </do_if>
          </do_if>
        </do_if>
      </do_if>
    </do_if>

  </add>
</diff><?xml version="1.0" encoding="UTF-8"?> 
<diff>

  <add sel="(//interrupts)[1]">

    <!-- skill increase -->
    <handler>
      <conditions>
        <event_object_killed_object object="this.ship" />
        <check_value value="@this.ship.owner == faction.player"/>
        <check_value value="@event.param.owner != faction.player"/>
      </conditions>
      <actions>
        <set_value name="$atVictim" exact="event.param"/>
        <do_if value="@$atVictim" chance="50">
          <set_value name="$incChance" exact="0.5f" />
          <do_if value="@$atVictim.isrealclass.ship_xl or @$atVictim.isrealclass.station">
            <set_value name="$incChance" exact="50.0f" />
          </do_if>
          <do_elseif value="@$atVictim.isrealclass.ship_l">
            <set_value name="$incChance" exact="30.0f" />
          </do_elseif>
          <do_elseif value="@$atVictim.isrealclass.ship_m">
            <set_value name="$incChance" exact="6.0f" />
          </do_elseif>
          <do_elseif value="@$atVictim.isrealclass.ship_s">
            <set_value name="$incChance" exact="4.5f" />
          </do_elseif>
          
          <set_value name="$levelMul" exact="1.0f" />
          <do_if value="player.difficulty le level.veryeasy">
            <set_value name="$levelMul" exact="3.0f" />
          </do_if>
          <do_elseif value="player.difficulty le level.easy">
            <set_value name="$levelMul" exact="2.5f" />
          </do_elseif>
          <do_elseif value="player.difficulty == level.medium">
            <set_value name="$levelMul" exact="2.0f" />
          </do_elseif>
          <do_elseif value="player.difficulty == level.hard">
            <set_value name="$levelMul" exact="1.5f" />
          </do_elseif>
          
          <set_value name="$incChance" exact="(($incChance)f * ($levelMul)f * 2.0f)f" />

          <do_if value="$incChance gt 150.0f">
            <set_value name="$incChanceEng" exact="100i" />
          </do_if>
          <do_else>
            <set_value name="$incChanceEng" exact="[(($incChance)f / 1.5f)i, 1i].max" />
          </do_else>

          <do_if value="$incChance gt 83.0f">
            <set_value name="$incChanceCpt" exact="100i" />
          </do_if>
          <do_else>
            <set_value name="$incChanceCpt" exact="[(($incChance)f * 1.2f)i, 1i].max" />
          </do_else>
          
          <do_if value="$incChance gt 100.0f">
            <set_value name="$incChance" exact="100.0f" />
          </do_if>
          

          <do_if value="true" chance="($incChance)i">
            <do_any>
              <do_if value="@this.skill.combat lt 5" weight="42">
                <add_skill entity="this" type="combat" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.combat + '* ' + skilltype.combat.name" />
              </do_if>
              <do_if value="@this.skill.leadership lt 5" weight="29">
                <add_skill entity="this" type="leadership" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.leadership + '* ' + skilltype.leadership.name" />
              </do_if>
              <do_if value="@this.skill.morale lt 5" weight="29">
                <add_skill entity="this" type="morale" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.morale + '* ' + skilltype.morale.name" />
              </do_if>
            </do_any>
          </do_if>

          <do_any>
            <do_if value="true" chance="$incChanceCpt">
              <do_if value="@this.ship.owner == faction.player and @this.ship.commander.type == entitytype.commander">
                <do_any>
                  <do_if value="@this.ship.commander.skill.navigation lt 5" weight="29">
                    <add_skill entity="this.ship.commander" type="navigation" exact="1" />
                    <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.commander.type.name + ' ' + @this.ship.commander.name + '@' + @this.ship.name + ' ' + this.ship.commander.skill.navigation + '* ' + skilltype.navigation.name" />
                  </do_if>
                  <do_if value="@this.ship.commander.skill.leadership lt 5" weight="29">
                    <add_skill entity="this.ship.commander" type="leadership" exact="1" />
                    <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.commander.type.name + ' ' + @this.ship.commander.name + '@' + @this.ship.name + ' ' + this.ship.commander.skill.leadership + '* ' + skilltype.leadership.name" />
                  </do_if>
                  <do_if value="@this.ship.commander.skill.morale lt 5" weight="42">
                    <add_skill entity="this.ship.commander" type="morale" exact="1" />
                    <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.commander.type.name + ' ' + this.ship.commander.name + '@' + @this.ship.name + ' ' + this.ship.commander.skill.morale + '* ' + skilltype.morale.name" />
                  </do_if>
                </do_any>
              </do_if>
            </do_if>

            <do_if value="true" chance="$incChanceEng">
              <do_if value="@this.ship.owner == faction.player and @this.ship.engineer.type == entitytype.engineer">
                <do_if value="@this.ship.engineer.skill.engineering lt 5">
                  <add_skill entity="this.ship.engineer" type="engineering" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.engineer.type.name + ' ' + @this.ship.engineer.name + '@' + @this.ship.name + ' ' + this.ship.engineer.skill.engineering + '* ' + skilltype.engineering.name" />
                </do_if>
              </do_if>
            </do_if>
          </do_any>

        </do_if>

      </actions>
    </handler>
  </add>

</diff><?xml version="1.0" encoding="UTF-8"?> 
<diff>

  <add sel="(//interrupts)[1]">

    <!-- skill increase -->
    <handler>
      <conditions>
        <event_object_killed_object object="this.station" />
        <check_value value="@this.station.owner == faction.player" />
        <check_value value="@event.param.owner != faction.player" />
      </conditions>
      <actions>
        <set_value name="$atVictim" exact="event.param"/>
        <do_if value="@$atVictim">
          <set_value name="$IncChance" exact="0" />
          <do_if value="@$atVictim.isrealclass.ship_xl">
            <set_value name="$IncChance" exact="20" />
          </do_if>
          <do_if value="@$atVictim.isrealclass.ship_l">
            <set_value name="$IncChance" exact="10" />
          </do_if>
          <do_if value="@$atVictim.isrealclass.ship_m">
            <set_value name="$IncChance" exact="2" />
          </do_if>
          <do_if value="@$atVictim.isrealclass.ship_s">
            <set_value name="$IncChance" exact="1" />
          </do_if>
         
          <do_if value="true" chance="$IncChance">
            <do_any>
              <do_if value="@this.skill.combat lt 5" weight="40">
                <add_skill entity="this" type="combat" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.station.name + ' ' + this.skill.combat + '* ' + skilltype.combat.name" />
              </do_if>
              <do_if value="@this.skill.leadership lt 5" weight="30">
                <add_skill entity="this" type="leadership" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.station.name + ' ' + this.skill.leadership + '* ' + skilltype.leadership.name" />
              </do_if>
              <do_if value="@this.skill.morale lt 5" weight="30">
                <add_skill entity="this" type="morale" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.station.name + ' ' + this.skill.morale + '* ' + skilltype.morale.name" />
              </do_if>
            </do_any>
          </do_if>
        </do_if>
      </actions>
    </handler>
  </add>

</diff><?xml version="1.0" encoding="utf-8" ?>
<diff>
  <add sel="//attention[@min='visible']/actions/do_if[@value='$ware.tags.indexof.{tag.liquid}']/do_while[@value='this.ship.cargo.{$ware}.free gt (0.05 * this.ship.cargo.{$ware}.max)']" pos="after">

    <do_if value="(not @$atCount) or ($atCount gt player.age)">
      <set_value name="$atCount" exact="player.age" />
    </do_if>
  
    <!-- skill increase -->
    <do_if value="@this.ship.owner == faction.player and player.age gt ($atCount + 3min)">
      <set_value name="$incChance" exact="6" />
      <set_value name="$atCount" exact="player.age" />
      <do_if value="(@this.type == entitytype.pilot or @this.type == entitytype.commander)">
        <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m or @this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
          <do_if value="true" chance="$incChance">
            <do_any>
              <do_if value="@this.skill.navigation lt 5" weight="42">
                <add_skill entity="this" type="navigation" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.navigation + '* ' + skilltype.navigation.name" />
              </do_if>
              <do_if value="(@this.skill.leadership lt 5 and (@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl)) or (@this.skill.combat lt 5 and (@this.ship.isclass.ship_s or @this.ship.isclass.ship_m))" weight="29">
                <do_if value="@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
                  <add_skill entity="this" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m">
                  <add_skill entity="this" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
              </do_if>
              <do_if value="@this.skill.morale lt 5" weight="29">
                <add_skill entity="this" type="morale" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.morale + '* ' + skilltype.morale.name" />
              </do_if>
            </do_any>
          </do_if>
        </do_if>
      </do_if>

      <do_any>
        <!-- AutoTrain: DO -->
        <do_if value="true" chance="69">
          <do_if value="true" chance="$incChance">
            <do_if value="@this.ship.defencenpc.type == entitytype.defencecontrol">
              <do_any>
                <do_if value="@this.ship.defencenpc.skill.combat lt 5" weight="40">
                  <add_skill entity="this.ship.defencenpc" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.leadership lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.morale lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="morale" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.morale + '* ' + skilltype.morale.name" />
                </do_if>
              </do_any>
            </do_if>
          </do_if>
        </do_if>
        
        <do_if value="@this.ship.engineer.type == entitytype.engineer and @this.ship.engineer.skill.engineering lt 5">
          <do_if value="true" chance="80">
            <do_if value="true" chance="$incChance">
              <add_skill entity="this.ship.engineer" type="engineering" exact="1" />
              <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.engineer.type.name + ' ' + @this.ship.engineer.name + '@' + @this.ship.name + ' ' + this.ship.engineer.skill.engineering + '* ' + skilltype.engineering.name" />
            </do_if>
          </do_if>
        </do_if>
      </do_any>
    </do_if>
  </add>          


  <add sel="//attention[@min='visible']/actions/do_else/do_if[@value='this.ship.isclass.ship_xl or this.ship.isclass.ship_l']/do_while[@value='this.ship.cargo.{$ware}.free gt (0.05 * this.ship.cargo.{$ware}.max)']" pos="after">

    <do_if value="(not @$atCount) or ($atCount gt player.age)">
      <set_value name="$atCount" exact="player.age" />
    </do_if>
  
    <!-- skill increase -->
    <do_if value="@this.ship.owner == faction.player and player.age gt ($atCount + 3min)">
      <set_value name="$incChance" exact="6" />
      <set_value name="$atCount" exact="player.age" />
      <do_if value="(@this.type == entitytype.pilot or @this.type == entitytype.commander)">
        <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m or @this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
          <do_if value="true" chance="$incChance">
            <do_any>
              <do_if value="@this.skill.navigation lt 5" weight="42">
                <add_skill entity="this" type="navigation" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.navigation + '* ' + skilltype.navigation.name" />
              </do_if>
              <do_if value="(@this.skill.leadership lt 5 and (@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl)) or (@this.skill.combat lt 5 and (@this.ship.isclass.ship_s or @this.ship.isclass.ship_m))" weight="29">
                <do_if value="@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
                  <add_skill entity="this" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m">
                  <add_skill entity="this" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
              </do_if>
              <do_if value="@this.skill.morale lt 5" weight="29">
                <add_skill entity="this" type="morale" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.morale + '* ' + skilltype.morale.name" />
              </do_if>
            </do_any>
          </do_if>
        </do_if>
      </do_if>

      <do_any>
        <!-- AutoTrain: DO -->
        <do_if value="true" chance="69">
          <do_if value="true" chance="$incChance">
            <do_if value="@this.ship.defencenpc.type == entitytype.defencecontrol">
              <do_any>
                <do_if value="@this.ship.defencenpc.skill.combat lt 5" weight="40">
                  <add_skill entity="this.ship.defencenpc" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.leadership lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.morale lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="morale" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.morale + '* ' + skilltype.morale.name" />
                </do_if>
              </do_any>
            </do_if>
          </do_if>
        </do_if>
        
        <do_if value="@this.ship.engineer.type == entitytype.engineer and @this.ship.engineer.skill.engineering lt 5">
          <do_if value="true" chance="80">
            <do_if value="true" chance="$incChance">
              <add_skill entity="this.ship.engineer" type="engineering" exact="1" />
              <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.engineer.type.name + ' ' + @this.ship.engineer.name + '@' + @this.ship.name + ' ' + this.ship.engineer.skill.engineering + '* ' + skilltype.engineering.name" />
            </do_if>
          </do_if>
        </do_if>
      </do_any>
    </do_if>
  </add>          


  <add sel="//attention[@min='unknown']/actions/do_while[@value='this.ship.cargo.{$ware}.free gt 0']" pos="after">

    <do_if value="(not @$atCount) or ($atCount gt player.age)">
      <set_value name="$atCount" exact="player.age" />
    </do_if>
  
    <!-- skill increase -->
    <do_if value="@this.ship.owner == faction.player and player.age gt ($atCount + 3min)">
      <set_value name="$incChance" exact="6" />
      <set_value name="$atCount" exact="player.age" />
      <do_if value="(@this.type == entitytype.pilot or @this.type == entitytype.commander)">
        <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m or @this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
          <do_if value="true" chance="$incChance">
            <do_any>
              <do_if value="@this.skill.navigation lt 5" weight="42">
                <add_skill entity="this" type="navigation" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.navigation + '* ' + skilltype.navigation.name" />
              </do_if>
              <do_if value="(@this.skill.leadership lt 5 and (@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl)) or (@this.skill.combat lt 5 and (@this.ship.isclass.ship_s or @this.ship.isclass.ship_m))" weight="29">
                <do_if value="@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
                  <add_skill entity="this" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m">
                  <add_skill entity="this" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
              </do_if>
              <do_if value="@this.skill.morale lt 5" weight="29">
                <add_skill entity="this" type="morale" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.morale + '* ' + skilltype.morale.name" />
              </do_if>
            </do_any>
          </do_if>
        </do_if>
      </do_if>

      <do_any>
        <!-- AutoTrain: DO -->
        <do_if value="true" chance="69">
          <do_if value="true" chance="$incChance">
            <do_if value="@this.ship.defencenpc.type == entitytype.defencecontrol">
              <do_any>
                <do_if value="@this.ship.defencenpc.skill.combat lt 5" weight="40">
                  <add_skill entity="this.ship.defencenpc" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.leadership lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.morale lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="morale" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.morale + '* ' + skilltype.morale.name" />
                </do_if>
              </do_any>
            </do_if>
          </do_if>
        </do_if>
        
        <do_if value="@this.ship.engineer.type == entitytype.engineer and @this.ship.engineer.skill.engineering lt 5">
          <do_if value="true" chance="80">
            <do_if value="true" chance="$incChance">
              <add_skill entity="this.ship.engineer" type="engineering" exact="1" />
              <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.engineer.type.name + ' ' + @this.ship.engineer.name + '@' + @this.ship.name + ' ' + this.ship.engineer.skill.engineering + '* ' + skilltype.engineering.name" />
            </do_if>
          </do_if>
        </do_if>
      </do_any>
    </do_if>
  </add>          

  
</diff><?xml version="1.0" encoding="utf-8" ?>
<diff>
  <add sel="//attention[@min='visible']/actions/do_while[@value='$target.isoperational and @$target.pilot']" pos="after">

    <do_if value="(not @$atCount) or ($atCount gt player.age)">
      <set_value name="$atCount" exact="player.age" />
    </do_if>
  
    <!-- skill increase -->
    <do_if value="@this.ship.owner == faction.player and player.age gt ($atCount + 170s)">
      <set_value name="$incChance" exact="5" />
      <set_value name="$atCount" exact="player.age" />
      <do_if value="(@this.type == entitytype.pilot or @this.type == entitytype.commander)">
        <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m or @this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
          <do_if value="true" chance="$incChance">
            <do_any>
              <do_if value="@this.skill.navigation lt 5" weight="42">
                <add_skill entity="this" type="navigation" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.navigation + '* ' + skilltype.navigation.name" />
              </do_if>
              <do_if value="(@this.skill.leadership lt 5 and (@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl)) or (@this.skill.combat lt 5 and (@this.ship.isclass.ship_s or @this.ship.isclass.ship_m))" weight="29">
                <do_if value="@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
                  <add_skill entity="this" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m">
                  <add_skill entity="this" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
              </do_if>
              <do_if value="@this.skill.morale lt 5" weight="29">
                <add_skill entity="this" type="morale" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.morale + '* ' + skilltype.morale.name" />
              </do_if>
            </do_any>
          </do_if>
        </do_if>
      </do_if>

      <do_any>
        <!-- AutoTrain: DO -->
        <do_if value="true" chance="90">
          <do_if value="true" chance="$incChance">
            <do_if value="@this.ship.defencenpc.type == entitytype.defencecontrol">
              <do_any>
                <do_if value="@this.ship.defencenpc.skill.combat lt 5" weight="40">
                  <add_skill entity="this.ship.defencenpc" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.leadership lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.morale lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="morale" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.morale + '* ' + skilltype.morale.name" />
                </do_if>
              </do_any>
            </do_if>
          </do_if>
        </do_if>
        
        <do_if value="@this.ship.engineer.type == entitytype.engineer and @this.ship.engineer.skill.engineering lt 5">
          <do_if value="true" chance="69">
            <do_if value="true" chance="$incChance">
              <add_skill entity="this.ship.engineer" type="engineering" exact="1" />
              <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.engineer.type.name + ' ' + @this.ship.engineer.name + '@' + @this.ship.name + ' ' + this.ship.engineer.skill.engineering + '* ' + skilltype.engineering.name" />
            </do_if>
          </do_if>
        </do_if>
      </do_any>
    </do_if>
  </add>          

  <add sel="//attention[@min='unknown']/actions/label[@name='start']" pos="after">

    <do_if value="(not @$atCount) or ($atCount gt player.age)">
      <set_value name="$atCount" exact="player.age" />
    </do_if>
  
    <!-- skill increase -->
    <do_if value="@this.ship.owner == faction.player and player.age gt ($atCount + 150s)">
      <set_value name="$incChance" exact="6" />
      <set_value name="$atCount" exact="player.age" />
      <do_if value="(@this.type == entitytype.pilot or @this.type == entitytype.commander)">
        <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m or @this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
          <do_if value="true" chance="$incChance">
            <do_any>
              <do_if value="@this.skill.navigation lt 5" weight="42">
                <add_skill entity="this" type="navigation" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.navigation + '* ' + skilltype.navigation.name" />
              </do_if>
              <do_if value="(@this.skill.leadership lt 5 and (@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl)) or (@this.skill.combat lt 5 and (@this.ship.isclass.ship_s or @this.ship.isclass.ship_m))" weight="29">
                <do_if value="@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
                  <add_skill entity="this" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m">
                  <add_skill entity="this" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
              </do_if>
              <do_if value="@this.skill.morale lt 5" weight="29">
                <add_skill entity="this" type="morale" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.morale + '* ' + skilltype.morale.name" />
              </do_if>
            </do_any>
          </do_if>
        </do_if>
      </do_if>

      <do_any>
        <!-- AutoTrain: DO -->
        <do_if value="true" chance="90">
          <do_if value="true" chance="$incChance">
            <do_if value="@this.ship.defencenpc.type == entitytype.defencecontrol">
              <do_any>
                <do_if value="@this.ship.defencenpc.skill.combat lt 5" weight="40">
                  <add_skill entity="this.ship.defencenpc" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.leadership lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.morale lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="morale" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.morale + '* ' + skilltype.morale.name" />
                </do_if>
              </do_any>
            </do_if>
          </do_if>
        </do_if>
        
        <do_if value="@this.ship.engineer.type == entitytype.engineer and @this.ship.engineer.skill.engineering lt 5">
          <do_if value="true" chance="69">
            <do_if value="true" chance="$incChance">
              <add_skill entity="this.ship.engineer" type="engineering" exact="1" />
              <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.engineer.type.name + ' ' + @this.ship.engineer.name + '@' + @this.ship.name + ' ' + this.ship.engineer.skill.engineering + '* ' + skilltype.engineering.name" />
            </do_if>
          </do_if>
        </do_if>
      </do_any>
    </do_if>
  </add>          
  
  
</diff><?xml version="1.0" encoding="utf-8" ?>
<diff>
  <add sel="//attention[@min='visible']/actions/do_while[@value='$target.isoperational and @$target.pilot']" pos="after">

    <do_if value="(not @$atCount) or ($atCount gt player.age)">
      <set_value name="$atCount" exact="player.age" />
    </do_if>
  
    <!-- skill increase -->
    <do_if value="@this.ship.owner == faction.player and player.age gt ($atCount + 170s)">
      <set_value name="$incChance" exact="5" />
      <set_value name="$atCount" exact="player.age" />
      <do_if value="(@this.type == entitytype.pilot or @this.type == entitytype.commander)">
        <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m or @this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
          <do_if value="true" chance="$incChance">
            <do_any>
              <do_if value="@this.skill.navigation lt 5" weight="42">
                <add_skill entity="this" type="navigation" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.navigation + '* ' + skilltype.navigation.name" />
              </do_if>
              <do_if value="(@this.skill.leadership lt 5 and (@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl)) or (@this.skill.combat lt 5 and (@this.ship.isclass.ship_s or @this.ship.isclass.ship_m))" weight="29">
                <do_if value="@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
                  <add_skill entity="this" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m">
                  <add_skill entity="this" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
              </do_if>
              <do_if value="@this.skill.morale lt 5" weight="29">
                <add_skill entity="this" type="morale" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.morale + '* ' + skilltype.morale.name" />
              </do_if>
            </do_any>
          </do_if>
        </do_if>
      </do_if>

      <do_any>
        <!-- AutoTrain: DO -->
        <do_if value="true" chance="90">
          <do_if value="true" chance="$incChance">
            <do_if value="@this.ship.defencenpc.type == entitytype.defencecontrol">
              <do_any>
                <do_if value="@this.ship.defencenpc.skill.combat lt 5" weight="40">
                  <add_skill entity="this.ship.defencenpc" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.leadership lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.morale lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="morale" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.morale + '* ' + skilltype.morale.name" />
                </do_if>
              </do_any>
            </do_if>
          </do_if>
        </do_if>
        
        <!-- AutoTrain: En -->
        <do_if value="@this.ship.engineer.type == entitytype.engineer and @this.ship.engineer.skill.engineering lt 5">
          <do_if value="true" chance="69">
            <do_if value="true" chance="$incChance">
              <add_skill entity="this.ship.engineer" type="engineering" exact="1" />
              <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.engineer.type.name + ' ' + @this.ship.engineer.name + '@' + @this.ship.name + ' ' + this.ship.engineer.skill.engineering + '* ' + skilltype.engineering.name" />
            </do_if>
          </do_if>
        </do_if>
      </do_any>
    </do_if>
  </add>          

  <add sel="//attention[@min='unknown']/actions/label[@name='start']" pos="after">

    <do_if value="(not @$atCount) or ($atCount gt player.age)">
      <set_value name="$atCount" exact="player.age" />
    </do_if>
  
    <!-- skill increase -->
    <do_if value="@this.ship.owner == faction.player and player.age gt ($atCount + 150s)">
      <set_value name="$incChance" exact="6" />
      <set_value name="$atCount" exact="player.age" />
      <do_if value="(@this.type == entitytype.pilot or @this.type == entitytype.commander)">
        <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m or @this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
          <do_if value="true" chance="$incChance">
            <do_any>
              <do_if value="@this.skill.navigation lt 5" weight="42">
                <add_skill entity="this" type="navigation" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.navigation + '* ' + skilltype.navigation.name" />
              </do_if>
              <do_if value="(@this.skill.leadership lt 5 and (@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl)) or (@this.skill.combat lt 5 and (@this.ship.isclass.ship_s or @this.ship.isclass.ship_m))" weight="29">
                <do_if value="@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
                  <add_skill entity="this" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m">
                  <add_skill entity="this" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
              </do_if>
              <do_if value="@this.skill.morale lt 5" weight="29">
                <add_skill entity="this" type="morale" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.morale + '* ' + skilltype.morale.name" />
              </do_if>
            </do_any>
          </do_if>
        </do_if>
      </do_if>

      <do_any>
        <!-- AutoTrain: DO -->
        <do_if value="true" chance="90">
          <do_if value="true" chance="$incChance">
            <do_if value="@this.ship.defencenpc.type == entitytype.defencecontrol">
              <do_any>
                <do_if value="@this.ship.defencenpc.skill.combat lt 5" weight="40">
                  <add_skill entity="this.ship.defencenpc" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.leadership lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.morale lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="morale" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.morale + '* ' + skilltype.morale.name" />
                </do_if>
              </do_any>
            </do_if>
          </do_if>
        </do_if>
        
        <do_if value="@this.ship.engineer.type == entitytype.engineer and @this.ship.engineer.skill.engineering lt 5">
          <do_if value="true" chance="69">
            <do_if value="true" chance="$incChance">
              <add_skill entity="this.ship.engineer" type="engineering" exact="1" />
              <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.engineer.type.name + ' ' + @this.ship.engineer.name + '@' + @this.ship.name + ' ' + this.ship.engineer.skill.engineering + '* ' + skilltype.engineering.name" />
            </do_if>
          </do_if>
        </do_if>
      </do_any>
    </do_if>
  </add>          
  
  
</diff><?xml version="1.0" encoding="utf-8" ?>
<diff>
  <add sel="//attention[@min='unknown']/actions/stop_boost[@object='this.ship']" pos="after">

    <!-- skill increase -->
    <set_value name="$IncChance" exact="13" />
    <do_if value="@this.ship.owner == faction.player and (@this.type == entitytype.pilot or @this.type == entitytype.commander)">
      <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m or @this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
        <do_if value="true" chance="$IncChance">
          <do_any>
            <do_if value="@this.skill.navigation lt 5" weight="42">
              <add_skill entity="this" type="navigation" exact="1" />
              <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.navigation + '* ' + skilltype.navigation.name" />
            </do_if>
            <do_if value="(@this.skill.leadership lt 5 and (@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl)) or (@this.skill.combat lt 5 and (@this.ship.isclass.ship_s or @this.ship.isclass.ship_m))" weight="29">
              <do_if value="@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
                <add_skill entity="this" type="leadership" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.leadership + '* ' + skilltype.leadership.name" />
              </do_if>
              <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m">
                <add_skill entity="this" type="combat" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.combat + '* ' + skilltype.combat.name" />
              </do_if>
            </do_if>
            <do_if value="@this.skill.morale lt 5" weight="29">
              <add_skill entity="this" type="morale" exact="1" />
              <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.morale + '* ' + skilltype.morale.name" />
            </do_if>
          </do_any>
        </do_if>
      </do_if>
    </do_if>

  </add>          

</diff><?xml version="1.0" encoding="utf-8" ?>
<diff>
  <add sel="//run_script[contains(@name,'move.seekenemies')]" pos="after">

    <do_if value="(not @$atCount) or ($atCount gt player.age)">
      <set_value name="$atCount" exact="player.age" />
    </do_if>

    <do_if value="@this.ship.owner == faction.player and player.age gt ($atCount + 170s)">
      <!-- skill increase -->
      <set_value name="$atCount" exact="player.age" />
      <set_value name="$incChance" exact="5" />
      <do_if value="true" chance="$incChance">
        <do_if value="@this.type == entitytype.pilot or @this.type == entitytype.commander">
          <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m or @this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
            <do_any>
              <do_if value="@this.skill.navigation lt 5" weight="42">
                <add_skill entity="this" type="navigation" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.navigation + '* ' + skilltype.navigation.name" />
              </do_if>
              <do_if value="(@this.skill.leadership lt 5 and (@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl)) or (@this.skill.combat lt 5 and (@this.ship.isclass.ship_s or @this.ship.isclass.ship_m))" weight="29">
                <do_if value="@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
                  <add_skill entity="this" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m">
                  <add_skill entity="this" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
              </do_if>
              <do_if value="@this.skill.morale lt 5" weight="29">
                <add_skill entity="this" type="morale" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + this.name + '@' + @this.ship.name + ' ' + this.skill.morale + '* ' + skilltype.morale.name" />
              </do_if>
            </do_any>
          </do_if>
        </do_if>
      </do_if>

      <!-- AutoTrain: DO -->
      <do_if value="true" chance="$incChance+2">
        <do_if value="@this.ship.defencenpc.type == entitytype.defencecontrol">
          <do_any>
            <do_if value="@this.ship.defencenpc.skill.combat lt 5" weight="40">
              <add_skill entity="this.ship.defencenpc" type="combat" exact="1" />
              <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.combat + '* ' + skilltype.combat.name" />
            </do_if>
            <do_if value="@this.ship.defencenpc.skill.leadership lt 5" weight="30">
              <add_skill entity="this.ship.defencenpc" type="leadership" exact="1" />
              <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.leadership + '* ' + skilltype.leadership.name" />
            </do_if>
            <do_if value="@this.ship.defencenpc.skill.morale lt 5" weight="30">
              <add_skill entity="this.ship.defencenpc" type="morale" exact="1" />
              <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.morale + '* ' + skilltype.morale.name" />
            </do_if>
          </do_any>
        </do_if>
      </do_if>

      <do_if value="@this.ship.engineer.type == entitytype.engineer and @this.ship.engineer.skill.engineering lt 5">
        <do_if value="true" chance="40">
          <do_if value="@this.ship.engineer.skill.engineering lt 5" chance="$incChance">
            <add_skill entity="this.ship.engineer" type="engineering" exact="1" />
            <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.engineer.type.name + ' ' + @this.ship.engineer.name + '@' + @this.ship.name + ' ' + this.ship.engineer.skill.engineering + '* ' + skilltype.engineering.name" />
          </do_if>
        </do_if>
      </do_if>
    </do_if>
  </add>          

</diff><?xml version="1.0" encoding="utf-8" ?>
<diff>

  <add sel="//attention[@min='unknown']/actions/do_if[@value='$traderesult']/set_value[@name='$price' and @exact='0Cr']" pos="after">

    <!-- skill increase -->
    <do_if value="@this.ship.owner == faction.player">
      <set_value name="$incChance" exact="14" />
      <do_if value="(@this.type == entitytype.pilot or @this.type == entitytype.commander)">
        <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m or @this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
          <do_if value="true" chance="$incChance">
            <do_any>
              <do_if value="@this.skill.navigation lt 5" weight="42">
                <add_skill entity="this" type="navigation" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.navigation + '* ' + skilltype.navigation.name" />
              </do_if>
              <do_if value="(@this.skill.leadership lt 5 and (@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl)) or (@this.skill.combat lt 5 and (@this.ship.isclass.ship_s or @this.ship.isclass.ship_m))" weight="29">
                <do_if value="@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
                  <add_skill entity="this" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m">
                  <add_skill entity="this" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
              </do_if>
              <do_if value="@this.skill.morale lt 5" weight="29">
                <add_skill entity="this" type="morale" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.morale + '* ' + skilltype.morale.name" />
              </do_if>
            </do_any>
          </do_if>
        </do_if>
      </do_if>

      <do_any>
        <!-- AutoTrain: DO -->
        <do_if value="true" chance="60">
          <do_if value="true" chance="$incChance">
            <do_if value="@this.ship.defencenpc.type == entitytype.defencecontrol">
              <do_any>
                <do_if value="@this.ship.defencenpc.skill.combat lt 5" weight="40">
                  <add_skill entity="this.ship.defencenpc" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.leadership lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.morale lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="morale" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.morale + '* ' + skilltype.morale.name" />
                </do_if>
              </do_any>
            </do_if>
          </do_if>
        </do_if>
        
        <do_if value="@this.ship.engineer.type == entitytype.engineer and @this.ship.engineer.skill.engineering lt 5">
          <do_if value="true" chance="80">
            <do_if value="true" chance="$incChance">
              <add_skill entity="this.ship.engineer" type="engineering" exact="1" />
              <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.engineer.type.name + ' ' + @this.ship.engineer.name + '@' + @this.ship.name + ' ' + this.ship.engineer.skill.engineering + '* ' + skilltype.engineering.name" />
            </do_if>
          </do_if>
        </do_if>
      </do_any>
    </do_if>
  </add>          
  
  
</diff><?xml version="1.0" encoding="utf-8" ?>
<diff>
  <add sel="//do_while[@value='$selloffer.available or $buyoffer.available']/do_if[@value='not $success']" pos="after">

    <do_if value="(not @$atCount) or ($atCount gt player.age)">
      <set_value name="$atCount" exact="player.age" />
    </do_if>

    <!-- skill increase -->
    <do_if value="$success">
      <do_if value="@this.ship.owner == faction.player and player.age gt ($atCount + 150s)">
        <set_value name="$incChance" exact="5" />
        <set_value name="$atCount" exact="player.age" />
        <do_if value="(@this.type == entitytype.pilot or @this.type == entitytype.commander)">
          <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m or @this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
            <do_if value="true" chance="$incChance">
              <do_any>
                <do_if value="@this.skill.navigation lt 5" weight="42">
                  <add_skill entity="this" type="navigation" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.navigation + '* ' + skilltype.navigation.name" />
                </do_if>
                <do_if value="(@this.skill.leadership lt 5 and (@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl)) or (@this.skill.combat lt 5 and (@this.ship.isclass.ship_s or @this.ship.isclass.ship_m))" weight="29">
                  <do_if value="@this.ship.isclass.ship_l or @this.ship.isclass.ship_xl">
                    <add_skill entity="this" type="leadership" exact="1" />
                    <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.leadership + '* ' + skilltype.leadership.name" />
                  </do_if>
                  <do_if value="@this.ship.isclass.ship_s or @this.ship.isclass.ship_m">
                    <add_skill entity="this" type="combat" exact="1" />
                    <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.combat + '* ' + skilltype.combat.name" />
                  </do_if>
                </do_if>
                <do_if value="@this.skill.morale lt 5" weight="29">
                  <add_skill entity="this" type="morale" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.ship.name + ' ' + this.skill.morale + '* ' + skilltype.morale.name" />
                </do_if>
              </do_any>
            </do_if>
          </do_if>
        </do_if>

        <!-- AutoTrain: DO -->
        <do_if value="true" chance="69">
          <do_if value="true" chance="$incChance">
            <do_if value="@this.ship.defencenpc.type == entitytype.defencecontrol">
              <do_any>
                <do_if value="@this.ship.defencenpc.skill.combat lt 5" weight="40">
                  <add_skill entity="this.ship.defencenpc" type="combat" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.combat + '* ' + skilltype.combat.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.leadership lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="leadership" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.leadership + '* ' + skilltype.leadership.name" />
                </do_if>
                <do_if value="@this.ship.defencenpc.skill.morale lt 5" weight="30">
                  <add_skill entity="this.ship.defencenpc" type="morale" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.defencenpc.type.name + ' ' + @this.ship.defencenpc.name + '@' + @this.ship.name + ' ' + this.ship.defencenpc.skill.morale + '* ' + skilltype.morale.name" />
                </do_if>
              </do_any>
            </do_if>
          </do_if>
        </do_if>
        
        <do_if value="@this.ship.engineer.type == entitytype.engineer and @this.ship.engineer.skill.engineering lt 5">
          <do_if value="true" chance="80">
            <do_if value="true" chance="$incChance">
              <add_skill entity="this.ship.engineer" type="engineering" exact="1" />
              <write_to_logbook category="general" text="'AutoTrain: ' + @this.ship.engineer.type.name + ' ' + @this.ship.engineer.name + '@' + @this.ship.name + ' ' + this.ship.engineer.skill.engineering + '* ' + skilltype.engineering.name" />
            </do_if>
          </do_if>
        </do_if>
      
      </do_if>
    </do_if>
  </add>          

</diff><?xml version="1.0" encoding="utf-8" ?>
<diff>
  <add sel="//set_command_action[@commandaction='commandaction.searchingtrades']" pos="after">

    <!-- skill increase -->
    <do_if value="@this.station.owner == faction.player">
      <set_value name="$incChance" exact="2" />
      <do_if value="true" chance="$incChance">
     
        <!-- AutoTrain: Manager -->
        <do_if value="true" chance="13">
          <do_if value="@this.station.owner == faction.player and @this.type == entitytype.manager">
            <do_any>
              <do_if value="@this.skill.leadership lt 5">
                <add_skill entity="this" type="leadership" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.station.name + ' ' + this.skill.leadership + '* ' + skilltype.leadership.name" />
              </do_if>
              <do_if value="@this.skill.management lt 5">
                <add_skill entity="this" type="management" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.station.name + ' ' + this.skill.management + '* ' + skilltype.management.name" />
              </do_if>
              <do_if value="@this.skill.navigation lt 5">
                <add_skill entity="this" type="navigation" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.type.name + ' ' + @this.name + '@' + @this.station.name + ' ' + this.skill.navigation + '* ' + skilltype.navigation.name" />
              </do_if>
            </do_any>
          </do_if>
        </do_if>

        <!-- AutoTrain: DO -->
        <do_if value="true" chance="13">
          <do_if value="@this.station.owner == faction.player and @this.station.defencenpc.type == entitytype.defencecontrol">
            <do_any>
              <do_if value="@this.station.defencenpc.skill.combat lt 5" weight="40">
                <add_skill entity="this.station.defencenpc" type="combat" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.station.defencenpc.type.name + ' ' + @this.station.defencenpc.name + '@' + @this.station.name + ' ' + this.station.defencenpc.skill.combat + '* ' + skilltype.combat.name" />
              </do_if>
              <do_if value="@this.station.defencenpc.skill.leadership lt 5" weight="30">
                <add_skill entity="this.station.defencenpc" type="leadership" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.station.defencenpc.type.name + ' ' + @this.station.defencenpc.name + '@' + @this.station.name + ' ' + this.station.defencenpc.skill.leadership + '* ' + skilltype.leadership.name" />
              </do_if>
              <do_if value="@this.station.defencenpc.skill.morale lt 5" weight="30">
                <add_skill entity="this.station.defencenpc" type="morale" exact="1" />
                <write_to_logbook category="general" text="'AutoTrain: ' + @this.station.defencenpc.type.name + ' ' + @this.station.defencenpc.name + '@' + @this.station.name + ' ' + this.station.defencenpc.skill.morale + '* ' + skilltype.morale.name" />
              </do_if>
            </do_any>
          </do_if>
        </do_if>
        
        
        <do_if value="true" chance="40">
          <get_production_specialist_types name="$Speci" object="this.station"/>
          <do_all exact="$Speci.count" counter="$cntSpec">
            <set_value name="$sType" exact="$Speci.{$cntSpec}" />
            <set_value name="$sEntity" exact="@this.station.controlentity.{$sType}" />
            <do_if value="@$sEntity" chance="25">
              <do_any>
                <do_if value="@$sEntity.skill.engineering lt 5" weight="50">
                  <add_skill entity="$sEntity" type="engineering" exact="1" />
                  <write_to_logbook category="general" text="'AutoTrain: ' + @$sEntity.type.name + ' ' + @$sEntity.name + '@' + @this.station.name + ' ' + $sEntity.skill.engineering + '* ' + skilltype.engineering.name" />
                </do_if>
                <do_if value="true" weight="50">
                  <do_if value="@$sEntity.skill.morale lt 5">
                    <add_skill entity="$sEntity" type="morale" exact="1" />
                    <do_if value="@$sEntity.skill.navigation == 5 and @$sEntity.skill.science == 5 and @$sEntity.skill.combat == 5 and @$sEntity.skill.leadership == 5 and @$sEntity.skill.management == 5">
                      <write_to_logbook category="general" text="'AutoTrain: ' + @$sEntity.type.name + ' ' + @$sEntity.name + '@' + @this.station.name + ' ' + $sEntity.skill.morale + '* ' + skilltype.morale.name" />
                    </do_if>
                  </do_if>
                  <do_if value="@$sEntity.skill.management lt 5">
                    <add_skill entity="$sEntity" type="management" exact="1" />
                    <do_if value="@$sEntity.skill.navigation == 5 and @$sEntity.skill.science == 5 and @$sEntity.skill.combat == 5 and @$sEntity.skill.leadership == 5">
                      <write_to_logbook category="general" text="'AutoTrain: ' + @$sEntity.type.name + ' ' + @$sEntity.name + '@' + @this.station.name + ' ' + $sEntity.skill.management + '* ' + skilltype.management.name" />
                    </do_if>
                  </do_if>
                  <do_if value="@$sEntity.skill.leadership lt 5">
                    <add_skill entity="$sEntity" type="leadership" exact="1" />
                    <do_if value="@$sEntity.skill.navigation == 5 and @$sEntity.skill.science == 5 and @$sEntity.skill.combat == 5">
                      <write_to_logbook category="general" text="'AutoTrain: ' + @$sEntity.type.name + ' ' + @$sEntity.name + '@' + @this.station.name + ' ' + $sEntity.skill.leadership + '* ' + skilltype.leadership.name" />
                    </do_if>
                  </do_if>
                  <do_if value="@$sEntity.skill.combat lt 5">
                    <add_skill entity="$sEntity" type="combat" exact="1" />
                    <do_if value="@$sEntity.skill.navigation == 5 and @$sEntity.skill.science == 5">
                      <write_to_logbook category="general" text="'AutoTrain: ' + @$sEntity.type.name + ' ' + @$sEntity.name + '@' + @this.station.name + ' ' + $sEntity.skill.combat + '* ' + skilltype.combat.name" />
                    </do_if>
                  </do_if>
                  <do_if value="@$sEntity.skill.navigation lt 5">
                    <add_skill entity="$sEntity" type="navigation" exact="1" />
                    <do_if value="@$sEntity.skill.science == 5">
                      <write_to_logbook category="general" text="'AutoTrain: ' + @$sEntity.type.name + ' ' + @$sEntity.name + '@' + @this.station.name + ' ' + $sEntity.skill.navigation + '* ' + skilltype.navigation.name" />
                    </do_if>
                  </do_if>
                  <do_if value="@$sEntity.skill.science lt 5">
                    <add_skill entity="$sEntity" type="science" exact="1" />
                    <write_to_logbook category="general" text="'AutoTrain: ' + @$sEntity.type.name + ' ' + @$sEntity.name + '@' + @this.station.name + ' ' + $sEntity.skill.science + '* ' + skilltype.science.name" />
                  </do_if>
                </do_if>
              </do_any>
            </do_if>
          </do_all>
        </do_if>
        
      </do_if>
      
    </do_if>
    
  </add>          

</diff><?xml version="1.0" encoding="UTF-8"?> 
<diff> 
  <replace silent="true" sel="//create_platform_actor[@type='entitytype.defencecontrol']/skills/skill[@type='combat']/@min">1</replace>
  <replace silent="true" sel="//create_platform_actor[@type='entitytype.defencecontrol']/skills/skill[@type='combat']/@max">4</replace>
  <replace silent="true" sel="//create_platform_actor[@type='entitytype.defencecontrol']/skills/skill[@type='leadership']/@min">1</replace>
  <replace silent="true" sel="//create_platform_actor[@type='entitytype.defencecontrol']/skills/skill[@type='leadership']/@max">4</replace>
  <replace silent="true" sel="//create_platform_actor[@type='entitytype.defencecontrol']/skills/skill[@type='morale']/@min">1</replace>
  <replace silent="true" sel="//create_platform_actor[@type='entitytype.defencecontrol']/skills/skill[@type='morale']/@max">4</replace>

  <replace silent="true" sel="//create_platform_actor[@type='entitytype.manager']/skills/skill[@type='navigation']/@min">1</replace>
  <replace silent="true" sel="//create_platform_actor[@type='entitytype.manager']/skills/skill[@type='navigation']/@max">4</replace>
  <replace silent="true" sel="//create_platform_actor[@type='entitytype.manager']/skills/skill[@type='leadership']/@min">1</replace>
  <replace silent="true" sel="//create_platform_actor[@type='entitytype.manager']/skills/skill[@type='leadership']/@max">4</replace>
  <replace silent="true" sel="//create_platform_actor[@type='entitytype.manager']/skills/skill[@type='management']/@min">1</replace>
  <replace silent="true" sel="//create_platform_actor[@type='entitytype.manager']/skills/skill[@type='management']/@max">4</replace>
</diff>              
<?xml version="1.0" encoding="UTF-8"?> 
<diff> 
  <replace silent="true" sel="//create_platform_actor[@name='$NHEngineer' and @type='entitytype.engineer']/skills/skill[@type='engineering']/@min">1</replace>
  <replace silent="true" sel="//create_platform_actor[@name='$NHEngineer' and @type='entitytype.engineer']/skills/skill[@type='engineering']/@max">4</replace>

  <replace silent="true" sel="//create_platform_actor[@name='$NHDefenceNPC' and @type='entitytype.defencecontrol']/skills/skill[@type='combat']/@min">1</replace>
  <replace silent="true" sel="//create_platform_actor[@name='$NHDefenceNPC' and @type='entitytype.defencecontrol']/skills/skill[@type='combat']/@max">4</replace>
  <replace silent="true" sel="//create_platform_actor[@name='$NHDefenceNPC' and @type='entitytype.defencecontrol']/skills/skill[@type='leadership']/@min">1</replace>
  <replace silent="true" sel="//create_platform_actor[@name='$NHDefenceNPC' and @type='entitytype.defencecontrol']/skills/skill[@type='leadership']/@max">4</replace>
  <replace silent="true" sel="//create_platform_actor[@name='$NHDefenceNPC' and @type='entitytype.defencecontrol']/skills/skill[@type='morale']/@min">1</replace>
  <replace silent="true" sel="//create_platform_actor[@name='$NHDefenceNPC' and @type='entitytype.defencecontrol']/skills/skill[@type='morale']/@max">4</replace>

  <replace silent="true" sel="//create_cue_actor[@cue='this' and @group='argon.pilot']/skills/skill[@type='navigation']/@min">1</replace>
  <replace silent="true" sel="//create_cue_actor[@cue='this' and @group='argon.pilot']/skills/skill[@type='navigation']/@max">4</replace>
  <replace silent="true" sel="//create_cue_actor[@cue='this' and @group='argon.pilot']/skills/skill[@type='leadership']/@min">1</replace>
  <replace silent="true" sel="//create_cue_actor[@cue='this' and @group='argon.pilot']/skills/skill[@type='leadership']/@max">4</replace>
  <replace silent="true" sel="//create_cue_actor[@cue='this' and @group='argon.pilot']/skills/skill[@type='morale']/@min">1</replace>
  <replace silent="true" sel="//create_cue_actor[@cue='this' and @group='argon.pilot']/skills/skill[@type='morale']/@max">4</replace>
  
  <add sel="//cue[@name='Success']/actions/do_if[@value='$commander.skill.boarding lt 5']" pos="after">

    <do_if value="true" chance="42">
      <do_any>
        <do_if value="@$commander.skill.leadership lt 5">
          <add_skill entity="$commander" type="leadership" exact="1" />
          <write_to_logbook category="general" text="'AutoTrain: ' + @$commander.type.name + ' ' + @$commander.name + '@' + @$target.name + ' ' + $commander.skill.leadership + '* ' + skilltype.leadership.name" />
        </do_if>
        <do_if value="@$commander.skill.morale lt 5">
          <add_skill entity="$commander" type="morale" exact="1" />
          <write_to_logbook category="general" text="'AutoTrain: ' + @$commander.type.name + ' ' + @$commander.name + '@' + @$target.name + ' ' + $commander.skill.morale + '* ' + skilltype.morale.name" />
        </do_if>
      </do_any>
    </do_if>
  
  </add>
</diff>              
<?xml version="1.0" encoding="UTF-8"?> 
<diff> 
  <replace silent="true" sel="//do_if[@value='not $upgrade? and not $component?']/create_platform_actor[@name='$NHEngineer' and @type='entitytype.engineer']/skills/skill[@type='engineering']/@min">1</replace>
  <replace silent="true" sel="//do_if[@value='not $upgrade? and not $component?']/create_platform_actor[@name='$NHEngineer' and @type='entitytype.engineer']/skills/skill[@type='engineering']/@max">4</replace>

  <replace silent="true" sel="//do_if[@value='not $upgrade? and not $component?']/create_platform_actor[@name='$NHDefenceNPC' and @type='entitytype.defencecontrol']/skills/skill[@type='combat']/@min">1</replace>
  <replace silent="true" sel="//do_if[@value='not $upgrade? and not $component?']/create_platform_actor[@name='$NHDefenceNPC' and @type='entitytype.defencecontrol']/skills/skill[@type='combat']/@max">4</replace>
  <replace silent="true" sel="//do_if[@value='not $upgrade? and not $component?']/create_platform_actor[@name='$NHDefenceNPC' and @type='entitytype.defencecontrol']/skills/skill[@type='leadership']/@min">1</replace>
  <replace silent="true" sel="//do_if[@value='not $upgrade? and not $component?']/create_platform_actor[@name='$NHDefenceNPC' and @type='entitytype.defencecontrol']/skills/skill[@type='leadership']/@max">4</replace>
  <replace silent="true" sel="//do_if[@value='not $upgrade? and not $component?']/create_platform_actor[@name='$NHDefenceNPC' and @type='entitytype.defencecontrol']/skills/skill[@type='morale']/@min">1</replace>
  <replace silent="true" sel="//do_if[@value='not $upgrade? and not $component?']/create_platform_actor[@name='$NHDefenceNPC' and @type='entitytype.defencecontrol']/skills/skill[@type='morale']/@max">4</replace>

  <replace silent="true" sel="//create_cue_actor[@cue='this' and @group='argon.pilot']/skills/skill[@type='navigation']/@min">1</replace>
  <replace silent="true" sel="//create_cue_actor[@cue='this' and @group='argon.pilot']/skills/skill[@type='navigation']/@max">4</replace>
  <replace silent="true" sel="//create_cue_actor[@cue='this' and @group='argon.pilot']/skills/skill[@type='leadership']/@min">1</replace>
  <replace silent="true" sel="//create_cue_actor[@cue='this' and @group='argon.pilot']/skills/skill[@type='leadership']/@max">4</replace>
  <replace silent="true" sel="//create_cue_actor[@cue='this' and @group='argon.pilot']/skills/skill[@type='morale']/@min">1</replace>
  <replace silent="true" sel="//create_cue_actor[@cue='this' and @group='argon.pilot']/skills/skill[@type='morale']/@max">4</replace>
</diff>              
<?xml version="1.0" encoding="iso-8859-1"?>
<content id="" name="" description="" author="pref" version="92" date="2016-04-24" save="0" lastupdate="">
  <dependency id="ws_604564648" optional="true" name="AutoCrew"/>
  <!--  <dependency id="CWIR" optional="true" name="Conquest and War"></dependency> -->
  <text language="44" name="AutoTrain" description="Ship/station crews gain skills while working" author="pref"/>
</content>
