Spawning main heroes
sry then...i'm so bored of reading
ok i fixed the code, but now the spell is casted, but the opponents creatures aren't poisoned at all...
and btw, i wanted to make a function that teaches heroes new spells every day, but it seems that some numbers are invalid...for example:16, 22, 47 don't exist. is there any other way to teach a hero all the spells he is able to learn in current state? it's realy annoying to have to restart the script and add if i~=(number) and i~=(another number)...
ok i fixed the code, but now the spell is casted, but the opponents creatures aren't poisoned at all...
and btw, i wanted to make a function that teaches heroes new spells every day, but it seems that some numbers are invalid...for example:16, 22, 47 don't exist. is there any other way to teach a hero all the spells he is able to learn in current state? it's realy annoying to have to restart the script and add if i~=(number) and i~=(another number)...
Sure. The code in a thread is executed separately, so if it terminates with an error it does not affect the whole script. So, to teach a hero all the spells you can write:
function teachspell(hero,spell)
TeachHeroSpell(hero,spell);
end;
for i=1,100 do --don't remeber number of spells actually
startThread('teachspell','Ohtarig',i)
end;
function teachspell(hero,spell)
TeachHeroSpell(hero,spell);
end;
for i=1,100 do --don't remeber number of spells actually
startThread('teachspell','Ohtarig',i)
end;
Who is online
Users browsing this forum: No registered users and 7 guests