Difference between revisions of "Dota 2 Workshop Tools/Scripting/API/CDOTA BaseNPC.CastAbilityImmediately"

From Valve Developer Community
Jump to: navigation, search
(Dota_Lebot push: Updated Page)
(Dota_Lebot push: Updated Page)
 
Line 6: Line 6:
  
  
''' void CastAbilityImmediately(handle ''a'', int ''b'') '''
+
''' void CastAbilityImmediately(handle ''ability'', int ''playerIndex'') '''
  
 
''Cast an ability immediately.''
 
''Cast an ability immediately.''
Line 12: Line 12:
  
  
 +
;Example
 +
<source lang="lua">
 +
local axe = Entities:FindByClassname(nil, "npc_dota_hero_axe")
 +
if axe then
 +
  local berserkersCall = axe:FindAbilityByName("axe_berserkers_call")
 +
  if berserkersCall:IsFullyCastable() then
 +
      axe:CastAbilityImmediately(berserkersCall, axe:GetPlayerOwnerID())
 +
  end
 +
end
 +
 +
</source>
 
== Parameters ==
 
== Parameters ==
 
{| class="standard-table" style="width: 50%;"
 
{| class="standard-table" style="width: 50%;"
Line 19: Line 30:
 
|-
 
|-
 
| handle
 
| handle
| a
+
| ability
 
| No Description Set
 
| No Description Set
 
|-
 
|-
 
| int
 
| int
| b
+
| playerIndex
 
| No Description Set
 
| No Description Set
 
|}
 
|}

Latest revision as of 12:33, 19 August 2014

Note: This page is automatically generated. Any changes may be overwritten

Function Description

void CastAbilityImmediately(handle ability, int playerIndex)

Cast an ability immediately.


Example
local axe = Entities:FindByClassname(nil, "npc_dota_hero_axe")
if axe then
   local berserkersCall = axe:FindAbilityByName("axe_berserkers_call")
   if berserkersCall:IsFullyCastable() then
      axe:CastAbilityImmediately(berserkersCall, axe:GetPlayerOwnerID())
   end
end

Parameters

Type Name Description
handle ability No Description Set
int playerIndex No Description Set