コード例 #1
0
        public static ItemObject GetTournamentPrizeVanilla(Settlement settlement)
        {
            float minValue = 1000f;
            float maxValue = 5000f;

            if (TournamentXPSettings.Instance.TownPrizeMinMaxAffectsVanilla)
            {
                minValue = TournamentPrizePoolBehavior.GetMinPrizeValue();
                maxValue = TournamentPrizePoolBehavior.GetMaxPrizeValue();
            }

            string[] strArray = new String[] { "winds_fury_sword_t3", "bone_crusher_mace_t3", "tyrhung_sword_t3", "pernach_mace_t3", "early_retirement_2hsword_t3", "black_heart_2haxe_t3", "knights_fall_mace_t3", "the_scalpel_sword_t3", "judgement_mace_t3", "dawnbreaker_sword_t3", "ambassador_sword_t3", "heavy_nasalhelm_over_imperial_mail", "closed_desert_helmet", "sturgian_helmet_closed", "full_helm_over_laced_coif", "desert_mail_coif", "heavy_nasalhelm_over_imperial_mail", "plumed_nomad_helmet", "eastern_studded_shoulders", "ridged_northernhelm", "armored_bearskin", "noble_horse_southern", "noble_horse_imperial", "noble_horse_western", "noble_horse_eastern", "noble_horse_battania", "noble_horse_northern", "special_camel" };

            ItemObject obj        = Game.Current.ObjectManager.GetObject <ItemObject>(strArray.GetRandomElement <string>());
            ItemObject itemObject = MBRandom.ChooseWeighted <ItemObject>(ItemObject.All, (ItemObject item) =>
            {
                if ((float)item.Value > minValue * (item.IsMountable ? 0.5f : 1f))
                {
                    if (TournamentXPSettings.Instance.EnablePrizeTypeFilterToLists)
                    {
                        var validPizeTypes = TournamentPrizePoolBehavior.GetActivePrizeTypes();

                        if ((float)item.Value < maxValue * (item.IsMountable ? 0.5f : 1f) && item.Culture == settlement.Town.Culture &&
                            validPizeTypes.Contains(item.ItemType)
                            )
                        {
                            return(1f);
                        }
                    }
                    else if ((float)item.Value < maxValue * (item.IsMountable ? 0.5f : 1f) && item.Culture == settlement.Town.Culture && (item.IsCraftedWeapon || item.IsMountable || item.ArmorComponent != null))
                    {
                        return(1f);
                    }
                }
                return(0f);
            }) ?? MBRandom.ChooseWeighted <ItemObject>(ItemObject.All, (ItemObject item) =>
            {
                if ((float)item.Value > minValue * (item.IsMountable ? 0.5f : 1f))
                {
                    if ((float)item.Value < maxValue * (item.IsMountable ? 0.5f : 1f) && (item.IsCraftedWeapon || item.IsMountable || item.ArmorComponent != null))
                    {
                        return(1f);
                    }
                }
                return(0f);
            });

            if (itemObject == null)
            {
                return(obj);
            }
            return(itemObject);
        }
