XRWS         !  }b   ß  wo  ext_01.cat ext_01.dat readme.txt libraries/charactergroups.xml 413 1441759872 089669042b4704750abcaf4a740a55e9
libraries/characters.xml 9890 1441759881 23ce27ef0e8abdbda18807212847ff07
md/BaelyNPCSpawn.xml 20272 1441704477 87ac117f0e4fd0501d5880a68ed593fd
<?xml version="1.0" encoding="utf-8" ?>
<diff>
  <add sel="/characters">
    <!-- Terran Platform Traders -->
    <character name="Bae.devries.trader">
     <select macro="character_ar_male_dv_a_macro" />
     <select macro="character_ar_male_dv_b_macro" />
     <select macro="character_ar_female_dv_a_macro" />
     <select macro="character_ar_female_dv_b_macro" /> 
    </character>
  </add>
</diff><?xml version="1.0" encoding="utf-8"?>
<diff>
<add sel="/characters">
  <!-- Platform characters for Baely NPC Spawn -->
  <!-- Argon NPC (Albion and Omicron Lyrae macros) -->
  <character id="Bae_argon_architect" group="argon.architect">
   <category tags="[albion, omicronlyrae, architect]" faction="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]" race="argon"/>
    <owner list="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]"/>
  </character>
  <character id="Bae_argon_commander" group="argon.commander">
   <category tags="[albion, omicronlyrae, commander]" faction="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]" race="argon"/>
    <owner list="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]"/>
  </character>
  <character id="Bae_argon_defence" group="argon.defence">
   <category tags="[albion, omicronlyrae, defencecontrol]" faction="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]" race="argon"/>
    <owner list="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]"/>
  </character>
  <character id="Bae_argon_engineer" group="argon.engineer">
   <category tags="[albion, omicronlyrae, engineer, shiptech]" faction="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]" race="argon"/>
    <owner list="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]"/>
  </character>
  <character id="Bae_argon_pilot" group="argon.pilot">
   <category tags="[albion, omicronlyrae, pilot]" faction="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]" race="argon"/>
    <owner list="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]"/>
  </character>
  <character id="Bae_argon_marine" group="argon.marine">
   <category tags="[albion, omicronlyrae, marine]" faction="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]" race="argon"/>
    <owner list="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]"/>
  </character>
  <character id="Bae_argon_manager" group="argon.manager">
   <category tags="[albion, omicronlyrae, manager]" faction="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]" race="argon"/>
    <owner list="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]"/>
  </character>
  
  <character id="Bae_argon_platform_trader" group="argon.trader">
    <category tags="[albion, omicronlyrae, upgradetrader, shiptrader, smallshiptrader, miningsupplier, junkdealer, equipment, foodmerchant, dronetrader, armsdealer]" faction="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]" race="argon"/>
    <owner list="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]"/>
  </character>
  <character id="Bae_argon_farmer" group="argon.spacefarmer">
   <category tags="[albion, omicronlyrae, spacefarmer]" faction="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]" race="argon"/>
    <owner list="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]"/>
  </character>
  <character id="Bae_argon_shadyguy" group="argon.shadyguy">
   <category tags="[albion, omicronlyrae, shadyguy]" faction="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]" race="argon"/>
    <owner list="[argongovernment, jonferson, aquarius, chow, frantonpharma, sonraenergy, plutarch, beryll, heartofalbion, leddaindustrial, wholesomefoods, nolimits, albionenergy, sovereignsyndicate, hereticvanguards]"/>
  </character>
  
  <!-- Terran NPC (DeVries macros) -->
  <character id="Bae_terran_architect" group="devries.architect">
   <category tags="[devries, architect]" faction="[canteran, reivers]" race="terran"/>
    <owner exact="[canteran, reivers]"/>
  </character>
  <character id="Bae_terran_commander" group="devries.commander">
   <category tags="[devries, commander]" faction="[canteran, reivers]" race="terran"/>
    <owner exact="[canteran, reivers]"/>
  </character>
  <character id="Bae_terran_defence" group="devries.defence">
   <category tags="[devries, defencecontrol]" faction="[canteran, reivers]" race="terran"/>
    <owner exact="[canteran, reivers]"/>
  </character>
  <character id="Bae_terran_engineer" group="devries.engineer">
   <category tags="[devries, engineer, shiptech]" faction="[canteran, reivers]" race="terran"/>
    <owner exact="[canteran, reivers]"/>
  </character>
  <character id="Bae_terran_pilot" group="devries.pilot">
   <category tags="[devries, pilot]" faction="[canteran, reivers]" race="terran"/>
    <owner exact="[canteran, reivers]"/>
  </character>
  <character id="Bae_terran_marine" group="devries.marine">
   <category tags="[devries, marine]" faction="[canteran, reivers]" race="terran"/>
    <owner exact="[canteran, reivers]"/>
  </character>
  <character id="Bae_terran_manager" group="devries.manager">
   <category tags="[devries, manager]" faction="[canteran, reivers]" race="terran"/>
    <owner exact="[canteran, reivers]"/>
  </character>
  
  <character id="Bae_terran_platform_trader" group="Bae.devries.trader">
    <category tags="[devries, upgradetrader, shiptrader, smallshiptrader, miningsupplier, junkdealer, equipment, foodmerchant, dronetrader, armsdealer]" faction="[canteran, reivers]" race="terran"/>
    <owner exact="[canteran, reivers]"/>
  </character>
  <character id="Bae_terran_farmer" group="devries.spacefarmer">
   <category tags="[devries, spacefarmer]" faction="[canteran, reivers]" race="terran"/>
    <owner exact="[canteran, reivers]"/>
  </character>
  <character id="Bae_terran_shadyguy" group="devries.shadyguy">
   <category tags="[devries, shadyguy]" faction="[canteran, reivers]" race="terran"/>
    <owner exact="[canteran, reivers]"/>
  </character>
  
  <!-- Teladi NPC (FoO macros) like teladi_civilian but with the DLC factions-->
  <character id="Bae_teladi_generic" group="teladi.generic.male">
   <category tags="[albion, devries, omicronlyrae, maelstrom, fieldsofopportunity, architect, commander, defencecontrol, engineer, fighterpilot, manager, marine, masstraffic, watchdog, pilot, traderpilot, specialistagriculture, specialistpowerstorage, specialistfood, specialistchemical, specialistprecision, specialistweapons, specialistpharmaceuticals, specialistmetals, specialistgeophysics, specialistsurfacesystems, specialistpowersupply, specialistaquatics]" faction="[teladi, teladidrugrunner, teladigunrunner]" race="teladi" comment="fullyqualified"/>
    <owner list="[teladi, teladidrugrunner, teladigunrunner]"/>
  </character>
  
  <!-- Split NPC (Maelstrom macros) currently, identical to family_ryak_generic -->
  <character id="Bae_split_generic" group="split.generic">
    <category tags="[maelstrom, upgradetrader, architect, commander, defencecontrol, engineer, fighterpilot, manager, marine, masstraffic, watchdog, pilot, traderpilot, specialistagriculture, specialistpowerstorage, specialistfood, specialistchemical, specialistprecision, specialistweapons, specialistpharmaceuticals, specialistmetals, specialistgeophysics, specialistsurfacesystems, specialistpowersupply, specialistaquatics]" faction="familyryak" race="split" comment="fullyqualified"/>
    <owner exact="familyryak"/>
  </character>
  
