Skip to content
User Avatar
#3832
Auto-translated
Good day! I need help with a script. I created a special ability for a hero, so that if, during a battle, less than 30% of creatures remain in his army, Death Wraiths are summoned in the amount of HeroLevel * 0.05. But I doubt that this will work...
function Start()
if GetHeroName(GetAttackerHero())=="HafadNecro" then
side=ATTACKER
aside=DEFENDER
start_creatures=CountCreatures(side)
elseif GetHeroName(GetDefenderHero())=="HafadNecro" then
side=DEFENDER
aside=ATTACKER
start_creatures=CountCreatures(side)
end
end
function CountCreatures(_side)
local fc_count=0
for key, element in GetCreatures(_side) do
fc_count=fc_count+GetCreatureNumber(element)
end
return fc_count
end
function UnitDeath(unit)
sleep(4)
if intg(start_creatures*0.30)<=CountCreatures(side) then
for key, name in GetCreatures(aside) do
SummonCreature(side, CREATURE_WRAITH, 0.05*GetHeroLevel("HafadNecro"), 12, 2)
end;
end;
end;

Мои карты:
Падший рыцарь
Сердце Хаоса

Мои моды:
Визуальные:
Изменение внешнего вида героев-некромантов
Существа-жители и кое-что по мелочи в городах Ордена Порядка, Некрополиса и Инферно

NCF-существа:
Странствующие рыцари
Наемники