Auto-translated
Hey guys, I need some help. I wrote a combat script for a Necromancer to cast mass spells of darkness depending on the level.
```
function start()
lev = GetGameVar("level") + 0;
mana = GetUnitManaPoints(GetAttackerHero())
SetUnitManaPoints(GetAttackerHero(), 100);
if lev < 10 then
UnitCastGlobalSpell(GetAttackerHero(), 212)
elseif lev < 20 then
UnitCastGlobalSpell(GetAttackerHero(), 212)
UnitCastGlobalSpell(GetAttackerHero(), 215)
elseif lev < 30 then
UnitCastGlobalSpell(GetAttackerHero(), 212)
UnitCastGlobalSpell(GetAttackerHero(), 215)
UnitCastGlobalSpell(GetAttackerHero(), 210)
else
UnitCastGlobalSpell(GetAttackerHero(), 212)
UnitCastGlobalSpell(GetAttackerHero(), 215)
UnitCastGlobalSpell(GetAttackerHero(), 210)
UnitCastGlobalSpell(GetAttackerHero(), 213)
end
SetUnitManaPoints(GetAttackerHero(), mana);
end
```
In battle, nothing happens (the variable is set, this was checked with another script).