Connection ErrorBad RequestThis page went staleSession ExpiredSign in requiredForbiddenNot FoundToo Many RequestsServer ErrorBad GatewayService UnavailableGateway TimeoutHTTP Version Not Supported
Session Expired
Your session has expired. Please log in to continue.
Sign in required
You need an account to do that. Sign in or create one — it only takes a minute.
This page went stale
Your security token was rejected, usually because the page sat open too long or you signed in elsewhere. Nothing was saved. Reload the page and try again.
Request Failed
We encountered an issue while processing your request.
Please check your internet connection and try again.
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).