AddHeroXP
- Parameters
whichHero unitThe hero unit to add experience to.
xpToAdd integerThe amount of experience to add to the hero unit.
showEyeCandy booleanIf the boolean input is true, then the hero-level-gain effect will be shown if the hero gains a level from the added experience.
- comment
Adds the input value of experience to the hero unit specified.
If the experience added exceeds the amount required for the hero to gain a level, then it will force the unit to gain a level and the remaining experience will spill over for the next level.
- bug
Adding negative value to experience will decrease it by the stated value, but won't lower the level even if the experience value after deduction is lower than the lower bound of the experience required to get the stated level.
- bug
If the value will become lower than zero, the experience won't be negative, instead of it it'll be equal to
4294967296+(supposed_negative_experience_value)which actually proves that WarCraft III uses unsigned int type for storing experience points.- patch
1.00
- Source
- common.j (suggest an edit or discuss on Github)
- return type
nothing- Source code
native AddHeroXP takes unit whichHero, integer xpToAdd, boolean showEyeCandy returns nothing