# Add Ability

Grammar — Add inBehavior to inUnit
FlagsNative | Action

Added ability may not be able to be cast without command buttons. You can set a ability to automaticly create command button, by go to the ability’s Command+ field, and assigne default button for them. “Use Default Button” and “Create Default Button” flags needs to be check to allow the button to be auto created. The position of the auto-created button can be set in the Button data.

# Arguments

  • unit — Unit
  • string<gamelink::Abil> — Ability

Returns — void

native void UnitAbilityAdd(unit inUnit, string inBehavior);

Category: Ability / Basic

# Examples

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/WarClassicSystem.galaxy:288

        autoA87D0C6F_val = lv_race;
        if (autoA87D0C6F_val == "Human") {
            UnitAbilityAdd(lv_townHall, "Amic");
        }
        else if (autoA87D0C6F_val == "NightElf") {