Auto-translated
yes, now it really casts spells randomly. However, the error is now different; it can't cast any spell except for prayer. I assign mass haste, stone skin, etc., but it says that "hero can't cast #25, 24, etc."
Here's a snippet of the script again:
if cast == 0 then
UnitCastGlobalSpell(hero, 54) --- prayer, works
elseif cast == 1 then
UnitCastGlobalSpell(hero, 24) --- haste
elseif cast == 2 then
UnitCastGlobalSpell(hero, 25) --- stone skin
elseif cast == 3 then
UnitCastGlobalSpell(hero, 28) --- bloodlust
elseif cast == 4 then
UnitCastGlobalSpell(hero, 29) --- deflection
elseif cast == 5 then
UnitCastGlobalSpell(hero, 23) --- prophet's power
end
Please explain this moment; otherwise, everything seems to be becoming clear.
Added 1 minute ago
Oops, sorry, the question is withdrawn. I needed to look for mass spells.
Thank you very much.