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.
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;