C# Class Ensage.Common.Extensions.UnitExtensions

The unit extensions.
Afficher le fichier Open project: EnsageSharp/Ensage.Common Class Usage Examples

Méthodes publiques

Méthode Description
AghanimState ( this unit ) : bool

Checks if given hero has AghanimScepter

AttackBackswing ( this unit ) : double

The attack backswing.

AttackPoint ( this unit ) : double

The attack point.

AttackRate ( this unit ) : double

The attack rate.

BasePredict ( this unit, Unit source, float delay, float speed ) : System.Vector3

The base predict.

BasePredict ( this unit, float delay ) : System.Vector3

The base predict.

BestAATarget ( this unit, float bonusRange ) : Hero

The best aa target.

CanAttack ( this unit ) : bool

Checks if given unit is able to attack

CanCast ( this unit ) : bool

Checks if given unit is able to cast spells

CanDie ( this unit, string sourceAbilityName = null, bool ignoreReincarnation = false ) : bool

The can die.

CanMove ( this unit ) : bool

Checks if given unit is able to move

CanReincarnate ( this unit ) : bool

The can reincarnate.

CanUseItems ( this unit ) : bool

Checks if given unit is not muted

ClosestToMouseTarget ( this source, float range = 1000 ) : Hero

The closest to mouse target.

DamageTaken ( this target, float dmg, DamageType dmgType, Unit source, bool throughBKB = false, double minusArmor = 0d, double minusDamageResistancePerc = 0d, double minusMagicResistancePerc = 0d ) : float

Returns actual damage the unit takes

DisableTarget ( this unit, Unit target ) : bool

Uses available disable ability which takes least time to hit the target, chains with other disables

FindItem ( this unit, string name, System.Item &item, bool cache = false ) : System.Item

The find item.

FindItem ( this unit, string name, bool cache = false ) : System.Item

Searches for a item in the units inventory with given name

FindModifier ( this unit, string modifierName ) : Modifier

The has modifier.

FindRelativeAngle ( this unit, System.Vector3 pos ) : float

The find relative angle.

FindRelativeAngle ( this unit, System.Vector3 pos, float delta ) : float

The find relative angle.

FindSpell ( this unit, string name, Ability &spell ) : Ability

The find spell.

FindSpell ( this unit, string name, bool cache = false ) : Ability

Returns spell of the unit with given name if it exists

GetAttackRange ( this unit ) : float

Returns actual attack range of a unit

GetChanneledAbility ( this unit ) : Ability

Finds spell/item which is currently being channeled by given unit

GetDagon ( this unit ) : System.Item

Finds a dagon in the units inventory

GetEnemyTeam ( this unit ) : Team

Returns Enemy Team of the unit

GetLeveledItem ( this unit, string name ) : System.Item

Finds item with given name which has more than 1 level

GetTurnRate ( this unit, bool currentTurnRate = true ) : double

The get turn rate.

GetTurnTime ( this unit, System.Entity entity ) : double

Calculates how much time it will take for given unit to turn to another entity

GetTurnTime ( this unit, System.Vector3 position ) : double

Calculates how much time it will take for given unit to turn to given vector

HasItem ( this unit, ClassID classId ) : bool

Returns if the target has the given Item

HasModifier ( this unit, string modifierName ) : bool

The has modifier.

HasModifiers ( this unit, string modifierNames, bool hasAll = true ) : bool

The has modifiers.

InFront ( this unit, float distance ) : System.Vector3

The in front.

IsAttackImmune ( this unit ) : bool

Checks if unit is immune to auto attack

IsAttacking ( this unit ) : bool

The is attacking.

IsChanneling ( this unit ) : bool

Checks if unit is currently channeling

IsDisarmed ( this unit ) : bool

The is disarmed.

IsHexed ( this unit ) : bool

The is hexed.

IsHexed ( this unit, float &hexDuration ) : bool

The is hexed.

IsInvisible ( this unit ) : bool

The is invisible.

IsInvul ( this unit ) : bool

The is invulnerable.

IsInvul ( this unit, float &invulnerabilityDuration ) : bool

The is invulnerable.

