;------------------------------------------- 0->1 Baghdad for the Muslim factions Trigger Crown_Fit_Baghdad_Islam
WhenToTest CharacterTurnEndInSettlement
Condition FactionIsLocal
and IsFactionLeader
and SettlementBuildingExists = education6_house_of_wisdom
and not IsUnderSiege
and GovernorLoyaltyLevel > loyalty_disillusioned
and Treasury > 20000
and Trait Crownholder > 1
and Trait Crownholder < 4
Affects Fit_Crown_abbasid 1 Chance 100
Affects Fit_Crown_rum 1 Chance 100
Affects Fit_Crown_zengid 1 Chance 100
Affects Fit_Crown_turks 1 Chance 100
Affects Fit_Crown_moors 1 Chance 100
Affects Fit_Crown_egypt 1 Chance 100
;------------------------------------------- 1->0 ------ zengid
Trigger Crown_zengid_UnFit
WhenToTest CharacterTurnEnd
Condition Trait Fit_Crown_zengid > 0
Affects Fit_Crown_zengid -1 Chance 100
;------------------------------------------- 0->1 perhaps should be deleted - Zengids should have access to Egypt or Baghdad
Trigger Crown_zengid_Fit_Aleppo
WhenToTest CharacterTurnEndInSettlement
Condition FactionIsLocal
and FactionType zengid
and IsFactionLeader
and SettlementName Aleppo
and SettlementBuildingExists >= jama
and not IsUnderSiege
and GovernorLoyaltyLevel > loyalty_disillusioned
and Treasury > 20000
and Trait Crownholder > 1
and Trait Crownholder < 4
Affects Fit_Crown_zengid 1 Chance 100
;------------------------------------------- 0->1
Trigger Crown_zengid_Fit_Cairo
WhenToTest CharacterTurnEndInSettlement
Condition FactionIsLocal
and FactionType zengid
and IsFactionLeader
and SettlementName Cairo
and SettlementBuildingExists >= education7_al_azhar_mosque
and not IsUnderSiege
and GovernorLoyaltyLevel > loyalty_disillusioned
and Treasury > 20000
and Trait Crownholder < 4 ; either Legacy (2) or Lands_Conquered (3)
and Trait Crownholder > 1 ; just in case of a bug
and Trait Fit_Crown_zengid < 1 ; redundant but just in case
Affects Fit_Crown_zengid 1 Chance 100