function rndcast()
while 1 do
SetGameVar('spell', random(5))
local index = GetLastSavedCombatIndex()
while index == GetLastSavedCombatIndex() do
sleep(10)
end
end
end
startThread(rndcast)
And in the combat script, replace the line:
cast = GetGameVar('spell')+0
with the line:
cast = random(5)
Yes, and random(5) will return a random number from 0 to 4. That is, random(n) returns a random number from 0 to n-1.
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4