IsLinkensProtected ( this unit ) : bool

The is linken protected.

IsMagicImmune ( this unit ) : bool

The is magic immune.

IsPurgable ( this unit ) : bool

Checks if enemy have a modifier which can be purged

IsRooted ( this unit ) : bool

The is rooted.

IsRooted ( this unit, float &rootDuration ) : bool

The is rooted.

IsSilenced ( this unit ) : bool

The is silenced.

IsStunned ( this unit ) : bool

The is stunned.

IsStunned ( this unit, float &stunDuration ) : bool

The is stunned.

IsUnitState ( this unit, UnitState state ) : bool

The is unit state.

IsValidTarget ( this unit, float range = float.MaxValue, bool checkTeam = true, System.Vector3 from = newVector3() ) : bool

The is valid target.

ManaBurnDamageTaken ( this unit, float burnAmount, double multiplier, DamageType dmgType, Unit source, bool throughBkb = false, double minusArmor = 0d, double minusDamageResistancePerc = 0d, double minusMagicResistancePerc = 0d ) : float

Returns how much mana burn damage given unit receives

ManaBurnSpellDamageTaken ( this unit, float burnAmount, double multiplier, DamageType dmgType, Unit source, string spellName, bool throughBkb = false, double minusArmor = 0d, double minusDamageResistancePerc = 0d, double minusMagicResistancePerc = 0d ) : float

The mana burn spell damage taken.

Predict ( this unit, float delay ) : System.Vector3

Returns predicted location of a unit after given milliseconds

ProjectileSpeed ( this unit ) : double

The projectile speed.

SilenceTarget ( this unit, Unit target ) : bool

Uses available silence ability which takes least time to hit the target, chains with disables

SlowTarget ( this unit, Unit target ) : bool

Uses available slow ability which takes least time to hit the target, chains with other disables

SpellDamageTaken ( this target, float dmg, DamageType dmgType, Unit source, string spellName, bool throughBKB = false, double minusArmor = 0d, double minusDamageResistancePerc = 0d, double minusMagicResistancePerc = 0d ) : float

The spell damage taken.

Vector2FromPolarAngle ( this unit, float delta = 0f, float radial = 1f ) : System.Vector2

The vector 2 from polar angle.

Vector3FromPolarAngle ( this unit, float delta = 0f, float radial = 1f ) : System.Vector3

The vector 3 from polar angle.

Private Methods

Méthode Description
Init ( ) : void

The initialize.

Method Details

AghanimState() public static méthode

Checks if given hero has AghanimScepter
public static AghanimState ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

AttackBackswing() public static méthode

The attack backswing.
public static AttackBackswing ( this unit ) : double
unit this /// The unit. ///
Résultat double

AttackPoint() public static méthode

The attack point.
public static AttackPoint ( this unit ) : double
unit this /// The unit. ///
Résultat double

AttackRate() public static méthode

The attack rate.
public static AttackRate ( this unit ) : double
unit this /// The unit. ///
Résultat double

BasePredict() public static méthode

The base predict.
public static BasePredict ( this unit, Unit source, float delay, float speed ) : System.Vector3
unit this /// The unit. ///
source Unit /// The source. ///
delay float /// The delay in milliseconds. ///
speed float /// The speed. ///
Résultat System.Vector3

BasePredict() public static méthode

The base predict.
public static BasePredict ( this unit, float delay ) : System.Vector3
unit this /// The unit. ///
delay float /// The delay in milliseconds. ///
Résultat System.Vector3

BestAATarget() public static méthode

The best aa target.
public static BestAATarget ( this unit, float bonusRange ) : Hero
unit this /// The unit. ///
bonusRange float /// The bonus range. ///
Résultat Hero

CanAttack() public static méthode

Checks if given unit is able to attack
public static CanAttack ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

CanCast() public static méthode

Checks if given unit is able to cast spells
public static CanCast ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

CanDie() public static méthode

The can die.
public static CanDie ( this unit, string sourceAbilityName = null, bool ignoreReincarnation = false ) : bool
unit this /// The unit. ///
sourceAbilityName string /// The source ability name. ///
ignoreReincarnation bool /// The ignore reincarnation. ///
Résultat bool

