From ac6772f6fd8d9e3732bebfc02502b0f481f02708 Mon Sep 17 00:00:00 2001 From: IhateTrains Date: Tue, 14 Jan 2025 14:52:04 +0000 Subject: [PATCH] Countless fixes to TFE conversion but apparently not enough to fix the crashes (#2423) #patch #2202 --------- Co-authored-by: codefactor-io --- .../CommonUtils/HistoryTests.cs | 29 + .../landed_titles/extra_landed_titles.txt | 2 + .../CK3/Characters/CharacterCollection.cs | 23 + .../CK3/Characters/CharactersLoader.cs | 49 +- ImperatorToCK3/CK3/Characters/DNAFactory.cs | 3 + .../CK3/Cultures/CultureCollection.cs | 5 + ImperatorToCK3/CK3/Dynasties/Dynasty.cs | 24 +- .../CK3/Dynasties/DynastyCollection.cs | 3 +- .../CK3/Religions/DoctrineCategory.cs | 3 + ImperatorToCK3/CK3/Religions/Faith.cs | 32 +- ImperatorToCK3/CK3/Religions/HolySite.cs | 12 + ImperatorToCK3/CK3/Religions/Religion.cs | 14 + .../CK3/Religions/ReligionCollection.cs | 2 +- ImperatorToCK3/CK3/Titles/LandedTitles.cs | 133 +- ImperatorToCK3/CK3/Titles/Title.cs | 23 +- ImperatorToCK3/CK3/Titles/TitleRankUtils.cs | 6 +- ImperatorToCK3/CK3/World.cs | 8 +- .../CommonUtils/EnumerableExtensions.cs | 15 + .../Genes/AccessoryGeneTemplate.cs | 4 + .../CommonUtils/Genes/WeightBlock.cs | 2 + .../zzz_IRToCK3_tfe_override_l_english.yml | 75 + ...zzz_IRToCK3_vanilla_override_l_english.yml | 14 + .../ck3_characters_to_preserve.txt | 27 +- .../configurables/converter_cultures.txt | 153 +- .../configurables/dynasties_to_preserve.txt | 12 +- .../dynasty_houses_to_preserve.txt | 79 +- .../configurables/removable_file_blocks.txt | 10252 ++++- .../removable_file_blocks_tfe.txt | 38240 +++++++++++++--- .../replaceable_file_blocks_tfe.txt | 841 + ImperatorToCK3/Imperator/World.cs | 57 +- .../Outputter/CharactersOutputter.cs | 20 +- ImperatorToCK3/Outputter/FileTweaker.cs | 168 +- ImperatorToCK3/Outputter/OnActionOutputter.cs | 42 +- ImperatorToCK3/Outputter/PillarOutputter.cs | 13 +- .../Outputter/ReligionsOutputter.cs | 7 +- ImperatorToCK3/Outputter/WorldOutputter.cs | 7 +- 36 files changed, 42585 insertions(+), 7814 deletions(-) create mode 100644 ImperatorToCK3/CommonUtils/EnumerableExtensions.cs create mode 100644 ImperatorToCK3/Data_Files/blankMod/output/localization/replace/english/zzz_IRToCK3_tfe_override_l_english.yml create mode 100644 ImperatorToCK3/Data_Files/configurables/replaceable_file_blocks_tfe.txt diff --git a/ImperatorToCK3.UnitTests/CommonUtils/HistoryTests.cs b/ImperatorToCK3.UnitTests/CommonUtils/HistoryTests.cs index 8cd34ded7..5033d8733 100644 --- a/ImperatorToCK3.UnitTests/CommonUtils/HistoryTests.cs +++ b/ImperatorToCK3.UnitTests/CommonUtils/HistoryTests.cs @@ -122,6 +122,35 @@ public void NullIsReturnedForNonExistingField() { Assert.Null(provHistory.GetFieldValue("title", new Date(1000, 1, 1))); } + [Fact] + public void NegativeDatesAreSupported() { + var reader = new BufferedReader( + @"= { #Sarkel + culture = mykenian + -750.1.2 = { + culture = macedonian + } + -100.1.2 = { + culture = greek + } + 50.3.4 = { + culture = roman + } + }"); + + var provHistoryFactory = new HistoryFactory.HistoryFactoryBuilder() + .WithSimpleField("culture", "culture", null) + .Build(); + + var provHistory = provHistoryFactory.GetHistory(reader); + + Assert.Equal("mykenian", provHistory.GetFieldValue("culture", new Date(-800, 1, 1))!.ToString()); + Assert.Equal("macedonian", provHistory.GetFieldValue("culture", new Date(-750, 1, 2))!.ToString()); + Assert.Equal("macedonian", provHistory.GetFieldValue("culture", new Date(-600, 1, 2))!.ToString()); + Assert.Equal("greek", provHistory.GetFieldValue("culture", new Date(-100, 1, 2))!.ToString()); + Assert.Equal("roman", provHistory.GetFieldValue("culture", new Date(50, 3, 4))!.ToString()); + } + [Fact] public void HistoryCanBeReadFromMultipleItems() { var reader1 = new BufferedReader( diff --git a/ImperatorToCK3.UnitTests/TestFiles/LandedTitlesTests/CK3/game/common/landed_titles/extra_landed_titles.txt b/ImperatorToCK3.UnitTests/TestFiles/LandedTitlesTests/CK3/game/common/landed_titles/extra_landed_titles.txt index 96a5fdfa9..0198b8ac3 100644 --- a/ImperatorToCK3.UnitTests/TestFiles/LandedTitlesTests/CK3/game/common/landed_titles/extra_landed_titles.txt +++ b/ImperatorToCK3.UnitTests/TestFiles/LandedTitlesTests/CK3/game/common/landed_titles/extra_landed_titles.txt @@ -3,6 +3,8 @@ e_mongolia = { k_mongolia = { capital = c_karakorum + + c_karakorum = {} # Just for the capital entry to be accepted by the converter. } k_jubu = {} diff --git a/ImperatorToCK3/CK3/Characters/CharacterCollection.cs b/ImperatorToCK3/CK3/Characters/CharacterCollection.cs index e75c07373..fb099de1b 100644 --- a/ImperatorToCK3/CK3/Characters/CharacterCollection.cs +++ b/ImperatorToCK3/CK3/Characters/CharacterCollection.cs @@ -846,4 +846,27 @@ public void RemoveUndefinedTraits(TraitMapper traitMapper) { } } } + + public void RemoveInvalidDynastiesFromHistory(DynastyCollection dynasties) { + Logger.Info("Removing invalid dynasties from CK3 character history..."); + + var ck3Characters = this.Where(c => !c.FromImperator).ToArray(); + var validDynastyIds = dynasties.Select(d => d.Id).ToHashSet(); + + foreach (var character in ck3Characters) { + if (!character.History.Fields.TryGetValue("dynasty", out var dynastyField)) { + continue; + } + + dynastyField.RemoveAllEntries(value => { + var dynastyId = value.ToString()?.RemQuotes(); + + if (string.IsNullOrWhiteSpace(dynastyId)) { + return true; + } + + return !validDynastyIds.Contains(dynastyId); + }); + } + } } \ No newline at end of file diff --git a/ImperatorToCK3/CK3/Characters/CharactersLoader.cs b/ImperatorToCK3/CK3/Characters/CharactersLoader.cs index 27d156816..c0907908f 100644 --- a/ImperatorToCK3/CK3/Characters/CharactersLoader.cs +++ b/ImperatorToCK3/CK3/Characters/CharactersLoader.cs @@ -1,6 +1,7 @@ using commonItems; using commonItems.Mods; using Open.Collections.Synchronized; +using System.Collections.Generic; using System.Linq; namespace ImperatorToCK3.CK3.Characters; @@ -33,9 +34,21 @@ public void LoadCK3Characters(ModFilesystem ck3ModFS, Date bookmarkDate) { "set_relation_ward", "set_relation_mentor", "add_opinion", "make_concubine", ]; - string[] fieldsToClear = ["friends", "best_friends", "lovers", "rivals", "nemesis", "primary_title", "dna"]; + string[] fieldsToClear = [ + "friends", "best_friends", "lovers", "rivals", "nemesis", + "primary_title", "dna", "spawn_army", "add_character_modifier", "languages", + "claims", + ]; + var femaleCharacterIds = loadedCharacters.Where(c => c.Female).Select(c => c.Id).ToHashSet(); + var maleCharacterIds = loadedCharacters.Select(c => c.Id).Except(femaleCharacterIds).ToHashSet(); + foreach (var character in loadedCharacters) { + // Clear some fields we don't need. + foreach (var fieldName in fieldsToClear) { + character.History.Fields[fieldName].RemoveAllEntries(); + } + // Remove post-bookmark history except for births and deaths. foreach (var field in character.History.Fields) { if (field.Id == "birth" || field.Id == "death") { @@ -58,7 +71,9 @@ public void LoadCK3Characters(ModFilesystem ck3ModFS, Date bookmarkDate) { deathField.RemoveAllEntries(); deathField.AddEntryToHistory(deathDate, "death", value: true); } - + + RemoveInvalidMotherAndFatherEntries(character, femaleCharacterIds, maleCharacterIds); + // Remove dated name changes like 64.10.13 = { name = "Linus" } var nameField = character.History.Fields["name"]; nameField.RemoveHistoryPastDate(birthDate); @@ -67,14 +82,34 @@ public void LoadCK3Characters(ModFilesystem ck3ModFS, Date bookmarkDate) { character.History.Fields["effects"].RemoveAllEntries( entry => irrelevantEffects.Any(effect => entry.ToString()?.Contains(effect) ?? false)); - // Clear some fields we don't need. - foreach (var fieldName in fieldsToClear) { - character.History.Fields[fieldName].RemoveAllEntries(); - } - character.InitSpousesCache(); character.InitConcubinesCache(); character.UpdateChildrenCacheOfParents(); } } + + private static void RemoveInvalidMotherAndFatherEntries(Character character, HashSet femaleCharacterIds, HashSet maleCharacterIds) { + // Remove wrong sex mother and father references (male mothers, female fathers). + var motherField = character.History.Fields["mother"]; + motherField.RemoveAllEntries(value => { + string? motherId = value.ToString()?.RemQuotes(); + if (motherId is null || !femaleCharacterIds.Contains(motherId)) { + Logger.Debug($"Removing invalid mother {motherId} from character {character.Id}"); + return true; + } + + return false; + }); + + var fatherField = character.History.Fields["father"]; + fatherField.RemoveAllEntries(value => { + string? fatherId = value.ToString()?.RemQuotes(); + if (fatherId is null || !maleCharacterIds.Contains(fatherId)) { + Logger.Debug($"Removing invalid father {fatherId} from character {character.Id}"); + return true; + } + + return false; + }); + } } \ No newline at end of file diff --git a/ImperatorToCK3/CK3/Characters/DNAFactory.cs b/ImperatorToCK3/CK3/Characters/DNAFactory.cs index 3648748f3..32f36b79e 100644 --- a/ImperatorToCK3/CK3/Characters/DNAFactory.cs +++ b/ImperatorToCK3/CK3/Characters/DNAFactory.cs @@ -395,7 +395,10 @@ AccessoryGene ck3Gene Logger.Warn($"No object mappings found for {geneInfo.ObjectName} in gene {irGeneName}!"); return null; } + + // Prefer using the smallest template that contains the object. var ck3GeneTemplate = ck3Gene.GeneTemplates + .OrderBy(t => t.ObjectCountForAgeSex(irCharacter.AgeSex)) .FirstOrDefault(t => t.ContainsObjectForAgeSex(irCharacter.AgeSex, convertedSetEntry)); if (ck3GeneTemplate is null) { Logger.Warn($"No template found for {convertedSetEntry} in CK3 gene {ck3Gene.Id}!"); diff --git a/ImperatorToCK3/CK3/Cultures/CultureCollection.cs b/ImperatorToCK3/CK3/Cultures/CultureCollection.cs index 46c01370b..dab4a301a 100644 --- a/ImperatorToCK3/CK3/Cultures/CultureCollection.cs +++ b/ImperatorToCK3/CK3/Cultures/CultureCollection.cs @@ -34,6 +34,11 @@ private void InitCultureDataParser(ColorFactory colorFactory, OrderedDictionary< }); cultureDataParser.RegisterKeyword("parents", reader => { cultureData.ParentCultureIds = reader.GetStrings().ToOrderedSet(); + + if (cultureData.ParentCultureIds.Count > 2) { + Logger.Warn("Found a culture that has more than 2 parents! Only the first 2 will be used."); + cultureData.ParentCultureIds = cultureData.ParentCultureIds.Take(2).ToOrderedSet(); + } }); cultureDataParser.RegisterKeyword("heritage", reader => { var heritageId = reader.GetString(); diff --git a/ImperatorToCK3/CK3/Dynasties/Dynasty.cs b/ImperatorToCK3/CK3/Dynasties/Dynasty.cs index 1b5cf9f06..31662647f 100644 --- a/ImperatorToCK3/CK3/Dynasties/Dynasty.cs +++ b/ImperatorToCK3/CK3/Dynasties/Dynasty.cs @@ -11,6 +11,8 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; +using ImperatorCharacter = ImperatorToCK3.Imperator.Characters.Character; + namespace ImperatorToCK3.CK3.Dynasties; [SerializationByProperties] @@ -32,10 +34,10 @@ public Dynasty(Family irFamily, CharacterCollection irCharacters, CulturesDB irC ck3Member?.SetDynastyId(Id, date: null); } - SetLocFromImperatorFamilyName(irFamily.GetMaleForm(irCulturesDB), irLocDB, ck3LocDB); + SetLocFromImperatorFamilyName(irFamily.GetMaleForm(irCulturesDB), imperatorMembers, irLocDB, ck3LocDB); } - public Dynasty(CK3.Characters.Character character, string irFamilyName, CulturesDB irCulturesDB, LocDB irLocDB, CK3LocDB ck3LocDB, Date date) { + public Dynasty(CK3.Characters.Character character, string irFamilyName, ImperatorCharacter[] irMembers, CulturesDB irCulturesDB, LocDB irLocDB, CK3LocDB ck3LocDB, Date date) { FromImperator = true; Id = $"dynn_irtock3_from_{character.Id}"; Name = Id; @@ -47,7 +49,7 @@ public Dynasty(CK3.Characters.Character character, string irFamilyName, Cultures character.SetDynastyId(Id, null); - SetLocFromImperatorFamilyName(Family.GetMaleForm(irFamilyName, irCulturesDB), irLocDB, ck3LocDB); + SetLocFromImperatorFamilyName(Family.GetMaleForm(irFamilyName, irCulturesDB), irMembers, irLocDB, ck3LocDB); } public Dynasty(string dynastyId, BufferedReader dynastyReader) { @@ -125,8 +127,9 @@ private void SetCultureFromImperator(Family irFamily, IReadOnlyList i Logger.Warn($"Couldn't determine culture for dynasty {Id}, needs manual setting!"); } - private void SetLocFromImperatorFamilyName(string irFamilyLocKey, LocDB irLocDB, CK3LocDB ck3LocDB) { + private void SetLocFromImperatorFamilyName(string irFamilyLocKey, ImperatorCharacter[] irMembers, LocDB irLocDB, CK3LocDB ck3LocDB) { var irFamilyLoc = irLocDB.GetLocBlockForKey(irFamilyLocKey); + var ck3NameLoc = ck3LocDB.GetOrCreateLocBlock(Name); if (irFamilyLoc is not null) { ck3NameLoc.CopyFrom(irFamilyLoc); @@ -137,6 +140,19 @@ private void SetLocFromImperatorFamilyName(string irFamilyLocKey, LocDB irLocDB, return !string.IsNullOrEmpty(other) ? other : irFamilyLoc.Id; }); } else { // fallback: use unlocalized Imperator family key + // If the loc key is an empty string, try using a family name from the family's members. + if (string.IsNullOrEmpty(irFamilyLocKey)) { + foreach (var irMember in irMembers) { + if (irMember.FamilyName is null) { + continue; + } + + Logger.Debug($"Dynasty {Id} has an empty loc key! Using family name from member \"{irMember.FamilyName}\"."); + ck3NameLoc[ConverterGlobals.PrimaryLanguage] = irMember.FamilyName; + return; + } + } + Logger.Debug($"Dynasty {Id} has no localization for name \"{irFamilyLocKey}\"! Using unlocalized name."); ck3NameLoc[ConverterGlobals.PrimaryLanguage] = irFamilyLocKey; } diff --git a/ImperatorToCK3/CK3/Dynasties/DynastyCollection.cs b/ImperatorToCK3/CK3/Dynasties/DynastyCollection.cs index eb19e53c9..576cc9228 100644 --- a/ImperatorToCK3/CK3/Dynasties/DynastyCollection.cs +++ b/ImperatorToCK3/CK3/Dynasties/DynastyCollection.cs @@ -77,7 +77,8 @@ private void CreateDynastiesForCharactersFromMinorFamilies(Imperator.World irWor } // Neither character nor their father have a dynasty, so we need to create a new one. - var newDynasty = new Dynasty(ck3Character, irFamilyName, irWorld.CulturesDB, irLocDB, ck3LocDB, date); + Imperator.Characters.Character[] irFamilyMembers = [irCharacter]; + var newDynasty = new Dynasty(ck3Character, irFamilyName, irFamilyMembers, irWorld.CulturesDB, irLocDB, ck3LocDB, date); AddOrReplace(newDynasty); ++createdDynastiesCount; } diff --git a/ImperatorToCK3/CK3/Religions/DoctrineCategory.cs b/ImperatorToCK3/CK3/Religions/DoctrineCategory.cs index a39c7a3c8..8b74aa446 100644 --- a/ImperatorToCK3/CK3/Religions/DoctrineCategory.cs +++ b/ImperatorToCK3/CK3/Religions/DoctrineCategory.cs @@ -8,6 +8,8 @@ namespace ImperatorToCK3.CK3.Religions; public sealed class DoctrineCategory : IIdentifiable { public string Id { get; } public string? GroupId { get; private set; } + public int NumberOfPicks { get; private set; } = 1; + private readonly OrderedSet doctrineIds = new(); public IReadOnlyCollection DoctrineIds => doctrineIds.ToImmutableArray(); @@ -16,6 +18,7 @@ public DoctrineCategory(string id, BufferedReader categoryReader) { var parser = new Parser(); parser.RegisterKeyword("group", reader => GroupId = reader.GetString()); + parser.RegisterKeyword("number_of_picks", reader => NumberOfPicks = reader.GetInt()); parser.RegisterRegex(CommonRegexes.String, (reader, doctrineId) => { doctrineIds.Add(doctrineId); ParserHelpers.IgnoreItem(reader); diff --git a/ImperatorToCK3/CK3/Religions/Faith.cs b/ImperatorToCK3/CK3/Religions/Faith.cs index 7c792e318..7845513dd 100644 --- a/ImperatorToCK3/CK3/Religions/Faith.cs +++ b/ImperatorToCK3/CK3/Religions/Faith.cs @@ -26,11 +26,25 @@ public Faith(string id, FaithData faithData, Religion religion) { attributes = [.. faithData.Attributes]; // Fixup for issue found in TFE: add reformed_icon if faith has unreformed_faith_doctrine. - if (DoctrineIds.Contains("unreformed_faith_doctrine") && !attributes.Any(pair => pair.Key == "reformed_icon")) { + if (DoctrineIds.Contains("unreformed_faith_doctrine") && attributes.All(pair => pair.Key != "reformed_icon")) { // Use the icon attribute. var icon = attributes.FirstOrDefault(pair => pair.Key == "icon"); attributes = [.. attributes, new KeyValuePair("reformed_icon", icon.Value)]; } + + // Fix a faith having more doctrines in the same category than allowed. + foreach (var category in religion.ReligionCollection.DoctrineCategories) { + var doctrinesInCategory = DoctrineIds.Where(d => category.DoctrineIds.Contains(d)).ToArray(); + if (doctrinesInCategory.Length > category.NumberOfPicks) { + Logger.Warn($"Faith {Id} has too many doctrines in category {category.Id}: " + + $"{string.Join(", ", doctrinesInCategory)}. Keeping the last {category.NumberOfPicks} of them."); + + DoctrineIds.ExceptWith(doctrinesInCategory); + foreach (var doctrine in doctrinesInCategory.Reverse().Take(category.NumberOfPicks)) { + DoctrineIds.Add(doctrine); + } + } + } } private readonly OrderedSet holySiteIds; @@ -78,17 +92,21 @@ public string Serialize(string indent, bool withBraces) { return sb.ToString(); } - public string? GetDoctrineIdForDoctrineCategoryId(string doctrineCategoryId) { + public OrderedSet GetDoctrineIdsForDoctrineCategoryId(string doctrineCategoryId) { var category = Religion.ReligionCollection.DoctrineCategories[doctrineCategoryId]; - return GetDoctrineIdForDoctrineCategory(category); + return GetDoctrineIdsForDoctrineCategory(category); } - private string? GetDoctrineIdForDoctrineCategory(DoctrineCategory category) { + private OrderedSet GetDoctrineIdsForDoctrineCategory(DoctrineCategory category) { var potentialDoctrineIds = category.DoctrineIds; // Look in faith first. If not found, look in religion. - var matchingInFaith = DoctrineIds.Intersect(potentialDoctrineIds).LastOrDefault(); - return matchingInFaith ?? Religion.DoctrineIds.Intersect(potentialDoctrineIds).LastOrDefault(); + var matchingInFaith = DoctrineIds.Intersect(potentialDoctrineIds).ToOrderedSet(); + if (matchingInFaith.Any()) { + return matchingInFaith; + } else { + return Religion.DoctrineIds.Intersect(potentialDoctrineIds).ToOrderedSet(); + } } public bool HasDoctrine(string doctrineId) { @@ -98,6 +116,6 @@ public bool HasDoctrine(string doctrineId) { return false; } - return GetDoctrineIdForDoctrineCategory(category) == doctrineId; + return GetDoctrineIdsForDoctrineCategory(category).Contains(doctrineId); } } \ No newline at end of file diff --git a/ImperatorToCK3/CK3/Religions/HolySite.cs b/ImperatorToCK3/CK3/Religions/HolySite.cs index 2e2654d7e..45e548667 100644 --- a/ImperatorToCK3/CK3/Religions/HolySite.cs +++ b/ImperatorToCK3/CK3/Religions/HolySite.cs @@ -54,6 +54,18 @@ public HolySite(string id, BufferedReader holySiteReader, Title.LandedTitles lan if (parsedBaronyId is not null) { Barony = landedTitles[parsedBaronyId]; } + + // Fix "barony not in specified county" errors reported by ck3-tiger. + if (Barony is not null && County is not null && Barony.DeJureLiege != County) { + string baseMessage = $"Holy site {Id} has barony {Barony.Id} not in specified county {County.Id}."; + var correctCounty = Barony.DeJureLiege; + if (correctCounty is not null) { + Logger.Debug($"{baseMessage} Setting county to {correctCounty.Id}."); + County = correctCounty; + } else { + Logger.Warn($"{baseMessage} Cannot find correct county."); + } + } } private static string GenerateHolySiteId(Title barony, Faith faith) { diff --git a/ImperatorToCK3/CK3/Religions/Religion.cs b/ImperatorToCK3/CK3/Religions/Religion.cs index 02bd8712e..453d6a71d 100644 --- a/ImperatorToCK3/CK3/Religions/Religion.cs +++ b/ImperatorToCK3/CK3/Religions/Religion.cs @@ -34,6 +34,20 @@ public Religion(string id, BufferedReader religionReader, ReligionCollection rel attributes.Add(new KeyValuePair(keyword, reader.GetStringOfItem())); }); religionParser.ParseStream(religionReader); + + // Fix a religion having more doctrines in the same category than allowed. + foreach (var category in religions.DoctrineCategories) { + var doctrinesInCategory = DoctrineIds.Where(d => category.DoctrineIds.Contains(d)).ToArray(); + if (doctrinesInCategory.Length > category.NumberOfPicks) { + Logger.Warn($"Religion {Id} has too many doctrines in category {category.Id}: " + + $"{string.Join(", ", doctrinesInCategory)}. Keeping the last {category.NumberOfPicks} of them."); + + DoctrineIds.ExceptWith(doctrinesInCategory); + foreach (var doctrine in doctrinesInCategory.Reverse().Take(category.NumberOfPicks)) { + DoctrineIds.Add(doctrine); + } + } + } } private void LoadFaith(string faithId, BufferedReader faithReader) { faithData = new FaithData(); diff --git a/ImperatorToCK3/CK3/Religions/ReligionCollection.cs b/ImperatorToCK3/CK3/Religions/ReligionCollection.cs index 33a07ece3..b602f861d 100644 --- a/ImperatorToCK3/CK3/Religions/ReligionCollection.cs +++ b/ImperatorToCK3/CK3/Religions/ReligionCollection.cs @@ -300,7 +300,7 @@ Date date var aliveFaithsWithSpiritualHeadDoctrine = Faiths .Where(f => aliveCharacterFaithIds.Contains(f.Id) || provinceFaithIds.Contains(f.Id)) - .Where(f => f.GetDoctrineIdForDoctrineCategoryId("doctrine_head_of_faith") == "doctrine_spiritual_head") + .Where(f => f.GetDoctrineIdsForDoctrineCategoryId("doctrine_head_of_faith").Contains("doctrine_spiritual_head")) .ToImmutableList(); foreach (var faith in aliveFaithsWithSpiritualHeadDoctrine) { diff --git a/ImperatorToCK3/CK3/Titles/LandedTitles.cs b/ImperatorToCK3/CK3/Titles/LandedTitles.cs index ecf7b2189..edb170441 100644 --- a/ImperatorToCK3/CK3/Titles/LandedTitles.cs +++ b/ImperatorToCK3/CK3/Titles/LandedTitles.cs @@ -67,6 +67,44 @@ public void LoadTitles(ModFilesystem ck3ModFS, CK3LocDB ck3LocDB) { } } + // Cleanup for counties having "capital" entries (found in TFE). + foreach (var county in Counties) { + if (county.CapitalCountyId is null) { + continue; + } + + Logger.Debug($"Removing capital entry from county {county.Id}."); + county.CapitalCountyId = null; + } + + // Cleanup for titles having invalid capital counties. + var validTitleIds = this.Select(t => t.Id).ToHashSet(); + var placeholderCountyId = validTitleIds.Order().First(t => t.StartsWith("c_")); + foreach (var title in this.Where(t => t.Rank > TitleRank.county)) { + if (title.CapitalCountyId is null && !title.Landless) { + // For landed titles, the game will generate capitals. + continue; + } + if (title.CapitalCountyId is not null && validTitleIds.Contains(title.CapitalCountyId)) { + continue; + } + // Try to use the first valid capital of a de jure vassal. + var newCapitalId = title.DeJureVassals + .Select(v => v.CapitalCountyId) + .FirstOrDefault(vassalCapitalId => vassalCapitalId is not null && validTitleIds.Contains(vassalCapitalId)); + // If not found, for landless titles try using capital of de jure liege. + if (newCapitalId is null && title.Landless) { + newCapitalId = title.DeJureLiege?.CapitalCountyId; + } + if (newCapitalId is not null) { + Logger.Debug($"Title {title.Id} has invalid capital county {title.CapitalCountyId ?? "NULL"}, replacing it with {newCapitalId}."); + title.CapitalCountyId = newCapitalId; + } else { + Logger.Warn($"Using placeholder county as capital for title {title.Id} with invalid capital county {title.CapitalCountyId ?? "NULL"}."); + title.CapitalCountyId = placeholderCountyId; + } + } + Logger.IncrementProgress(); } public void LoadTitles(BufferedReader reader) { @@ -266,29 +304,64 @@ public ImmutableHashSet GetAllHolderIds() { } public void CleanUpHistory(CharacterCollection characters, Date ck3BookmarkDate) { - Logger.Debug("Removing invalid holders from history..."); + Logger.Debug("Cleaning up title history..."); - var validIds = characters.Select(c => c.Id).ToImmutableHashSet(); - foreach (var title in this) { + // Remove invalid holder ID entries. + var validCharacterIds = characters.Select(c => c.Id).ToImmutableHashSet(); + Parallel.ForEach(this, title => { if (!title.History.Fields.TryGetValue("holder", out var holderField)) { - continue; + return; } holderField.RemoveAllEntries( - value => value.ToString() is string valStr && valStr != "0" && !validIds.Contains(valStr) + value => value.ToString()?.RemQuotes() is string valStr && valStr != "0" && !validCharacterIds.Contains(valStr) ); - } + + // Afterwards, remove empty date entries. + holderField.DateToEntriesDict.RemoveWhere(kvp => kvp.Value.Count == 0); + }); + + // Fix holder being born after receiving the title, by moving the title grant to the birth date. + Parallel.ForEach(this, title => { + if (!title.History.Fields.TryGetValue("holder", out var holderField)) { + return; + } + + foreach (var (date, entriesList) in holderField.DateToEntriesDict.ToArray()) { + if (date > ck3BookmarkDate) { + continue; + } + + var lastEntry = entriesList[^1]; + var holderId = lastEntry.Value.ToString()?.RemQuotes(); + if (holderId is null || holderId == "0") { + continue; + } + + if (!characters.TryGetValue(holderId, out var holder)) { + holderField.DateToEntriesDict.Remove(date); + continue; + } + + var holderBirthDate = holder.BirthDate; + if (date <= holderBirthDate) { + // Move the title grant to the birth date. + holderField.DateToEntriesDict.Remove(date); + holderField.AddEntryToHistory(holderBirthDate, lastEntry.Key, lastEntry.Value); + } + } + }); // For counties, remove holder = 0 entries that precede a holder = entry // that's before or at the bookmark date. - foreach (var county in Counties) { + Parallel.ForEach(Counties, county => { if (!county.History.Fields.TryGetValue("holder", out var holderField)) { - continue; + return; } var holderIdAtBookmark = county.GetHolderId(ck3BookmarkDate); if (holderIdAtBookmark == "0") { - continue; + return; } // If we have a holder at the bookmark date, remove all holder = 0 entries that precede it. @@ -299,7 +372,39 @@ public void CleanUpHistory(CharacterCollection characters, Date ck3BookmarkDate) foreach (var date in entryDatesToRemove) { holderField.DateToEntriesDict.Remove(date); } - } + }); + + // Remove liege entries of the same rank as the title they're in. + // For example, TFE had more or less this: d_kordofan = { liege = d_kordofan } + var validRankChars = new HashSet { 'e', 'k', 'd', 'c', 'b'}; + Parallel.ForEach(this, title => { + if (!title.History.Fields.TryGetValue("liege", out var liegeField)) { + return; + } + + var titleRank = title.Rank; + + liegeField.RemoveAllEntries(value => { + string? valueStr = value.ToString()?.RemQuotes(); + if (valueStr is null || valueStr == "0") { + return false; + } + + char rankChar = valueStr[0]; + if (!validRankChars.Contains(rankChar)) { + Logger.Warn($"Removing invalid rank liege entry from {title.Id}: {valueStr}"); + return true; + } + + var liegeRank = TitleRankUtils.CharToTitleRank(rankChar); + if (liegeRank <= titleRank) { + Logger.Warn($"Removing invalid rank liege entry from {title.Id}: {valueStr}"); + return true; + } + + return false; + }); + }); // Remove liege entries that are not valid (liege title is not held at the entry date). foreach (var title in this) { @@ -313,7 +418,7 @@ public void CleanUpHistory(CharacterCollection characters, Date ck3BookmarkDate) } var lastEntry = entriesList.Last(); - var liegeTitleId = lastEntry.Value.ToString(); + var liegeTitleId = lastEntry.Value.ToString()?.RemQuotes(); if (liegeTitleId is null || liegeTitleId == "0") { continue; } @@ -324,9 +429,9 @@ public void CleanUpHistory(CharacterCollection characters, Date ck3BookmarkDate) // Instead of removing the liege entry, see if the liege title has a holder at a later date, // and move the liege entry to that date. liegeTitle.History.Fields.TryGetValue("holder", out var liegeHolderField); - Date? laterDate = liegeHolderField?.DateToEntriesDict.Keys - .Where(d => d > date && d <= ck3BookmarkDate) - .Min(); + Date? laterDate = liegeHolderField?.DateToEntriesDict + .Where(kvp => kvp.Key > date && kvp.Key <= ck3BookmarkDate && kvp.Value.Count != 0 && kvp.Value[^1].Value.ToString() != "0") + .Min(kvp => kvp.Key); if (laterDate == null) { liegeField.DateToEntriesDict.Remove(date); diff --git a/ImperatorToCK3/CK3/Titles/Title.cs b/ImperatorToCK3/CK3/Titles/Title.cs index fc195305d..f7d2fbb34 100644 --- a/ImperatorToCK3/CK3/Titles/Title.cs +++ b/ImperatorToCK3/CK3/Titles/Title.cs @@ -751,8 +751,8 @@ public HashSet GetAllHolderIds() { return ids; } public void SetHolder(Character? character, Date date) { - var id = character is null ? "0" : character.Id; - History.AddFieldValue(date, "holder", "holder", id); + var holderId = character is null ? "0" : character.Id; + History.AddFieldValue(date, "holder", "holder", holderId); } public void SetDevelopmentLevel(int value, Date date) { @@ -1433,12 +1433,12 @@ private void AppointCouncilMembersFromImperator(ReligionCollection religionColle } // Skip if the faith doesn't allow the character's gender to be clergy. - var clerigalGenderDoctrine = rulerFaith.GetDoctrineIdForDoctrineCategoryId("doctrine_clerical_gender"); - if (clerigalGenderDoctrine is not null) { - if (clerigalGenderDoctrine == "doctrine_clerical_gender_female_only" && !ck3Official.Female) { + var clerigalGenderDoctrines = rulerFaith.GetDoctrineIdsForDoctrineCategoryId("doctrine_clerical_gender"); + if (clerigalGenderDoctrines.Any()) { + if (clerigalGenderDoctrines.Contains("doctrine_clerical_gender_female_only") && !ck3Official.Female) { continue; } - if (clerigalGenderDoctrine == "doctrine_clerical_gender_male_only" && ck3Official.Female) { + if (clerigalGenderDoctrines.Contains("doctrine_clerical_gender_male_only") && ck3Official.Female) { continue; } } @@ -1447,12 +1447,15 @@ private void AppointCouncilMembersFromImperator(ReligionCollection religionColle if (heldTitlesCount == 0) { var courtFaith = ck3Ruler.GetFaithId(irSaveDate); if (courtFaith is not null) { - var dominantGenderDoctrine = religionCollection.GetFaith(courtFaith)? - .GetDoctrineIdForDoctrineCategoryId("doctrine_gender"); - if (dominantGenderDoctrine == "doctrine_gender_male_dominated" && ck3Official.Female) { + var dominantGenderDoctrines = religionCollection.GetFaith(courtFaith)? + .GetDoctrineIdsForDoctrineCategoryId("doctrine_gender"); + if (dominantGenderDoctrines is null) { continue; } - if (dominantGenderDoctrine == "doctrine_gender_female_dominated" && !ck3Official.Female) { + if (dominantGenderDoctrines.Contains("doctrine_gender_male_dominated") && ck3Official.Female) { + continue; + } + if (dominantGenderDoctrines.Contains("doctrine_gender_female_dominated") && !ck3Official.Female) { continue; } } diff --git a/ImperatorToCK3/CK3/Titles/TitleRankUtils.cs b/ImperatorToCK3/CK3/Titles/TitleRankUtils.cs index 8850f6c60..6839ae623 100644 --- a/ImperatorToCK3/CK3/Titles/TitleRankUtils.cs +++ b/ImperatorToCK3/CK3/Titles/TitleRankUtils.cs @@ -3,14 +3,14 @@ namespace ImperatorToCK3.CK3.Titles; public static class TitleRankUtils { - public static TitleRank CharToTitleRank(char c) { - return c switch { + public static TitleRank CharToTitleRank(char rankChar) { + return rankChar switch { 'e' => TitleRank.empire, 'k' => TitleRank.kingdom, 'd' => TitleRank.duchy, 'c' => TitleRank.county, 'b' => TitleRank.barony, - _ => throw new ArgumentOutOfRangeException(nameof(c)) + _ => throw new ArgumentOutOfRangeException(nameof(rankChar), $"Unknown title rank character: {rankChar}") }; } } \ No newline at end of file diff --git a/ImperatorToCK3/CK3/World.cs b/ImperatorToCK3/CK3/World.cs index 2fdec76cd..586cfe2c4 100644 --- a/ImperatorToCK3/CK3/World.cs +++ b/ImperatorToCK3/CK3/World.cs @@ -131,7 +131,11 @@ public World(Imperator.World impWorld, Configuration config, Thread? irCoaExtrac Logger.Info("Loading map data..."); MapData = new MapData(ModFS); }, - () => CK3CoaMapper = new(ModFS) + () => CK3CoaMapper = new(ModFS), + () => { + // Modify some CK3 and mod files and put them in the output before we start outputting anything. + FileTweaker.ModifyAndRemovePartsOfFiles(ModFS, outputModPath, config).Wait(); + } ); OrderedDictionary ck3ModFlags = config.GetCK3ModFlags(); @@ -270,6 +274,8 @@ public World(Imperator.World impWorld, Configuration config, Thread? irCoaExtrac ClearFeaturedCharactersDescriptions(config.CK3BookmarkDate); Dynasties.LoadCK3Dynasties(ModFS); + // Now that we have loaded all dynasties from CK3, we can remove invalid dynasty IDs from character history. + Characters.RemoveInvalidDynastiesFromHistory(Dynasties); Dynasties.ImportImperatorFamilies(impWorld, cultureMapper, impWorld.LocDB, LocDB, CorrectedDate); DynastyHouses.LoadCK3Houses(ModFS); diff --git a/ImperatorToCK3/CommonUtils/EnumerableExtensions.cs b/ImperatorToCK3/CommonUtils/EnumerableExtensions.cs new file mode 100644 index 000000000..887f8b7e0 --- /dev/null +++ b/ImperatorToCK3/CommonUtils/EnumerableExtensions.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Linq; + +namespace ImperatorToCK3.CommonUtils; + +public static class EnumerableExtensions +{ + public static KeyValuePair? LastOrNull( + this IEnumerable> source) { + var keyValuePairs = source as KeyValuePair[] ?? source.ToArray(); + return keyValuePairs.Length != 0 + ? keyValuePairs.Last() + : null; + } +} \ No newline at end of file diff --git a/ImperatorToCK3/CommonUtils/Genes/AccessoryGeneTemplate.cs b/ImperatorToCK3/CommonUtils/Genes/AccessoryGeneTemplate.cs index 9891a3be8..840562e7d 100644 --- a/ImperatorToCK3/CommonUtils/Genes/AccessoryGeneTemplate.cs +++ b/ImperatorToCK3/CommonUtils/Genes/AccessoryGeneTemplate.cs @@ -33,6 +33,10 @@ private void RegisterKeys(Parser parser) { }); parser.IgnoreUnregisteredItems(); } + + public int ObjectCountForAgeSex(string ageSex) { + return AgeSexWeightBlocks.TryGetValue(ageSex, out var weightBlock) ? weightBlock.ObjectCount : 0; + } public bool ContainsObjectForAgeSex(string ageSex, string objectName) { return AgeSexWeightBlocks.TryGetValue(ageSex, out var weightBlock) && weightBlock.ContainsObject(objectName); diff --git a/ImperatorToCK3/CommonUtils/Genes/WeightBlock.cs b/ImperatorToCK3/CommonUtils/Genes/WeightBlock.cs index 707a19e4a..15e8dd6a1 100644 --- a/ImperatorToCK3/CommonUtils/Genes/WeightBlock.cs +++ b/ImperatorToCK3/CommonUtils/Genes/WeightBlock.cs @@ -8,6 +8,8 @@ namespace ImperatorToCK3.CommonUtils.Genes; public sealed class WeightBlock { public uint SumOfAbsoluteWeights { get; private set; } = 0; private readonly List> objectsList = []; + + public int ObjectCount => objectsList.Count; public WeightBlock() { } public WeightBlock(BufferedReader reader) { diff --git a/ImperatorToCK3/Data_Files/blankMod/output/localization/replace/english/zzz_IRToCK3_tfe_override_l_english.yml b/ImperatorToCK3/Data_Files/blankMod/output/localization/replace/english/zzz_IRToCK3_tfe_override_l_english.yml new file mode 100644 index 000000000..133f6c524 --- /dev/null +++ b/ImperatorToCK3/Data_Files/blankMod/output/localization/replace/english/zzz_IRToCK3_tfe_override_l_english.yml @@ -0,0 +1,75 @@ +l_english: + # MUST READ: + # for every overridden loc, explain why we're overriding it! + + # The event about the division of the Roman Empire should not mention Diocletian. + tfe_title_event.0004.desc: "The Empire now faces many external and internal problems. To make it more manageable, it needs to be split into two halves: a Western half centered on Italia, and an Eastern half centered on Constantinople.\n\nThe big question that remains is whether to do this now, or later. On one hand, ruling a united Empire is an overwhelming burden on myself. On the other hand, if I am confident enough in my abilities to hold the Empire together for the short-term, we can have it split between my heirs #italic after#! I die." + + # Don't mention Italy being the "old heartland of the Roman Empire"; we don't know if it was the heartland in the converted game. + tfe_culture.3000.desc: "In the past few generations, recent political events in [GetGeographicalRegion('world_europe_south_italy').GetName] have led to great social upheaval and cultural changes in places like [county_to_convert.GetNameNoTier].\n\nOne can now argue that even though the descendants of the [old_culture.GetCollectiveNoun] who live in [county_to_convert.GetNameNoTier] still remember and honor their glorious past, they are no longer truly like their ancestors. As of late, it is more accurate to say that the inhabitants of [county_to_convert.GetNameNoTierNoTooltip] have transformed from the Romans of classical antiquity into a new, different people: the [italian.GetCollectiveNoun]." + + # cn_name_list_marienburg is missing localization as of TFE 'After the Pharaohs' update. + cn_name_list_marienburg: "Marienburg" + # cn_name_list_marienwerder is missing localization as of TFE 'After the Pharaohs' update. + cn_name_list_marienwerder: "Marienwerder" + # cn_name_list_troki is missing localization as of TFE 'After the Pharaohs' update. + cn_troki: "Troki" + # cn_name_list_welshpool is missing localization as of TFE 'After the Pharaohs' update. + cn_name_list_welshpool: "Welshpool" + + # evenk_prefix is missing localization as of TFE 'After the Pharaohs' update. + evenk_prefix: "Evenk" + # evenk_collective_noun is missing localization as of TFE 'After the Pharaohs' update. + evenk_collective_noun: "Evenks" + + # shaka_prefix is missing localization as of TFE 'After the Pharaohs' update. + shaka_prefix: "Shaka" + + # beja_health_god_god_name is missing localization as of TFE 'After the Pharaohs' update. + beja_health_god_god_name: "$paganism_health_god_name$" + # beja_health_god_god_name_possessive is missing localization as of TFE 'After the Pharaohs' update. + beja_health_god_god_name_possessive: "$paganism_health_god_name_possessive$" + # beja_high_god_god_name is missing localization as of TFE 'After the Pharaohs' update. + beja_high_god_god_name: "$paganism_high_god_name$" + # beja_high_god_god_name_possessive is missing localization as of TFE 'After the Pharaohs' update. + beja_high_god_god_name_possessive: "$paganism_high_god_name_possessive$" + + # from error.log: "Unrecognized loc key teachings_of_ulfilas_name. teachings_of_ulfilas" + teachings_of_ulfilas_name: "special_faith_teachings_of_ulfilas_name" + + # Unlocalized TFE name lists from error.log: + name_list_tuareg: "Tuareg" + name_list_afri: "Afri" + name_list_nivkh: "Nivkh" + name_list_yukaghir: "Yukaghir" + + # GALLAECIA is missing localization as of TFE 'After the Pharaohs' update. + GALLAECIA: "Gallaecia" + + # from error.log: + # Unrecognized loc key unavailable_doctrine_name. unavailable_doctrine + # Unrecognized loc key unavailable_doctrine_desc. unavailable_doctrine + unavailable_doctrine_name: "Unavailable" + unavailable_doctrine_desc: "" + + # The rock_of_gibraltar_01 building is missing as of TFE 'After the Pharaohs' update. Replace the datafunction with a static text. + building_rock_of_gibraltar_destination_desc: "The Rock of Gibraltar, rising majestically above the sea, is a strategic and symbolic landmark. The local people, aware of its military significance, have fortified it over the centuries, making it a bastion at the gateway between two worlds." + + # from error.log: + # Missing loc for caucasian_group_coa_gfx + caucasian_group_coa_gfx: "Caucasian" + + # from error.log: + # Culture missing localization for maganite + # Missing localization for maganite_prefix + # Missing localization for maganite_collective_noun + # https://en.wikipedia.org/wiki/Magan_(civilization) + maganite: "Maganite" + maganite_prefix: "Maganite" + maganite_collective_noun: "Maganites" + + # from error.log: + # Key is missing localization: TFE_gladiator_completed_log_entry_title + # Key is missing localization: TFE_chariot_completed_log_entry_title + TFE_gladiator_completed_log_entry_title: "$TFE_gladiator_completed_log_title$" + TFE_chariot_completed_log_entry_title: "$TFE_chariot_completed_log_title$" \ No newline at end of file diff --git a/ImperatorToCK3/Data_Files/blankMod/output/localization/replace/english/zzz_IRToCK3_vanilla_override_l_english.yml b/ImperatorToCK3/Data_Files/blankMod/output/localization/replace/english/zzz_IRToCK3_vanilla_override_l_english.yml index 34c482638..b1687e428 100644 --- a/ImperatorToCK3/Data_Files/blankMod/output/localization/replace/english/zzz_IRToCK3_vanilla_override_l_english.yml +++ b/ImperatorToCK3/Data_Files/blankMod/output/localization/replace/english/zzz_IRToCK3_vanilla_override_l_english.yml @@ -3,10 +3,24 @@ # for every overridden loc, explain why we're overriding it! # "Eastern Roman" makes little sense for cultures diverging from Roman culture in the West. It's also weird for Roman culture to have "Roman Legacy". tradition_roman_legacy_name: "Imperial Legacy" + # "Byzantine" does not make sense for a world where the "Byzantine Empire" never existed. heritage_byzantine: "Hellenistic" heritage_byzantine_name: "Hellenistic" heritage_byzantine_collective_noun: "Hellenists" + # "Hispania" is a Roman name for the Iberian Peninsula. e_spain: "Iberia" e_spain_adj: "Iberian" + + # Don't mention Justinian in the event description. + ep3_emperor_yearly.8030.desc: "A fearsome whale ravages shipping along the straits, my [ROOT.Char.Custom2('RelationToMeShort', complainer)], [complainer.GetTitledFirstName] laments: "Fishermen, merchants — even naval captains! All dread leaving their havens."\n\nDubious stratagems are offered to deal with this terror of the deep, as accounts of its exploits pile up." + + # Don't mention Leo the Isaurian in the event description. + ep3_emperor_yearly.8040.leo: "The Iconoclastic doctrine brought great strife to the empire, and to Christendom — but only for a time..." + + # Hasan Sabbah decisions are removed by the converter. + unlock_evangelize_decision_tt: "" + unlock_final_hasan_decisions_1_tt: "" + unlock_final_hasan_decisions_2_tt: "" + unlock_final_hasan_decisions_3_tt: "" diff --git a/ImperatorToCK3/Data_Files/configurables/ck3_characters_to_preserve.txt b/ImperatorToCK3/Data_Files/configurables/ck3_characters_to_preserve.txt index 48b061731..d54ea29e3 100644 --- a/ImperatorToCK3/Data_Files/configurables/ck3_characters_to_preserve.txt +++ b/ImperatorToCK3/Data_Files/configurables/ck3_characters_to_preserve.txt @@ -34,6 +34,12 @@ after_bookmark_date = { # Characters referenced in achievements: 109607 + 41702 + 6878 + 159137 + 215009 + 34281 + 466517 # Characters eferenced in events\dlc\fp2\fp2_el_cid_events.txt: 107590 # El Cid @@ -45,6 +51,25 @@ after_bookmark_date = { 34014 34005 33911 + + # Characters referenced in events\dlc\ep3\ep3_story_cycle_violet_poet_events.txt + andalusian_0003 + andalusian_0004 + + # Characters referenced in common/scripted_effects/07_dlc_ep3_scripted_effects.txt + 90028 + + # Characters referenced in events\dlc\ep3\ep3_laamp_events.txt + 122 + 102531 + 364 + 114 + 175 + 172 + 161266 + + # Characters referenced in tests\dynasty_links_tests.txt + 120 # Easter egg characters: easteregg_veronica_pazos @@ -117,7 +142,6 @@ after_bookmark_date = { easteregg_maxence_voleau easteregg_jason_cantalini easteregg_fabian_franzen - easteregg_veronica_pazos easteregg_weronika_kowalczyk easteregg_jakob_jorstedt easteregg_tess_lindholm @@ -155,4 +179,5 @@ after_bookmark_date = { easteregg_lucia_dzediti easteregg_david_ostlund easteregg_neyla_garcia + easteregg_anna_johansson } \ No newline at end of file diff --git a/ImperatorToCK3/Data_Files/configurables/converter_cultures.txt b/ImperatorToCK3/Data_Files/configurables/converter_cultures.txt index 81aa5d1b0..65d133c63 100644 --- a/ImperatorToCK3/Data_Files/configurables/converter_cultures.txt +++ b/ImperatorToCK3/Data_Files/configurables/converter_cultures.txt @@ -92,7 +92,14 @@ nuragic = { 10 = mediterranean } - coa_gfx = { latin_group_coa_gfx western_coa_gfx } + MOD_DEPENDENT = { + IF tfe = { + # Solves the error.log containing a line about not matching sequence in noric. + coa_gfx = { latin_group_coa_gfx breton_coa_gfx } + } ELSE = { + coa_gfx = { latin_group_coa_gfx western_coa_gfx } + } + } building_gfx = { mediterranean_building_gfx } clothing_gfx = { western_clothing_gfx } unit_gfx = { mena_unit_gfx } @@ -1720,7 +1727,14 @@ oscan = { ethos = ethos_egalitarian - coa_gfx = { latin_group_coa_gfx western_coa_gfx } + MOD_DEPENDENT = { + IF tfe = { + # Solves the error.log containing a line about not matching sequence in noric. + coa_gfx = { latin_group_coa_gfx breton_coa_gfx } + } ELSE = { + coa_gfx = { latin_group_coa_gfx western_coa_gfx } + } + } building_gfx = { mediterranean_building_gfx } clothing_gfx = { western_clothing_gfx } unit_gfx = { western_unit_gfx } @@ -1747,7 +1761,14 @@ samnite = { ethos = ethos_stoic - coa_gfx = { latin_group_coa_gfx western_coa_gfx } + MOD_DEPENDENT = { + IF tfe = { + # Solves the error.log containing a line about not matching sequence in noric. + coa_gfx = { latin_group_coa_gfx breton_coa_gfx } + } ELSE = { + coa_gfx = { latin_group_coa_gfx western_coa_gfx } + } + } building_gfx = { mediterranean_building_gfx } clothing_gfx = { western_clothing_gfx } unit_gfx = { western_unit_gfx } @@ -1776,7 +1797,14 @@ venetic = { # https://en.wikipedia.org/wiki/Adriatic_Veneti ethos = ethos_stoic - coa_gfx = { latin_group_coa_gfx western_coa_gfx } + MOD_DEPENDENT = { + IF tfe = { + # Solves the error.log containing a line about not matching sequence in noric. + coa_gfx = { latin_group_coa_gfx breton_coa_gfx } + } ELSE = { + coa_gfx = { latin_group_coa_gfx western_coa_gfx } + } + } building_gfx = { mediterranean_building_gfx } clothing_gfx = { western_clothing_gfx } unit_gfx = { western_unit_gfx } @@ -1810,7 +1838,14 @@ ligustic = { ethos = ethos_stoic - coa_gfx = { latin_group_coa_gfx western_coa_gfx } + MOD_DEPENDENT = { + IF tfe = { + # Solves the error.log containing a line about not matching sequence in noric. + coa_gfx = { latin_group_coa_gfx breton_coa_gfx } + } ELSE = { + coa_gfx = { latin_group_coa_gfx western_coa_gfx } + } + } building_gfx = { mediterranean_building_gfx } clothing_gfx = { western_clothing_gfx } unit_gfx = { western_unit_gfx } @@ -1839,7 +1874,14 @@ messapic = { ethos = ethos_stoic - coa_gfx = { latin_group_coa_gfx western_coa_gfx } + MOD_DEPENDENT = { + IF tfe = { + # Solves the error.log containing a line about not matching sequence in noric. + coa_gfx = { latin_group_coa_gfx breton_coa_gfx } + } ELSE = { + coa_gfx = { latin_group_coa_gfx western_coa_gfx } + } + } building_gfx = { mediterranean_building_gfx } clothing_gfx = { western_clothing_gfx } unit_gfx = { western_unit_gfx } @@ -1868,7 +1910,14 @@ sardonian = { ethos = ethos_stoic - coa_gfx = { latin_group_coa_gfx western_coa_gfx } + MOD_DEPENDENT = { + IF tfe = { + # Solves the error.log containing a line about not matching sequence in noric. + coa_gfx = { latin_group_coa_gfx breton_coa_gfx } + } ELSE = { + coa_gfx = { latin_group_coa_gfx western_coa_gfx } + } + } building_gfx = { mediterranean_building_gfx } clothing_gfx = { western_clothing_gfx } unit_gfx = { western_unit_gfx } @@ -1897,7 +1946,14 @@ siculian = { ethos = ethos_stoic - coa_gfx = { latin_group_coa_gfx western_coa_gfx } + MOD_DEPENDENT = { + IF tfe = { + # Solves the error.log containing a line about not matching sequence in noric. + coa_gfx = { latin_group_coa_gfx breton_coa_gfx } + } ELSE = { + coa_gfx = { latin_group_coa_gfx western_coa_gfx } + } + } building_gfx = { mediterranean_building_gfx } clothing_gfx = { western_clothing_gfx } unit_gfx = { western_unit_gfx } @@ -1935,7 +1991,14 @@ roman = { name_list = name_list_roman - coa_gfx = { latin_group_coa_gfx western_coa_gfx } + MOD_DEPENDENT = { + IF tfe = { + # Solves the error.log containing a line about not matching sequence in noric. + coa_gfx = { latin_group_coa_gfx breton_coa_gfx } + } ELSE = { + coa_gfx = { latin_group_coa_gfx western_coa_gfx } + } + } building_gfx = { mediterranean_building_gfx } clothing_gfx = { byzantine_clothing_gfx } clothing_gfx = { western_clothing_gfx } @@ -2174,7 +2237,14 @@ breathanach = { 30 = caucasian_dark_hair } - coa_gfx = { latin_group_coa_gfx western_coa_gfx } + MOD_DEPENDENT = { + IF tfe = { + # Solves the error.log containing a line about not matching sequence in noric. + coa_gfx = { latin_group_coa_gfx breton_coa_gfx } + } ELSE = { + coa_gfx = { latin_group_coa_gfx western_coa_gfx } + } + } building_gfx = { western_building_gfx } clothing_gfx = { northern_clothing_gfx } unit_gfx = { western_unit_gfx } @@ -2207,7 +2277,14 @@ transadrianic = { 30 = caucasian_dark_hair } - coa_gfx = { latin_group_coa_gfx western_coa_gfx } + MOD_DEPENDENT = { + IF tfe = { + # Solves the error.log containing a line about not matching sequence in noric. + coa_gfx = { latin_group_coa_gfx breton_coa_gfx } + } ELSE = { + coa_gfx = { latin_group_coa_gfx western_coa_gfx } + } + } building_gfx = { western_building_gfx } clothing_gfx = { northern_clothing_gfx } unit_gfx = { western_unit_gfx } @@ -2240,7 +2317,14 @@ brythenig = { 30 = caucasian_dark_hair } - coa_gfx = { latin_group_coa_gfx western_coa_gfx } + MOD_DEPENDENT = { + IF tfe = { + # Solves the error.log containing a line about not matching sequence in noric. + coa_gfx = { latin_group_coa_gfx breton_coa_gfx } + } ELSE = { + coa_gfx = { latin_group_coa_gfx western_coa_gfx } + } + } building_gfx = { western_building_gfx } clothing_gfx = { northern_clothing_gfx } unit_gfx = { western_unit_gfx } @@ -2274,7 +2358,14 @@ laessin = { 30 = caucasian_dark_hair } - coa_gfx = { latin_group_coa_gfx western_coa_gfx } + MOD_DEPENDENT = { + IF tfe = { + # Solves the error.log containing a line about not matching sequence in noric. + coa_gfx = { latin_group_coa_gfx breton_coa_gfx } + } ELSE = { + coa_gfx = { latin_group_coa_gfx western_coa_gfx } + } + } building_gfx = { western_building_gfx } clothing_gfx = { northern_clothing_gfx } unit_gfx = { western_unit_gfx } @@ -2307,7 +2398,14 @@ wenedyk = { 30 = caucasian_dark_hair } - coa_gfx = { latin_group_coa_gfx western_coa_gfx } + MOD_DEPENDENT = { + IF tfe = { + # Solves the error.log containing a line about not matching sequence in noric. + coa_gfx = { latin_group_coa_gfx breton_coa_gfx } + } ELSE = { + coa_gfx = { latin_group_coa_gfx western_coa_gfx } + } + } building_gfx = { western_building_gfx } clothing_gfx = { northern_clothing_gfx } unit_gfx = { western_unit_gfx } @@ -2460,7 +2558,14 @@ etruscan = { 10 = mediterranean } - coa_gfx = { latin_group_coa_gfx western_coa_gfx } + MOD_DEPENDENT = { + IF tfe = { + # Solves the error.log containing a line about not matching sequence in noric. + coa_gfx = { latin_group_coa_gfx breton_coa_gfx } + } ELSE = { + coa_gfx = { latin_group_coa_gfx western_coa_gfx } + } + } building_gfx = { mediterranean_building_gfx } clothing_gfx = { western_clothing_gfx } unit_gfx = { western_unit_gfx } @@ -2490,7 +2595,14 @@ rhaetian = { 10 = mediterranean } - coa_gfx = { latin_group_coa_gfx western_coa_gfx } + MOD_DEPENDENT = { + IF tfe = { + # Solves the error.log containing a line about not matching sequence in noric. + coa_gfx = { latin_group_coa_gfx breton_coa_gfx } + } ELSE = { + coa_gfx = { latin_group_coa_gfx western_coa_gfx } + } + } building_gfx = { mediterranean_building_gfx } clothing_gfx = { western_clothing_gfx } unit_gfx = { western_unit_gfx } @@ -2521,7 +2633,14 @@ lemnian = { 10 = mediterranean } - coa_gfx = { latin_group_coa_gfx western_coa_gfx } + MOD_DEPENDENT = { + IF tfe = { + # Solves the error.log containing a line about not matching sequence in noric. + coa_gfx = { latin_group_coa_gfx breton_coa_gfx } + } ELSE = { + coa_gfx = { latin_group_coa_gfx western_coa_gfx } + } + } building_gfx = { mediterranean_building_gfx } clothing_gfx = { western_clothing_gfx } unit_gfx = { western_unit_gfx } diff --git a/ImperatorToCK3/Data_Files/configurables/dynasties_to_preserve.txt b/ImperatorToCK3/Data_Files/configurables/dynasties_to_preserve.txt index 43a01914d..725012630 100644 --- a/ImperatorToCK3/Data_Files/configurables/dynasties_to_preserve.txt +++ b/ImperatorToCK3/Data_Files/configurables/dynasties_to_preserve.txt @@ -5,4 +5,14 @@ jamshid 1029100 # Sassanid, referenced in events\dlc\fp3\fp3_struggle_events.txt 613 # Seljuk, referenced in events\yearly_events\yearly_events_persia.txt -25061 # Karling, referenced in common/achievements/standard_achievements.txt \ No newline at end of file +25061 # Karling, referenced in common/achievements/standard_achievements.txt +105800 # in achievements + +# TFE +900021 # referenced in common\scripted_guis\sevenhouses.txt +mihran_dynasty # referenced in common\scripted_guis\sevenhouses.txt +suren_dynasty # referenced in common\scripted_guis\sevenhouses.txt +varaz_dynasty # referenced in common\scripted_guis\sevenhouses.txt +spandiyadh_dynasty # referenced in common\scripted_guis\sevenhouses.txt +7511 # referenced in common\scripted_guis\sevenhouses.txt +900018 # referenced in common\on_action\sevenhouses_on_actions.txt \ No newline at end of file diff --git a/ImperatorToCK3/Data_Files/configurables/dynasty_houses_to_preserve.txt b/ImperatorToCK3/Data_Files/configurables/dynasty_houses_to_preserve.txt index 63ce16258..9dbf97fab 100644 --- a/ImperatorToCK3/Data_Files/configurables/dynasty_houses_to_preserve.txt +++ b/ImperatorToCK3/Data_Files/configurables/dynasty_houses_to_preserve.txt @@ -11,4 +11,81 @@ house_harmaytan # referenced in common\scripted_character_templates\04_fp3_chara house_tusi # referenced in common\scripted_character_templates\04_fp3_character_templates.txt house_tumert # referenced in common\scripted_effects\00_almohad_invasion_effects.txt house_almohad # referenced in common\scripted_effects\00_almohad_invasion_effects.txt -house_prum # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt \ No newline at end of file +house_prum # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_rustaveli # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_tondaiman # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_khayyam # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_rabban # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_von_bingen # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_aquinas # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_alighieri # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_becket # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_maimon # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_de_troyes # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_skallagrimsson # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_ormstunga # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_rode # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_al_haytham # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_of_ockham # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_chaucer # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_bacon # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_of_lincoln # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_wycliffe # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_abelard # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_dargenteuil # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_petrarca # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_bondone # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_fibonacci # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_boccaccio # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_de_pizan # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_sturluson # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_de_villa_nova # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_khalduni # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_rumi # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_sina # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_rushdi # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_biruni # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_yitzchaki # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_halevi # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_shaprut # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_gershon # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_ezra # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_gabirol # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_nahman # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_crescas # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_gaon # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_awkal # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_tudela # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_polo # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_eckhart # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_czarny # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_choniates # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_psellos # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_tzetzes # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_blemmydes # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_pachymeres # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_moschopoulos # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_metochites # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_choniates_2 # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_tarchaneiotes # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_pletho # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_lekapenos # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_bessarion # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_kydones # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_holobolos # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_axuch # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_gosh # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_rustaveli # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_tatevatsi # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_pitsak # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_medici # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_borgia # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_wallace # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_vignolles # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_corvey # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_flor # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt +house_monmouth # referenced in common\scripted_effects\00_historical_characters_scripted_effects.txt + +# TFE +house_hashmid # referenced in events\islam_events.txt +house_umayyad # referenced in events\islam_events.txt \ No newline at end of file diff --git a/ImperatorToCK3/Data_Files/configurables/removable_file_blocks.txt b/ImperatorToCK3/Data_Files/configurables/removable_file_blocks.txt index 4e910bc0d..603d2d962 100644 --- a/ImperatorToCK3/Data_Files/configurables/removable_file_blocks.txt +++ b/ImperatorToCK3/Data_Files/configurables/removable_file_blocks.txt @@ -281,6 +281,337 @@ } } } + + # Anachronistic + { + ### GAME RULE: EXTRA ADMINS + apply_historic_administrative_game_rule_effect = yes + } + + # Anachronistic + { + ### GAME RULE: EXTRA ADMINS + ## We'll be doing some excessive triggers below in a bid to lightly future-proof + error-spam mods less, don't worry about it. + ### We handle players after the lobby. + # Historic chars. + apply_historic_administrative_game_rule_effect = yes + # Players. + if = { + limit = { has_dlc_feature = roads_to_power } + if = { + limit = { + NOT = { has_game_rule = historicity_extra_admin_player_wherever_gameplay_not_administrative } + } + if = { + limit = { has_game_rule = historicity_extra_admin_player_wherever_alt_historic_always } + every_player = { + limit = { + highest_held_title_tier >= tier_kingdom + NOR = { + government_has_flag = government_is_administrative + government_has_flag = government_is_landless_adventurer + } + } + convert_to_administrative_from_feudalism_game_start_effect = yes + } + } + else_if = { + limit = { has_game_rule = historicity_extra_admin_player_wherever_alt_historic_with_august_trait } + every_player = { + limit = { + highest_held_title_tier >= tier_kingdom + NOR = { + government_has_flag = government_is_administrative + government_has_flag = government_is_landless_adventurer + } + has_trait = august + } + convert_to_administrative_from_feudalism_game_start_effect = yes + } + } + } + } + } + + # Anachronistic + { + ### 1178 CRUSADE SETUP ### + if = { + limit = { + game_start_date >= 1178.10.1 + } + religion:islam_religion = { + set_variable = { + name = variable_ghw_unlocked + value = yes + } + } + religion:christianity_religion = { + set_variable = { + name = variable_ghw_unlocked + value = yes + } + } + set_global_variable = { + name = had_first_catholic_crusade + value = yes + } + } + } + + # Anachronistic + { + ### Pandidakterion IN CONSTANTINOPLE ### + if = { + limit = { + has_ep3_dlc_trigger = yes + current_date >= 1046.1.1 + } + title:c_byzantion = { add_county_modifier = pandidakterion_university_modifier } + } + } + + # Anachronistic + { + ### Varangian Guard ### + if = { + limit = { + has_ep3_dlc_trigger = yes + current_date >= 988.1.1 + } + title:e_byzantium = { set_variable = founded_varangian_guard } + } + } + + # Anachronistic + { + ### EP3 BYZANTIUM IMPORTANT COUNTIES ### + if = { + limit = { has_ep3_dlc_trigger = yes } + title:c_antiocheia = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_jerusalem = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_alexandria = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_abbadan = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_edessa = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_bari = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_siracusa = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_roma = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_ravenna = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_tunis = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_tangiers = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_murcia = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_lombardia = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_trier = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_cumberland = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_northumberland = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_chandax = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_tourraine = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = ep3_emperor_yearly.2000 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = ep3_emperor_yearly.2000 + } + } + title:c_byzantion = { + set_important_location = { + title = title:e_byzantium + enter_realm_event = roman_restoration.1200 + } + set_important_location = { + title = title:e_roman_empire + enter_realm_event = roman_restoration.1200 + } + } + } + } + + # Anachronistic + { + ### GAME RULE: DETERMINISTIC CONQUEST + if = { + limit = { + OR = { + NOT = { has_game_rule = historicity_norman_conquest_default_random } + game_rule_rig_norman_conquest_for_hereward_trigger = yes + } + } + set_global_variable = deterministic_conquest_of_england_1066 + # See if we should just teleport our combatants' armies into place. + trigger_event = { + id = game_rule.1151 + trigger_on_next_date = 1066.09.25 + } + trigger_event = { + id = game_rule.1152 + trigger_on_next_date = 1066.10.14 + } + } + } + + { + if = { + limit = { + game_start_date >= 1067.12.25 + } + title:k_england = { set_coa = k_england_norman} + } + } { ### GAME RULE: RULER OF MUNSTER @@ -834,6 +1165,20 @@ } } } + { + ### 1066 - EL CID STORY CYCLE ### + character:107590 ?= { + if = { + limit = { + cid_story_cycle_start_trigger = yes + } + trigger_event = { + id = cid.0001 + days = 1 + } + } + } + } { ## Hereweard the Wake character:90028 ?= { @@ -4046,7 +4391,7 @@ bookmark.0300 = { # by Nicholas Legault } } -"events\single_combat_events.txt" = { +"events/single_combat_events.txt" = { { # Historical dynasty = dynasty:1055 @@ -5652,2214 +5997,8721 @@ game_rule.1143 = { } } -"gfx\portraits\portrait_modifiers\02_all_developer_characters.txt" = { +"gfx/portraits/portrait_modifiers/02_all_developer_characters.txt" = { { - modifier = { + isabella_welch = { + dna_modifiers = { + accessory = { + mode = add + gene = clothes + template = dde_hre_high_nobility_clothes + value = 0.1 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { add = 999 exists = this - exists = character:73857 - this = character:73857 + exists = character:easteregg_isabella_welch + this = character:easteregg_isabella_welch } + } + } } + { + elisabeth_gangenes = { + dna_modifiers = { + accessory = { + mode = add + gene = clothes + template = fp1_high_nobility_clothes + value = 1.0 + } + accessory = { + mode = add + gene = cloaks + template = fp1_cloak + value = 0 + } + morph = { + mode = modify_multiply + gene = gene_bs_bust + value = 1.0 + template = bust_clothes + } + morph = { + mode = modify_multiply + gene = gene_bs_body_shape + value = 1.0 + template = body_shape_average_clothed + } + } + weight = { + base = 0 modifier = { add = 999 exists = this - exists = character:70292 - this = character:70292 + exists = character:easteregg_elisabeth_gangenes + this = character:easteregg_elisabeth_gangenes } + } + } } + { + rebecca_ronnback = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_03 + value = 0 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 modifier = { add = 999 exists = this - exists = character:163157 #Ismail Samani - this = character:163157 #Ismail Samani + exists = character:easteregg_rebecca_ronnback + this = character:easteregg_rebecca_ronnback } + } + } } + { + hanna_lohman = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.51 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 modifier = { add = 999 exists = this - exists = character:1230316 #Suri of Mandesh - this = character:1230316 #Suri of Mandesh + exists = character:easteregg_hanna_lohman + this = character:easteregg_hanna_lohman } - } - { - modifier = { + modifier = { add = 999 exists = this - exists = character:73759 - this = character:73759 + exists = character:easteregg_anna_strom + this = character:easteregg_anna_strom } + } } + } + { - modifier = { + marcus_bose = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = no_hairstyles + value = 0.27 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.87 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { add = 999 exists = this - exists = character:73783 - this = character:73783 + exists = character:easteregg_marcus_bose + this = character:easteregg_marcus_bose } + } + } } -} -"common/on_action/prison_on_actions.txt" = { { - bookmark.0003 # King Aella gets imprisoned by one of Ragnarr Lodbrok's sons + jesse_kopparvall = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = no_hairstyles + value = 0.27 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = scripted_character_beards_02 + value = 0.3 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_jesse_kopparvall + this = character:easteregg_jesse_kopparvall + } + } + } } -} -"common/decisions/80_major_decisions_british_isles.txt" = { { - dynasty = dynasty:1029001 #The Cornish royal house is always able to get away with these shenanigans. + lukasz_opara = { + dna_modifiers = { + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_lukasz_opara + this = character:easteregg_lukasz_opara + } + } } - { - dynasty = dynasty:1029001 #The Cornish royal house is at it again. } -} -"common/decisions/80_major_decisions_middle_europe.txt" = { { -############################# -# Refound HRE # -# by Ewan Cowhig Croft # -############################# -restore_holy_roman_empire_decision = { - picture = { - reference = "gfx/interface/illustrations/decisions/decision_dynasty_house.dds" + mateusz_mierzwa = { + dna_modifiers = { + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_mateusz_mierzwa + this = character:easteregg_mateusz_mierzwa + } + } } - decision_group_type = major - ai_check_interval = 12 + natalia_lechnata = { + dna_modifiers = { + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_natalia_lechnata + this = character:easteregg_natalia_lechnata + } + } + } - desc = restore_holy_roman_empire_decision_desc - selection_tooltip = restore_holy_roman_empire_decision_tooltip + natalia_poreba = { + dna_modifiers = { + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_natalia_poreba + this = character:easteregg_natalia_poreba + } + } + } + } - is_shown = { - is_landed_or_landless_administrative = yes - exists = dynasty # Everyone should have a dynasty, but in case they don't... - NOT = { has_global_variable = flag_restored_roman_empire } # Not if Rome already exists (prevent Rome from restoring HRE) - NOR = { #Title existence cnditions. - exists = title:e_hre.holder #Well, that'd be redundant. - #highest_held_title_tier = tier_empire #Existing emperors likewise should not be giving up their empire. - } - NOR = { #It doesn't make sense for these competing empires. - has_title = title:e_byzantium - has_title = title:e_roman_empire - has_title = title:e_mongol_empire - } - AND = { #Faith conditions. - NOT = { this = faith.religious_head } #Nice try, Mr. Pope. - faith = { - religion_tag = christianity_religion - has_doctrine_parameter = spiritual_head_of_faith #Gotta be invested with the authority by someone other than yourself. + { + struan_mccallum = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.62 # Please replace with accessory = accessory_name } - NAND = { #No need for a competing empire if your faith controls the ERE. - exists = title:e_byzantium.holder - faith = title:e_byzantium.holder.faith + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.74 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_struan_mccallum + this = character:easteregg_struan_mccallum } } - OR = { #Government conditions. - government_has_flag = government_is_feudal - government_has_flag = government_is_clan - government_allows = administrative - } - exists = faith.religious_head + } } - is_valid = { - #Standard requirements. - is_independent_ruler = yes - trigger_if = { - limit = { - is_ai = no + { + riad_deneche = { + dna_modifiers = { + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_riad_deneche + this = character:easteregg_riad_deneche } - prestige_level >= high_prestige_level } - #Title ownership conditions. - OR = { #Gotta be King of a core Carolingian Kingdom. - has_title = title:k_east_francia - has_title = title:k_bavaria - has_title = title:k_france - has_title = title:k_italy - has_title = title:k_lotharingia - any_vassal = { - OR = { - has_title = title:k_east_francia - has_title = title:k_bavaria - has_title = title:k_france - has_title = title:k_italy - has_title = title:k_lotharingia - } + } + } + + { + anton_leirnes = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = all_hairstyles + accessory = male_hair_western_07 } - } - trigger_if = { - limit = { - is_ai = no + accessory = { + mode = add + gene = beards + template = all_beards + accessory = male_beard_mena_04 } - custom_description = { #And have some additional royal dignity for good measure. - text = decision_refound_hre_own_three_kingdoms.tt - any_held_title = { - tier = tier_kingdom - count >= 3 - } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_tomasz_ender + this = character:easteregg_tomasz_ender } } - sub_realm_size >= 120 #Plus your various kingdoms should be ruling something. - #HoF preference conditions. - trigger_if = { - limit = { - is_ai = no + } + } + + { + stella_carrick = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.04 # Please replace with accessory = accessory_name } - OR = { - faith.religious_head = { #And they have to actually like you enough to want to invest you. - opinion = { - target = root - value >= high_positive_opinion - } - } - root = { has_strong_usable_hook = faith.religious_head } #Or you have a strong hook on them that you can actually use. - root = { has_weak_hook = faith.religious_head } #Or a regular hook, to be fair, provided you meet the other criteria. + accessory = { + mode = add + gene = cloaks + template = fp1_cloak + value = 1 + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_stella_carrick + this = character:easteregg_stella_carrick } } } + } - is_valid_showing_failures_only = { - is_available_adult = yes - faith.religious_head = { is_available_adult = yes } - NOR = { - has_trait = excommunicated - is_at_war_with = faith.religious_head + { + fenni_johansson = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.04 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_fenni_johansson + this = character:easteregg_fenni_johansson + } } } + } - effect = { - show_as_tooltip = { - restore_holy_roman_empire_decision_scripted_effect = yes - } - gain_heroic_legend_seed_tooltip_effect = yes - save_scope_as = founder - faith.religious_head = { save_scope_as = founder_hof } - if = { - limit = { - faith.religious_head = { is_playable_character = yes } + { + james_beaumont = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.32 # Please replace with accessory = accessory_name } - faith.religious_head.capital_province = { save_scope_as = ceremony_locale } - } - else = { - capital_province = { save_scope_as = ceremony_locale } - } - trigger_event = { - id = middle_europe_decisions.0015 - } - #Notify other players. - every_player = { - limit = { - NOT = { this = root } - is_within_diplo_range = { CHARACTER = root } + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.04 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_james_beaumont + this = character:easteregg_james_beaumont } - trigger_event = middle_europe_decisions.0016 } - if = { - limit = { - is_ai = no - NOT = { exists = global_var:restore_holy_roman_empire_decision } + } + } + + { + bahar_shefket = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.73 # Please replace with accessory = accessory_name } - set_global_variable = { - name = restore_holy_roman_empire_decision - value = root + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_bahar_shefket + this = character:easteregg_bahar_shefket } } - # Assign Dynamic Prince-Electors - hidden_effect = { - if = { - limit = { has_global_variable_list = hre_elector_list } - clear_global_variable_list = hre_elector_list + } + } + + { + hugo_cortell = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.38 # Please replace with accessory = accessory_name } - while = { - count = 7 - random_vassal = { - limit = { - capital_province.empire = title:e_hre # must be de-jure vassal of empire - OR = { # prince-bishopric or duchy - AND = { - government_has_flag = government_is_theocracy - primary_title.tier >= tier_county - } - primary_title.tier >= tier_duchy - } - NOT = { # not already selected - is_target_in_global_variable_list = { - name = hre_elector_list - target = primary_title - } - } - } - weight = { - modifier = { # major vassals heavily weighted - factor = 10 - is_powerful_vassal = yes - } - modifier = { # same culture as emperor preferred - factor = 4 - culture = root.culture - } - modifier = { # we don't mind going outside Germania, but prefer it - factor = 1.5 - trigger = { exists = primary_title.title_province } - primary_title.title_province.barony = { - OR = { - target_is_de_jure_liege_or_above = title:k_bavaria - target_is_de_jure_liege_or_above = title:k_bohemia - target_is_de_jure_liege_or_above = title:k_east_francia - target_is_de_jure_liege_or_above = title:k_frisia - target_is_de_jure_liege_or_above = title:k_lotharingia - target_is_de_jure_liege_or_above = title:k_pomerania - } - } - } - modifier = { # we want at least 3 theocracies ideally - factor = 10 - any_in_global_list = { - variable = hre_elector_list - count < 3 - holder = { government_has_flag = government_is_theocracy } - } - government_has_flag = government_is_theocracy - } - modifier = { # 3 is enough theocracies unless we can't find feudal - factor = 0.1 - any_in_global_list = { - variable = hre_elector_list - count >= 3 - holder = { government_has_flag = government_is_theocracy } - } - government_has_flag = government_is_theocracy - } - } - add_to_global_variable_list = { - name = hre_elector_list - target = primary_title - } - } + accessory = { + mode = add + gene = beards + template = scripted_character_beards_02 + value = 0.11 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_hugo_cortell + this = character:easteregg_hugo_cortell } - hre_elector_list_save_effect = yes # saves list scopes to title as variables for tooltip } } + } - cost = { - gold = { - if = { - limit = { - is_ai = no - } - add = 500 + { + alexander_newcombe = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_03 + value = 0.1 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = scripted_character_beards_02 + value = 0.11 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_alexander_newcombe + this = character:easteregg_alexander_newcombe } } - piety = 200 + } } - ai_potential = { - is_independent_ruler = yes - highest_held_title_tier >= tier_kingdom - } - - ai_will_do = { - base = 100 - - modifier = { # We don't want a solo-France to form the HRE - factor = 0 - NOR = { - has_title = title:k_east_francia - has_title = title:k_bavaria - has_title = title:k_italy - has_title = title:k_lotharingia - any_vassal = { - OR = { - has_title = title:k_east_francia - has_title = title:k_bavaria - has_title = title:k_italy - has_title = title:k_lotharingia - } - } + { + elena_zenko = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.51 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_elena_zenko + this = character:easteregg_elena_zenko } } } -} } -} -"common/legends/chronicles/00_chronicles.txt" = { { - triggered_desc = { - trigger = { - scope:ancestor = character:6392 - } - desc = legend_carolingian + fei_berg_hulthen = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.0 # Please replace with accessory = accessory_name } - } - { - triggered_desc = { - trigger = { - scope:ancestor = character:6392 - } - desc = legend_carolingian_desc + accessory = { + mode = add + gene = beards + template = no_beard + value = 0.11 # Please replace with accessory = accessory_name } - } - { - triggered_desc = { - trigger = { - scope:ancestor = character:82233 - } - desc = legend_the_wheelwright + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_fei_berg_hulthen + this = character:easteregg_fei_berg_hulthen } + } } - { - triggered_desc = { - trigger = { - scope:ancestor = character:82233 - } - desc = legend_the_wheelwright_desc - } } + { - triggered_desc = { - trigger = { - scope:ancestor = character:159058 - } - desc = legend_cadell + stina_arvidsson_radestig = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_03 + value = 0.6# Please replace with accessory = accessory_name } - } - { - triggered_desc = { - trigger = { - scope:ancestor = character:159058 - } - desc = legend_cadell_desc + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_stina_arvidsson_radestig + this = character:easteregg_stina_arvidsson_radestig } + } } - { - triggered_desc = { - trigger = { - scope:ancestor = character:107590 - } - desc = legend_el_cid - } } + { - triggered_desc = { - trigger = { - scope:ancestor = character:107590 - } - desc = legend_el_cid_desc + ola_jentzsch = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.99 # Please replace with accessory = accessory_name } - } - { - triggered_desc = { - trigger = { - scope:ancestor = character:1700 - } - desc = legend_peasant_emperor + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.61 # Please replace with accessory = accessory_name } - } - { - triggered_desc = { - trigger = { - scope:ancestor = character:1700 - } - desc = legend_peasant_emperor_desc + accessory = { + mode = add + gene = headgear + template = no_headgear + value = 0.5 # Please replace with accessory = accessory_name } - } - { - triggered_desc = { - trigger = { - scope:ancestor = character:168345 - } - desc = legend_premysl + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_ola_jentzsch + this = character:easteregg_ola_jentzsch } + } } - { - triggered_desc = { - trigger = { - scope:ancestor = character:168345 - } - desc = legend_premysl_desc - } } + { - triggered_desc = { - trigger = { - scope:ancestor = character:303250 - } - desc = legend_borjigin + nikola_stokic = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + accessory = male_hair_fp1_09 + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_nikola_stokic + this = character:easteregg_nikola_stokic } + } + } } + { - triggered_desc = { - trigger = { - scope:ancestor = character:303250 - } - desc = legend_borjigin_desc + sandra_runge_moller = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.54 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_sandra_runge_moller + this = character:easteregg_sandra_runge_moller } + } } + } + { - triggered_desc = { - trigger = { - scope:ancestor = character:7255 - } - desc = legend_the_red_hand + alessandro_bragalini = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = no_hairstyles + value = 0.99 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.45 # Please replace with accessory = accessory_name } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_alessandro_bragalini + this = character:easteregg_alessandro_bragalini + } + } } + } + { - triggered_desc = { - trigger = { - scope:ancestor = character:7255 - } - desc = legend_the_red_hand_desc + jon_astrup_hallkvist = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.2 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = no_beard + value = 0.45 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_jon_astrup_hallkvist + this = character:easteregg_jon_astrup_hallkvist } + } } + } + { - triggered_desc = { - trigger = { - scope:ancestor = character:180637 - } - desc = legend_yazdagird_iii + maxence_voleau = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_03 + value = 1 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = scripted_character_beards_02 + value = 0.11 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_maxence_voleau + this = character:easteregg_maxence_voleau } + } } + } + { - triggered_desc = { - trigger = { - scope:ancestor = character:180637 - } - desc = legend_yazdagird_iii_desc + jason_cantalini = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.15 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.45 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_jason_cantalini + this = character:easteregg_jason_cantalini } + } } + } + { - triggered_desc = { - trigger = { - scope:ancestor = character:180645 - } - desc = legend_bahram_gur + chad_uhl = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + accessory = male_hair_western_02 + } + accessory = { + mode = add + gene = beards + template = scripted_character_beards_03 + accessory = m_beard_ep2_western_01 #m_beard_sep_western_01 } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_chad_uhl + this = character:easteregg_chad_uhl + } + } + } } + { - triggered_desc = { - trigger = { - scope:ancestor = character:180645 - } - desc = legend_bahram_gur_desc + fabian_franzen = { + dna_modifiers = { + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_fabian_franzen + this = character:easteregg_fabian_franzen } + } + } } + { - triggered_desc = { - trigger = { - scope:ancestor = character:188637 - } - desc = legend_saman_khudah + zack_holmgren = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.27 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = no_beard + value = 0.11 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_zack_holmgren + this = character:easteregg_zack_holmgren } + } + } } + { - triggered_desc = { - trigger = { - scope:ancestor = character:188637 - } - desc = legend_saman_khudah_desc + claudia_baldassi = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.23 # Please replace with accessory = accessory_name } - } - { - triggered_desc = { - trigger = { - scope:ancestor = character:163109 - } - desc = legend_ragnarr + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_claudia_baldassi + this = character:easteregg_claudia_baldassi } + } } - { - triggered_desc = { - trigger = { - scope:ancestor = character:163109 - } - desc = legend_ragnarr_desc - } } + { - triggered_desc = { - trigger = { - scope:ancestor = character:7627 - } - desc = legend_alfred_of_wessex + joe_parkin = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = no_hairstyles + value = 0.27 # Please replace with accessory = accessory_name } - } - { - triggered_desc = { - trigger = { - scope:ancestor = character:7627 - } - desc = legend_alfred_of_wessex_desc + accessory = { + mode = add + gene = beards + template = no_beard + value = 0.11 # Please replace with accessory = accessory_name } - } - { - triggered_desc = { - trigger = { - scope:ancestor = character:168130 - } - desc = legend_william_gellones + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_joe_parkin + this = character:easteregg_joe_parkin } - } - { - triggered_desc = { - trigger = { - scope:ancestor = character:168130 - } - desc = legend_william_gellones_desc + modifier = { + add = 999 + exists = this + exists = character:easteregg_mathias_frostewarn + this = character:easteregg_mathias_frostewarn } + } } - { - triggered_desc = { - trigger = { - scope:ancestor = character:99 - } - desc = legend_edward_the_martyr - } } + { - triggered_desc = { - trigger = { - scope:ancestor = character:99 - } - desc = legend_edward_the_martyr_desc + veronica_pazos = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.04 # Please replace with accessory = accessory_name } - } - { - triggered_desc = { - trigger = { - scope:ancestor = character:40605 - } - desc = legend_sons_of_rurik + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_veronica_pazos + this = character:easteregg_veronica_pazos } + } } - { - triggered_desc = { - trigger = { - scope:ancestor = character:40605 - } - desc = legend_sons_of_rurik_desc + + weronika_kowalczyk = { + dna_modifiers = { + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_weronika_kowalczyk + this = character:easteregg_weronika_kowalczyk } + } } -} -"events/diarchy_events/diarchy_events.txt" = { - { - # Historic setup stuff. - ## Fatimids start basically completely screwed. - if = { - limit = { this = character:3096 } - set_diarchy_swing = 100 + jakob_jorstedt = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.84 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = no_beard + value = 0.45 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_jakob_jorstedt + this = character:easteregg_jakob_jorstedt + } } } -} - -"events/dlc/fp1/fp1_major_decision_events.txt" = { - { -scripted_effect fp1_1011_gib_pretty_hair_effect = { - # Gain the famous nickname. - give_nickname = nick_fairhair - # And a bit of diplomacy for your long vow. - add_diplomacy_skill = 2 - # Plus that haircut. - remove_character_modifier = harald_tanglehairs_vow_modifier -} -# Tanglehair becomes Fairhair. -fp1_major_decisions.1011 = { - type = character_event - title = fp1_major_decisions.1011.t - desc = { - desc = fp1_major_decisions.1011.desc.intro - first_valid = { - triggered_desc = { - trigger = { exists = scope:gyda } - desc = fp1_major_decisions.1011.desc.gyda + tess_lindholm = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.13 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_berrak_oz + this = character:easteregg_berrak_oz + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_tess_lindholm + this = character:easteregg_tess_lindholm } - desc = fp1_major_decisions.1011.desc.oath } - desc = fp1_major_decisions.1011.desc.outro - } - theme = crown - left_portrait = { - character = root - animation = personality_honorable } - right_portrait = { - character = scope:gyda - animation = admiration - } - override_background = { reference = fp1_ocean_norse } - trigger = { - # This character is Harald Fairhair. - exists = character:144000 - this = character:144000 - # The title they've acquired is Norway. - scope:title = title:k_norway - # Norway has been created by them. - scope:transfer_type = flag:created - # Norway has not been created previously. - NOT = { exists = global_var:norway_created } + luke_bean = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_03 + value = 0.1 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.45 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_luke_bean + this = character:easteregg_luke_bean + } + } } - immediate = { - play_music_cue = "mx_cue_succession" - # Check to see if Gyda is still around and kicking, and if so, treat this as a romance. - character:166044 = { - if = { - limit = { - is_alive = yes - can_marry_character_trigger = { CHARACTER = root } - has_any_bad_relationship_with_root_trigger = no - is_ai = yes - } - save_scope_as = gyda + artur_kacprzak = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.2 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.11 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_artur_kacprzak + this = character:easteregg_artur_kacprzak } } } - # My vow fulfilled! - option = { - name = fp1_major_decisions.1011.a - - # Apply standard haircut effects. - fp1_1011_gib_pretty_hair_effect = yes - - ai_chance = { - # AI should only default to this if Gyda is unavailable. + tomas_versekys = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_03 + value = 0.1 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = no_beard + value = 0.11 # Please replace with accessory = accessory_name + } + } + weight = { base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_tomas_versekys + this = character:easteregg_tomas_versekys + } } } - - # Gyda, my love! - option = { - name = fp1_major_decisions.1011.b - trigger = { - # Gyda must have been valid. - exists = scope:gyda - # And, for MP, remain valid. - can_marry_character_trigger = { CHARACTER = scope:gyda } - } - # Apply standard haircut effects. - fp1_1011_gib_pretty_hair_effect = yes - # Harald & Gyda are wed. - if = { - limit = { - has_ep2_dlc_trigger = yes + ida_hedberg = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_03 + value = 0.1 # Please replace with accessory = accessory_name } - create_grand_wedding_betrothal = { - SPOUSE_1 = root - SPOUSE_2 = scope:gyda - HOST = root - PROMISEE = scope:gyda + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_ida_hedberg + this = character:easteregg_ida_hedberg } } - else = { marry = scope:gyda } - # And rather happy about it. - add_opinion = { - target = scope:gyda - modifier = love_opinion - opinion = 50 - } - reverse_add_opinion = { - target = scope:gyda - modifier = love_opinion - opinion = 50 - } + } - ai_chance = { - # AI should always select this option if it's present. - base = 100 + alexander_windahl = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.77 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = no_beard + value = 0.11 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_alexander_windahl + this = character:easteregg_alexander_windahl + } } } - - # Leave it; it is a mark of the struggles I have been through. - option = { - name = fp1_major_decisions.1011.c - trigger = { is_ai = no } - # Harald Tanglehair keeps his wild locks. - custom_tooltip = fp1_major_decisions.1011.c.tt - ## We swap the modifiers out so the copy responds correctly. - hidden_effect = { - remove_character_modifier = harald_tanglehairs_vow_modifier - add_character_modifier = harald_tanglehairs_reminder_modifier + johan_husen = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = no_hairstyles + value = 0.77 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.04 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_johan_husen + this = character:easteregg_johan_husen + } } - # And a bit of learning for the lessons you've endured. - add_learning_skill = 2 + } - ai_chance = { - # Option here for player choice. + daan_broekhof = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.87 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = no_beard + value = 0.04 # Please replace with accessory = accessory_name + } + } + weight = { base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_daan_broekhof + this = character:easteregg_daan_broekhof + } } } -} - } - - { - # And if it's not Harald Fairhair who did it, shame him. - if = { - limit = { - exists = character:144000 - NOT = { this = character:144000 } - character:144000 = { is_alive = yes } + + alexia_belfort = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.73 # Please replace with accessory = accessory_name } - hidden_effect = { - # Save the current King of Norway. - save_scope_as = king_of_norway - # And message Harald with the bad news. - character:144000 = { - send_interface_toast = { - title = fp1_major_decisions.1012.t - left_icon = scope:king_of_norway - hidden_effect = { remove_character_modifier = harald_tanglehairs_vow_modifier } - add_character_modifier = harald_tanglehairs_vow_broken_modifier - } - } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_alexia_belfort + this = character:easteregg_alexia_belfort } } } -} - -"events/decisions_events/middle_europe_decisions_events.txt" = { - { -# Conduct the reformation -middle_europe_decisions.0015 = { - type = character_event - title = middle_europe_decisions.0015.t - desc = middle_europe_decisions.0015.desc - theme = realm - left_portrait = { - character = scope:founder - animation = personality_bold + + david_drake = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = no_hairstyles + value = 0.77 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = all_beards + accessory = m_beard_sp2_western_01 + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_david_drake + this = character:easteregg_david_drake + } + } } - immediate = { - play_music_cue = "mx_cue_epic_sacral_moment" - restore_holy_roman_empire_decision_scripted_effect = yes - legend_seed_new_title_effect = yes - create_artifact_reichskrone_effect = { OWNER = this } + ernesto_lopez = { + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = all_beards + accessory = male_beard_fp2_iberian_christian_01 + } + accessory = { + mode = add + gene = hairstyles + template = all_hairstyles + accessory = male_hair_western_01 + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_ernesto_lopez + this = character:easteregg_ernesto_lopez + } + } } - #Renovatio Imperii! - option = { - name = middle_europe_decisions.0015.a - give_nickname = nick_the_great - add_prestige_experience = monumental_fame_gain - every_vassal = { - add_opinion = { - modifier = reformed_holy_roman_empire_opinion - target = root + lucas_ribeiro = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = fp3_hairstyles_iranian_straight + value = 0.1 + } + accessory = { + mode = add + gene = beards + template = no_beard + value = 0.11 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_lucas_ribeiro + this = character:easteregg_lucas_ribeiro } - custom = restore_holy_roman_empire_decision_effects_vassal_opinion.tt - } - ai_chance = { #When taken, the AI should always pick this. - base = 100 } } - ##No Germany please, we're Byzantine. - #option = { - # name = middle_europe_decisions.0015.b - # ai_chance = { #When taken, the AI should always go for the decision. - # base = 0 - # } - #} -} + daniel_velasquez = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = all_hairstyles + accessory = male_hair_fp2_iberian_muslim_01 + } + accessory = { + mode = add + gene = beards + template = all_beards + accessory = male_beard_fp2_iberian_christian_01 + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_daniel_velasquez + this = character:easteregg_daniel_velasquez + } + } } -} -"events/dlc/fp1/fp1_scandinavian_adventurer_events.txt" = { - { -# Drag in famous landless Norse characters if they haven't become landed after twenty years. -fp1_scandinavian_adventurers.0011 = { - scope = none - hidden = yes + jakob_eklund = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = all_hairstyles + accessory = male_hair_indian_03 + } + accessory = { + mode = add + gene = beards + template = no_beard + value = 0.11 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_jakob_eklund + this = character:easteregg_jakob_eklund + } + } + } # jakob_eklund - trigger = { - # DLC check. - has_fp1_dlc_trigger = yes - # No point in later starts. - game_start_date = 867.1.1 + emelie_verdugo = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + range = {0.83 0.98} # Mix between all FP1 scripted char hairstyles + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_emelie_verdugo + this = character:easteregg_emelie_verdugo + } + } } - immediate = { - trigger_event = { - id = fp1_scandinavian_adventurers.0012 - years = 20 + anton_holmqvist = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = no_hairstyles + value = 0.27 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = all_beards + accessory = m_beard_ep2_western_03 + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_anton_holmqvist + this = character:easteregg_anton_holmqvist + } } } -} - } - - { -scripted_effect scandi_adventurers_grab_famous_character_effect = { - $CHARACTER$ ?= { - if = { - limit = { - # Still kickin'. - is_physically_able_adult = yes - # Shouldn't ever really be an issue, but y'never know. - is_ai = yes - # Hasn't got anything dynastic of note going on. - is_ruler = no - any_heir_title = { count = 0 } - # And is free and clear to go. - is_imprisoned = no - OR = { - is_married = no - AND = { - is_female = yes - matrilinear_marriage = yes - } - AND = { - is_male = yes - patrilinear_marriage = yes - } - } - # And is still North Germanic/not in either of the lists. - culture = { has_cultural_pillar = heritage_north_germanic } - NOR = { - save_temporary_scope_as = character - any_in_global_list = { - variable = western_scandinavian_adventurer_list - this = scope:character - } - any_in_global_list = { - variable = eastern_scandinavian_adventurer_list - this = scope:character - } - } + + samet_atasoy = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = all_hairstyles + accessory = male_hair_western_04 } - # Norse, Norwegians, & Danes go into the western adventurer list. - if = { - limit = { - OR = { - has_culture = culture:norse - has_culture = culture:norwegian - has_culture = culture:danish - } - } - add_to_global_variable_list = { - name = western_scandinavian_adventurer_list - target = this - } + accessory = { + mode = add + gene = beards + template = all_beards + accessory = male_beard_western_03 } - # Norse & Swedes go into the eastern adventurer list. - if = { - limit = { - OR = { - has_culture = culture:norse - has_culture = culture:swedish - } - } - add_to_global_variable_list = { - name = eastern_scandinavian_adventurer_list - target = this - } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_samet_atasoy + this = character:easteregg_samet_atasoy } - # Either way, flag 'em for priority in the system. - add_character_flag = prioritised_scandinavian_adventurer } } -} - -fp1_scandinavian_adventurers.0012 = { - hidden = yes - scope = none - - trigger = { - # DLC check. - has_fp1_dlc_trigger = yes - # No point in later starts. - game_start_date = 867.1.1 - OR = { - exists = character:242 - exists = character:163119 + richard_lindkvist = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = all_hairstyles + accessory = male_hair_indian_01 + } + accessory = { + mode = add + gene = beards + template = all_beards + accessory = male_beard_western_03 + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_richard_lindkvist + this = character:easteregg_richard_lindkvist + } } - } - immediate = { - # Nab Rollo. - scandi_adventurers_grab_famous_character_effect = { CHARACTER = character:242 } - # Nab Ubbe. - scandi_adventurers_grab_famous_character_effect = { CHARACTER = character:163119 } - } -} - } - - { -fp1_scandinavian_adventurers.0021 = { - hidden = yes - scope = none - - trigger = { - # DLC check. - has_fp1_dlc_trigger = yes - # No point in later starts. - game_start_date = 867.1.1 - } - - immediate = { - # Haesteinn. - character:6878 = { add_character_flag = prioritised_scandinavian_adventurer } - # Ivar the Boneless. - character:163111 = { add_character_flag = prioritised_scandinavian_adventurer } - # Halfdan Whiteshirt. - character:163112 = { add_character_flag = prioritised_scandinavian_adventurer } - # Sigurdr Snake-in-the-Eye. - character:163110 = { add_character_flag = prioritised_scandinavian_adventurer } - # Bjorn Ironside. - character:163108 = { add_character_flag = prioritised_scandinavian_adventurer } - # Rurik the Troublemaker. - character:40605 = { add_character_flag = prioritised_scandinavian_adventurer } - # Dyre the Stranger. - character:6811 = { add_character_flag = prioritised_scandinavian_adventurer } - # Harald Fairhair. - character:144000 = { add_character_flag = prioritised_scandinavian_adventurer } - # Audr the Deep-Minded. - character:168609 = { add_character_flag = prioritised_scandinavian_adventurer } - } -} + daniel_tolman = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = all_hairstyles + accessory = male_hair_western_03 + } + accessory = { + mode = add + gene = beards + template = all_beards + accessory = male_beard_western_02 + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_daniel_tolman + this = character:easteregg_daniel_tolman + } + } } -} -"common\on_action\yearly_groups_on_actions.txt" = { - { - 160 = fp2_yearly.1004 # The Hawk of Quarysh - } - { - 250 = fp3_yearly.8020 # The Lady of the Land + female_hair_steppe_01 = { # Twin braids with ribbons and earrings + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.76 # For the randomness to work correctly + } + } + weight = { + base = 0 + } } -} -"events\dlc\fp2\fp2_yearly_events.txt" = { - { -################################### -# The Hawk of Quarysh -# By Daniel Moore -################################### -fp2_yearly.1004 = { - type = character_event - title = fp2_yearly.1004.t - desc = fp2_yearly.1004.desc - theme = learning - left_portrait = { - character = root - animation = worry + female_hair_steppe_02 = { # Tight with twin braids rolled up into two balls, earrings + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.79 # For the randomness to work correctly + } + } + weight = { + base = 0 + } } + ### FP2 Hair ### - trigger = { - has_fp2_dlc_trigger = yes - - has_religion = religion:islam_religion - capital_province = { - geographical_region = world_europe_west_iberia - } - NOT = { - has_character_flag = fp2_yearly.1004 + female_hair_fp2_iberian_muslim_01 = { # Let out but with smaller braids braided in + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_03 + value = 0.1 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_ida_hedberg + this = character:easteregg_ida_hedberg + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_francesca_passoni + this = character:easteregg_francesca_passoni + } } } - cooldown = { - years = 50 - } - - immediate = { - add_character_flag = fp2_yearly.1004 - - character:73679 = { - save_scope_as = hawk_of_quraysh + female_hair_fp2_iberian_muslim_02 = { # Let out but with smaller braids braided in + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_03 + value = 0.2 # For the randomness to work correctly + } + } + weight = { + base = 0 } + } - dynasty:597 = { - save_scope_as = hawk_dynasty + female_hair_fp2_iberian_muslim_03 = { # Let out but with smaller braids braided in + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_03 + value = 0.4 # For the randomness to work correctly + } } + weight = { + base = 0 - dynasty:100721 = { - save_scope_as = abbasid_dynasty + modifier = { + add = 999 + exists = this + exists = character:73683 + this = character:73683 + } } } - option = { #I'm related! - name = fp2_yearly.1004.c - trigger = { - dynasty = { - this = scope:hawk_dynasty + female_hair_fp2_iberian_christian_01 = { # Let out but with smaller braids braided in + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_03 + value = 0.6 # For the randomness to work correctly } } + weight = { + base = 0 - ai_chance = { - base = 1000 + modifier = { + add = 999 + exists = this + exists = character:73759 + this = character:73759 + } } - add_prestige = medium_prestige_value } - option = { #How he inspired soldiers - name = fp2_yearly.1004.a - add_character_modifier = { - modifier = fp2_hawk_of_quarysh_martial_modifier - years = 10 + female_hair_fp2_iberian_christian_02 = { # Let out but with smaller braids braided in + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_03 + value = 0.83 # For the randomness to work correctly } + } + weight = { + base = 0 - ai_chance = { - base = 100 - ai_value_modifier = { - ai_energy = 1 - ai_boldness = 1 + modifier = { + add = 999 + exists = this + exists = character:73857 + this = character:73857 + } + + modifier = { + add = 999 + exists = this + exists = character:70292 + this = character:70292 + } + + modifier = { + add = 999 + exists = this + exists = character:easteregg_melanie_bjurman + this = character:easteregg_melanie_bjurman } } } - option = { #How diplomatic he was - name = fp2_yearly.1004.b - add_character_modifier = { - modifier = fp2_hawk_of_quarysh_diplomacy_modifier - years = 10 + female_hair_fp2_iberian_christian_03 = { # Let out but with smaller braids braided in + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_03 + value = 1 # For the randomness to work correctly } + } + weight = { + base = 0 - ai_chance = { - base = 100 - ai_value_modifier = { - ai_sociability = 1 - ai_compassion = 1 + modifier = { + add = 999 + exists = this + exists = character:73783 + this = character:73783 } } } -} - } -} -"events\dlc\fp3\fp3_heritage_events.txt" = { - { -fp3_yearly.8020 = { - type = character_event - title = fp3_yearly.8020.t - desc = fp3_yearly.8020.desc - theme = faith - left_portrait = { - character = root - animation = personality_rational - } - right_portrait = { - character = scope:pious_woman - animation = paranoia + ### FP1 Hair ### + + female_hair_fp1_01 = { # Let out but with smaller braids braided in + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.83 # For the randomness to work correctly + } + } + weight = { + base = 0 + } } - lower_left_portrait = { - character = scope:righteous_caliph + female_hair_fp1_02 = { # Very big loose braid on one shoulder + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.86 # For the randomness to work correctly + } + } + weight = { + base = 0 + + modifier = { + add = 999 + exists = this + exists = character:easteregg_elisabeth_gangenes + this = character:easteregg_elisabeth_gangenes + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_lucia_dzediti + this = character:easteregg_lucia_dzediti + } + } } + female_hair_fp1_03 = { # Pigtail braids + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.90 # For the randomness to work correctly + } + } + weight = { + base = 0 + } + } + female_hair_fp1_04 = { # Crown braid with ribbon + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.92 # For the randomness to work correctly + } + } + weight = { + base = 0 + } + } - trigger = { + female_hair_fp1_05 = { # Twin tails on chest, let out in back + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.95 # For the randomness to work correctly + } + } + weight = { + base = 0 + } + } - #standard sanity checks - has_fp3_dlc_trigger = yes - is_ruler = yes - is_available_healthy_adult = yes + female_hair_fp1_06 = { # Let out fluffy straight + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.98 # For the randomness to work correctly + } + } + weight = { + base = 0 - #premise checks - we need ROOT's faith to not have been reformed into a matriarchal faith for this historical context - OR = { - has_religion = religion:islam_religion - has_religion = religion:christianity_religion + modifier = { + add = 999 + exists = this + exists = character:easteregg_alva_granholm + this = character:easteregg_alva_granholm + } } + } - has_game_rule = default_gender_equality #this triggers an error. Suspected code issue. + ### FP3 Hair - NOT = { - faith = { has_doctrine = doctrine_gender_female_dominated } + m_hair_fp3_iranian_01 = { # Long split strands + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_05 + value = 0.1 # For the randomness to work correctly + } } + weight = { + base = 0 - #checking for approppriate county - any_held_county = { - OR = { - this = title:c_rayy - any_county_province = { - barony = { fp3_zoroastrian_holy_sites_province_trigger = yes } - } + modifier = { + add = 999 + exists = this + exists = character:163157 #Ismail Samani + this = character:163157 #Ismail Samani } } + } - #checking that we have a HoF with the appropriate interests - NOT = { faith.religious_head = root } - - exists = root.faith.religious_head - - root.faith.religious_head = { - fp3_zealous_caliph_trigger = yes - #checking that his Islam hasn't been reformed into something that'd make the event's premise weird - faith = { - NOT = { - has_doctrine = doctrine_gender_female_dominated - } - } - } - - #checking that we have a spouse or daughter that would fit the scope - OR = { - any_spouse = { - fp3_bibi_shahrbanu_devotee_trigger = yes - } - any_concubine = { - fp3_bibi_shahrbanu_devotee_trigger = yes - } - any_child = { - fp3_bibi_shahrbanu_devotee_trigger = yes - } - any_courtier_or_guest = { - fp3_bibi_shahrbanu_devotee_trigger = yes - has_relation_friend = root - } - } - } - - immediate = { - - - #Saving relevant historical characters and faiths as scopes - character:180638 = { save_scope_as = bibi_shahrbanu } - - character:33912 = { save_scope_as = imam_husayn } - - religion:zoroastrianism_religion = { save_scope_as = anahita_faith } - - #saving the caliph as a scope - root.faith.religious_head = { - if = { - limit = { - fp3_zealous_caliph_trigger = yes - faith = { - NOT = { - has_doctrine = doctrine_gender_female_dominated - } - } - } + m_hair_fp3_iranian_02 = { # Seljuk Braids + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_05 + value = 0.6 # For the randomness to work correctly } - save_scope_as = righteous_caliph } - - random_held_county = { - limit = { this = title:c_rayy } - save_scope_as = temple_county + weight = { + base = 0 } + } - if = { - limit = { - NOT = { exists = scope:temple_county } - } - random_held_county = { - limit = { - any_county_province = { - barony = { fp3_zoroastrian_holy_sites_province_trigger = yes } - } - } - save_scope_as = temple_county + m_hair_fp3_iranian_03 = { # Medium wavy ends + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_05 + value = 0.9 # For the randomness to work correctly } } + weight = { + base = 0 - #getting the best pious woman for our purposes - if = { - limit = { - any_spouse = { fp3_bibi_shahrbanu_devotee_trigger = yes } - } - random_spouse = { - limit = { - fp3_bibi_shahrbanu_devotee_trigger = yes - } - save_scope_as = pious_woman - } - } - else_if = { - limit = { - any_concubine = { fp3_bibi_shahrbanu_devotee_trigger = yes } - } - random_concubine = { - limit = { - any_concubine = { fp3_bibi_shahrbanu_devotee_trigger = yes } - } - save_scope_as = pious_woman + modifier = { + add = 999 + exists = this + exists = character:1230316 #Suri of Mandesh + this = character:1230316 #Suri of Mandesh } } - else_if = { - limit = { - any_child = { fp3_bibi_shahrbanu_devotee_trigger = yes } - } - random_child = { - limit = { - any_child = { fp3_bibi_shahrbanu_devotee_trigger = yes } - } - save_scope_as = pious_woman + } + + f_hair_fp3_iranian_01 = { # Medium Curls with Earrings + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_05 + value = 0.6 # For the randomness to work correctly } } - else_if = { - limit = { - any_courtier_or_guest = { - fp3_bibi_shahrbanu_devotee_trigger = yes - has_relation_friend = root - } - } - random_courtier_or_guest = { - limit = { - any_courtier_or_guest = { - fp3_bibi_shahrbanu_devotee_trigger = yes - has_relation_friend = root - } - } - save_scope_as = pious_woman - } + weight = { + base = 0 } } - cooldown = { years = 100 } - - option = { - name = fp3_yearly.8020.a #triggered option if you like them very very much - - trigger = { - - reverse_opinion = { - target = scope:pious_woman - value >= 30 + f_hair_fp3_iranian_02 = { # Long Split with Earrings + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_05 + value = 0.75 # For the randomness to work correctly } } - - remove_short_term_gold = minor_gold_value - - scope:pious_woman = { - if = { - limit = { - OR = { - has_relation_lover = root - has_relation_soulmate = root - } - } - add_opinion = { - target = root - modifier = happy_opinion - opinion = 20 - } - } - else = { - root = { - progress_towards_lover_effect = { - CHARACTER = scope:pious_woman - REASON = lover_sided_with_me_against_hof - OPINION = 20 - } - } - } + weight = { + base = 0 } + } - scope:righteous_caliph = { - add_opinion = { - target = root - opinion = -30 - modifier = angry_opinion + f_hair_fp3_iranian_03 = { # Medium buns with earrings + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_05 + value = 0.9 # For the randomness to work correctly } } - - stress_impact = { - callous = major_stress_impact_gain - shy = medium_stress_impact_gain - zealous = major_stress_impact_gain + weight = { + base = 0 } - - ai_chance = { - base = 100 - ai_value_modifier = { - ai_sociability = 0.5 - ai_boldness = 1 - ai_rationality = 1 - ai_compassion = 1 - } - } } - option = { - name = fp3_yearly.8020.b - flavor = supporting_womens_faith_flavor - - remove_short_term_gold = medium_gold_value - - scope:temple_county = { - add_county_modifier = { - modifier = fp3_persian_resurgence_county_modifier - years = 50 + david_ostlund = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.078 # Please replace with accessory = accessory_name } - } - - scope:righteous_caliph = { - add_opinion = { - target = root - opinion = -30 - modifier = angry_opinion + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.855 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_david_ostlund + this = character:easteregg_david_ostlund } } + } - scope:pious_woman = { - add_opinion = { - target = root - opinion = 20 - modifier = happy_opinion + philip_wessman = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_01 + value = 0.247 # Please replace with accessory = accessory_name + } + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.098 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_philip_wessman + this = character:easteregg_philip_wessman } } + } - stress_impact = { - compassionate = minor_stress_impact_loss - cynical = medium_stress_impact_gain - zealous = major_stress_impact_gain + neyla_garcia = { + dna_modifiers = { + accessory = { + mode = add + gene = hairstyles + template = scripted_character_hairstyles_03 + value = 0.51 # Please replace with accessory = accessory_name + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_neyla_garcia + this = character:easteregg_neyla_garcia + } } + } + } +} - ai_chance = { - base = 100 - ai_value_modifier = { - ai_energy = 0.5 - ai_boldness = 1 - ai_vengefulness = 0.5 - } - } +"common/on_action/prison_on_actions.txt" = { + { + bookmark.0003 # King Aella gets imprisoned by one of Ragnarr Lodbrok's sons } +} - option = { - name = fp3_yearly.8020.c +"common/decisions/80_major_decisions_british_isles.txt" = { + { + dynasty = dynasty:1029001 #The Cornish royal house is always able to get away with these shenanigans. + } + { + dynasty = dynasty:1029001 #The Cornish royal house is at it again. + } +} +"common/decisions/80_major_decisions_middle_europe.txt" = { + { +############################# +# Refound HRE # +# by Ewan Cowhig Croft # +############################# +restore_holy_roman_empire_decision = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_dynasty_house.dds" + } + decision_group_type = major + + ai_check_interval = 12 + + desc = restore_holy_roman_empire_decision_desc + selection_tooltip = restore_holy_roman_empire_decision_tooltip + + is_shown = { + is_landed_or_landless_administrative = yes + exists = dynasty # Everyone should have a dynasty, but in case they don't... + NOT = { has_global_variable = flag_restored_roman_empire } # Not if Rome already exists (prevent Rome from restoring HRE) + NOR = { #Title existence cnditions. + exists = title:e_hre.holder #Well, that'd be redundant. + #highest_held_title_tier = tier_empire #Existing emperors likewise should not be giving up their empire. + } + NOR = { #It doesn't make sense for these competing empires. + has_title = title:e_byzantium + has_title = title:e_roman_empire + has_title = title:e_mongol_empire + } + AND = { #Faith conditions. + NOT = { this = faith.religious_head } #Nice try, Mr. Pope. + faith = { + religion_tag = christianity_religion + has_doctrine_parameter = spiritual_head_of_faith #Gotta be invested with the authority by someone other than yourself. + } + NAND = { #No need for a competing empire if your faith controls the ERE. + exists = title:e_byzantium.holder + faith = title:e_byzantium.holder.faith + } + } + OR = { #Government conditions. + government_has_flag = government_is_feudal + government_has_flag = government_is_clan + government_allows = administrative + } + exists = faith.religious_head + } + + is_valid = { + #Standard requirements. + is_independent_ruler = yes + trigger_if = { + limit = { + is_ai = no + } + prestige_level >= high_prestige_level + } + #Title ownership conditions. + OR = { #Gotta be King of a core Carolingian Kingdom. + has_title = title:k_east_francia + has_title = title:k_bavaria + has_title = title:k_france + has_title = title:k_italy + has_title = title:k_lotharingia + any_vassal = { + OR = { + has_title = title:k_east_francia + has_title = title:k_bavaria + has_title = title:k_france + has_title = title:k_italy + has_title = title:k_lotharingia + } + } + } + trigger_if = { + limit = { + is_ai = no + } + custom_description = { #And have some additional royal dignity for good measure. + text = decision_refound_hre_own_three_kingdoms.tt + any_held_title = { + tier = tier_kingdom + count >= 3 + } + } + } + sub_realm_size >= 120 #Plus your various kingdoms should be ruling something. + #HoF preference conditions. + trigger_if = { + limit = { + is_ai = no + } + OR = { + faith.religious_head = { #And they have to actually like you enough to want to invest you. + opinion = { + target = root + value >= high_positive_opinion + } + } + root = { has_strong_usable_hook = faith.religious_head } #Or you have a strong hook on them that you can actually use. + root = { has_weak_hook = faith.religious_head } #Or a regular hook, to be fair, provided you meet the other criteria. + } + } + } + + is_valid_showing_failures_only = { + is_available_adult = yes + faith.religious_head = { is_available_adult = yes } + NOR = { + has_trait = excommunicated + is_at_war_with = faith.religious_head + } + } + + effect = { + show_as_tooltip = { + restore_holy_roman_empire_decision_scripted_effect = yes + } + gain_heroic_legend_seed_tooltip_effect = yes + save_scope_as = founder + faith.religious_head = { save_scope_as = founder_hof } + if = { + limit = { + faith.religious_head = { is_playable_character = yes } + } + faith.religious_head.capital_province = { save_scope_as = ceremony_locale } + } + else = { + capital_province = { save_scope_as = ceremony_locale } + } + trigger_event = { + id = middle_europe_decisions.0015 + } + #Notify other players. + every_player = { + limit = { + NOT = { this = root } + is_within_diplo_range = { CHARACTER = root } + } + trigger_event = middle_europe_decisions.0016 + } + if = { + limit = { + is_ai = no + NOT = { exists = global_var:restore_holy_roman_empire_decision } + } + set_global_variable = { + name = restore_holy_roman_empire_decision + value = root + } + } + # Assign Dynamic Prince-Electors + hidden_effect = { + if = { + limit = { has_global_variable_list = hre_elector_list } + clear_global_variable_list = hre_elector_list + } + while = { + count = 7 + random_vassal = { + limit = { + capital_province.empire = title:e_hre # must be de-jure vassal of empire + OR = { # prince-bishopric or duchy + AND = { + government_has_flag = government_is_theocracy + primary_title.tier >= tier_county + } + primary_title.tier >= tier_duchy + } + NOT = { # not already selected + is_target_in_global_variable_list = { + name = hre_elector_list + target = primary_title + } + } + } + weight = { + modifier = { # major vassals heavily weighted + factor = 10 + is_powerful_vassal = yes + } + modifier = { # same culture as emperor preferred + factor = 4 + culture = root.culture + } + modifier = { # we don't mind going outside Germania, but prefer it + factor = 1.5 + trigger = { exists = primary_title.title_province } + primary_title.title_province.barony = { + OR = { + target_is_de_jure_liege_or_above = title:k_bavaria + target_is_de_jure_liege_or_above = title:k_bohemia + target_is_de_jure_liege_or_above = title:k_east_francia + target_is_de_jure_liege_or_above = title:k_frisia + target_is_de_jure_liege_or_above = title:k_lotharingia + target_is_de_jure_liege_or_above = title:k_pomerania + } + } + } + modifier = { # we want at least 3 theocracies ideally + factor = 10 + any_in_global_list = { + variable = hre_elector_list + count < 3 + holder = { government_has_flag = government_is_theocracy } + } + government_has_flag = government_is_theocracy + } + modifier = { # 3 is enough theocracies unless we can't find feudal + factor = 0.1 + any_in_global_list = { + variable = hre_elector_list + count >= 3 + holder = { government_has_flag = government_is_theocracy } + } + government_has_flag = government_is_theocracy + } + } + add_to_global_variable_list = { + name = hre_elector_list + target = primary_title + } + } + } + hre_elector_list_save_effect = yes # saves list scopes to title as variables for tooltip + } + } + + cost = { + gold = { + if = { + limit = { + is_ai = no + } + add = 500 + } + } + piety = 200 + } + + ai_potential = { + is_independent_ruler = yes + highest_held_title_tier >= tier_kingdom + } + + ai_will_do = { + base = 100 + + modifier = { # We don't want a solo-France to form the HRE + factor = 0 + NOR = { + has_title = title:k_east_francia + has_title = title:k_bavaria + has_title = title:k_italy + has_title = title:k_lotharingia + any_vassal = { + OR = { + has_title = title:k_east_francia + has_title = title:k_bavaria + has_title = title:k_italy + has_title = title:k_lotharingia + } + } + } + } + } +} + } +} + +"common/legends/chronicles/00_chronicles.txt" = { + { + triggered_desc = { + trigger = { + scope:ancestor = character:6392 + } + desc = legend_carolingian + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:6392 + } + desc = legend_carolingian_desc + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:82233 + } + desc = legend_the_wheelwright + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:82233 + } + desc = legend_the_wheelwright_desc + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:159058 + } + desc = legend_cadell + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:159058 + } + desc = legend_cadell_desc + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:107590 + } + desc = legend_el_cid + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:107590 + } + desc = legend_el_cid_desc + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:1700 + } + desc = legend_peasant_emperor + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:1700 + } + desc = legend_peasant_emperor_desc + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:168345 + } + desc = legend_premysl + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:168345 + } + desc = legend_premysl_desc + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:303250 + } + desc = legend_borjigin + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:303250 + } + desc = legend_borjigin_desc + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:7255 + } + desc = legend_the_red_hand + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:7255 + } + desc = legend_the_red_hand_desc + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:180637 + } + desc = legend_yazdagird_iii + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:180637 + } + desc = legend_yazdagird_iii_desc + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:180645 + } + desc = legend_bahram_gur + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:180645 + } + desc = legend_bahram_gur_desc + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:188637 + } + desc = legend_saman_khudah + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:188637 + } + desc = legend_saman_khudah_desc + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:163109 + } + desc = legend_ragnarr + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:163109 + } + desc = legend_ragnarr_desc + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:7627 + } + desc = legend_alfred_of_wessex + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:7627 + } + desc = legend_alfred_of_wessex_desc + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:168130 + } + desc = legend_william_gellones + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:168130 + } + desc = legend_william_gellones_desc + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:99 + } + desc = legend_edward_the_martyr + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:99 + } + desc = legend_edward_the_martyr_desc + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:40605 + } + desc = legend_sons_of_rurik + } + } + { + triggered_desc = { + trigger = { + scope:ancestor = character:40605 + } + desc = legend_sons_of_rurik_desc + } + } +} + +"events/diarchy_events/diarchy_events.txt" = { + { + # Historic setup stuff. + ## Fatimids start basically completely screwed. + if = { + limit = { this = character:3096 } + set_diarchy_swing = 100 + } + } +} + +"events/dlc/fp1/fp1_major_decision_events.txt" = { + { +scripted_effect fp1_1011_gib_pretty_hair_effect = { + # Gain the famous nickname. + give_nickname = nick_fairhair + # And a bit of diplomacy for your long vow. + add_diplomacy_skill = 2 + # Plus that haircut. + remove_character_modifier = harald_tanglehairs_vow_modifier +} + +# Tanglehair becomes Fairhair. +fp1_major_decisions.1011 = { + type = character_event + title = fp1_major_decisions.1011.t + desc = { + desc = fp1_major_decisions.1011.desc.intro + first_valid = { + triggered_desc = { + trigger = { exists = scope:gyda } + desc = fp1_major_decisions.1011.desc.gyda + } + desc = fp1_major_decisions.1011.desc.oath + } + desc = fp1_major_decisions.1011.desc.outro + } + theme = crown + left_portrait = { + character = root + animation = personality_honorable + } + right_portrait = { + character = scope:gyda + animation = admiration + } + override_background = { reference = fp1_ocean_norse } + + trigger = { + # This character is Harald Fairhair. + exists = character:144000 + this = character:144000 + # The title they've acquired is Norway. + scope:title = title:k_norway + # Norway has been created by them. + scope:transfer_type = flag:created + # Norway has not been created previously. + NOT = { exists = global_var:norway_created } + } + + immediate = { + play_music_cue = "mx_cue_succession" + # Check to see if Gyda is still around and kicking, and if so, treat this as a romance. + character:166044 = { + if = { + limit = { + is_alive = yes + can_marry_character_trigger = { CHARACTER = root } + has_any_bad_relationship_with_root_trigger = no + is_ai = yes + } + save_scope_as = gyda + } + } + } + + # My vow fulfilled! + option = { + name = fp1_major_decisions.1011.a + + # Apply standard haircut effects. + fp1_1011_gib_pretty_hair_effect = yes + + ai_chance = { + # AI should only default to this if Gyda is unavailable. + base = 0 + } + } + + # Gyda, my love! + option = { + name = fp1_major_decisions.1011.b + trigger = { + # Gyda must have been valid. + exists = scope:gyda + # And, for MP, remain valid. + can_marry_character_trigger = { CHARACTER = scope:gyda } + } + + # Apply standard haircut effects. + fp1_1011_gib_pretty_hair_effect = yes + # Harald & Gyda are wed. + if = { + limit = { + has_ep2_dlc_trigger = yes + } + create_grand_wedding_betrothal = { + SPOUSE_1 = root + SPOUSE_2 = scope:gyda + HOST = root + PROMISEE = scope:gyda + } + } + else = { marry = scope:gyda } + # And rather happy about it. + add_opinion = { + target = scope:gyda + modifier = love_opinion + opinion = 50 + } + reverse_add_opinion = { + target = scope:gyda + modifier = love_opinion + opinion = 50 + } + + ai_chance = { + # AI should always select this option if it's present. + base = 100 + } + } + + # Leave it; it is a mark of the struggles I have been through. + option = { + name = fp1_major_decisions.1011.c + trigger = { is_ai = no } + + # Harald Tanglehair keeps his wild locks. + custom_tooltip = fp1_major_decisions.1011.c.tt + ## We swap the modifiers out so the copy responds correctly. + hidden_effect = { + remove_character_modifier = harald_tanglehairs_vow_modifier + add_character_modifier = harald_tanglehairs_reminder_modifier + } + # And a bit of learning for the lessons you've endured. + add_learning_skill = 2 + + ai_chance = { + # Option here for player choice. + base = 0 + } + } +} + } + + { + # And if it's not Harald Fairhair who did it, shame him. + if = { + limit = { + exists = character:144000 + NOT = { this = character:144000 } + character:144000 = { is_alive = yes } + } + hidden_effect = { + # Save the current King of Norway. + save_scope_as = king_of_norway + # And message Harald with the bad news. + character:144000 = { + send_interface_toast = { + title = fp1_major_decisions.1012.t + left_icon = scope:king_of_norway + hidden_effect = { remove_character_modifier = harald_tanglehairs_vow_modifier } + add_character_modifier = harald_tanglehairs_vow_broken_modifier + } + } + } + } + } +} + +"events/decisions_events/middle_europe_decisions_events.txt" = { + { +# Conduct the reformation +middle_europe_decisions.0015 = { + type = character_event + title = middle_europe_decisions.0015.t + desc = middle_europe_decisions.0015.desc + theme = realm + left_portrait = { + character = scope:founder + animation = personality_bold + } + + immediate = { + play_music_cue = "mx_cue_epic_sacral_moment" + restore_holy_roman_empire_decision_scripted_effect = yes + legend_seed_new_title_effect = yes + create_artifact_reichskrone_effect = { OWNER = this } + } + + #Renovatio Imperii! + option = { + name = middle_europe_decisions.0015.a + give_nickname = nick_the_great + add_prestige_experience = monumental_fame_gain + every_vassal = { + add_opinion = { + modifier = reformed_holy_roman_empire_opinion + target = root + } + custom = restore_holy_roman_empire_decision_effects_vassal_opinion.tt + } + ai_chance = { #When taken, the AI should always pick this. + base = 100 + } + } + + ##No Germany please, we're Byzantine. + #option = { + # name = middle_europe_decisions.0015.b + # ai_chance = { #When taken, the AI should always go for the decision. + # base = 0 + # } + #} +} + } +} + +"events/dlc/fp1/fp1_scandinavian_adventurer_events.txt" = { + { +# Drag in famous landless Norse characters if they haven't become landed after twenty years. +fp1_scandinavian_adventurers.0011 = { + scope = none + hidden = yes + + trigger = { + # DLC check. + has_fp1_dlc_trigger = yes + # No point in later starts. + game_start_date = 867.1.1 + } + + immediate = { + trigger_event = { + id = fp1_scandinavian_adventurers.0012 + years = 20 + } + } +} + } + + { +scripted_effect scandi_adventurers_grab_famous_character_effect = { + $CHARACTER$ ?= { + if = { + limit = { + # Still kickin'. + is_physically_able_adult = yes + # Shouldn't ever really be an issue, but y'never know. + is_ai = yes + # Hasn't got anything dynastic of note going on. + is_ruler = no + any_heir_title = { count = 0 } + # And is free and clear to go. + is_imprisoned = no + OR = { + is_married = no + AND = { + is_female = yes + matrilinear_marriage = yes + } + AND = { + is_male = yes + patrilinear_marriage = yes + } + } + # And is still North Germanic/not in either of the lists. + culture = { has_cultural_pillar = heritage_north_germanic } + NOR = { + save_temporary_scope_as = character + any_in_global_list = { + variable = western_scandinavian_adventurer_list + this = scope:character + } + any_in_global_list = { + variable = eastern_scandinavian_adventurer_list + this = scope:character + } + } + } + # Norse, Norwegians, & Danes go into the western adventurer list. + if = { + limit = { + OR = { + has_culture = culture:norse + has_culture = culture:norwegian + has_culture = culture:danish + } + } + add_to_global_variable_list = { + name = western_scandinavian_adventurer_list + target = this + } + } + # Norse & Swedes go into the eastern adventurer list. + if = { + limit = { + OR = { + has_culture = culture:norse + has_culture = culture:swedish + } + } + add_to_global_variable_list = { + name = eastern_scandinavian_adventurer_list + target = this + } + } + # Either way, flag 'em for priority in the system. + add_character_flag = prioritised_scandinavian_adventurer + } + } +} + } + + { +fp1_scandinavian_adventurers.0012 = { + hidden = yes + scope = none + + trigger = { + # DLC check. + has_fp1_dlc_trigger = yes + # No point in later starts. + game_start_date = 867.1.1 + + OR = { + exists = character:242 + exists = character:163119 + } + + } + + immediate = { + # Nab Rollo. + scandi_adventurers_grab_famous_character_effect = { CHARACTER = character:242 } + # Nab Ubbe. + scandi_adventurers_grab_famous_character_effect = { CHARACTER = character:163119 } + } +} + } + + { +fp1_scandinavian_adventurers.0021 = { + hidden = yes + scope = none + + trigger = { + # DLC check. + has_fp1_dlc_trigger = yes + # No point in later starts. + game_start_date = 867.1.1 + } + + immediate = { + # Haesteinn. + character:6878 = { add_character_flag = prioritised_scandinavian_adventurer } + # Ivar the Boneless. + character:163111 = { add_character_flag = prioritised_scandinavian_adventurer } + # Halfdan Whiteshirt. + character:163112 = { add_character_flag = prioritised_scandinavian_adventurer } + # Sigurdr Snake-in-the-Eye. + character:163110 = { add_character_flag = prioritised_scandinavian_adventurer } + # Bjorn Ironside. + character:163108 = { add_character_flag = prioritised_scandinavian_adventurer } + # Rurik the Troublemaker. + character:40605 = { add_character_flag = prioritised_scandinavian_adventurer } + # Dyre the Stranger. + character:6811 = { add_character_flag = prioritised_scandinavian_adventurer } + # Harald Fairhair. + character:144000 = { add_character_flag = prioritised_scandinavian_adventurer } + # Audr the Deep-Minded. + character:168609 = { add_character_flag = prioritised_scandinavian_adventurer } + } +} + } +} + +"common\on_action\yearly_groups_on_actions.txt" = { + { + 160 = fp2_yearly.1004 # The Hawk of Quarysh + } + { + 250 = fp3_yearly.8020 # The Lady of the Land + } +} + +"events\dlc\fp2\fp2_yearly_events.txt" = { + { +################################### +# The Hawk of Quarysh +# By Daniel Moore +################################### +fp2_yearly.1004 = { + type = character_event + title = fp2_yearly.1004.t + desc = fp2_yearly.1004.desc + theme = learning + left_portrait = { + character = root + animation = worry + } + + + trigger = { + has_fp2_dlc_trigger = yes + + has_religion = religion:islam_religion + + capital_province = { + geographical_region = world_europe_west_iberia + } + + NOT = { + has_character_flag = fp2_yearly.1004 + } + } + + cooldown = { + years = 50 + } + + immediate = { + add_character_flag = fp2_yearly.1004 + + character:73679 = { + save_scope_as = hawk_of_quraysh + } + + dynasty:597 = { + save_scope_as = hawk_dynasty + } + + dynasty:100721 = { + save_scope_as = abbasid_dynasty + } + } + + option = { #I'm related! + name = fp2_yearly.1004.c + trigger = { + dynasty = { + this = scope:hawk_dynasty + } + } + + ai_chance = { + base = 1000 + } + add_prestige = medium_prestige_value + } + + option = { #How he inspired soldiers + name = fp2_yearly.1004.a + add_character_modifier = { + modifier = fp2_hawk_of_quarysh_martial_modifier + years = 10 + } + + ai_chance = { + base = 100 + ai_value_modifier = { + ai_energy = 1 + ai_boldness = 1 + } + } + } + + option = { #How diplomatic he was + name = fp2_yearly.1004.b + add_character_modifier = { + modifier = fp2_hawk_of_quarysh_diplomacy_modifier + years = 10 + } + + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = 1 + ai_compassion = 1 + } + } + } +} + } +} + +"events\dlc\fp3\fp3_heritage_events.txt" = { + { +fp3_yearly.8020 = { + type = character_event + title = fp3_yearly.8020.t + desc = fp3_yearly.8020.desc + theme = faith + + left_portrait = { + character = root + animation = personality_rational + } + + right_portrait = { + character = scope:pious_woman + animation = paranoia + } + + lower_left_portrait = { + character = scope:righteous_caliph + } + + + + trigger = { + + #standard sanity checks + has_fp3_dlc_trigger = yes + is_ruler = yes + is_available_healthy_adult = yes + + #premise checks - we need ROOT's faith to not have been reformed into a matriarchal faith for this historical context + OR = { + has_religion = religion:islam_religion + has_religion = religion:christianity_religion + } + + has_game_rule = default_gender_equality #this triggers an error. Suspected code issue. + + NOT = { + faith = { has_doctrine = doctrine_gender_female_dominated } + } + + #checking for approppriate county + any_held_county = { + OR = { + this = title:c_rayy + any_county_province = { + barony = { fp3_zoroastrian_holy_sites_province_trigger = yes } + } + } + } + + #checking that we have a HoF with the appropriate interests + NOT = { faith.religious_head = root } + + exists = root.faith.religious_head + + root.faith.religious_head = { + fp3_zealous_caliph_trigger = yes + #checking that his Islam hasn't been reformed into something that'd make the event's premise weird + faith = { + NOT = { + has_doctrine = doctrine_gender_female_dominated + } + } + } + + #checking that we have a spouse or daughter that would fit the scope + OR = { + any_spouse = { + fp3_bibi_shahrbanu_devotee_trigger = yes + } + any_concubine = { + fp3_bibi_shahrbanu_devotee_trigger = yes + } + any_child = { + fp3_bibi_shahrbanu_devotee_trigger = yes + } + any_courtier_or_guest = { + fp3_bibi_shahrbanu_devotee_trigger = yes + has_relation_friend = root + } + } + } + + immediate = { + + + #Saving relevant historical characters and faiths as scopes + character:180638 = { save_scope_as = bibi_shahrbanu } + + character:33912 = { save_scope_as = imam_husayn } + + religion:zoroastrianism_religion = { save_scope_as = anahita_faith } + + #saving the caliph as a scope + root.faith.religious_head = { + if = { + limit = { + fp3_zealous_caliph_trigger = yes + faith = { + NOT = { + has_doctrine = doctrine_gender_female_dominated + } + } + } + } + save_scope_as = righteous_caliph + } + + random_held_county = { + limit = { this = title:c_rayy } + save_scope_as = temple_county + } + + if = { + limit = { + NOT = { exists = scope:temple_county } + } + random_held_county = { + limit = { + any_county_province = { + barony = { fp3_zoroastrian_holy_sites_province_trigger = yes } + } + } + save_scope_as = temple_county + } + } + + #getting the best pious woman for our purposes + if = { + limit = { + any_spouse = { fp3_bibi_shahrbanu_devotee_trigger = yes } + } + random_spouse = { + limit = { + fp3_bibi_shahrbanu_devotee_trigger = yes + } + save_scope_as = pious_woman + } + } + else_if = { + limit = { + any_concubine = { fp3_bibi_shahrbanu_devotee_trigger = yes } + } + random_concubine = { + limit = { + any_concubine = { fp3_bibi_shahrbanu_devotee_trigger = yes } + } + save_scope_as = pious_woman + } + } + else_if = { + limit = { + any_child = { fp3_bibi_shahrbanu_devotee_trigger = yes } + } + random_child = { + limit = { + any_child = { fp3_bibi_shahrbanu_devotee_trigger = yes } + } + save_scope_as = pious_woman + } + } + else_if = { + limit = { + any_courtier_or_guest = { + fp3_bibi_shahrbanu_devotee_trigger = yes + has_relation_friend = root + } + } + random_courtier_or_guest = { + limit = { + any_courtier_or_guest = { + fp3_bibi_shahrbanu_devotee_trigger = yes + has_relation_friend = root + } + } + save_scope_as = pious_woman + } + } + } + + cooldown = { years = 100 } + + option = { + name = fp3_yearly.8020.a #triggered option if you like them very very much + + trigger = { + + reverse_opinion = { + target = scope:pious_woman + value >= 30 + } + } + + remove_short_term_gold = minor_gold_value + + scope:pious_woman = { + if = { + limit = { + OR = { + has_relation_lover = root + has_relation_soulmate = root + } + } + add_opinion = { + target = root + modifier = happy_opinion + opinion = 20 + } + } + else = { + root = { + progress_towards_lover_effect = { + CHARACTER = scope:pious_woman + REASON = lover_sided_with_me_against_hof + OPINION = 20 + } + } + } + } + + scope:righteous_caliph = { + add_opinion = { + target = root + opinion = -30 + modifier = angry_opinion + } + } + + stress_impact = { + callous = major_stress_impact_gain + shy = medium_stress_impact_gain + zealous = major_stress_impact_gain + } + + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = 0.5 + ai_boldness = 1 + ai_rationality = 1 + ai_compassion = 1 + } + } + } + + option = { + name = fp3_yearly.8020.b + flavor = supporting_womens_faith_flavor + + remove_short_term_gold = medium_gold_value + + scope:temple_county = { + add_county_modifier = { + modifier = fp3_persian_resurgence_county_modifier + years = 50 + } + } + + scope:righteous_caliph = { + add_opinion = { + target = root + opinion = -30 + modifier = angry_opinion + } + } + + scope:pious_woman = { + add_opinion = { + target = root + opinion = 20 + modifier = happy_opinion + } + } + + stress_impact = { + compassionate = minor_stress_impact_loss + cynical = medium_stress_impact_gain + zealous = major_stress_impact_gain + } + + ai_chance = { + base = 100 + ai_value_modifier = { + ai_energy = 0.5 + ai_boldness = 1 + ai_vengefulness = 0.5 + } + } + } + + option = { + name = fp3_yearly.8020.c + + add_piety = major_piety_gain + + scope:righteous_caliph = { + add_opinion = { + target = root + opinion = 20 + modifier = pleased_opinion + } + } + + scope:pious_woman = { + if = { + limit = { #if she has a forceful personality, she'll be galvanized in her faith by this + fp3_assertive_female_believer_trigger = yes + } + add_character_modifier = { + modifier = fp3_womens_faith_galvanized_modifier + years = 25 + } + } + else = { #otherwise, she'll just be sad or angry + add_opinion = { + target = root + opinion = -20 + modifier = fp3_persecuted_my_faith_opinion + } + } + } + + hidden_effect = { + custom_tooltip = fp3_sharhabanu_devotees_angry.tt + random_courtier = { #female courtiers might get galvanized too, depending on their personality + if = { + limit = { + fp3_bibi_shahrbanu_devotee_trigger = yes + fp3_assertive_female_believer_trigger = yes + NOT = { this = scope:pious_woman } + } + add_character_modifier = { + modifier = fp3_womens_faith_galvanized_modifier + years = 25 + } + } + } + } + + stress_impact = { + zealous = minor_stress_impact_loss + compassionate = medium_stress_impact_gain + content = medium_stress_impact_gain + lazy = medium_stress_impact_gain + } + + ai_chance = { + base = 100 + ai_value_modifier = { + ai_energy = 0.5 + ai_boldness = 1 + ai_vengefulness = 0.5 + } + } + } +} + } +} + +"common\decisions\dlc_decisions\fp_3\fp3_islamic_decisions.txt" = { + { +avenge_the_battle_of_nahrawan_decision = { + picture = { + reference = "gfx/interface/illustrations/decisions/fp3/fp3_decision_supremacy.dds" + } + decision_group_type = major + ai_check_interval = 120 + sort_order = 30 + + title = { + first_valid = { + triggered_desc = { + trigger = { + faith = { + OR = { + has_doctrine = tenet_fp3_fedayeen + has_doctrine = tenet_warmonger + has_doctrine_parameter = pluralism_fundamentalist_proselytization_bonus + } + } + } + desc = destroy_the_apostates_decision_name + } + desc = avenge_the_battle_of_nahrawan_decision_name + } + } + + desc = avenge_the_battle_of_nahrawan_decision_desc + + selection_tooltip = avenge_the_battle_of_nahrawan_decision_tooltip + + is_shown = { + has_fp3_dlc_trigger = yes + faith = { has_doctrine = muhammad_succession_muhakkima_doctrine } + exists = capital_province + capital_province = { + OR = { + geographical_region = world_persian_empire + geographical_region = world_middle_east + } + } + NOT = { + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:avenge_the_battle_of_nahrawan_decision + } + } + } + + is_valid = { + completely_controls_region = world_mesopotamia + custom_description = { + text = "restore_high_priesthood_holy_sites" + faith = { + any_holy_site = { + OR = { + county.holder = root + county.holder.top_liege = { this = root } + } + count >= 3 + } + } + } + custom_description = { + text = avenge_the_battle_of_nahrawan_sunni_caliphate_irrelevant + NOT = { exists = title:d_sunni.holder } + } + custom_description = { + text = avenge_the_battle_of_nahrawan_shia_caliphate_irrelevant + NOT = { exists = title:d_shiite.holder } + } + } + + is_valid_showing_failures_only = { + is_alive = yes + not = { exists = involved_activity } + is_imprisoned = no + } + + + effect = { + save_scope_as = avenger + + #Sunni penalty scope save + title:e_arabia = { + random_de_jure_county_holder = { #If there's a big Sunni presence in Arabia + limit = { + faith = { has_doctrine = muhammad_succession_sunni_doctrine } + highest_held_title_tier = tier_empire + } + alternative_limit = { + faith = { has_doctrine = muhammad_succession_sunni_doctrine } + highest_held_title_tier = tier_kingdom + } + alternative_limit = { + faith = { has_doctrine = muhammad_succession_sunni_doctrine } + highest_held_title_tier = tier_duchy + } + faith = { + save_scope_as = sunni_faith + } + } + } + + title:e_persia = { + random_de_jure_county_holder = { #If there's a big Sunni presence in Persia + limit = { + faith = { has_doctrine = muhammad_succession_sunni_doctrine } + highest_held_title_tier = tier_empire + } + alternative_limit = { + faith = { has_doctrine = muhammad_succession_sunni_doctrine } + highest_held_title_tier = tier_kingdom + } + alternative_limit = { + faith = { has_doctrine = muhammad_succession_sunni_doctrine } + highest_held_title_tier = tier_duchy + } + faith = { + save_scope_as = sunni_faith + } + } + } + + #Shia penalty scope save + title:e_arabia = { + random_de_jure_county_holder = { #If there's a big Shia presence in Arabia + limit = { + faith = { has_doctrine = muhammad_succession_shia_doctrine } + highest_held_title_tier = tier_empire + } + alternative_limit = { + faith = { has_doctrine = muhammad_succession_shia_doctrine } + highest_held_title_tier = tier_kingdom + } + alternative_limit = { + faith = { has_doctrine = muhammad_succession_shia_doctrine } + highest_held_title_tier = tier_duchy + } + faith = { + save_scope_as = shia_faith + } + } + } + + #Shia penalty scope save + title:e_persia = { + random_de_jure_county_holder = { #If there's a big Shia presence in Persia + limit = { + faith = { has_doctrine = muhammad_succession_shia_doctrine } + highest_held_title_tier = tier_empire + } + alternative_limit = { + faith = { has_doctrine = muhammad_succession_shia_doctrine } + highest_held_title_tier = tier_kingdom + } + alternative_limit = { + faith = { has_doctrine = muhammad_succession_shia_doctrine } + highest_held_title_tier = tier_duchy + } + faith = { + save_scope_as = shia_faith + } + } + } + + show_as_tooltip = { avenge_the_battle_of_nahrawan_scripted_effect = yes } #Actually applied in fp3_decision.0011 - Prestige, religion bonuses + + #Events + trigger_event = fp3_decision.0011 + every_player = { + limit = { + NOT = { this = scope:avenger } + is_within_diplo_range = { CHARACTER = scope:avenger } + } + trigger_event = fp3_decision.0012 + } + + #Can only be done once + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:avenge_the_battle_of_nahrawan_decision + } + } + + ai_will_do = { + base = 100 + } +} + } +} + +"events/dlc/fp3/fp3_religious_decision_events.txt" = { + { +fp3_decision.0011 = { + type = character_event + title = fp3_decision.0011.t + desc = { + desc = fp3_decision.0011_opening.desc + first_valid = { + triggered_desc = { + trigger = { + faith = { + OR = { + has_doctrine = tenet_fp3_fedayeen + has_doctrine = tenet_warmonger + has_doctrine_parameter = pluralism_fundamentalist_proselytization_bonus + } + } + } + desc = fp3_decision.0011_fanatic_murderer.desc + } + desc = fp3_decision.0011_unfanatic_unmurderer.desc + } + } + + + theme = war + left_portrait = { + character = scope:avenger + animation = war_over_win + } + + override_background = { reference = battlefield } + + immediate = { + play_music_cue = "mx_cue_combat_2" + + character:33911 = { save_scope_as = ali } + character:163029 = { save_scope_as = muawiya } + } + + option = { + name = fp3_decision.0011.a + + avenge_the_battle_of_nahrawan_scripted_effect = yes + + stress_impact = { + zealous = major_stress_impact_loss + vengeful = major_stress_impact_loss + ambitious = medium_stress_impact_loss + } + } +} + } +} + +"common\decisions\dlc_decisions\ep_3\06_ep3_hasan_story_cycle_decisions.txt" = { + # Hassan Sabbah, the founder of Assasins + { +############################################# +# Do some basic missionary work # +# by James Beaumont # +############################################# + +hasan_evangelize_the_faith = { + picture = { + reference = "gfx/interface/illustrations/decisions/fp3/fp3_decision_secret_faith.dds" + } + sort_order = 500 + ai_check_interval = 120 + + desc = hasan_evangelize_the_faith_desc + selection_tooltip = hasan_evangelize_the_faith_tooltip + decision_group_type = story_cycle_hasan + + cooldown = { months = 1 } + + is_shown = { + #DLC check. + has_ep3_dlc_trigger = yes + is_landed = no + any_owned_story = { + story_type = story_hasan + } + } + + is_valid = { + domicile.domicile_location.county ?= { + OR = { + hasan_evangelize_province_trigger = yes + custom_tooltip = { + text = or_a_neigbouring_county_tt + save_temporary_scope_as = county_check + any_neighboring_county = { + hasan_evangelize_province_trigger = yes + holder.top_liege = scope:county_check.holder.top_liege + } + } + } + } + } + + is_valid_showing_failures_only = { + is_alive = yes + is_available_adult = yes + has_contagious_deadly_disease_trigger = no + } + + cost = { piety = 250 } + + effect = { + domicile.domicile_location.county ?= { + if = { + limit = { hasan_evangelize_province_trigger = yes } + save_scope_as = location + } + else = { + save_temporary_scope_as = county_check + random_neighboring_county = { + limit = { + hasan_evangelize_province_trigger = yes + holder.top_liege = scope:county_check.holder.top_liege + } + save_scope_as = location + } + } + } + trigger_event = hasan_sabbah.1010 + custom_tooltip = chance_to_advance_to_the_assassins_tt + } + + ai_potential = { this = character:41702 } + + ai_will_do = { + base = 200 + } +} +############################################# +# Do some RADICAL missionary work 🕶🤙 # +# by James Beaumont # +############################################# + +hasan_agitate_the_populace = { + picture = { + reference = "gfx/interface/illustrations/decisions/fp3/antagonistic.dds" + } + sort_order = 500 + ai_check_interval = 120 + + desc = hasan_agitate_the_populace_desc + selection_tooltip = hasan_agitate_the_populace_tooltip + decision_group_type = story_cycle_hasan + + cooldown = { months = 1 } + + is_shown = { + #DLC check. + has_ep3_dlc_trigger = yes + is_landed = no + any_owned_story = { + story_type = story_hasan + } + } + + is_valid = { + hasan_camp_in_foes_realm_trigger = yes + OR = { + domicile.domicile_location.county = { + NOT = { faith = root.faith } + NOT = { has_county_modifier = ep3_agitated_populace } + NOT = { has_county_modifier = tougher_to_convert } + } + custom_tooltip = { + text = or_a_neigbouring_county_tt + domicile.domicile_location.county = { + save_temporary_scope_as = county_check + any_neighboring_county = { + NOT = { faith = root.faith } + NOT = { has_county_modifier = ep3_agitated_populace } + NOT = { has_county_modifier = tougher_to_convert } + holder.top_liege = scope:county_check.holder.top_liege + } + } + } + } + } + + is_valid_showing_failures_only = { + is_alive = yes + is_available_adult = yes + has_contagious_deadly_disease_trigger = no + } + + cost = { prestige = 250 } + + effect = { + if = { + limit = { + domicile.domicile_location.county = { + NOT = { faith = root.faith } + NOT = { has_county_modifier = ep3_agitated_populace } + NOT = { has_county_modifier = tougher_to_convert } + } + } + domicile.domicile_location.county = { save_scope_as = location } + } + else = { + domicile.domicile_location.county = { + save_temporary_scope_as = county_check + random_neighboring_county = { + limit = { + NOT = { faith = root.faith } + NOT = { has_county_modifier = ep3_agitated_populace } + NOT = { has_county_modifier = tougher_to_convert } + holder.top_liege = scope:county_check.holder.top_liege + } + save_scope_as = location + } + } + } + trigger_event = hasan_sabbah.1040 + } + + ai_potential = { this = character:41702 } + + ai_will_do = { + base = 200 + } +} +############################################# +# Become death, destroyer of Seljuks # +# by James Beaumont # +############################################# +hasan_ignite_the_flames = { + picture = { + reference = "gfx/interface/illustrations/decisions/fp3/fp3_decision_strength.dds" + } + sort_order = 500 + ai_check_interval = 120 + + desc = hasan_ignite_the_flames_desc + selection_tooltip = hasan_ignite_the_flames_tooltip + decision_group_type = story_cycle_hasan + + cooldown = { months = 1 } + + is_shown = { + #DLC check. + has_ep3_dlc_trigger = yes + any_owned_story = { + story_type = story_hasan + } + } + + is_valid = { + hasan_camp_in_foes_realm_trigger = yes + is_at_war = no + custom_tooltip = { + text = at_least_5_counties_are_nizari + domicile.domicile_location.county.holder.top_liege = { + any_sub_realm_county = { + count >= 5 + faith = root.faith + } + } + } + } + + is_valid_showing_failures_only = { + is_alive = yes + is_available_adult = yes + has_contagious_deadly_disease_trigger = no + } + + cost = { + prestige = 250 + } + + effect = { + random_owned_story = { + limit = { + story_type = story_hasan + } + var:ultimate_foe = { save_scope_as = ultimate_foe } + } + hasan_sabbah_ignite_decision_effect = yes + } + + ai_potential = { this = character:41702 } + + ai_will_do = { + base = 200 + } +} + +############################################# +# Found the Assassins # +# by James Beaumont # +############################################# +hasan_found_the_assassins = { + picture = { + reference = "gfx/interface/illustrations/decisions/fp3/fp3_decision_sunder.dds" + } + sort_order = 500 + ai_check_interval = 120 + + desc = hasan_found_the_assassins_desc + selection_tooltip = hasan_found_the_assassins_tooltip + decision_group_type = story_cycle_hasan + + is_shown = { + #DLC check. + has_ep3_dlc_trigger = yes + any_owned_story = { + story_type = story_hasan + NOT = { exists = var:assassins } + } + is_landed = no + faith = faith:nizari + NOT = { + has_character_flag = founded_assassins_already + } + } + + is_valid = { + hasan_camp_in_foes_realm_trigger = yes + domicile.domicile_location.barony = { is_leased_out = no } + domicile.domicile_location.county.faith = root.faith + custom_tooltip = { + text = is_mountainous_desc + domicile.domicile_location = { is_mountainous_trigger = yes } + } + domicile.domicile_location = { + is_county_capital = no + } + } + + is_valid_showing_failures_only = { + is_alive = yes + is_available_adult = yes + has_contagious_deadly_disease_trigger = no + } + + cost = { piety = 1500 } + + effect = { + domicile.domicile_location = { save_scope_as = location } + if = { + limit = { + scope:location = { + has_holding = no + } + } + if = { + limit = { + scope:location.county.holder = { + government_has_flag = government_is_tribal + } + } + scope:location = { + set_holding_type = church_holding + } + } + else = { + scope:location = { + set_holding_type = castle_holding + } + } + } + create_character = { + template = holy_order_leader_character + location = scope:location + save_scope_as = leader + } + hidden_effect = { + create_title_and_vassal_change = { + type = leased_out + save_scope_as = change + add_claim_on_loss = no + } + scope:location.barony = { + change_title_holder_include_vassals = { + holder = scope:location.barony.holder.top_liege + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + } + create_holy_order = { + leader = scope:leader + capital = scope:location.barony + save_scope_as = new_holy_order + } + scope:new_holy_order ?= { + title = { set_title_name = holy_order_hashshashin } + } + create_holy_order_effect = yes + random_owned_story = { + limit = { story_type = story_hasan } + set_variable = { + name = assassins + value = scope:new_holy_order + } + } + add_character_flag = founded_assassins_already + scope:location = { + if = { + limit = { + has_special_building = no + } + add_special_building = assassin_castle_01 + } + else_if = { + limit = { + has_building_or_higher = alamut_castle_01 + } + hidden_effect = { + remove_building = alamut_castle_01 + } + add_special_building = alamut_castle_02 + } + } + add_intrigue_skill = 2 + give_nickname = nick_old_man_of_the_mountain + } + + ai_potential = { this = character:41702 } + + ai_will_do = { + base = 200 + } +} + +############################################# +# Expand the Assassins # +# by James Beaumont # +############################################# +hasan_expand_the_assassins = { + picture = { + reference = "gfx/interface/illustrations/decisions/fp3/fp3_decision_foundation.dds" + } + sort_order = 500 + ai_check_interval = 120 + + desc = hasan_expand_the_assassins_desc + selection_tooltip = hasan_expand_the_assassins_tooltip + decision_group_type = story_cycle_hasan + + is_shown = { + #DLC check. + has_ep3_dlc_trigger = yes + any_owned_story = { + story_type = story_hasan + has_variable = assassins + } + is_landed = no + faith = faith:nizari + } + + is_valid = { + hasan_camp_in_foes_realm_trigger = yes + domicile.domicile_location.barony = { is_leased_out = no } + domicile.domicile_location.county.faith = root.faith + custom_tooltip = { + text = is_mountainous_desc + domicile.domicile_location = { is_mountainous_trigger = yes } + } + } + + is_valid_showing_failures_only = { + is_alive = yes + is_available_adult = yes + has_contagious_deadly_disease_trigger = no + domicile.domicile_location = { is_county_capital = no } + } + + cost = { piety = 250 } + + effect = { + random_owned_story = { + limit = { + story_type = story_hasan + } + var:assassins = { save_scope_as = assassins } + } + show_as_tooltip = { + domicile.domicile_location.barony = { lease_out_to = scope:assassins } + } + hidden_effect = { + if = { + limit = { NOT = { domicile.domicile_location.barony.holder = root } } + create_title_and_vassal_change = { + type = leased_out + save_scope_as = change + add_claim_on_loss = no + } + domicile.domicile_location.barony = { + change_title_holder_include_vassals = { + holder = holder.top_liege + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + domicile.domicile_location.barony = { lease_out_to = scope:assassins } + } + } + } + + ai_potential = { this = character:41702 } + + ai_will_do = { + base = 200 + } +} + } +} + +"common/casus_belli_types/00_event_war.txt" = { + { + #Hereward the Wake departs for the Fenlands + character:90028 = { save_scope_as = hereward } + + if = { + limit = { + exists = scope:hereward + } + + scope:hereward = { + trigger_event = { + id = ep3_laamps.6000 + days = { 1 2 } + } + } + } + + #Eadgar becomes a LAAMP + character:112 = { save_scope_as = eadgar } + + if = { + limit = { + exists = scope:eadgar + } + + scope:eadgar = { + trigger_event = { + id = ep3_laamps.7000 + days = { 1 2 } + } + } + } + } +} + + +"common/decisions/dlc_decisions/ep_3/06_ep3_laamp_decisions.txt" = { + { + #Stahp it, John de Courcy + this = character:214000 + } + { + trigger_if = { # Temujun stays, he needs to become Genghis Khan after all! + limit = { + exists = character:125501 + } + NOT = { this = character:125501 } + } + } + { + if = { + limit = { + any_owned_story = { + story_type = story_hasan + } + } + custom_tooltip = chance_to_advance_to_the_assassins_tt + } + } +} + + +"common/script_values/00_war_values.txt" = { + { + # Haesteinn needs to stop merc'ing East Francia when the resulting kingdom simply will not last. + if = { + limit = { this = character:6878 } + # Assuming the player hasn't opted into batshit Vikings. + if = { + limit = { + NOT = { has_game_rule = fp1_scandi_adventurers_apocalyptic } + } + # Tell him to calm it down a bit and pick a damned duchy realm or something. + if = { + limit = { + scope:defender = { + OR = { + realm_size >= massive_realm_size + highest_held_title_tier >= tier_kingdom + } + } + } + multiply = 0 + } + # ... and a bit of bonus score if said-realm is an NPC Mercia to get him to behave a bit more historically. + if = { + limit = { + scope:defender = { + primary_title = title:d_hereford + is_independent_ruler = yes + is_ai = yes + } + } + multiply = 100 + } + } + # ... in which case, go extra wild. + else_if = { + limit = { has_game_rule = fp1_scandi_adventurers_apocalyptic } + # Nothing but a shiny new kingdom will satisfy apocalypse-Haesteinn. + if = { + limit = { + scope:defender = { highest_held_title_tier <= tier_duchy } + } + multiply = 0 + } + } + } + } +} + +"common/scripted_triggers/07_ep3_triggers.txt" = { + { +hasan_camp_in_foes_realm_trigger = { + trigger_if = { + limit = { + any_owned_story = { + var:ultimate_foe ?= { + save_temporary_scope_as = ultimate_foe + } + } + } + custom_description = { + text = hasan_stroy_cycle_camp_at_foe_realm + object = scope:ultimate_foe + domicile.domicile_location.county.holder = { + OR = { + any_liege_or_above = { + this = scope:ultimate_foe + } + this = scope:ultimate_foe + } + } + } + } + trigger_else = { + character:3096 = { + save_temporary_scope_as = caliph + } + save_temporary_scope_as = hasan + any_owned_story = { + trigger_if = { + limit = { exists = var:radical_points } + save_temporary_scope_value_as = { + name = radical_points + value = var:radical_points + } + } + trigger_else = { + save_temporary_scope_value_as = { + name = radical_points + value = 0 + } + } + } + custom_tooltip = { + text = hasan_stroy_cycle_ultimate_foe + any_owned_story = { + story_type = story_hasan + exists = var:ultimate_foe + exists = var:radical_points + var:radical_points >= 15 + } + } + } +} + } +} + + +"common/scripted_effects/06_dlc_ce1_legend_effects.txt" = { + { + else_if = { # Carolingian + limit = { + legend_property:ancestor ?= character:6392 + legend_property:title ?= title:e_france + } + set_global_variable = { + name = carolingian_legend + value = yes + } + } + } + + { + else_if = { # the_wheelwright + limit = { + legend_property:ancestor ?= character:82233 + } + set_global_variable = { + name = the_wheelwright_legend + value = yes + } + } + } + + { + else_if = { # cadell + limit = { + legend_property:ancestor ?= character:159058 + } + set_global_variable = { + name = cadell_legend + value = yes + } + } + } + + { + else_if = { # sons_of_rurik + limit = { + legend_property:ancestor ?= character:40605 + } + set_global_variable = { + name = sons_of_rurik_legend + value = yes + } + } + } + + { + else_if = { # peasant_emperor + limit = { + legend_property:ancestor ?= character:1700 + } + set_global_variable = { + name = peasant_emperor_legend + value = yes + } + } + } + + { + else_if = { # premysl + limit = { + legend_property:ancestor ?= character:168345 + } + set_global_variable = { + name = premysl_legend + value = yes + } + } + } + + { + else_if = { # borjigin + limit = { + legend_property:ancestor ?= character:303250 + } + set_global_variable = { + name = borjigin_legend + value = yes + } + } + } + + { + else_if = { # the_red_hand + limit = { + legend_property:ancestor ?= character:7255 + } + set_global_variable = { + name = the_red_hand_legend + value = yes + } + } + } + + { + else_if = { # yazdagird_iii + limit = { + legend_property:ancestor ?= character:180637 + } + set_global_variable = { + name = yazdagird_iii_legend + value = yes + } + } + } + + { + else_if = { # bahram_gur + limit = { + legend_property:ancestor ?= character:180645 + } + set_global_variable = { + name = bahram_gur_legend + value = yes + } + } + } + + { + else_if = { # saman_khudah + limit = { + legend_property:ancestor ?= character:188637 + } + set_global_variable = { + name = saman_khudah_legend + value = yes + } + } + } + + { + else_if = { # saman_khudah + limit = { + legend_property:ancestor ?= character:163109 + } + set_global_variable = { + name = ragnarr_legend + value = yes + } + } + } + + { + else_if = { + limit = { + legend_property:culture ?= culture:hunnic + legend_property:title ?= title:e_caspian-pontic_steppe + legend_property:original_region ?= geographical_region:world_steppe_west + } + set_global_variable = { + name = hunnic_heritage_legend + value = yes + } + } + } + + { + else_if = { + limit = { + legend_property:ancestor ?= character:7627 + } + set_global_variable = { + name = alfred_of_wessex_legend + value = yes + } + } + } + + { + else_if = { + limit = { + legend_property:ancestor ?= character:168130 + } + set_global_variable = { + name = william_gellones_legend + value = yes + } + } + } + + { + else_if = { + limit = { + legend_property:ancestor ?= character:99 + } + set_global_variable = { + name = edward_the_martyr_legend + value = yes + } + } + } +} + +"gfx/portraits/portrait_modifiers/05_headgear_situational.txt" = { + { + this = character:41702 + } +} + +"gfx/portraits/portrait_modifiers/00_custom_beards.txt" = { + { + modifier = { + add = 200 + exists = this + exists = character:easteregg_joe_parkin + this = character:easteregg_joe_parkin + } + } +} + +"events/war_events/war_events.txt" = { + { + option = { + name = war_event.2001.c + + trigger = { #Only available for the war for England + OR = { + root = character:102531 #Hardrade + root = character:172 #William + } + } + + custom_tooltip = war_event.2001.c.tt + + save_scope_as = harald + scope:defender = { + trigger_event = { + id = war_event.2004 + days = 1 + } + } + + ai_chance = { + base = 25 + modifier = { + add = 1000 #This should ALWAYS happen if Hereward is a player and Hardrade is the one giving up + AND = { + character:90028 = { + is_ai = no + } + root = character:102531 + } + } + } + } + } +} + +"events/story_cycles/ep3_story_cycle_hasan.txt" = { + { +# Ismaili Preachers +# You meet Amira Zarrab and begin the story cycle +# 1000 +hasan_sabbah.1000 = { + type = character_event + title = hasan_sabbah.1000.t + desc = hasan_sabbah.1000.desc + theme = learning + override_background = { reference = temple } + left_portrait = { + character = root + animation = thinking + } + right_portrait = { + character = scope:amira + animation = personality_zealous + } + + trigger = { + has_ep3_dlc_trigger = yes + } + + immediate = { + hidden_effect = { + create_character = { + name = amira + age = { 20 50 } + gender = male + trait = zealous + trait = gregarious + trait = diligent + trait = loyal + random_traits_list = { + count = 1 + education_learning_3 = {} + education_learning_4 = {} + } + location = root.location + faith = faith:ismaili + culture = culture:persian + after_creation = { + dynasty = { set_dynasty_name = dynn_zarrab } + house = { set_house_name = dynn_zarrab } + } + save_scope_as = amira + } + location = { save_scope_as = location } + } + } + + # You have succeeded in wounding and breaching my belief + option = { + name = hasan_sabbah.1000.a + flavor = begin_hasan_cycle_ismaili_tt + add_courtier = scope:amira + camp_officer_grant_effect = { + EMPLOYER = root + CANDIDATE = scope:amira + POS = second + } + + set_character_faith = faith:ismaili + custom_tooltip = { + text = unlock_evangelize_decision_tt + create_story = story_hasan + random_owned_story = { + limit = { + story_type = story_hasan + } + set_variable = { + name = story_phase + value = 1 + } + } + every_courtier = { + limit = { + religion = religion:islam_religion + } + set_character_faith = faith:ismaili + } + } + custom_tooltip = advance_to_the_assassins_tt + ai_chance = { + base = 1000 # Historically determined + } + } + + # Truth cannot be sought outside the pale of Islam + option = { + name = hasan_sabbah.1000.b + flavor = begin_hasan_cycle_twelver_tt + custom_tooltip = { + text = unlock_evangelize_decision_tt + create_story = story_hasan + random_owned_story = { + limit = { + story_type = story_hasan + } + set_variable = { + name = story_phase + value = 1 + } + } + } + ai_chance = { + base = 0 # Historically determined + } + } +} + } + + { +# Shiite Evangelism +# You try to convert the local populace to your faith +# 1010-1019 +hasan_sabbah.1010 = { + type = character_event + title = hasan_sabbah.1010.t + desc = hasan_sabbah.1010.desc + theme = learning + override_background = { + trigger = { + location = { + county.development_level >= 10 + has_holding = yes + } + } + reference = market + } + override_background = { + trigger = { + location = { + OR = { + county.development_level < 10 + has_holding = no + } + } + } + reference = terrain_travel + } + left_portrait = { + character = root + animation = debating + } + + # Preach the faith, diplomatically + option = { + name = hasan_sabbah.1010.a + duel = { + skills = { diplomacy learning } + value = high_skill_rating + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + add = { + subtract = scope:location.county.county_opinion + } + } + modifier = { + factor = 0.75 + NOT = { scope:location.county.religion = root.religion } + } + modifier = { + factor = 10 + scope:location.county = title:c_qazwin + } + min = 10 + send_interface_toast = { + type = event_toast_effect_good + title = hasan_sabbah.1010.a.win + left_icon = root + ep3_hasan_missionary_effect = { + PREACHER = root + LOCATION = scope:location + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + modifier = { + add = scope:location.county.county_opinion + } + modifier = { + factor = 1.25 + NOT = { scope:location.county.religion = root.religion } + } + min = 10 + send_interface_toast = { + type = event_toast_effect_bad + title = hasan_sabbah.1010.a.lose + left_icon = root + scope:location.county = { + add_county_modifier = { + modifier = tougher_to_convert + years = 10 + } + } + } + } + } + ai_chance = { + base = 10 + } + } + + after = { + hidden_effect = { + # Send Hasan to Egypt + if = { + limit = { + any_owned_story = { + story_type = story_hasan + exists = var:radical_points + var:radical_points >= 5 + } + OR = { + faith = faith:ismaili + faith = faith:nizari + } + NOR = { + has_character_flag = arrived_in_egypt + has_character_flag = had_hasan_sabah_20 + } + } + trigger_event = { + id = hasan_sabbah.1020 + months = { 3 5 } + } + } + # Make Hasan a radical (begin forming the Assassins) + else_if = { + limit = { + any_owned_story = { + story_type = story_hasan + exists = var:radical_points + var:radical_points >= 15 + NOT = { exists = var:ultimate_foe } + } + } + trigger_event = { + id = hasan_sabbah.1031 + months = { 3 5 } + } + } + else_if = { + limit = { + any_owned_story = { + story_type = story_hasan + exists = var:story_phase + var:story_phase >= 2 + NOT = { exists = var:ultimate_foe } + } + faith:ismaili = { + NOT = { + religious_head = scope:location.county.holder + religious_head = scope:location.county.holder.top_liege + religious_head = scope:location.county.holder.liege + religious_head = scope:location.county.holder.liege.liege + } + } + faith:nizari = { + NOT = { + religious_head = scope:location.county.holder + religious_head = scope:location.county.holder.top_liege + religious_head = scope:location.county.holder.liege + religious_head = scope:location.county.holder.liege.liege + } + } + } + trigger_event = { + id = hasan_sabbah.1031 + months = { 3 5 } + } + } + } + } +} + } + + { +# Divine Calling +# You're summoned to Egypt +# 1020-1029 +hasan_sabbah.1020 = { + type = character_event + title = hasan_sabbah.1020.t + desc = hasan_sabbah.1020.desc + theme = learning + override_background = { reference = terrain } + left_portrait = { + character = root + animation = personality_zealous + } + lower_right_portrait = { + character = scope:ismaili_caliph + animation = personality_zealous + } + + trigger = { + is_travelling = no + NOT = { + has_character_flag = had_hasan_sabah_20 + } + faith:ismaili.religious_head ?= { is_landed = yes } + } + + immediate = { + if = { + limit = { + NOT = { has_character_flag = had_hasan_sabah_20 } + } + add_character_flag = { + flag = had_hasan_sabah_20 + years = 1 + } + } + faith:ismaili.religious_head = { + save_scope_as = ismaili_caliph + capital_county = { save_scope_as = cairo } + } + } + + # Let'sa go + option = { + name = hasan_sabbah.1020.a + custom_tooltip = hasan_sabbah.1020.a.tt + custom_tooltip = advance_to_the_assassins_tt + start_travel_plan = { + destination = scope:ismaili_caliph.capital_province + players_use_planner = yes + return_trip = no + travel_with_domicile = yes + on_arrival_destinations = last + on_arrival_event = hasan_sabbah.1022 + on_travel_planner_cancel_event = hasan_sabbah.1020 + } + + ai_chance = { + base = 1000 # Historical path + } + } + + # Let'sa not + option = { + name = hasan_sabbah.1020.b + stress_impact = { + zealous = medium_stress_impact_gain + ambitious = medium_stress_impact_gain + } + ai_chance = { + base = 0 + } + } +} + } + + { +# The Ismaili Caliphate +# Arrive in Egypt, is it time to become Nizari? I think it's time to become Nizari +# 1022 +hasan_sabbah.1022 = { + type = character_event + title = hasan_sabbah.1022.t + desc = hasan_sabbah.1022.desc + theme = realm + override_background = { reference = throne_room_scope } + left_portrait = { + character = root + animation = obsequious_bow + } + right_portrait = { + character = scope:ismaili_caliph + animation = personality_honorable + } + lower_left_portrait = { + character = character:41706 + } + lower_right_portrait = { + character = character:3098 + } + + immediate = { + add_character_flag = arrived_in_egypt + faith:ismaili.religious_head = { + save_scope_as = ismaili_caliph + save_scope_as = background_throne_room_scope + } + character:41706 = { save_scope_as = nizar } + } + + # Nizar knows what's up + option = { + name = hasan_sabbah.1022.a + if = { + limit = { + character:41706 ?= { is_alive = yes } + } + set_relation_friend = { + target = character:41706 + reason = friend_supported_my_claim + } + hidden_effect = { + if = { + limit = { NOT = { character:41706.faith = faith:nizari } } + character:41706 = { + set_character_faith = faith:nizari + } + } + } + } + ep3_hasan_advance_radicalism = yes + if = { + limit = { + NOT = { + faith = faith:nizari + } + } + set_character_faith = faith:nizari + } add_piety = major_piety_gain + ai_chance = { + base = 1000 # Historical path + } + } + + # Actually, the Ismaili candidate seems like a cool guy + option = { + name = hasan_sabbah.1022.b + if = { + limit = { + NOT = { + faith = faith:ismaili + } + } + set_character_faith = faith:ismaili + } + stress_impact = { + ambitious = medium_stress_impact_gain + } + ai_chance = { + base = 0 + } + } +} + } + + { +# Death of a Caliph +# The original caliph died, it's *definitely* time to become Nizari +# 1030 +hasan_sabbah.1030 = { + type = character_event + title = hasan_sabbah.1030.t + desc = { + first_valid = { + triggered_desc = { + trigger = { exists = scope:new_ismaili_caliph } + desc = hasan_sabbah.1030.desc_caliph_heir + } + desc = hasan_sabbah.1030.desc_caliph_no_heir + } + } + theme = realm + override_background = { reference = throne_room } + left_portrait = { + character = root + animation = rage + } + right_portrait = { + character = scope:new_ismaili_caliph + animation = personality_dishonorable + } + lower_left_portrait = { + character = character:41706 + } + + trigger = { + OR = { + faith = faith:ismaili + faith = faith:nizari + } + exists = faith:ismaili.religious_head + } + + immediate = { + faith:ismaili.religious_head = { save_scope_as = new_ismaili_caliph } + character:41706 ?= { + liege = { save_scope_as = liege } + save_scope_as = nizar + if = { + limit = { + is_ai = yes + is_alive = yes + } + banish_effect = { BANISHER = scope:liege } + } + hidden_effect = { + if = { + limit = { NOT = { faith = faith:nizari } } + set_character_faith = faith:nizari + } + } + } + random_owned_story = { + limit = { + story_type = story_hasan + } + save_scope_as = story + } + } + + # Nizar knows what's up + option = { + name = hasan_sabbah.1030.a + if = { + limit = { + character:41706 ?= { is_alive = yes } + } + set_relation_friend = { + target = character:41706 + reason = friend_supported_my_claim + } + if = { + limit = { + character:41706 = { is_landed = no } + } + add_courtier = character:41706 + scope:story = { + set_variable = { + name = preferred_caliph + value = character:41706 + } + } + } + } + else = { + scope:story = { + set_variable = { + name = preferred_caliph + value = root + } + } + } + custom_tooltip = { + text = advance_to_the_assassins_tt + scope:story = { + set_variable = { + name = story_phase + value = 2 + } + } + } + if = { + limit = { NOT = { faith = faith:nizari } } + set_character_faith = faith:nizari + } + add_piety = medium_piety_gain + if = { + limit = { is_ai = yes } + domicile = { move_domicile = title:b_alamut.title_province } + } + else = { + start_travel_plan = { + destination = title:b_alamut.title_province + players_use_planner = yes + return_trip = no + travel_with_domicile = yes + on_arrival_destinations = last + } + } + ai_chance = { + base = 1000 # Historical path + } + } + + # Actually, the Ismaili candidate seems like a cool guy + option = { + name = hasan_sabbah.1030.b + trigger = { + exists = scope:new_ismaili_caliph + } + scope:story = { + set_variable = { + name = preferred_caliph + value = scope:new_ismaili_caliph + } + } + set_relation_friend = { + target = scope:new_ismaili_caliph + reason = friend_supported_my_claim + } + if = { + limit = { NOT = { faith = faith:ismaili } } + set_character_faith = faith:ismaili + } + stress_impact = { + ambitious = medium_stress_impact_gain + } + ai_chance = { + base = 0 + } + } + + # Actually, the Ismaili are right, but have no heir + option = { + name = hasan_sabbah.1030.c + trigger = { + NOT = { exists = scope:new_ismaili_caliph } + } + if = { + limit = { NOT = { faith = faith:ismaili } } + set_character_faith = faith:ismaili + } + stress_impact = { + ambitious = medium_stress_impact_gain + } + ai_chance = { + base = 0 + } + } +} + } + + { +# The Enemy of Nizarism +# Time to decide my ultimate enemy +# 1031 +hasan_sabbah.1031 = { + type = character_event + title = hasan_sabbah.1031.t + desc = hasan_sabbah.1031.desc + theme = realm + override_background = { reference = throne_room } + left_portrait = { + character = root + animation = rage + } + right_portrait = { + character = scope:seljuk_equivalent + animation = personality_dishonorable + } + + trigger = { + scope:location.county.holder.top_liege = { + NOT = { + faith = root.faith + } + realm_size >= 10 + highest_held_title_tier >= tier_kingdom + } + any_owned_story = { + story_type = story_hasan + NOT = { + exists = var:ultimate_foe + } + } + } + + immediate = { + scope:location.county.holder.top_liege = { save_scope_as = seljuk_equivalent } + random_owned_story = { + limit = { story_type = story_hasan } + save_scope_as = story + } + } + + # It's this guy + option = { + name = hasan_sabbah.1031.a + custom_tooltip = { + text = unlock_final_hasan_decisions_1_tt + scope:story = { + set_variable = { + name = ultimate_foe + value = scope:seljuk_equivalent + } + } + } + if = { + limit = { + faith = faith:nizari + } + custom_tooltip = unlock_final_hasan_decisions_2_tt + } + custom_tooltip = unlock_final_hasan_decisions_3_tt + set_relation_nemesis = { + target = scope:seljuk_equivalent + reason = nemesis_eternal_enemy + } + + ai_chance = { + base = 0 + modifier = { + add = 1000 + scope:seljuk_equivalent.house = house:house_seljuk + } + } + } + + # This is not him + option = { + name = hasan_sabbah.1031.b + custom_tooltip = look_for_another_enemy_tt + ai_chance = { + base = 0 + modifier = { + add = 1000 + NOT = { scope:seljuk_equivalent.house = house:house_seljuk } + } + } + } +} + } + + { +# A Rousing Sermon +# Agitate the populace decision event +# 1040 +hasan_sabbah.1040 = { + type = character_event + title = hasan_sabbah.1040.t + desc = hasan_sabbah.1040.desc + theme = realm + override_background = { reference = terrain } + left_portrait = { + character = root + animation = rage + } + + immediate = { + random_owned_story = { + limit = { story_type = story_hasan } + var:ultimate_foe = { save_scope_as = ultimate_foe } + } + } + + # Make them angy + option = { + name = hasan_sabbah.1040.a + duel = { + skills = { intrigue learning } + value = high_skill_rating + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + add = { + subtract = scope:location.county.county_opinion + } + } + send_interface_toast = { + type = event_toast_effect_good + title = hasan_sabbah.1040.a.win + left_icon = root + scope:location.county = { + add_county_modifier = { + modifier = ep3_agitated_populace + years = 15 + } + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + modifier = { + add = scope:location.county.county_opinion + } + send_interface_toast = { + type = event_toast_effect_bad + title = hasan_sabbah.1040.a.lose + left_icon = root + scope:location.county = { + add_county_modifier = { + modifier = tougher_to_convert + years = 10 + } + } + } + } + } + ai_chance = { + base = 10 + } + } +} + } + + { +# The Old Man of the Mountain +# Post-war settling down event +# 1050 +hasan_sabbah.1050 = { + type = character_event + title = hasan_sabbah.1050.t + desc = hasan_sabbah.1050.desc + theme = realm + left_portrait = { + character = root + animation = thinking + } + + # Let's settle + option = { + name = hasan_sabbah.1050.a + + custom_tooltip = create_new_kingdom + create_dynamic_title = { + tier = kingdom + name = HASAN_KINGDOM + adj = HASAN_KINGDOM_adj + } + change_government = clan_government + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = yes + } + scope:hasan_home = { + duchy = { + every_direct_de_jure_vassal_title = { + limit = { tier = tier_county } + change_title_holder = { + holder = root + change = scope:change + } + } + change_title_holder = { + holder = root + change = scope:change + } + } + } + scope:new_title = { + change_title_holder = { + holder = root + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + hidden_effect = { + scope:new_title = { + set_de_jure_liege_title = root.location.empire + set_coa = title:b_alamut + set_color_from_title = scope:hasan_home + set_capital_county = scope:hasan_home + } + } + if = { + limit = { + exists = scope:caliph + scope:caliph = { + is_landed = no + } + scope:caliph.faith = root.faith + NOT = { exists = root.faith.religious_head } + } + create_title_and_vassal_change = { + type = conquest + save_scope_as = change2 + add_claim_on_loss = yes + } + custom_description = { + text = "new_religious_head_title" + object = scope:caliph + subject = scope:caliph + + set_up_dynamic_spiritual_hof_title_existing_hof_effect = { + CREATOR = root + RELIGIOUS_HEAD = scope:caliph + } + } + scope:caliph = { + change_liege = { + liege = root + change = scope:change2 + } + } + resolve_title_and_vassal_change = scope:change2 + } + destroy_laamp_effect = { ADVENTURER = root } + ep3_become_landed_cleanup_effect = yes + + ai_chance = { + base = 1000 + } + } + + # Let's not + option = { + name = hasan_sabbah.1050.b + ai_chance = { + base = 0 + } + } +} + } +} + + +"common/story_cycles/ep3_story_cycle_hasan_sabbah.txt" = { + { +story_hasan = { + # by James Beaumont + + on_setup = { + + } +# + on_end = { + debug_log = "Hasan i Sabbah story ended on:" + debug_log_date = yes + } +# + on_owner_death = { + end_story = yes + } + + + # Progress on Assassing path Events + effect_group = { + months = 6 + + first_valid = { + triggered_effect = { + trigger = { + exists = var:radical_points + var:radical_points >= 5 + story_owner = { + OR = { + faith = faith:ismaili + faith = faith:nizari + } + NOR = { + has_character_flag = arrived_in_egypt + has_character_flag = had_hasan_sabah_20 + } + } + } + effect = { + story_owner = { + trigger_event = hasan_sabbah.1020 + } + } + } + triggered_effect = { + trigger = { + exists = var:radical_points + var:radical_points >= 15 + NOT = { exists = var:ultimate_foe } + } + effect = { + story_owner = { + trigger_event = hasan_sabbah.1031 + } + } + } + triggered_effect = { + trigger = { + exists = var:story_phase + var:story_phase >= 2 + NOT = { exists = var:ultimate_foe } + story_owner.domicile.domicile_location.county.holder ?= { + save_temporary_scope_as = county_holder + } + faith:ismaili = { + religious_head = { + save_temporary_scope_as = ismaili_hof + NOR = { + this = scope:county_holder + scope:county_holder = { + any_liege_or_above = { + this = scope:ismaili_hof + } + } + } + } + } + faith:nizari = { + religious_head = { + save_temporary_scope_as = nizari_hof + NOR = { + this = scope:county_holder + scope:county_holder = { + any_liege_or_above = { + this = scope:nizari_hof + } + } + } + } + } + } + effect = { + story_owner = { + domicile.domicile_location = { + save_scope_as = location + } + trigger_event = hasan_sabbah.1031 + } + } + } + } + } + + # Hasan dies or stops being muslim, end the story + effect_group = { + days = { 40 60 } + + first_valid = { + triggered_effect = { + trigger = { + OR = { + # Standard checks + NOT = { exists = story_owner } + story_owner = { + is_alive = no + } + # Must be Muslim + NOT = { story_owner = { religion = religion:islam_religion } } + # Must be landless + NOT = { story_owner = { has_government = landless_adventurer_government } } + # Must not be Sunni + story_owner = { faith = { has_doctrine = muhammad_succession_sunni_doctrine } } + } + } + effect = { + end_story = yes + } + } + } + } +} + } +} + +"events/story_cycles/ep3_story_cycle_el_cid.txt" = { + { +namespace = cid + +####################################### +# El Cid story cycle +# By Veronica Pazos +####################################### + +####################################### +### +### ONGOING STORY CYCLE EVENTS +### +### 0001-0099 Story Entry Points +### 0100-0199 Part I: Exile +### 0200-0299 Part II: Restoration +### 0400-0499 Conclusion +### 0500-0599 Maintenance +### +####################################### + +####################################### +### +### ENTRY POINTS TO THE STORY +### 0001 Your liege despises you +### +####################################### + +# By Order of the King +# You are exiled by your liege / Someone at court despises you / Historical flavour if Alfonso VI is your liege +# 0001 + +scripted_trigger cid_0001_hate_trigger = { + OR = { + has_relation_rival = root + has_relation_nemesis = root + opinion = { + target = root + value <= -50 + } + } +} + +scripted_effect create_el_cid_story = { + create_story = { + type = story_el_cid + save_scope_as = new_story + } + random_owned_story = { + limit = { story_type = story_el_cid } + save_scope_as = story_el_cid + story_owner = { + set_variable = { + name = cid_enemy + value = flag:$ENEMY$ + } + set_variable = { + name = cid_liege + value = scope:liege + } + set_variable = { + name = cid_loyalty_counter + value = 0 + } + set_variable = ongoing_cid_story_cycle + } + } +} + +cid.0001 = { + type = character_event + window = fullscreen_event + title = cid.0001.t + desc = { + desc = cid.0001.desc.intro + first_valid = { + triggered_desc = { + trigger = { + var:cid_enemy = flag:alfonso + } + desc = cid.0001.desc.alfonso + } + triggered_desc = { + trigger = { + var:cid_enemy = flag:garcia + } + desc = cid.0001.desc.garcia_ordonez + } + triggered_desc = { + trigger = { + var:cid_enemy = flag:liege + } + desc = cid.0001.desc.liege_hate + } + desc = cid.0001.desc.courtier + } + desc = cid.0001.desc.outro + } + theme = laamp + left_portrait = { + character = root + animation = wailing + } + right_portrait = { + character = scope:liege + animation = personality_callous + } + lower_right_portrait = { + trigger = { exists = scope:bad_courtier } + character = scope:bad_courtier + } + override_background = { reference = ep3_fullscreen_adventurer_negative } + + immediate = { + location.county.holder.top_liege = { save_scope_as = liege } + if = { #Historical conditions first + limit = { scope:liege = character:108500 } + hidden_effect = { # We show this in the "after" + create_el_cid_story = { ENEMY = alfonso } + } + } + else_if = { #If your liege hates you that takes preferent + limit = { + scope:liege = { cid_0001_hate_trigger = yes } + } + hidden_effect = { + create_el_cid_story = { ENEMY = liege } + } + } + else_if = { #If Garcia Ordoñez is there then it's him even if he "likes" you + limit = { + character:106050 ?= { + is_alive = yes + top_liege = scope:liege + } + } + character:106050 = { + save_scope_as = bad_courtier + } + hidden_effect = { + create_el_cid_story = { ENEMY = garcia } + } + } + else_if = { #If a random courtier hates you + limit = { + scope:liege = { + any_courtier = { + location = scope:liege.location + cid_0001_hate_trigger = yes + } + } + } + scope:liege = { + random_courtier = { + limit = { + cid_0001_hate_trigger = yes + } + weight = { + #Choose someone that really hates you first + modifier = { + add = 15 + has_relation_nemesis = root + } + modifier = { + add = 10 + has_relation_rival = root + } + modifier = { + add = 5 + opinion = { + target = root + value <= -90 + } + } + #Try to make it someone relevant + modifier = { + add = 5 + is_councillor_of = scope:liege + } + modifier = { + add = 5 + OR = { + is_close_family_of = scope:liege + is_consort_of = scope:liege + } + } + modifier = { + add = 5 + is_powerful_vassal_of = scope:liege + } + modifier = { + add = 2 + has_trait = callous + } + modifier = { + add = 2 + has_trait = disloyal + } + modifier = { + add = 2 + has_trait = ambitious + } + } + save_scope_as = bad_courtier + } + } + hidden_effect = { + create_el_cid_story = { ENEMY = courtier } + } + } + else = { #We make someone hate you + scope:liege = { + random_courtier = { + limit = { + is_available_healthy_ai_adult = yes + } + weight = { + #Try to make it someone relevant + modifier = { + add = 5 + is_councillor_of = scope:liege + } + modifier = { + add = 5 + OR = { + is_close_family_of = scope:liege + is_consort_of = scope:liege + } + } + modifier = { + add = 5 + is_powerful_vassal_of = scope:liege + } + modifier = { + add = 2 + has_trait = callous + } + modifier = { + add = 2 + has_trait = disloyal + } + modifier = { + add = 2 + has_trait = ambitious + } + } + save_scope_as = bad_courtier + } + } + hidden_effect = { + scope:bad_courtier = { + add_opinion = { + target = root + opinion = -75 + modifier = hate_opinion + } + } + create_el_cid_story = { ENEMY = courtier } + } + } + } + + # I will always be loyal to you + option = { + name = cid.0001.a + flavor = cid.0001.a.flavor + custom_tooltip = story_el_cid_tt + custom_tooltip = cid_loyalty_counter_positive + change_variable = { + name = cid_loyalty_counter + add = 1 + } + ai_chance = { + base = 1000 # Historically determined + } + } + + # I shall become my own liege + option = { + name = cid.0001.b + flavor = cid.0001.b.flavor + custom_tooltip = story_el_cid_tt + custom_tooltip = cid_loyalty_counter_negative + change_variable = { + name = cid_loyalty_counter + add = -1 + } + ai_chance = { + base = 0 # Historically determined + } + } + + # Opt out + option = { + name = ep3_story_cycle_admin_eunuch.2043.b + scope:story_el_cid = { end_story = yes } + ai_chance = { + base = 0 # Historically determined + } + } + + after = { # To make it look nicer in the tooltip + scope:liege ?= { + if = { + limit = { has_relation_friend = root } + remove_relation_friend = root + } + } + create_title_and_vassal_change = { + type = independency + add_claim_on_loss = yes + save_scope_as = change + } + becomes_independent = { change = scope:change } + resolve_title_and_vassal_change = scope:change + } +} + +####################################### +### +### PART I: EXILE +### 1000 No one opens the door to you +### 1010 You have no money to pay your men +### 1020 You have to leave your spouse/children behind +### 1030 You have some money - send a gift? +### 1040 You pray for your liege +### +####################################### + +# Closed Doors +# No one opens the door for you +# 1000 + +cid.1000 = { + type = character_event + title = cid.1000.t + desc = cid.1000.desc + theme = laamp + left_portrait = { + character = root + animation = worry + } + right_portrait = { + character = scope:peasant + animation = beg + } + lower_right_portrait = { + trigger = { exists = scope:liege } + character = scope:liege + } + override_background = { reference = alley_night } + override_effect_2d = { + reference = rain + } + + trigger = { + is_landless_adventurer = yes + NOT = { has_variable = had_cid_1000 } + } + + immediate = { + set_variable = had_cid_1000 + var:cid_liege = { save_scope_as = liege } + if = { + limit = { + any_pool_character = { + province = root.location + is_adult = yes + } + } + random_pool_character = { + province = root.location + limit = { + is_adult = yes + } + save_scope_as = peasant + } + } + else = { + hidden_effect = { + create_basic_peasant_effect = yes + } + } + } + + # Let's just leave + option = { + name = cid.1000.a + flavor = cid.1000.a.flavor + custom_tooltip = cid_loyalty_counter_positive + domicile = { + change_provisions = medium_provisions_loss + } + change_variable = { + name = cid_loyalty_counter + add = 1 + } + ai_chance = { + base = 1000 # Historically determined + } + } + + # Open the door + option = { + name = cid.1000.b + flavor = cid.1000.b.flavor + custom_tooltip = cid_loyalty_counter_negative + add_character_modifier = { + modifier = cid_opened_doors_modifier + years = 10 + } + domicile = { + change_provisions = minor_provisions_gain + } + change_variable = { + name = cid_loyalty_counter + add = -1 + } + ai_chance = { + base = 0 # Historically determined + } + } +} + +# No Gold or Silver +# You cannot afford your men +# 1010 + +scripted_trigger cid_1010_courtier_trigger = { + is_adult = yes + NOR = { + is_close_family_of = root + is_spouse_of = root + } +} + +cid.1010 = { + type = character_event + title = cid.1010.t + desc = cid.1010.desc + theme = laamp + left_portrait = { + character = root + animation = wedding_happy_cry + } + right_portrait = { + character = scope:friend + animation = lantern + camera = camera_event_right_pointing_right + } + lower_left_portrait = scope:courtier_1 + lower_center_portrait = { + trigger = { exists = scope:courtier_2 } + character = scope:courtier_2 + } + lower_right_portrait = { + trigger = { exists = scope:courtier_3 } + character = scope:courtier_3 + } + override_background = { reference = ep2_hunt_foggy_forest } + override_effect_2d = { + reference = fog + } + + trigger = { + is_landless_adventurer = yes + any_courtier = { + cid_1010_courtier_trigger = yes + count >= 2 + } + NOT = { has_variable = had_cid_1010 } + } + + immediate = { + set_variable = had_cid_1010 + var:cid_liege = { save_scope_as = liege } + random_courtier = { + limit = { cid_1010_courtier_trigger = yes } + weight = { + modifier = { + add = 15 + has_relation_best_friend = root + } + modifier = { + add = 10 + has_relation_friend = root + } + modifier = { + add = 5 + opinion = { + target = root + value >= 50 + } + } + } + save_scope_as = friend + } + random_courtier = { + limit = { + cid_1010_courtier_trigger = yes + NOT = { this = scope:friend } + } + weight = { + modifier = { + add = 5 + has_any_court_position = yes + } + } + save_scope_as = courtier_1 + } + if = { + limit = { + any_courtier = { + cid_1010_courtier_trigger = yes + NOT = { this = scope:friend } + NOT = { this = scope:courtier_1 } + } + } + random_courtier = { + limit = { + cid_1010_courtier_trigger = yes + NOT = { this = scope:friend } + NOT = { this = scope:courtier_1 } + } + weight = { + modifier = { + add = 5 + has_any_court_position = yes + } + } + save_scope_as = courtier_2 + } + } + if = { + limit = { + any_courtier = { + cid_1010_courtier_trigger = yes + NOT = { this = scope:friend } + NOT = { this = scope:courtier_1 } + NOT = { this = scope:courtier_2 } + } + } + random_courtier = { + limit = { + cid_1010_courtier_trigger = yes + NOT = { this = scope:friend } + NOT = { this = scope:courtier_1 } + NOT = { this = scope:courtier_2 } + } + weight = { + modifier = { + add = 5 + has_any_court_position = yes + } + } + save_scope_as = courtier_3 + } + } + if = { + limit = { employs_court_position = camp_cook_camp_officer } + random_court_position_holder = { + type = camp_cook_camp_officer + save_scope_as = cook + } + } + } + + # Special option if you have a Camp Cook + option = { + name = cid.1010.a + add_internal_flag = special + trigger = { employs_court_position = camp_cook_camp_officer } + domicile = { + change_provisions = minor_provisions_loss + } + + ai_chance = { + base = 1000 # Historically determined + } + } + + # Thanks, amigo + option = { + name = cid.1010.b + flavor = cid.1010.b.flavor + custom_tooltip = cid_loyalty_counter_negative + if = { + limit = { + NOT = { has_relation_friend = scope:friend } + } + set_relation_friend = { + target = scope:friend + reason = friend_cid_lent_gold + } + } + else = { + scope:friend = { + add_opinion = { + target = root + modifier = strengthened_friendship_opinion + } + } + } + add_gold = medium_gold_value + change_variable = { + name = cid_loyalty_counter + add = -1 + } + ai_chance = { + base = 1000 # Historically determined + } + } + + # Dont anger the king further + option = { + name = cid.1010.c + custom_tooltip = cid_loyalty_counter_very_positive + remove_courtier_or_guest = scope:courtier_1 + scope:courtier_1 = { + set_variable = { + name = cid_1010_no_invite_var + value = root + } + } + if = { + limit = { exists = scope:courtier_2 } + remove_courtier_or_guest = scope:courtier_2 + scope:courtier_2 = { + set_variable = { + name = cid_1010_no_invite_var + value = root + } + } + } + if = { + limit = { exists = scope:courtier_3 } + remove_courtier_or_guest = scope:courtier_3 + scope:courtier_3 = { + set_variable = { + name = cid_1010_no_invite_var + value = root + } + } + } + change_variable = { + name = cid_loyalty_counter + add = 2 + } + ai_chance = { + base = 0 # Historically determined + } + } +} + +# Farewell, My Dear +# You leave your spouse/children behind +# 1020 + +cid.1020 = { + type = character_event + title = cid.1020.t + desc = { + desc = cid.1020.desc.intro + first_valid = { + triggered_desc = { + trigger = { + exists = scope:child_1 + } + desc = cid.0001.desc.children + } + desc = cid.0001.desc.no_children + } + } + theme = laamp + left_portrait = { + character = root + animation = grief + } + right_portrait = { + character = scope:spouse + animation = wailing + } + lower_left_portrait = { + trigger = { exists = scope:child_1 } + character = scope:child_1 + } + lower_center_portrait = { + trigger = { exists = scope:child_2 } + character = scope:child_2 + } + lower_right_portrait = { + trigger = { exists = scope:priest } + character = scope:priest + } + override_background = { reference = temple } + + trigger = { + any_courtier = { + is_spouse_of = root + } + NOT = { has_variable = had_cid_1020 } + } + + immediate = { + set_variable = had_cid_1020 + var:cid_liege = { save_scope_as = liege } + random_courtier = { + limit = { is_spouse_of = root } + weight = { + modifier = { + add = 15 + has_relation_soulmate = root + } + modifier = { + add = 5 + has_relation_lover = root + } + modifier = { + add = 5 + this = root.primary_spouse + } + } + save_scope_as = spouse + } + if = { + limit = { + any_courtier = { is_child_of = root } + } + random_courtier = { + limit = { is_child_of = root } + weight = { + modifier = { + add = 5 + is_primary_heir_of = root + } + } + save_scope_as = child_1 + } + } + if = { + limit = { + any_courtier = { + is_child_of = root + NOT = { this = scope:child_1 } + } + } + random_courtier = { + limit = { + is_child_of = root + NOT = { this = scope:child_1 } + } + save_scope_as = child_2 + } + } + if = { + limit = { + employs_court_position = camp_priest_camp_officer + } + random_court_position_holder = { + type = camp_priest_camp_officer + save_scope_as = my_priest + } + } + } + + # Special option if you have a Priest that can intercede + option = { + name = cid.1020.a + add_internal_flag = special + trigger = { + employs_court_position = camp_priest_camp_officer + } + remove_short_term_gold = minor_gold_value + add_piety = medium_piety_value + ai_chance = { + base = 1000 # Historically determined + } + } + + # I shall miss you dearly + option = { + name = cid.1020.b + flavor = cid.1020.b.flavor + custom_tooltip = cid_loyalty_counter_positive + + location.county.holder = { + add_courtier = scope:spouse + } + if = { + limit = { exists = scope:child_1 } + location.county.holder = { add_courtier = scope:child_1 } + } + if = { + limit = { exists = scope:child_2 } + location.county.holder = { add_courtier = scope:child_2 } + } + + change_variable = { + name = cid_loyalty_counter + add = 1 + } + ai_chance = { + base = 1000 # Historically determined + } + } + + # I cannot do this + option = { + name = cid.1020.c + flavor = cid.1020.c.flavor + custom_tooltip = cid_loyalty_counter_very_negative + if = { + limit = { + NOT = { + can_set_relation_lover_trigger = { CHARACTER = scope:spouse } + } + } + set_relation_lover = { + target = scope:spouse + reason = cid_lover_refused_to_left_behind + } + } + add_character_modifier = { + modifier = cid_family_good_modifier + years = 10 + } + change_variable = { + name = cid_loyalty_counter + add = -2 + } + ai_chance = { + base = 0 # Historically determined + } + } +} + +# For the Love of the King +# You have some money, send gift? +# 1030 + +cid.1030 = { + type = character_event + title = cid.1030.t + desc = cid.1030.desc + theme = laamp + left_portrait = { + character = root + animation = thinking + } + lower_right_portrait = scope:liege + artifact = { + trigger = { exists = scope:artifact } + target = scope:artifact + position = lower_left_portrait + } + + trigger = { + NOT = { has_variable = had_cid_1030 } + gold >= 50 + } + + immediate = { + set_variable = had_cid_1030 + var:cid_liege = { save_scope_as = liege } + if = { + limit = { + any_character_artifact = { + OR = { + rarity = illustrious + rarity = famed + } + } + } + random_character_artifact = { + limit = { + OR = { + rarity = masterwork + rarity = illustrious + rarity = famed + } + } + weight = { + modifier = { + add = 10 + is_equipped = no + } + modifier = { + add = 2 + rarity = famed + } + modifier = { + add = 2 + rarity = illustrious + } + } + save_scope_as = artifact + } + } + } + + # If you have an artifact send that instead? + option = { + name = cid.1030.a + trigger = { exists = scope:artifact } + add_internal_flag = special + custom_tooltip = cid_loyalty_counter_positive + scope:artifact = { set_owner = scope:liege } + change_variable = { + name = cid_loyalty_counter + add = 1 + } + ai_chance = { + base = 1000 # Historically determined + } + } + + # Send money + option = { + name = cid.1030.b + custom_tooltip = cid_loyalty_counter_positive + pay_short_term_gold = { + target = scope:liege + gold = medium_gold_value + } + change_variable = { + name = cid_loyalty_counter + add = 1 + } + ai_chance = { + base = 1000 # Historically determined + } + } + + # No, thanks + option = { + name = cid.1030.c + custom_tooltip = cid_loyalty_counter_negative + + change_variable = { + name = cid_loyalty_counter + add = -1 + } + ai_chance = { + base = 0 + } + } +} + +# May the Lord Have Mercy +# Publicly pray for your liege +# 1040 + +cid.1040 = { + type = character_event + title = cid.1040.t + desc = cid.1040.desc + theme = laamp + left_portrait = { + character = root + animation = prayer + } + lower_right_portrait = scope:liege + override_background = { reference = temple } + + trigger = { + NOT = { has_variable = had_cid_1040 } + } + + immediate = { + set_variable = had_cid_1040 + var:cid_liege = { save_scope_as = liege } + } + + # You do it in your own camp, dayum + option = { + name = cid.1040.a + custom_tooltip = cid_1040_a_tt + trigger = { + domicile = { has_domicile_building = baggage_train_shrine } + } + add_internal_flag = special + + custom_tooltip = cid_loyalty_counter_very_positive + + change_variable = { + name = cid_loyalty_counter + add = 2 + } + ai_chance = { + base = 1000 # Historically determined + } + } + + # Pray for them + option = { + name = cid.1040.b + custom_tooltip = cid_loyalty_counter_positive + change_variable = { + name = cid_loyalty_counter + add = 1 + } + ai_chance = { + base = 1000 # Historically determined + } + } + + # Pray for yourself + option = { + name = cid.1040.c + custom_tooltip = cid_loyalty_counter_negative + add_character_modifier = { + modifier = cid_own_prayer + years = 15 + } + change_variable = { + name = cid_loyalty_counter + add = -1 + } + ai_chance = { + base = 0 + } + } +} + +####################################### +### +### PART II: RESTORATION +### 2000 You win Tizona +### 2001 You win Colada +### 2010 Your liege offers you a favourable marriage +### 2020 You become landed again +### +####################################### + +# From the Elbow Down +# You win Tizona +# 2000 + +cid.2000 = { + type = character_event + title = cid.2000.t + desc = { + desc = cid.2000.desc.intro + first_valid = { + triggered_desc = { + trigger = { exists = scope:loser } + desc = cid.2000.desc.loser + } + desc = cid.2000.desc.fallback + } + desc = cid.2000.desc.outro + } + theme = laamp + left_portrait = { + character = root + animation = jockey_victory + camera = camera_event_horse_left + } + right_portrait = { + trigger = { exists = scope:loser } + character = scope:loser + animation = severelywounded + } + artifact = { + target = scope:newly_created_artifact + position = lower_center_portrait + } + lower_right_portrait = scope:liege + override_background = { reference = ce1_legendary_battlefield } + override_effect_2d = { + reference = legend_glow + } + + trigger = { + NOT = { has_variable = had_cid_2000 } + has_variable = ongoing_cid_story_cycle + } + + immediate = { + set_variable = had_cid_2000 + var:cid_liege = { save_scope_as = liege } + # Create the artifact + if = { # Court Artifact + limit = { has_royal_court = yes } + create_artifact = { + name = artifact_wall_cid_sword_name + description = artifact_wall_el_cids_sword + type = pedestal + visuals = wall_cid_sword + wealth = 90 + quality = 90 + template = tizona_template + history = { + type = created_before_history + } + modifier = tizona_modifier + save_scope_as = newly_created_artifact + decaying = no + } + } + else = { + hidden_effect_new_object = { + create_artifact = { + name = artifact_wall_cid_sword_name + description = artifact_wall_el_cids_sword + type = sword + visuals = sword + modifier = tizona_no_court_modifier + wealth = 90 + quality = 90 + save_scope_as = newly_created_artifact + } + } + } + } + + # I win! + option = { + name = cid.2000.a + flavor = cid.2000.a.flavor + custom_tooltip = cid_loyalty_counter_negative + custom_tooltip = cid.2001.a.tt + change_variable = { + name = cid_loyalty_counter + add = -1 + } + add_gold = medium_gold_value + + #If you have CE1 we give you a legend seed + if = { + limit = { + has_dlc_feature = legends + NOT = { has_variable = had_cid_2001 } + exists = scope:loser + NOT = { has_game_rule = historical_legends_only } + } + create_legend_seed = { + type = heroic + quality = famed + chronicle = legendary_battle + properties = { + winner = root + loser = scope:loser + location = root.location + } + } + } + + ai_chance = { + base = 1000 # Historically determined + } + } + + # Send the spoils to the king + option = { + name = cid.2000.b + flavor = cid.2000.b.flavor + custom_tooltip = cid_loyalty_counter_positive + change_variable = { + name = cid_loyalty_counter + add = 1 + } + scope:liege = { + add_gold = medium_gold_value + scope:newly_created_artifact = { set_owner = scope:liege } + } + + ai_chance = { + base = 0 # Historically determined + } + } +} + +# From a Brave Master +# You win Colada +# 2001 + +cid.2001 = { + type = character_event + title = cid.2001.t + desc = { + desc = cid.2001.desc.intro + first_valid = { + triggered_desc = { + trigger = { exists = scope:loser } + desc = cid.2001.desc.loser + } + desc = cid.2001.desc.fallback + } + desc = cid.2001.desc.outro + first_valid = { + triggered_desc = { + trigger = { has_variable = had_cid_2000 } + desc = cid.2001.desc.outro.tizona + } + } + } + theme = laamp + left_portrait = { + character = root + animation = sword_coup_degrace + } + right_portrait = { + trigger = { exists = scope:loser } + character = scope:loser + animation = severelywounded + } + artifact = { + target = scope:newly_created_artifact + position = lower_center_portrait + } + lower_right_portrait = scope:liege + override_background = { reference = ce1_legendary_battlefield } + override_effect_2d = { + reference = rain + } + + trigger = { + NOT = { has_variable = had_cid_2001 } + has_variable = ongoing_cid_story_cycle + } + + immediate = { + set_variable = had_cid_2001 + var:cid_liege = { save_scope_as = liege } + # Create the artifact + if = { # Court Artifact + limit = { has_royal_court = yes } + hidden_effect_new_object = { + create_artifact = { + name = artifact_colada_name + description = artifact_colada_description + type = pedestal + visuals = wall_cid_sword + wealth = 75 + quality = 75 + template = general_unique_template + history = { + type = created_before_history + } + modifier = colada_modifier + save_scope_as = newly_created_artifact + decaying = no + } + } + } + else = { + hidden_effect_new_object = { + create_artifact = { + name = artifact_colada_name + description = artifact_colada_description + type = sword + visuals = sword + modifier = colada_non_court_modifier + wealth = 75 + quality = 75 + save_scope_as = newly_created_artifact + } + } + } + } + + # I win! + option = { + name = cid.2001.a + flavor = cid.2001.a.flavor + custom_tooltip = cid_loyalty_counter_negative + custom_tooltip = cid.2001.a.tt + change_variable = { + name = cid_loyalty_counter + add = -1 + } + add_gold = medium_gold_value + + #If you have CE1 we give you a legend seed + if = { + limit = { + has_dlc_feature = legends + NOT = { has_variable = had_cid_2000 } + NOT = { has_game_rule = historical_legends_only } + } + create_legend_seed = { + type = heroic + quality = famed + chronicle = legendary_battle + properties = { + winner = root + loser = scope:loser + location = root.location + } + } + } + + ai_chance = { + base = 1000 # Historically determined + } + } + + # Send the spoils to the king + option = { + name = cid.2001.b + custom_tooltip = cid_loyalty_counter_positive + change_variable = { + name = cid_loyalty_counter + add = 1 + } + scope:liege = { + add_gold = medium_gold_value + scope:newly_created_artifact = { set_owner = scope:liege } + } + + ai_chance = { + base = 0 # Historically determined + } + } +} + +# A Favorable Offer +# Your liege offers you a favourable marriage +# 2010 + +scripted_trigger cid_2010_possible_child_trigger = { + is_child_of = root + trigger_if = { + limit = { + NOR = { + faith = { has_doctrine = doctrine_polygamy } + allowed_more_spouses = yes + } + } + is_married = no + is_betrothed = no + } +} + +scripted_trigger cid_2010_herald_trigger = { + is_capable_adult = yes + NOR = { + is_close_family_of = scope:liege + is_spouse_of = scope:liege + } + NOT = { has_council_position = councillor_court_chaplain } +} + +scripted_effect cid_2010_create_proposed_spouse_effect = { + create_character = { + template = knight + dynasty = none + location = scope:liege.location + culture = scope:liege.location.culture + faith = scope:liege.location.faith + gender_female_chance = $CHANCE$ + save_scope_as = proposed_spouse + } +} + +cid.2010 = { + type = character_event + title = cid.2010.t + desc = cid.2010.desc + theme = laamp + left_portrait = { + character = root + animation = thinking + } + right_portrait = { + character = scope:herald + animation = chancellor + } + lower_left_portrait = { + character = scope:child + } + lower_right_portrait = { + character = scope:proposed_spouse + } + + trigger = { + any_courtier = { + cid_2010_possible_child_trigger = yes + } + var:cid_loyalty_counter >= 2 + NOT = { has_variable = had_cid_2010 } + } + + immediate = { + set_variable = had_cid_2010 + var:cid_liege = { save_scope_as = liege } + if = { + limit = { + scope:liege = { + any_courtier = { cid_2010_herald_trigger = yes } + } + } + scope:liege = { + random_courtier = { + limit = { + cid_2010_herald_trigger = yes + } + save_scope_as = herald + } + } + } + else = { + create_character = { + template = herald_character + dynasty = none + location = scope:liege.location + culture = scope:liege.location.culture + faith = scope:liege.location.faith + gender_female_chance = root_faith_dominant_gender_adjusted_female_chance + save_scope_as = herald + } + scope:liege = { add_courtier = scope:herald } + } + random_courtier = { + limit = { + cid_2010_possible_child_trigger = yes + } + weight = { + modifier = { + add = 5 + is_primary_heir_of = root + } + modifier = { + add = 2 + age >= 16 + } + } + save_scope_as = child + } + if = { + limit = { + scope:liege = { + any_close_or_extended_family_member = { + can_marry_character_trigger = { + CHARACTER = scope:child + } + } + } + } + scope:liege = { + random_close_or_extended_family_member = { + limit = { + can_marry_character_trigger = { + CHARACTER = scope:child + } + } + weight = { # Good candidates + modifier = { + add = 5 + is_close_family_of = scope:liege + } + modifier = { # Age appropriate + add = 5 + age <= scope:child.age_plus_5 + age >= scope:child.age_minus_5 + } + } + save_scope_as = proposed_spouse + } + } + } + else_if = { + limit = { + scope:liege = { + any_courtier = { + can_marry_character_trigger = { + CHARACTER = scope:child + } + } + } + } + scope:liege = { + random_courtier = { + limit = { + can_marry_character_trigger = { + CHARACTER = scope:child + } + } + weight = { # Age appropriate + modifier = { + add = 5 + age <= scope:child.age_plus_5 + age >= scope:child.age_minus_5 + } + modifier = { # Knights are just cool + add = 2 + is_knight_of = scope:liege + } + } + save_scope_as = proposed_spouse + } + } + } + else = { + if = { # We make them a woman if your child is a man/woman that can marry a woman + limit = { + scope:child = { + OR = { + AND = { + is_female = yes + OR = { + has_sexuality = homosexual + has_sexuality = bisexual + } + allowed_to_marry_same_sex_trigger = yes + } + AND = { + is_male = yes + OR = { + has_sexuality = heterosexual + has_sexuality = bisexual + } + } + } + } + } + cid_2010_create_proposed_spouse_effect = { CHANCE = 100 } + } + else = { + cid_2010_create_proposed_spouse_effect = { CHANCE = 0 } + } + scope:proposed_spouse = { add_character_flag = wear_armor } + scope:liege = { add_courtier = scope:proposed_spouse } + } + } - scope:righteous_caliph = { - add_opinion = { - target = root - opinion = 20 - modifier = pleased_opinion + # Sure + option = { + name = cid.2010.a + flavor = cid.2010.a.flavor + custom_tooltip = cid_loyalty_counter_very_positive + scope:child = { create_betrothal = scope:proposed_spouse } + change_variable = { + name = cid_loyalty_counter + add = 2 + } + ai_chance = { + base = 1000 # Historically determined + } + } + + # No way + option = { + name = cid.2010.b + custom_tooltip = cid_loyalty_counter_very_negative + add_character_modifier = { + modifier = cid_refused_betrothal + years = 10 + } + change_variable = { + name = cid_loyalty_counter + add = -2 + } + ai_chance = { + base = 0 # Historically determined + } + } +} + +# LOYAL ENDING +# An Honorable Man +# You become landed again +# 2020 + +scripted_effect cid_2020_loyal_effect = { + if = { + limit = { NOT = { has_trait = loyal } } + add_trait_force_tooltip = loyal + } +} + +cid.2020 = { + type = character_event + title = cid.2020.t + desc = cid.2020.desc + theme = laamp + left_portrait = { + character = root + animation = wedding_happy_cry + } + right_portrait = { + character = scope:liege + animation = ecstasy + } + + trigger = { + #triggered through the story cycle + var:cid_liege.primary_title = { + any_de_jure_county = { + holder = root.var:cid_liege + NOR = { + root.var:cid_liege.capital_county ?= this + root.var:cid_liege.primary_title ?= this + } } } + NOT = { has_variable = had_cid_2020 } + } - scope:pious_woman = { - if = { - limit = { #if she has a forceful personality, she'll be galvanized in her faith by this - fp3_assertive_female_believer_trigger = yes + immediate = { + if = { + limit = { + is_ai = no + } + add_achievement_global_variable_effect = { + VARIABLE = finished_mio_cid_achievement + VALUE = yes + } + } + set_variable = had_cid_2020 + var:cid_liege = { save_scope_as = liege } + scope:liege.primary_title = { + every_de_jure_county = { + limit = { + holder = scope:liege + NOR = { + scope:liege.capital_county ?= this + scope:liege.primary_title ?= this + } } - add_character_modifier = { - modifier = fp3_womens_faith_galvanized_modifier - years = 25 + add_to_list = granted_title + } + } + } + + # Wahoo! + option = { + name = cid.2020.a + flavor = cid.2020.a.flavor + cid_2020_loyal_effect = yes + # Resolve title, liege, government changes + ep3_become_landed_save_liege_effect = { + TITLE_GIVER = root.var:cid_liege + ALWAYS_INDEPENDENT = no + TITLE_LIST = granted_title + } + ep3_become_landed_transfer_no_ennobled_modifier_effect = { + TITLE_RECEIVER = root + TITLE_LIST = granted_title + TYPE = granted + REASON = flag:negotiated + } + + ai_chance = { + base = 1000 # Historically determined + } + } + + # I'm good + option = { + name = cid.2020.b + flavor = cid.2020.b.flavor + custom_tooltip = cid_2020_b_tt + cid_2020_loyal_effect = yes + add_prestige = major_prestige_gain + domicile = { + change_provisions = medium_provisions_gain + } + if = { + limit = { + can_add_hook = { + target = scope:liege + type = loyalty_hook } } - else = { #otherwise, she'll just be sad or angry - add_opinion = { - target = root - opinion = -20 - modifier = fp3_persecuted_my_faith_opinion + add_hook = { + target = scope:liege + type = loyalty_hook + } + } + + ai_chance = { + base = 0 # Historically determined + } + } + + # I'm good and also screw you + option = { + name = cid.2020.c + custom_tooltip = cid_2020_b_tt + scope:liege = { + add_opinion = { + target = root + opinion = -50 + modifier = disrespect_opinion + } + } + + ai_chance = { + base = 0 # Historically determined + } + } + + after = { + random_owned_story = { + limit = { + story_type = story_el_cid + } + end_story = yes + } + } +} + +####################################### +### +### CONCLUSION +### +### # Good Ending given out in 2020 # +### 4000 Neutral Ending +### 4010 Disloyal Ending +### +####################################### + +# The End of the Song +# Neutral Ending +# 4000 + +cid.4000 = { + type = letter_event + opening = { + desc = cid.4000.opening + } + desc = cid.4000.desc + sender = scope:sender + + trigger = { + NOT = { has_variable = had_cid_4000 } + } + + immediate = { + set_variable = had_cid_4000 + var:cid_liege = { save_scope_as = sender } + } + + # Bleh + option = { + name = cid.4000.a + if = { #You didn't manage to max out either way + limit = { + NOT = { has_trait = fickle } + } + add_trait_force_tooltip = fickle + } + ai_chance = { + base = 100 + } + } + + after = { + random_owned_story = { + limit = { + story_type = story_el_cid + } + end_story = yes + } + } +} + +# Mio Cid +# Disloyal Ending: You become landed again +# 4010 + +scripted_effect cid_4010_disloyal_effect = { + if = { + limit = { NOT = { has_trait = disloyal } } + add_trait_force_tooltip = disloyal + } +} + +cid.4010 = { + type = character_event + title = cid.4010.t + desc = cid.4010.desc + theme = laamp + left_portrait = { + character = root + animation = dismissal + } + right_portrait = { + character = scope:herald + animation = anger + } + lower_right_portrait = scope:liege + + trigger = { + #triggered through the story cycle <= -5 loyalty + var:cid_liege.primary_title = { + any_de_jure_county = { + holder = root.var:cid_liege + NOR = { + root.var:cid_liege.capital_county ?= this + root.var:cid_liege.primary_title ?= this } } } + NOT = { has_variable = had_cid_4010 } + } - hidden_effect = { - custom_tooltip = fp3_sharhabanu_devotees_angry.tt - random_courtier = { #female courtiers might get galvanized too, depending on their personality - if = { + immediate = { + set_variable = had_cid_4010 + var:cid_liege = { save_scope_as = liege } + if = { + limit = { + scope:liege = { + any_courtier = { cid_2010_herald_trigger = yes } + } + } + scope:liege = { + random_courtier = { limit = { - fp3_bibi_shahrbanu_devotee_trigger = yes - fp3_assertive_female_believer_trigger = yes - NOT = { this = scope:pious_woman } - } - add_character_modifier = { - modifier = fp3_womens_faith_galvanized_modifier - years = 25 + cid_2010_herald_trigger = yes } + save_scope_as = herald } } } + else = { + create_character = { + template = herald_character + dynasty = none + location = scope:liege.location + culture = scope:liege.location.culture + faith = scope:liege.location.faith + gender_female_chance = root_faith_dominant_gender_adjusted_female_chance + save_scope_as = herald + } + scope:liege = { add_courtier = scope:herald } + } + } - stress_impact = { - zealous = minor_stress_impact_loss - compassionate = medium_stress_impact_gain - content = medium_stress_impact_gain - lazy = medium_stress_impact_gain + # Wahoo! Get landed and independent + option = { + name = cid.4010.a + flavor = cid.4010.a.flavor + trigger = { has_variable = cid_title_to_give } + cid_4010_disloyal_effect = yes + var:cid_title_to_give = { + every_de_jure_county = { add_to_list = seized_titles } + } + ep3_become_landed_save_liege_effect = { + TITLE_GIVER = var:cid_title_to_give.holder + ALWAYS_INDEPENDENT = yes + TITLE_LIST = seized_titles + } + ep3_become_landed_transfer_no_ennobled_modifier_effect = { + TITLE_RECEIVER = root + TITLE_LIST = seized_titles + TYPE = usurped + REASON = flag:seize_realm + } + + ai_chance = { + base = 1000 # Historically determined } + } - ai_chance = { - base = 100 - ai_value_modifier = { - ai_energy = 0.5 - ai_boldness = 1 - ai_vengefulness = 0.5 - } - } + # I'm good + option = { + name = cid.4010.b + flavor = cid.4010.b.flavor + custom_tooltip = cid_2020_b_tt + cid_4010_disloyal_effect = yes + add_prestige = medium_prestige_gain + + ai_chance = { + base = 500 # Historically determined + } + } + + # Actually... the king is not that bad + option = { + name = cid.4010.c + flavor = cid.4010.c.flavor + custom_tooltip = cid_2020_b_tt + domicile = { change_provisions = medium_provisions_gain } + if = { + limit = { + scope:liege = { + can_add_hook = { + target = root + type = favor_hook + } + } + } + scope:liege = { + add_hook = { + target = root + type = favor_hook + } + } + } + progress_towards_friend_effect = { + REASON = friend_cid_liege_repentance + CHARACTER = scope:liege + OPINION = 50 + } + + ai_chance = { + base = 0 # Historically determined + } + } + + after = { + random_owned_story = { + limit = { + story_type = story_el_cid + } + end_story = yes + } + } +} + +####################################### +### +### MAINTENANCE +### 5000 Liege dies (letter event) +### +####################################### + +# Your liege died +# 5000 + +cid.5000 = { + type = letter_event + opening = { + desc = cid.5000.opening + } + desc = cid.5000.desc + sender = scope:sender + + immediate = { + location.county.holder.top_liege = { save_scope_as = sender } + } + + # Oops + option = { + name = cid.5000.a + ai_chance = { + base = 1000 # Historically determined + } + } + + after = { + random_owned_story = { + limit = { + story_type = story_el_cid + } + end_story = yes + } } } } } -"common\decisions\dlc_decisions\fp_3\fp3_islamic_decisions.txt" = { +"common/character_interactions/06_ep3_laamp_interactions.txt" = { { -avenge_the_battle_of_nahrawan_decision = { - picture = { - reference = "gfx/interface/illustrations/decisions/fp3/fp3_decision_supremacy.dds" + ## Hasan cannot be exiled by anyone during his story. + disable_interaction_for_hasan_trigger = yes + } +} + +"common/casus_belli_types/07_ep3_wars.txt" = { + { +ep3_hasan_assassin_war = { + icon = dissolution_war + group = event + allow_hostages = no + allowed_for_character = {} + valid_to_start = { + always = no + } + + on_declaration = { + on_declared_war = yes + # TODO_CD_EP3, add every same-faith vassal to attacker's side? } - decision_group_type = major - ai_check_interval = 120 - sort_order = 30 - title = { + on_victory_desc = { first_valid = { triggered_desc = { + trigger = { # Desc for only one player attacker + scope:attacker = { + is_local_player = yes + } + } + desc = nation_fracturing_faction_war_victory_desc_local_player_attacker_alone + } + triggered_desc = { # Desc for only one attacker, player defender trigger = { - faith = { - OR = { - has_doctrine = tenet_fp3_fedayeen - has_doctrine = tenet_warmonger - has_doctrine_parameter = pluralism_fundamentalist_proselytization_bonus - } + scope:defender = { + is_local_player = yes } } - desc = destroy_the_apostates_decision_name + desc = player_nation_fracturing_faction_war_victory_desc_local_player_defender_attacker_alone } - desc = avenge_the_battle_of_nahrawan_decision_name + desc = nation_fracturing_faction_war_victory_desc_local_player_attacker_alone # Desc for a third party involved } + } - desc = avenge_the_battle_of_nahrawan_decision_desc + on_victory = { - selection_tooltip = avenge_the_battle_of_nahrawan_decision_tooltip + scope:attacker = { show_pow_release_message_effect = yes } - is_shown = { - has_fp3_dlc_trigger = yes - faith = { has_doctrine = muhammad_succession_muhakkima_doctrine } - exists = capital_province - capital_province = { - OR = { - geographical_region = world_persian_empire - geographical_region = world_middle_east - } - } - NOT = { - is_target_in_global_variable_list = { - name = unavailable_unique_decisions - target = flag:avenge_the_battle_of_nahrawan_decision - } + #EP2 Accolade glory gain from winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_med_effect = yes } + hasan_sabbah_end_war = { + HASAN = scope:attacker + SELJUK = scope:defender } + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes } - is_valid = { - completely_controls_region = world_mesopotamia - custom_description = { - text = "restore_high_priesthood_holy_sites" - faith = { - any_holy_site = { - OR = { - county.holder = root - county.holder.top_liege = { this = root } + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = player_nation_fracturing_faction_war_white_peace_defender_desc + } + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes } - count >= 3 } + desc = player_nation_fracturing_faction_war_white_peace_attacker_desc } + desc = player_nation_fracturing_faction_war_white_peace_desc } - custom_description = { - text = avenge_the_battle_of_nahrawan_sunni_caliphate_irrelevant - NOT = { exists = title:d_sunni.holder } - } - custom_description = { - text = avenge_the_battle_of_nahrawan_shia_caliphate_irrelevant - NOT = { exists = title:d_shiite.holder } - } - } - is_valid_showing_failures_only = { - is_alive = yes - not = { exists = involved_activity } - is_imprisoned = no } - - effect = { - save_scope_as = avenger - - #Sunni penalty scope save - title:e_arabia = { - random_de_jure_county_holder = { #If there's a big Sunni presence in Arabia - limit = { - faith = { has_doctrine = muhammad_succession_sunni_doctrine } - highest_held_title_tier = tier_empire - } - alternative_limit = { - faith = { has_doctrine = muhammad_succession_sunni_doctrine } - highest_held_title_tier = tier_kingdom - } - alternative_limit = { - faith = { has_doctrine = muhammad_succession_sunni_doctrine } - highest_held_title_tier = tier_duchy - } - faith = { - save_scope_as = sunni_faith + on_white_peace = { + scope:attacker = { + show_pow_release_message_effect = yes + stress_impact = { + ambitious = medium_stress_impact_gain + arrogant = medium_stress_impact_gain + } + } + hidden_effect = { + scope:attacker = { + add_truce_both_ways = { + character = scope:defender + days = 1825 + war = root.war + result = white_peace } } } - title:e_persia = { - random_de_jure_county_holder = { #If there's a big Sunni presence in Persia - limit = { - faith = { has_doctrine = muhammad_succession_sunni_doctrine } - highest_held_title_tier = tier_empire - } - alternative_limit = { - faith = { has_doctrine = muhammad_succession_sunni_doctrine } - highest_held_title_tier = tier_kingdom - } - alternative_limit = { - faith = { has_doctrine = muhammad_succession_sunni_doctrine } - highest_held_title_tier = tier_duchy - } - faith = { - save_scope_as = sunni_faith - } + scope:defender = { + stress_impact = { + arrogant = medium_stress_impact_gain + } + + add_character_flag = { + flag = recent_nation_fracturing_faction_war + years = faction_nation_fracturing_war_white_peace_cooldown } + add_prestige = minor_prestige_value } - #Shia penalty scope save - title:e_arabia = { - random_de_jure_county_holder = { #If there's a big Shia presence in Arabia - limit = { - faith = { has_doctrine = muhammad_succession_shia_doctrine } - highest_held_title_tier = tier_empire - } - alternative_limit = { - faith = { has_doctrine = muhammad_succession_shia_doctrine } - highest_held_title_tier = tier_kingdom - } - alternative_limit = { - faith = { has_doctrine = muhammad_succession_shia_doctrine } - highest_held_title_tier = tier_duchy - } - faith = { - save_scope_as = shia_faith + on_white_peace_faction_revolt_war = yes + # End Hasan's story cycle + hidden_effect = { + scope:attacker = { + if = { + limit = { + any_owned_story = { + story_type = story_hasan + } + } + random_owned_story = { + limit = { + story_type = story_hasan + } + end_story = yes + } } } } - #Shia penalty scope save - title:e_persia = { - random_de_jure_county_holder = { #If there's a big Shia presence in Persia - limit = { - faith = { has_doctrine = muhammad_succession_shia_doctrine } - highest_held_title_tier = tier_empire - } - alternative_limit = { - faith = { has_doctrine = muhammad_succession_shia_doctrine } - highest_held_title_tier = tier_kingdom - } - alternative_limit = { - faith = { has_doctrine = muhammad_succession_shia_doctrine } - highest_held_title_tier = tier_duchy - } - faith = { - save_scope_as = shia_faith + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = nation_fracturing_faction_war_defeat_defender_desc + } + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes + } } + desc = player_nation_fracturing_defeat_attacker_desc } + desc = player_nation_fracturing_faction_war_defeat_desc } - show_as_tooltip = { avenge_the_battle_of_nahrawan_scripted_effect = yes } #Actually applied in fp3_decision.0011 - Prestige, religion bonuses + } - #Events - trigger_event = fp3_decision.0011 - every_player = { - limit = { - NOT = { this = scope:avenger } - is_within_diplo_range = { CHARACTER = scope:avenger } + on_defeat = { + scope:attacker = { show_pow_release_message_effect = yes } + scope:defender = { + add_character_flag = { + flag = recent_nation_fracturing_faction_war + years = faction_nation_fracturing_war_defeat_cooldown } - trigger_event = fp3_decision.0012 - } + add_dread = medium_dread_gain + # Prestige for Defender + add_prestige_war_defender_effect = { + PRESTIGE_VALUE = medium_prestige_value + } + add_achievement_flag_effect = { FLAG = achievement_know_your_place_flag } - #Can only be done once - add_to_global_variable_list = { - name = unavailable_unique_decisions - target = flag:avenge_the_battle_of_nahrawan_decision + # LEGITIMACY FROM WINNING FACTION WAR + faction_war_end_victory_legitimacy_effect = yes + } + # End Hasan's story cycle + hidden_effect = { + scope:attacker = { + if = { + limit = { + any_owned_story = { + story_type = story_hasan + } + } + random_owned_story = { + limit = { + story_type = story_hasan + } + end_story = yes + } + } + } } + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes } - ai_will_do = { - base = 100 + on_invalidated_desc = msg_invalidate_war_title + + check_defender_inheritance_validity = no + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + transfer_behavior = transfer + + war_name = "ASSASSIN_NATION_FRACTURING_WAR_NAME" + + interface_priority = 120 + + attacker_wargoal_percentage = 0.8 + + max_attacker_score_from_battles = 100 + max_defender_score_from_battles = 50 + + max_defender_score_from_occupation = 150 + max_attacker_score_from_occupation = 150 + + max_ai_diplo_distance_to_title = 500 +} + } +} + +"common/on_action/dlc/ep3/el_cid_story_cycle_on_action.txt" = { + { +##################################################### +### +### El Cid Story Cycle On-Actions +### +### el_cid_landless_on_action +### el_cid_landless_or_landed_on_action +### +##################################################### + +# Landless +el_cid_landless_on_action = { + random_events = { + # No one opens the door to you + 200 = cid.1000 + # You have no money to pay your men + 100 = cid.1010 + # You have to leave your spouse/children behind + 200 = cid.1020 + } +} + +# Landless or Landed +el_cid_landless_or_landed_on_action = { + random_events = { + # You have some money - send gift? + 100 = cid.1030 + # You pray for your liege + 100 = cid.1040 + # cid.2000 triggered from the combat on_action + # cid.2001 triggered from the combat on_action + # Your liege offers you a favourable marriage + 250 = cid.2010 } } } } -"events/dlc/fp3/fp3_religious_decision_events.txt" = { +"common/on_action/combat_on_actions.txt" = { { -fp3_decision.0011 = { - type = character_event - title = fp3_decision.0011.t - desc = { - desc = fp3_decision.0011_opening.desc - first_valid = { - triggered_desc = { - trigger = { - faith = { - OR = { - has_doctrine = tenet_fp3_fedayeen - has_doctrine = tenet_warmonger - has_doctrine_parameter = pluralism_fundamentalist_proselytization_bonus - } + #If you are el Cid you get a special events + if = { + limit = { + side_primary_participant = { has_variable = ongoing_cid_story_cycle } + enemy_side.side_commander.primary_title = title:k_valencia + } + enemy_side.side_commander ?= { save_scope_as = loser } + side_primary_participant = { + set_variable = { + name = cid_title_to_give + value = prev.enemy_side.side_commander.primary_title + } + trigger_event = cid.2000 #Tizona + } + } + else_if = { + limit = { + side_primary_participant = { has_variable = ongoing_cid_story_cycle } + OR = { + enemy_side.side_commander.primary_title = title:c_barcelona + enemy_side.side_commander.primary_title = title:d_barcelona + } + } + enemy_side.side_commander ?= { save_scope_as = loser } + side_primary_participant = { + set_variable = { + name = cid_title_to_give + value = prev.enemy_side.side_commander.primary_title + } + trigger_event = cid.2001 #Colada + } + } + else_if = { + limit = { + side_primary_participant = { has_variable = ongoing_cid_story_cycle } + } + random = { + chance = 10 + enemy_side.side_commander ?= { save_scope_as = loser } + side_primary_participant = { + set_variable = { + name = cid_title_to_give + value = prev.enemy_side.side_commander.primary_title } + trigger_event = cid.2000 + } + } + } + } +} + +"common/on_action/war_on_actions.txt" = { + { + if = { + limit = { + scope:attacker = { + is_ai = no + this = character:223523 + } + scope:defender = { + this = character:226000 + } + } + scope:attacker = { + add_achievement_global_variable_effect = { + VARIABLE = finished_kingdom_of_heaven_achievement + VALUE = yes + } + } + } + } + { + if = { + limit = { + scope:defender = { + is_ai = no + this = character:223523 + } + scope:attacker = { + this = character:226000 + } + } + scope:defender = { + add_achievement_global_variable_effect = { + VARIABLE = finished_kingdom_of_heaven_achievement + VALUE = yes } - desc = fp3_decision.0011_fanatic_murderer.desc } - desc = fp3_decision.0011_unfanatic_unmurderer.desc } } +} - - theme = war - left_portrait = { - character = scope:avenger - animation = war_over_win +"events/dlc/ep3/ep3_emperor_yearly_8.txt" = { + { + # Justinian I for flavor + character:70512 = { save_scope_as = justinian } } - override_background = { reference = battlefield } - - immediate = { - play_music_cue = "mx_cue_combat_2" - - character:33911 = { save_scope_as = ali } - character:163029 = { save_scope_as = muawiya } + # Don't reference Leo the Isaurian + { + character:70502 = { save_scope_as = leo } } +} - option = { - name = fp3_decision.0011.a - - avenge_the_battle_of_nahrawan_scripted_effect = yes - stress_impact = { - zealous = major_stress_impact_loss - vengeful = major_stress_impact_loss - ambitious = medium_stress_impact_loss +"common/scripted_triggers/00_laamp_triggers.txt" = { + { +disable_interaction_for_hasan_trigger = { + trigger_if = { + limit = { scope:recipient = character:41702 } + custom_tooltip = { + text = owns_a_story_trigger + scope:recipient = { owns_story_of_type = story_hasan } } } } } } -"common\decisions\dlc_decisions\ep_3\06_ep3_hasan_story_cycle_decisions.txt" = { - # Hassan Sabbah, the founder of Assasins - { -############################################# -# Do some basic missionary work # -# by James Beaumont # -############################################# - -hasan_evangelize_the_faith = { - picture = { - reference = "gfx/interface/illustrations/decisions/fp3/fp3_decision_secret_faith.dds" - } - sort_order = 500 - ai_check_interval = 120 - - desc = hasan_evangelize_the_faith_desc - selection_tooltip = hasan_evangelize_the_faith_tooltip - decision_group_type = story_cycle_hasan - cooldown = { months = 1 } +"common/story_cycles/ep3_story_cycle_el_cid.txt" = { + { +################################################## +### +### The Song of El Cid +### by Veronica Pazos +### +################################################## - is_shown = { - #DLC check. - has_ep3_dlc_trigger = yes - is_landed = no - any_owned_story = { - story_type = story_hasan +story_el_cid = { + + on_setup = { + story_owner = { + top_liege = { save_scope_as = liege } } } - - is_valid = { - domicile.domicile_location.county ?= { - OR = { - hasan_evangelize_province_trigger = yes - custom_tooltip = { - text = or_a_neigbouring_county_tt - save_temporary_scope_as = county_check - any_neighboring_county = { - hasan_evangelize_province_trigger = yes - holder.top_liege = scope:county_check.holder.top_liege - } - } - } + + on_end = { + debug_log = "El Cid's story ended on:" + debug_log_date = yes + #We clean up all variables + story_owner = { + remove_variable = cid_enemy + remove_variable = cid_liege + remove_variable = cid_loyalty_counter + remove_variable = ongoing_cid_story_cycle + remove_variable = cid_title_to_give + #And you can never have this again + set_variable = had_cid_story_cycle } } - is_valid_showing_failures_only = { - is_alive = yes - is_available_adult = yes - has_contagious_deadly_disease_trigger = no + on_owner_death = { + end_story = yes } - cost = { piety = 250 } + # Liege dies + effect_group = { + months = 1 - effect = { - domicile.domicile_location.county ?= { - if = { - limit = { hasan_evangelize_province_trigger = yes } - save_scope_as = location - } - else = { - save_temporary_scope_as = county_check - random_neighboring_county = { - limit = { - hasan_evangelize_province_trigger = yes - holder.top_liege = scope:county_check.holder.top_liege + first_valid = { + triggered_effect = { #If your liege dies + trigger = { + story_owner.var:cid_liege = { + OR = { + NOT = { exists = this } + is_alive = no + } + } + } + effect = { + story_owner = { + trigger_event = cid.5000 } - save_scope_as = location } } } - trigger_event = hasan_sabbah.1010 - custom_tooltip = chance_to_advance_to_the_assassins_tt - } - - ai_potential = { this = character:41702 } - - ai_will_do = { - base = 200 - } -} -############################################# -# Do some RADICAL missionary work 🕶🤙 # -# by James Beaumont # -############################################# - -hasan_agitate_the_populace = { - picture = { - reference = "gfx/interface/illustrations/decisions/fp3/antagonistic.dds" - } - sort_order = 500 - ai_check_interval = 120 - - desc = hasan_agitate_the_populace_desc - selection_tooltip = hasan_agitate_the_populace_tooltip - decision_group_type = story_cycle_hasan - - cooldown = { months = 1 } - - is_shown = { - #DLC check. - has_ep3_dlc_trigger = yes - is_landed = no - any_owned_story = { - story_type = story_hasan - } } + + effect_group = { + months = { 6 12 } + chance = 100 - is_valid = { - hasan_camp_in_foes_realm_trigger = yes - OR = { - domicile.domicile_location.county = { - NOT = { faith = root.faith } - NOT = { has_county_modifier = ep3_agitated_populace } - NOT = { has_county_modifier = tougher_to_convert } + random_valid = { + triggered_effect = { + trigger = { # Landless events + story_owner = { + has_government = landless_adventurer_government + } + } + effect = { + story_owner = { + var:cid_liege = { save_scope_as = liege } + var:cid_enemy = { save_scope_as = enemy } + trigger_event = { on_action = el_cid_landless_on_action } + } + } } - custom_tooltip = { - text = or_a_neigbouring_county_tt - domicile.domicile_location.county = { - save_temporary_scope_as = county_check - any_neighboring_county = { - NOT = { faith = root.faith } - NOT = { has_county_modifier = ep3_agitated_populace } - NOT = { has_county_modifier = tougher_to_convert } - holder.top_liege = scope:county_check.holder.top_liege + triggered_effect = { + trigger = { # Landless OR Landed events + always = yes + } + effect = { + story_owner = { + var:cid_liege = { save_scope_as = liege } + var:cid_enemy = { save_scope_as = enemy } + trigger_event = { on_action = el_cid_landless_or_landed_on_action } } } } } } + + # Endings + effect_group = { + months = 3 - is_valid_showing_failures_only = { - is_alive = yes - is_available_adult = yes - has_contagious_deadly_disease_trigger = no - } - - cost = { prestige = 250 } - - effect = { - if = { - limit = { - domicile.domicile_location.county = { - NOT = { faith = root.faith } - NOT = { has_county_modifier = ep3_agitated_populace } - NOT = { has_county_modifier = tougher_to_convert } + first_valid = { #Your liege takes you back + triggered_effect = { + trigger = { + story_owner = { + var:cid_loyalty_counter >= 5 + is_landless_adventurer = yes + } + } + effect = { + story_owner = { + trigger_event = cid.2020 + } } } - domicile.domicile_location.county = { save_scope_as = location } - } - else = { - domicile.domicile_location.county = { - save_temporary_scope_as = county_check - random_neighboring_county = { - limit = { - NOT = { faith = root.faith } - NOT = { has_county_modifier = ep3_agitated_populace } - NOT = { has_county_modifier = tougher_to_convert } - holder.top_liege = scope:county_check.holder.top_liege + triggered_effect = { #Your liege hates you + trigger = { + story_owner = { + var:cid_loyalty_counter <= -5 + is_landless_adventurer = yes + } + } + effect = { + story_owner = { + trigger_event = cid.4010 + } + } + } + triggered_effect = { #Neutral ending + trigger = { + story_owner = { + var:cid_loyalty_counter > -5 + var:cid_loyalty_counter < 5 + has_variable = had_cid_1000 + has_variable = had_cid_1030 + has_variable = had_cid_1040 + trigger_if = { + limit = { + any_courtier = { + is_adult = yes + NOR = { + is_close_family_of = prev + is_spouse_of = prev + } + count >= 2 + } + } + has_variable = had_cid_1010 + } + trigger_if = { + limit = { + any_courtier = { + is_spouse_of = prev + } + } + has_variable = had_cid_1020 + } + trigger_if = { + limit = { + any_child = { + is_betrothed = no + } + } + has_variable = had_cid_2010 + } + } + } + effect = { + story_owner = { + trigger_event = cid.4000 } - save_scope_as = location } } } - trigger_event = hasan_sabbah.1040 - } - - ai_potential = { this = character:41702 } - - ai_will_do = { - base = 200 } } -############################################# -# Become death, destroyer of Seljuks # -# by James Beaumont # -############################################# -hasan_ignite_the_flames = { - picture = { - reference = "gfx/interface/illustrations/decisions/fp3/fp3_decision_strength.dds" } - sort_order = 500 - ai_check_interval = 120 - - desc = hasan_ignite_the_flames_desc - selection_tooltip = hasan_ignite_the_flames_tooltip - decision_group_type = story_cycle_hasan +} - cooldown = { months = 1 } +"common/customizable_localization/00_travel.txt" = { + # Anachronistic. + { + text = { # Offa's Dyke + trigger = { + has_special_building = yes + #OR = { + # this = province:1643 # Cheshire + # this = province:1646 # Shropshire + # this = province:1648 # Bishop's Castle + # this = province:1580 # Gloucester + # this = province:1632 # Hereford + # this = province:1633 # Wigmore + # this = province:1634 # Clifford + #} + has_building_or_higher = offas_dyke_01 + } + setup_scope = { + character:205072 = { save_scope_as = offa } + } + localization_key = building_offas_dyke_destination_desc + } + } - is_shown = { - #DLC check. - has_ep3_dlc_trigger = yes - any_owned_story = { - story_type = story_hasan + { + text = { # Palace of Aachen + trigger = { + has_special_building = yes + #this = province:2092 # Aachen + has_building_or_higher = palace_of_aachen_01 + } + localization_key = building_palace_of_aachen_destination_desc + setup_scope = { + character:6392 = { save_scope_as = charlemagne } } } + } - is_valid = { - hasan_camp_in_foes_realm_trigger = yes - is_at_war = no - custom_tooltip = { - text = at_least_5_counties_are_nizari - domicile.domicile_location.county.holder.top_liege = { - any_sub_realm_county = { - count >= 5 - faith = root.faith - } - } + { + text = { # Ananda Temple + trigger = { + has_special_building = yes + #this = province:9550 # Pagan + has_building_or_higher = ananda_temple_01 } + localization_key = building_ananda_temple_destination_desc + setup_scope = { + dynasty:2000000 = { save_scope_as = pagan_dynasty } + } + } } - is_valid_showing_failures_only = { - is_alive = yes - is_available_adult = yes - has_contagious_deadly_disease_trigger = no + { + text = { # Brihadeeswarar Temple + trigger = { + has_special_building = yes + #this = province:1115 # Cholamandalam + has_building_or_higher = brihadeeswarar_temple_01 + } + localization_key = building_brihadeeswarar_temple_destination_desc + setup_scope = { + dynasty:1043008 = { save_scope_as = chola_dynasty } + } } + } +} - cost = { - prestige = 250 +"events/dlc/ep3/ep3_laamp_flavour_ewan_events.txt" = { + # Easter egg, causes errors in TFE. + { + # Cannibal (Chad) + 50 = { + trigger = { + can_start_single_combat_trigger = yes + character:easteregg_chad_uhl ?= { + is_alive = yes + location ?= root.location + is_pool_character = yes + } + } + save_scope_value_as = { + name = hunter_type + value = flag:cannibal_chad + } + ep3_laamp_flavour_ewan_4061_roll_animal_size_effect = { + MIN = 1 + MAX = 1 + } + # Nab our cannibal. + character:easteregg_chad_uhl = { save_scope_as = cannibal } + } } - effect = { - random_owned_story = { - limit = { - story_type = story_hasan + { + # Log if it was Chad who lost. + if = { + limit = { character:easteregg_chad_uhl ?= scope:sc_loser } + trigger_event = ep3_laamp_flavour_ewan.4065 } - var:ultimate_foe = { save_scope_as = ultimate_foe } + # Or Anna. + else_if = { + limit = { character:easteregg_anna_johansson ?= scope:sc_loser } + trigger_event = ep3_laamp_flavour_ewan.4067 + } + } + { + # Log if it was Chad who won. + else_if = { + limit = { character:easteregg_chad_uhl ?= scope:sc_victor } + trigger_event = ep3_laamp_flavour_ewan.4066 } - hasan_sabbah_ignite_decision_effect = yes } +} - ai_potential = { this = character:41702 } - ai_will_do = { - base = 200 +"common/scripted_effects/07_dlc_ep3_scripted_effects.txt" = { + { + if = { + limit = { + any_owned_story = { + story_type = story_hasan + } + } + custom_tooltip = { + text = advance_to_the_assassins_tt + random_owned_story = { + limit = { + story_type = story_hasan + } + if = { + limit = { + exists = var:radical_points + } + change_variable = { + name = radical_points + add = 1 + } + } + else = { + set_variable = { + name = radical_points + value = 1 + } + } + } + } } -} - -############################################# -# Found the Assassins # -# by James Beaumont # -############################################# -hasan_found_the_assassins = { - picture = { - reference = "gfx/interface/illustrations/decisions/fp3/fp3_decision_sunder.dds" } - sort_order = 500 - ai_check_interval = 120 - desc = hasan_found_the_assassins_desc - selection_tooltip = hasan_found_the_assassins_tooltip - decision_group_type = story_cycle_hasan - - is_shown = { - #DLC check. - has_ep3_dlc_trigger = yes - any_owned_story = { - story_type = story_hasan - NOT = { exists = var:assassins } + { +hasan_sabbah_ignite_decision_effect = { + if = { + limit = { + hasan_sabbah_event_troops_value <= 1000 } - is_landed = no - faith = faith:nizari - NOT = { - has_character_flag = founded_assassins_already + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = ayyar + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = ayyar + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = ayyar + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes } } - - is_valid = { - hasan_camp_in_foes_realm_trigger = yes - domicile.domicile_location.barony = { is_leased_out = no } - domicile.domicile_location.county.faith = root.faith - custom_tooltip = { - text = is_mountainous_desc - domicile.domicile_location = { is_mountainous_trigger = yes } + else_if = { + limit = { + hasan_sabbah_event_troops_value <= 2000 } - domicile.domicile_location = { - is_county_capital = no + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes } } - - is_valid_showing_failures_only = { - is_alive = yes - is_available_adult = yes - has_contagious_deadly_disease_trigger = no + else_if = { + limit = { + hasan_sabbah_event_troops_value <= 3000 + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + } + else_if = { + limit = { + hasan_sabbah_event_troops_value > 3000 + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 2 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 2 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 2 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 2 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 2 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + } + start_war = { + cb = ep3_hasan_assassin_war + target = root.location.county.holder.top_liege + target_title = root.location.county.holder.top_liege.primary_title + } +} } - cost = { piety = 1500 } - - effect = { - domicile.domicile_location = { save_scope_as = location } + { +hasan_sabbah_end_war = { + # Offer Hasan the opportunity to become landed + hidden_effect = { if = { limit = { - scope:location = { - has_holding = no - } - } - if = { - limit = { - scope:location.county.holder = { - government_has_flag = government_is_tribal + $SELJUK$ = { + any_sub_realm_barony = { + title_province = { has_building_or_higher = alamut_castle_01 } } } - scope:location = { - set_holding_type = church_holding - } - } - else = { - scope:location = { - set_holding_type = castle_holding + } + $SELJUK$ = { + random_sub_realm_barony = { + limit = { + title_province = { has_building_or_higher = alamut_castle_01 } + } + county = { + save_scope_as = hasan_home + } } } } - create_character = { - template = holy_order_leader_character - location = scope:location - save_scope_as = leader - } - hidden_effect = { - create_title_and_vassal_change = { - type = leased_out - save_scope_as = change - add_claim_on_loss = no + else_if = { + limit = { + $SELJUK$ = { + any_sub_realm_county = { + faith = $HASAN$.faith + holder = { is_ai = yes } + } + } } - scope:location.barony = { - change_title_holder_include_vassals = { - holder = scope:location.barony.holder.top_liege - change = scope:change + $SELJUK$ = { + random_sub_realm_county = { + limit = { + faith = $HASAN$.faith + holder = { is_ai = yes } + } + save_scope_as = hasan_home } } - resolve_title_and_vassal_change = scope:change - } - create_holy_order = { - leader = scope:leader - capital = scope:location.barony - save_scope_as = new_holy_order - } - scope:new_holy_order ?= { - title = { set_title_name = holy_order_hashshashin } } - create_holy_order_effect = yes - random_owned_story = { - limit = { story_type = story_hasan } - set_variable = { - name = assassins - value = scope:new_holy_order + else = { + $SELJUK$ = { + random_sub_realm_county = { + limit = { + holder = { is_ai = yes } + } + save_scope_as = hasan_home + } } } - add_character_flag = founded_assassins_already - scope:location = { + $HASAN$ = { if = { limit = { - has_special_building = no + any_owned_story = { + story_type = story_hasan + exists = var:preferred_caliph + } + } + random_owned_story = { + limit = { story_type = story_hasan } + var:preferred_caliph = { save_scope_as = caliph } } - add_special_building = assassin_castle_01 } - else_if = { + trigger_event = { + id = hasan_sabbah.1050 + } + if = { limit = { - has_building_or_higher = alamut_castle_01 + is_ai = no } - hidden_effect = { - remove_building = alamut_castle_01 + add_achievement_global_variable_effect = { + VARIABLE = finished_the_old_man_of_the_mountain_achievement + VALUE = yes } - add_special_building = alamut_castle_02 } } - add_intrigue_skill = 2 - give_nickname = nick_old_man_of_the_mountain } - - ai_potential = { this = character:41702 } - - ai_will_do = { - base = 200 + create_title_and_vassal_change = { + type = independency + save_scope_as = change } -} - -############################################# -# Expand the Assassins # -# by James Beaumont # -############################################# -hasan_expand_the_assassins = { - picture = { - reference = "gfx/interface/illustrations/decisions/fp3/fp3_decision_foundation.dds" + $HASAN$ = { + add_prestige = medium_prestige_value } - sort_order = 500 - ai_check_interval = 120 + $SELJUK$ = { + add_prestige = { + value = medium_prestige_value + multiply = -1 + } - desc = hasan_expand_the_assassins_desc - selection_tooltip = hasan_expand_the_assassins_tooltip - decision_group_type = story_cycle_hasan + every_vassal = { + limit = { + highest_held_title_tier > tier_barony + } + change_liege_or_become_independent = { + CHANGE = scope:change + VASSAL = this + } + } - is_shown = { - #DLC check. - has_ep3_dlc_trigger = yes - any_owned_story = { - story_type = story_hasan - has_variable = assassins + every_vassal = { + limit = { is_ai = no } + send_interface_toast = { + type = msg_gained_independence + title = liege_primary_title_dissolution + desc = liege_primary_title_dissolution_desc + left_icon = $SELJUK$ + } } - is_landed = no - faith = faith:nizari } - - is_valid = { - hasan_camp_in_foes_realm_trigger = yes - domicile.domicile_location.barony = { is_leased_out = no } - domicile.domicile_location.county.faith = root.faith - custom_tooltip = { - text = is_mountainous_desc - domicile.domicile_location = { is_mountainous_trigger = yes } + resolve_title_and_vassal_change = scope:change + $SELJUK$ = { + every_held_title = { + limit = { + tier >= tier_duchy + is_head_of_faith = no + NOT = { this = $SELJUK$.capital_county.duchy } + } + add_to_temporary_list = titles_to_destroy } } - - is_valid_showing_failures_only = { - is_alive = yes - is_available_adult = yes - has_contagious_deadly_disease_trigger = no - domicile.domicile_location = { is_county_capital = no } + every_in_list = { + list = titles_to_destroy + $HASAN$ = { + destroy_title = prev + } } - - cost = { piety = 250 } - - effect = { - random_owned_story = { + $SELJUK$ = { + if = { limit = { - story_type = story_hasan + government_has_flag = government_is_administrative } - var:assassins = { save_scope_as = assassins } + admin_government_reset_effect = yes } - show_as_tooltip = { - domicile.domicile_location.barony = { lease_out_to = scope:assassins } - } - hidden_effect = { + } + # LEGITIMACY FROM LOSING FACTION WAR + faction_war_end_defeat_legitimacy_effect = yes + # End Hasan's story cycle + hidden_effect = { + $HASAN$ = { if = { - limit = { NOT = { domicile.domicile_location.barony.holder = root } } - create_title_and_vassal_change = { - type = leased_out - save_scope_as = change - add_claim_on_loss = no + limit = { + any_owned_story = { + story_type = story_hasan + } } - domicile.domicile_location.barony = { - change_title_holder_include_vassals = { - holder = holder.top_liege - change = scope:change + random_owned_story = { + limit = { + story_type = story_hasan } + end_story = yes } - resolve_title_and_vassal_change = scope:change - domicile.domicile_location.barony = { lease_out_to = scope:assassins } } } } +} + } - ai_potential = { this = character:41702 } - - ai_will_do = { - base = 200 + { + character:41702 ?= $PREACHER$ } } + + +"common/on_action/army_on_actions.txt" = { + { + game_rule.1021 # Figure out whether we should fire a conclusion event during the Conquest. } } -"common\casus_belli_types\00_event_war.txt" = { - { - #Hereward the Wake departs for the Fenlands - character:90028 = { save_scope_as = hereward } +"common/scripted_effects/00_ep3_decision_effects.txt" = { + # Anachronistic + { +apply_historic_administrative_game_rule_effect = { + # We'll be doing some excessive triggers below in a bid to lightly future-proof + error-spam mods less, don't worry about it. + ## We also do player-specific realms separately — we need to know what their realm is so we do it after the lobby exclusively. + # Egypt. + if = { + limit = { + NOT = { has_game_rule = historicity_extra_admin_egypt_gameplay_not_administrative } + exists = title:k_egypt + } + if = { + limit = { has_game_rule = historicity_extra_admin_egypt_historic_always } + title:k_egypt.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } + } + } + # Arabia. + if = { + limit = { + NOT = { has_game_rule = historicity_extra_admin_arabia_gameplay_not_administrative } + exists = title:e_arabia + } + if = { + limit = { has_game_rule = historicity_extra_admin_arabia_historic_867 } + # Give the Armenians a fighting chance. + culture:armenian = { save_scope_as = ignore_culture } + title:e_arabia.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } + } + } + # Ghana. + if = { + limit = { + NOT = { has_game_rule = historicity_extra_admin_ghana_gameplay_not_administrative } + exists = title:k_ghana + } + if = { + limit = { has_game_rule = historicity_extra_admin_ghana_historic_always } + title:k_ghana.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } + } + } + # Kabulistan/the Ghaznivids. + if = { + limit = { + NOT = { has_game_rule = historicity_extra_admin_kabulistan_gameplay_not_administrative } + exists = title:k_kabulistan + } + if = { + limit = { has_game_rule = historicity_extra_admin_kabulistan_historic_always } + title:k_kabulistan.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } + } + } + # Persia. + if = { + limit = { + NOT = { has_game_rule = historicity_extra_admin_persia_gameplay_not_administrative } + exists = title:e_persia + exists = title:k_persia + } if = { limit = { - exists = scope:hereward + game_start_date = 1178.10.1 + has_game_rule = historicity_extra_admin_persia_historic_1178 } - - scope:hereward = { - trigger_event = { - id = ep3_laamps.6000 - days = { 1 2 } + title:k_persia.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } + } + else_if = { + limit = { has_game_rule = historicity_extra_admin_persia_alt_historic_always } + # Independent k_persia. + if = { + limit = { + title:k_persia.holder ?= { is_independent_ruler = yes } } + title:k_persia.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } + } + # Else, the empire. + else = { + title:e_persia.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } } } - - #Eadgar becomes a LAAMP - character:112 = { save_scope_as = eadgar } - + } + # Maghreb. + if = { + limit = { + NOT = { has_game_rule = historicity_extra_admin_maghreb_gameplay_not_administrative } + exists = title:k_maghreb + } if = { limit = { - exists = scope:eadgar - } - - scope:eadgar = { - trigger_event = { - id = ep3_laamps.7000 - days = { 1 2 } - } + game_start_date >= 1066.9.15 + has_game_rule = historicity_extra_admin_maghreb_historic_post_1066 } + title:k_maghreb.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } + } + else_if = { + limit = { has_game_rule = historicity_extra_admin_maghreb_alt_historic_always } + title:k_maghreb.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } } } -} - -"common/decisions/dlc_decisions/ep_3/06_ep3_laamp_decisions.txt" = { - { - #Stahp it, John de Courcy - this = character:214000 - } - { - trigger_if = { # Temujun stays, he needs to become Genghis Khan after all! + # Tamilakam/the Cholas. + if = { + limit = { + NOT = { has_game_rule = historicity_extra_admin_tamilakam_gameplay_not_administrative } + exists = title:k_tamilakam + } + if = { limit = { - exists = character:125501 + game_start_date = 1066.9.15 + has_game_rule = historicity_extra_admin_tamilakam_historic_1066 } - NOT = { this = character:125501 } + title:k_tamilakam.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } + } + else_if = { + limit = { has_game_rule = historicity_extra_admin_tamilakam_alt_historic_always } + title:k_tamilakam.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } + } + } + # The Carolingians. + if = { + limit = { + NOT = { has_game_rule = historicity_extra_admin_carolingians_gameplay_not_administrative } + game_start_date = 867.1.1 + exists = title:k_france + exists = title:k_lotharingia + exists = title:k_east_francia + exists = title:k_italy + } + if = { + limit = { has_game_rule = historicity_extra_admin_carolingians_alt_historic_all_administrative } + title:k_france.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } + title:k_lotharingia.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } + title:k_east_francia.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } + title:k_italy.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } + } + if = { + limit = { has_game_rule = historicity_extra_admin_carolingians_alt_historic_west_francia_administrative } + title:k_france.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } + } + if = { + limit = { has_game_rule = historicity_extra_admin_carolingians_alt_historic_lotharingia_administrative } + title:k_lotharingia.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } + } + if = { + limit = { has_game_rule = historicity_extra_admin_carolingians_alt_historic_east_francia_administrative } + title:k_east_francia.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } + } + if = { + limit = { has_game_rule = historicity_extra_admin_carolingians_alt_historic_italy_administrative } + title:k_italy.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes } } } } + } +} \ No newline at end of file diff --git a/ImperatorToCK3/Data_Files/configurables/removable_file_blocks_tfe.txt b/ImperatorToCK3/Data_Files/configurables/removable_file_blocks_tfe.txt index 59dfbe02f..ca2a5f21d 100644 --- a/ImperatorToCK3/Data_Files/configurables/removable_file_blocks_tfe.txt +++ b/ImperatorToCK3/Data_Files/configurables/removable_file_blocks_tfe.txt @@ -416,4448 +416,30229 @@ make_trait_inactive = intellect_good_3 } } -} -"common/on_action/sea_minority_game_start.txt" = { + # In megacampaigns the abandonment of Britannia is not a given. { - # Alans if = { limit = { - game_start_date >= 400.1.1 - } - add_culture_minority_effect = { - CULTURE = culture:alan - SIZE = large - COUNTY = title:c_tunis + game_start_date >= 410.1.1 } - add_faith_minority_effect = { - FAITH = faith:arianism - SIZE = large - COUNTY = title:c_tunis + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:flag_abandoned_britannia } } } -} - -"common/on_action/government_change_on_actions.txt" = { { - NOT = { - THIS = character:taifal_01 - } + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:flag_abandoned_britannia + } } + + # In converted games the Graeaco-Roman presence in Egypt is not a given. { - title:e_mongolia = { - every_in_de_jure_hierarchy = { - limit = { - is_title_created = yes + # Greek/Egyptian rulers in Egypt now know both Coptic and Greek + if = { + limit = { + game_start_date >= 500.1.1 # Rough timeframe for transition + } + every_county_in_region = { + region = custom_roman_aegyptus + if = { + limit = { + holder = { + NOT = { + knows_language = language_kemetic + } + } + } + holder = { + learn_language = language_kemetic + } } - holder = { - if = { - limit = { - has_government = tribal_government + if = { + limit = { + holder = { + NOT = { + knows_language = language_greek + } } - change_government = nomadic_government + } + holder = { + learn_language = language_greek } } } } - title:e_siberia = { - every_in_de_jure_hierarchy = { - limit = { - is_title_created = yes - } - holder = { + } + + { + if = { + limit = { + game_start_date >= 551.7.9 + } + title:b_beirut.title_province = { + limit = { has_building = beirut_university } + remove_building = beirut_university + } + } + if = { + limit = { + game_start_date >= 800.1.1 + } + title:b_urmiya.title_province = { + limit = { has_building = adur_gushnasp } + remove_building = adur_gushnasp + } + } + if = { + limit = { + game_start_date >= 529.1.1 + } + title:b_athens.title_province = { + limit = { has_building = generic_university } + remove_building = generic_university + } + } + } + + # Anachronistic + { + if = { + limit = { + game_start_date >= 390.1.1 + } + culture:vandal = { + add_culture_tradition = tradition_practiced_pirates + remove_variable = tradition_cooldown + } + } + if = { + limit = { + game_start_date > 476.1.1 + } + culture:ostrogothic = { + add_culture_tradition = tradition_ostrogothic_overlordship + remove_variable = tradition_cooldown + } + } + } + + # Something related to Jewish Exilarchs, seems not needed for converted games + { + title:c_iskaf.holder = { + vassal_contract_set_obligation_level = { type = religious_rights level = 1 } + } + } + + # Anachronistic + { + if = { + limit = { + game_start_date = 532.2.1 + } + title:e_mongolia.holder.dynasty = { + add_dynasty_modifier = rouran_khagans + } + title:k_franks = { + set_title_name = k_franks_united + set_definitive_form = yes + set_de_jure_liege_title = title:e_france + } + title:k_yemen.holder = { + every_vassal = { if = { limit = { - has_government = tribal_government + NOT = { faith = title:k_yemen.holder.faith } } - change_government = nomadic_government + vassal_contract_set_obligation_level = { type = religious_rights level = 1 } } } + reverse_add_opinion = { + modifier = angry_opinion + target = title:e_abyssinia.holder + opinion = -50 + } } } - title:e_volga-ural = { - every_in_de_jure_hierarchy = { - limit = { - is_title_created = yes + } + + # Anachronistic + { + if = { + limit = { + game_start_date >= 420.1.1 + } + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:flag_created_yazd + } + } + } + + # Anachronistic + { + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:TFE_establish_the_rouran_khaganate + } + } + + # Anachronistic + { + if = { + limit = { + AND = { + game_start_date >= 532.1.1 + game_start_date <= 540.1.1 } - holder = { - if = { - limit = { - has_government = tribal_government - } - change_government = nomadic_government - } + } + set_global_variable = { + name = has_eternal_peace + value = yes + } + } + } + + # Anachronistic + { + if = { + limit = { + game_start_date <= 476.1.1 + has_dlc_feature = hybridize_culture + } + culture:ostrogothic = { + add_culture_tradition = tradition_malleable_invaders + remove_variable = tradition_cooldown + } + } + } + + # In converted games we don't know if yazd is a holy site. + { + faith:mazdayasna = { + deactivate_holy_site = yazd # Yazd hasn't been consacrated yet + } + faith:zurvanism = { + deactivate_holy_site = yazd # Yazd hasn't been consacrated yet + } + faith:gayomarthianism = { + deactivate_holy_site = yazd # Yazd hasn't been consacrated yet + } + faith:khurmazta = { + deactivate_holy_site = yazd # Yazd hasn't been consacrated yet + } + faith:mazdakism = { + deactivate_holy_site = yazd # Yazd hasn't been consacrated yet + } + faith:khurramism = { + deactivate_holy_site = yazd # Yazd hasn't been consacrated yet + } + faith:urartuism = { + deactivate_holy_site = yazd # Yazd hasn't been consacrated yet + } + faith:armaz = { + deactivate_holy_site = yazd # Yazd hasn't been consacrated yet + } + faith:magousaian = { + deactivate_holy_site = yazd # Yazd hasn't been consacrated yet + } + } + + { + if = { + limit = { + NOT = { + game_start_date = 476.9.4 } } + title:k_france = { + set_color_from_title = title:k_france_2 + set_coa = title:k_france_2 + } } - title:e_tartaria = { + } + + # Seems not needed for converted games + { + title:e_western_roman_empire = { every_in_de_jure_hierarchy = { - limit = { - is_title_created = yes - } - holder = { - if = { - limit = { - has_government = tribal_government - } - change_government = nomadic_government - } - } + update_dynamic_coa = yes } } - title:k_oghuz_il = { + title:e_byzantium = { every_in_de_jure_hierarchy = { - limit = { - is_title_created = yes - } - holder = { - if = { - limit = { - has_government = tribal_government - } - change_government = nomadic_government - } - } + update_dynamic_coa = yes } } - title:e_rajastan = { + title:e_roman_empire = { every_in_de_jure_hierarchy = { - limit = { - is_title_created = yes - } - holder = { - if = { - limit = { - culture ?= { - has_cultural_tradition = tradition_gana_sangha - } - government_has_flag = government_is_tribal - } - change_government = gana_sangha_government - primary_title = { - add_title_law = gana_sangha_elective_succession_law - } - } - } + update_dynamic_coa = yes } } } -} -"common/on_action/tribs_on_action.txt" = { + # Anachronistic { if = { limit = { - AND = { - game_start_date > 361.1.1 - game_start_date < 362.1.1 + OR = { + game_start_date <= 376.1.1 # End of the Former Liang Dynasty + game_start_date >= 441.1.1 # Northern Wei conquest of Northern Liang, reunifying Liang province } + } + set_global_variable = { + name = TFE_order_restored_to_liang + value = yes } - ###GUPTAS - # Kushans - if = { - limit = { - AND = { - exists = character:kushan_014 - exists = character:900963 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:kushan_014 - SUZERAIN = character:900963 - } + } + } + + # Anachronistic + { + if = { + limit = { + game_start_date >= 476.9.4 } - # Madrakas - if = { - limit = { - AND = { - exists = character:matraka_01 - exists = character:900963 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:matraka_01 - SUZERAIN = character:900963 - } + set_global_variable = { + name = wre_collapsed + value = yes } - # Yaudheyas - if = { - limit = { - AND = { - exists = character:yaudheya_01 - exists = character:900963 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:yaudheya_01 - SUZERAIN = character:900963 - } + } + } + # Anachronistic + { + if = { + limit = { + game_start_date < 550.1.1 } - # Malavas - #if = { - # limit = { - # AND = { - # exists = character:malava_01 - # exists = character:900963 - # } - # } - # make_tributary = { - # TYPE = tributary_permanent - # TRIBUTARY = character:malava_01 - # SUZERAIN = character:900963 - # } - #} - # Arjunayanas - #if = { - # limit = { - # AND = { - # exists = character:guptasad_32 - # exists = character:900963 - # } - # } - # make_tributary = { - # TYPE = tributary_permanent - # TRIBUTARY = character:guptasad_32 - # SUZERAIN = character:900963 - # } - #} - # Karttripuras - if = { - limit = { - AND = { - exists = character:karttripura_01 - exists = character:900963 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:karttripura_01 - SUZERAIN = character:900963 - } + faith:manichean = { + deactivate_holy_site = yijinai # Manichaeism didn't really spread to China until the 6th century, so doesn't make sense + deactivate_holy_site = udabhanda # Replaced by Lyon in earlier start dates when Manichaeism had a significant following in Europe } - # Nepal/Licchavis - if = { - limit = { - AND = { - exists = character:licchavi_02 - exists = character:900963 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:licchavi_02 - SUZERAIN = character:900963 - } + } + else = { + faith:manichean = { + deactivate_holy_site = lyon + deactivate_holy_site = jerusalem } - # Kamarupa - if = { - limit = { - AND = { - exists = character:190054 - exists = character:900963 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:190054 - SUZERAIN = character:900963 - } + } + } + + { + set_global_variable = { + name = britannia_dejure_splity + value = yes } - # Davakas - if = { - limit = { - AND = { - exists = character:davaka_01 - exists = character:900963 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:davaka_01 - SUZERAIN = character:900963 - } + set_global_variable = { + name = gallia_dejure_splity + value = yes } - # Samatatas - #if = { - # limit = { - # AND = { - # exists = character:samatata_01 - # exists = character:900963 - # } - # } - # make_tributary = { - # TYPE = tributary_permanent - # TRIBUTARY = character:samatata_01 - # SUZERAIN = character:900963 - # } - #} - # Kosalas - if = { - limit = { - AND = { - exists = character:orissa_01 - exists = character:900963 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:orissa_01 - SUZERAIN = character:900963 - } + set_global_variable = { + name = hispania_dejure_splity + value = yes } - #Mahakantara - if = { - limit = { - AND = { - exists = character:orissa_02 - exists = character:900963 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:orissa_02 - SUZERAIN = character:900963 - } + set_global_variable = { + name = septem_provinciae_dejure_splity + value = yes } - # Salankayanas - if = { - limit = { - AND = { - exists = character:salankayana_01 - exists = character:900963 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:salankayana_01 - SUZERAIN = character:900963 - } + } + + # Anachronistic + { + title:k_andalusia = { + set_title_name = BAETICA } - #Avamuktas - if = { - limit = { - AND = { - exists = character:orissa_06 - exists = character:900963 - } + title:k_badajoz = { + set_title_name = LUSITANIA + } + } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:orissa_06 - SUZERAIN = character:900963 + # Anachronistic + { +TFE_on_game_start_de_jure_capitals = { + effect = { + if = { + limit = { + current_date <= 395.1.17 + } + title:k_nubia = { + set_capital_county = title:c_abwab + } + } + if = { + limit = { + current_date <= 476.9.4 + } + title:e_britannia = { + set_capital_county = title:c_gowrie + } + } + else = { + title:e_britannia = { + set_color_from_title = title:e_britannia_2 + } + } + if = { + limit = { + current_date < 632.6.8 + } + title:e_arabia = { + set_capital_county = title:c_medina + } + } + } +} + } + { + TFE_on_game_start_de_jure_capitals + } + + { +TFE_on_game_start_larp_history = { + effect = { + if = { + limit = { + any_ruler = { + has_game_rule = dead_cultures_enabled } } - #Dhananjayids + title:c_kairwan = { + set_county_culture = culture:punic + set_county_faith = faith:carthage_pagan + } + title:c_west_qamuda = { + set_county_culture = culture:punic + set_county_faith = faith:carthage_pagan + } + title:c_tabassa = { + set_county_culture = culture:punic + set_county_faith = faith:carthage_pagan + } + title:c_qashtiliya = { + set_county_culture = culture:punic + set_county_faith = faith:carthage_pagan + } + + title:c_vermandois = { + set_county_culture = culture:gaul + } + title:c_bayeux = { + set_county_culture = culture:gaul + } + title:c_avranches = { + set_county_culture = culture:gaul + } + title:c_lisieux = { + set_county_culture = culture:gaul + } if = { limit = { - AND = { - exists = character:orissa_08 - exists = character:900963 - } + dummy_male.current_date < 400 } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:orissa_08 - SUZERAIN = character:900963 + title:c_eu = { + set_county_culture = culture:gaul } - } - - # Abyssinia Tributaries in Kush/Nubia - if = { - limit = { - AND = { - exists = character:meroitic_misc_01 - exists = character:aksum_12 - } + title:c_rethel = { + set_county_culture = culture:gaul } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:meroitic_misc_01 - SUZERAIN = character:aksum_12 + title:c_dijon = { + set_county_culture = culture:gaul } - } - if = { - limit = { - AND = { - exists = character:dinka_01 - exists = character:aksum_12 - } + title:c_briey = { + set_county_culture = culture:gaul } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:dinka_01 - SUZERAIN = character:aksum_12 - } - } - if = { - limit = { - AND = { - exists = character:dinka_05 - exists = character:aksum_12 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:dinka_05 - SUZERAIN = character:aksum_12 - } - } - if = { - limit = { - AND = { - exists = character:dinka_09 - exists = character:aksum_12 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:dinka_09 - SUZERAIN = character:aksum_12 - } - } - character:990016 = { - add_prestige = 1500 - add_gold = 250 - spawn_army = { - name = "Hunnic Migrators" - levies = 1000 - men_at_arms = { - type = horse_archers - stacks = 5 - } - men_at_arms = { - type = light_footmen - stacks = 5 - } - men_at_arms = { - type = siege_towers - stacks = 5 - } - location = title:b_itil.title_province - inheritable = no - } - spawn_army = { - name = "Hunnic Migrators" - levies = 1000 - men_at_arms = { - type = light_horsemen - stacks = 5 - } - men_at_arms = { - type = horse_archers - stacks = 5 - } - men_at_arms = { - type = siege_towers - stacks = 5 - } - location = title:b_engels.title_province - inheritable = no + title:c_luxembourg = { + set_county_culture = culture:gaul + } + title:c_bouillon = { + set_county_culture = culture:gaul + } + title:c_namur = { + set_county_culture = culture:gaul } } } + } +} + } + { + TFE_on_game_start_larp_history + } + + # Seems to cause infinite recursion bacause of the on-action having the same name as the effect :/ + # TODO: verify + { +garamantes_flavour_effect = { + effect = { + garamantes_flavour_effect = yes + } +} + } + { + garamantes_flavour_effect + } +} + +"common/on_action/sea_minority_game_start.txt" = { + # Anachronistic + { +set_minorities_game_start = { + effect = { + + #Africa + if = { limit = { - AND = { - game_start_date > 394.1.1 - game_start_date < 396.1.1 - } + game_start_date >= 300.1.1 } - ###EASTERN ROMAN - if = { - limit = { - AND = { - exists = character:judham_11 - exists = character:70519 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:judham_11 - SUZERAIN = character:70519 - } + add_culture_minority_effect = { + CULTURE = culture:gaw + SIZE = large + COUNTY = title:c_kukiya } - if = { - limit = { - AND = { - exists = character:amilah_01 - exists = character:70519 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:amilah_01 - SUZERAIN = character:70519 - } + add_culture_minority_effect = { + CULTURE = culture:bozo + SIZE = small + COUNTY = title:c_kukiya } - if = { - limit = { - AND = { - exists = character:lazika_03 - exists = character:70519 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:lazika_03 - SUZERAIN = character:70519 - } + add_culture_minority_effect = { + CULTURE = culture:sorko + SIZE = small + COUNTY = title:c_gao } - if = { - limit = { - AND = { - exists = character:tanukhid_011 - exists = character:70519 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:tanukhid_011 - SUZERAIN = character:70519 - } + add_culture_minority_effect = { + CULTURE = culture:bozo + SIZE = small + COUNTY = title:c_gao } - - ###GUPTAS - # Madrakas - #if = { - # limit = { - # AND = { - # exists = character:matraka_01 - # exists = character:2020123 - # } - # } - # make_tributary = { - # TYPE = tributary_permanent - # TRIBUTARY = character:matraka_01 - # SUZERAIN = character:2020123 - # } - #} - # Yaudheyas - if = { - limit = { - AND = { - exists = character:yaudheya_01 - exists = character:2020123 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:yaudheya_01 - SUZERAIN = character:2020123 - } + add_culture_minority_effect = { + CULTURE = culture:marka + SIZE = small + COUNTY = title:c_gao } - # Karttripuras - if = { - limit = { - AND = { - exists = character:karttripura_02 - exists = character:2020123 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:karttripura_02 - SUZERAIN = character:2020123 - } + add_culture_minority_effect = { + CULTURE = culture:bobo + SIZE = small + COUNTY = title:c_gao } - # Nepal/Licchavis - if = { - limit = { - AND = { - exists = character:licchavi_02 - exists = character:2020123 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:licchavi_02 - SUZERAIN = character:2020123 - } + add_culture_minority_effect = { + CULTURE = culture:malinke + SIZE = small + COUNTY = title:c_gao } - # Kamarupa - if = { - limit = { - AND = { - exists = character:190055 - exists = character:2020123 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:190055 - SUZERAIN = character:2020123 - } + add_culture_minority_effect = { + CULTURE = culture:garamantian + SIZE = small + COUNTY = title:c_tessalit } - # Davakas - if = { - limit = { - AND = { - exists = character:davaka_01 - exists = character:2020123 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:davaka_01 - SUZERAIN = character:2020123 - } + add_culture_minority_effect = { + CULTURE = culture:garamantian + SIZE = small + COUNTY = title:c_djado } - # Samatatas - #if = { - # limit = { - # AND = { - # exists = character:samatata_01 - # exists = character:2020123 - # } - # } - # make_tributary = { - # TYPE = tributary_permanent - # TRIBUTARY = character:samatata_01 - # SUZERAIN = character:2020123 - # } - #} - } - if = { - limit = { - game_start_date = 476.9.4 + add_culture_minority_effect = { + CULTURE = culture:garamantian + SIZE = small + COUNTY = title:c_djanet } - if = { - limit = { - AND = { - exists = character:996002 - exists = character:70515 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:996002 - SUZERAIN = character:70515 - } + add_culture_minority_effect = { + CULTURE = culture:garamantian + SIZE = small + COUNTY = title:c_bilma } - if = { - limit = { - AND = { - exists = character:tanukhid_03 - exists = character:70515 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:tanukhid_03 - SUZERAIN = character:70515 - } + add_culture_minority_effect = { + CULTURE = culture:garamantian + SIZE = small + COUNTY = title:c_tibesti } - if = { - limit = { - AND = { - exists = character:lazika_05 - exists = character:70515 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:lazika_05 - SUZERAIN = character:70515 - } + add_culture_minority_effect = { + CULTURE = culture:garamantian + SIZE = small + COUNTY = title:c_kanem } - character:strabo_02 ?= { - spawn_army = { - name = "Zeno's Auxiliaries" - levies = 1000 - men_at_arms = { - type = palatinae - #type = armored_footmen - stacks = 2 - } - men_at_arms = { - type = comitatenses - #type = armored_footmen - stacks = 2 - } - location = title:c_turnovo.title_province - inheritable = no - } + add_culture_minority_effect = { + CULTURE = culture:garamantian + SIZE = small + COUNTY = title:c_dirku } - character:992016 ?= { - spawn_army = { - name = "Ostrogoth Invaders" - levies = 3000 - men_at_arms = { - type = bowmen - stacks = 5 - } - men_at_arms = { - type = light_horsemen - stacks = 5 - } - men_at_arms = { - type = light_footmen - stacks = 10 - } - men_at_arms = { - type = siege_towers - stacks = 3 - } - location = capital_province - inheritable = no - } + add_culture_minority_effect = { + CULTURE = culture:laguatan + SIZE = small + COUNTY = title:c_barqa } - character:yujiulu_10 ?= { - dynasty = { - add_dynasty_modifier = rouran_khagans - } + add_culture_minority_effect = { + CULTURE = culture:laguatan + SIZE = small + COUNTY = title:c_derna } - } - - ###WESTERN ROMAN AND AFRICAN - if = { - limit = { - AND = { - game_start_date > 394.1.1 - game_start_date < 396.1.1 - } + add_culture_minority_effect = { + CULTURE = culture:laguatan + SIZE = small + COUNTY = title:c_syrte } - if = { - limit = { - AND = { - exists = character:159009 - exists = character:145227 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:159009 - SUZERAIN = character:145227 - } + add_culture_minority_effect = { + CULTURE = culture:laguatan + SIZE = small + COUNTY = title:c_labda } - if = { - limit = { - AND = { - exists = character:mauri_18 - exists = character:145227 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:mauri_18 - SUZERAIN = character:145227 - } + add_culture_minority_effect = { + CULTURE = culture:laguatan + SIZE = small + COUNTY = title:c_tripolitana } - if = { - limit = { - AND = { - exists = character:afroroman_01 - exists = character:145227 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:afroroman_01 - SUZERAIN = character:145227 - } + add_culture_minority_effect = { + CULTURE = culture:laguatan + SIZE = small + COUNTY = title:c_gabes } - if = { - limit = { - AND = { - exists = character:mauri_28 - exists = character:mauri_18 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:mauri_28 - SUZERAIN = character:mauri_18 - } + add_culture_minority_effect = { + CULTURE = culture:laguatan + SIZE = small + COUNTY = title:c_djerba } - if = { - limit = { - AND = { - exists = character:mauri_23 - exists = character:145227 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:mauri_23 - SUZERAIN = character:145227 - } + add_culture_minority_effect = { + CULTURE = culture:laguatan + SIZE = small + COUNTY = title:c_ghat + } + add_culture_minority_effect = { + CULTURE = culture:laguatan + SIZE = small + COUNTY = title:c_tobruk + } + add_culture_minority_effect = { + CULTURE = culture:laguatan + SIZE = small + COUNTY = title:c_sullum + } + add_culture_minority_effect = { + CULTURE = culture:laguatan + SIZE = small + COUNTY = title:c_farafra + } + add_culture_minority_effect = { + CULTURE = culture:laguatan + SIZE = small + COUNTY = title:c_dakhla + } + add_culture_minority_effect = { + CULTURE = culture:laguatan + SIZE = small + COUNTY = title:c_bahriya + } + add_culture_minority_effect = { + CULTURE = culture:laguatan + SIZE = small + COUNTY = title:c_kharga } } + # Punic if = { limit = { - AND = { - game_start_date > 360.1.1 - game_start_date < 362.1.1 - } + game_start_date <= 600.1.1 } - if = { - limit = { - AND = { - exists = character:afroroman_01 - exists = character:145237 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:afroroman_01 - SUZERAIN = character:145237 - } + add_culture_minority_effect = { + CULTURE = culture:punic + SIZE = large + COUNTY = title:c_tunis } - if = { - limit = { - AND = { - exists = character:mauri_17 - exists = character:145237 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:mauri_17 - SUZERAIN = character:145237 - } + add_faith_minority_effect = { + FAITH = faith:carthage_pagan + SIZE = large + COUNTY = title:c_tunis } - if = { - limit = { - AND = { - exists = character:arsacid_46 - exists = character:145237 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:arsacid_46 - SUZERAIN = character:145237 - } + add_culture_minority_effect = { + CULTURE = culture:punic + SIZE = large + COUNTY = title:c_satfura } - if = { - limit = { - AND = { - exists = character:mauri_27 - exists = character:mauri_17 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:mauri_27 - SUZERAIN = character:mauri_17 - } + add_faith_minority_effect = { + FAITH = faith:carthage_pagan + SIZE = large + COUNTY = title:c_satfura } - if = { - limit = { - AND = { - exists = character:mauri_22 - exists = character:145237 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:mauri_22 - SUZERAIN = character:145237 - } + add_culture_minority_effect = { + CULTURE = culture:punic + SIZE = large + COUNTY = title:c_medjerda } - ###PERSIANS - if = { - limit = { - AND = { - exists = character:159582 - exists = character:180617 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:159582 - SUZERAIN = character:180617 - } + add_faith_minority_effect = { + FAITH = faith:carthage_pagan + SIZE = large + COUNTY = title:c_medjerda } - if = { - limit = { - AND = { - exists = character:159758 - exists = character:180617 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:159758 - SUZERAIN = character:180617 - } + add_culture_minority_effect = { + CULTURE = culture:punic + SIZE = large + COUNTY = title:c_kairwan } - if = { - limit = { - AND = { - exists = character:lakhmid_03 - exists = character:180617 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:lakhmid_03 - SUZERAIN = character:180617 - } + add_faith_minority_effect = { + FAITH = faith:carthage_pagan + SIZE = large + COUNTY = title:c_kairwan } - if = { - limit = { - AND = { - exists = character:khinda_05 - exists = character:himyar_11 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:khinda_05 - SUZERAIN = character:himyar_11 - } + add_culture_minority_effect = { + CULTURE = culture:punic + SIZE = large + COUNTY = title:c_mahdiya } - #character:990016 ?= { - # add_gold = 250 - # spawn_army = { - # name = "Hunnic Invaders" - # levies = 2000 - # men_at_arms = { - # type = light_horsemen - # stacks = 15 - # } - # men_at_arms = { - # type = horse_archers - # stacks = 15 - # } - # men_at_arms = { - # type = siege_towers - # stacks = 5 - # } - # location = capital_province - # inheritable = no - # } - # spawn_army = { - # name = "Hunnic Invaders" - # levies = 1000 - # men_at_arms = { - # type = light_horsemen - # stacks = 10 - # } - # men_at_arms = { - # type = horse_archers - # stacks = 10 - # } - # men_at_arms = { - # type = siege_towers - # stacks = 5 - # } - # location = capital_province - # inheritable = yes - # } - #} - } - - ###PERSIAN - if = { - limit = { - AND = { - game_start_date > 394.1.1 - game_start_date < 396.1.1 - } + add_faith_minority_effect = { + FAITH = faith:carthage_pagan + SIZE = large + COUNTY = title:c_mahdiya } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:lakhmid_06 - SUZERAIN = character:180618 + add_culture_minority_effect = { + CULTURE = culture:punic + SIZE = large + COUNTY = title:c_sfax } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:159583 - SUZERAIN = character:180618 + add_faith_minority_effect = { + FAITH = faith:carthage_pagan + SIZE = large + COUNTY = title:c_sfax } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:159761 - SUZERAIN = character:180618 + add_culture_minority_effect = { + CULTURE = culture:punic + SIZE = large + COUNTY = title:c_gabes } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:arsacid_58 - SUZERAIN = character:180618 + add_faith_minority_effect = { + FAITH = faith:carthage_pagan + SIZE = large + COUNTY = title:c_gabes + } + add_culture_minority_effect = { + CULTURE = culture:punic + SIZE = large + COUNTY = title:c_djerba + } + add_faith_minority_effect = { + FAITH = faith:carthage_pagan + SIZE = large + COUNTY = title:c_djerba + } + add_culture_minority_effect = { + CULTURE = culture:punic + SIZE = large + COUNTY = title:c_tripolitana + } + add_faith_minority_effect = { + FAITH = faith:carthage_pagan + SIZE = large + COUNTY = title:c_tripolitana + } + add_culture_minority_effect = { + CULTURE = culture:punic + SIZE = large + COUNTY = title:c_labda + } + add_faith_minority_effect = { + FAITH = faith:carthage_pagan + SIZE = large + COUNTY = title:c_labda } } + + # Alans if = { limit = { - AND = { - game_start_date > 475.1.1 - game_start_date < 477.1.1 - } - } - if = { - limit = { - AND = { - exists = character:lakhmid_08 - exists = character:180624 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:lakhmid_08 - SUZERAIN = character:180624 - } + game_start_date >= 400.1.1 } - if = { - limit = { - AND = { - exists = character:159766 - exists = character:180624 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:159766 - SUZERAIN = character:180624 - } + add_culture_minority_effect = { + CULTURE = culture:alan + SIZE = large + COUNTY = title:c_tunis } - if = { - limit = { - AND = { - exists = character:159859 - exists = character:180624 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:159859 - SUZERAIN = character:180624 - } + add_faith_minority_effect = { + FAITH = faith:arianism + SIZE = large + COUNTY = title:c_tunis } } - - ###GUPTA + + # Gauls if = { limit = { - AND = { - game_start_date > 394.1.1 - game_start_date < 396.1.1 - } + game_start_date <= 600.1.1 } - if = { - limit = { - AND = { - exists = character:salankayana_02 - exists = character:2020123 - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = character:salankayana_02 - SUZERAIN = character:2020123 - } + add_culture_minority_effect = { + CULTURE = culture:gaul + SIZE = small + COUNTY = title:c_brugge + } + add_faith_minority_effect = { + FAITH = faith:gaulish_pagan + SIZE = small + COUNTY = title:c_brugge + } + add_culture_minority_effect = { + CULTURE = culture:gaul + SIZE = small + COUNTY = title:c_yperen + } + add_faith_minority_effect = { + FAITH = faith:gaulish_pagan + SIZE = small + COUNTY = title:c_yperen + } + add_culture_minority_effect = { + CULTURE = culture:gaul + SIZE = small + COUNTY = title:c_guines + } + add_faith_minority_effect = { + FAITH = faith:gaulish_pagan + SIZE = small + COUNTY = title:c_guines + } + add_culture_minority_effect = { + CULTURE = culture:gaul + SIZE = small + COUNTY = title:c_boulogne + } + add_faith_minority_effect = { + FAITH = faith:gaulish_pagan + SIZE = small + COUNTY = title:c_boulogne + } + add_culture_minority_effect = { + CULTURE = culture:gaul + SIZE = small + COUNTY = title:c_eu + } + add_faith_minority_effect = { + FAITH = faith:gaulish_pagan + SIZE = small + COUNTY = title:c_eu } } - ###532 BM Caucasus + # Rhaetian if = { limit = { - AND = { - game_start_date > 530.1.1 - game_start_date < 540.1.1 - } + game_start_date <= 450.1.1 } - if = { - limit = { - AND = { - exists = title:d_abkhazia.holder - exists = title:e_byzantium.holder - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = title:d_abkhazia.holder - SUZERAIN = title:e_byzantium.holder - } + add_culture_minority_effect = { + CULTURE = culture:rhaetian + SIZE = small + COUNTY = title:c_trent } - if = { - limit = { - AND = { - exists = title:d_georgia.holder - exists = title:e_persia.holder - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = title:d_georgia.holder - SUZERAIN = title:e_persia.holder - } - } - if = { - limit = { - AND = { - exists = title:d_albania.holder - exists = title:e_persia.holder - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = title:d_albania.holder - SUZERAIN = title:e_persia.holder - } - } - if = { - limit = { - AND = { - exists = title:k_lakhmid.holder - exists = title:e_persia.holder - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = title:k_lakhmid.holder - SUZERAIN = title:e_persia.holder - } - } - if = { - limit = { - AND = { - exists = title:k_ghassanid.holder - exists = title:e_byzantium.holder - } - } - make_tributary = { - TYPE = tributary_permanent - TRIBUTARY = title:k_ghassanid.holder - SUZERAIN = title:e_byzantium.holder - } + add_culture_minority_effect = { + CULTURE = culture:rhaetian + SIZE = small + COUNTY = title:c_brescia } } - #I'm too lazy to make another file :p + ##INDIA + + # Buddhists in holy sites and centres of learning + add_faith_minority_effect = { + FAITH = faith:pudgalavada + SIZE = large + COUNTY = title:c_mathura + } + add_faith_minority_effect = { + FAITH = faith:sarvastivada + SIZE = large + COUNTY = title:c_mathura + } + add_faith_minority_effect = { + FAITH = faith:dharmaguptaka + SIZE = large + COUNTY = title:c_mathura + } + add_faith_minority_effect = { + FAITH = faith:mahasanghika + SIZE = large + COUNTY = title:c_mathura + } + add_faith_minority_effect = { + FAITH = faith:pudgalavada + SIZE = large + COUNTY = title:c_varanasi + } + add_faith_minority_effect = { + FAITH = faith:sarvastivada + SIZE = large + COUNTY = title:c_varanasi + } + add_faith_minority_effect = { + FAITH = faith:dharmaguptaka + SIZE = large + COUNTY = title:c_varanasi + } + add_faith_minority_effect = { + FAITH = faith:mahasanghika + SIZE = large + COUNTY = title:c_varanasi + } + add_faith_minority_effect = { + FAITH = faith:pudgalavada + SIZE = large + COUNTY = title:c_vidisa + } + add_faith_minority_effect = { + FAITH = faith:sarvastivada + SIZE = large + COUNTY = title:c_vidisa + } + add_faith_minority_effect = { + FAITH = faith:dharmaguptaka + SIZE = large + COUNTY = title:c_vidisa + } + add_faith_minority_effect = { + FAITH = faith:mahasanghika + SIZE = large + COUNTY = title:c_vidisa + } + add_faith_minority_effect = { + FAITH = faith:pudgalavada + SIZE = large + COUNTY = title:c_somnath + } + + # Pashupatas in Vidisha + add_faith_minority_effect = { + FAITH = faith:pashupata + SIZE = large + COUNTY = title:c_vidisa + } + + # Pataliputra has Bhagavatas + add_faith_minority_effect = { + FAITH = faith:krishnaism + SIZE = large + COUNTY = title:c_magadha + } + + # Varanasi is diverse + add_faith_minority_effect = { + FAITH = faith:krishnaism + SIZE = large + COUNTY = title:c_varanasi + } + add_faith_minority_effect = { + FAITH = faith:vaishnavism + SIZE = large + COUNTY = title:c_varanasi + } + add_faith_minority_effect = { + FAITH = faith:shaivism + SIZE = large + COUNTY = title:c_varanasi + } + add_faith_minority_effect = { + FAITH = faith:mahasanghika + SIZE = large + COUNTY = title:c_varanasi + } + add_faith_minority_effect = { + FAITH = faith:sarvastivada + SIZE = large + COUNTY = title:c_varanasi + } + + # Jains in Kajangala, Mithila, and Radha + add_faith_minority_effect = { + FAITH = faith:svetambara + SIZE = large + COUNTY = title:c_damin_i_koh + } + add_faith_minority_effect = { + FAITH = faith:svetambara + SIZE = large + COUNTY = title:c_mithila + } + add_faith_minority_effect = { + FAITH = faith:svetambara + SIZE = large + COUNTY = title:c_radha + } + + # Kherwals in Kajangala + add_culture_minority_effect = { + CULTURE = culture:munda + SIZE = small + COUNTY = title:c_damin_i_koh + } + + # Dravida Shaivas in Tamilakam + add_faith_minority_effect = { + FAITH = faith:dravida_saiva + SIZE = large + COUNTY = title:c_cholamandalam + } + add_faith_minority_effect = { + FAITH = faith:dravida_saiva + SIZE = large + COUNTY = title:c_korkai + } + add_faith_minority_effect = { + FAITH = faith:dravida_saiva + SIZE = large + COUNTY = title:c_madurai + } + add_faith_minority_effect = { + FAITH = faith:srikula_shaktism + SIZE = large + COUNTY = title:c_jaffna + } + add_faith_minority_effect = { + FAITH = faith:dravida_saiva + SIZE = large + COUNTY = title:c_kongu + } + add_faith_minority_effect = { + FAITH = faith:dravida_saiva + SIZE = large + COUNTY = title:c_korkai + } + + # Digambaras in Tamilakam + add_faith_minority_effect = { + FAITH = faith:digambara + SIZE = large + COUNTY = title:c_cholamandalam + } + add_faith_minority_effect = { + FAITH = faith:digambara + SIZE = large + COUNTY = title:c_korkai + } + add_faith_minority_effect = { + FAITH = faith:digambara + SIZE = large + COUNTY = title:c_madurai + } + add_faith_minority_effect = { + FAITH = faith:dravida_saiva + SIZE = large + COUNTY = title:c_korkai + } + + # Tamils in Tambapanni + add_culture_minority_effect = { + CULTURE = culture:tamil + SIZE = large + COUNTY = title:c_batticaloa + } + add_culture_minority_effect = { + CULTURE = culture:tamil + SIZE = large + COUNTY = title:c_phiti + } + add_culture_minority_effect = { + CULTURE = culture:tamil + SIZE = large + COUNTY = title:c_trincomalee + } + add_faith_minority_effect = { + FAITH = faith:dravida_saiva + SIZE = large + COUNTY = title:c_batticaloa + } + add_faith_minority_effect = { + FAITH = faith:dravida_saiva + SIZE = large + COUNTY = title:c_phiti + } + add_faith_minority_effect = { + FAITH = faith:dravida_saiva + SIZE = large + COUNTY = title:c_trincomalee + } + + # Maharashtrakas in port towns + add_culture_minority_effect = { + CULTURE = culture:marathi + SIZE = large + COUNTY = title:c_surparaka + } + add_culture_minority_effect = { + CULTURE = culture:marathi + SIZE = large + COUNTY = title:c_panaji + } + add_culture_minority_effect = { + CULTURE = culture:marathi + SIZE = large + COUNTY = title:c_kondana + } + add_culture_minority_effect = { + CULTURE = culture:marathi + SIZE = large + COUNTY = title:c_karahataka + } + add_culture_minority_effect = { + CULTURE = culture:marathi + SIZE = large + COUNTY = title:c_kolhapur + } + + # Avantakas in their homeland + add_culture_minority_effect = { + CULTURE = culture:avantika + SIZE = large + COUNTY = title:c_sarangpur + } + add_faith_minority_effect = { + FAITH = faith:saura + SIZE = large + COUNTY = title:c_sarangpur + } + add_culture_minority_effect = { + CULTURE = culture:avantika + SIZE = large + COUNTY = title:c_vidisa + } + add_faith_minority_effect = { + FAITH = faith:saura + SIZE = large + COUNTY = title:c_vidisa + } + add_culture_minority_effect = { + CULTURE = culture:avantika + SIZE = large + COUNTY = title:c_dasapura + } + add_faith_minority_effect = { + FAITH = faith:saura + SIZE = large + COUNTY = title:c_dasapura + } + # Malava settlement in the Narmada valley + add_culture_minority_effect = { + CULTURE = culture:malvi + SIZE = large + COUNTY = title:c_ujjayini + } + add_faith_minority_effect = { + FAITH = faith:pashupata + SIZE = large + COUNTY = title:c_ujjayini + } + add_culture_minority_effect = { + CULTURE = culture:malvi + SIZE = large + COUNTY = title:c_dhara + } + add_faith_minority_effect = { + FAITH = faith:pashupata + SIZE = large + COUNTY = title:c_dhara + } + # Vaishnavas and Shaivas in Haridwar + add_faith_minority_effect = { + FAITH = faith:pashupata + SIZE = large + COUNTY = title:c_ujjayini + } + add_faith_minority_effect = { + FAITH = faith:pashupata + SIZE = large + COUNTY = title:c_ujjayini + } + + # Buddhists in Sanchi + add_faith_minority_effect = { + FAITH = faith:mahasanghika + SIZE = large + COUNTY = title:c_vidisa + } + + # Narasimha Cult in Mathura + add_faith_minority_effect = { + FAITH = faith:narasimha + SIZE = small + COUNTY = title:c_mathura + } + + # Kanchipuram is diverse + add_faith_minority_effect = { + FAITH = faith:dravida_saiva + SIZE = large + COUNTY = title:c_kanchipuram + } + add_faith_minority_effect = { + FAITH = faith:theravada + SIZE = large + COUNTY = title:c_kanchipuram + } + add_faith_minority_effect = { + FAITH = faith:pudgalavada + SIZE = small + COUNTY = title:c_kanchipuram + } + add_faith_minority_effect = { + FAITH = faith:vaishnavism + SIZE = large + COUNTY = title:c_kanchipuram + } + add_faith_minority_effect = { + FAITH = faith:digambara + SIZE = small + COUNTY = title:c_kanchipuram + } + add_faith_minority_effect = { + FAITH = faith:mahasanghika + SIZE = small + COUNTY = title:c_kanchipuram + } + add_culture_minority_effect = { + CULTURE = culture:telugu + SIZE = large + COUNTY = title:c_kanchipuram + } + add_faith_minority_effect = { + FAITH = faith:manichean + SIZE = small + COUNTY = title:c_kanchipuram + } + + # Jews and Christians in Kerala + add_faith_minority_effect = { + FAITH = faith:malabarism + SIZE = small + COUNTY = title:c_kerala + } if = { limit = { - game_start_date = 476.9.4 + game_start_date < 400.1.1 } - title:k_italy.holder ?= { - add_gold = 200 - spawn_army = { - name = "Scirian Invaders" - levies = 1500 - men_at_arms = { - type = bowmen - stacks = 3 - } - men_at_arms = { - type = light_horsemen - stacks = 2 - } - men_at_arms = { - type = light_footmen - stacks = 4 - } - location = capital_province - inheritable = no - } - spawn_army = { - name = "Scirian Invaders" - levies = 1500 - men_at_arms = { - type = bowmen - stacks = 3 - } - men_at_arms = { - type = light_horsemen - stacks = 2 - } - men_at_arms = { - type = light_footmen - stacks = 4 - } - location = capital_province - inheritable = yes - } + add_faith_minority_effect = { + FAITH = faith:nicene + SIZE = small + COUNTY = title:c_kerala } - title:k_visigoths.holder ?= { - add_gold = 300 - spawn_army = { - name = gothic_event_troops - levies = 2000 - men_at_arms = { - type = bowmen - stacks = 2 - } - men_at_arms = { - type = light_horsemen - stacks = 2 - } - men_at_arms = { - type = light_footmen - stacks = 4 - } - location = capital_province - inheritable = no - } - spawn_army = { - name = gothic_event_troops - levies = 2000 - men_at_arms = { - type = bowmen - stacks = 2 - } - men_at_arms = { - type = light_horsemen - stacks = 2 - } - men_at_arms = { - type = light_footmen - stacks = 4 - } - location = capital_province - inheritable = yes - } + } + if = { + limit = { + game_start_date > 400.1.1 + } + add_faith_minority_effect = { + FAITH = faith:nestorian + SIZE = small + COUNTY = title:c_kerala } } - else_if = { + + # Christians in Tambapanni + if = { limit = { - AND = { - game_start_date > 394.1.1 - game_start_date < 396.1.1 - } + game_start_date < 400.1.1 } - title:e_western_roman_empire.holder ?= { - add_gold = 1000 + add_faith_minority_effect = { + FAITH = faith:nicene + SIZE = small + COUNTY = title:c_kotte } - title:e_byzantium.holder ?= { - add_gold = 1000 + } + if = { + limit = { + game_start_date > 400.1.1 } - character:200290 = { - remove_claim = title:d_muntenia - } - character:balamer_01 ?= { - add_prestige = 3000 - spawn_army = { - name = "Hunnic Invaders" - levies = 2000 - men_at_arms = { - type = horse_archers - stacks = 10 - } - men_at_arms = { - type = light_footmen - stacks = 20 - } - men_at_arms = { - type = siege_towers - stacks = 5 - } - location = title:b_peremyshl.title_province - inheritable = no - } - spawn_army = { - name = "Hunnic Invaders" - levies = 2000 - men_at_arms = { - type = light_horsemen - stacks = 10 - } - men_at_arms = { - type = horse_archers - stacks = 10 - } - men_at_arms = { - type = light_footmen - stacks = 10 - } - men_at_arms = { - type = siege_towers - stacks = 5 - } - location = title:b_stoenesti.title_province - inheritable = no - } - } - character:990000 ?= { - spawn_army = { - name = "Hunnic Invaders" - levies = 2000 - men_at_arms = { - type = light_horsemen - stacks = 10 - } - men_at_arms = { - type = horse_archers - stacks = 10 - } - men_at_arms = { - type = siege_towers - stacks = 5 - } - location = capital_province - inheritable = no - } - } - character:yujiulu_072 ?= { - add_prestige = 500 - spawn_army = { - name = "Rouran Invaders" - levies = 1000 - men_at_arms = { - type = light_horsemen - stacks = 3 - } - men_at_arms = { - type = horse_archers - stacks = 3 - } - men_at_arms = { - type = siege_towers - stacks = 2 - } - location = capital_province - inheritable = yes - } + add_faith_minority_effect = { + FAITH = faith:nestorian + SIZE = small + COUNTY = title:c_kotte } } - } -} + + # Zoroastrians and manicheans in Sindh and Gujarat + add_faith_minority_effect = { + FAITH = faith:mazdayasna + SIZE = small + COUNTY = title:c_debul + } + add_faith_minority_effect = { + FAITH = faith:mazdayasna + SIZE = small + COUNTY = title:c_daman + } + add_faith_minority_effect = { + FAITH = faith:mazdayasna + SIZE = small + COUNTY = title:c_surparaka + } + add_culture_minority_effect = { + CULTURE = culture:persian + SIZE = small + COUNTY = title:c_debul + } + add_culture_minority_effect = { + CULTURE = culture:persian + SIZE = small + COUNTY = title:c_daman + } + add_culture_minority_effect = { + CULTURE = culture:persian + SIZE = small + COUNTY = title:c_surparaka + } + add_faith_minority_effect = { + FAITH = faith:manichean + SIZE = small + COUNTY = title:c_debul + } + add_faith_minority_effect = { + FAITH = faith:manichean + SIZE = small + COUNTY = title:c_daman + } + add_faith_minority_effect = { + FAITH = faith:manichean + SIZE = small + COUNTY = title:c_surparaka + } -"common/on_action/TFE_title_on_actions.txt" = { - { - if = { - limit = { - scope:title = title:k_ostrogoths - root = { is_greek_or_roman = no } - NOT = { exists = global_var:gothic_war_won } - character:992020 = { - is_alive = yes - NOT = { - THIS = root.mother - } - } - OR = { - debug_log_details = "Check Conditions" - #root = { has_active_diarchy = yes } - #scope:title.holder = { has_active_diarchy = yes } - root = { diarch = character:992020 } - scope:title.holder = { diarch = character:992020 } - #character:992020 = { is_diarch = yes } - #character:992020 = { is_designated_diarch = yes } - character:992020 = { is_diarch_of_target = root } - character:992020 = { is_diarch_of_target = scope:title.holder } - } - } - scope:title.holder = { - trigger_event = { - id = germanic_events.0019 - days = 1 - } - } + # Maldives + add_faith_minority_effect = { + FAITH = faith:mahayana + SIZE = large + COUNTY = title:c_maldives + } + add_faith_minority_effect = { + FAITH = faith:theravada + SIZE = large + COUNTY = title:c_maldives + } + add_culture_minority_effect = { + CULTURE = culture:malaiya + SIZE = small + COUNTY = title:c_maldives + } + add_culture_minority_effect = { + CULTURE = culture:tamil + SIZE = small + COUNTY = title:c_maldives } - } -} -"common/on_action/TFE_yearly_on_actions.txt" = { - { + # Shaivas in Kashmir + add_faith_minority_effect = { + FAITH = faith:shaivism + SIZE = large + COUNTY = title:c_kasmira + } + add_faith_minority_effect = { + FAITH = faith:shaivism + SIZE = large + COUNTY = title:c_astore + } + add_faith_minority_effect = { + FAITH = faith:shaivism + SIZE = large + COUNTY = title:c_allai + } + + # Shakas in Saurashtra + add_culture_minority_effect = { + CULTURE = culture:shaka + SIZE = large + COUNTY = title:c_navasarika + } + add_faith_minority_effect = { + FAITH = faith:mahayana + SIZE = large + COUNTY = title:c_navasarika + } + add_culture_minority_effect = { + CULTURE = culture:shaka + SIZE = large + COUNTY = title:c_vadodara + } + add_faith_minority_effect = { + FAITH = faith:mahayana + SIZE = large + COUNTY = title:c_vadodara + } + add_culture_minority_effect = { + CULTURE = culture:shaka + SIZE = large + COUNTY = title:c_ujjayini + } + add_faith_minority_effect = { + FAITH = faith:mahayana + SIZE = large + COUNTY = title:c_ujjayini + } + add_culture_minority_effect = { + CULTURE = culture:shaka + SIZE = large + COUNTY = title:c_dvaraka + } + + # Yuezhi in Gandhara + + add_faith_minority_effect = { + FAITH = faith:sarvastivada + SIZE = large + COUNTY = title:c_purushapura + } + add_culture_minority_effect = { + CULTURE = culture:yuezhi + SIZE = large + COUNTY = title:c_purushapura + } + + # Burusho people + + add_culture_minority_effect = { + CULTURE = culture:burusho + SIZE = large + COUNTY = title:c_yasin + } + + # Abhiras + + add_culture_minority_effect = { + CULTURE = culture:abhira + SIZE = large + COUNTY = title:c_vardhamana + } + + add_culture_minority_effect = { + CULTURE = culture:abhira + SIZE = large + COUNTY = title:c_valabhi + } + + add_culture_minority_effect = { + CULTURE = culture:abhira + SIZE = large + COUNTY = title:c_surparaka + } + + # Veddas + + add_culture_minority_effect = { + CULTURE = culture:vedda + SIZE = large + COUNTY = title:c_dakhina_desa + } + + add_culture_minority_effect = { + CULTURE = culture:vedda + SIZE = large + COUNTY = title:c_kandy + } + + add_culture_minority_effect = { + CULTURE = culture:vedda + SIZE = large + COUNTY = title:c_rohana + } + + add_culture_minority_effect = { + CULTURE = culture:vedda + SIZE = large + COUNTY = title:c_batticaloa + } + + add_culture_minority_effect = { + CULTURE = culture:vedda + SIZE = large + COUNTY = title:c_phiti + } + + add_culture_minority_effect = { + CULTURE = culture:vedda + SIZE = large + COUNTY = title:c_trincomalee + } + + add_culture_minority_effect = { + CULTURE = culture:vedda + SIZE = large + COUNTY = title:c_jaffna + } + + add_culture_minority_effect = { + CULTURE = culture:vedda + SIZE = large + COUNTY = title:c_kotte + } + + add_faith_minority_effect = { + FAITH = faith:vedda_pagan + SIZE = large + COUNTY = title:c_dakhina_desa + } + + add_faith_minority_effect = { + FAITH = faith:vedda_pagan + SIZE = large + COUNTY = title:c_kandy + } + + add_faith_minority_effect = { + FAITH = faith:vedda_pagan + SIZE = large + COUNTY = title:c_rohana + } + + add_faith_minority_effect = { + FAITH = faith:vedda_pagan + SIZE = large + COUNTY = title:c_batticaloa + } + + add_faith_minority_effect = { + FAITH = faith:vedda_pagan + SIZE = large + COUNTY = title:c_phiti + } + + add_faith_minority_effect = { + FAITH = faith:vedda_pagan + SIZE = large + COUNTY = title:c_trincomalee + } + + add_faith_minority_effect = { + FAITH = faith:vedda_pagan + SIZE = large + COUNTY = title:c_jaffna + } + + add_faith_minority_effect = { + FAITH = faith:vedda_pagan + SIZE = large + COUNTY = title:c_kotte + } + + # Burma Minorities + + add_culture_minority_effect = { + CULTURE = culture:burmese + SIZE = large + COUNTY = title:c_takon + } + + add_culture_minority_effect = { + CULTURE = culture:mon + SIZE = large + COUNTY = title:c_kusumi + } + + add_culture_minority_effect = { + CULTURE = culture:zo + SIZE = large + COUNTY = title:c_manipur + } + + add_faith_minority_effect = { + FAITH = faith:theravada + SIZE = large + COUNTY = title:c_kusumi + } + + add_faith_minority_effect = { + FAITH = faith:shaivism + SIZE = large + COUNTY = title:c_yamethin + } + + add_faith_minority_effect = { + FAITH = faith:shaivism + SIZE = small + COUNTY = title:c_magwe + } + + ##JEWISH PEOPLE + + #Jewish and Samaritan minorities in Jerusalem + add_culture_minority_effect = { + CULTURE = culture:hebrew + SIZE = large + COUNTY = title:c_jerusalem + } + add_faith_minority_effect = { + FAITH = faith:samaritan + SIZE = large + COUNTY = title:c_jerusalem + } + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = large + COUNTY = title:c_jerusalem + } + + #Jews in Himyar + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = small + COUNTY = title:c_taizz + } + + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = small + COUNTY = title:c_mandab + } + + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = small + COUNTY = title:c_dathina + } + + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = large + COUNTY = title:c_sanaa + } + + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = large + COUNTY = title:c_mahra + } + + #Jews and Christians in Cyrenaica + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = large + COUNTY = title:c_barqa + } if = { limit = { - current_date > 400.1.1 - current_date < 450.1.1 - NOT = { has_global_variable = attila_spawn } - title:e_hunnic_empire.holder = { - is_adult = yes - } + game_start_date > 476.1.1 + game_start_date < 600.1.1 } - random = { - chance = 30 - modifier = { - add = 20 - current_date >= 405.1.1 - } - modifier = { - add = 20 - current_date >= 410.1.1 - } - modifier = { - add = 10 - current_date >= 415.1.1 - } - set_global_variable = { - name = attila_spawn - value = yes - } - trigger_event = { - id = steppe.6666 - days = { 1 2 } - } + add_faith_minority_effect = { + FAITH = faith:chalcedonian + SIZE = large + COUNTY = title:c_barqa + } + add_culture_minority_effect = { + CULTURE = culture:aegyptian + SIZE = large + COUNTY = title:c_barqa + } + add_faith_minority_effect = { + FAITH = faith:coptic + SIZE = large + COUNTY = title:c_barqa + } + add_culture_minority_effect = { + CULTURE = culture:kemetic + SIZE = large + COUNTY = title:c_barqa } } if = { limit = { - current_date > 533.1.1 - NOT = { has_global_variable = gothic_war_cycle_active } - exists = title:e_byzantium.holder - exists = title:k_ostrogoths.holder - exists = title:k_italy.holder - title:k_ostrogoths.holder = title:k_italy.holder - title:k_ostrogoths.holder = { - is_independent_ruler = yes - } - character:992020 = { - is_alive = yes - liege = title:k_ostrogoths.holder - } - title:k_ostrogoths.holder = { - has_active_diarchy = yes - diarch = character:992020 - } + game_start_date < 600.1.1 } - random = { - chance = 10 - modifier = { - add = 10 - current_date >= 534.1.1 - } - modifier = { - add = 10 - current_date >= 535.1.1 - } - modifier = { - add = 15 - current_date >= 536.1.1 - } - modifier = { - add = 15 - current_date >= 537.1.1 - } - modifier = { - add = 15 - current_date >= 538.1.1 - } - title:e_byzantium.holder = { - trigger_event = { - id = germanic_events.0032 - days = 1 - } - } - set_global_variable = { - name = gothic_war_cycle_active - value = yes - } - set_global_variable = { - name = amalasuntha_coup_unlock - value = yes - } + add_faith_minority_effect = { + FAITH = faith:ammon_pagan + SIZE = large + COUNTY = title:c_barqa } + #add_culture_minority_effect = { + # CULTURE = culture:garamantian + # SIZE = large + # COUNTY = title:c_barqa + #} + add_faith_minority_effect = { + FAITH = faith:ammon_pagan + SIZE = large + COUNTY = title:c_derna + } + #add_culture_minority_effect = { + # CULTURE = culture:garamantian + # SIZE = large + # COUNTY = title:c_derna + #} + } + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = small + COUNTY = title:c_napoli + } + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = small + COUNTY = title:c_lombardia + } + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = small + COUNTY = title:c_genoa + } + + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = small + COUNTY = title:c_derna + } + + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = small + COUNTY = title:c_tobruk + } + + #Jews in Rome + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = small + COUNTY = title:c_roma + } + + #Jews in Mesopotamia ##Add more later + add_faith_minority_effect = { + FAITH = faith:malabarism + SIZE = large + COUNTY = title:c_ctesiphon + } + + add_faith_minority_effect = { + FAITH = faith:malabarism + SIZE = large + COUNTY = title:c_baghdad + } + + add_faith_minority_effect = { + FAITH = faith:malabarism + SIZE = large + COUNTY = title:c_iskaf + } + + add_faith_minority_effect = { + FAITH = faith:malabarism + SIZE = large + COUNTY = title:c_anbar + } + + add_faith_minority_effect = { + FAITH = faith:malabarism + SIZE = large + COUNTY = title:c_ahvaz + } + + add_faith_minority_effect = { + FAITH = faith:malabarism + SIZE = large + COUNTY = title:c_tustar + } + + add_faith_minority_effect = { + FAITH = faith:malabarism + SIZE = small + COUNTY = title:c_basra + } + + #Jews in Egypt ##Add more later + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = large + COUNTY = title:c_alexandria + } + + #Jews in Syria ##Add more later + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = large + COUNTY = title:c_antiocheia + } + + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = large + COUNTY = title:c_edessa + } + + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = large + COUNTY = title:c_beirut + } + + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = large + COUNTY = title:c_tripoli + } + + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = large + COUNTY = title:c_damascus + } + + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = large + COUNTY = title:c_homs + } + + #Jews in Anatolia ##Add more later + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = large + COUNTY = title:c_cilicia + } + + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = small + COUNTY = title:c_lycandus + } + + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = small + COUNTY = title:c_tall_hamid + } + + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = large + COUNTY = title:c_seleucia + } + + #Jews in Greece ##Add more later + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = small + COUNTY = title:c_attica + } + add_faith_minority_effect = { + FAITH = faith:samaritan #Samaritan synagogue in Thessaloniki + SIZE = small + COUNTY = title:c_thessalonika + } + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = small + COUNTY = title:c_thessalonika + } + + #Jews in Cyprus + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = large + COUNTY = title:c_nicosia + } + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = large + COUNTY = title:c_famagusta + } + + #Jews in Aksum + add_faith_minority_effect = { + FAITH = faith:rabbinism + SIZE = small + COUNTY = title:c_tigre + } + + #Jews in Georgia + add_faith_minority_effect = { + FAITH = faith:malabarism + SIZE = small + COUNTY = title:c_guria + } + + add_faith_minority_effect = { + FAITH = faith:malabarism + SIZE = small + COUNTY = title:c_odishi + } + + #Jews in Iran + + add_faith_minority_effect = { + FAITH = faith:malabarism + SIZE = large + COUNTY = title:c_isfahan + } + + add_faith_minority_effect = { + FAITH = faith:malabarism + SIZE = small + COUNTY = title:c_hamadan + } + + ##ERAN + + #Ctesiphon's diversity + + add_faith_minority_effect = { + FAITH = faith:manichean + SIZE = large + COUNTY = title:c_ctesiphon + } + add_culture_minority_effect = { + CULTURE = culture:assyrian + SIZE = large + COUNTY = title:c_ctesiphon + } + add_culture_minority_effect = { + CULTURE = culture:parthian + SIZE = small + COUNTY = title:c_ctesiphon + } + add_culture_minority_effect = { + CULTURE = culture:aramean + SIZE = small + COUNTY = title:c_ctesiphon + } + add_culture_minority_effect = { + CULTURE = culture:greek + SIZE = small + COUNTY = title:c_ctesiphon } if = { limit = { - current_date > 533.1.1 - NOT = { exists = title:k_ostrogoths.holder } - exists = title:e_byzantium.holder - has_global_variable = gothic_war_won - #NOT = { has_global_variable = has_eternal_peace } - NOT = { has_global_variable = gothic_war_stalemate } - title:e_byzantium.holder = { - any_vassal_or_below = { - culture = { has_cultural_pillar = heritage_east_germanic } - any_held_title = { - OR = { - tier = tier_county - tier = tier_duchy - } - OR = { - kingdom = title:k_italy - kingdom = title:k_italia_annonariae - kingdom = title:k_italia_suburbicariae - } - } - } - } + game_start_date < 400.1.1 } - random = { - chance = 20 - modifier = { - add = 10 - current_date >= 540.1.1 - } - modifier = { - add = 10 - current_date >= 545.1.1 - } - modifier = { - add = 10 - current_date >= 550.1.1 - } - modifier = { - add = 30 - character:992029 = { - is_alive = yes - age > 15 - OR = { - is_landed = yes - title:e_byzantium.holder = { - any_vassal_or_below = { - exists = primary_heir - primary_heir = character:992029 - } - } - } - top_liege = title:e_byzantium.holder - } - } - trigger_event = { - id = germanic_events.0028 - days = 1 - } + add_faith_minority_effect = { + FAITH = faith:nicene + SIZE = large + COUNTY = title:c_ctesiphon } } - } - - { if = { limit = { - AND = { - game_start_date <= 406.1.1 - current_date >= 406.1.1 - NOT = { exists = global_var:marcus_usurper } - title:e_western_roman_empire = { - is_title_created = yes - } - title:e_western_roman_empire = { - OR = { - any_in_de_facto_hierarchy = { - THIS = title:k_britannia - } - holder = { - has_title = title:k_britannia - } - } - } - character:BUsuprer_01 = { - is_alive = yes - NOT = { - has_title = title:k_britannia - } - } - } + game_start_date > 400.1.1 } - - character:BUsuprer_01 = { - trigger_event = briton.0008 - set_global_variable = { - name = marcus_usurper - value = yes - } + add_faith_minority_effect = { + FAITH = faith:nestorian + SIZE = large + COUNTY = title:c_ctesiphon } } - } - - { + + #Meshan's diversity + add_culture_minority_effect = { + CULTURE = culture:persian + SIZE = large + COUNTY = title:c_basra + } + add_culture_minority_effect = { + CULTURE = culture:greek + SIZE = small + COUNTY = title:c_basra + } + add_culture_minority_effect = { + CULTURE = culture:persian + SIZE = large + COUNTY = title:c_ubulla + } + add_culture_minority_effect = { + CULTURE = culture:greek + SIZE = small + COUNTY = title:c_ubulla + } + add_culture_minority_effect = { + CULTURE = culture:persian + SIZE = large + COUNTY = title:c_rusafa + } + add_culture_minority_effect = { + CULTURE = culture:greek + SIZE = small + COUNTY = title:c_rusafa + } + add_faith_minority_effect = { + FAITH = faith:mazdayasna + SIZE = large + COUNTY = title:c_basra + } + add_faith_minority_effect = { + FAITH = faith:mazdayasna + SIZE = large + COUNTY = title:c_ubulla + } + add_faith_minority_effect = { + FAITH = faith:mazdayasna + SIZE = large + COUNTY = title:c_rusafa + } if = { limit = { - current_date >= 400.1.1 - NOT = { has_global_variable = radagaisus_has_invaded } - current_date <= 410.1.1 - NOT = { exists = title:k_goths.holder } - character:radagaisian_02 = { - is_alive = yes - } + game_start_date >= 400.1.1 } - random = { - chance = 5 - modifier = { - add = 15 - current_date >= 401.1.1 - } - modifier = { - add = 30 - current_date >= 403.1.1 - } - modifier = { - add = 40 - current_date >= 405.1.1 - } - modifier = { - add = 10 - current_date >= 406.1.1 - } - set_global_variable = { - name = radagaisus_has_invaded - value = yes - } - trigger_event = { - id = gothic_wars.0011 - days = { 30 50 } - } + add_culture_minority_effect = { + CULTURE = culture:jat + SIZE = small + COUNTY = title:c_basra } - } - - if = { - limit = { - current_date >= 400.1.1 - has_global_variable = radagaisus_has_invaded - NOT = { has_global_variable = goth_migrations } - current_date <= 420.1.1 + add_culture_minority_effect = { + CULTURE = culture:jat + SIZE = large + COUNTY = title:c_ubulla } - random = { - chance = 20 - modifier = { - add = 10 - current_date >= 405.1.1 - } - modifier = { - add = 20 - current_date >= 407.1.1 - } - modifier = { - add = 40 - current_date >= 409.1.1 - } - modifier = { - add = 10 - current_date >= 411.1.1 - } - set_global_variable = { - name = goth_migrations - value = yes - } - trigger_event = gothic_wars.0022 - trigger_event = gothic_wars.0023 - trigger_event = gothic_wars.0024 - trigger_event = gothic_wars.0025 + add_culture_minority_effect = { + CULTURE = culture:jat + SIZE = large + COUNTY = title:c_rusafa } } - if = { - limit = { - game_start_date = 476.9.4 - NOT = { has_global_variable = clovis_invasion } - OR = { - AND = { - character:997004 = { - is_alive = yes - is_landed = yes - is_independent_ruler = yes - NOT = { - has_title = title:k_france - } - trigger_if = { - limit = { - title:k_france = { - is_title_created = yes - } - } - NOT = { - OR = { - is_allied_to = title:k_france.holder - AND = { - exists = var:my_suzerain - var:my_suzerain = title:k_france.holder - var:my_suzerain = { - OR = { - is_target_in_variable_list = { name = non_permanent_tributaries target = prev } - is_target_in_variable_list = { name = permanent_tributaries target = prev } - } - } - } - } - } - } - } - character:997005 = { - NOT = { - has_title = title:k_france - } - } - } - AND = { - character:997005 = { - is_alive = yes - is_landed = yes - is_independent_ruler = yes - NOT = { - has_title = title:k_france - } - } - character:997004 = { - NOT = { - has_title = title:k_france - } - } - } - } - AND = { - title:k_france = { - is_title_created = yes - } - title:k_france.holder = { - culture = culture:gallo_roman - } - } - current_date <= 500.1.1 - } - random = { - chance = 0 - modifier = { - add = 5 - current_date >= 478.1.1 - } - modifier = { - add = 10 - current_date >= 479.1.1 - } - modifier = { - add = 35 - current_date >= 480.1.1 - } - modifier = { - add = 50 - current_date >= 481.1.1 - } - set_global_variable = { - name = clovis_invasion - value = yes - } - if = { - limit = { - character:997004 = { - is_alive = yes - is_landed = yes - is_independent_ruler = yes - } - } - character:997004 = { - trigger_event = germanic_events.0003 - } - } - else_if = { - limit = { - character:997005 = { - is_alive = yes - is_landed = yes - is_independent_ruler = yes - } - } - character:997005 = { - trigger_event = germanic_events.0003 - } - } - } + # Persians in Oman + add_culture_minority_effect = { + CULTURE = culture:persian + SIZE = large + COUNTY = title:c_batina + } + add_faith_minority_effect = { + FAITH = faith:mazdayasna + SIZE = large + COUNTY = title:c_batina + } + add_culture_minority_effect = { + CULTURE = culture:persian + SIZE = large + COUNTY = title:c_muscat + } + add_faith_minority_effect = { + FAITH = faith:mazdayasna + SIZE = large + COUNTY = title:c_muscat + } + add_culture_minority_effect = { + CULTURE = culture:persian + SIZE = small + COUNTY = title:c_julfar + } + add_faith_minority_effect = { + FAITH = faith:mazdayasna + SIZE = small + COUNTY = title:c_julfar } - } -} -"common/on_action/death.txt" = { - { - # Fix gods-damned Bavaria splitting from East Francia in an ugly fashion in 867. - if = { - limit = { - # Make sure we're looking at the right guy & that the circumstances haven't changed too much. - this = character:90107 - highest_held_title_tier = tier_kingdom - has_realm_law = confederate_partition_succession_law - # Bavaria should be in a fit state for interfering with the handout order. - title:k_bavaria = { - OR = { - is_title_created = no - holder = root - } - any_in_de_jure_hierarchy = { - tier = tier_county - # More than 50%. - count >= 22 - holder = { - any_liege_or_above = { this = root } - } - } - } - NOT = { has_primary_title = title:k_bavaria } - # Players can sort this themselves: you just need to have Bavaria as your primary title and it's all fine. - is_ai = yes - } - # If we've got no Bavaria, create it. - if = { - limit = { - title:k_bavaria = { is_title_created = no } - } - create_title_and_vassal_change = { - type = created - save_scope_as = change - } - title:k_bavaria = { - change_title_holder = { - holder = root - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - } - # Then switch around. - set_primary_title_to = title:k_bavaria + # Sogdians in Tarim Basin/Dunhuang + add_culture_minority_effect = { + CULTURE = culture:sogdian + SIZE = small + COUNTY = title:c_shazhou + } + add_faith_minority_effect = { + FAITH = faith:khurmazta + SIZE = small + COUNTY = title:c_shazhou + } + add_culture_minority_effect = { + CULTURE = culture:sogdian + SIZE = small + COUNTY = title:c_khotan + } + add_faith_minority_effect = { + FAITH = faith:khurmazta + SIZE = small + COUNTY = title:c_khotan + } + add_culture_minority_effect = { + CULTURE = culture:sogdian + SIZE = small + COUNTY = title:c_yarkand + } + add_faith_minority_effect = { + FAITH = faith:khurmazta + SIZE = small + COUNTY = title:c_yarkand + } + add_culture_minority_effect = { + CULTURE = culture:sogdian + SIZE = small + COUNTY = title:c_kashgar + } + add_faith_minority_effect = { + FAITH = faith:khurmazta + SIZE = small + COUNTY = title:c_kashgar + } + add_culture_minority_effect = { + CULTURE = culture:sogdian + SIZE = small + COUNTY = title:c_kashgar + } + add_faith_minority_effect = { + FAITH = faith:khurmazta + SIZE = small + COUNTY = title:c_kashgar + } + add_culture_minority_effect = { + CULTURE = culture:sogdian + SIZE = small + COUNTY = title:c_karashar + } + add_faith_minority_effect = { + FAITH = faith:khurmazta + SIZE = small + COUNTY = title:c_karashar + } + add_culture_minority_effect = { + CULTURE = culture:sogdian + SIZE = small + COUNTY = title:c_kara_khoja + } + add_faith_minority_effect = { + FAITH = faith:khurmazta + SIZE = small + COUNTY = title:c_kara_khoja + } + add_culture_minority_effect = { + CULTURE = culture:sogdian + SIZE = small + COUNTY = title:c_kucha + } + add_faith_minority_effect = { + FAITH = faith:khurmazta + SIZE = small + COUNTY = title:c_kucha + } + + # Taoist presence in Dunhuang lands + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = small + COUNTY = title:c_kara_khoja + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = large + COUNTY = title:c_shazhou + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = small + COUNTY = title:c_xingqing + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = small + COUNTY = title:c_shunzhou + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = large + COUNTY = title:c_liangzhou + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = large + COUNTY = title:c_fanhe + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = large + COUNTY = title:c_dajing + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = large + COUNTY = title:c_baiyin + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = large + COUNTY = title:c_yongdeng + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = large + COUNTY = title:c_ganzhou + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = small + COUNTY = title:c_linze + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = small + COUNTY = title:c_gaotai + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = small + COUNTY = title:c_jinta + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = small + COUNTY = title:c_suzhou + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = small + COUNTY = title:c_yumen + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = small + COUNTY = title:c_changma + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = small + COUNTY = title:c_hongliuyuan + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = small + COUNTY = title:c_shazhou + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = small + COUNTY = title:c_yumenguan + } + add_faith_minority_effect = { + FAITH = faith:zhengyi + SIZE = small + COUNTY = title:c_subei + } + + # Bedouin presence in the Eastern Delta of Egypt + add_culture_minority_effect = { + CULTURE = culture:bedouin + SIZE = small + COUNTY = title:c_cairo + } + add_culture_minority_effect = { + CULTURE = culture:bedouin + SIZE = large + COUNTY = title:c_sharkiya + } + add_culture_minority_effect = { + CULTURE = culture:bedouin + SIZE = large + COUNTY = title:c_damietta + } + + # Aegyptians in the Delta + add_culture_minority_effect = { + CULTURE = culture:aegyptian + SIZE = large + COUNTY = title:c_sharkiya + } + add_culture_minority_effect = { + CULTURE = culture:aegyptian + SIZE = large + COUNTY = title:c_giza + } + add_culture_minority_effect = { + CULTURE = culture:aegyptian + SIZE = large + COUNTY = title:c_al-gharbiya + } + add_culture_minority_effect = { + CULTURE = culture:aegyptian + SIZE = small + COUNTY = title:c_fayyum + } + add_culture_minority_effect = { + CULTURE = culture:aegyptian + SIZE = small + COUNTY = title:c_asyut + } + add_culture_minority_effect = { + CULTURE = culture:aegyptian + SIZE = small + COUNTY = title:c_qus + } + add_culture_minority_effect = { + CULTURE = culture:aegyptian + SIZE = small + COUNTY = title:c_aswan + } + add_culture_minority_effect = { + CULTURE = culture:aegyptian + SIZE = small + COUNTY = title:c_cairo + } + + # Egyptians in the Delta + add_culture_minority_effect = { + CULTURE = culture:kemetic + SIZE = large + COUNTY = title:c_damietta + } + add_culture_minority_effect = { + CULTURE = culture:kemetic + SIZE = large + COUNTY = title:c_al-buhaira + } + add_culture_minority_effect = { + CULTURE = culture:kemetic + SIZE = large + COUNTY = title:c_alexandria + } + + # Nubians and Beja in Aswan + add_culture_minority_effect = { + CULTURE = culture:beja + SIZE = small + COUNTY = title:c_aswan + } + add_faith_minority_effect = { + FAITH = faith:beja_pagan + SIZE = small + COUNTY = title:c_aswan + } + add_culture_minority_effect = { + CULTURE = culture:nubian + SIZE = small + COUNTY = title:c_aswan + } + add_faith_minority_effect = { + FAITH = faith:kushitism_pagan + SIZE = small + COUNTY = title:c_aswan } - } -} -"common/on_action/diarchy_on_action.txt" = { - { if = { limit = { - scope:old_diarch = character:992020 - exists = title:e_byzantium.holder - NOT = { has_global_variable = gothic_war_cycle_active } - NOT = { has_global_variable = gothic_war_cycle_prep } + game_start_date > 476.1.1 + game_start_date < 580.1.1 } - if = { - limit = { - character:992020 = { - is_alive = no - } - } - title:e_byzantium.holder = { - trigger_event = { - id = germanic_events.0023 - days = 1 - } - } + add_faith_minority_effect = { + FAITH = faith:coptic + SIZE = large + COUNTY = title:c_faras } - else_if = { - limit = { - root = { - mother = character:992020 - } - } - root = { - trigger_event = { - id = germanic_events.0021 - days = 1 - } - } - title:e_byzantium.holder = { - trigger_event = { - id = germanic_events.0022 - days = 1 - } - } + add_faith_minority_effect = { + FAITH = faith:coptic + SIZE = large + COUNTY = title:c_kalabsha } - else_if = { - limit = { - NOT = { - root = { - mother = character:992020 - } - } - } - root = { - trigger_event = { - id = germanic_events.0020 - days = 1 - } - } - title:e_byzantium.holder = { - trigger_event = { - id = germanic_events.0022 - days = 1 - } - } + add_faith_minority_effect = { + FAITH = faith:coptic + SIZE = small + COUNTY = title:c_dongola + } + add_faith_minority_effect = { + FAITH = faith:coptic + SIZE = small + COUNTY = title:c_abwab + } + add_faith_minority_effect = { + FAITH = faith:coptic + SIZE = small + COUNTY = title:c_alodia } } - } -} -"common/on_action/title_on_actions.txt" = { - { - # Am I The Chad? + # Ancient Egypt Pagan remnants and Egyptian religious minorities distribution if = { - limit = { root = character:easteregg_chad_uhl } - set_house = house:house_chad_uhl + limit = { + game_start_date > 476.1.1 + game_start_date < 580.1.1 + } + add_faith_minority_effect = { + FAITH = faith:egyptian_pagan + SIZE = small + COUNTY = title:c_aswan + } } - } -} - -"common/on_action/east_asia_flavor_on_actions.txt" = { - { -on_game_start = { - on_actions = { - on_TFE_east_asia_start - } -} - -on_TFE_east_asia_start = { - effect = { - character:western_liang_043 ?= { - if = { - limit = { - is_alive = yes - is_landed = yes - } - trigger_event = { - id = liang.0012 - days = { 365 2190 } - } + if = { + limit = { + game_start_date < 532.1.1 + } + add_faith_minority_effect = { + FAITH = faith:greco_egyptian_pagan + SIZE = large + COUNTY = title:c_alexandria } } - } -} - } -} + else_if = { + limit = { + game_start_date >= 476.1.1 + } + # If there are Aegyptians/Hellenized Egyptians here, put in Copts + add_faith_minority_effect = { + FAITH = faith:coptic + SIZE = large + COUNTY = title:c_derna + } + add_faith_minority_effect = { + FAITH = faith:coptic + SIZE = large + COUNTY = title:c_tobruk + } + add_faith_minority_effect = { + FAITH = faith:coptic + SIZE = large + COUNTY = title:c_sullum + } + add_faith_minority_effect = { + FAITH = faith:coptic + SIZE = large + COUNTY = title:c_al-buhaira + } + add_faith_minority_effect = { + FAITH = faith:coptic + SIZE = large + COUNTY = title:c_alexandria + } + add_faith_minority_effect = { + FAITH = faith:coptic + SIZE = large + COUNTY = title:c_damietta + } + add_faith_minority_effect = { + FAITH = faith:chalcedonian + SIZE = large + COUNTY = title:c_al-gharbiya + } + add_faith_minority_effect = { + FAITH = faith:chalcedonian + SIZE = large + COUNTY = title:c_cairo + } + add_faith_minority_effect = { + FAITH = faith:chalcedonian + SIZE = large + COUNTY = title:c_giza + } + add_faith_minority_effect = { + FAITH = faith:chalcedonian + SIZE = large + COUNTY = title:c_fayyum + } + add_faith_minority_effect = { + FAITH = faith:chalcedonian + SIZE = large + COUNTY = title:c_qus + } + add_faith_minority_effect = { + FAITH = faith:chalcedonian + SIZE = large + COUNTY = title:c_bahnasa + } + add_faith_minority_effect = { + FAITH = faith:chalcedonian + SIZE = large + COUNTY = title:c_ushmun + } + add_faith_minority_effect = { + FAITH = faith:chalcedonian + SIZE = large + COUNTY = title:c_asyut + } + add_faith_minority_effect = { + FAITH = faith:chalcedonian + SIZE = large + COUNTY = title:c_aswan + } + add_faith_minority_effect = { + FAITH = faith:chalcedonian + SIZE = large + COUNTY = title:c_qusayr + } + add_faith_minority_effect = { + FAITH = faith:chalcedonian + SIZE = large + COUNTY = title:c_farama + } + add_faith_minority_effect = { + FAITH = faith:chalcedonian + SIZE = large + COUNTY = title:c_sinai + } + add_faith_minority_effect = { + FAITH = faith:chalcedonian + SIZE = large + COUNTY = title:c_firaun + } + add_faith_minority_effect = { + FAITH = faith:coptic + SIZE = large + COUNTY = title:c_firaun + } -"common/scripted_triggers/tfe_culture_triggers.txt" = { - { - dynasty = dynasty:nuvelan - } -} + } -"gfx/portraits/portrait_modifiers/50_hairstyles_scripted_characters.txt" = { - { - modifier = { - add = 999 - exists = this - exists = character:aksum_17 #eon - this = character:aksum_17 #eon - } - } - { - modifier = { - add = 999 - exists = this - exists = character:himyarite_30 #Abraha - this = character:himyarite_30 #Abraha - } - } - { - modifier = { - add = 999 - exists = this - exists = character:142 #robert_curthose - this = character:142 #robert_curthose - } - } - { - modifier = { - add = 999 - exists = this - exists = character:70515 #Zeno - this = character:70515 #Zeno - } - } - { - modifier = { - add = 999 - exists = this - exists = character:vigg_04 #Hengest - this = character:vigg_04 #Hengest - } - } - { - modifier = { - add = 999 - exists = this - exists = character:syagri_06 #Syagrus - this = character:syagri_06 #Syagrus - } - } - { - modifier = { - add = 999 - exists = this - exists = character:rugian_03 #Feletheus - this = character:rugian_03 #Feletheus - } - } - { - modifier = { - add = 999 - exists = this - exists = character:6878 #jarl_haesteinn - this = character:6878 #jarl_haesteinn - } - } - { - modifier = { - add = 999 - exists = this - exists = character:aelling_01 #Aelle - this = character:aelling_01 #Aelle - } - } + if = { + limit = { + game_start_date < 400.1.1 + } + add_faith_minority_effect = { + FAITH = faith:marcionite + SIZE = large + COUNTY = title:c_asyut + } + add_faith_minority_effect = { + FAITH = faith:nicene + SIZE = large + COUNTY = title:c_asyut + } + add_faith_minority_effect = { + FAITH = faith:nicene + SIZE = large + COUNTY = title:c_aswan + } + add_faith_minority_effect = { + FAITH = faith:marcionite + SIZE = small + COUNTY = title:c_asyut + } + add_faith_minority_effect = { + FAITH = faith:marcionite + SIZE = small + COUNTY = title:c_aswan + } + add_faith_minority_effect = { + FAITH = faith:nicene + SIZE = small + COUNTY = title:c_qusayr + } - { - modifier = { - add = 999 - exists = this - exists = character:easteregg_elisabeth_gangenes - this = character:easteregg_elisabeth_gangenes - } - } - { - modifier = { - add = 999 - exists = this - exists = character:7757 #duchess_matilda - this = character:7757 #duchess_matilda - } - modifier = { - add = 999 - exists = this - exists = character:102505 #queen_ingebjorg - this = character:102505 #queen_ingebjorg - } - modifier = { - add = 999 - exists = this - exists = character:765 #princess_swietoslawa - this = character:765 #princess_swietoslawa - } - modifier = { - add = 999 - exists = this - exists = character:930551279 #eudoxia - this = character:930551279 #eudoxia - } - modifier = { - add = 999 - exists = this - exists = character:placidia_01 #placidia - this = character:placidia_01 #placidia - } - modifier = { - add = 999 - exists = this - exists = character:900065 #serena - this = character:900065 #serena - } - modifier = { - add = 999 - exists = this - exists = character:992020 #Amalasuntha - this = character:992020 #Amalasuntha } - modifier = { - add = 999 - exists = this - exists = character:992024 #Matasuntha - this = character:992024 #Matasuntha + + # Sardinian pagans + if = { + limit = { + game_start_date <= 600.1.1 + } + add_faith_minority_effect = { + FAITH = faith:sardinian_pagan + SIZE = small + COUNTY = title:c_cagliari + } + add_faith_minority_effect = { + FAITH = faith:sardinian_pagan + SIZE = small + COUNTY = title:c_arborea + } + add_faith_minority_effect = { + FAITH = faith:sardinian_pagan + SIZE = small + COUNTY = title:c_gallura + } + add_faith_minority_effect = { + FAITH = faith:roman_pagan + SIZE = small + COUNTY = title:c_arborea + } + add_faith_minority_effect = { + FAITH = faith:roman_pagan + SIZE = small + COUNTY = title:c_cagliari + } + add_faith_minority_effect = { + FAITH = faith:sardinian_pagan + SIZE = small + COUNTY = title:c_logudoro + } } + if = { + limit = { + game_start_date <= 700.1.1 + } + add_faith_minority_effect = { + FAITH = faith:sardinian_pagan + SIZE = small + COUNTY = title:c_tortoli + } + } + + if = { + limit = { + game_start_date > 476.1.1 + } + # Mauri settled in Sardinia by the Vandals + add_culture_minority_effect = { + CULTURE = culture:maurian + SIZE = large + COUNTY = title:c_cagliari + } + add_culture_minority_effect = { + CULTURE = culture:maurian + SIZE = large + COUNTY = title:c_tortoli + } + add_culture_minority_effect = { + CULTURE = culture:maurian + SIZE = small + COUNTY = title:c_gallura + } + add_culture_minority_effect = { + CULTURE = culture:maurian + SIZE = small + COUNTY = title:c_arborea + } + add_culture_minority_effect = { + CULTURE = culture:maurian + SIZE = small + COUNTY = title:c_logudoro + } + } + + # Southern Mesopotamia + add_faith_minority_effect = { + FAITH = faith:malabarism + SIZE = large + COUNTY = title:c_badaraya + } + add_faith_minority_effect = { + FAITH = faith:bardaisanism + SIZE = small + COUNTY = title:c_badaraya + } + add_faith_minority_effect = { + FAITH = faith:south_mesopotamian_pagan + SIZE = small + COUNTY = title:c_ahvaz + } + add_faith_minority_effect = { + FAITH = faith:south_mesopotamian_pagan + SIZE = large + COUNTY = title:c_ctesiphon + } + add_faith_minority_effect = { + FAITH = faith:south_mesopotamian_pagan + SIZE = large + COUNTY = title:c_batiha + } + add_faith_minority_effect = { + FAITH = faith:south_mesopotamian_pagan + SIZE = large + COUNTY = title:c_kufa + } + add_faith_minority_effect = { + FAITH = faith:south_mesopotamian_pagan + SIZE = small + COUNTY = title:c_anbar + } + add_faith_minority_effect = { + FAITH = faith:south_mesopotamian_pagan + SIZE = small + COUNTY = title:c_samarra + } + add_faith_minority_effect = { + FAITH = faith:bardaisanism + SIZE = large + COUNTY = title:c_rusafa + } + if = { + limit = { + game_start_date < 451.1.1 + } + add_faith_minority_effect = { + FAITH = faith:nicene + SIZE = large + COUNTY = title:c_iskaf + } + add_faith_minority_effect = { + FAITH = faith:nicene + SIZE = large + COUNTY = title:c_badaraya + } + add_faith_minority_effect = { + FAITH = faith:nicene + SIZE = large + COUNTY = title:c_tib + } + add_faith_minority_effect = { + FAITH = faith:nicene + SIZE = large + COUNTY = title:c_rusafa + } + add_faith_minority_effect = { + FAITH = faith:elkesaite + SIZE = large + COUNTY = title:c_baghdad + } + } + if = { + limit = { + game_start_date >= 451.1.1 + game_start_date <= 532.1.1 + } + add_faith_minority_effect = { + FAITH = faith:south_mesopotamian_pagan + SIZE = large + COUNTY = title:c_iskaf + } + add_faith_minority_effect = { + FAITH = faith:south_mesopotamian_pagan + SIZE = large + COUNTY = title:c_baghdad + } + add_faith_minority_effect = { + FAITH = faith:nestorian + SIZE = large + COUNTY = title:c_iskaf + } + add_faith_minority_effect = { + FAITH = faith:nestorian + SIZE = small + COUNTY = title:c_badaraya + } + add_faith_minority_effect = { + FAITH = faith:nestorian + SIZE = small + COUNTY = title:c_tib + } + add_faith_minority_effect = { + FAITH = faith:nestorian + SIZE = large + COUNTY = title:c_rusafa + } + } + if = { + limit = { + game_start_date >= 532.1.1 + #game_start_date <= 600.1.1 + } + add_faith_minority_effect = { + FAITH = faith:south_mesopotamian_pagan + SIZE = small + COUNTY = title:c_iskaf + } + add_faith_minority_effect = { + FAITH = faith:south_mesopotamian_pagan + SIZE = small + COUNTY = title:c_baghdad + } + add_faith_minority_effect = { + FAITH = faith:nestorian + SIZE = large + COUNTY = title:c_iskaf + } + add_faith_minority_effect = { + FAITH = faith:nestorian + SIZE = large + COUNTY = title:c_badaraya + } + add_faith_minority_effect = { + FAITH = faith:nestorian + SIZE = large + COUNTY = title:c_tib + } + add_faith_minority_effect = { + FAITH = faith:nestorian + SIZE = large + COUNTY = title:c_rusafa + } + } + + + + if = { + limit = { + game_start_date <= 600.1.1 + #game_start_date >= 532.1.1 + } + add_faith_minority_effect = { + FAITH = faith:mandeaism + SIZE = large + COUNTY = title:c_karbala + } + add_faith_minority_effect = { + FAITH = faith:bardaisanism + SIZE = small + COUNTY = title:c_baghdad + } + add_faith_minority_effect = { + FAITH = faith:bardaisanism + SIZE = small + COUNTY = title:c_badaraya + } + add_faith_minority_effect = { + FAITH = faith:bardaisanism + SIZE = small + COUNTY = title:c_wasit + } + add_faith_minority_effect = { + FAITH = faith:bardaisanism + SIZE = small + COUNTY = title:c_tib + } + } + + # Gayomarthian sect in major Sassanid centers + + # Can't add to Ctesiphon or else the UI gets weird + # add_faith_minority_effect = { + # FAITH = faith:gayomarthianism + # SIZE = small + # COUNTY = title:c_ctesiphon + # } + add_faith_minority_effect = { + FAITH = faith:gayomarthianism + SIZE = small + COUNTY = title:c_shiraz + } + add_faith_minority_effect = { + FAITH = faith:gayomarthianism + SIZE = small + COUNTY = title:c_isfahan + } + add_faith_minority_effect = { + FAITH = faith:gayomarthianism + SIZE = small + COUNTY = title:c_rayy + } + add_faith_minority_effect = { + FAITH = faith:gayomarthianism + SIZE = small + COUNTY = title:c_herat + } + + # Zoroastrian presence in Christian Iranian lands in the south + add_faith_minority_effect = { + FAITH = faith:mazdayasna + SIZE = large + COUNTY = title:c_shiraz + } + add_faith_minority_effect = { + FAITH = faith:mazdayasna + SIZE = large + COUNTY = title:c_mandestan + } + add_faith_minority_effect = { + FAITH = faith:mazdayasna + SIZE = large + COUNTY = title:c_irahistan + } + add_faith_minority_effect = { + FAITH = faith:mazdayasna + SIZE = large + COUNTY = title:c_sif-i-umara + } + + # Latins/Greeks in Sicily + add_culture_minority_effect = { + CULTURE = culture:greek + SIZE = large + COUNTY = title:c_trapani + } + add_culture_minority_effect = { + CULTURE = culture:greek + SIZE = large + COUNTY = title:c_palermo + } + add_culture_minority_effect = { + CULTURE = culture:roman + SIZE = small + COUNTY = title:c_agrigento + } + add_culture_minority_effect = { + CULTURE = culture:roman + SIZE = small + COUNTY = title:c_messina + } + add_culture_minority_effect = { + CULTURE = culture:roman + SIZE = small + COUNTY = title:c_siracusa + } + add_culture_minority_effect = { + CULTURE = culture:roman + SIZE = small + COUNTY = title:c_reggio_calabria + } + add_culture_minority_effect = { + CULTURE = culture:roman + SIZE = small + COUNTY = title:c_bari + } + + if = { + limit = { + game_start_date <= 600.1.1 + game_start_date >= 476.1.1 + } + add_culture_minority_effect = { + CULTURE = culture:herulian + SIZE = small + COUNTY = title:c_pavia + } + add_culture_minority_effect = { + CULTURE = culture:rugian + SIZE = small + COUNTY = title:c_pavia + } + add_culture_minority_effect = { + CULTURE = culture:scirian + SIZE = small + COUNTY = title:c_pavia + } + add_culture_minority_effect = { + CULTURE = culture:ostrogothic + SIZE = large + COUNTY = title:c_pavia + } + add_faith_minority_effect = { + FAITH = faith:arianism + SIZE = large + COUNTY = title:c_pavia + } + # add_culture_minority_effect = { + # CULTURE = culture:rugian + # SIZE = large + # COUNTY = title:c_cremona + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_cremona + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_cremona + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_aquileia + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_aquileia + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_friuli + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_friuli + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_gorz + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_gorz + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_verona + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_verona + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_treviso + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_treviso + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_padua + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_padua + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_polesine + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_polesine + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_monferrato + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_monferrato + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_turin + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_turin + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_novara + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_novara + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_cuneo + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_cuneo + # } + # add_culture_minority_effect = { + # CULTURE = culture:rugian + # SIZE = large + # COUNTY = title:c_lombardia + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_lombardia + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_lombardia + # } + # add_culture_minority_effect = { + # CULTURE = culture:rugian + # SIZE = large + # COUNTY = title:c_brescia + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_brescia + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_como + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_como + # } + # add_culture_minority_effect = { + # CULTURE = culture:rugian + # SIZE = large + # COUNTY = title:c_trent + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_trent + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_trent + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_parma + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_parma + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_tortona + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_tortona + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_genoa + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_genoa + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_luni + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_luni + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_modena + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_modena + # } + # add_culture_minority_effect = { + # CULTURE = culture:rugian + # SIZE = large + # COUNTY = title:c_mantua + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_mantua + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_mantua + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_pisa + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_pisa + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_firenze + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_firenze + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_lucca + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_lucca + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_arezzo + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_arezzo + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_siena + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_siena + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_orbetello + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_orbetello + # } + add_culture_minority_effect = { + CULTURE = culture:herulian + SIZE = small + COUNTY = title:c_ravenna + } + add_culture_minority_effect = { + CULTURE = culture:rugian + SIZE = small + COUNTY = title:c_ravenna + } + add_culture_minority_effect = { + CULTURE = culture:scirian + SIZE = small + COUNTY = title:c_ravenna + } + add_culture_minority_effect = { + CULTURE = culture:ostrogothic + SIZE = large + COUNTY = title:c_ravenna + } + add_faith_minority_effect = { + FAITH = faith:arianism + SIZE = large + COUNTY = title:c_ravenna + } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_bologna + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_bologna + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_ferrara + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_ferrara + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_casentino + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_ancona + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_ancona + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_ancona + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_urbino + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_urbino + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_spoleto + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_spoleto + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_orvieto + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_orvieto + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_teramo + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_teramo + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_lanciano + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_lanciano + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_abruzzi + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_abruzzi + # } + add_culture_minority_effect = { + CULTURE = culture:herulian + SIZE = small + COUNTY = title:c_roma + } + add_culture_minority_effect = { + CULTURE = culture:rugian + SIZE = small + COUNTY = title:c_roma + } + add_culture_minority_effect = { + CULTURE = culture:scirian + SIZE = small + COUNTY = title:c_roma + } + add_culture_minority_effect = { + CULTURE = culture:ostrogothic + SIZE = large + COUNTY = title:c_roma + } + add_faith_minority_effect = { + FAITH = faith:arianism + SIZE = large + COUNTY = title:c_roma + } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_viterbo + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_viterbo + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_tivoli + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_tivoli + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_napoli + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_napoli + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_capua + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_capua + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_salerno + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_salerno + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_benevento + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_benevento + # } + # add_culture_minority_effect = { + # CULTURE = culture:ostrogothic + # SIZE = large + # COUNTY = title:c_foggia + # } + # add_faith_minority_effect = { + # FAITH = faith:arianism + # SIZE = large + # COUNTY = title:c_foggia + # } + } + + # Small Buddhist presence attested in Red Sea/Southeast Egypt, per recommendations by Luthien and Soraya + if = { + limit = { + game_start_date < 500.1.1 + } + add_culture_minority_effect = { + CULTURE = culture:saurashtri + SIZE = small + COUNTY = title:c_qusayr + } + add_faith_minority_effect = { + FAITH = faith:mahasanghika + SIZE = small + COUNTY = title:c_qusayr + } + } + + + # Socotra, most diverse place on the planet :cool glasses emoji: + if = { + limit = { + game_start_date < 500.1.1 + } + add_culture_minority_effect = { + CULTURE = culture:greek + SIZE = small + COUNTY = title:c_socotra + } + add_culture_minority_effect = { + CULTURE = culture:nabatean + SIZE = small + COUNTY = title:c_socotra + } + } + add_culture_minority_effect = { + CULTURE = culture:saurashtri + SIZE = small + COUNTY = title:c_socotra + } + add_faith_minority_effect = { + FAITH = faith:shaivism + SIZE = small + COUNTY = title:c_socotra + } + add_culture_minority_effect = { + CULTURE = culture:himyarite + SIZE = small + COUNTY = title:c_socotra + } + add_culture_minority_effect = { + CULTURE = culture:persian + SIZE = small + COUNTY = title:c_socotra + } + add_faith_minority_effect = { + FAITH = faith:mazdayasna + SIZE = small + COUNTY = title:c_socotra + } + add_culture_minority_effect = { + CULTURE = culture:ethiopian + SIZE = small + COUNTY = title:c_socotra + } + + # Manichaeans in Dakhla + add_faith_minority_effect = { + FAITH = faith:manichean + SIZE = small + COUNTY = title:c_dakhla + } + + # Remnants of Emesa Pagan/worship of Elagabal in Emesa + if = { + limit = { + game_start_date > 476.1.1 + game_start_date < 500.1.1 + } + add_faith_minority_effect = { + FAITH = faith:emesa_pagan + SIZE = small + COUNTY = title:c_homs + } + } + } +} } + { - modifier = { - add = 999 - exists = this - exists = character:108501 #infanta_urraca - this = character:108501 #infanta_urraca - } - modifier = { - add = 999 - exists = this - exists = character:131 #eadgifu_the_fair - this = character:131 #eadgifu_the_fair - } - } - { - modifier = { - add = 999 - exists = this - exists = character:633 #queen_yelizaveta - this = character:633 #queen_yelizaveta - } + set_minorities_game_start } +} + +"common/on_action/government_change_on_actions.txt" = { { - modifier = { - add = 999 - exists = this - exists = character:easteregg_bianca_savazzi - this = character:easteregg_bianca_savazzi - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_claudia_baldassi - this = character:easteregg_claudia_baldassi - } + NOT = { + THIS = character:taifal_01 + } } { - modifier = { - add = 999 - exists = this - exists = character:6863 #ingrid_bjornsdottir - this = character:6863 #ingrid_bjornsdottir - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_linnea_thimren - this = character:easteregg_linnea_thimren - } + NOT = { + THIS = character:alan_13 + } } { - modifier = { - add = 999 - exists = this - exists = character:6839 #iliana_of_uppland - this = character:6839 #iliana_of_uppland - } - modifier = { - add = 999 - exists = this - exists = character:161257 #queen_wyszeslawa - this = character:161257 #queen_wyszeslawa - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_steacy_mcilwham - this = character:easteregg_steacy_mcilwham - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_katya_boestad - this = character:easteregg_katya_boestad - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_tegan_harris - this = character:easteregg_tegan_harris - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_bahar_shefket - this = character:easteregg_bahar_shefket - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_alexia_belfort - this = character:easteregg_alexia_belfort - } + NOT = { + THIS = character:persian_armenia_01 + } + NOT = { + THIS = character:159564 + } + NOT = { + THIS = character:159858 + } + NOT = { + THIS = character:159853 + } + NOT = { + THIS = character:159995 + } + NOT = { + THIS = character:159892 + } } { - modifier = { - add = 999 - exists = this - exists = character:997005 #Chlodovech - this = character:997005 #Chlodovech - } - modifier = { - add = 999 - exists = character:997013 #Chlothar - this = character:997013 #Chlothar - } - modifier = { - add = 999 - exists = this - exists = character:997015 #Theodobert - this = character:997015 #Theodobert - } + title:e_mongolia = { + every_in_de_jure_hierarchy = { + limit = { + is_title_created = yes + } + holder = { + if = { + limit = { + has_government = tribal_government + } + change_government = nomadic_government + } + } + } + } + title:e_siberia = { + every_in_de_jure_hierarchy = { + limit = { + is_title_created = yes + } + holder = { + if = { + limit = { + has_government = tribal_government + } + change_government = nomadic_government + } + } + } + } + title:e_volga-ural = { + every_in_de_jure_hierarchy = { + limit = { + is_title_created = yes + } + holder = { + if = { + limit = { + has_government = tribal_government + } + change_government = nomadic_government + } + } + } + } + title:e_tartaria = { + every_in_de_jure_hierarchy = { + limit = { + is_title_created = yes + } + holder = { + if = { + limit = { + has_government = tribal_government + } + change_government = nomadic_government + } + } + } + } + title:k_oghuz_il = { + every_in_de_jure_hierarchy = { + limit = { + is_title_created = yes + } + holder = { + if = { + limit = { + has_government = tribal_government + } + change_government = nomadic_government + } + } + } + } + title:e_rajastan = { + every_in_de_jure_hierarchy = { + limit = { + is_title_created = yes + } + holder = { + if = { + limit = { + culture ?= { + has_cultural_tradition = tradition_gana_sangha + } + government_has_flag = government_is_tribal + } + change_government = gana_sangha_government + primary_title = { + add_title_law = gana_sangha_elective_succession_law + } + } + } + } + } } + + # Anachronistic { - modifier = { - add = 999 - exists = this - exists = character:123 #queen_ealdgyth - this = character:123 #queen_ealdgyth - } - modifier = { - add = 999 - exists = this - exists = character:367 #duchess_mathilde - this = character:367 #duchess_mathilde - } + if = { + limit = { + AND = { + title:k_croatia = { + is_title_created = yes + } + title:k_croatia.holder ?= { + game_start_date = 476.9.4 + } + } + } + title:k_croatia.holder ?= { + if = { + limit = { + highest_held_title_tier >= tier_kingdom + has_dlc_feature = roads_to_power + } + change_government = autocratic_government_ep3 + } + else_if = { + change_government = autocratic_government + } + every_vassal_or_below = { + limit = { + OR = { + has_government = feudal_government + has_government = republic_government + } + } + if = { + limit = { + highest_held_title_tier >= tier_barony + has_dlc_feature = roads_to_power + } + change_government = autocratic_government_ep3 + } + else_if = { + limit = { + highest_held_title_tier >= tier_barony + } + change_government = autocratic_government + } + } + } + } } + + # Anachronistic { - modifier = { - add = 999 - exists = this - exists = character:145072 #Focas - this = character:145072 #Focas - } - modifier = { - add = 999 - exists = this - exists = character:145071 #Heraclius - this = character:145071 #Heraclius - } - modifier = { - add = 999 - exists = this - exists = character:armenian_01 #Narses - this = character:armenian_01 #Narses - } - modifier = { - add = 999 - exists = this - exists = character:greek_17 #Plutarch - this = character:greek_17 #Plutarch - } + if = { + limit = { + AND = { + title:k_france = { + is_title_created = yes + } + title:k_croatia.holder ?= { + game_start_date = 476.9.4 + } + } + } + title:k_france.holder ?= { + if = { + limit = { + highest_held_title_tier >= tier_kingdom + has_dlc_feature = roads_to_power + } + change_government = autocratic_government_ep3 + } + else_if = { + change_government = autocratic_government + } + every_vassal_or_below = { + limit = { + OR = { + has_government = feudal_government + has_government = republic_government + } + + } + if = { + limit = { + highest_held_title_tier >= tier_barony + has_dlc_feature = roads_to_power + } + change_government = autocratic_government_ep3 + } + else_if = { + limit = { + highest_held_title_tier >= tier_barony + } + change_government = autocratic_government + } + } + } + } } + + # Anachronistic { - modifier = { - add = 999 - exists = this - exists = character:6448 #count_eudes - this = character:6448 #count_eudes - } - modifier = { - add = 999 - exists = this - exists = character:107500 #king_sancho - this = character:107500 #king_sancho - } - modifier = { - add = 999 - exists = this - exists = character:214 #king_philippe - this = character:214 #king_philippe - } - modifier = { - add = 999 - exists = this - exists = character:146 #william_the_red - this = character:146 #william_the_red - } + if = { + limit = { + current_date = 476.9.4 + } + title:k_visigoths.holder ?= { + change_government = roman_government + every_held_title = { + limit = { + AND = { + tier = tier_county + NOT = { + title_province = { + has_holding_type = estate_holding + } + } + } + } + title_province = { + set_holding_type = estate_holding + } + } + every_vassal_or_below = { + limit = { + has_government = feudal_government + } + change_government = roman_government + every_held_title = { + limit = { + AND = { + tier = tier_county + NOT = { + title_province = { + has_holding_type = estate_holding + } + } + } + } + title_province = { + set_holding_type = estate_holding + } + } + } + } + title:e_spain = { + every_in_de_jure_hierarchy = { + limit = { + AND = { + tier = tier_county + holder = { + OR = { + government_has_flag = government_is_autocratic + government_has_flag = government_is_autocratic_ep3 + } + } + holder = { + highest_held_title_tier = tier_county + } + } + } + holder = { + change_government = roman_government + every_held_title = { + limit = { + AND = { + tier = tier_county + NOT = { + title_province = { + has_holding_type = estate_holding + } + } + } + } + title_province = { + set_holding_type = estate_holding + } + } + } + } + } + title:k_italy.holder ?= { + change_government = roman_government + every_held_title = { + limit = { + AND = { + tier = tier_county + NOT = { + title_province = { + has_holding_type = estate_holding + } + } + } + } + title_province = { + set_holding_type = estate_holding + } + } + every_vassal_or_below = { + limit = { + has_government = feudal_government + } + change_government = roman_government + every_held_title = { + limit = { + AND = { + tier = tier_county + NOT = { + title_province = { + has_holding_type = estate_holding + } + } + } + } + title_province = { + set_holding_type = estate_holding + } + } + } + } + } + if = { + limit = { + current_date = 532.2.1 + } + title:k_visigoths.holder ?= { + change_government = roman_government + every_held_title = { + limit = { + AND = { + tier = tier_county + NOT = { + title_province = { + has_holding_type = estate_holding + } + } + } + } + title_province = { + set_holding_type = estate_holding + } + } + every_vassal_or_below = { + limit = { + OR = { + has_government = feudal_government + has_government = autocratic_government + has_government = autocratic_government_ep3 + } + } + change_government = roman_government + every_held_title = { + limit = { + AND = { + tier = tier_county + NOT = { + title_province = { + has_holding_type = estate_holding + } + } + } + } + title_province = { + set_holding_type = estate_holding + } + } + } + } + title:e_spain = { + every_in_de_jure_hierarchy = { + limit = { + AND = { + tier = tier_county + holder = { + OR = { + government_has_flag = government_is_autocratic + government_has_flag = government_is_autocratic_ep3 + } + } + holder = { + highest_held_title_tier = tier_county + } + } + } + holder = { + change_government = roman_government + every_held_title = { + limit = { + AND = { + tier = tier_county + NOT = { + title_province = { + has_holding_type = estate_holding + } + } + } + } + title_province = { + set_holding_type = estate_holding + } + } + } + } + } + title:k_ostrogoths.holder ?= { + change_government = roman_government + every_held_title = { + limit = { + AND = { + tier = tier_county + NOT = { + title_province = { + has_holding_type = estate_holding + } + } + } + } + title_province = { + set_holding_type = estate_holding + } + } + every_vassal_or_below = { + limit = { + has_government = feudal_government + } + change_government = roman_government + every_held_title = { + limit = { + AND = { + tier = tier_county + NOT = { + title_province = { + has_holding_type = estate_holding + } + } + } + } + title_province = { + set_holding_type = estate_holding + } + } + } + } + } } +} + +"common/on_action/tribs_on_action.txt" = { { - modifier = { - add = 999 - exists = this - exists = character:163112 #halfdan_whiteshirt - this = character:163112 #halfdan_whiteshirt - } - modifier = { - add = 999 - exists = this - exists = character:30228 #king_louis - this = character:30228 #king_louis - } - modifier = { - add = 999 - exists = this - exists = character:984 #king_malcom - this = character:984 #king_malcom - } - modifier = { - add = 999 - exists = this - exists = character:212892 #ota_the_handsome - this = character:212892 #ota_the_handsome - } - modifier = { - add = 999 - exists = this - exists = character:762 #king_boleslaw - this = character:762 #king_boleslaw - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_joel_hansson - this = character:easteregg_joel_hansson - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_peter_johannesson - this = character:easteregg_peter_johannesson - } - modifier = { + if = { + limit = { + AND = { + game_start_date > 361.1.1 + game_start_date < 362.1.1 + } + } + ###GUPTAS + # Kushans + if = { + limit = { + AND = { + exists = character:kushan_014 + exists = character:900963 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:kushan_014 + SUZERAIN = character:900963 + } + } + # Madrakas + if = { + limit = { + AND = { + exists = character:matraka_01 + exists = character:900963 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:matraka_01 + SUZERAIN = character:900963 + } + } + # Yaudheyas + if = { + limit = { + AND = { + exists = character:yaudheya_01 + exists = character:900963 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:yaudheya_01 + SUZERAIN = character:900963 + } + } + # Malavas + #if = { + # limit = { + # AND = { + # exists = character:malava_01 + # exists = character:900963 + # } + # } + # make_tributary = { + # TYPE = tributary_permanent + # TRIBUTARY = character:malava_01 + # SUZERAIN = character:900963 + # } + #} + # Arjunayanas + #if = { + # limit = { + # AND = { + # exists = character:guptasad_32 + # exists = character:900963 + # } + # } + # make_tributary = { + # TYPE = tributary_permanent + # TRIBUTARY = character:guptasad_32 + # SUZERAIN = character:900963 + # } + #} + # Karttripuras + if = { + limit = { + AND = { + exists = character:karttripura_01 + exists = character:900963 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:karttripura_01 + SUZERAIN = character:900963 + } + } + # Nepal/Licchavis + if = { + limit = { + AND = { + exists = character:licchavi_02 + exists = character:900963 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:licchavi_02 + SUZERAIN = character:900963 + } + } + # Kamarupa + if = { + limit = { + AND = { + exists = character:190054 + exists = character:900963 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:190054 + SUZERAIN = character:900963 + } + } + # Davakas + if = { + limit = { + AND = { + exists = character:davaka_01 + exists = character:900963 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:davaka_01 + SUZERAIN = character:900963 + } + } + # Samatatas + #if = { + # limit = { + # AND = { + # exists = character:samatata_01 + # exists = character:900963 + # } + # } + # make_tributary = { + # TYPE = tributary_permanent + # TRIBUTARY = character:samatata_01 + # SUZERAIN = character:900963 + # } + #} + # Kosalas + if = { + limit = { + AND = { + exists = character:orissa_01 + exists = character:900963 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:orissa_01 + SUZERAIN = character:900963 + } + } + #Mahakantara + if = { + limit = { + AND = { + exists = character:orissa_02 + exists = character:900963 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:orissa_02 + SUZERAIN = character:900963 + } + } + # Salankayanas + if = { + limit = { + AND = { + exists = character:salankayana_01 + exists = character:900963 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:salankayana_01 + SUZERAIN = character:900963 + } + } + #Avamuktas + if = { + limit = { + AND = { + exists = character:orissa_06 + exists = character:900963 + } + + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:orissa_06 + SUZERAIN = character:900963 + } + } + #Dhananjayids + if = { + limit = { + AND = { + exists = character:orissa_08 + exists = character:900963 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:orissa_08 + SUZERAIN = character:900963 + } + } + + # Abyssinia Tributaries in Kush/Nubia + if = { + limit = { + AND = { + exists = character:meroitic_misc_01 + exists = character:aksum_12 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:meroitic_misc_01 + SUZERAIN = character:aksum_12 + } + } + if = { + limit = { + AND = { + exists = character:dinka_01 + exists = character:aksum_12 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:dinka_01 + SUZERAIN = character:aksum_12 + } + } + if = { + limit = { + AND = { + exists = character:dinka_05 + exists = character:aksum_12 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:dinka_05 + SUZERAIN = character:aksum_12 + } + } + if = { + limit = { + AND = { + exists = character:dinka_09 + exists = character:aksum_12 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:dinka_09 + SUZERAIN = character:aksum_12 + } + } + character:990016 = { + add_prestige = 1500 + add_gold = 250 + spawn_army = { + name = "Hunnic Migrators" + levies = 1000 + men_at_arms = { + type = horse_archers + stacks = 5 + } + men_at_arms = { + type = light_footmen + stacks = 5 + } + men_at_arms = { + type = siege_towers + stacks = 5 + } + location = title:b_itil.title_province + inheritable = no + } + spawn_army = { + name = "Hunnic Migrators" + levies = 1000 + men_at_arms = { + type = light_horsemen + stacks = 5 + } + men_at_arms = { + type = horse_archers + stacks = 5 + } + men_at_arms = { + type = siege_towers + stacks = 5 + } + location = title:b_engels.title_province + inheritable = no + } + } + } + if = { + limit = { + AND = { + game_start_date > 394.1.1 + game_start_date < 396.1.1 + } + } + ###EASTERN ROMAN + if = { + limit = { + AND = { + exists = character:judham_11 + exists = character:70519 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:judham_11 + SUZERAIN = character:70519 + } + } + if = { + limit = { + AND = { + exists = character:amilah_01 + exists = character:70519 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:amilah_01 + SUZERAIN = character:70519 + } + } + if = { + limit = { + AND = { + exists = character:lazika_03 + exists = character:70519 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:lazika_03 + SUZERAIN = character:70519 + } + } + if = { + limit = { + AND = { + exists = character:tanukhid_011 + exists = character:70519 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:tanukhid_011 + SUZERAIN = character:70519 + } + } + + ###GUPTAS + # Madrakas + #if = { + # limit = { + # AND = { + # exists = character:matraka_01 + # exists = character:2020123 + # } + # } + # make_tributary = { + # TYPE = tributary_permanent + # TRIBUTARY = character:matraka_01 + # SUZERAIN = character:2020123 + # } + #} + # Yaudheyas + if = { + limit = { + AND = { + exists = character:yaudheya_01 + exists = character:2020123 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:yaudheya_01 + SUZERAIN = character:2020123 + } + } + # Karttripuras + if = { + limit = { + AND = { + exists = character:karttripura_02 + exists = character:2020123 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:karttripura_02 + SUZERAIN = character:2020123 + } + } + # Nepal/Licchavis + if = { + limit = { + AND = { + exists = character:licchavi_02 + exists = character:2020123 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:licchavi_02 + SUZERAIN = character:2020123 + } + } + # Kamarupa + if = { + limit = { + AND = { + exists = character:190055 + exists = character:2020123 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:190055 + SUZERAIN = character:2020123 + } + } + # Davakas + if = { + limit = { + AND = { + exists = character:davaka_01 + exists = character:2020123 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:davaka_01 + SUZERAIN = character:2020123 + } + } + # Samatatas + #if = { + # limit = { + # AND = { + # exists = character:samatata_01 + # exists = character:2020123 + # } + # } + # make_tributary = { + # TYPE = tributary_permanent + # TRIBUTARY = character:samatata_01 + # SUZERAIN = character:2020123 + # } + #} + } + if = { + limit = { + game_start_date = 476.9.4 + } + if = { + limit = { + AND = { + exists = character:996002 + exists = character:70515 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:996002 + SUZERAIN = character:70515 + } + } + if = { + limit = { + AND = { + exists = character:tanukhid_03 + exists = character:70515 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:tanukhid_03 + SUZERAIN = character:70515 + } + } + if = { + limit = { + AND = { + exists = character:lazika_05 + exists = character:70515 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:lazika_05 + SUZERAIN = character:70515 + } + } + character:strabo_02 ?= { + spawn_army = { + name = "Zeno's Auxiliaries" + levies = 1000 + men_at_arms = { + type = palatinae + #type = armored_footmen + stacks = 2 + } + men_at_arms = { + type = comitatenses + #type = armored_footmen + stacks = 2 + } + location = title:c_turnovo.title_province + inheritable = no + } + } + character:992016 ?= { + spawn_army = { + name = "Ostrogoth Invaders" + levies = 3000 + men_at_arms = { + type = bowmen + stacks = 5 + } + men_at_arms = { + type = light_horsemen + stacks = 5 + } + men_at_arms = { + type = light_footmen + stacks = 10 + } + men_at_arms = { + type = siege_towers + stacks = 3 + } + location = capital_province + inheritable = no + } + } + character:yujiulu_10 ?= { + dynasty = { + add_dynasty_modifier = rouran_khagans + } + } + } + + ###WESTERN ROMAN AND AFRICAN + if = { + limit = { + AND = { + game_start_date > 394.1.1 + game_start_date < 396.1.1 + } + } + if = { + limit = { + AND = { + exists = character:159009 + exists = character:145227 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:159009 + SUZERAIN = character:145227 + } + } + if = { + limit = { + AND = { + exists = character:mauri_18 + exists = character:145227 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:mauri_18 + SUZERAIN = character:145227 + } + } + if = { + limit = { + AND = { + exists = character:afroroman_01 + exists = character:145227 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:afroroman_01 + SUZERAIN = character:145227 + } + } + if = { + limit = { + AND = { + exists = character:mauri_28 + exists = character:mauri_18 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:mauri_28 + SUZERAIN = character:mauri_18 + } + } + if = { + limit = { + AND = { + exists = character:mauri_23 + exists = character:145227 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:mauri_23 + SUZERAIN = character:145227 + } + } + } + + if = { + limit = { + AND = { + game_start_date > 360.1.1 + game_start_date < 362.1.1 + } + } + if = { + limit = { + AND = { + exists = character:afroroman_01 + exists = character:145237 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:afroroman_01 + SUZERAIN = character:145237 + } + } + if = { + limit = { + AND = { + exists = character:mauri_17 + exists = character:145237 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:mauri_17 + SUZERAIN = character:145237 + } + } + if = { + limit = { + AND = { + exists = character:arsacid_46 + exists = character:145237 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:arsacid_46 + SUZERAIN = character:145237 + } + } + if = { + limit = { + AND = { + exists = character:mauri_27 + exists = character:mauri_17 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:mauri_27 + SUZERAIN = character:mauri_17 + } + } + if = { + limit = { + AND = { + exists = character:mauri_22 + exists = character:145237 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:mauri_22 + SUZERAIN = character:145237 + } + } + ###PERSIANS + if = { + limit = { + AND = { + exists = character:159582 + exists = character:180617 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:159582 + SUZERAIN = character:180617 + } + } + if = { + limit = { + AND = { + exists = character:159758 + exists = character:180617 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:159758 + SUZERAIN = character:180617 + } + } + if = { + limit = { + AND = { + exists = character:lakhmid_03 + exists = character:180617 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:lakhmid_03 + SUZERAIN = character:180617 + } + } + if = { + limit = { + AND = { + exists = character:khinda_05 + exists = character:himyar_11 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:khinda_05 + SUZERAIN = character:himyar_11 + } + } + #character:990016 ?= { + # add_gold = 250 + # spawn_army = { + # name = "Hunnic Invaders" + # levies = 2000 + # men_at_arms = { + # type = light_horsemen + # stacks = 15 + # } + # men_at_arms = { + # type = horse_archers + # stacks = 15 + # } + # men_at_arms = { + # type = siege_towers + # stacks = 5 + # } + # location = capital_province + # inheritable = no + # } + # spawn_army = { + # name = "Hunnic Invaders" + # levies = 1000 + # men_at_arms = { + # type = light_horsemen + # stacks = 10 + # } + # men_at_arms = { + # type = horse_archers + # stacks = 10 + # } + # men_at_arms = { + # type = siege_towers + # stacks = 5 + # } + # location = capital_province + # inheritable = yes + # } + #} + } + + ###PERSIAN + if = { + limit = { + AND = { + game_start_date > 394.1.1 + game_start_date < 396.1.1 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:lakhmid_06 + SUZERAIN = character:180618 + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:159583 + SUZERAIN = character:180618 + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:159761 + SUZERAIN = character:180618 + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:arsacid_58 + SUZERAIN = character:180618 + } + } + if = { + limit = { + AND = { + game_start_date > 475.1.1 + game_start_date < 477.1.1 + } + } + if = { + limit = { + AND = { + exists = character:lakhmid_08 + exists = character:180624 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:lakhmid_08 + SUZERAIN = character:180624 + } + } + if = { + limit = { + AND = { + exists = character:159766 + exists = character:180624 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:159766 + SUZERAIN = character:180624 + } + } + if = { + limit = { + AND = { + exists = character:159859 + exists = character:180624 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:159859 + SUZERAIN = character:180624 + } + } + } + + ###GUPTA + if = { + limit = { + AND = { + game_start_date > 394.1.1 + game_start_date < 396.1.1 + } + } + if = { + limit = { + AND = { + exists = character:salankayana_02 + exists = character:2020123 + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = character:salankayana_02 + SUZERAIN = character:2020123 + } + } + } + + ###532 BM Caucasus + if = { + limit = { + AND = { + game_start_date > 530.1.1 + game_start_date < 540.1.1 + } + } + if = { + limit = { + AND = { + exists = title:d_abkhazia.holder + exists = title:e_byzantium.holder + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = title:d_abkhazia.holder + SUZERAIN = title:e_byzantium.holder + } + } + if = { + limit = { + AND = { + exists = title:d_georgia.holder + exists = title:e_persia.holder + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = title:d_georgia.holder + SUZERAIN = title:e_persia.holder + } + } + if = { + limit = { + AND = { + exists = title:d_albania.holder + exists = title:e_persia.holder + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = title:d_albania.holder + SUZERAIN = title:e_persia.holder + } + } + if = { + limit = { + AND = { + exists = title:k_lakhmid.holder + exists = title:e_persia.holder + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = title:k_lakhmid.holder + SUZERAIN = title:e_persia.holder + } + } + if = { + limit = { + AND = { + exists = title:k_ghassanid.holder + exists = title:e_byzantium.holder + } + } + make_tributary = { + TYPE = tributary_permanent + TRIBUTARY = title:k_ghassanid.holder + SUZERAIN = title:e_byzantium.holder + } + } + } + + #I'm too lazy to make another file :p + if = { + limit = { + game_start_date = 476.9.4 + } + title:k_italy.holder ?= { + add_gold = 200 + spawn_army = { + name = "Scirian Invaders" + levies = 1500 + men_at_arms = { + type = bowmen + stacks = 3 + } + men_at_arms = { + type = light_horsemen + stacks = 2 + } + men_at_arms = { + type = light_footmen + stacks = 4 + } + location = capital_province + inheritable = no + } + spawn_army = { + name = "Scirian Invaders" + levies = 1500 + men_at_arms = { + type = bowmen + stacks = 3 + } + men_at_arms = { + type = light_horsemen + stacks = 2 + } + men_at_arms = { + type = light_footmen + stacks = 4 + } + location = capital_province + inheritable = yes + } + } + title:k_visigoths.holder ?= { + add_gold = 300 + spawn_army = { + name = gothic_event_troops + levies = 2000 + men_at_arms = { + type = bowmen + stacks = 2 + } + men_at_arms = { + type = light_horsemen + stacks = 2 + } + men_at_arms = { + type = light_footmen + stacks = 4 + } + location = capital_province + inheritable = no + } + spawn_army = { + name = gothic_event_troops + levies = 2000 + men_at_arms = { + type = bowmen + stacks = 2 + } + men_at_arms = { + type = light_horsemen + stacks = 2 + } + men_at_arms = { + type = light_footmen + stacks = 4 + } + location = capital_province + inheritable = yes + } + } + } + else_if = { + limit = { + AND = { + game_start_date > 394.1.1 + game_start_date < 396.1.1 + } + } + title:e_western_roman_empire.holder ?= { + add_gold = 1000 + } + title:e_byzantium.holder ?= { + add_gold = 1000 + } + character:200290 = { + remove_claim = title:d_muntenia + } + character:balamer_01 ?= { + add_prestige = 3000 + spawn_army = { + name = "Hunnic Invaders" + levies = 2000 + men_at_arms = { + type = horse_archers + stacks = 10 + } + men_at_arms = { + type = light_footmen + stacks = 20 + } + men_at_arms = { + type = siege_towers + stacks = 5 + } + location = title:b_peremyshl.title_province + inheritable = no + } + spawn_army = { + name = "Hunnic Invaders" + levies = 2000 + men_at_arms = { + type = light_horsemen + stacks = 10 + } + men_at_arms = { + type = horse_archers + stacks = 10 + } + men_at_arms = { + type = light_footmen + stacks = 10 + } + men_at_arms = { + type = siege_towers + stacks = 5 + } + location = title:b_stoenesti.title_province + inheritable = no + } + } + character:990000 ?= { + spawn_army = { + name = "Hunnic Invaders" + levies = 2000 + men_at_arms = { + type = light_horsemen + stacks = 10 + } + men_at_arms = { + type = horse_archers + stacks = 10 + } + men_at_arms = { + type = siege_towers + stacks = 5 + } + location = capital_province + inheritable = no + } + } + character:yujiulu_072 ?= { + add_prestige = 500 + spawn_army = { + name = "Rouran Invaders" + levies = 1000 + men_at_arms = { + type = light_horsemen + stacks = 3 + } + men_at_arms = { + type = horse_archers + stacks = 3 + } + men_at_arms = { + type = siege_towers + stacks = 2 + } + location = capital_province + inheritable = yes + } + } + } + } +} + +"common/on_action/TFE_title_on_actions.txt" = { + { + if = { + limit = { + scope:title = title:k_ostrogoths + root = { is_greek_or_roman = no } + NOT = { exists = global_var:gothic_war_won } + character:992020 = { + is_alive = yes + NOT = { + THIS = root.mother + } + } + OR = { + debug_log_details = "Check Conditions" + #root = { has_active_diarchy = yes } + #scope:title.holder = { has_active_diarchy = yes } + root = { diarch = character:992020 } + scope:title.holder = { diarch = character:992020 } + #character:992020 = { is_diarch = yes } + #character:992020 = { is_designated_diarch = yes } + character:992020 = { is_diarch_of_target = root } + character:992020 = { is_diarch_of_target = scope:title.holder } + } + } + scope:title.holder = { + trigger_event = { + id = germanic_events.0019 + days = 1 + } + } + } + } +} + +"common/on_action/TFE_yearly_on_actions.txt" = { + { + if = { + limit = { + current_date > 400.1.1 + current_date < 450.1.1 + NOT = { has_global_variable = attila_spawn } + title:e_hunnic_empire.holder = { + is_adult = yes + } + } + random = { + chance = 30 + modifier = { + add = 20 + current_date >= 405.1.1 + } + modifier = { + add = 20 + current_date >= 410.1.1 + } + modifier = { + add = 10 + current_date >= 415.1.1 + } + set_global_variable = { + name = attila_spawn + value = yes + } + trigger_event = { + id = steppe.6666 + days = { 1 2 } + } + } + } + if = { + limit = { + current_date > 533.1.1 + NOT = { has_global_variable = gothic_war_cycle_active } + exists = title:e_byzantium.holder + exists = title:k_ostrogoths.holder + exists = title:k_italy.holder + title:k_ostrogoths.holder = title:k_italy.holder + title:k_ostrogoths.holder = { + is_independent_ruler = yes + } + character:992020 = { + is_alive = yes + liege = title:k_ostrogoths.holder + } + title:k_ostrogoths.holder = { + has_active_diarchy = yes + diarch = character:992020 + } + } + random = { + chance = 10 + modifier = { + add = 10 + current_date >= 534.1.1 + } + modifier = { + add = 10 + current_date >= 535.1.1 + } + modifier = { + add = 15 + current_date >= 536.1.1 + } + modifier = { + add = 15 + current_date >= 537.1.1 + } + modifier = { + add = 15 + current_date >= 538.1.1 + } + title:e_byzantium.holder = { + trigger_event = { + id = germanic_events.0032 + days = 1 + } + } + set_global_variable = { + name = gothic_war_cycle_active + value = yes + } + set_global_variable = { + name = amalasuntha_coup_unlock + value = yes + } + } + } + if = { + limit = { + current_date > 533.1.1 + NOT = { exists = title:k_ostrogoths.holder } + exists = title:e_byzantium.holder + has_global_variable = gothic_war_won + #NOT = { has_global_variable = has_eternal_peace } + NOT = { has_global_variable = gothic_war_stalemate } + title:e_byzantium.holder = { + any_vassal_or_below = { + culture = { has_cultural_pillar = heritage_east_germanic } + any_held_title = { + OR = { + tier = tier_county + tier = tier_duchy + } + OR = { + kingdom = title:k_italy + kingdom = title:k_italia_annonariae + kingdom = title:k_italia_suburbicariae + } + } + } + } + } + random = { + chance = 20 + modifier = { + add = 10 + current_date >= 540.1.1 + } + modifier = { + add = 10 + current_date >= 545.1.1 + } + modifier = { + add = 10 + current_date >= 550.1.1 + } + modifier = { + add = 30 + character:992029 = { + is_alive = yes + age > 15 + OR = { + is_landed = yes + title:e_byzantium.holder = { + any_vassal_or_below = { + exists = primary_heir + primary_heir = character:992029 + } + } + } + top_liege = title:e_byzantium.holder + } + } + trigger_event = { + id = germanic_events.0028 + days = 1 + } + } + } + } + + { + if = { + limit = { + AND = { + game_start_date <= 406.1.1 + current_date >= 406.1.1 + NOT = { exists = global_var:marcus_usurper } + title:e_western_roman_empire = { + is_title_created = yes + } + title:e_western_roman_empire = { + OR = { + any_in_de_facto_hierarchy = { + THIS = title:k_britannia + } + holder = { + has_title = title:k_britannia + } + } + } + character:BUsuprer_01 = { + is_alive = yes + NOT = { + has_title = title:k_britannia + } + } + } + } + + character:BUsuprer_01 = { + trigger_event = briton.0008 + set_global_variable = { + name = marcus_usurper + value = yes + } + } + } + } + + { + if = { + limit = { + current_date >= 400.1.1 + NOT = { has_global_variable = radagaisus_has_invaded } + current_date <= 410.1.1 + NOT = { exists = title:k_goths.holder } + character:radagaisian_02 = { + is_alive = yes + } + } + random = { + chance = 5 + modifier = { + add = 15 + current_date >= 401.1.1 + } + modifier = { + add = 30 + current_date >= 403.1.1 + } + modifier = { + add = 40 + current_date >= 405.1.1 + } + modifier = { + add = 10 + current_date >= 406.1.1 + } + set_global_variable = { + name = radagaisus_has_invaded + value = yes + } + trigger_event = { + id = gothic_wars.0011 + days = { 30 50 } + } + } + } + + if = { + limit = { + current_date >= 400.1.1 + has_global_variable = radagaisus_has_invaded + NOT = { has_global_variable = goth_migrations } + current_date <= 420.1.1 + } + random = { + chance = 20 + modifier = { + add = 10 + current_date >= 405.1.1 + } + modifier = { + add = 20 + current_date >= 407.1.1 + } + modifier = { + add = 40 + current_date >= 409.1.1 + } + modifier = { + add = 10 + current_date >= 411.1.1 + } + set_global_variable = { + name = goth_migrations + value = yes + } + trigger_event = gothic_wars.0022 + trigger_event = gothic_wars.0023 + trigger_event = gothic_wars.0024 + trigger_event = gothic_wars.0025 + } + } + + if = { + limit = { + game_start_date = 476.9.4 + NOT = { has_global_variable = clovis_invasion } + OR = { + AND = { + character:997004 = { + is_alive = yes + is_landed = yes + is_independent_ruler = yes + NOT = { + has_title = title:k_france + } + trigger_if = { + limit = { + title:k_france = { + is_title_created = yes + } + } + NOT = { + OR = { + is_allied_to = title:k_france.holder + AND = { + exists = var:my_suzerain + var:my_suzerain = title:k_france.holder + var:my_suzerain = { + OR = { + is_target_in_variable_list = { name = non_permanent_tributaries target = prev } + is_target_in_variable_list = { name = permanent_tributaries target = prev } + } + } + } + } + } + } + } + character:997005 = { + NOT = { + has_title = title:k_france + } + } + } + AND = { + character:997005 = { + is_alive = yes + is_landed = yes + is_independent_ruler = yes + NOT = { + has_title = title:k_france + } + } + character:997004 = { + NOT = { + has_title = title:k_france + } + } + } + } + AND = { + title:k_france = { + is_title_created = yes + } + title:k_france.holder = { + culture = culture:gallo_roman + } + } + current_date <= 500.1.1 + } + random = { + chance = 0 + modifier = { + add = 5 + current_date >= 478.1.1 + } + modifier = { + add = 10 + current_date >= 479.1.1 + } + modifier = { + add = 35 + current_date >= 480.1.1 + } + modifier = { + add = 50 + current_date >= 481.1.1 + } + set_global_variable = { + name = clovis_invasion + value = yes + } + if = { + limit = { + character:997004 = { + is_alive = yes + is_landed = yes + is_independent_ruler = yes + } + } + character:997004 = { + trigger_event = germanic_events.0003 + } + } + else_if = { + limit = { + character:997005 = { + is_alive = yes + is_landed = yes + is_independent_ruler = yes + } + } + character:997005 = { + trigger_event = germanic_events.0003 + } + } + } + } + } + + { + if = { + limit = { + current_date >= 533.1.1 + current_date <= 545.1.1 + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:recall_belisarius + } + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:vandalic_aftermath_vassals + } + NOT = { has_global_variable = berber_revolt } + exists = title:e_byzantium.holder + title:e_byzantium.holder = { + any_vassal_or_below = { + highest_held_title_tier > tier_barony + capital_province = { geographical_region = custom_roman_africae } + OR = { + culture = { has_cultural_pillar = heritage_berber } + culture = culture:mauro_roman + } + } + } + } + set_global_variable = { + name = berber_revolt + value = yes + } + trigger_event = { + id = western_roman.0072 + days = 90 + } + } + } +} + +"common/on_action/death.txt" = { + { + # Fix gods-damned Bavaria splitting from East Francia in an ugly fashion in 867. + if = { + limit = { + # Make sure we're looking at the right guy & that the circumstances haven't changed too much. + this = character:90107 + highest_held_title_tier = tier_kingdom + has_realm_law = confederate_partition_succession_law + # Bavaria should be in a fit state for interfering with the handout order. + title:k_bavaria = { + OR = { + is_title_created = no + holder = root + } + any_in_de_jure_hierarchy = { + tier = tier_county + # More than 50%. + count >= 22 + holder = { + any_liege_or_above = { this = root } + } + } + } + NOT = { has_primary_title = title:k_bavaria } + # Players can sort this themselves: you just need to have Bavaria as your primary title and it's all fine. + is_ai = yes + } + # If we've got no Bavaria, create it. + if = { + limit = { + title:k_bavaria = { is_title_created = no } + } + create_title_and_vassal_change = { + type = created + save_scope_as = change + } + title:k_bavaria = { + change_title_holder = { + holder = root + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + } + # Then switch around. + set_primary_title_to = title:k_bavaria + } + } +} + +"common/on_action/diarchy_on_action.txt" = { + { + if = { + limit = { + scope:old_diarch = character:992020 + exists = title:e_byzantium.holder + NOT = { has_global_variable = gothic_war_cycle_active } + NOT = { has_global_variable = gothic_war_cycle_prep } + } + if = { + limit = { + character:992020 = { + is_alive = no + } + } + title:e_byzantium.holder = { + trigger_event = { + id = germanic_events.0023 + days = 1 + } + } + } + else_if = { + limit = { + root = { + mother = character:992020 + } + } + root = { + trigger_event = { + id = germanic_events.0021 + days = 1 + } + } + title:e_byzantium.holder = { + trigger_event = { + id = germanic_events.0022 + days = 1 + } + } + } + else_if = { + limit = { + NOT = { + root = { + mother = character:992020 + } + } + } + root = { + trigger_event = { + id = germanic_events.0020 + days = 1 + } + } + title:e_byzantium.holder = { + trigger_event = { + id = germanic_events.0022 + days = 1 + } + } + } + } + } +} + +"common/on_action/title_on_actions.txt" = { + { + # Am I The Chad? + if = { + limit = { root = character:easteregg_chad_uhl } + set_house = house:house_chad_uhl + } + } + + { + AND = { + scope:title = { + tier = tier_county + title_province = { + geographical_region = TFE_eastern_iranian_struggle_region + } + } + root = { + any_character_struggle = { + involvement = involved + is_struggle_type = eastern_iranian_struggle + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_usurp_title + CHAR = root + } + } + } + } + } + + { + AND = { + scope:title = { + tier = tier_county + title_province = { + geographical_region = TFE_eastern_iranian_struggle_region + } + } + root = { + any_character_struggle = { + involvement = involved + is_struggle_type = eastern_iranian_struggle + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_gain_claim_on_title + CHAR = root + } + } + } + } + } +} + +"common/on_action/east_asia_flavor_on_actions.txt" = { + { +on_game_start = { + on_actions = { + on_TFE_east_asia_start + } +} + +on_TFE_east_asia_start = { + effect = { + character:western_liang_043 ?= { + if = { + limit = { + is_alive = yes + is_landed = yes + } + trigger_event = { + id = liang.0012 + days = { 365 2190 } + } + } + } + } +} + } + + { +# A title is transferred to a new character +# root = the new holder +# scope:title = the title that changes hands +# scope:previous_holder = previous holder. Might be dead +on_title_gain = { + events = { + delay = { days = 1 } + liang.0010 # Meng Min passes away and Li Gao becomes governor of Dunhuang + } +} + +# A title is inherited by a character +# root = the new holder +# scope:title = the title that changes hands +# scope:previous_holder = previous holder. Should be dead +on_title_gain_inheritance = { + events = { + delay = { days = 1 } + liang.0010 # Meng Min passes away and Li Gao becomes governor of Dunhuang + } +} + } +} + +"common/scripted_effects/TFE_effects.txt" = { + { + copy_inheritable_appearance_from = character:990000 + } + + { +start_vandalic_war_effect = { + + global_var:justinian_commander = { + add_character_flag = STOP_ADMIN + } + + title:c_mahdiya = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = global_var:justinian_commander + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + if = { + limit = { + exists = title:e_byzantium.holder + NOT = { global_var:justinian_commander.top_liege = title:e_byzantium.holder } + } + create_title_and_vassal_change = { + type = conquest_claim + save_scope_as = change_two + add_claim_on_loss = no + } + global_var:justinian_commander = { + change_liege = { + liege = title:e_byzantium.holder + change = scope:change_two + } + } + resolve_title_and_vassal_change = scope:change_two + } + + global_var:justinian_commander = { + every_sub_realm_county = { + limit = { + tier = tier_county + empire = { this = title:e_byzantium } + } + # Grab the county for ease of reference. + save_temporary_scope_as = current_county + # Create an elevated peasant to claim the county. + create_character = { + location = scope:current_county.title_province + template = old_country_local_warlord_template + save_temporary_scope_as = local_warlord + } + # Assign the seceding title to the new upstart. + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + hidden_effect = { + scope:current_county = { + change_title_holder = { + holder = scope:local_warlord + change = scope:change + take_baronies = yes + } + } + } + resolve_title_and_vassal_change = scope:change + if = { + limit = { + exists = title:e_byzantium.holder + } + # And give them their independence. + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = no + } + hidden_effect = { + scope:local_warlord = { + #becomes_independent = { change = scope:change } + change_liege = { + liege = title:e_byzantium.holder + change = scope:change + } + } + } + resolve_title_and_vassal_change = scope:change + } + } + if = { + limit = { + exists = title:e_byzantium.holder + } + every_vassal = { + limit = { + capital_county.empire = title:e_byzantium + } + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = no + } + hidden_effect = { + change_liege = { + liege = title:e_byzantium.holder + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + } + } + every_held_title = { + limit = { + tier >= tier_duchy + is_titular = no + } + add_to_list = list_to_return + } + every_in_list = { + list = list_to_return + save_scope_as = title_to_return + global_var:justinian_commander = { destroy_title = scope:title_to_return } + } + } + + #Need to put this here after duchy title transfer for admin + title:c_mahdiya = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = global_var:justinian_commander + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + global_var:justinian_commander = { + trigger_event = { + id = western_roman.0042 + days = 1 + } + start_war = { + cb = vandalic_war_cb + target = title:k_vandals.holder + target_title = title:k_vandals + claimant = global_var:justinian_commander + } + } +} + } + + { +start_gothic_war_effect = { + if = { + limit = { + NOT = { title:c_trapani.holder = global_var:justinian_gothic_commander } + NOT = { title:c_trapani.holder = character:belisarius_001 } + trigger_if = { + limit = { + exists = title:k_vandals.holder + } + NOT = { title:c_trapani.holder.top_liege = title:k_vandals.holder } + } + } + title:c_trapani = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = global_var:justinian_gothic_commander + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + } + if = { + limit = { + global_var:justinian_gothic_commander = { + is_landed = no + } + } + title:c_malta = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = global_var:justinian_gothic_commander + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + } + #title:k_ostrogoths.holder = { + # every_sub_realm_county = { + # limit = { + # NOT = { this = title:c_malta } + # NOT = { this = title:c_palermo } + # duchy = title:d_sicily + # } + # save_temporary_scope_as = current_county + # create_title_and_vassal_change = { + # type = usurped + # save_scope_as = change + # add_claim_on_loss = no + # } + # scope:current_county = { + # change_title_holder = { + # holder = global_var:justinian_gothic_commander + # change = scope:change + # take_baronies = yes + # } + # } + # resolve_title_and_vassal_change = scope:change + # } + #} + + global_var:justinian_gothic_commander = { + every_sub_realm_county = { + limit = { + tier = tier_county + empire = { this = title:e_byzantium } + NOT = { + duchy = title:d_sicily + } + } + # Grab the county for ease of reference. + save_temporary_scope_as = current_county + # Create an elevated peasant to claim the county. + create_character = { + location = scope:current_county.title_province + template = old_country_local_warlord_template + save_temporary_scope_as = local_warlord + } + # Assign the seceding title to the new upstart. + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + hidden_effect = { + scope:current_county = { + change_title_holder = { + holder = scope:local_warlord + change = scope:change + take_baronies = yes + } + } + } + resolve_title_and_vassal_change = scope:change + if = { + limit = { + exists = title:e_byzantium.holder + } + # And give them their independence. + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = no + } + hidden_effect = { + scope:local_warlord = { + #becomes_independent = { change = scope:change } + change_liege = { + liege = title:e_byzantium.holder + change = scope:change + } + } + } + resolve_title_and_vassal_change = scope:change + } + } + if = { + limit = { + exists = title:e_byzantium.holder + } + every_vassal = { + limit = { + capital_county.empire = title:e_byzantium + } + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = no + } + hidden_effect = { + change_liege = { + liege = title:e_byzantium.holder + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + } + } + every_held_title = { + limit = { + tier >= tier_duchy + } + add_to_list = list_to_return + } + every_in_list = { + list = list_to_return + save_scope_as = title_to_return + global_var:justinian_gothic_commander = { destroy_title = scope:title_to_return } + } + } + global_var:justinian_gothic_commander = { + trigger_event = { + id = germanic_events.0026 + days = 1 + } + if = { + limit = { + exists = title:e_byzantium.holder + global_var:justinian_gothic_commander = { + NOT = { top_liege = title:e_byzantium.holder } + } + } + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = changev + add_claim_on_loss = no + } + global_var:justinian_gothic_commander = { + change_liege = { + liege = title:e_byzantium.holder + change = scope:changev + } + } + resolve_title_and_vassal_change = scope:changev + } + } + if = { + limit = { + title:k_ostrogoths.holder = { + any_sub_realm_county = { + duchy = title:d_sicily + } + } + } + global_var:justinian_gothic_commander = { + start_war = { + casus_belli = gothic_duchy_conquest_cb + target = title:k_ostrogoths.holder + target_title = title:d_sicily + claimant = global_var:justinian_gothic_commander + } + } + } + else = { + set_global_variable = { + name = gothic_attacker_1 + value = global_var:justinian_gothic_commander + } + if = { + limit = { + exists = title:k_daciae.holder + title:k_daciae.holder.top_liege = title:e_byzantium.holder + } + set_global_variable = { + name = gothic_attacker_2 + value = title:k_daciae.holder + } + } + title:e_byzantium.holder = { + start_war = { + cb = gothic_war_regular_cb + target = title:k_ostrogoths.holder + target_title = title:k_ostrogoths + claimant = title:e_byzantium.holder + } + } + } +} + } + + { +end_gothic_war_early_effect = { + if = { + limit = { + scope:truce_breakee = { + any_vassal_or_below = { + any_character_war = { + using_cb = gothic_duchy_conquest_cb + } + } + } + } + scope:truce_breakee = { + every_vassal_or_below = { + every_character_war = { + limit = { + using_cb = gothic_duchy_conquest_cb + } + end_war = white_peace + } + } + } + } + if = { + limit = { + AND = { + exists = title:k_ostrogoths.holder + title:k_ostrogoths.holder = { + any_character_war = { + using_cb = cb_gothic_wars_amalasuntha + } + } + } + } + title:k_ostrogoths.holder = { + every_character_war = { + limit = { + using_cb = cb_gothic_wars_amalasuntha + } + end_war = white_peace + } + } + } + if = { + limit = { + scope:truce_breakee = { + any_character_war = { + using_cb = gothic_war_regular_cb + } + } + } + scope:truce_breakee = { + every_character_war = { + limit = { + using_cb = gothic_war_regular_cb + } + end_war = white_peace + } + } + } +} + } +} + +"common/scripted_triggers/tfe_culture_triggers.txt" = { + { + dynasty = dynasty:nuvelan + } +} + +"gfx/portraits/portrait_modifiers/50_hairstyles_scripted_characters.txt" = { + { + modifier = { + add = 999 + exists = this + exists = character:aksum_17 #eon + this = character:aksum_17 #eon + } + } + { + modifier = { + add = 999 + exists = this + exists = character:himyarite_30 #Abraha + this = character:himyarite_30 #Abraha + } + } + { + modifier = { + add = 999 + exists = this + exists = character:142 #robert_curthose + this = character:142 #robert_curthose + } + } + { + modifier = { + add = 999 + exists = this + exists = character:70515 #Zeno + this = character:70515 #Zeno + } + } + { + modifier = { + add = 999 + exists = this + exists = character:vigg_04 #Hengest + this = character:vigg_04 #Hengest + } + } + { + modifier = { + add = 999 + exists = this + exists = character:syagri_06 #Syagrus + this = character:syagri_06 #Syagrus + } + } + { + modifier = { + add = 999 + exists = this + exists = character:rugian_03 #Feletheus + this = character:rugian_03 #Feletheus + } + } + { + modifier = { + add = 999 + exists = this + exists = character:6878 #jarl_haesteinn + this = character:6878 #jarl_haesteinn + } + } + { + modifier = { + add = 999 + exists = this + exists = character:aelling_01 #Aelle + this = character:aelling_01 #Aelle + } + } + + { + modifier = { + add = 999 + exists = this + exists = character:easteregg_elisabeth_gangenes + this = character:easteregg_elisabeth_gangenes + } + } + { + modifier = { + add = 999 + exists = this + exists = character:7757 #duchess_matilda + this = character:7757 #duchess_matilda + } + modifier = { + add = 999 + exists = this + exists = character:102505 #queen_ingebjorg + this = character:102505 #queen_ingebjorg + } + modifier = { + add = 999 + exists = this + exists = character:765 #princess_swietoslawa + this = character:765 #princess_swietoslawa + } + modifier = { + add = 999 + exists = this + exists = character:930551279 #eudoxia + this = character:930551279 #eudoxia + } + modifier = { + add = 999 + exists = this + exists = character:placidia_01 #placidia + this = character:placidia_01 #placidia + } + modifier = { + add = 999 + exists = this + exists = character:900065 #serena + this = character:900065 #serena + } + modifier = { + add = 999 + exists = this + exists = character:992020 #Amalasuntha + this = character:992020 #Amalasuntha + } + modifier = { + add = 999 + exists = this + exists = character:992024 #Matasuntha + this = character:992024 #Matasuntha + } + } + { + modifier = { + add = 999 + exists = this + exists = character:108501 #infanta_urraca + this = character:108501 #infanta_urraca + } + modifier = { + add = 999 + exists = this + exists = character:131 #eadgifu_the_fair + this = character:131 #eadgifu_the_fair + } + } + { + modifier = { + add = 999 + exists = this + exists = character:633 #queen_yelizaveta + this = character:633 #queen_yelizaveta + } + } + { + modifier = { + add = 999 + exists = this + exists = character:easteregg_bianca_savazzi + this = character:easteregg_bianca_savazzi + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_claudia_baldassi + this = character:easteregg_claudia_baldassi + } + } + { + modifier = { + add = 999 + exists = this + exists = character:6863 #ingrid_bjornsdottir + this = character:6863 #ingrid_bjornsdottir + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_linnea_thimren + this = character:easteregg_linnea_thimren + } + } + { + modifier = { + add = 999 + exists = this + exists = character:6839 #iliana_of_uppland + this = character:6839 #iliana_of_uppland + } + modifier = { + add = 999 + exists = this + exists = character:161257 #queen_wyszeslawa + this = character:161257 #queen_wyszeslawa + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_steacy_mcilwham + this = character:easteregg_steacy_mcilwham + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_katya_boestad + this = character:easteregg_katya_boestad + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_tegan_harris + this = character:easteregg_tegan_harris + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_bahar_shefket + this = character:easteregg_bahar_shefket + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_alexia_belfort + this = character:easteregg_alexia_belfort + } + } + { + modifier = { + add = 999 + exists = this + exists = character:997005 #Chlodovech + this = character:997005 #Chlodovech + } + modifier = { + add = 999 + exists = character:997013 #Chlothar + this = character:997013 #Chlothar + } + modifier = { + add = 999 + exists = this + exists = character:997015 #Theodobert + this = character:997015 #Theodobert + } + } + { + modifier = { + add = 999 + exists = this + exists = character:123 #queen_ealdgyth + this = character:123 #queen_ealdgyth + } + modifier = { + add = 999 + exists = this + exists = character:367 #duchess_mathilde + this = character:367 #duchess_mathilde + } + } + { + modifier = { + add = 999 + exists = this + exists = character:145072 #Focas + this = character:145072 #Focas + } + modifier = { + add = 999 + exists = this + exists = character:145071 #Heraclius + this = character:145071 #Heraclius + } + modifier = { + add = 999 + exists = this + exists = character:armenian_01 #Narses + this = character:armenian_01 #Narses + } + modifier = { + add = 999 + exists = this + exists = character:greek_17 #Plutarch + this = character:greek_17 #Plutarch + } + } + { + modifier = { + add = 999 + exists = this + exists = character:6448 #count_eudes + this = character:6448 #count_eudes + } + modifier = { + add = 999 + exists = this + exists = character:107500 #king_sancho + this = character:107500 #king_sancho + } + modifier = { + add = 999 + exists = this + exists = character:214 #king_philippe + this = character:214 #king_philippe + } + modifier = { + add = 999 + exists = this + exists = character:146 #william_the_red + this = character:146 #william_the_red + } + } + { + modifier = { + add = 999 + exists = this + exists = character:163112 #halfdan_whiteshirt + this = character:163112 #halfdan_whiteshirt + } + modifier = { + add = 999 + exists = this + exists = character:30228 #king_louis + this = character:30228 #king_louis + } + modifier = { + add = 999 + exists = this + exists = character:984 #king_malcom + this = character:984 #king_malcom + } + modifier = { + add = 999 + exists = this + exists = character:212892 #ota_the_handsome + this = character:212892 #ota_the_handsome + } + modifier = { + add = 999 + exists = this + exists = character:762 #king_boleslaw + this = character:762 #king_boleslaw + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_joel_hansson + this = character:easteregg_joel_hansson + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_peter_johannesson + this = character:easteregg_peter_johannesson + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_petter_vilberg + this = character:easteregg_petter_vilberg + } + + modifier = { + add = 999 + exists = this + exists = character:168137 + this = character:168137 + } + modifier = { + add = 999 + exists = this + exists = character:200290 #Atawulf + this = character:200290 #Arawulf + } + modifier = { + add = 999 + exists = this + exists = character:180618 #Bahram + this = character:180618 #Bahram + } + modifier = { + add = 999 + exists = this + exists = character:997004 #Childeric + this = character:997004 #Childeric + } + modifier = { + add = 999 + exists = this + exists = character:997009 #Theodoric Meroving + this = character:997009 #Theodoric Meroving + } + modifier = { + add = 999 + exists = this + exists = character:997011 #Chlodomir + this = character:997011 #Chlodomir + } + } + { + modifier = { + add = 999 + exists = this + exists = character:3924 #emir_yahya + this = character:3924 #emir_yahya + } + modifier = { + add = 999 + exists = this + exists = character:106000 #king_antso + this = character:106000 #king_antso + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_alexander_oltner + this = character:easteregg_alexander_oltner + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_ismael_serrano + this = character:easteregg_ismael_serrano + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_christian_daflos + this = character:easteregg_christian_daflos + } + modifier = { + add = 999 + exists = this + exists = character:70517 #Leo + this = character:70517 #Leo + } + modifier = { + add = 999 + exists = this + exists = character:mauro_roman_kings_02 #Massonas + this = character:mauro_roman_kings_02 #Massonas + } + } + { + modifier = { + add = 999 + exists = this + exists = character:205141 #Ceredig + this = character:205141 #Ceredig + } + modifier = { + add = 999 + exists = this + exists = character:70512 #Justinian + this = character:70512 #Justinian + } + modifier = { + add = 999 + exists = this + exists = character:cappadocia_07 #Ioannes + this = character:cappadocia_07 #Ioannes + } + } + { + modifier = { + add = 999 + exists = this + exists = character:quadi_04 # Hermerich of the Quadi + this = character:quadi_04 # Hermerich of the Quadi + } + } + { + modifier = { + add = 400 + exists = this + exists = character:83355 #petty_king_murchad + this = character:83355 #petty_king_murchad + } + modifier = { + add = 999 + exists = this + exists = character:109500 #king_garcia + this = character:109500 #king_garcia + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_henrik_fahraeus + this = character:easteregg_henrik_fahraeus + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_jakub_potapczyk + this = character:easteregg_jakub_potapczyk + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_petter_lundh + this = character:easteregg_petter_lundh + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_max_weltz + this = character:easteregg_max_weltz + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_max_collin + this = character:easteregg_max_collin + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_martin_anward + this = character:easteregg_martin_anward + } + modifier = { + add = 999 + exists = this + exists = character:6392 #charlemagne + this = character:6392 #charlemagne + } + } + { + modifier = { + add = 999 + exists = this + exists = character:522 #duke_vratislav + this = character:522 #duke_vratislav + } + modifier = { + add = 999 + exists = this + exists = character:108500 #king_alfonso + this = character:108500 #king_alfonso + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_sean_hughes + this = character:easteregg_sean_hughes + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_paul_depre + this = character:easteregg_paul_depre + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_zack_holmgren + this = character:easteregg_zack_holmgren + } + modifier = { + add = 999 + exists = this + exists = character:159431 #Conan Meriadoc + this = character:159431 #tiberius + } + modifier = { + add = 999 + exists = this + exists = character:999103 #king_alaric + this = character:999103 #king_alaric + } + modifier = { + add = 999 + exists = this + exists = character:159038 #Coel + this = character:159038 #ACoel + } + modifier = { + add = 999 + exists = this + exists = character:constantinus_05 #Ambrosius + this = character:constantinus_05 #Ambrosius + } + modifier = { + add = 999 + exists = this + exists = character:mauri_42 #Iabdas + this = character:mauri_42 #Iabdas + } + modifier = { + add = 999 + exists = this + exists = character:997002 #Chlodio + this = character:997002 #Chlodio + } + } + { + modifier = { + add = 999 + exists = this + exists = character:easteregg_james_beaumont + this = character:easteregg_james_beaumont + } + modifier = { + add = 999 + exists = this + exists = character:maldras_06 #Hermenerich + this = character:maldras_06 #Hermenerich + } + modifier = { + add = 999 + exists = this + exists = character:982001 #Abu Karib + this = character:982001 #Abu Karib + } + modifier = { + add = 999 + exists = this + exists = character:xionite_001 #Kidara + this = character:xionite_001 #Kidara + } + modifier = { + add = 999 + exists = this + exists = character:samo_01 #Samo + this = character:samo_01 #Samo + } + } + { + modifier = { + add = 999 + exists = this + exists = character:90104 #charles_the_bald + this = character:90104 #charles_the_bald + } + modifier = { + add = 999 + exists = this + exists = character:1316 #emperor_heinrich + this = character:1316 #emperor_heinrich + } + modifier = { + add = 999 + exists = this + exists = character:992016 #theodoric_the_great + this = character:992016 #theodoric_the_great + } + modifier = { + add = 999 + exists = this + exists = character:83432 #Eochaid + this = character:83432 #Eochaid + } + } + { + modifier = { + modifier = { + add = 999 + exists = this + exists = character:easteregg_nils_wadensten + this = character:easteregg_nils_wadensten + } + add = 999 + exists = this + exists = character:900062 #stilicho + this = character:900062 #stilicho + } + modifier = { + add = 999 + exists = this + exists = character:70519 #Imperator Arcadius I + this = character:70519 #Imperator Arcadius I + } + modifier = { + add = 999 + exists = this + exists = character:145227 #Imperator Honorius I + this = character:145227 #Imperator Honorius I + } + modifier = { + add = 999 + exists = this + exists = character:nepos_02 #Nepos + this = character:nepos_02 #Nepos + } + modifier = { + add = 999 + exists = this + exists = character:145237 #julian_the_apostate + this = character:145237 #julian_the_apostate + } + modifier = { + add = 999 + exists = this + exists = character:londinium_01 #Riothamus + this = character:londinium_01 #Riothamus + } + modifier = { + add = 999 + exists = this + exists = character:arsacid_58 #vramshapuh + this = character:arsacid_58 #vramshapuh + } + modifier = { + add = 999 + exists = this + exists = character:vandals_005 #Hilderic + this = character:vandals_005 #Hilderic + } + modifier = { + add = 999 + exists = this + exists = character:992022 #Theodahad + this = character:992022 #Theodahad + } + modifier = { + add = 999 + exists = this + exists = character:991004 #Mundus + this = character:991004 #Mundus + } + modifier = { + add = 999 + exists = this + exists = character:greek_20 #Proklos + this = character:greek_20 #Proklos + } + } + { + modifier = { + add = 999 + exists = this + exists = character:nuvelan_11 #Gildo + this = character:nuvelan_11 #Gildo + } + modifier = { + add = 999 + exists = this + exists = character:aksum_16 #Ouazeba + this = character:aksum_16 #Ouazeba + } + } + { + modifier = { + add = 999 + exists = this + exists = character:easteregg_magne_skjaeran + this = character:easteregg_magne_skjaeran + } + } + { + modifier = { + modifier = { + add = 999 + exists = this + exists = character:163111 #ivar_the_boneless + this = character:163111 #ivar_the_boneless + } + modifier = { + add = 999 + exists = this + exists = character:102531 #harald_hardrade + this = character:102531 #harald_hardrade + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_joacim_carlberg + this = character:easteregg_joacim_carlberg + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_struan_mccallum + this = character:easteregg_struan_mccallum + } + add = 999 + exists = this + exists = character:999105 #athaulf + this = character:999105 #athaulf + } + modifier = { + add = 999 + exists = this + exists = character:997003 #Merovech + this = character:997003 #Merovech + } + modifier = { + add = 999 + exists = this + exists = character:992003 #Hermanaric + this = character:992003 #Hermanaric + } + } + { + modifier = { + add = 999 + exists = this + exists = character:163110 #sigurdr_snake_in_the_eye + this = character:163110 #sigurdr_snake_in_the_eye + } + modifier = { + add = 999 + exists = this + exists = character:144000 #haraldr_fairhair + this = character:144000 #haraldr_fairhair + } + modifier = { + add = 999 + exists = this + exists = character:40605 #rurik_rurikid + this = character:40605 #rurik_rurikid + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_jonas_wickerstrom + this = character:easteregg_jonas_wickerstrom + } + modifier = { + add = 999 + exists = this + exists = character:900016 #faramund + this = character:900016 #faramund + } + } + { + modifier = { + add = 999 + exists = this + exists = character:163108 #bjorn_ironside + this = character:163108 #bjorn_ironside + } + modifier = { + add = 999 + exists = this + exists = character:140 #william_the_bastard + this = character:140 #william_the_bastard + } + modifier = { + add = 999 + exists = this + exists = character:101515 #king_svend + this = character:101515 #king_svend + } + modifier = { + add = 999 + exists = this + exists = character:42018 #karlmann + this = character:42018 #karlmann + } + } + { + modifier = { + add = 999 + exists = this + exists = character:159137 #almos_arpad + this = character:159137 #almos_arpad + } + } + { + modifier = { + add = 999 + exists = this + exists = character:alchonid_005 #Khingila + this = character:alchonid_005 #Khingila + } + modifier = { + add = 999 + exists = this + exists = character:hephthalite_misc_017 #Katulf + this = character:hephthalite_misc_017 #Katulf + } + } + { + modifier = { + add = 999 + exists = this + exists = character:belisarius_001 #Belisarius + this = character:belisarius_001 #Belisarius + } + } + { + modifier = { + add = 999 + exists = this + exists = character:200284 #euric + this = character:200284 #euric + } + modifier = { + add = 999 + exists = this + exists = character:180628 #Khosrau + this = character:180628 #Khosrau + } + modifier = { + add = 999 + exists = this + exists = character:mauri_36 #Masties + this = character:mauri_36 #Masties + } + } + { + modifier = { + add = 999 + exists = this + exists = character:danis0005 + this = character:danis0005 + } + + modifier = { + add = 999 + exists = this + exists = character:surunbaqi0001 + this = character:surunbaqi0001 + } + modifier = { + add = 999 + exists = this + exists = character:107590 #el_cid + this = character:107590 #el_cid + } + modifier = { + add = 999 + exists = this + exists = character:159012 #Cadwallon + this = character:159012 #Cadwallon + } + modifier = { + add = 999 + exists = this + exists = character:ashina_03 #Tuwu + this = character:ashina_03 #Tuwu + } + modifier = { + add = 999 + exists = this + exists = character:ashina_05 #Istemi + this = character:ashina_05 #Istemi + } + } + { + modifier = { + add = 999 + exists = this + exists = character:200280 #Theodis + this = character:200280 #Theodis + } + modifier = { + add = 999 + exists = this + exists = character:ashina_04 #Bumin + this = character:ashina_04 #Bumin + } + modifier = { + add = 999 + exists = this + exists = character:waegmunding_2 #Beowulf + this = character:waegmunding_2 #Beowulf + } + } + { + modifier = { + add = 999 + exists = this + exists = character:996002 #odoacer + this = character:996002 #odoacer + } + modifier = { + add = 999 + exists = this + exists = character:992023 #Athalaric + this = character:992023 #Athalaric + } + modifier = { + add = 999 + exists = this + exists = character:992063 #Fritigern + this = character:992063 #Fritigern + } + } + { + modifier = { + add = 999 + exists = this + exists = character:900016 #Faramund + this = character:900016 #Faramund + } + modifier = { + add = 999 + exists = character:990006 #Attila + this = character:990006 #Attila + } + modifier = { + add = 999 + exists = this + exists = character:997012 #Childebert + this = character:997012 #Childebert + } + } + { + modifier = { + add = 999 + exists = this + exists = character:vandals_012 #Gelimer + this = character:vandals_012 #Gelimer + } + modifier = { + add = 999 + exists = this + exists = character:marshalnsc + this = character:marshalnsc + } + } + { + modifier = { + add = 999 + exists = this + exists = character:168314 #waldrada + this = character:168314 #waldrada + } + modifier = { + add = 999 + exists = this + exists = character:1183 #empress_bertha + this = character:1183 #empress_bertha + } + } + { + modifier = { + add = 999 + exists = this + exists = character:251187 #daurama_daura + this = character:251187 #daurama_daura + } + } + { + modifier = { + add = 999 + exists = this + exists = character:73683 + this = character:73683 + } + modifier = { + add = 999 + exists = this + exists = character:vandals_003 + this = character:vandals_003 + } + } + { + modifier = { + add = 999 + exists = this + exists = character:73759 + this = character:73759 + } + } + { + modifier = { + add = 999 + exists = this + exists = character:73857 + this = character:73857 + } + + modifier = { + add = 999 + exists = this + exists = character:70292 + this = character:70292 + } + } + { + modifier = { + add = 999 + exists = this + exists = character:73783 + this = character:73783 + } + } +} + +"common/casus_belli_types/TFE_event_wars.txt" = { + { +independence_war_vandal = { + icon = independence_faction_war + group = event + ai = no # AI targeting is handled through game_rule events. + + allow_hostages = no + allowed_against_character = { + OR = { + scope:attacker = { + liege = scope:defender + } + scope:attacker = { + top_liege = scope:defender + } + } + } + + cost = { + piety = { + value = 0 + } + prestige = { + value = 0 + } + } + + on_declaration = { + on_declared_war = yes + # Remove offending HumSac modifiers. + scope:attacker = { + hidden_effect = { fp1_remove_humsac_offended_counties_effect = yes } + } + war = { + every_war_attacker = { + if = { + limit = { + OR = { + liege = title:k_africae.holder + AND = { + liege = { + liege = scope:defender + } + NOT = { + faith = liege.faith + } + } + } + } + add_character_flag = should_become_independent + } + } + } + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { # Desc for only one player attacker + scope:attacker = { + is_local_player = yes + } + } + desc = independence_war_victory_desc_local_player_attacker_alone + } + triggered_desc = { # Desc for only one attacker, player defender + trigger = { + scope:defender = { + is_local_player = yes + } + } + desc = player_independence_war_victory_desc_local_player_defender_attacker_alone + } + desc = independence_war_victory_desc_local_player_attacker_alone # Desc for a third party involved + } + + } + + on_victory = { + scope:attacker = { show_pow_release_message_effect = yes } + + #EP2 Accolade glory gain from winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_med_effect = yes } + + create_title_and_vassal_change = { + type = independency + save_scope_as = change + } + if = { + # Free character with the flag + limit = { exists = war } + war = { + every_war_attacker = { + if = { + limit = { has_character_flag = should_become_independent } + + create_title_and_vassal_change = { + type = independency + save_scope_as = going_independent + add_claim_on_loss = no + } + becomes_independent = { + change = scope:going_independent + } + + resolve_title_and_vassal_change = scope:going_independent + + add_truce_both_ways = { + character = scope:defender + days = 1825 + war = root.war + result = victory + } + + remove_character_flag = should_become_independent + + change_liege_or_become_independent = { + CHANGE = scope:change + VASSAL = this + } + + hidden_effect = { + set_variable = { + name = independence_war_former_liege + value = scope:defender + } + + save_scope_as = current_member + + # Struggle Catalyst + if = { + limit = { + catalyst_gave_independence_to_powerful_diff_faith_culture_vassal_preliminary_trigger = { + CHAR1 = scope:defender + CHAR2 = scope:current_member + } + any_character_struggle = { + involvement = involved + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal + CHAR = scope:current_member + } + } + } + every_character_struggle = { + involvement = involved + limit = { + activate_struggle_catalyst_secondary_character_involvement_either_trigger = { + CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal + CHAR = scope:current_member + } + } + activate_struggle_catalyst = { + catalyst = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal + character = scope:defender + } + } + } + } + } + } + } + } + + scope:defender = { + # Struggle Catalyst + hidden_effect = { + if = { + limit = { + catalyst_gave_independence_to_powerful_diff_faith_culture_vassal_preliminary_trigger = { + CHAR1 = scope:defender + CHAR2 = scope:attacker + } + any_character_struggle = { + involvement = involved + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal + CHAR = scope:attacker + } + } + } + every_character_struggle = { + involvement = involved + limit = { + activate_struggle_catalyst_secondary_character_involvement_either_trigger = { + CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal + CHAR = scope:attacker + } + } + activate_struggle_catalyst = { + catalyst = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal + character = scope:defender + } + } + } + } + } + + resolve_title_and_vassal_change = scope:change + + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = player_independence_war_white_peace_defender_desc + } + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes + } + } + desc = player_independence_war_white_peace_attacker_desc + } + desc = player_independence_war_white_peace_desc + } + + } + + on_white_peace = { + scope:attacker = { + show_pow_release_message_effect = yes + stress_impact = { + ambitious = medium_stress_impact_gain + arrogant = medium_stress_impact_gain + } + } + hidden_effect = { + scope:attacker = { + add_truce_both_ways = { + character = scope:defender + days = 1825 + war = root.war + result = white_peace + } + } + } + + scope:defender = { + add_prestige = minor_prestige_value + stress_impact = { + arrogant = medium_stress_impact_gain + } + } + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = player_independence_defeat_defender_desc + } + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes + } + } + desc = player_independence_defeat_attacker_desc + } + desc = player_independence_war_defeat_desc + } + + } + + on_defeat = { + scope:attacker = { show_pow_release_message_effect = yes } + scope:defender = { + add_dread = medium_dread_gain + # Prestige for Defender + add_prestige_war_defender_effect = { + PRESTIGE_VALUE = medium_prestige_value + } + } + + if = { + # Free character with the flag + limit = { exists = war } + war = { + every_war_attacker = { + save_scope_as = expelled_vandal + if = { + limit = { + has_character_flag = should_become_independent + NOT = { THIS = character:vandals_012 } + } + hard_imprison_character_effect = { + TARGET = this + IMPRISONER = scope:defender + } + scope:defender = { + add_opinion = { + target = prev + modifier = vassal_lost_faction_revolt_war + } + } + } + if = { + limit = { + THIS = character:vandals_012 + title:c_cappadocia.holder = { + is_ai = yes + } + } + title:c_cappadocia = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = character:vandals_012 + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + every_vassal = { + add_to_list = vassals_to_defect + } + + every_held_title = { + limit = { + NOT = { this = title:c_cappadocia } + } + add_to_list = titles_to_usurp + } + + create_title_and_vassal_change = { + type = usurped + save_scope_as = title_change + add_claim_on_loss = no + } + every_in_list = { + list = titles_to_usurp + change_title_holder = { + holder = title:k_africae.holder + change = scope:title_change + take_baronies = no + } + } + every_in_list = { + list = vassals_to_defect + change_liege = { + liege = title:k_africae.holder + change = scope:title_change + } + } + change_liege = { + liege = title:k_africae.holder.top_liege + change = scope:title_change + } + resolve_title_and_vassal_change = scope:title_change + character:vandals_012 = { + add_character_modifier = { + modifier = peaceful_retirement + } + add_trait = content + change_government = imperial_government + } + } + else_if = { + limit = { + THIS = character:vandals_012 + } + title:c_lower_galatia = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = character:vandals_012 + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + every_vassal = { + add_to_list = vassals_to_defect + } + + every_held_title = { + limit = { + NOT = { this = title:c_lower_galatia } + } + add_to_list = titles_to_usurp + } + + create_title_and_vassal_change = { + type = usurped + save_scope_as = title_change + add_claim_on_loss = no + } + every_in_list = { + list = titles_to_usurp + change_title_holder = { + holder = title:k_africae.holder + change = scope:title_change + take_baronies = no + } + } + every_in_list = { + list = vassals_to_defect + change_liege = { + liege = title:k_africae.holder + change = scope:title_change + } + } + change_liege = { + liege = title:k_africae.holder.top_liege + change = scope:title_change + } + resolve_title_and_vassal_change = scope:title_change + character:vandals_012 = { + add_character_modifier = { + modifier = peaceful_retirement + } + add_trait = content + change_government = imperial_government + } + } + if = { + limit = { + liege = title:k_africae.holder + NOT = { THIS = character:vandals_012 } + } + save_scope_as = vandal_expel + scope:defender.top_liege = { + random_sub_realm_county = { + limit = { + kingdom = title:k_orientis + holder = { + is_ai = yes + realm_size > 1 + NOT = { + OR = { + THIS = primary_title.title_capital_county + THIS = primary_title.title_capital_county.de_jure_liege + } + } + } + NOT = { + is_in_list = vandal_titles_to_usurp + } + } + save_scope_as = county_expel + add_to_list = vandal_titles_to_usurp + + #create_title_and_vassal_change = { + # type = usurped + # save_scope_as = change + # add_claim_on_loss = no + #} + #scope:county_expel = { + # change_title_holder = { + # holder = scope:expelled_vandal + # change = scope:change + # take_baronies = yes + # } + #} + #resolve_title_and_vassal_change = scope:change + } + scope:vandal_expel = { + every_vassal = { + add_to_list = vassals_to_defect + } + + every_held_title = { + limit = { + NOT = { this = scope:county_expel } + } + add_to_list = titles_to_usurp + } + + create_title_and_vassal_change = { + type = usurped + save_scope_as = title_change + add_claim_on_loss = no + } + every_in_list = { + list = titles_to_usurp + change_title_holder = { + holder = title:k_africae.holder + change = scope:title_change + take_baronies = no + } + } + every_in_list = { + list = vassals_to_defect + change_liege = { + liege = title:k_africae.holder + change = scope:title_change + } + } + change_liege = { + liege = title:k_africae.holder.top_liege + change = scope:title_change + } + resolve_title_and_vassal_change = scope:title_change + } + if = { + limit = { + scope:vandal_expel = { + is_landed = no + } + character:vandals_012 = { + is_alive = yes + is_landed = yes + } + } + character:vandals_012 = { + add_courtier = scope:vandal_expel + } + } + } + } + } + } + } + add_culture_minority_effect = { + CULTURE = culture:vandal + SIZE = small + COUNTY = title:c_upper_khabur + } + add_culture_minority_effect = { + CULTURE = culture:vandal + SIZE = small + COUNTY = title:c_amida + } + add_culture_minority_effect = { + CULTURE = culture:vandal + SIZE = small + COUNTY = title:c_tall_basma + } + } + + on_invalidated_desc = msg_invalidate_war_title + + check_defender_inheritance_validity = no + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + transfer_behavior = transfer + + war_name = "INDEPENDENCE_WAR_NAME" + + interface_priority = 120 + + attacker_wargoal_percentage = 0.8 + + max_attacker_score_from_battles = 100 + max_defender_score_from_battles = 50 + + max_defender_score_from_occupation = 150 + max_attacker_score_from_occupation = 150 + + max_ai_diplo_distance_to_title = 500 +} + } + { +cb_gothic_wars = { + group = event + + allowed_for_character = { + } + + allowed_against_character = { + scope:attacker = { + ALL_FALSE = { + top_liege = scope:defender.top_liege + liege = scope:defender + } + } + } + + + target_titles = neighbor_land + target_title_tier = county + ignore_effect = change_title_holder + should_show_war_goal_subview = yes + combine_into_one = yes + ai_only_against_neighbors = yes + mutually_exclusive_titles = { always = yes } + + valid_to_start = { + always = no + } + + should_invalidate = { + NOT = { + any_in_list = { + list = target_titles + any_in_de_jure_hierarchy = { + tier = tier_county + holder = { + OR = { + this = scope:defender + target_is_liege_or_above = scope:defender + } + } + } + } + } + } + + on_invalidated_desc = msg_religious_war_invalidation_region_message + + on_invalidated = { + } + + cost = { + } + + on_declaration = { + on_declared_war = yes + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = gothic_wars_victory_desc_attacker + } + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = gothic_wars_victory_desc_defender + } + desc = gothic_wars_victory_desc + } + } + + on_victory = { + #EP2 accolade glory gain for winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_high_effect = yes } + scope:defender = { + pay_long_term_gold = { + target = scope:attacker + gold = grand_raid_gold + } + add_prestige = -1000 + } + scope:attacker = { + add_prestige = grand_raid_gold + dynasty = { + add_dynasty_prestige = 300 + } + trigger_event = { + id = gothic_wars.0002 + days = 1 + } + } + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = gothic_wars_white_peace_desc_attacker + } + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = gothic_wars_white_peace_desc_defender + } + desc = gothic_wars_white_peace_desc + } + } + + on_white_peace = { + #EP2 accolade glory gain for doing ok against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } + scope:defender = { accolade_defender_war_end_glory_gain_med_effect = yes } + scope:attacker = { + add_prestige = { + value = minor_prestige_value + multiply = -1.0 + } + stress_impact = { + ambitious = medium_stress_impact_gain + arrogant = medium_stress_impact_gain + } + } + # Prestige for the attacker's war allies + add_from_contribution_attackers = { + prestige = medium_prestige_value + opinion = { + modifier = contributed_in_war + } + } + + # Prestige for the defender's war allies + add_from_contribution_defenders = { + prestige = medium_prestige_value + opinion = { + modifier = contributed_in_war + } + } + + scope:defender = { + remove_variable = realm_size + stress_impact = { + arrogant = medium_stress_impact_gain + } + } + + add_truce_white_peace_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = gothic_wars_defeat_desc_attacker + } + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = gothic_wars_defeat_desc_defender + } + desc = gothic_wars_defeat_desc + } + } + + on_defeat = { + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_attacker_war_end_glory_gain_high_effect = yes } + scope:attacker = { show_pow_release_message_effect = yes } + + # Prestige loss for the attacker + scope:attacker = { + save_temporary_scope_as = loser + pay_short_term_gold_reparations_effect = { + GOLD_VALUE = 5 + } + add_prestige = { + value = major_prestige_value + multiply = -1.0 + } + } + + # Prestige for Defender + scope:defender = { + remove_variable = realm_size + add_prestige_war_defender_effect = { + PRESTIGE_VALUE = major_prestige_value + } + } + + # Prestige for the attacker's war allies + add_from_contribution_attackers = { + prestige = medium_prestige_value + opinion = { + modifier = contributed_in_war + } + } + + # Prestige for the defender's war allies + add_from_contribution_defenders = { + prestige = medium_prestige_value + opinion = { + modifier = contributed_in_war + } + } + + add_truce_attacker_defeat_effect = yes + on_lost_aggression_war_discontent_loss = yes + } + + transfer_behavior = transfer + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + attacker_score_from_battles_scale = 200 # War Score from battles won by the Attacker is modified by this value + defender_score_from_battles_scale = 200 # War Score from battles won by the Defender is modified by this value + max_attacker_score_from_battles = 100 # How much War Score the Attacker can gain from battles in total + max_defender_score_from_battles = 100 # How much War Score the Defender can gain from battles in total + + max_defender_score_from_occupation = 50 + full_occupation_by_defender_gives_victory = no + + war_name = GOTHIC_WARS_NAME + war_name_base = GRAND_RAID_WAR_NAME_BASE + cb_name = GRAND_RAID_CB + + interface_priority = 100 +} + } + { +radagaisus_invasion_cb = { + group = event + + allowed_for_character = { + } + + allowed_against_character = { + scope:attacker = { + ALL_FALSE = { + top_liege = scope:defender.top_liege + liege = scope:defender + } + } + } + + combine_into_one = yes + + target_titles = none + target_title_tier = all + target_de_jure_regions_above = yes + ignore_effect = change_title_holder + ai_only_against_neighbors = yes + defender_ticking_warscore_delay = { years = 2 } + + white_peace_possible = no + + valid_to_start = { + always = no + } + + should_invalidate = { + NOT = { + any_in_list = { + list = target_titles + any_in_de_jure_hierarchy = { + tier = tier_county + holder = { + OR = { + this = scope:defender + target_is_liege_or_above = scope:defender + } + } + } + } + } + } + + on_invalidated_desc = msg_religious_war_invalidation_region_message + + on_invalidated = { + } + + cost = { + } + + on_declaration = { + on_declared_war = yes + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = radagaisus_invasion_victory_desc_attacker + } + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = radagaisus_invasion_victory_desc_defender + } + desc = radagaisus_invasion_victory_desc + } + } + + on_victory = { + #EP2 accolade glory gain for winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_high_effect = yes } + scope:attacker = { show_pow_release_message_effect = yes } + scope:defender = { + trigger_event = { + id = gothic_wars.0014 + days = 1 + } + } + + create_title_and_vassal_change = { + type = conquest_holy_war + save_scope_as = change + add_claim_on_loss = yes + } + # go through the dejure hierarchy under target titles, transfer titles with same or worse tolerance holders (their religion equaly or less tolerated than the defender's), + # take the holder as vassal otherwise and don't go deeper + every_in_list = { + list = target_titles + custom_tooltip = RELIGIOUS_CB_TITLE + + conquest_cb_title_transfer = { + RELIGIOUS_WAR = yes + } + } + + every_in_list = { + list = vassals_taken + change_liege = { + liege = scope:attacker + change = scope:change + } + } + + every_in_list = { + list = titles_taken + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + + resolve_title_and_vassal_change = scope:change + + # Prestige Progress for the Attacker + every_in_list = { + list = target_titles + scope:attacker = { + add_prestige_experience = medium_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + # Truce + add_truce_attacker_victory_effect = yes + + # FP1: note the victory for future memorialisation via stele (if applicable) + scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes } + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = radagaisus_invasion_white_peace_desc_attacker + } + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = radagaisus_invasion_white_peace_desc_defender + } + desc = radagaisus_invasion_white_peace_desc + } + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = radagaisus_invasion_defeat_desc_attacker + } + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = radagaisus_invasion_defeat_desc_defender + } + desc = radagaisus_invasion_defeat_desc + } + } + + on_defeat = { + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_attacker_war_end_glory_gain_high_effect = yes } + scope:attacker = { show_pow_release_message_effect = yes } + + if = { + limit = { + exists = title:k_visigoths.holder + } + goths_flee_effect = yes + } + + # Prestige loss for the attacker + scope:attacker = { + save_temporary_scope_as = loser + pay_short_term_gold_reparations_effect = { + GOLD_VALUE = 5 + } + add_prestige = { + value = major_prestige_value + multiply = -1.0 + } + } + + # Prestige for Defender + scope:defender = { + add_prestige_war_defender_effect = { + PRESTIGE_VALUE = major_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + lost_radagaisus_invasion_effect = yes + + add_truce_attacker_defeat_effect = yes + on_lost_aggression_war_discontent_loss = yes + } + + transfer_behavior = transfer + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = RADAGAISUS_INVASION_NAME + war_name_base = RADAGAISUS_INVASION_NAME_BASE + cb_name = RADAGAISUS_INVASION_CB_NAME + + use_de_jure_wargoal_only = yes + + interface_priority = 100 +} + } + { +cb_gothic_wars_amalasuntha = { + group = event + #white_peace_possible = no + + allowed_for_character = { + } + + allowed_against_character = { + } + + target_titles = none + target_title_tier = all + target_de_jure_regions_above = yes + ignore_effect = change_title_holder + ai_only_against_neighbors = yes + + valid_to_start = { + always = no + } + + should_invalidate = { + scope:defender = { + is_independent_ruler = no + } + } + + on_invalidated_desc = msg_religious_war_invalidation_region_message + + on_invalidated = { + } + + cost = { + } + + on_declaration = { + on_declared_war = yes + set_global_variable = { + name = gothic_war_declared + value = yes + } + scope:attacker = { + spawn_army = { + name = "Ostrogothic Defenders" + levies = 750 + men_at_arms = { + type = light_footmen + stacks = 3 + } + men_at_arms = { + type = bowmen + stacks = 2 + } + men_at_arms = { + type = light_horsemen + stacks = 2 + } + war = scope:war + location = capital_province + } + every_vassal = { + limit = { + is_greek_or_roman = no + is_ai = yes + } + save_scope_as = join_attacker + scope:war = { + add_attacker = scope:join_attacker + } + } + } + } + + #This is necessary for error log -- this should never happen + on_white_peace_desc = { + desc = cb_gothic_wars_amalasuntha_white_peace_desc + } + + on_white_peace = { + scope:attacker = { + show_pow_release_message_effect = yes + stress_impact = { + ambitious = medium_stress_impact_gain + arrogant = medium_stress_impact_gain + } + } + + #EP2 accolade glory gain for defender doing alright + scope:defender = { accolade_defender_war_end_glory_gain_low_effect = yes } + + # Defender neither gains nor loses any prestige. + scope:defender = { + stress_impact = { + arrogant = medium_stress_impact_gain + } + } + + # Truce + add_truce_white_peace_effect = yes + if = { + limit = { + NOT = { exists = global_var:belisarius_betrayal_white_peace } + } + + scope:attacker = { + every_held_title = { + limit = { + tier = tier_county + duchy = title:d_sicily + } + create_title_and_vassal_change = { + type = granted + save_scope_as = change + add_claim_on_loss = no + } + change_title_holder_include_vassals = { + holder = scope:defender + change = scope:change + } + resolve_title_and_vassal_change = scope:change + } + every_vassal = { + limit = { + capital_county = { + duchy = title:d_sicily + } + } + create_title_and_vassal_change = { + type = granted + save_scope_as = change + add_claim_on_loss = no + } + change_liege = { + liege = scope:defender + change = scope:change + } + resolve_title_and_vassal_change = scope:change + } + } + + if = { + limit = { + exists = title:e_byzantium.holder + scope:defender = { + NOT = { top_liege = title:e_byzantium.holder } + } + } + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = change + add_claim_on_loss = no + } + scope:defender = { + change_liege = { + liege = title:e_byzantium.holder + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + } + + } + + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = cb_gothic_wars_amalasuntha_victory_desc_attacker + } + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = cb_gothic_wars_amalasuntha_defeat_desc_defender + } + desc = cb_gothic_wars_amalasuntha_victory_desc + } + } + + on_victory = { + #EP2 accolade glory gain for winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_high_effect = yes } + #scope:attacker = { destroy_title = title:k_thracian_goths } + scope:attacker = { show_pow_release_message_effect = yes } + + scope:defender = { + every_vassal = { + add_to_list = vassals_to_defect + } + } + + scope:defender = { + every_held_title = { + add_to_list = titles_to_usurp + } + } + + create_title_and_vassal_change = { + type = usurped + save_scope_as = title_change + add_claim_on_loss = no + } + every_in_list = { + list = titles_to_usurp + change_title_holder = { + holder = scope:attacker + change = scope:title_change + take_baronies = no + } + } + every_in_list = { + list = vassals_to_defect + change_liege = { + liege = scope:attacker + change = scope:title_change + } + } + resolve_title_and_vassal_change = scope:title_change + + # Prestige Progress for the Attacker + every_in_list = { + list = target_titles + scope:attacker = { + add_prestige_experience = medium_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + scope:attacker = { + imprison = { + target = scope:defender + type = house_arrest + } + } + + # Truce + add_truce_attacker_victory_effect = yes + + # FP1: note the victory for future memorialisation via stele (if applicable). + scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes } + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = cb_gothic_wars_amalasuntha_victory_desc_defender + } + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = cb_gothic_wars_amalasuntha_defeat_desc_attacker + } + desc = cb_gothic_wars_amalasuntha_defeat_desc + } + } + + on_defeat = { + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_attacker_war_end_glory_gain_high_effect = yes } + #scope:defender = { destroy_title = title:k_ostrogoths } + scope:defender = { show_pow_release_message_effect = yes } + + scope:attacker = { + every_vassal = { + add_to_list = vassals_to_defect + } + } + + scope:attacker = { + every_held_title = { + add_to_list = titles_to_usurp + } + } + + create_title_and_vassal_change = { + type = usurped + save_scope_as = title_change + add_claim_on_loss = no + } + every_in_list = { + list = titles_to_usurp + change_title_holder = { + holder = scope:defender + change = scope:title_change + take_baronies = no + } + } + every_in_list = { + list = vassals_to_defect + change_liege = { + liege = scope:defender + change = scope:title_change + } + } + resolve_title_and_vassal_change = scope:title_change + + # Prestige Progress for the Defender + every_in_list = { + list = target_titles + scope:defender = { + add_prestige_experience = medium_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + scope:defender = { + imprison = { + target = scope:attacker + type = house_arrest + } + } + + if = { + limit = { + exists = title:e_byzantium.holder + scope:defender = { + NOT = { top_liege = title:e_byzantium.holder } + } + } + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = change + add_claim_on_loss = no + } + scope:defender = { + change_liege = { + liege = title:e_byzantium.holder + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + title:e_byzantium.holder = { + trigger_event = { + id = western_roman.0062 + days = 1 + } + } + } + + if = { + limit = { + exists = title:k_ostrogoths.holder + scope:defender = title:k_ostrogoths.holder + } + scope:defender = { destroy_title = title:k_ostrogoths } + } + + # Truce + add_truce_attacker_defeat_effect = yes + + # FP1: note the victory for future memorialisation via stele (if applicable). + scope:defender = { fp1_remember_recent_conquest_victory_effect = yes } + } + + transfer_behavior = transfer + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = cb_gothic_wars_amalasuntha_NAME + war_name_base = cb_gothic_wars_amalasuntha_NAME_BASE + cb_name = cb_gothic_wars_amalasuntha_NAME + + interface_priority = 79 + + use_de_jure_wargoal_only = yes + + attacker_score_from_battles_scale = 50 # War Score from battles won by the Attacker is modified by this value + defender_score_from_battles_scale = 50 # War Score from battles won by the Defender is modified by this value + max_attacker_score_from_battles = 100 # How much War Score the Attacker can gain from battles in total + max_defender_score_from_battles = 50 # How much War Score the Defender can gain from battles in total + attacker_score_from_occupation_scale = 25 + defender_score_from_occupation_scale = 25 + + max_ai_diplo_distance_to_title = 500 +} + } + { +vandalic_war_cb = { + group = event + white_peace_possible = no + # Root is the title + # scope:claimant is the claimant + # scope:attacker is the attacker + # scope:defender is the defender + + target_titles = claim + #target_title_tier = all + + on_declaration = { + on_declared_war = yes + scope:attacker = { + capital_county = { + add_county_modifier = { modifier = roman_camps years = 5 } + } + spawn_army = { + name = "Roman Vanguard" + levies = 1000 + men_at_arms = { + type = cataphract + stacks = 2 + } + men_at_arms = { + type = bowmen + stacks = 1 + } + men_at_arms = { + type = palatinae + stacks = 1 + } + men_at_arms = { + type = comitatenses + stacks = 1 + } + men_at_arms = { + type = scorpio + stacks = 2 + } + location = province:4578 #Mahdiya + uses_supply = no + inheritable = yes + } + spawn_army = { + name = "Roman Vanguard" + levies = 600 + men_at_arms = { + type = cataphract + stacks = 2 + } + men_at_arms = { + type = bowmen + stacks = 1 + } + men_at_arms = { + type = palatinae + stacks = 1 + } + men_at_arms = { + type = comitatenses + stacks = 1 + } + men_at_arms = { + type = scorpio + stacks = 2 + } + location = province:4578 #Mahdiya + uses_supply = no + inheritable = yes + war = scope:war + } + spawn_army = { + name = "Roman Vanguard" + levies = 600 + men_at_arms = { + type = cataphract + stacks = 2 + } + men_at_arms = { + type = bowmen + stacks = 1 + } + men_at_arms = { + type = palatinae + stacks = 1 + } + men_at_arms = { + type = comitatenses + stacks = 1 + } + men_at_arms = { + type = scorpio + stacks = 2 + } + location = province:4578 #Mahdiya + uses_supply = no + inheritable = yes + war = scope:war + } + if = { + limit = { + character:armenian_02 = { + is_alive = yes + } + } + add_courtier = character:armenian_02 + } + } + scope:defender = { + if = { + limit = { + global_var:hildirix ?= { + is_alive = yes + } + } + trigger_event = { + id = western_roman.0040 + days = 1 + } + } + } + if = { + limit = { + title:c_tunis.holder = scope:defender + } + title:c_tunis = { + add_county_modifier = { modifier = surprise_attack years = 2 } + } + } + #scope:attacker = { + # trigger_event = { + # id = TFE_flavour_events.0051 + # days = 1 + # } + #} + } + + should_invalidate = { + scope:defender = { + is_independent_ruler = no + } + } + + on_invalidated_desc = msg_subjugation_war_invalidated_message + + on_invalidated = { + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:claimant = { is_local_player = yes } + } + desc = claim_cb_victory_desc_attacker_claimant + } + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = claim_cb_victory_desc_attacker + } + desc = claim_cb_victory_desc + } + } + + on_victory = { + scope:defender = { + every_held_title = { + limit = { + tier >= tier_kingdom + NOT = { this = title:k_vandals } + } + scope:defender = { destroy_title = prev } + } + every_held_title = { + limit = { + tier = tier_duchy + NOT = { this = title:d_tunis } + } + scope:defender = { destroy_title = prev } + } + } + scope:attacker = { + top_liege = { + save_scope_as = victor + every_vassal = { + add_opinion = { + modifier = respect_opinion + target = scope:victor + opinion = 20 + } + } + } + } + title:c_mahdiya = { + remove_county_modifier = roman_camps + } + title:c_tunis = { + remove_county_modifier = surprise_attack + } + #EP2 accolade glory gain for winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_high_effect = yes } + scope:attacker = { show_pow_release_message_effect = yes } + scope:attacker = { + if = { + limit = { + OR = { + top_liege = { + has_title = title:e_byzantium + } + top_liege = { + has_title = title:e_roman_empire + } + } + } + custom_tooltip = vandalic_war_end_effect + top_liege = { + trigger_event = { + id = western_roman.0041 + days = 1 + } + } + } + } + + create_title_and_vassal_change = { + type = conquest_claim + save_scope_as = change + add_claim_on_loss = yes + } + # Create a claim CB which is executed to handle title/vassal changes, in addition to being used to calculate Prestige awards for war participants. + setup_claim_cb = { + titles = target_titles + attacker = scope:attacker + defender = scope:defender + claimant = scope:claimant + change = scope:change + } + + resolve_title_and_vassal_change = scope:change + + if = { + limit = { + NOT = { scope:claimant = scope:attacker } + scope:claimant.primary_title.tier < scope:attacker.primary_title.tier + scope:claimant = { + NOT = { target_is_liege_or_above = scope:attacker } + } + } + + create_title_and_vassal_change = { + type = conquest_claim + save_scope_as = change_two + add_claim_on_loss = yes + } + scope:claimant = { + change_liege = { + liege = scope:attacker + change = scope:change_two + } + } + resolve_title_and_vassal_change = scope:change_two + } + + if = { + limit = { + NOT = { scope:claimant = scope:attacker } + scope:attacker = { + can_add_hook = { + type = favor_hook + target = scope:claimant + } + } + } + scope:attacker = { + add_hook = { + target = scope:claimant + type = favor_hook + } + } + } + if = { + limit = { + scope:defender = { + highest_held_title_tier >= tier_kingdom + } + } + create_title_and_vassal_change = { + type = conquest + save_scope_as = changethree + add_claim_on_loss = yes + } + scope:defender = { + every_held_title = { + limit = { + tier >= tier_kingdom + } + change_title_holder_include_vassals = { + holder = scope:attacker + change = scope:changethree + } + } + } + resolve_title_and_vassal_change = scope:changethree + } + if = { + limit = { + scope:defender = { + is_independent_ruler = yes + is_landed = yes + } + } + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = changev + add_claim_on_loss = no + } + scope:defender = { + change_liege = { + liege = scope:attacker + change = scope:changev + } + } + resolve_title_and_vassal_change = scope:changev + } + resolve_title_and_vassal_change = scope:change + # FP1: note the victory for future memorialisation via stele (if applicable). + scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes } + # Shift dejure under Italia to the Ostrogoths + #title:k_italy = { + # every_in_de_jure_hierarchy = { + # limit = { + # tier = tier_duchy + # } + # set_de_jure_liege_title = scope:attacker.primary_title + # } + #} + + #scope:attacker = { + # imprison = { + # target = scope:defender + # type = house_arrest + # } + #} + if = { + limit = { + global_var:hildirix = { + is_alive = yes + } + } + global_var:hildirix ?= { release_from_prison = yes } + global_var:hildirix ?= { remove_character_flag = is_being_tortured } + } + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = claim_cb_white_peace_desc_defender + } + desc = claim_cb_white_peace_desc + } + + } + + on_white_peace = { + #EP2 accolade glory gain for doing ok against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } + scope:defender = { accolade_defender_war_end_glory_gain_med_effect = yes } + scope:attacker = { + show_pow_release_message_effect = yes + stress_impact = { + ambitious = medium_stress_impact_gain + arrogant = medium_stress_impact_gain + } + } + + # press claims + every_in_list = { + list = target_titles + if = { + limit = { scope:claimant = { has_weak_claim_on = prev } } + scope:claimant = { + make_claim_strong = prev + } + } + } + # Prestige loss for the attacker + scope:attacker = { + stress_impact = { + arrogant = medium_stress_impact_gain + } + } + # Defender neither gains nor loses any prestige. + scope:defender = { + stress_impact = { + arrogant = medium_stress_impact_gain + } + } + + if = { + limit = { + NOT = { scope:claimant = scope:attacker } + scope:attacker = { + can_add_hook = { + type = favor_hook + target = scope:claimant + } + } + } + scope:attacker = { + add_hook = { + target = scope:claimant + type = favor_hook + } + } + } + + # Truce + add_truce_white_peace_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = claim_cb_defeat_desc_defender + } + triggered_desc = { + trigger = { scope:claimant = { is_local_player = yes } } + desc = claim_cb_defeat_desc_attacker_claimant + } + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = claim_cb_defeat_desc_attacker + } + desc = claim_cb_defeat_desc + } + + } + + on_defeat = { + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_attacker_war_end_glory_gain_high_effect = yes } + scope:attacker = { show_pow_release_message_effect = yes } + + title:c_mahdiya = { + remove_county_modifier = roman_camps + } + title:c_tunis = { + remove_county_modifier = surprise_attack + } + + title:c_kran = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + title:c_beroe = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + title:c_burgas = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + title:c_adrianopolis = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + title:d_adrianopolis = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + title:c_mahdiya = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:defender + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + #title:e_byzantium.holder = { + # add_courtier = scope:attacker + #} + + if = { + limit = { + NOT = { scope:claimant = scope:attacker } + scope:attacker = { + can_add_hook = { + type = favor_hook + target = scope:claimant + } + } + } + scope:attacker = { + add_hook = { + target = scope:claimant + type = favor_hook + } + } + } + + # Attacker pays gold to the defender as reparations. + scope:attacker = { + pay_short_term_gold_reparations_effect = { + GOLD_VALUE = 3 + } + } + + # Truce + add_truce_attacker_defeat_effect = yes + + scope:attacker = { + save_temporary_scope_as = loser + } + on_lost_aggression_war_discontent_loss = yes + } + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + transfer_behavior = transfer + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = VANDALIC_WAR_NAME + war_name_base = VANDALIC_WAR_NAME_BASE + cb_name = VANDALIC_CB_NAME + interface_priority = 60 + + attacker_score_from_battles_scale = 200 # War Score from battles won by the Attacker is modified by this value + defender_score_from_battles_scale = 200 # War Score from battles won by the Defender is modified by this value + max_attacker_score_from_battles = 100 # How much War Score the Attacker can gain from battles in total + max_defender_score_from_battles = 100 # How much War Score the Defender can gain from battles in total + + max_defender_score_from_occupation = 50 + full_occupation_by_defender_gives_victory = no + + should_show_war_goal_subview = yes + + attacker_wargoal_percentage = 0.8 + + max_ai_diplo_distance_to_title = 1000 +} + } + + # k_juteland not in TFE as of the 'After the Pharaohs' update + { + this = title:k_juteland + } + { + this = title:k_juteland + } +} + +"common/casus_belli_types/TFE_event_wars_overflow.txt" = { + { +gothic_war_regular_cb = { + group = event + white_peace_possible = yes + # Root is the title + # scope:claimant is the claimant + # scope:attacker is the attacker + # scope:defender is the defender + + target_titles = claim + #target_title_tier = all + + on_declaration = { + on_declared_war = yes + struggle:italian_struggle = { + activate_struggle_catalyst = { + catalyst = catalyst_TFE_major_historical_event_devastation + character = scope:attacker + } + } + set_global_variable = { + name = gothic_war_declared + value = yes + } + if = { + limit = { + exists = global_var:gothic_attacker_1 + global_var:gothic_attacker_1 = { + is_alive = yes + is_landed = yes + } + } + global_var:gothic_attacker_1 = { + trigger_event = { + id = germanic_events.0027 + days = 1 + } + } + } + if = { + limit = { + exists = global_var:gothic_attacker_2 + } + global_var:gothic_attacker_2 = { + trigger_event = { + id = germanic_events.0027 + days = 1 + } + } + } + every_vassal_or_below = { + limit = { + any_sub_realm_county = { + tier = tier_county + duchy = title:d_sicily + } + } + save_scope_as = add_attacker_this + scope:add_attacker_this = { + trigger_event = { + id = germanic_events.0027 + days = 1 + } + } + } + } + + should_invalidate = { + scope:defender = { + is_independent_ruler = no + } + } + + on_invalidated_desc = msg_subjugation_war_invalidated_message + + on_invalidated = { + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:claimant = { is_local_player = yes } + } + desc = claim_cb_victory_desc_attacker_claimant + } + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = claim_cb_victory_desc_attacker + } + desc = claim_cb_victory_desc + } + } + + on_victory = { + title:c_trapani = { + remove_county_modifier = roman_camps + } + scope:defender = { + every_held_title = { + limit = { + tier >= tier_kingdom + NOT = { this = title:k_italy } + NOT = { this = title:k_croatia } + } + scope:defender = { destroy_title = prev } + } + } + scope:attacker = { + top_liege = { + save_scope_as = victor + every_vassal = { + add_opinion = { + modifier = respect_opinion + target = scope:victor + opinion = 20 + } + } + } + } + #EP2 accolade glory gain for winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_high_effect = yes } + scope:attacker = { show_pow_release_message_effect = yes } + scope:attacker = { + if = { + limit = { + OR = { + top_liege = { + has_title = title:e_byzantium + } + top_liege = { + has_title = title:e_roman_empire + } + } + } + custom_tooltip = gothic_war_end_effect + top_liege = { + trigger_event = { + id = western_roman.0062 + days = 1 + } + } + } + } + + create_title_and_vassal_change = { + type = conquest_claim + save_scope_as = change + add_claim_on_loss = yes + } + # Create a claim CB which is executed to handle title/vassal changes, in addition to being used to calculate Prestige awards for war participants. + setup_claim_cb = { + titles = target_titles + attacker = scope:attacker + defender = scope:defender + claimant = scope:claimant + change = scope:change + } + + resolve_title_and_vassal_change = scope:change + + if = { + limit = { + NOT = { scope:claimant = scope:attacker } + scope:claimant.primary_title.tier < scope:attacker.primary_title.tier + scope:claimant = { + NOT = { target_is_liege_or_above = scope:attacker } + } + } + + create_title_and_vassal_change = { + type = conquest_claim + save_scope_as = change_two + add_claim_on_loss = yes + } + scope:claimant = { + change_liege = { + liege = scope:attacker + change = scope:change_two + } + } + resolve_title_and_vassal_change = scope:change_two + } + + if = { + limit = { + NOT = { scope:claimant = scope:attacker } + scope:attacker = { + can_add_hook = { + type = favor_hook + target = scope:claimant + } + } + } + scope:attacker = { + add_hook = { + target = scope:claimant + type = favor_hook + } + } + } + if = { + limit = { + scope:defender = { + highest_held_title_tier >= tier_kingdom + } + } + create_title_and_vassal_change = { + type = conquest + save_scope_as = changethree + add_claim_on_loss = yes + } + scope:defender = { + every_held_title = { + limit = { + tier >= tier_kingdom + } + change_title_holder_include_vassals = { + holder = scope:attacker + change = scope:changethree + } + } + } + resolve_title_and_vassal_change = scope:changethree + } + if = { + limit = { + scope:defender = { + is_independent_ruler = yes + is_landed = yes + } + } + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = changev + add_claim_on_loss = no + } + scope:defender = { + change_liege = { + liege = scope:attacker + change = scope:changev + } + } + resolve_title_and_vassal_change = scope:changev + } + resolve_title_and_vassal_change = scope:change + # FP1: note the victory for future memorialisation via stele (if applicable). + scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes } + # Shift dejure under Italia to the Ostrogoths + #title:k_italy = { + # every_in_de_jure_hierarchy = { + # limit = { + # tier = tier_duchy + # } + # set_de_jure_liege_title = scope:attacker.primary_title + # } + #} + + #scope:attacker = { + # imprison = { + # target = scope:defender + # type = house_arrest + # } + #} + #if = { + # limit = { + # character:992020 = { + # is_alive = yes + # is_imprisoned = yes + # } + # } + # character:992020 = { release_from_prison = yes } + #} + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = claim_cb_white_peace_desc_defender + } + desc = claim_cb_white_peace_desc + } + + } + + on_white_peace = { + #EP2 accolade glory gain for doing ok against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } + scope:defender = { accolade_defender_war_end_glory_gain_med_effect = yes } + scope:attacker = { + show_pow_release_message_effect = yes + stress_impact = { + ambitious = medium_stress_impact_gain + arrogant = medium_stress_impact_gain + } + } + + if = { + limit = { + NOT = { exists = global_var:belisarius_betrayal_white_peace } + } + + scope:defender = { + every_sub_realm_county = { + limit = { + OR = { + title_province = { + geographical_region = TFE_south_po_river_region + } + title_province = { + geographical_region = illyricum_pannoniae_diocese_region + } + } + } + save_scope_as = checkcounty + if = { + limit = { + OR = { + scope:checkcounty.holder = scope:defender + AND = { + scope:checkcounty.holder.liege = scope:defender + NOT = { + scope:checkcounty.holder = { + every_sub_realm_county = { + OR = { + title_province = { + geographical_region = TFE_south_po_river_region + } + title_province = { + geographical_region = illyricum_pannoniae_diocese_region + } + } + } + } + } + } + } + } + scope:checkcounty = { add_to_list = titles_taken } + } + else_if = { + limit = { + scope:checkcounty.holder.liege = scope:defender + } + scope:checkcounty.holder = { add_to_list = vassals_taken } + } + } + } + + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = yes + } + + every_in_list = { + list = vassals_taken + change_liege = { + liege = scope:attacker + change = scope:change + } + } + + every_in_list = { + list = titles_taken + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + + resolve_title_and_vassal_change = scope:change + + } + + # Truce + add_truce_white_peace_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = claim_cb_defeat_desc_defender + } + triggered_desc = { + trigger = { scope:claimant = { is_local_player = yes } } + desc = claim_cb_defeat_desc_attacker_claimant + } + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = claim_cb_defeat_desc_attacker + } + desc = claim_cb_defeat_desc + } + + } + + on_defeat = { + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_attacker_war_end_glory_gain_high_effect = yes } + scope:attacker = { show_pow_release_message_effect = yes } + + title:c_trapani = { + remove_county_modifier = roman_camps + } + + title:c_kran = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + title:c_beroe = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + title:c_burgas = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + title:c_adrianopolis = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + title:d_adrianopolis = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + title:c_trapani = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:attacker.top_liege + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + #title:e_byzantium.holder = { + # add_courtier = scope:attacker + #} + + if = { + limit = { + NOT = { scope:claimant = scope:attacker } + scope:attacker = { + can_add_hook = { + type = favor_hook + target = scope:claimant + } + } + } + scope:attacker = { + add_hook = { + target = scope:claimant + type = favor_hook + } + } + } + + # Attacker pays gold to the defender as reparations. + scope:attacker = { + pay_short_term_gold_reparations_effect = { + GOLD_VALUE = 3 + } + } + + # Truce + add_truce_attacker_defeat_effect = yes + + scope:attacker = { + save_temporary_scope_as = loser + } + on_lost_aggression_war_discontent_loss = yes + } + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + transfer_behavior = transfer + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = GOTHIC_WAR_AMA_NAME + war_name_base = GOTHIC_WAR_AMA_NAME_BASE + cb_name = GOTHIC_WAR_AMA_NAME + interface_priority = 60 + + attacker_score_from_battles_scale = 50 # War Score from battles won by the Attacker is modified by this value + defender_score_from_battles_scale = 50 # War Score from battles won by the Defender is modified by this value + max_attacker_score_from_battles = 50 # How much War Score the Attacker can gain from battles in total + max_defender_score_from_battles = 100 # How much War Score the Defender can gain from battles in total + attacker_score_from_occupation_scale = 25 + defender_score_from_occupation_scale = 25 + + should_show_war_goal_subview = yes + + attacker_wargoal_percentage = 0.4 + + max_ai_diplo_distance_to_title = 1000 +} + } + { +independence_war_berber = { + icon = independence_faction_war + group = event + ai = no # AI targeting is handled through game_rule events. + + allow_hostages = no + allowed_against_character = { + OR = { + scope:attacker = { + liege = scope:defender + } + scope:attacker = { + top_liege = scope:defender + } + } + } + + cost = { + piety = { + value = 0 + } + prestige = { + value = 0 + } + } + + on_declaration = { + on_declared_war = yes + # Remove offending HumSac modifiers. + scope:attacker = { + spawn_army = { + name = "Berber Tribesmen" + levies = 1000 + men_at_arms = { + type = bowmen + stacks = 2 + } + men_at_arms = { + type = desert_hussar + stacks = 2 + } + men_at_arms = { + type = light_footmen + stacks = 2 + } + location = province:4601 #Nemancha + inheritable = no + uses_supply = no + war = scope:war + } + } + scope:attacker = { + hidden_effect = { fp1_remove_humsac_offended_counties_effect = yes } + } + war = { + every_war_attacker = { + if = { + limit = { + top_liege = scope:defender + NOT = { culture = { has_same_culture_heritage = liege.culture } } + } + add_character_flag = should_become_independent + } + } + } + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { # Desc for only one player attacker + scope:attacker = { + is_local_player = yes + } + } + desc = independence_war_victory_desc_local_player_attacker_alone + } + triggered_desc = { # Desc for only one attacker, player defender + trigger = { + scope:defender = { + is_local_player = yes + } + } + desc = player_independence_war_victory_desc_local_player_defender_attacker_alone + } + desc = independence_war_victory_desc_local_player_attacker_alone # Desc for a third party involved + } + + } + + on_victory = { + scope:attacker = { show_pow_release_message_effect = yes } + + #EP2 Accolade glory gain from winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_med_effect = yes } + + create_title_and_vassal_change = { + type = independency + save_scope_as = change + } + if = { + # Free character with the flag + limit = { exists = war } + war = { + every_war_attacker = { + if = { + limit = { + has_character_flag = should_become_independent + top_liege = scope:defender + } + + create_title_and_vassal_change = { + type = independency + save_scope_as = going_independent + add_claim_on_loss = no + } + becomes_independent = { + change = scope:going_independent + } + + resolve_title_and_vassal_change = scope:going_independent + + add_truce_both_ways = { + character = scope:defender + days = 1825 + war = root.war + result = victory + } + + remove_character_flag = should_become_independent + + change_liege_or_become_independent = { + CHANGE = scope:change + VASSAL = this + } + + hidden_effect = { + set_variable = { + name = independence_war_former_liege + value = scope:defender + } + + save_scope_as = current_member + + # Struggle Catalyst + if = { + limit = { + catalyst_gave_independence_to_powerful_diff_faith_culture_vassal_preliminary_trigger = { + CHAR1 = scope:defender + CHAR2 = scope:current_member + } + any_character_struggle = { + involvement = involved + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal + CHAR = scope:current_member + } + } + } + every_character_struggle = { + involvement = involved + limit = { + activate_struggle_catalyst_secondary_character_involvement_either_trigger = { + CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal + CHAR = scope:current_member + } + } + activate_struggle_catalyst = { + catalyst = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal + character = scope:defender + } + } + } + } + } + } + } + } + + scope:defender = { + # Struggle Catalyst + hidden_effect = { + if = { + limit = { + catalyst_gave_independence_to_powerful_diff_faith_culture_vassal_preliminary_trigger = { + CHAR1 = scope:defender + CHAR2 = scope:attacker + } + any_character_struggle = { + involvement = involved + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal + CHAR = scope:attacker + } + } + } + every_character_struggle = { + involvement = involved + limit = { + activate_struggle_catalyst_secondary_character_involvement_either_trigger = { + CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal + CHAR = scope:attacker + } + } + activate_struggle_catalyst = { + catalyst = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal + character = scope:defender + } + } + } + } + } + resolve_title_and_vassal_change = scope:change + + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = player_independence_war_white_peace_defender_desc + } + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes + } + } + desc = player_independence_war_white_peace_attacker_desc + } + desc = player_independence_war_white_peace_desc + } + + } + + on_white_peace = { + scope:attacker = { + show_pow_release_message_effect = yes + stress_impact = { + ambitious = medium_stress_impact_gain + arrogant = medium_stress_impact_gain + } + } + hidden_effect = { + scope:attacker = { + add_truce_both_ways = { + character = scope:defender + days = 1825 + war = root.war + result = white_peace + } + } + } + + scope:defender = { + add_prestige = minor_prestige_value + stress_impact = { + arrogant = medium_stress_impact_gain + } + } + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = player_independence_defeat_defender_desc + } + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes + } + } + desc = player_independence_defeat_attacker_desc + } + desc = player_independence_war_defeat_desc + } + + } + + on_defeat = { + scope:attacker = { show_pow_release_message_effect = yes } + scope:defender = { + add_dread = medium_dread_gain + # Prestige for Defender + add_prestige_war_defender_effect = { + PRESTIGE_VALUE = medium_prestige_value + } + } + if = { + limit = { exists = war } + war = { + every_war_attacker = { + limit = { + top_liege = scope:defender + } + hard_imprison_character_effect = { + TARGET = this + IMPRISONER = scope:defender + } + scope:defender = { + add_opinion = { + target = prev + modifier = vassal_lost_faction_revolt_war + } + } + } + } + } + if = { + limit = { + character:thracio_03 = { + is_landed = yes + top_liege = scope:defender + is_imprisoned = yes + } + } + character:thracio_03 = { + depose = yes + release_from_prison = yes + } + } + if = { + limit = { + exists = title:k_mauro_roman_kingdom.holder + } + title:k_mauro_roman_kingdom.holder = { + add_courtier = character:thracio_03 + } + character:thracio_03 = { + add_unpressed_claim = title:k_mauro_roman_kingdom + } + } + if = { + limit = { + war = { + any_war_attacker = { has_title = title:d_avaritana } + } + war = { + any_war_defender = { has_title = title:d_zaba } + } + } + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = change + add_claim_on_loss = no + } + + if = { + limit = { + title:d_avaritana.holder.primary_title.tier < title:d_zaba.holder.primary_title.tier + } + title:d_avaritana.holder = { + change_liege = { + liege = title:d_zaba.holder + change = scope:change + } + } + } + else = { + title:d_avaritana.holder = { + every_held_title = { + if = { + limit = { + tier = title:d_avaritana.holder.primary_title.tier + } + change_title_holder = { + holder = title:d_zaba.holder + change = scope:change + } + } + else_if = { + limit = { + OR = { + NOT = { exists = scope:secondary_title } + tier > scope:secondary_title.tier + } + } + save_temporary_scope_as = secondary_title + } + } + } + + title:d_avaritana.holder = { + if = { + limit = { + exists = scope:secondary_title + } + every_vassal = { + limit = { + primary_title.tier >= scope:secondary_title.tier + NOT = { + primary_title.tier = tier_barony + } + } + change_liege = { + liege = title:d_zaba.holder + change = scope:change + } + } + } + } + + title:d_avaritana.holder = { + change_liege = { + liege = title:d_zaba.holder + change = scope:change + } + } + } + + resolve_title_and_vassal_change = scope:change + + title:d_avaritana.holder = { + destroy_title = title:d_avaritana + } + } + } + + on_invalidated_desc = msg_invalidate_war_title + + check_defender_inheritance_validity = no + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + transfer_behavior = transfer + + war_name = "INDEPENDENCE_WAR_NAME" + + interface_priority = 120 + + attacker_wargoal_percentage = 0.8 + + max_attacker_score_from_battles = 100 + max_defender_score_from_battles = 50 + + max_defender_score_from_occupation = 150 + max_attacker_score_from_occupation = 150 + + max_ai_diplo_distance_to_title = 500 +} + } + + { +gothic_duchy_conquest_cb = { + icon = duchy_conquest_cb + group = event + white_peace_possible = yes + + combine_into_one = yes + should_show_war_goal_subview = yes + mutually_exclusive_titles = { always = yes } + + attacker_score_from_occupation_scale = 150 + attacker_score_from_battles_scale = 150 + defender_score_from_battles_scale = 150 + + target_titles = all + target_title_tier = duchy + target_de_jure_regions_above = yes + ignore_effect = change_title_holder + + should_invalidate = { + scope:defender = { + is_independent_ruler = no + NOT = { has_title = title:k_ostrogoths } + } + } + + on_invalidated_desc = msg_subjugation_war_invalidated_message + + on_invalidated = { + } + + on_declaration = { + on_declared_war = yes + set_global_variable = { + name = gothic_war_declared + value = yes + } + set_global_variable = { + name = gothic_attacker_1 + value = scope:attacker + } + scope:attacker = { + capital_county = { + add_county_modifier = { modifier = roman_camps years = 5 } + } + spawn_army = { + name = "Roman Vanguard" + levies = 1000 + men_at_arms = { + type = cataphract + stacks = 2 + } + men_at_arms = { + type = bowmen + stacks = 1 + } + men_at_arms = { + type = palatinae + stacks = 1 + } + men_at_arms = { + type = comitatenses + stacks = 1 + } + men_at_arms = { + type = scorpio + stacks = 2 + } + location = province:2636 #Trapani + uses_supply = no + inheritable = yes + } + spawn_army = { + name = "Roman Vanguard" + levies = 600 + men_at_arms = { + type = cataphract + stacks = 2 + } + men_at_arms = { + type = bowmen + stacks = 1 + } + men_at_arms = { + type = palatinae + stacks = 1 + } + men_at_arms = { + type = comitatenses + stacks = 1 + } + men_at_arms = { + type = scorpio + stacks = 2 + } + location = province:2636 #Trapani + uses_supply = no + inheritable = yes + war = scope:war + } + spawn_army = { + name = "Roman Vanguard" + levies = 600 + men_at_arms = { + type = cataphract + stacks = 2 + } + men_at_arms = { + type = bowmen + stacks = 1 + } + men_at_arms = { + type = palatinae + stacks = 1 + } + men_at_arms = { + type = comitatenses + stacks = 1 + } + men_at_arms = { + type = scorpio + stacks = 2 + } + location = province:2636 #Trapani + uses_supply = no + inheritable = yes + war = scope:war + } + if = { + limit = { + character:armenian_02 = { + is_alive = yes + } + } + add_courtier = character:armenian_02 + } + } + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = county_conquest_cb_victory_desc_attacker + } + desc = county_conquest_cb_victory_desc + } + } + + on_victory = { + scope:attacker = { show_pow_release_message_effect = yes } + custom_tooltip = gothic_war_end_effect2 + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_med_effect = yes } + + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = yes + } + + # go through the dejure hierarchy under target titles, transfer eligible vassals and sieze counties from ineligible ones + every_in_list = { + list = target_titles + custom_tooltip = CONQUEST_CB_TITLE + + conquest_cb_title_transfer = { + RELIGIOUS_WAR = no + } + } + + every_in_list = { + list = vassals_taken + change_liege = { + liege = scope:attacker + change = scope:change + } + } + + every_in_list = { + list = titles_taken + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + + resolve_title_and_vassal_change = scope:change + + # Prestige Progress for the Attacker + every_in_list = { + list = target_titles + scope:attacker = { + add_prestige_experience = medium_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + # Truce + add_truce_attacker_victory_effect = yes + + # FP1: note the victory for future memorialisation via stele (if applicable). + scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes } + + if = { # Warning that only counties are changing hands + limit = { + any_in_list = { + list = target_titles + tier = tier_duchy + } + } + random_in_list = { + list = target_titles + limit = { tier = tier_duchy } + save_scope_as = de_jure_target + } + } + if = { + limit = { + any_in_list = { + list = target_titles + tier = tier_duchy + holder = scope:defender + } + } + if = { + limit = { + scope:defender = { + any_held_title = { + tier = tier_county + NOT = { target_is_de_jure_liege_or_above = scope:de_jure_target } + } + } + } + custom_tooltip = conquest_title_not_transferred_tt + } + else = { custom_tooltip = conquest_title_destroyed_tt } + } + else = { + if = { + limit = { + any_in_list = { + list = target_titles + tier = tier_duchy + is_title_created = yes + } + } + custom_tooltip = conquest_title_usurp_tt + } + else = { custom_tooltip = conquest_title_create_tt } + } + if = { + limit = { + scope:attacker = { + top_liege = title:e_byzantium.holder + } + } + if = { + limit = { + exists = title:k_daciae.holder + title:k_daciae.holder.top_liege = title:e_byzantium.holder + } + set_global_variable = { + name = gothic_attacker_2 + value = title:k_daciae.holder + } + } + title:e_byzantium.holder = { + trigger_event = { + id = western_roman.0063 + days = 1 + } + start_war = { + cb = gothic_war_regular_cb + target = title:k_ostrogoths.holder + target_title = title:k_ostrogoths + claimant = title:e_byzantium.holder + } + } + } + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_white_peace_desc_defender + } + desc = county_conquest_cb_white_peace_desc + } + } + + on_white_peace = { + scope:attacker = { show_pow_release_message_effect = yes } + # Prestige loss for the attacker + + #EP2 accolade glory gain for doing pretty good against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_low_effect = yes } + + scope:attacker = { + add_prestige = { + value = minor_prestige_value + multiply = -1.0 + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # not impactful as the scale are identical + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + + add_truce_white_peace_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_defeat_desc_defender + } + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes + has_targeting_faction = yes + } + } + desc = county_conquest_cb_defeat_desc_attacker + } + desc = county_conquest_cb_defeat_desc + } + } + + on_defeat = { + scope:attacker = { show_pow_release_message_effect = yes } + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_med_effect = yes } + + # Prestige loss for the attacker + scope:attacker = { + pay_short_term_gold_reparations_effect = { + GOLD_VALUE = 3 + } + add_prestige = { + value = major_prestige_value + multiply = -1.0 + } + } + + # Prestige for Defender + scope:defender = { + add_prestige_war_defender_effect = { + PRESTIGE_VALUE = major_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + add_truce_attacker_defeat_effect = yes + + scope:attacker = { + save_temporary_scope_as = loser + } + on_lost_aggression_war_discontent_loss = yes + } + + transfer_behavior = transfer + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "CONQUEST_WAR_NAME" + war_name_base = "CONQUEST_WAR_NAME_BASE" + cb_name = "CONQUEST_DUCHY_CB_NAME" + + interface_priority = 79 + + use_de_jure_wargoal_only = yes + + attacker_wargoal_percentage = 0.8 + + attacker_score_from_battles_scale = 200 # War Score from battles won by the Attacker is modified by this value + defender_score_from_battles_scale = 200 # War Score from battles won by the Defender is modified by this value + max_attacker_score_from_battles = 100 # How much War Score the Attacker can gain from battles in total + max_defender_score_from_battles = 100 # How much War Score the Defender can gain from battles in total + + max_defender_score_from_occupation = 50 + full_occupation_by_defender_gives_victory = no +} + } +} + +"common/scripted_effects/TFE_invasion_effects.txt" = { + { +lost_radagaisus_invasion_effect = { + if = { + limit = { + exists = title:k_goths.holder + } + title:k_goths.holder = { + if = { # Imprison them if they aren't imprisoned. + limit = { + is_imprisoned = no + character:900062 = { + is_alive = yes + } + } + + hard_imprison_character_effect = { + TARGET = this + IMPRISONER = character:900062 + } + trigger_event = { + id = gothic_wars.0016 + days = 7 + } + } + else = { + limit = { + is_imprisoned = no + } + hard_imprison_character_effect = { + TARGET = this + IMPRISONER = scope:defender + } + } + } + } +} + } + + { +spawn_radagaisus_character_effect = { + title:c_hewes.title_province = { + save_scope_as = radagaisus_birthplace + } + + character:radagaisian_02 = { + # Make temporarily immune to disease + add_character_flag = { + flag = immune_to_disease + years = 15 + } + save_scope_as = radagaisus + + add_gold = 500 + add_prestige = 2500 + add_dread = high_dread + add_character_modifier = { + modifier = TFE_king_of_the_goths_modifier + } + create_the_gothic_kingdom_effect = yes + } + + radagaisus_find_target_titles_effect = yes + + every_player = { + if = { + limit = { + exists = title:e_western_roman_empire.holder + NOR = { + THIS = scope:radagaisus + THIS = title:e_western_roman_empire.holder + } + } + trigger_event = gothic_wars.0012 + } + if = { + limit = { + exists = title:e_western_roman_empire.holder + THIS = title:e_western_roman_empire.holder + } + trigger_event = gothic_wars.0013 + } + } +} + } + + { +radagaisus_find_target_titles_effect = { + if = { + limit = { + exists = title:k_italia_suburbicariae + exists = title:k_italia_annonariae + OR = { + title:k_italia_suburbicariae.holder.top_liege.primary_title = title:e_western_roman_empire + title:k_italia_suburbicariae.holder.top_liege.primary_title = title:e_roman_empire + } + } + title:k_italia_suburbicariae.holder.top_liege = { + save_scope_as = target_one + } + } + if = { + limit = { + exists = scope:target_one + } + radagaisus_declare_war_for_target_title_effect = yes + } +} + +radagaisus_declare_war_for_target_title_effect = { + save_scope_as = war_leader + if = { + limit = { exists = scope:target_one } + scope:radagaisus = { + start_war = { + cb = radagaisus_invasion_cb + target = scope:target_one + target_title = title:k_italia_annonariae + target_title = title:k_italia_suburbicariae + } + } + scope:radagaisus = { + spawn_gothic_troops_effect = yes + } + } + else = { + debug_log = "Failed to find a valid war target for Radagaisus!" + } +} + } + + { +goths_flee_effect = { + title:k_visigoths.holder = { + save_scope_as = visigothic_king + } + + scope:visigothic_king = { + trigger_event = { + id = gothic_wars.0015 + days = 1 + } + } +} + } +} + +"common/decisions/TFE_major_decisions_south_asia.txt" = { + { +# Restore the main branch of the Vakataka Dynasty + +reclaim_vakataka_decision = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_dynasty_house.dds" + } + decision_group_type = major + + desc = reclaim_vakataka_decision_desc + selection_tooltip = reclaim_vakataka_decision_tooltip + + ai_check_interval = 120 + + is_shown = { + dynasty = dynasty:900024 + NOT = { house = character:900900.house } #Not a member of the OG Vakatakas + NOT = { + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:reclaim_vakataka_decision + } + } + } + + is_valid = { + is_independent_ruler = yes + prestige_level >= 4 + completely_controls = title:k_maharastra + completely_controls = title:k_telingana + completely_controls = title:k_karnata + } + + is_valid_showing_failures_only = { + is_available_adult = yes + is_landed_or_landless_administrative = yes + } + + cost = { + prestige = 850 + piety = 500 + } + + effect = { + hidden_effect = { ROOT.house = { every_house_member = { set_house = character:900900.house } } } + set_house = character:900900.house + add_pressed_claim = title:e_deccan + add_pressed_claim = title:k_gondwana + add_pressed_claim = title:d_jejakabhukti + add_pressed_claim = title:d_akara_dasarna + save_scope_as = founder + trigger_event = { + id = tfe_south_asia_decision.2001 + } + #Notify other Vakatakas + every_player = { + limit = { + dynasty = dynasty:900024 + } + trigger_event = tfe_south_asia_decision.2002 + } + } + + hidden_effect = { + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:reclaim_vakataka_decision + } + } + + ai_potential = { + always = yes + } + + ai_will_do = { + base = 100 + } +} + } + { +#Restore the Three Crowned Kings +muvendhar_restoration_decision = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_dynasty_house.dds" + } + decision_group_type = cultural + + desc = muvendhar_restoration_decision_desc + selection_tooltip = muvendhar_restoration_decision_tooltip + + ai_check_interval = 120 + + is_shown = { + is_ruler = yes + is_landed_or_landless_administrative = yes + OR = { + culture = culture:tamil + culture = culture:malaiya + culture = culture:sinhala + culture = { any_parent_culture_or_above = { this = culture:tamil }} + culture = { any_parent_culture_or_above = { this = culture:malaiya }} + culture = { any_parent_culture_or_above = { this = culture:sinhala }} + } + NOT = { + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:muvendhar_restoration_decision + } + } + } + + is_valid = { + is_independent_ruler = yes + has_title = title:k_tamilakam + prestige_level >= 3 + title:d_chola_nadu.holder.dynasty = dynasty:1043008 + title:d_pandya_nadu.holder.dynasty = dynasty:1043009 + title:d_chera_nadu.holder.dynasty = dynasty:1043010 + NOT = { dynasty = dynasty:900026 } + completely_controls = title:d_chola_nadu + completely_controls = title:d_pandya_nadu + completely_controls = title:d_chera_nadu + } + + is_valid_showing_failures_only = { + is_capable_adult = yes + is_imprisoned = no + is_at_war = no + } + + cost = { + prestige = 750 + piety = 500 + } + + effect = { + if = { + limit = { + NOR = { + dynasty = dynasty:1043008 + dynasty = dynasty:1043009 + dynasty = dynasty:1043010 + } + } + dynasty = { add_dynasty_prestige = 500 } + } + dynasty:1043008 = { add_dynasty_prestige = 500 } + dynasty:1043009 = { add_dynasty_prestige = 500 } + dynasty:1043010 = { add_dynasty_prestige = 500 } + save_scope_as = founder + trigger_event = tfe_south_asia_decision.4001 + hidden_effect = { + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:muvendhar_restoration_decision + } + } + } + + ai_potential = { + always = yes + } + + ai_will_do = { + base = 100 + } +} + } +} + +"common/decisions/TFE_major_decisions_middle_east.txt" = { + { +TFE_construct_khawarnaq = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_mena_palace.dds" + } + decision_group_type = major + + desc = TFE_construct_khawarnaq_desc + selection_tooltip = TFE_construct_khawarnaq_tooltip + + ai_check_interval = 120 + + is_shown = { + is_landed_or_landless_administrative = yes + NOT = { #Can only do it once. + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:TFE_construct_khawarnaq + } + } + dynasty = dynasty:lakhmid_dynasty + OR = { + game_start_date = 395.1.17 + game_start_date = 361.11.17 + } + has_title = title:k_lakhmid + } + + is_valid = { + has_title = title:k_lakhmid + prestige_level >= 3 + completely_controls = title:c_kufa + } + + cost = { + prestige = 500 + gold = 500 + } + + effect = { + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:TFE_construct_khawarnaq + } + title:b_an-najaf.title_province = { + add_special_building = palace_khawarnaq + + } + trigger_event = TFE_flavour_events.0007 + add_prestige = 500 + dynasty = { + add_dynasty_prestige = 500 + } + } + + ai_potential = { + always = yes + } + + ai_will_do = { + base = 100 + } +} + } +} + +"common/decisions/TFE_rome_decisions.txt" = { + { +recall_belisarius = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_roman_knight.dds" + } + decision_group_type = roman + + ai_check_interval = 6 + + desc = recall_belisarius_desc + selection_tooltip = recall_belisarius_tooltip + + is_shown = { + NOT = { + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:recall_belisarius + } + } + #OR = { + # root = global_var:justinian + # has_trait = paranoid + #} + has_global_variable = vandalic_war_won + current_date >= 530.1.1 + current_date <= 600.1.1 + OR = { + has_title = title:e_byzantium + has_title = title:e_roman_empire + } + exists = title:k_africae.holder + title:k_africae.holder = { + is_vassal_of = root + } + game_start_date = 532.2.1 + } + + is_valid = { + character:belisarius_001 = title:k_africae.holder + } + + effect = { + root = { + save_scope_as = emperor + } + title:k_africae.holder = { + save_scope_as = belisarius + } + custom_tooltip = recall_belisarius_warning + character:belisarius_001 = { + add_opinion = { + modifier = angry_opinion + target = root + opinion = -20 + } + trigger_event = { + id = western_roman.0044 + days = 1 + } + } + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:recall_belisarius + } + } + + cost = { + prestige = { + if = { + limit = { + is_ai = no + } + add = { + value = 500 + } + } + } + gold = { + if = { + limit = { + is_ai = no + } + add = { + value = 250 + } + } + } + } + + ai_potential = { + is_at_war = no + } + ai_will_do = { + base = 100 + } +} + } + + { +start_amalasuntha_coup = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_destiny_goal.dds" + } + decision_group_type = roman + + ai_goal = yes + + desc = start_amalasuntha_coup_desc + selection_tooltip = start_amalasuntha_coup_tooltip + + is_shown = { + OR = { + has_title = title:e_byzantium + has_title = title:e_roman_empire + } + NOT = { + exists = global_var:gothic_war_declared + } + exists = global_var:amalasuntha_coup_unlock + current_date >= 530.1.1 + current_date <= 600.1.1 + NOT = { + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:started_gothic_war + } + } + character:992020 = { + is_alive = yes + liege = title:k_ostrogoths.holder + } + title:k_ostrogoths.holder = { + has_active_diarchy = yes + diarch = character:992020 + } + game_start_date = 532.2.1 + } + + is_valid = { + trigger_if = { + limit = { + is_ai = yes + } + is_at_war = no + } + trigger_if = { + limit = { + is_ai = yes + character:belisarius_001 = { + is_ai = no + } + } + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:recall_belisarius + } + } + } + + effect = { + root = { + save_scope_as = emperor + trigger_event = { + id = germanic_events.0033 + days = 1 + } + } + custom_tooltip = gothic_war_belisarius_warning + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:started_gothic_war + } + } + + cost = { + prestige = { + if = { + limit = { + is_ai = no + } + add = { + value = 250 + } + } + } + } + + ai_potential = { + always = yes + } + ai_will_do = { + base = 100 + } +} + } + + { +vandalic_war = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_vandalic_war.dds" + } + decision_group_type = roman + + ai_check_interval = 12 + + desc = vandalic_war_desc + selection_tooltip = vandalic_war_tooltip + + is_shown = { + NOT = { + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:vandalic_war + } + } + exists = title:k_vandals + has_title = title:e_byzantium + current_date >= 530.1.1 + game_start_date = 532.2.1 + OR = { + character:vandals_005 = { + is_alive = yes + } + AND = { + current_date <= 550.1.1 + any_courtier = { + has_claim_on = title:k_vandals + } + } + } + } + + effect = { + custom_tooltip = vandalic_war_decision_1 + custom_tooltip = vandalic_war_decision_2 + custom_tooltip = vandalic_war_decision_3 + + hidden_effect = { + every_vassal = { + add_opinion = { + modifier = respect_opinion + target = root + opinion = -20 + } + } + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:vandalic_war + } + trigger_event = { + id = western_roman.0039 + days = 1 + } + } + } + + cost = { + prestige = { + if = { + limit = { + is_ai = no + } + add = { + value = 750 + } + } + } + gold = { + if = { + limit = { + is_ai = no + } + add = { + value = 250 + } + } + } + } + + ai_potential = { + always = yes + } + ai_will_do = { + base = 100 + } + +} + } + + { +break_eternal_peace = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_destiny_goal.dds" + } + decision_group_type = major + + ai_check_interval = 12 + + desc = break_eternal_peace_desc + selection_tooltip = break_eternal_peace_tooltip + + is_shown = { + has_global_variable = has_eternal_peace + OR = { + has_title = title:e_byzantium + has_title = title:e_roman_empire + has_title = title:e_persia + } + } + + effect = { + remove_global_variable = has_eternal_peace + root = { + save_scope_as = truce_breaker + } + if = { + limit = { + OR = { + has_title = title:e_byzantium + has_title = title:e_roman_empire + } + NOT = { + has_title = title:e_persia + } + } + title:e_persia.holder = { + save_scope_as = truce_breakee + add_opinion = { + modifier = angry_opinion + target = scope:truce_breaker + opinion = -100 + } + trigger_event = { + id = TFE_flavour_events.0035 + days = 1 + } + every_vassal_or_below = { + trigger_event = { + id = TFE_flavour_events.0036 + days = 1 + } + } + } + every_vassal_or_below = { + trigger_event = { + id = TFE_flavour_events.0036 + days = 1 + } + } + } + if = { + limit = { + NOT = { + OR = { + has_title = title:e_byzantium + has_title = title:e_roman_empire + } + } + has_title = title:e_persia + } + if = { + limit = { + exists = title:e_byzantium.holder + } + title:e_byzantium.holder = { + save_scope_as = truce_breakee + add_opinion = { + modifier = angry_opinion + target = scope:truce_breaker + opinion = -100 + } + trigger_event = { + id = TFE_flavour_events.0035 + days = 1 + } + every_vassal_or_below = { + trigger_event = { + id = TFE_flavour_events.0036 + days = 1 + } + } + } + every_vassal_or_below = { + trigger_event = { + id = TFE_flavour_events.0036 + days = 1 + } + } + if = { + limit = { + exists = global_var:gothic_war_declared + NOT = { exists = global_var:gothic_war_won } + root = title:e_persia.holder + } + title:e_persia.holder = { + trigger_event = { + id = western_roman.0064 + days = 1 + } + } + } + } + if = { + limit = { + exists = title:e_roman_empire.holder + } + title:e_roman_empire.holder = { + save_scope_as = truce_breakee + add_opinion = { + modifier = angry_opinion + target = root + opinion = -100 + } + trigger_event = { + id = TFE_flavour_events.0035 + days = 1 + } + every_vassal_or_below = { + trigger_event = { + id = TFE_flavour_events.0036 + days = 1 + } + } + } + every_vassal_or_below = { + trigger_event = { + id = TFE_flavour_events.0036 + days = 1 + } + } + if = { + limit = { + exists = global_var:gothic_war_declared + NOT = { exists = global_var:gothic_war_won } + root = title:e_persia.holder + } + title:e_persia.holder = { + trigger_event = { + id = western_roman.0064 + days = 1 + } + } + } + } + } + } + + cost = { + prestige = { + if = { + limit = { + is_ai = no + } + add = { + value = 1000 + } + } + } + } + + ai_potential = { + is_at_war = no + } + ai_will_do = { + base = 10 + modifier = { + add = 30 + has_title = title:e_persia + } + modifier = { + add = -50 + current_date <= 540.1.1 + } + modifier = { + add = 200 + AND = { + has_title = title:e_persia + exists = global_var:gothic_war_declared + NOT = { exists = global_var:gothic_war_won } + } + } + } + +} + } + + { +vandalic_aftermath_vassals = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_destiny_goal.dds" + } + decision_group_type = roman + + ai_check_interval = 12 + + desc = vandalic_aftermath_vassals_desc + selection_tooltip = vandalic_aftermath_vassals_tooltip + + is_shown = { + NOT = { + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:vandalic_aftermath_vassals + } + } + #OR = { + # root = global_var:justinian + # has_trait = zealous + #} + OR = { + has_title = title:e_byzantium + has_title = title:e_roman_empire + } + has_global_variable = vandalic_war_won + exists = title:k_africae.holder + title:k_africae.holder = { + any_vassal = { + faith = faith:arianism + } + } + current_date >= 530.1.1 + current_date <= 570.1.1 + game_start_date = 532.2.1 + } + + is_valid = { + NOT = { faith = faith:arianism } + is_at_war = no + } + + effect = { + root = { + save_scope_as = emperor + } + title:k_africae.holder = { + save_scope_as = vicar + } + custom_tooltip = vandalic_aftermath_vassals_warning + every_vassal_or_below = { + limit = { + OR = { + culture = culture:vandal + liege = title:k_africae.holder + } + NOT = { faith = root.faith } + NOT = { culture = { has_cultural_pillar = heritage_berber } } + vassal_contract_obligation_level_can_be_increased = religious_rights + highest_held_title_tier > tier_barony + } + add_opinion = { + modifier = angry_opinion + target = root + opinion = -20 + } + trigger_event = { + id = western_roman.0043 + days = 1 + } + } + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:vandalic_aftermath_vassals + } + } + + cost = { + prestige = { + if = { + limit = { + is_ai = no + } + add = { + value = 500 + } + } + } + } + + ai_potential = { + is_at_war = no + } + ai_will_do = { + base = 100 + } +} + } + + { +start_gothic_war = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_destiny_goal.dds" + } + decision_group_type = roman + + ai_check_interval = 6 + + desc = start_gothic_war_desc + selection_tooltip = start_gothic_war_tooltip + + is_shown = { + OR = { + has_title = title:e_byzantium + has_title = title:e_roman_empire + } + NOT = { + exists = global_var:gothic_war_declared + } + exists = global_var:gothic_war_cycle_prep + current_date >= 530.1.1 + current_date <= 600.1.1 + NOT = { + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:started_gothic_war + } + } + game_start_date = 532.2.1 + } + + is_valid = { + is_at_war = no + trigger_if = { + limit = { + is_ai = yes + } + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:recall_belisarius + } + } + } + + effect = { + root = { + trigger_event = { + id = germanic_events.0025 + days = 1 + } + } + custom_tooltip = gothic_war_belisarius_warning + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:started_gothic_war + } + } + + cost = { + prestige = { + if = { + limit = { + is_ai = no + } + add = { + value = 500 + } + } + } + gold = { + if = { + limit = { + is_ai = no + } + add = { + value = 250 + } + } + } + } + + ai_potential = { + is_at_war = no + } + ai_will_do = { + base = 10 + modifier = { + add = -10 + current_date <= 540.1.1 + } + modifier = { + add = 100 + exists = global_var:vandalic_war_won + } + } +} + } + + # ck3-tiger: "unknown token `government_hast_flag`". This is a TFE error as of the 'After the Pharaohs' update. + { +restore_the_west_empire = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_dynasty_house.dds" + } + decision_group_type = roman + + desc = restore_the_west_empire_desc + selection_tooltip = restore_the_west_empire_tooltip + ai_goal = yes + + is_shown = { + is_landed = yes + exists = dynasty + culture = { has_cultural_pillar = heritage_latin } + title:e_western_roman_empire = { + is_title_created = no + } + title:e_roman_empire = { + is_title_created = no + } + highest_held_title_tier = tier_empire + NOT = { + has_title = title:e_byzantium + } + NOT = { + government_has_flag = government_is_roman + } + } + + is_valid = { + is_independent_ruler = yes + prestige_level >= high_prestige_level + highest_held_title_tier = tier_empire + OR = { + government_has_flag = government_is_imperial + government_has_flag = government_is_imperial_cult + government_has_flag = government_is_autocratic + government_has_flag = government_is_autocratic_ep3 + government_has_flag = government_is_administrative + } + completely_controls = title:d_latium + completely_controls = title:d_friuli + completely_controls = title:d_romagna + completely_controls = title:d_sicily + completely_controls = title:d_lombardia + completely_controls = title:d_apulia + completely_controls = title:d_tunis + completely_controls = title:d_dalmatia + } + + is_valid_showing_failures_only = { + is_capable_adult = yes + is_imprisoned = no + is_independent_ruler = yes + is_at_war = no + } + + effect = { + save_scope_as = founder + show_as_tooltip = { restore_the_west_effect = yes } + trigger_event = { id = western_roman.0011 } + #notify other players + if = { + limit = { + government_has_flag = government_is_autocratic + } + change_government = imperial_government + every_vassal = { + limit = { + OR = { + government_has_flag = government_is_autocratic + AND = { + government_has_flag = government_is_roman + highest_held_title_tier > tier_county + } + } + } + change_government = imperial_government + } + else_if = { + limit = { + government_has_flag = government_is_autocratic_ep3 + } + save_scope_as = founder + show_as_tooltip = { restore_the_west_effect = yes } + trigger_event = { id = western_roman.0011 } + #government stuff + change_government = administrative_government + every_vassal = { + limit = { + OR = { + government_has_flag = government_is_autocratic_ep3 + AND = { + government_hast_flag = government_is_roman + highest_held_title_tier > tief_countiy + } + } + } + change_government = administrative_government + } + } + every_player = { + limit = { + NOT = { this = scope:founder } + } + #vassal players get a separate event + if = { + limit = { + any_liege_or_above = { this = scope:founder } + } + trigger_event = western_roman.0012 + } + #germanics get a separate event + if = { + limit = { + culture = { has_cultural_pillar = heritage_north_germanic } + culture = { has_cultural_pillar = heritage_west_germanic } + culture = { has_cultural_pillar = heritage_east_germanic } + culture = { has_cultural_pillar = heritage_central_germanic } + } + trigger_event = western_roman.0013 + } + #slavs get a separate event + if = { + limit = { + culture = { has_cultural_pillar = heritage_slavic } + culture = { has_cultural_pillar = heritage_south_slavic } + } + trigger_event = western_roman.0014 + } + #everyone else within range gets a less personal version + else = { trigger_event = western_roman.0015 } + } + hidden_effect = { + if = { + limit = { + title:e_italy = { + is_titular = no + } + } + title:e_italy = { + every_in_de_jure_hierarchy = { + set_de_jure_liege_title = title:e_western_roman_empire + } + } + } + } + } + } + + cost = { gold = { value = 750 if = { limit = { is_ai = yes } multiply = 0 } } prestige = { value = 250 if = { limit = { is_ai = yes } multiply = 0 } } piety = { value = 250 if = { limit = { is_ai = yes } multiply = 0 } } } + + ai_potential = { + always = yes + } + + ai_will_do = { + base = 100 + } +} + } + + # ck3-tiger: "unknown token `tief_countiy`". This is a TFE error as of the 'After the Pharaohs' update. + { +#Restore Eastern Rome - Hróðvitnir +restore_the_east = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_dynasty_house.dds" + } + decision_group_type = roman + + desc = restore_the_east_desc + selection_tooltip = restore_the_east_tooltip + ai_goal = yes + + is_shown = { + is_landed = yes + exists = dynasty + OR = { + culture = { has_cultural_pillar = heritage_latin } + } + #capital must be in rome + title:e_byzantium = { + any_in_de_jure_hierarchy = { + THIS = root.capital_county + } + is_title_created = no + } + title:e_roman_empire = { + is_title_created = no + } + highest_held_title_tier < tier_empire + } + + is_valid = { + is_independent_ruler = yes + prestige_level >= high_prestige_level + OR = { + government_has_flag = government_is_autocratic + government_has_flag = government_is_autocratic_ep3 + government_has_flag = government_is_roman + } + completely_controls = title:d_thrace + completely_controls = title:d_alexandria + completely_controls = title:d_delta + completely_controls = title:d_palestine + completely_controls = title:d_antioch + completely_controls = title:d_achaia + completely_controls = title:d_krete + completely_controls = title:d_thessalonika + } + + is_valid_showing_failures_only = { + is_capable_adult = yes + is_imprisoned = no + is_independent_ruler = yes + is_at_war = no + } + + effect = { + if = { + limit = { + NOT = { has_dlc_feature = roads_to_power } + } + save_scope_as = founder + show_as_tooltip = { restore_the_east_effect = yes } + trigger_event = { id = western_roman.0021 } + #government stuff + if = { + limit = { + government_has_flag = government_is_autocratic + } + change_government = imperial_government + every_vassal = { + limit = { + OR = { + government_has_flag = government_is_autocratic + AND = { + government_has_flag = government_is_roman + highest_held_title_tier > tier_county + } + } + } + change_government = imperial_government + } + else_if = { + save_scope_as = founder + show_as_tooltip = { restore_the_west_effect = yes } + trigger_event = { id = western_roman.0021 } + #government stuff + change_government = administrative_government + every_vassal = { + limit = { + OR = { + government_has_flag = government_is_autocratic_ep3 + AND = { + government_hast_flag = government_is_roman + highest_held_title_tier > tief_countiy + } + } + } + change_government = administrative_government + } + } + #notify other players + every_player = { + limit = { + NOT = { this = scope:founder } + } + #vassal players get a separate event + if = { + limit = { + any_liege_or_above = { this = scope:founder } + } + trigger_event = eastern_roman.0002 + } + #germanics get a separate event + if = { + limit = { + culture = { has_cultural_pillar = heritage_north_germanic } + culture = { has_cultural_pillar = heritage_west_germanic } + culture = { has_cultural_pillar = heritage_east_germanic } + culture = { has_cultural_pillar = heritage_central_germanic } + } + trigger_event = eastern_roman.0003 + } + #slavs get a separate event + if = { + limit = { + culture = { has_cultural_pillar = heritage_slavic } + culture = { has_cultural_pillar = heritage_south_slavic } + } + trigger_event = eastern_roman.0004 + } + #everyone else within range gets a less personal version + else = { trigger_event = eastern_roman.0005 } + } + } + } + } + + cost = { gold = { value = 1000 if = { limit = { is_ai = yes } multiply = 0 } } prestige = { value = 500 if = { limit = { is_ai = yes } multiply = 0 } } piety = { value = 500 if = { limit = { is_ai = yes } multiply = 0 } } } + + ai_potential = { + always = yes + } + + ai_will_do = { + base = 100 + } +} + } + + # No k_italia_annonaria in TFE as of the 'After the Pharaohs' update. + { + any_vassal = { + has_title = title:k_italia_annonaria + } + } + { + has_title = title:k_italia_annonaria + } +} + + +"common/decisions/tfe_culture_decisions.txt" = { + { +dong_zhuo_culture_decision = { + ai_check_interval = 0 + is_shown = { + has_game_rule = larp_enabled + NOT = { + culture = { + this = culture:soissons + } + } + dynasty = dynasty:syagri + game_start_date = 395.1.17 + } + is_valid = { + culture = { has_cultural_pillar = heritage_levantine } + custom_description = { + text = soissonstrigger1 + culture = { any_parent_culture_or_above = { this = culture:han } } + } + dynasty = dynasty:syagri + has_title = title:k_israel + custom_description = { + text = soissonstrigger2 + current_date = 690.4.20 + } + } + effect = { + save_scope_as = soi + #Convert your, and your whole family's, culture + set_culture = culture:soissons + add_prestige = 10000 + hidden_effect = { + if = { + limit = { any_spouse = { is_landed = no } } + every_spouse = { + limit = { + is_landed = no + } + set_culture = culture:soissons + } + } + if = { + limit = { + any_close_family_member = { + is_landed = no + NOT = { is_spouse_of = root } + } + } + every_close_family_member = { + limit = { + is_landed = no + NOT = { is_spouse_of = root } + } + custom = all_unlanded_family_members + set_culture = culture:soissons + } + } + + #Convert appropriate vassals, and their family + if = { + limit = { + any_vassal_or_below = { + is_ai = yes + } + } + every_vassal_or_below = { + limit = { + is_ai = yes + } + set_culture = culture:soissons + } + } + + #Flip Counties + every_realm_county = { + set_county_culture = culture:soissons + } + + culture:soissons = { + hidden_effect = { + reset_culture_creation_date = yes + get_all_innovations_from = culture:han + get_all_innovations_from = culture:hebrew + } + } + + trigger_event = tfe_culture.9900 + } + } + cost = { gold = 69 } +} + } +} + +"gfx/portraits/portrait_modifiers/00_custom_hair.txt" = { + { + modifier = { + add = 200 + exists = this + exists = character:easteregg_joe_parkin + this = character:easteregg_joe_parkin + } + modifier = { + add = 200 + exists = this + exists = character:easteregg_alessandro_bragalini + this = character:easteregg_alessandro_bragalini + } + } +} + +"gfx/portraits/portrait_modifiers/50_beards_scripted_characters.txt" = { + { +beards_scripted_characters = { + + usage = game + selection_behavior = max + + male_beard_western_01 = { # Standard full beard + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.04 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:144998 #king_lothaire + this = character:144998 #king_lothaire + } + modifier = { + add = 999 + exists = this + exists = character:83355 #petty_king_murchad + this = character:83355 #petty_king_murchad + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_petter_vilberg + this = character:easteregg_petter_vilberg + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_james_beaumont + this = character:easteregg_james_beaumont + } + modifier = { + add = 999 + exists = this + exists = character:159038 #Coel + this = character:159038 #ACoel + } + modifier = { + add = 999 + exists = this + exists = character:900062 #Stilicho + this = character:900062 #Stilicho + } + modifier = { + add = 999 + exists = this + exists = character:180618 #Bahram + this = character:180618 #Bahram + } + modifier = { + add = 999 + exists = this + exists = character:83432 #Eochaid + this = character:83432 #Eochaid + } + modifier = { + add = 999 + exists = this + exists = character:londinium_01 #Riothamus + this = character:londinium_01 #Riothamus + } + modifier = { + add = 999 + exists = this + exists = character:vigg_04 #Hengest + this = character:vigg_04 #Hengest + } + modifier = { + add = 999 + exists = this + exists = character:constantinus_05 #Ambrosius + this = character:constantinus_05 #Ambrosius + } + modifier = { + add = 999 + exists = this + exists = character:cappadocia_07 #Ioannes + this = character:cappadocia_07 #Ioannes + } + modifier = { + add = 999 + exists = this + exists = character:mauri_42 #Iabdas + this = character:mauri_42 #Iabdas + } + modifier = { + add = 999 + exists = this + exists = character:997011 #Chlodomir + this = character:997011 #Chlodomir + } + } + } + + male_beard_western_02 = { # Standard goatee + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.07 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:107500 #king_sancho + this = character:107500 #king_sancho + } + modifier = { + add = 999 + exists = this + exists = character:42018 #karlmann + this = character:42018 #karlmann + } + modifier = { + add = 999 + exists = this + exists = character:991004 #Mundus + this = character:991004 #Mundus + } + } + } + + male_beard_western_03 = { # Short beard + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.11 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:163110 #sigurdr_snake_in_the_eye + this = character:163110 #sigurdr_snake_in_the_eye + } + modifier = { + add = 999 + exists = this + exists = character:90104 #charles_the_bald + this = character:90104 #charles_the_bald + } + modifier = { + add = 999 + exists = this + exists = character:109500 #king_garcia + this = character:109500 #king_garcia + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_henrik_fahraeus + this = character:easteregg_henrik_fahraeus + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_olof_bjork + this = character:easteregg_olof_bjork + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_sean_hughes + this = character:easteregg_sean_hughes + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_maximilian_olbers + this = character:easteregg_maximilian_olbers + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_nikolaos_kaltsogiannis + this = character:easteregg_nikolaos_kaltsogiannis + } + } + } + + male_beard_western_04 = { # Short goatee + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.14 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_nils_wadensten + this = character:easteregg_nils_wadensten + } + modifier = { + add = 999 + exists = this + exists = character:waegmunding_2 #Beowulf + this = character:waegmunding_2 #Beowulf + } + } + } + + male_beard_western_05 = { # Mustache + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.17 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:122 #king_harold + this = character:122 #king_harold + } + modifier = { + add = 999 + exists = this + exists = character:1128 #duke_robert + this = character:1128 #duke_robert + } + modifier = { + add = 999 + exists = this + exists = character:992016 #theodoric_the_great + this = character:992016 #theodoric_the_great + } + modifier = { + add = 999 + exists = this + exists = character:992022 #Theodahad + this = character:992022 #Theodahad + } + modifier = { + add = 999 + exists = this + exists = character:997003 #Merovech + this = character:997003 #Merovech + } + } + } + + male_beard_western_06 = { # Big bushy beard + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.2 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:106000 #king_antso + this = character:106000 #king_antso + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_paul_depre + this = character:easteregg_paul_depre + } + modifier = { + add = 999 + exists = this + exists = character:999103 #Alaric I + this = character:999103 #Alaric I + } + modifier = { + add = 999 + exists = this + exists = character:997002 #Chlodio + this = character:997002 #Chlodio + } + } + } + + male_beard_western_07 = { # Chin strap + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.23 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:997004 #Childeric + this = character:997004 #Childeric + } + } + } + + male_beard_western_08 = { # Big with fancy mustache + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.27 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:984 #king_malcom + this = character:984 #king_malcom + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_max_weltz + this = character:easteregg_max_weltz + } + modifier = { + add = 999 + exists = this + exists = character:arsacid_58 #vramshapuh + this = character:arsacid_58 #vramshapuh + } + modifier = { + add = 999 + exists = this + exists = character:145071 #Heraclius + this = character:145071 #Heraclius + } + } + } + + male_beard_western_09 = { # Pointy beard + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.30 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:159431 #Conan Meriadoc + this = character:159431 #Conan Meriadoc + } + modifier = { + add = 999 + exists = this + exists = character:maldras_06 #Hermenerich + this = character:maldras_06 #Hermenerich + } + modifier = { + add = 999 + exists = this + exists = character:997009 #Theodoric Meroving + this = character:997009 #Theodoric Meroving + } + modifier = { + add = 999 + exists = this + exists = character:992063 #Fritigern + this = character:992063 #Fritigern + } + } + } + + male_beard_western_10 = { # Chin goatee + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.33 # For the randomness to work correctly + } + } + weight = { + base = 0 + } + } + + male_beard_mena_01 = { # Very curly medium length full beard + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.35 # For the randomness to work correctly + } + } + weight = { + base = 0 + + modifier = { + add = 999 + exists = this + exists = character:982001 #Abu Karib + this = character:982001 #Abu Karib + } + } + } + + male_beard_mena_02 = { # Big with small mustache + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.39 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:3924 #emir_yahya + this = character:3924 #emir_yahya + } + modifier = { + add = 999 + exists = this + exists = character:lakhmid_06 #al-Nu'Man + this = character:lakhmid_06 #al-Nu'Man + } + modifier = { + add = 999 + exists = this + exists = character:rugian_03 #Feletheus + this = character:rugian_03 #Feletheus + } + } + } + + male_beard_mena_03 = { # Big chin strap + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.42 # For the randomness to work correctly + } + } + weight = { + base = 0 + } + } + + male_beard_mena_04 = { # Short stylish + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.45 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:quadi_04 # Hermerich of the Quadi + this = character:quadi_04 # Hermerich of the Quadi + } + modifier = { + add = 999 + exists = this + exists = character:syagri_06 #Syagrus + this = character:syagri_06 #Syagrus + } + modifier = { + add = 999 + exists = this + exists = character:997005 #Chlodovech + this = character:997005 #Chlodovech + } + modifier = { + add = 999 + exists = this + exists = character:belisarius_001 #Belisarius + this = character:belisarius_001 #Belisarius + } + } + } + + male_beard_northern_01 = { # Big wide + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.48 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:163111 #ivar_the_boneless + this = character:163111 #ivar_the_boneless + } + modifier = { + add = 999 + exists = this + exists = character:102531 #harald_hardrade + this = character:102531 #harald_hardrade + } + } + } + + male_beard_northern_02 = { # Single braid + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.52 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:163112 #halfdan_whiteshirt + this = character:163112 #halfdan_whiteshirt + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:6878 #jarl_haesteinn + this = character:6878 #jarl_haesteinn + } + } + } + + male_beard_northern_03 = { # Beaded beard + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.54 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:163108 #bjorn_ironside + this = character:163108 #bjorn_ironside + } + modifier = { + add = 999 + exists = this + exists = character:40605 #rurik + this = character:40605 #rurik + } + modifier = { + add = 999 + exists = this + exists = character:easteregg_peter_johannesson + this = character:easteregg_peter_johannesson + } + modifier = { + add = 999 + exists = character:997013 #Chlothar + this = character:997013 #Chlothar + } + } + } + + male_beard_steppe_01 = { # long at chin with mustache + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.58 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = character:ashina_03 #Tuwu + this = character:ashina_03 #Tuwu + } + modifier = { + add = 999 + exists = character:ashina_04 #Bumin + this = character:ashina_04 #Bumin + } + } + } + + male_beard_steppe_02 = { # low rough + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.61 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:159137 #almos_arpad + this = character:159137 #almos_arpad + } + modifier = { + add = 999 + exists = character:990006 #Attila + this = character:990006 #Attila + } + modifier = { + add = 999 + exists = character:ashina_05 #Istemi + this = character:ashina_05 #Istemi + } + modifier = { + add = 999 + exists = this + exists = character:hephthalite_misc_017 #Katulf + this = character:hephthalite_misc_017 #Katulf + } + } + } + + male_beard_sub_saharan_01 = { # Full african beard medium + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.64 # For the randomness to work correctly + } + } + weight = { + base = 0 + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:nuvelan_11 #Gildo + this = character:nuvelan_11 #Gildo + } + modifier = { + add = 999 + exists = this + exists = character:aksum_16 #Ouazeba + this = character:aksum_16 #Ouazeba + } + modifier = { + add = 999 + exists = this + exists = character:himyarite_30 #Abraha + this = character:himyarite_30 #Abraha + } + } + } + + male_beard_sub_saharan_02 = { # Stylish african goatee + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.67 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:aksum_17 #eon + this = character:aksum_17 #eon + } + } + } + + male_beard_sub_saharan_03 = { # Full african beard long + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.70 # For the randomness to work correctly + } + } + weight = { + base = 0 + } + } + + male_beard_indian_01 = { # Handlebar mustache + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.74 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:easteregg_struan_mccallum + this = character:easteregg_struan_mccallum + } + modifier = { + add = 999 + exists = this + exists = character:alchonid_005 #Khingila + this = character:alchonid_005 #Khingila + } + modifier = { + add = 999 + exists = this + exists = character:arsacid_64 #Mystakon + this = character:arsacid_64 #Mystakon + } + } + } + + male_beard_indian_02 = { # Indian pointy + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.77 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:900016 #Faramund + this = character:900016 #Faramund + } + modifier = { + add = 999 + exists = this + exists = character:xionite_001 #Kidara + this = character:xionite_001 #Kidara + } + modifier = { + add = 999 + exists = this + exists = character:145072 #Focas + this = character:145072 #Focas + } + modifier = { + add = 999 + exists = this + exists = character:greek_17 #Plutarch + this = character:greek_17 #Plutarch + } + } + } + + male_beard_indian_03 = { # Very curly medium length full beard + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.80 # For the randomness to work correctly + } + } + weight = { + base = 0 + + } + } + + male_beard_rtt_01 = { # Wizard beard + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.0 # For the randomness to work correctly + } + } + weight = { + base = 0 + } + } + + ### FP2 Beards ### + + male_beard_fp2_iberian_christian_01 = { # Twin braids with metal rings + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_02 + value = 0.11 # For the randomness to work correctly + } + } + weight = { + base = 0 + } + } + + male_beard_fp2_iberian_christian_02 = { # Twin braids with metal rings + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_02 + value = 0.235 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:996002 #Odovacar + this = character:996002 #Odovacar + } + modifier = { + add = 999 + exists = this + exists = character:168137 + this = character:168137 + } + + modifier = { + add = 999 + exists = this + exists = character:70292 + this = character:70292 + } + } + } + + male_beard_fp2_iberian_christian_03 = { # Twin braids with metal rings + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_02 + value = 0.36 # For the randomness to work correctly + } + } + weight = { + base = 0 + + modifier = { + add = 999 + exists = this + exists = character:73813 + this = character:73813 + } + + modifier = { + add = 999 + exists = this + exists = character:surunbaqi0001 + this = character:surunbaqi0001 + } + } + } + + male_beard_fp2_iberian_christian_04 = { + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_02 + value = 0.485 # For the randomness to work correctly + } + } + weight = { + base = 0 + + modifier = { + add = 999 + exists = this + exists = character:barcelona_00003 + this = character:barcelona_00003 + } + modifier = { + add = 999 + exists = this + exists = character:200280 #Theodis + this = character:200280 #Theodis + } + modifier = { + add = 999 + exists = this + exists = character:997015 #Theodobert + this = character:997015 #Theodobert + } + } + } + + male_beard_fp2_iberian_muslim_01 = { # Thick Groomed Beard + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_02 + value = 0.61 # For the randomness to work correctly + } + } + weight = { + base = 0 + + modifier = { + add = 999 + exists = this + exists = character:70150 + this = character:70150 + } + + modifier = { + add = 999 + exists = this + exists = character:180628 #Khosrau + this = character:180628 #Khosrau + } + + modifier = { + add = 999 + exists = this + exists = character:73683 + this = character:73683 + } + modifier = { + add = 999 + exists = this + exists = character:200284 #euric + this = character:200284 #euric + } + modifier = { + add = 999 + exists = this + exists = character:aelling_01 #Aelle + this = character:aelling_01 #Aelle + } + modifier = { + add = 999 + exists = this + exists = character:159012 #Cadwallon + this = character:159012 #Cadwallon + } + } + } + + male_beard_fp2_iberian_muslim_02 = { # Scholar's beard + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_02 + value = 0.735 # For the randomness to work correctly + } + } + weight = { + base = 0 + + modifier = { + add = 999 + exists = this + exists = character:danis0005 + this = character:danis0005 + } + modifier = { + add = 999 + exists = this + exists = character:vandals_003 + this = character:vandals_003 + } + modifier = { + add = 999 + exists = this + exists = character:145237 #julian_the_apostate + this = character:145237 #julian_the_apostate + } + modifier = { + add = 999 + exists = this + exists = character:greek_20 #Proklos + this = character:greek_20 #Proklos + } + } + } + + + + male_beard_fp2_iberian_muslim_03 = { # Forked beard + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_02 + value = 0.860 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:mauri_36 #Masties + this = character:mauri_36 #Masties + } + } + } + + no_beard = { + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_02 + value = 1 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:73857 + this = character:73857 + } + modifier = { + add = 999 + exists = this + exists = character:nepos_02 #Nepos + this = character:nepos_02 #Nepos + } + modifier = { + add = 999 + exists = this + exists = character:70512 #Justinian + this = character:70512 #Justinian + } + modifier = { + add = 999 + exists = this + exists = character:205141 #Ceredig + this = character:205141 #Ceredig + } + modifier = { + add = 999 + exists = this + exists = character:vandals_005 #Hilderic + this = character:vandals_005 #Hilderic + } + modifier = { + add = 999 + exists = this + exists = character:vandals_012 #Gelimer + this = character:vandals_012 #Gelimer + } + modifier = { + add = 999 + exists = this + exists = character:992023 #Athalaric + this = character:992023 #Athalaric + } + modifier = { + add = 999 + exists = this + exists = character:70515 #Zeno + this = character:70515 #Zeno + } + modifier = { + add = 999 + exists = this + exists = character:70517 #Leo + this = character:70517 #Leo + } + modifier = { + add = 999 + exists = this + exists = character:70514 #Anastasius + this = character:70514 #Anastasius + } + modifier = { + add = 999 + exists = this + exists = character:armenian_01 #Narses + this = character:armenian_01 #Narses + } + modifier = { + add = 999 + exists = this + exists = character:mauro_roman_kings_02 #Massonas + this = character:mauro_roman_kings_02 #Massonas + } + modifier = { + add = 999 + exists = this + exists = character:samo_01 #Samo + this = character:samo_01 #Samo + } + } + } + + + ### FP1 Beards ### + male_beard_fp1_01 = { # Twin braids with metal rings + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.84 # For the randomness to work correctly + } + } + weight = { + base = 0 + } + } + + male_beard_fp1_02 = { # Short low beard + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.1 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:159117 #Kubrat + this = character:159117 #Kubrat + } + } + } + + male_beard_fp1_03 = { # Wavy pointy beard + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.90 # For the randomness to work correctly + } + } + weight = { + base = 0 + + } + } + + male_beard_fp1_04 = { # Huge braid + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.94 # For the randomness to work correctly + } + } + weight = { + base = 0 + } + } + + male_beard_fp1_05 = { # Long narrow wavy + dna_modifiers = { + accessory = { + mode = add + gene = beards + template = scripted_character_beards_01 + value = 0.97 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:997012 #Childebert + this = character:997012 #Childebert + } + modifier = { add = 999 + exists = this + exists = character:992003 #Hermanaric + this = character:992003 #Hermanaric + } + } + } +} + } +} + +"gfx/portraits/portrait_modifiers/50_headgear_scripted_characters.txt" = { + { +headgear_scripted_characters = { + + usage = game + selection_behavior = max + priority = 10 + + no_headgear = { # No headgear + dna_modifiers = { + accessory = { + mode = add + gene = headgear + template = fp2_scripted_headgear_01 + value = 0.1 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 50 + exists = this + exists = character:73857 + this = character:73857 + } + modifier = { + add = 50 + exists = this + exists = character:108501 + this = character:108501 + } + modifier = { + add = 999 + exists = this + exists = character:900062 #Stilicho + this = character:900062 #Stilicho + } + modifier = { + add = 999 + exists = this + exists = character:nuvelan_11 #Gildo + this = character:nuvelan_11 #Gildo + } + modifier = { + add = 999 + exists = this + exists = character:belisarius_001 #Belisarius + this = character:belisarius_001 #Belisarius + } + } + } + + male_headgear_secular_fp2_iberian_muslim_common_01_low = { + dna_modifiers = { + accessory = { + mode = add + gene = headgear + template = fp2_scripted_headgear_01 + value = 0.5 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 50 + exists = this + exists = character:73813 # Musa + this = character:73813 + } + } + } + + male_headgear_secular_fp2_iberian_muslim_high_nobility_01 = { + dna_modifiers = { + accessory = { + mode = add + gene = headgear + template = fp2_scripted_headgear_01 + value = 1 # For the randomness to work correctly + } + } + weight = { + base = 0 + modifier = { + add = 50 + exists = this + exists = character:danis0005 # Adanis + this = character:danis0005 + } + } + } + male_headgear_secular_roman_pannonian_hat_high_nobility = { + dna_modifiers = { + accessory = { + mode = add + gene = headgear + template = roman_pannonian_hat_high + value = 1 + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:nepos_02 #Nepos + this = character:nepos_02 #Nepos + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:syagri_06 #Syagrius + this = character:syagri_06 #Syagrius + } + } + } + male_headgear_secular_western_high_nobility = { + dna_modifiers = { + accessory = { + mode = add + gene = headgear + template = western_high_nobility + value = 1 + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:900016 #Faramund + this = character:900016 #Faramund + } + } + } + male_headgear_secular_roman_diadem = { + dna_modifiers = { + accessory = { + mode = add + gene = headgear + template = roman_diadem + value = 1 + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:70515 #Zeno + this = character:70515 #Zeno + } + } + } + male_headgear_secular_sassanid_crown = { + dna_modifiers = { + accessory = { + mode = add + gene = headgear + template = ep1_sassanid_crown + value = 1 + } + } + weight = { + base = 0 + modifier = { + add = 999 + exists = this + exists = character:180628 #Khosrau + this = character:180628 #Khosrau + } + } + } +} + } +} + + +"events/gothic_wars_events.txt" = { + { +### King of the Goths is crowned after the Death of Theodosius and starts a rebellion +### by Juli +gothic_wars.0001 = { + type = character_event + theme = war + title = gothic_wars_0001.t + desc = gothic_wars_0001.desc + override_icon = { reference = "gfx/interface/icons/event_types/special_visigoths.dds" } + + left_portrait = { + character = ROOT + animation = rage + } + right_portrait = { + character = character:70534 + animation = zealous + } + lower_left_portrait = { + character = title:e_western_roman_empire.holder + animation = cynical + } + lower_right_portrait = { + character = title:e_byzantium.holder + animation = grief + } + + option = { + name = gothic_wars_0001.a + add_character_modifier = { + modifier = TFE_king_of_the_goths_modifier # They became King of the Goths + } + } +} +### King of the Goth Has won the rebellion and now can choose to press demands on the emperor +### by Juli +gothic_wars.0002 = { + type = character_event + theme = war + title = gothic_wars_0002.t + desc = gothic_wars_0002.desc + override_icon = { reference = "gfx/interface/icons/event_types/special_visigoths.dds" } + + left_portrait = { + character = ROOT + animation = personality_zealous + } + right_portrait = { + character = title:e_byzantium.holder + animation = shame + } + + option = { # The King chooses to pressure the Emperor into giving him an office + custom_tooltip = gothic_wars_0002.option.a.tooltip + name = gothic_wars_0002.a + title:e_byzantium.holder = {trigger_event = gothic_wars.0003 } + ai_chance = { + # AI should always be fairly likely to pick this. + base = 100 + } + } + option = { # The King chooses to forgive the romans and settle with the plundering he gained + name = gothic_wars_0002.b + ai_chance = { + base = 1 + } + } +} +### Emperor of Byzantium recieves demand from the Goths +### by Juli +gothic_wars.0003 = { + type = character_event + theme = war + title = gothic_wars_0003.t + desc = gothic_wars_0003.desc + override_icon = { reference = "gfx/interface/icons/event_types/special_visigoths.dds" } + + left_portrait = { + character = title:k_visigoths.holder + animation = personality_greedy + } + right_portrait = { + character = title:e_byzantium.holder + animation = vengeful + } + + option = { # The Emperor accepts the demands + name = gothic_wars_0003.a + title:k_visigoths.holder = {trigger_event = gothic_wars.0004 } + ai_chance = { + # AI should always be fairly likely to pick this. + base = 100 + } + } + option = { # The Emperor declines the offer, making the goths rebel again + name = gothic_wars_0003.b + title:k_visigoths.holder = { + start_war = { + casus_belli = depose_war + target = title:e_byzantium.holder + target_title = title:e_byzantium + } + } + ai_chance = { + base = 1 + } + } +} +### King of the Goths is granted an Office in Illyricum +### by Juli +gothic_wars.0004 = { + type = character_event + theme = war + title = gothic_wars_0004.t + desc = gothic_wars_0004.desc + override_icon = { reference = "gfx/interface/icons/event_types/special_visigoths.dds" } + + left_portrait = { + character = ROOT + animation = personality_bold + } + right_portrait = { + character = title:e_byzantium.holder + animation = shame + } + + option = { # The Emperor accepted the demands and grants Illyricum to Alaric + name = gothic_wars_0004.a + every_county_in_region = { + region = custom_roman_illyricum + limit = { + holder = { + highest_held_title_tier < tier_kingdom #to not vassalize the vicar + top_liege = title:e_byzantium.holder + } + } + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = no + } + holder = { + change_liege = { + liege = root + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + } + hidden_effect = { + every_realm_county = { + limit = { + NOT = { + any_county_in_region = { + region = custom_roman_illyricum + THIS = PREV + } + } + holder = { + OR = { + any_liege_or_above = { + THIS = root + } + THIS = root + } + } + } + if = { + limit = { + holder = root + } + create_character = { + location = THIS.title_province + gender = male + dynasty = generate + faith = root.faith + culture = root.culture + save_scope_as = local_warlord + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + change_title_holder = { + holder = scope:local_warlord + change = scope:change + take_baronies = yes + } + resolve_title_and_vassal_change = scope:change + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = no + } + scope:local_warlord = { + change_liege = { + liege = title:e_byzantium.holder + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + } + else = { + holder = { + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = no + } + change_liege = { + liege = title:e_byzantium.holder + change = scope:change + } + resolve_title_and_vassal_change = scope:change + } + } + + } + } + add_pressed_claim = title:k_italia_suburbicariae + } +} + } + + { +### Invasion of the Gothic pagan Radagaisus around in 405-406 - Hróð +gothic_wars.0011 = { + scope = none + hidden = yes + + immediate = { + debug_log = "Radagaisus appeared!" + debug_log_date = yes + spawn_radagaisus_character_effect = yes + } +} + } + + { +## Radagaisus notification event global - Hróð +gothic_wars.0012 = { + type = character_event + theme = war + title = gothic_wars_0012.t + desc = gothic_wars_0012.desc + + left_portrait = { + character = character:radagaisian_02 + animation = rage + } + right_portrait = { + character = title:e_western_roman_empire.holder + animation = fear + } + + option = { + name = gothic_wars_0012.a + } +} +## Radagaisus notification event for defender - Hróð +gothic_wars.0013 = { + type = character_event + theme = war + title = gothic_wars_0012.t + desc = gothic_wars_0013.desc + + left_portrait = { + character = character:radagaisian_02 + animation = rage + } + right_portrait = { + character = ROOT + animation = fear + } + + option = { + name = gothic_wars_0013.a + } +} +## Defender event if Radagaisus wins - Hróð +gothic_wars.0014 = { + type = character_event + theme = war + title = gothic_wars_0012.t + desc = gothic_wars_0014.desc + + left_portrait = { + character = character:radagaisian_02 + animation = personality_bold + } + right_portrait = { + character = scope:defender + animation = shame + } + + option = { + name = gothic_wars_0014.a + scope:defender = { + add_pressed_claim = title:k_italia_annonariae + add_pressed_claim = title:k_italia_suburbicariae + } + } +} +## Event for the Visigothic King if Radagaisus loses - Hróð +gothic_wars.0015 = { + type = character_event + theme = war + title = gothic_wars_0012.t + desc = gothic_wars_0015.desc + + left_portrait = { + character = scope:defender + animation = personality_bold + } + right_portrait = { + character = character:radagaisian_02 + animation = grief + } + + option = { + name = gothic_wars_0015.a + scope:visigothic_king = { + add_unpressed_claim = title:k_italia_annonariae + add_unpressed_claim = title:k_italia_suburbicariae + } + title:e_western_roman_empire.holder = { + add_opinion = { + target = scope:visigothic_king + modifier = angry_opinion + opinion = -30 + } + } + title:e_byzantium.holder = { + add_opinion = { + target = scope:visigothic_king + modifier = angry_opinion + opinion = -30 + } + } + spawn_smaller_gothic_troops_effect = yes + ai_chance = { + base = 50 + + opinion_modifier = { + if = { + exists = scope:visigothic_king.liege + } + who = scope:visigothic_king + opinion_target = scope:visigothic_king.liege + multiplier = 1 + } + } + } + option = { + name = gothic_wars_0015.b + title:e_western_roman_empire.holder = { + add_opinion = { + target = scope:visigothic_king + modifier = pleased_opinion + opinion = 30 + } + } + title:e_byzantium.holder = { + add_opinion = { + target = scope:visigothic_king + modifier = pleased_opinion + opinion = 30 + } + } + ai_chance = { + base = 50 + + opinion_modifier = { + if = { + exists = scope:visigothic_king.liege + } + who = scope:visigothic_king + opinion_target = scope:visigothic_king.liege + multiplier = 1 + } + } + } +} + } +} + +"common/scripted_effects/TFE_landless_adventurer_effects.txt" = { + { + ############################################################ + # + # 361 LAAMP + # + ############################################################ + + # Charietto + character:ripurian_misc_001 ?= { + if = { + limit = { + is_alive = yes + is_landless_adventurer = yes + } + add_realm_law_skip_effects = camp_purpose_brigands + } + } + + # Moses the Black + character:nobatia_12 ?= { + if = { + limit = { + is_alive = yes + is_landless_adventurer = yes + } + add_realm_law_skip_effects = camp_purpose_brigands + } + } + } + + { + ############################################################ + # + # 395 LAAMP + # + ############################################################ + + # Olympiodorus + character:aegyptian_misc_009 ?= { + if = { + limit = { + is_alive = yes + is_landless_adventurer = yes + } + add_realm_law_skip_effects = camp_purpose_scholars + } + } + + # Claudius Marius Victorius/Victorinus + character:gallo_roman_misc_010 ?= { + if = { + limit = { + is_alive = yes + is_landless_adventurer = yes + } + add_realm_law_skip_effects = camp_purpose_scholars + } + } + + # Fravitta + character:992079 ?= { + if = { + limit = { + is_alive = yes + is_landless_adventurer = yes + } + add_realm_law_skip_effects = camp_purpose_mercenaries + } + } + } + + { + ############################################################ + # + # 476 LAAMP + # + ############################################################ + + + # Damascius + character:syrian_misc_06 ?= { + if = { + limit = { + is_alive = yes + is_landless_adventurer = yes + } + add_realm_law_skip_effects = camp_purpose_scholars + } + } + + # Pamprepius + character:aegyptus_84 ?= { + if = { + limit = { + is_alive = yes + is_landless_adventurer = yes + } + add_realm_law_skip_effects = camp_purpose_scholars + } + } + } + + { + ############################################################ + # + # 532 LAAMP + # + ############################################################ + + # Cosmas Indicopleustes + character:aegyptian_misc_008 ?= { + if = { + limit = { + is_alive = yes + is_landless_adventurer = yes + } + add_realm_law_skip_effects = camp_purpose_explorers + } + } + } +} + +"events/liang_events.txt" = { + { +# Meng Min is a cool guy, but destiny calls for Li Gao to do his part as the distant ancestor of the Tang Dynasty +liang.0012 = { + type = character_event + hidden = yes + + trigger = { + this = character:western_liang_043 # Meng Min + character:western_liang_005 = { # Li Gao is alive + is_alive = yes + } + } + + immediate = { + death = { + death_reason = death_natural_causes + } + } +} + } + + { +# Give Li Gao the territory +liang.0010 = { + type = character_event + title = liang.0010.t + desc = liang.0010.desc + theme = realm + + left_portrait = { + character = scope:governor + animation = personality_content + } + right_portrait = { + character = scope:li_gao + animation = personality_forgiving + } + lower_center_portrait = { + character = scope:guo_nen + } + + trigger = { + game_start_date < 400.1.1 + game_start_date > 385.1.1 + NOT = { has_global_variable = TFE_li_gao_becomes_governor } + scope:title = { + this = title:d_guiyi + } + character:western_liang_005 ?= { + is_alive = yes + NOT = { has_title = scope:title } + } + } + + immediate = { + set_global_variable = { + name = TFE_li_gao_becomes_governor + value = yes + } + save_scope_as = governor + character:western_liang_005 = { + save_scope_as = li_gao + } + character:liang_007 = { + save_scope_as = guo_nen + } + } + + # Give Li Gao the title + option = { + name = liang.0010.a + add_character_flag = gave_li_gao_title + scope:li_gao = { + trigger_event = liang.0011 + } + show_as_tooltip = { + scope:li_gao = { + get_title = scope:title + } + if = { + limit = { + has_title = title:d_aksay + } + scope:li_gao = { + get_title = title:d_aksay + } + } + if = { + limit = { + has_title = title:c_guazhou + } + scope:li_gao = { + get_title = title:c_guazhou + } + } + scope:li_gao = { + add_prestige = 500 + } + } + if = { + limit = { + scope:li_gao = { + is_ai = yes + } + } + set_player_character = scope:li_gao + } + } + + # Don't give Li Gao the title + option = { + name = liang.0010.b + trigger = { + is_ai = no + } + add_prestige = -250 + add_character_modifier = { + modifier = TFE_refused_to_give_up_dunhuang + } + scope:li_gao = { + add_pressed_claim = scope:title + } + if = { + limit = { + has_title = title:d_aksay + } + scope:li_gao = { + add_pressed_claim = title:d_aksay + } + } + if = { + limit = { + has_title = title:c_guazhou + } + scope:li_gao = { + add_pressed_claim = title:c_guazhou + } + } + } + + after = { + hidden_effect = { + if = { + limit = { + has_character_flag = gave_li_gao_title + } + if = { + limit = { + is_landed = yes + highest_held_title_tier < tier_duchy + } + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = change + } + scope:governor = { + change_liege = { + liege = scope:li_gao + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + } + else_if = { + limit = { + is_landed = no + } + scope:li_gao = { + add_courtier = scope:governor + } + } + remove_character_flag = gave_li_gao_title + } + } + } +} + } +} + +"events/roman_events.txt" = { + { +western_roman.0027 = { + type = character_event + title = western_roman.0027.t + desc = western_roman.0027.desc + theme = realm + left_portrait = { + character = root + animation = personality_vengeful + } + right_portrait = { + character = character:orestes_02 + animation = personality_greedy + } + + immediate = { + play_music_cue = "TFE_General_Cue" + } + + option = { + name = western_roman.0027.a + add_stress = major_stress_gain + set_relation_rival = { + target = character:996002 + reason = rival_usurper + } + add_pressed_claim = title:k_italy + add_pressed_claim = title:d_romagna + add_pressed_claim = title:c_ravenna + remove_trait = diligent + add_trait = impatient + custom_tooltip = nepos_ambition_tooltip + set_global_variable = { + name = nepos_ambition_var + value = yes + } + ai_chance = { + base = 90 + } + } + option = { + name = western_roman.0027.b + add_prestige = 500 + every_vassal = { + add_opinion = { + modifier = friendliness_opinion + target = scope:root + opinion = 20 + } + } + remove_trait = ambitious + add_trait = content + ai_chance = { + base = 10 + } + } +} + } + + { +western_roman.0038 = { + type = character_event + title = western_roman.0038.t + desc = western_roman.0038.desc + theme = realm + override_icon = { reference = "gfx/interface/icons/event_types/special_rhomaion.dds" } + + left_portrait = { + character = root + animation = anger + } + lower_center_portrait = { + character = global_var:gelimer + animation = personality_greedy + } + right_portrait = { + character = global_var:hildirix + animation = fear + } + + immediate = { + title:e_byzantium.holder = { + add_legitimacy = -400 + } + if = { + limit = { + character:vandals_005 = { + is_alive = yes + } + } + set_global_variable = { + name = hildirix + value = character:vandals_005 + } + character:vandals_005 = { + add_character_flag = { + flag = is_being_tortured + years = 20 # + } + } + title:k_vandals.holder = { + imprison = { + target = global_var:hildirix + type = house_arrest + } + } + set_global_variable = { + name = gelimer + value = title:k_vandals.holder + } + } + add_character_modifier = { + modifier = renovatio_imperii + years = 10 + } + } + + option = { + name = western_roman.0038.a + ai_chance = { + base = 100 + } + } + + option = { + name = western_roman.0038.b + ai_chance = { + base = 0 + } + } + +} + } + + { +western_roman.0039 = { + type = character_event + title = western_roman.0039.t + desc = western_roman.0039.desc + theme = realm + override_icon = { reference = "gfx/interface/icons/event_types/special_rhomaion.dds" } + + left_portrait = { + character = root + animation = personality_vengeful + } + lower_center_portrait = { + character = scope:commander_2 + animation = personality_bold + } + right_portrait = { + character = scope:commander_1 + animation = personality_bold + } + + immediate = { + title:k_vandals.holder = { + set_scope_as = target_ruler + } + if = { + limit = { + global_var:belisarius = { + is_alive = yes + } + } + global_var:belisarius = { + save_scope_as = commander_1 + } + } + else_if = { + limit = { + character:armenian_01 = { + is_alive = yes + } + character:armenian_01 = { + is_courtier_of = root + } + } + character:armenian_01 = { + save_scope_as = commander_1 + } + } + else_if = { + limit = { + character:armenian_02 = { + is_alive = yes + } + character:armenian_02 = { + is_courtier_of = root + } + } + character:armenian_02 = { + save_scope_as = commander_1 + } + } + else = { + random_courtier = { + limit = { + is_adult = yes + is_male = yes + } + save_scope_as = commander_1 + } + } + random_courtier = { + limit = { + NOT = { THIS = scope:commander_1 } + is_adult = yes + is_male = yes + } + save_scope_as = commander_2 + } + } + + option = { + name = western_roman.0039.a + hidden_effect = { + set_global_variable = { + name = justinian_commander + value = scope:commander_1 + } + start_vandalic_war_effect = yes + } + ai_chance = { + base = 100 + } + } + + option = { + name = western_roman.0039.b + hidden_effect = { + set_global_variable = { + name = justinian_commander + value = scope:commander_2 + } + start_vandalic_war_effect = yes + } + ai_chance = { + base = 0 + } + } +} + } + + { +western_roman.0041 = { + type = character_event + title = western_roman.0041.t + desc = western_roman.0041.desc + theme = realm + override_icon = { reference = "gfx/interface/icons/event_types/special_rhomaion.dds" } + + left_portrait = { + character = root + animation = personality_honorable + } + + immediate = { + global_var:justinian_commander = { + add_character_flag = STOP_ADMIN + } + title:k_vandals.holder = { + save_scope_as = justinian_commander + } + set_global_variable = { + name = vandalic_war_won + value = yes + } + title:e_byzantium.holder = { + add_legitimacy = 100 + } + if = { + limit = { + character:vandals_146 = { + is_alive = yes + is_landed = yes + top_liege = root + } + } + character:vandals_146 = { + vassal_contract_set_obligation_level = { type = feudal_government_taxes level = 2 } + vassal_contract_set_obligation_level = { type = feudal_government_levies level = 1 } + vassal_contract_set_obligation_level = { type = religious_rights level = 1 } + } + } + } + + option = { + name = western_roman.0041.a + if = { + limit = { + exists = title:d_tunis.holder + title:d_tunis.holder = { is_vassal_or_below_of = scope:justinian_commander } + } + title:d_tunis = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:justinian_commander + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + } + if = { + limit = { + title:c_tunis.holder = { is_vassal_or_below_of = scope:justinian_commander } + } + title:c_tunis = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:justinian_commander + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + } + end_vandalic_war_africae_effect = yes + global_var:justinian_commander = { + remove_character_flag = STOP_ADMIN + } + ai_chance = { + base = 5 + } + } + + option = { + name = western_roman.0041.b + trigger = { + NOT = { scope:justinian_commander = character:belisarius_001 } + } + end_vandalic_war_africae_effect = yes + title:k_africae = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = root + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + title:c_trapani = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:justinian_commander + change = scope:change + take_baronies = yes + } + } + + resolve_title_and_vassal_change = scope:change + + title:c_mahdiya = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:justinian_commander.top_liege + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + global_var:justinian_commander = { + remove_character_flag = STOP_ADMIN + } + + ai_chance = { + base = 0 + } + } + option = { + name = western_roman.0041.c + trigger = { + global_var:hildirix = { + is_alive = yes + } + } + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:recall_belisarius + } + title:c_tunis = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = global_var:hildirix + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + title:k_vandals = { + add_to_list = titles_to_usurp + } + + title:k_vandals.holder = { + every_vassal = { + limit = { + capital_county = { + NOT = { empire = { this = title:e_byzantium } } + } + } + add_to_list = vassals_to_defect + } + } + + create_title_and_vassal_change = { + type = usurped + save_scope_as = title_change + add_claim_on_loss = no + } + every_in_list = { + list = titles_to_usurp + change_title_holder = { + holder = global_var:hildirix + change = scope:title_change + take_baronies = no + } + } + every_in_list = { + list = vassals_to_defect + change_liege = { + liege = global_var:hildirix + change = scope:title_change + } + } + resolve_title_and_vassal_change = scope:title_change + + title:c_trapani = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:justinian_commander + change = scope:change + take_baronies = yes + } + } + scope:justinian_commander = { + change_liege = { + liege = top_liege + change = scope:title_change + } + } + resolve_title_and_vassal_change = scope:change + + title:c_mahdiya = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = global_var:hildirix + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + global_var:justinian_commander = { + remove_character_flag = STOP_ADMIN + } + + ai_chance = { + base = 90 + } + } + option = { + name = western_roman.0041.d + trigger = { + global_var:hildirix = { + is_alive = yes + } + } + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:recall_belisarius + } + title:c_tunis = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = global_var:hildirix + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + title:k_vandals = { + add_to_list = titles_to_usurp + } + + title:k_vandals.holder = { + every_vassal = { + limit = { + capital_county = { + NOT = { empire = { this = title:e_byzantium } } + } + } + add_to_list = vassals_to_defect + } + } + + create_title_and_vassal_change = { + type = usurped + save_scope_as = title_change + add_claim_on_loss = no + } + every_in_list = { + list = titles_to_usurp + change_title_holder = { + holder = global_var:hildirix + change = scope:title_change + take_baronies = no + } + } + every_in_list = { + list = vassals_to_defect + change_liege = { + liege = global_var:hildirix + change = scope:title_change + } + } + resolve_title_and_vassal_change = scope:title_change + + create_title_and_vassal_change = { + type = independency + save_scope_as = change + } + global_var:hildirix = { + becomes_independent = { + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + + make_tributary = { + TYPE = tributary_permanent + SUZERAIN = title:e_byzantium.holder + TRIBUTARY = global_var:hildirix + } + + title:c_trapani = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:justinian_commander + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + title:c_mahdiya = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = global_var:hildirix + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + create_title_and_vassal_change = { + type = independency + save_scope_as = change + } + scope:justinian_commander = { + becomes_independent = { + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = change + add_claim_on_loss = no + } + scope:justinian_commander = { + change_liege = { + liege = root + change = scope:change + } + resolve_title_and_vassal_change = scope:change + } + + global_var:justinian_commander = { + remove_character_flag = STOP_ADMIN + } + + ai_chance = { + base = 5 + } + } +} + } + + { +western_roman.0043 = { + type = character_event + title = western_roman.0043.t + desc = western_roman.0043.desc + theme = realm + left_portrait = { + character = root + animation = fear + } + right_portrait = { + character = scope:emperor + animation = personality_vengeful + } + lower_center_portrait = { + character = scope:vicar + animation = personality_honorable + } + + immediate = { + root = { + save_scope_as = recipient + } + scope:emperor = { + save_scope_as = actor + } + } + + option = { + name = western_roman.0043.a + if = { + limit = { + OR = { + liege = title:k_africae.holder + AND = { + liege = { + liege = scope:defender + } + NOT = { + faith = liege.faith + } + } + } + } + add_character_flag = should_become_independent + } + if = { + limit = { + scope:actor = { + any_character_war = { + AND = { + using_cb = independence_war_vandal + casus_belli = { + primary_defender = scope:actor + } + } + } + } + } + scope:actor = { + every_character_war = { + limit = { + using_cb = independence_war_vandal + casus_belli = { + primary_defender = scope:actor + } + } + add_attacker = scope:recipient + } + } + } + else = { + start_war = { + cb = independence_war_vandal + target = scope:actor + } + } + ai_chance = { + base = 75 + ai_value_modifier = { + ai_boldness = 0.5 + ai_zeal = 1 + } + opinion_modifier = { + opinion_target = top_liege + who = root + multiplier = 0.25 + } + } + } + + option = { + name = western_roman.0043.b + demand_conversion_interaction_effect = yes + ai_chance = { + base = 25 + ai_value_modifier = { + ai_greed = 0.25 + ai_boldness = -0.5 + ai_zeal = -1 + ai_rationality = 0.25 + } + opinion_modifier = { + opinion_target = top_liege + who = root + multiplier = -0.25 + } + } + } +} + +western_roman.0044 = { + type = character_event + title = western_roman.0044.t + desc = western_roman.0044.desc + theme = realm + left_portrait = { + character = root + animation = personality_honorable + } + right_portrait = { + character = scope:emperor + animation = personality_greedy + } + + immediate = { + if = { + limit = { + character:assyrian_02 = { + is_alive = yes + is_landed = no + } + } + character:assyrian_02 = { + save_scope_as = new_vicar + } + } + else = { + scope:emperor = { + random_courtier = { + limit = { + is_adult = yes + is_male = yes + health >= fine_health + } + save_scope_as = new_vicar + } + } + } + } + + option = { + name = western_roman.0044.a + if = { + limit = { + has_trait = loyal + } + remove_trait = loyal + } + else = { + add_trait = disloyal + } + remove_trait = calm + add_trait = ambitious + set_relation_rival = { + target = scope:emperor + reason = rival_betrayed_friendship + } + scope:emperor = { + set_relation_rival = { + target = root + reason = rival_betrayed_friendship + } + } + add_opinion = { + modifier = hate_opinion + target = scope:emperor + opinion = -100 + } + reverse_add_opinion = { + modifier = hate_opinion + target = scope:emperor + opinion = -100 + } + set_global_variable = { + name = belisarius_betrayal + value = yes + } + start_war = { + cb = independence_war + target = scope:emperor + } + ai_chance = { + base = 0 + } + } + + option = { + name = western_roman.0044.b + if = { + limit = { + has_trait = disloyal + } + remove_trait = disloyal + } + else = { + add_trait = loyal + } + add_prestige = 2000 + add_prestige_level = 1 + add_character_modifier = { + modifier = imperial_triumph + years = 10 + } + scope:emperor = { + remove_trait = paranoid + add_trait = stubborn + send_interface_toast = { + title = western_roman.0044.tt + left_icon = root + right_icon = scope:emperor + } + } + + title:c_trapani = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = root + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + root = { + every_vassal = { + add_to_list = vassals_to_defect + } + } + + every_held_title = { + limit = { + NOT = { this = title:c_trapani } + } + add_to_list = titles_to_usurp + } + + create_title_and_vassal_change = { + type = usurped + save_scope_as = title_change + add_claim_on_loss = no + } + every_in_list = { + list = titles_to_usurp + change_title_holder = { + holder = scope:new_vicar + change = scope:title_change + take_baronies = no + } + } + every_in_list = { + list = vassals_to_defect + change_liege = { + liege = scope:new_vicar + change = scope:title_change + } + } + resolve_title_and_vassal_change = scope:title_change + + if = { + limit = { + scope:new_vicar = { + is_independent_ruler = yes + } + } + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = change + add_claim_on_loss = no + } + scope:new_vicar = { + change_liege = { + liege = scope:emperor + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + } + + if = { + limit = { + scope:new_vicar = { + NOT = { + OR = { + has_government = imperial_government + has_government = administrative_government + } + } + } + } + scope:new_vicar = { + if = { + limit = { + has_dlc_feature = roads_to_power + } + change_government = administrative_government + } + else = { + change_government = imperial_government + } + } + } + + #I hate admin + title:c_trapani = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = root + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + ai_chance = { + base = 100 + } + } +} + } + + { +western_roman.0062 = { + type = character_event + title = western_roman.0062.t + desc = western_roman.0062.desc + theme = realm + override_icon = { reference = "gfx/interface/icons/event_types/special_rhomaion.dds" } + + left_portrait = { + character = root + animation = personality_honorable + } + + immediate = { + set_global_variable = { + name = gothic_war_won + value = yes + } + root = { + save_scope_as = gothic_war_victor + add_legitimacy = 100 + } + if = { + limit = { + exists = title:k_italy.holder + title:k_italy.holder.top_liege = root + } + title:k_italy.holder = { + every_held_title = { + limit = { tier = tier_duchy } + title:k_italy.holder = { + destroy_title = prev + } + } + } + } + } + + option = { + name = western_roman.0062.a + if = { + limit = { + exists = title:k_italy.holder + OR = { + title:k_italy.holder = root + title:k_italy.holder.top_liege = root + } + } + title:k_italy = { + save_scope_as = title + } + trigger_event = tfe_title_event.0002 + } + if = { + limit = { + exists = title:k_croatia.holder + OR = { + title:k_croatia.holder = root + title:k_croatia.holder.top_liege = root + } + } + title:k_croatia = { + save_scope_as = title + } + trigger_event = tfe_title_event.0002 + } + ai_chance = { + base = 5 + } + } + + option = { + name = western_roman.0062.b + ai_chance = { + base = 0 + } + } + + option = { + name = western_roman.0062.c + if = { + limit = { + exists = title:k_italy.holder + OR = { + title:k_italy.holder = root + title:k_italy.holder.top_liege = root + } + } + end_gothic_war_italia_effect = yes + title:k_italia_annonariae = { + save_scope_as = title + } + trigger_event = tfe_title_event.0002 + title:k_italia_suburbicariae = { + save_scope_as = title + } + trigger_event = tfe_title_event.0002 + } + if = { + limit = { + exists = title:k_croatia.holder + OR = { + title:k_croatia.holder = root + title:k_croatia.holder.top_liege = root + } + } + end_gothic_war_croatia_effect = yes + title:k_pannonia = { + save_scope_as = title + } + trigger_event = tfe_title_event.0002 + } + ai_chance = { + base = 90 + } + } + option = { + name = western_roman.0062.d + if = { + limit = { + exists = title:k_italy.holder + OR = { + title:k_italy.holder = root + title:k_italy.holder.top_liege = root + } + } + end_gothic_war_italia_effect = yes + } + if = { + limit = { + exists = title:k_croatia.holder + OR = { + title:k_croatia.holder = root + title:k_croatia.holder.top_liege = root + } + } + end_gothic_war_croatia_effect = yes + } + ai_chance = { + base = 5 + } + } + option = { + name = western_roman.0062.e + trigger = { + is_ai = yes + } + if = { + limit = { + exists = title:k_italy.holder + OR = { + title:k_italy.holder = root + title:k_italy.holder.top_liege = root + } + } + end_gothic_war_italia_effect = yes + } + if = { + limit = { + exists = title:k_croatia.holder + OR = { + title:k_croatia.holder = root + title:k_croatia.holder.top_liege = root + } + } + end_gothic_war_croatia_effect = yes + title:k_pannonia = { + save_scope_as = title + } + trigger_event = tfe_title_event.0002 + } + if = { + limit = { + character:belisarius_001 = { + is_alive = yes + #is_ai = no + highest_held_title_tier <= tier_duchy + any_held_title = { + tier = tier_county + kingdom = title:k_italia_suburbicariae + } + top_liege = title:e_byzantium.holder + } + NOT = { exists = global_var:belisarius_betrayal } + } + title:k_italia_suburbicariae = { + save_scope_as = title + } + scope:title = { + create_title_and_vassal_change = { + type = granted + save_scope_as = change + add_claim_on_loss = no + } + change_title_holder_include_vassals = { + holder = character:belisarius_001 + change = scope:change + } + resolve_title_and_vassal_change = scope:change + } + } + else = { + title:k_italia_suburbicariae = { + save_scope_as = title + } + trigger_event = tfe_title_event.0002 + } + if = { + limit = { + character:belisarius_001 = { + is_alive = yes + #is_ai = no + highest_held_title_tier <= tier_duchy + any_held_title = { + tier = tier_county + kingdom = title:k_italia_annonariae + } + top_liege = title:e_byzantium.holder + } + NOT = { exists = global_var:belisarius_betrayal } + } + title:k_italia_annonariae = { + save_scope_as = title + } + scope:title = { + create_title_and_vassal_change = { + type = granted + save_scope_as = change + add_claim_on_loss = no + } + change_title_holder_include_vassals = { + holder = character:belisarius_001 + change = scope:change + } + resolve_title_and_vassal_change = scope:change + } + } + else = { + title:k_italia_annonariae = { + save_scope_as = title + } + trigger_event = tfe_title_event.0002 + } + ai_chance = { + base = 1000 + } + } +} + } + + { +western_roman.0064 = { + type = character_event + title = western_roman.0064.t + desc = western_roman.0064.desc + override_icon = { reference = "gfx/interface/icons/event_types/special_rhomaion.dds" } + theme = realm + left_portrait = { + character = scope:truce_breaker + animation = personality_greedy + } + right_portrait = { + character = scope:truce_breakee + animation = rage + } + + immediate = { + title:e_byzantium.holder = { + save_scope_as = truce_breakee + } + title:e_persia.holder = { + save_scope_as = truce_breaker + } + } + + option = { + name = western_roman.0064.a + trigger = { + AND = { + scope:truce_breaker = { + character_is_land_realm_neighbor = scope:truce_breakee + } + NOT = { scope:truce_breakee = { is_at_war_with = scope:truce_breaker } } + } + } + scope:truce_breakee = { + random_sub_realm_county = { + limit = { + is_neighbor_to_realm = scope:truce_breaker + } + save_scope_as = target_title_eternal_placeholder + } + } + scope:truce_breaker = { + start_war = { + cb = TFE_gothic_outbreak_county_struggle_cb + target = scope:truce_breakee + target_title = scope:target_title_eternal_placeholder + claimant = scope:truce_breaker + } + } + if = { + limit = { + OR = { + scope:truce_breakee = { + any_character_war = { + using_cb = gothic_war_regular_cb + attacker_war_score <= 75 + } + } + AND = { + exists = title:k_ostrogoths.holder + title:k_ostrogoths.holder = { + any_character_war = { + using_cb = cb_gothic_wars_amalasuntha + defender_war_score <= 75 + } + } + } + scope:truce_breakee = { + any_vassal_or_below = { + any_character_war = { + using_cb = gothic_duchy_conquest_cb + attacker_war_score <= 75 + } + } + } + } + } + scope:truce_breakee = { + trigger_event = { + id = western_roman.0065 + days = 1 + } + } + } + ai_chance = { + base = 1 + } + } + option = { + name = western_roman.0064.b + trigger = { + AND = { + exists = title:d_abkhazia.holder + title:d_abkhazia.holder = { + exists = var:my_suzerain + var:my_suzerain = scope:truce_breakee + } + NOT = { title:d_abkhazia.holder = { is_at_war_with = scope:truce_breaker } } + } + } + scope:truce_breaker = { + start_war = { + cb = individual_duchy_de_jure_cb + target = title:d_abkhazia.holder + target_title = title:d_abkhazia + claimant = scope:truce_breaker + } + } + if = { + limit = { + OR = { + scope:truce_breakee = { + any_character_war = { + using_cb = gothic_war_regular_cb + attacker_war_score <= 75 + } + } + AND = { + exists = title:k_ostrogoths.holder + title:k_ostrogoths.holder = { + any_character_war = { + using_cb = cb_gothic_wars_amalasuntha + defender_war_score <= 75 + } + } + } + scope:truce_breakee = { + any_vassal_or_below = { + any_character_war = { + using_cb = gothic_duchy_conquest_cb + attacker_war_score <= 75 + } + } + } + } + } + scope:truce_breakee = { + trigger_event = { + id = western_roman.0065 + days = 1 + } + } + } + ai_chance = { + base = 100 + } + } + option = { + name = western_roman.0064.c + ai_chance = { + base = 1 + } + } +} + +western_roman.0065 = { + type = character_event + title = western_roman.0065.t + desc = western_roman.0065.desc + override_icon = { reference = "gfx/interface/icons/event_types/special_rhomaion.dds" } + theme = realm + left_portrait = { + character = scope:truce_breaker + animation = personality_greedy + } + right_portrait = { + character = scope:truce_breakee + animation = rage + } + + option = { + name = western_roman.0065.a + trigger = { + OR = { + character:belisarius_001 = { + is_alive = yes + is_landed = yes + any_character_war = { + using_cb = gothic_war_regular_cb + } + } + character:belisarius_001 = { + is_alive = yes + is_landed = yes + any_character_war = { + using_cb = cb_gothic_wars_amalasuntha + } + } + character:belisarius_001 = { + is_alive = yes + is_landed = yes + any_character_war = { + using_cb = gothic_duchy_conquest_cb + } + } + } + } + character:belisarius_001 = { + trigger_event = { + id = western_roman.0066 + days = 1 + } + } + ai_chance = { + base = 100 + } + } + option = { + name = western_roman.0065.b + trigger = { + NOT = { + OR = { + character:belisarius_001 = { + is_alive = yes + is_landed = yes + any_character_war = { + using_cb = gothic_war_regular_cb + } + } + character:belisarius_001 = { + is_alive = yes + is_landed = yes + any_character_war = { + using_cb = cb_gothic_wars_amalasuntha + } + } + character:belisarius_001 = { + is_alive = yes + is_landed = yes + any_character_war = { + using_cb = gothic_duchy_conquest_cb + } + } + } + } + } + save_scope_as = peace_offerer + title:k_ostrogoths.holder = { + trigger_event = western_roman.0071 + } + ai_chance = { + base = 100 + } + } + option = { + name = western_roman.0065.c + ai_chance = { + base = 1 + } + } +} + +western_roman.0066 = { + type = character_event + title = western_roman.0066.t + desc = western_roman.0066.desc + override_icon = { reference = "gfx/interface/icons/event_types/special_rhomaion.dds" } + theme = realm + left_portrait = { + character = scope:truce_breaker + animation = personality_greedy + } + right_portrait = { + character = scope:truce_breakee + animation = rage + } + + option = { + name = western_roman.0066.a + struggle:italian_struggle = { + activate_struggle_catalyst = { + catalyst = catalyst_TFE_major_historical_event_devastation + character = root + } + } + scope:truce_breakee = { + trigger_event = { + id = western_roman.0067 + days = 1 + } + } + if = { + limit = { + exists = title:k_ostrogoths.holder + } + title:k_ostrogoths.holder = { + trigger_event = { + id = western_roman.0068 + days = 1 + } + } + } + scope:truce_breakee = { + add_opinion = { + modifier = anger_opinion + target = character:belisarius_001 + opinion = -50 + } + } + character:belisarius_001 = { + remove_trait = loyal + } + if = { + limit = { + character:belisarius_001 = { + has_trait = calm + NOT = { has_trait = deceitful } + NOT = { has_trait = honest } + } + } + character:belisarius_001 = { + remove_trait = calm + add_trait = deceitful + } + } + ai_chance = { + base = 100 + } + } + option = { + name = western_roman.0066.b + custom_tooltip = western_roman.0066.b.tooltip + save_scope_as = peace_offerer + title:k_ostrogoths.holder = { + trigger_event = western_roman.0071 + } + ai_chance = { + base = 1 + } + } +} + } + + { +western_roman.0068 = { + type = character_event + title = western_roman.0068.t + desc = western_roman.0068.desc + override_icon = { reference = "gfx/interface/icons/event_types/special_rhomaion.dds" } + theme = realm + left_portrait = { + character = root + animation = personality_bold + } + + option = { + name = western_roman.0068.a + character:belisarius_001 = { + trigger_event = { + id = western_roman.0069 + days = 1 + } + } + ai_chance = { + base = 100 + } + } + + option = { + name = western_roman.0068.b + ai_chance = { + base = 1 + } + } +} + +western_roman.0069 = { + type = character_event + title = western_roman.0069.t + desc = western_roman.0069.desc + override_icon = { reference = "gfx/interface/icons/event_types/special_rhomaion.dds" } + theme = realm + left_portrait = { + character = root + animation = personality_bold + } + + option = { + name = western_roman.0069.a + struggle:italian_struggle = { + activate_struggle_catalyst = { + catalyst = catalyst_TFE_major_historical_event_devastation + character = root + } + } + set_global_variable = { + name = belisarius_betrayal + value = yes + } + set_global_variable = { + name = belisarius_betrayal_white_peace + value = yes + } + scope:truce_breakee = { + set_relation_rival = { + target = root + reason = rival_betrayed_friendship + } + } + add_opinion = { + modifier = hate_opinion + target = scope:truce_breakee + opinion = -100 + } + reverse_add_opinion = { + modifier = hate_opinion + target = scope:truce_breakee + opinion = -100 + } + scope:truce_breakee = { + trigger_event = { + id = western_roman.0070 + days = 1 + } + } + character:belisarius_001 = { + if = { + limit = { + has_trait = loyal + } + remove_trait = loyal + } + else = { + add_trait = disloyal + } + every_character_war = { + limit = { + OR = { + using_cb = gothic_duchy_conquest_cb + using_cb = cb_gothic_wars_amalasuntha + using_cb = gothic_war_regular_cb + } + } + end_war = white_peace + } + get_title = title:e_western_roman_empire + if = { + limit = { + exists = title:e_italy.holder + title:e_italy.holder = title:k_ostrogoths.holder + } + destroy_title = title:e_italy + } + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = changev + add_claim_on_loss = no + } + title:k_ostrogoths.holder = { + change_liege = { + liege = character:belisarius_001 + change = scope:changev + } + } + resolve_title_and_vassal_change = scope:changev + title:k_ostrogoths.holder = { + save_scope_as = destroychar + every_held_title = { + limit = { + tier >= tier_kingdom + } + scope:destroychar = { destroy_title = prev } + } + } + scope:truce_breakee = { + start_war = { + cb = gothic_subjugation_cb + target = character:belisarius_001 + claimant = scope:truce_breakee + } + } + } + ai_chance = { + base = 1 + } + } + + option = { + name = western_roman.0069.b + if = { + limit = { + character:belisarius_001 = { + NOT = { has_trait = loyal } + } + } + character:belisarius_001 = { + remove_trait = disloyal + add_trait = loyal + } + } + ai_chance = { + base = 100 + } + } +} + } + + { +western_roman.0071 = { + type = character_event + title = western_roman.0071.t + desc = western_roman.0071.desc + override_icon = { reference = "gfx/interface/icons/event_types/special_rhomaion.dds" } + theme = realm + left_portrait = { + character = root + animation = worry + } + + option = { + name = western_roman.0071.a + struggle:italian_struggle = { + activate_struggle_catalyst = { + catalyst = catalyst_TFE_major_historical_event_rebuilding + character = root + } + } + ai_chance = { + base = 100 + } + scope:peace_offerer = { + send_interface_toast = { + title = WHITE_PEACE_ACCEPTED + left_icon = root + } + } + end_gothic_war_early_effect = yes + if = { + limit = { + character:belisarius_001 = { + is_landed = yes + top_liege = scope:truce_breakee + } + exists = title:k_pontus.holder + title:k_pontus.holder.top_liege = scope:truce_breakee + } + character:belisarius_001 = { + every_held_title = { + add_to_list = title_to_return + } + every_vassal = { + add_to_list = vassal_to_return + } + } + title:c_trebizond = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = character:belisarius_001 + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + title:k_pontus = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder_include_vassals = { + holder = character:belisarius_001 + change = scope:change + take_baronies = no + } + } + resolve_title_and_vassal_change = scope:change + + create_title_and_vassal_change = { + type = usurped + save_scope_as = title_change + add_claim_on_loss = no + } + every_in_list = { + list = title_to_return + change_title_holder = { + holder = character:belisarius_001.top_liege + change = scope:title_change + take_baronies = no + } + } + every_in_list = { + list = vassal_to_return + change_liege = { + liege = character:belisarius_001.top_liege + change = scope:title_change + } + } + resolve_title_and_vassal_change = scope:title_change + } + } + + option = { + name = western_roman.0071.b + scope:peace_offerer = { + send_interface_toast = { + title = WHITE_PEACE_DECLINED + left_icon = root + } + } + ai_chance = { + base = 1 + } + } +} + } + + { +western_roman.0072 = { + scope = none + hidden = yes + immediate = { + title:e_byzantium.holder = { + save_scope_as = emperor + } + if = { + limit = { + character:thracio_03 = { + is_alive = yes + } + OR = { + character:thracio_03 = { + is_landed = no + } + character:thracio_03 = { + is_landed = yes + top_liege = { has_title = title:e_byzantium } + capital_province = { geographical_region = custom_roman_africae } + } + } + } + character:thracio_03 = { + save_scope_as = berber_leader + } + } + else_if = { + limit = { + character:mauro_roman_05 = { + is_alive = yes + is_landed = yes + top_liege = { has_title = title:e_byzantium } + } + } + character:mauro_roman_05 = { + save_scope_as = berber_leader + } + } + else = { + title:e_byzantium.holder = { + random_vassal_or_below = { + limit = { + highest_held_title_tier > tier_barony + OR = { + culture = { has_cultural_pillar = heritage_berber } + culture = culture:mauro_roman + } + } + save_scope_as = berber_leader + } + } + } + if = { + limit = { + character:thracio_03 = { + is_alive = yes + is_landed = no + } + scope:berber_leader = character:thracio_03 + } + title:c_qashtiliya = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:berber_leader + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + } + if = { + limit = { + character:mauro_roman_05 = { + is_alive = yes + is_landed = yes + top_liege = { has_title = title:e_byzantium } + } + character:mauro_roman_06 = { + is_alive = yes + is_married = no + } + character:thracio_03 = { + is_alive = yes + is_married = no + } + scope:berber_leader = character:thracio_03 + } + character:mauro_roman_05 = { + trigger_event = { + id = western_roman.0073 + days = 1 + } + } + } + title:e_byzantium.holder = { + every_vassal_or_below = { + limit = { + highest_held_title_tier > tier_barony + OR = { + culture = { has_cultural_pillar = heritage_berber } + culture = culture:mauro_roman + } + NOT = { this = scope:berber_leader } + } + trigger_event = { + id = western_roman.0075 + days = 2 + } + } + } + title:e_byzantium.holder = { + trigger_event = { + id = western_roman.0077 + days = 2 + } + } + if = { + limit = { + exists = title:k_mauro_roman_kingdom.holder + } + title:k_mauro_roman_kingdom.holder = { + trigger_event = { + id = western_roman.0075 + days = 2 + } + } + } + if = { + limit = { + exists = title:d_avaritana.holder + } + title:d_avaritana.holder = { + trigger_event = { + id = western_roman.0075 + days = 2 + } + } + } + if = { + limit = { + exists = title:d_zaba.holder + } + title:d_zaba.holder = { + trigger_event = { + id = western_roman.0076 + days = 2 + } + } + } + if = { + limit = { + exists = title:d_naffur.holder + } + title:d_naffur.holder = { + trigger_event = { + id = western_roman.0075 + days = 2 + } + } + } + scope:berber_leader = { + trigger_event = { + id = western_roman.0074 + days = 1 + } + } + } +} + +western_roman.0073 = { + type = character_event + title = western_roman.0073.t + desc = western_roman.0073.desc + override_icon = { reference = "gfx/interface/icons/event_types/special_rhomaion.dds" } + theme = realm + left_portrait = { + character = root + animation = personality_bold + } + right_portrait = { + character = character:thracio_03 + animation = personality_bold + } + + option = { + name = western_roman.0073.a + character:thracio_03 = { + marry = character:mauro_roman_06 + } + ai_chance = { + base = 100 + } + } + option = { + name = western_roman.0073.b + ai_chance = { + base = 0 + } + } +} + +western_roman.0074 = { + type = character_event + title = western_roman.0074.t + desc = western_roman.0074.desc + override_icon = { reference = "gfx/interface/icons/event_types/special_rhomaion.dds" } + theme = realm + left_portrait = { + character = root + animation = personality_bold + } + + immediate = { + title:e_byzantium.holder = { + random_vassal_or_below = { + limit = { + highest_held_title_tier > tier_barony + OR = { + culture = { has_cultural_pillar = heritage_berber } + culture = culture:mauro_roman + } + } + weight = { + base = 1 + modifier = { + add = 5 + primary_title.tier >= tier_duchy + } + modifier = { + add = martial + } + modifier = { + add = martial + } + modifier = { + add = martial + } + modifier = { + add = martial + } + modifier = { + add = martial + } + } + save_scope_as = berber_leader_replacement + } + } + } + + option = { + name = western_roman.0074.a + spawn_army = { + name = "Roman Deserters" + levies = 600 + men_at_arms = { + type = clibanarius + stacks = 1 + } + men_at_arms = { + type = cataphract + stacks = 1 + } + men_at_arms = { + type = scorpio + stacks = 2 + } + men_at_arms = { + type = armored_footmen + stacks = 2 + } + men_at_arms = { + type = bowmen + stacks = 1 + } + location = scope:berber_leader.capital_province + inheritable = no + } + scope:berber_leader = { + set_relation_rival = { + target = scope:emperor + reason = rival_age_old_rivalry + } + add_prestige = 500 + start_war = { + cb = independence_war_berber + target = scope:emperor + } + } + ai_chance = { base = 100 } + } + option = { + name = western_roman.0074.b + + scope:berber_leader_replacement = { + save_scope_as = berber_leader + } + + scope:berber_leader = { + spawn_army = { + name = "Roman Deserters" + levies = 600 + men_at_arms = { + type = clibanarius + stacks = 1 + } + men_at_arms = { + type = cataphract + stacks = 1 + } + men_at_arms = { + type = scorpio + stacks = 2 + } + men_at_arms = { + type = armored_footmen + stacks = 2 + } + men_at_arms = { + type = bowmen + stacks = 1 + } + location = scope:berber_leader.capital_province + inheritable = no + } + scope:berber_leader = { + set_relation_rival = { + target = scope:emperor + reason = rival_age_old_rivalry + } + add_prestige = 500 + start_war = { + cb = independence_war_berber + target = scope:emperor + } + } + } + + ai_chance = { base = 0 } + } +} + +western_roman.0075 = { + type = character_event + title = western_roman.0075.t + desc = western_roman.0075.desc + override_icon = { reference = "gfx/interface/icons/event_types/special_rhomaion.dds" } + theme = realm + left_portrait = { + character = root + animation = personality_bold + } + + option = { + name = western_roman.0075.a + if = { + limit = { + root = character:mauro_roman_05 + exists = title:k_mauro_roman_kingdom.holder + NOT = { top_liege = title:k_mauro_roman_kingdom.holder } + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = title_change + add_claim_on_loss = yes + } + character:mauro_roman_05 = { + change_liege = { + liege = title:k_mauro_roman_kingdom.holder + change = scope:title_change + } + } + resolve_title_and_vassal_change = scope:title_change + character:mauro_roman_05 = { + add_unpressed_claim = title:k_mauro_roman_kingdom + create_alliance = { + target = title:k_mauro_roman_kingdom.holder + allied_through_owner = root + allied_through_target = title:k_mauro_roman_kingdom.holder + } + } + } + scope:emperor = { + every_character_war = { + limit = { + using_cb = independence_war_berber + casus_belli = { + primary_defender = scope:emperor + } + } + add_attacker = root + } + } + add_character_flag = should_become_independent + ai_chance = { + base = 100 + } + } + option = { + name = western_roman.0075.b + ai_chance = { + base = 0 + } + } +} + +western_roman.0076 = { + type = character_event + title = western_roman.0076.t + desc = western_roman.0076.desc + override_icon = { reference = "gfx/interface/icons/event_types/special_rhomaion.dds" } + theme = realm + left_portrait = { + character = root + animation = personality_bold + } + + option = { + name = western_roman.0076.a + scope:emperor = { + every_character_war = { + limit = { + using_cb = independence_war_berber + casus_belli = { + primary_defender = scope:emperor + } + } + add_defender = root + } + } + ai_chance = { + base = 100 + } + } + option = { + name = western_roman.0076.b + ai_chance = { + base = 0 + } + } +} + } + + { +western_roman.0077 = { + type = character_event + title = western_roman.0077.t + desc = western_roman.0077.desc + override_icon = { reference = "gfx/interface/icons/event_types/special_rhomaion.dds" } + theme = realm + left_portrait = { + character = root + animation = rage + } + right_portrait = { + character = character:thracio_03 + animation = personality_bold + } + + option = { + name = western_roman.0077.a + ai_chance = { + base = 100 + } + } +} + } +} + +"events/germanic_events.txt" = { + { +germanic_events.0014 = { + title = germanic_events.0014.t + desc = germanic_events.0014.desc + scope = character + theme = realm + + left_portrait = { + character = scope:suitor_1 + animation = personality_greedy + } + right_portrait = { + character = scope:suitor_2 + animation = personality_greedy + } + lower_center_portrait = { + character = scope:suitor_3 + animation = personality_greedy + } + + immediate = { + if = { + limit = { + character:992100 = { + is_alive = yes + is_landed = yes + is_vassal_of = root + is_betrothed = no + is_married = no + } + } + character:992100 = { + save_scope_as = suitor_1 + } + } + else = { + random_vassal = { + limit = { + is_male = yes + is_betrothed = no + is_married = no + exists = dynasty + NOT = { dynasty = root.dynasty } + } + save_scope_as = suitor_1 + } + } + if = { + limit = { + character:992030 = { + is_alive = yes + is_landed = yes + is_betrothed = no + is_married = no + is_vassal_of = root + } + } + character:992030 = { + save_scope_as = suitor_2 + } + } + else = { + random_vassal = { + limit = { + is_male = yes + is_betrothed = no + is_married = no + exists = dynasty + NOT = { dynasty = root.dynasty } + NOT = { scope:suitor_1 = THIS } + } + save_scope_as = suitor_2 + } + } + if = { + limit = { + character:rugian_17 = { + is_alive = yes + is_landed = yes + is_betrothed = no + is_married = no + is_vassal_of = root + } + } + character:rugian_17 = { + save_scope_as = suitor_3 + } + } + else = { + random_vassal = { + limit = { + is_male = yes + is_betrothed = no + is_married = no + exists = dynasty + NOT = { dynasty = root.dynasty } + NOT = { scope:suitor_1 = THIS } + NOT = { scope:suitor_2 = THIS } + } + save_scope_as = suitor_3 + } + } + } + + option = { + name = germanic_events.0014.option.a + trigger = { + exists = scope:suitor_1 + scope:suitor_1 = { + is_alive = yes + is_landed = yes + is_betrothed = no + is_married = no + is_vassal_of = root + } + } + character:992024 = { + create_betrothal = scope:suitor_1 + } + character:992023 = { + create_alliance = { + target = scope:suitor_1 + allied_through_owner = character:992024 + allied_through_target = scope:suitor_1 + } + } + ai_chance = { + base = 10 + modifier = { + scope:suitor_1 = character:992100 + add = 90 + } + } + } + option = { + name = germanic_events.0014.option.b + trigger = { + exists = scope:suitor_2 + scope:suitor_2 = { + is_alive = yes + is_landed = yes + is_betrothed = no + is_married = no + is_vassal_of = root + } + } + character:992024 = { + create_betrothal = scope:suitor_2 + } + character:992023 = { + create_alliance = { + target = scope:suitor_2 + allied_through_owner = character:992024 + allied_through_target = scope:suitor_2 + } + } + ai_chance = { + base = 10 + modifier = { + exists = scope:suitor_1 + scope:suitor_1 = character:992100 + add = -10 + } + } + } + option = { + name = germanic_events.0014.option.c + trigger = { + exists = scope:suitor_3 + scope:suitor_3 = { + is_alive = yes + is_landed = yes + is_betrothed = no + is_married = no + is_vassal_of = root + } + } + character:992024 = { + create_betrothal = scope:suitor_3 + } + character:992023 = { + create_alliance = { + target = scope:suitor_3 + allied_through_owner = character:992024 + allied_through_target = scope:suitor_3 + } + } + ai_chance = { + base = 10 + modifier = { + exists = scope:suitor_1 + scope:suitor_1 = character:992100 + add = -10 + } + } + } + option = { + name = germanic_events.0014.option.d + ai_chance = { + base = 1 + } + } +} + } + + { +germanic_events.0015 = { + scope = none + hidden = yes + + immediate = { + #title:k_ostrogoths.holder = { + # add_gold = 50000 + #} + character:992020 = { + save_scope_as = regent + } + title:k_ostrogoths.holder = { + if = { + limit = { + dynasty = scope:regent.dynasty + } + title:k_ostrogoths.holder = { + add_character_flag = { + flag = deposed + years = 1 + } + } + if = { + limit = { + any_vassal = { + THIS = character:992022 + } + } + character:992022 = { + save_scope_as = ostrogoth_king + } + } + else_if = { + limit = { + any_vassal = { + THIS = character:992100 + } + } + character:992100 = { + save_scope_as = ostrogoth_king + } + } + else_if = { + limit = { + any_vassal = { + is_greek_or_roman = no + } + } + random_vassal = { + limit = { + is_greek_or_roman = no + } + save_scope_as = ostrogoth_king + } + } + } + else = { + title:k_ostrogoths.holder = { + save_scope_as = ostrogoth_king + } + } + } + title:e_byzantium.holder = { + save_scope_as = emperor + } + title:k_ostrogoths.holder = { + every_vassal = { + limit = { + highest_held_title_tier >= tier_county + is_ai = yes + NOT = { is_in_list = roman_vassals } + NOT = { is_in_list = ostrogoth_vassals } + } + save_scope_as = deciding_vassal + random_list = { + 50 = { #Side with Romans + modifier = { + add = -500 + OR = { + #Future Ostrogothic kings + THIS = character:992022 + THIS = character:992100 + THIS = character:992030 + THIS = character:rugian_17 + THIS = character:992029 + THIS = character:992104 + THIS = scope:ostrogoth_king + } + } + modifier = { + add = 20 + scope:deciding_vassal = { + is_greek_or_roman = yes + } + } + modifier = { + add = -20 + scope:deciding_vassal = { + culture = { + has_cultural_pillar = heritage_east_germanic + } + } + } + opinion_modifier = { + who = scope:deciding_vassal + opinion_target = scope:roman_king + multiplier = 0.25 + } + opinion_modifier = { + who = scope:deciding_vassal + opinion_target = scope:emperor + multiplier = 0.25 + } + opinion_modifier = { + who = scope:deciding_vassal + opinion_target = scope:ostrogoth_king + multiplier = -0.5 + } + add_to_list = roman_vassals + } + 50 = { #Side with Ostrogoths + modifier = { + add = 500 + OR = { + #Future Ostrogothic kings + THIS = character:992022 + THIS = character:992100 + THIS = character:992030 + THIS = character:rugian_17 + THIS = character:992029 + THIS = character:992104 + THIS = scope:ostrogoth_king + } + } + modifier = { + add = 20 + scope:deciding_vassal = { + culture = { + has_cultural_pillar = heritage_east_germanic + } + } + } + modifier = { + add = -20 + scope:deciding_vassal = { + is_greek_or_roman = yes + } + } + opinion_modifier = { + who = scope:deciding_vassal + opinion_target = scope:roman_king + multiplier = -0.25 + } + opinion_modifier = { + who = scope:deciding_vassal + opinion_target = scope:emperor + multiplier = -0.25 + } + opinion_modifier = { + who = scope:deciding_vassal + opinion_target = scope:ostrogoth_king + multiplier = 0.5 + } + add_to_list = ostrogoth_vassals + } + } + } + } + + if = { + limit = { + scope:roman_king = { + is_landed = yes + } + } + scope:roman_king = { + every_held_title = { + add_to_list = revert_to_emperor_titles + } + every_vassal = { + add_to_list = revert_to_emperor_vassals + } + } + } + + if = { + limit = { + character:992020 = { + is_landed = yes + } + } + character:992020 = { + every_held_title = { + add_to_list = titles_to_usurp + } + every_vassal = { + add_to_list = roman_vassals + } + } + } + + if = { + limit = { + title:k_ostrogoths.holder = { + has_character_flag = deposed + } + } + + title:k_ostrogoths.holder = { + add_to_list = roman_vassals + every_held_title = { + limit = { + tier = tier_kingdom + } + add_to_list = revert_to_goths_titles + } + every_vassal = { + add_to_list = revert_to_goths_vassals + } + } + + create_title_and_vassal_change = { + type = usurped + save_scope_as = title_change + add_claim_on_loss = yes + } + every_in_list = { + list = revert_to_goths_titles + change_title_holder = { + holder = scope:ostrogoth_king + change = scope:title_change + take_baronies = no + } + } + every_in_list = { + list = revert_to_goths_vassals + change_liege = { + liege = scope:ostrogoth_king + change = scope:title_change + } + } + resolve_title_and_vassal_change = scope:title_change + } + + title:c_roma = { + save_temporary_scope_as = current_county + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = no + } + scope:current_county = { + change_title_holder = { + holder = scope:roman_king + change = scope:change + take_baronies = yes + } + } + resolve_title_and_vassal_change = scope:change + + if = { + limit = { + scope:roman_king = { + any_held_title = { + NOT = { THIS = title:c_roma } + } + } + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = title_change + add_claim_on_loss = yes + } + every_in_list = { + list = revert_to_emperor_titles + change_title_holder = { + holder = scope:emperor + change = scope:title_change + take_baronies = no + } + } + every_in_list = { + list = revert_to_emperor_vassals + change_liege = { + liege = scope:emperor + change = scope:title_change + } + } + resolve_title_and_vassal_change = scope:title_change + } + + + scope:ostrogoth_king = { + every_held_title = { + limit = { + NOT = { this = title:k_ostrogoths } + tier = tier_kingdom + } + add_to_list = titles_to_usurp + clear_title_laws = yes + } + } + + create_title_and_vassal_change = { + type = usurped + save_scope_as = title_change + add_claim_on_loss = yes + } + every_in_list = { + list = titles_to_usurp + change_title_holder = { + holder = scope:roman_king + change = scope:title_change + take_baronies = no + } + } + every_in_list = { + list = roman_vassals + change_liege = { + liege = scope:roman_king + change = scope:title_change + } + } + resolve_title_and_vassal_change = scope:title_change + + scope:ostrogoth_king = { + set_relation_rival = { + target = scope:roman_king + reason = rival_usurper + } + } + + if = { + limit = { + scope:roman_king = { + is_independent_ruler = no + } + } + scope:roman_king = { + create_title_and_vassal_change = { + type = independency + save_scope_as = going_independent + add_claim_on_loss = no + } + becomes_independent = { + change = scope:going_independent + } + resolve_title_and_vassal_change = scope:going_independent + } + } + + scope:ostrogoth_king = { + start_war = { + cb = cb_gothic_wars_amalasuntha + target = scope:roman_king + } + } + + scope:emperor = { + trigger_event = { + id = germanic_events.0016 + days = 1 + } + } + scope:ostrogoth_king = { + trigger_event = { + id = germanic_events.0017 + days = 1 + } + } + every_player = { + limit = { + OR = { + is_vassal_of = scope:ostrogoth_king + is_vassal_of = scope:roman_king + } + } + trigger_event = { + id = germanic_events.0018 + days = 1 + } + } + } +} + } + + { +germanic_events.0019 = { + title = germanic_events.0019.t + desc = germanic_events.0019.desc + scope = character + theme = realm + override_background = { + reference = corridor_night + } + + left_portrait = { + character = root + animation = personality_greedy + } + + right_portrait = { + character = character:992020 + animation = fear + } + + option = { + name = germanic_events.0019.a + root = { + end_diarchy = yes + imprison = { + target = character:992020 + type = house_arrest + } + } + character:992020 = { + add_opinion = { + modifier = hate_opinion + target = root + opinion = -50 + } + } + set_global_variable = { + name = gothic_war_cycle_active + value = yes + } + #if = { + # limit = { + # exists = title:e_byzantium.holder + # } + # title:e_byzantium.holder = { + # trigger_event = { + # id = germanic_events.0022 + # days = 1 + # } + # } + #} + ai_chance = { + base = 1 + modifier = { + is_greek_or_roman = no + add = 100 + } + } + } + option = { + name = germanic_events.0019.b + character:992020 = { + add_opinion = { + modifier = grateful_opinion + target = root + opinion = 20 + } + } + root = { + add_hook = { + target = character:992020 + type = favor_hook + } + } + ai_chance = { + base = 1 + modifier = { + is_greek_or_roman = yes + add = 100 + } + } + } +} + +germanic_events.0020 = { + title = germanic_events.0020.t + desc = germanic_events.0020.desc + scope = character + theme = realm + override_background = { + reference = corridor_night + } + + left_portrait = { + character = root + animation = personality_greedy + } + + right_portrait = { + character = character:992020 + animation = fear + } + + option = { + name = germanic_events.0020.a + root = { + imprison = { + target = character:992020 + type = house_arrest + } + } + character:992020 = { + add_opinion = { + modifier = hate_opinion + target = root + opinion = -50 + } + } + set_global_variable = { + name = gothic_war_cycle_active + value = yes + } + ai_chance = { + base = 1 + modifier = { + is_greek_or_roman = no + add = 100 + } + } + } + option = { + name = germanic_events.0020.b + character:992020 = { + add_opinion = { + modifier = grateful_opinion + target = root + opinion = 20 + } + } + root = { + add_hook = { + target = character:992020 + type = favor_hook + } + } + ai_chance = { + base = 1 + modifier = { + is_greek_or_roman = yes + add = 100 + } + } + } +} + +germanic_events.0021 = { + title = germanic_events.0021.t + desc = germanic_events.0021.desc + scope = character + theme = realm + override_background = { + reference = corridor_night + } + + left_portrait = { + character = root + animation = personality_bold + } + + right_portrait = { + character = character:992020 + animation = personality_greedy + } + + immediate = { + root = { + save_scope_as = actor + } + character:992020 = { + save_scope_as = recipient + } + } + + option = { + name = germanic_events.0021.a + scope:recipient = { + add_opinion = { + modifier = respect_opinion + target = scope:actor + opinion = -20 + } + } + send_child_to_clergy_effect = yes + if = { + limit = { + exists = title:e_byzantium.holder + } + scope:recipient = { + visit_court_of = title:e_byzantium.holder + } + } + else = { + scope:recipient = { + kick_from_court_interaction_effect = yes + } + } + set_global_variable = { + name = gothic_war_cycle_active + value = yes + } + ai_chance = { + base = 1 + modifier = { + is_greek_or_roman = no + add = 100 + } + } + } + option = { + name = germanic_events.0021.b + character:992020 = { + add_opinion = { + modifier = love_opinion + target = root + opinion = 20 + } + } + root = { + add_hook = { + target = character:992020 + type = favor_hook + } + } + ai_chance = { + base = 1 + modifier = { + is_greek_or_roman = yes + add = 100 + } + } + } +} + +germanic_events.0022 = { + title = germanic_events.0022.t + desc = germanic_events.0022.desc + scope = character + theme = realm + override_background = { + reference = corridor_night + } + + left_portrait = { + character = root + animation = anger + } + + right_portrait = { + character = character:992020 + animation = fear + } + + option = { + name = germanic_events.0022.a + set_global_variable = { + name = gothic_war_cycle_active + value = yes + } + trigger_event = { + id = germanic_events.0025 + days = 1 + } + ai_chance = { + base = 0 + modifier = { + AND = { + has_global_variable = vandalic_war_won + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:recall_belisarius + } + } + add = 50 + } + } + } + option = { + name = germanic_events.0022.b + set_global_variable = { + name = gothic_war_cycle_prep + value = yes + } + ai_chance = { + base = 50 + modifier = { + AND = { + has_global_variable = vandalic_war_won + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:recall_belisarius + } + } + add = -50 + } + } + } +} + +germanic_events.0023 = { + title = germanic_events.0023.t + desc = germanic_events.0023.desc + scope = character + theme = realm + override_background = { + reference = corridor_night + } + + left_portrait = { + character = root + animation = anger + } + + right_portrait = { + character = character:992020 + animation = fear + } + + option = { + name = germanic_events.0023.a + set_global_variable = { + name = gothic_war_cycle_active + value = yes + } + trigger_event = { + id = germanic_events.0025 + days = 1 + } + ai_chance = { + base = 0 + modifier = { + AND = { + has_global_variable = vandalic_war_won + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:recall_belisarius + } + } + add = 50 + } + } + } + option = { + name = germanic_events.0023.b + set_global_variable = { + name = gothic_war_cycle_prep + value = yes + } + ai_chance = { + base = 50 + modifier = { + AND = { + has_global_variable = vandalic_war_won + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:recall_belisarius + } + } + add = -50 + } + } + } +} + } + + { +germanic_events.0025 = { + type = character_event + title = germanic_events.0025.t + desc = germanic_events.0025.desc + theme = realm + override_icon = { reference = "gfx/interface/icons/event_types/special_rhomaion.dds" } + + left_portrait = { + character = title:e_byzantium.holder + animation = personality_bold + } + lower_center_portrait = { + character = scope:commander_2 + animation = personality_bold + } + right_portrait = { + character = scope:commander_1 + animation = personality_bold + } + + immediate = { + struggle:italian_struggle = { + activate_struggle_catalyst = { + catalyst = catalyst_TFE_major_historical_event_devastation + character = root + } + } + title:k_ostrogoths.holder = { + set_scope_as = target_ruler + } + if = { + limit = { + global_var:belisarius = { + is_alive = yes + OR = { + is_at_war = no + NOT = { + any_character_war = { + using_cb = vandalic_war_cb + } + } + } + OR = { + NOT = { exists = title:k_africae.holder } + NOT = { title:k_africae.holder = global_var:belisarius } + } + } + NOT = { exists = global_var:belisarius_betrayal } + } + global_var:belisarius = { + save_scope_as = commander_1 + } + } + else_if = { + limit = { + character:armenian_01 = { + is_alive = yes + } + character:armenian_01 = { + is_courtier_of = root + } + } + character:armenian_01 = { + save_scope_as = commander_1 + } + } + else_if = { + limit = { + character:armenian_02 = { + is_alive = yes + } + character:armenian_02 = { + is_courtier_of = root + } + } + character:armenian_02 = { + save_scope_as = commander_1 + } + } + else = { + random_courtier = { + limit = { + is_adult = yes + is_male = yes + } + save_scope_as = commander_1 + } + } + random_courtier = { + limit = { + NOT = { THIS = scope:commander_1 } + is_adult = yes + is_male = yes + } + save_scope_as = commander_2 + } + } + + option = { + name = germanic_events.0025.a + hidden_effect = { + set_global_variable = { + name = justinian_gothic_commander + value = scope:commander_1 + } + start_gothic_war_effect = yes + } + ai_chance = { + base = 100 + } + } + + option = { + name = germanic_events.0025.b + hidden_effect = { + set_global_variable = { + name = justinian_gothic_commander + value = scope:commander_2 + } + start_gothic_war_effect = yes + } + ai_chance = { + base = 0 + } + } +} + } + + { +germanic_events.0028 = { + scope = none + hidden = yes + + immediate = { + title:e_byzantium.holder = { + save_scope_as = ostrogoth_king + } + if = { + limit = { + character:992029 = { + is_alive = yes + is_landed = no + age > 15 + } + title:e_byzantium.holder = { + any_vassal_or_below = { + exists = primary_heir + primary_heir = character:992029 + any_held_title = { + OR = { + tier = tier_county + tier = tier_duchy + } + OR = { + kingdom = title:k_italy + kingdom = title:k_italia_annonariae + kingdom = title:k_italia_suburbicariae + } + } + } + } + } + title:e_byzantium.holder = { + random_vassal_or_below = { + limit = { + exists = primary_heir + primary_heir = character:992029 + } + depose = yes + } + } + } + if = { + limit = { + character:992029 = { + is_alive = yes + is_landed = yes + top_liege = title:e_byzantium.holder + } + } + character:992029 = { save_scope_as = ostrogoth_king } + if = { + limit = { + character:992029 = { + OR = { + has_trait = education_martial_1 + has_trait = education_martial_2 + has_trait = education_martial_3 + } + } + } + character:992029 = { + remove_trait = education_martial_1 + remove_trait = education_martial_2 + remove_trait = education_martial_3 + add_trait = education_martial_4 + } + } + } + if = { + limit = { + scope:ostrogoth_king = title:e_byzantium.holder + } + title:e_byzantium.holder = { + random_vassal_or_below = { + limit = { + culture = { has_cultural_pillar = heritage_east_germanic } + any_held_title = { + OR = { + tier = tier_county + tier = tier_duchy + } + OR = { + kingdom = title:k_italy + kingdom = title:k_italia_annonariae + kingdom = title:k_italia_suburbicariae + } + } + } + weight = { + base = 1 + modifier = { + add = 5 + primary_title.tier >= tier_duchy + } + modifier = { + add = martial + } + modifier = { + add = martial + } + modifier = { + add = martial + } + modifier = { + add = martial + } + modifier = { + add = martial + } + } + save_scope_as = ostrogoth_king + } + } + } + + create_title_and_vassal_change = { + type = created + save_scope_as = change + add_claim_on_loss = no + } + title:k_ostrogoths = { + change_title_holder = { + holder = scope:ostrogoth_king + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + + title:e_byzantium.holder = { + save_scope_as = emperor + } + + title:e_byzantium.holder = { + every_vassal_or_below = { + limit = { + highest_held_title_tier >= tier_county + is_ai = yes + culture = { has_cultural_pillar = heritage_east_germanic } + NOT = { has_title = title:k_ostrogoths } + any_held_title = { + OR = { + tier = tier_county + tier = tier_duchy + } + OR = { + kingdom = title:k_italy + kingdom = title:k_italia_annonariae + kingdom = title:k_italia_suburbicariae + } + } + } + add_to_list = ostrogoth_vassals_revival + } + } + + every_in_list = { + list = ostrogoth_vassals_revival + save_scope_as = ostrogoth_vassal_king_test + every_held_title = { + limit = { + tier >= tier_kingdom + NOT = { this = title:k_ostrogoths } + } + scope:ostrogoth_vassal_king_test = { destroy_title = prev } + } + } + + every_in_list = { + list = ostrogoth_vassals_revival + if = { + limit = { + NOT = { + liege = { + culture = { + has_cultural_pillar = heritage_east_germanic + } + } + } + } + add_to_list = ostrogoth_vassals_revival_final + } + } + + create_title_and_vassal_change = { + type = usurped + save_scope_as = title_change + add_claim_on_loss = yes + } + every_in_list = { + list = ostrogoth_vassals_revival_final + change_liege = { + liege = scope:ostrogoth_king + change = scope:title_change + } + } + resolve_title_and_vassal_change = scope:title_change + + scope:emperor = { + trigger_event = { + id = germanic_events.0029 + days = 1 + } + } + scope:ostrogoth_king = { + trigger_event = { + id = germanic_events.0030 + days = 1 + } + } + every_player = { + limit = { + OR = { + is_vassal_of = scope:ostrogoth_king + is_vassal_of = scope:emperor + } + culture = { has_cultural_pillar = heritage_east_germanic } + NOT = { THIS = scope:ostrogoth_king } + } + trigger_event = { + id = germanic_events.0031 + days = 1 + } + } + every_player = { + limit = { + OR = { + is_vassal_or_below_of = scope:ostrogoth_king + is_vassal_or_below_of = scope:emperor + } + culture = { has_cultural_pillar = heritage_east_germanic } + } + trigger_event = { + id = germanic_events.0034 + days = 2 + } + } + } +} + } + + { +germanic_events.0032 = { + title = germanic_events.0032.t + desc = germanic_events.0032.desc + scope = character + theme = realm + override_background = { + reference = corridor_night + } + + left_portrait = { + character = title:k_ostrogoths.holder + animation = anger + } + + right_portrait = { + character = character:992020 + animation = personality_bold + } + + option = { + name = germanic_events.0032.a + set_global_variable = { + name = gothic_war_cycle_active + value = yes + } + root = { + save_scope_as = emperor + } + trigger_event = { + id = germanic_events.0033 + days = 1 + } + ai_chance = { + base = 0 + modifier = { + AND = { + has_global_variable = vandalic_war_won + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:recall_belisarius + } + } + add = 50 + } + } + } + option = { + name = germanic_events.0032.b + ai_chance = { + base = 50 + modifier = { + AND = { + has_global_variable = vandalic_war_won + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:recall_belisarius + } + } + add = -50 + } + } + } +} + +germanic_events.0033 = { + type = character_event + title = germanic_events.0033.t + desc = germanic_events.0033.desc + theme = realm + override_icon = { reference = "gfx/interface/icons/event_types/special_rhomaion.dds" } + + left_portrait = { + character = title:e_byzantium.holder + animation = personality_bold + } + lower_center_portrait = { + character = scope:commander_2 + animation = personality_bold + } + right_portrait = { + character = scope:commander_1 + animation = personality_bold + } + + immediate = { + title:k_ostrogoths.holder = { + set_scope_as = target_ruler + } + if = { + limit = { + character:armenian_01 = { + is_alive = yes + } + character:armenian_01 = { + top_liege = scope:emperor + } + } + character:armenian_01 = { + save_scope_as = commander_1 + } + } + else_if = { + limit = { + character:belisarius_001 = { + is_alive = yes + } + character:belisarius_001 = { + top_liege = scope:emperor + OR = { + is_at_war = no + NOT = { + any_character_war = { + using_cb = vandalic_war_cb + } + } + } + } + NOT = { exists = global_var:belisarius_betrayal } + } + character:belisarius_001 = { + save_scope_as = commander_1 + } + } + else_if = { + limit = { + character:armenian_02 = { + is_alive = yes + } + character:armenian_02 = { + top_liege = scope:emperor + } + } + character:armenian_02 = { + save_scope_as = commander_1 + } + } + else = { + scope:emperor = { + random_courtier = { + limit = { + is_adult = yes + is_male = yes + is_landed = no + } + save_scope_as = commander_1 + } + } + } + if = { + limit = { + NOT = { scope:commander_1 = character:belisarius_001 } + } + character:belisarius_001 = { + save_scope_as = commander_2 + } + } + else = { + random_courtier = { + limit = { + NOT = { THIS = scope:commander_1 } + is_adult = yes + is_male = yes + } + save_scope_as = commander_2 + } + } + } + + option = { + name = germanic_events.0033.a + hidden_effect = { + scope:commander_1 = { + save_scope_as = roman_king + } + trigger_event = { + id = germanic_events.0015 + days = 1 + } + } + ai_chance = { + base = 1 + modifier = { + add = 100 + scope:commander_1 = { + is_ai = no + } + } + } + } + + option = { + name = germanic_events.0033.b + hidden_effect = { + scope:commander_2 = { + save_scope_as = roman_king + } + trigger_event = { + id = germanic_events.0015 + days = 1 + } + } + ai_chance = { + base = 1 + modifier = { + add = 100 + scope:commander_2 = { + is_ai = no + } + } + } + } +} + } +} + +"common/script_values/TFE_values.txt" = { + { + every_county_in_region = { + region = world_europe_west_britannia + limit = { + holder.top_liege = { britannia_character_involved_in_struggle_trigger = no } + } + add = 1 + } + } + + { + if = { + limit = { + AND = { + exists = struggle:eastern_iranian_struggle + struggle:eastern_iranian_struggle = { + is_struggle_phase = struggle_TFE_eastern_iranian_phase_development + } + } + } + multiply = 0.7 + } + } +} + +"events/TFE_flavour_events.txt" = { + # from ck3-tiger: + # council position councillor_martial not defined in common/council_positions/ + { + right_portrait = { + character = cp:councillor_martial + animation = worry + } + } + + { +TFE_flavour_events.0007 = { + title = TFE_flavour_events.0007.t + desc = TFE_flavour_events.0007.desc + scope = character + theme = martial + trigger = { + character:cenmar_01 = { + is_alive = yes + } + } + override_background = { + reference = throne_room + } + left_portrait = { + character = root + animation = rage + } + right_portrait = { + character = character:cenmar_01 + animation = worry + } + option = { + name = TFE_flavour_events.0007.a + character:cenmar_01 = { + death = { + death_reason = death_defenestration + killer = root + } + } + add_dread = 10 + add_prestige = -100 + stress_impact = { + vengeful = minor_stress_impact_loss + sadistic = minor_stress_impact_loss + compassionate = minor_stress_impact_gain + } + } + option = { + name = TFE_flavour_events.0007.b + add_prestige = 100 + stress_impact = { + vengeful = minor_stress_impact_gain + sadistic = minor_stress_impact_gain + compassionate = minor_stress_impact_loss + } + remove_courtier_or_guest = character:cenmar_01 + } +} + } + + { +TFE_flavour_events.0051 = { + hidden = yes + scope = none + + immediate = { + if = { + limit = { + character:vandals_013 = { + is_alive = yes + is_landed = yes + is_vassal_or_below_of = scope:defender + } + } + scope:war = { + add_defender = character:vandals_013 + } + } + if = { + limit = { + character:vandals_146 = { + is_alive = yes + is_landed = yes + is_vassal_or_below_of = scope:defender + } + } + scope:war = { + add_attacker = character:vandals_146 + } + } + + } +} + } +} + +"common/buildings/TFE_special_buildings.txt" = { + { +palace_khawarnaq = { + construction_time = slow_construction_time + + type_icon = "aljaferia.dds" + + can_construct_potential = { + always = yes + } + + can_construct = { + always = yes + } + + character_modifier = { + vassal_opinion = 5 + monthly_prestige_gain_per_happy_powerful_vassal_add = 0.05 + monthly_dynasty_prestige_mult = 0.05 + } + county_modifier = { + tax_mult = 0.1 + development_growth_factor = 0.05 + } + ai_value = { + base = 100 + ai_tier_1_building_modifier = yes + } + on_complete = { + county_controller = { + trigger_event = TFE_flavour_events.0007 + } + } + cost_gold = expensive_building_tier_3_cost + type = special + flag = travel_point_of_interest_wonder +} + } +} + +"events/tfe_title_events.txt" = { + # The event about the division of the Roman Empire should not mention Diocletian. + { + immediate = { + character:145241 = { + save_scope_as = diocletian + } + } + } + + # from error.log: [event.cpp:201]: character is not a valid entry at file: events/tfe_title_events.txt line: 1525 (tfe_title_event.0009) (valid: character_event, court_event, activity_event, letter_event ) + { +# De jure drift Dniester and Dnieper towards Hunnic Empire +tfe_title_event.0009 = { + type = character + hidden = yes + immediate = { + # 15 years of drift progress for both titles + title:k_ruthenia = { + change_de_jure_drift_progress = { + target = title:e_hunnic_empire + value = 180 + } + } + title:k_galicia-volhynia = { + change_de_jure_drift_progress = { + target = title:e_hunnic_empire + value = 180 + } + } + } +} + } + + { +# Conduct the reformation +tfe_title_event.0010 = { + type = character_event + title = tfe_title_event.0010.t + desc = tfe_title_event.0010.desc + theme = realm + left_portrait = { + character = scope:founder + animation = personality_bold + } + + immediate = { + play_music_cue = "mx_cue_epic_sacral_moment" + restore_holy_roman_empire_decision_scripted_effect = yes + create_artifact_reichskrone_effect = { OWNER = this } + } + + #Renovatio Imperii! + option = { + name = tfe_title_event.0010.a + give_nickname = nick_the_great + add_prestige_experience = monumental_fame_gain + every_vassal = { + add_opinion = { + modifier = reformed_holy_roman_empire_opinion + target = root + } + custom = restore_holy_roman_empire_decision_effects_vassal_opinion.tt + } + ai_chance = { #When taken, the AI should always pick this. + base = 100 + } + } + + ##No Germany please, we're Byzantine. + #option = { + # name = tfe_title_event.0010.b + # ai_chance = { #When taken, the AI should always go for the decision. + # base = 0 + # } + #} +} + } +} + +"events/dharma_dravidian.txt" = { + { +dharma_dravidian.008 = { + type = character_event + theme = war + title = gothic_wars_0012.t + desc = gothic_wars_0013.desc + + left_portrait = { + character = scope:old_acclaimed_knight + animation = rage + } + right_portrait = { + character = ROOT + animation = fear + } +lower_right_portrait = character:900962 + option = { + name = gothic_wars_0013.a + } +} + } +} + +"events/steppe_events.txt" = { + { +steppe.6666 = { + scope = none + hidden = yes + + immediate = { + debug_log = "Attila spawns!" + debug_log_date = yes + spawn_attila_character_effect = yes + set_global_variable = { + name = attila_spawn + value = yes + } + title:e_hunnic_empire.holder = { + save_scope_as = khan + } + scope:attila = { + copy_inheritable_appearance_from = character:990000 + add_trait = the_hun + change_age = -3 + give_nickname = nick_the_hun + set_character_faith = scope:khan.faith + set_culture = scope:khan.culture + if = { + limit = { + scope:khan = { + gender = male + } + } + set_father = scope:khan + set_house = scope:khan.house + } + if = { + limit = { + scope:khan = { + gender = female + } + } + set_mother = scope:khan + set_house = scope:khan.house + } + scope:khan = { + set_designated_heir = scope:attila + add_courtier = scope:attila + } + #Doesn't work + #add_martial_skill = 10 + #add_diplomacy_skill = 5 + #add_intrigue_skill = 5 + #add_stewardship_skill = 5 + #add_prowess_skill = 10 + } + every_player = { + trigger_event = { + id = steppe.0011 + } + } + } + + +} + } +} + +"events/tfe_culture_events.txt" = { + { + modifier = { + add = 2 + OR = { + this = character:996002 # Odoacer + this = character:992016 # Theodoric + } + } + } + + # from error.log: + # Event #tfe_culture.4001 has no options in events/tfe_culture_events.txt + { +## Add flag for djeddars +tfe_culture.4001 = { + #hidden = yes + trigger = { + exists = player_heir + culture = { + has_cultural_pillar = heritage_berber + } + } + + immediate = { + player_heir = { + if = { + limit = { + AND = { + religion = religion:christianity_religion + culture = { + has_cultural_pillar = heritage_berber + } + } + } + set_variable = { + name = berber_ancestor_to_bury + value = root + years = 5 + } + } + } + } +} + } +} + +"common/culture/name_lists/TFE_easter_egg.txt" = { + { + Näcken + } +} + +"common\scripted_modifiers\00_faction_modifiers.txt" = { + { + # Keep it while the Calip is alive + modifier = { + add = -1000 + $FACTION_TARGET$ = { + this = character:73683 + any_held_title = { + this = title:k_andalusia + } + } + has_game_rule = dissolution_after_caliph_death + } + } +} + +"common/on_action/senate_on_actions.txt" = { + { +on_game_start = { + on_actions = { + on_senate_start_italy + } + on_actions = { + on_senate_start_eastern + } + +} + +on_senate_start_italy = { + effect = { + set_global_variable = { + name = italian_senate_dismantle + value = flag:no + } + set_global_variable = { + name = eastern_senate_dismantle + value = flag:no + } + set_global_variable = { + name = office_events_eastern + value = flag:yes + } + set_global_variable = { + name = office_events_italy + value = flag:yes + } + while = { + count = 6 + create_character = { + culture = title:c_roma.culture + gender = male + age = {35 50} + dynasty = generate + trait = low_senator + faith = title:c_roma.holder.top_liege.faith + + employer = title:c_roma.holder.top_liege + save_scope_as = senator + } + scope:senator = { + add_to_global_variable_list = { + name = low_senate_italy + target = THIS + } + add_to_global_variable_list = { + name = all_senate_italy + target = THIS + } + if = { + limit = { + title:c_roma.holder.top_liege.primary_title = { + is_titular = no + } + } + add_pressed_claim = title:c_roma.holder.top_liege.primary_title + } + decide_senate_idea = yes + if = { + limit = { + NOT = { + any_held_title = { is_noble_family_title = yes } + } + liege = { government_allows = administrative } + } + create_noble_family_effect = yes + domicile ?= { set_up_domicile_estate_effect = yes } + if = { + if = { limit = { liege = { has_government = administrative_government } } change_government = administrative_government } + if = { limit = { liege = { has_government = autocratic_government_ep3 } } change_government = autocratic_government_ep3 } + if = { limit = { liege = { has_government = imperial_government } } change_government = imperial_government } + if = { limit = { liege = { has_government = autocratic_government } } change_government = autocratic_government } + if = { limit = { liege = { has_government = imperial_cult_government } } change_government = imperial_cult_government } + } + } + } + } + while = { + count = 10 + create_character = { + culture = title:c_roma.culture + gender = male + age = {35 50} + dynasty = generate + trait = senator + faith = title:c_roma.holder.top_liege.faith + + employer = title:c_roma.holder.top_liege + save_scope_as = senator + } + scope:senator = { + add_to_global_variable_list = { + name = senate_italy + target = THIS + } + add_to_global_variable_list = { + name = all_senate_italy + target = THIS + } + if = { + limit = { + title:c_roma.holder.top_liege.primary_title = { + is_titular = no + } + } + add_pressed_claim = title:c_roma.holder.top_liege.primary_title + } + decide_senate_idea = yes + if = { + limit = { + NOT = { + any_held_title = { is_noble_family_title = yes } + } + liege = { government_allows = administrative } + } + create_noble_family_effect = yes + domicile ?= { set_up_domicile_estate_effect = yes } + if = { + if = { limit = { liege = { has_government = administrative_government } } change_government = administrative_government } + if = { limit = { liege = { has_government = autocratic_government_ep3 } } change_government = autocratic_government_ep3 } + if = { limit = { liege = { has_government = imperial_government } } change_government = imperial_government } + if = { limit = { liege = { has_government = autocratic_government } } change_government = autocratic_government } + if = { limit = { liege = { has_government = imperial_cult_government } } change_government = imperial_cult_government } + } + } + } + + } + while = { + count = 5 + create_character = { + culture = title:c_roma.culture + gender = male + age = {35 50} + dynasty = generate + trait = high_senator + faith = title:c_roma.holder.top_liege.faith + + employer = title:c_roma.holder.top_liege + save_scope_as = senator + } + scope:senator = { + add_to_global_variable_list = { + name = high_senate_italy + target = THIS + } + add_to_global_variable_list = { + name = all_senate_italy + target = THIS + } + if = { + limit = { + title:c_roma.holder.top_liege.primary_title = { + is_titular = no + } + } + add_pressed_claim = title:c_roma.holder.top_liege.primary_title + } + decide_senate_idea = yes + if = { + limit = { + NOT = { + any_held_title = { is_noble_family_title = yes } + } + liege = { government_allows = administrative } + } + create_noble_family_effect = yes + domicile ?= { set_up_domicile_estate_effect = yes } + if = { + if = { limit = { liege = { has_government = administrative_government } } change_government = administrative_government } + if = { limit = { liege = { has_government = autocratic_government_ep3 } } change_government = autocratic_government_ep3 } + if = { limit = { liege = { has_government = imperial_government } } change_government = imperial_government } + if = { limit = { liege = { has_government = autocratic_government } } change_government = autocratic_government } + if = { limit = { liege = { has_government = imperial_cult_government } } change_government = imperial_cult_government } + } + } + } + + } + every_in_global_list = { + variable = low_senate_italy + random_list = { + 33 = { + add_to_global_variable_list = { + name = aristocratic_senate_italy + target = THIS + } + } + 33 = { + add_to_global_variable_list = { + name = populist_senate_italy + target = THIS + } + } + 33 = { + add_to_global_variable_list = { + name = traditionalist_senate_italy + target = THIS + } + } + } + } + every_in_global_list = { + variable = senate_italy + random_list = { + 33 = { + add_to_global_variable_list = { + name = aristocratic_senate_italy + target = THIS + } + } + 33 = { + add_to_global_variable_list = { + name = populist_senate_italy + target = THIS + } + } + 33 = { + add_to_global_variable_list = { + name = traditionalist_senate_italy + target = THIS + } + } + } + } + every_in_global_list = { + variable = high_senate_italy + random_list = { + 33 = { + add_to_global_variable_list = { + name = aristocratic_senate_italy + target = THIS + } + } + 33 = { + add_to_global_variable_list = { + name = populist_senate_italy + target = THIS + } + } + 33 = { + add_to_global_variable_list = { + name = traditionalist_senate_italy + target = THIS + } + } + } + } + set_global_variable = { + name = aristocratic_senate_italy_gold + value = 1000 + } + set_global_variable = { + name = populist_senate_italy_gold + value = 1000 + } + set_global_variable = { + name = traditionalist_senate_italy_gold + value = 1000 + } + set_global_variable = { + name = italy_senate_admin + value = flag:taxing_rights + } + set_global_variable = { + name = italy_senate_military + value = flag:exclusion + } + set_global_variable = { + name = italy_senate_legistlation + value = flag:regular + } + set_global_variable = { + name = italy_senate_tasks + value = flag:none + } + title:c_roma.holder.top_liege = { + add_character_modifier = taxing_rights_senate_admin + add_character_modifier = exclusion_senate_mil + add_character_modifier = regular_senate_legislation + } + } + on_actions = { + delay = { days = { 365 420 } } + on_senate_yearly + } + on_actions = { + delay = { months = { 60 80 } } + on_senate_lol_italy + } + on_actions = { + delay = { years = 20 } + on_senate_20_years + } + on_actions = { + delay = { months = 1 } + on_senate_monthly_income + } +} +on_senate_start_eastern = { + effect = { + while = { + count = 6 + create_character = { + culture = title:c_byzantion.holder.top_liege.culture + gender = male + age = {35 50} + dynasty = generate + trait = low_senator + faith = title:c_byzantion.holder.top_liege.faith + + employer = title:c_byzantion.holder.top_liege + save_scope_as = senator + } + scope:senator = { + add_to_global_variable_list = { + name = low_senate_eastern + target = THIS + } + add_to_global_variable_list = { + name = all_senate_eastern + target = THIS + } + if = { + limit = { + title:c_byzantion.holder.top_liege.primary_title = { + is_titular = no + } + } + add_pressed_claim = title:c_byzantion.holder.top_liege.primary_title + } + decide_senate_idea = yes + if = { + limit = { + NOT = { + any_held_title = { is_noble_family_title = yes } + } + liege = { government_allows = administrative } + } + create_noble_family_effect = yes + domicile ?= { set_up_domicile_estate_effect = yes } + if = { + if = { limit = { liege = { has_government = administrative_government } } change_government = administrative_government } + if = { limit = { liege = { has_government = autocratic_government_ep3 } } change_government = autocratic_government_ep3 } + if = { limit = { liege = { has_government = imperial_government } } change_government = imperial_government } + if = { limit = { liege = { has_government = autocratic_government } } change_government = autocratic_government } + if = { limit = { liege = { has_government = imperial_cult_government } } change_government = imperial_cult_government } + } + } + } + } + while = { + count = 10 + create_character = { + culture = title:c_byzantion.holder.top_liege.culture + gender = male + age = {35 50} + dynasty = generate + trait = senator + faith = title:c_byzantion.holder.top_liege.faith + + employer = title:c_byzantion.holder.top_liege + save_scope_as = senator + } + scope:senator = { + add_to_global_variable_list = { + name = senate_eastern + target = THIS + } + add_to_global_variable_list = { + name = all_senate_eastern + target = THIS + } + if = { + limit = { + title:c_byzantion.holder.top_liege.primary_title = { + is_titular = no + } + } + add_pressed_claim = title:c_byzantion.holder.top_liege.primary_title + } + decide_senate_idea = yes + if = { + limit = { + NOT = { + any_held_title = { is_noble_family_title = yes } + } + liege = { government_allows = administrative } + } + create_noble_family_effect = yes + domicile ?= { set_up_domicile_estate_effect = yes } + if = { + if = { limit = { liege = { has_government = administrative_government } } change_government = administrative_government } + if = { limit = { liege = { has_government = autocratic_government_ep3 } } change_government = autocratic_government_ep3 } + if = { limit = { liege = { has_government = imperial_government } } change_government = imperial_government } + if = { limit = { liege = { has_government = autocratic_government } } change_government = autocratic_government } + if = { limit = { liege = { has_government = imperial_cult_government } } change_government = imperial_cult_government } + } + } + } + + } + while = { + count = 5 + create_character = { + culture = title:c_byzantion.holder.top_liege.culture + gender = male + age = {35 50} + dynasty = generate + trait = high_senator + faith = title:c_byzantion.holder.top_liege.faith + + employer = title:c_byzantion.holder.top_liege + save_scope_as = senator + } + scope:senator = { + add_to_global_variable_list = { + name = high_senate_eastern + target = THIS + } + add_to_global_variable_list = { + name = all_senate_eastern + target = THIS + } + if = { + limit = { + title:c_byzantion.holder.top_liege.primary_title = { + is_titular = no + } + } + add_pressed_claim = title:c_byzantion.holder.top_liege.primary_title + } + decide_senate_idea = yes + if = { + limit = { + NOT = { + any_held_title = { is_noble_family_title = yes } + } + liege = { government_allows = administrative } + } + create_noble_family_effect = yes + domicile ?= { set_up_domicile_estate_effect = yes } + if = { + if = { limit = { liege = { has_government = administrative_government } } change_government = administrative_government } + if = { limit = { liege = { has_government = autocratic_government_ep3 } } change_government = autocratic_government_ep3 } + if = { limit = { liege = { has_government = imperial_government } } change_government = imperial_government } + if = { limit = { liege = { has_government = autocratic_government } } change_government = autocratic_government } + if = { limit = { liege = { has_government = imperial_cult_government } } change_government = imperial_cult_government } + } + } + } + + } + every_in_global_list = { + variable = low_senate_eastern + random_list = { + 33 = { + add_to_global_variable_list = { + name = aristocratic_senate_eastern + target = THIS + } + } + 33 = { + add_to_global_variable_list = { + name = populist_senate_eastern + target = THIS + } + } + 33 = { + add_to_global_variable_list = { + name = traditionalist_senate_eastern + target = THIS + } + } + } + } + every_in_global_list = { + variable = senate_eastern + random_list = { + 33 = { + add_to_global_variable_list = { + name = aristocratic_senate_eastern + target = THIS + } + } + 33 = { + add_to_global_variable_list = { + name = populist_senate_eastern + target = THIS + } + } + 33 = { + add_to_global_variable_list = { + name = traditionalist_senate_eastern + target = THIS + } + } + } + } + every_in_global_list = { + variable = high_senate_eastern + random_list = { + 33 = { + add_to_global_variable_list = { + name = aristocratic_senate_eastern + target = THIS + } + } + 33 = { + add_to_global_variable_list = { + name = populist_senate_eastern + target = THIS + } + } + 33 = { + add_to_global_variable_list = { + name = traditionalist_senate_eastern + target = THIS + } + } + } + } + set_global_variable = { + name = aristocratic_senate_eastern_gold + value = 1000 + } + set_global_variable = { + name = populist_senate_eastern_gold + value = 1000 + } + set_global_variable = { + name = traditionalist_senate_eastern_gold + value = 1000 + } + set_global_variable = { + name = eastern_senate_admin + value = flag:taxing_rights + } + set_global_variable = { + name = eastern_senate_military + value = flag:exclusion + } + set_global_variable = { + name = eastern_senate_legistlation + value = flag:regular + } + set_global_variable = { + name = eastern_senate_tasks + value = flag:none + } + title:c_byzantion.holder.top_liege = { + add_character_modifier = taxing_rights_senate_admin + add_character_modifier = exclusion_senate_mil + add_character_modifier = regular_senate_legislation + } + } + on_actions = { + delay = { days = { 365 420 } } + on_senate_yearly_eastern + } + on_actions = { + delay = { years = 20 } + on_senate_20_years_eastern + } + on_actions = { + delay = { months = { 70 90 } } + on_senate_lol_eastern + } +} + +on_senate_yearly = { + effect = { + every_in_global_list = { + variable = all_senate_italy + remove_variable = loyalist_senate + remove_variable = disloyal_senate + remove_variable = pragmatic_senate + remove_variable = gloryhound_senate + decide_senate_idea = yes + } + title:c_roma.holder.top_liege = { + if = { + limit = { + access_to_italian_senate = yes + } + if = { + limit = { + global_var:italy_senate_admin = flag:minimum + NOT = { + has_character_modifier = minumum_senate_admin + } + } + add_character_modifier = minumum_senate_admin + } + else_if = { + limit = { + global_var:italy_senate_admin = flag:taxing_rights + NOT = { + has_character_modifier = taxing_rights_senate_admin + } + } + add_character_modifier = taxing_rights_senate_admin + } + else_if = { + limit = { + global_var:italy_senate_admin = flag:absolute + NOT = { + has_character_modifier = absolute_senate_admin + } + } + add_character_modifier = absolute_senate_admin + } + + if = { + limit = { + global_var:italy_senate_military = flag:exclusion + NOT = { + has_character_modifier = exclusion_senate_mil + } + } + add_character_modifier = exclusion_senate_mil + } + else_if = { + limit = { + global_var:italy_senate_military = flag:regular + NOT = { + has_character_modifier = regular_senate_mil + } + } + add_character_modifier = regular_senate_mil + } + else_if = { + limit = { + global_var:italy_senate_military = flag:retinue + NOT = { + has_character_modifier = retinue_senate_mil + } + } + add_character_modifier = retinue_senate_mil + } + + if = { + limit = { + global_var:italy_senate_legistlation = flag:no_legislation + NOT = { + has_character_modifier = no_senate_legislation + } + } + add_character_modifier = no_senate_legislation + } + else_if = { + limit = { + global_var:italy_senate_legistlation = flag:regular + NOT = { + has_character_modifier = regular_senate_legislation + } + } + add_character_modifier = regular_senate_legislation + } + else_if = { + limit = { + global_var:italy_senate_legistlation = flag:absolute + NOT = { + has_character_modifier = absolute_senate_legislation + } + } + add_character_modifier = absolute_senate_legislation + } + } + } + } + on_actions = { + delay = { days = { 365 420 } } + on_senate_yearly + } +} +on_senate_yearly_eastern = { + effect = { + every_in_global_list = { + variable = all_senate_eastern + remove_variable = loyalist_senate + remove_variable = disloyal_senate + remove_variable = pragmatic_senate + remove_variable = gloryhound_senate + decide_senate_idea = yes + } + title:c_byzantion.holder.top_liege = { + if = { + limit = { + access_to_eastern_senate = yes + } + if = { + limit = { + global_var:eastern_senate_admin = flag:minimum + NOT = { + has_character_modifier = minumum_senate_admin + } + } + add_character_modifier = minumum_senate_admin + } + else_if = { + limit = { + global_var:eastern_senate_admin = flag:taxing_rights + NOT = { + has_character_modifier = taxing_rights_senate_admin + } + } + add_character_modifier = taxing_rights_senate_admin + } + else_if = { + limit = { + global_var:eastern_senate_admin = flag:absolute + NOT = { + has_character_modifier = absolute_senate_admin + } + } + add_character_modifier = absolute_senate_admin + } + + if = { + limit = { + global_var:eastern_senate_military = flag:exclusion + NOT = { + has_character_modifier = exclusion_senate_mil + } + } + add_character_modifier = exclusion_senate_mil + } + else_if = { + limit = { + global_var:eastern_senate_military = flag:regular + NOT = { + has_character_modifier = regular_senate_mil + } + } + add_character_modifier = regular_senate_mil + } + else_if = { + limit = { + global_var:eastern_senate_military = flag:retinue + NOT = { + has_character_modifier = retinue_senate_mil + } + } + add_character_modifier = retinue_senate_mil + } + + if = { + limit = { + global_var:eastern_senate_legistlation = flag:no_legislation + NOT = { + has_character_modifier = no_senate_legislation + } + } + add_character_modifier = no_senate_legislation + } + else_if = { + limit = { + global_var:eastern_senate_legistlation = flag:regular + NOT = { + has_character_modifier = regular_senate_legislation + } + } + add_character_modifier = regular_senate_legislation + } + else_if = { + limit = { + global_var:eastern_senate_legistlation = flag:absolute + NOT = { + has_character_modifier = absolute_senate_legislation + } + } + add_character_modifier = absolute_senate_legislation + } + } + } + } + on_actions = { + delay = { days = { 365 420 } } + on_senate_yearly_eastern + } +} + +on_title_gain = { + on_actions = { senate_on_title_gain } + on_actions = { senate_on_title_gain_eastern } +} + +senate_on_title_gain = { + effect = { + if = { + limit = { + is_target_in_global_variable_list = { + name = all_senate_italy + target = THIS + } + scope:title = { is_noble_family_title = no } + } + if = { + limit = { + has_trait = low_senator + } + remove_trait = low_senator + add_trait = former_senator + if = { + limit = { + has_claim_on = title:c_roma.holder.top_liege.primary_title + } + remove_claim = title:c_roma.holder.top_liege.primary_title + } + remove_list_global_variable = { + name = low_senate_italy + target = THIS + } + remove_list_global_variable = { + name = all_senate_italy + target = THIS + } + remove_list_global_variable = { + name = aristocratic_senate_italy + target = THIS + } + remove_list_global_variable = { + name = populist_senate_italy + target = THIS + } + remove_list_global_variable = { + name = traditionalist_senate_italy + target = THIS + } + if = { + limit = { + title:c_roma.holder.top_liege = { + any_courtier = { + has_trait = training_senator + age >= 35 + } + } + } + title:c_roma.holder.top_liege = { + random_courtier = { + limit = { + has_trait = training_senator + age >= 35 + } + remove_trait =training_senator + add_trait = low_senator + add_to_global_variable_list = { + name = low_senate_italy + target = THIS + } + add_to_global_variable_list = { + name = all_senate_italy + target = THIS + } + if = { + limit = { + title:c_roma.holder.top_liege.primary_title = { + is_titular = no + } + } + add_pressed_claim = title:c_roma.holder.top_liege.primary_title + } + decide_senate_party = yes + decide_senate_idea = yes + } + } + } + else = { + create_character = { + culture = title:c_roma.culture + gender = male + age = {35 50} + dynasty = generate + trait = low_senator + faith = title:c_roma.holder.top_liege.faith + + employer = title:c_roma.holder.top_liege + save_scope_as = senator + } + scope:senator = { + add_to_global_variable_list = { + name = low_senate_italy + target = THIS + } + add_to_global_variable_list = { + name = all_senate_italy + target = THIS + } + if = { + limit = { + title:c_roma.holder.top_liege.primary_title = { + is_titular = no + } + } + add_pressed_claim = title:c_roma.holder.top_liege.primary_title + } + decide_senate_party = yes + decide_senate_idea = yes + } + } + } + else_if = { + limit = { + has_trait = senator + } + remove_trait = senator + add_trait = former_senator + if = { + limit = { + has_claim_on = title:c_roma.holder.top_liege.primary_title + } + remove_claim = title:c_roma.holder.top_liege.primary_title + } + remove_list_global_variable = { + name = senate_italy + target = THIS + } + remove_list_global_variable = { + name = all_senate_italy + target = THIS + } + remove_list_global_variable = { + name = aristocratic_senate_italy + target = THIS + } + remove_list_global_variable = { + name = populist_senate_italy + target = THIS + } + remove_list_global_variable = { + name = traditionalist_senate_italy + target = THIS + } + random_in_global_list = { + variable = low_senate_italy + remove_trait = low_senator + add_trait = senator + create_character = { + culture = title:c_roma.culture + gender = male + age = {35 50} + dynasty = generate + trait = low_senator + faith = title:c_roma.holder.top_liege.faith + + employer = title:c_roma.holder.top_liege + save_scope_as = senator + } + scope:senator = { + add_to_global_variable_list = { + name = low_senate_italy + target = THIS + } + add_to_global_variable_list = { + name = all_senate_italy + target = THIS + } + if = { + limit = { + title:c_roma.holder.top_liege.primary_title = { + is_titular = no + } + } + add_pressed_claim = title:c_roma.holder.top_liege.primary_title + } + decide_senate_party = yes + decide_senate_idea = yes + } + remove_list_global_variable = { + name = low_senate_italy + target = THIS + } + add_to_global_variable_list = { + name = senate_italy + target = THIS + } + } + } + else_if = { + limit = { + has_trait = high_senator + } + remove_trait = high_senator + add_trait = former_senator + if = { + limit = { + has_claim_on = title:c_roma.holder.top_liege.primary_title + } + remove_claim = title:c_roma.holder.top_liege.primary_title + } + remove_list_global_variable = { + name = high_senate_italy + target = THIS + } + remove_list_global_variable = { + name = all_senate_italy + target = THIS + } + remove_list_global_variable = { + name = aristocratic_senate_italy + target = THIS + } + remove_list_global_variable = { + name = populist_senate_italy + target = THIS + } + remove_list_global_variable = { + name = traditionalist_senate_italy + target = THIS + } + random_in_global_list = { + variable = senate_italy + remove_trait = senator + add_trait = high_senator + remove_list_global_variable = { + name = senate_italy + target = THIS + } + add_to_global_variable_list = { + name = high_senate_italy + target = THIS + } + random_in_global_list = { + variable = low_senate_italy + remove_trait = low_senator + add_trait = senator + create_character = { + culture = title:c_roma.culture + gender = male + age = {35 50} + dynasty = generate + trait = low_senator + faith = title:c_roma.holder.top_liege.faith + + employer = title:c_roma.holder.top_liege + save_scope_as = senator + } + scope:senator = { + add_to_global_variable_list = { + name = low_senate_italy + target = THIS + } + add_to_global_variable_list = { + name = all_senate_italy + target = THIS + } + if = { + limit = { + title:c_roma.holder.top_liege.primary_title = { + is_titular = no + } + } + add_pressed_claim = title:c_roma.holder.top_liege.primary_title + } + decide_senate_party = yes + decide_senate_idea = yes + } + remove_list_global_variable = { + name = low_senate_italy + target = THIS + } + add_to_global_variable_list = { + name = senate_italy + target = THIS + } + } + } + } + } + } +} +senate_on_title_gain_eastern = { + effect = { + if = { + limit = { + is_target_in_global_variable_list = { + name = all_senate_eastern + target = THIS + } + scope:title = { is_noble_family_title = no } + } + if = { + limit = { + has_trait = low_senator + } + remove_trait = low_senator + add_trait = former_senator + if = { + limit = { + has_claim_on = title:c_byzantion.holder.top_liege.primary_title + } + remove_claim = title:c_byzantion.holder.top_liege.primary_title + } + remove_list_global_variable = { + name = low_senate_eastern + target = THIS + } + remove_list_global_variable = { + name = all_senate_eastern + target = THIS + } + remove_list_global_variable = { + name = aristocratic_senate_eastern + target = THIS + } + remove_list_global_variable = { + name = populist_senate_eastern + target = THIS + } + remove_list_global_variable = { + name = traditionalist_senate_eastern + target = THIS + } + if = { + limit = { + title:c_byzantion.holder.top_liege = { + any_courtier = { + has_trait = training_senator + age >= 35 + } + } + } + title:c_byzantion.holder.top_liege = { + random_courtier = { + limit = { + has_trait = training_senator + age >= 35 + } + remove_trait =training_senator + add_trait = low_senator + add_to_global_variable_list = { + name = low_senate_eastern + target = THIS + } + add_to_global_variable_list = { + name = all_senate_eastern + target = THIS + } + if = { + limit = { + title:c_byzantion.holder.top_liege.primary_title = { + is_titular = no + } + } + add_pressed_claim = title:c_byzantion.holder.top_liege.primary_title + } + decide_senate_party = yes + decide_senate_idea = yes + } + } + } + else = { + create_character = { + culture = title:c_byzantion.culture + gender = male + age = {35 50} + dynasty = generate + trait = low_senator + faith = title:c_byzantion.holder.top_liege.faith + + employer = title:c_byzantion.holder.top_liege + save_scope_as = senator + } + scope:senator = { + add_to_global_variable_list = { + name = low_senate_eastern + target = THIS + } + add_to_global_variable_list = { + name = all_senate_eastern + target = THIS + } + if = { + limit = { + title:c_byzantion.holder.top_liege.primary_title = { + is_titular = no + } + } + add_pressed_claim = title:c_byzantion.holder.top_liege.primary_title + } + decide_senate_party = yes + decide_senate_idea = yes + } + } + } + else_if = { + limit = { + has_trait = senator + } + remove_trait = senator + add_trait = former_senator + if = { + limit = { + has_claim_on = title:c_byzantion.holder.top_liege.primary_title + } + remove_claim = title:c_byzantion.holder.top_liege.primary_title + } + remove_list_global_variable = { + name = senate_eastern + target = THIS + } + remove_list_global_variable = { + name = all_senate_eastern + target = THIS + } + remove_list_global_variable = { + name = aristocratic_senate_eastern + target = THIS + } + remove_list_global_variable = { + name = populist_senate_eastern + target = THIS + } + remove_list_global_variable = { + name = traditionalist_senate_eastern + target = THIS + } + random_in_global_list = { + variable = low_senate_eastern + remove_trait = low_senator + add_trait = senator + create_character = { + culture = title:c_byzantion.culture + gender = male + age = {35 50} + dynasty = generate + trait = low_senator + faith = title:c_byzantion.holder.top_liege.faith + + employer = title:c_byzantion.holder.top_liege + save_scope_as = senator + } + scope:senator = { + add_to_global_variable_list = { + name = low_senate_eastern + target = THIS + } + add_to_global_variable_list = { + name = all_senate_eastern + target = THIS + } + if = { + limit = { + title:c_byzantion.holder.top_liege.primary_title = { + is_titular = no + } + } + add_pressed_claim = title:c_byzantion.holder.top_liege.primary_title + } + decide_senate_party = yes + decide_senate_idea = yes + } + remove_list_global_variable = { + name = low_senate_eastern + target = THIS + } + add_to_global_variable_list = { + name = senate_eastern + target = THIS + } + } + } + else_if = { + limit = { + has_trait = high_senator + } + remove_trait = high_senator + add_trait = former_senator + if = { + limit = { + has_claim_on = title:c_byzantion.holder.top_liege.primary_title + } + remove_claim = title:c_byzantion.holder.top_liege.primary_title + } + remove_list_global_variable = { + name = high_senate_eastern + target = THIS + } + remove_list_global_variable = { + name = all_senate_eastern + target = THIS + } + remove_list_global_variable = { + name = aristocratic_senate_eastern + target = THIS + } + remove_list_global_variable = { + name = populist_senate_eastern + target = THIS + } + remove_list_global_variable = { + name = traditionalist_senate_eastern + target = THIS + } + random_in_global_list = { + variable = senate_eastern + remove_trait = senator + add_trait = high_senator + remove_list_global_variable = { + name = senate_eastern + target = THIS + } + add_to_global_variable_list = { + name = high_senate_eastern + target = THIS + } + random_in_global_list = { + variable = low_senate_eastern + remove_trait = low_senator + add_trait = senator + create_character = { + culture = title:c_byzantion.culture + gender = male + age = {35 50} + dynasty = generate + trait = low_senator + faith = title:c_byzantion.holder.top_liege.faith + + employer = title:c_byzantion.holder.top_liege + save_scope_as = senator + } + scope:senator = { + add_to_global_variable_list = { + name = low_senate_eastern + target = THIS + } + add_to_global_variable_list = { + name = all_senate_eastern + target = THIS + } + if = { + limit = { + title:c_byzantion.holder.top_liege.primary_title = { + is_titular = no + } + } + add_pressed_claim = title:c_byzantion.holder.top_liege.primary_title + } + decide_senate_party = yes + decide_senate_idea = yes + } + remove_list_global_variable = { + name = low_senate_eastern + target = THIS + } + add_to_global_variable_list = { + name = senate_eastern + target = THIS + } + } + } + } + } + } +} + +#senate use money +on_senate_20_years = { + effect = { + if = { + limit = { + global_var:italy_senate_admin = flag:minimum + title:c_roma.holder.top_liege = { + access_to_italian_senate = yes + } + } + title:c_roma.holder.top_liege.primary_title = { + random_in_de_facto_hierarchy = { + limit = { + tier = tier_duchy + global_var:aristocratic_senate_italy_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_aristocrats_italy + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_aristocrats_italy + } + } + } + } + } + } + change_global_variable = { + name = aristocratic_senate_italy_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + random_in_de_facto_hierarchy = { + limit = { + tier = tier_duchy + global_var:populist_senate_italy_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_populists_italy + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_populists_italy + } + } + } + } + } + } + change_global_variable = { + name = populist_senate_italy_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + random_in_de_facto_hierarchy = { + limit = { + tier = tier_duchy + global_var:traditionalist_senate_italy_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_traditionalist_italy + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_traditionalist_italy + } + } + } + } + } + } + change_global_variable = { + name = traditionalist_senate_italy_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + } + } + else_if = { + limit = { + global_var:italy_senate_admin = flag:taxing_rights + title:c_roma.holder.top_liege = { + access_to_italian_senate = yes + } + } + title:c_roma.holder.top_liege.primary_title = { + random_in_de_facto_hierarchy = { + limit = { + tier = tier_kingdom + global_var:aristocratic_senate_italy_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_aristocrats_italy + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_aristocrats_italy + } + } + } + } + } + } + change_global_variable = { + name = aristocratic_senate_italy_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + random_in_de_facto_hierarchy = { + limit = { + tier = tier_kingdom + global_var:populist_senate_italy_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_populists_italy + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_populists_italy + } + } + } + } + } + } + change_global_variable = { + name = populist_senate_italy_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + random_in_de_facto_hierarchy = { + limit = { + tier = tier_kingdom + global_var:traditionalist_senate_italy_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_traditionalist_italy + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_traditionalist_italy + } + } + } + } + } + } + change_global_variable = { + name = traditionalist_senate_italy_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + } + } + else_if = { + limit = { + global_var:italy_senate_admin = flag:absolute + title:c_roma.holder.top_liege = { + access_to_italian_senate = yes + } + } + title:c_roma.holder.top_liege.primary_title = { + if = { + limit = { + global_var:aristocratic_senate_italy_gold > distribute_bread_price + } + change_global_variable = { + name = aristocratic_senate_italy_gold + subtract = distribute_bread_price + } + every_in_de_facto_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + else_if = { + random_in_de_facto_hierarchy = { + limit = { + tier = tier_kingdom + global_var:aristocratic_senate_italy_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_aristocrats_italy + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_aristocrats_italy + } + } + } + } + } + } + change_global_variable = { + name = aristocratic_senate_italy_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + } + if = { + limit = { + global_var:populist_senate_italy_gold > distribute_bread_price + } + change_global_variable = { + name = populist_senate_italy_gold + subtract = distribute_bread_price + } + every_in_de_facto_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + else_if = { + random_in_de_facto_hierarchy = { + limit = { + tier = tier_kingdom + global_var:populist_senate_italy_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_populists_italy + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_populists_italy + } + } + } + } + } + } + change_global_variable = { + name = populist_senate_italy_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + } + if = { + limit = { + global_var:traditionalist_senate_italy_gold > distribute_bread_price + } + change_global_variable = { + name = traditionalist_senate_italy_gold + subtract = distribute_bread_price + } + every_in_de_facto_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + else_if = { + random_in_de_facto_hierarchy = { + limit = { + tier = tier_kingdom + global_var:traditionalist_senate_italy_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_traditionalist_italy + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_traditionalist_italy + } + } + } + } + } + } + change_global_variable = { + name = traditionalist_senate_italy_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + } + } + } + if = { + limit = { + NOT = { + game_start_date = 532.2.1 + } + } + random_list = { + 1 = { + modifier = { + add = { + value = 5 + } + global_var:italy_senate_admin = flag:taxing_rights + title:c_roma.holder.top_liege = { + access_to_italian_senate = yes + } + OR = { + global_var:traditionalist_senate_italy_gold > standard_activity_cost + global_var:aristocratic_senate_italy_gold > standard_activity_cost + global_var:populist_senate_italy_gold > standard_activity_cost + } + } + modifier = { + add = { + value = 20 + } + global_var:italy_senate_admin = flag:absolute + title:c_roma.holder.top_liege = { + access_to_italian_senate = yes + } + OR = { + global_var:traditionalist_senate_italy_gold > standard_activity_cost + global_var:aristocratic_senate_italy_gold > standard_activity_cost + global_var:populist_senate_italy_gold > standard_activity_cost + } + } + title:c_roma.holder.top_liege = { + random_vassal_or_below = { + limit = { + NOT = { + any_owned_story = { + story_type = story_sponsor_gladiator_games_decision + } + } + } + weight = { + base = 10 + modifier = { + add = italy_aristocratic_size + has_character_flag = bribed_aristocrats_italy + } + modifier = { + add = italy_populist_size + has_character_flag = bribed_populists_italy + } + modifier = { + add = italy_traditionalist_size + has_character_flag = bribed_traditionalist_italy + } + } + trigger_event = sponsor_gladiatorial_games.0015 + } + } + if = { + limit = { + global_var:traditionalist_senate_italy_gold > standard_activity_cost + } + change_global_variable = { + name = traditionalist_senate_italy_gold + subtract = standard_activity_cost + } + } + else_if = { + limit = { + global_var:aristocratic_senate_italy_gold > standard_activity_cost + } + change_global_variable = { + name = aristocratic_senate_italy_gold + subtract = standard_activity_cost + } + } + else_if = { + limit = { + global_var:populist_senate_italy_gold > standard_activity_cost + } + change_global_variable = { + name = populist_senate_italy_gold + subtract = standard_activity_cost + } + } + } + + 9 = { + + } + } + } + } + on_actions = { + delay = { years = 20 } + on_senate_20_years + } +} +on_senate_20_years_eastern = { + effect = { + if = { + limit = { + global_var:eastern_senate_admin = flag:minimum + title:c_byzantion.holder.top_liege = { + access_to_eastern_senate = yes + } + } + title:c_byzantion.holder.top_liege.primary_title = { + random_in_de_facto_hierarchy = { + limit = { + tier = tier_duchy + global_var:aristocratic_senate_eastern_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_aristocrats_eastern + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_aristocrats_eastern + } + } + } + } + } + } + change_global_variable = { + name = aristocratic_senate_eastern_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + random_in_de_facto_hierarchy = { + limit = { + tier = tier_duchy + global_var:populist_senate_eastern_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_populists_eastern + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_populists_eastern + } + } + } + } + } + } + change_global_variable = { + name = populist_senate_eastern_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + random_in_de_facto_hierarchy = { + limit = { + tier = tier_duchy + global_var:traditionalist_senate_eastern_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_traditionalist_eastern + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_traditionalist_eastern + } + } + } + } + } + } + change_global_variable = { + name = traditionalist_senate_eastern_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + } + } + else_if = { + limit = { + global_var:eastern_senate_admin = flag:taxing_rights + title:c_byzantion.holder.top_liege = { + access_to_eastern_senate = yes + } + } + title:c_byzantion.holder.top_liege.primary_title = { + random_in_de_facto_hierarchy = { + limit = { + tier = tier_kingdom + global_var:aristocratic_senate_eastern_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_aristocrats_eastern + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_aristocrats_eastern + } + } + } + } + } + } + change_global_variable = { + name = aristocratic_senate_eastern_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + random_in_de_facto_hierarchy = { + limit = { + tier = tier_kingdom + global_var:populist_senate_eastern_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_populists_eastern + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_populists_eastern + } + } + } + } + } + } + change_global_variable = { + name = populist_senate_eastern_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + random_in_de_facto_hierarchy = { + limit = { + tier = tier_kingdom + global_var:traditionalist_senate_eastern_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_traditionalist_eastern + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_traditionalist_eastern + } + } + } + } + } + } + change_global_variable = { + name = traditionalist_senate_eastern_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + } + } + else_if = { + limit = { + global_var:eastern_senate_admin = flag:absolute + title:c_byzantion.holder.top_liege = { + access_to_eastern_senate = yes + } + } + title:c_byzantion.holder.top_liege.primary_title = { + if = { + limit = { + global_var:aristocratic_senate_eastern_gold > distribute_bread_price + } + change_global_variable = { + name = aristocratic_senate_eastern_gold + subtract = distribute_bread_price + } + every_in_de_facto_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + else_if = { + random_in_de_facto_hierarchy = { + limit = { + tier = tier_kingdom + global_var:aristocratic_senate_eastern_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_aristocrats_eastern + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_aristocrats_eastern + } + } + } + } + } + } + change_global_variable = { + name = aristocratic_senate_eastern_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + } + if = { + limit = { + global_var:populist_senate_eastern_gold > distribute_bread_price + } + change_global_variable = { + name = populist_senate_eastern_gold + subtract = distribute_bread_price + } + every_in_de_facto_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + else_if = { + random_in_de_facto_hierarchy = { + limit = { + tier = tier_kingdom + global_var:populist_senate_eastern_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_populists_eastern + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_populists_eastern + } + } + } + } + } + } + change_global_variable = { + name = populist_senate_eastern_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + } + if = { + limit = { + global_var:traditionalist_senate_eastern_gold > distribute_bread_price + } + change_global_variable = { + name = traditionalist_senate_eastern_gold + subtract = distribute_bread_price + } + every_in_de_facto_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + else_if = { + random_in_de_facto_hierarchy = { + limit = { + tier = tier_kingdom + global_var:traditionalist_senate_eastern_gold > distribute_bread_price + } + weight = { + base = 10 + modifier = { + add = 100 + trigger_if = { + limit = { + is_title_created = yes + } + OR = { + holder = { + has_character_flag = bribed_traditionalist_eastern + } + holder = { + any_liege_or_above = { + NOT = { + highest_held_title_tier = tier_empire + } + has_character_flag = bribed_traditionalist_eastern + } + } + } + } + } + } + change_global_variable = { + name = traditionalist_senate_eastern_gold + subtract = distribute_bread_price + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + } + add_county_modifier = { + modifier = distribute_bread_modifier + years = 10 + } + } + } + } + } + } + if = { + limit = { + NOT = { + game_start_date = 532.2.1 + } + } + random_list = { + 1 = { + modifier = { + add = { + value = 5 + } + global_var:eastern_senate_admin = flag:taxing_rights + title:c_byzantion.holder.top_liege = { + access_to_eastern_senate = yes + } + OR = { + global_var:traditionalist_senate_eastern_gold > standard_activity_cost + global_var:aristocratic_senate_eastern_gold > standard_activity_cost + global_var:populist_senate_eastern_gold > standard_activity_cost + } + } + modifier = { + add = { + value = 20 + } + global_var:eastern_senate_admin = flag:absolute + title:c_byzantion.holder.top_liege = { + access_to_eastern_senate = yes + } + OR = { + global_var:traditionalist_senate_eastern_gold > standard_activity_cost + global_var:aristocratic_senate_eastern_gold > standard_activity_cost + global_var:populist_senate_eastern_gold > standard_activity_cost + } + } + title:c_byzantion.holder.top_liege = { + random_vassal_or_below = { + limit = { + NOT = { + any_owned_story = { + story_type = story_sponsor_gladiator_games_decision + } + } + } + weight = { + base = 10 + modifier = { + add = eastern_aristocratic_size + has_character_flag = bribed_aristocrats_eastern + } + modifier = { + add = eastern_populist_size + has_character_flag = bribed_populists_eastern + } + modifier = { + add = eastern_traditionalist_size + has_character_flag = bribed_traditionalist_eastern + } + } + trigger_event = sponsor_gladiatorial_games.0015 + } + } + if = { + limit = { + global_var:traditionalist_senate_eastern_gold > standard_activity_cost + } + change_global_variable = { + name = traditionalist_senate_eastern_gold + subtract = standard_activity_cost + } + } + else_if = { + limit = { + global_var:aristocratic_senate_eastern_gold > standard_activity_cost + } + change_global_variable = { + name = aristocratic_senate_eastern_gold + subtract = standard_activity_cost + } + } + else_if = { + limit = { + global_var:populist_senate_eastern_gold > standard_activity_cost + } + change_global_variable = { + name = populist_senate_eastern_gold + subtract = standard_activity_cost + } + } + } + + 9 = { + + } + } + } + } + on_actions = { + delay = { years = 20 } + on_senate_20_years_eastern + } +} + +on_senate_lol_italy = { + effect = { + if = { + limit = { + title:c_roma.holder.top_liege = { + access_to_italian_senate = yes + } + } + if = { + limit = { + OR = { + senate_italy_one_party_revolting = yes + senate_italy_two_party_revolting = yes + senate_italy_all_party_revolting = yes + } + } + title:c_roma.holder.top_liege = { + trigger_event = { + id = senate.0010 + days = {90 180} + } + } + } + if = { + limit = { + OR = { + senate_italy_aristocratic_disloyal = yes + senate_italy_populist_disloyal = yes + senate_italy_traditionalist_disloyal = yes + } + } + title:c_roma.holder.top_liege = { + random_list = { + 10 = { + trigger_event = { + id = senate.0011 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0012 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0013 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0014 + days = {100 300} + } + } + 5 = { + trigger_event = { + id = senate.0015 + days = {100 300} + } + } + } + } + } + if = { + limit = { + OR = { + senate_italy_aristocratic_indifferent = yes + senate_italy_populist_indifferent = yes + senate_italy_traditionalist_indifferent = yes + } + } + title:c_roma.holder.top_liege = { + random_list = { + 10 = { + trigger_event = { + id = senate.0016 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0017 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0018 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0019 + days = {100 300} + } + } + 5 = { + trigger_event = { + id = senate.0020 + days = {100 300} + } + } + } + } + } + if = { + limit = { + OR = { + senate_italy_aristocratic_loyal = yes + senate_italy_populist_loyal = yes + senate_italy_traditionalist_loyal = yes + } + } + title:c_roma.holder.top_liege = { + random_list = { + 10 = { + trigger = { + trigger_if = { + limit = { + access_to_italian_senate = yes + } + OR = { + AND = { + OR = { + senate_italy_aristocratic_loyal = yes + senate_italy_aristocratic_supportive = yes + } + global_var:aristocratic_senate_italy_gold >= TFE_games_predicted_cost_half + } + AND = { + OR = { + senate_italy_populist_loyal = yes + senate_italy_populist_supportive = yes + } + global_var:populist_senate_italy_gold >= TFE_games_predicted_cost_half + } + AND = { + OR = { + senate_italy_traditionalist_loyal = yes + senate_italy_traditionalist_supportive = yes + } + global_var:traditionalist_senate_italy_gold >= TFE_games_predicted_cost_half + } + } + } + trigger_else_if = { + limit = { + access_to_eastern_senate = yes + } + OR = { + AND = { + OR = { + senate_eastern_aristocratic_loyal = yes + senate_eastern_aristocratic_supportive = yes + } + global_var:aristocratic_senate_eastern_gold >= TFE_games_predicted_cost_half + } + AND = { + OR = { + senate_eastern_populist_loyal = yes + senate_eastern_populist_supportive = yes + } + global_var:populist_senate_eastern_gold >= TFE_games_predicted_cost_half + } + AND = { + OR = { + senate_eastern_traditionalist_loyal = yes + senate_eastern_traditionalist_supportive = yes + } + global_var:traditionalist_senate_eastern_gold >= TFE_games_predicted_cost_half + } + } + } + } + trigger_event = { + id = senate.0021 + days = {100 300} + } + } + 10 = { + trigger = { + trigger_if = { + limit = { + access_to_italian_senate = yes + } + OR = { + AND = { + OR = { + senate_italy_aristocratic_loyal = yes + senate_italy_aristocratic_supportive = yes + } + global_var:aristocratic_senate_italy_gold >= root.capital_county.duchy.distribute_bread_price + } + AND = { + OR = { + senate_italy_populist_loyal = yes + senate_italy_populist_supportive = yes + } + global_var:populist_senate_italy_gold >= root.capital_county.duchy.distribute_bread_price + } + AND = { + OR = { + senate_italy_traditionalist_loyal = yes + senate_italy_traditionalist_supportive = yes + } + global_var:traditionalist_senate_italy_gold >= root.capital_county.duchy.distribute_bread_price + } + } + } + trigger_else_if = { + limit = { + access_to_eastern_senate = yes + } + OR = { + AND = { + OR = { + senate_eastern_aristocratic_loyal = yes + senate_eastern_aristocratic_supportive = yes + } + global_var:aristocratic_senate_eastern_gold >= root.capital_county.duchy.distribute_bread_price + } + AND = { + OR = { + senate_eastern_populist_loyal = yes + senate_eastern_populist_supportive = yes + } + global_var:populist_senate_eastern_gold >= root.capital_county.duchy.distribute_bread_price + } + AND = { + OR = { + senate_eastern_traditionalist_loyal = yes + senate_eastern_traditionalist_supportive = yes + } + global_var:traditionalist_senate_eastern_gold >= root.capital_county.duchy.distribute_bread_price + } + } + } + } + trigger_event = { + id = senate.0022 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0023 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0024 + days = {100 300} + } + } + 5 = { + trigger_event = { + id = senate.0025 + days = {100 300} + } + } + } + } + } + if = { + limit = { + OR = { + senate_italy_aristocratic_supportive = yes + senate_italy_populist_supportive = yes + senate_italy_traditionalist_supportive = yes + } + } + title:c_roma.holder.top_liege = { + random_list = { + 10 = { + trigger = { + trigger_if = { + limit = { + access_to_italian_senate = yes + } + OR = { + AND = { + OR = { + senate_italy_aristocratic_loyal = yes + senate_italy_aristocratic_supportive = yes + } + global_var:aristocratic_senate_italy_gold >= 400 + } + AND = { + OR = { + senate_italy_populist_loyal = yes + senate_italy_populist_supportive = yes + } + global_var:populist_senate_italy_gold >= 400 + } + AND = { + OR = { + senate_italy_traditionalist_loyal = yes + senate_italy_traditionalist_supportive = yes + } + global_var:traditionalist_senate_italy_gold >= 400 + } + } + } + trigger_else_if = { + limit = { + access_to_eastern_senate = yes + } + OR = { + AND = { + OR = { + senate_eastern_aristocratic_loyal = yes + senate_eastern_aristocratic_supportive = yes + } + global_var:aristocratic_senate_eastern_gold >= 400 + } + AND = { + OR = { + senate_eastern_populist_loyal = yes + senate_eastern_populist_supportive = yes + } + global_var:populist_senate_eastern_gold >= 400 + } + AND = { + OR = { + senate_eastern_traditionalist_loyal = yes + senate_eastern_traditionalist_supportive = yes + } + global_var:traditionalist_senate_eastern_gold >= 400 + } + } + } + } + trigger_event = { + id = senate.0026 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0027 + days = {100 300} + } + } + 10 = { + trigger = { + trigger_if = { + limit = { + access_to_italian_senate = yes + } + OR = { + AND = { + OR = { + senate_italy_aristocratic_loyal = yes + senate_italy_aristocratic_supportive = yes + } + global_var:aristocratic_senate_italy_gold >= TFE_games_predicted_cost + } + AND = { + OR = { + senate_italy_populist_loyal = yes + senate_italy_populist_supportive = yes + } + global_var:populist_senate_italy_gold >= TFE_games_predicted_cost + } + AND = { + OR = { + senate_italy_traditionalist_loyal = yes + senate_italy_traditionalist_supportive = yes + } + global_var:traditionalist_senate_italy_gold >= TFE_games_predicted_cost + } + } + } + trigger_else_if = { + limit = { + access_to_eastern_senate = yes + } + OR = { + AND = { + OR = { + senate_eastern_aristocratic_loyal = yes + senate_eastern_aristocratic_supportive = yes + } + global_var:aristocratic_senate_eastern_gold >= TFE_games_predicted_cost + } + AND = { + OR = { + senate_eastern_populist_loyal = yes + senate_eastern_populist_supportive = yes + } + global_var:populist_senate_eastern_gold >= TFE_games_predicted_cost + } + AND = { + OR = { + senate_eastern_traditionalist_loyal = yes + senate_eastern_traditionalist_supportive = yes + } + global_var:traditionalist_senate_eastern_gold >= TFE_games_predicted_cost + } + } + } + } + trigger_event = { + id = senate.0028 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0029 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0030 + days = {100 300} + } + } + } + } + } + } + } + on_actions = { + delay = { months = { 90 120 } } + on_senate_lol_italy + } +} + +on_senate_lol_eastern = { + effect = { + if = { + limit = { + title:c_byzantion.holder.top_liege = { + access_to_eastern_senate = yes + } + } + if = { + limit = { + OR = { + senate_eastern_one_party_revolting = yes + senate_eastern_two_party_revolting = yes + senate_eastern_all_party_revolting = yes + } + } + title:c_byzantion.holder.top_liege = { + trigger_event = { + id = senate.0010 + days = {90 180} + } + } + } + if = { + limit = { + OR = { + senate_eastern_aristocratic_disloyal = yes + senate_eastern_populist_disloyal = yes + senate_eastern_traditionalist_disloyal = yes + } + } + title:c_byzantion.holder.top_liege = { + random_list = { + 10 = { + trigger_event = { + id = senate.0011 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0012 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0013 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0014 + days = {100 300} + } + } + 5 = { + trigger_event = { + id = senate.0015 + days = {100 300} + } + } + } + } + } + if = { + limit = { + OR = { + senate_eastern_aristocratic_indifferent = yes + senate_eastern_populist_indifferent = yes + senate_eastern_traditionalist_indifferent = yes + } + } + title:c_byzantion.holder.top_liege = { + random_list = { + 10 = { + trigger_event = { + id = senate.0016 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0017 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0018 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0019 + days = {100 300} + } + } + 5 = { + trigger_event = { + id = senate.0020 + days = {100 300} + } + } + } + } + } + if = { + limit = { + OR = { + senate_eastern_aristocratic_loyal = yes + senate_eastern_populist_loyal = yes + senate_eastern_traditionalist_loyal = yes + } + } + title:c_byzantion.holder.top_liege = { + random_list = { + 10 = { + trigger = { + trigger_if = { + limit = { + access_to_italian_senate = yes + } + OR = { + AND = { + OR = { + senate_italy_aristocratic_loyal = yes + senate_italy_aristocratic_supportive = yes + } + global_var:aristocratic_senate_italy_gold >= half_activity_mny + } + AND = { + OR = { + senate_italy_populist_loyal = yes + senate_italy_populist_supportive = yes + } + global_var:populist_senate_italy_gold >= half_activity_mny + } + AND = { + OR = { + senate_italy_traditionalist_loyal = yes + senate_italy_traditionalist_supportive = yes + } + global_var:traditionalist_senate_italy_gold >= half_activity_mny + } + } + } + trigger_else_if = { + limit = { + access_to_eastern_senate = yes + } + OR = { + AND = { + OR = { + senate_eastern_aristocratic_loyal = yes + senate_eastern_aristocratic_supportive = yes + } + global_var:aristocratic_senate_eastern_gold >= half_activity_mny + } + AND = { + OR = { + senate_eastern_populist_loyal = yes + senate_eastern_populist_supportive = yes + } + global_var:populist_senate_eastern_gold >= half_activity_mny + } + AND = { + OR = { + senate_eastern_traditionalist_loyal = yes + senate_eastern_traditionalist_supportive = yes + } + global_var:traditionalist_senate_eastern_gold >= half_activity_mny + } + } + } + } + trigger_event = { + id = senate.0021 + days = {100 300} + } + } + 10 = { + trigger = { + trigger_if = { + limit = { + access_to_italian_senate = yes + } + OR = { + AND = { + OR = { + senate_italy_aristocratic_loyal = yes + senate_italy_aristocratic_supportive = yes + } + global_var:aristocratic_senate_italy_gold >= root.capital_county.duchy.distribute_bread_price + } + AND = { + OR = { + senate_italy_populist_loyal = yes + senate_italy_populist_supportive = yes + } + global_var:populist_senate_italy_gold >= root.capital_county.duchy.distribute_bread_price + } + AND = { + OR = { + senate_italy_traditionalist_loyal = yes + senate_italy_traditionalist_supportive = yes + } + global_var:traditionalist_senate_italy_gold >= root.capital_county.duchy.distribute_bread_price + } + } + } + trigger_else_if = { + limit = { + access_to_eastern_senate = yes + } + OR = { + AND = { + OR = { + senate_eastern_aristocratic_loyal = yes + senate_eastern_aristocratic_supportive = yes + } + global_var:aristocratic_senate_eastern_gold >= root.capital_county.duchy.distribute_bread_price + } + AND = { + OR = { + senate_eastern_populist_loyal = yes + senate_eastern_populist_supportive = yes + } + global_var:populist_senate_eastern_gold >= root.capital_county.duchy.distribute_bread_price + } + AND = { + OR = { + senate_eastern_traditionalist_loyal = yes + senate_eastern_traditionalist_supportive = yes + } + global_var:traditionalist_senate_eastern_gold >= root.capital_county.duchy.distribute_bread_price + } + } + } + } + trigger_event = { + id = senate.0022 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0023 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0024 + days = {100 300} + } + } + 5 = { + trigger_event = { + id = senate.0025 + days = {100 300} + } + } + } + } + } + if = { + limit = { + OR = { + senate_eastern_aristocratic_supportive = yes + senate_eastern_populist_supportive = yes + senate_eastern_traditionalist_supportive = yes + } + } + title:c_byzantion.holder.top_liege = { + random_list = { + 10 = { + trigger = { + trigger_if = { + limit = { + access_to_eastern_senate = yes + } + OR = { + AND = { + OR = { + senate_eastern_aristocratic_loyal = yes + senate_eastern_aristocratic_supportive = yes + } + global_var:aristocratic_senate_eastern_gold >= 400 + } + AND = { + OR = { + senate_eastern_populist_loyal = yes + senate_eastern_populist_supportive = yes + } + global_var:populist_senate_eastern_gold >= 400 + } + AND = { + OR = { + senate_eastern_traditionalist_loyal = yes + senate_eastern_traditionalist_supportive = yes + } + global_var:traditionalist_senate_eastern_gold >= 400 + } + } + } + trigger_else_if = { + limit = { + access_to_eastern_senate = yes + } + OR = { + AND = { + OR = { + senate_eastern_aristocratic_loyal = yes + senate_eastern_aristocratic_supportive = yes + } + global_var:aristocratic_senate_eastern_gold >= 400 + } + AND = { + OR = { + senate_eastern_populist_loyal = yes + senate_eastern_populist_supportive = yes + } + global_var:populist_senate_eastern_gold >= 400 + } + AND = { + OR = { + senate_eastern_traditionalist_loyal = yes + senate_eastern_traditionalist_supportive = yes + } + global_var:traditionalist_senate_eastern_gold >= 400 + } + } + } + } + trigger_event = { + id = senate.0026 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0027 + days = {100 300} + } + } + 10 = { + trigger = { + trigger_if = { + limit = { + access_to_italian_senate = yes + } + OR = { + AND = { + OR = { + senate_italy_aristocratic_loyal = yes + senate_italy_aristocratic_supportive = yes + } + global_var:aristocratic_senate_italy_gold >= TFE_games_predicted_cost + } + AND = { + OR = { + senate_italy_populist_loyal = yes + senate_italy_populist_supportive = yes + } + global_var:populist_senate_italy_gold >= TFE_games_predicted_cost + } + AND = { + OR = { + senate_italy_traditionalist_loyal = yes + senate_italy_traditionalist_supportive = yes + } + global_var:traditionalist_senate_italy_gold >= TFE_games_predicted_cost + } + } + } + trigger_else_if = { + limit = { + access_to_eastern_senate = yes + } + OR = { + AND = { + OR = { + senate_eastern_aristocratic_loyal = yes + senate_eastern_aristocratic_supportive = yes + } + global_var:aristocratic_senate_eastern_gold >= TFE_games_predicted_cost + } + AND = { + OR = { + senate_eastern_populist_loyal = yes + senate_eastern_populist_supportive = yes + } + global_var:populist_senate_eastern_gold >= TFE_games_predicted_cost + } + AND = { + OR = { + senate_eastern_traditionalist_loyal = yes + senate_eastern_traditionalist_supportive = yes + } + global_var:traditionalist_senate_eastern_gold >= TFE_games_predicted_cost + } + } + } + } + trigger_event = { + id = senate.0028 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0029 + days = {100 300} + } + } + 10 = { + trigger_event = { + id = senate.0030 + days = {100 300} + } + } + } + } + } + } + } + on_actions = { + delay = { months = { 90 120 } } + on_senate_lol_eastern + } +} + +on_senate_monthly_income = { + effect = { + change_global_variable = { + name = aristocratic_senate_italy_gold + add = 10 + } + change_global_variable = { + name = populist_senate_italy_gold + add = 10 + } + change_global_variable = { + name = traditionalist_senate_italy_gold + add = 10 + } + change_global_variable = { + name = aristocratic_senate_eastern_gold + add = 10 + } + change_global_variable = { + name = populist_senate_eastern_gold + add = 10 + } + change_global_variable = { + name = traditionalist_senate_eastern_gold + add = 10 + } + } + on_actions = { + delay = { months = 1 } + on_senate_monthly_income + } +} + } +} + + +"common/on_action/senate_tasks_on_actions.txt" = { + { +on_game_start = { + on_actions = { + on_senate_tasks + } + on_actions = { + on_senate_tasks_eastern + } + on_actions = { + on_senate_tasks_2_years + } + on_actions = { + on_senate_tasks_2_years_eastern + } +} + +on_senate_tasks = { + effect = { + if = { + limit = { + global_var:italy_senate_tasks = flag:none + } + title:c_roma.holder.top_liege = { + if = { + limit = { + access_to_italian_senate = yes + } + decide_new_task = yes + } + } + title:c_roma.holder.top_liege = { + if = { + limit = { + global_var:italy_senate_tasks = flag:conquer + + } + trigger_event = senate.0005 + } + } + + } + } + on_actions = { + delay = { days = { 3650 3750 } } + on_senate_tasks + } +} +on_senate_tasks_2_years = { + effect = { + if = { + limit = { + AND = { + global_var:italy_senate_tasks = flag:conquer + global_var:italy_senate_conquer = { + is_alive = no + } + title:c_roma.holder.top_liege = { + access_to_italian_senate = yes + } + } + } + title:c_roma.holder.top_liege = { + trigger_event = senate.0005 + } + } + else_if = { + limit = { + AND = { + global_var:italy_senate_tasks = flag:convert_culture + global_var:italy_senate_convert_culture_county = { + culture = holder.top_liege.culture + } + title:c_roma.holder.top_liege = { + access_to_italian_senate = yes + } + } + } + title:c_roma.holder.top_liege = { + trigger_event = senate.0001 + } + set_global_variable = { + name = italy_senate_tasks + value = flag:none + } + } + else_if = { + limit = { + AND = { + global_var:italy_senate_tasks = flag:convert_faith + global_var:italy_senate_convert_faith_county = { + faith = holder.top_liege.faith + } + title:c_roma.holder.top_liege = { + access_to_italian_senate = yes + } + } + } + title:c_roma.holder.top_liege = { + trigger_event = senate.0002 + } + set_global_variable = { + name = italy_senate_tasks + value = flag:none + } + } + } + on_actions = { + delay = { years = 2 } + on_senate_tasks_2_years + } +} + +on_senate_tasks_eastern = { + effect = { + if = { + limit = { + global_var:eastern_senate_tasks = flag:none + } + title:c_byzantion.holder.top_liege = { + if = { + limit = { + access_to_eastern_senate = yes + } + decide_new_task_eastern = yes + } + } + title:c_byzantion.holder.top_liege = { + if = { + limit = { + global_var:eastern_senate_tasks = flag:conquer + + } + trigger_event = { + id = senate.0007 + days = 1 + } + } + } + + } + } + on_actions = { + delay = { days = { 3650 3750 } } + on_senate_tasks_eastern + } +} +on_senate_tasks_2_years_eastern = { + effect = { + if = { + limit = { + AND = { + global_var:eastern_senate_tasks = flag:conquer + global_var:eastern_senate_conquer = { + is_alive = no + } + title:c_byzantion.holder.top_liege = { + access_to_eastern_senate = yes + } + } + } + title:c_byzantion.holder.top_liege = { + trigger_event = senate.0007 + } + } + else_if = { + limit = { + AND = { + global_var:eastern_senate_tasks = flag:convert_culture + global_var:eastern_senate_convert_culture_county = { + culture = holder.top_liege.culture + } + title:c_byzantion.holder.top_liege = { + access_to_eastern_senate = yes + } + } + } + title:c_byzantion.holder.top_liege = { + trigger_event = senate.0001 + } + set_global_variable = { + name = eastern_senate_tasks + value = flag:none + } + } + else_if = { + limit = { + AND = { + global_var:eastern_senate_tasks = flag:convert_faith + global_var:eastern_senate_convert_faith_county = { + faith = holder.top_liege.faith + } + title:c_byzantion.holder.top_liege = { + access_to_eastern_senate = yes + } + } + } + title:c_byzantion.holder.top_liege = { + trigger_event = senate.0002 + } + set_global_variable = { + name = eastern_senate_tasks + value = flag:none + } + } + } + on_actions = { + delay = { years = 2 } + on_senate_tasks_2_years_eastern + } +} + } +} + +"common/scripted_effects/00_ep1_inspiration_effects.txt" = { + { + 10 = { #Recreate if lost + modifier = { + OR = { + scope:adventurer.adventure_inspiration_average_skill_value >= high_inspiration_skill + AND = { + exists = scope:inspiration_owner.var:artifact_quality + scope:inspiration_owner.var:artifact_quality > high_adventurer_epic_quality_level #Cumulative event choices + } + } + add = 5 + } + trigger = { + NOT = { + any_artifact = { + has_variable = charlamagne_throne + } + } + game_start_date >= 700 + scope:location ?= { + OR = { + geographical_region = custom_carolingian_francia + geographical_region = custom_carolingian_germany + geographical_region = custom_lotharingia + geographical_region = custom_northern_italy + } + } + } + create_artifact_throne_charlemagne_effect = { OWNER = root } + } + } + + { + 10 = { #Head of St Edmund + modifier = { + OR = { + scope:adventurer.adventure_inspiration_average_skill_value >= high_inspiration_skill + AND = { + exists = scope:inspiration_owner.var:artifact_quality + scope:inspiration_owner.var:artifact_quality > high_adventurer_epic_quality_level #Cumulative event choices + } + } + add = 5 + } + trigger = { + NOT = { + any_artifact = { + has_variable = edmund_head + } + game_start_date >= 800 + } + scope:location ?= { + OR = { + geographical_region = world_europe_west_britannia + geographical_region = world_europe_north + } + } + } + create_artifact_edmund_head_effect = { OWNER = root } + } + } + + { + 10 = { #Curtana + modifier = { + OR = { + scope:adventurer.adventure_inspiration_average_skill_value >= high_inspiration_skill + AND = { + exists = scope:inspiration_owner.var:artifact_quality + scope:inspiration_owner.var:artifact_quality > high_adventurer_epic_quality_level #Cumulative event choices + } + } + add = 5 + } + trigger = { + any_artifact = { + count < 1 + has_variable = curtana + } + scope:location ?= { + OR = { + geographical_region = world_europe_west + geographical_region = world_europe_south + } + } + } + create_artifact_curtana_effect = { OWNER = ROOT } + } + } + + { + 10 = { + modifier = { + OR = { + scope:adventurer.adventure_inspiration_average_skill_value >= high_inspiration_skill + AND = { + exists = scope:inspiration_owner.var:artifact_quality + scope:inspiration_owner.var:artifact_quality > high_adventurer_epic_quality_level #Cumulative event choices + } + } + add = 5 + } + trigger = { + NOT = { + any_artifact = { + has_variable = crown_of_justinian + } + } + game_start_date >= 500 + scope:location ?= { + OR = { + geographical_region = custom_eastern_roman_empire + culture = { has_cultural_pillar = heritage_byzantine } + } + } + } + create_artifact_pedestal_justinian_effect = { OWNER = root } + } + } + + { + 10 = { #Recreate if lost + modifier = { + OR = { + scope:adventurer.adventure_inspiration_average_skill_value >= high_inspiration_skill + AND = { + exists = scope:inspiration_owner.var:artifact_quality + scope:inspiration_owner.var:artifact_quality > high_adventurer_epic_quality_level #Cumulative event choices + } + } + add = 5 + } + trigger = { + NOT = { + any_artifact = { + has_variable = charlamagne_throne + } + } + game_start_date >= 700 + scope:location ?= { + OR = { + geographical_region = custom_carolingian_francia + geographical_region = custom_carolingian_germany + geographical_region = custom_lotharingia + geographical_region = custom_northern_italy + } + } + } + create_artifact_throne_charlemagne_effect = { OWNER = root } + } + } + + { + 10 = { + modifier = { + OR = { + scope:adventurer.adventure_inspiration_average_skill_value >= high_inspiration_skill + AND = { + exists = scope:inspiration_owner.var:artifact_quality + scope:inspiration_owner.var:artifact_quality > high_adventurer_epic_quality_level #Cumulative event choices + } + } + add = 5 + } + trigger = { + NOT = { + any_artifact = { + has_variable = sword_attila + } + game_start_date <= 400 + } + scope:location ?= { + OR = { + geographical_region = custom_south_slavia + geographical_region = custom_carpathia + geographical_region = ghw_region_crimea + geographical_region = custom_bavaria + } + } + } + create_artifact_wall_sword_attila_effect = { OWNER = root } + } + } + + { + 10 = { + modifier = { + OR = { + scope:adventurer.adventure_inspiration_average_skill_value >= high_inspiration_skill + AND = { + exists = scope:inspiration_owner.var:artifact_quality + scope:inspiration_owner.var:artifact_quality > high_adventurer_epic_quality_level #Cumulative event choices + } + } + add = 5 + } + trigger = { + NOT = { + any_artifact = { + has_variable = throne_scone + } + } + current_year >= 500 + scope:location ?= { + geographical_region = world_europe_west_britannia + } + } + create_artifact_throne_scone_effect = { OWNER = root } + } + } +} + +"common/character_interactions/00_war.txt" = { + { + modifier = { + trigger = { + OR = { + scope:war = { + using_cb = gothic_duchy_conquest_cb + } + scope:war = { + using_cb = gothic_war_regular_cb + } + scope:war = { + using_cb = cb_gothic_wars_amalasuntha + } + } + } + add = -1000 + + desc = "GOTHIC_WAR_NO_PEACE" + } + } +} + +"common/decisions/80_major_decisions_middle_europe.txt" = { + { +############################# +# Refound HRE # +# by Ewan Cowhig Croft # +############################# +restore_holy_roman_empire_decision = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_dynasty_house.dds" + } + decision_group_type = major + + ai_check_interval = 12 + + desc = restore_holy_roman_empire_decision_desc + selection_tooltip = restore_holy_roman_empire_decision_tooltip + + is_shown = { + always = no + } + + is_valid = { + #Standard requirements. + is_independent_ruler = yes + trigger_if = { + limit = { + is_ai = no + } + prestige_level >= high_prestige_level + } + #Title ownership conditions. + OR = { #Gotta be King of a core Carolingian Kingdom. + has_title = title:k_east_francia + has_title = title:k_bavaria + has_title = title:k_france + has_title = title:k_italy + has_title = title:k_lotharingia + any_vassal = { + OR = { + has_title = title:k_east_francia + has_title = title:k_bavaria + has_title = title:k_france + has_title = title:k_italy + has_title = title:k_lotharingia + } + } + } + trigger_if = { + limit = { + is_ai = no + } + custom_description = { #And have some additional royal dignity for good measure. + text = decision_refound_hre_own_three_kingdoms.tt + any_held_title = { + tier = tier_kingdom + count >= 3 + } + } + } + sub_realm_size >= 120 #Plus your various kingdoms should be ruling something. + #HoF preference conditions. + trigger_if = { + limit = { + is_ai = no + } + OR = { + faith.religious_head = { #And they have to actually like you enough to want to invest you. + opinion = { + target = root + value >= high_positive_opinion + } + } + root = { has_strong_usable_hook = faith.religious_head } #Or you have a strong hook on them that you can actually use. + root = { has_weak_hook = faith.religious_head } #Or a regular hook, to be fair, provided you meet the other criteria. + } + } + } + + is_valid_showing_failures_only = { + is_available_adult = yes + faith.religious_head = { is_available_adult = yes } + NOR = { + has_trait = excommunicated + is_at_war_with = faith.religious_head + } + } + + effect = { + show_as_tooltip = { + restore_holy_roman_empire_decision_scripted_effect = yes + } + gain_heroic_legend_seed_tooltip_effect = yes + save_scope_as = founder + faith.religious_head = { save_scope_as = founder_hof } + if = { + limit = { + faith.religious_head = { is_playable_character = yes } + } + faith.religious_head.capital_province = { save_scope_as = ceremony_locale } + } + else = { + capital_province = { save_scope_as = ceremony_locale } + } + trigger_event = { + id = middle_europe_decisions.0015 + } + #Notify other players. + every_player = { + limit = { + NOT = { this = root } + is_within_diplo_range = { CHARACTER = root } + } + trigger_event = middle_europe_decisions.0016 + } + if = { + limit = { + is_ai = no + NOT = { exists = global_var:restore_holy_roman_empire_decision } + } + set_global_variable = { + name = restore_holy_roman_empire_decision + value = root + } + } + # Assign Dynamic Prince-Electors + hidden_effect = { + if = { + limit = { has_global_variable_list = hre_elector_list } + clear_global_variable_list = hre_elector_list + } + while = { + count = 7 + random_vassal = { + limit = { + capital_province.empire = title:e_hre # must be de-jure vassal of empire + OR = { # prince-bishopric or duchy + AND = { + government_has_flag = government_is_theocracy + primary_title.tier >= tier_county + } + primary_title.tier >= tier_duchy + } + NOT = { # not already selected + is_target_in_global_variable_list = { + name = hre_elector_list + target = primary_title + } + } + } + weight = { + modifier = { # major vassals heavily weighted + factor = 10 + is_powerful_vassal = yes + } + modifier = { # same culture as emperor preferred + factor = 4 + culture = root.culture + } + modifier = { # we don't mind going outside Germania, but prefer it + factor = 1.5 + trigger = { exists = primary_title.title_province } + primary_title.title_province.barony = { + OR = { + target_is_de_jure_liege_or_above = title:k_bavaria + target_is_de_jure_liege_or_above = title:k_bohemia + target_is_de_jure_liege_or_above = title:k_east_francia + target_is_de_jure_liege_or_above = title:k_frisia + target_is_de_jure_liege_or_above = title:k_lotharingia + target_is_de_jure_liege_or_above = title:k_pomerania + } + } + } + modifier = { # we want at least 3 theocracies ideally + factor = 10 + any_in_global_list = { + variable = hre_elector_list + count < 3 + holder = { government_has_flag = government_is_theocracy } + } + government_has_flag = government_is_theocracy + } + modifier = { # 3 is enough theocracies unless we can't find feudal + factor = 0.1 + any_in_global_list = { + variable = hre_elector_list + count >= 3 + holder = { government_has_flag = government_is_theocracy } + } + government_has_flag = government_is_theocracy + } + } + add_to_global_variable_list = { + name = hre_elector_list + target = primary_title + } + } + } + hre_elector_list_save_effect = yes # saves list scopes to title as variables for tooltip + } + } + + cost = { + gold = { + if = { + limit = { + is_ai = no + } + add = 500 + } + } + piety = 200 + } + + ai_potential = { + is_independent_ruler = yes + highest_held_title_tier >= tier_kingdom + } + + ai_will_do = { + base = 100 + + modifier = { # We don't want a solo-France to form the HRE + factor = 0 + NOR = { + has_title = title:k_east_francia + has_title = title:k_bavaria + has_title = title:k_italy + has_title = title:k_lotharingia + any_vassal = { + OR = { + has_title = title:k_east_francia + has_title = title:k_bavaria + has_title = title:k_italy + has_title = title:k_lotharingia + } + } + } + } + } +} + } + + # Uses k_sorbia which is not in TFE as of the 'After the Pharaohs' update. + { +###################################### +# Establish the Electorate of Saxony # +# by James Beaumont # +###################################### + +establish_the_electorate_of_saxony_decision = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_found_kingdom.dds" + } + decision_group_type = major + + ai_check_interval = 120 + + desc = establish_the_electorate_of_saxony_decision_desc + selection_tooltip = establish_the_electorate_of_saxony_decision_tooltip + + is_shown = { + # Temporarily disabled due to stability issues in the HRE. + always = no + # Can't form Saxony if Saxony already formed. + NOT = { + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:flag_formed_saxony + } + } + # Is in the HRE or is the Emperor + OR = { + liege = title:e_hre.holder + has_primary_title = title:e_hre + } + } + + is_valid = { + OR = { + has_primary_title = title:e_hre + # Avoid some funky tooltips. + AND = { + highest_held_title_tier <= tier_kingdom + top_liege = { has_title = title:e_hre } + } + } + custom_tooltip = { + text = polabia_held_or_nonexistent.tt + OR = { + has_title = title:k_sorbia + NOT = { exists = title:k_sorbia.holder } + } + } + completely_controls = title:d_meissen + completely_controls = title:d_lausitz + completely_controls = title:d_anhalt + completely_controls = title:d_thuringia + # Most of the Kingdom of Polabia is at least somewhat pro-HRE + custom_tooltip = { + text = polabia_must_be_hre_culture_tt + any_county_in_region = { + region = custom_polabia + # At least half. + count >= 12 + OR = { + culture = root.culture + culture = title:e_hre.holder.culture + } + } + } + } + + effect = { + hidden_effect = { + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:flag_formed_saxony + } + save_scope_as = founder + title:e_hre.holder = { save_scope_as = hre_emperor_scope } + trigger_event = middle_europe_decisions.0017 + } + show_as_tooltip = { + create_kingdom_of_saxony_effect = { CHARACTER = root } + } + if = { + limit = { has_title = title:e_hre } + custom_tooltip = middle_europe_decision.0017.tt + } + } + + cost = { gold = 200 } + + ai_potential = { + always = yes + } + + ai_will_do = { + base = 100 + } +} + } +} + +"common/struggle\struggles/tfe_eastern_iranian_struggle.txt" = { + { +eastern_iranian_struggle = { + # has_fp2_dlc_trigger = yes #TODO_CD_AN Request support for dlc locking on struggles + + ################################################## + # Setup + ################################################## + cultures = { + # Iranian + persian + parthian + khwarezmian + old_ferghanan + ferghanan + + # Serindian + sogdian + bactrian + pactyan + hephthalite + wusun # Add for 476 and after + xionite + yuezhi + saka + + # Indo-Aryan + kashmiri + nuristani + burusho + + # Sarmatian + kangju + + # Turkic + avar + kangar + + # Semitic + assyrian + + } + + faiths = { + + # Zoroastrian + mazdayasna + gayomarthianism + khurmazta + mazdakism + + # Dualism + manichean + #mandeaism + #quqite + + # Christian + nicene # Should be disabled after 476 + marcionite + bardaisanism + # Christian faiths below become involved once they are spawned + nestorian + + # Zun + zun_pagan + + # Dezawist + nuristani_pagan + + # Tengri + tengri_pagan + + # Buddhism + mahayana + pudgalavada + dharmaguptaka + sarvastivada + mahasanghika + vajrayana + + # Hinduism + shaivism + vaishnavism + + # Greco-Roman + #roman_pagan + #hellenic_pagan + + # Judaism + malabarism + + } + regions = { + TFE_eastern_iranian_struggle_region + } + + # A culture or faith becomes involved if 50% of the total number of counties belonging to it are inside the struggle region. + involvement_prerequisite_percentage = 0.5 + + on_start = { + # Starting Events + trigger_event = { on_action = tfe_eastern_iranian_struggle_starting_events } + } + + on_change_phase = { + + # Set up AI Intent + trigger_event = eastern_iranian_struggle.0003 + } + + # Root = the current struggle + # scope:character = the character which has joined the struggle + on_join = { + if = { + limit = { + is_ai = no + } + + trigger_event = eastern_iranian_struggle.0501 + } + else = { + # assign an intent to the freshly joined character + trigger_event = eastern_iranian_struggle.0004 + } + } + + ################################################## + # Phases + ################################################## + start_phase = struggle_TFE_eastern_iranian_phase_expansion + + phase_list = { + + # Opportunity Phase represents complacency after a long period of coexistence during Conciliation; people are comfortable that things are good and so actors with ill-intent can get away with things once again. + struggle_TFE_eastern_iranian_phase_expansion = { + ################################################## + # General Set-Up + + background = "gfx/interface/illustrations/struggle_backgrounds/struggle_opportunity_middle_east.dds" + + future_phases = { + struggle_TFE_eastern_iranian_phase_hostility = { + catalysts = { + catalyst_passing_of_time = minimal_struggle_catalyst_gain + catalyst_gain_claim_on_title = minor_struggle_catalyst_gain + catalyst_win_any_war_within_the_region = minor_struggle_catalyst_gain # Good + catalyst_new_building_in_castle = minor_struggle_catalyst_gain # How to do AI? + catalyst_becomes_rival_with_involved = major_struggle_catalyst_gain # Good + catalyst_using_a_hook_on_very_important_character = medium_struggle_catalyst_gain # good + catalyst_unnatural_death_important_character = medium_struggle_catalyst_gain + catalyst_usurp_title = major_struggle_catalyst_gain # good + catalyst_forced_conversion = medium_struggle_catalyst_gain + catalyst_reveal_secret_important = major_struggle_catalyst_gain + catalyst_broke_truce_against_important_character = massive_struggle_catalyst_gain # Cannot motivate the AI to do that without code support + catalyst_tfe_declared_war = major_struggle_catalyst_gain + } + } + struggle_TFE_eastern_iranian_phase_development = { + catalysts = { + catalyst_improve_development_vassal_diff_faith_culture = minimal_struggle_catalyst_gain # How to do AI? + catalyst_gift_independent_ruler = minor_struggle_catalyst_gain # AI done + catalyst_became_friend_lover_with_character = minor_struggle_catalyst_gain + catalyst_learned_new_language_important = minor_struggle_catalyst_gain # AI done + catalyst_new_building_in_city = minor_struggle_catalyst_gain # How to do AI? + catalyst_sign_truce_outside_war = minor_struggle_catalyst_gain # will need update when addding truce through wards + catalyst_formed_interreligious_alliance_with_important_character = minor_struggle_catalyst_gain + catalyst_ransom_important = medium_struggle_catalyst_gain + catalyst_grant_privilege_to_diff_faith_culture_vassal = medium_struggle_catalyst_gain + catalyst_invite_diff_faith_culture_to_feast = medium_struggle_catalyst_gain + catalyst_independence_from_non_dejure_vassal = major_struggle_catalyst_gain + catalyst_grant_land_local_noble = major_struggle_catalyst_gain + catalyst_became_best_friend_soulmate_with_very_important_character = major_struggle_catalyst_gain # AI done + catalyst_convert_local_culture_faith = major_struggle_catalyst_gain + catalyst_release_important = massive_struggle_catalyst_gain + } + } + } + + war_effects = { + ###### Common + + # Nothing + + ###### Involved + involved_parameters = { + claims_in_region_cost_prestige_not_gold_for_involved_parties = yes + involved_or_interloper_wars_in_struggle_region_cheaper_prestige_costs = yes + unlocks_border_raid_casus_belli = yes + unlocks_contract_assistance_interaction = yes + unlocks_bargain_fealty_interaction = yes + more_nomadic_migration_armies = yes + cheaper_nomadic_migrations_within_struggle_region = yes + } + + involved_character_modifier = { + mercenary_hire_cost_mult = -0.3 + ai_war_chance = 0.25 + ai_war_cooldown = -0.25 + } + + ###### Interlopers + interloper_parameters = { + involved_or_interloper_wars_in_struggle_region_cheaper_prestige_costs = yes + } + + ###### Uninvolved + + # Nothing + } + + faith_effects = { + ###### Common + common_parameters = { + cheaper_to_convert_to_struggle_faith = yes + county_faith_conversion_in_region_proceeds_faster = yes + #holy_wars_in_region_cannot_be_declared = yes + } + + ###### Involved + involved_parameters = { + interfaith_marriages_available_between_involved_characters = yes + } + + ###### Interlopers + + # Nothing + + ###### Uninvolved + + # Nothing + + } + + culture_effects = { + ###### Common + common_parameters = { + cheaper_to_convert_to_struggle_culture = yes + } + + ###### Involved + involved_parameters = { + learning_languages_gives_prestige = yes + granting_title_to_local_noble_gives_prestige = yes + gain_acceptance_when_developing_other_culture_county = yes + } + + ###### Interlopers + + # Nothing + + ###### Uninvolved + + # Nothing + } + + other_effects = { + ###### Common + + # Nothing + + + ###### Involved + involved_parameters = { + unlocks_buy_claim_for_all = yes + unlocks_demand_payments_for_all = yes + unlocks_abduct_for_all = yes + unlocks_fabricate_hooks_for_all = yes + unlocks_claim_throne_for_all = yes + unlocks_incite_revolts_interaction = yes + struggle_unlocks_befriend_schemes_for_everyone = yes + unlocks_epic_commission_for_independent_rulers = yes + unlocks_truce_purchasing_interaction = yes + unlocks_sell_minor_title_for_kings_and_higher = yes + } + + ###### Interlopers + interloper_parameters = { + + } + + interloper_character_modifier = { + county_opinion_add = -5 + #tax_mult = -0.1 + } + + ###### Uninvolved + uninvolved_parameters = { + + } + + uninvolved_county_modifier = { + county_opinion_add = -10 + #tax_mult = -0.15 + } + + } + + #We are listing all available decision to give players insights on how they can end the Struggle + ending_decisions = { + struggle_eastern_iranian_ending_domination_decision + struggle_eastern_iranian_ending_silk_road_decision + struggle_eastern_iranian_ending_compromise_decision + } + } + + # The Hostility phase accounts for the more brutal & fundamentalist side of the struggle; intolerance and violence break out even in stable areas & resentments over slights real or imagined escalate dramatically. + # Should we add a transition to Opportunity? A smaller deescalation than going to compromise + struggle_TFE_eastern_iranian_phase_hostility = { + ################################################## + # General Set-Up + + background = "gfx/interface/illustrations/struggle_backgrounds/struggle_opportunity_middle_east.dds" + + future_phases = { + struggle_TFE_eastern_iranian_phase_compromise = { + catalysts = { + catalyst_passing_of_time = minimal_struggle_catalyst_gain + catalyst_improve_development_vassal_diff_faith_culture = minimal_struggle_catalyst_gain + catalyst_gift_independent_ruler = minor_struggle_catalyst_gain + catalyst_became_friend_lover_with_character = minor_struggle_catalyst_gain + catalyst_learned_new_language_important = minor_struggle_catalyst_gain + catalyst_new_building_in_city = minor_struggle_catalyst_gain + catalyst_sign_truce_outside_war = minor_struggle_catalyst_gain + catalyst_formed_interreligious_alliance_with_important_character = minor_struggle_catalyst_gain + catalyst_ransom_important = medium_struggle_catalyst_gain + catalyst_grant_privilege_to_diff_faith_culture_vassal = medium_struggle_catalyst_gain + catalyst_invite_diff_faith_culture_to_feast = medium_struggle_catalyst_gain + catalyst_independence_from_non_dejure_vassal = major_struggle_catalyst_gain + catalyst_grant_land_local_noble = major_struggle_catalyst_gain + catalyst_became_best_friend_soulmate_with_very_important_character = major_struggle_catalyst_gain + catalyst_convert_local_culture_faith = major_struggle_catalyst_gain + catalyst_release_important = massive_struggle_catalyst_gain + } + } + } + + war_effects = { + ###### Common + + # Nothing + + ##### Involved + involved_parameters = { + struggle_cb_cost_minor = yes + truces_by_involved_or_interlopers_within_region_shorter = yes + involved_or_interloper_wars_in_struggle_region_cheaper_piety_costs = yes + involved_or_interloper_wars_in_struggle_region_cheaper_costs = yes + unlocks_border_raid_casus_belli = yes + unlocks_forced_vassalization_casus_belli = yes + } + + involved_character_modifier = { + same_culture_mercenary_hire_cost_mult = -0.3 + ai_war_chance = 1 + ai_war_cooldown = -0.5 + army_pursuit_mult = 0.2 + army_siege_value_mult = 0.2 + enemy_hard_casualty_modifier = 0.5 + advantage = 5 # gives the upper hand against outsiders + } + + ###### Interlopers + interloper_parameters = { + truces_by_involved_or_interlopers_within_region_shorter = yes + involved_or_interloper_wars_in_struggle_region_cheaper_piety_costs = yes + involved_or_interloper_wars_in_struggle_region_cheaper_costs = yes + } + + interloper_character_modifier = { + enemy_hard_casualty_modifier = 0.5 + } + + ###### Uninvolved + uninvolved_parameters = { + #claims_in_region_more_expensive_to_press_for_uninvolved = yes + } + + } + + faith_effects = { + ###### Common + common_parameters = { + county_faith_conversion_in_region_proceeds_slower = yes + #holy_wars_in_region_cannot_be_declared = yes # not sure if relevant? + } + + ###### Involved + involved_parameters = { + #holy_order_can_be_created_by_dukes = yes + interfaith_marriages_available_between_involved_characters = yes + interfaith_marriages_between_involved_characters_costs_piety = yes + } + + involved_character_modifier = { + levy_reinforcement_rate_same_faith = 0.5 + domain_tax_different_faith_mult = 0.25 + #holy_order_hire_cost_mult = -0.25 + + opinion_of_different_faith = -10 + } + + ###### Interlopers + interloper_character_modifier = { + #holy_order_hire_cost_mult = -0.25 + } + + ###### Uninvolved + + # Nothing + } + + culture_effects = { + + ###### Common + common_parameters = { + county_culture_conversion_in_region_proceeds_slower = yes + } + + ###### Involved + involved_character_modifier = { + opinion_of_different_culture = -10 + + cultural_head_fascination_mult = -0.5 + cultural_head_acceptance_gain_mult = -0.5 + } + ###### Interlopers + interloper_character_modifier = { + cultural_head_fascination_mult = -0.25 + cultural_head_acceptance_gain_mult = -0.25 + } + ###### Uninvolved + + # Nothing + } + + other_effects = { + ###### Common + + # Nothing + + ###### Involved + involved_parameters = { + # struggle_vips_and_culture_faith_heads_may_develop_spontaneous_negative_relations = yes + powerful_vassal_can_claim_liege_titles = yes + unlocks_claim_throne_for_powerful_vassals = yes + unlocks_truce_purchasing_interaction = yes + unlocks_expedite_scheme_decision = yes + } + + involved_character_modifier = { + max_hostile_schemes_add = 1 + } + + involved_county_modifier = { + development_growth_factor = -0.3 + tax_mult = -0.1 + } + + ###### Interlopers + interloper_parameters = { + + } + + interloper_county_modifier = { + county_opinion_add = -5 + tax_mult = -0.30 + development_growth_factor = -0.4 + } + + ###### Uninvolved + uninvolved_parameters = { + + } + + uninvolved_county_modifier = { + county_opinion_add = -10 + tax_mult = -0.75 + + development_growth_factor = -0.5 + } + } + + ################################################## + # Ending + + #We are listing all available decision to give players insights on how they can end the Struggle + ending_decisions = { + struggle_eastern_iranian_ending_domination_decision + struggle_eastern_iranian_ending_silk_road_decision + struggle_eastern_iranian_ending_compromise_decision + } + } + + # Compromise happens either when Hostility has gone on so long that people are sick of it, or else when Hostility has been narrowly avoided after a bout of Tension and folks're relieved; shared trauma and too much violence encourage people to calm down and live and let live. + struggle_TFE_eastern_iranian_phase_compromise = { + ################################################## + # General Set-Up + + background = "gfx/interface/illustrations/struggle_backgrounds/struggle_opportunity_middle_east.dds" + + future_phases = { + struggle_TFE_eastern_iranian_phase_expansion = { + catalysts = { + catalyst_passing_of_time = minimal_struggle_catalyst_gain + catalyst_gain_claim_on_title = minor_struggle_catalyst_gain + catalyst_win_any_war_within_the_region = minor_struggle_catalyst_gain # Good + catalyst_new_building_in_castle = minor_struggle_catalyst_gain # Good + catalyst_becomes_rival_with_involved = major_struggle_catalyst_gain # Good + catalyst_using_a_hook_on_very_important_character = medium_struggle_catalyst_gain # good + catalyst_unnatural_death_important_character = medium_struggle_catalyst_gain + catalyst_usurp_title = major_struggle_catalyst_gain # good + catalyst_forced_conversion = medium_struggle_catalyst_gain + catalyst_reveal_secret_important = major_struggle_catalyst_gain + catalyst_broke_truce_against_important_character = massive_struggle_catalyst_gain # Cannot motivate the AI to do that without code support + catalyst_tfe_declared_war = major_struggle_catalyst_gain + } + } + } + + war_effects = { + ###### Common + common_parameters = { + struggle_clash_restricted_to_single_county = yes + } + + ###### Involved + involved_parameters = { + white_peace_acceptance_between_involved_or_interloper_with_region_easier = yes + truces_by_involved_or_interlopers_within_region_longer = yes + struggle_cheaper_buy_truce = yes + unlocks_enforce_truces_interaction = yes + struggle_cb_cost_major = yes + involved_or_interloper_diff_faith_wars_in_struggle_region_more_expensive_prestige_costs = yes + apply_truce_when_sending_ward = yes + invasion_conquest_war_cannot_be_declared = yes + } + + involved_character_modifier = { + ai_war_chance = -0.25 + ai_war_cooldown = 0.25 + + levy_reinforcement_rate_friendly_territory = 0.5 + levy_reinforcement_rate_same_faith = 0.5 + garrison_size = 0.25 + defender_advantage = 5 + } + ###### Interlopers + interloper_parameters = { + white_peace_acceptance_between_involved_or_interloper_with_region_easier = yes + truces_by_involved_or_interlopers_within_region_longer = yes + involved_or_interloper_diff_faith_wars_in_struggle_region_more_expensive_prestige_costs = yes + } + + interloper_county_modifier = { + monthly_county_control_change_at_war_add = -0.01 + monthly_county_control_change_at_war_mult = -0.25 + + defender_holding_advantage = -5 + } + + ###### Uninvolved + uninvolved_county_modifier = { + monthly_county_control_change_at_war_add = -0.02 + monthly_county_control_change_at_war_mult = -0.5 + + defender_holding_advantage = -10 + } + } + + faith_effects = { + ###### Common + common_parameters = { + holy_wars_in_region_cannot_be_declared = yes + county_faith_conversion_in_region_proceeds_slower = yes + } + + ###### Involved + involved_parameters = { + interfaith_marriages_available_between_involved_characters = yes + piety_from_new_alliance = yes + completing_building_in_temple_gives_piety = yes + release_prisoner_diff_faith_gives_prestige = yes + same_faith_friend_piety_gain = yes + } + + involved_character_modifier = { + opinion_of_different_faith = 10 + } + + ###### Interlopers + interloper_character_modifier = { + opinion_of_different_faith = 10 + } + + ###### Uninvolved + + # Nothing + } + + culture_effects = { + ###### Common + common_parameters = { + county_culture_conversion_in_region_proceeds_faster = yes + } + + ###### Involved + involved_parameters = { + release_prisoner_diff_culture_gives_prestige = yes + } + + involved_character_modifier = { + cultural_head_acceptance_gain_mult = 0.5 + opinion_of_different_culture = 10 + max_learn_language_schemes_add = 1 + } + + ###### Interlopers + interloper_character_modifier = { + opinion_of_different_culture = 5 + max_learn_language_schemes_add = 1 + } + + ###### Uninvolved + + # Nothing + } + + other_effects = { + ###### Common + + # Nothing + + ###### Involved + + involved_parameters = { + completing_building_in_castle_gives_development = yes + granting_independence_to_non_dejure_gives_renown = yes + struggle_grant_titles_diff_faith_culture_gives_prestige = yes + } + + involved_county_modifier = { + castle_holding_build_gold_cost = -0.25 + castle_holding_holding_build_gold_cost = -0.25 + } + + ###### Interlopers + interloper_character_modifier = { + county_opinion_add = -5 + tax_mult = -0.25 + } + + ###### Uninvolved + uninvolved_county_modifier = { + county_opinion_add = -10 + tax_mult = -0.5 + } + } + + ################################################## + # Ending + + #We are listing all available decision to give players insights on how they can end the Struggle + ending_decisions = { + struggle_eastern_iranian_ending_domination_decision + struggle_eastern_iranian_ending_silk_road_decision + struggle_eastern_iranian_ending_compromise_decision + } + } + + # During Conciliation Phase, things have gotten so amicable that societies outside the Struggle often find relations difficult to parse; interfaith marriages & myriad cultural changes are common. + # We s + struggle_TFE_eastern_iranian_phase_development = { + ################################################## + # General Set-Up + + background = "gfx/interface/illustrations/struggle_backgrounds/struggle_opportunity_middle_east.dds" + + future_phases = { + struggle_TFE_eastern_iranian_phase_compromise = { + catalysts = { + catalyst_passing_of_time = minimal_struggle_catalyst_gain + catalyst_gain_claim_on_title = minor_struggle_catalyst_gain + catalyst_win_any_war_within_the_region = minor_struggle_catalyst_gain # Good + catalyst_new_building_in_castle = minor_struggle_catalyst_gain # Good + catalyst_becomes_rival_with_involved = major_struggle_catalyst_gain # Good + catalyst_using_a_hook_on_very_important_character = medium_struggle_catalyst_gain # good + #- Host a Feast when having at least two different-faith vassals + catalyst_unnatural_death_important_character = medium_struggle_catalyst_gain + catalyst_usurp_title = major_struggle_catalyst_gain # good + catalyst_forced_conversion = medium_struggle_catalyst_gain + catalyst_reveal_secret_important = major_struggle_catalyst_gain + catalyst_broke_truce_against_important_character = massive_struggle_catalyst_gain # Cannot motivate the AI to do that without code support + } + } + } + + war_effects = { + ###### Common + common_parameters = { + invasion_conquest_war_cannot_be_declared = yes + struggle_clash_restricted_to_single_county = yes + } + + ###### Involved + + involved_parameters = { + struggle_cb_cost_major = yes + struggle_cheaper_buy_truce = yes + truces_by_involved_or_interlopers_within_region_longer = yes + } + + involved_character_modifier = { + ai_war_chance = -0.5 + ai_war_cooldown = 0.5 + } + + involved_county_modifier = { + monthly_county_control_change_at_war_add = -0.01 + monthly_county_control_change_at_war_mult = -0.10 + } + + ###### Interlopers + interloper_parameters = { + truces_by_involved_or_interlopers_within_region_longer = yes + } + + interloper_county_modifier = { + monthly_county_control_change_at_war_add = -0.02 + monthly_county_control_change_at_war_mult = -0.25 + } + + ###### Uninvolved + uninvolved_county_modifier = { + monthly_county_control_change_at_war_add = -0.05 + monthly_county_control_change_at_war_mult = -0.5 + } + } + + faith_effects = { + ###### Common + + # Nothing + + ###### Involved + involved_character_modifier = { + opinion_of_different_faith = 20 + different_faith_county_opinion_mult = -0.5 + opinion_of_different_faith_liege = 10 + } + + involved_parameters = { + truces_by_involved_or_interlopers_within_region_longer = yes + county_conversion_disabled_for_involved_faiths_within_region = yes + interfaith_marriages_available_between_involved_characters = yes + interfaith_marriages_between_involved_characters_gives_piety = yes + release_prisoner_diff_faith_gives_prestige = yes + learning_languages_gives_piety = yes + holy_wars_in_region_cannot_be_declared = yes + } + + ###### Interlopers + + # Nothing + + ###### Uninvolved + + # Nothing + } + + culture_effects = { + ###### Common + + # Nothing + + ###### Involved + involved_parameters = { + easier_culture_hybridising_for_involved_and_interlopers = yes + release_prisoner_diff_culture_gives_prestige = yes + } + + involved_character_modifier = { + cultural_head_acceptance_gain_mult = 0.2 + opinion_of_different_culture = 20 + learn_language_scheme_phase_duration_add = major_scheme_phase_duration_bonus_value + owned_personal_scheme_success_chance_add = 10 + cultural_head_fascination_mult = 0.25 + } + + ###### Interlopers + interloper_parameters = { + easier_culture_hybridising_for_involved_and_interlopers = yes + } + + ###### Uninvolved + + # Nothing + } + + other_effects = { + ###### Common + all_county_modifier = { + development_growth_factor = 0.3 + } + + ###### Involved + involved_parameters = { + # struggle_vips_and_culture_faith_heads_may_develop_spontaneous_positive_or_negative_relations = yes + struggle_unlocks_befriend_schemes_for_everyone = yes + struggle_prestige_from_feast = yes + struggle_gifts_involved_diff_faith_culture_leads_to_friendship = yes + struggle_grant_titles_diff_faith_culture_to_leads_to_friendship = yes + struggle_cannot_execute_involved_prisoners = yes + struggle_becoming_friend_gives_prestige = yes + involved_form_alliances_with_each_other_easier = yes + struggle_agents_less_likely_to_join_schemes = yes + struggle_cheaper_urbanize_silk_road_decision = yes + } + + involved_county_modifier = { + county_opinion_add = 20 + build_speed = -0.25 + tax_mult = 0.1 + city_holding_holding_build_gold_cost = -0.25 + city_holding_build_gold_cost = -0.25 + } + + involved_character_modifier = { + befriend_scheme_phase_duration_add = massive_scheme_phase_duration_bonus_value + enemy_hostile_scheme_phase_duration_add = medium_scheme_phase_duration_malus_value + max_personal_schemes_add = 1 + } + + ###### Interlopers + interloper_character_modifier = { + county_opinion_add = 10 + build_speed = -0.05 + + tax_mult = 0.05 + } + + ###### Uninvolved + + # Really hard for them to stay here + uninvolved_county_modifier = { + tax_mult = 0.02 + #county_opinion_add = -50 + #garrison_size = -0.1 + #supply_limit_mult = -0.1 + } + } + + ################################################## + # Ending + + #We are listing all available decision to give players insights on how they can end the Struggle + ending_decisions = { + struggle_eastern_iranian_ending_domination_decision + struggle_eastern_iranian_ending_silk_road_decision + struggle_eastern_iranian_ending_compromise_decision + } + } + } + + # AI should gift +} + } +} + +"events/eastern_iranian_struggle_events/tfe_eastern_iranian_struggle_events.txt" = { + { +namespace = eastern_iranian_struggle + +### SYSTEM EVENTS ################################################################# +## # Parameter Events +## # Other Events +### EVENT LIST #################################################################### +################################################################################### + +# Setting AI Intent +eastern_iranian_struggle.0003 = { + hidden = yes + scope = none + scope = struggle + + trigger = { # Should not need this, but, redundancy check! -h + exists = struggle:eastern_iranian_struggle + struggle:eastern_iranian_struggle = { any_involved_ruler = { count > 0 } } # For when the conflict is ongoing but nobody is left to fight it + } + + immediate = { + # prepare needed variables; they will be destroyed at the end of the immediate + set_variable = { + name = agents_for_escalation + value = 0 + } + set_variable = { + name = agents_for_deescalation + value = 0 + } + + # Go through the characters to distribute them between the potential transitions + struggle:eastern_iranian_struggle = { + every_involved_ruler = { + limit = { is_alive = yes } + ####################### + # Play cue track + ###################### + if = { + limit = { is_ai = no } + play_music_cue = "mx_Struggle_Opening" + } + + ####################### + # Check existing flags + ###################### + if = { + limit = { has_character_flag = agenda_towards_escalation } + change_variable = { + name = agents_for_escalation + add = 1 + } + } + else_if = { + limit = { has_character_flag = agenda_towards_deescalation } + change_variable = { + name = agents_for_deescalation + add = 1 + } + } + else = { # Set a flag + + ############################# + # Current Phase: EXPANSION + ############################# + if = { + limit = { root = { is_struggle_phase = struggle_TFE_eastern_iranian_phase_expansion } } + random_list = { + # Working towards hostility + # It should be for characters looking for direct conflicts and domination, with the will and ability to expand their realms + 100 = { + # Odds modifiers + eastern_iranian_struggle_set_ai_agenda_common_modifiers = { + PHASE = hostility + INTENT = escalation + } + + # Apply effects + eastern_iranian_struggle_apply_ai_agenda_effect = { + INTENT = escalation + } + } + # Working towards development + 100 = { + # Odds modifiers + eastern_iranian_struggle_set_ai_agenda_common_modifiers = { + PHASE = development + INTENT = deescalation + } + + # Apply effects + eastern_iranian_struggle_apply_ai_agenda_effect = { + INTENT = deescalation + } + } + } + } + + ############################# + # Current Phase: DEVELOPMENT + ############################# + if = { + limit = { root = { is_struggle_phase = struggle_TFE_eastern_iranian_phase_development } } + random_list = { + # Working towards compromise + # It should be for characters looking for direct conflicts and domination, with the will and ability to expand their realms + 100 = { + # Odds modifiers + eastern_iranian_struggle_set_ai_agenda_common_modifiers = { + PHASE = compromise + INTENT = escalation + } + + # Apply effects + eastern_iranian_struggle_apply_ai_agenda_effect = { + INTENT = escalation + } + } + } + } + ############################# + # Current Phase: Hostility + ############################# + if = { + limit = { root = { is_struggle_phase = struggle_TFE_eastern_iranian_phase_hostility } } + random_list = { + # Working towards Compromise + 100 = { + # Odds modifiers + eastern_iranian_struggle_set_ai_agenda_common_modifiers = { + PHASE = compromise + INTENT = deescalation + } + + # Apply effects + eastern_iranian_struggle_apply_ai_agenda_effect = { + INTENT = deescalation + } + } + } + } + + ############################# + # Current Phase: Compromise + ############################# + if = { + limit = { root = { is_struggle_phase = struggle_TFE_eastern_iranian_phase_compromise } } + random_list = { + # Working towards expansion + 100 = { + # Odds modifiers + eastern_iranian_struggle_set_ai_agenda_common_modifiers = { + PHASE = expansion + INTENT = escalation + } + + # Apply effects + eastern_iranian_struggle_apply_ai_agenda_effect = { + INTENT = escalation + } + } + } + } + } + } + } + + # Clean variables + remove_variable = agents_for_escalation + remove_variable = agents_for_deescalation + } +} + +# Set AI Intent on join +eastern_iranian_struggle.0004 = { + hidden = yes + scope = none + + immediate = { + set_variable = { + name = agents_for_escalation + value = 0 + } + set_variable = { + name = agents_for_deescalation + value = 0 + } + + ############################ + # Update the variables + ############################ + every_character_struggle = { + every_involved_ruler = { + limit = { is_alive = yes } + if = { + limit = { has_character_flag = agenda_towards_escalation } + root = { + change_variable = { + name = agents_for_escalation + add = 1 + } + } + } + else_if = { + limit = { has_character_flag = agenda_towards_deescalation } + root = { + change_variable = { + name = agents_for_deescalation + add = 1 + } + } + } + } + } + + if = { + limit = { + NOR = { + has_character_flag = agenda_towards_escalation + has_character_flag = agenda_towards_deescalation + } + } + + ############################# + # Current Phase: EXPANSION + ############################# + if = { + limit = { any_character_struggle = { AND = { is_struggle_type = eastern_iranian_struggle is_struggle_phase = struggle_TFE_eastern_iranian_phase_expansion } } } + random_list = { + # Working towards hostility + # It should be for characters looking for direct conflicts and domination, with the will and ability to expand their realms + 100 = { + # Odds modifiers + eastern_iranian_struggle_set_ai_agenda_common_modifiers = { + PHASE = hostility + INTENT = escalation + } + + # Apply effects + eastern_iranian_struggle_apply_ai_agenda_effect = { + INTENT = escalation + } + } + # Working towards development + 100 = { + # Odds modifiers + eastern_iranian_struggle_set_ai_agenda_common_modifiers = { + PHASE = development + INTENT = deescalation + } + + # Apply effects + eastern_iranian_struggle_apply_ai_agenda_effect = { + INTENT = deescalation + } + } + } + } + + ############################# + # Current Phase: DEVELOPMENT + ############################# + if = { + limit = { any_character_struggle = { AND = { is_struggle_type = eastern_iranian_struggle is_struggle_phase = struggle_TFE_eastern_iranian_phase_development } } } + random_list = { + # Working towards compromise + # It should be for characters looking for direct conflicts and domination, with the will and ability to expand their realms + 100 = { + # Odds modifiers + eastern_iranian_struggle_set_ai_agenda_common_modifiers = { + PHASE = compromise + INTENT = escalation + } + + # Apply effects + eastern_iranian_struggle_apply_ai_agenda_effect = { + INTENT = escalation + } + } + } + } + ############################# + # Current Phase: Hostility + ############################# + if = { + limit = { any_character_struggle = { AND = { is_struggle_type = eastern_iranian_struggle is_struggle_phase = struggle_TFE_eastern_iranian_phase_hostility } } } + random_list = { + # Working towards Compromise + 100 = { + # Odds modifiers + eastern_iranian_struggle_set_ai_agenda_common_modifiers = { + PHASE = compromise + INTENT = deescalation + } + + # Apply effects + eastern_iranian_struggle_apply_ai_agenda_effect = { + INTENT = deescalation + } + } + } + } + + ############################# + # Current Phase: Compromise + ############################# + if = { + limit = { any_character_struggle = { AND = { is_struggle_type = eastern_iranian_struggle is_struggle_phase = struggle_TFE_eastern_iranian_phase_compromise } } } + random_list = { + # Working towards expansion + 100 = { + # Odds modifiers + eastern_iranian_struggle_set_ai_agenda_common_modifiers = { + PHASE = expansion + INTENT = escalation + } + + # Apply effects + eastern_iranian_struggle_apply_ai_agenda_effect = { + INTENT = escalation + } + } + } + } + } + + # Clean variables + remove_variable = agents_for_escalation + remove_variable = agents_for_deescalation + } +} + +################################### +# Easten Iranian Struggle Intro Events +# 0501 - 599 +################################### +eastern_iranian_struggle.0501 = { # Fullscreen Intro Event + type = character_event + window = fullscreen_event + title = eastern_iranian_struggle.0501.t + desc = { + desc = eastern_iranian_struggle.0501.desc + first_valid = { + triggered_desc = { + trigger = { + any_character_struggle = { + involvement = involved + is_struggle_type = eastern_iranian_struggle + } + } + desc = fp2_struggle.0501.desc.involved + } + triggered_desc = { + trigger = { + any_character_struggle = { + involvement = interloper + is_struggle_type = eastern_iranian_struggle + } + } + desc = fp2_struggle.0501.desc.interloper + } + } + } + theme = realm + trigger = { # we need to prevent this from firing for all players when a new player joins in MP + is_ai = no + NOT = { has_character_flag = eastern_iranian_struggle_intro_event_flag } + tfe_character_any_involvement_eastern_iranian_struggle_trigger = yes + } + override_background = { reference = TFE_struggle_bg_oasis } + override_sound = { reference = "event:/DLC/FP2/SFX/UI/fp2_struggle_ui_intro_animate" } + + widgets = { + widget = { + gui = "event_window_widget_struggle_info" + container = "dynamic_content_widget" + controller = struggle_info + setup_scope = { struggle:eastern_iranian_struggle = { save_scope_as = struggle } } + } + } + immediate = { + play_music_cue = "mood_alexandria" + add_character_flag = eastern_iranian_struggle_intro_event_flag + save_scope_value_as = { + name = start + value = yes + } + } + option = { + name = eastern_iranian_struggle.0501.a + clicksound = "event:/DLC/FP2/SFX/UI/fp2_struggle_start_select" + } +} + + + + + +################################### +# Eastern Iranian Struggle Ending Events +# 1000 - 1099 +################################### + +# Domination Ending +eastern_iranian_struggle.1000 = { + type = character_event + window = fullscreen_event + title = eastern_iranian_struggle.1000.t + desc = eastern_iranian_struggle.1000.desc + theme = court + override_background = { reference = TFE_struggle_bg_mena_palace } + override_sound = { reference = "event:/DLC/FP2/SFX/UI/fp2_struggle_ui_intro_end_animate" } + + immediate = { + + # Add all involved cultures with counties to a list, for marriage and holy war checks + TFE_eastern_iranian_struggle_ending_culture_list_effect = yes + + play_music_cue = "mx_Struggle_ending_hostility" + + dynasty = { add_dynasty_prestige = 10000 } + give_nickname = nick_the_great + + save_scope_as = struggle_ender + } + + # Conquest victory + option = { + name = eastern_iranian_struggle.1000.a + house = { + add_house_modifier = { + modifier = struggle_eastern_iranian_house_offense_modifier + } + } + stress_impact = { + compassionate = minor_stress_impact_gain + forgiving = minor_stress_impact_gain + } + set_global_variable = { + name = TFE_struggle_eastern_iranian_conquest_victory + value = yes + days = 15 # Clear out eventually, just in case + } + } + + # Bulwark victory + option = { + name = eastern_iranian_struggle.1000.b + house = { + add_house_modifier = { + modifier = struggle_eastern_iranian_house_defense_modifier + } + } + stress_impact = { + brave = minor_stress_impact_gain + arrogant = minor_stress_impact_gain + } + set_global_variable = { + name = TFE_struggle_eastern_iranian_bulwark_victory + value = yes + days = 15 # Clear out eventually, just in case + } + } + + # Influence victory + option = { + name = eastern_iranian_struggle.1000.c + house = { + add_house_modifier = { + modifier = struggle_eastern_iranian_house_political_modifier + } + } + stress_impact = { + wrathful = minor_stress_impact_gain + trusting = minor_stress_impact_gain + } + set_global_variable = { + name = TFE_struggle_eastern_iranian_influence_victory + value = yes + days = 15 # Clear out eventually, just in case + } + } + + after = { + # End Struggle + struggle:eastern_iranian_struggle = { + end_struggle = struggle_eastern_iranian_ending_domination_decision + } + # Notify + every_player = { + # limit = { + # NOT = { this = root } + # } + trigger_event = eastern_iranian_struggle.1001 + } + } +} + + + + +# Integration Ending notification +eastern_iranian_struggle.1001 = { # Fullscreen Intro Event + type = character_event + window = fullscreen_event + title = eastern_iranian_struggle.1001.t + desc = { + desc = eastern_iranian_struggle.1001.desc + first_valid = { + triggered_desc = { + trigger = { + has_global_variable = TFE_struggle_eastern_iranian_conquest_victory + } + desc = eastern_iranian_struggle.1001.desc.closing.conquest + } + triggered_desc = { + trigger = { + has_global_variable = TFE_struggle_eastern_iranian_bulwark_victory + } + desc = eastern_iranian_struggle.1001.desc.closing.bulwark + } + triggered_desc = { + trigger = { + has_global_variable = TFE_struggle_eastern_iranian_influence_victory + } + desc = eastern_iranian_struggle.1001.desc.closing.influence + } + } + desc = eastern_iranian_struggle.1001.desc.closing + } + theme = court + override_background = { reference = TFE_struggle_bg_mena_palace } + override_sound = { reference = "event:/DLC/FP2/SFX/UI/fp2_struggle_ui_intro_animate" } + + immediate = { + play_music_cue = "mx_Struggle_ending_hostility" + scope:struggle_ender = { + show_as_tooltip = { + if = { + limit = { + has_global_variable = TFE_struggle_eastern_iranian_conquest_victory + } + house = { + add_house_modifier = { + modifier = struggle_eastern_iranian_house_offense_modifier + } + } + } + else_if = { + limit = { + has_global_variable = TFE_struggle_eastern_iranian_bulwark_victory + } + house = { + add_house_modifier = { + modifier = struggle_eastern_iranian_house_political_modifier + } + } + } + else_if = { + limit = { + has_global_variable = TFE_struggle_eastern_iranian_influence_victory + } + house = { + add_house_modifier = { + modifier = struggle_eastern_iranian_house_political_modifier + } + } + } + } + } + } + option = { + name = eastern_iranian_struggle.1001.a + } +} + + + + +# Silk Road Prosperity Ending +eastern_iranian_struggle.1002 = { + type = character_event + window = fullscreen_event + title = eastern_iranian_struggle.1002.t + desc = eastern_iranian_struggle.1002.desc + theme = court + override_background = { reference = TFE_struggle_bg_eastern_market } + override_sound = { reference = "event:/DLC/FP2/SFX/UI/fp2_struggle_ui_intro_end_animate" } + + immediate = { + + # Add all involved cultures with counties to a list, for marriage and holy war checks + TFE_eastern_iranian_struggle_ending_culture_list_effect = yes + + play_music_cue = "mx_Struggle_ending_conciliation" + + dynasty = { add_dynasty_prestige = 10000 } + give_nickname = nick_the_great + + save_scope_as = struggle_ender + } + + # Urbanite victory + option = { + name = eastern_iranian_struggle.1002.a + house = { + add_house_modifier = { + modifier = struggle_eastern_iranian_house_urban_modifier + } + } + stress_impact = { + compassionate = minor_stress_impact_gain + forgiving = minor_stress_impact_gain + } + set_global_variable = { + name = TFE_struggle_eastern_iranian_urban_victory + value = yes + days = 15 # Clear out eventually, just in case + } + } + + # Trader victory + option = { + name = eastern_iranian_struggle.1002.b + house = { + add_house_modifier = { + modifier = struggle_eastern_iranian_house_trade_modifier + } + } + stress_impact = { + brave = minor_stress_impact_gain + arrogant = minor_stress_impact_gain + } + set_global_variable = { + name = TFE_struggle_eastern_iranian_trade_victory + value = yes + days = 15 # Clear out eventually, just in case + } + } + + # Civilizer victory + option = { + name = eastern_iranian_struggle.1002.c + house = { + add_house_modifier = { + modifier = struggle_eastern_iranian_house_culture_modifier + } + } + stress_impact = { + wrathful = minor_stress_impact_gain + trusting = minor_stress_impact_gain + } + set_global_variable = { + name = TFE_struggle_eastern_iranian_culture_victory + value = yes + days = 15 # Clear out eventually, just in case + } + } + + after = { + # End Struggle + struggle:eastern_iranian_struggle = { + end_struggle = struggle_eastern_iranian_ending_silk_road_decision + } + # Notify + every_player = { + # limit = { + # NOT = { this = root } + # } + trigger_event = eastern_iranian_struggle.1003 + } + } +} + + + + +# Silk Road Ending notification +eastern_iranian_struggle.1003 = { # Fullscreen Intro Event + type = character_event + window = fullscreen_event + title = eastern_iranian_struggle.1003.t + desc = { + desc = eastern_iranian_struggle.1003.desc + first_valid = { + triggered_desc = { + trigger = { + has_global_variable = TFE_struggle_eastern_iranian_urban_victory + } + desc = eastern_iranian_struggle.1003.desc.closing.urban + } + triggered_desc = { + trigger = { + has_global_variable = TFE_struggle_eastern_iranian_trade_victory + } + desc = eastern_iranian_struggle.1003.desc.closing.trade + } + triggered_desc = { + trigger = { + has_global_variable = TFE_struggle_eastern_iranian_culture_victory + } + desc = eastern_iranian_struggle.1003.desc.closing.culture + } + } + desc = eastern_iranian_struggle.1003.desc.closing + } + theme = court + override_background = { reference = TFE_struggle_bg_eastern_market } + override_sound = { reference = "event:/DLC/FP2/SFX/UI/fp2_struggle_ui_intro_animate" } + + immediate = { + play_music_cue = "mx_Struggle_ending_conciliation" + scope:struggle_ender = { + show_as_tooltip = { + if = { + limit = { + has_global_variable = TFE_struggle_eastern_iranian_urban_victory + } + house = { + add_house_modifier = { + modifier = struggle_eastern_iranian_house_urban_modifier + } + } + } + else_if = { + limit = { + has_global_variable = TFE_struggle_eastern_iranian_trade_victory + } + house = { + add_house_modifier = { + modifier = struggle_eastern_iranian_house_trade_modifier + } + } + } + else_if = { + limit = { + has_global_variable = TFE_struggle_eastern_iranian_culture_victory + } + house = { + add_house_modifier = { + modifier = struggle_eastern_iranian_house_culture_modifier + } + } + } + } + } + } + option = { + name = eastern_iranian_struggle.1003.a + } +} + + +# Decentralization Ending +eastern_iranian_struggle.1004 = { + type = character_event + window = fullscreen_event + title = eastern_iranian_struggle.1004.t + desc = { + desc = eastern_iranian_struggle.1004.desc + } + theme = court + override_background = { reference = TFE_struggle_bg_oasis } + override_sound = { reference = "event:/DLC/FP2/SFX/UI/fp2_struggle_ui_intro_end_animate" } + + immediate = { + play_music_cue = "mx_Struggle_ending_compromise" + + save_scope_as = struggle_ender + + # Independent/Split De Jure Duchies will become De Jure Kingdoms + # if = { + # limit = { + # every_county_in_region = { + # region = TFE_eastern_iranian_struggle_region + # any_this_title_or_de_jure_above = { + # fp2_struggle_ending_compromise_independent_duchy_trigger = yes + # # NOT = { this = } + # } + # } + # } + # custom_tooltip = { + # text = tfe_iranian_struggle_compromise_create_new_kingdoms_tt + # persia_struggle_compromise_duchies_to_kingdoms_effect = yes + # } + # } + # if = { + # limit = { + # title:e_persia = { + # any_in_de_jure_hierarchy = { fp2_struggle_ending_compromise_independent_duchy_trigger = yes } + # } + # } + # custom_tooltip = { + # text = tfe_iranian_struggle_compromise_create_new_kingdoms_tt + # persia_struggle_compromise_duchies_to_kingdoms_effect = yes + # } + # } + # if = { + # limit = { + # title:e_turan = { + # any_in_de_jure_hierarchy = { fp2_struggle_ending_compromise_independent_duchy_trigger = yes } + # } + # } + # custom_tooltip = { + # text = tfe_iranian_struggle_compromise_create_new_kingdoms_tt + # persia_struggle_compromise_duchies_to_kingdoms_effect = yes + # } + # } + # Move duchies to right kingdoms + # persia_struggle_compromise_transfer_duchies_effect = yes + # # Turn kingdoms to empires + # persia_struggle_compromise_kingdoms_to_empires_effect = yes + # # distribute small kingdoms + # persia_struggle_compromise_distribute_kingdoms_to_neighbouring_empires_effect = yes + # # assign the new title to existing characters + # persia_struggle_compromise_distribute_the_actual_titles = yes + + hidden_effect = { + TFE_eastern_iranian_struggle_compromise_de_jure_effect = yes + } + + # Set up truces + persia_struggle_compromise_truce_effect = yes + + ##### Major Effects ##### + fp2_struggle_compromise_ender_effect = yes + + # Tooltips! + tfe_struggle_eastern_iranian_compromise_tooltip_effect = yes + + ##### Minor Effects ##### + # Self-sufficiency modifiers for each independent realm + tfe_struggle_eastern_iranian_compromise_modifier_rewards_effect = yes + set_global_variable = { + name = persia_struggle_compromise_ending + value = yes + } + } + + # Ok + option = { + name = eastern_iranian_struggle.1004.a + if = { + limit = { + any_in_list = { + list = kingdom_empire + this = root.primary_title + } + } + custom_tooltip = fp2_struggle.0901.tt + } + } + + after = { + stress_impact = { + arrogant = medium_stress_impact_gain + } + # End Struggle + struggle:eastern_iranian_struggle = { + end_struggle = struggle_eastern_iranian_ending_compromise_decision + } + every_player = { + # limit = { + # NOT = { this = root } + # } + trigger_event = eastern_iranian_struggle.1005 + } + } +} + +eastern_iranian_struggle.1005 = { + type = character_event + window = fullscreen_event + title = eastern_iranian_struggle.1005.t + desc = { + first_valid = { + triggered_desc = { + trigger = { is_in_list = struggle_involvees } + desc = eastern_iranian_struggle.1005.opening.involved + } + desc = eastern_iranian_struggle.1005.opening + } + desc = eastern_iranian_struggle.1005.desc + } + theme = court + override_background = { reference = TFE_struggle_bg_oasis } + override_sound = { reference = "event:/DLC/FP2/SFX/UI/fp2_struggle_ui_intro_end_animate" } + + immediate = { + play_music_cue = "mx_Struggle_ending_compromise" + ##### Major Effects ##### + show_as_tooltip = { + scope:struggle_ender = { fp2_struggle_compromise_ender_effect = yes } + } + # Independent/Split De Jure Duchies will become De Jure Kingdoms + tfe_struggle_eastern_iranian_compromise_tooltip_effect = yes + if = { + limit = { is_in_list = struggle_involvees } + show_as_tooltip = { + fp2_struggle_compromise_modifier_rewards_personal_house_effect = yes + fp2_struggle_compromise_modifier_rewards_personal_county_effect = yes + } + } + } + + # Ok + option = { + name = eastern_iranian_struggle.1005.a + } +} + +eastern_iranian_struggle.2001 = { + type = character_event + title = eastern_iranian_struggle.2001.t + desc = eastern_iranian_struggle.2001.desc + + theme = stewardship + + left_portrait = { + character = root + animation = personality_zealous + } + + option = { + name = eastern_iranian_struggle.2001.a + + remove_short_term_gold = capital_county.urbanize_silk_road_price + add_prestige = urbanize_silk_road_prestige_bonus_small + capital_county = { + add_county_modifier = { + modifier = urbanize_silk_road_modifier + years = 10 + } + } + } + + option = { + trigger = { + primary_title.tier >= tier_duchy + capital_county.duchy = { + is_title_created = yes + } + } + name = eastern_iranian_struggle.2001.b + + remove_short_term_gold = capital_county.urbanize_silk_road_price_duchy + add_prestige = urbanize_silk_road_prestige_bonus_medium + capital_county = { + add_county_modifier = { + modifier = urbanize_silk_road_modifier + years = 10 + } + } + capital_county = { + save_temporary_scope_as = current_title + duchy = { + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + title_province = { + geographical_region = TFE_eastern_iranian_struggle_region + } + holder = { + OR = { + this = scope:current_title.holder + is_vassal_or_below_of = scope:current_title.holder + } + } + } + custom = urbanize_modifier_added_tt + hidden_effect = { + add_county_modifier = { + modifier = urbanize_silk_road_modifier + years = 10 + } + } + } + } + } + } + + option = { + trigger = { + primary_title.tier >= tier_kingdom + capital_county.kingdom = { + is_title_created = yes + } + } + name = eastern_iranian_struggle.2001.c + + remove_short_term_gold = capital_county.urbanize_silk_road_price_kingdom + add_prestige = urbanize_silk_road_prestige_bonus_large + capital_county = { + add_county_modifier = { + modifier = urbanize_silk_road_modifier + years = 10 + } + } + capital_county = { + save_temporary_scope_as = current_title + kingdom = { + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + title_province = { + geographical_region = TFE_eastern_iranian_struggle_region + } + holder = { + OR = { + this = scope:current_title.holder + is_vassal_or_below_of = scope:current_title.holder + } + } + } + + custom = every_owned_county_within_de_jure_capital_kingdom_tt + custom = urbanize_modifier_added_tt + hidden_effect = { + add_county_modifier = { + modifier = urbanize_silk_road_modifier + years = 10 + } + } + } + } + } + } + + option = { + trigger = { + primary_title.tier >= tier_empire + capital_county.empire = { + is_title_created = yes + } + } + name = eastern_iranian_struggle.2001.d + + remove_short_term_gold = capital_county.urbanize_silk_road_price_empire + add_prestige = urbanize_silk_road_prestige_bonus_huge + capital_county = { + add_county_modifier = { + modifier = urbanize_silk_road_modifier + years = 10 + } + } + capital_county = { + save_temporary_scope_as = current_title + empire = { + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + title_province = { + geographical_region = TFE_eastern_iranian_struggle_region + } + holder = { + OR = { + this = scope:current_title.holder + is_vassal_or_below_of = scope:current_title.holder + } + } + } + + custom = every_owned_county_within_de_jure_capital_empire_tt + custom = urbanize_modifier_added_tt + hidden_effect = { + add_county_modifier = { + modifier = urbanize_silk_road_modifier + years = 10 + } + } + } + } + } + } + + # Actually, that's quite expensive lmao + option = { + name = eastern_iranian_struggle.2001.e + + custom_tooltip = eastern_iranian_struggle.2001.e_effect + remove_decision_cooldown = struggle_eastern_iranian_urbanize_area + } +} + } +} + +"common/decisions/tfe_struggle_decisions.txt" = { + # The decision's loc has anachronistic references to Romans and Saxons, and the decision references an undefined event. + { +establish_the_old_north = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_destiny_goal.dds" + } + decision_group_type = major + + ai_check_interval = 30 + + is_shown = { + is_ruler = yes + is_landed = yes + AND = { + exists = struggle:britannia_struggle + struggle:britannia_struggle = { + AND = { + is_culture_involved_in_struggle = root.culture + } + } + } + exists = dynasty + OR = { + culture = { has_cultural_pillar = heritage_brythonic } + culture = { has_cultural_pillar = heritage_goidelic } + culture = { has_cultural_pillar = heritage_celtic } + } + capital_county = { + title_province = { geographical_region = old_north } + } + NOT = { #Can only do it once. + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:established_old_north + } + } + highest_held_title_tier <= tier_duchy + title:k_old_north = { + AND = { + is_titular = yes + is_title_created = no + } + } + } + + is_valid = { + OR = { #Independent or vassal of an Emperor + is_independent_ruler = yes + top_liege.primary_title.tier >= tier_empire + } + prestige_level >= medium_prestige_level + has_title = title:d_northumberland + has_title = title:d_lancaster + has_title = title:d_lothian + has_title = title:d_galloway + completely_controls_region = old_north + } + + is_valid_showing_failures_only = { + is_available_adult = yes + } + + effect = { + save_scope_as = founder + show_as_tooltip = { old_north_scripted_effect = yes } + trigger_event = { id = britannia_struggle.7000 } + every_player = { + limit = { + NOT = { this = scope:founder } + top_liege = { + OR = { + this = scope:founder + any_neighboring_and_across_water_top_liege_realm_owner = { this = scope:founder } + } + } + } + trigger_event = britannia_struggle.7001 + } + hidden_effect = { + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:established_old_north + } + } + } +} + } + + { +################################################### +# +# EASTERN IRANIAN STRUGGLE ENDINGS +# By cybrxkhan +# +################################################### + + +# Domination +struggle_eastern_iranian_ending_domination_decision = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_dehqan.dds" + } + extra_picture = "gfx/interface/illustrations/struggle_decisions_buttons/decision_dehqan.dds" + decision_group_type = major + + title = struggle_eastern_iranian_ending_domination_decision + desc = struggle_eastern_iranian_ending_domination_decision_desc + selection_tooltip = struggle_eastern_iranian_ending_domination_decision_tooltip + confirm_click_sound = "event:/DLC/FP2/SFX/UI/fp2_struggle_ending_decision_confirm" + is_invisible = yes + + sort_order = 80 + + is_valid = { + is_independent_ruler = yes + + custom_tooltip = { + text = struggle_eastern_iranian_ending_domination_correct_phase_tt + any_character_struggle = { + is_struggle_type = eastern_iranian_struggle + OR = { + is_struggle_phase = struggle_TFE_eastern_iranian_phase_expansion + is_struggle_phase = struggle_TFE_eastern_iranian_phase_hostility + } + } + } + + custom_tooltip = { + text = struggle_ending_decision_correct_involvement_tt + any_character_struggle = { + involvement = involved + is_struggle_type = eastern_iranian_struggle + } + } + + prestige_level >= 4 + highest_held_title_tier >= tier_kingdom + + # Control at least 75% of the struggle region + custom_tooltip = { + text = struggle_eastern_iranian_ending_domination_region_tt + struggle_eastern_iranian_ending_domination_percent_region_trigger = yes + } + + + # OR = { + # culture = { has_cultural_pillar = heritage_iranian } # West Iranians + # culture = { has_cultural_pillar = heritage_tocharian } # East Iranians + # } + + # No other realm controls more than 20% of the region + custom_tooltip = { + text = struggle_eastern_iranian_ending_domination_decision_region_tt + NOT = { + struggle:eastern_iranian_struggle = { + any_involved_ruler = { + NOT = { this = root } + is_independent_ruler = yes + exists = primary_title + primary_title = { is_mercenary_company = no } + save_temporary_scope_as = eastern_iranian_region_realm + any_county_in_region = { + region = TFE_eastern_iranian_struggle_region + percent > fp2_struggle_hostility_region_percent_decimal_value + holder.top_liege = scope:eastern_iranian_region_realm + } + } + } + } + } + + } + + effect = { + if = { + limit = { has_dlc_feature = legends } + legend_seed_struggle_ending_effect = { + ENDER = root + STRUGGLE = eastern_iranian_struggle + } + } + ##### Major Effects ##### + show_as_tooltip = { + dynasty = { add_dynasty_prestige = 10000 } + give_nickname = nick_the_great + } + # Boost to culture and faith conversion + custom_tooltip = struggle_eastern_iranian_ending_bonus_conversion_tt + # Choose variation of dominance boost + custom_description_no_bullet = { text = struggle_eastern_iranian_dominance_modifier_list_tt } + + # Trigger a player facing event as a coda + trigger_event = eastern_iranian_struggle.1000 + } + + cost = { gold = { value = 200 } } + + ai_check_interval = 120 + + ai_potential = { always = yes } + + ai_will_do = { base = 100 } + +} + + +# Silk Road/Prosperity +struggle_eastern_iranian_ending_silk_road_decision = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_mena_palace.dds" + } + extra_picture = "gfx/interface/illustrations/struggle_decisions_buttons/decision_mena_palace.dds" + decision_group_type = major + + title = struggle_eastern_iranian_ending_silk_road_decision + desc = struggle_eastern_iranian_ending_silk_road_decision_desc + selection_tooltip = struggle_eastern_iranian_ending_silk_road_decision_tooltip + confirm_click_sound = "event:/DLC/FP2/SFX/UI/fp2_struggle_ending_decision_confirm" + is_invisible = yes + + sort_order = 80 + + is_valid = { + is_independent_ruler = yes + + custom_tooltip = { + text = struggle_eastern_iranian_ending_silk_road_correct_phase_tt + any_character_struggle = { + is_struggle_type = eastern_iranian_struggle + OR = { + is_struggle_phase = struggle_TFE_eastern_iranian_phase_expansion + is_struggle_phase = struggle_TFE_eastern_iranian_phase_development + } + } + } + + custom_tooltip = { + text = struggle_ending_decision_correct_involvement_tt + any_character_struggle = { + involvement = involved + is_struggle_type = eastern_iranian_struggle + } + } + + prestige_level >= 4 + highest_held_title_tier >= tier_kingdom + + # Control at least 40% of the struggle region + custom_tooltip = { + text = struggle_eastern_iranian_ending_silk_road_region_tt + struggle_eastern_iranian_ending_silk_road_percent_region_trigger = yes + } + + # Own at least 5 counties in the struggle region with 80 development, including your capital + custom_tooltip = { + text = struggle_eastern_iranian_ending_silk_road_county_req_tt + capital_county = { + development_level >= struggle_eastern_iranian_development_req_value + title_province = { geographical_region = TFE_eastern_iranian_struggle_region } + } + any_held_county = { + count >= struggle_eastern_iranian_development_county_value + development_level >= struggle_eastern_iranian_development_req_value + title_province = { geographical_region = TFE_eastern_iranian_struggle_region } + } + # capital_county.de_jure_liege.de_jure_liege = { + # any_de_jure_county = { + # percent >= 0.8 + # culture = root.culture + # faith = root.faith + # } + # } + } + + + # OR = { + # culture = { has_cultural_pillar = heritage_iranian } # West Iranians + # culture = { has_cultural_pillar = heritage_tocharian } # East Iranians + # } + + # No other realm controls more than 20% of the region + # custom_tooltip = { + # text = struggle_eastern_iranian_ending_total_victory_decision_region_tt + # NOT = { + # struggle:roman_persian_struggle = { + # any_involved_ruler = { + # NOT = { this = root } + # is_independent_ruler = yes + # exists = primary_title + # primary_title = { is_mercenary_company = no } + # save_temporary_scope_as = eastern_iranian_region_realm + # any_county_in_region = { + # region = TFE_eastern_iranian_struggle_region + # percent > fp2_struggle_hostility_region_percent_decimal_value + # holder.top_liege = scope:eastern_iranian_region_realm + # } + # } + # } + # } + # } + + } + + effect = { + if = { + limit = { has_dlc_feature = legends } + legend_seed_struggle_ending_effect = { + ENDER = root + STRUGGLE = eastern_iranian_struggle + } + } + ##### Major Effects ##### + show_as_tooltip = { + dynasty = { add_dynasty_prestige = 10000 } + give_nickname = nick_the_great + } + # Boost to culture and faith conversion + custom_tooltip = struggle_eastern_iranian_ending_bonus_conversion_tt + # Choose economic, cultural, or military boost + custom_description_no_bullet = { text = struggle_eastern_iranian_silk_road_prosperity_modifier_list_tt } + + # Trigger a player facing event as a coda + trigger_event = eastern_iranian_struggle.1002 + } + + cost = { gold = { value = 200 } } + + ai_check_interval = 120 + + ai_potential = { always = yes } + + ai_will_do = { base = 100 } + +} + + +# Decentralized Polities +struggle_eastern_iranian_ending_compromise_decision = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_qanat.dds" + } + extra_picture = "gfx/interface/illustrations/struggle_decisions_buttons/decision_qanat.dds" + decision_group_type = major + + title = struggle_eastern_iranian_ending_compromise_decision + desc = struggle_eastern_iranian_ending_compromise_decision_desc + selection_tooltip = struggle_eastern_iranian_ending_compromise_decision_tooltip + confirm_click_sound = "event:/DLC/FP2/SFX/UI/fp2_struggle_ending_decision_confirm" + is_invisible = yes + + sort_order = 80 + + is_valid = { + is_independent_ruler = yes + + custom_tooltip = { + text = struggle_eastern_iranian_ending_compromise_decision_correct_phase_tt + any_character_struggle = { + AND = { + is_struggle_type = eastern_iranian_struggle + is_struggle_phase = struggle_TFE_eastern_iranian_phase_compromise + } + } + } + + custom_tooltip = { + text = struggle_ending_decision_correct_involvement_tt + any_character_struggle = { + involvement = involved + is_struggle_type = eastern_iranian_struggle + } + } + + OR = { + # Exalted among Men or higher + prestige_level >= very_high_prestige_level + # Hold and completely control a de jure kingdom of Hispania + custom_tooltip = { + text = struggle_eastern_iranian_ending_compromise_decision_kingdom_tt + tfe_struggle_ending_hold_de_jure_kingdom_trigger_persia = yes + } + } + + # Control less than 50% of Iberia + custom_tooltip = { + text = struggle_eastern_iranian_ending_compromise_decision_region_tt + tfe_struggle_ending_percent_persia_trigger = yes + } + + # No one else controls more than 50% of Iberia + custom_tooltip = { + text = struggle_eastern_iranian_ending_compromise_decision_other_region_tt + tfe_struggle_ending_other_percent_persia_trigger = yes + } + + # No Independent Involved rulers are at war with each other + custom_tooltip = { + text = struggle_iberia_ending_compromise_truce_tt + NOT = { + struggle:eastern_iranian_struggle = { + any_involved_ruler = { + is_independent_ruler = yes + primary_title = { is_mercenary_company = no } + any_primary_war_enemy = { + is_independent_ruler = yes + any_character_struggle = { + involvement = involved + is_struggle_type = eastern_iranian_struggle + } + primary_title = { is_mercenary_company = no } + } + } + } + } + } + + OR = { + # Every other involved independent ruler in Eastern Iranian region has at least 60 opinion of you or is strong hooked + custom_tooltip = { + text = struggle_eastern_iranian_ending_compromise_decision_opinion_tt + struggle:eastern_iranian_struggle = { + NOT = { + any_involved_ruler = { + NOT = { this = root } + is_independent_ruler = yes + primary_title = { is_holy_order = no } + primary_title = { is_mercenary_company = no } + save_temporary_scope_as = this_character + NOR = { + root = { has_strong_hook = scope:this_character } + opinion = { + target = root + value >= struggle_iberia_ending_compromise_decision_opinion_value + } + } + } + } + } + } + # No other independent ruler in Eastern Iranian region is a king or above + custom_tooltip = { + text = struggle_eastern_iranian_ending_compromise_decision_independent_tt + struggle:eastern_iranian_struggle = { + NOT = { + any_involved_ruler = { + NOT = { this = root } + is_independent_ruler = yes + primary_title = { is_mercenary_company = no } + primary_title.tier >= tier_kingdom + } + } + } + } + # More than 25% of Eastern Iranian region is controlled by Interloper or Uninvolved rulers + custom_tooltip = { + text = struggle_eastern_iranian_ending_compromise_decision_interloper_tt + any_county_in_region = { + region = TFE_eastern_iranian_struggle_region + percent > fp2_struggle_compromise_uninvolved_percent_decimal_value + holder.top_liege = { + NOT = { + any_character_struggle = { + involvement = involved + is_struggle_type = eastern_iranian_struggle + } + } + } + } + } + } + } + + effect = { + if = { + limit = { has_dlc_feature = legends } + legend_seed_struggle_ending_effect = { + ENDER = root + STRUGGLE = eastern_iranian_struggle + } + } + ##### Major Effects ##### + # Personal effects for ruler + show_as_tooltip = { tfe_struggle_compromise_ender_effect = yes } + # any_county_in_region + # Independent/Split De Jure Duchies will become De Jure Kingdoms + # if = { + # limit = { + # every_county_in_region = { + # region = TFE_eastern_iranian_struggle_region + # any_this_title_or_de_jure_above = { + # fp2_struggle_ending_compromise_independent_duchy_trigger = yes + # # NOT = { this = } + # } + # } + # } + # custom_tooltip = tfe_iranian_struggle_compromise_create_new_kingdoms_tt + # } + # if = { + # limit = { + # title:e_persia = { + # any_in_de_jure_hierarchy = { + # fp2_struggle_ending_compromise_independent_duchy_trigger = yes + # # NOT = { this = } + # } + # } + # } + # custom_tooltip = tfe_iranian_struggle_compromise_create_new_kingdoms_tt + # } + # if = { + # limit = { + # title:e_turan = { + # any_in_de_jure_hierarchy = { + # fp2_struggle_ending_compromise_independent_duchy_trigger = yes + # } + # } + # } + # custom_tooltip = tfe_iranian_struggle_compromise_create_new_kingdoms_tt + # } + # Other Tooltips! + tfe_iranian_struggle_compromise_tooltip_effect = yes + + ##### Minor Effects ##### + # Self-sufficiency/defensive modifiers for each independent realm + show_as_tooltip = { fp2_struggle_compromise_modifier_rewards_effect = yes } + + show_as_tooltip = { + stress_impact = { + arrogant = medium_stress_impact_gain + } + } + + + # Trigger a player facing event as a coda + trigger_event = eastern_iranian_struggle.1004 + } + + cost = { gold = { value = 150 } } + + ai_check_interval = 120 + + ai_potential = { always = yes } + + ai_will_do = { base = 100 } +} + +#Eastern Iranian Struggle Silk Road Urbanization Decision (totally not copied from the discord title) +struggle_eastern_iranian_urbanize_area = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_qanat.dds" + } + + desc = struggle_eastern_iranian_urbanize_area_desc + selection_tooltip = struggle_eastern_iranian_urbanize_area_tooltip + ai_check_interval = 0 + cooldown = { years = 15 } + + is_shown = { + capital_county = { + title_province = { + geographical_region = TFE_eastern_iranian_struggle_region + } + } + } + + is_valid_showing_failures_only = { + is_at_war = no + is_adult = yes + } + + effect = { + # Get some good county opinion, and prevent said counties from joining popular revolts + # show_as_tooltip = { + # capital_county = { + # add_county_modifier = { + # modifier = urbanize_silk_road_modifier + # years = 10 + # } + # } + # } + custom_tooltip = struggle_eastern_iranian_urbanize_area_extend_to_county + if = { + limit = { + primary_title.tier >= tier_duchy + any_held_title = { tier = tier_duchy } + capital_county.duchy = { + is_title_created = yes + } + } + custom_tooltip = struggle_eastern_iranian_urbanize_area_extend_to_duchy + } + if = { + limit = { + primary_title.tier >= tier_kingdom + any_held_title = { tier = tier_kingdom } + capital_county.kingdom = { + is_title_created = yes + } + } + custom_tooltip = struggle_eastern_iranian_urbanize_area_extend_to_kingdom + } + if = { + limit = { + primary_title.tier >= tier_empire + any_held_title = { tier = tier_empire } + capital_county.empire = { + is_title_created = yes + } + } + custom_tooltip = struggle_eastern_iranian_urbanize_area_extend_to_empire + } + + trigger_event = eastern_iranian_struggle.2001 + } + + ai_will_do = { + base = 20 + } +} + } +} + +"common/on_action/game_start.txt" = { + # TFE doesn't have Iceland on the map. + { + title:d_iceland = { set_coa = d_iceland_norse } + title:c_vestisland = { set_coa = c_vestisland_norse } + title:c_nordrland = { set_coa = c_nordrland_norse } + title:c_austisland = { set_coa = c_austisland_norse } + title:c_sudurland = { set_coa = c_sudurland_norse } + } +} + +"common/scripted_modifiers/TFE_marriage_modifier.txt" = { + { + ############# + # HAROLD # + ############# + modifier = { + add = -5000 + years_from_game_start <= 5 + OR = { + scope:actor = character:122 + scope:recipient = character:122 + scope:secondary_actor = character:122 + scope:secondary_recipient = character:122 + } + scope:actor = { + is_ai = yes + } + scope:recipient = { + is_ai = yes + } + scope:secondary_actor = { + is_ai = yes + } + scope:secondary_recipient = { + is_ai = yes + } + } + } +} + +"gfx/portraits/portrait_modifiers/01_beards_base.txt" = { + { + modifier = { + add = 666 exists = this - exists = character:easteregg_petter_vilberg - this = character:easteregg_petter_vilberg - } + exists = character:easteregg_daan_broekhof + this = character:easteregg_daan_broekhof + } + modifier = { + add = 1000 + exists = this + has_character_flag = no_beard + } + } +} + +"common/casus_belli_types/00_migration_wars.txt" = { + # The converter removes eastern_iranian_struggle + { + if = { + limit = { + AND = { + exists = struggle:eastern_iranian_struggle + struggle:eastern_iranian_struggle = { + AND = { + has_struggle_phase_parameter = cheaper_nomadic_migrations_within_struggle_region + is_culture_involved_in_struggle = scope:attacker.culture + } + } + } + } + multiply = { + value = 0.5 + desc = EASTERN_IRANIAN_STRUGGLE + } + } + } + + # The converter removes eastern_iranian_struggle + { + if = { + limit = { + OR = { + AND = { + exists = struggle:eastern_iranian_struggle + migration_levies_value >= 10 + struggle:eastern_iranian_struggle = { + has_struggle_phase_parameter = more_nomadic_migration_armies + } + any_in_list = { + list = target_titles + title_capital_county.title_province = { + geographical_region = TFE_eastern_iranian_struggle_region + } + } + has_cultural_tradition = tradition_nomadic_migrations + } + AND = { + exists = struggle:north_indian_struggle + migration_levies_value >= 10 + struggle:north_indian_struggle = { + has_struggle_phase_parameter = more_nomadic_migration_armies + } + any_in_list = { + list = target_titles + title_capital_county.title_province = { + geographical_region = TFE_north_indian_struggle_region + } + } + has_cultural_tradition = tradition_nomadic_migrations + } + } + } + spawn_army = { + name = event_troop_default_name + levies = migration_army_levies_small + men_at_arms = { + type = light_horsemen + stacks = migration_army_maa_small + } + location = scope:attacker.capital_province + uses_supply = no + inheritable = yes + } + } + } + + # k_juteland not in TFE as of the 'After the Pharaohs' update + { + this = title:k_juteland + } + { + this = title:k_juteland + } + + # From error.log: "Compiling source for special_invasion_cb_seize_land_in_region_trigger failed for unknown arguments: TARGET_EMPIRE" + { +visigothic_revolt_cb = { + group = event #Switching this to event will render the CB invisible. + + allowed_for_character = { culture = culture:visigothic } + target_titles = all + target_title_tier = kingdom + target_de_jure_regions_above = yes + ignore_effect = change_title_holder + combine_into_one = yes + + + should_invalidate = { + NOT = { + any_in_list = { + list = target_titles + any_in_de_jure_hierarchy = { + tier = tier_county + holder = { + target_is_same_character_or_above = scope:defender + } + } + } + } + #Emperors do not deign to migrate. Plus it'll mess up title destruction. + scope:attacker = { highest_held_title_tier >= tier_empire } + } + + on_invalidated = { + if = { + limit = { exists = scope:attacker.player_heir } + scope:attacker.player_heir = { + if = { + limit = { + culture = culture:german + faith = { has_doctrine = unreformed_faith_doctrine } + } + } + #Give scope:attacker back their ability to declare a migration in the event of invalidation. + add_character_flag = undertaking_visigothic_migration + } + } + } - modifier = { - add = 999 - exists = this - exists = character:168137 - this = character:168137 - } - modifier = { - add = 999 - exists = this - exists = character:200290 #Atawulf - this = character:200290 #Arawulf - } - modifier = { - add = 999 - exists = this - exists = character:180618 #Bahram - this = character:180618 #Bahram - } - modifier = { - add = 999 - exists = this - exists = character:997004 #Childeric - this = character:997004 #Childeric - } - modifier = { - add = 999 - exists = this - exists = character:997009 #Theodoric Meroving - this = character:997009 #Theodoric Meroving - } - modifier = { - add = 999 - exists = this - exists = character:997011 #Chlodomir - this = character:997011 #Chlodomir - } + on_invalidated_desc = msg_invasion_war_invalidated_message + + on_declaration = { + on_declared_war = yes + #Give scope:attacker some armies to ensure success & use up their free invasion. + scope:attacker = { + remove_character_flag = undertaking_visigothic_migration + #One army to conquer. + spawn_army = { + name = event_troop_default_name + levies = migration_army_levies_very_large + men_at_arms = { + type = pikemen_unit + stacks = migration_army_maa_very_large + } + men_at_arms = { + type = bowmen + stacks = migration_army_maa_large + } + location = scope:attacker.capital_province + uses_supply = no + war = scope:war + inheritable = yes + } + #And one army to hold. + spawn_army = { + name = event_troop_default_name + levies = migration_army_levies_large + men_at_arms = { + type = pikemen_unit + stacks = migration_army_maa_very_large + } + location = scope:attacker.capital_province + uses_supply = no + inheritable = yes + } + } + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:attacker = { is_local_player = yes } + } + desc = visigothic_invasion_war_victory_desc_attacker + } + desc = visigothic_invasion_war_victory_desc + } + triggered_desc = { + trigger = { + scope:attacker = { is_local_player = yes } + } + desc = visigothic_invasion_war_warning_desc + } + } + + on_victory = { + # Legitimacy + add_legitimacy_attacker_victory_effect = yes + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_high_effect = yes } + scope:attacker = { show_pow_release_message_effect = yes } + #If the Mogyers aren't independent, make them so. + #Take lands within Pannonia. + hidden_effect = { + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = yes + } + setup_invasion_cb = { + titles = target_titles + attacker = scope:attacker + defender = scope:defender + change = scope:change + take_occupied = no + } + every_in_list = { + list = target_titles + + # Personally seize all duchy titles in k_hungary AND duchy titles personally held by the target king. + every_in_de_jure_hierarchy = { + limit = { + tier = tier_kingdom + special_invasion_cb_seize_land_in_region_trigger = { + TARGET_REGION = custom_roman_illyricum + TARGET_EMPIRE = e_italy + } + } + if = { + limit = { + exists = holder + holder = { + exists = top_liege + top_liege = scope:defender + + # Vassal players in Hungary get to keep their holdings, so they can play as vassals of the new king instead of game-overing. + NAND = { + NOT = { this = top_liege } + is_ai = no + } + } + } + custom_description = { + text = custom_seize_title_and_below_de_jure + subject = scope:attacker + object = this + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + + # Grab the counties that go with the duchies, too. + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + exists = holder + holder = { + top_liege = scope:defender + + # Vassal players in Hungary get to keep their holdings, so they can play as vassals of the new king instead of game-overing. + NAND = { + NOT = { this = top_liege } + is_ai = no + } + } + } + hidden_effect = { + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + add_to_temporary_list = county_titles_under_transfer + } + } + } + } + resolve_title_and_vassal_change = scope:change + } + + #Start processing the Hungarian-specific effects. + scope:attacker = { + visigothic_rebellion_scripted_effect = { INVADER = scope:attacker } + } + + # Attacker gets Prestige Experience, Defender loses Prestige, all other participants gain Prestige based on their war contribution. + modify_all_participants_fame_values = { + WINNER = scope:attacker + LOSER = scope:defender + FAME_BASE = scope:cb_prestige_factor # Set by 'setup_invasion_cb' + IS_RELIGIOUS_WAR = no + WINNER_FAME_SCALE = 10 + LOSER_FAME_SCALE = -10 + WINNER_ALLY_FAME_SCALE = 10 + LOSER_ALLY_FAME_SCALE = 10 + } + + # Truce + add_truce_attacker_victory_effect = yes + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = invasion_war_white_peace_desc_defender + } + desc = invasion_war_white_peace_desc + } + } + + on_white_peace = { + #EP2 accolade glory gain for doing ok against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } + scope:defender = { accolade_defender_war_end_glory_gain_med_effect = yes } + scope:attacker = { show_pow_release_message_effect = yes } + # Prestige for the attacker's war allies + add_from_contribution_attackers = { + prestige = major_prestige_value + opinion = { + modifier = contributed_in_war + } + } + + # Prestige for the defender's war allies + add_from_contribution_defenders = { + prestige = major_prestige_value + opinion = { + modifier = contributed_in_war + } + } + + # Truce + add_truce_white_peace_effect = yes + + scope:attacker = { + add_prestige = mongol_invasion_cb_prestige_white_peace + } + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = invasion_war_white_peace_desc_defender + } + desc = invasion_war_white_peace_desc + } + } + + on_defeat = { + # Legitimacy + add_legitimacy_attacker_defeat_effect = yes + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_attacker_war_end_glory_gain_high_effect = yes } + scope:attacker = { show_pow_release_message_effect = yes } + + # Prestige loss for the attacker + scope:attacker = { + pay_short_term_gold = { + gold = 5 + target = scope:defender + yearly_income = yes + } + add_prestige = { + value = massive_prestige_value + multiply = -1.0 + } + } + + # Attacker loses Prestige, all other war participants gain Prestige (Defender gains full prestige, all allies on both sides gain based on war contribution). + modify_all_participants_fame_values = { + WINNER = scope:defender + LOSER = scope:attacker + FAME_BASE = scope:cb_prestige_factor # Set by 'setup_claim_cb' + IS_RELIGIOUS_WAR = no + WINNER_FAME_SCALE = 10 + LOSER_FAME_SCALE = -10 + WINNER_ALLY_FAME_SCALE = 10 + LOSER_ALLY_FAME_SCALE = 10 + } + + add_truce_attacker_defeat_effect = yes + + scope:attacker = { + save_temporary_scope_as = loser + } + on_lost_aggression_war_discontent_loss = yes + } + + transfer_behavior = transfer + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + transfer_behavior = transfer + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "HUNGARIAN_INVASION_WAR_NAME" + war_name_base = "HUNGARIAN_INVASION_WAR_NAME_BASE" + cb_name = "HUNGARIAN_INVASION_CB_NAME" + + interface_priority = 100 + +} } +} + +"common/on_action/tfe_struggle_on_actions.txt" = { { - modifier = { - add = 999 - exists = this - exists = character:3924 #emir_yahya - this = character:3924 #emir_yahya - } - modifier = { - add = 999 - exists = this - exists = character:106000 #king_antso - this = character:106000 #king_antso - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_alexander_oltner - this = character:easteregg_alexander_oltner - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_ismael_serrano - this = character:easteregg_ismael_serrano - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_christian_daflos - this = character:easteregg_christian_daflos - } - modifier = { - add = 999 - exists = this - exists = character:70517 #Leo - this = character:70517 #Leo - } - modifier = { - add = 999 - exists = this - exists = character:mauro_roman_kings_02 #Massonas - this = character:mauro_roman_kings_02 #Massonas - } +tfe_eastern_iranian_struggle_starting_events = { + events = { + neutral_struggle.0001 + eastern_iranian_struggle.0003 + } +} + } +} + +"common/script_values/TFE_struggle_values.txt" = { + { + struggle:eastern_iranian_struggle = { + every_involved_ruler = { + limit = { + NOT = { this = root } + is_independent_ruler = yes + primary_title = { + is_mercenary_company = no + is_holy_order = no + tier >= tier_kingdom + } + } + add = 1 + } + } + } + + { + struggle:eastern_iranian_struggle = { + every_involved_ruler = { + limit = { + NOT = { this = root } + is_independent_ruler = yes + primary_title = { + is_mercenary_company = no + is_holy_order = no + } + } + add = 1 + } + } } + { - modifier = { - add = 999 - exists = this - exists = character:205141 #Ceredig - this = character:205141 #Ceredig - } - modifier = { - add = 999 - exists = this - exists = character:70512 #Justinian - this = character:70512 #Justinian - } - modifier = { - add = 999 - exists = this - exists = character:cappadocia_07 #Ioannes - this = character:cappadocia_07 #Ioannes - } + struggle:eastern_iranian_struggle = { + every_involved_ruler = { + limit = { + NOT = { this = root } + is_independent_ruler = yes + primary_title = { is_holy_order = no } + primary_title = { is_mercenary_company = no } + save_temporary_scope_as = this_character + OR = { + root = { has_strong_hook = scope:this_character } + opinion = { + target = root + value >= struggle_persia_ending_compromise_decision_opinion_value + } + } + } + add = 1 + } + } } + { - modifier = { - add = 999 - exists = this - exists = character:quadi_04 # Hermerich of the Quadi - this = character:quadi_04 # Hermerich of the Quadi - } + every_county_in_region = { + region = TFE_eastern_iranian_struggle_region + limit = { + holder.top_liege = { + NOT = { + any_character_struggle = { + involvement = involved + is_struggle_type = eastern_iranian_struggle + } + } + } + } + add = 1 } + } + { - modifier = { - add = 400 - exists = this - exists = character:83355 #petty_king_murchad - this = character:83355 #petty_king_murchad - } - modifier = { - add = 999 - exists = this - exists = character:109500 #king_garcia - this = character:109500 #king_garcia - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_henrik_fahraeus - this = character:easteregg_henrik_fahraeus - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_jakub_potapczyk - this = character:easteregg_jakub_potapczyk - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_petter_lundh - this = character:easteregg_petter_lundh - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_max_weltz - this = character:easteregg_max_weltz - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_max_collin - this = character:easteregg_max_collin - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_martin_anward - this = character:easteregg_martin_anward - } - modifier = { - add = 999 - exists = this - exists = character:6392 #charlemagne - this = character:6392 #charlemagne - } + every_county_in_region = { + region = TFE_eastern_iranian_struggle_region + limit = { + holder.top_liege = { + NOT = { + any_character_struggle = { + involvement = involved + is_struggle_type = eastern_iranian_struggle + } + } + } + } + add = 1 + } + } +} + +"common/scripted_effects/TFE_eastern_iranian_struggle_scripted_effects.txt" = { + { +TFE_eastern_iranian_struggle_ending_involved_list_effect = { + save_scope_as = struggle_ender + struggle:eastern_iranian_struggle = { + every_involved_ruler = { + limit = { + is_independent_ruler = yes + primary_title = { is_mercenary_company = no } + } + add_to_list = struggle_involvees + } + } + # Add all involved cultures with counties to a list, for war checks + TFE_eastern_iranian_struggle_ending_culture_list_effect = yes + # Add all involved faiths with counties to a list, for marriage and holy war checks + TFE_eastern_iranian_struggle_ending_faith_list_effect = yes +} + +# Add all Involved cultures with counties to a list +TFE_eastern_iranian_struggle_ending_culture_list_effect = { + every_culture_global = { + limit = { + save_temporary_scope_as = this_culture + struggle:eastern_iranian_struggle = { is_culture_involved_in_struggle = scope:this_culture } + culture_number_of_counties > 0 + } + save_scope_as = culture_scope + add_to_global_variable_list = { + name = TFE_eastern_iranian_struggle_ending_culture_list + target = scope:culture_scope + } + } +} + +# Add all Involved independent rulers to a list +TFE_eastern_iranian_struggle_ending_involved_list_effect = { + save_scope_as = struggle_ender + struggle:eastern_iranian_struggle = { + every_involved_ruler = { + limit = { + is_independent_ruler = yes + primary_title = { is_mercenary_company = no } + } + add_to_list = struggle_involvees + } + } + # Add all involved cultures with counties to a list, for war checks + TFE_eastern_iranian_struggle_ending_culture_list_effect = yes + # Add all involved faiths with counties to a list, for marriage and holy war checks + TFE_eastern_iranian_struggle_ending_faith_list_effect = yes +} + +# Add all Involved faiths with counties to a list +TFE_eastern_iranian_struggle_ending_faith_list_effect = { + every_religion_global = { + limit = { + any_faith = { + save_temporary_scope_as = this_faith + struggle:eastern_iranian_struggle = { is_faith_involved_in_struggle = scope:this_faith } + num_county_followers > 0 + } + } + every_faith = { + limit = { + struggle:eastern_iranian_struggle = { is_faith_involved_in_struggle = prev } + num_county_followers > 0 + } + save_scope_as = faith_scope + add_to_global_variable_list = { + name = TFE_eastern_iranian_struggle_ending_faith_list + target = scope:faith_scope + } + } + } +} + + + + +TFE_eastern_iranian_struggle_compromise_de_jure_effect = { + + # Existing Kingdoms + # d_khorezm + if = { + limit = { + NOT = { + title:k_oghuz_il = { + target_is_de_jure_liege_or_above = title:e_turan + } + } + + } + title:k_oghuz_il = { + set_de_jure_liege_title = title:e_turan + } + } + if = { + limit = { + exists = title:d_khorezm.holder + NOT = { exists = title:k_oghuz_il.holder } + NOT = { + title:d_khorezm.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_khorezm.holder = { + get_title = title:k_oghuz_il + } + } + + # d_chah + if = { + limit = { + NOT = { + title:k_syr_darya = { + target_is_de_jure_liege_or_above = title:e_turan + } + } + + } + title:k_syr_darya = { + set_de_jure_liege_title = title:e_turan + } + } + if = { + limit = { + exists = title:d_chah.holder + NOT = { exists = title:k_syr_darya.holder } + NOT = { + title:d_chah.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_chah.holder = { + get_title = title:k_syr_darya + } + } + + # d_soghd + if = { + limit = { + NOT = { + title:k_transoxiana = { + target_is_de_jure_liege_or_above = title:e_turan + } + } + + } + title:k_transoxiana = { + set_de_jure_liege_title = title:e_turan + } + } + if = { + limit = { + exists = title:d_soghd.holder + NOT = { exists = title:k_transoxiana.holder } + NOT = { + title:d_soghd.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_soghd.holder = { + get_title = title:k_transoxiana + } + } + + # d_nishapur + if = { + limit = { + NOT = { + title:k_khorasan = { + target_is_de_jure_liege_or_above = title:e_turan + } + } + + } + title:k_khorasan = { + set_de_jure_liege_title = title:e_turan + } + } + if = { + limit = { + exists = title:d_nishapur.holder + NOT = { exists = title:k_khorasan.holder } + NOT = { + title:d_nishapur.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_nishapur.holder = { + get_title = title:k_khorasan + } + } + + + # d_kabul + if = { + limit = { + NOT = { + title:k_kabulistan = { + target_is_de_jure_liege_or_above = title:e_turan + } + } + + } + title:k_kabulistan = { + set_de_jure_liege_title = title:e_turan + } + } + if = { + limit = { + exists = title:d_kabul.holder + NOT = { exists = title:k_kabulistan.holder } + NOT = { + title:d_kabul.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_kabul.holder = { + get_title = title:k_kabulistan + } + } + + # d_gandhara + if = { + limit = { + NOT = { + title:k_punjab = { + target_is_de_jure_liege_or_above = title:e_turan + } + } + + } + title:k_punjab = { + set_de_jure_liege_title = title:e_turan + } + } + if = { + limit = { + exists = title:d_gandhara.holder + NOT = { exists = title:k_punjab.holder } + NOT = { + title:d_gandhara.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_gandhara.holder = { + get_title = title:k_punjab + } + } + + # d_kasmira + if = { + limit = { + NOT = { + title:k_kashmir = { + target_is_de_jure_liege_or_above = title:e_turan + } + } + + } + title:k_kashmir = { + set_de_jure_liege_title = title:e_turan + } + } + if = { + limit = { + exists = title:d_kasmira.holder + NOT = { exists = title:k_kashmir.holder } + NOT = { + title:d_kasmira.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_kasmira.holder = { + get_title = title:k_kashmir + } + } + + + # New Kingdoms + # d_merv + title:d_merv = { + set_de_jure_liege_title = title:k_merv_struggle + } + title:k_merv_struggle = { + set_de_jure_liege_title = title:e_turan } - { - modifier = { - add = 999 - exists = this - exists = character:522 #duke_vratislav - this = character:522 #duke_vratislav - } - modifier = { - add = 999 - exists = this - exists = character:108500 #king_alfonso - this = character:108500 #king_alfonso - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_sean_hughes - this = character:easteregg_sean_hughes - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_paul_depre - this = character:easteregg_paul_depre - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_zack_holmgren - this = character:easteregg_zack_holmgren - } - modifier = { - add = 999 - exists = this - exists = character:159431 #Conan Meriadoc - this = character:159431 #tiberius - } - modifier = { - add = 999 - exists = this - exists = character:999103 #king_alaric - this = character:999103 #king_alaric - } - modifier = { - add = 999 - exists = this - exists = character:159038 #Coel - this = character:159038 #ACoel - } - modifier = { - add = 999 - exists = this - exists = character:constantinus_05 #Ambrosius - this = character:constantinus_05 #Ambrosius - } - modifier = { - add = 999 - exists = this - exists = character:mauri_42 #Iabdas - this = character:mauri_42 #Iabdas - } - modifier = { - add = 999 - exists = this - exists = character:997002 #Chlodio - this = character:997002 #Chlodio - } + if = { + limit = { + exists = title:d_merv.holder + NOT = { + title:d_merv.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_merv.holder = { + get_title = title:k_merv_struggle + } } - { - modifier = { - add = 999 - exists = this - exists = character:easteregg_james_beaumont - this = character:easteregg_james_beaumont - } - modifier = { - add = 999 - exists = this - exists = character:maldras_06 #Hermenerich - this = character:maldras_06 #Hermenerich - } - modifier = { - add = 999 - exists = this - exists = character:982001 #Abu Karib - this = character:982001 #Abu Karib - } - modifier = { - add = 999 - exists = this - exists = character:xionite_001 #Kidara - this = character:xionite_001 #Kidara - } - modifier = { - add = 999 - exists = this - exists = character:samo_01 #Samo - this = character:samo_01 #Samo - } + + # d_ghur + title:d_ghur = { + set_de_jure_liege_title = title:k_ghur_struggle } - { - modifier = { - add = 999 - exists = this - exists = character:90104 #charles_the_bald - this = character:90104 #charles_the_bald - } - modifier = { - add = 999 - exists = this - exists = character:1316 #emperor_heinrich - this = character:1316 #emperor_heinrich - } - modifier = { - add = 999 - exists = this - exists = character:992016 #theodoric_the_great - this = character:992016 #theodoric_the_great - } - modifier = { - add = 999 - exists = this - exists = character:83432 #Eochaid - this = character:83432 #Eochaid - } + title:k_ghur_struggle = { + set_de_jure_liege_title = title:e_turan } - { - modifier = { - modifier = { - add = 999 - exists = this - exists = character:easteregg_nils_wadensten - this = character:easteregg_nils_wadensten - } - add = 999 - exists = this - exists = character:900062 #stilicho - this = character:900062 #stilicho - } - modifier = { - add = 999 - exists = this - exists = character:70519 #Imperator Arcadius I - this = character:70519 #Imperator Arcadius I - } - modifier = { - add = 999 - exists = this - exists = character:145227 #Imperator Honorius I - this = character:145227 #Imperator Honorius I - } - modifier = { - add = 999 - exists = this - exists = character:nepos_02 #Nepos - this = character:nepos_02 #Nepos - } - modifier = { - add = 999 - exists = this - exists = character:145237 #julian_the_apostate - this = character:145237 #julian_the_apostate - } - modifier = { - add = 999 - exists = this - exists = character:londinium_01 #Riothamus - this = character:londinium_01 #Riothamus - } - modifier = { - add = 999 - exists = this - exists = character:arsacid_58 #vramshapuh - this = character:arsacid_58 #vramshapuh - } - modifier = { - add = 999 - exists = this - exists = character:vandals_005 #Hilderic - this = character:vandals_005 #Hilderic - } - modifier = { - add = 999 - exists = this - exists = character:992022 #Theodahad - this = character:992022 #Theodahad - } - modifier = { - add = 999 - exists = this - exists = character:991004 #Mundus - this = character:991004 #Mundus - } - modifier = { - add = 999 - exists = this - exists = character:greek_20 #Proklos - this = character:greek_20 #Proklos - } + if = { + limit = { + exists = title:d_ghur.holder + NOT = { + title:d_ghur.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_ghur.holder = { + get_title = title:k_ghur_struggle + } + } + + # d_herat + title:d_herat = { + set_de_jure_liege_title = title:k_herat_struggle + } + title:k_herat_struggle = { + set_de_jure_liege_title = title:e_turan + } + if = { + limit = { + exists = title:d_herat.holder + NOT = { + title:d_herat.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_herat.holder= { + get_title = title:k_herat_struggle + } + } + + # d_balkh + title:d_balkh = { + set_de_jure_liege_title = title:k_balkh_struggle + } + title:k_balkh_struggle = { + set_de_jure_liege_title = title:e_turan + } + if = { + limit = { + exists = title:d_balkh.holder + NOT = { + title:d_balkh.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_balkh.holder = { + get_title = title:k_balkh_struggle + } + } + + # d_nasa + title:d_nasa = { + set_de_jure_liege_title = title:k_nasa_struggle + } + title:k_nasa_struggle = { + set_de_jure_liege_title = title:e_turan + } + if = { + limit = { + exists = title:d_nasa.holder + NOT = { + title:d_nasa.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_nasa.holder = { + get_title = title:k_nasa_struggle + } + } + + # d_kohestan + title:d_kohestan = { + set_de_jure_liege_title = title:k_kohestan_struggle + } + title:k_kohestan_struggle = { + set_de_jure_liege_title = title:e_turan + } + if = { + limit = { + exists = title:d_kohestan.holder + NOT = { + title:d_kohestan.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_kohestan.holder = { + get_title = title:k_kohestan_struggle + } + } + + # d_badakhshan + title:d_badakhshan = { + set_de_jure_liege_title = title:k_badakhshan_struggle + } + title:k_badakhshan_struggle = { + set_de_jure_liege_title = title:e_turan + } + if = { + limit = { + exists = title:d_badakhshan.holder + NOT = { + title:d_badakhshan.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_badakhshan.holder = { + get_title = title:k_badakhshan_struggle + } } - { - modifier = { - add = 999 - exists = this - exists = character:nuvelan_11 #Gildo - this = character:nuvelan_11 #Gildo + + # d_khuttal + title:d_khuttal = { + set_de_jure_liege_title = title:k_khuttal_struggle + } + title:k_khuttal_struggle = { + set_de_jure_liege_title = title:e_turan + } + if = { + limit = { + exists = title:d_khuttal.holder + NOT = { + title:d_khuttal.holder = { + any_held_title = { tier = tier_kingdom } + } + } } - modifier = { - add = 999 - exists = this - exists = character:aksum_16 #Ouazeba - this = character:aksum_16 #Ouazeba + title:d_khuttal.holder = { + get_title = title:k_khuttal_struggle } } - { - modifier = { - add = 999 - exists = this - exists = character:easteregg_magne_skjaeran - this = character:easteregg_magne_skjaeran - } + + # d_osrushana + title:d_osrushana = { + set_de_jure_liege_title = title:k_osrushana_struggle } - { - modifier = { - modifier = { - add = 999 - exists = this - exists = character:163111 #ivar_the_boneless - this = character:163111 #ivar_the_boneless - } - modifier = { - add = 999 - exists = this - exists = character:102531 #harald_hardrade - this = character:102531 #harald_hardrade - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_joacim_carlberg - this = character:easteregg_joacim_carlberg - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_struan_mccallum - this = character:easteregg_struan_mccallum + title:k_osrushana_struggle = { + set_de_jure_liege_title = title:e_turan + } + if = { + limit = { + exists = title:d_osrushana.holder + NOT = { + title:d_osrushana.holder = { + any_held_title = { tier = tier_kingdom } + } } - add = 999 - exists = this - exists = character:999105 #athaulf - this = character:999105 #athaulf - } - modifier = { - add = 999 - exists = this - exists = character:997003 #Merovech - this = character:997003 #Merovech - } - modifier = { - add = 999 - exists = this - exists = character:992003 #Hermanaric - this = character:992003 #Hermanaric - } + } + title:d_osrushana.holder = { + get_title = title:k_osrushana_struggle + } } - { - modifier = { - add = 999 - exists = this - exists = character:163110 #sigurdr_snake_in_the_eye - this = character:163110 #sigurdr_snake_in_the_eye - } - modifier = { - add = 999 - exists = this - exists = character:144000 #haraldr_fairhair - this = character:144000 #haraldr_fairhair - } - modifier = { - add = 999 - exists = this - exists = character:40605 #rurik_rurikid - this = character:40605 #rurik_rurikid - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_jonas_wickerstrom - this = character:easteregg_jonas_wickerstrom - } - modifier = { - add = 999 - exists = this - exists = character:900016 #faramund - this = character:900016 #faramund - } + + # d_ferghana + title:d_ferghana = { + set_de_jure_liege_title = title:k_ferghana_struggle } - { - modifier = { - add = 999 - exists = this - exists = character:163108 #bjorn_ironside - this = character:163108 #bjorn_ironside - } - modifier = { - add = 999 - exists = this - exists = character:140 #william_the_bastard - this = character:140 #william_the_bastard - } - modifier = { - add = 999 - exists = this - exists = character:101515 #king_svend - this = character:101515 #king_svend - } - modifier = { - add = 999 - exists = this - exists = character:42018 #karlmann - this = character:42018 #karlmann - } + title:k_ferghana_struggle = { + set_de_jure_liege_title = title:e_turan } - { - modifier = { - add = 999 - exists = this - exists = character:159137 #almos_arpad - this = character:159137 #almos_arpad - } + if = { + limit = { + exists = title:d_ferghana.holder + NOT = { + title:d_ferghana.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_ferghana.holder = { + get_title = title:k_ferghana_struggle + } } - { - modifier = { - add = 999 - exists = this - exists = character:alchonid_005 #Khingila - this = character:alchonid_005 #Khingila - } - modifier = { - add = 999 - exists = this - exists = character:hephthalite_misc_017 #Katulf - this = character:hephthalite_misc_017 #Katulf - } + + # d_uzboy + title:d_uzboy = { + set_de_jure_liege_title = title:k_uzboy_struggle } - { - modifier = { - add = 999 - exists = this - exists = character:belisarius_001 #Belisarius - this = character:belisarius_001 #Belisarius - } + title:k_uzboy_struggle = { + set_de_jure_liege_title = title:e_turan } - { - modifier = { - add = 999 - exists = this - exists = character:200284 #euric - this = character:200284 #euric - } - modifier = { - add = 999 - exists = this - exists = character:180628 #Khosrau - this = character:180628 #Khosrau - } - modifier = { - add = 999 - exists = this - exists = character:mauri_36 #Masties - this = character:mauri_36 #Masties - } + if = { + limit = { + exists = title:d_uzboy.holder + NOT = { + title:d_uzboy.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_uzboy.holder = { + get_title = title:k_uzboy_struggle + } + } + + # d_zabulistan + title:d_zabulistan = { + set_de_jure_liege_title = title:k_zabulistan_struggle + } + title:k_zabulistan_struggle = { + set_de_jure_liege_title = title:e_turan + } + if = { + limit = { + exists = title:d_zabulistan.holder + NOT = { + title:d_zabulistan.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_zabulistan.holder = { + get_title = title:k_zabulistan_struggle + } + } + + # d_syr_darya + title:d_syr_darya = { + set_de_jure_liege_title = title:k_syr_darya_struggle + } + title:k_syr_darya_struggle = { + set_de_jure_liege_title = title:e_turan + } + if = { + limit = { + exists = title:d_syr_darya.holder + NOT = { + title:d_syr_darya.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_syr_darya.holder = { + get_title = title:k_syr_darya_struggle + } + } + + # d_muyunkum + title:d_muyunkum = { + set_de_jure_liege_title = title:k_muyunkum_struggle + } + title:k_muyunkum_struggle = { + set_de_jure_liege_title = title:e_turan + } + if = { + limit = { + exists = title:d_muyunkum.holder + NOT = { + title:d_muyunkum.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_muyunkum.holder = { + get_title = title:k_muyunkum_struggle + } + } + + # d_sistan + title:d_sistan = { + set_de_jure_liege_title = title:k_sistan_struggle + } + title:k_sistan_struggle = { + set_de_jure_liege_title = title:e_turan + } + if = { + limit = { + exists = title:d_sistan.holder + NOT = { + title:d_sistan.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_sistan.holder = { + get_title = title:k_sistan_struggle + } + } + + # d_aral_il + title:d_aral_il = { + set_de_jure_liege_title = title:k_aral_il_struggle + } + title:k_aral_il_struggle = { + set_de_jure_liege_title = title:e_turan + } + if = { + limit = { + exists = title:d_aral_il.holder + NOT = { + title:d_aral_il.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_aral_il.holder = { + get_title = title:k_aral_il_struggle + } + } + + # d_transcaspiana + title:d_transcaspiana = { + set_de_jure_liege_title = title:k_transcaspiana_struggle + } + title:k_transcaspiana_struggle = { + set_de_jure_liege_title = title:e_turan + } + if = { + limit = { + exists = title:d_transcaspiana.holder + NOT = { + title:d_transcaspiana.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_transcaspiana.holder = { + get_title = title:k_transcaspiana_struggle + } } - { - modifier = { - add = 999 - exists = this - exists = character:danis0005 - this = character:danis0005 - } - modifier = { - add = 999 - exists = this - exists = character:surunbaqi0001 - this = character:surunbaqi0001 - } - modifier = { - add = 999 - exists = this - exists = character:107590 #el_cid - this = character:107590 #el_cid - } - modifier = { - add = 999 - exists = this - exists = character:159012 #Cadwallon - this = character:159012 #Cadwallon - } - modifier = { - add = 999 - exists = this - exists = character:ashina_03 #Tuwu - this = character:ashina_03 #Tuwu - } - modifier = { - add = 999 - exists = this - exists = character:ashina_05 #Istemi - this = character:ashina_05 #Istemi - } + # d_jemba + title:d_jemba = { + set_de_jure_liege_title = title:k_jemba_struggle } - { - modifier = { - add = 999 - exists = this - exists = character:200280 #Theodis - this = character:200280 #Theodis - } - modifier = { - add = 999 - exists = this - exists = character:ashina_04 #Bumin - this = character:ashina_04 #Bumin - } - modifier = { - add = 999 - exists = this - exists = character:waegmunding_2 #Beowulf - this = character:waegmunding_2 #Beowulf - } + title:k_jemba_struggle = { + set_de_jure_liege_title = title:e_turan } - { - modifier = { - add = 999 - exists = this - exists = character:996002 #odoacer - this = character:996002 #odoacer - } - modifier = { - add = 999 - exists = this - exists = character:992023 #Athalaric - this = character:992023 #Athalaric - } - modifier = { - add = 999 - exists = this - exists = character:992063 #Fritigern - this = character:992063 #Fritigern - } + if = { + limit = { + exists = title:d_jemba.holder + NOT = { + title:d_jemba.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_jemba.holder = { + get_title = title:k_jemba_struggle + } } - { - modifier = { - add = 999 - exists = this - exists = character:900016 #Faramund - this = character:900016 #Faramund - } - modifier = { - add = 999 - exists = character:990006 #Attila - this = character:990006 #Attila - } - modifier = { - add = 999 - exists = this - exists = character:997012 #Childebert - this = character:997012 #Childebert - } + + # d_pamir + title:d_pamir = { + set_de_jure_liege_title = title:k_pamir_struggle } - { - modifier = { - add = 999 - exists = this - exists = character:vandals_012 #Gelimer - this = character:vandals_012 #Gelimer - } - modifier = { - add = 999 - exists = this - exists = character:marshalnsc - this = character:marshalnsc - } + title:k_pamir_struggle = { + set_de_jure_liege_title = title:e_turan } - { - modifier = { - add = 999 - exists = this - exists = character:168314 #waldrada - this = character:168314 #waldrada - } - modifier = { - add = 999 - exists = this - exists = character:1183 #empress_bertha - this = character:1183 #empress_bertha - } + if = { + limit = { + exists = title:d_pamir.holder + NOT = { + title:d_pamir.holder = { + any_held_title = { tier = tier_kingdom } + } + } + } + title:d_pamir.holder = { + get_title = title:k_pamir_struggle + } } - { - modifier = { - add = 999 - exists = this - exists = character:251187 #daurama_daura - this = character:251187 #daurama_daura - } + + +} + + + +tfe_iranian_struggle_compromise_tooltip_effect = { + # De Jure Kingdoms will become De Jure Empires + custom_tooltip = tfe_iranian_struggle_compromise_new_de_jure_kingdoms_tt + # custom_tooltip = struggle_compromise_duchy_transfer_tt + # custom_tooltip = tfe_iranian_struggle_compromise_create_new_empires_tt + # if = { + # limit = { + # struggle:eastern_iranian_struggle = { + # any_involved_ruler = { + # count > 1 + # is_independent_ruler = yes + # primary_title = { is_mercenary_company = no } + # } + # } + # # Every Involved ruler gets a 10 year truce with every other + # custom_tooltip = fp2_struggle_compromise_truce_tt + # } + # } + # custom_tooltip = fp2_struggle_compromise_war_cost_tt +} + + + + + +tfe_struggle_eastern_iranian_compromise_tooltip_effect = { + # New de jure Kingdoms + tfe_iranian_struggle_compromise_tooltip_effect = yes + if = { + limit = { + struggle:eastern_iranian_struggle = { + any_involved_ruler = { + count > 1 + is_independent_ruler = yes + primary_title = { is_mercenary_company = no } + } + } + # Every Involved ruler gets a 10 year truce with every other + custom_tooltip = fp2_struggle_compromise_truce_tt + } } - { - modifier = { - add = 999 - exists = this - exists = character:73683 - this = character:73683 - } - modifier = { - add = 999 - exists = this - exists = character:vandals_003 - this = character:vandals_003 - } + custom_tooltip = fp2_struggle_compromise_war_cost_tt +} + + +tfe_struggle_eastern_iranian_compromise_modifier_rewards_effect = { + struggle:eastern_iranian_struggle = { + show_as_tooltip = { + every_involved_ruler = { + limit = { this = root } + custom = fp2_struggle_compromise_house_rewards_tt + struggle_eastern_iranian_compromise_modifier_rewards_personal_house_effect = yes + } + every_involved_ruler = { + limit = { this = root } + custom = fp2_struggle_compromise_defensive_rewards_tt + struggle_eastern_iranian_compromise_modifier_rewards_personal_county_effect = yes + } + } + hidden_effect = { + every_involved_ruler = { + limit = { + is_independent_ruler = yes + primary_title = { is_mercenary_company = no } + exists = house + NOT = { + house = { has_house_modifier = struggle_eastern_iranian_compromise_house_reward_modifier } + } + } + struggle_eastern_iranian_compromise_modifier_rewards_personal_house_effect = yes + } + every_involved_ruler = { + limit = { + is_independent_ruler = yes + primary_title = { is_mercenary_company = no } + } + struggle_eastern_iranian_compromise_modifier_rewards_personal_county_effect = yes + } + } } - { - modifier = { - add = 999 - exists = this - exists = character:73759 - this = character:73759 - } +} + + + + +# Add house modifiers to a single character (used in tooltips); +struggle_eastern_iranian_compromise_modifier_rewards_personal_house_effect = { + house = { + custom_tooltip = struggle_eastern_iranian_compromise_house_enforce_truce_rewards_tt + add_house_modifier = { + modifier = struggle_eastern_iranian_compromise_house_reward_modifier + } + } +} + +# Add county modifiers to a single character (used in tooltips) +struggle_eastern_iranian_compromise_modifier_rewards_personal_county_effect = { + capital_county = { + add_county_modifier = { #TODO_CD_FP2 (JP) check this is the right scope + modifier = struggle_eastern_iranian_compromise_defensive_reward_modifier + } + } +} + + + + + + + + + + + + + + + + + + + + +persia_struggle_compromise_duchies_to_kingdoms_effect = { + hidden_effect = { + title:e_persia = { + # Cycle through de jure duchies held by independent dukes + every_in_de_jure_hierarchy = { + # Prefer primary titles + limit = { + this = this.holder.primary_title + fp2_struggle_ending_compromise_independent_duchy_trigger = yes + any_in_de_jure_hierarchy = { + tier = tier_county + title_province = { + geographical_region = TFE_eastern_iranian_struggle_region + } + } + } + # Then capital titles + alternative_limit = { + this.title_capital_county = this.kingdom.title_capital_county + fp2_struggle_ending_compromise_independent_duchy_trigger = yes + } + alternative_limit = { fp2_struggle_ending_compromise_independent_duchy_trigger = yes } + save_scope_as = old_title + persia_struggle_compromise_create_new_kingdom_effect = { TYPE = NEW FETCH = scope:old_title } + } + # Cycle through titular duchies held by independent dukes (e.g. Zaragoza) + every_in_list = { + list = titular_iberian_duchies + save_scope_as = special_duchy + if = { + # Independent holder who controls at least 50% a de jure duchy, and no kingdom has the same as that duchy + limit = { fp2_struggle_ending_compromise_titular_trigger = yes } + title:e_persia = { + random_in_de_jure_hierarchy = { + limit = { + tier = tier_duchy + any_direct_de_jure_vassal_title = { + percent >= 0.5 + holder.top_liege = scope:special_duchy.holder + } + } + save_scope_as = old_title + } + } + persia_struggle_compromise_create_new_kingdom_effect = { TYPE = SPECIAL FETCH = scope:special_duchy } + } + } + # Cycle through uncreated de jure duchies to split if needed (e.g. Coimbra) + every_in_de_jure_hierarchy = { + limit = { fp2_struggle_ending_compromise_split_duchy_trigger = yes } + save_scope_as = old_title + persia_struggle_compromise_create_new_kingdom_effect = { TYPE = NEW FETCH = scope:old_title } + } + } + title:e_turan = { + # Cycle through de jure duchies held by independent dukes + every_in_de_jure_hierarchy = { + # Prefer primary titles + limit = { + this = this.holder.primary_title + fp2_struggle_ending_compromise_independent_duchy_trigger = yes + any_in_de_jure_hierarchy = { + tier = tier_county + title_province = { + geographical_region = TFE_eastern_iranian_struggle_region + } + } + } + # Then capital titles + alternative_limit = { + this.title_capital_county = this.kingdom.title_capital_county + fp2_struggle_ending_compromise_independent_duchy_trigger = yes + } + alternative_limit = { fp2_struggle_ending_compromise_independent_duchy_trigger = yes } + save_scope_as = old_title + turan_struggle_compromise_create_new_kingdom_effect = { TYPE = NEW FETCH = scope:old_title } + } + # Cycle through titular duchies held by independent dukes (e.g. Zaragoza) + every_in_list = { + list = titular_iberian_duchies + save_scope_as = special_duchy + if = { + # Independent holder who controls at least 50% a de jure duchy, and no kingdom has the same as that duchy + limit = { fp2_struggle_ending_compromise_titular_trigger = yes } + title:e_turan = { + random_in_de_jure_hierarchy = { + limit = { + tier = tier_duchy + any_direct_de_jure_vassal_title = { + percent >= 0.5 + holder.top_liege = scope:special_duchy.holder + } + } + save_scope_as = old_title + } + } + turan_struggle_compromise_create_new_kingdom_effect = { TYPE = SPECIAL FETCH = scope:special_duchy } + } + } + # Cycle through uncreated de jure duchies to split if needed (e.g. Coimbra) + every_in_de_jure_hierarchy = { + limit = { fp2_struggle_ending_compromise_split_duchy_trigger = yes } + save_scope_as = old_title + turan_struggle_compromise_create_new_kingdom_effect = { TYPE = NEW FETCH = scope:old_title } + } + } } - { - modifier = { - add = 999 - exists = this - exists = character:73857 - this = character:73857 - } +} - modifier = { - add = 999 - exists = this - exists = character:70292 - this = character:70292 - } +persia_struggle_compromise_create_new_kingdom_effect = { + add_to_list = duchy_kingdom + create_dynamic_title = { + tier = kingdom + name = $TYPE$_CREATED_TITLE_NAME } - { - modifier = { - add = 999 - exists = this - exists = character:73783 - this = character:73783 - } + scope:old_title = { + # Edge case for kingdoms which do not control their own capital duchy + if = { + limit = { + title_capital_county = de_jure_liege.title_capital_county + exists = de_jure_liege.holder + NOT = { holder = de_jure_liege.holder } + } + de_jure_liege = { + # So kingdom has a capital + set_capital_county = this.holder.capital_county + # So titles do not share CoAs + set_coa = this.holder.house + } + } + set_de_jure_liege_title = scope:new_title + } + scope:new_title = { + set_coa = $FETCH$ + set_color_from_title = $FETCH$ + set_capital_county = $FETCH$.title_capital_county + set_de_jure_liege_title = title:e_persia } } - -"common\casus_belli_types\TFE_event_wars.txt" = { - { -independence_war_vandal = { - icon = independence_faction_war - group = event - ai = no # AI targeting is handled through game_rule events. - - allow_hostages = no - allowed_against_character = { - OR = { - scope:attacker = { - liege = scope:defender +turan_struggle_compromise_create_new_kingdom_effect = { + add_to_list = duchy_kingdom + create_dynamic_title = { + tier = kingdom + name = $TYPE$_CREATED_TITLE_NAME + } + scope:old_title = { + # Edge case for kingdoms which do not control their own capital duchy + if = { + limit = { + title_capital_county = de_jure_liege.title_capital_county + exists = de_jure_liege.holder + NOT = { holder = de_jure_liege.holder } } - scope:attacker = { - top_liege = scope:defender + de_jure_liege = { + # So kingdom has a capital + set_capital_county = this.holder.capital_county + # So titles do not share CoAs + set_coa = this.holder.house } } + set_de_jure_liege_title = scope:new_title } + scope:new_title = { + set_coa = $FETCH$ + set_color_from_title = $FETCH$ + set_capital_county = $FETCH$.title_capital_county + set_de_jure_liege_title = title:e_turan + } +} - cost = { - piety = { - value = 0 +persia_struggle_compromise_transfer_duchies_effect = { + title:e_persia = { + while = { + limit = { + any_in_de_jure_hierarchy = { + fp2_struggle_compromise_transfer_duchy_trigger = yes + any_in_de_jure_hierarchy = { + tier = tier_county + title_province = { + geographical_region = TFE_eastern_iranian_struggle_region + } + } + } + } + every_in_de_jure_hierarchy = { + limit = { + fp2_struggle_compromise_transfer_duchy_trigger = yes + any_in_de_jure_hierarchy = { + tier = tier_county + title_province = { + geographical_region = TFE_eastern_iranian_struggle_region + } + } + } + add_to_list = transferred_duchies + # To ensure kingdom's capitals are always inside them + if = { + limit = { title_capital_county = kingdom.title_capital_county } + kingdom = { + save_scope_as = old_kingdom + if = { + limit = { + any_direct_de_jure_vassal_title = { + NOT = { is_in_list = transferred_duchies } + title_capital_county.kingdom = scope:old_kingdom + } + } + random_direct_de_jure_vassal_title = { + limit = { + NOT = { is_in_list = transferred_duchies } + title_capital_county.kingdom = scope:old_kingdom + } + title_capital_county = { save_scope_as = new_capital } + } + set_capital_county = scope:new_capital + } + } + } + if = { + limit = { title_capital_county.holder.top_liege.primary_title.tier = tier_kingdom } + set_de_jure_liege_title = title_capital_county.holder.top_liege.primary_title + } + else = { set_de_jure_liege_title = title_capital_county.holder.top_liege.capital_county.kingdom } + } } - prestige = { - value = 0 + } + title:e_turan = { + while = { + limit = { + any_in_de_jure_hierarchy = { + fp2_struggle_compromise_transfer_duchy_trigger = yes + any_in_de_jure_hierarchy = { + tier = tier_county + title_province = { + geographical_region = TFE_eastern_iranian_struggle_region + } + } + } + } + every_in_de_jure_hierarchy = { + limit = { + fp2_struggle_compromise_transfer_duchy_trigger = yes + any_in_de_jure_hierarchy = { + tier = tier_county + title_province = { + geographical_region = TFE_eastern_iranian_struggle_region + } + } + } + add_to_list = transferred_duchies + # To ensure kingdom's capitals are always inside them + if = { + limit = { title_capital_county = kingdom.title_capital_county } + kingdom = { + save_scope_as = old_kingdom + if = { + limit = { + any_direct_de_jure_vassal_title = { + NOT = { is_in_list = transferred_duchies } + title_capital_county.kingdom = scope:old_kingdom + } + } + random_direct_de_jure_vassal_title = { + limit = { + NOT = { is_in_list = transferred_duchies } + title_capital_county.kingdom = scope:old_kingdom + } + title_capital_county = { save_scope_as = new_capital } + } + set_capital_county = scope:new_capital + } + } + } + if = { + limit = { title_capital_county.holder.top_liege.primary_title.tier = tier_kingdom } + set_de_jure_liege_title = title_capital_county.holder.top_liege.primary_title + } + else = { set_de_jure_liege_title = title_capital_county.holder.top_liege.capital_county.kingdom } + } + } + } +} +# Create new de jure empires from relevant kingdoms +persia_struggle_compromise_kingdoms_to_empires_effect = { + hidden_effect = { + title:e_persia = { + every_in_de_jure_hierarchy = { + limit = { + tier = tier_kingdom + NOT = { + THIS = title:k_mesopotamia + } + any_in_de_jure_hierarchy = { + count >= fp2_struggle_compromise_ending_minimal_empire_size + tier = tier_county + } + any_in_de_jure_hierarchy = { + tier = tier_county + title_province = { + geographical_region = TFE_eastern_iranian_struggle_region + } + } + } + fp2_struggle_compromise_create_new_empire_effect = yes + } + } + title:e_turan = { + every_in_de_jure_hierarchy = { + limit = { + tier = tier_kingdom + NOT = { + THIS = title:k_mesopotamia + } + any_in_de_jure_hierarchy = { + count >= fp2_struggle_compromise_ending_minimal_empire_size + tier = tier_county + } + any_in_de_jure_hierarchy = { + tier = tier_county + title_province = { + geographical_region = TFE_eastern_iranian_struggle_region + } + } + } + fp2_struggle_compromise_create_new_empire_effect = yes + } } } +} - on_declaration = { - on_declared_war = yes - # Remove offending HumSac modifiers. - scope:attacker = { - hidden_effect = { fp1_remove_humsac_offended_counties_effect = yes } +# Distribute remaining Kingdoms to neighboring empires +persia_struggle_compromise_distribute_kingdoms_to_neighbouring_empires_effect = { + hidden_effect = { + title:e_persia = { + every_in_de_jure_hierarchy = { + limit = { + tier = tier_kingdom + NOT = { + THIS = title:k_mesopotamia + } + any_in_de_jure_hierarchy = { + tier = tier_county + title_province = { + geographical_region = TFE_eastern_iranian_struggle_region + } + } + + } + save_scope_as = kingdom_to_distribute + random_title_to_title_neighboring_and_across_water_kingdom = { + limit = { # Prefer land borders + any_this_title_or_de_jure_above = { is_in_list = new_empire_list } + any_title_to_title_neighboring_kingdom = { this = scope:kingdom_to_distribute } + } + alternative_limit = { # Then sea borders + any_this_title_or_de_jure_above = { is_in_list = new_empire_list } + } + weight = { + modifier = { # Value one from Iberia for small empire + add = { + value = 2 + subtract = { + value = 0 + every_in_de_jure_hierarchy = { + add = 0.25 + } + } + min = 0 + } + any_in_de_jure_hierarchy = { + tier = tier_county + title_province = { geographical_region = TFE_eastern_iranian_struggle_region } + } + } + modifier = { # Value smaller empire + add = { + value = 2 + subtract = { + value = 0 + every_in_de_jure_hierarchy = { + limit = { tier = tier_kingdom } + add = 0.5 + } + } + min = 0 + } + } + modifier = { # Value most shared borders + add = { + value = 0 + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + any_neighboring_county = { target_is_de_jure_liege_or_above = scope:kingdom_to_distribute } + } + add = 1 + } + min = 0 + } + } + } + add_to_list = transferred_kingdoms + scope:kingdom_to_distribute = { set_de_jure_liege_title = prev.de_jure_liege } + } + } } - war = { - every_war_attacker = { - if = { - limit = { - OR = { - liege = title:k_africae.holder - AND = { - liege = { - liege = scope:defender + title:e_turan = { + every_in_de_jure_hierarchy = { + limit = { + tier = tier_kingdom + NOT = { + THIS = title:k_mesopotamia + } + any_in_de_jure_hierarchy = { + tier = tier_county + title_province = { + geographical_region = TFE_eastern_iranian_struggle_region + } + } + + } + save_scope_as = kingdom_to_distribute + random_title_to_title_neighboring_and_across_water_kingdom = { + limit = { # Prefer land borders + any_this_title_or_de_jure_above = { is_in_list = new_empire_list } + any_title_to_title_neighboring_kingdom = { this = scope:kingdom_to_distribute } + } + alternative_limit = { # Then sea borders + any_this_title_or_de_jure_above = { is_in_list = new_empire_list } + } + weight = { + modifier = { # Value one from Iberia for small empire + add = { + value = 2 + subtract = { + value = 0 + every_in_de_jure_hierarchy = { + add = 0.25 + } } - NOT = { - faith = liege.faith + min = 0 + } + any_in_de_jure_hierarchy = { + tier = tier_county + title_province = { geographical_region = TFE_eastern_iranian_struggle_region } + } + } + modifier = { # Value smaller empire + add = { + value = 2 + subtract = { + value = 0 + every_in_de_jure_hierarchy = { + limit = { tier = tier_kingdom } + add = 0.5 + } + } + min = 0 + } + } + modifier = { # Value most shared borders + add = { + value = 0 + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + any_neighboring_county = { target_is_de_jure_liege_or_above = scope:kingdom_to_distribute } + } + add = 1 } + min = 0 } } } - add_character_flag = should_become_independent + add_to_list = transferred_kingdoms + scope:kingdom_to_distribute = { set_de_jure_liege_title = prev.de_jure_liege } } } } } +} - on_victory_desc = { - first_valid = { - triggered_desc = { - trigger = { # Desc for only one player attacker - scope:attacker = { - is_local_player = yes +persia_struggle_compromise_distribute_the_actual_titles = { + struggle:eastern_iranian_struggle = { + create_title_and_vassal_change = { + type = granted + save_scope_as = change + } + every_involved_ruler = { + limit = { + save_temporary_scope_as = new_owner_temp + primary_title = { + tier = tier_duchy + exists = de_jure_liege + de_jure_liege = { tfe_struggle_ending_compromise_create_title_trigger_persia = yes } + } + } + save_scope_as = new_owner + primary_title.de_jure_liege = { + change_title_holder = { + holder = scope:new_owner + change = scope:change + } + add_to_list = assigned_title + } + } + every_involved_ruler = { + limit = { + save_temporary_scope_as = new_owner_temp + primary_title = { + tier = tier_kingdom + NOT = { + THIS = title:k_mesopotamia + } + exists = de_jure_liege + de_jure_liege = { tfe_struggle_ending_compromise_create_title_trigger_persia = yes } + } + } + save_scope_as = new_owner + primary_title.de_jure_liege = { + change_title_holder = { + holder = scope:new_owner + change = scope:change + } + add_to_list = assigned_title + } + } + resolve_title_and_vassal_change = scope:change + } +} + +persia_struggle_compromise_truce_effect = { + hidden_effect = { + if = { + limit = { + struggle:eastern_iranian_struggle = { + any_involved_ruler = { + count > 1 + is_independent_ruler = yes + primary_title = { is_mercenary_company = no } + } + } + } + struggle:eastern_iranian_struggle = { + every_involved_ruler = { + limit = { + is_independent_ruler = yes + primary_title = { is_mercenary_company = no } + } + add_to_list = eastern_iranian_struggle_compromise_truce_list + } + } + while = { + limit = { + any_in_list = { + list = eastern_iranian_struggle_compromise_truce_list + NOT = { has_variable = fp2_struggle_compromise_flag } + } + } + ordered_in_list = { + list = eastern_iranian_struggle_compromise_truce_list + limit = { + NOT = { has_variable = fp2_struggle_compromise_flag } + } + order_by = realm_size + save_scope_as = realm_scope + set_variable = fp2_struggle_compromise_flag # variable ensures truces are set only once per couple + } + every_in_list = { + list = eastern_iranian_struggle_compromise_truce_list + limit = { + NOR = { + has_variable = fp2_struggle_compromise_flag + this = scope:realm_scope + has_truce = scope:realm_scope + } } + add_truce_both_ways = { + character = scope:realm_scope + days = 3650 + name = TRUCE_TFE_COMPROMISE_PERSIA + } + } + } + every_in_list = { + list = eastern_iranian_struggle_compromise_truce_list + remove_variable = fp2_struggle_compromise_flag + } + } + } +} + } +} + +"common/scripted_triggers/TFE_eastern_iranian_struggle_triggers.txt" = { + { +# Checks no more than half of Eastern Iranian region is owned by another +struggle_ending_other_percent_eastern_iranian_trigger = { + struggle:eastern_iranian_struggle = { + NOT = { + any_involved_ruler = { + exists = primary_title # Max figured out that is_independent_ruler causes errors if you are unlanded + NOT = { this = root } + is_independent_ruler = yes + primary_title = { is_mercenary_company = no } + any_county_in_region = { + region = TFE_eastern_iranian_struggle_region + percent > fp2_struggle_compromise_involved_percent_decimal_value + holder.top_liege = prev } - desc = independence_war_victory_desc_local_player_attacker_alone } - triggered_desc = { # Desc for only one attacker, player defender - trigger = { - scope:defender = { - is_local_player = yes - } + } + } +} + } + + { +tfe_struggle_ending_other_percent_persia_trigger = { + struggle:eastern_iranian_struggle = { + NOT = { + any_involved_ruler = { + exists = primary_title # Max figured out that is_independent_ruler causes errors if you are unlanded + NOT = { this = root } + is_independent_ruler = yes + primary_title = { is_mercenary_company = no } + any_county_in_region = { + region = TFE_eastern_iranian_struggle_region + percent > fp2_struggle_compromise_involved_percent_decimal_value + holder.top_liege = prev } - desc = player_independence_war_victory_desc_local_player_defender_attacker_alone } - desc = independence_war_victory_desc_local_player_attacker_alone # Desc for a third party involved } + } +} + } + { +tfe_character_any_involvement_eastern_iranian_struggle_trigger = { + OR = { + tfe_character_involved_in_eastern_iranian_struggle_trigger = yes + tfe_character_interloper_in_struggle_trigger_persia = yes } +} - on_victory = { - scope:attacker = { show_pow_release_message_effect = yes } +tfe_character_involved_in_eastern_iranian_struggle_trigger = { + any_character_struggle = { + involvement = involved + is_struggle_type = eastern_iranian_struggle + } +} - #EP2 Accolade glory gain from winning against higher ranked enemy - scope:attacker = { accolade_attacker_war_end_glory_gain_med_effect = yes } +tfe_character_interloper_in_struggle_trigger_persia = { + any_character_struggle = { + involvement = interloper + is_struggle_type = eastern_iranian_struggle + } +} + } +} - create_title_and_vassal_change = { - type = independency - save_scope_as = change - } - if = { - # Free character with the flag - limit = { exists = war } - war = { - every_war_attacker = { +"events/north_indian_struggle_events/tfe_north_indian_struggle_events.txt" = { + { + ############################# + # Current Phase: EXPANSION + ############################# if = { - limit = { has_character_flag = should_become_independent } - - create_title_and_vassal_change = { - type = independency - save_scope_as = going_independent - add_claim_on_loss = no - } - becomes_independent = { - change = scope:going_independent - } + limit = { root = { is_struggle_phase = struggle_TFE_eastern_iranian_phase_expansion } } + random_list = { + # Working towards hostility + # It should be for characters looking for direct conflicts and domination, with the will and ability to expand their realms + 100 = { + # Odds modifiers + north_indian_struggle_set_ai_agenda_common_modifiers = { + PHASE = hostility + INTENT = escalation + } - resolve_title_and_vassal_change = scope:going_independent + # Apply effects + north_indian_struggle_apply_ai_agenda_effect = { + INTENT = escalation + } + } + # Working towards development + 100 = { + # Odds modifiers + north_indian_struggle_set_ai_agenda_common_modifiers = { + PHASE = development + INTENT = deescalation + } - add_truce_both_ways = { - character = scope:defender - days = 1825 - war = root.war - result = victory + # Apply effects + north_indian_struggle_apply_ai_agenda_effect = { + INTENT = deescalation + } + } } + } - remove_character_flag = should_become_independent + ############################# + # Current Phase: DEVELOPMENT + ############################# + if = { + limit = { root = { is_struggle_phase = struggle_TFE_eastern_iranian_phase_development } } + random_list = { + # Working towards compromise + # It should be for characters looking for direct conflicts and domination, with the will and ability to expand their realms + 100 = { + # Odds modifiers + north_indian_struggle_set_ai_agenda_common_modifiers = { + PHASE = compromise + INTENT = escalation + } - change_liege_or_become_independent = { - CHANGE = scope:change - VASSAL = this + # Apply effects + north_indian_struggle_apply_ai_agenda_effect = { + INTENT = escalation + } + } } + } + ############################# + # Current Phase: Hostility + ############################# + if = { + limit = { root = { is_struggle_phase = struggle_TFE_eastern_iranian_phase_hostility } } + random_list = { + # Working towards Compromise + 100 = { + # Odds modifiers + north_indian_struggle_set_ai_agenda_common_modifiers = { + PHASE = compromise + INTENT = deescalation + } - hidden_effect = { - set_variable = { - name = independence_war_former_liege - value = scope:defender + # Apply effects + north_indian_struggle_apply_ai_agenda_effect = { + INTENT = deescalation + } } + } + } - save_scope_as = current_member - - # Struggle Catalyst - if = { - limit = { - catalyst_gave_independence_to_powerful_diff_faith_culture_vassal_preliminary_trigger = { - CHAR1 = scope:defender - CHAR2 = scope:current_member - } - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal - CHAR = scope:current_member - } - } + ############################# + # Current Phase: Compromise + ############################# + if = { + limit = { root = { is_struggle_phase = struggle_TFE_eastern_iranian_phase_compromise } } + random_list = { + # Working towards expansion + 100 = { + # Odds modifiers + north_indian_struggle_set_ai_agenda_common_modifiers = { + PHASE = expansion + INTENT = escalation } - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_either_trigger = { - CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal - CHAR = scope:current_member - } - } - activate_struggle_catalyst = { - catalyst = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal - character = scope:defender - } + + # Apply effects + north_indian_struggle_apply_ai_agenda_effect = { + INTENT = escalation } } } } + } + + { + ############################# + # Current Phase: EXPANSION + ############################# + if = { + limit = { any_character_struggle = { AND = { is_struggle_type = north_indian_struggle is_struggle_phase = struggle_TFE_eastern_iranian_phase_expansion } } } + random_list = { + # Working towards hostility + # It should be for characters looking for direct conflicts and domination, with the will and ability to expand their realms + 100 = { + # Odds modifiers + north_indian_struggle_set_ai_agenda_common_modifiers = { + PHASE = hostility + INTENT = escalation + } + + # Apply effects + north_indian_struggle_apply_ai_agenda_effect = { + INTENT = escalation + } + } + # Working towards development + 100 = { + # Odds modifiers + north_indian_struggle_set_ai_agenda_common_modifiers = { + PHASE = development + INTENT = deescalation + } + + # Apply effects + north_indian_struggle_apply_ai_agenda_effect = { + INTENT = deescalation + } + } } } - } - scope:defender = { - # Struggle Catalyst - hidden_effect = { - if = { - limit = { - catalyst_gave_independence_to_powerful_diff_faith_culture_vassal_preliminary_trigger = { - CHAR1 = scope:defender - CHAR2 = scope:attacker + ############################# + # Current Phase: DEVELOPMENT + ############################# + if = { + limit = { any_character_struggle = { AND = { is_struggle_type = north_indian_struggle is_struggle_phase = struggle_TFE_eastern_iranian_phase_development } } } + random_list = { + # Working towards compromise + # It should be for characters looking for direct conflicts and domination, with the will and ability to expand their realms + 100 = { + # Odds modifiers + north_indian_struggle_set_ai_agenda_common_modifiers = { + PHASE = compromise + INTENT = escalation } - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal - CHAR = scope:attacker - } + + # Apply effects + north_indian_struggle_apply_ai_agenda_effect = { + INTENT = escalation } } - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_either_trigger = { - CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal - CHAR = scope:attacker - } + } + } + ############################# + # Current Phase: Hostility + ############################# + if = { + limit = { any_character_struggle = { AND = { is_struggle_type = north_indian_struggle is_struggle_phase = struggle_TFE_eastern_iranian_phase_hostility } } } + random_list = { + # Working towards Compromise + 100 = { + # Odds modifiers + north_indian_struggle_set_ai_agenda_common_modifiers = { + PHASE = compromise + INTENT = deescalation + } + + # Apply effects + north_indian_struggle_apply_ai_agenda_effect = { + INTENT = deescalation } - activate_struggle_catalyst = { - catalyst = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal - character = scope:defender - } } } } - } - resolve_title_and_vassal_change = scope:change + ############################# + # Current Phase: Compromise + ############################# + if = { + limit = { any_character_struggle = { AND = { is_struggle_type = north_indian_struggle is_struggle_phase = struggle_TFE_eastern_iranian_phase_compromise } } } + random_list = { + # Working towards expansion + 100 = { + # Odds modifiers + north_indian_struggle_set_ai_agenda_common_modifiers = { + PHASE = expansion + INTENT = escalation + } + # Apply effects + north_indian_struggle_apply_ai_agenda_effect = { + INTENT = escalation + } + } + } + } } +} - on_white_peace_desc = { - first_valid = { +"gfx/portraits/portrait_modifiers/06_clothes_special.txt" = { + { + baudouin = { + dna_modifiers = { + accessory = { + mode = add + gene = special_headgear_face_mask + template = face_mask + range = { 0 1 } + } + } + weight = { + base = 0 + modifier = { + add = 1000 + exists = character:223523 + this = character:223523 + } + } + } + } +} + +"localization/english/names/TFE_names_error_log_l_english.yml" = { + { + Näcken:0 "Näcken" + } +} + +"common/legends/chronicles/00_chronicles.txt" = { + { triggered_desc = { - trigger = { scope:defender = { is_local_player = yes } } - desc = player_independence_war_white_peace_defender_desc + trigger = { + scope:ancestor=character:waegmunding_2 + } + desc = TFE_legend_beowulf + } + } + { + triggered_desc = { + trigger = { + scope:ancestor=character:waegmunding_2 + } + desc = TFE_legend_beowulf_desc + } + } + + { + triggered_desc = { + trigger = { + scope:ancestor=character:snakeyboy_0 + } + desc = TFE_legend_haftvad } + } + { triggered_desc = { trigger = { - scope:attacker = { - is_local_player = yes + scope:ancestor=character:snakeyboy_0 + } + desc = TFE_legend_haftvad_desc + } + } +} + +"events/artifacts/historical_artifacts_events.txt" = { + { + if = { + limit = { + current_date >= 476.1.1 + exists = character:180624 + character:180624 = { is_alive = yes } + } + character:180624={ + create_artifact_peroz_pearl_effect = { OWNER = character:180624 } + } + } + } + { + ### Crown of Justinian + if = { + limit = { + has_dlc_feature = royal_court + exists = title:e_byzantium.holder + current_date >= 550.1.15 + } + title:e_byzantium.holder = { + create_artifact_pedestal_justinian_effect = { OWNER = this } + } + } + } + { + ### Throne of Scone (featuring Stone) + if = { + limit = { + has_dlc_feature = royal_court + exists = title:k_scotland.holder + current_date > 500.1.1 + } + title:k_scotland.holder = { + create_artifact_throne_scone_effect = { OWNER = this } + } + } + } + { + ### Throne of Charlemagne + if = { + limit = { + has_dlc_feature = royal_court + exists = title:e_hre.holder + current_date >= 800.1.15 + } + title:e_hre.holder = { + create_artifact_throne_charlemagne_effect = { OWNER = this } + } + } + } + { + ### Pentapyrgion + if = { + limit = { + has_dlc_feature = royal_court + exists = title:e_byzantium.holder + current_date >= 829.1.1 + } + title:e_byzantium.holder = { + create_artifact_sculpture_cabinet_pentapyrgion_effect = { OWNER = this } + } + } + } + + # No e_rajastan in TFE as of the 'After The Pharaohs' update. + { + title:e_rajastan = { + random_in_de_jure_hierarchy = { + limit = { tier = tier_county } + holder = { + create_artifact_charmadhal_effect = { OWNER = THIS } } } - desc = player_independence_war_white_peace_attacker_desc } - desc = player_independence_war_white_peace_desc - } + } +} +"common/decisions/TFE_major_germanic_decisions.txt" = { + { +form_the_hre_TFE = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_emperor_apotheosis.dds" } + decision_group_type = major + + desc = form_the_hre_TFE_desc + selection_tooltip = form_the_hre_TFE_tooltip - on_white_peace = { - scope:attacker = { - show_pow_release_message_effect = yes - stress_impact = { - ambitious = medium_stress_impact_gain - arrogant = medium_stress_impact_gain - } + ai_check_interval = 250 + + is_shown = { + is_ruler = yes + is_landed_or_landless_administrative = yes + highest_held_title_tier >= tier_kingdom + religion = religion:christianity_religion + NOT = { #Can only do it once. + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:form_the_hre_TFE + } } - hidden_effect = { - scope:attacker = { - add_truce_both_ways = { - character = scope:defender - days = 1825 - war = root.war - result = white_peace - } + AND = { + title:e_western_roman_empire = { + is_title_created = no + } + title:e_roman_empire = { + is_title_created = no } } - - scope:defender = { - add_prestige = minor_prestige_value - stress_impact = { - arrogant = medium_stress_impact_gain - } + capital_county.title_province = { + geographical_region = world_europe_west + } + NOT = { + has_title = title:e_byzantium + } + NOT = { + culture = { + has_cultural_pillar = heritage_latin + } } } - on_defeat_desc = { - first_valid = { - triggered_desc = { - trigger = { scope:defender = { is_local_player = yes } } - desc = player_independence_defeat_defender_desc + is_valid = { + is_independent_ruler = yes + highest_held_title_tier >= tier_kingdom + religion = religion:christianity_religion + realm_size >= 60 + completely_controls = title:c_ravenna + custom_description = { + text = form_the_hre_TFE_trigger_01 + trigger_if = { + limit = { + title:e_byzantium = { + is_title_created = yes + } + } + title:e_byzantium.holder = { + any_realm_county = { + count <= form_hre_TFE_county_trigger + title_province = { geographical_region = form_the_hre_TFE_ere_region } + } + } } - triggered_desc = { - trigger = { - scope:attacker = { - is_local_player = yes + } + custom_description = { + text = form_the_hre_TFE_trigger_02 + NOT = { + any_independent_ruler = { + AND = { + is_landed_or_landless_administrative = yes + capital_county.title_province ?= { + geographical_region = world_europe_west + } + highest_held_title_tier >= tier_kingdom + current_military_strength > form_hre_TFE_strength_trigger } } - desc = player_independence_defeat_attacker_desc } - desc = player_independence_war_defeat_desc } + + } + is_valid_showing_failures_only = { + is_imprisoned = no + is_independent_ruler = yes } - on_defeat = { - scope:attacker = { show_pow_release_message_effect = yes } - scope:defender = { - add_dread = medium_dread_gain - # Prestige for Defender - add_prestige_war_defender_effect = { - PRESTIGE_VALUE = medium_prestige_value - } + effect = { + give_nickname = nick_the_great + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:form_the_hre_TFE } + show_as_tooltip = { + restore_holy_roman_empire_decision_scripted_effect = yes + } + save_scope_as = founder + faith.religious_head = { save_scope_as = founder_hof } if = { - # Free character with the flag - limit = { exists = war } - war = { - every_war_attacker = { - save_scope_as = expelled_vandal - if = { - limit = { - has_character_flag = should_become_independent - NOT = { THIS = character:vandals_012 } - } - hard_imprison_character_effect = { - TARGET = this - IMPRISONER = scope:defender - } - scope:defender = { - add_opinion = { - target = prev - modifier = vassal_lost_faction_revolt_war - } - } - } - if = { - limit = { - THIS = character:vandals_012 - title:c_cappadocia.holder = { - is_ai = yes - } - } - title:c_cappadocia = { - save_temporary_scope_as = current_county - } - create_title_and_vassal_change = { - type = usurped - save_scope_as = change - add_claim_on_loss = no - } - scope:current_county = { - change_title_holder = { - holder = character:vandals_012 - change = scope:change - take_baronies = yes - } - } - resolve_title_and_vassal_change = scope:change - - every_vassal = { - add_to_list = vassals_to_defect - } - - every_held_title = { - limit = { - NOT = { this = title:c_cappadocia } - } - add_to_list = titles_to_usurp - } - - create_title_and_vassal_change = { - type = usurped - save_scope_as = title_change - add_claim_on_loss = no - } - every_in_list = { - list = titles_to_usurp - change_title_holder = { - holder = title:k_africae.holder - change = scope:title_change - take_baronies = no - } - } - every_in_list = { - list = vassals_to_defect - change_liege = { - liege = title:k_africae.holder - change = scope:title_change - } - } - change_liege = { - liege = title:k_africae.holder.top_liege - change = scope:title_change - } - resolve_title_and_vassal_change = scope:title_change - character:vandals_012 = { - add_character_modifier = { - modifier = peaceful_retirement - } - add_trait = content - change_government = imperial_government - } - } - else_if = { - limit = { - THIS = character:vandals_012 - } - title:c_lower_galatia = { - save_temporary_scope_as = current_county - } - create_title_and_vassal_change = { - type = usurped - save_scope_as = change - add_claim_on_loss = no - } - scope:current_county = { - change_title_holder = { - holder = character:vandals_012 - change = scope:change - take_baronies = yes - } - } - resolve_title_and_vassal_change = scope:change - - every_vassal = { - add_to_list = vassals_to_defect - } - - every_held_title = { - limit = { - NOT = { this = title:c_lower_galatia } - } - add_to_list = titles_to_usurp - } - - create_title_and_vassal_change = { - type = usurped - save_scope_as = title_change - add_claim_on_loss = no - } - every_in_list = { - list = titles_to_usurp - change_title_holder = { - holder = title:k_africae.holder - change = scope:title_change - take_baronies = no - } - } - every_in_list = { - list = vassals_to_defect - change_liege = { - liege = title:k_africae.holder - change = scope:title_change + limit = { + faith.religious_head = { is_landed = yes } + } + faith.religious_head.capital_province = { save_scope_as = ceremony_locale } + } + else = { + capital_province = { save_scope_as = ceremony_locale } + } + trigger_event = { + id = tfe_title_event.0010 + } + #Notify other players. + every_player = { + limit = { + NOT = { this = root } + is_within_diplo_range = { CHARACTER = root } + } + trigger_event = tfe_title_event.0011 + } + if = { + limit = { + is_ai = no + NOT = { exists = global_var:restore_holy_roman_empire_decision } + } + set_global_variable = { + name = restore_holy_roman_empire_decision + value = root + } + } + # Assign Dynamic Prince-Electors + hidden_effect = { + if = { + limit = { has_global_variable_list = hre_elector_list } + clear_global_variable_list = hre_elector_list + } + while = { + count = 7 + random_vassal = { + limit = { + capital_province.empire = title:e_hre # must be de-jure vassal of empire + OR = { # prince-bishopric or duchy + AND = { + government_has_flag = government_is_theocracy + primary_title.tier >= tier_county } + primary_title.tier >= tier_duchy } - change_liege = { - liege = title:k_africae.holder.top_liege - change = scope:title_change - } - resolve_title_and_vassal_change = scope:title_change - character:vandals_012 = { - add_character_modifier = { - modifier = peaceful_retirement + NOT = { # not already selected + is_target_in_global_variable_list = { + name = hre_elector_list + target = primary_title } - add_trait = content - change_government = imperial_government } } - if = { - limit = { - liege = title:k_africae.holder - NOT = { THIS = character:vandals_012 } + weight = { + modifier = { # major vassals heavily weighted + factor = 10 + is_powerful_vassal = yes } - save_scope_as = vandal_expel - scope:defender.top_liege = { - random_sub_realm_county = { - limit = { - kingdom = title:k_orientis - holder = { - is_ai = yes - realm_size > 1 - NOT = { - OR = { - THIS = primary_title.title_capital_county - THIS = primary_title.title_capital_county.de_jure_liege - } - } - } - NOT = { - is_in_list = vandal_titles_to_usurp - } + modifier = { # same culture as emperor preferred + factor = 4 + culture = root.culture + } + modifier = { # we don't mind going outside Germania, but prefer it + factor = 1.5 + trigger = { exists = primary_title.title_province } + primary_title.title_province.barony = { + OR = { + target_is_de_jure_liege_or_above = title:k_bavaria + target_is_de_jure_liege_or_above = title:k_bohemia + target_is_de_jure_liege_or_above = title:k_east_francia + target_is_de_jure_liege_or_above = title:k_frisia + target_is_de_jure_liege_or_above = title:k_lotharingia + target_is_de_jure_liege_or_above = title:k_pomerania } - save_scope_as = county_expel - add_to_list = vandal_titles_to_usurp - - #create_title_and_vassal_change = { - # type = usurped - # save_scope_as = change - # add_claim_on_loss = no - #} - #scope:county_expel = { - # change_title_holder = { - # holder = scope:expelled_vandal - # change = scope:change - # take_baronies = yes - # } - #} - #resolve_title_and_vassal_change = scope:change } - scope:vandal_expel = { - every_vassal = { - add_to_list = vassals_to_defect - } - - every_held_title = { - limit = { - NOT = { this = scope:county_expel } - } - add_to_list = titles_to_usurp - } - - create_title_and_vassal_change = { - type = usurped - save_scope_as = title_change - add_claim_on_loss = no - } - every_in_list = { - list = titles_to_usurp - change_title_holder = { - holder = title:k_africae.holder - change = scope:title_change - take_baronies = no - } - } - every_in_list = { - list = vassals_to_defect - change_liege = { - liege = title:k_africae.holder - change = scope:title_change - } - } - change_liege = { - liege = title:k_africae.holder.top_liege - change = scope:title_change - } - resolve_title_and_vassal_change = scope:title_change + } + modifier = { # we want at least 3 theocracies ideally + factor = 10 + any_in_global_list = { + variable = hre_elector_list + count < 3 + holder = { government_has_flag = government_is_theocracy } } - if = { - limit = { - scope:vandal_expel = { - is_landed = no - } - character:vandals_012 = { - is_alive = yes - is_landed = yes - } - } - character:vandals_012 = { - add_courtier = scope:vandal_expel - } + government_has_flag = government_is_theocracy + } + modifier = { # 3 is enough theocracies unless we can't find feudal + factor = 0.1 + any_in_global_list = { + variable = hre_elector_list + count >= 3 + holder = { government_has_flag = government_is_theocracy } } + government_has_flag = government_is_theocracy } } + add_to_global_variable_list = { + name = hre_elector_list + target = primary_title + } } } + hre_elector_list_save_effect = yes # saves list scopes to title as variables for tooltip } - add_culture_minority_effect = { - CULTURE = culture:vandal - SIZE = small - COUNTY = title:c_upper_khabur + + } + + ai_potential = { + always = yes + } + + cost = { + gold = 250 + } + + ai_will_do = { + base = 100 + } +} + } + + # Triggers event TFE_major_decisions.0020 that we remove + { +############################################################### +# # +# Establish a new Capital for the Visigoths # +# by Juli # +# # +############################################################### +visigothic_capital_decision = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_destiny_goal.dds" + } + decision_group_type = cultural + + desc = visigothic_capital_decision_desc + selection_tooltip = visigothic_capital_decision_tooltip + + ai_check_interval = 120 + + is_shown = { + exists = global_var:wre_collapsed #WRE has fallen + # Only should be visible for Recently established Visigoths + is_ruler = yes + is_landed_or_landless_administrative = yes + exists = dynasty + NOT = { #Can only do it once. + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:founded_visigothic_capital + } } - add_culture_minority_effect = { - CULTURE = culture:vandal - SIZE = small - COUNTY = title:c_amida + OR ={ + culture = { has_cultural_pillar = heritage_east_germanic } # This way other germanic lords that end up being Visigoth Kings may do it too + culture = culture:visigothic # This way other post-roman Visigothic lords can also take the decision + culture = culture:ostrogothic # This way other post-roman Visigothic lords can also take the decision + } + root.faith = { + religion_tag = christianity_religion + } + has_title = title:k_visigoths + # Must hold a county in Hispania or France + any_held_title = { + tier = tier_county + OR = { + title_province = { geographical_region = world_europe_west_iberia } + title_province = { geographical_region = world_europe_west_francia } + } + } + # By 567 Toledo became Capital + NOT = { game_start_date >= 567.1.1 } + } + + is_valid = { + #Must be independent. + is_independent_ruler = yes + #Has to be around to organise the construction. + is_imprisoned = no + #Must have a capital within title:e_spain or e_france, as we'll use this as a fallback. + + custom_description = { + text = visigothic_capital_decision_your_capital_is_in_spain_or_gaul + OR = { + capital_county = { title_province = { geographical_region = world_europe_west_iberia }} + capital_county = { title_province = { geographical_region = world_europe_west_francia }} + } + } + OR = { + religion = religion:christianity_religion + } + #Should have a decent prestige level. + OR = { + prestige_level >= very_high_prestige_level + AND = { + prestige_level >= high_prestige_level + completely_controls = title:c_toledo + } + AND = { + prestige_level >= high_prestige_level + completely_controls = title:c_toulouse + } + } + #Repeat the time limit concern just so that the player knows it's a thing. + custom_description = { + text = found_capital_of_the_visigoths_decision_before_last_date + current_date <= 600.1.1 + } + } + + is_valid_showing_failures_only = { + is_available_at_peace_adult = yes + } + + effect = { + save_scope_as = founder + #Nab scope:founder's capital for the initial tooltip; this may be changed in the actual event. + scope:founder.capital_county = { save_scope_as = new_visigothic_capital } + show_as_tooltip = { found_capital_of_visigoths_scripted_effect = yes } + trigger_event = { id = TFE_major_decisions.0020 } + #Notifying other players is done in scope:founder's event, as scope:founder may change the circumstances of the decision with their option choice. + hidden_effect = { + add_to_global_variable_list = { + name = unavailable_unique_decisions + target = flag:founded_visigothic_capital + } + } + } + + cost = { + gold = 500 + prestige = 1000 + piety = 500 + } + + ai_potential = { + always = yes + } + + ai_will_do = { + base = 0 + + # Weight up for traits. + modifier = { + add = 25 + has_trait = ambitious + } + modifier = { + add = 25 + has_trait = arrogant + } + modifier = { + add = 25 + has_trait = architect + } + modifier = { + add = 25 + has_trait = administrator + } + modifier = { + add = 25 + has_trait = viking + } + + # Weight up for game year. + modifier = { + add = 25 + current_year >= 476 + } + modifier = { + add = 25 + current_year >= 500 + } + } +} + } + + # No d_carthaginensis in TFE as of the 'After The Pharaohs' update. + { + title:d_carthaginensis = { + set_de_jure_liege_title = title:k_visigoths + } + } + + # No d_tarraconensis in TFE as of the 'After The Pharaohs' update. + { + title:d_tarraconensis = { + set_de_jure_liege_title = title:k_visigoths + } + } +} + + +"common/decisions/TFE_major_celtic_decisions.txt" = { + # No k_britanny in TFE as of the 'After The Pharaohs' update. + { + title:k_britanny = { + set_de_jure_liege_title = title:e_gaul + } + } + { + title:d_brittany = { + set_de_jure_liege_title = title:k_britanny + } + } +} + + +"gfx/coat_of_arms/colored_emblems/50_coa_designer_emblems.txt" = { + { +ce_african_cross_NU.dds = { colors = 1 category = crosses_and_knots } + } +} + +"events/dlc/fp1/fp1_scandinavian_adventurer_events.txt" = { + { +fp1_scandinavian_adventurers.0012 = { + hidden = yes + scope = none + + trigger = { + # DLC check. + has_fp1_dlc_trigger = yes + # No point in later starts. + game_start_date = 867.1.1 + + OR = { + exists = character:242 + exists = character:163119 + } + + } + + immediate = { + # Nab Rollo. + scandi_adventurers_grab_famous_character_effect = { CHARACTER = character:242 } + # Nab Ubbe. + scandi_adventurers_grab_famous_character_effect = { CHARACTER = character:163119 } + } +} + } +} + +"events/dlc/fp3/fp3_struggle_events.txt" = { + { + character:34010 = { save_scope_as = Mutawakkil } # Stabbed by guards + } + { + character:34012 = { save_scope_as = Muntasir } # Poisoned probably + } + { + character:34013 = { save_scope_as = Mustain } # Betrayed by bookmark character (?) (Note: this char is listed as 3933 in some other files for some reason) + } + { + character:34014 = { save_scope_as = Mostaza } # Bookmark ruler + } + { + character:34014 = { save_scope_as = Mostaza } # Bookmark ruler + } + { + triggered_desc = { + trigger = { + any_character_struggle = { is_struggle_type = persian_struggle } + has_title = character:34014.primary_title + } + desc = fp3_struggle.0051.b + } + } +} + + +"common/culture/creation_names/00_names.txt" = { + # TFE doesn't have Iceland on the map + { +icelandic = { + trigger = { + OR = { + capital_county = { + title:d_iceland = { + is_de_jure_liege_or_above_target = prev + } + } + has_primary_title = title:d_iceland } - add_culture_minority_effect = { - CULTURE = culture:vandal - SIZE = small - COUNTY = title:c_tall_basma + culture = { has_cultural_pillar = heritage_north_germanic } + any_sub_realm_county = { + culture = { has_cultural_pillar = heritage_north_germanic } + duchy = title:d_iceland } } +} + } +} - on_invalidated_desc = msg_invalidate_war_title +"common/scripted_effects/06_dlc_ce1_legend_effects.txt" = { + { + else_if = { + limit = { + legend_property:ancestor ?= character:snakeyboy_0 + } + set_global_variable = { + name = haftvad_legend + value = yes + } + } + } - check_defender_inheritance_validity = no + { + else_if = { + limit = { + legend_property:ancestor ?= character:waegmunding_2 + } + set_global_variable = { + name = beowulf_legend + value = yes + } + } + } - on_primary_attacker_death = inherit - on_primary_defender_death = inherit + # No d_iceland in TFE. + { + root.primary_title = title:d_iceland + } - attacker_allies_inherit = yes - defender_allies_inherit = yes + # No c_muluvagil in TFE as of the 'After The Pharaohs' update + { + root.primary_title = title:c_muluvagil + } - transfer_behavior = transfer + # TFE uses hun instead of hunnic. + { + 999 = { + trigger = { + OR = { + root.culture = { + OR = { + culture_overlaps_geographical_region = world_steppe + culture_overlaps_geographical_region = custom_carpathia + } + } + culture = { has_cultural_pillar = heritage_turkic } + culture = { has_cultural_pillar = heritage_mongolic } + culture = { has_cultural_pillar = heritage_magyar } + } + NOT = { culture = culture:hunnic } + } + set_variable = { + name = original_region + value = geographical_region:world_steppe_west + years = 1 + } + culture:hunnic = { save_scope_as = ancient_culture } + } + } - war_name = "INDEPENDENCE_WAR_NAME" + # TFE uses heritage_hellenistic instead of heritage_ancient_greek. + { + culture = { has_cultural_pillar = heritage_ancient_greek } + } +} - interface_priority = 120 +"events/single_combat_events.txt" = { + { + # Historical + dynasty = dynasty:1055 + house = house:house_british_isles_wessex + # Vanity: because they're long. + dynasty = dynasty:vanity_riedinger + dynasty = dynasty:vanity_kaltsogiannis + # Vanity: because their punctuation screws things up. + dynasty = dynasty:vanity_bjarnehed + dynasty = dynasty:vanity_daflos + dynasty = dynasty:vanity_welch + dynasty = dynasty:vanity_opara + dynasty = dynasty:vanity_beaumont + } +} - attacker_wargoal_percentage = 0.8 +"events/dlc/fp1/fp1_yearly_events.txt" = { + # No d_iceland in TFE. + { + #Averted giant holmgang that would have sunk Iceland. + 166 = { + trigger = { + #Must not have any counties in Iceland, as the news'd travel otherwise. + NOT = { + any_realm_de_jure_duchy = { this = title:d_iceland } + } + } + save_scope_value_as = { + name = lie_nature + value = flag:kept_iceland_afloat + } + } + } +} - max_attacker_score_from_battles = 100 - max_defender_score_from_battles = 50 - - max_defender_score_from_occupation = 150 - max_attacker_score_from_occupation = 150 +"common/scripted_effects/00_accolades_scripted_effects.txt" = { + # No d_iceland in TFE. + { + any_culture_duchy = { + NOT = { + this = title:d_iceland + } + } + } +} - max_ai_diplo_distance_to_title = 500 +"common/scripted_triggers/00_hunt_triggers.txt" = { + # No d_iceland in TFE. + { + duchy = title:d_iceland # Not native + } } + +"common/scripted_triggers/00_cultural_heritage_triggers.txt" = { + # heritage_north_african was not defined as of TFE's 'After the Pharaohs' update + { + has_cultural_pillar = heritage_north_african } +} + +"common/coat_of_arms/template_lists/coa_templates.txt" = { + # No e_rajastan in TFE as of the 'After The Pharaohs' update { -radagaisus_invasion_cb = { - group = event + this = title:e_rajastan + } +} - allowed_for_character = { +"common/customizable_localization/06_ce1_epidemics_custom_loc.txt" = { + # Character easteregg_veronica_pazos seems to be missing from TFE. + { + text = { + trigger = { + exists = character:easteregg_veronica_pazos + this = character:easteregg_veronica_pazos + } + localization_key = third_impact + } } +} - allowed_against_character = { - scope:attacker = { - ALL_FALSE = { - top_liege = scope:defender.top_liege - liege = scope:defender - } + +"common/customizable_localization/00_destination_custom_loc.txt" = { + # TFE uses language_kemetic instead of language_egyptian as of the 'After The Pharaohs' update + { + text = { + trigger = { + culture = { has_cultural_pillar = language_egyptian } } + localization_key = DestinationInspiredLanguageDescriptorEgyptian + } } +} - combine_into_one = yes - target_titles = none - target_title_tier = all - target_de_jure_regions_above = yes - ignore_effect = change_title_holder - ai_only_against_neighbors = yes - defender_ticking_warscore_delay = { years = 2 } +"common/decisions/80_major_decisions_south_asia.txt" = { + # No e_rajastan in TFE as of the 'After The Pharaohs' update + { + completely_controls = title:e_rajastan + } +} - white_peace_possible = no - valid_to_start = { - always = no +"common/decisions/80_major_decisions.txt" = { + # innovation_ledger is not in TFE as of the 'After the Pharaohs' update. + { + has_innovation = innovation_ledger } +} - should_invalidate = { - NOT = { - any_in_list = { - list = target_titles - any_in_de_jure_hierarchy = { - tier = tier_county - holder = { - OR = { - this = scope:defender - target_is_liege_or_above = scope:defender - } - } - } - } - } + +"common/scripted_triggers/00_coa_triggers.txt" = { + # No e_rajastan in TFE as of the 'After The Pharaohs' update + { + this = title:e_rajastan } +} - on_invalidated_desc = msg_religious_war_invalidation_region_message - on_invalidated = { +"common/scripted_effects/00_decisions_effects.txt" = { + # No e_rajastan in TFE as of the 'After The Pharaohs' update + { + title:e_rajastan = { add_to_list = indian_empire } } - cost = { + { + if = { + limit = { has_title = title:e_rajastan } + destroy_title = title:e_rajastan + } } - on_declaration = { - on_declared_war = yes + # No k_sorbia in TFE as of the 'After The Pharaohs' update + { + title:k_sorbia = { add_to_list = west_slavic_kingdoms } } - on_victory_desc = { - first_valid = { - triggered_desc = { - trigger = { scope:attacker = { is_local_player = yes } } - desc = radagaisus_invasion_victory_desc_attacker + { + # If Saxony has been created, shift everything back into Polabia + if = { + limit = { + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:flag_formed_saxony } - triggered_desc = { - trigger = { scope:defender = { is_local_player = yes } } - desc = radagaisus_invasion_victory_desc_defender + } + title:k_saxony = { + every_in_de_jure_hierarchy = { + limit = { tier = tier_duchy } + set_de_jure_liege_title = title:k_sorbia } - desc = radagaisus_invasion_victory_desc } } + } +} - on_victory = { - #EP2 accolade glory gain for winning against higher ranked enemy - scope:attacker = { accolade_attacker_war_end_glory_gain_high_effect = yes } - scope:attacker = { show_pow_release_message_effect = yes } - scope:defender = { - trigger_event = { - id = gothic_wars.0014 - days = 1 + +"events/dlc/ep3/ep3_decisions_events.txt" = { + # No d_laamp_asen in TFE as of the 'After The Pharaohs' update + { + modifier = { # Asen and Peter always try to go to war with you + add = 1000 + primary_title = title:d_laamp_asen } - } + } + { + modifier = { # Asen and Peter always try to go to war with you + factor = 0 + primary_title = title:d_laamp_asen + } + } + { + modifier = { # Asen and Peter always try to go to war with you + factor = 0 + primary_title = title:d_laamp_asen + } + } +} - create_title_and_vassal_change = { - type = conquest_holy_war - save_scope_as = change - add_claim_on_loss = yes +"common/coat_of_arms/dynamic_definitions/00_norse_coas.txt" = { + # No d_iceland in TFE. + { +d_iceland = { + item = { + trigger = { + coa_switch_to_norse_trigger = yes } - # go through the dejure hierarchy under target titles, transfer titles with same or worse tolerance holders (their religion equaly or less tolerated than the defender's), - # take the holder as vassal otherwise and don't go deeper - every_in_list = { - list = target_titles - custom_tooltip = RELIGIOUS_CB_TITLE - - conquest_cb_title_transfer = { - RELIGIOUS_WAR = yes - } + coat_of_arms = d_iceland_norse + } +} +c_vestisland = { + item = { + trigger = { + coa_switch_to_norse_trigger = yes } - - every_in_list = { - list = vassals_taken - change_liege = { - liege = scope:attacker - change = scope:change - } + coat_of_arms = c_vestisland_norse + } +} +c_nordrland = { + item = { + trigger = { + coa_switch_to_norse_trigger = yes } - - every_in_list = { - list = titles_taken - change_title_holder = { - holder = scope:attacker - change = scope:change - take_baronies = yes - } + coat_of_arms = c_nordrland_norse + } +} +c_austisland = { + item = { + trigger = { + coa_switch_to_norse_trigger = yes } - - resolve_title_and_vassal_change = scope:change - - # Prestige Progress for the Attacker - every_in_list = { - list = target_titles - scope:attacker = { - add_prestige_experience = medium_prestige_value - } + coat_of_arms = c_austisland_norse + } +} +c_sudurland = { + item = { + trigger = { + coa_switch_to_norse_trigger = yes } + coat_of_arms = c_sudurland_norse + } +} + } +} - # Allies on both sides get full prestige value for helping in the war, based on their war participation. - modify_allies_of_participants_fame_values = { - WINNER = scope:attacker - FAME_BASE = medium_prestige_value - IS_RELIGIOUS_WAR = no - WINNER_ALLY_FAME_SCALE = 1 - LOSER_ALLY_FAME_SCALE = 1 - } +"map_data/geographical_regions/geographical_region.txt" = { + # No d_shamir in TFE as of the 'After The Pharaohs' update + { + d_shamir + } +} - # Truce - add_truce_attacker_victory_effect = yes +"history/provinces/k_mesopotamia.txt" = { + # Anachronistic + { + 410.1.1 = { + special_building_slot = palace_khawarnaq + special_building = palace_khawarnaq + } + } +} - # FP1: note the victory for future memorialisation via stele (if applicable) - scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes } +"common/decisions/dlc_decisions\ep_3\06_ep3_separatist_uprising_decision.txt" = { + # No d_laamp_asen in TFE as of the 'After The Pharaohs' update + { + modifier = { # Asen and Peter always try to do this + add = 1000 + primary_title = title:d_laamp_asen + } } +} - on_white_peace_desc = { - first_valid = { - triggered_desc = { - trigger = { scope:attacker = { is_local_player = yes } } - desc = radagaisus_invasion_white_peace_desc_attacker +"common/scripted_effects/00_historical_characters_scripted_effects.txt" = { + # No Iceland in TFE as of the 'After The Pharaohs' update + { + if = { # Gunnlaug Ormstunga + limit = { + current_year >= 1000 + current_year <= 1006 + NOT = { exists = global_var:hchar_gunnlaug_ormstunga } + } + set_global_variable = { name = hchar_gunnlaug_ormstunga value = yes } + title:b_reykjavik = { + save_scope_as = birth_location + create_character = { + age = 20 + name = "Gunnlaug" + dynasty_house = house:house_ormstunga + gender_female_chance = 0 + random_traits = no + location = scope:birth_location.title_province + faith = scope:birth_location.title_province.faith + culture = scope:birth_location.title_province.culture + trait = education_diplomacy_2 + trait = poet + trait = deceitful + trait = lustful + trait = ambitious + trait = viking + diplomacy = { min_template_high_skill max_template_high_skill } + martial = { min_template_high_skill max_template_high_skill } + stewardship = { min_template_low_skill max_template_low_skill } + intrigue = { min_template_high_skill max_template_high_skill } + learning = { min_template_high_skill max_template_high_skill } + prowess = { min_template_high_skill max_template_high_skill } + save_scope_as = historical_character } - triggered_desc = { - trigger = { scope:defender = { is_local_player = yes } } - desc = radagaisus_invasion_white_peace_desc_defender + scope:historical_character ?= { + save_scope_as = explorer + historical_character_finalization_effect = yes + set_variable = gunnlaug_ormstunga } - desc = radagaisus_invasion_white_peace_desc + if = { limit = { has_variable = gunnlaug_ormstunga } } # Error suppression + spawn_historical_characters_boilerplate_effect = yes } } + } - on_defeat_desc = { - first_valid = { - triggered_desc = { - trigger = { scope:attacker = { is_local_player = yes } } - desc = radagaisus_invasion_defeat_desc_attacker + { + if = { # Snorri Sturluson + limit = { + current_year >= 1199 + current_year <= 1205 + NOT = { exists = global_var:hchar_snorri_sturluson } + } + set_global_variable = { name = hchar_snorri_sturluson value = yes } + title:b_reykjavik = { + save_scope_as = birth_location + create_character = { + age = 20 + name = "Snorri" + dynasty_house = house:house_sturluson + gender_female_chance = 0 + random_traits = no + location = scope:birth_location.title_province + faith = scope:birth_location.title_province.faith + culture = scope:birth_location.title_province.culture + trait = education_learning_3 + trait = ambitious + trait = diligent + trait = gregarious + trait = poet + diplomacy = { min_template_high_skill max_template_high_skill } + martial = { min_template_low_skill max_template_low_skill } + stewardship = { min_template_high_skill max_template_high_skill } + intrigue = { min_template_high_skill max_template_high_skill } + learning = { min_template_high_skill max_template_high_skill } + prowess = { min_template_low_skill max_template_low_skill } + save_scope_as = historical_character } - triggered_desc = { - trigger = { scope:defender = { is_local_player = yes } } - desc = radagaisus_invasion_defeat_desc_defender + scope:historical_character ?= { + historical_character_finalization_effect = yes + set_variable = snorri_sturluson + save_scope_as = major + create_inspiration = book_inspiration } - desc = radagaisus_invasion_defeat_desc + if = { limit = { has_variable = snorri_sturluson } } # Error suppression + spawn_historical_characters_boilerplate_effect = yes } } + } - on_defeat = { - #EP2 accolade glory gain for winning against higher ranked enemy - scope:defender = { accolade_attacker_war_end_glory_gain_high_effect = yes } - scope:attacker = { show_pow_release_message_effect = yes } - - if = { - limit = { - exists = title:k_visigoths.holder - } - goths_flee_effect = yes + { + if = { # Egil Skallagrímsson + limit = { + current_year >= 930 + current_year <= 936 + NOT = { exists = global_var:hchar_egil_skallagrimrsson } } - - # Prestige loss for the attacker - scope:attacker = { - save_temporary_scope_as = loser - pay_short_term_gold_reparations_effect = { - GOLD_VALUE = 5 + set_global_variable = { name = hchar_egil_skallagrimrsson value = yes } + title:b_olafsvik = { + save_scope_as = birth_location + create_character = { + age = 20 + name = "Egil" + dynasty_house = house:house_skallagrimsson + gender_female_chance = 0 + random_traits = no + location = scope:birth_location.title_province + faith = scope:birth_location.title_province.faith + culture = scope:birth_location.title_province.culture + trait = education_diplomacy_2 + trait = poet + trait = gregarious + trait = wrathful + trait = brave + trait = berserker + trait = viking + diplomacy = { min_template_high_skill max_template_high_skill } + martial = { min_template_high_skill max_template_high_skill } + stewardship = { min_template_low_skill max_template_low_skill } + intrigue = { min_template_high_skill max_template_high_skill } + learning = { min_template_high_skill max_template_high_skill } + prowess = { min_template_high_skill max_template_high_skill } + save_scope_as = historical_character } - add_prestige = { - value = major_prestige_value - multiply = -1.0 + scope:historical_character ?= { + historical_character_finalization_effect = yes + set_variable = egil_skallagrimrsson + save_scope_as = major + change_current_weight = 75 } + if = { limit = { has_variable = egil_skallagrimrsson } } # Error suppression + spawn_historical_characters_boilerplate_effect = yes } + } + } - # Prestige for Defender - scope:defender = { - add_prestige_war_defender_effect = { - PRESTIGE_VALUE = major_prestige_value + { + if = { # Þorbjörg the Seeress + limit = { + current_year >= 970 + current_year <= 976 + NOT = { exists = global_var:hchar_torbjorg_the_seeress } + } + set_global_variable = { name = hchar_torbjorg_the_seeress value = yes } + title:b_reydarfjall= { + save_scope_as = birth_location + create_character = { + age = 20 + name = "T_orbjO_rg" + dynasty = none + gender_female_chance = 100 + random_traits = no + location = scope:birth_location.title_province + faith = faith:norse_pagan + culture = scope:birth_location.title_province.culture + trait = education_learning_3 + trait = patient + trait = zealous + trait = humble + trait = lifestyle_mystic + diplomacy = { min_template_high_skill max_template_high_skill } + martial = { min_template_low_skill max_template_low_skill } + stewardship = { min_template_high_skill max_template_high_skill } + intrigue = { min_template_high_skill max_template_high_skill } + learning = { min_template_high_skill max_template_high_skill } + prowess = { min_template_low_skill max_template_low_skill } + save_scope_as = historical_character + } + scope:historical_character ?= { + historical_character_finalization_effect = yes + set_variable = torbjorg_the_seeress + hidden_effect = { + add_trait_xp = { + trait = lifestyle_mystic + value = 100 + } + } + give_nickname = nick_the_seeress + add_piety = 5000 + add_character_flag = ai_will_not_convert } + if = { limit = { has_variable = torbjorg_the_seeress } } # Error suppression + spawn_historical_characters_boilerplate_effect = yes } + } + } +} - # Allies on both sides get full prestige value for helping in the war, based on their war participation. - modify_allies_of_participants_fame_values = { - WINNER = scope:defender - FAME_BASE = medium_prestige_value - IS_RELIGIOUS_WAR = no - WINNER_ALLY_FAME_SCALE = 1 - LOSER_ALLY_FAME_SCALE = 1 - } +"common/coat_of_arms/dynamic_definitions/roman_coa_ere.txt" = { + # d_phoenicia not in TFE as of the 'After The Pharaohs' update + { +d_phoenicia = { item = { trigger = { coa_switch_to_roman_trigger = yes } coat_of_arms = d_phoenicia_roman } } + } +} - lost_radagaisus_invasion_effect = yes - add_truce_attacker_defeat_effect = yes - on_lost_aggression_war_discontent_loss = yes +"common/scripted_effects/TFE_dejure.txt" = { + # No c_placensia in TFE as of the 'After The Pharaohs' update + { + title:c_placensia = { + set_de_jure_liege_title = title:d_badajoz + } } - transfer_behavior = transfer - - on_primary_attacker_death = inherit - on_primary_defender_death = inherit + # No c_clemont_sur_allier in TFE as of the 'After The Pharaohs' update + { + title:c_clemont_sur_allier = { + set_de_jure_liege_title = title:d_auvergne + } + } - attacker_allies_inherit = yes - defender_allies_inherit = yes + # No d_gloucestor in TFE as of the 'After The Pharaohs' update + { + title:c_hereford = { + set_de_jure_liege_title = title:d_gloucestor + } + } +} - war_name = RADAGAISUS_INVASION_NAME - war_name_base = RADAGAISUS_INVASION_NAME_BASE - cb_name = RADAGAISUS_INVASION_CB_NAME - use_de_jure_wargoal_only = yes - - interface_priority = 100 +"common/flavorization/00_title_holders.txt" = { + # error: female used instead of title tier + { +celtic_queen = { + type = character + gender = male + special = holder + tier = female + priority = 150 + heritages = { heritage_celtic } } } +} + +"common/on_action/sevenhouses_on_actions.txt" = { + # Disable TFE's anachronistic seven houses mechanic for Persia { - if = { - limit = { - character:armenian_02 = { - is_alive = yes +on_game_start = { + on_actions = { + on_sevenhouses_start + } +} + +on_sevenhouses_start = { + effect = { + add_to_global_variable_list = { + name = seven_houses + target = dynasty:900021 + } + add_to_global_variable_list = { + name = seven_houses + target = dynasty:mihran_dynasty + } + add_to_global_variable_list = { + name = seven_houses + target = dynasty:suren_dynasty + } + add_to_global_variable_list = { + name = seven_houses + target = dynasty:varaz_dynasty + } + add_to_global_variable_list = { + name = seven_houses + target = dynasty:spandiyadh_dynasty + } + add_to_global_variable_list = { + name = seven_houses + target = dynasty:7511 + } + add_to_global_variable_list = { + name = seven_houses + target = dynasty:900018 + } + } + on_actions = { + delay = { days = 1 } + on_three_months_sevenhouses + } + on_actions = { + delay = { days = { 365 420 } } + on_yearly_sevenhouses + } +} + +on_three_months_sevenhouses = { + effect = { + if = { + limit = { + AND = { + exists = title:e_persia.holder + title:e_persia.holder = { + government_has_flag = government_is_eranshar + sevenhouses_enabled = yes + } + } + } + title:e_persia.holder = { + remove_all_character_modifier_instances = sevenhouses_bad_modifier_strong + remove_all_character_modifier_instances = sevenhouses_good_modifier_strong + remove_all_character_modifier_instances = sevenhouses_bad_modifier + remove_all_character_modifier_instances = sevenhouses_good_modifier + remove_all_character_modifier_instances = sevenhouses_bad_modifier_strong_dehqan + remove_all_character_modifier_instances = sevenhouses_good_modifier_strong_dehqan + remove_all_character_modifier_instances = sevenhouses_bad_modifier_dehqan + remove_all_character_modifier_instances = sevenhouses_good_modifier_dehqan + if = { + limit = { + is_target_in_global_variable_list = { + name = unavailable_unique_decisions + target = flag:TFE_instate_dehqans + } + } + if = { + limit = { + sevenhouses_strength_value >= 50 # if strong houses + } + if = { + limit = { + sevenhouses_favor_value < 50 #if sad houses + } + while = { + count = fifty_minus_sevenhouses_favor_value + add_character_modifier = sevenhouses_bad_modifier_strong_dehqan #very bad modifier + } + } + else = { + while = { + count = sevenhouses_favor_value_minus_50 + add_character_modifier = sevenhouses_good_modifier_strong_dehqan #very good modifier + } + } + } + else = { # if weak houses + if = { + limit = { + sevenhouses_favor_value < 50 #if sad houses + } + while = { + count = fifty_minus_sevenhouses_favor_value + add_character_modifier = sevenhouses_bad_modifier_dehqan #bad modifier + } + } + else = { + while = { + count = sevenhouses_favor_value_minus_50 + add_character_modifier = sevenhouses_good_modifier_dehqan #good modifier + } + } + } + } + else = { + if = { + limit = { + sevenhouses_strength_value >= 50 # if strong houses + } + if = { + limit = { + sevenhouses_favor_value < 50 #if sad houses + } + while = { + count = fifty_minus_sevenhouses_favor_value + add_character_modifier = sevenhouses_bad_modifier_strong #very bad modifier + } + } + else = { + while = { + count = sevenhouses_favor_value_minus_50 + add_character_modifier = sevenhouses_good_modifier_strong #very good modifier + } + } + } + else = { # if weak houses + if = { + limit = { + sevenhouses_favor_value < 50 #if sad houses + } + while = { + count = fifty_minus_sevenhouses_favor_value + add_character_modifier = sevenhouses_bad_modifier #bad modifier + } + } + else = { + while = { + count = sevenhouses_favor_value_minus_50 + add_character_modifier = sevenhouses_good_modifier #good modifier + } + } } } - add_courtier = character:armenian_02 } + } + } + on_actions = { + delay = { months = 3 } + on_three_months_sevenhouses } } -"common\casus_belli_types\TFE_event_wars_overflow.txt" = { - { -independence_war_berber = { - icon = independence_faction_war - group = event - ai = no # AI targeting is handled through game_rule events. - - allow_hostages = no - allowed_against_character = { - OR = { - scope:attacker = { - liege = scope:defender +on_yearly_sevenhouses = { + effect = { + if = { + limit = { + AND = { + exists = title:e_persia.holder + title:e_persia.holder = { + government_has_flag = government_is_eranshar + sevenhouses_enabled = yes + any_character_struggle = { + involvement = involved + is_struggle_type = roman_persian_struggle + } + } + } } - scope:attacker = { - top_liege = scope:defender + title:e_persia.holder = { + if = { + limit = { + sevenhouses_favor_value >= 70 + } + struggle:roman_persian_struggle = { + activate_struggle_catalyst = { catalyst = catalyst_high_favor_with_houses character = prev } + } + } + else_if = { + limit = { + sevenhouses_favor_value <= 30 + } + struggle:roman_persian_struggle = { + activate_struggle_catalyst = { catalyst = catalyst_low_favor_with_houses character = prev } + } + } } } } + on_actions = { + delay = { days = { 365 420 } } + on_yearly_sevenhouses + } +} + } +} - cost = { - piety = { - value = 0 + +"common/culture/name_lists/00_celtic.txt" = { + # fix "Unexpected token: prefix, near line: 386" from error.log + { + prefix = yes + } +} + + +"common/scripted_effects/00_mongol_invasion_effects.txt" = { + # Character 125501 (Temujin) is not in TFE as of the 'After The Pharaohs' update. + { + if = { + limit = { + exists = character:125501 + character:125501 = { + is_ai = no + is_landed = yes + } } - prestige = { - value = 0 + character:125501 = { + save_scope_as = temujin + } + scope:temujin = { + # Make temporarily immune to disease + add_character_flag = { + flag = immune_to_disease + years = 15 + } + + add_trait = greatest_of_khans + form_the_mongol_empire_effect = yes + add_prestige = 25000 + give_nickname = nick_genghis_khan + trigger_event = conqueror.0001 } } + else_if = { + limit = { + exists = character:125501 + character:125501 = { is_physically_able_ai_adult = yes } + } + character:125501 = { + save_scope_as = temujin + } + scope:temujin = { + # Make temporarily immune to disease + add_character_flag = { + flag = immune_to_disease + years = 15 + } - on_declaration = { - on_declared_war = yes - # Remove offending HumSac modifiers. - scope:attacker = { - spawn_army = { - name = "Berber Tribesmen" - levies = 1000 - men_at_arms = { - type = bowmen - stacks = 2 - } - men_at_arms = { - type = desert_hussar - stacks = 2 + add_trait = greatest_of_khans + give_temujin_land_effect = yes + add_gold = 5000 + add_dread = high_dread + spawn_temujins_court_effect = yes + form_the_mongol_empire_effect = yes + add_prestige = 25000 + if = { + limit = { NOT = { has_perk = peacemaker_perk } } + add_perk = peacemaker_perk + } + remove_trait = education_diplomacy_1 + remove_trait = education_diplomacy_2 + remove_trait = education_diplomacy_3 + remove_trait = education_diplomacy_4 + remove_trait = education_diplomacy_5 + remove_trait = education_intrigue_1 + remove_trait = education_intrigue_2 + remove_trait = education_intrigue_3 + remove_trait = education_intrigue_4 + remove_trait = education_intrigue_5 + remove_trait = education_stewardship_1 + remove_trait = education_stewardship_2 + remove_trait = education_stewardship_3 + remove_trait = education_stewardship_4 + remove_trait = education_stewardship_5 + remove_trait = education_learning_1 + remove_trait = education_learning_2 + remove_trait = education_learning_3 + remove_trait = education_learning_4 + remove_trait = education_learning_5 + remove_trait = education_martial_1 + remove_trait = education_martial_2 + remove_trait = education_martial_3 + remove_trait = education_martial_4 + add_trait = education_martial_5 + add_trait = flexible_leader + add_trait = athletic + if = { + limit = { has_dlc_feature = tours_and_tournaments } + add_trait = tourney_participant + add_random_tiered_trait_track_xp_effect = { + TRAIT = lifestyle_hunter + TRACK = hunter + LEVEL_1 = yes + LEVEL_3 = no + } + add_random_tiered_trait_track_xp_effect = { + TRAIT = tourney_participant + TRACK = horse + LEVEL_1 = yes + LEVEL_3 = yes + } + add_random_tiered_trait_track_xp_effect = { + TRAIT = tourney_participant + TRACK = bow + LEVEL_1 = yes + LEVEL_3 = yes } - men_at_arms = { - type = light_footmen - stacks = 2 + } + dynasty = { + add_dynasty_prestige_level = 5 + add_dynasty_prestige = 10000 + add_dynasty_perk = warfare_legacy_1 + add_dynasty_perk = warfare_legacy_2 + add_dynasty_perk = warfare_legacy_3 + add_dynasty_perk = warfare_legacy_4 + add_dynasty_perk = warfare_legacy_5 + if = { + limit = { + has_dlc_feature = hybridize_culture + } + add_dynasty_perk = ep1_culture_legacy_1 } - location = province:4601 #Nemancha - inheritable = no - uses_supply = no - war = scope:war } + give_nickname = nick_genghis_khan } - scope:attacker = { - hidden_effect = { fp1_remove_humsac_offended_counties_effect = yes } + } + else_if = { + limit = { + exists = character:125501.dynasty + character:125501.dynasty = { + any_dynasty_member = { + is_ai = no + is_landed = yes + } + } } - war = { - every_war_attacker = { - if = { - limit = { - top_liege = scope:defender - NOT = { culture = { has_same_culture_heritage = liege.culture } } - } - add_character_flag = should_become_independent + character:125501.dynasty = { + random_dynasty_member = { + limit = { + is_ai = no + is_landed = yes } + save_scope_as = temujin + } + } + scope:temujin = { + # Make temporarily immune to disease + add_character_flag = { + flag = immune_to_disease + years = 15 } + + add_trait = greatest_of_khans + form_the_mongol_empire_effect = yes + add_prestige = 25000 + give_nickname = nick_genghis_khan + trigger_event = conqueror.0001 } } + else_if = { + limit = { + exists = character:125501.dynasty + character:125501.dynasty = { + any_dynasty_member = { + is_physically_able_ai_adult = yes + } + } + } + character:125501.dynasty = { + random_dynasty_member = { + limit = { + is_physically_able_ai_adult = yes + is_landed = yes + } + alternative_limit = { + is_physically_able_ai_adult = yes + } + save_scope_as = temujin + } + } + scope:temujin = { + # Make temporarily immune to disease + add_character_flag = { + flag = immune_to_disease + years = 15 + } - on_victory_desc = { - first_valid = { - triggered_desc = { - trigger = { # Desc for only one player attacker - scope:attacker = { - is_local_player = yes - } + add_trait = greatest_of_khans + give_temujin_land_effect = yes + add_gold = 5000 + add_dread = high_dread + spawn_temujins_court_effect = yes + form_the_mongol_empire_effect = yes + add_prestige = 25000 + if = { + limit = { NOT = { has_perk = peacemaker_perk } } + add_perk = peacemaker_perk + } + remove_trait = education_diplomacy_1 + remove_trait = education_diplomacy_2 + remove_trait = education_diplomacy_3 + remove_trait = education_diplomacy_4 + remove_trait = education_diplomacy_5 + remove_trait = education_intrigue_1 + remove_trait = education_intrigue_2 + remove_trait = education_intrigue_3 + remove_trait = education_intrigue_4 + remove_trait = education_intrigue_5 + remove_trait = education_stewardship_1 + remove_trait = education_stewardship_2 + remove_trait = education_stewardship_3 + remove_trait = education_stewardship_4 + remove_trait = education_stewardship_5 + remove_trait = education_learning_1 + remove_trait = education_learning_2 + remove_trait = education_learning_3 + remove_trait = education_learning_4 + remove_trait = education_learning_5 + remove_trait = education_martial_1 + remove_trait = education_martial_2 + remove_trait = education_martial_3 + remove_trait = education_martial_4 + add_trait = education_martial_5 + add_trait = flexible_leader + add_trait = athletic + if = { + limit = { has_dlc_feature = tours_and_tournaments } + add_trait = tourney_participant + add_random_tiered_trait_track_xp_effect = { + TRAIT = lifestyle_hunter + TRACK = hunter + LEVEL_1 = yes + LEVEL_3 = no + } + add_random_tiered_trait_track_xp_effect = { + TRAIT = tourney_participant + TRACK = horse + LEVEL_1 = yes + LEVEL_3 = yes + } + add_random_tiered_trait_track_xp_effect = { + TRAIT = tourney_participant + TRACK = bow + LEVEL_1 = yes + LEVEL_3 = yes } - desc = independence_war_victory_desc_local_player_attacker_alone } - triggered_desc = { # Desc for only one attacker, player defender - trigger = { - scope:defender = { - is_local_player = yes + dynasty = { + add_dynasty_prestige_level = 5 + add_dynasty_prestige = 10000 + add_dynasty_perk = warfare_legacy_1 + add_dynasty_perk = warfare_legacy_2 + add_dynasty_perk = warfare_legacy_3 + add_dynasty_perk = warfare_legacy_4 + add_dynasty_perk = warfare_legacy_5 + if = { + limit = { + has_dlc_feature = hybridize_culture } + add_dynasty_perk = ep1_culture_legacy_1 } - desc = player_independence_war_victory_desc_local_player_defender_attacker_alone } - desc = independence_war_victory_desc_local_player_attacker_alone # Desc for a third party involved + give_nickname = nick_genghis_khan } + } + } +} + +"common/coat_of_arms/coat_of_arms/new_landed_titles.txt" = { + # No ce_gaetulia.dds in TFE as of the 'After The Pharaohs' update. + { + colored_emblem = { + texture = "ce_gaetulia.dds" + color1 = "yellow" + color2 = "white" + instance = { position = { 0.5 0.5 } scale = { 1.0 1.0 } } + } } - on_victory = { - scope:attacker = { show_pow_release_message_effect = yes } + # Fix "Unexpected token: custom" from error.log + { +custom=yes + } +} - #EP2 Accolade glory gain from winning against higher ranked enemy - scope:attacker = { accolade_attacker_war_end_glory_gain_med_effect = yes } - create_title_and_vassal_change = { - type = independency - save_scope_as = change - } - if = { - # Free character with the flag - limit = { exists = war } - war = { - every_war_attacker = { - if = { - limit = { - has_character_flag = should_become_independent - top_liege = scope:defender - } +"common/coat_of_arms/coat_of_arms/new_dynasties.txt" = { + # No ce_eagle_islam.dds in TFE as of the 'After The Pharaohs' update. + { + colored_emblem = { + texture = "ce_eagle_islam.dds" + color1 = "yellow" + instance = { position = { 0.5 0.5 } scale = { 1.0 1.0 } } + } + } - create_title_and_vassal_change = { - type = independency - save_scope_as = going_independent - add_claim_on_loss = no - } - becomes_independent = { - change = scope:going_independent - } + # No ce_cross.dds in TFE as of the 'After The Pharaohs' update. + { + colored_emblem = { + texture = "ce_cross.dds" + color1 = "yellow" + color2 = "yellow" + instance = { position = { 0.5 0.5 } scale = { 1.0 1.0 } } + } + } - resolve_title_and_vassal_change = scope:going_independent + # No color gray in TFE as of the 'After The Pharaohs' update. + { +sisenanding = { + pattern = "pattern_solid.dds" + color1 = "gray" + color2 = "gray" + colored_emblem = { + texture = "ce_snake.dds" + color1 = "yellow" + color2 = "red" + instance = { position = { 0.5 0.5 } scale = { 0.9 0.9 } } + } +} + } - add_truce_both_ways = { - character = scope:defender - days = 1825 - war = root.war - result = victory - } + # ck3-tiger: 2 errors as of the TFE 'After The Pharaohs' update. + { +900077 = { + pattern = "pattern_solid.dds" + color1 = "red" + colored_emblem = { + texture = "ce_horse_statant.dds" + color1 = "yellow" + color2 = "brown" + instance = { position = { 0.5 0.5 } scale = { 1.0 1.0 } } + } + colored_emblem = { + texture = "ce_antler.dds" + color1 = "yellow" + color2 = "brown" + instance = { position = { 0.7.5 0.2 } scale = { 0.5 0.5 } } + } +} + } - remove_character_flag = should_become_independent + # Fix broken syntax for 7632 dynasty CoA. + { + Pharamonderic + } - change_liege_or_become_independent = { - CHANGE = scope:change - VASSAL = this - } + # Fix "Unexpected token: custom" from error.log + { + custom=yes + } +} - hidden_effect = { - set_variable = { - name = independence_war_former_liege - value = scope:defender - } - save_scope_as = current_member +"common/game_concepts/TFE_game_concepts.txt" = { + # The converter removes eastern_iranian_struggle. + { +eastern_iranian_struggle = { + #alias = { struggle_region_region } + parent = struggle +} - # Struggle Catalyst - if = { - limit = { - catalyst_gave_independence_to_powerful_diff_faith_culture_vassal_preliminary_trigger = { - CHAR1 = scope:defender - CHAR2 = scope:current_member - } - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal - CHAR = scope:current_member - } - } - } - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_either_trigger = { - CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal - CHAR = scope:current_member - } - } - activate_struggle_catalyst = { - catalyst = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal - character = scope:defender - } - } - } - } - } - } - } - } +struggle_phase_eastern_iranian_expansion = { + texture = "gfx/interface/icons/struggle_types/struggle_TFE_eastern_iranian_phase_migration.dds" + parent = eastern_iranian_struggle +} - scope:defender = { - # Struggle Catalyst - hidden_effect = { - if = { - limit = { - catalyst_gave_independence_to_powerful_diff_faith_culture_vassal_preliminary_trigger = { - CHAR1 = scope:defender - CHAR2 = scope:attacker - } - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal - CHAR = scope:attacker - } - } - } - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_either_trigger = { - CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal - CHAR = scope:attacker - } - } - activate_struggle_catalyst = { - catalyst = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal - character = scope:defender - } - } - } - } - } - resolve_title_and_vassal_change = scope:change +struggle_phase_eastern_iranian_hostility = { + texture = "gfx/interface/icons/struggle_types/struggle_TFE_eastern_iranian_phase_hostility.dds" + parent = eastern_iranian_struggle +} + +struggle_phase_eastern_iranian_compromise = { + texture = "gfx/interface/icons/struggle_types/struggle_TFE_eastern_iranian_phase_compromise.dds" + parent = eastern_iranian_struggle +} +struggle_phase_eastern_iranian_development = { + texture = "gfx/interface/icons/struggle_types/struggle_TFE_eastern_iranian_phase_conciliation.dds" + parent = eastern_iranian_struggle +} } - on_white_peace_desc = { - first_valid = { - triggered_desc = { - trigger = { scope:defender = { is_local_player = yes } } - desc = player_independence_war_white_peace_defender_desc - } - triggered_desc = { - trigger = { - scope:attacker = { - is_local_player = yes - } - } - desc = player_independence_war_white_peace_attacker_desc - } - desc = player_independence_war_white_peace_desc - } + { +silk_road_urbanization = { + alias = { silk_road_urbanization_short silk_road_urbanize } + parent = eastern_iranian_struggle + texture = "gfx/interface/icons/council_task_types/task_develop_county.dds" +} + } +} + +"common/governments/other_government.txt" = { + # Not defined in TFE as of the 'After The Pharaohs' update. + { + clan_government_obligations } +} - on_white_peace = { - scope:attacker = { - show_pow_release_message_effect = yes - stress_impact = { - ambitious = medium_stress_impact_gain - arrogant = medium_stress_impact_gain - } - } - hidden_effect = { - scope:attacker = { - add_truce_both_ways = { - character = scope:defender - days = 1825 - war = root.war - result = white_peace - } - } - } - scope:defender = { - add_prestige = minor_prestige_value - stress_impact = { - arrogant = medium_stress_impact_gain - } - } +"events/dharma_dravidian.txt" = { + # ck3-tiger: "`event_background` now causes a crash. It has been replaced by `reference` since 1.9" + { + override_background = { event_background = throne_room } + } + { + override_background = { event_background = cliff_temple } } +} + + +"events/decisions_events/middle_europe_decisions_events.txt" = { + # Uses k_sorbia which is not in TFE as of the 'After The Pharaohs' update. + { +################################################## +# Establish the Electorate of Saxony +# by James Beaumont +################################################## + +scripted_trigger middle_europe_decisions_0017_most_powerful_saxon_vassal_trigger = { + highest_held_title_tier = tier_duchy + any_sub_realm_county = { kingdom = title:k_sorbia } +} - on_defeat_desc = { - first_valid = { - triggered_desc = { - trigger = { scope:defender = { is_local_player = yes } } - desc = player_independence_defeat_defender_desc - } - triggered_desc = { - trigger = { - scope:attacker = { - is_local_player = yes - } - } - desc = player_independence_defeat_attacker_desc - } - desc = player_independence_war_defeat_desc - } +scripted_trigger middle_europe_decisions_0017_get_theocratic_vassal_trigger = { + government_has_flag = government_is_theocracy + any_sub_realm_county = { kingdom = title:k_sorbia } +} + +scripted_trigger middle_europe_decisions_0017_get_appropriate_courtier_trigger = { + is_available_ai_adult = yes +} +# Electorate of Saxony event +middle_europe_decisions.0017 = { + type = character_event + title = middle_europe_decisions.0017.t + desc = middle_europe_decisions.0017.desc + theme = realm + left_portrait = { + character = scope:founder + animation = personality_bold } + lower_left_portrait = scope:left_portrait + lower_center_portrait = scope:centre_portrait + lower_right_portrait = scope:right_portrait - on_defeat = { - scope:attacker = { show_pow_release_message_effect = yes } - scope:defender = { - add_dread = medium_dread_gain - # Prestige for Defender - add_prestige_war_defender_effect = { - PRESTIGE_VALUE = medium_prestige_value - } - } + immediate = { + # Get the most powerful vassal in Saxony that is not already a king if = { - limit = { exists = war } - war = { - every_war_attacker = { - limit = { - top_liege = scope:defender - } - hard_imprison_character_effect = { - TARGET = this - IMPRISONER = scope:defender - } - scope:defender = { - add_opinion = { - target = prev - modifier = vassal_lost_faction_revolt_war + limit = { + any_vassal = { middle_europe_decisions_0017_most_powerful_saxon_vassal_trigger = yes } + } + ordered_vassal = { + limit = { middle_europe_decisions_0017_most_powerful_saxon_vassal_trigger = yes } + order_by = { + every_held_title = { + limit = { + tier = tier_county + kingdom = title:k_sorbia } + add = 1 } } + position = 0 + save_scope_as = most_powerful_saxon } } + # Get a theocratic vassal in Saxony if = { limit = { - character:thracio_03 = { - is_landed = yes - top_liege = scope:defender - is_imprisoned = yes - } + any_vassal = { middle_europe_decisions_0017_get_theocratic_vassal_trigger = yes } } - character:thracio_03 = { - depose = yes - release_from_prison = yes + random_vassal = { + limit = { middle_europe_decisions_0017_get_theocratic_vassal_trigger = yes} + save_scope_as = saxon_bishop } } + # Get my heir if = { limit = { - exists = title:k_mauro_roman_kingdom.holder - } - title:k_mauro_roman_kingdom.holder = { - add_courtier = character:thracio_03 - } - character:thracio_03 = { - add_unpressed_claim = title:k_mauro_roman_kingdom + exists = player_heir + player_heir = { + liege = root + OR = { + any_county_in_region = { + region = custom_polabia + holder = root + } + player_heir = { highest_held_title_tier >= tier_county } + } + } } + player_heir = { save_scope_as = heir_scope } } + # Get a courtier if = { limit = { - war = { - any_war_attacker = { has_title = title:d_avaritana } - } - war = { - any_war_defender = { has_title = title:d_zaba } + any_courtier = { + count >= 1 } } - create_title_and_vassal_change = { - type = swear_fealty - save_scope_as = change - add_claim_on_loss = no - } - - if = { + random_courtier = { limit = { - title:d_avaritana.holder.primary_title.tier < title:d_zaba.holder.primary_title.tier - } - title:d_avaritana.holder = { - change_liege = { - liege = title:d_zaba.holder - change = scope:change + any_relation = { + type = friend + this = scope:founder } + middle_europe_decisions_0017_get_appropriate_courtier_trigger = yes } + alternative_limit = { middle_europe_decisions_0017_get_appropriate_courtier_trigger = yes } + save_scope_as = rando_courtier_scope } - else = { - title:d_avaritana.holder = { - every_held_title = { - if = { - limit = { - tier = title:d_avaritana.holder.primary_title.tier - } - change_title_holder = { - holder = title:d_zaba.holder - change = scope:change - } - } - else_if = { - limit = { - OR = { - NOT = { exists = scope:secondary_title } - tier > scope:secondary_title.tier - } - } - save_temporary_scope_as = secondary_title - } - } - } - - title:d_avaritana.holder = { - if = { - limit = { - exists = scope:secondary_title - } - every_vassal = { - limit = { - primary_title.tier >= scope:secondary_title.tier - NOT = { - primary_title.tier = tier_barony - } - } - change_liege = { - liege = title:d_zaba.holder - change = scope:change - } - } - } - } - - title:d_avaritana.holder = { - change_liege = { - liege = title:d_zaba.holder - change = scope:change - } - } + } + ## And if, somehow, there's no courtier, make one. + else = { + create_character = { + gender_female_chance = root_soldier_female_chance + location = root.capital_province + template = soldier_friend_character + save_scope_as = rando_courtier_scope + dynasty = generate } - - resolve_title_and_vassal_change = scope:change - - title:d_avaritana.holder = { - destroy_title = title:d_avaritana + add_courtier = scope:rando_courtier_scope + } + # Set up portraits. + ## Are we on the courtier fallback? If so, only gimme the one. + if = { + limit = { + NOT = { + exists = scope:heir_scope + exists = scope:most_powerful_saxon + exists = scope:saxon_bishop + } } + scope:rando_courtier_scope = { save_scope_as = centre_portrait } + } + ## Otherwise, trying and set up as many of the three as we can. + if = { + limit = { exists = scope:heir_scope } + scope:heir_scope = { save_scope_as = left_portrait } + } + if = { + limit = { exists = scope:most_powerful_saxon } + scope:most_powerful_saxon = { save_scope_as = centre_portrait } + } + if = { + limit = { exists = scope:saxon_bishop } + scope:saxon_bishop = { save_scope_as = right_portrait } } } - on_invalidated_desc = msg_invalidate_war_title - - check_defender_inheritance_validity = no - - on_primary_attacker_death = inherit - on_primary_defender_death = inherit + # I am great + option = { + name = middle_europe_decisions.0017.a + trigger = { + NOT = { has_title = title:e_hre } + } + create_kingdom_of_saxony_effect = { CHARACTER = root } + ai_chance = { + # If you've got the option, nab it. + base = 1000 + } + } - attacker_allies_inherit = yes - defender_allies_inherit = yes + # I give it to my beloved heir + option = { + name = middle_europe_decisions.0017.b + trigger = { + has_title = title:e_hre + exists = scope:heir_scope + } + create_kingdom_of_saxony_effect = { CHARACTER = scope:heir_scope } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_rationality = 0.5 + ai_honor = 0.5 + } + } + } - transfer_behavior = transfer + # I give it to a powerful Saxon + option = { + name = middle_europe_decisions.0017.c + trigger = { + has_title = title:e_hre + exists = scope:most_powerful_saxon + } + create_kingdom_of_saxony_effect = { CHARACTER = scope:most_powerful_saxon } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_rationality = 0.5 + ai_boldness = -0.25 + } + } + } - war_name = "INDEPENDENCE_WAR_NAME" + # I give it to the church + option = { + name = middle_europe_decisions.0017.d + trigger = { + has_title = title:e_hre + exists = scope:saxon_bishop + } + create_kingdom_of_saxony_effect = { CHARACTER = scope:saxon_bishop } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_zeal = 1 + ai_greed = -0.5 + } + } + } - interface_priority = 120 + # I give it to some rando + option = { + name = middle_europe_decisions.0017.e + trigger = { + has_title = title:e_hre + NOT = { + # Player heir not valid + exists = scope:heir_scope + # There are no vassals in Saxony + exists = scope:most_powerful_saxon + # There is no bishop in Saxony + exists = scope:saxon_bishop + } + } + create_kingdom_of_saxony_effect = { CHARACTER = scope:rando_courtier_scope } + ai_chance = { + # No need to modify, as it'll be your only action if you've got it (generally). + base = 100 + } + } +} - attacker_wargoal_percentage = 0.8 +# Electorate of Saxony event +middle_europe_decisions.0018 = { + type = character_event + title = middle_europe_decisions.0017.t + desc = middle_europe_decisions.0018.desc + theme = realm + left_portrait = { + character = scope:new_saxon_king + animation = personality_bold + } - max_attacker_score_from_battles = 100 - max_defender_score_from_battles = 50 - - max_defender_score_from_occupation = 150 - max_attacker_score_from_occupation = 150 + immediate = { + show_as_tooltip = { + create_kingdom_of_saxony_effect = { CHARACTER = scope:new_saxon_king } + } + } - max_ai_diplo_distance_to_title = 500 + # I am great + option = { + name = { + trigger = { has_title = title:k_saxony } + text = middle_europe_decisions.0018.a.new_king + } + name = { + trigger = { + OR = { + is_vassal_or_below_of = title:e_west_slavia.holder + title:e_west_slavia = { is_de_jure_liege_or_above_target = prev } + } + } + text = middle_europe_decisions.0018.a.slav + } + name = { + trigger = {} + text = middle_europe_decisions.0018.a + } + ai_chance = { + base = 100 + } + } } } } -"common/scripted_effects/TFE_invasion_effects.txt" = { + +"common/scripted_effects/00_major_decisions_scripted_effects.txt" = { + # Uses k_sorbia which is not in TFE as of the 'After The Pharaohs' update. { -lost_radagaisus_invasion_effect = { +create_kingdom_of_saxony_effect = { if = { limit = { - exists = title:k_goths.holder + NOR = { + root = $CHARACTER$ + exists = scope:new_saxon_king + } } - title:k_goths.holder = { - if = { # Imprison them if they aren't imprisoned. + # Grant every held title in Saxony to the new holder + root = { + every_held_title = { limit = { - is_imprisoned = no - character:900062 = { - is_alive = yes + OR = { + title:k_saxony = { is_de_jure_liege_or_above_target = prev } + title:k_sorbia = { is_de_jure_liege_or_above_target = prev } + } + NOT = { + holder = { capital_county = prev } } } - - hard_imprison_character_effect = { - TARGET = this - IMPRISONER = character:900062 + create_title_and_vassal_change = { + type = granted + save_scope_as = title_change + add_claim_on_loss = no } - trigger_event = { - id = gothic_wars.0016 - days = 7 + change_title_holder = { + holder = $CHARACTER$ + change = scope:title_change } + resolve_title_and_vassal_change = scope:title_change } - else = { - limit = { - is_imprisoned = no + } + } + if = { + limit = { exists = title:k_sorbia.holder } + destroy_title = title:k_sorbia + } + title:k_sorbia = { + every_in_de_jure_hierarchy = { + limit = { tier = tier_duchy } + set_de_jure_liege_title = title:k_saxony + } + } + title:k_saxony = { set_coa = k_saxon_electorate } + title:k_saxony = { set_de_jure_liege_title = title:e_hre } + create_title_and_vassal_change = { + type = created + save_scope_as = title_change + add_claim_on_loss = no + } + if = { + limit = { + has_title = title:e_hre + } + hidden_effect = { + title:k_saxony = { + change_title_holder = { + holder = $CHARACTER$ + change = scope:title_change + } + } + } + } + else = { + title:k_saxony = { + change_title_holder = { + holder = $CHARACTER$ + change = scope:title_change + } + } + } + every_vassal = { + limit = { + primary_title = { + OR = { + title:k_saxony = { is_de_jure_liege_or_above_target = prev } + title:k_sorbia = { is_de_jure_liege_or_above_target = prev } + } + } + NOT = { this = $CHARACTER$ } + NOT = { any_liege_or_above = { this = $CHARACTER$ } } + } + change_liege = { + liege = $CHARACTER$ + change = scope:title_change + } + } + hidden_effect = { + if = { + limit = { + NOR = { + $CHARACTER$ = root + $CHARACTER$ = { is_vassal_or_below_of = root } + } + } + $CHARACTER$ = { + change_liege = { + liege = root + change = scope:title_change } - hard_imprison_character_effect = { - TARGET = this - IMPRISONER = scope:defender + } + } + } + resolve_title_and_vassal_change = scope:title_change + hidden_effect = { + $CHARACTER$ = { save_scope_as = new_saxon_king } + every_player = { + limit = { + NOT = { this = prev } + or = { + is_vassal_or_below_of = title:e_hre.holder + AND = { + exists = title:e_west_slavia + is_vassal_or_below_of = title:e_west_slavia.holder + } + title:e_hre = { is_neighbor_to_realm = prev } + primary_title = { + title:e_west_slavia = { is_de_jure_liege_or_above_target = prev } + } } } + trigger_event = middle_europe_decisions.0018 } } } } } -"common\decisions\TFE_major_decisions_south_asia.txt" = { - { -# Restore the main branch of the Vakataka Dynasty - -reclaim_vakataka_decision = { - picture = { - reference = "gfx/interface/illustrations/decisions/decision_dynasty_house.dds" - } - decision_group_type = major - - desc = reclaim_vakataka_decision_desc - selection_tooltip = reclaim_vakataka_decision_tooltip - - ai_check_interval = 120 - is_shown = { - dynasty = dynasty:900024 - NOT = { house = character:900900.house } #Not a member of the OG Vakatakas - NOT = { - is_target_in_global_variable_list = { - name = unavailable_unique_decisions - target = flag:reclaim_vakataka_decision +"common/scripted_effects/TFE_decisions_central_asia_effects.txt" = { + { + title:k_transoxania = { + if = { + limit = { + NOT = { is_in_list = new_de_jure_kingdoms } + } + add_to_list = new_de_jure_kingdoms } } } +} - is_valid = { - is_independent_ruler = yes - prestige_level >= 4 - completely_controls = title:k_maharastra - completely_controls = title:k_telingana - completely_controls = title:k_karnata - } - - is_valid_showing_failures_only = { - is_available_adult = yes - is_landed_or_landless_administrative = yes - } - - cost = { - prestige = 850 - piety = 500 - } - effect = { - hidden_effect = { ROOT.house = { every_house_member = { set_house = character:900900.house } } } - set_house = character:900900.house - add_pressed_claim = title:e_deccan - add_pressed_claim = title:k_gondwana - add_pressed_claim = title:d_jejakabhukti - add_pressed_claim = title:d_akara_dasarna - save_scope_as = founder - trigger_event = { - id = tfe_south_asia_decision.2001 - } - #Notify other Vakatakas - every_player = { - limit = { - dynasty = dynasty:900024 - } - trigger_event = tfe_south_asia_decision.2002 - } - } +"common/scripted_effects/03_dlc_fp3_scripted_effects.txt" = { + { + # Are we Ismailis? + else_if = { + limit = { faith = faith:ismaili } + # Transfer the title. + create_title_and_vassal_change = { + type = created + save_scope_as = change + add_claim_on_loss = no + } + title:d_ismaili = { + change_title_holder = { + holder = scope:founder + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + faith = { set_religious_head_title = title:d_ismaili } - hidden_effect = { - add_to_global_variable_list = { - name = unavailable_unique_decisions - target = flag:reclaim_vakataka_decision + # Set up the remaining bits'n'bobs. + if = { + limit = { + NOT = { has_realm_law = same_faith_succession_law } + } + add_realm_law_skip_effects = same_faith_succession_law + } + title:d_ismaili = { add_title_law = temporal_head_of_faith_succession_law } + # Make it the HoF head. } - } - - ai_potential = { - always = yes - } - - ai_will_do = { - base = 100 } } - } + + +"common/decisions/00_major_decisions_east_europe.txt" = { + # ck3-tiger: "unknown token `custom_prussia`". This is a TFE error as of the 'After The Pharaohs' update. { -#Restore the Three Crowned Kings -muvendhar_restoration_decision = { +# Basically same as founding Livonia +found_kingdom_of_prussia_decision = { picture = { - reference = "gfx/interface/illustrations/decisions/decision_dynasty_house.dds" + reference = "gfx/interface/illustrations/decisions/decision_destiny_goal.dds" } - decision_group_type = cultural - - desc = muvendhar_restoration_decision_desc - selection_tooltip = muvendhar_restoration_decision_tooltip + decision_group_type = major ai_check_interval = 120 + desc = found_kingdom_of_prussia_decision_desc + selection_tooltip = found_kingdom_of_prussia_decision_tooltip + is_shown = { is_ruler = yes - is_landed_or_landless_administrative = yes + is_landed = yes + exists = dynasty OR = { - culture = culture:tamil - culture = culture:malaiya - culture = culture:sinhala - culture = { any_parent_culture_or_above = { this = culture:tamil }} - culture = { any_parent_culture_or_above = { this = culture:malaiya }} - culture = { any_parent_culture_or_above = { this = culture:sinhala }} + #Must be a Prussian or Christian in Prussia + AND = { + #Is a Crusader founding the Kingdom + root.faith = { + NOT = { religion_tag = baltic_religion } + NOT = { has_doctrine = unreformed_faith_doctrine } + } + capital_province = { + geographical_region = ghw_region_baltic + } + } + #Or just be Prussian. + culture = { has_name_list = name_list_prussian } } - NOT = { + NOT = { #You can only do it once. is_target_in_global_variable_list = { name = unavailable_unique_decisions - target = flag:muvendhar_restoration_decision + target = flag:flag_founded_kingdom_of_prussia } } + highest_held_title_tier <= tier_duchy } - + is_valid = { - is_independent_ruler = yes - has_title = title:k_tamilakam - prestige_level >= 3 - title:d_chola_nadu.holder.dynasty = dynasty:1043008 - title:d_pandya_nadu.holder.dynasty = dynasty:1043009 - title:d_chera_nadu.holder.dynasty = dynasty:1043010 - NOT = { dynasty = dynasty:900026 } - completely_controls = title:d_chola_nadu - completely_controls = title:d_pandya_nadu - completely_controls = title:d_chera_nadu - } + OR = { #Independent or vassal of an Emperor + is_independent_ruler = yes + top_liege.primary_title.tier >= tier_empire + } + prestige_level >= medium_prestige_level - is_valid_showing_failures_only = { - is_capable_adult = yes - is_imprisoned = no - is_at_war = no + #You must control the kingdom's heartlands. + has_title = title:d_prussia + has_title = title:d_masuria + completely_controls_region = custom_prussia } - cost = { - prestige = 750 - piety = 500 + is_valid_showing_failures_only = { + is_available_adult = yes } effect = { - if = { - limit = { - NOR = { - dynasty = dynasty:1043008 - dynasty = dynasty:1043009 - dynasty = dynasty:1043010 - } - } - dynasty = { add_dynasty_prestige = 500 } - } - dynasty:1043008 = { add_dynasty_prestige = 500 } - dynasty:1043009 = { add_dynasty_prestige = 500 } - dynasty:1043010 = { add_dynasty_prestige = 500 } save_scope_as = founder - trigger_event = tfe_south_asia_decision.4001 + found_kingdom_of_prussia_decision_scripted_effect = yes hidden_effect = { add_to_global_variable_list = { name = unavailable_unique_decisions - target = flag:muvendhar_restoration_decision + target = flag:flag_founded_kingdom_of_prussia } } } - + + cost = { + gold = major_gold_value + } + ai_potential = { always = yes } @@ -4869,1655 +30650,2229 @@ muvendhar_restoration_decision = { } } -"common\decisions\TFE_rome_decisions.txt" = { + +"common/customizable_localization/00_pl_custom_loc_extra.txt" = { + # The file references some titles missing in TFE. { -recall_belisarius = { - picture = { - reference = "gfx/interface/illustrations/decisions/decision_roman_knight.dds" + this = title:d_ismaili } - decision_group_type = roman - - ai_check_interval = 6 + { + #nobles + + this = title:d_nf_ampelas + this = title:d_nf_aplakes + this = title:d_nf_agelastos + this = title:d_nf_doukas + this = title:d_nf_gerontas + this = title:d_nf_hexavoulis + this = title:d_nf_kardias + this = title:d_nf_katakalitzes + this = title:d_nf_kourkouas + this = title:d_nf_krateros + this = title:d_nf_lachanodrakon + this = title:d_nf_makedon + this = title:d_nf_maleios + this = title:d_nf_maleinos + this = title:d_nf_maurikios + this = title:d_nf_melissenos + this = title:d_nf_pastillas + this = title:d_nf_ooryphas + this = title:d_nf_sellokalas + this = title:d_nf_skleros + this = title:d_nf_arcruni + this = title:d_nf_argyros + this = title:d_nf_basiliakos + this = title:d_nf_botaneiates + this = title:d_nf_bryennios + this = title:d_nf_diogenes + this = title:d_nf_dragosevic + this = title:d_nf_kamateros + this = title:d_nf_karandenos + this = title:d_nf_kaukadenos + this = title:d_nf_komnenos + this = title:d_nf_makrembolites + this = title:d_nf_murzuphlos + this = title:d_nf_ouranos + this = title:d_nf_pahlavuni + this = title:d_nf_palaiologos + this = title:d_nf_pegonites + this = title:d_nf_phokas + this = title:d_nf_pleustes + this = title:d_nf_synadenos + this = title:d_nf_tarchaneiotes + this = title:d_nf_taronites + this = title:d_nf_varajnuni + this = title:d_nf_saronites + this = title:d_nf_garidas + this = title:d_nf_areobindenos + this = title:d_nf_alopos + this = title:d_nf_durres + this = title:d_nf_angelos + this = title:d_nf_batatzes + this = title:d_nf_branas + this = title:d_nf_gabras + this = title:d_nf_kamytzes + this = title:d_nf_kantakouzenos + this = title:d_nf_komnenos_doukas + this = title:d_nf_kontostephanos + this = title:d_nf_lampardas + this = title:d_nf_macrodoukas + this = title:d_nf_petraliphas + this = title:d_nf_raoul + this = title:d_nf_rogerios + } + { + this = title:d_laamp_anangapida + this = title:d_laamp_ziyar + this = title:d_laamp_ahwazi + this = title:d_laamp_guttorm + this = title:d_laamp_hrolfr + this = title:d_laamp_ubbe + this = title:d_laamp_enian + this = title:d_laamp_sabbah + this = title:d_laamp_wake + this = title:d_laamp_el_cid + this = title:d_laamp_crispin + this = title:d_laamp_suleyman + this = title:d_laamp_wallada + this = title:d_laamp_danishmend + this = title:d_laamp_voiteh + this = title:d_laamp_aelfwine + this = title:d_laamp_karatzas + this = title:d_laamp_kizil_buga + this = title:d_laamp_ali_ibn_reverter + this = title:d_laamp_andronikos_komnenos + this = title:d_laamp_asen + this = title:d_laamp_mieszko + this = title:d_laamp_raimon_brun + this = title:d_laamp_lalibela + this = title:d_laamp_muhammad_bakhtiyar + this = title:d_laamp_raoul + } +} - desc = recall_belisarius_desc - selection_tooltip = recall_belisarius_tooltip - is_shown = { +"common/scripted_triggers/TFE_hunt_triggers.txt" = { + # No doctrine parameter cannot_hunt in TFE as of the 'After The Pharaohs' update. + { + custom_tooltip = { + text = faith_cannot_hunt_parameter_tt NOT = { - is_target_in_global_variable_list = { - name = unavailable_unique_decisions - target = flag:recall_belisarius - } - } - #OR = { - # root = global_var:justinian - # has_trait = paranoid - #} - has_global_variable = vandalic_war_won - current_date >= 530.1.1 - current_date <= 600.1.1 - OR = { - has_title = title:e_byzantium - has_title = title:e_roman_empire + faith = { has_doctrine_parameter = cannot_hunt } } - exists = title:k_africae.holder - title:k_africae.holder = { - is_vassal_of = root - } - game_start_date = 532.2.1 } - - is_valid = { - character:belisarius_001 = title:k_africae.holder } +} - effect = { - root = { - save_scope_as = emperor - } - title:k_africae.holder = { - save_scope_as = belisarius - } - custom_tooltip = recall_belisarius_warning - character:belisarius_001 = { - add_opinion = { - modifier = angry_opinion - target = root - opinion = -20 + +"common/event_backgrounds/01_event_backgrounds.txt" = { + # error.log error as of TFE 'After The Pharaohs' update: "has_building_gfx trigger [ Unknown gfx culture flag byzantine_building_gfx ]" + { + background = { # EP3 - Byzantium + trigger = { + trigger_if = { + limit = { + NOT = { exists = scope:activity } + } + location.culture ?= { has_building_gfx = byzantine_building_gfx } } - trigger_event = { - id = western_roman.0044 - days = 1 + trigger_else = { + scope:activity.activity_location.culture ?= { has_building_gfx = byzantine_building_gfx } } } - add_to_global_variable_list = { - name = unavailable_unique_decisions - target = flag:recall_belisarius - } + reference = "gfx/interface/illustrations/event_scenes/ep3_feast_byzantine.dds" + environment = "environment_ep3_byzantine_feast" + ambience = "event:/SFX/Events/Backgrounds/feasthall" + } } - cost = { - prestige = { - if = { - limit = { - is_ai = no - } - add = { - value = 500 + { + background = { # EP3 - Byzantium + trigger = { + trigger_if = { + limit = { exists = scope:bg_override_char } + scope:bg_override_char = { + location.culture = { has_building_gfx = byzantine_building_gfx } } } - } - gold = { - if = { - limit = { - is_ai = no - } - add = { - value = 250 - } + trigger_else = { + location.culture = { has_building_gfx = byzantine_building_gfx } } } + reference = "gfx/interface/illustrations/event_scenes/ep3_feast_byzantine.dds" + environment = "environment_ep3_byzantine_feast" + ambience = "event:/SFX/Events/Backgrounds/feasthall" + } + } + + { + background = { + trigger = { + location.culture = { has_building_gfx = byzantine_building_gfx } + } + reference = "gfx/interface/illustrations/event_scenes/ep3_relaxing_room.dds" + environment = "environment_ep3_relaxing_room" + ambience = "event:/DLC/EP3/SFX/Events/Event_Images/ep3_evn_eventimage_byzantine_relaxing_room" + } } - ai_potential = { - is_at_war = no + { + background = { # Byzantium + trigger = { + location.culture ?= { has_building_gfx = byzantine_building_gfx } + } + reference = "gfx/interface/illustrations/event_scenes/ep3_feast_byzantine.dds" + environment = "environment_ep3_byzantine_feast" + ambience = "event:/SFX/Events/Backgrounds/feasthall" } - ai_will_do = { - base = 100 + } + + # No building rock_of_gibraltar_01 in TFE as of the 'After The Pharaohs' update. + { + has_building_or_higher = rock_of_gibraltar_01 } } + + +"common/customizable_localization/00_building_custom_localization.txt" = { + # No building rock_of_gibraltar_01 in TFE as of the 'After The Pharaohs' update. + { + text = { # Gibraltar + trigger = { + has_special_building = yes + has_building = rock_of_gibraltar_01 + #this = province:1845 # Algeciras + } + localization_key = building_rock_of_gibraltar_01 } - + } +} + + +"history/characters/aegyptian.txt" = { + # Character aegyptus_87 has broken syntax as of TFE 'After The Pharaohs' update. { -start_amalasuntha_coup = { - picture = { - reference = "gfx/interface/illustrations/decisions/decision_destiny_goal.dds" + Simokattes } - decision_group_type = roman +} - ai_goal = yes - desc = start_amalasuntha_coup_desc - selection_tooltip = start_amalasuntha_coup_tooltip +"history/characters/greek.txt" = { + # Character 70506 has broken syntax as of TFE 'After The Pharaohs' update. + { + Rhinotmetos + } +} - is_shown = { - OR = { - has_title = title:e_byzantium - has_title = title:e_roman_empire - } - NOT = { - exists = global_var:gothic_war_declared - } - exists = global_var:amalasuntha_coup_unlock - current_date >= 530.1.1 - current_date <= 600.1.1 - NOT = { - is_target_in_global_variable_list = { - name = unavailable_unique_decisions - target = flag:started_gothic_war - } - } - character:992020 = { - is_alive = yes - liege = title:k_ostrogoths.holder + +"common/achievements/ep3_achievements.txt" = { + # Characters 34281 and 215009 are missing from TFE as of the 'After The Pharaohs' update. + { + this = character:34281 + this = character:215009 + } + + # Character 466517 is missing from TFE as of the 'After The Pharaohs' update. + { + custom_description = { + text = tamar_mepe_achievement_trigger + this = character:466517 + completely_controls = title:k_georgia + completely_controls = title:k_armenia + completely_controls = title:k_daylam } - title:k_ostrogoths.holder = { - has_active_diarchy = yes - diarch = character:992020 + } + { + this = character:466517 + } + + # Character 41702 is missing from TFE as of the 'After The Pharaohs' update. + { + custom_description = { + text = the_old_man_of_the_mountain_achievement_trigger + this = character:41702 + exists = global_var:finished_the_old_man_of_the_mountain_achievement } - game_start_date = 532.2.1 } +} - is_valid = { - trigger_if = { - limit = { - is_ai = yes - } - is_at_war = no + +"common/achievements/standard_achievements.txt" = { + # Character 6878 is missing from TFE as of the 'After The Pharaohs' update. + { + character:6878 = { + is_alive = yes + is_ai = no } - trigger_if = { - limit = { - is_ai = yes - character:belisarius_001 = { - is_ai = no - } - } - is_target_in_global_variable_list = { - name = unavailable_unique_decisions - target = flag:recall_belisarius + } + { + custom_description = { + text = going_places_achievement_trigger + highest_held_title_tier >= tier_kingdom + character:6878 = { + is_alive = yes + is_ai = no } } } +} - effect = { - root = { - save_scope_as = emperor - trigger_event = { - id = germanic_events.0033 - days = 1 - } - } - custom_tooltip = gothic_war_belisarius_warning - add_to_global_variable_list = { - name = unavailable_unique_decisions - target = flag:started_gothic_war - } + +"common/activities/activity_types/monument_expedition.txt" = { + # No building rock_of_gibraltar_01 in TFE as of the 'After The Pharaohs' update. + { + has_building_or_higher = rock_of_gibraltar_01 } +} - cost = { - prestige = { - if = { - limit = { - is_ai = no - } - add = { - value = 250 - } - } + +"common\customizable_localization\00_travel.txt" = { + # No building rock_of_gibraltar_01 in TFE as of the 'After The Pharaohs' update. + { + text = { # Gibraltar + trigger = { + has_special_building = yes + has_building_or_higher = rock_of_gibraltar_01 + #this = province:1845 # Algeciras } + localization_key = building_rock_of_gibraltar_destination_desc } + } +} - ai_potential = { - always = yes + +"common/scripted_triggers/00_illustration_triggers.txt" = { + # Missing building gfx as of TFE 'After The Pharaohs' update + { + has_building_gfx = dravidian_building_gfx } - ai_will_do = { - base = 100 + { + has_building_gfx = ainu_building_gfx } -} + { + has_building_gfx = japanese_building_gfx } - { -vandalic_war = { - picture = { - reference = "gfx/interface/illustrations/decisions/decision_vandalic_war.dds" + has_building_gfx = korean_building_gfx } - decision_group_type = roman + { + has_building_gfx = korean_building_gfx + } + { + has_building_gfx = siberian_building_gfx + } + { + has_building_gfx = vietnamese_building_gfx + } + { + has_building_gfx = byzantine_building_gfx + } + { + has_building_gfx = caucasian_building_gfx + } + { + has_building_gfx = bulgarian_building_gfx + } + { + has_building_gfx = hausa_building_gfx + } + { + has_building_gfx = somalian_building_gfx + } + { + has_building_gfx = cemanahuac_building_gfx + } + { + has_building_gfx = haudenosaunee_building_gfx + } + { + has_building_gfx = tawantinsuyu_building_gfx + } + { + has_building_gfx = thule_building_gfx + } +} - ai_check_interval = 12 - desc = vandalic_war_desc - selection_tooltip = vandalic_war_tooltip +"common/activities/activity_types/TFE_activity_races.txt" = { + # error.log: "Compiling source for is_diff_faith_or_culture_trigger failed for unknown arguments: STRUGGLE_TYPE. At common/scripted_triggers" + { + STRUGGLE_TYPE = iberian_struggle + } +} - is_shown = { - NOT = { - is_target_in_global_variable_list = { - name = unavailable_unique_decisions - target = flag:vandalic_war - } - } - exists = title:k_vandals - has_title = title:e_byzantium - current_date >= 530.1.1 - game_start_date = 532.2.1 - OR = { - character:vandals_005 = { - is_alive = yes - } - AND = { - current_date <= 550.1.1 - any_courtier = { - has_claim_on = title:k_vandals - } - } + +"gfx/interface/illustrations/scripted_illustrations/ingame.txt" = { + # No byzantine_building_gfx in TFE as of the 'After The Pharaohs' update. + { + # feast, byzantine + texture = { + reference = "event_scenes/ep3_feast_byzantine.dds" + + trigger = { + involved_activity ?= { has_activity_type = activity_feast } + location ?= involved_activity.activity_location + involved_activity.activity_location.culture = { has_building_gfx = byzantine_building_gfx } } } + } +} - effect = { - custom_tooltip = vandalic_war_decision_1 - custom_tooltip = vandalic_war_decision_2 - custom_tooltip = vandalic_war_decision_3 - hidden_effect = { - every_vassal = { - add_opinion = { - modifier = respect_opinion - target = root - opinion = -20 - } - } - add_to_global_variable_list = { - name = unavailable_unique_decisions - target = flag:vandalic_war - } - trigger_event = { - id = western_roman.0039 - days = 1 - } +"common/activities/activity_types/feast.txt" = { + # No byzantine_building_gfx in TFE as of the 'After The Pharaohs' update. + { + background = { # EP3 + trigger = { + activity_location.culture = { has_building_gfx = byzantine_building_gfx } } + texture = "gfx/interface/illustrations/event_scenes/ep3_feast_byzantine.dds" + environment = "environment_ep3_byzantine_feast" + ambience = "event:/SFX/Events/Backgrounds/corner_of_tavern" + } } +} - cost = { - prestige = { - if = { - limit = { - is_ai = no - } - add = { - value = 750 - } - } - } - gold = { - if = { - limit = { - is_ai = no - } - add = { - value = 250 - } - } - } + +"common/scripted_triggers/07_ep3_triggers.txt" = { + # No byzantine_building_gfx in TFE as of the 'After The Pharaohs' update. + { +ep3_should_use_byzantine_graphics_trigger = { + culture = { has_building_gfx = byzantine_building_gfx } +} } +} - ai_potential = { - always = yes + +"gfx/interface/illustrations/scripted_illustrations/main_menu.txt" = { + # These use ep3_should_use_byzantine_graphics_trigger which is removed above. + { + texture = { + reference = "main_menu/ep3_frontend_byzantine.dds" + + trigger = { + ep3_should_use_byzantine_graphics_trigger = yes + } } - ai_will_do = { - base = 100 + environment = { + reference = "environment_ep3_frontend_byzantine_main" + + trigger = { + ep3_should_use_byzantine_graphics_trigger = yes + } } + } +} + +"common/scripted_triggers/00_artifact_triggers.txt" = { + # No byzantine_building_gfx in TFE as of the 'After The Pharaohs' update. + { +artifact_use_byzantine_building_visuals_trigger = { + exists = culture + culture = { has_building_gfx = byzantine_building_gfx } } } + { + has_building_gfx = byzantine_building_gfx + } } -"common/decisions/tfe_culture_decisions.txt" = { +"common/buildings/99_background_graphics_buildings.txt" = { + # No byzantine_building_gfx in TFE as of the 'After The Pharaohs' update. { -dong_zhuo_culture_decision = { - ai_check_interval = 0 - is_shown = { - has_game_rule = larp_enabled - NOT = { - culture = { - this = culture:soissons - } + asset = { + type = pdxmesh + requires_dlc_flag = roads_to_power + graphical_cultures = { byzantine_building_gfx } + graphical_regions = { graphical_mediterranean } + names = { + "ep3_byzantine_walls_02_mesh" } - dynasty = dynasty:syagri - game_start_date = 395.1.17 } - is_valid = { - culture = { has_cultural_pillar = heritage_levantine } - custom_description = { - text = soissonstrigger1 - culture = { any_parent_culture_or_above = { this = culture:han } } + } + + { + asset = { + type = pdxmesh + requires_dlc_flag = roads_to_power + graphical_cultures = { byzantine_building_gfx } + graphical_regions = { graphical_mediterranean } + names = { + "ep3_byzantine_walls_03_mesh" } - dynasty = dynasty:syagri - has_title = title:k_israel - custom_description = { - text = soissonstrigger2 - current_date = 690.4.20 + } + } + + { + asset = { + type = pdxmesh + requires_dlc_flag = roads_to_power + graphical_cultures = { byzantine_building_gfx } + graphical_regions = { graphical_mediterranean } + names = { + "ep3_byzantine_walls_04_mesh" } } - effect = { - save_scope_as = soi - #Convert your, and your whole family's, culture - set_culture = culture:soissons - add_prestige = 10000 - hidden_effect = { - if = { - limit = { any_spouse = { is_landed = no } } - every_spouse = { - limit = { - is_landed = no - } - set_culture = culture:soissons - } - } - if = { - limit = { - any_close_family_member = { - is_landed = no - NOT = { is_spouse_of = root } - } - } - every_close_family_member = { - limit = { - is_landed = no - NOT = { is_spouse_of = root } - } - custom = all_unlanded_family_members - set_culture = culture:soissons - } - } + } +} - #Convert appropriate vassals, and their family - if = { - limit = { - any_vassal_or_below = { - is_ai = yes - } - } - every_vassal_or_below = { - limit = { - is_ai = yes - } - set_culture = culture:soissons - } - } - #Flip Counties - every_realm_county = { - set_county_culture = culture:soissons - } +"common/buildings/00_city_buildings.txt" = { + # No byzantine_building_gfx in TFE as of the 'After The Pharaohs' update. + { + ### EP3 Byzantine ### + asset = { + type = pdxmesh + name = "ep3_byzantine_city_01_mesh" + ### TODO Add DLC Check + illustration = @holding_illustration_byzantine + soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/mediterranean_city" soundparameter = { "Tier" = 0 } } + graphical_cultures = { byzantine_building_gfx } + graphical_regions = { graphical_mediterranean } + } + } - culture:soissons = { - hidden_effect = { - reset_culture_creation_date = yes - get_all_innovations_from = culture:han - get_all_innovations_from = culture:hebrew - } - } + { + ### EP3 Byzantine ### + asset = { + type = pdxmesh + name = "ep3_byzantine_city_01_mesh" + requires_dlc_flag = roads_to_power + illustration = @holding_illustration_byzantine + soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/mediterranean_city" soundparameter = { "Tier" = 1 } } + graphical_cultures = { byzantine_building_gfx } + graphical_regions = { graphical_mediterranean } + } + } - trigger_event = tfe_culture.9900 - } + { + ### EP3 Byzantine ### + asset = { + type = pdxmesh + name = "ep3_byzantine_city_02_mesh" + requires_dlc_flag = roads_to_power + illustration = @holding_illustration_byzantine + soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/mediterranean_city" soundparameter = { "Tier" = 2 } } + graphical_cultures = { byzantine_building_gfx } + graphical_regions = { graphical_mediterranean } } - cost = { gold = 69 } -} } -} -"gfx/portraits/portrait_modifiers/00_custom_hair.txt" = { { - modifier = { - add = 200 - exists = this - exists = character:easteregg_joe_parkin - this = character:easteregg_joe_parkin - } - modifier = { - add = 200 - exists = this - exists = character:easteregg_alessandro_bragalini - this = character:easteregg_alessandro_bragalini - } + ### EP3 Byzantine ### + asset = { + type = pdxmesh + name = "ep3_byzantine_city_02_mesh" + requires_dlc_flag = roads_to_power + illustration = @holding_illustration_byzantine + soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/mediterranean_city" soundparameter = { "Tier" = 2 } } + graphical_cultures = { byzantine_building_gfx } + graphical_regions = { graphical_mediterranean } + } } } -"gfx/portraits/portrait_modifiers/50_beards_scripted_characters.txt" = { - { -beards_scripted_characters = { - usage = game - selection_behavior = max +"common/buildings/00_castle_buildings.txt" = { + # No byzantine_building_gfx in TFE as of the 'After The Pharaohs' update. + { + ### EP3 Byzantine ### + asset = { + type = pdxmesh + name = "ep3_byzantine_castle_01_a_mesh" + requires_dlc_flag = roads_to_power + illustration = @holding_illustration_constantinople + soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 0 } } + graphical_cultures = { byzantine_building_gfx } + provinces = { 496 } + } + asset = { + type = pdxmesh + name = "ep3_byzantine_castle_01_a_mesh" + requires_dlc_flag = roads_to_power + illustration = @holding_illustration_byzantine + soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 0 } } + graphical_cultures = { byzantine_building_gfx } + graphical_regions = { graphical_mediterranean } + } + } - male_beard_western_01 = { # Standard full beard - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.04 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:144998 #king_lothaire - this = character:144998 #king_lothaire - } - modifier = { - add = 999 - exists = this - exists = character:83355 #petty_king_murchad - this = character:83355 #petty_king_murchad - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_petter_vilberg - this = character:easteregg_petter_vilberg - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_james_beaumont - this = character:easteregg_james_beaumont - } - modifier = { - add = 999 - exists = this - exists = character:159038 #Coel - this = character:159038 #ACoel - } - modifier = { - add = 999 - exists = this - exists = character:900062 #Stilicho - this = character:900062 #Stilicho - } - modifier = { - add = 999 - exists = this - exists = character:180618 #Bahram - this = character:180618 #Bahram - } - modifier = { - add = 999 - exists = this - exists = character:83432 #Eochaid - this = character:83432 #Eochaid - } - modifier = { - add = 999 - exists = this - exists = character:londinium_01 #Riothamus - this = character:londinium_01 #Riothamus - } - modifier = { - add = 999 - exists = this - exists = character:vigg_04 #Hengest - this = character:vigg_04 #Hengest - } - modifier = { - add = 999 - exists = this - exists = character:constantinus_05 #Ambrosius - this = character:constantinus_05 #Ambrosius - } - modifier = { - add = 999 - exists = this - exists = character:cappadocia_07 #Ioannes - this = character:cappadocia_07 #Ioannes - } - modifier = { - add = 999 - exists = this - exists = character:mauri_42 #Iabdas - this = character:mauri_42 #Iabdas - } - modifier = { - add = 999 - exists = this - exists = character:997011 #Chlodomir - this = character:997011 #Chlodomir - } - } - } + { + ### EP3 Byzantine ### + asset = { + type = pdxmesh + name = "ep3_byzantine_castle_02_a_mesh" + requires_dlc_flag = roads_to_power + illustration = @holding_illustration_constantinople + soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 1 } } + graphical_cultures = { byzantine_building_gfx } + provinces = { 496 } + } + asset = { + type = pdxmesh + name = "ep3_byzantine_castle_02_a_mesh" + requires_dlc_flag = roads_to_power + illustration = @holding_illustration_byzantine + soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 1 } } + graphical_cultures = { byzantine_building_gfx } + graphical_regions = { graphical_mediterranean } + } + } - male_beard_western_02 = { # Standard goatee - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.07 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:107500 #king_sancho - this = character:107500 #king_sancho - } - modifier = { - add = 999 - exists = this - exists = character:42018 #karlmann - this = character:42018 #karlmann - } - modifier = { - add = 999 - exists = this - exists = character:991004 #Mundus - this = character:991004 #Mundus - } - } - } + { + ### EP3 Byzantine ### + asset = { + type = pdxmesh + name = "ep3_byzantine_castle_03_a_mesh" + requires_dlc_flag = roads_to_power + illustration = @holding_illustration_constantinople + soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 2 } } + graphical_cultures = { byzantine_building_gfx } + provinces = { 496 } + } + asset = { + type = pdxmesh + name = "ep3_byzantine_castle_03_a_mesh" + requires_dlc_flag = roads_to_power + illustration = @holding_illustration_byzantine + soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 2 } } + graphical_cultures = { byzantine_building_gfx } + graphical_regions = { graphical_mediterranean } + } + } - male_beard_western_03 = { # Short beard - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.11 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:163110 #sigurdr_snake_in_the_eye - this = character:163110 #sigurdr_snake_in_the_eye - } - modifier = { - add = 999 - exists = this - exists = character:90104 #charles_the_bald - this = character:90104 #charles_the_bald - } - modifier = { - add = 999 - exists = this - exists = character:109500 #king_garcia - this = character:109500 #king_garcia - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_henrik_fahraeus - this = character:easteregg_henrik_fahraeus - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_olof_bjork - this = character:easteregg_olof_bjork - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_sean_hughes - this = character:easteregg_sean_hughes - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_maximilian_olbers - this = character:easteregg_maximilian_olbers - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_nikolaos_kaltsogiannis - this = character:easteregg_nikolaos_kaltsogiannis - } - } - } + { + ### EP3 Byzantine ### + asset = { + type = pdxmesh + name = "ep3_byzantine_castle_04_a_mesh" + requires_dlc_flag = roads_to_power + illustration = @holding_illustration_constantinople + soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 3 } } + graphical_cultures = { byzantine_building_gfx } + provinces = { 496 } + } + asset = { + type = pdxmesh + name = "ep3_byzantine_castle_04_a_mesh" + requires_dlc_flag = roads_to_power + illustration = @holding_illustration_byzantine + soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 3 } } + graphical_cultures = { byzantine_building_gfx } + graphical_regions = { graphical_mediterranean } + } + } +} - male_beard_western_04 = { # Short goatee - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.14 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:easteregg_nils_wadensten - this = character:easteregg_nils_wadensten - } - modifier = { - add = 999 - exists = this - exists = character:waegmunding_2 #Beowulf - this = character:waegmunding_2 #Beowulf - } - } - } - male_beard_western_05 = { # Mustache - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.17 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:122 #king_harold - this = character:122 #king_harold - } - modifier = { - add = 999 - exists = this - exists = character:1128 #duke_robert - this = character:1128 #duke_robert - } - modifier = { - add = 999 - exists = this - exists = character:992016 #theodoric_the_great - this = character:992016 #theodoric_the_great - } - modifier = { - add = 999 - exists = this - exists = character:992022 #Theodahad - this = character:992022 #Theodahad - } - modifier = { - add = 999 - exists = this - exists = character:997003 #Merovech - this = character:997003 #Merovech - } - } - } +"common/culture/traditions/TFE_regional_traditions.txt" = { + # from error.log: "terrain trigger [ Invalid terrain type mountain ]" + { + if = { + limit = { + NOT = { + scope:character = { + any_sub_realm_county = { + culture = scope:character.culture + any_county_province = { + terrain = mountain + } + } + } + } + } + multiply = 0 + } + } + + # No innovation_war_elephants in TFE as of the 'After The Pharaohs' update. + { + has_innovation = innovation_war_elephants + } +} + + +"common/culture/traditions/RICE_sri_lanka_traditions.txt" = { + # RICE_sri_lanka_struggle_region not in TFE as of the 'After The Pharaohs' update. + { + any_culture_county = { + #count >= 4 + any_county_province = { + geographical_region = RICE_sri_lanka_struggle_region + } + } + } + + { + custom_tooltip = { + text = RICE_culture_in_sri_lanka_desc + any_culture_county = { + count >= 4 + any_county_province = { + geographical_region = RICE_sri_lanka_struggle_region + } + } + } + } +} + + +"common/court_positions/types/roman_vicar_court_positions.txt" = { + # Broken syntax inside this court position. + { +k_epirus_governor = { + skill = stewardship max_available_positions = 1 + category = court_position_roman_vicar + opinion = { value = regular_court_position_opinion } + aptitude_level_breakpoints = { 20 40 60 80 } + aptitude = { value = 25 add = { value = stewardship multiply = 1.25 max = 25 desc = court_position_skill_stewardship } add = { value = martial multiply = 1.25 max = 25 desc = court_position_skill_martial } if = { limit = { has_trait = administrator } add = { value = 20 desc = court_position_administrator_trait } } if = { limit = { has_trait = overseer } add = { value = 20 desc = court_position_overseer_trait } } } + is_shown = { + OR = { government_has_flag = government_is_imperial government_has_flag = government_is_imperial_cult government_has_flag = government_is_administrative } + OR = { + any_vassal = { + has_title = title:k_epirus + } + AND = { + has_title = title:k_epirus + NOT = { capital_county.kingdom = title:k_epirus } + } + } + } + valid_position = { + OR = { government_has_flag = government_is_imperial government_has_flag = government_is_imperial_cult government_has_flag = government_is_administrative } + } + + valid_character = { + scope:employee = { + OR = { + trigger_if = { + limit = { + AND = { + exists = title:k_epirus.holder + + NOT = { scope:liege = exists = title:k_epirus.holder } + + } + title:k_epirus.holder = { + NOT = { + OR = { + AND = { + liege = { access_to_eastern_senate = yes } + global_variable_list_size = { + name = aristocratic_senate_eastern + value > 9 + } + has_character_flag = bribed_aristocrats_eastern + } + AND = { + liege = { access_to_eastern_senate = yes } + global_variable_list_size = { + name = populist_senate_eastern + value > 9 + } + has_character_flag = bribed_populists_eastern + } + AND = { + liege = { access_to_eastern_senate = yes } + global_variable_list_size = { + name = traditionalist_senate_eastern + value > 9 + } + has_character_flag = bribed_traditionalist_eastern + } + AND = { + liege = { access_to_eastern_senate = yes } + has_character_flag = bribed_populists_eastern + has_character_flag = bribed_aristocrats_eastern + } + AND = { + liege = { access_to_eastern_senate = yes } + has_character_flag = bribed_traditionalist_eastern + has_character_flag = bribed_aristocrats_eastern + } + AND = { + liege = { access_to_eastern_senate = yes } + has_character_flag = bribed_populists_eastern + has_character_flag = bribed_traditionalist_eastern + } + AND = { + liege = { access_to_italian_senate = yes } + global_variable_list_size = { + name = aristocratic_senate_italy + value > 9 + } + has_character_flag = bribed_aristocrats_italy + } + AND = { + liege = { access_to_italian_senate = yes } + global_variable_list_size = { + name = populist_senate_italy + value > 9 + } + has_character_flag = bribed_populists_italy + } + AND = { + liege = { access_to_italian_senate = yes } + global_variable_list_size = { + name = traditionalist_senate_italy + value > 9 + } + has_character_flag = bribed_traditionalist_italy + } + AND = { + liege = { access_to_italian_senate = yes } + has_character_flag = bribed_populists_italy + has_character_flag = bribed_aristocrats_italy + } + AND = { + liege = { access_to_italian_senate = yes } + has_character_flag = bribed_traditionalist_italy + has_character_flag = bribed_aristocrats_italy + } + AND = { + liege = { access_to_italian_senate = yes } + has_character_flag = bribed_populists_italy + has_character_flag = bribed_traditionalist_italy + } + } + } + } + } + OR = { + liege = { + has_title = title:k_epirus + } + has_trait = low_senator + has_trait = senator + has_trait = high_senator + } + } + trigger_else = { + OR = { + has_trait = low_senator + has_trait = senator + has_trait = high_senator + } + } + has_title = title:k_epirus + + } + } + } + revoke_cost = { + prestige = { + value = 1000 + if = { + limit = { + exists = title:k_epirus.holder + title:k_epirus.holder = { + OR = { + AND = { + liege = { access_to_eastern_senate = yes } + global_variable_list_size = { + name = aristocratic_senate_eastern + value > 9 + } + has_character_flag = bribed_aristocrats_eastern + } + AND = { + liege = { access_to_eastern_senate = yes } + global_variable_list_size = { + name = populist_senate_eastern + value > 9 + } + has_character_flag = bribed_populists_eastern + } + AND = { + liege = { access_to_eastern_senate = yes } + global_variable_list_size = { + name = traditionalist_senate_eastern + value > 9 + } + has_character_flag = bribed_traditionalist_eastern + } + AND = { + liege = { access_to_eastern_senate = yes } + has_character_flag = bribed_populists_eastern + has_character_flag = bribed_aristocrats_eastern + } + AND = { + liege = { access_to_eastern_senate = yes } + has_character_flag = bribed_traditionalist_eastern + has_character_flag = bribed_aristocrats_eastern + } + AND = { + liege = { access_to_eastern_senate = yes } + has_character_flag = bribed_populists_eastern + has_character_flag = bribed_traditionalist_eastern + } + AND = { + liege = { access_to_italian_senate = yes } + global_variable_list_size = { + name = aristocratic_senate_italy + value > 9 + } + has_character_flag = bribed_aristocrats_italy + } + AND = { + liege = { access_to_italian_senate = yes } + global_variable_list_size = { + name = populist_senate_italy + value > 9 + } + has_character_flag = bribed_populists_italy + } + AND = { + liege = { access_to_italian_senate = yes } + global_variable_list_size = { + name = traditionalist_senate_italy + value > 9 + } + has_character_flag = bribed_traditionalist_italy + } + AND = { + liege = { access_to_italian_senate = yes } + has_character_flag = bribed_populists_italy + has_character_flag = bribed_aristocrats_italy + } + AND = { + liege = { access_to_italian_senate = yes } + has_character_flag = bribed_traditionalist_italy + has_character_flag = bribed_aristocrats_italy + } + AND = { + liege = { access_to_italian_senate = yes } + has_character_flag = bribed_populists_italy + has_character_flag = bribed_traditionalist_italy + } + } + } + } + add = { + value = 10000 + desc = SENATE_BRIBED_VICAR + } + } + } + } + salary = { round = no gold = medium_court_position_salary } + scaling_employer_modifiers = { + terrible = { monthly_county_control_growth_add = 0.1 } + poor = { monthly_county_control_growth_add = 0.2 } + average = { monthly_county_control_growth_add = 0.3 } + good = { monthly_county_control_growth_add = 0.4 } + excellent = { monthly_county_control_growth_add = 0.5 } + } + modifier = { monthly_prestige = minor_court_position_prestige_salary } + on_court_position_received = { + if = { + limit = {scope:employee = { is_landed = no } } + scope:liege = { save_scope_as = employer_saved } + scope:employee = { save_scope_as = employee_saved } + create_title_and_vassal_change = { type = granted save_scope_as = title_change add_claim_on_loss = no } + title:k_epirus = { change_title_holder_include_vassals = { holder = scope:employee change = scope:title_change } } + title:k_epirus = { random_in_de_facto_hierarchy = { limit = { tier = tier_county holder.highest_held_title_tier >= tier_duchy OR = { holder = { has_title = title:k_epirus } holder = { highest_held_title_tier >= tier_kingdom } } } change_title_holder_include_vassals = { holder = scope:employee change = scope:title_change } } holder = { random_vassal = { limit = { highest_held_title_tier = tier_county } change_liege = { liege = scope:employee change = scope:title_change } } } } + resolve_title_and_vassal_change = scope:title_change + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = title_change_2 add_claim_on_loss = no + } + scope:employee_saved = { change_liege = { liege = scope:employer_saved change = scope:title_change_2 } } + resolve_title_and_vassal_change = scope:title_change_2 + change_government = imperial_government + } + } + on_court_position_revoked = { seneschal_title_revoked_effect = yes k_epirus_revoked_effect = yes } + on_court_position_invalidated = { seneschal_title_revoked_effect = yes } + candidate_score = { + value = 250 + add = scope:base_value + add = court_position_candidate_score_base_value + + if = { + limit = { + NOT = { exists = scope:firing_court_position } + scope:employee = { has_any_court_position = yes } + } + add = 150 + } + if = { + limit = { + scope:employee = { + OR = { + AND = { + liege = { access_to_eastern_senate = yes } + global_variable_list_size = { + name = aristocratic_senate_eastern + value > 9 + } + has_character_flag = bribed_aristocrats_eastern + } + AND = { + liege = { access_to_eastern_senate = yes } + global_variable_list_size = { + name = populist_senate_eastern + value > 9 + } + has_character_flag = bribed_populists_eastern + } + AND = { + liege = { access_to_eastern_senate = yes } + global_variable_list_size = { + name = traditionalist_senate_eastern + value > 9 + } + has_character_flag = bribed_traditionalist_eastern + } + AND = { + liege = { access_to_eastern_senate = yes } + has_character_flag = bribed_populists_eastern + has_character_flag = bribed_aristocrats_eastern + } + AND = { + liege = { access_to_eastern_senate = yes } + has_character_flag = bribed_traditionalist_eastern + has_character_flag = bribed_aristocrats_eastern + } + AND = { + liege = { access_to_eastern_senate = yes } + has_character_flag = bribed_populists_eastern + has_character_flag = bribed_traditionalist_eastern + } + AND = { + liege = { access_to_italian_senate = yes } + global_variable_list_size = { + name = aristocratic_senate_italy + value > 9 + } + has_character_flag = bribed_aristocrats_italy + } + AND = { + liege = { access_to_italian_senate = yes } + global_variable_list_size = { + name = populist_senate_italy + value > 9 + } + has_character_flag = bribed_populists_italy + } + AND = { + liege = { access_to_italian_senate = yes } + global_variable_list_size = { + name = traditionalist_senate_italy + value > 9 + } + has_character_flag = bribed_traditionalist_italy + } + AND = { + liege = { access_to_italian_senate = yes } + has_character_flag = bribed_populists_italy + has_character_flag = bribed_aristocrats_italy + } + AND = { + liege = { access_to_italian_senate = yes } + has_character_flag = bribed_traditionalist_italy + has_character_flag = bribed_aristocrats_italy + } + AND = { + liege = { access_to_italian_senate = yes } + has_character_flag = bribed_populists_italy + has_character_flag = bribed_traditionalist_italy + } + } + } + } + add = { + value = 10000 + desc = SENATE_BRIBED_VICAR + } + } + if = { + limit = { + scope:employee = { + has_title = title:k_epirus + } + } + add = 200 #to stop AI from revoking alot + } + if = { + limit = { + scope:liege = { + has_relation_rival = scope:employee + } + } + add = 900 # rival isn't that big of a deal + } + } +} + } +} - male_beard_western_06 = { # Big bushy beard - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.2 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:106000 #king_antso - this = character:106000 #king_antso - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_paul_depre - this = character:easteregg_paul_depre - } - modifier = { - add = 999 - exists = this - exists = character:999103 #Alaric I - this = character:999103 #Alaric I - } - modifier = { - add = 999 - exists = this - exists = character:997002 #Chlodio - this = character:997002 #Chlodio - } - } - } - male_beard_western_07 = { # Chin strap - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.23 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:997004 #Childeric - this = character:997004 #Childeric - } - } - } +"events/succession_exp_start_up.txt" = { + # from error.log: "none is not a valid entry at file: events/succession_exp_start_up.txt line: 4 (succexp.004) (valid: character_event, court_event, activity_event, letter_event )" + { +namespace = succexp - male_beard_western_08 = { # Big with fancy mustache - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.27 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:984 #king_malcom - this = character:984 #king_malcom +succexp.004 = { + type = none + hidden = yes + immediate = { + if = { + limit = { exists = title:e_western_roman_empire } + title:e_western_roman_empire = { + add_title_law = imperial_elective_succession_law } - modifier = { - add = 999 - exists = this - exists = character:easteregg_max_weltz - this = character:easteregg_max_weltz + } + if = { + limit = { exists = title:e_byzantium } + title:e_byzantium = { + add_title_law = imperial_elective_succession_law } - modifier = { - add = 999 - exists = this - exists = character:arsacid_58 #vramshapuh - this = character:arsacid_58 #vramshapuh - } - modifier = { - add = 999 - exists = this - exists = character:145071 #Heraclius - this = character:145071 #Heraclius - } } } +} + } +} - male_beard_western_09 = { # Pointy beard - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.30 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:159431 #Conan Meriadoc - this = character:159431 #Conan Meriadoc - } - modifier = { - add = 999 - exists = this - exists = character:maldras_06 #Hermenerich - this = character:maldras_06 #Hermenerich - } - modifier = { - add = 999 - exists = this - exists = character:997009 #Theodoric Meroving - this = character:997009 #Theodoric Meroving - } - modifier = { - add = 999 - exists = this - exists = character:992063 #Fritigern - this = character:992063 #Fritigern - } - } + +"common/on_action/new_electives_on_action.txt" = { + # We're removing this because the succexp.004 event is removed above. + { +on_game_start = { + on_actions = { + succexpstart + } +} +succexpstart = { + events = { + succexp.004 } +} + } +} + + +"common/traits/TFE_traits.txt" = { + # From error.log: "Error: "Unexpected token: fame" + { + fame = yes + } + + # From error.log: "Error: "Unexpected token: can_inherit" + { + can_inherit = no + } + + # From error.log: "Error: "Unexpected token: blocks_from_claim_inheritance" + { + blocks_from_claim_inheritance = yes + } + + # From error.log: "Error: "Unexpected token: popular_opinion" + { + popular_opinion = 10 + } +} + + +"common/traits/TFE_vanilla_redefinition_traits.txt" = { + # From error.log: "Error: "Unexpected token: hostile_scheme_power_mult, near line: 90" + { + hostile_scheme_power_mult = 0.15 + } +} + + +"common/scripted_triggers/TFE_clothing_triggers.txt" = { + # from error.log: "Unknown trigger type" for all of these + { + style_changing_reformer_byzantine = yes + } + { + style_changing_reformer_indian = yes + } + { + style_changing_reformer_mena = yes + } + { + style_changing_reformer_african = yes + } + { + style_changing_reformer_northern = yes + } + { + style_changing_reformer_iberian_muslim = yes + } + { + style_changing_reformer_iberian_christian = yes + } + { + style_changing_reformer_iranian = yes + } + { + style_changing_reformer_turkic = yes + } + { + style_changing_reformer_fp1_norse = yes + } + { + style_changing_reformer_mongol = yes + } + { + style_changing_reformer_dde_hre = yes + } + { + style_changing_reformer_dde_abbasid = yes + } + { + style_changing_reformer_western = yes + } +} + + +"common/culture/eras/00_culture_eras.txt" = { + # From error.log: "Error: "Unexpected token: modifier" + { + modifier = { + mercenary_hire_cost_mult = 0.15 + } + } +} + + +"common/religion/religions/00_druidism.txt" = { + # From error.log: "Error: "Failed to read key reference: reformed_faith_doctrine: reformed_faith_doctrine" + { + doctrine = reformed_faith_doctrine + } +} + + +"common/scripted_triggers/TFE_brythonic_struggle_triggers.txt" = { + # An effect should not be in scripted_triggers. + { +tfe_struggle_compromise_ender_effect = { + give_nickname = nick_the_pragmatic + dynasty = { add_dynasty_prestige = 10000 } +} + } +} + + +"events/T4N_tributaries.txt" = { + # Unused event; from error.log: "Unknown effect random_war at file: events/T4N_tributaries.txt line: 223" + { +#Suzerain is called to permanent tributary war +#on_war_started +#Root is suzerain +#call_to_arms_tribute is defender +tributaries.6 = { + type = character_event + theme = realm + title = tributary_6_tit + desc = tributary_6_desc + right_portrait = { + character = scope:call_to_arms_tribute + animation = war_defender + + } + left_portrait = { + character = root + animation = personality_rational + } + + option = { + name = suzerain_joins_the_war + add_piety = minor_piety_value + scope:call_to_arms_tribute = { + random_war = { + limit = { + root = { + NOR = { + is_at_war_as_defender = yes + is_at_war_with = scope:call_to_arms_tribute + } + } + } + if = { + limit = { + scope:call_to_arms_tribute = { + is_at_war_as_attacker = yes + } + } + add_attacker = root + } + else_if = { + limit = { + scope:call_to_arms_tribute = { + is_at_war_as_defender = yes + } + } + add_defender = root + } + else = { + debug_log = "Something broke, report to typical" + } + } + trigger_event = { id = tributaries.8 } #tributary gets a positive response + } + } + + option = { + name = suzerain_refuses_to_join_war + add_prestige = major_prestige_loss + save_scope_as = former_suzerain + scope:call_to_arms_tribute = { + trigger_event = { id = tributaries.7 } #tributary gets a negative response + } + } +} + } +} + + +"history/cultures/heritage_pictish.txt" = { + # innovation_pictish_warbands not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_pictish_warbands + } +} + + +"history/cultures/pictish.txt" = { + # innovation_pictish_warbands not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_pictish_warbands + } +} - male_beard_western_10 = { # Chin goatee - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.33 # For the randomness to work correctly - } - } - weight = { - base = 0 - } - } - male_beard_mena_01 = { # Very curly medium length full beard - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.35 # For the randomness to work correctly - } - } - weight = { - base = 0 +"history/cultures/heritage_levantine.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} - modifier = { - add = 999 - exists = this - exists = character:982001 #Abu Karib - this = character:982001 #Abu Karib - } - } - } - male_beard_mena_02 = { # Big with small mustache - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.39 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:3924 #emir_yahya - this = character:3924 #emir_yahya - } - modifier = { - add = 999 - exists = this - exists = character:lakhmid_06 #al-Nu'Man - this = character:lakhmid_06 #al-Nu'Man - } - modifier = { - add = 999 - exists = this - exists = character:rugian_03 #Feletheus - this = character:rugian_03 #Feletheus - } - } - } +"history/cultures/heritage_semitic.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} - male_beard_mena_03 = { # Big chin strap - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.42 # For the randomness to work correctly - } - } - weight = { - base = 0 - } - } - male_beard_mena_04 = { # Short stylish - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.45 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:quadi_04 # Hermerich of the Quadi - this = character:quadi_04 # Hermerich of the Quadi - } - modifier = { - add = 999 - exists = this - exists = character:syagri_06 #Syagrus - this = character:syagri_06 #Syagrus - } - modifier = { - add = 999 - exists = this - exists = character:997005 #Chlodovech - this = character:997005 #Chlodovech - } - modifier = { - add = 999 - exists = this - exists = character:belisarius_001 #Belisarius - this = character:belisarius_001 #Belisarius - } - } - } +"history/cultures/kashmiri.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} - male_beard_northern_01 = { # Big wide - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.48 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:163111 #ivar_the_boneless - this = character:163111 #ivar_the_boneless - } - modifier = { - add = 999 - exists = this - exists = character:102531 #harald_hardrade - this = character:102531 #harald_hardrade - } - } - } - male_beard_northern_02 = { # Single braid - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.52 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:163112 #halfdan_whiteshirt - this = character:163112 #halfdan_whiteshirt - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:6878 #jarl_haesteinn - this = character:6878 #jarl_haesteinn - } - } - } +"history/cultures/kochinim.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} - male_beard_northern_03 = { # Beaded beard - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.54 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:163108 #bjorn_ironside - this = character:163108 #bjorn_ironside - } - modifier = { - add = 999 - exists = this - exists = character:40605 #rurik - this = character:40605 #rurik - } - modifier = { - add = 999 - exists = this - exists = character:easteregg_peter_johannesson - this = character:easteregg_peter_johannesson - } - modifier = { - add = 999 - exists = character:997013 #Chlothar - this = character:997013 #Chlothar - } - } - } - male_beard_steppe_01 = { # long at chin with mustache - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.58 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = character:ashina_03 #Tuwu - this = character:ashina_03 #Tuwu - } - modifier = { - add = 999 - exists = character:ashina_04 #Bumin - this = character:ashina_04 #Bumin - } - } - } +"history/cultures/mauro_roman.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} + + +"history/cultures/nepali.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} + + +"history/cultures/radhanite.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} + + +"history/cultures/yemeni.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} - male_beard_steppe_02 = { # low rough - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.61 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:159137 #almos_arpad - this = character:159137 #almos_arpad - } - modifier = { - add = 999 - exists = character:990006 #Attila - this = character:990006 #Attila - } - modifier = { - add = 999 - exists = character:ashina_05 #Istemi - this = character:ashina_05 #Istemi - } - modifier = { - add = 999 - exists = this - exists = character:hephthalite_misc_017 #Katulf - this = character:hephthalite_misc_017 #Katulf - } - } - } - male_beard_sub_saharan_01 = { # Full african beard medium - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.64 # For the randomness to work correctly - } - } - weight = { - base = 0 - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:nuvelan_11 #Gildo - this = character:nuvelan_11 #Gildo - } - modifier = { - add = 999 - exists = this - exists = character:aksum_16 #Ouazeba - this = character:aksum_16 #Ouazeba - } - modifier = { - add = 999 - exists = this - exists = character:himyarite_30 #Abraha - this = character:himyarite_30 #Abraha - } +"history/cultures/heritage_kemetic.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger } - } +} - male_beard_sub_saharan_02 = { # Stylish african goatee - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.67 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:aksum_17 #eon - this = character:aksum_17 #eon - } - } - } - male_beard_sub_saharan_03 = { # Full african beard long - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.70 # For the randomness to work correctly - } - } - weight = { - base = 0 - } - } +"history/cultures/heritage_latin.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} - male_beard_indian_01 = { # Handlebar mustache - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.74 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:easteregg_struan_mccallum - this = character:easteregg_struan_mccallum - } - modifier = { - add = 999 - exists = this - exists = character:alchonid_005 #Khingila - this = character:alchonid_005 #Khingila - } - modifier = { - add = 999 - exists = this - exists = character:arsacid_64 #Mystakon - this = character:arsacid_64 #Mystakon - } - } - } - male_beard_indian_02 = { # Indian pointy - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.77 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:900016 #Faramund - this = character:900016 #Faramund - } - modifier = { - add = 999 - exists = this - exists = character:xionite_001 #Kidara - this = character:xionite_001 #Kidara - } - modifier = { - add = 999 - exists = this - exists = character:145072 #Focas - this = character:145072 #Focas - } - modifier = { - add = 999 - exists = this - exists = character:greek_17 #Plutarch - this = character:greek_17 #Plutarch - } - } - } +"history/cultures/heritage_israelite.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} - male_beard_indian_03 = { # Very curly medium length full beard - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.80 # For the randomness to work correctly - } - } - weight = { - base = 0 - } - } +"history/cultures/heritage_iranian.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} - male_beard_rtt_01 = { # Wizard beard - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.0 # For the randomness to work correctly - } - } - weight = { - base = 0 - } - } - ### FP2 Beards ### +"history/cultures/heritage_indo_aryan.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} - male_beard_fp2_iberian_christian_01 = { # Twin braids with metal rings - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_02 - value = 0.11 # For the randomness to work correctly - } - } - weight = { - base = 0 - } - } - male_beard_fp2_iberian_christian_02 = { # Twin braids with metal rings - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_02 - value = 0.235 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:996002 #Odovacar - this = character:996002 #Odovacar - } - modifier = { - add = 999 - exists = this - exists = character:168137 - this = character:168137 - } +"history/cultures/heritage_iberian.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} + + +"history/cultures/heritage_elamite.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} + + +"history/cultures/heritage_dravidian.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} - modifier = { - add = 999 - exists = this - exists = character:70292 - this = character:70292 - } - } - } - male_beard_fp2_iberian_christian_03 = { # Twin braids with metal rings - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_02 - value = 0.36 # For the randomness to work correctly - } - } - weight = { - base = 0 +"history/cultures/egyptian.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} - modifier = { - add = 999 - exists = this - exists = character:73813 - this = character:73813 - } - modifier = { - add = 999 - exists = this - exists = character:surunbaqi0001 - this = character:surunbaqi0001 - } - } - } +"history/cultures/daylamite.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} - male_beard_fp2_iberian_christian_04 = { - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_02 - value = 0.485 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:barcelona_00003 - this = character:barcelona_00003 - } - modifier = { - add = 999 - exists = this - exists = character:200280 #Theodis - this = character:200280 #Theodis - } - modifier = { - add = 999 - exists = this - exists = character:997015 #Theodobert - this = character:997015 #Theodobert - } - } - } +"history/cultures/brahui.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} - male_beard_fp2_iberian_muslim_01 = { # Thick Groomed Beard - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_02 - value = 0.61 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:70150 - this = character:70150 - } +"history/cultures/albanian.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} - modifier = { - add = 999 - exists = this - exists = character:180628 #Khosrau - this = character:180628 #Khosrau - } - modifier = { - add = 999 - exists = this - exists = character:73683 - this = character:73683 - } - modifier = { - add = 999 - exists = this - exists = character:200284 #euric - this = character:200284 #euric - } - modifier = { - add = 999 - exists = this - exists = character:aelling_01 #Aelle - this = character:aelling_01 #Aelle - } - modifier = { - add = 999 - exists = this - exists = character:159012 #Cadwallon - this = character:159012 #Cadwallon - } - } - } +"history/cultures/afro_roman.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + discover_innovation = innovation_ledger + } +} - male_beard_fp2_iberian_muslim_02 = { # Scholar's beard - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_02 - value = 0.735 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:danis0005 - this = character:danis0005 - } - modifier = { - add = 999 - exists = this - exists = character:vandals_003 - this = character:vandals_003 - } - modifier = { - add = 999 - exists = this - exists = character:145237 #julian_the_apostate - this = character:145237 #julian_the_apostate - } - modifier = { - add = 999 - exists = this - exists = character:greek_20 #Proklos - this = character:greek_20 #Proklos - } - } - } +"common/on_action/religion_on_actions.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + has_innovation = innovation_ledger + } + + # event false_conversion.0001 not in TFE as of the 'After The Pharaohs' update. + { + false_conversion.0001 # Flag possible false conversions. + } +} + + +"common/scripted_triggers/00_ai_value_triggers.txt" = { + # innovation_ledger not in TFE as of the 'After The Pharaohs' update. + { + AND = { + culture = { has_innovation = innovation_ledger } + capital_county.title_province.combined_building_level <= 4 + } + } +} + + +"common/character_interactions/00_adoption.txt" = { + # from error.log: + #[00:36:38][E][pdx_persistent_reader.cpp:216]: Error: "Unknown trigger type: value, near line: 502 + #Unknown trigger type: if, near line: 503 + #Unknown trigger type: if, near line: 521 + #Unknown trigger type: if, near line: 539" in file: "common/character_interactions/00_adoption.txt" near line: 557 + { +adopt_interaction = { + icon = icon_dynasty + category = interaction_category_diplomacy + interface_priority = 60 + + desc = adopt_interaction_desc + use_diplomatic_range = yes + + is_shown = { + AND = { + OR = { + # Cultures that default with this tradition should still be able to adopt + scope:actor.culture = { has_cultural_parameter = allows_adoption } + scope:actor = { + AND = { + OR = { + government_has_flag = government_is_imperial + government_has_flag = government_is_administrative + government_has_flag = government_is_autocratic + government_has_flag = government_is_autocratic_ep3 + government_has_flag = government_is_imperial_cult + } + highest_held_title_tier >= tier_kingdom + } + } + scope:actor = { + faith = { + has_doctrine_parameter = TFE_enables_adoption + } + } + } + NOT = { + has_game_rule = no_adoption + } + } + NOT = { + scope:recipient = scope:actor + } + scope:actor = { + is_adult = yes + OR = { + # Compassionate people like adopting + has_trait = compassionate + # Game rule as an overriding factor + has_game_rule = adoption_always_allowed + # You have no kids and your fertility is low + AND = { + any_child = { + count < 1 + } + fertility <= low_fertility + } + # You are married to a same-sex partner + AND = { + is_married = yes + # People in bisexual polygamous spheres are not valid for this + NOT = { + OR = { + AND = { + any_consort = { + is_female = yes + } + is_male = yes + } + AND = { + any_consort = { + is_male = yes + } + is_female = yes + } + } + } + } + # You are unmarried and uninterested in having biological children + AND = { + is_married = no + OR = { + has_sexuality = asexual + has_sexuality = homosexual + } + } + OR = { + # You have a cultrad that lets you adopt + culture = { has_cultural_parameter = allows_adoption } + AND = { + OR = { + government_has_flag = government_is_imperial + government_has_flag = government_is_administrative + government_has_flag = government_is_autocratic + government_has_flag = government_is_autocratic_ep3 + government_has_flag = government_is_imperial_cult + } + highest_held_title_tier >= tier_kingdom + } + faith = { + has_doctrine_parameter = TFE_enables_adoption + } + } + } + OR = { + # You are unmarried + is_married = no + # You are the dominant partner in at least one of your marriages + AND = { + is_female = yes + matrilinear_marriage = yes + } + AND = { + is_male = yes + matrilinear_marriage = no + } + # Your marriage is same-sex + NOT = { + OR = { + AND = { + any_consort = { + is_female = yes + } + is_male = yes + } + AND = { + any_consort = { + is_male = yes + } + is_female = yes + } + } + } + } + } + scope:recipient = { + # Younger than you by at least 5 + #is_adult = no + scope:recipient.age <= scope:actor.age_plus_5 + #age + # Landless only (ruler used to catch edge-cases of landless HoF children) + is_ruler = no + # Don't get imprisoned children and so on + is_available = yes + # None of their close relatives are rulers + NOT = { + any_close_or_extended_family_member = { is_ruler = yes } + } + # They don't already belong to your house + NOT = { house = scope:actor.house } + # Don't adopt your own grandkids + NOT = { + any_ancestor = { + this = scope:actor + } + } + # Don't steal the King of France's great nephew + NOT = { + any_liege_or_above = { + prev.dynasty = dynasty + } + } + } + } + is_valid = {} + + is_valid_showing_failures_only = {} + + send_option = { # EP3 Influence + is_shown = { # Actor must have a government that uses influence + scope:actor = { + government_has_flag = government_has_influence + } + } + is_valid = { + # Actor has enough influence + scope:actor = { influence >= medium_influence_value } + # Both characters are within the same top realm + scope:recipient.top_liege = scope:actor.top_liege + } + flag = influence_send_option + localization = TRADE_INFLUENCE_FOR_BETTER_AI_ACCEPTANCE + } + send_options_exclusive = no + + on_accept = { + show_as_tooltip = { + adopt_effect = { + CHILD = scope:recipient + ADOPTER = scope:actor + } + } + hidden_effect = { + scope:actor = { trigger_event = adoption.0001 } + } + } + + cost = { + renown = { + value = { + add = medium_dynasty_prestige_value + if = { # Free for free adoption + limit = { + scope:actor = { + OR = { + culture = { has_cultural_parameter = free_adoption } + has_game_rule = adoption_always_allowed + } + } + } + multiply = 0 + } + if = { # Free for same-sex couples + limit = { + scope:actor = { + OR = { + AND = { + any_consort = { + is_female = yes + } + is_female = yes + } + AND = { + any_consort = { + is_male = yes + } + is_male = yes + } + } + } + } + multiply = 0 + } + } + } + prestige = { + value = { + add = medium_prestige_value + if = { + limit = { + scope:actor = { + OR = { + culture = { has_cultural_parameter = free_adoption } + has_game_rule = adoption_always_allowed + } + } + } + multiply = 0 + } + } + } + piety = { + value = { + add = medium_piety_value + if = { + limit = { + scope:actor = { + OR = { + culture = { has_cultural_parameter = free_adoption } + has_game_rule = adoption_always_allowed + } + } + } + multiply = 0 + } + # No piety cost for adopting a righteous-faith child + if = { + limit = { + scope:actor.faith = { + faith_hostility_level = { + target = scope:recipient.faith + value < faith_astray_level + } + } + } + multiply = 0 + } + else_if = { + limit = { + scope:actor.faith = { + faith_hostility_level = { + target = scope:recipient.faith + value > faith_astray_level + } + } + } + add = minor_piety_value + } + else_if = { + limit = { + scope:actor.faith = { + faith_hostility_level = { + target = scope:recipient.faith + value > faith_hostile_level + } + } + } + add = medium_piety_value + } + } + } + influence = { + value = 0 + if = { + limit = { scope:influence_send_option = yes } + add = scope:actor.medium_influence_value + desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION + } + } + } + ai_potential = { + any_child = { + count < 2 + } + OR = { + fertility <= low_fertility + AND = { + is_male = yes + NOT = { + any_spouse = { + fertility > low_fertility + is_female = yes + } + } + } + AND = { + is_female = yes + NOT = { + any_spouse = { + fertility > low_fertility + is_male = yes + } + } + } + } + } - male_beard_fp2_iberian_muslim_03 = { # Forked beard - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_02 - value = 0.860 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:mauri_36 #Masties - this = character:mauri_36 #Masties - } - } - } + ai_targets = { + health >= fine_health + fertility > low_fertility + age < 50 + ai_recipients = courtiers + ai_recipients = guests + # Friends, wards, etc. + ai_recipients = scripted_relations + max = 30 + } - no_beard = { - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_02 - value = 1 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:73857 - this = character:73857 - } - modifier = { - add = 999 - exists = this - exists = character:nepos_02 #Nepos - this = character:nepos_02 #Nepos - } - modifier = { - add = 999 - exists = this - exists = character:70512 #Justinian - this = character:70512 #Justinian - } - modifier = { - add = 999 - exists = this - exists = character:205141 #Ceredig - this = character:205141 #Ceredig - } - modifier = { - add = 999 - exists = this - exists = character:vandals_005 #Hilderic - this = character:vandals_005 #Hilderic - } - modifier = { - add = 999 - exists = this - exists = character:vandals_012 #Gelimer - this = character:vandals_012 #Gelimer - } - modifier = { - add = 999 - exists = this - exists = character:992023 #Athalaric - this = character:992023 #Athalaric - } - modifier = { - add = 999 - exists = this - exists = character:70515 #Zeno - this = character:70515 #Zeno - } - modifier = { - add = 999 - exists = this - exists = character:70517 #Leo - this = character:70517 #Leo - } - modifier = { - add = 999 - exists = this - exists = character:70514 #Anastasius - this = character:70514 #Anastasius - } - modifier = { - add = 999 - exists = this - exists = character:armenian_01 #Narses - this = character:armenian_01 #Narses - } - modifier = { - add = 999 - exists = this - exists = character:mauro_roman_kings_02 #Massonas - this = character:mauro_roman_kings_02 #Massonas - } - modifier = { - add = 999 - exists = this - exists = character:samo_01 #Samo - this = character:samo_01 #Samo - } - } - } + ai_accept = { + base = 0 + modifier = { # My parents are alive + add = -15 + desc = parents_are_alive_tt + OR = { + father ?= { is_alive = yes } + mother ?= { is_alive = yes } + } + } + modifier = { # I hate my mother + add = 10 + desc = i_hate_my_mother_tt + exists = mother + mother = { is_alive = yes } + opinion = { + value <= medium_negative_opinion + target = mother + } + } + modifier = { # I hate my father + add = 10 + desc = i_hate_my_father_tt + exists = father + father = { is_alive = yes } + opinion = { + value <= medium_negative_opinion + target = father + } + } + modifier = { # I like my mother + add = -10 + desc = i_like_my_mother_tt + exists = mother + mother = { is_alive = yes } + opinion = { + value >= medium_positive_opinion + target = mother + } + } + modifier = { # I like my father + add = -10 + desc = i_like_my_father_tt + exists = father + father = { is_alive = yes } + opinion = { + value >= medium_positive_opinion + target = father + } + } + modifier = { # I like you + add = { + value = 5 + if = { + limit = { + opinion = { + value >= high_positive_opinion + target = scope:actor + } + } + add = 10 + } + if = { + limit = { + opinion = { + value >= very_high_positive_opinion + target = scope:actor + } + } + add = 10 + } + } + desc = i_like_you_tt + opinion = { + value >= medium_positive_opinion + target = scope:actor + } + } + modifier = { # You're my friend :) + add = 10 + desc = youre_my_friend_tt + has_relation_friend = scope:actor + } + modifier = { # You're my guardian + add = 10 + desc = youre_my_guardian_tt + has_relation_guardian = scope:actor + } + modifier = { # I have no mother + add = 5 + desc = i_want_a_mother_tt + scope:actor = { is_female = yes } + OR = { + NOT = { exists = mother } + mother = { is_alive = no } + } + } + modifier = { # I have no father + add = 5 + desc = i_want_a_father_tt + scope:actor = { is_male = yes } + OR = { + NOT = { exists = father } + father = { is_alive = no } + } + } + modifier = { # I am a noble! + add = -15 + desc = i_am_noble_tt + has_no_particular_noble_roots_trigger = no + } + modifier = { # We are so alike ^^ + add = { + value = 5 + if = { + limit = { + number_of_personality_traits_in_common = { + target = scope:actor + value = 2 + } + } + multiply = 2 + } + else_if = { + limit = { + number_of_personality_traits_in_common = { + target = scope:actor + value = 3 + } + } + multiply = 3 + } + else_if = { + limit = { + number_of_personality_traits_in_common = { + target = scope:actor + value = 4 + } + } + multiply = 4 + } + } + desc = we_are_alike_tt + number_of_personality_traits_in_common = { + target = scope:actor + value >= 1 + } + } + modifier = { # Yo, you're offering me a place in a landed house? Sick. + add = 10 + desc = ambition_tt + has_trait = ambitious + } + modifier = { + value = 0 + if = { + limit = { + scope:recipient = { has_trait = low_senator } + scope:actor = { + AND = { + OR = { + government_has_flag = government_is_imperial + government_has_flag = government_is_administrative + government_has_flag = government_is_autocratic + government_has_flag = government_is_autocratic_ep3 + government_has_flag = government_is_imperial_cult + } + highest_held_title_tier > tier_kingdom + } + } + } + add = 10 + } + if = { + limit = { + scope:recipient = { has_trait = senator } + scope:actor = { + AND = { + OR = { + government_has_flag = government_is_imperial + government_has_flag = government_is_administrative + government_has_flag = government_is_autocratic + government_has_flag = government_is_autocratic_ep3 + government_has_flag = government_is_imperial_cult + } + highest_held_title_tier > tier_kingdom + } + } + } + add = 20 + } + if = { + limit = { + scope:recipient = { has_trait = high_senator } + scope:actor = { + AND = { + OR = { + government_has_flag = government_is_imperial + government_has_flag = government_is_administrative + government_has_flag = government_is_autocratic + government_has_flag = government_is_autocratic_ep3 + government_has_flag = government_is_imperial_cult + } + highest_held_title_tier > tier_kingdom + } + } + } + add = 30 + } + } + modifier = { + add = 25 + scope:influence_send_option = yes + desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION + } + } + + ai_frequency = 120 + + ai_will_do = { + base = 50 + modifier = { # I am childless and my marriage will never produce heirs + add = 100 + scope:actor = { + any_child = { + count < 1 + } + OR = { + fertility <= low_fertility + AND = { + is_male = yes + NOT = { + any_spouse = { + fertility > low_fertility + is_female = yes + } + } + } + AND = { + is_female = yes + NOT = { + any_spouse = { + fertility > low_fertility + is_male = yes + } + } + } + } + } + } - ### FP1 Beards ### - male_beard_fp1_01 = { # Twin braids with metal rings - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.84 # For the randomness to work correctly - } - } - weight = { - base = 0 - } - } + modifier = { # I am kind and the child is an orphan + add = 100 + scope:actor = { + ai_compassion >= high_positive_compassion + } + NOT = { + exists = scope:recipient.mother + exists = scope:recipient.father + } + } - male_beard_fp1_02 = { # Short low beard - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.1 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:159117 #Kubrat - this = character:159117 #Kubrat - } - } - } + modifier = { # Traits in common + add = 25 + scope:actor = { + number_of_personality_traits_in_common = { + target = scope:recipient + value = 1 + } + } + } - male_beard_fp1_03 = { # Wavy pointy beard - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.90 # For the randomness to work correctly - } - } - weight = { - base = 0 - - } - } + modifier = { # Traits in common + add = 25 + scope:actor = { + number_of_personality_traits_in_common = { + target = scope:recipient + value = 2 + } + } + } - male_beard_fp1_04 = { # Huge braid - dna_modifiers = { - accessory = { - mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.94 # For the randomness to work correctly - } - } - weight = { - base = 0 - } - } + modifier = { # Traits in common + add = 25 + scope:actor = { + number_of_personality_traits_in_common = { + target = scope:recipient + value = 3 + } + } + } - male_beard_fp1_05 = { # Long narrow wavy + modifier = { # My culture is into adoption + add = 25 + scope:actor = { + OR = { + culture = { has_cultural_parameter = free_adoption } + has_game_rule = adoption_always_allowed + } + } + } + + modifier = { # I like the kid + add = 25 + scope:actor = { + opinion = { + value >= medium_positive_opinion + target = scope:recipient + } + } + } + + modifier = { # The kid is my friend uwu + add = 25 + scope:actor = { + has_relation_friend = scope:recipient + } + } + + modifier = { # The kid is my ward + add = 25 + scope:actor = { + has_relation_guardian = scope:recipient + } + } + + modifier = { # I care about bloodlines and dynasties and whatnot + add = -25 + scope:actor = { + NOR = { + culture = { has_cultural_parameter = free_adoption } + has_game_rule = adoption_always_allowed + has_trait = humble + has_trait = callous + } + } + } + + modifier = { # I will not adopt filthy filthy heretics + factor = 0 + faith = { + faith_hostility_level = { + target = scope:recipient.faith + value >= faith_astray_level + } + } + } + } +} + } +} + + +"gfx/portraits/portrait_modifiers/TFE_easter_egg.txt" = { + # from error.log: + # modes modify, modify_multiply and replace only work for regular genes + { +marshalnsc_portrait_modifier = { + usage = game + marshalnsc_portrait_modifier = { dna_modifiers = { + morph = { + mode = replace + gene = gene_balding_hair_effect + template = no_baldness + value = 1 + } accessory = { mode = add - gene = beards - template = scripted_character_beards_01 - value = 0.97 # For the randomness to work correctly + gene = special_headgear_spectacles + template = spectacles + value = 1 } - } + } weight = { base = 0 modifier = { - add = 999 - exists = this - exists = character:997012 #Childebert - this = character:997012 #Childebert - } - modifier = { - add = 999 - exists = this - exists = character:992003 #Hermanaric - this = character:992003 #Hermanaric + add = 100 + has_character_flag = marshalnsc_portrait_modifier } } } @@ -6525,665 +32880,604 @@ beards_scripted_characters = { } } -"gfx/portraits/portrait_modifiers/50_headgear_scripted_characters.txt" = { - { -headgear_scripted_characters = { - usage = game - selection_behavior = max - priority = 10 +# TODO: [00:36:38][E][pdx_persistent_reader.cpp:216]: Error: "Malformed token: scope:court_chaplain_check, near line: 84" in file: "common/pool_character_selectors/00_clergy.txt" near line: 84 + + +"music/in_game/TFE_music.txt" = { + # remove music cue overrides + { +mx_cue_death = { + music = "file:/music/TFE/TFE_Death.ogg" + pause_factor = 25 + # play every time +} + +mx_cue_combat_3 = { + music = "file:/music/TFE/TFE_WarCry.ogg" + pause_factor = 25 + # Cooldown + years = 1 +} + +mx_cue_combat_2 = { + music = "file:/music/TFE/TFE_Combat1.ogg" + pause_factor = 25 + # Cooldown + years = 1 +} + +# mx_cue_ck3_vocal_maintheme = { +# music = "event:/MUSIC/Cues/Events/CK3 Vocal Main Theme/mx_cue_ck3_vocal_maintheme" +# pause_factor = 25 +# # play every time + +# } + +# mx_cue_banquet = { +# music = "event:/MUSIC/Cues/Events/Banquet/mx_cue_banquet" +# pause_factor = 25 +# # play every time +# calls = 2 + +# } + +mx_cue_crusade_starts = { + music = "file:/music/TFE/TFE_WARDECLARED.ogg" + pause_factor = 25 + # play every time + +} + +mx_cue_war_declared = { + music = "file:/music/TFE/TFE_WARDECLARED.ogg" + name = "TFE_war_declared" + pause_factor = 35 + # play every time +} + +mx_cue_combat_stinger = { + music = "file:/music/TFE/TFE_Combat2.ogg" + pause_factor = 25 + # Cooldown + #years = 1 +} + +# mx_cue_positive_effect = { +# music = "event:/MUSIC/Cues/Events/Positive/mx_cue_postive_effect" +# pause_factor = 25 +# # Cooldown +# #months = 3 +# } + + mx_cue_peace_ensues = { + music = "file:/music/TFE/TFE_Champion.ogg" + pause_factor = 25 + # play every time +} + +# mx_cue_faith_conversion = { +# music = "event:/MUSIC/Cues/Events/faith_conversion/mx_cue_faith_conversion" +# pause_factor = 25 +# # Cooldown +# calls = 2 +# } + + mx_cue_birth = { + music = "file:/music/TFE/TFE_A_New_Heir.ogg" + pause_factor = 25 + # play only once +} + + mx_cue_stress = { + music = "file:/music/TFE/TFE_Stress.ogg" + pause_factor = 25 + # Cooldown + calls = 3 +} + +mx_cue_illness = { + music = "file:/music/TFE/TFE_Illness.ogg" + pause_factor = 25 + # Cooldown + calls = 3 +} + +mx_cue_murder = { + music = "file:/music/TFE/TFE_Murder.ogg" + pause_factor = 25 + # Cooldown + years = 1 +} + +mx_cue_succession = { + music = "file:/music/TFE/TFE_Death.ogg" + pause_factor = 25 + # play every time +} + +mx_cue_succession_instrumental = { + music = "file:/music/TFE/TFE_Death.ogg" + #name = "TFE_death" + pause_factor = 25 + # play every time +} + } +} + + +"music/music_player_categories/TFE_music_categories.txt" = { + # from error.log: + # [02:36:24][E][music_tracks.cpp:185]: Could not find the track "TFE_main_theme_track" that was specified for the music category "TFE_soundtrack" + # [02:36:24][E][music_tracks.cpp:185]: Could not find the track "TFE_war_declared" that was specified for the music category "TFE_soundtrack" + { + "TFE_main_theme_track" + } + { + "TFE_war_declared" + } +} + + +"events/decisions_events/TFE_major_decisions_events.txt" = { + # from error.log: + # [02:52:37][E][jomini_effect.cpp:546]: Unknown effect found_capital_of_visigothic_scripted_effect at file: events/decisions_events/TFE_major_decisions_events.txt line: 231 (TFE_major_decisions.0020:option) + # [02:52:37][E][jomini_effect.cpp:546]: Unknown effect found_capital_of_visigothic_scripted_effect at file: events/decisions_events/TFE_major_decisions_events.txt line: 280 (TFE_major_decisions.0021:immediate) + # [02:52:37][E][jomini_effect.cpp:546]: Unknown effect found_capital_of_visigothic_scripted_effect at file: events/decisions_events/TFE_major_decisions_events.txt line: 319 (TFE_major_decisions.0022:immediate) + { +############################################################### +# # +# Establish a new Capital for the Visigoths # +# by Juli # +# 0020-0022 # +############################################################### + +# Founder event +TFE_major_decisions.0020 = { + type = character_event + title = TFE_major_decisions.0020.t + desc = TFE_major_decisions.0020.desc + theme = realm + left_portrait = { + character = scope:founder + animation = personality_honorable + } + + override_background = { reference = market_west } + + immediate = { + play_music_cue = "mx_cue_epic_sacral_moment" + } + + #Toledo shall be my capital. + option = { + name = TFE_major_decisions.0020.a + + trigger = { + #Must have title:c_toledo in order to make it your capital. + any_sub_realm_county = { this = title:c_toledo } + #And Kiev cannot be held by a player who has _only_ title:c_toledo, unless that player is you. + title:c_toledo.holder = { + OR = { + is_ai = yes + any_held_title = { + count >= 1 + tier = tier_county + NOT = { this = title:c_toledo } + } + this = scope:founder + } + } + } + + #Organise the usurpation/capital move of title:c_toledo if appropriate. + if = { + limit = { + NOT = { title:c_toledo.holder = scope:founder } + } + create_title_and_vassal_change = { + type = usurped + save_scope_as = change + add_claim_on_loss = yes + } + title:c_toledo = { + change_title_holder = { + holder = root + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + } + set_realm_capital = title:c_toledo + #Otherwise, set title:c_toledo to be scope:new_visigothic_capital & go through with the effect. + title:c_toledo = { + save_scope_as = new_visigothic_capital + found_capital_of_visigoths_scripted_effect = yes + } + + ai_chance = { + #AI should always take this option if it's available. + base = 100 + } + } + + #My current capital shall be my capital! + option = { + name = TFE_major_decisions.0020.b + + #Not generally necessary, but just to stop some weird loc eventualities. + trigger = { + NOT = { capital_county = title:c_toledo } + } + + #We try to use the player's current capital, but if they've moved it outside of e_spain, then we go with the default set in the standard decision entry. + if = { + limit = { capital_county.empire = title:e_spain } + #Formatted a little inefficiently for readability. + capital_county = { save_scope_as = new_visigothic_capital } + } + #Then enact the actual effects. + found_capital_of_visigothic_scripted_effect = yes + + ai_chance = { + #AI will only take this option if they have no other choice (i.e., can't get Kiev). + base = 0 + } + } + + after = { + #Take care of notification events. + every_player = { + limit = { + capital_province = { + OR = { + geographical_region = world_europe_west + geographical_region = world_europe_south + geographical_region = world_africa_north + } + } + #Obviously, we exempt scope:founder themselves. + NOT = { this = scope:founder } + } + #Vassal players get a separate event. + if = { + limit = { + any_liege_or_above = { this = scope:founder } + } + trigger_event = TFE_major_decisions.0021 + } + #Everyone else within range gets a less personal version. + else = { trigger_event = TFE_major_decisions.0022 } + } + } +} + +# Vassal notification event +TFE_major_decisions.0021 = { + type = character_event + title = TFE_major_decisions.0021.t + desc = TFE_major_decisions.0021.desc + theme = realm + left_portrait = { + character = scope:founder + animation = personality_honorable + } + + override_background = { reference = market_west } + immediate = { + play_music_cue = "mx_cue_epic_sacral_moment" + show_as_tooltip = { found_capital_of_visigothic_scripted_effect = yes } + } + + #A worthy capital! + option = { + name = TFE_major_decisions.0021.a - no_headgear = { # No headgear - dna_modifiers = { - accessory = { - mode = add - gene = headgear - template = fp2_scripted_headgear_01 - value = 0.1 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 50 - exists = this - exists = character:73857 - this = character:73857 - } - modifier = { - add = 50 - exists = this - exists = character:108501 - this = character:108501 + ai_chance = { + #Doesn't especially matter. + base = 100 } - modifier = { - add = 999 - exists = this - exists = character:900062 #Stilicho - this = character:900062 #Stilicho + } + + #Bah, ain't no city of mine. + option = { + name = TFE_major_decisions.0021.b + + ai_chance = { + #Doesn't especially matter. + base = 100 } - modifier = { - add = 999 - exists = this - exists = character:nuvelan_11 #Gildo - this = character:nuvelan_11 #Gildo + } +} + +# Distant players notification event +TFE_major_decisions.0022 = { + type = character_event + title = TFE_major_decisions.0022.t + desc = TFE_major_decisions.0022.desc + theme = realm + left_portrait = { + character = scope:founder + animation = personality_honorable + } + + override_background = { reference = market_west } + + immediate = { + play_music_cue = "mx_cue_epic_sacral_moment" + show_as_tooltip = { found_capital_of_visigothic_scripted_effect = yes } + } + + #This scope:new_visigothic_capital sounds intriguingly rich... + option = { + name = TFE_major_decisions.0022.a + trigger = { + OR = { + culture = { has_cultural_pillar = heritage_east_germanic } + } } - modifier = { - add = 999 - exists = this - exists = character:belisarius_001 #Belisarius - this = character:belisarius_001 #Belisarius + + ai_chance = { + #Doesn't especially matter. + base = 100 } - } - } + } - male_headgear_secular_fp2_iberian_muslim_common_01_low = { - dna_modifiers = { - accessory = { - mode = add - gene = headgear - template = fp2_scripted_headgear_01 - value = 0.5 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 50 - exists = this - exists = character:73813 # Musa - this = character:73813 + #They're still just backwards foreigners. + option = { + name = TFE_major_decisions.0022.b + trigger = { + NOR = { + culture = { has_cultural_pillar = heritage_east_germanic } } } - } - male_headgear_secular_fp2_iberian_muslim_high_nobility_01 = { - dna_modifiers = { - accessory = { - mode = add - gene = headgear - template = fp2_scripted_headgear_01 - value = 1 # For the randomness to work correctly - } - } - weight = { - base = 0 - modifier = { - add = 50 - exists = this - exists = character:danis0005 # Adanis - this = character:danis0005 - } + ai_chance = { + #Doesn't especially matter. + base = 100 } } - male_headgear_secular_roman_pannonian_hat_high_nobility = { - dna_modifiers = { - accessory = { - mode = add - gene = headgear - template = roman_pannonian_hat_high - value = 1 - } + + #I don't really see how this concerns me? + option = { + name = TFE_major_decisions.0022.c + + ai_chance = { + #Doesn't especially matter. + base = 100 } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:nepos_02 #Nepos - this = character:nepos_02 #Nepos - } + } +} + } +} + + +"common/on_action/TFE_activity_on_actions.txt" = { + # from error.log: + # [02:52:37][E][pdx_persistent_reader.cpp:216]: Error: "Unexpected token: if, near line: 66" in file: "common/on_action/TFE_activity_on_actions.txt" near line: 72 + # [02:52:37][E][pdx_persistent_reader.cpp:216]: Error: "Unexpected token: else_if, near line: 73" in file: "common/on_action/TFE_activity_on_actions.txt" near line: 78 + # [02:52:37][E][pdx_persistent_reader.cpp:216]: Error: "Unexpected token: else_if, near line: 79" in file: "common/on_action/TFE_activity_on_actions.txt" near line: 84 + # [02:52:37][E][pdx_persistent_reader.cpp:216]: Error: "Unexpected token: else, near line: 85" in file: "common/on_action/TFE_activity_on_actions.txt" near line: 87 + { +#DOESN'T WORK DO IN ACTIVITY DIRECTLY +gladiator_new_event_selection_guest = { + if = { + limit = { + #scope:TFE_games_option_fights ?= flag:TFE_games_option_fights_good + scope:activity = { is_lodgings_good = yes } } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:syagri_06 #Syagrius - this = character:syagri_06 #Syagrius - } + on_action = gladiator_new_event_selection_guest_good + } + else_if = { + limit = { + scope:activity = { is_lodgings_very_good = yes } } + on_action = gladiator_new_event_selection_guest_very_good } - male_headgear_secular_western_high_nobility = { - dna_modifiers = { - accessory = { - mode = add - gene = headgear - template = western_high_nobility - value = 1 - } + else_if = { + limit = { + scope:activity = { is_lodgings_bad = yes } } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:900016 #Faramund - this = character:900016 #Faramund + on_action = gladiator_new_event_selection_guest_bad + } + else = { + on_action = gladiator_new_event_selection_guest_default + } +} + } +} + + +"common/on_action/resources_on_actions.txt" = { + # from error.log: + # [04:13:22][E][jomini_script_system.cpp:284]: Script system error! + # Error: add_county_modifier effect [ Invalid database object 'sugar_resources_modifier' ] + # Script location: file: common/on_action/resources_on_actions.txt line: 5167 (on_resource_start) + { + ##SUGAR + title:c_sfax = { + add_county_modifier = { + modifier = sugar_resources_modifier + } + title_province = { + + } } + } +} + + +"common/culture/innovations/00_late_antiquity_innovations.txt" = { + # from error.log: "Failed to read key reference: TFE_region_china: TFE_region_china, near line: 302" + { +innovation_sky_lanterns = { + group = culture_group_regional + culture_era = culture_era_late_antiquity + region = TFE_region_china + icon = @misc_inventions + + character_modifier = { + siege_morale_loss = 0.1 + } + + flag = global_regional + flag = late_antiquity_era_regional +} + } +} + + +"history/cultures/heritage_chinese.txt" = { + # We're removing this because innovation_sky_lanterns is removed above. + { + discover_innovation = innovation_sky_lanterns + } +} + + +"common/customizable_localization/TFE_custom_loc.txt" = { + # error.log + # [13:34:07][E][jomini_custom_text.cpp:114]: Invalid/missing scope type for custom localization 'feudal_government_or_dynastic', at 'file: common/customizable_localization/TFE_custom_loc.txt line: 219 (feudal_government_or_dynastic)' + # [13:34:07][E][jomini_custom_text.cpp:114]: Invalid/missing scope type for custom localization 'feudal_government_or_dynastic_adj', at 'file: common/customizable_localization/TFE_custom_loc.txt line: 233 (feudal_government_or_dynastic_adj)' + # [13:34:07][E][jomini_custom_text.cpp:114]: Invalid/missing scope type for custom localization 'feudal_government_or_dynastic_realm', at 'file: common/customizable_localization/TFE_custom_loc.txt line: 247 (feudal_government_or_dynastic_realm)' + { +feudal_government_or_dynastic = { + type = empty + text = { + trigger = { + dummy_male.current_date < 650.1.1 } + localization_key = feudal_government_dynastic } - male_headgear_secular_roman_diadem = { - dna_modifiers = { - accessory = { - mode = add - gene = headgear - template = roman_diadem - value = 1 - } + text = { + localization_key = feudal_government_feudal + fallback = yes + } +} + +feudal_government_or_dynastic_adj = { + type = empty + text = { + trigger = { + dummy_male.current_date < 650.1.1 } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:70515 #Zeno - this = character:70515 #Zeno - } + localization_key = feudal_government_dynastic_adj + } + text = { + localization_key = feudal_government_feudal_adj + fallback = yes + } +} + +feudal_government_or_dynastic_realm = { + type = empty + text = { + trigger = { + dummy_male.current_date < 650.1.1 } + localization_key = feudal_government_dynastic_realm } - male_headgear_secular_sassanid_crown = { - dna_modifiers = { - accessory = { - mode = add - gene = headgear - template = ep1_sassanid_crown - value = 1 + text = { + localization_key = feudal_government_feudal_realm + fallback = yes + } +} + } +} + + +"common/religion/doctrines/00_core_tenets.txt" = { + # from error.log: + # Error: "Unexpected token: monthly_county_control_change_factor, near line: 487" in file: "common/religion/doctrines/00_core_tenets.txt" near line: 487 + { + monthly_county_control_change_factor = 0.15 + } + + # from error.log: + # Error: "Trigger section already read earlier: is_shown, near line: 615" in file: "common/religion/doctrines/00_core_tenets.txt" near line: 621 + { + is_shown = { + OR = { + religion_tag = judaism_religion + religion_tag = christianity_religion + religion_tag = islam_religion } } - weight = { - base = 0 - modifier = { - add = 999 - exists = this - exists = character:180628 #Khosrau - this = character:180628 #Khosrau + } +} + + +"common/character_interactions/00_prison_interactions.txt" = { + # from error.log: + # Error: "Unknown trigger type: limit, near line: 96" in file: "common/character_interactions/00_prison_interactions.txt" near line: 107 + { + custom_description = { + text = great_houses_are_too_strong + subject = scope:actor + trigger_if = { + limit = { + AND = { + exists = title:e_persia.holder + scope:actor = title:e_persia.holder + title:e_persia.holder = { + government_has_flag = government_is_eranshar + sevenhouses_enabled = yes + + } + scope:actor = { + sevenhouses_strength_value >= 85 + } + } + } + NOT = { + any_in_global_list = { + variable = seven_houses + limit = { + AND = { + exists = dynast + dynast = { + is_landed = yes + is_independent_ruler = no + } + dynast.top_liege = title:e_persia.holder + } + } + scope:recipient = dynast + } + } } } } } + + +"common/buildings/00_temple_buildings.txt" = { + # from error.log: + # Error: "Trigger section already read earlier: can_construct_showing_failures_only, near line: 637" in file: "common/buildings/00_temple_buildings.txt" near line: 640 + { + can_construct_showing_failures_only = { + building_requirement_tribal = no + building_requirement_tribal_holding_in_county = yes + } } } -"common/dna_data/00_dna_patrons.txt" = { - { -bitcoin_patron ={ - portrait_info={ - genes={ - hair_color={ 13 247 117 230 } - skin_color={ 159 149 199 103 } - eye_color={ 241 76 44 160 } - gene_chin_forward={ "chin_forward_neg" 125 "chin_forward_neg" 125 } - gene_chin_height={ "chin_height_neg" 114 "chin_height_neg" 114 } - gene_chin_width={ "chin_width_pos" 183 "chin_width_pos" 183 } - gene_eye_angle={ "eye_angle_pos" 133 "eye_angle_pos" 133 } - gene_eye_depth={ "eye_depth_neg" 119 "eye_depth_neg" 119 } - gene_eye_height={ "eye_height_pos" 131 "eye_height_pos" 131 } - gene_eye_distance={ "eye_distance_pos" 137 "eye_distance_pos" 137 } - gene_eye_shut={ "eye_shut_pos" 139 "eye_shut_pos" 139 } - gene_forehead_angle={ "forehead_angle_neg" 107 "forehead_angle_neg" 107 } - gene_forehead_brow_height={ "forehead_brow_height_neg" 105 "forehead_brow_height_neg" 105 } - gene_forehead_roundness={ "forehead_roundness_pos" 166 "forehead_roundness_pos" 166 } - gene_forehead_width={ "forehead_width_neg" 114 "forehead_width_neg" 114 } - gene_forehead_height={ "forehead_height_pos" 161 "forehead_height_pos" 161 } - gene_head_height={ "head_height_neg" 112 "head_height_neg" 86 } - gene_head_width={ "head_width_pos" 156 "head_width_pos" 131 } - gene_head_profile={ "head_profile_pos" 177 "head_profile_pos" 134 } - gene_head_top_height={ "head_top_height_pos" 0 "head_top_height_pos" 128 } - gene_head_top_width={ "head_top_width_pos" 125 "head_top_width_pos" 146 } - gene_jaw_angle={ "jaw_angle_neg" 105 "jaw_angle_neg" 105 } - gene_jaw_forward={ "jaw_forward_pos" 139 "jaw_forward_pos" 139 } - gene_jaw_height={ "jaw_height_pos" 129 "jaw_height_pos" 129 } - gene_jaw_width={ "jaw_width_neg" 101 "jaw_width_neg" 101 } - gene_mouth_corner_depth={ "mouth_corner_depth_pos" 130 "mouth_corner_depth_pos" 130 } - gene_mouth_corner_height={ "mouth_corner_height_neg" 127 "mouth_corner_height_neg" 127 } - gene_mouth_forward={ "mouth_forward_pos" 131 "mouth_forward_pos" 131 } - gene_mouth_height={ "mouth_height_neg" 114 "mouth_height_neg" 114 } - gene_mouth_width={ "mouth_width_pos" 137 "mouth_width_pos" 137 } - gene_mouth_upper_lip_size={ "mouth_upper_lip_size_pos" 151 "mouth_upper_lip_size_pos" 151 } - gene_mouth_lower_lip_size={ "mouth_lower_lip_size_neg" 91 "mouth_lower_lip_size_neg" 91 } - gene_mouth_open={ "mouth_open_neg" 115 "mouth_open_neg" 115 } - gene_neck_length={ "neck_length_neg" 141 "neck_length_neg" 76 } - gene_neck_width={ "neck_width_neg" 117 "neck_width_neg" 117 } - gene_bs_cheek_forward={ "cheek_forward_pos" 163 "cheek_forward_pos" 163 } - gene_bs_cheek_height={ "cheek_height_neg" 14 "cheek_height_neg" 14 } - gene_bs_cheek_width={ "cheek_width_neg" 9 "cheek_width_neg" 9 } - gene_bs_ear_angle={ "ear_angle_neg" 112 "ear_angle_neg" 112 } - gene_bs_ear_inner_shape={ "ear_inner_shape_pos" 11 "ear_inner_shape_pos" 11 } - gene_bs_ear_bend={ "ear_upper_bend_pos" 35 "ear_upper_bend_pos" 35 } - gene_bs_ear_outward={ "ear_outward_pos" 7 "ear_outward_pos" 7 } - gene_bs_ear_size={ "ear_size_pos" 119 "ear_size_pos" 119 } - gene_bs_eye_corner_depth={ "eye_corner_depth_pos" 243 "eye_corner_depth_pos" 243 } - gene_bs_eye_fold_shape={ "eye_fold_shape_pos" 149 "eye_fold_shape_pos" 149 } - gene_bs_eye_size={ "eye_size_neg" 37 "eye_size_neg" 37 } - gene_bs_eye_upper_lid_size={ "eye_upper_lid_size_pos" 15 "eye_upper_lid_size_pos" 15 } - gene_bs_forehead_brow_curve={ "forehead_brow_curve_neg" 48 "forehead_brow_curve_neg" 48 } - gene_bs_forehead_brow_forward={ "forehead_brow_forward_neg" 98 "forehead_brow_forward_neg" 98 } - gene_bs_forehead_brow_inner_height={ "forehead_brow_inner_height_neg" 51 "forehead_brow_inner_height_neg" 51 } - gene_bs_forehead_brow_outer_height={ "forehead_brow_outer_height_pos" 59 "forehead_brow_outer_height_pos" 59 } - gene_bs_forehead_brow_width={ "forehead_brow_width_pos" 30 "forehead_brow_width_pos" 30 } - gene_bs_jaw_def={ "jaw_def_neg" 19 "jaw_def_neg" 19 } - gene_bs_mouth_lower_lip_def={ "mouth_lower_lip_def_pos" 44 "mouth_lower_lip_def_pos" 44 } - gene_bs_mouth_lower_lip_full={ "mouth_lower_lip_full_pos" 60 "mouth_lower_lip_full_pos" 60 } - gene_bs_mouth_lower_lip_pad={ "mouth_lower_lip_pad_neg" 2 "mouth_lower_lip_pad_neg" 2 } - gene_bs_mouth_lower_lip_width={ "mouth_lower_lip_width_pos" 14 "mouth_lower_lip_width_pos" 14 } - gene_bs_mouth_philtrum_def={ "mouth_philtrum_def_pos" 51 "mouth_philtrum_def_pos" 51 } - gene_bs_mouth_philtrum_shape={ "mouth_philtrum_shape_neg" 23 "mouth_philtrum_shape_neg" 23 } - gene_bs_mouth_philtrum_width={ "mouth_philtrum_width_neg" 36 "mouth_philtrum_width_neg" 36 } - gene_bs_mouth_upper_lip_def={ "mouth_upper_lip_def_pos" 33 "mouth_upper_lip_def_pos" 33 } - gene_bs_mouth_upper_lip_full={ "mouth_upper_lip_full_pos" 24 "mouth_upper_lip_full_pos" 24 } - gene_bs_mouth_upper_lip_profile={ "mouth_upper_lip_profile_neg" 99 "mouth_upper_lip_profile_neg" 99 } - gene_bs_mouth_upper_lip_width={ "mouth_upper_lip_width_neg" 33 "mouth_upper_lip_width_neg" 33 } - gene_bs_nose_forward={ "nose_forward_pos" 255 "nose_forward_neg" 76 } - gene_bs_nose_height={ "nose_height_pos" 115 "nose_height_pos" 14 } - gene_bs_nose_length={ "nose_length_neg" 133 "nose_length_pos" 93 } - gene_bs_nose_nostril_height={ "nose_nostril_height_pos" 34 "nose_nostril_height_pos" 34 } - gene_bs_nose_nostril_width={ "nose_nostril_width_pos" 38 "nose_nostril_width_pos" 38 } - gene_bs_nose_profile={ "nose_profile_hawk" 62 "nose_profile_neg" 62 } - gene_bs_nose_ridge_angle={ "nose_ridge_angle_pos" 25 "nose_ridge_angle_pos" 25 } - gene_bs_nose_ridge_width={ "nose_ridge_width_neg" 20 "nose_ridge_width_neg" 20 } - gene_bs_nose_size={ "nose_size_pos" 53 "nose_size_pos" 53 } - gene_bs_nose_tip_angle={ "nose_tip_angle_neg" 33 "nose_tip_angle_neg" 33 } - gene_bs_nose_tip_forward={ "nose_tip_forward_neg" 42 "nose_tip_forward_neg" 42 } - gene_bs_nose_tip_width={ "nose_tip_width_pos" 21 "nose_tip_width_pos" 21 } - face_detail_cheek_def={ "cheek_def_01" 39 "cheek_def_01" 39 } - face_detail_cheek_fat={ "cheek_fat_01_pos" 0 "cheek_fat_01_neg" 45 } - face_detail_chin_cleft={ "chin_dimple" 16 "chin_dimple" 16 } - face_detail_chin_def={ "chin_def_neg" 214 "chin_def_neg" 214 } - face_detail_eye_lower_lid_def={ "eye_lower_lid_def" 119 "eye_lower_lid_def" 119 } - face_detail_eye_socket={ "eye_socket_03" 9 "eye_socket_03" 9 } - face_detail_nasolabial={ "nasolabial_01" 0 "nasolabial_01" 17 } - face_detail_nose_ridge_def={ "nose_ridge_def_pos" 1 "nose_ridge_def_pos" 1 } - face_detail_nose_tip_def={ "nose_tip_def" 205 "nose_tip_def" 205 } - face_detail_temple_def={ "temple_def" 244 "temple_def" 244 } - expression_brow_wrinkles={ "brow_wrinkles_02" 50 "brow_wrinkles_02" 50 } - expression_eye_wrinkles={ "eye_wrinkles_02" 175 "eye_wrinkles_02" 175 } - expression_forehead_wrinkles={ "forehead_wrinkles_03" 157 "forehead_wrinkles_03" 157 } - expression_other={ "cheek_wrinkles_both_01" 0 "cheek_wrinkles_both_01" 0 } - complexion={ "complexion_1" 255 "complexion_3" 168 } - gene_height={ "normal_height" 123 "normal_height" 123 } - gene_bs_body_type={ "body_fat_head_fat_full" 92 "body_fat_head_fat_full" 122 } - gene_bs_body_shape={ "body_shape_apple_half" 0 "body_shape_apple_half" 0 } - gene_bs_bust={ "bust_clothes" 204 "bust_shape_3_full" 161 } - gene_age={ "old_1" 225 "old_1" 225 } - gene_eyebrows_shape={ "far_spacing_avg_thickness" 248 "far_spacing_avg_thickness" 248 } - gene_eyebrows_fullness={ "layer_2_low_thickness" 149 "layer_2_low_thickness" 149 } - gene_body_hair={ "body_hair_avg" 95 "body_hair_avg" 95 } - gene_hair_type={ "hair_wavy" 168 "hair_wavy" 168 } - gene_baldness={ "no_baldness" 127 "no_baldness" 127 } - eye_accessory={ "normal_eyes" 18 "normal_eyes" 18 } - teeth_accessory={ "normal_teeth" 0 "normal_teeth" 0 } - eyelashes_accessory={ "normal_eyelashes" 73 "normal_eyelashes" 73 } - hairstyles={ "western_hairstyles_straight" 42 "all_hairstyles" 0 } - beards={ "no_beard" 255 "no_beard" 0 } - clothes={ "western_bedchamber" 79 "most_clothes" 0 } - } - } - enabled = yes -} -cloverskeeper_winner={ - type=male - id=0 - genes={ hair_color={ 135 152 80 76 } - skin_color={ 60 80 60 80 } - eye_color={ 233 129 172 132 } - gene_chin_forward={ "chin_forward_neg" 137 "chin_forward_neg" 124 } - gene_chin_height={ "chin_height_neg" 114 "chin_height_neg" 95 } - gene_chin_width={ "chin_width_pos" 113 "chin_width_pos" 127 } - gene_eye_angle={ "eye_angle_pos" 128 "eye_angle_pos" 128 } - gene_eye_depth={ "eye_depth_neg" 135 "eye_depth_neg" 118 } - gene_eye_height={ "eye_height_neg" 122 "eye_height_neg" 122 } - gene_eye_distance={ "eye_distance_pos" 131 "eye_distance_pos" 131 } - gene_eye_shut={ "eye_shut_pos" 145 "eye_shut_pos" 145 } - gene_forehead_angle={ "forehead_angle_neg" 136 "forehead_angle_neg" 120 } - gene_forehead_brow_height={ "forehead_brow_height_neg" 90 "forehead_brow_height_neg" 120 } - gene_forehead_roundness={ "forehead_roundness_pos" 160 "forehead_roundness_pos" 160 } - gene_forehead_width={ "forehead_width_pos" 125 "forehead_width_pos" 131 } - gene_forehead_height={ "forehead_height_pos" 151 "forehead_height_pos" 132 } - gene_head_height={ "head_height_pos" 165 "head_height_pos" 165 } - gene_head_width={ "head_width_pos" 130 "head_width_pos" 151 } - gene_head_profile={ "head_profile_pos" 166 "head_profile_pos" 166 } - gene_head_top_height={ "head_top_height_pos" 128 "head_top_height_pos" 128 } - gene_head_top_width={ "head_top_width_pos" 122 "head_top_width_pos" 127 } - gene_jaw_angle={ "jaw_angle_pos" 172 "jaw_angle_pos" 128 } - gene_jaw_forward={ "jaw_forward_neg" 105 "jaw_forward_neg" 105 } - gene_jaw_height={ "jaw_height_pos" 126 "jaw_height_pos" 139 } - gene_jaw_width={ "jaw_width_pos" 120 "jaw_width_pos" 175 } - gene_mouth_corner_depth={ "mouth_corner_depth_neg" 116 "mouth_corner_depth_neg" 116 } - gene_mouth_corner_height={ "mouth_corner_height_pos" 160 "mouth_corner_height_pos" 160 } - gene_mouth_forward={ "mouth_forward_neg" 120 "mouth_forward_neg" 120 } - gene_mouth_height={ "mouth_height_pos" 152 "mouth_height_pos" 152 } - gene_mouth_width={ "mouth_width_neg" 121 "mouth_width_neg" 121 } - gene_mouth_upper_lip_size={ "mouth_upper_lip_size_neg" 87 "mouth_upper_lip_size_neg" 87 } - gene_mouth_lower_lip_size={ "mouth_lower_lip_size_neg" 118 "mouth_lower_lip_size_neg" 99 } - gene_mouth_open={ "mouth_open_pos" 152 "mouth_open_pos" 178 } - gene_neck_length={ "neck_length_pos" 134 "neck_length_pos" 134 } - gene_neck_width={ "neck_width_pos" 137 "neck_width_pos" 137 } - gene_bs_cheek_forward={ "cheek_forward_pos" 79 "cheek_forward_pos" 37 } - gene_bs_cheek_height={ "cheek_height_pos" 79 "cheek_height_neg" 35 } - gene_bs_cheek_width={ "cheek_width_neg" 53 "cheek_width_neg" 7 } - gene_bs_ear_angle={ "ear_angle_neg" 197 "ear_angle_neg" 33 } - gene_bs_ear_inner_shape={ "ear_inner_shape_pos" 23 "ear_inner_shape_pos" 23 } - gene_bs_ear_bend={ "ear_both_bend_pos" 4 "ear_upper_bend_pos" 125 } - gene_bs_ear_outward={ "ear_outward_pos" 45 "ear_outward_pos" 34 } - gene_bs_ear_size={ "ear_size_pos" 63 "ear_size_pos" 50 } - gene_bs_eye_corner_depth={ "eye_corner_depth_pos" 51 "eye_corner_depth_pos" 213 } - gene_bs_eye_fold_shape={ "eye_fold_shape_pos" 1 "eye_fold_shape_pos" 1 } - gene_bs_eye_size={ "eye_size_pos" 53 "eye_size_pos" 28 } - gene_bs_eye_upper_lid_size={ "eye_upper_lid_size_neg" 49 "eye_upper_lid_size_pos" 8 } - gene_bs_forehead_brow_curve={ "forehead_brow_curve_neg" 118 "forehead_brow_curve_neg" 118 } - gene_bs_forehead_brow_forward={ "forehead_brow_forward_pos" 3 "forehead_brow_forward_pos" 48 } - gene_bs_forehead_brow_inner_height={ "forehead_brow_inner_height_pos" 105 "forehead_brow_inner_height_pos" 121 } - gene_bs_forehead_brow_outer_height={ "forehead_brow_outer_height_pos" 89 "forehead_brow_outer_height_pos" 120 } - gene_bs_forehead_brow_width={ "forehead_brow_width_pos" 63 "forehead_brow_width_pos" 27 } - gene_bs_jaw_def={ "jaw_def_neg" 57 "jaw_def_neg" 2 } - gene_bs_mouth_lower_lip_def={ "mouth_lower_lip_def_pos" 85 "mouth_lower_lip_def_pos" 85 } - gene_bs_mouth_lower_lip_full={ "mouth_lower_lip_full_pos" 81 "mouth_lower_lip_full_pos" 31 } - gene_bs_mouth_lower_lip_pad={ "mouth_lower_lip_pad_neg" 47 "mouth_lower_lip_pad_neg" 104 } - gene_bs_mouth_lower_lip_width={ "mouth_lower_lip_width_neg" 5 "mouth_lower_lip_width_neg" 5 } - gene_bs_mouth_philtrum_def={ "mouth_philtrum_def_pos" 27 "mouth_philtrum_def_pos" 27 } - gene_bs_mouth_philtrum_shape={ "mouth_philtrum_shape_pos" 38 "mouth_philtrum_shape_pos" 38 } - gene_bs_mouth_philtrum_width={ "mouth_philtrum_width_neg" 113 "mouth_philtrum_width_neg" 113 } - gene_bs_mouth_upper_lip_def={ "mouth_upper_lip_def_pos" 42 "mouth_upper_lip_def_pos" 42 } - gene_bs_mouth_upper_lip_full={ "mouth_upper_lip_full_pos" 97 "mouth_upper_lip_full_pos" 22 } - gene_bs_mouth_upper_lip_profile={ "mouth_upper_lip_profile_pos" 162 "mouth_upper_lip_profile_pos" 162 } - gene_bs_mouth_upper_lip_width={ "mouth_upper_lip_width_pos" 11 "mouth_upper_lip_width_pos" 11 } - gene_bs_nose_forward={ "nose_forward_pos" 31 "nose_forward_neg" 15 } - gene_bs_nose_height={ "nose_height_pos" 7 "nose_height_neg" 24 } - gene_bs_nose_length={ "nose_length_pos" 47 "nose_length_pos" 122 } - gene_bs_nose_nostril_height={ "nose_nostril_height_neg" 79 "nose_nostril_height_pos" 18 } - gene_bs_nose_nostril_width={ "nose_nostril_width_neg" 141 "nose_nostril_width_neg" 50 } - gene_bs_nose_profile={ "nose_profile_neg" 43 "nose_profile_neg" 58 } - gene_bs_nose_ridge_angle={ "nose_ridge_angle_pos" 33 "nose_ridge_angle_neg" 37 } - gene_bs_nose_ridge_width={ "nose_ridge_width_neg" 7 "nose_ridge_width_neg" 32 } - gene_bs_nose_size={ "nose_size_pos" 24 "nose_size_pos" 24 } - gene_bs_nose_tip_angle={ "nose_tip_angle_pos" 7 "nose_tip_angle_pos" 7 } - gene_bs_nose_tip_forward={ "nose_tip_forward_neg" 213 "nose_tip_forward_neg" 18 } - gene_bs_nose_tip_width={ "nose_tip_width_neg" 135 "nose_tip_width_neg" 51 } - face_detail_cheek_def={ "cheek_def_02" 173 "cheek_def_01" 10 } - face_detail_cheek_fat={ "cheek_fat_01_neg" 43 "cheek_fat_01_pos" 3 } - face_detail_chin_cleft={ "chin_cleft" 181 "chin_dimple" 13 } - face_detail_chin_def={ "chin_def_neg" 249 "chin_def_neg" 249 } - face_detail_eye_lower_lid_def={ "eye_lower_lid_def" 140 "eye_lower_lid_def" 83 } - face_detail_eye_socket={ "eye_socket_color_01" 25 "eye_socket_color_02" 25 } - face_detail_nasolabial={ "nasolabial_03" 55 "nasolabial_03" 55 } - face_detail_nose_ridge_def={ "nose_ridge_def_neg" 18 "nose_ridge_def_pos" 18 } - face_detail_nose_tip_def={ "nose_tip_def" 60 "nose_tip_def" 60 } - face_detail_temple_def={ "temple_def" 226 "temple_def" 226 } - expression_brow_wrinkles={ "brow_wrinkles_01" 33 "brow_wrinkles_01" 33 } - expression_eye_wrinkles={ "eye_wrinkles_02" 217 "eye_wrinkles_02" 217 } - expression_forehead_wrinkles={ "forehead_wrinkles_03" 172 "forehead_wrinkles_03" 172 } - expression_other={ "cheek_wrinkles_both_01" 0 "cheek_wrinkles_both_01" 0 } - complexion={ "complexion_7" 255 "complexion_5" 201 } - gene_height={ "normal_height" 126 "normal_height" 116 } - gene_bs_body_type={ "body_fat_head_fat_low" 126 "body_fat_head_fat_full" 126 } - gene_bs_body_shape={ "body_shape_hourglass_half" 51 "body_shape_hourglass_half" 0 } - gene_bs_bust={ "bust_clothes" 80 "bust_default" 111 } - gene_age={ "old_3" 123 "old_3" 123 } - gene_eyebrows_shape={ "avg_spacing_lower_thickness" 116 "avg_spacing_avg_thickness" 138 } - gene_eyebrows_fullness={ "layer_2_low_thickness" 91 "layer_2_avg_thickness" 147 } - gene_body_hair={ "body_hair_avg" 167 "body_hair_avg" 167 } - gene_hair_type={ "hair_straight" 117 "hair_straight" 117 } - gene_baldness={ "no_baldness" 127 "no_baldness" 127 } - eye_accessory={ "normal_eyes" 103 "normal_eyes" 103 } - teeth_accessory={ "normal_teeth" 0 "normal_teeth" 0 } - eyelashes_accessory={ "normal_eyelashes" 201 "normal_eyelashes" 201 } - beards={ "no_beard" 255 "no_beard" 0 } - hairstyles={ "northern_hairstyles_straight" 95 "all_hairstyles" 0 } - clothes={ "western_bedchamber" 79 "most_clothes" 0 } - } - override={ - portrait_modifier_overrides={ - custom_beards=male_empty - custom_hair=male_hair_northern_02 - } - } -  - entity={ 0 0 } -} - } -} - -"common/dna_data/00_dna_ee.txt" = { - { -2000003 = { - dna = "gIySVE1eTFw2rCWTAaAAfAGDAYMAdgGEAHoBggGkAHMAegB/AHgAbQGHAYABggGfAY0BsgGcAc8AcwGoAbABhAGYAYAAZAHMAFgBoAB2AHIBqgGLAZwBhQBzAHoBfwGAAB8BkQGGAYwAeQGLAYwAdgB2AF0BhAB/AFIBsgBmAF0AJQG3AX8BjwGBAHUALQEnAAEBcAAzAQoABQATAHIArAIWAAwAMwAiATEAMgFDAf4BFgAlARYBKgEwARAAPgEAACgALgAdAQMAPgEpAUkBLwEoASEAPQAyARsBHgA0ACEAZwACACwAEgAMAWUAKgFIACQADgAmAAgATgAVACgBeAAHACIADAEHAFAAMQENAAkBAACcAjMBYAEBAQUAAQEkAAoBMwFhARUBLQAbAG4ARgELAK0BdQAfASsAEAESAQUAIADnAAcFAAIIAZoAHAAfAPAA6wDvAJcDDAJdAKgARgAvAfMCAAIABMUBhAGKAYkBkAN4CwQIAAVkApgDEALABIgIWwR2A28BgQCgAo4BbAB/AH8AcwBzAAAAAAE2ATY=" -} -dna_marshalnsc = { - type = male - id = 0 - genes = { - hair_color={ 88 252 88 252 } - skin_color={ 222 115 222 115 } - eye_color={ 39 245 39 245 } - gene_chin_forward={ "chin_forward_neg" 71 "chin_forward_neg" 71 } - gene_chin_height={ "chin_height_pos" 140 "chin_height_pos" 140 } - gene_chin_width={ "chin_width_neg" 125 "chin_width_neg" 125 } - gene_eye_angle={ "eye_angle_pos" 138 "eye_angle_pos" 138 } - gene_eye_depth={ "eye_depth_pos" 136 "eye_depth_pos" 136 } - gene_eye_height={ "eye_height_neg" 103 "eye_height_neg" 103 } - gene_eye_distance={ "eye_distance_neg" 123 "eye_distance_neg" 123 } - gene_eye_shut={ "eye_shut_pos" 146 "eye_shut_pos" 146 } - gene_forehead_angle={ "forehead_angle_pos" 134 "forehead_angle_pos" 134 } - gene_forehead_brow_height={ "forehead_brow_height_pos" 135 "forehead_brow_height_pos" 135 } - gene_forehead_roundness={ "forehead_roundness_neg" 52 "forehead_roundness_neg" 52 } - gene_forehead_width={ "forehead_width_neg" 107 "forehead_width_neg" 107 } - gene_forehead_height={ "forehead_height_pos" 168 "forehead_height_pos" 168 } - gene_head_height={ "head_height_neg" 104 "head_height_neg" 104 } - gene_head_width={ "head_width_pos" 138 "head_width_pos" 138 } - gene_head_profile={ "head_profile_neg" 96 "head_profile_neg" 96 } - gene_head_top_height={ "head_top_height_pos" 138 "head_top_height_pos" 138 } - gene_head_top_width={ "head_top_width_pos" 142 "head_top_width_pos" 142 } - gene_jaw_angle={ "jaw_angle_neg" 118 "jaw_angle_neg" 118 } - gene_jaw_forward={ "jaw_forward_neg" 125 "jaw_forward_neg" 125 } - gene_jaw_height={ "jaw_height_pos" 152 "jaw_height_pos" 152 } - gene_jaw_width={ "jaw_width_pos" 138 "jaw_width_pos" 138 } - gene_mouth_corner_depth={ "mouth_corner_depth_pos" 135 "mouth_corner_depth_pos" 135 } - gene_mouth_corner_height={ "mouth_corner_height_neg" 120 "mouth_corner_height_neg" 120 } - gene_mouth_forward={ "mouth_forward_neg" 124 "mouth_forward_neg" 124 } - gene_mouth_height={ "mouth_height_neg" 124 "mouth_height_neg" 124 } - gene_mouth_width={ "mouth_width_neg" 41 "mouth_width_neg" 41 } - gene_mouth_upper_lip_size={ "mouth_upper_lip_size_neg" 126 "mouth_upper_lip_size_neg" 126 } - gene_mouth_lower_lip_size={ "mouth_lower_lip_size_neg" 119 "mouth_lower_lip_size_neg" 119 } - gene_mouth_open={ "mouth_open_neg" 96 "mouth_open_neg" 96 } - gene_neck_length={ "neck_length_pos" 128 "neck_length_pos" 128 } - gene_neck_width={ "neck_width_neg" 113 "neck_width_neg" 113 } - gene_bs_cheek_forward={ "cheek_forward_pos" 14 "cheek_forward_pos" 14 } - gene_bs_cheek_height={ "cheek_height_pos" 47 "cheek_height_pos" 47 } - gene_bs_cheek_width={ "cheek_width_neg" 21 "cheek_width_neg" 21 } - gene_bs_ear_angle={ "ear_angle_pos" 122 "ear_angle_pos" 122 } - gene_bs_ear_inner_shape={ "ear_inner_shape_pos" 38 "ear_inner_shape_pos" 38 } - gene_bs_ear_bend={ "ear_both_bend_pos" 6 "ear_both_bend_pos" 6 } - gene_bs_ear_outward={ "ear_outward_neg" 29 "ear_outward_neg" 29 } - gene_bs_ear_size={ "ear_size_pos" 40 "ear_size_pos" 40 } - gene_bs_eye_corner_depth={ "eye_corner_depth_neg" 194 "eye_corner_depth_neg" 194 } - gene_bs_eye_fold_shape={ "eye_fold_shape_pos" 32 "eye_fold_shape_pos" 32 } - gene_bs_eye_size={ "eye_size_pos" 44 "eye_size_pos" 44 } - gene_bs_eye_upper_lid_size={ "eye_upper_lid_size_neg" 217 "eye_upper_lid_size_neg" 217 } - gene_bs_forehead_brow_curve={ "forehead_brow_curve_neg" 16 "forehead_brow_curve_neg" 16 } - gene_bs_forehead_brow_forward={ "forehead_brow_forward_neg" 49 "forehead_brow_forward_neg" 49 } - gene_bs_forehead_brow_inner_height={ "forehead_brow_inner_height_pos" 14 "forehead_brow_inner_height_pos" 14 } - gene_bs_forehead_brow_outer_height={ "forehead_brow_outer_height_pos" 116 "forehead_brow_outer_height_pos" 116 } - gene_bs_forehead_brow_width={ "forehead_brow_width_neg" 16 "forehead_brow_width_neg" 16 } - gene_bs_jaw_def={ "jaw_def_neg" 195 "jaw_def_neg" 195 } - gene_bs_mouth_lower_lip_def={ "mouth_lower_lip_def_pos" 87 "mouth_lower_lip_def_pos" 87 } - gene_bs_mouth_lower_lip_full={ "mouth_lower_lip_full_pos" 14 "mouth_lower_lip_full_pos" 14 } - gene_bs_mouth_lower_lip_pad={ "mouth_lower_lip_pad_neg" 4 "mouth_lower_lip_pad_neg" 4 } - gene_bs_mouth_lower_lip_width={ "mouth_lower_lip_width_neg" 6 "mouth_lower_lip_width_neg" 6 } - gene_bs_mouth_philtrum_def={ "mouth_philtrum_def_pos" 15 "mouth_philtrum_def_pos" 15 } - gene_bs_mouth_philtrum_shape={ "mouth_philtrum_shape_pos" 34 "mouth_philtrum_shape_pos" 34 } - gene_bs_mouth_philtrum_width={ "mouth_philtrum_width_neg" 47 "mouth_philtrum_width_neg" 47 } - gene_bs_mouth_upper_lip_def={ "mouth_upper_lip_def_pos" 114 "mouth_upper_lip_def_pos" 114 } - gene_bs_mouth_upper_lip_full={ "mouth_upper_lip_full_pos" 32 "mouth_upper_lip_full_pos" 32 } - gene_bs_mouth_upper_lip_profile={ "mouth_upper_lip_profile_neg" 11 "mouth_upper_lip_profile_neg" 11 } - gene_bs_mouth_upper_lip_width={ "mouth_upper_lip_width_neg" 15 "mouth_upper_lip_width_neg" 15 } - gene_bs_nose_forward={ "nose_forward_pos" 22 "nose_forward_pos" 22 } - gene_bs_nose_height={ "nose_height_pos" 72 "nose_height_pos" 72 } - gene_bs_nose_length={ "nose_length_neg" 79 "nose_length_neg" 79 } - gene_bs_nose_nostril_height={ "nose_nostril_height_pos" 11 "nose_nostril_height_pos" 11 } - gene_bs_nose_nostril_width={ "nose_nostril_width_neg" 79 "nose_nostril_width_neg" 79 } - gene_bs_nose_profile={ "nose_profile_pos" 33 "nose_profile_pos" 33 } - gene_bs_nose_ridge_angle={ "nose_ridge_angle_pos" 10 "nose_ridge_angle_pos" 10 } - gene_bs_nose_ridge_width={ "nose_ridge_width_pos" 48 "nose_ridge_width_pos" 48 } - gene_bs_nose_size={ "nose_size_pos" 59 "nose_size_pos" 59 } - gene_bs_nose_tip_angle={ "nose_tip_angle_neg" 27 "nose_tip_angle_neg" 27 } - gene_bs_nose_tip_forward={ "nose_tip_forward_neg" 175 "nose_tip_forward_neg" 175 } - gene_bs_nose_tip_width={ "nose_tip_width_neg" 8 "nose_tip_width_neg" 8 } - face_detail_cheek_def={ "cheek_def_01" 74 "cheek_def_01" 74 } - face_detail_cheek_fat={ "cheek_fat_01_pos" 152 "cheek_fat_01_pos" 152 } - face_detail_chin_cleft={ "chin_cleft" 22 "chin_cleft" 22 } - face_detail_chin_def={ "chin_def_neg" 55 "chin_def_neg" 55 } - face_detail_eye_lower_lid_def={ "eye_lower_lid_def" 107 "eye_lower_lid_def" 107 } - face_detail_eye_socket={ "eye_socket_03" 6 "eye_socket_03" 6 } - face_detail_nasolabial={ "nasolabial_01" 11 "nasolabial_01" 11 } - face_detail_nose_ridge_def={ "nose_ridge_def_neg" 12 "nose_ridge_def_neg" 12 } - face_detail_nose_tip_def={ "nose_tip_def" 20 "nose_tip_def" 20 } - face_detail_temple_def={ "temple_def" 0 "temple_def" 0 } - expression_brow_wrinkles={ "brow_wrinkles_03" 13 "brow_wrinkles_03" 13 } - expression_eye_wrinkles={ "eye_wrinkles_01" 32 "eye_wrinkles_01" 32 } - expression_forehead_wrinkles={ "forehead_wrinkles_02" 150 "forehead_wrinkles_02" 150 } - expression_other={ "cheek_wrinkles_both_01" 0 "cheek_wrinkles_both_01" 0 } - complexion={ "complexion_2" 137 "complexion_2" 137 } - gene_height={ "normal_height" 126 "normal_height" 126 } - gene_bs_body_type={ "body_fat_head_fat_medium" 134 "body_fat_head_fat_medium" 134 } - gene_bs_body_shape={ "body_shape_rectangle_full" 70 "body_shape_rectangle_full" 19 } - gene_bs_bust={ "bust_clothes" 9 "bust_shape_1_half" 12 } - gene_age={ "old_2" 12 "old_2" 12 } - gene_eyebrows_shape={ "far_spacing_low_thickness" 240 "far_spacing_low_thickness" 240 } - gene_eyebrows_fullness={ "layer_2_low_thickness" 234 "layer_2_low_thickness" 234 } - gene_body_hair={ "body_hair_sparse_low_stubble" 7 "body_hair_sparse_low_stubble" 7 } - gene_hair_type={ "hair_straight_thin_beard" 190 "hair_straight_thin_beard" 190 } - gene_baldness={ "male_pattern_baldness" 239 "male_pattern_baldness" 168 } - eye_accessory={ "normal_eyes" 131 "normal_eyes" 131 } - teeth_accessory={ "normal_teeth" 0 "normal_teeth" 0 } - eyelashes_accessory={ "normal_eyelashes" 207 "normal_eyelashes" 207 } - hairstyles={ "male_hair_fp1_07" 190 "all_hairstyles" 0 } - beards={ "no_beard" 255 "no_beard" 0 } - clothes={ "western_bedchamber" 79 "most_clothes" 0 } - } - - override = { - portrait_modifier_overrides = { - custom_hair = male_hair_fp1_07 - custom_beards = male_empty - } - } - - entity = { 0 0 } -} - -dna_tazon = { - portrait_info = { - genes = { - hair_color={ 147 249 225 211 } - skin_color={ 56 73 150 107 } - eye_color={ 51 179 17 164 } - gene_chin_forward={ "chin_forward_pos" 143 "chin_forward_pos" 141 } - gene_chin_height={ "chin_height_pos" 149 "chin_height_pos" 153 } - gene_chin_width={ "chin_width_pos" 137 "chin_width_pos" 136 } - gene_eye_angle={ "eye_angle_pos" 82 "eye_angle_pos" 155 } - gene_eye_depth={ "eye_depth_neg" 168 "eye_depth_neg" 123 } - gene_eye_height={ "eye_height_neg" 188 "eye_height_neg" 115 } - gene_eye_distance={ "eye_distance_neg" 150 "eye_distance_neg" 125 } - gene_eye_shut={ "eye_shut_pos" 118 "eye_shut_pos" 134 } - gene_forehead_angle={ "forehead_angle_pos" 143 "forehead_angle_pos" 165 } - gene_forehead_brow_height={ "forehead_brow_height_pos" 114 "forehead_brow_height_pos" 163 } - gene_forehead_roundness={ "forehead_roundness_neg" 162 "forehead_roundness_neg" 117 } - gene_forehead_width={ "forehead_width_pos" 148 "forehead_width_pos" 131 } - gene_forehead_height={ "forehead_height_pos" 144 "forehead_height_pos" 128 } - gene_head_height={ "head_height_neg" 156 "head_height_neg" 108 } - gene_head_width={ "head_width_pos" 97 "head_width_pos" 225 } - gene_head_profile={ "head_profile_neg" 102 "head_profile_neg" 92 } - gene_head_top_height={ "head_top_height_pos" 155 "head_top_height_pos" 157 } - gene_head_top_width={ "head_top_width_pos" 131 "head_top_width_pos" 166 } - gene_jaw_angle={ "jaw_angle_pos" 89 "jaw_angle_pos" 131 } - gene_jaw_forward={ "jaw_forward_pos" 126 "jaw_forward_pos" 139 } - gene_jaw_height={ "jaw_height_neg" 108 "jaw_height_neg" 126 } - gene_jaw_width={ "jaw_width_pos" 136 "jaw_width_pos" 144 } - gene_mouth_corner_depth={ "mouth_corner_depth_pos" 82 "mouth_corner_depth_pos" 127 } - gene_mouth_corner_height={ "mouth_corner_height_pos" 120 "mouth_corner_height_pos" 160 } - gene_mouth_forward={ "mouth_forward_pos" 134 "mouth_forward_pos" 134 } - gene_mouth_height={ "mouth_height_pos" 203 "mouth_height_pos" 138 } - gene_mouth_width={ "mouth_width_pos" 115 "mouth_width_pos" 136 } - gene_mouth_upper_lip_size={ "mouth_upper_lip_size_neg" 121 "mouth_upper_lip_size_neg" 107 } - gene_mouth_lower_lip_size={ "mouth_lower_lip_size_neg" 143 "mouth_lower_lip_size_neg" 117 } - gene_mouth_open={ "mouth_open_neg" 1 "mouth_open_neg" 13 } - gene_neck_length={ "neck_length_neg" 121 "neck_length_neg" 109 } - gene_neck_width={ "neck_width_pos" 120 "neck_width_pos" 144 } - gene_bs_cheek_forward={ "cheek_forward_pos" 17 "cheek_forward_pos" 7 } - gene_bs_cheek_height={ "cheek_height_pos" 55 "cheek_height_pos" 32 } - gene_bs_cheek_width={ "cheek_width_neg" 21 "cheek_width_neg" 7 } - gene_bs_ear_angle={ "ear_angle_pos" 57 "ear_angle_pos" 41 } - gene_bs_ear_inner_shape={ "ear_inner_shape_pos" 22 "ear_inner_shape_pos" 22 } - gene_bs_ear_bend={ "ear_lower_bend_pos" 102 "ear_both_bend_pos" 44 } - gene_bs_ear_outward={ "ear_outward_neg" 99 "ear_outward_pos" 20 } - gene_bs_ear_size={ "ear_size_pos" 9 "ear_size_pos" 33 } - gene_bs_eye_corner_depth={ "eye_corner_depth_pos" 109 "eye_corner_depth_pos" 230 } - gene_bs_eye_fold_shape={ "eye_fold_shape_neg" 33 "eye_fold_shape_pos" 29 } - gene_bs_eye_size={ "eye_size_pos" 59 "eye_size_neg" 26 } - gene_bs_eye_upper_lid_size={ "eye_upper_lid_size_pos" 127 "eye_upper_lid_size_neg" 7 } - gene_bs_forehead_brow_curve={ "forehead_brow_curve_pos" 13 "forehead_brow_curve_neg" 108 } - gene_bs_forehead_brow_forward={ "forehead_brow_forward_pos" 109 "forehead_brow_forward_pos" 38 } - gene_bs_forehead_brow_inner_height={ "forehead_brow_inner_height_pos" 67 "forehead_brow_inner_height_pos" 121 } - gene_bs_forehead_brow_outer_height={ "forehead_brow_outer_height_neg" 41 "forehead_brow_outer_height_pos" 44 } - gene_bs_forehead_brow_width={ "forehead_brow_width_neg" 39 "forehead_brow_width_neg" 45 } - gene_bs_jaw_def={ "jaw_def_neg" 15 "jaw_def_neg" 51 } - gene_bs_mouth_lower_lip_def={ "mouth_lower_lip_def_pos" 127 "mouth_lower_lip_def_pos" 123 } - gene_bs_mouth_lower_lip_full={ "mouth_lower_lip_full_neg" 75 "mouth_lower_lip_full_neg" 83 } - gene_bs_mouth_lower_lip_pad={ "mouth_lower_lip_pad_neg" 39 "mouth_lower_lip_pad_pos" 23 } - gene_bs_mouth_lower_lip_width={ "mouth_lower_lip_width_neg" 59 "mouth_lower_lip_width_neg" 32 } - gene_bs_mouth_philtrum_def={ "mouth_philtrum_def_pos" 89 "mouth_philtrum_def_pos" 50 } - gene_bs_mouth_philtrum_shape={ "mouth_philtrum_shape_pos" 19 "mouth_philtrum_shape_neg" 1 } - gene_bs_mouth_philtrum_width={ "mouth_philtrum_width_pos" 109 "mouth_philtrum_width_neg" 195 } - gene_bs_mouth_upper_lip_def={ "mouth_upper_lip_def_pos" 127 "mouth_upper_lip_def_pos" 34 } - gene_bs_mouth_upper_lip_full={ "mouth_upper_lip_full_pos" 27 "mouth_upper_lip_full_neg" 3 } - gene_bs_mouth_upper_lip_profile={ "mouth_upper_lip_profile_neg" 47 "mouth_upper_lip_profile_pos" 64 } - gene_bs_mouth_upper_lip_width={ "mouth_upper_lip_width_neg" 43 "mouth_upper_lip_width_pos" 67 } - gene_bs_nose_forward={ "nose_forward_neg" 37 "nose_forward_neg" 20 } - gene_bs_nose_height={ "nose_height_pos" 79 "nose_height_pos" 77 } - gene_bs_nose_length={ "nose_length_pos" 27 "nose_length_pos" 46 } - gene_bs_nose_nostril_height={ "nose_nostril_height_pos" 21 "nose_nostril_height_pos" 125 } - gene_bs_nose_nostril_width={ "nose_nostril_width_neg" 27 "nose_nostril_width_neg" 47 } - gene_bs_nose_profile={ "nose_profile_pos" 31 "nose_profile_pos" 18 } - gene_bs_nose_ridge_angle={ "nose_ridge_angle_neg" 9 "nose_ridge_angle_neg" 10 } - gene_bs_nose_ridge_width={ "nose_ridge_width_pos" 109 "nose_ridge_width_pos" 32 } - gene_bs_nose_size={ "nose_size_neg" 13 "nose_size_neg" 29 } - gene_bs_nose_tip_angle={ "nose_tip_angle_neg" 3 "nose_tip_angle_pos" 39 } - gene_bs_nose_tip_forward={ "nose_tip_forward_pos" 5 "nose_tip_forward_neg" 19 } - gene_bs_nose_tip_width={ "nose_tip_width_neg" 1 "nose_tip_width_pos" 103 } - face_detail_cheek_def={ "cheek_def_01" 47 "cheek_def_02" 56 } - face_detail_cheek_fat={ "cheek_fat_02_pos" 64 "cheek_fat_01_pos" 25 } - face_detail_chin_cleft={ "chin_cleft" 4 "chin_cleft" 18 } - face_detail_chin_def={ "chin_def_neg" 63 "chin_def" 5 } - face_detail_eye_lower_lid_def={ "eye_lower_lid_def" 176 "eye_lower_lid_def" 233 } - face_detail_eye_socket={ "eye_socket_color_01" 150 "eye_socket_color_01" 208 } - face_detail_nasolabial={ "nasolabial_03" 21 "nasolabial_03" 21 } - face_detail_nose_ridge_def={ "nose_ridge_def_neg" 0 "nose_ridge_def_pos" 194 } - face_detail_nose_tip_def={ "nose_tip_def" 30 "nose_tip_def" 74 } - face_detail_temple_def={ "temple_def" 33 "temple_def" 140 } - expression_brow_wrinkles={ "brow_wrinkles_04" 35 "brow_wrinkles_04" 35 } - expression_eye_wrinkles={ "eye_wrinkles_01" 70 "eye_wrinkles_01" 70 } - expression_forehead_wrinkles={ "forehead_wrinkles_01" 90 "forehead_wrinkles_01" 90 } - expression_other={ "cheek_wrinkles_both_01" 0 "cheek_wrinkles_both_01" 0 } - complexion={ "complexion_1" 209 "complexion_2" 129 } - gene_height={ "normal_height" 122 "normal_height" 127 } - gene_bs_body_type={ "body_fat_head_fat_low" 116 "body_fat_head_fat_low" 116 } - gene_bs_body_shape={ "body_shape_hourglass_half" 0 "body_shape_hourglass_half" 0 } - gene_bs_bust={ "bust_clothes" 31 "bust_shape_3_full" 154 } - gene_age={ "old_3" 80 "old_3" 80 } - gene_eyebrows_shape={ "avg_spacing_low_thickness" 143 "far_spacing_low_thickness" 235 } - gene_eyebrows_fullness={ "layer_2_avg_thickness" 151 "layer_2_low_thickness" 174 } - gene_body_hair={ "body_hair_avg" 129 "body_hair_avg" 129 } - gene_hair_type={ "hair_straight" 158 "hair_straight" 158 } - gene_baldness={ "male_pattern_baldness" 94 "male_pattern_baldness" 94 } - eye_accessory={ "normal_eyes" 218 "normal_eyes" 218 } - teeth_accessory={ "normal_teeth" 0 "normal_teeth" 0 } - eyelashes_accessory={ "normal_eyelashes" 204 "normal_eyelashes" 204 } - beards={ "western_beards_straight" 255 "no_beard" 0 } - hairstyles={ "western_hairstyles_straight" 231 "all_hairstyles" 0 } - } - } - enabled=yes + +"common/modifiers/TFE_religion_modifiers.txt" = { + # from error.log: + # Error: "Unexpected token: forest_movement_speed, near line: 15" in file: "common/modifiers/TFE_religion_modifiers.txt" near line: 15 + { + forest_movement_speed = 0.5 + } } + + +"common/governments/imperial_government.txt" = { + # from error.log: + # Error: "Unexpected token: autocratic_government_opinion, near line: 49" in file: "common/governments/imperial_government.txt" near line: 49 + { + character_modifier = { + autocratic_government_opinion = -50 + } } } \ No newline at end of file diff --git a/ImperatorToCK3/Data_Files/configurables/replaceable_file_blocks_tfe.txt b/ImperatorToCK3/Data_Files/configurables/replaceable_file_blocks_tfe.txt new file mode 100644 index 000000000..efe8e7814 --- /dev/null +++ b/ImperatorToCK3/Data_Files/configurables/replaceable_file_blocks_tfe.txt @@ -0,0 +1,841 @@ +# This file contains blocks from The Fallen Eagle files that can be replaced with new ones. +# The structure is as follows: + +# = { +# replace = { +# before = { +# some original code +# } +# after = { +# some modified code +# } +# } +# +# replace = { +# before = { +# some original code 2 +# } +# after = { +# some modified code 2 +# } +# } +# } + +# INDENTATION IS IMPORTANT INSIDE the before BLOCK! +# ASIDE FROM THE CURLY BRACKETS SURROUNDING THE BLOCK, IT MUST MATCH THE ORIGINAL FILE. +# OTHERWISE THE BLOCKS WON'T BE MODIFIED! + + +"common/scripted_triggers/tfe_culture_triggers.txt" = { + replace = { + before = { + any_county = { + limit = { + title_province = { + geographical_region = custom_england + } + } + count >= 6 + holder = { + OR = { + this = scope:valid_opponent + any_liege_or_above = { this = scope:valid_opponent } + } + } + } + } # end of before + + after = { + any_county = { + count >= 6 + title_province = { + geographical_region = custom_england + } + holder = { + OR = { + this = scope:valid_opponent + any_liege_or_above = { this = scope:valid_opponent } + } + } + } + } # end of after + } +} + + +"common/culture/pillars/TFE_language.txt" = { + replace = { + before = { + limit = { has_cultural_pillar = languaglanguage_west_himalayane_pyu } + } + after = { + limit = { has_cultural_pillar = language_west_himalayan } + } + } +} + + +"map_data/geographical_regions/geographical_region.txt" = { + # No c_reggio in TFE as of the 'After The Pharaohs' update. + replace = { + before = { + c_reggio + c_camarda + } + after = { + c_camarda + } + } + + # No c_san in TFE as of the 'After The Pharaohs' update. + replace = { + before = { + c_san + c_parma + } + after = { + c_parma + } + } + + # No c_sankt in TFE as of the 'After The Pharaohs' update. + replace = { + before = { + c_sankt + c_zurich + } + after = { + c_zurich + } + } + + # No c_sankt in TFE as of the 'After The Pharaohs' update. + replace = { + before = { + c_sankt + c_amstetten + } + after = { + c_amstetten + } + } + + # No c_french in TFE as of the 'After The Pharaohs' update. + replace = { + before = { + c_french + c_penthievre + } + after = { + c_penthievre + } + } + + # No c_ile in TFE as of the 'After The Pharaohs' update. + # No c_brie in TFE as of the 'After The Pharaohs' update. + replace = { + before = { + c_ile + c_brie + } + after = { + } + } + + # No c_west in TFE as of the 'After The Pharaohs' update. + replace = { + before = { + c_west + c_mahdiya + } + after = { + c_mahdiya + } + } + + # No c_alcacer in TFE as of the 'After The Pharaohs' update. + replace = { + before = { + c_alcacer + c_alcacer_do_sal + } + after = { + c_alcacer_do_sal + } + } + + # No c_asturias in TFE as of the 'After The Pharaohs' update. + replace = { + before = { + c_asturias + c_asturias_de_santillana + } + after = { + c_asturias_de_santillana + } + } + + # No c_alto in TFE as of the 'After The Pharaohs' update. + replace = { + before = { + c_alto + c_alto_aragon + } + after = { + c_alto_aragon + } + } + + # No c_castelo in TFE as of the 'After The Pharaohs' update. + replace = { + before = { + c_castelo + c_castelo_branco + } + after = { + c_castelo_branco + } + } +} + + +"events/TFE_flavour_events.txt" = { + # from error.log as of TFE 'After The Pharaohs' update + # [01:35:44][E][jomini_script_system.cpp:284]: Script system error! + # Error: death effect [ Unknown death reason 'sickness' ] + # Script location: file: events/TFE_flavour_events.txt line: 1700 (TFE_flavour_events.0039:immediate) + replace = { + before = { + death_reason = sickness + } + after = { + death_reason = death_ill + } + } +} + + +"music/main_themes/music.txt" = { + # Restore vanilla main theme, the TFE one seems broken as of the 'After The Pharaohs' update. + replace = { + before = { +main_theme_track = { + music = "file:/MUSIC/TFE/TFE_Main.ogg" + name = "TFE_main_theme_track" + can_be_interrupted = yes +} + } + after = { +main_theme_track = { + music = "event:/MUSIC/MainTheme/Maintheme" + can_be_interrupted = yes +} + } + } +} + + +"common/culture/traditions/TFE_realm_traditions.txt" = { + # from error.log: + # [02:52:37][E][pdx_persistent_reader.cpp:216]: Error: "Unexpected token: strong_traits_more_valued, near line: 473" in file: "common/culture/traditions/TFE_realm_traditions.txt" near line: 473 + # [02:52:37][E][pdx_persistent_reader.cpp:216]: Error: "Unexpected token: strong_traits_more_common, near line: 474" in file: "common/culture/traditions/TFE_realm_traditions.txt" near line: 474 + # [02:52:37][E][pdx_persistent_reader.cpp:216]: Error: "Unexpected token: weak_traits_looked_down_upon, near line: 475" in file: "common/culture/traditions/TFE_realm_traditions.txt" near line: 475 + replace = { + before = { + character_modifier = { + strong_traits_more_valued = yes + strong_traits_more_common = yes + weak_traits_looked_down_upon = yes + accolade_glory_gain_mult = 0.1 + light_cavalry_max_size_add = 2 + } + } + after = { + character_modifier = { + accolade_glory_gain_mult = 0.1 + light_cavalry_max_size_add = 2 + } + } + } +} + + +"history/cultures/heritage_hellenistic.txt" = { + # from error.log: "key reference innovation_animal_husbandry found more that one time" + replace = { + before = { + discover_innovation = innovation_animal_husbandry + discover_innovation = innovation_tanning_tables + discover_innovation = innovation_animal_husbandry + } + after = { + discover_innovation = innovation_animal_husbandry + discover_innovation = innovation_tanning_tables + } + } +} + + +"history/cultures/heritage_iberian.txt" = { + # from error.log: + # [03:32:02][E][culture_history_entry.cpp:42]: key reference innovation_mustering_grounds found more that one time file: history/cultures/heritage_iberian.txt line: 43 + # [03:32:02][E][culture_history_entry.cpp:42]: key reference innovation_development_01 found more that one time file: history/cultures/heritage_iberian.txt line: 44 + replace = { + before = { + discover_innovation = innovation_mustering_grounds + discover_innovation = innovation_development_01 + } + after = { + } + } +} + + +"history/cultures/afro_roman.txt" = { + # from error.log: + # [03:32:01][E][culture_history_entry.cpp:42]: key reference innovation_crop_rotation found more that one time file: history/cultures/afro_roman.txt line: 36 + replace = { + before = { + discover_innovation = innovation_smithing_tables + discover_innovation = innovation_crop_rotation + } + after = { + discover_innovation = innovation_smithing_tables + } + } + + # from error.log: + # [03:32:01][E][culture_history_entry.cpp:42]: key reference innovation_mustering_grounds found more that one time file: history/cultures/afro_roman.txt line: 38 + # [03:32:01][E][culture_history_entry.cpp:42]: key reference innovation_development_01 found more that one time file: history/cultures/afro_roman.txt line: 39 + replace = { + before = { + discover_innovation = innovation_mustering_grounds + discover_innovation = innovation_development_01 + } + after = {} + } +} + + +"history/cultures/daylamite.txt" = { + # from error.log: + # key reference innovation_development_01 found more that one time file: history/cultures/daylamite.txt line: 30 + replace = { + before = { + discover_innovation = innovation_mustering_grounds + discover_innovation = innovation_development_01 + } + after = { + discover_innovation = innovation_mustering_grounds + } + } +} + + +"history/cultures/egyptian.txt" = { + # from error.log: key reference innovation_development_01 found more that one time file: history/cultures/egyptian.txt line: 32 + replace = { + before = { + discover_innovation = innovation_mustering_grounds + discover_innovation = innovation_development_01 + } + after = { + discover_innovation = innovation_mustering_grounds + } + } +} + + +"history/cultures/georgian.txt" = { + replace = { + before = { + discover_innovation = innovation_animal_husbandry + discover_innovation = innovation_tanning_tables + discover_innovation = innovation_animal_husbandry + } + after = { + discover_innovation = innovation_animal_husbandry + discover_innovation = innovation_tanning_tables + } + } +} + + +"history/cultures/heritage_byzantine.txt" = { + replace = { + before = { + discover_innovation = innovation_animal_husbandry + discover_innovation = innovation_tanning_tables + discover_innovation = innovation_animal_husbandry + } + after = { + discover_innovation = innovation_animal_husbandry + discover_innovation = innovation_tanning_tables + } + } +} + + +"history/cultures/heritage_dravidian.txt" = { + # from error.log: "key reference innovation_development_01 found more that one time file: history/cultures/heritage_dravidian.txt line: 34" + replace = { + before = { + discover_innovation = innovation_mustering_grounds + discover_innovation = innovation_development_01 + } + after = { + discover_innovation = innovation_mustering_grounds + } + } +} + + +"history/cultures/heritage_indo_aryan.txt" = { + # from error.log: "key reference innovation_development_01 found more that one time file: history/cultures/heritage_indo_aryan.txt line: 34" + replace = { + before = { + discover_innovation = innovation_mustering_grounds + discover_innovation = innovation_development_01 + } + after = { + discover_innovation = innovation_mustering_grounds + } + } +} + + +"common/on_action/TFE_game_start.txt" = { + # backport of TFE commit 7dfdda5 + replace = { + before = { + OR = { + government_allows = administrative + top_liege = { government_allows = administrative } + } + } + after = { + government_allows = administrative + top_liege = { government_allows = administrative } + } + } +} + + +"common/court_positions/types/missonary_court_positions.txt" = { + # from error.log: + # [04:13:22][E][jomini_script_system.cpp:284]: Script system error! + # Error: has_doctrine_parameter trigger [ Bool doctrine parameter 'doctrine_missionary_encouraged' does not exist ] + # Script location: file: common/court_positions/types/missonary_court_positions.txt line: 244 (missionary:aptitude) + replace = { + before = { + has_doctrine_parameter = doctrine_missionary_encouraged + } + after = { + has_doctrine = doctrine_missionary_encouraged + } + } +} + + +"history/cultures/heritage_iranian.txt" = { + # from error.log: + # key reference innovation_development_01 found more that one time file: history/cultures/heritage_iranian.txt line: 31 + replace = { + before = { + discover_innovation = innovation_mustering_grounds + discover_innovation = innovation_development_01 + } + after = { + discover_innovation = innovation_mustering_grounds + } + } +} + + +"history/cultures/heritage_israelite.txt" = { + # from error.log: + # key reference innovation_development_01 found more that one time file: history/cultures/heritage_israelite.txt line: 28 + replace = { + before = { + discover_innovation = innovation_mustering_grounds + discover_innovation = innovation_development_01 + } + after = { + discover_innovation = innovation_mustering_grounds + } + } +} + + +"history/cultures/heritage_kemetic.txt" = { + # from error.log: + # key reference innovation_development_01 found more that one time file: history/cultures/heritage_kemetic.txt line: 32 + replace = { + before = { + discover_innovation = innovation_mustering_grounds + discover_innovation = innovation_development_01 + } + after = { + discover_innovation = innovation_mustering_grounds + } + } +} + + +"history/cultures/yemeni.txt" = { + # from error.log: + # key reference innovation_development_01 found more that one time file: history/cultures/yemeni.txt line: 32 + replace = { + before = { + discover_innovation = innovation_mustering_grounds + discover_innovation = innovation_development_01 + } + after = { + discover_innovation = innovation_mustering_grounds + } + } +} + + +"history/cultures/radhanite.txt" = { + # from error.log: + # key reference innovation_development_01 found more that one time file: history/cultures/radhanite.txt line: 28 + replace = { + before = { + discover_innovation = innovation_mustering_grounds + discover_innovation = innovation_development_01 + } + after = { + discover_innovation = innovation_mustering_grounds + } + } +} + + +"history/cultures/kashmiri.txt" = { + # from error.log: + # key reference innovation_development_01 found more that one time file: history/cultures/kashmiri.txt line: 34 + replace = { + before = { + discover_innovation = innovation_mustering_grounds + discover_innovation = innovation_development_01 + } + after = { + discover_innovation = innovation_mustering_grounds + } + } +} + + +"history/cultures/heritage_levantine.txt" = { + # from error.log: + # key reference innovation_development_01 found more that one time file: history/cultures/heritage_levantine.txt line: 32 + replace = { + before = { + discover_innovation = innovation_mustering_grounds + discover_innovation = innovation_development_01 + } + after = { + discover_innovation = innovation_mustering_grounds + } + } +} + + +"history/cultures/kochinim.txt" = { + # from error.log: + # key reference innovation_development_01 found more that one time file: history/cultures/kochinim.txt line: 34 + replace = { + before = { + discover_innovation = innovation_mustering_grounds + discover_innovation = innovation_development_01 + } + after = { + discover_innovation = innovation_mustering_grounds + } + } +} + + +"history/cultures/nepali.txt" = { + # from error.log: + # key reference innovation_development_01 found more that one time file: history/cultures/nepali.txt line: 34 + replace = { + before = { + discover_innovation = innovation_mustering_grounds + discover_innovation = innovation_development_01 + } + after = { + discover_innovation = innovation_mustering_grounds + } + } +} + + +"history/cultures/mauro_roman.txt" = { + # from error.log: + # key reference innovation_crop_rotation found more that one time file: history/cultures/mauro_roman.txt line: 36 + replace = { + before = { + discover_innovation = innovation_smithing_tables + discover_innovation = innovation_crop_rotation + } + after = { + discover_innovation = innovation_smithing_tables + } + } + + # from error.log: + # key reference innovation_mustering_grounds found more that one time file: history/cultures/mauro_roman.txt line: 38 + # key reference innovation_development_01 found more that one time file: history/cultures/mauro_roman.txt line: 39 + replace = { + before = { + discover_innovation = innovation_mustering_grounds + discover_innovation = innovation_development_01 + } + after = {} + } +} + +"history/cultures/heritage_latin.txt" = { + # from error.log: + # key reference innovation_crop_rotation found more that one time file: history/cultures/heritage_latin.txt line: 36 + replace = { + before = { + discover_innovation = innovation_smithing_tables + discover_innovation = innovation_crop_rotation + } + after = { + discover_innovation = innovation_smithing_tables + } + } + + # from error.log: + # key reference innovation_mustering_grounds found more that one time file: history/cultures/heritage_latin.txt line: 38 + # key reference innovation_development_01 found more that one time file: history/cultures/heritage_latin.txt line: 39 + replace = { + before = { + discover_innovation = innovation_mustering_grounds + discover_innovation = innovation_development_01 + } + after = {} + } +} + + +"common/religion/religions/00_zoroastrianism.txt" = { + # from ck3-tiger: "title armaz not defined in common/landed_titles/" + # Remove religious_head entry and set doctrine_no_head. + replace = { + before = { + armaz = { + color = { 0.1 0.7 0.4 } + icon = georgian_zoroastrian + reformed_icon = georgian_zoroastrian_reformed + religious_head = armaz + + holy_site = ushi-darena + holy_site = nok_kundi + holy_site = takht-i-sangin + holy_site = takht-e_soleyman + holy_site = yazd + + doctrine = tenet_unrelenting_faith + doctrine = tenet_ancestor_worship + doctrine = tenet_sacrificial_ceremonies + doctrine = doctrine_major_branch_behdin + + doctrine = doctrine_pluralism_pluralistic + doctrine = doctrine_spiritual_head + doctrine = unreformed_faith_doctrine + + localization = { + HighGodName = urartuism_high_god_name + HighGodName2 = urartuism_high_god_name_2 + HighGodNamePossessive = urartuism_high_god_name_possessive + GoodGodNames = { + urartu_good_god_vanatur + urartu_good_god_the_sun + urartu_good_god_mithra + urartu_good_god_zoroaster + } + PriestMale = urartuism_priest_male + PriestMalePlural = urartuism_priest_male_plural + PriestFemale = urartuism_priest_male + PriestFemalePlural = urartuism_priest_male_plural + PriestNeuter = urartuism_priest_male + PriestNeuterPlural = urartuism_priest_male_plural + } + } + } + after = { + armaz = { + color = { 0.1 0.7 0.4 } + icon = georgian_zoroastrian + reformed_icon = georgian_zoroastrian_reformed + + holy_site = ushi-darena + holy_site = nok_kundi + holy_site = takht-i-sangin + holy_site = takht-e_soleyman + holy_site = yazd + + doctrine = tenet_unrelenting_faith + doctrine = tenet_ancestor_worship + doctrine = tenet_sacrificial_ceremonies + doctrine = doctrine_major_branch_behdin + + doctrine = doctrine_pluralism_pluralistic + doctrine = doctrine_no_head + doctrine = unreformed_faith_doctrine + + localization = { + HighGodName = urartuism_high_god_name + HighGodName2 = urartuism_high_god_name_2 + HighGodNamePossessive = urartuism_high_god_name_possessive + GoodGodNames = { + urartu_good_god_vanatur + urartu_good_god_the_sun + urartu_good_god_mithra + urartu_good_god_zoroaster + } + PriestMale = urartuism_priest_male + PriestMalePlural = urartuism_priest_male_plural + PriestFemale = urartuism_priest_male + PriestFemalePlural = urartuism_priest_male_plural + PriestNeuter = urartuism_priest_male + PriestNeuterPlural = urartuism_priest_male_plural + } + } + } + } +} + + +"common/governments/other_government.txt" = { + # from error.log: + # Error: "Unexpected token: regiments_prestige_as_gold, near line: 235" in file: "common/governments/other_government.txt" near line: 235 + # Error: "Unexpected token: dynasty_named_realms, near line: 510" in file: "common/governments/other_government.txt" near line: 510 + replace = { + before = { + government_rules = { + rulers_should_have_dynasty = yes + royal_court = yes + legitimacy = yes + #landless_playable = yes + #mercenary = yes + } + + supply_limit_mult_for_others = -0.8 + valid_holdings = { castle_holding trade_center_holding } + regiments_prestige_as_gold = yes + required_county_holdings = { tribal_holding city_holding church_holding } + flag = government_can_raid_rule + } + + after = { + government_rules = { + rulers_should_have_dynasty = yes + regiments_prestige_as_gold = yes + royal_court = yes + legitimacy = yes + #landless_playable = yes + #mercenary = yes + } + + supply_limit_mult_for_others = -0.8 + valid_holdings = { castle_holding trade_center_holding } + required_county_holdings = { tribal_holding city_holding church_holding } + flag = government_can_raid_rule + } + } + + # from error.log: + # Error: "Unexpected enum found: always_use_patronym, near line: 307" in file: "common/governments/other_government.txt" near line: 313 + # Error: "Unexpected enum found: always_use_patronym, near line: 350" in file: "common/governments/other_government.txt" near line: 356 + replace = { + before = { + government_rules = { + always_use_patronym = yes + dynasty_named_realms = yes + create_cadet_branches = yes + rulers_should_have_dynasty = yes + royal_court = yes + legitimacy = yes + } + } + + after = { + government_rules = { + dynasty_named_realms = yes + create_cadet_branches = yes + rulers_should_have_dynasty = yes + royal_court = yes + legitimacy = yes + } + always_use_patronym = yes + } + } + + # from error.log: + # Error: "Unexpected token: dynasty_named_realms, near line: 510" in file: "common/governments/other_government.txt" near line: 510 + replace = { + before = { + government_rules = { + create_cadet_branches = yes + rulers_should_have_dynasty = yes + royal_court = yes + legitimacy = yes + } + ai = { + use_legends = yes + } + valid_holdings = { tribal_holding castle_holding trade_center_holding } + required_county_holdings = { tribal_holding } + always_use_patronym = yes + dynasty_named_realms = yes + } + + after = { + government_rules = { + create_cadet_branches = yes + rulers_should_have_dynasty = yes + royal_court = yes + legitimacy = yes + dynasty_named_realms = yes + } + ai = { + use_legends = yes + } + valid_holdings = { tribal_holding castle_holding trade_center_holding } + required_county_holdings = { tribal_holding } + always_use_patronym = yes + } + } +} + + +"common/genes/07_genes_special_accessories_misc.txt" = { + # from ck3-tiger: + # accessory female_clothes_secular_byzantine_war_nobility_01_low not defined in gfx/portraits/accessories/ + replace = { + before = { + 0 = female_clothes_secular_byzantine_war_nobility_01_low + } + after = { + 0 = f_clothes_sec_byzantine_war_nob_01_lo + } + } +} + + +"common\genes\06_genes_special_accessories_headgear.txt" = { + replace = { + before = { + 1 = female_headgear_secular_steppe_war_nobility_01 + } + after = { + 1 = f_headgear_sec_ep2_steppe_war_nob_01 + } + } +} \ No newline at end of file diff --git a/ImperatorToCK3/Imperator/World.cs b/ImperatorToCK3/Imperator/World.cs index eb411b026..b7fa0f3e2 100644 --- a/ImperatorToCK3/Imperator/World.cs +++ b/ImperatorToCK3/Imperator/World.cs @@ -626,7 +626,7 @@ private void LoadPreImperatorRulers() { private void LoadModFilesystemDependentData() { // Some stuff can be loaded in parallel to save time. Parallel.Invoke( - () => LocDB.ScrapeLocalizations(ModFS), + () => LoadImperatorLocalization(), () => { MapData = new MapData(ModFS); Areas.LoadAreas(ModFS, Provinces); @@ -662,6 +662,61 @@ private void LoadModFilesystemDependentData() { Logger.IncrementProgress(); } + private void LoadImperatorLocalization(){ + LocDB.ScrapeLocalizations(ModFS); + + // Now that all the I:R loc is loaded, replace substitution parameters with actual loc. + // For example: + // E23: "$NABATEAN_SUBJECT$" + // NABATEAN_SUBJECT: "Edom" + // Becomes: + // E23: "Edom" + // NABATEAN_SUBJECT: "Edom" + + foreach (var locBlock in LocDB) { + foreach (var (language, loc) in locBlock.ToArray()) { + if (loc is null) { + continue; + } + + ReplaceSubstitutionKeysInLoc(locBlock, language, loc); + } + } + } + + private void ReplaceSubstitutionKeysInLoc(LocBlock locBlock, string language, string loc) { + Regex substitutionRegex = new(@"\$[A-Z_]*\$"); + + var matches = substitutionRegex.Matches(loc); + foreach (Match? match in matches) { + if (match is null) { + continue; + } + + var substitutionKey = match.Value[1..^1]; + + // Avoid infinite recursion by checking if the key is already in the loc block. + if (substitutionKey == locBlock.Id) { + continue; + } + + var substitutionLocBlock = LocDB.GetLocBlockForKey(substitutionKey); + if (substitutionLocBlock is null) { + continue; + } + var substitutionLoc = substitutionLocBlock[language]; + if (substitutionLoc is null) { + Logger.Debug($"Substitution for key {substitutionKey} not found in {language} localization for key {locBlock.Id}."); + continue; + } + + // If the substitution loc contains a substitution key, replace it first. + ReplaceSubstitutionKeysInLoc(substitutionLocBlock, language, substitutionLoc); + + locBlock[language] = loc.Replace(match.Value, substitutionLoc); + } + } + private BufferedReader ProcessSave(string saveGamePath) { switch (saveType) { case SaveType.Plaintext: diff --git a/ImperatorToCK3/Outputter/CharactersOutputter.cs b/ImperatorToCK3/Outputter/CharactersOutputter.cs index 383438a96..a9d3b6cb0 100644 --- a/ImperatorToCK3/Outputter/CharactersOutputter.cs +++ b/ImperatorToCK3/Outputter/CharactersOutputter.cs @@ -38,7 +38,8 @@ public static async Task OutputCharacters(string outputPath, CharacterCollection .OrderBy(c => c.Id).ToImmutableList(); var sb = new StringBuilder(); - var pathForCharactersFromIR = $"{outputPath}/history/characters/IRToCK3_fromImperator.txt"; + const string irCharactersFileName = "IRToCK3_fromImperator.txt"; + var pathForCharactersFromIR = $"{outputPath}/history/characters/{irCharactersFileName}"; await using var charactersFromIROutput = FileHelper.OpenWriteWithRetries(pathForCharactersFromIR); foreach (var character in charactersFromIR) { CharacterOutputter.WriteCharacter(sb, character, conversionDate, ck3BookmarkDate); @@ -46,14 +47,25 @@ public static async Task OutputCharacters(string outputPath, CharacterCollection sb.Clear(); } - var pathForCharactersFromCK3 = $"{outputPath}/history/characters/IRToCK3_fromCK3.txt"; + const string ck3CharactersFileName = "IRToCK3_fromCK3.txt"; + var pathForCharactersFromCK3 = $"{outputPath}/history/characters/{ck3CharactersFileName}"; await using var charactersFromCK3Output = FileHelper.OpenWriteWithRetries(pathForCharactersFromCK3, Encoding.UTF8); foreach (var character in charactersFromCK3) { CharacterOutputter.WriteCharacter(sb, character, conversionDate, ck3BookmarkDate); await charactersFromCK3Output.WriteAsync(sb.ToString()); sb.Clear(); } - + + // There may have been other character history files due to being in the removable_file_blocks*.txt files. + // Their contents are already in the characters' history fields, outputted above, so we can remove the extra files. + HashSet filesToKeep = [irCharactersFileName, ck3CharactersFileName]; + var characterHistoryFiles = Directory.GetFiles(Path.Combine(outputPath, "history/characters"), "*.txt"); + foreach (var file in characterHistoryFiles) { + if (!filesToKeep.Contains(Path.GetFileName(file))) { + File.Delete(file); + } + } + await OutputCharactersDNA(outputPath, charactersWithDNA); } @@ -149,7 +161,7 @@ Date conversionDate var accessoryName = grouping.Key.ObjectName; var characterFlagName = $"portrait_modifier_{templateName}_obj_{accessoryName}"; - var characterEffectStr = $"{{ add_character_flag = {characterFlagName} }}"; + var characterEffectStr = $"{{ add_character_flag = {characterFlagName} add_character_flag = has_scripted_appearance }}"; foreach (Character character in grouping) { Date effectDate = character.DeathDate ?? conversionDate; diff --git a/ImperatorToCK3/Outputter/FileTweaker.cs b/ImperatorToCK3/Outputter/FileTweaker.cs index 188fe7e6f..b0ff61a4a 100644 --- a/ImperatorToCK3/Outputter/FileTweaker.cs +++ b/ImperatorToCK3/Outputter/FileTweaker.cs @@ -1,4 +1,5 @@ using commonItems; +using commonItems.Collections; using commonItems.Mods; using ImperatorToCK3.CommonUtils; using System.Collections.Generic; @@ -6,68 +7,171 @@ using System.Linq; using System.Threading.Tasks; -namespace ImperatorToCK3.CK3.Cleanup; +namespace ImperatorToCK3.Outputter; + +internal readonly struct PartOfFileToModify(string textBefore, string textAfter, bool warnIfNotFound = true) { + internal readonly string TextBefore = textBefore; + internal readonly string TextAfter = textAfter; + internal readonly bool WarnIfNotFound = warnIfNotFound; + + public void Deconstruct(out string textBefore, out string textAfter, out bool warnIfNotFound) { + textBefore = TextBefore; + textAfter = TextAfter; + warnIfNotFound = WarnIfNotFound; + } +} + +internal enum LineEnding { + CRLF, + LF, + CR +} public static class FileTweaker { - public static async Task RemoveUnneededPartsOfFiles(ModFilesystem ck3ModFS, string outputModPath, Configuration config) { + public static async Task ModifyAndRemovePartsOfFiles(ModFilesystem ck3ModFS, string outputModPath, Configuration config) { + // Load removable blocks from configurables. + Dictionary> partsToModifyPerFile = new(); + if (config.FallenEagleEnabled) { - Logger.Info("Removing unneeded parts of Fallen Eagle files..."); - await RemovePartsOfFilesFromConfigurable("configurables/removable_file_blocks_tfe.txt", ck3ModFS, outputModPath); - } else if (!config.WhenTheWorldStoppedMakingSenseEnabled) { // vanilla - Logger.Info("Removing unneeded parts of vanilla files..."); - await RemovePartsOfFilesFromConfigurable("configurables/removable_file_blocks.txt", ck3ModFS, outputModPath); + Logger.Info("Reading unneeded parts of Fallen Eagle files..."); + ReadPartsOfFileToRemove(partsToModifyPerFile, "configurables/removable_file_blocks_tfe.txt", warnIfNotFound: true); + + Logger.Info("Reading parts of Fallen Eagle files to modify..."); + ReadPartsOfFileToReplace(partsToModifyPerFile, "configurables/replaceable_file_blocks_tfe.txt", warnIfNotFound: true); + } + + if (config.RajasOfAsiaEnabled) { + Logger.Info("Reading unneeded parts of Rajas of Asia files..."); + ReadPartsOfFileToRemove(partsToModifyPerFile, "configurables/removable_file_blocks_roa.txt", warnIfNotFound: true); + } + + bool isVanilla = config.GetCK3ModFlags()["vanilla"]; + Logger.Info("Reading unneeded parts of vanilla files..."); + ReadPartsOfFileToRemove(partsToModifyPerFile, "configurables/removable_file_blocks.txt", warnIfNotFound: isVanilla); + + await ModifyPartsOfFiles(partsToModifyPerFile, ck3ModFS, outputModPath); + } + + private static void ReadPartsOfFileToRemove(Dictionary> partsToModifyPerFile, string configurablePath, bool warnIfNotFound) { + var parser = new Parser(); + parser.RegisterRegex(CommonRegexes.String, (reader, fileName) => { + ReadBlocksToRemoveForFile(fileName, reader, partsToModifyPerFile, warnIfNotFound); + }); + parser.RegisterRegex(CommonRegexes.QuotedString, (reader, fileNameInQuotes) => { + string fileName = fileNameInQuotes.RemQuotes(); + ReadBlocksToRemoveForFile(fileName, reader, partsToModifyPerFile, warnIfNotFound); + }); + parser.IgnoreAndLogUnregisteredItems(); + + parser.ParseFile(configurablePath); + } + + private static void ReadBlocksToRemoveForFile(string fileName, BufferedReader reader, Dictionary> partsToModifyPerFile, bool warnIfNotFound) { + var blocksToRemove = new BlobList(reader).Blobs.Select(b => b.Trim()).ToArray(); + + if (partsToModifyPerFile.TryGetValue(fileName, out var existingBlocksToModify)) { + var alreadyExistingBlocks = existingBlocksToModify.Select(b => b.TextBefore); + var newBlocksToRemove = blocksToRemove + .Except(alreadyExistingBlocks) + .Select(b => new PartOfFileToModify(textBefore: b, textAfter: string.Empty, warnIfNotFound: warnIfNotFound)); + existingBlocksToModify.UnionWith(newBlocksToRemove); + } else { + partsToModifyPerFile[fileName] = blocksToRemove + .Select(b => new PartOfFileToModify(textBefore: b, textAfter: string.Empty, warnIfNotFound: warnIfNotFound)) + .ToOrderedSet(); } } - private static async Task RemovePartsOfFilesFromConfigurable(string configurablePath, ModFilesystem ck3ModFS, string outputModPath) { - // Load removable blocks from configurables. - Dictionary partsToRemovePerFile = []; + private static void ReadPartsOfFileToReplace(Dictionary> partsToModifyPerFile, string configurablePath, bool warnIfNotFound) { var parser = new Parser(); parser.RegisterRegex(CommonRegexes.String, (reader, fileName) => { - var blocksToRemove = new BlobList(reader).Blobs.Select(b => b.Trim()).ToArray(); - partsToRemovePerFile[fileName] = blocksToRemove; + ReadBlocksToReplaceForFile(fileName, reader, partsToModifyPerFile, warnIfNotFound); }); parser.RegisterRegex(CommonRegexes.QuotedString, (reader, fileNameInQuotes) => { - var blocksToRemove = new BlobList(reader).Blobs.Select(b => b.Trim()).ToArray(); - partsToRemovePerFile[fileNameInQuotes.RemQuotes()] = blocksToRemove; + string fileName = fileNameInQuotes.RemQuotes(); + ReadBlocksToReplaceForFile(fileName, reader, partsToModifyPerFile, warnIfNotFound); }); parser.IgnoreAndLogUnregisteredItems(); + parser.ParseFile(configurablePath); + } + + private static void ReadBlocksToReplaceForFile(string fileName, BufferedReader reader, Dictionary> partsToModifyPerFile, bool warnIfNotFound) { + string? before = null; + string? after = null; + var parserForFile = new Parser(); + parserForFile.RegisterKeyword("replace", replaceBlockReader => { + var replaceBlockParser = new Parser(); + replaceBlockParser.RegisterKeyword("before", beforeReader => { + // Remove opening and closing braces. + before = beforeReader.GetStringOfItem().ToString().Trim()[1..^1].Trim(); + }); + replaceBlockParser.RegisterKeyword("after", afterReader => { + after = afterReader.GetStringOfItem().ToString().Trim()[1..^1].Trim(); + }); + replaceBlockParser.IgnoreAndLogUnregisteredItems(); + replaceBlockParser.ParseStream(replaceBlockReader); + + if (before is null || after is null) { + Logger.Warn($"Invalid replace block for {fileName}."); + return; + } + + // Add to partsToModifyPerFile. + var partOfFileToModify = new PartOfFileToModify(textBefore: before, textAfter: after, warnIfNotFound: warnIfNotFound); + if (partsToModifyPerFile.TryGetValue(fileName, out var existingBlocksToModify)) { + var alreadyExistingBlocks = existingBlocksToModify.Select(b => b.TextBefore); + if (alreadyExistingBlocks.Contains(before)) { + Logger.Warn($"Duplicate replace block for {fileName}: {before}"); + return; + } + existingBlocksToModify.Add(partOfFileToModify); + } else { + partsToModifyPerFile[fileName] = [partOfFileToModify]; + } + }); + parserForFile.IgnoreAndLogUnregisteredItems(); + parserForFile.ParseStream(reader); + } + + + private static async Task ModifyPartsOfFiles(Dictionary> partsToModifyPerFile, ModFilesystem ck3ModFS, string outputModPath) { // Log count of blocks to remove for each file. - foreach (var (relativePath, partsToRemove) in partsToRemovePerFile) { - Logger.Debug($"Loaded {partsToRemove.Length} blocks to remove from {relativePath}."); + foreach (var (relativePath, partsToRemove) in partsToModifyPerFile) { + Logger.Debug($"Loaded {partsToRemove.Count} blocks to remove from {relativePath}."); } - foreach (var (relativePath, partsToRemove) in partsToRemovePerFile) { + foreach (var (relativePath, partsToRemove) in partsToModifyPerFile) { var inputPath = ck3ModFS.GetActualFileLocation(relativePath); if (!File.Exists(inputPath)) { Logger.Debug($"{relativePath} not found."); return; } - string lineEndings = GetLineEndingsInFile(inputPath); + LineEnding lineEndings = GetLineEndingsInFile(inputPath); var fileContent = await File.ReadAllTextAsync(inputPath); - foreach (var block in partsToRemove) { + foreach (var (blockBefore, blockAfter, warnIfNotFound) in partsToRemove) { // If the file uses other line endings than CRLF, we need to modify the search string. string searchString; - if (lineEndings == "LF") { - searchString = block.Replace("\r\n", "\n"); - } else if (lineEndings == "CR") { - searchString = block.Replace("\r\n", "\r"); + if (lineEndings == LineEnding.LF) { + searchString = blockBefore.Replace("\r\n", "\n"); + } else if (lineEndings == LineEnding.CR) { + searchString = blockBefore.Replace("\r\n", "\r"); } else { - searchString = block; + searchString = blockBefore; } - // Log if the block is not found. if (!fileContent.Contains(searchString)) { - Logger.Warn($"Block not found in file {relativePath}: {searchString}"); + if (warnIfNotFound) { + Logger.Warn($"Block not found in file {relativePath}: {searchString}"); + } continue; } - fileContent = fileContent.Replace(searchString, ""); + fileContent = fileContent.Replace(searchString, blockAfter); } string outputPath = $"{outputModPath}/{relativePath}"; @@ -82,25 +186,25 @@ private static async Task RemovePartsOfFilesFromConfigurable(string configurable } } - private static string GetLineEndingsInFile(string filePath) { + private static LineEnding GetLineEndingsInFile(string filePath) { using StreamReader sr = new StreamReader(filePath); bool returnSeen = false; while (sr.Peek() >= 0) { char c = (char)sr.Read(); if (c == '\n') { - return returnSeen ? "CRLF" : "LF"; + return returnSeen ? LineEnding.CRLF : LineEnding.LF; } else if (returnSeen) { - return "CR"; + return LineEnding.CR; } returnSeen = c == '\r'; } if (returnSeen) { - return "CR"; + return LineEnding.CR; } else { - return "LF"; + return LineEnding.LF; } } } \ No newline at end of file diff --git a/ImperatorToCK3/Outputter/OnActionOutputter.cs b/ImperatorToCK3/Outputter/OnActionOutputter.cs index ce0232c48..3cabfd331 100644 --- a/ImperatorToCK3/Outputter/OnActionOutputter.cs +++ b/ImperatorToCK3/Outputter/OnActionOutputter.cs @@ -1,11 +1,6 @@ using commonItems; -using commonItems.Collections; using commonItems.Mods; -using ImperatorToCK3.CK3.Cleanup; -using ImperatorToCK3.CommonUtils; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; using System.Threading.Tasks; @@ -14,9 +9,6 @@ namespace ImperatorToCK3.Outputter; public static class OnActionOutputter { public static async Task OutputEverything(Configuration config, ModFilesystem ck3ModFS, string outputModPath){ await OutputCustomGameStartOnAction(config); - if (config.FallenEagleEnabled) { - await DisableUnneededFallenEagleOnActionFiles(outputModPath); - } Logger.IncrementProgress(); } @@ -24,16 +16,16 @@ public static async Task OutputCustomGameStartOnAction(Configuration config) { Logger.Info("Writing game start on-action..."); var sb = new StringBuilder(); - + const string customOnGameStartOnAction = "irtock3_on_game_start_after_lobby"; - + sb.AppendLine("on_game_start_after_lobby = {"); sb.AppendLine($"\ton_actions = {{ {customOnGameStartOnAction } }}"); sb.AppendLine("}"); - + sb.AppendLine($"{customOnGameStartOnAction} = {{"); sb.AppendLine("\teffect = {"); - + if (config.LegionConversion == LegionConversion.MenAtArms) { sb.AppendLine(""" # IRToCK3: add MAA regiments @@ -76,26 +68,22 @@ public static async Task OutputCustomGameStartOnAction(Configuration config) { } } """); + // Disable the anachronistic Seven Houses mechanic for Persia, + // by making the sevenhouses_enabled scripted trigger evaluate to false. + sb.AppendLine(""" + # IRToCK3: disable the Seven Houses mechanic for Persia. + set_global_variable = { + name = sevenhouses_dead + value = yes + } + """); } - + sb.AppendLine("\t}"); sb.AppendLine("}"); - + var filePath = $"output/{config.OutputModName}/common/on_action/IRToCK3_game_start.txt"; await using var writer = new StreamWriter(filePath, append: false, new UTF8Encoding(encoderShouldEmitUTF8Identifier: true)); await writer.WriteAsync(sb.ToString()); } - - private static async Task DisableUnneededFallenEagleOnActionFiles(string outputModPath) { - Logger.Info("Disabling unneeded Fallen Eagle on-actions..."); - var onActionsToDisable = new OrderedSet { - "sevenhouses_on_actions.txt", - "senate_tasks_on_actions.txt", - }; - foreach (var filename in onActionsToDisable) { - var filePath = $"{outputModPath}/common/on_action/{filename}"; - await using var writer = new StreamWriter(filePath, append: false, new UTF8Encoding(encoderShouldEmitUTF8Identifier: true)); - await writer.WriteLineAsync("# disabled by IRToCK3"); - } - } } diff --git a/ImperatorToCK3/Outputter/PillarOutputter.cs b/ImperatorToCK3/Outputter/PillarOutputter.cs index 3b2a18eca..b698c246c 100644 --- a/ImperatorToCK3/Outputter/PillarOutputter.cs +++ b/ImperatorToCK3/Outputter/PillarOutputter.cs @@ -16,8 +16,19 @@ public static async Task OutputPillars(string outputPath, PillarCollection pilla sb.AppendLine($"{pillar.Id}={PDXSerializer.Serialize(pillar)}"); } - var outputFilePath = Path.Combine(outputPath, "common/culture/pillars/IRtoCK3_all_pillars.txt"); + const string pillarFileName = "IRtoCK3_all_pillars.txt"; + var outputFilePath = Path.Combine(outputPath, "common/culture/pillars", pillarFileName); await using var output = FileHelper.OpenWriteWithRetries(outputFilePath, System.Text.Encoding.UTF8); await output.WriteAsync(sb.ToString()); + + // There may be other pillar files due to being in the removable_file_blocks*.txt or replaceable_file_blocks*.txt file. + // Their contents are already in the IRtoCK3_all_pillars.txt file outputted above, so we can remove the extra files. + var pillarFiles = Directory.GetFiles(Path.Combine(outputPath, "common/culture/pillars"), "*.txt"); + foreach (var file in pillarFiles) { + if (Path.GetFileName(file) == pillarFileName) { + continue; + } + File.Delete(file); + } } } \ No newline at end of file diff --git a/ImperatorToCK3/Outputter/ReligionsOutputter.cs b/ImperatorToCK3/Outputter/ReligionsOutputter.cs index 6c67023da..ff9ba25ea 100644 --- a/ImperatorToCK3/Outputter/ReligionsOutputter.cs +++ b/ImperatorToCK3/Outputter/ReligionsOutputter.cs @@ -22,20 +22,19 @@ await Task.WhenAll( private static async Task OutputHolySites(string outputModPath, ReligionCollection ck3ReligionCollection, CK3LocDB ck3LocDB) { Logger.Info("Writing holy sites..."); - var sitesToOutput = ck3ReligionCollection.HolySites.Where(s => s.IsFromConverter) - .ToArray(); + var sitesToOutput = ck3ReligionCollection.HolySites.ToArray(); var sb = new StringBuilder(); foreach (var site in sitesToOutput) { sb.AppendLine($"{site.Id}={PDXSerializer.Serialize(site)}"); } - var outputPath = Path.Combine(outputModPath, "common/religion/holy_sites/IRtoCK3_sites.txt"); + var outputPath = Path.Combine(outputModPath, "common/religion/holy_sites/all_holy_sites.txt"); await using var output = FileHelper.OpenWriteWithRetries(outputPath, Encoding.UTF8); await output.WriteAsync(sb.ToString()); sb.Clear(); // Add localization. - foreach (var site in sitesToOutput) { + foreach (var site in ck3ReligionCollection.HolySites) { // holy site name var siteNameLocBlock = ck3LocDB.GetOrCreateLocBlock($"holy_site_{site.Id}_name"); diff --git a/ImperatorToCK3/Outputter/WorldOutputter.cs b/ImperatorToCK3/Outputter/WorldOutputter.cs index 9e1b84968..27853e5a7 100644 --- a/ImperatorToCK3/Outputter/WorldOutputter.cs +++ b/ImperatorToCK3/Outputter/WorldOutputter.cs @@ -4,7 +4,6 @@ using commonItems.Serialization; using DotLiquid; using ImperatorToCK3.CK3; -using ImperatorToCK3.CK3.Cleanup; using ImperatorToCK3.CK3.Legends; using ImperatorToCK3.CommonUtils; using ImperatorToCK3.Exceptions; @@ -29,8 +28,6 @@ public static void OutputWorld(World ck3World, Imperator.World imperatorWorld, C CreateFolders(outputPath); Task.WaitAll( - FileTweaker.RemoveUnneededPartsOfFiles(ck3World.ModFS, outputPath, config), - CharactersOutputter.OutputEverything(outputPath, ck3World.Characters, imperatorWorld.EndDate, config.CK3BookmarkDate, ck3World.ModFS), DynastiesOutputter.OutputDynastiesAndHouses(outputPath, ck3World.Dynasties, ck3World.DynastyHouses), @@ -87,7 +84,7 @@ private static async Task OutputLegendSeeds(string outputPath, LegendSeedCollect Logger.Info("Writing legend seeds..."); await File.WriteAllTextAsync( Path.Combine(outputPath, "common/legends/legend_seeds/IRtoCK3_all_legend_seeds.txt"), - PDXSerializer.Serialize(legendSeeds, indent: "", withBraces: false), + PDXSerializer.Serialize(legendSeeds.OrderBy(s => s.Id), indent: "", withBraces: false), new UTF8Encoding(encoderShouldEmitUTF8Identifier: true) ); } @@ -169,11 +166,13 @@ private static void OutputModFile(string outputName) { modFileBuilder.AppendLine("replace_path=\"common/bookmarks/challenge_characters\""); modFileBuilder.AppendLine("replace_path=\"common/culture/cultures\""); modFileBuilder.AppendLine("replace_path=\"common/culture/pillars\""); + modFileBuilder.AppendLine("replace_path=\"common/dna_data\""); modFileBuilder.AppendLine("replace_path=\"common/dynasties\""); modFileBuilder.AppendLine("replace_path=\"common/dynasty_houses\""); modFileBuilder.AppendLine("replace_path=\"common/landed_titles\""); modFileBuilder.AppendLine("replace_path=\"common/legends/legend_seeds\""); modFileBuilder.AppendLine("replace_path=\"common/religion/religions\""); + modFileBuilder.AppendLine("replace_path=\"common/religion/holy_sites\""); modFileBuilder.AppendLine("replace_path=\"history/characters\""); modFileBuilder.AppendLine("replace_path=\"history/province_mapping\""); modFileBuilder.AppendLine("replace_path=\"history/provinces\"");