On ActionChanged this version
on_join_war
root = country
Holy Roman EmpireInternational OrganizationeffectDefinitionin_game/common/on_action/_hardcoded.txt:1647
1648effect = {
1649if = {
1650limit = {
1651has_ruler = yes
1652is_at_war_with = ruler.employer
}
1654remove_commander = ruler
}
1656else_if = {
1657limit = {
1658has_regent = yes
1659is_at_war_with = regent.employer
}
1661reset_regency = yes
}
1663if = {
1664limit = {
1667scope:war = {
1668is_a_defender = root
1669defender_leader = {
1670this != root
}
1673attacker_leader = {
}
}
}
1679every_international_organization_member = {
1680limit = {
1681this != root
}
1683add_opinion = {
1684modifier = hre_emperor_defends_empire
1685target = root
}
}
}
}
}