</add>
</diff>
<?xml version="1.0" encoding="utf-8"?>
<mdscript name="BaelyNPCSpawn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
<cues>
<!-- A Station NPC Spawning System for Player owned stations, similar to vanilla + a few enhancements. -->
<!-- Station randomly chooses a system, then from there, randomly chooses a job, and from there randomly choose a faction(if possible) to generate NPC -->
<!-- Stations takes into account their current system and owner's (player's) reputation with each faction -->

<cue name="Baely_Setup">
  <conditions>
    <event_player_created />
  </conditions>
  <actions>
    <!-- md.$Baely_Range : Config value for how random your npcs' skills are going to be. Default is 1 and vanilla is 3
        0 => 5 stars
        1 => 4 - 5 stars
        2 => 3 - 5 stars
        3 => 2 - 5 stars
        4 => 1 - 5 stars
        5 => 0 - 5 stars
    -->
    <set_value name="md.$Baely_Range" exact="1"/>
  </actions>
</cue>

<cue name="Baely_NPCSpawn" instantiate="false" namespace="this">
  <conditions>
    <event_object_changed_zone object="player.entity" />
    <!--<event_player_created />-->
  </conditions>
  <actions>
    
    <find_station name="$PlayerStations" owner="faction.player" space="player.zone" multiple="true" />
    <do_if value="$PlayerStations.count">
      <!-- Figure out the faction weights depending on the zone's system. [M,A,O,D,F]
           Currently based on # of jumpgates between systems
      -->
      <do_if value="player.cluster.name" exact="'Maelstrom'">
        <set_value name="$clusterWeight" exact="[ 18, 1, 18, 3, 3 ]" />
      </do_if>
      <do_elseif value="player.cluster.name" exact="'Albion'">
        <set_value name="$clusterWeight" exact="[ 1, 27, 3, 9, 9 ]" />
      </do_elseif>
      <do_elseif value="player.cluster.name" exact="'Omicron Lyrae'">
        <set_value name="$clusterWeight" exact="[ 3, 1, 9, 3, 3 ]" />
      </do_elseif>
      <do_elseif value="player.cluster.name" exact="'DeVries'">
        <set_value name="$clusterWeight" exact="[ 1, 3, 3, 9, 1 ]" />
      </do_elseif>
      <do_elseif value="player.cluster.name" exact="'Fields of Opportunity'">
        <set_value name="$clusterWeight" exact="[ 1, 3, 3, 1, 9 ]" />
      </do_elseif>
      <do_else>
        <set_value name="$clusterWeight" exact="[ 1, 1, 1, 1, 1 ]" />
      </do_else>
      <set_value name="$clusterWeightFactor" exact="100 / ( $clusterWeight.{1} + $clusterWeight.{2} + $clusterWeight.{3} + $clusterWeight.{4} + $clusterWeight.{5} )" />
      <do_all exact="$clusterWeight.count" counter="$C">
        <set_value name="$clusterWeight.{$C}" exact="$clusterWeight.{$C} * $clusterWeightFactor" />
      </do_all>
      <set_value name="$popTypes" exact="[dockpopulationtype.bar, dockpopulationtype.ships, dockpopulationtype.repair, dockpopulationtype.trade, dockpopulationtype.administrative]" />
      <set_value name="$jobWeight" exact="[[0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 130, 130, 100, 0, 150, 100, 130], 
                                           [0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 130, 130, 100, 0, 150, 100, 130], 
                                           [480, 480, 0, 360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 360, 0, 0, 0], 
                                           [0, 0, 0, 0, 160, 160, 160, 160, 120, 160, 160, 0, 0, 0, 0, 0, 0, 0], 
                                           [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]" />
      
      <set_value name="$Factions" exact="[ 'familyryak', 'albionenergy', 'beryll', 'heartofalbion', 'leddaindustrial', 'nolimits', 'plutarch', 'wholesomefoods', 'sovereignsyndicate', 'aquarius', 'argongovernment', 'chow', 'frantonpharma', 'jonferson', 'sonraenergy', 'hereticvanguards', 'canteran', 'reivers', 'teladi', 'teladidrugrunner', 'teladigunrunner' ]" />
      <set_value name="$FactionsRel" exact="[]" />
      <set_value name="$HighestRel" exact="0.00000000000001" />
      <do_all exact="$Factions.count" counter="$f">
        <append_to_list name="$FactionsRel" exact="player.entity.relationto.{ faction.{ $Factions.{$f} } }" />
        <do_if value="$FactionsRel.{$f} gt $HighestRel">
          <set_value name="$HighestRel" exact="$FactionsRel.{$f}" />
        </do_if>
      </do_all>
      
      <!-- A faction's weight will be 0 if unknown to player or has negative relations. 
           1 to 101 depending on its proportion to the most friendly faction. -->
      <set_value name="$factionWeight" exact="[]" />
      <do_all exact="$Factions.count" counter="$e" >
        <do_if value="$FactionsRel.{$e} ge 0f">
          <do_if value="faction.{ $Factions.{$e} }.knowntoplayer" >
            <append_to_list name="$factionWeight" exact="[ $Factions.{$e}, ($FactionsRel.{$e} / $HighestRel * 100f) + 1f ]" />
          </do_if>
          <do_else>
            <append_to_list name="$factionWeight" exact="[ $Factions.{$e}, 0f ]" />
          </do_else>
        </do_if>
        <do_else>
          <append_to_list name="$factionWeight" exact="[ $Factions.{$e}, 0f ]" />
        </do_else>
      </do_all>
      
      <!-- For each station in this zone -->
      <do_all exact="$PlayerStations.count" counter="$i" >
        <!-- For each population type on this station -->
        <do_all exact="$popTypes.count" counter="$d" >
          <find_dock_location name="$DockingBay" container="$PlayerStations.{$i}" multiple="true" dockpopulationtype="$popTypes.{$d}" />
          <!-- For each dock of this specific population type -->
          <do_all exact="$DockingBay.count" counter="$j" >
            <!-- For each empty actor slot in this dock -->
            <do_all min="$DockingBay.{$j}.numfreeactorslots / 2" max="$DockingBay.{$j}.numfreeactorslots - 1" counter="$k" >

              <do_any> <!-- Select the actor's home cluster MAODF -->
                <set_value name="$chosenCluster" exact="1" weight="$clusterWeight.{1}" />
                <set_value name="$chosenCluster" exact="2" weight="$clusterWeight.{2}" />
                <set_value name="$chosenCluster" exact="3" weight="$clusterWeight.{3}" />
                <set_value name="$chosenCluster" exact="4" weight="$clusterWeight.{4}" />
                <set_value name="$chosenCluster" exact="5" weight="$clusterWeight.{5}" />
              </do_any>
              <do_any> <!-- Select the actor's Job... [entitytype, refID suffix, SkillsID]-->
                <!-- Traders -->
                <set_value name="$chosenJob" exact="[ 'dronetrader', 'platform_trader', 0 ]" weight="80 + $jobWeight.{$d}.{1}" />
                <set_value name="$chosenJob" exact="[ 'armsdealer', 'platform_trader', 0 ]" weight="80 + $jobWeight.{$d}.{2}" />
                <set_value name="$chosenJob" exact="[ 'recruitment', 'platform_trader', 0 ]" weight="50 + $jobWeight.{$d}.{3}" />
                <set_value name="$chosenJob" exact="[ 'upgradetrader', 'platform_trader', 0 ]" weight="60 + $jobWeight.{$d}.{4}" />
                <set_value name="$chosenJob" exact="[ 'equipment', 'platform_trader', 0 ]" weight="40 + $jobWeight.{$d}.{5}" />
                <set_value name="$chosenJob" exact="[ 'foodmerchant', 'platform_trader', 0 ]" weight="40 + $jobWeight.{$d}.{6}" />
                <set_value name="$chosenJob" exact="[ 'junkdealer', 'platform_trader', 0 ]" weight="40 + $jobWeight.{$d}.{7}" />
                <set_value name="$chosenJob" exact="[ 'miningsupplier', 'platform_trader', 0 ]" weight="40 + $jobWeight.{$d}.{8}" />
                <set_value name="$chosenJob" exact="[ 'shadyguy', 'shadyguy', 0 ]" weight="30 + $jobWeight.{$d}.{9}" />
                <set_value name="$chosenJob" exact="[ 'shiptech', 'platform_trader', 0 ]" weight="40 + $jobWeight.{$d}.{10}" />
                <set_value name="$chosenJob" exact="[ 'spacefarmer', 'farmer', 0 ]" weight="40 + $jobWeight.{$d}.{11}" />
                <!-- Officers -->
                <set_value name="$chosenJob" exact="[ 'architect', 'architect', 1 ]" weight="50 + $jobWeight.{$d}.{12}" />
                <set_value name="$chosenJob" exact="[ 'commander', 'commander', 2 ]" weight="50 + $jobWeight.{$d}.{13}" />
                <set_value name="$chosenJob" exact="[ 'defencecontrol', 'defence', 3 ]" weight="40 + $jobWeight.{$d}.{14}" />
                <set_value name="$chosenJob" exact="[ 'engineer', 'engineer', 4 ]" weight="60 + $jobWeight.{$d}.{15}" />
                <set_value name="$chosenJob" exact="[ 'pilot', 'pilot', 5 ]" weight="40 + $jobWeight.{$d}.{16}" />
                <set_value name="$chosenJob" exact="[ 'marine', 'marine', 6 ]" weight="60 + $jobWeight.{$d}.{17}" />
                <set_value name="$chosenJob" exact="[ 'manager', 'manager', 7 ]" weight="50 + $jobWeight.{$d}.{18}" />
              </do_any>

              <!-- Selected actor from Maelstrom, only one character macro, possible factions: familyryak -->
              <do_if value="$chosenCluster == 1">
                <!-- Select the actor's Faction -->
                <set_value name="$chosenFaction" exact="$factionWeight.{1}" />
                <!-- Using job and race, generate the ref ID -->
                <set_value name="$RefID" exact="'Bae_split_generic'" />
              </do_if>

              <!-- Selected actor from Albion, possible factions: albionenergy, beryll, heartofalbion, leddaindustrial, nolimits, plutarch, wholesomefoods, sovereignsyndicate -->
              <do_elseif value="$chosenCluster == 2">
                <do_any> <!-- Select the actor's Faction -->
                  <set_value name="$chosenFaction" exact="$factionWeight.{2}" weight="$factionWeight.{2}.{2}" />
                  <set_value name="$chosenFaction" exact="$factionWeight.{3}" weight="$factionWeight.{3}.{2}" />
                  <set_value name="$chosenFaction" exact="$factionWeight.{4}" weight="$factionWeight.{4}.{2}" />
                  <set_value name="$chosenFaction" exact="$factionWeight.{5}" weight="$factionWeight.{5}.{2}" />
                  <set_value name="$chosenFaction" exact="$factionWeight.{6}" weight="$factionWeight.{6}.{2}" />
                  <set_value name="$chosenFaction" exact="$factionWeight.{7}" weight="$factionWeight.{7}.{2}" />
                  <set_value name="$chosenFaction" exact="$factionWeight.{8}" weight="$factionWeight.{8}.{2}" />
                  <set_value name="$chosenFaction" exact="$factionWeight.{9}" weight="$factionWeight.{9}.{2}" />
                </do_any>
                <!-- Using job and race, generate the ref ID -->
                <set_value name="$RefID" exact="'Bae_argon_' + $chosenJob.{2}" />
              </do_elseif>

              <!-- Selected actor from Omicron Lyrae, possible factions: aquarius, argongovernment, chow, frantonpharma, jonferson, sonraenergy, hereticvanguards -->
              <do_elseif value="$chosenCluster == 3">
                <do_any> <!-- Select the actor's Faction -->
                  <set_value name="$chosenFaction" exact="$factionWeight.{10}" weight="$factionWeight.{10}.{2}" />
                  <set_value name="$chosenFaction" exact="$factionWeight.{11}" weight="$factionWeight.{11}.{2}" />
                  <set_value name="$chosenFaction" exact="$factionWeight.{12}" weight="$factionWeight.{12}.{2}" />
                  <set_value name="$chosenFaction" exact="$factionWeight.{13}" weight="$factionWeight.{13}.{2}" />
                  <set_value name="$chosenFaction" exact="$factionWeight.{14}" weight="$factionWeight.{14}.{2}" />
                  <set_value name="$chosenFaction" exact="$factionWeight.{15}" weight="$factionWeight.{15}.{2}" />
                  <set_value name="$chosenFaction" exact="$factionWeight.{16}" weight="$factionWeight.{16}.{2}" />
                </do_any>
                <!-- Using job and race, generate the ref ID -->
                <set_value name="$RefID" exact="'Bae_argon_' + $chosenJob.{2}" />
              </do_elseif>

              <!-- Selected actor from DeVries, possible factions: canteran, reivers -->
              <do_elseif value="$chosenCluster == 4">
                <do_any> <!-- Select the actor's Faction -->
                  <set_value name="$chosenFaction" exact="$factionWeight.{17}" weight="$factionWeight.{17}.{2}" />
                  <set_value name="$chosenFaction" exact="$factionWeight.{18}" weight="$factionWeight.{18}.{2}" />
                </do_any>
                <!-- Using job and race, generate the ref ID -->
                <set_value name="$RefID" exact="'Bae_terran_' + $chosenJob.{2}" />
              </do_elseif>

              <!-- Selected actor from Fields of Opportunity, only one character macro, possible factions: teladi, teladidrugrunner, teladigunrunner -->
              <do_elseif value="$chosenCluster == 5">
                <do_any> <!-- Select the actor's Faction -->
                  <set_value name="$chosenFaction" exact="$factionWeight.{19}" weight="$factionWeight.{19}.{2}" />
                  <set_value name="$chosenFaction" exact="$factionWeight.{20}" weight="$factionWeight.{20}.{2}" />
                  <set_value name="$chosenFaction" exact="$factionWeight.{21}" weight="$factionWeight.{21}.{2}" />
                </do_any>
                <!-- Using job and race, generate the ref ID -->
                <set_value name="$RefID" exact="'Bae_teladi_generic'" />
              </do_elseif>


              <!-- Finally, generate npc -->
              <do_if value="$chosenFaction.{2} ge 1">
                <create_platform_actor name="$NewActor" dockingbay="$DockingBay.{$j}.component" type="entitytype.{ $chosenJob.{1} }" tags="tag.{ $chosenJob.{1} }" ref="$RefID" />
                <set_owner object="$NewActor" faction="faction.{ $chosenFaction.{1} }" />
                <set_remote_commable actor="$NewActor" remote="true"/>

                <!-- Set skills if needed -->
                <set_value name="$B" exact="md.$Baely_Range" />
                <do_if value="$B lt 0">
                  <set_value name="$B" exact="0" />
                </do_if>
                <do_elseif value="$B gt 5 ">
                  <set_value name="$B" exact="5" />
                </do_elseif>

                <do_if value="$chosenJob.{3} == 1"><!-- Architect -->
                  <set_skill entity="$NewActor" type="management" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="navigation" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="engineering" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="morale" min="1" max="4" />
                  <set_skill entity="$NewActor" type="combat" min="0" max="3" />
                  <set_skill entity="$NewActor" type="leadership" min="1" max="4" />
                  <set_skill entity="$NewActor" type="science" min="1" max="4" />
                </do_if>
                <do_elseif value="$chosenJob.{3} == 2"><!-- Commander -->
                  <set_skill entity="$NewActor" type="morale" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="navigation" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="leadership" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="management" min="0" max="3" />
                  <set_skill entity="$NewActor" type="combat" min="1" max="4" />
                  <set_skill entity="$NewActor" type="engineering" min="1" max="4" />
                  <set_skill entity="$NewActor" type="science" min="0" max="3" />
                </do_elseif>
                <do_elseif value="$chosenJob.{3} == 3"><!-- Defence -->
                  <set_skill entity="$NewActor" type="morale" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="combat" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="leadership" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="management" min="0" max="3" />
                  <set_skill entity="$NewActor" type="navigation" min="1" max="4" />
                  <set_skill entity="$NewActor" type="engineering" min="1" max="4" />
                  <set_skill entity="$NewActor" type="science" min="0" max="3" />
                </do_elseif>
                <do_elseif value="$chosenJob.{3} == 4"><!-- Engineer -->
                  <set_skill entity="$NewActor" type="engineering" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="morale" min="1" max="4" />
                  <set_skill entity="$NewActor" type="navigation" min="1" max="4" />
                  <set_skill entity="$NewActor" type="leadership" min="1" max="4" />
                  <set_skill entity="$NewActor" type="management" min="1" max="4" />
                  <set_skill entity="$NewActor" type="combat" min="0" max="3" />
                  <set_skill entity="$NewActor" type="science" min="1" max="4" />
                </do_elseif>
                <do_elseif value="$chosenJob.{3} == 5"><!-- Pilot -->
                  <set_skill entity="$NewActor" type="morale" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="navigation" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="combat" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="leadership" min="1" max="4" />
                  <set_skill entity="$NewActor" type="management" min="0" max="3" />
                  <set_skill entity="$NewActor" type="engineering" min="1" max="4" />
                  <set_skill entity="$NewActor" type="science" min="0" max="3" />
                </do_elseif>
                <do_elseif value="$chosenJob.{3} == 6"><!-- Marine -->
                  <set_skill entity="$NewActor" type="boarding" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="leadership" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="morale" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="combat" min="1" max="4" />
                  <set_skill entity="$NewActor" type="engineering" min="1" max="4" />
                  <set_skill entity="$NewActor" type="management" min="0" max="3" />
                  <set_skill entity="$NewActor" type="navigation" min="1" max="4" />
                  <set_skill entity="$NewActor" type="science" min="0" max="3" />
                </do_elseif>
                <do_elseif value="$chosenJob.{3} == 7"><!-- Manager -->
                  <set_skill entity="$NewActor" type="leadership" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="management" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="navigation" min="5 - $B" max="5" />
                  <set_skill entity="$NewActor" type="science" min="1" max="4" />
                  <set_skill entity="$NewActor" type="engineering" min="1" max="4" />
                  <set_skill entity="$NewActor" type="morale" min="1" max="4" />
                  <set_skill entity="$NewActor" type="combat" min="0" max="3" />
                </do_elseif>
              </do_if>
            </do_all>
          </do_all>
        </do_all>
      </do_all>
      
      <!-- Clean up -->
      <remove_value name="$clusterWeight" />
      <remove_value name="$clusterWeightFactor" />
      <remove_value name="$popTypes" />
      <remove_value name="$jobWeight" />
      <remove_value name="$Factions" />
      <remove_value name="$FactionsRel" />
      <remove_value name="$HighestRel" />
      <remove_value name="$factionWeight" />
      <remove_value name="$chosenCluster" />
      <remove_value name="$chosenJob" />
      <remove_value name="$chosenFaction" />
      <remove_value name="$RefID" />
      <remove_value name="$B" />
    </do_if>
    <!-- Note: Avoided spawning specialist engineers because of the mess it creates thanks to the incarnation system -->
    <reset_cue cue="this" />
  </actions>