CanMove() public static méthode

Checks if given unit is able to move
public static CanMove ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

CanReincarnate() public static méthode

The can reincarnate.
public static CanReincarnate ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

CanUseItems() public static méthode

Checks if given unit is not muted
public static CanUseItems ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

ClosestToMouseTarget() public static méthode

The closest to mouse target.
public static ClosestToMouseTarget ( this source, float range = 1000 ) : Hero
source this /// The source. ///
range float /// The range. ///
Résultat Hero

DamageTaken() public static méthode

Returns actual damage the unit takes
public static DamageTaken ( this target, float dmg, DamageType dmgType, Unit source, bool throughBKB = false, double minusArmor = 0d, double minusDamageResistancePerc = 0d, double minusMagicResistancePerc = 0d ) : float
target this /// damaged unit ///
dmg float /// amount of damage ///
dmgType DamageType /// Type of damage (Magical/Physical/Pure/Health removal) ///
source Unit /// source of the damage ///
throughBKB bool /// true if the damage pierces magic immunity ///
minusArmor double /// The minus Armor. ///
minusDamageResistancePerc double /// The minus Damage Resistance Percentage. ///
minusMagicResistancePerc double /// The minus Magic Resistance Percentage. ///
Résultat float

DisableTarget() public static méthode

Uses available disable ability which takes least time to hit the target, chains with other disables
public static DisableTarget ( this unit, Unit target ) : bool
unit this /// The unit. ///
target Unit /// The target. ///
Résultat bool

FindItem() public static méthode

The find item.
public static FindItem ( this unit, string name, System.Item &item, bool cache = false ) : System.Item
unit this /// The unit. ///
name string /// The name. ///
item System.Item /// The item. ///
cache bool /// The cache. ///
Résultat System.Item

FindItem() public static méthode

Searches for a item in the units inventory with given name
public static FindItem ( this unit, string name, bool cache = false ) : System.Item
unit this /// The unit. ///
name string /// The name. ///
cache bool /// Store the item and use stored next time (Risk of EntityNotFoundException) ///
Résultat System.Item

FindModifier() public static méthode

The has modifier.
public static FindModifier ( this unit, string modifierName ) : Modifier
unit this /// The unit. ///
modifierName string /// The modifier name. ///
Résultat Modifier

FindRelativeAngle() public static méthode

The find relative angle.
public static FindRelativeAngle ( this unit, System.Vector3 pos ) : float
unit this /// The unit. ///
pos System.Vector3 /// The position. ///
Résultat float

FindRelativeAngle() public static méthode

The find relative angle.
public static FindRelativeAngle ( this unit, System.Vector3 pos, float delta ) : float
unit this /// The unit. ///
pos System.Vector3 /// The pos. ///
delta float /// The alpha. ///
Résultat float

FindSpell() public static méthode

The find spell.
public static FindSpell ( this unit, string name, Ability &spell ) : Ability
unit this /// The unit. ///
name string /// The name. ///
spell Ability /// The spell. ///
Résultat Ability

FindSpell() public static méthode

Returns spell of the unit with given name if it exists
public static FindSpell ( this unit, string name, bool cache = false ) : Ability
unit this /// The unit. ///
name string /// The name. ///
cache bool /// Use cached spell (risk of EntityNotFoundException) ///
Résultat Ability

GetAttackRange() public static méthode

Returns actual attack range of a unit
public static GetAttackRange ( this unit ) : float
unit this /// The unit. ///
Résultat float

GetChanneledAbility() public static méthode

Finds spell/item which is currently being channeled by given unit
public static GetChanneledAbility ( this unit ) : Ability
unit this /// The unit. ///
Résultat Ability

GetDagon() public static méthode

Finds a dagon in the units inventory
public static GetDagon ( this unit ) : System.Item
unit this /// The unit. ///
Résultat System.Item

GetEnemyTeam() public static méthode

Returns Enemy Team of the unit
public static GetEnemyTeam ( this unit ) : Team
unit this /// The unit. ///
Résultat Team

GetLeveledItem() public static méthode

