🦸Hero

Table to work with CHero.

CHero extends CNPC

GetCurrentXP(hero: CHero): integer

Name
Type
Description

hero

Returns the hero's current XP.


GetAbilityPoints(hero: CHero): integer

Name
Type
Description

hero

Returns the hero's available ability points.


GetRespawnTime(hero: CHero): number

Could be less than current game time if hero is already alive.

Name
Type
Description

hero

Returns the game time when the hero will respawn.


GetRespawnTimePenalty(hero: CHero): number

Name
Type
Description

hero

Returns the next respawn time penalty, e.g. buyback.


GetPrimaryAttribute(hero: CHero): Enum.Attributes

Name
Type
Description

hero

Returns the hero's primary attribute type.


GetStrength(hero: CHero): number

Name
Type
Description

hero

Returns white value of strength.


GetAgility(hero: CHero): number

Name
Type
Description

hero

Returns white value of agility.


GetIntellect(hero: CHero): number

Name
Type
Description

hero

Returns white value of intellect.


GetStrengthTotal(hero: CHero): number

Name
Type
Description

hero

Returns total value of strength.


GetAgilityTotal(hero: CHero): number

Name
Type
Description

hero

Returns total value of agility.


GetIntellectTotal(hero: CHero): number

Name
Type
Description

hero

Returns total value of intellect.


GetLastHurtTime(hero: CHero): number

Name
Type
Description

hero

Returns the time when the hero was last hurt.


GetHurtAmount(hero: CHero): number

Name
Type
Description

hero

Returns the amount of damage the hero last received.


GetRecentDamage(hero: CHero): integer

Name
Type
Description

hero

Returns the damage taken by the hero in the last in ~1 second.


GetPainFactor(hero: CHero): number

Name
Type
Description

hero

Returns the pain factor of the hero. Not sure what it is.


GetTargetPainFactor(hero: CHero): number

Name
Type
Description

hero

Returns the pain factor of the hero's target. Not sure what it is.


GetLifeState(hero: CHero): boolean

Name
Type
Description

hero

Returns true if the hero is alive. Recommended to use Entity.IsAlive instead.


GetPlayerID(hero: CHero): integer

Name
Type
Description

hero

Returns the ID of the hero player.


GetReplicatingOtherHeroModel(hero: CHero): CHero|nil

Name
Type
Description

hero

If the hero is an illusion, Arc's copy, Meepo clone, etc. returns the original hero, otherwise returns nil.


TalentIsLearned(hero: CHero, talent: Enum.TalentTypes): boolean

Name
Type
Description

Returns true if talent is learned.

Example

TALENT_8 <=> TALENT_7
TALENT_6 <=> TALENT_5
TALENT_4 <=> TALENT_3
TALENT_2 <=> TALENT_1

GetFacetAbilities(hero: CHero): CAbility[]

Name
Type
Description

hero

Returns facet ability array.


GetFacetID(hero: CHero): integer

Name
Type
Description

hero

Returns facet id. Start from 1.


GetLastMaphackPos(hero: CHero): Vector|nil

Name
Type
Description

hero

Returns the last hero pos from maphack.

Last updated