-
Notifications
You must be signed in to change notification settings - Fork 12
Unit AI API
#Unit AI Functions These functions are available on every unit handle the AI can access.
- entity:GetClassname
- entity:GetEntityHandle
- entity:GetEntityIndex
- entity:GetName
- unit:FindAbilityByName
- unit:GetAbilityByIndex
- unit:GetAbilityPoints
- unit:GetAbsOrigin
- unit:GetAttackAnimationPoint
- unit:GetAttackCapability
- unit:GetAttackRange
- unit:GetAttackRange
- unit:GetAttackSpeed
- unit:GetAttacksPerSecond
- unit:GetAverageTrueDamage
- unit:GetForwardVector
- unit:GetGold
- unit:GetHealth
- unit:GetIdealSpeed
- unit:GetItemInSlot
- unit:GetLevel
- unit:GetMaxHealth
- unit:GetModelName
- unit:GetOrigin
- unit:GetOwner
- unit:GetOwnerEntity
- unit:GetPlayerOwnerID
- unit:GetProjectileSpeed
- unit:GetTeam
- unit:GetTeamNumber
- unit:HasBuyback
- unit:IsAlive
- unit:IsHero
- unit:IsInVision
- unit:IsTower
Get the classname of the entity.
-
Get the entity handle of the entity.
-
Get the entity index of the entity.
-
Get the name of the entity.
-
Retrieve an ability by index from the unit.
- name - The name of the ability to look up.
Only works if the unit is in vision and wraps result.
Retrieve an ability by index from the unit.
- index - The index of the ability on the unit.
Wrap the result, only works if unit is in vision, nil otherwise.
Retrieve the amount of ability points a hero has.
Only works for allies.
Get the position of the unit.
Return nil when unit is in fog of war.
Get the unit's attack animation point.
Only works in vision.
Get the unit's attack capability.
Only works in vision.
Get the unit's attack range.
Only works in vision.
Get the unit's attack range.
Only works in vision.
Get the unit's attack speed.
Only works in vision.
Get the amount of attacks the unit does per second based on its attack speed.
Only works in vision.
Get the average value of the unit's minimum and maximum damage values.
Only works in vision.
Get the forward vector of the unit.
Only works in vision.
Get the gold of a unit.
Modification: Only works for allies.
Get the health of the unit.
Return nil when unit is in fog of war.
Get the unit's movespeed.
Only works in vision.
Retrieve an item by slot from the unit.
- slot - The name of the ability to look up.
Only works if the unit is in vision and wraps the result.
Get the level of a unit.
Modification: Only works for units in vision.
Get the maximum health of the unit.
Return nil when unit is in fog of war.
Get the model name of the unit.
Return nil when unit is in fog of war.
Get the position of the unit.
Return nil when unit is in fog of war.
Get the owner of the unit.
Wrap result.
Get the owner of the unit.
Wrap result.
Get the ID of the player owning this unit.
-
Get the unit's projectile speed.
Only works in vision.
Get the team of the unit.
-
Get the team of the unit.
None.
Return if the unit has buyback or not. Only for allies.
Does not exist in regular API.
Return if the unit is alive or not.
-
See if the hero is a unit or not.
Only works in vision.
Return if the unit is in vision or not
Does not exist in regular API.
See if the hero is a unit or not.
Only works in vision.