- Joined
- Feb 11, 2016
- Messages
- 259
How I can replace Hero A of level 11 for Hero B of level 1?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
You can... Tested just now with the following GUI trigger...You can't reduce the hero level.
Melee Initialization

Events


Player - Player 1 (Red) types a chat message containing <Empty String> as A substring

Conditions

Actions


Hero - Set Blood Mage 0000 <gen> Hero-level to (Integer((Entered chat string))), Hide level-up graphics
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![]()