Changes a unit's stats integer field.
There're quirks when changing stats, some values don't apply immediately and some don't work at all, likely due to how the game engine uses them. Example:
Regeneration type values are as follows:
- 0 - Never
- 1 - Always
- 2 - Only on blight
- 4 - Only at night
Changing the regeneration type at runtime WILL NOT work, even if true is returned (false positive).
For vision, it appears changing them to a specific value does not immediately change it. Instead, it will change over time to approach and reach said value. However, if one wishes to decrease the vision range, and the initial vision range is greater than 1800, the vision will remain at 1800. Thus, one must change it first to 1800, then to the desired value. Otherwise, vision change works as intended. One cannot increase vision beyond 1800.
Going into a fountain of life will not increase a unit's hp regeneration rate. Modifying regeneration rate is instant.
Many fields don't work at all.
- return type
- Source code
native BlzSetUnitIntegerField takes unit whichUnit, unitintegerfield whichField, integer value returns boolean