Easy Ability Fields

Easy Ability Fields allows you to use the Get and Set Ability Field natives without headaches. It uses artificial intelligence a simple algorithm to convert fourCC codes to the correct field types and calls the appropriate function to retrieve the value.

Lua:
GetUnitAbilityField(whichUnit, fourCC, "adur")
is equivalent to:
Lua:
BlzGetAbilityRealLevelField(BlzGetUnitAbility(whichUnit, FourCC(fourCC), ABILITY_RLF_DURATION_NORMAL, GetUnitAbilityLevel(whichUnit, FourCC(fourCC)) - 1)
You can of course specify the level explicitly.

Features:
  • Call function with unit and abilityId instead of ability instance.
  • Interface that calls the appropriate native.
  • Pass fourCC code of ability field instead of common.j constant.
  • Convert level to 1-indexing.
  • Retrieve generic ability field value with GetAbilityField, which gives the ability temporarily to a dummy.
  • Omit level parameter to automatically use the unit's current level.
  • Cache result for faster execution.

Installation:
Copy the ListOfFields and EasyAbilityFields scripts into your map, then copy the Easy Ability Field Dummy unit and set the DUMMY_UNIT constant to its fourCC code.
Contents

EasyAbilityFields (Map)

EasyAbilityFields (Binary)

ListOfFields (Binary)

Reviews
Wrda
A resource that simplies modifying the ability fields of a unit in a breeze. Chuck Norris is here making our lives easier. Approved
Top