Skip to content

Scripts for beginners.

User Avatar
#325
Auto-translated
BlueHeavenHero
Hello everyone. I recently learned that it is possible to control the enemy army using scripts, depending on the difficulty level. How exactly can this be done?

Well, for example, like this:

function HeroesBuff()
local heroes = {"Duncan", "Biara"};
local diff = GetDifficulty();
for h,hero in heroes do
for creatureID = 1, CREATURES_COUNT - 1 do
if GetObjectCreatures( hero, creatureID) >= 1 then
HeroSetUp = GetObjectCreatures( hero, creatureID );
RemoveObjectCreatures( hero, creatureID, HeroSetUp );
AddObjectCreatures( hero, creatureID, HeroSetUp + ( HeroSetUp / 100 * 10) * diff );
end;
end;
end;
end;