Skip to content
User Avatar
#2756
Auto-translated
LetoX, could it be that you made a mistake somewhere else in the combat script, and the entire interpreter crashes? If you have a working version with a different spell and a non-working current version, try gradually switching from one to the other and see at what stage it stops working. Here is a piece of my similar script that works normally: player_hero = '';

function Start()

if(IsHuman(ATTACKER)) then
player_hero = GetAttackerHero();
else
player_hero = GetDefenderHero();
end

combatSetPause(not nil);

local last_mana = GetUnitManaPoints(player_hero);
SetUnitManaPoints(player_hero, 100);
repeat sleep() until(GetUnitManaPoints(player_hero) == 100);
startThread(UnitCastGlobalSpell, player_hero, SPELL_MASS_STONESKIN);
sleep(1);
SetUnitManaPoints(player_hero, last_mana);
repeat sleep() until(GetUnitManaPoints(player_hero) == last_mana);

setATB(player_hero, 0.5);
sleep(1);
combatSetPause(nil);

end
РПГ-сценарий для HoMM5: Путь героя
ЧаВо по созданию карт для HoMM5: ЧаВо