Code: Select all
//DEFINITIONS
int HarderLvl
bool PiratesDead
bool NotMore
//INITIALIZATION
HarderLvl = 10;
PiratesDead = true;
NotMore = true;
//END_INITIALIZATION
RULE NewShips PERIODICITY 5
if ((NumUnitsInGroup("Pirates") < HarderLvl) && PiratesDead && NotMore)
then NewShips
END_RULE
ACTION NewShips
SCRIPT WORLD
PiratesDead = false;
HarderLvl = HarderLvl + 7;
PlayVoiceOver("Fx_Bld_Coastal_Defense.mp3");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates3");
DoDelay(1);
STEP
SelectGroup("Pirates");
SetSelectionStance(kStanceType_Aggressive);
SetSelectionFormation("StaggeredLine");
SearchAndDestroyWithSelection();
PiratesDead = true;
END_SCRIPT
END_ACTION
"NewPirates3" as such are area names, so would need to be added in map editor first.
It's not very complicated once you understand how functions are executed.