Finds item with given name which has more than 1 level
public static GetLeveledItem ( this unit, string name ) : System.Item
unit this /// The unit. ///
name string /// The name. ///
Résultat System.Item

GetTurnRate() public static méthode

The get turn rate.
public static GetTurnRate ( this unit, bool currentTurnRate = true ) : double
unit this /// The unit. ///
currentTurnRate bool /// The current turn rate. ///
Résultat double

GetTurnTime() public static méthode

Calculates how much time it will take for given unit to turn to another entity
public static GetTurnTime ( this unit, System.Entity entity ) : double
unit this /// The unit. ///
entity System.Entity /// The unit 2. ///
Résultat double

GetTurnTime() public static méthode

Calculates how much time it will take for given unit to turn to given vector
public static GetTurnTime ( this unit, System.Vector3 position ) : double
unit this /// The entity. ///
position System.Vector3 /// The position. ///
Résultat double

HasItem() public static méthode

Returns if the target has the given Item
public static HasItem ( this unit, ClassID classId ) : bool
unit this /// The unit. ///
classId ClassID /// The class Id. ///
Résultat bool

HasModifier() public static méthode

The has modifier.
public static HasModifier ( this unit, string modifierName ) : bool
unit this /// The unit. ///
modifierName string /// The modifier name. ///
Résultat bool

HasModifiers() public static méthode

The has modifiers.
public static HasModifiers ( this unit, string modifierNames, bool hasAll = true ) : bool
unit this /// The unit. ///
modifierNames string /// The modifier names. ///
hasAll bool /// The has all. ///
Résultat bool

InFront() public static méthode

The in front.
public static InFront ( this unit, float distance ) : System.Vector3
unit this /// The unit. ///
distance float /// The distance. ///
Résultat System.Vector3

IsAttackImmune() public static méthode

Checks if unit is immune to auto attack
public static IsAttackImmune ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

IsAttacking() public static méthode

The is attacking.
public static IsAttacking ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

IsChanneling() public static méthode

Checks if unit is currently channeling
public static IsChanneling ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

IsDisarmed() public static méthode

The is disarmed.
public static IsDisarmed ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

IsHexed() public static méthode

The is hexed.
public static IsHexed ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

IsHexed() public static méthode

The is hexed.
public static IsHexed ( this unit, float &hexDuration ) : bool
unit this /// The unit. ///
hexDuration float /// The hex duration. ///
Résultat bool

IsInvisible() public static méthode

The is invisible.
public static IsInvisible ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

IsInvul() public static méthode

The is invulnerable.
public static IsInvul ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

IsInvul() public static méthode

The is invulnerable.
public static IsInvul ( this unit, float &invulnerabilityDuration ) : bool
unit this /// The unit. ///
invulnerabilityDuration float /// The invulnerability duration. ///
Résultat bool

IsLinkensProtected() public static méthode

The is linken protected.
public static IsLinkensProtected ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

IsMagicImmune() public static méthode

The is magic immune.
public static IsMagicImmune ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

IsPurgable() public static méthode

Checks if enemy have a modifier which can be purged
public static IsPurgable ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

IsRooted() public static méthode

The is rooted.
public static IsRooted ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

IsRooted() public static méthode

The is rooted.
public static IsRooted ( this unit, float &rootDuration ) : bool
unit this /// The unit. ///
rootDuration float /// The root duration. ///
Résultat bool

IsSilenced() public static méthode

The is silenced.
public static IsSilenced ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

IsStunned() public static méthode

The is stunned.
public static IsStunned ( this unit ) : bool
unit this /// The unit. ///
Résultat bool

IsStunned() public static méthode

The is stunned.
public static IsStunned ( this unit, float &stunDuration ) : bool
unit this /// The unit. ///
stunDuration float /// The stun duration. ///
Résultat bool

IsUnitState() public static méthode

The is unit state.
public static IsUnitState ( this unit, UnitState state ) : bool
unit this /// The unit. ///
state UnitState /// The state. ///
Résultat bool

IsValidTarget() public static méthode

