👾Entity
Table to work with CEntity
.
CEntity
.CEntity
is base class for all entities in the game e.g. CNPC
, Hero
, CPlayer
, CAbility
IsEntity(entity: CEntity
): boolean
CEntity
): boolean
Returns true
if the entity is in entity list. Search in unordered set.
IsNPC(entity: CEntity
): boolean
CEntity
): boolean
Returns true
if the entity is in NPC list. Search in unordered set.
IsHero(entity: CEntity
): boolean
CEntity
): boolean
Returns true
if the entity is in hero list. Search in unordered set.
IsPlayer(entity: CEntity
): boolean
CEntity
): boolean
Returns true
if the entity is in player list. Search in unordered set.
IsAbility(entity: CEntity
): boolean
CEntity
): boolean
Returns true
if the entity is in ability list. Search in unordered set. Item is ability.
Not the same as Entities.Get(index). See example.
index
integer
Returns entity by game index.
Example
GetIndex(entity: CEntity
): integer
CEntity
): integer
Returns game index of entity.
GetClassName(entity: CEntity
): string
CEntity
): string
Returns the entity's class name.
GetUnitName(entity: CEntity
): string
CEntity
): string
Returns the entity's name.
GetUnitDesignerName(entity: CEntity
): string
CEntity
): string
Returns the entity's designerName field.
GetTeamNum(entity: CEntity
): Enum.TeamNum
CEntity
): Enum.TeamNum
Returns the entity's team number.
Returns true
if the entities are in the same team.
Returns the entity's position.
Returns the entity's rotation.
Example
IsAlive(entity: CEntity
): boolean
CEntity
): boolean
Returns true
if the entity is alive.
IsDormant(entity: CEntity
): boolean
CEntity
): boolean
Returns true
if the entity is not visible to the local player.
GetHealth(entity: CEntity
): integer
CEntity
): integer
Returns the entity's health.
GetMaxHealth(entity: CEntity
): integer
CEntity
): integer
Returns the entity's max health.
Returns the entity's owner or nil
if the entity has no owner.\ e.g. for CPlayer
-> npc_dota_hero_ember_spirit
-> npc_dota_hero_ember_spirit_fire_remnant
ownership chain Entity.GetOwner(remnant)
will return Ember Spirit's entity.
Returns true
if the entity is owned by another entity-owner. It will check the first owner only.
Returns the entity's last owner.\ e.g. for CPlayer
-> npc_dota_hero_ember_spirit
-> npc_dota_hero_ember_spirit_fire_remnant
ownership chain Entity.GetOwner(remnant)
will return CPlayer
.
Returns true
if the entity is owned by another entity-owner. It will check the whole ownership chain.
GetHeroesInRadius(entity: CEntity
, radius: number
, teamType [?]
: Enum.TeamType
, skipIllusions [?]
: boolean
): CHero[]
CEntity
, radius: number
, teamType [?]
: Enum.TeamType
, skipIllusions [?]
: boolean
): CHero[]
radius
number
radius to search around
skipIllusions [?]
boolean
true
if you want to get table without illusions (default: true)
Returns an array of all alive and visible heroes in radius of the entity. Exclude illusion.
Example
GetUnitsInRadius(entity: CEntity
, radius: number
, teamType [?]
: Enum.TeamType
, skipIllusions [?]
: boolean
): CNPC[]
CEntity
, radius: number
, teamType [?]
: Enum.TeamType
, skipIllusions [?]
: boolean
): CNPC[]
radius
number
radius to search around
skipIllusions [?]
boolean
true
if you want to get table without illusions (default: true)
Returns an array of all alive and visible NPCs in radius of the entity.
Example
Active means that tree is not destroyed.
radius
number
radius to search around
active [?]
boolean
true
if you want to get table with active trees only, otherwise for inactive trees (default: true)
Returns an array of all not temporary trees in radius of the entity.
Example
Temporary trees are trees planted by abilities or items.
radius
number
radius to search around
Returns an array of all temporary trees in radius of the entity.
Example
playerId
integer
player id
Returns true
if entity is controllable by player.
distance
number
distance to move forward
Returns position in front of entity or (0,0,0) if entity is invalid.
GetClassID(entity: CEntity
): integer
CEntity
): integer
Returns entity class id. Could be as a optimized way to check entity type.
Returns value of the field.
Last updated