You can... Tested just now with the following GUI trigger...You can't reduce the hero level.
function SetHeroLevelBJ takes unit whichHero,integer newLevel,boolean showEyeCandy returns nothing
local integer oldLevel = GetHeroLevel(whichHero)
if (newLevel > oldLevel) then
call SetHeroLevel(whichHero, newLevel, showEyeCandy)
elseif (newLevel < oldLevel) then
call UnitStripHeroLevel(whichHero, oldLevel - newLevel)
else
endif
endfunction
It is also extremely crash prone. Why not just set the hero to a lower level using a trigger?You can probably use chaos to turn your hero into a unit, and then remove it to turn it back into a hero, this MIGHT reset the hero level, but I wouldn't advise this because it'll do other dumb shit like turn your bonus armor into base armor (which is extremely undesirable if there are any +armor effects, auras, etc).
If one just wants to change the unit types then use inverse morph trick. Set the base form of copied Bear form ability to his new hero form. Add then immediately remove this ability and the hero's unit type is changed. All stats should be retained from the old hero including level and learnt abilities. All non-permanent abilities are lost. One can lower the hero level back to 1 using triggers, as I described above.how to do that?
Ah right, now I remember, that's true since it's actually data local to the execution stack instance.iirc, triggering unit is the exception for waits![]()