Here's one attempt. I'm not sure that it will work, mainly because of the capital requirement. Without a "controlled_by" trigger (like the owned_by one) I'm not sure how to make sure the event knows that the capital is occupied by rebels.
If you're using Magna Mundi, you can use the "capital" building (in MMIV) which has little purpose other than to help modders select the capital.
After making sure events #1 and #2 work properly, you can write a series of events based on #3, each representing a different government. I'd like to code it to be compatable with both ATAGE and Vanilla, but the thought of it is making my head spin.
If these events DO work properly, you could easily add more triggers to help determine the kind of government you get, rather than making it totally random. You could either exclude whole governments (e.g. if you are a noble republic, you cannot become an absolute monarchy) or you could add modifiers (e.g. if you have Divine Supremacy you are more likely to become a theocracy).
Code:
#######################
# Regime Change setup #
#######################
country_event = {
id = 200701
trigger = {
capital_scope = { controller = { tag = REB } }
NOT = { has_country_flag = rebel_government }
}
mean_time_to_happen = { months = 1 }
title = "The fall of $CAPITAL$"
desc = "Despite the heroic defense of the capital, $CAPITAL$ fell to rebels in $YEAR$. $MONARCH$ was forced to flee while overjoyed rebels declared a new government."
option = {
name = "We must retake the city!"
stability = -6
set_country_flag = rebel_government
}
}
country_event = {
id = 200702
trigger = {
has_country_flag = rebel_government
NOT = { capital_scope = { controller = { tag = REB } } }
NOT = { stability = 2 }
}
mean_time_to_happen = { months = 1 }
title = "$CAPITAL$ is retaken"
desc = "The capital of $COUNTRY$ is once again in our hands!"
option = {
name = "Praise God!"
stability = +1
clr_country_flag = rebel_government
}
}
country_event = {
id = 200703
trigger = {
has_country_flag = rebel_government
NOT = { capital_scope = { controller = { tag = REB } } }
stability = 2
NOT = { government = absolute_monarchy }
}
mean_time_to_happen = { months = 1 }
title = "Rebels overthrow the government"
desc = "Having defeated the remaining forces loyal to the old regime, the rebels set up a new government."
option = {
name = "Long live $MONARCH$!"
ai_chance = { factor = 50 }
stability = +1
clr_country_flag = rebel_government
}
option = {
name = "$MONARCH$ shall rule as absolute monarch"
ai_chance = { factor = 50 }
stability = +1
clr_country_flag = rebel_government
government = absolute_monarchy
}
}