Доброго времени суток! Нужна помощь по скрипту. Создал я спецу для героя, чтобы если во время боя в его армии осталось меньше 30% существ, призывались Вестники Смерти в размере УровеньГероя*0.05. Но сомневаюсь, что это будет работать...
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;