The is valid target.
public static IsValidTarget ( this unit, float range = float.MaxValue, bool checkTeam = true, System.Vector3 from = newVector3() ) : bool
unit this /// The unit. ///
range float /// The range. ///
checkTeam bool /// The check team. ///
from System.Vector3 /// The from. ///
Résultat bool

ManaBurnDamageTaken() public static méthode

Returns how much mana burn damage given unit receives
public static ManaBurnDamageTaken ( this unit, float burnAmount, double multiplier, DamageType dmgType, Unit source, bool throughBkb = false, double minusArmor = 0d, double minusDamageResistancePerc = 0d, double minusMagicResistancePerc = 0d ) : float
unit this /// The unit. ///
burnAmount float /// The burn Amount. ///
multiplier double /// The multiplier. ///
dmgType DamageType /// The dmg Type. ///
source Unit /// The source. ///
throughBkb bool /// The through Bkb. ///
minusArmor double /// The minus Armor. ///
minusDamageResistancePerc double /// The minus Damage Resistance Perc. ///
minusMagicResistancePerc double /// The minus Magic Resistance Perc. ///
Résultat float

ManaBurnSpellDamageTaken() public static méthode

The mana burn spell damage taken.
public static ManaBurnSpellDamageTaken ( this unit, float burnAmount, double multiplier, DamageType dmgType, Unit source, string spellName, bool throughBkb = false, double minusArmor = 0d, double minusDamageResistancePerc = 0d, double minusMagicResistancePerc = 0d ) : float
unit this /// The unit. ///
burnAmount float /// The burn amount. ///
multiplier double /// The multiplier. ///
dmgType DamageType /// The dmg type. ///
source Unit /// The source. ///
spellName string /// The spell name. ///
throughBkb bool /// The through bkb. ///
minusArmor double /// The minus armor. ///
minusDamageResistancePerc double /// The minus damage resistance perc. ///
minusMagicResistancePerc double /// The minus magic resistance perc. ///
Résultat float

Predict() public static méthode

Returns predicted location of a unit after given milliseconds
public static Predict ( this unit, float delay ) : System.Vector3
unit this /// The unit. ///
delay float /// The delay. ///
Résultat System.Vector3

ProjectileSpeed() public static méthode

The projectile speed.
public static ProjectileSpeed ( this unit ) : double
unit this /// The unit. ///
Résultat double

SilenceTarget() public static méthode

Uses available silence ability which takes least time to hit the target, chains with disables
public static SilenceTarget ( this unit, Unit target ) : bool
unit this /// The unit. ///
target Unit /// The target. ///
Résultat bool

SlowTarget() public static méthode

Uses available slow ability which takes least time to hit the target, chains with other disables
public static SlowTarget ( this unit, Unit target ) : bool
unit this /// The unit. ///
target Unit /// The target. ///
Résultat bool

SpellDamageTaken() public static méthode

The spell damage taken.
public static SpellDamageTaken ( this target, float dmg, DamageType dmgType, Unit source, string spellName, bool throughBKB = false, double minusArmor = 0d, double minusDamageResistancePerc = 0d, double minusMagicResistancePerc = 0d ) : float
target this /// The target. ///
dmg float /// The dmg. ///
dmgType DamageType /// The dmg type. ///
source Unit /// The source. ///
spellName string /// The spell name. ///
throughBKB bool /// The through bkb. ///
minusArmor double /// The minus armor. ///
minusDamageResistancePerc double /// The minus damage resistance perc. ///
minusMagicResistancePerc double /// The minus magic resistance perc. ///
Résultat float

Vector2FromPolarAngle() public static méthode

The vector 2 from polar angle.
public static Vector2FromPolarAngle ( this unit, float delta = 0f, float radial = 1f ) : System.Vector2
unit this /// The unit. ///
delta float /// The delta. ///
radial float /// The radial. ///
Résultat System.Vector2

Vector3FromPolarAngle() public static méthode

The vector 3 from polar angle.
public static Vector3FromPolarAngle ( this unit, float delta = 0f, float radial = 1f ) : System.Vector3
unit this /// The unit. ///
delta float /// The delta. ///
radial float /// The radial. ///
Résultat System.Vector3