Skip to content
User Avatar
#4014
Auto-translated
Shiroyasha2910

Good evening, I wanted to give a hero mana through a script, like with the "Secret Advantage" skill, so that it ignores the hero's maximum mana. I tried using ChangeHeroStat(), but it didn't work. The funny thing is that when I just started working on the map, I actually managed to ignore the maximum mana, but I needed it to go up to the maximum, and now it's the other way around, and I can't remember how I did it. I found an answer on the forum on how to give a hero mana up to 300 using ChangeHeroStat(), but as I wrote above, it didn't work.


Possible solution: temporarily add Knowledge to the hero, and after increasing the amount of mana, return the Knowledge to its previous value. Example:

ChangeHeroStat("Deleb", STAT_KNOWLEDGE, 10)
ChangeHeroStat("Deleb", STAT_MANA_POINTS, 100)
ChangeHeroStat("Deleb", STAT_KNOWLEDGE, -10)

I quickly checked it through the console. Yes, it works, the mana remains above the maximum value. For now, I'll do it this way; maybe someone knows how to do it with a single command.