Yeah, I made it this way, but you can replace the name of the trait by anything you like (Alignment is a common word from my mod's world) :
Code:
;------------------------------------------
Trait AlignmentAgitator
Characters family
Level Protester
Description Protester_desc
EffectsDescription Protester_effects_desc
Threshold 1
Effect Unrest 4
Effect TroopMorale -2
Level Moderate_Agitator
Description Moderate_Agitator_desc
EffectsDescription Moderate_Agitator_effects_desc
Threshold 2
Effect Unrest 7
Effect TroopMorale -3
Level Troublemaker
Description Troublemaker_desc
EffectsDescription Troublemaker_effects_desc
Threshold 3
Effect Unrest 10
Effect TroopMorale -4
Level Revolutionary
Description Revolutionary_desc
EffectsDescription Revolutionary_effects_desc
Threshold 4
Effect Unrest 13
Effect TroopMorale -5
Level Anarchist
Description Anarchist_desc
EffectsDescription Anarchist_effects_desc
Threshold 5
Effect Unrest 16
Effect TroopMorale -6
The following is to reset the trait at every turn start, so that the game can test each turn wether to give the trait back or not (thanks to Withwnar). If the player has made things to avoid having the trait coming back, then it is useful. If you want it to be permanent, then do not use it.
Code:
;------------------------------------------
Trigger agitatoregypt1
WhenToTest CharacterTurnEnd
Condition AgentType = named character
and CharFactionType egypt
and Trait AlignmentAgitator > 0
Affects AlignmentAgitator -5 Chance 100
The following are the conditions to get the trait. You can replace Chivalry by anything you like, depending on what are the reasons you want the unrest for ... The trait will be given to all the generals of the faction that do match with the conditions (Chivalry). This will only affect the governors of cities for unrest but can affect all the generals on the map for the troopmorale. In any case, it only applies to the "guilty" generals. So if you want it to be factionwide, just change the triggers.
Code:
;------------------------------------------
Trigger agitatoregypt2
WhenToTest CharacterTurnEnd
Condition AgentType = named character
and CharFactionType egypt
and Attribute Chivalry >= -3
and Attribute Chivalry <= -1
Affects AlignmentAgitator 1 Chance 100
;------------------------------------------
Trigger agitatoregypt3
WhenToTest CharacterTurnEnd
Condition AgentType = named character
and CharFactionType egypt
and Attribute Chivalry >= 0
and Attribute Chivalry <= 2
Affects AlignmentAgitator 2 Chance 100
;------------------------------------------
Trigger agitatoregypt4
WhenToTest CharacterTurnEnd
Condition AgentType = named character
and CharFactionType egypt
and Attribute Chivalry >= 3
and Attribute Chivalry <= 5
Affects AlignmentAgitator 3 Chance 100
;------------------------------------------
Trigger agitatoregypt5
WhenToTest CharacterTurnEnd
Condition AgentType = named character
and CharFactionType egypt
and Attribute Chivalry >= 6
and Attribute Chivalry <= 8
Affects AlignmentAgitator 4 Chance 100
;------------------------------------------
Trigger agitatoregypt6
WhenToTest CharacterTurnEnd
Condition AgentType = named character
and CharFactionType egypt
and Attribute Chivalry >= 9
and Attribute Chivalry <= 10
Affects AlignmentAgitator 5 Chance 100