Code:
;======================================================================================================
;------- Makurian Help for the Fatimids ---------------------------------------------------------------
;======================================================================================================
; by JoC 2022
;====================================================================================================== Makurian Help for the Fatimids
; script is a modification of Turcoman Help for Rum script
; historically, Makuria paid baqt and provide troops to the Fatimids - the relations were ok
; this helped prompted the Saladin's expedition to Nubia in late 12c., so we see how important it was
; thus the goal of this script is to provide some help to the Fatimids if they have problems at home (eg. with the Crusaders)
; the aremies are sizable but there's 2% chance no military help will be provided, only additional money
; this is a recurrent help - there's a 20 turns cool-down period per army spawned.
; It ends after the transition of Egypt from the Fatimids to Ayyubids.
; in the future: one need to analyse when and how the Ayyubids rise
monitor_event PreFactionTurnStart FactionType egypt
and I_EventCounter faction_size_egypt_small == 1 ; no more than 3 settlements
and I_EventCounter Makurian_Help_for_Fatimids < 1 ; no recent help from Makuria
and I_NumberOfSettlements egypt > 0 ; in case of a bug (perhaps not needed)
and not I_CharacterExists SudanPrince ; the leader of the previous support doesn't live anymore
and RandomPercent < 20
log -------------------- Script : Makurian help for the Fatimids (1) INFORMATION ---------------------
historic_event EGYPT_MAKURIAN_HELP_IN_NEED
log -------------------- Script : Makurian help for the Fatimids (2) TERMINATION AFTER AYYBIDS RISE --
if I_EventCounter ayyubids_rise > 0
terminate_monitor
end_if
log -------------------- Script : Makurian help for the Fatimids (3) FUNDING FOR THE ARMIES -----------
if I_EventCounter temp_purse_egypt = 0 ; in case it was increased somewhere else in the script
add_money egypt 5000 ; in case the faction is in debts and would disband the armies outright
increment_kings_purse egypt 5000 ; to ensure the AI doesn't disband the armies for some time
inc_event_counter temp_purse_egypt 21 ; this counter goes down in another script and after 20 turns this additional income is removed
end_if
log -------------------- Script : Makurian help for the Fatimids (4) SPAWN OF ARMIES ------------------
if RandomPercent < 90
log ------ spawn Ya_qub Afra
spawn_army
faction egypt
character Ya_qub Afra, named character, age 35, x 316, y 12, portrait ME_sudan_prince, label SudanPrince, direction N
traits LoyaltyStarter 2 , MilitaryInclination 1 , Military_Edu 3 , GoodCommander 3 , ReligionStarter 1 , Handsome 7 , Intelligent 8
unit ME Bodyguard exp 2 armour 0 weapon_lvl 0
unit Bedouin Camel Riders exp 7 armour 0 weapon_lvl 0
unit Bedouin Camel Riders exp 0 armour 0 weapon_lvl 0
unit African Spearmen exp 7 armour 0 weapon_lvl 0
unit African Spearmen exp 0 armour 0 weapon_lvl 0
unit African Tribal Warriors exp 7 armour 0 weapon_lvl 0
unit African Tribal Warriors exp 4 armour 0 weapon_lvl 0
unit African Tribal Warriors exp 1 armour 0 weapon_lvl 0
unit African Tribal Warriors exp 0 armour 0 weapon_lvl 0
unit African Archers exp 7 armour 0 weapon_lvl 0
unit African Archers exp 0 armour 0 weapon_lvl 0
end
inc_event_counter Makurian_Help_for_Fatimids 20 ; it goes down in another script
end_if
if RandomPercent < 65
log ------ spawn Malik Abla
spawn_army
faction egypt
character Malik Abla, named character, age 32, x 312, y 18
traits LoyaltyStarter 3 , MilitaryInclination 1 , Military_Edu 2 , GoodCommander 3 , ReligionStarter 1 , StrategyDread 2 , Handsome 6 , Intelligent 7 , GoodCavalryGeneral 2 , Miserly 2
unit ME Bodyguard exp 3 armour 0 weapon_lvl 0
unit Bedouin Camel Riders exp 7 armour 0 weapon_lvl 0
unit Bedouin Camel Riders exp 0 armour 0 weapon_lvl 0
unit African Spearmen exp 7 armour 0 weapon_lvl 0
unit African Spearmen exp 0 armour 0 weapon_lvl 0
unit African Tribal Warriors exp 7 armour 0 weapon_lvl 0
unit African Tribal Warriors exp 4 armour 0 weapon_lvl 0
unit African Tribal Warriors exp 1 armour 0 weapon_lvl 0
unit African Tribal Warriors exp 0 armour 0 weapon_lvl 0
unit African Archers exp 7 armour 0 weapon_lvl 0
unit African Archers exp 0 armour 0 weapon_lvl 0
end
inc_event_counter Makurian_Help_for_Fatimids 20
end_if
if RandomPercent < 40
log ------ spawn Talq Afra
spawn_army
faction egypt
character Talq Afra, named character, age 28, x 308, y 4
traits LoyaltyStarter 3 , MilitaryInclination 1 , Military_Edu 1 , StrategyChivalry 2 , ReligionStarter 1 , Handsome 5 , Intelligent 6 , GoodCavalryGeneral 2 , Generous 2
unit ME Bodyguard exp 3 armour 0 weapon_lvl 0
unit Bedouin Camel Riders exp 7 armour 0 weapon_lvl 0
unit Bedouin Camel Riders exp 0 armour 0 weapon_lvl 0
unit African Spearmen exp 7 armour 0 weapon_lvl 0
unit African Spearmen exp 0 armour 0 weapon_lvl 0
unit African Tribal Warriors exp 7 armour 0 weapon_lvl 0
unit African Tribal Warriors exp 4 armour 0 weapon_lvl 0
unit African Tribal Warriors exp 1 armour 0 weapon_lvl 0
unit African Tribal Warriors exp 0 armour 0 weapon_lvl 0
unit African Archers exp 7 armour 0 weapon_lvl 0
unit African Archers exp 0 armour 0 weapon_lvl 0
end
inc_event_counter Makurian_Help_for_Fatimids 20
end_if