How do you calculate choices in the story

Basically in Binding Blade if you completed all the Gaiden Chapters and got all the Weapons of the Scouring, and finish Idunn with the Binding Blade, you’ll get the True Ending right? And if you completed every Gaiden Chapter in Blazing Sword, you get a special scene where Nergal met his wife Aenir, and depending on what pathway you are going in Sacred Stones, Eirika and Ephraim will go separate pathways, going with Eirika will have her have the Special Dialogue and vice versa.

But before I continue my Rom Hack I started last month I want to ask, how do you calculate the choices you make throughout the story to effect the Endgame in 2 Pathways, do I have to set Global Flags and rotate them around with different conditional IDs or do I have to do something else? Oh and how do I rotate Alignments for the Soldiers who accompany you between Enemy and NPC depending on the choices you make?

if has weapon_1 {
if has weapon_2 {
if has weapon_3 {
end so on
} else NOPE


Most of the splits in FE7 can be handled through setting and checking event IDs/flags, but some of the more complicated ones (like the checks for relative lord and party levels) are handled through assembly routines.