コード例 #2
0
        public static void PrizeSelectConsequence(MenuCallbackArgs args)
        {
            try
            {
                List <InquiryElement> prizeElements  = new List <InquiryElement>();
                TournamentGame        tournamentGame = Campaign.Current.TournamentManager.GetTournamentGame(Settlement.CurrentSettlement.Town);
                TournamentPrizePool   currentPool    = GetTournamentPrizePool(Settlement.CurrentSettlement);

                if (currentPool.Prizes.Count < TournamentXPSettings.Instance.NumberOfPrizeOptions)
                {
                    ItemObject prize = GenerateTournamentPrize(tournamentGame, currentPool, true);
                }

                //  InformationManager.Clear();
                foreach (ItemRosterElement ire in currentPool.Prizes)
                {
                    var p = ire.EquipmentElement;
                    try
                    {
                        var ii = new ImageIdentifier(p.Item.StringId, ImageIdentifierType.Item, p.GetModifiedItemName().ToString());
                        // prizeElements.Add(new InquiryElement(p.Item.StringId, ii, true, p.Item.ToToolTipTextObject().ToString()));
                        prizeElements.Add(new InquiryElement(
                                              p.Item.StringId,
                                              p.GetModifiedItemName().ToString(),
                                              ii,
                                              true,
                                              p.ToToolTipTextObject().ToString()
                                              ));
                    }
                    catch (Exception ex)
                    {
                        ErrorLog.Log("ERROR: Tournament Prize System\nFailed to add prize element to display" + p.Item.StringId);
                        ErrorLog.Log(ex.ToStringFull());
                    }
                }
                if (prizeElements.Count > 0)
                {
                    string     info  = "{=tourn012}You can choose an item from the list below as your reward if you win the tournament!";
                    TextObject descr = new TextObject(info);

                    if (TournamentXPSettings.Instance.DebugMode)
                    {
                        info  = "Town:{TOWN}\nMin:{MIN}\nMax:{MAX}\nProsperity:{PROSPERITY}\nTypes:{TYPES}";
                        descr = new TextObject(info);
                        descr.SetTextVariable("TOWN", currentPool.Town.Name);
                        descr.SetTextVariable("MIN", TournamentPrizePoolBehavior.GetMinPrizeValue().ToString());
                        descr.SetTextVariable("MAX", TournamentPrizePoolBehavior.GetMaxPrizeValue().ToString());
                        descr.SetTextVariable("PROSPERITY", currentPool.Town.GetProsperityLevel().ToString());
                        var types = "";
                        foreach (var t in TournamentPrizePoolBehavior.GetActivePrizeTypes())
                        {
                            types += t.ToString() + ", ";
                        }
                        types = types.Substring(0, types.Length - 2);
                        descr.SetTextVariable("TYPES", types);
                    }

                    InformationManager.ShowMultiSelectionInquiry(new MultiSelectionInquiryData(
                                                                     new TextObject("{=tourn005}Tournament Prize Selection").ToString(), descr.ToString(), prizeElements, true, true, new TextObject("{=tourn006}OK").ToString(), new TextObject("{=tourn007}Cancel").ToString(),
                                                                     new Action <List <InquiryElement> >(OnSelectPrize), new Action <List <InquiryElement> >(OnDeSelectPrize)), true);
                    try
                    {
                        GameMenu.SwitchToMenu("town_arena");
                    }
                    catch (Exception ex)
                    {
                        ErrorLog.Log("ERROR: BMTournamentXP: Select Prize: Refresh Menu");
                        ErrorLog.Log(ex.ToStringFull());
                    }
                }
                else
                {
                    InformationManager.ShowInquiry(new InquiryData("Tournament Prize Selection", "You should not be seeing this.  Something went wrong generating the prize list. Your item restrictions may be set too narrow.", true, false, "OK", "", null, null));
                }
            }
            catch (Exception ex)
            {
                ErrorLog.Log("ERROR: BMTournamentXP: Tournament Prize Selection");
                ErrorLog.Log(ex.ToStringFull());
            }
        }
