Dota 2 Workshop Tools/Scripting/API/CDOTA BaseNPC.CastAbilityOnTarget: Difference between revisions
< Dota 2 Workshop Tools | Scripting | API
Jump to navigation
Jump to search
No edit summary |
|||
Line 26: | Line 26: | ||
| handle | | handle | ||
| ability | | ability | ||
| The ability on the unit to be cast on the target | | The ability on the unit to be cast on the target as in the KV | ||
| keys.caster:FindAbilityByName("mana_burn") | | keys.caster:FindAbilityByName("mana_burn") | ||
|- | |- | ||
Line 34: | Line 34: | ||
| keys.caster:GetOwner():GetPlayerID() | | keys.caster:GetOwner():GetPlayerID() | ||
|} | |} | ||
== Example == | |||
keys.caster:CastAbilityOnTarget(targetReference, keys.caster:FindAbilityByName("mana_burn"), keys.caster:GetOwner():GetPlayerID()) |
Revision as of 09:24, 17 August 2014

Function Description
void CastAbilityOnTarget(handle target, handle ability, int playerIndex)
Cast an ability on a target entity.
Parameters
Type | Name | Description | Example |
---|---|---|---|
handle | target | The target to this ability is to be casted on | target |
handle | ability | The ability on the unit to be cast on the target as in the KV | keys.caster:FindAbilityByName("mana_burn") |
int | playerIndex | The casting units player ID | keys.caster:GetOwner():GetPlayerID() |
Example
keys.caster:CastAbilityOnTarget(targetReference, keys.caster:FindAbilityByName("mana_burn"), keys.caster:GetOwner():GetPlayerID())