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
entity
Returns true
if the entity is in entity list. Search in unordered set.
IsNPC(entity: CEntity
): boolean
CEntity
): boolean
entity
Returns true
if the entity is in NPC list. Search in unordered set.
IsHero(entity: CEntity
): boolean
CEntity
): boolean
entity
Returns true
if the entity is in hero list. Search in unordered set.
IsPlayer(entity: CEntity
): boolean
CEntity
): boolean
entity
Returns true
if the entity is in player list. Search in unordered set.
IsAbility(entity: CEntity
): boolean
CEntity
): boolean
entity
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
entity
Returns game index of entity.
GetClassName(entity: CEntity
): string
CEntity
): string
entity
Returns the entity's class name.
GetUnitName(entity: CEntity
): string
CEntity
): string
entity
Returns the entity's name.
GetUnitDesignerName(entity: CEntity
): string
CEntity
): string
entity
Returns the entity's designerName field.
GetTeamNum(entity: CEntity
): Enum.TeamNum
CEntity
): Enum.TeamNum
entity
Returns the entity's team number.
entity1
entity2
Returns true
if the entities are in the same team.
entity
Returns the entity's position.
entity
Returns the entity's rotation.
Example
IsAlive(entity: CEntity
): boolean
CEntity
): boolean
entity
Returns true
if the entity is alive.
IsDormant(entity: CEntity
): boolean
CEntity
): boolean
entity
Returns true
if the entity is not visible to the local player.
GetHealth(entity: CEntity
): integer
CEntity
): integer
entity
Returns the entity's health.
GetMaxHealth(entity: CEntity
): integer
CEntity
): integer
entity
Returns the entity's max health.
entity
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.
entity
- entity to check
owner
- owner for comparison
Returns true
if the entity is owned by another entity-owner. It will check the first owner only.
entity
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
.
entity
entity to check
owner
owner for comparison
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[]
entity
entity to get position
radius
number
radius to search around
teamType [?]
relative to the entity (default: TEAM_ENEMY)
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[]
entity
entity to get position
radius
number
radius to search around
teamType [?]
relative to the entity (default: TEAM_ENEMY)
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.
entity
entity to get position
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.
entity
entity to get position
radius
number
radius to search around
Returns an array of all temporary trees in radius of the entity.
Example
entity
entity to check
playerId
integer
player id
Returns true
if entity is controllable by player.
entity
entity to get position
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
entity
entity to get class id
Returns entity class id. Could be as a optimized way to check entity type.
entity
entity to get field from
fieldName
string
field name
dbgPrint
boolean
print possible errors
Returns value of the field.
Last updated