ChangeHeroStat(heroName, statID, delta);
heroName
– the hero’s name statID
– the stat’s ID delta
– stat modification value
This function modifies the hero’s specified stat by delta
. The following stats can be modified: experience, attack, defense, spell power, knowledge, luck, morale, move points, mana points. delta
can take on either positive (the stat is increased) or negative (the stat is decreased) values for all stats except experience, since experience can only grow.
The stats’ values themselves can not be negative. The top values of move points and mana points stats are additionally limited by the move points max and mana points max values. If the modification results in the stat exceeding the permissible limitations, it is truncated.
statID
can take one of the following values:
STAT_EXPERIENCE
– the hero’s experienceSTAT_ATTACK
– attack levelSTAT_DEFENCE
– defense levelSTAT_SPELL_POWER
– spell powerSTAT_KNOWLEDGE
– knowledgeSTAT_LUCK
– luckSTAT_MORALE
– moraleSTAT_MOVE_POINTS
– remaining movement points numberSTAT_MANA_POINTS
– current mana points number