private void UpdateCurrentMercenaryTroopAndCount(Town town)
        {
            CharacterObject  oldTroopType       = custom_merc_data_holder.dictionaryOfMercAtTownData[town].TroopInfoCharObject();
            List <TroopInfo> possibleMercTroops = custom_merc_data_holder.dictionaryOfMercAtTownData[town].PossibleMercTroopInfo;

            if (possibleMercTroops.Count == 0)
            {
                return;
            }
            int r           = MBRandom.Random.Next(possibleMercTroops.Count);
            int numbOfUnits = FindNumberOfMercenariesToAdd();

            if (MBRandom.RandomFloat > Settings.Settings.Instance.PossibilityOfSpawn)
            {
                numbOfUnits = 0;
            }
            TroopInfo newTroopInfo = possibleMercTroops[r];

            custom_merc_data_holder.dictionaryOfMercAtTownData[town].ChangeMercenaryType(newTroopInfo, numbOfUnits);

            // Since we don't have access to MercenaryNUmberChangedInTown or MercenaryTroopChangedInTown
            // need way to trigger spawn of hire guy in tavern when inside of town on a daily update
            // instead of PlayerEncounter.LocationEncounter != null just using currentSettlement to determine if inside of settlement
            if (oldTroopType != null && MobileParty.MainParty.CurrentSettlement != null && MobileParty.MainParty.CurrentSettlement.IsTown && MobileParty.MainParty.CurrentSettlement.Town == town)
            {
                AddCustomMercenaryCharacterToTavern(town.Settlement, oldTroopType);
            }
        }
 public void ChangeMercenaryType(TroopInfo newTroopInfo, int number)
 {
     if (newTroopInfo != TroopInfo)
     {
         TroopInfo = newTroopInfo;
         Number    = number;
         return;
     }
     if (Number != number)
     {
         int difference = number - Number;
         ChangeMercenaryCount(difference);
     }
 }