UnitRemoveAbility
- Parameters
whichUnit unitTarget unit.
abilityId integerAbilities' raw code identifier.
- comment
Removes the ability from target unit.
Returns:
- true if the removal was successful (hero did have this ability before)
- false otherwise (hero does not have this ability)
- bug
Removing non-interrupt abilities like divine shield while they're being cast (at the EVENT_PLAYER_UNIT_SPELL_EFFECT point), and while the caster is moving, will cause the caster to become unresponsive to new commands until they reach their ordered move point.
- note
See
UnitModifySkillPoints/ModifyHeroSkillPointsto grant a hero skill points.- note
All different building ability codes like 'AHbu', 'ANbu' are considered equivalent. For example, removing 'AHbu' on a unit with only 'ANbu' would remove 'ANbu' instead. See
GetUnitAbilityLevel.- patch
1.00
- Source
- common.j (suggest an edit or discuss on Github)
- return type
boolean- Source code
native UnitRemoveAbility takes unit whichUnit, integer abilityId returns boolean