🌟Ability

Table to work with CAbility.

CAbility extends CEntity

GetOwner(ability: CAbility): CEntity|nil

Name
Type
Description

ability

Returns the ability owner.


IsPassive(ability: CAbility): boolean

Name
Type
Description

ability

Returns true if the ability is passive.


IsBasic(ability: CAbility): boolean

Name
Type
Description

ability

Returns true if the ability is basic.


IsUltimate(ability: CAbility): boolean

Name
Type
Description

ability

Returns true if the ability is an ultimate.


IsAttributes(ability: CAbility): boolean

Name
Type
Description

ability

Returns true if the ability is an attribute or a talent.


GetType(ability: CAbility): Enum.AbilityTypes

Name
Type
Description

ability

Returns the ability type.


GetBehavior(ability: CAbility): Enum.AbilityBehavior

Name
Type
Description

ability

Returns the ability type.


GetTargetTeam(ability: CAbility): Enum.TargetTeam

Name
Type
Description

ability

Returns the target team of this Ability.


GetTargetType(ability: CAbility): Enum.TargetType

Name
Type
Description

ability

Returns the target type of this Ability.


GetTargetFlags(ability: CAbility): Enum.TargetFlags

Name
Type
Description

ability

Returns the target flags of this Ability.


GetDamageType(ability: CAbility): Enum.DamageTypes

Name
Type
Description

ability

Returns the damage type of this Ability.


GetImmunityType(ability: CAbility): Enum.ImmunityTypes

Name
Type
Description

ability

Returns the immunity type of this Ability.


GetDispellableType(ability: CAbility): Enum.DispellableTypes

Name
Type
Description

ability

Returns the dispel type of this Ability.


GetLevelSpecialValueFor(ability: CAbility, name: string, lvl [?]: integer): number

Name
Type
Description

ability

name

string

Special value name. Can be found in the ability KV file. (assets/data/npc_abilities.json)

lvl [?]

integer

Ability level, if -1 will automatically get lvl. (default: -1)

WRONG API FIX ME IT MUST BE GetSpecialValueFor.


IsReady(ability: CAbility): boolean

Name
Type
Description

ability

Returns true if the ability is ready to use.


SecondsSinceLastUse(ability: CAbility): number

Name
Type
Description

ability

Returns the number of seconds passed from the last usage of the ability. Will return -1 if the ability is not on the cooldown.


GetDamage(ability: CAbility): number

Name
Type
Description

ability

Returns the ability damage from assets/data/npc_abilities.json field. Will return 0.0 if the ability doesn't contain this field.


GetLevel(ability: CAbility): integer

Name
Type
Description

ability

Returns the current ability level.


GetCastPoint(ability: CAbility, include_modifiers [?]: boolean): number

Name
Type
Description

ability

include_modifiers [?]

boolean

(default: true)

Gets the cast delay of this Ability.


GetCastPointModifier(ability: CAbility): number

Name
Type
Description

ability

Gets the cast delay modifier of this Ability.


IsCastable(ability: CAbility, mana [?]: number): boolean

Name
Type
Description

ability

mana [?]

number

(default: 0.0)

Returns true if the ability is currently castable. Checks for mana cost, cooldown, level, and slot for items.


IsChannelling(ability: CAbility): boolean

Name
Type
Description

ability

Returns true if the ability is in channeling state. Example: teleport, rearm, powershot etc.


GetName(ability: CAbility): string

Name
Type
Description

ability

Returns the ability name or empty string.


GetBaseName(ability: CAbility): string

Name
Type
Description

ability

Returns the ability base name or empty string.


IsInnate(ability: CAbility): boolean

Name
Type
Description

ability

Returns true if the ability is innate.


IsInnatePassive(ability: CAbility): boolean

Name
Type
Description

ability

Returns true if the ability is passive innate.


GetMaxLevel(ability: CAbility): integer

Name
Type
Description

ability

Returns ability's max level.


IsGrantedByFacet(ability: CAbility): boolean

Name
Type
Description

ability

Returns true when abiliti is granted by facet.


CanBeExecuted(ability: CAbility): Enum.AbilityCastResult

Name
Type
Description

ability

Returns -1 if ability can be executed.


IsOwnersManaEnough(ability: CAbility): boolean

Name
Type
Description

ability

Returns true if enough mana for cast.


CastNoTarget(ability: CAbility, queue [?]: boolean, push [?]: boolean, execute_fast [?]: boolean, identifier [?]: string): nil

Name
Type
Description

ability

queue [?]

boolean

Will add order to the cast queue. (default: false)

push [?]

boolean

Will push order to the OnPrepareUnitOrders callback. (default: false)

execute_fast [?]

boolean

Will push order to start of the order's list. (default: false)

identifier [?]

string

The identifier which will be passed to OnPrepareUnitOrders callback. (default: nil)

Casts the ability that doesn't require a target or position.


CastPosition(ability: CAbility, pos: Vector, queue [?]: boolean, push [?]: boolean, execute_fast [?]: boolean, identifier [?]: string): nil

Name
Type
Description

ability

pos

Order position.

queue [?]

boolean

