CDOTA_BaseNPC extends CBaseFlex
s
c
#
AddAbility(abilityNamestring): CDOTABaseAbility
s
c
#

Add an ability to this unit by name.
AddActivityModifier(namestring): nil
s
c
#

  • name - The name of the activity modifier to add, e.g. 'haste'.
  • Add an activity modifier that affects future StartGesture calls.
    AddItem(itemCDOTA_Item): CDOTA_Item
    s
    c
    #

    Add an item to this unit's inventory.
    AddItemByName(itemNamestring): CDOTA_Item
    s
    c
    #

    Add an item to this unit's inventory.
    AddNewModifier(casterCDOTA_BaseNPC | nil, abilityCDOTABaseAbility | nil, modifierNamestring, modifierTabletable | nil): CDOTA_Buff
    s
    c
    #

    Add a modifier to this unit.
    AddNoDraw(): nil
    s
    c
    #

    Adds the no draw flag.
    AddSpeechBubble(bubbleint, speechstring, durationfloat, unOffsetXuint, unOffsetYuint): nil
    s
    c
    #

    Add a speech bubble(1-4 live at a time) to this NPC.
    AlertNearbyUnits(attackerCDOTA_BaseNPC, abilityCDOTABaseAbility): nil
    s
    c
    #
    AngerNearbyUnits(): nil
    s
    c
    #
    AttackNoEarlierThan(timefloat): nil
    s
    c
    #
    AttackReady(): bool
    s
    c
    #
    BoundingRadius2D(): float
    s
    c
    #
    CanEntityBeSeenByMyTeam(entityCDOTA_BaseNPC): bool
    s
    c
    #

    Check FoW to see if an entity is visible.
    CanSellItems(): bool
    s
    c
    #

    Query if this unit can sell items.
    CastAbilityImmediately(abilityCDOTABaseAbility, playerIndexint): nil
    s
    c
    #

    Cast an ability immediately.
    CastAbilityNoTarget(abilityCDOTABaseAbility, playerIndexint): nil
    s
    c
    #

    Cast an ability with no target.
    CastAbilityOnPosition(positionVector, abilityCDOTABaseAbility, playerIndexint): nil
    s
    c
    #

    Cast an ability on a position.
    CastAbilityOnTarget(targetCDOTA_BaseNPC, abilityCDOTABaseAbility, playerIndexint): nil
    s
    c
    #

    Cast an ability on a target entity.
    CastAbilityToggle(abilityCDOTABaseAbility, playerIndexint): nil
    s
    c
    #

    Toggle an ability.
    ClearActivityModifiers(): nil
    s
    c
    #

    Clear Activity modifiers.
    DestroyAllSpeechBubbles(): nil
    s
    c
    #
    DisassembleItem(itemCDOTA_Item): nil
    s
    c
    #

    Disassemble the passed item in this unit's inventory.
    DropItemAtPosition(destVector, itemCDOTA_Item): nil
    s
    c
    #

    Drop an item at a given point.
    DropItemAtPositionImmediate(itemCDOTA_Item, positionVector): nil
    s
    c
    #

    Immediately drop a carried item at a given position.
    EjectItemFromStash(itemCDOTA_Item): nil
    s
    c
    #

    Drops the selected item out of this unit's stash.
    FaceTowards(targetVector): nil
    s
    c
    #

    This unit will be set to face the target point.
    FadeGesture(activityGameActivity_t): nil
    s
    c
    #

    Fade and remove the given gesture activity.
    FindAbilityByName(abilityNamestring): CDOTABaseAbility | nil
    s
    c
    #

    Retrieve an ability by name from the unit.
    FindAllModifiers(): [CDOTA_Buff]
    s
    c
    #

    Returns a table of all of the modifiers on the NPC.
    FindAllModifiersByName(modifierNamestring): [CDOTA_Buff]
    s
    c
    #

    Returns a table of all of the modifiers on the NPC with the passed name (modifierName).
    FindItemInInventory(itemNamestring): CDOTA_Item | nil
    s
    c
    #

    Get handle to first item in inventory, else nil.
    FindModifierByName(modifierNamestring): CDOTA_Buff | nil
    s
    c
    #

    Return a handle to the modifier of the given name if found, else nil (string Name ).
    FindModifierByNameAndCaster(modifierNamestring, casterCDOTA_BaseNPC): CDOTA_Buff | nil
    s
    c
    #

    Return a handle to the modifier of the given name from the passed caster if found, else nil.
    ForceKill(reincarnatebool): nil
    s
    c
    #

    Kill this unit immediately.
    ForcePlayActivityOnce(activityGameActivity_t): nil
    s
    c
    #

    Play an activity once, and then go back to idle.
    GetAbilityByIndex(indexint): CDOTABaseAbility | nil
    s
    c
    #

    Retrieve an ability by index from the unit.
    GetAbilityCount(): int
    s
    c
    #
    GetAcquisitionRange(): float
    s
    c
    #

    Gets the range at which this unit will auto-acquire.
    GetAdditionalBattleMusicWeight(): float
    s
    c
    #

    Combat involving this creature will have this weight added to the music calcuations.
    GetAggroTarget(): CDOTA_BaseNPC | nil
    s
    c
    #

    Returns this unit's aggro target.
    GetAttackAnimationPoint(): float
    s
    c
    #
    GetAttackCapability(): DOTAUnitAttackCapability_t
    s
    c
    #
    GetAttackDamage(): int
    s
    c
    #

    Returns a random integer between the minimum and maximum base damage of the unit.
    GetAttackRangeBuffer(): float
    s
    c
    #

    Gets the attack range buffer.
    GetAttackSpeed(): float
    s
    c
    #
    GetAttacksPerSecond(): float
    s
    c
    #
    GetAttackTarget(): CDOTA_BaseNPC | nil
    s
    c
    #
    GetAverageTrueAttackDamage(targetCDOTA_BaseNPC | nil): int
    s
    c
    #

    Returns the average value of the minimum and maximum damage values.
    GetBaseAttackRange(): int
    s
    c
    #
    GetBaseAttackTime(): float
    s
    c
    #
    GetBaseDamageMax(): int
    s
    c
    #

    Get the maximum attack damage of this unit.
    GetBaseDamageMin(): int
    s
    c
    #

    Get the minimum attack damage of this unit.
    GetBaseDayTimeVisionRange(): int
    s
    c
    #

    Returns the vision range before modifiers.
    GetBaseHealthRegen(): float
    s
    c
    #
    GetBaseMagicalResistanceValue(): float
    s
    c
    #

    Returns base magical armor value.
    GetBaseMaxHealth(): float
    s
    c
    #

    Gets the base max health value.
    GetBaseMoveSpeed(): float
    s
    c
    #
    GetBaseNightTimeVisionRange(): int
    s
    c
    #

    Returns the vision range after modifiers.
    GetBonusManaRegen(): float
    s
    c
    #

    This Mana regen is derived from constant bonuses like Basilius.
    GetCastPoint(attackbool): float
    s
    c
    #
    GetCastRangeBonus(): float
    s
    c
    #
    GetCloneSource(): CDOTA_BaseNPC | nil
    s
    c
    #

    Get clone source (Meepo Prime, if this is a Meepo).
    GetCollisionPadding(): float
    s
    c
    #

    Returns the size of the collision padding around the hull.
    GetCooldownReduction(): float
    s
    c
    #
    GetCreationTime(): float
    s
    c
    #
    GetCurrentActiveAbility(): CDOTABaseAbility | nil
    s
    c
    #

    Get the ability this unit is currently casting.
    GetCurrentVisionRange(): int
    s
    c
    #

    Gets the current vision range.
    GetCursorCastTarget(): CDOTA_BaseNPC | nil
    s
    c
    #
    GetCursorPosition(): Vector
    s
    c
    #
    GetCursorTargetingNothing(): bool
    s
    c
    #
    GetDayTimeVisionRange(): int
    s
    c
    #

    Returns the vision range after modifiers.
    GetDeathXP(): int
    s
    c
    #

    Get the XP bounty on this unit.
    GetDisplayAttackSpeed(): float
    s
    c
    #

    Attack speed expressed as constant value.
    GetEvasion(): float
    s
    c
    #
    GetForceAttackTarget(): CDOTA_BaseNPC | nil
    s
    c
    #
    GetGoldBounty(): int
    s
    c
    #

    Get the gold bounty on this unit.
    GetHasteFactor(): float
    s
    c
    #
    GetHealthDeficit(): int
    s
    c
    #

    Returns integer amount of health missing from max.
    GetHealthPercent(): int
    s
    c
    #

    Get the current health percent of the unit.
    GetHealthRegen(): float
    s
    c
    #
    GetHullRadius(): float
    s
    c
    #

    Get the collision hull radius of this NPC.
    GetIdealSpeed(): float
    s
    c
    #

    Returns speed after all modifiers.
    GetIdealSpeedNoSlows(): float
    s
    c
    #

    Returns speed after all modifiers, but excluding those that reduce speed.
    GetIncreasedAttackSpeed(): float
    s
    c
    #
    GetInitialGoalEntity(): CBaseEntity | nil
    s
    c
    #

    Returns the initial waypoint goal for this NPC.
    GetInitialGoalPosition(): Vector
    s
    c
    #

    Get waypoint position for this NPC.
    GetItemInSlot(slotint): CDOTA_Item | nil
    s
    c
    #

    Returns nth item in inventory slot (index is zero based).
    GetLastAttackTime(): float
    s
    c
    #
    GetLastDamageTime(): float
    s
    c
    #

    Get the last time this NPC took damage.
    GetLastIdleChangeTime(): float
    s
    c
    #

    Get the last game time that this unit switched to/from idle state.
    GetLevel(): int
    s
    c
    #

    Returns the level of this unit.
    GetMagicalArmorValue(): float
    s
    c
    #

    Returns current magical armor value.
    GetMainControllingPlayer(): int
    s
    c
    #

    Returns the player ID of the controlling player.
    GetMana(): float
    s
    c
    #

    Get the mana on this unit.
    GetManaPercent(): int
    s
    c
    #

    Get the percent of mana remaining.
    GetManaRegen(): float
    s
    c
    #
    GetMaximumGoldBounty(): int
    s
    c
    #

    Get the maximum gold bounty for this unit.
    GetMaxMana(): float
    s
    c
    #

    Get the maximum mana of this unit.
    GetMinimumGoldBounty(): int
    s
    c
    #

    Get the minimum gold bounty for this unit.
    GetModelRadius(): float
    s
    c
    #
    GetModifierCount(): int
    s
    c
    #

    How many modifiers does this unit have?
    GetModifierNameByIndex(indexint): string
    s
    c
    #

    Get a modifier name by index.
    GetModifierStackCount(modifierNamestring, casterCDOTA_BaseNPC): int
    s
    c
    #

    Gets the stack count of a given modifier.
    GetMoveSpeedModifier(baseSpeedfloat, returnUnslowedbool): float
    s
    c
    #
    GetMustReachEachGoalEntity(): bool
    s
    c
    #

    Set whether this NPC is required to reach each goal entity, rather than being allowed to unkink their path.
    GetNeverMoveToClearSpace(): bool
    s
    c
    #

    If set to true, we will never attempt to move this unit to clear space, even when it unphases.
    GetNightTimeVisionRange(): int
    s
    c
    #

    Returns the vision range after modifiers.
    GetOpposingTeamNumber(): DOTATeam_t
    s
    c
    #
    GetPaddedCollisionRadius(): float
    s
    c
    #

    Get the collision hull radius (including padding) of this NPC.
    GetPhysicalArmorBaseValue(): float
    s
    c
    #

    Returns base physical armor value.
    GetPhysicalArmorValue(ignoreBasebool): float
    s
    c
    #

    Returns current physical armor value.
    GetPlayerOwner(): CDOTAPlayer
    s
    c
    #

    Returns the player that owns this unit.
    GetPlayerOwnerID(): PlayerID
    s
    c
    #

    Get the owner player ID for this unit.
    GetProjectileSpeed(): int
    s
    c
    #
    GetRangedProjectileName(): string
    s
    c
    #
    GetRangeToUnit(npcCDOTA_BaseNPC): float
    s
    c
    #
    GetSecondsPerAttack(): float
    s
    c
    #
    GetSpellAmplification(baseOnlybool): float
    s
    c
    #
    GetStatusResistance(): float
    s
    c
    #
    GetTotalPurchasedUpgradeGoldCost(): int
    s
    c
    #

    Get how much gold has been spent on ability upgrades.
    GetUnitLabel(): string
    s
    c
    #
    GetUnitName(): string
    s
    c
    #

    Get the name of this unit.
    GiveMana(manafloat): nil
    s
    c
    #

    Give mana to this unit, this can be used for mana gained by abilities or item usage.
    HasAbility(abilityNamestring): bool
    s
    c
    #

    See whether this unit has an ability by name.
    HasAnyActiveAbilities(): bool
    s
    c
    #
    HasAttackCapability(): bool
    s
    c
    #
    HasFlyingVision(): bool
    s
    c
    #
    HasFlyMovementCapability(): bool
    s
    c
    #
    HasGroundMovementCapability(): bool
    s
    c
    #
    HasInventory(): bool
    s
    c
    #

    Does this unit have an inventory.
    HasItemInInventory(itemNamestring): bool
    s
    c
    #

    See whether this unit has an item by name.
    HasModifier(scriptNamestring): bool
    s
    c
    #

    Sees if this unit has a given modifier.
    HasMovementCapability(): bool
    s
    c
    #
    HasScepter(): bool
    s
    c
    #
    Heal(amountfloat, inflictorCDOTABaseAbility | nil): nil
    s
    c
    #

    Heal this unit.
    Hold(): nil
    s
    c
    #

    Hold position.
    Interrupt(): nil
    s
    c
    #
    InterruptChannel(): nil
    s
    c
    #
    InterruptMotionControllers(findClearSpacebool): nil
    s
    c
    #
    IsAlive(): bool
    s
    c
    #

    Is this unit alive?
    IsAncient(): bool
    s
    c
    #

    Is this unit an Ancient?
    IsAttackImmune(): bool
    s
    c
    #
    IsAttacking(): bool
    s
    c
    #
    IsAttackingEntity(entityCDOTA_BaseNPC): bool
    s
    c
    #
    IsBarracks(): bool
    s
    c
    #

    Is this unit a Barracks?
    IsBlind(): bool
    s
    c
    #
    IsBlockDisabled(): bool
    s
    c
    #
    IsBoss(): bool
    s
    c
    #

    Is this unit a boss?
    IsBuilding(): bool
    s
    c
    #

    Is this unit a building?
    IsChanneling(): bool
    s
    c
    #

    Is this unit currently channeling a spell?
    IsClone(): bool
    s
    c
    #

    Is this unit a clone? (Meepo).
    IsCommandRestricted(): bool
    s
    c
    #
    IsConsideredHero(): bool
    s
    c
    #

    Is this unit a considered a hero for targeting purposes?
    IsControllableByAnyPlayer(): bool
    s
    c
    #

    Is this unit controlled by any non-bot player?
    IsCourier(): bool
    s
    c
    #

    Is this unit a courier?
    IsCreature(): bool
    s
    c
    #

    Is this a Creature type NPC?
    IsCreep(): bool
    s
    c
    #

    Is this unit a creep?
    IsDeniable(): bool
    s
    c
    #
    IsDisarmed(): bool
    s
    c
    #
    IsDominated(): bool
    s
    c
    #
    IsEvadeDisabled(): bool
    s
    c
    #
    IsFort(): bool
    s
    c
    #

    Is this unit an Ancient?
    IsFrozen(): bool
    s
    c
    #
    IsHero(): bool
    s
    c
    #

    Is this a hero or hero illusion?
    IsHexed(): bool
    s
    c
    #
    IsIdle(): bool
    s
    c
    #

    Is this creature currently idle?
    IsIllusion(): bool
    s
    c
    #
    IsInRangeOfShop(shopTypeDOTA_SHOP_TYPE, physicalbool): bool
    s
    c
    #

    Ask whether this unit is in range of the specified shop.
    IsInventoryEnabled(): bool
    s
    c
    #

    Does this unit have an inventory.
    IsInvisible(): bool
    s
    c
    #
    IsInvulnerable(): bool
    s
    c
    #
    IsLowAttackPriority(): bool
    s
    c
    #
    IsMagicImmune(): bool
    s
    c
    #
    IsMovementImpaired(): bool
    s
    c
    #
    IsMoving(): bool
    s
    c
    #

    Is this unit moving?
    IsMuted(): bool
    s
    c
    #
    IsNeutralUnitType(): bool
    s
    c
    #

    Is this a neutral?
    IsNightmared(): bool
    s
    c
    #
    IsOpposingTeam(teamDOTATeam_t): bool
    s
    c
    #
    IsOther(): bool
    s
    c
    #

    Is this unit a ward-type unit?
    IsOutOfGame(): bool
    s
    c
    #
    IsOwnedByAnyPlayer(): bool
    s
    c
    #

    Is this unit owned by any non-bot player?
    IsPhantom(): bool
    s
    c
    #

    Is this a phantom unit?
    IsPhantomBlocker(): bool
    s
    c
    #
    IsPhased(): bool
    s
    c
    #
    IsPositionInRange(positionVector, rangefloat): bool
    s
    c
    #
    IsRangedAttacker(): bool
    s
    c
    #

    Is this unit a ranged attacker?
    IsRealHero(): bool
    s
    c
    #

    Is this a real hero?
    IsRooted(): bool
    s
    c