Code:
;Invasion Started
monitor_event FactionTurnStart FactionIsLocal
and I_CompareCounter Pxs_LocalFaction_Is_Good = 1
and I_EventCounter Pxs_Evil_Invasion_Ready = 1
and I_EventCounter Pxs_Evil_Invasion_Faction_Assigned = 1
and not I_EventCounter Pxs_Invasion_Cancelled > 0
ui_flash_stop
;Enemy army arrived, move to safe position near target settlement
if I_EventCounter Pxs_Invasion_Phase = 8
set_event_counter Pxs_Invasion_Phase 9
while I_CharacterExists Cinvader
kill_character Cinvader
end_while
if not I_CharacterExists Cinvader
;Harad
if I_EventCounter Pxs_Harad_CInvasion = 1
spawn_army
faction hungary
character Cinvader, named character, age 56, x 399, y 340
traits LoyaltyStarter 1 , GoodCommander 2 , ReligionStarter 1 , GoodAttacker 2 , Loyal 2 , GoodAdministrator 1 , StrategicSkill 1 , LogisticalSkill 1
unit Serpent Bodyguard exp 3 armour 1 weapon_lvl 0
end
give_everything_to_faction hungary spain false
;add his units
;base level
create_unit Cinvader, Southron Spearmen, num 4, exp 1, arm 0, wep 0
create_unit Cinvader, Corsairs, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Corsair Archers, num 1, exp 1, arm 0, wep 0
if I_EventCounter Pxs_Invasion_Type = 1
create_unit Cinvader, Southron Spearmen, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Corsairs, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Corsair Archers, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Raiders Cavalry, num 1, exp 1, arm 0, wep 0
end_if
if I_EventCounter Pxs_Invasion_Type = 2
create_unit Cinvader, Southron Pikemen, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Southron Lancers, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Mumakil, num 1, exp 1, arm 0, wep 0
end_if
if I_EventCounter Pxs_Invasion_Type = 3
create_unit Dismounted Serpent Guard, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Southron Lancers, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Mumakil, num 1, exp 1, arm 0, wep 0
end_if
;Declare war, mov camera
if I_LocalFaction sicily
console_command diplomatic_stance spain sicily War
end_if
if I_LocalFaction milan
console_command diplomatic_stance spain milan War
end_if
if I_LocalFaction egypt
console_command diplomatic_stance spain egypt War
end_if
if I_LocalFaction mongols
console_command diplomatic_stance spain mongols War
end_if
if I_LocalFaction moors
console_command diplomatic_stance spain moors War
end_if
if I_LocalFaction turks
console_command diplomatic_stance spain turks War
end_if
if I_LocalFaction byzantium
console_command diplomatic_stance spain byzantium War
end_if
if I_LocalFaction scotland
console_command diplomatic_stance spain scotland War
end_if
end_if
;Rhun
if I_EventCounter Pxs_Rhun_CInvasion = 1
spawn_army
faction hungary
character Cinvader, named character, age 56, x 399, y 340
traits LoyaltyStarter 1 , GoodCommander 2 , ReligionStarter 1 , GoodAttacker 2 , Loyal 2 , GoodAdministrator 1 , StrategicSkill 1 , LogisticalSkill 1
unit Kataphracts Bodyguard exp 3 armour 1 weapon_lvl 0
end
give_everything_to_faction hungary venice false
;add his units
;base level
create_unit Cinvader, Easterling Clansmen, num 4, exp 1, arm 0, wep 0
create_unit Cinvader, Balchoth Horde, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Rhunnic Pikemen, num 1, exp 1, arm 0, wep 0
if I_EventCounter Pxs_Invasion_Type = 1
create_unit Cinvader, Easterling Clansmen, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Dismounted Variags, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Mounted Clanguard, num 1, exp 1, arm 0, wep 0
end_if
if I_EventCounter Pxs_Invasion_Type = 2
create_unit Cinvader, Rhunnic Swordsmen, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Dismounted Variags, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Mounted Clanguard, num 1, exp 1, arm 0, wep 0
end_if
if I_EventCounter Pxs_Invasion_Type = 3
create_unit Cinvader, Rhunnic Elite Archers, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Rhunnic Elite Infantry, num 2, exp 1, arm 0, wep 0
end_if
;Declare war, mov camera, mov army
if I_LocalFaction sicily
console_command diplomatic_stance venice sicily War
end_if
if I_LocalFaction milan
console_command diplomatic_stance venice milan War
end_if
if I_LocalFaction egypt
console_command diplomatic_stance venice egypt War
end_if
if I_LocalFaction mongols
console_command diplomatic_stance venice mongols War
end_if
if I_LocalFaction moors
console_command diplomatic_stance venice moors War
end_if
if I_LocalFaction turks
console_command diplomatic_stance venice turks War
end_if
if I_LocalFaction byzantium
console_command diplomatic_stance venice byzantium War
end_if
if I_LocalFaction scotland
console_command diplomatic_stance venice scotland War
end_if
end_if
;OOMM
if I_EventCounter Pxs_OOMM_CInvasion = 1
spawn_army
faction hungary
character Cinvader, named character, age 56, x 399, y 340
traits LoyaltyStarter 1 , GoodCommander 2 , ReligionStarter 1 , GoodAttacker 2 , Loyal 2 , GoodAdministrator 1 , StrategicSkill 1 , LogisticalSkill 1
unit Moria Bodyguards exp 3 armour 1 weapon_lvl 0
end
give_everything_to_faction hungary hre false
;add his units
;base level
create_unit Cinvader, Goblin Orcs Mercs, num 4, exp 1, arm 0, wep 0
create_unit Cinvader, Snaga Skirmishers, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Moria Orcs, num 1, exp 1, arm 0, wep 0
if I_EventCounter Pxs_Invasion_Type = 1
create_unit Cinvader, Goblin Archers, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Snaga Skirmishers, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Moria Orcs, num 1, exp 1, arm 0, wep 0
end_if
if I_EventCounter Pxs_Invasion_Type = 2
create_unit Cinvader, Goblin Orcs Mercs, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Cave Trolls, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Goblin Wargs, num 1, exp 1, arm 0, wep 0
end_if
if I_EventCounter Pxs_Invasion_Type = 3
create_unit Cinvader, Goblin Orcs Mercs, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Cave Trolls, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Goblin Wargs, num 1, exp 1, arm 0, wep 0
end_if
;Declare war, mov camera, mov army
if I_LocalFaction sicily
console_command diplomatic_stance hre sicily War
end_if
if I_LocalFaction milan
console_command diplomatic_stance hre milan War
end_if
if I_LocalFaction egypt
console_command diplomatic_stance hre egypt War
end_if
if I_LocalFaction mongols
console_command diplomatic_stance hre mongols War
end_if
if I_LocalFaction moors
console_command diplomatic_stance hre moors War
end_if
if I_LocalFaction turks
console_command diplomatic_stance portugal turks War
end_if
if I_LocalFaction byzantium
console_command diplomatic_stance hre byzantium War
end_if
if I_LocalFaction scotland
console_command diplomatic_stance hre scotland War
end_if
end_if
;Isengard
if I_EventCounter Pxs_Isengard_CInvasion = 1
spawn_army
faction hungary
character Cinvader, named character, age 56, x 399, y 340
traits LoyaltyStarter 1 , GoodCommander 2 , ReligionStarter 1 , GoodAttacker 2 , Loyal 2 , GoodAdministrator 1 , StrategicSkill 1 , LogisticalSkill 1
unit Uruk-Hai Bodyguards exp 3 armour 1 weapon_lvl 0
end
give_everything_to_faction hungary france false
;add his units
;base level
create_unit Cinvader, Uruk-Hai Raiders Mercs, num 4, exp 1, arm 0, wep 0
create_unit Cinvader, Uruk-Hai Infantry, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Dunlendings Mercs, num 2, exp 1, arm 0, wep 0
if I_EventCounter Pxs_Invasion_Type = 1
create_unit Cinvader, Uruk-Hai Archers, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Uruk-Hai Pikemen, num 2, exp 1, arm 0, wep 0
end_if
if I_EventCounter Pxs_Invasion_Type = 2
create_unit Cinvader, Uruk-Hai Crossbow, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Uruk-Hai Raiders Mercs, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Wargs, num 1, exp 1, arm 0, wep 0
end_if
if I_EventCounter Pxs_Invasion_Type = 3
create_unit Cinvader, Uruk-Hai Crossbow, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Uruk-Hai Raiders Mercs, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Wargs, num 1, exp 1, arm 0, wep 0
end_if
;Declare war, mov camera, mov army
if I_LocalFaction sicily
console_command diplomatic_stance france sicily War
end_if
if I_LocalFaction milan
console_command diplomatic_stance france milan War
end_if
if I_LocalFaction egypt
console_command diplomatic_stance france egypt War
end_if
if I_LocalFaction mongols
console_command diplomatic_stance france mongols War
end_if
if I_LocalFaction moors
console_command diplomatic_stance france moors War
end_if
if I_LocalFaction turks
console_command diplomatic_stance france turks War
end_if
if I_LocalFaction byzantium
console_command diplomatic_stance france byzantium War
end_if
if I_LocalFaction scotland
console_command diplomatic_stance france scotland War
end_if
end_if
;OOG
if I_EventCounter Pxs_OOG_CInvasion = 1
spawn_army
faction hungary
character Cinvader, named character, age 56, x 399, y 340
traits LoyaltyStarter 1 , GoodCommander 2 , ReligionStarter 1 , GoodAttacker 2 , Loyal 2 , GoodAdministrator 1 , StrategicSkill 1 , LogisticalSkill 1
unit Moria Bodyguards exp 3 armour 1 weapon_lvl 0
end
give_everything_to_faction hungary portugal false
;add his units
;base level
create_unit Cinvader, Goblin Spears, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Snaga Band, num 4, exp 1, arm 0, wep 0
create_unit Cinvader, Orc Fellers, num 1, exp 1, arm 0, wep 0
if I_EventCounter Pxs_Invasion_Type = 1
create_unit Cinvader, Orc Fellers, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Orc Halberd, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Goblin Trackers, num 1, exp 1, arm 0, wep 0
end_if
if I_EventCounter Pxs_Invasion_Type = 2
create_unit Cinvader, Goblin Trackers, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Goblin Spears, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Snow Trolls, num 1, exp 1, arm 0, wep 0
end_if
if I_EventCounter Pxs_Invasion_Type = 3
create_unit Cinvader, Goblin Trackers, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Snaga Band, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Snow Trolls, num 1, exp 1, arm 0, wep 0
end_if
;Declare war, mov camera, mov army
if I_LocalFaction sicily
console_command diplomatic_stance portugal sicily War
end_if
if I_LocalFaction milan
console_command diplomatic_stance portugal milan War
end_if
if I_LocalFaction egypt
console_command diplomatic_stance portugal egypt War
end_if
if I_LocalFaction mongols
console_command diplomatic_stance portugal mongols War
end_if
if I_LocalFaction moors
console_command diplomatic_stance portugal moors War
end_if
if I_LocalFaction turks
console_command diplomatic_stance portugal turks War
end_if
if I_LocalFaction byzantium
console_command diplomatic_stance portugal byzantium War
end_if
if I_LocalFaction scotland
console_command diplomatic_stance portugal scotland War
end_if
end_if
;Mordor
if I_EventCounter Pxs_Mordor_CInvasion = 1
spawn_army
faction hungary
character Cinvader, named character, age 56, x 399, y 340
traits LoyaltyStarter 1 , GoodCommander 2 , ReligionStarter 1 , GoodAttacker 2 , Loyal 2 , GoodAdministrator 1 , StrategicSkill 1 , LogisticalSkill 1
unit Uruk Bodyguards exp 3 armour 1 weapon_lvl 0
end
give_everything_to_faction hungary england false
;add his units
;base level
create_unit Cinvader, Mordor Orcs Mercs, num 5, exp 1, arm 0, wep 0
create_unit Cinvader, Mordor Archers Mercs, num 2, exp 1, arm 0, wep 0
if I_EventCounter Pxs_Invasion_Type = 1
create_unit Cinvader, Mordor Archers Mercs, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, 2handed Orcs, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Morannon Guard, num 1, exp 1, arm 0, wep 0
end_if
if I_EventCounter Pxs_Invasion_Type = 2
create_unit Cinvader, Battle Trolls, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Mordor Uruks, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Morannon Guard, num 1, exp 1, arm 0, wep 0
end_if
if I_EventCounter Pxs_Invasion_Type = 3
create_unit Cinvader, Battle Trolls, num 1, exp 1, arm 0, wep 0
create_unit Cinvader, Mordor Uruks, num 2, exp 1, arm 0, wep 0
create_unit Cinvader, Morannon Guard, num 1, exp 1, arm 0, wep 0
end_if
;Declare war, mov camera, mov army
if I_LocalFaction sicily
console_command diplomatic_stance england sicily War
end_if
if I_LocalFaction milan
console_command diplomatic_stance england milan War
end_if
if I_LocalFaction egypt
console_command diplomatic_stance england egypt War
end_if
if I_LocalFaction mongols
console_command diplomatic_stance england mongols War
end_if
if I_LocalFaction moors
console_command diplomatic_stance england moors War
end_if
if I_LocalFaction turks
console_command diplomatic_stance england turks War
end_if
if I_LocalFaction byzantium
console_command diplomatic_stance england byzantium War
end_if
if I_LocalFaction scotland
console_command diplomatic_stance england scotland War
end_if
end_if
end_if
if I_LocalFaction sicily
and I_SettlementOwner Anorien = sicily
snap_strat_camera 246 , 129
console_command move_character Cinvader, 246 , 129
console_command mp Cinvader -250
end_if
if I_LocalFaction milan
and I_SettlementOwner Kings-Land = milan
snap_strat_camera 192 , 154
console_command move_character Cinvader, 192 , 154
console_command mp Cinvader -250
end_if
if I_LocalFaction egypt
and I_SettlementOwner Imladris = egypt
snap_strat_camera 182 , 250
console_command move_character Cinvader, 182 , 250
console_command mp Cinvader -250
end_if
if I_LocalFaction mongols
and I_SettlementOwner Elven-Mirkwood = mongols
snap_strat_camera 258 , 267
console_command move_character Cinvader, 258 , 267
console_command mp Cinvader -250
end_if
if I_LocalFaction moors
and I_SettlementOwner Erebor = moors
snap_strat_camera 296 , 264
console_command move_character Cinvader, 296 , 264
console_command mp Cinvader -250
end_if
if I_LocalFaction turks
and I_SettlementOwner Bree = turks
snap_strat_camera 125 , 247
console_command move_character Cinvader, 125 , 247
console_command mp Cinvader -250
end_if
if I_LocalFaction byzantium
and I_SettlementOwner Lake_Evendim = byzantium
snap_strat_camera 98 , 259
console_command move_character Cinvader, 98 , 259
console_command mp Cinvader -250
end_if
if I_LocalFaction scotland
and I_SettlementOwner Dale = scotland
snap_strat_camera 296 , 264
console_command move_character Cinvader, 296 , 264
console_command mp Cinvader -250
end_if
console_command give_trait Cinvader CInvader
historic_event Pxs_Enemy_Army_Near_By
end_if
;Alert Incoming Invasion
if not I_EventCounter Pxs_Invasion_Phase > 0
historic_event Pxs_Inminent_Invasion
end_if
;Wait 3 turns
if I_EventCounter Pxs_Invasion_Phase < 8
inc_event_counter Pxs_Invasion_Phase 1
end_if
end_monitor