Will add order to the cast queue. (default: false)

push [?]

boolean

Will push order to the OnPrepareUnitOrders callback. (default: false)

execute_fast [?]

boolean

Will push order to start of the order's list. (default: false)

identifier [?]

string

The identifier which will be passed to OnPrepareUnitOrders callback. (default: nil)

Casts the ability at a specified position.


CastTarget(ability: CAbility, target: CNPC, queue [?]: boolean, push [?]: boolean, execute_fast [?]: boolean, identifier [?]: string): nil

Name
Type
Description

ability

target

Order target.

queue [?]

boolean

Will add order to the cast queue. (default: false)

push [?]

boolean

Will push order to the OnPrepareUnitOrders callback. (default: false)

execute_fast [?]

boolean

Will push order to start of the order's list. (default: false)

identifier [?]

string

The identifier which will be passed to OnPrepareUnitOrders callback. (default: nil)

Casts the ability on a specified target.


Toggle(ability: CAbility, queue [?]: boolean, push [?]: boolean, execute_fast [?]: boolean, identifier [?]: string): nil

Name
Type
Description

ability

queue [?]

boolean

Will add order to the cast queue. (default: false)

push [?]

boolean

Will push order to the OnPrepareUnitOrders callback. (default: false)

execute_fast [?]

boolean

Will push order to start of the order's list. (default: false)

identifier [?]

string

The identifier which will be passed to OnPrepareUnitOrders callback. (default: nil)

Toggles the ability. Example: Armlet.


ToggleMod(ability: CAbility, queue [?]: boolean, push [?]: boolean, execute_fast [?]: boolean, identifier [?]: string): nil

Name
Type
Description

ability

queue [?]

boolean

Will add order to the cast queue. (default: false)

push [?]

boolean

Will push order to the OnPrepareUnitOrders callback. (default: false)

execute_fast [?]

boolean

Will push order to start of the order's list. (default: false)

identifier [?]

string

The identifier which will be passed to OnPrepareUnitOrders callback. (default: nil)

Toggles the ability modifier. Example: Frost Arrows, Medusa's Shield.


CanBeUpgraded(ability: CAbility): Enum.AbilityLearnResult|nil

Name
Type
Description

ability

Returns if the ability is upgradable with a specific reason.


GetIndex(ability: CAbility): integer

Name
Type
Description

ability

Returns the index of the ability in the ability owner's list. The index can be used in NPC.GetAbilityByIndex later.


GetCastRange(ability: CAbility): number

Name
Type
Description

ability

Returns the cast range of the ability.


IsHidden(ability: CAbility): boolean

Name
Type
Description

ability

Returns true if ability is hidden. Example: Zeus's Nimbus before purchasing agh.


IsActivated(ability: CAbility): boolean

Name
Type
Description

ability

Returns true if the ability is in an activated state.


GetDirtyButtons(ability: CAbility): integer

Name
Type
Description

ability

Returns we don't know what :).


GetToggleState(ability: CAbility): boolean

Name
Type
Description

ability

Returns if the ability is toggled. Example: Medusa's Shield.


IsInAbilityPhase(ability: CAbility): boolean

Name
Type
Description

ability

Returns true if the ability is in the cast state. Examples: Nature's Prophet's Teleport, Meepo's Poof.


GetCooldown(ability: CAbility): number

Name
Type
Description

ability

Returns the amount of time before the ability can be cast.


GetCooldownLength(ability: CAbility): number

Name
Type
Description

ability

Returns the amount of time the ability couldn't be cast after being used.


GetManaCost(ability: CAbility): number

Name
Type
Description

ability

Returns the ability mana cost.


GetAutoCastState(ability: CAbility): boolean

Name
Type
Description

ability

Returns the autocast state of the ability.


GetAltCastState(ability: CAbility): boolean

Name
Type
Description

ability

Returns the alt cast state of the ability. Example: Doom's Devour.


GetChannelStartTime(ability: CAbility): number

Name
Type
Description

ability

Returns the gametime the channeling of the ability will start. Requires the ability to be in the cast state when called.


GetCastStartTime(ability: CAbility): number

Name
Type
Description

ability

Returns the gametime the ability will be casted. Requires the ability to be in the cast state when called.


IsInIndefinateCooldown(ability: CAbility): boolean

Name
Type
Description

ability

Returns true if the cooldown of the ability is indefinite.


IsInIndefinateCooldown(ability: CAbility): boolean

Name
Type
Description

ability

Returns true if the cooldown of the ability is frozen.


GetOverrideCastPoint(ability: CAbility): number

Name
Type
Description

ability

Returns the overridden cast point. Example: Arcane Blink.


IsStolen(ability: CAbility): boolean

Name
Type
Description

ability

Returns true if the ability is stolen.


GetCurrentCharges(ability: CAbility): integer

Name
Type
Description

ability

Returns the number of charges available.


ChargeRestoreTimeRemaining(ability: CAbility): integer

Name
Type
Description

ability

Returns the remaining time for the next charge to restore.


GetKeybind(ability: Ability): string

Name
Type
Description

ability

Ability

Returns the keybind of the ability.

Last updated