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.
Hello! I need help with a question: In general, I have a counter. The presence of creatures from a list in a hero's army should affect it. For example:
enemy_creatures = {106, 107, 108, 109, 110, 111, 112, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28} - these are red creatures and regular demons, as well as "fiery" demons (without alternative upgrades). There are 21 of them in the list, and I write:
for enemy=1,21 do
if GetHeroCreatures(HeroName, enemy_creatures[enemy]) >= 1 then
counter = counter - 1;
The problem is that the function affects the counter for the entire list, i.e., even for one stack in the hero's army, it reduces the counter by not 1, but by all 22. How can I write the function so that it only changes the counter if creatures with IDs from the list are present in the hero's army?