Code:
;======================================================================================================================== ;====================================================================================================== GEORGIA EVOLUTION
;---------- Georgia Evolution
; counters used in EDB for availability of the units, but also benefits from the buildings (library, equestrian etc.)
set_event_counter georgian2_golden_age_player 0 ; turn 80-140
set_event_counter georgian3_shota_rustaveli_player 0 ; turn 150-220
set_event_counter georgian4_crossbow_in_caucasus_player 0 ; turn 200-300
set_event_counter georgian6_revival_player 0 ; turn 270-360
set_event_counter georgian7_last_united_kingdom_player 0 ; turn 520-600
set_event_counter georgian8_tatar_lancers_reform_player 0 ; turn 70-160
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
monitor_event PreFactionTurnStart FactionType georgia
if not I_IsFactionAIControlled georgia
log -------------------- Georgia evolution: (0 1) INFORMATION ----------------------------------------
if I_TurnNumber == 0
historic_event GEORGIAN0_STARTING_INFO
end_if
if I_TurnNumber == 3
historic_event GEORGIAN1_REFORMS_INFO
end_if
if I_TurnNumber == 4
historic_event GEORGIAN1B_MILITARY_REFORMS_INFO
end_if
end_if
;-------------------- Georgia stability : (A) Financial support after a LOSS OF THE CAPITAL
;------------------- (this script is needed because losing the capital usually paralyses financially the faction)
if not I_SettlementOwner Tbilisi = georgia
and not I_EventCounter player_size_huge == 1
and I_NumberOfSettlements georgia > 0
and I_NumberOfSettlements georgia < 8
log -------------------- Georgia lacking capital - nobles' financial help
console_command add_money georgia, 5000
if not I_IsFactionAIControlled georgia
historic_event NO_CAPITAL_SUPPORT
end_if
end_if
if not I_EventCounter GEORGIAN2_GOLDEN_AGE == 1
and RandomPercent < 40
and I_SettlementOwner Tbilisi = georgia
log -------------------- Georgia evolution: (2) GOLDEN AGE ----------------------------------------
; historically should take place around turn 140
set_event_counter continue 0
if I_TurnNumber > 70 ; just in case the player rushes the map
and I_SettlementOwner Kutaisi = georgia ; Geogia holds core regions
if I_CompareCounter number_landowners2_built > 2 ; Georgia built 3+ Local Guards (Large Town level)
and I_CompareCounter number_ikoner_studio_built > 1 ; Georgia built 2+ Ikoner Studio (Minor City level)
if I_FactionLeaderTrait georgia WifeIsGreek > 0 ; the FL should have either wife or some ancestors of Byzantine / Kievian descent
set_event_counter continue 1
end_if
if I_FactionLeaderTrait georgia Royal_Relation_Greek > 0
set_event_counter continue 1
end_if
if I_FactionLeaderTrait georgia WifeIsKievan > 0
set_event_counter continue 1
end_if
if I_FactionLeaderTrait georgia Royal_Relation_Kievan > 0
set_event_counter continue 1
end_if
end_if
if I_EventCounter FL_is_crowned_ruler == 1 ; FL has the crown
and not I_IsFactionAIControlled georgia ; to ensure it's not another faction FL who's got the crown
set_event_counter continue 1
end_if
if I_TurnNumber > 130 ; FALL BACK - in case of failure or a bug
set_event_counter continue 1
end_if
end_if
if I_EventCounter continue = 1
set_event_counter continue 0
historic_event GEORGIAN2_GOLDEN_AGE factions { georgia, jerusalem, byzantium, turks, cumans, abbasid, rum, zengid, kievan_rus, }
if not I_IsFactionAIControlled georgia
inc_event_counter georgian2_golden_age_player 1
end_if
end_if
end_if
if not I_EventCounter GEORGIAN3_SHOTA_RUSTAVELI == 1
and I_EventCounter GEORGIAN2_GOLDEN_AGE = 1
and I_TurnNumber > 150
and RandomPercent < 40 ; to add some randomness against the bugs
log -------------------- Georgia evolution: (3) SHOTA RUSTAVELI ----------------------------------------
; historically should take place around turn 170
set_event_counter continue 0
if I_SettlementOwner Tbilisi = georgia ; at least the capital is in the Georgian hands
if I_CompareCounter number_ikoner_studio_built > 3 ; Gergia has built 3 Ikoner Studios (Minor City level)
and I_CompareCounter number_cathedral_o_built > 1 ; at least 2 Large City
and I_SettlementOwner Kutaisi = georgia
set_event_counter continue 1
end_if
if I_TurnNumber > 210 ; FALL BACK - in case of failure or a bug
set_event_counter continue 1
end_if
end_if
if I_SettlementOwner Jerusalem = georgia ; automatic if Georgia conquers Jerusalem
set_event_counter continue 1
end_if
if I_EventCounter continue = 1
set_event_counter continue 0
historic_event GEORGIAN3_SHOTA_RUSTAVELI factions { georgia, jerusalem, byzantium, turks, cumans, abbasid, rum, zengid, kievan_rus, }
if not I_IsFactionAIControlled georgia
inc_event_counter georgian3_shota_rustaveli_player 1
end_if
end_if
end_if
if not I_EventCounter GEORGIAN4_CROSSBOW_IN_CAUCASUS == 1
and I_EventCounter GEORGIAN3_SHOTA_RUSTAVELI = 1
and RandomPercent < 40
and I_TurnNumber > 200
and I_SettlementOwner Tbilisi = georgia
and I_EventCounter MOUNTED_CROSSBOWS > 0 ; improvments in crossbow technology in Europe occured
log -------------------- Georgia evolution: (4) CROSSBOW IN CAUCASUS ----------------------------------------
; add crossbow units for Georgia
; this event is unrelated to the next Georgian events (may happen later)
; there's no pic
if I_CompareCounter number_university_built > 0 ; at least 1 Large City (allows contacts with the Latins)
and I_CompareCounter number_marksmans_range_built > 1 ; Gergia has built 2 Marksmans Ranges (Castle level)
and I_SettlementOwner Kutaisi = georgia
if I_FactionLeaderTrait georgia WifeIsJerusalem > 0 ; the FL should have either wife or some ancestors of Byzantine / Kievian descent
set_event_counter continue 1
end_if
if I_FactionLeaderTrait georgia Royal_Relation_Jerusalem > 0
set_event_counter continue 1
end_if
if I_FactionLeaderTrait georgia WifeIsHRE > 0
set_event_counter continue 1
end_if
if I_FactionLeaderTrait georgia Royal_Relation_HRE > 0
set_event_counter continue 1
end_if
if I_FactionLeaderTrait georgia WifeIsEnglish > 0
set_event_counter continue 1
end_if
if I_FactionLeaderTrait georgia Royal_Relation_English > 0
set_event_counter continue 1
end_if
if I_FactionLeaderTrait georgia WifeIsSicilian > 0
set_event_counter continue 1
end_if
if I_FactionLeaderTrait georgia Royal_Relation_Sicilian > 0
set_event_counter continue 1
end_if
if I_FactionLeaderTrait georgia WifeIsFrench > 0
set_event_counter continue 1
end_if
if I_FactionLeaderTrait georgia Royal_Relation_French > 0
set_event_counter continue 1
end_if
end_if
if I_TurnNumber > 290 ; FALL BACK - in case of failure or a bug
set_event_counter continue 1
end_if
if I_EventCounter continue = 1
set_event_counter continue 0
historic_event GEORGIAN4_CROSSBOW_IN_CAUCASUS factions { georgia, jerusalem, byzantium, turks, cumans, abbasid, rum, zengid, kievan_rus, }
if not I_IsFactionAIControlled georgia
inc_event_counter georgian4_crossbow_in_caucasus_player 1
end_if
end_if
end_if
if not I_EventCounter GEORGIAN5_REVIVAL_ALLOWED = 1 ; no randomness here as it should happen as soon as conditions are met: this is just a pre-condition for Georgian Revival
and I_EventCounter GEORGIAN3_SHOTA_RUSTAVELI = 1
log -------------------- Georgia evolution: (5) REVIVAL ALLOWED ----------------------------------------
if not I_SettlementOwner Tbilisi = georgia
and not I_SettlementOwner Tbilisi = slave
historic_event GEORGIAN5_REVIVAL_ALLOWED
end_if
if I_TurnNumber > 270 ; fallback
historic_event GEORGIAN5_REVIVAL_ALLOWED
end_if
end_if
if not I_EventCounter GEORGIAN6_REVIVAL == 1
and I_EventCounter GEORGIAN5_REVIVAL_ALLOWED = 1
and RandomPercent < 40
and I_SettlementOwner Tbilisi = georgia
log -------------------- Georgia evolution: (6) GEORGIAN REVIVAL ----------------------------------------
; historically should take place around turn 380
set_event_counter continue 0
if I_TurnNumber > 270
and I_CompareCounter number_landowners3_built > 3 ; Gergia has built 4 Local Councils (Minor City level)
and I_CompareCounter number_citadel_built > 0 ; at least 1 Citadel (Large Castle) exists
set_event_counter continue 1
end_if
if I_TurnNumber > 350 ; FALL BACK - in case of failure or a bug
set_event_counter continue 1
end_if
if I_EventCounter continue = 1
set_event_counter continue 0
historic_event GEORGIAN6_REVIVAL factions { georgia, jerusalem, byzantium, turks, cumans, abbasid, rum, zengid, kievan_rus, }
if not I_IsFactionAIControlled georgia
inc_event_counter georgian6_revival_player 1
end_if
end_if
end_if
end_monitor
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;-------------------------------------------------------------------- GEORGIAN 7 LAST UNITED KINGDOM
; historically should take place around turn 600
; details of this event are to be worked out in the future (the description is ok, but there's no pic)
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
monitor_event PreFactionTurnStart FactionType georgia
and FactionBuildingExists >= huge_cathedral_o ; at least 1 Huge City
and FactionBuildingExists >= great_university ; at least 1 Huge City
and FactionBuildingExists >= royal_armoury ; highest level of barracks in a citadel
and RandomPercent < 40
and I_SettlementOwner Tbilisi = georgia
set_event_counter continue 0
if I_TurnNumber > 520
and I_SettlementOwner Kutaisi = georgia
set_event_counter continue 1
end_if
if I_TurnNumber > 600 ; FALL BACK - in case of failure or a bug
set_event_counter continue 1
end_if
if I_EventCounter continue = 1
set_event_counter continue 0
historic_event GEORGIAN7_LAST_UNITED_KINGDOM factions { georgia, jerusalem, byzantium, turks, cumans, abbasid, rum, zengid, kievan_rus, }
if not I_IsFactionAIControlled georgia
inc_event_counter georgian7_last_united_kingdom_player 1
end_if
terminate_monitor
end_if
end_monitor
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;-------------------------------------------------------------------- GEORGIAN 8 TATAR LANCERS REFORMS
; the blueprint for this script are the EBII Pontos reforms
; it is likely to happen within the first 70-150 turns (backstop at turn 160)
; in the future it will be streamlined as far as the number of the monitors is concerned
declare_counter georgia_battlewon
monitor_event PostBattle FactionType georgia
and WonBattle
and GeneralFoughtFaction cumans
and not I_ConflictType Naval
and not I_ConflictType Withdraw
inc_counter georgia_battlewon 1
if I_IsFactionAIControlled georgia ; not for the AI
terminate_monitor
end_if
if I_CompareCounter georgia_battlewon > 10
terminate_monitor
end_if
end_monitor
monitor_event PostBattle FactionType georgia
and WonBattle
and GeneralFoughtFaction turks
and not I_ConflictType Naval
and not I_ConflictType Withdraw
inc_counter georgia_battlewon 1
if I_IsFactionAIControlled georgia ; not for the AI
terminate_monitor
end_if
if I_CompareCounter georgia_battlewon > 10
terminate_monitor
end_if
end_monitor
monitor_event PostBattle FactionType georgia
and WonBattle
and GeneralFoughtFaction rum
and not I_ConflictType Naval
and not I_ConflictType Withdraw
inc_counter georgia_battlewon 1
if I_IsFactionAIControlled georgia ; not for the AI
terminate_monitor
end_if
if I_CompareCounter georgia_battlewon > 10
terminate_monitor
end_if
end_monitor
monitor_event PostBattle FactionType georgia
and WonBattle
and GeneralFoughtFaction mongols
and not I_ConflictType Naval
and not I_ConflictType Withdraw
inc_counter georgia_battlewon 1
if I_IsFactionAIControlled georgia ; not for the AI
terminate_monitor
end_if
if I_CompareCounter georgia_battlewon > 10
terminate_monitor
end_if
end_monitor
monitor_event FactionTurnStart FactionType georgia
if I_CompareCounter georgia_battlewon > 9
and I_SettlementOwner Kutaisi = georgia
and I_SettlementOwner Tbilisi = georgia
set_event_counter georgian8_tatar_lancers_reform_player 1
historic_event GEORGIAN8_TATAR_LANCERS_REFORM factions { georgia, }
terminate_monitor
end_if
if I_TurnNumber > 160 ; FALL BACK - in case of failure or a bug
and RandomPercent < 10 ; to add some randomness against the bugs
historic_event GEORGIAN8_TATAR_LANCERS_REFORM factions { georgia, }
terminate_monitor
end_if
end_monitor
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@