</cue>
</cues>
</mdscript>Baely v1.0
==================
What is it?
-----------
This mod takes Black Rain's NPC Spawn Mod to the next level.
It is a Station NPC Spawning System for player owned stations, it's as close as possible to the system used by vanilla NPC stations.
On zone change, each player owned station in zone takes into account its current location and player's reputation with each faction to populate each dock with NPCs.
The most friendly factions that belong to the same home system have highest spawn chance. Uses the same custom characters/charactergroups from above.
Default star level is random 4-5 stars on primary skills, this range can be changed at the top of the BailyNPCSpawn.xml file. Set it at 3 to have the same star ranges as NPCs on NPC Stations.
Note: Specialists are not spawned here in order to avoid problems with the incarnation system and the persistent actor bs.

Feedback is welcomed.

Developed while using X Rebirth v3.60

Changes
-------
v1.0 -
    -Skipped 0.01-1.0 alphas and Published at 1.0

Uninstall
---------

Unsuscribe in Steam WS to deactivate/remove. Should not have any effect on save games.

Credits
-------
BlackRain whose NPCSpawn Mod inspired me to start my own modding. (thanks)
J3ANP3T3R, Yorrick Vander, UniTrader, euclid + Mad_Joker.<?xml version="1.0" encoding="utf-8"?>
<content id="" name="" description="" author="Apostilite" version="101" date="2015-09-09" save="false" lastupdate="">
  <dependency version="360"/>
  <text language="44" name="Baely NPC Spawn" description="Station NPC Spawning System for player owned stations, it's as close as possible to the system used by vanilla NPC stations." author="Apostilite" version="101" date="2015-09-8" save="false"/>
</content>