コード例 #3
0
        public static ItemObject GenerateTournamentPrize(TournamentGame tournamentGame, TournamentPrizePool currentPool = null, bool keepTownPrize = true)
        {
            var  numItemsToGet   = TournamentXPSettings.Instance.NumberOfPrizeOptions;
            bool bRegenAllPrizes = false;

            if (currentPool == null)
            {
                bRegenAllPrizes = true;
                currentPool     = GetTournamentPrizePool(tournamentGame.Town.Settlement);
            }
            var allitems = GetItemStringsRevised(tournamentGame, TournamentPrizePoolBehavior.GetActivePrizeTypes());

            if (allitems.Count == 0)
            {
                MessageBox.Show("TournamentsXPanded Error:\nAlert, your prize generation filters have resulted in no valid prizes.  Consider widening your prize value range and if you are using a custom list make sure it's loaded correctly.");
                return(null);
            }

            //Add any existing items if we are filling in missing ones from an already generated pool
            var pickeditems = new List <string>();

            if (keepTownPrize && !string.IsNullOrWhiteSpace((tournamentGame.Prize.StringId)))
            {
                pickeditems.Add(tournamentGame.Prize.StringId);
                currentPool.SelectedPrizeStringId = tournamentGame.Prize.StringId;
            }
            try
            {
                if (!bRegenAllPrizes)
                {
                    foreach (ItemRosterElement existingPrize in currentPool.Prizes)
                    {
                        if (!pickeditems.Contains(existingPrize.EquipmentElement.Item.StringId))
                        {
                            pickeditems.Add(existingPrize.EquipmentElement.Item.StringId);
                        }

                        if (allitems.Contains(existingPrize.EquipmentElement.Item.StringId))
                        {
                            allitems.Remove(existingPrize.EquipmentElement.Item.StringId);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorLog.Log("ERROR: GetTournamentPrize existingprizes\n" + ex.ToStringFull());
            }

            //If the totoal pool of unique items is less than our desired number, reduce our pool size.
            if (allitems.Count() < numItemsToGet)
            {
                numItemsToGet = allitems.Count();
            }

            while (pickeditems.Count < numItemsToGet && allitems.Count() > 0)
            {
                var randomId = allitems.GetRandomElement <string>();

                if (!pickeditems.Contains(randomId))
                {
                    pickeditems.Add(randomId);
                    allitems.Remove(randomId);
                }
            }
            currentPool.Prizes = new ItemRoster();
            foreach (var id in pickeditems)
            {
                ItemModifier itemModifier = null;
                ItemObject   pickedPrize  = null;
                try
                {
                    pickedPrize = Game.Current.ObjectManager.GetObject <ItemObject>(id);
                }
                catch (Exception ex)
                {
                    ErrorLog.Log("Error getting object StringId: " + id + "\n" + ex.ToStringFull());
                }

                if (pickedPrize != null)
                {
#if VERSION120 || VERSION130
                    if (TournamentXPSettings.Instance.EnableItemModifiersForPrizes && pickedPrize.ItemType != ItemObject.ItemTypeEnum.Thrown && pickedPrize.ItemType != ItemObject.ItemTypeEnum.Arrows)
                    {
                        try
                        {
                            if (MBRandom.RandomFloatRanged(100f) < 50f)
                            {
                                var ee = GetEquipmentWithModifier(pickedPrize, TournamentPrizePoolBehavior.GetProsperityModifier(tournamentGame.Town.Settlement));
                                itemModifier = ee.ItemModifier;
                            }
                        }
                        catch (Exception ex)
                        {
                            ErrorLog.Log("Error in GetEquipmentWithModifier\nItem:" + pickedPrize.StringId + "\n" + ex.ToStringFull());
                        }
                    }
#endif
                    try
                    {
                        currentPool.Prizes.Add(new ItemRosterElement(pickedPrize, 1, itemModifier));
                    }
                    catch (Exception ex)
                    {
                        ErrorLog.Log("Error adding equipment to prizepool.\n" + ex.ToStringFull());
                    }
                }
                else
                {
                    MessageBox.Show("Invalid Item detected.  Please remove: " + id + " from your list of custom items. Ignoring this item and continuing.");
                }
            }

            if (!keepTownPrize)
            {
                var selected = currentPool.Prizes.GetRandomElement <ItemRosterElement>();
                currentPool.SelectedPrizeStringId = selected.EquipmentElement.Item.StringId;
                SetTournamentSelectedPrize(tournamentGame, selected.EquipmentElement.Item);
            }
            return(currentPool.SelectPrizeItemRosterElement.EquipmentElement.Item);
        }
コード例 #4
0
        public static List <string> GetItemStringsRevised(TournamentGame tournamentGame, List <ItemObject.ItemTypeEnum> validTypes)
        {
            int prizeMin = MathF.Floor(TournamentPrizePoolBehavior.GetMinPrizeValue() * .7f);
            int prizeMax = MathF.Ceiling(TournamentPrizePoolBehavior.GetMaxPrizeValue() * 1.5f);

            List <string> allitems = new List <string>();

            if (TournamentXPSettings.Instance.PrizeListIncludeLegacy)
            {
                var legacyItems = _legacyItems.AsEnumerable();
                if (TournamentXPSettings.Instance.PrizeFilterCultureLegacyItems)
                {
                    legacyItems = legacyItems.Where(x => x.Culture == tournamentGame.Town.Culture);
                }
                if (TournamentXPSettings.Instance.PrizeFilterValueLegacyItems)
                {
                    legacyItems = legacyItems.Where(x => x.Value >= prizeMin && x.Value <= prizeMax);
                }
                if (TournamentXPSettings.Instance.PrizeFilterItemTypesLegacyItems)
                {
                    legacyItems = legacyItems.Where(x => validTypes.Contains(x.ItemType));
                }
                allitems = allitems.Concat(legacyItems.Select(x => x.StringId)).ToList();
            }
            if (TournamentXPSettings.Instance.PrizeListIncludeCustom && TournamentPrizePoolBehavior.CustomTournamentItems != null && TournamentPrizePoolBehavior.CustomTournamentItems.Count > 0)
            {
                try
                {
                    var customItems = _customItems.AsEnumerable();
                    if (TournamentXPSettings.Instance.PrizeFilterCultureCustomItems)
                    {
                        customItems = customItems.Where(x => x.Culture == tournamentGame.Town.Culture);
                    }
                    if (TournamentXPSettings.Instance.PrizeFilterValueCustomItems)
                    {
                        customItems = customItems.Where(x => x.Value >= prizeMin && x.Value <= prizeMax);
                    }
                    if (TournamentXPSettings.Instance.PrizeFilterItemTypesCustomItems)
                    {
                        customItems = customItems.Where(x => validTypes.Contains(x.ItemType));
                    }

                    allitems = allitems.Concat(customItems.Select(x => x.StringId).ToList()).ToList();
                }
                catch (Exception ex)
                {
                    ErrorLog.Log("Error adding custom items to prize pool.");
                    ErrorLog.Log(ex.ToStringFull());
                }
            }
            if (TournamentXPSettings.Instance.PrizeListIncludeTown)
            {
                var roster = tournamentGame.Town.Owner.ItemRoster;
                roster.RemoveZeroCounts();
                var townItems = roster.Where(x => x.Amount > 0 && !x.EquipmentElement.Item.NotMerchandise).Select(x => x.EquipmentElement.Item);

                if (TournamentXPSettings.Instance.PrizeFilterCultureTownItems)
                {
                    townItems = townItems.Where(x => x.Culture == tournamentGame.Town.Culture);
                }
                if (TournamentXPSettings.Instance.PrizeFilterValueTownItems)
                {
                    townItems = townItems.Where(x => x.Value >= prizeMin && x.Value <= prizeMax);
                }
                if (TournamentXPSettings.Instance.PrizeFilterItemTypesTownItems)
                {
                    townItems = townItems.Where(x => validTypes.Contains(x.ItemType));
                }

                allitems = allitems.Concat(townItems.Select(x => x.StringId)).ToList();
            }
            if (TournamentXPSettings.Instance.PrizeListIncludeVanilla)
            {
                var vanillaItems = ItemObject.All.AsEnumerable();
                if (TournamentXPSettings.Instance.PrizeFilterCultureStandardItems)
                {
                    vanillaItems = vanillaItems.Where(x => x.Culture == tournamentGame.Town.Culture);
                }
                if (TournamentXPSettings.Instance.PrizeFilterValueStandardItems)
                {
                    vanillaItems = vanillaItems.Where(x => x.Value >= prizeMin && x.Value <= prizeMax);
                }
                if (TournamentXPSettings.Instance.PrizeFilterItemTypesStandardItems)
                {
                    vanillaItems = vanillaItems.Where(x => validTypes.Contains(x.ItemType));
                }
                allitems = allitems.Concat(vanillaItems.Select(x => x.StringId)).ToList();
            }

            if (allitems.Count == 0)
            {
                //Alert - fix it somehow
                MessageBox.Show("TournamentXPanded Error:\nYour filters are too strict, no items are found to populate the tournaments with. Check your settings to allow for a wider choice.  Generally, this can only occur if you've set the lists to only allow for custom items, and those items are not loaded correctly.\nYou can enable debug mode to view additional diagnostics, to help determine if you items are loading or not.");
                ErrorLog.Log("Error populating Tournament Prizes\n");
            }

            return(allitems);
        }
コード例 #5
0
        public static ItemObject GenerateTournamentPrize(TournamentGame tournamentGame, TournamentPrizePool currentPool = null, bool keepTownPrize = true)
        {
            var  numItemsToGet   = TournamentXPSettings.Instance.NumberOfPrizeOptions;
            bool bRegenAllPrizes = false;

            if (currentPool == null)
            {
                bRegenAllPrizes = true;
                currentPool     = GetTournamentPrizePool(tournamentGame.Town.Settlement);
            }
            var allitems = GetItemStringsRevised(tournamentGame, TournamentPrizePoolBehavior.GetActivePrizeTypes());

            //Add any existing items if we are filling in missing ones from an already generated pool
            var pickeditems = new List <string>();

            if (keepTownPrize && !string.IsNullOrWhiteSpace((tournamentGame.Prize.StringId)))
            {
                pickeditems.Add(tournamentGame.Prize.StringId);
                currentPool.SelectedPrizeStringId = tournamentGame.Prize.StringId;
            }
            try
            {
                if (!bRegenAllPrizes)
                {
                    foreach (ItemRosterElement existingPrize in currentPool.Prizes)
                    {
                        if (!pickeditems.Contains(existingPrize.EquipmentElement.Item.StringId))
                        {
                            pickeditems.Add(existingPrize.EquipmentElement.Item.StringId);
                        }

                        if (allitems.Contains(existingPrize.EquipmentElement.Item.StringId))
                        {
                            allitems.Remove(existingPrize.EquipmentElement.Item.StringId);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorLog.Log("ERROR: GetTournamentPrize existingprizes\n" + ex.ToStringFull());
            }

            //If the totoal pool of unique items is less than our desired number, reduce our pool size.
            if (allitems.Count() < numItemsToGet)
            {
                numItemsToGet = allitems.Count();
            }

            while (pickeditems.Count < numItemsToGet && allitems.Count() > 0)
            {
                var randomId = allitems.GetRandomElement <string>();

                if (!pickeditems.Contains(randomId))
                {
                    pickeditems.Add(randomId);
                    allitems.Remove(randomId);
                }
            }
            currentPool.Prizes = new ItemRoster();
            foreach (var id in pickeditems)
            {
                ItemModifier itemModifier = null;
                var          pickedPrize  = Game.Current.ObjectManager.GetObject <ItemObject>(id);
#if VERSION120
                if (TournamentXPSettings.Instance.EnableItemModifiersForPrizes)
                {
                    //var ee = GetEquipmentWithModifier(pickedPrize, TournamentPrizePoolBehavior.GetProsperityModifier(tournamentGame.Town.Settlement));
                    if (MBRandom.RandomFloatRanged(100f) < 50f)
                    {
                        var ee = GetEquipmentWithModifier(pickedPrize, 1.3f);
                        itemModifier = ee.ItemModifier;
                    }
                }
#endif
                currentPool.Prizes.Add(new ItemRosterElement(pickedPrize, 1, itemModifier));
                // currentPool.Prizes.Add(new ItemRosterElement(pickedPrize, 1, null)); //Turn off random item mods for now;
            }

            if (!keepTownPrize)
            {
                var selected = currentPool.Prizes.GetRandomElement <ItemRosterElement>();
                currentPool.SelectedPrizeStringId = selected.EquipmentElement.Item.StringId;
                SetTournamentSelectedPrize(tournamentGame, selected.EquipmentElement.Item);
            }
            return(currentPool.SelectPrizeItemRosterElement.EquipmentElement.Item);
        }
コード例 #6
0
        public static List <string> GetItemStringsRevised(TournamentGame tournamentGame, List <ItemObject.ItemTypeEnum> validTypes)
        {
            int prizeMin = MathF.Floor(TournamentPrizePoolBehavior.GetMinPrizeValue() * .7f);
            int prizeMax = MathF.Ceiling(TournamentPrizePoolBehavior.GetMaxPrizeValue() * 1.5f);

            List <string> allitems = new List <string>();

            if (TournamentXPSettings.Instance.PrizeListIncludeLegacy)
            {
                var legacyItems = _legacyItems.AsEnumerable();
                if (TournamentXPSettings.Instance.PrizeFilterCultureLegacyItems)
                {
                    legacyItems = legacyItems.Where(x => x.Culture == tournamentGame.Town.Culture);
                }
                if (TournamentXPSettings.Instance.PrizeFilterValueLegacyItems)
                {
                    legacyItems = legacyItems.Where(x => x.Value >= prizeMin && x.Value <= prizeMax);
                }
                if (TournamentXPSettings.Instance.PrizeFilterItemTypesLegacyItems)
                {
                    legacyItems = legacyItems.Where(x => validTypes.Contains(x.ItemType));
                }
                allitems = allitems.Concat(legacyItems.Select(x => x.StringId)).ToList();
            }
            if (TournamentXPSettings.Instance.PrizeListIncludeCustom && TournamentPrizePoolBehavior.CustomTournamentItems != null && TournamentPrizePoolBehavior.CustomTournamentItems.Count > 0)
            {
                try
                {
                    var customItems = _customItems.AsEnumerable();
                    if (TournamentXPSettings.Instance.PrizeFilterCultureCustomItems)
                    {
                        customItems = customItems.Where(x => x.Culture == tournamentGame.Town.Culture);
                    }
                    if (TournamentXPSettings.Instance.PrizeFilterValueCustomItems)
                    {
                        customItems = customItems.Where(x => x.Value >= prizeMin && x.Value <= prizeMax);
                    }
                    if (TournamentXPSettings.Instance.PrizeFilterItemTypesCustomItems)
                    {
                        customItems = customItems.Where(x => validTypes.Contains(x.ItemType));
                    }

                    allitems = allitems.Concat(customItems.Select(x => x.StringId).ToList()).ToList();
                }
                catch (Exception ex)
                {
                    ErrorLog.Log("Error adding custom items to prize pool.");
                    ErrorLog.Log(ex.ToStringFull());
                }
            }
            if (TournamentXPSettings.Instance.PrizeListIncludeTown)
            {
                var roster = tournamentGame.Town.Owner.ItemRoster;
                roster.RemoveZeroCounts();
                var townItems = roster.Where(x => x.Amount > 0 && !x.EquipmentElement.Item.NotMerchandise).Select(x => x.EquipmentElement.Item);

                if (TournamentXPSettings.Instance.PrizeFilterCultureTownItems)
                {
                    townItems = townItems.Where(x => x.Culture == tournamentGame.Town.Culture);
                }
                if (TournamentXPSettings.Instance.PrizeFilterValueTownItems)
                {
                    townItems = townItems.Where(x => x.Value >= prizeMin && x.Value <= prizeMax);
                }
                if (TournamentXPSettings.Instance.PrizeFilterItemTypesTownItems)
                {
                    townItems = townItems.Where(x => validTypes.Contains(x.ItemType));
                }

                allitems = allitems.Concat(townItems.Select(x => x.StringId)).ToList();
            }
            if (TournamentXPSettings.Instance.PrizeListIncludeVanilla)
            {
                var vanillaItems = ItemObject.All.AsEnumerable();
                if (TournamentXPSettings.Instance.PrizeFilterCultureStandardItems)
                {
                    vanillaItems = vanillaItems.Where(x => x.Culture == tournamentGame.Town.Culture);
                }
                if (TournamentXPSettings.Instance.PrizeFilterValueStandardItems)
                {
                    vanillaItems = vanillaItems.Where(x => x.Value >= prizeMin && x.Value <= prizeMax);
                }
                if (TournamentXPSettings.Instance.PrizeFilterItemTypesStandardItems)
                {
                    vanillaItems = vanillaItems.Where(x => validTypes.Contains(x.ItemType));
                }
                allitems = allitems.Concat(vanillaItems.Select(x => x.StringId)).ToList();
            }

            if (allitems.Count == 0)
            {
                //Alert - fix it somehow
            }

            return(allitems);
        }
コード例 #7
0
        public static List <string> GetItemStringsRevised(TournamentGame tournamentGame, List <ItemObject.ItemTypeEnum> validTypes)
        {
            string[]      strArray = new String[] { "winds_fury_sword_t3", "bone_crusher_mace_t3", "tyrhung_sword_t3", "pernach_mace_t3", "early_retirement_2hsword_t3", "black_heart_2haxe_t3", "knights_fall_mace_t3", "the_scalpel_sword_t3", "judgement_mace_t3", "dawnbreaker_sword_t3", "ambassador_sword_t3", "heavy_nasalhelm_over_imperial_mail", "closed_desert_helmet", "sturgian_helmet_closed", "full_helm_over_laced_coif", "desert_mail_coif", "heavy_nasalhelm_over_imperial_mail", "plumed_nomad_helmet", "eastern_studded_shoulders", "ridged_northernhelm", "armored_bearskin", "noble_horse_southern", "noble_horse_imperial", "noble_horse_western", "noble_horse_eastern", "noble_horse_battania", "noble_horse_northern", "special_camel" };
            List <string> allitems = new List <string>();

            if (TournamentXPSettings.Instance.PrizeListIncludeLegacy)
            {
                allitems = allitems.Concat(strArray.ToList()).ToList();
            }
            if (TournamentXPSettings.Instance.PrizeListIncludeCustom && TournamentPrizePoolBehavior.CustomTourneyItems != null && TournamentPrizePoolBehavior.CustomTourneyItems.Count > 0)
            {
                try
                {
                    var customItems = TournamentPrizePoolBehavior.CustomTourneyItems.Where(x => validTypes.Contains(x.ItemType));
                    if (TournamentXPSettings.Instance.TownPrizeMinMaxAffectsCustom)
                    {
                        customItems = customItems.Where(x => x.Value >= MathF.Floor(TournamentPrizePoolBehavior.GetMinPrizeValue()) && x.Value <= MathF.Ceiling(TournamentPrizePoolBehavior.GetMaxPrizeValue()));
                    }
                    allitems = allitems.Concat(customItems.Select(x => x.StringId).ToList()).ToList();
                }
                catch (Exception ex)
                {
                    ErrorLog.Log("Error adding custom items to prize pool.");
                    ErrorLog.Log(ex.ToStringFull());
                }
            }
            if (TournamentXPSettings.Instance.PrizeListIncludeTown)
            {
                int _minValue = 1600;
                int _maxValue = 5000;
                _minValue = TournamentPrizePoolBehavior.GetMinPrizeValue();
                _maxValue = TournamentPrizePoolBehavior.GetMaxPrizeValue();
                var townItems = GetValidTownItems(tournamentGame, _minValue, _maxValue, validTypes);
                allitems = allitems.Concat(townItems).ToList();
            }
            if (TournamentXPSettings.Instance.PrizeListIncludeVanilla)
            {
                int _minValue = 1600;
                int _maxValue = 5000;

                List <string> vanillaItems;
                if (TournamentXPSettings.Instance.TownPrizeMinMaxAffectsVanilla)
                {
                    _minValue = TournamentPrizePoolBehavior.GetMinPrizeValue();
                    _maxValue = TournamentPrizePoolBehavior.GetMaxPrizeValue();
                }
                vanillaItems = ItemObject.All.Where(x => x.Culture == tournamentGame.Town.Settlement.Culture && validTypes.Contains(x.ItemType) && x.Value >= _minValue && x.Value <= _maxValue).Select(x => x.StringId).ToList();
                if (vanillaItems.Count == 0)
                {
                    vanillaItems = ItemObject.All.Where(x => validTypes.Contains(x.ItemType) && x.Value >= _minValue && x.Value <= _maxValue).Select(x => x.StringId).ToList();
                }

                allitems = allitems.Concat(vanillaItems).ToList();
            }
            if (allitems.Count == 0)
            {
                return(strArray.ToList());
            }

            return(allitems);
        }