@moddota/dota-lua-types
Version:
TypeScript definitions for Dota 2 Lua API
1,854 lines (1,798 loc) • 304 kB
TypeScript
/** @noSelfInFile */
// @validateApiUsageDefault server
/** @both */
declare const CBaseAnimatingActivity: DotaConstructor<CBaseAnimatingActivity>;
declare interface CBaseAnimatingActivity extends CBaseModelEntity {
/**
* Returns the duration in seconds of the active sequence.
*/
ActiveSequenceDuration(): number;
/**
* Get the cycle of the animation.
*/
GetCycle(): number;
/**
* Returns the name of the active sequence.
*/
GetSequence(): string;
/**
* Ask whether the main sequence is done playing.
*/
IsSequenceFinished(): boolean;
/**
* Sets the active sequence by name, resetting the current cycle.
*/
ResetSequence(sequenceName: string): void;
/**
* Returns the duration in seconds of the given sequence name.
*/
SequenceDuration(sequenceName: string): number;
/**
* Set the cycle of the animation.
*/
SetCycle(cycle: number): void;
/**
* Set the specified pose parameter to the specified value.
*/
SetPoseParameter(name: string, value: number): number;
/**
* Sets the active sequence by name, keeping the current cycle.
*/
SetSequence(sequenceName: string): void;
/**
* Stop the current animation by setting playback rate to 0.0.
*/
StopAnimation(): void;
__kind__: 'instance';
}
/** @both */
declare const CBaseAnimGraph: DotaConstructor<CBaseAnimGraph>;
declare interface CBaseAnimGraph extends CBaseModelEntity {
/**
* Get the value of the given animGraph parameter.
*/
GetGraphParameter(param: string): object;
/**
* Pass the desired look target in world space to the graph.
*/
SetGraphLookTarget(value: Vector): void;
/**
* Set the specific param value, type is inferred from the type in script.
*/
SetGraphParameter(param: string, svArg: object): void;
/**
* Set the specific param on or off.
*/
SetGraphParameterBool(name: string, value: boolean): void;
/**
* Pass the enum (int) value to the specified param.
*/
SetGraphParameterEnum(name: string, value: number): void;
/**
* Pass the float value to the specified param.
*/
SetGraphParameterFloat(name: string, value: number): void;
/**
* Pass the int value to the specified param.
*/
SetGraphParameterInt(name: string, value: number): void;
/**
* Pass the vector value to the specified param in the graph.
*/
SetGraphParameterVector(name: string, value: Vector): void;
__kind__: 'instance';
}
declare const CBaseCombatCharacter: DotaConstructor<CBaseCombatCharacter>;
/** @client */
declare const C_BaseCombatCharacter: typeof CBaseCombatCharacter;
declare interface CBaseCombatCharacter extends CBaseFlex {
__kind__: 'instance';
}
declare const CBaseEntity: DotaConstructor<CBaseEntity>;
/** @client */
declare const C_BaseEntity: typeof CBaseEntity;
declare interface CBaseEntity extends CEntityInstance {
/**
* Adds the render effect flag.
*/
AddEffects(flags: EntityEffects): void;
/**
* Apply a Velocity Impulse.
*/
ApplyAbsVelocityImpulse(vecImpulse: Vector): void;
/**
* Apply an Ang Velocity Impulse.
*/
ApplyLocalAngularVelocityImpulse(angImpulse: Vector): void;
/**
* Get float value for an entity attribute.
*/
Attribute_GetFloatValue(name: string, defaultValue: number): number;
/**
* Get int value for an entity attribute.
*/
Attribute_GetIntValue(name: string, defaultValue: number): number;
/**
* Set float value for an entity attribute.
*/
Attribute_SetFloatValue(name: string, value: number): void;
/**
* Set int value for an entity attribute.
*/
Attribute_SetIntValue(name: string, value: number): void;
/**
* Delete an entity attribute.
*/
DeleteAttribute(name: string): void;
/**
* Plays a sound from this entity.
*/
EmitSound(soundname: string): void;
/**
* Plays/modifies a sound from this entity. changes sound if nPitch and/or flVol
* or flSoundTime is > 0.
*/
EmitSoundParams(soundName: string, pitch: number, volume: number, delay: number): void;
/**
* Get the qangles that this entity is looking at.
*/
EyeAngles(): QAngle;
/**
* Get vector to eye position - absolute coords.
*/
EyePosition(): Vector;
FirstMoveChild(): CBaseEntity;
FollowEntity(entity: CBaseEntity, boneMerge: boolean): void;
/**
* HEntity to follow, string BoneOrAttachName.
*/
FollowEntityMerge(ent: object, boneOrAttachName: string): void;
/**
* Returns a table containing the criteria that would be used for response queries
* on this entity. This is the same as the table that is passed to response rule
* script function callbacks.
*/
GatherCriteria(result: object): void;
/** @both */
GetAbsOrigin(): Vector;
GetAbsScale(): number;
GetAngles(): QAngle;
/**
* Get entity pitch, yaw, roll as a vector.
*/
GetAnglesAsVector(): Vector;
/**
* Get the local angular velocity - returns a vector of pitch,yaw,roll.
*/
GetAngularVelocity(): Vector;
/**
* Get Base? velocity.
*/
GetBaseVelocity(): Vector;
/**
* Get a vector containing max bounds, centered on object.
*/
GetBoundingMaxs(): Vector;
/**
* Get a vector containing min bounds, centered on object.
*/
GetBoundingMins(): Vector;
/**
* Get a table containing the 'Mins' & 'Maxs' vector bounds, centered on object.
*/
GetBounds(): EntityBounds;
/**
* Get vector to center of object - absolute coords.
*/
GetCenter(): Vector;
/**
* Get the entities parented to this entity.
*/
GetChildren(): CBaseEntity[];
/**
* Looks up a context and returns it if available. May return string, float, or
* null (if the context isn't found).
*/
GetContext(name: string): string | number | undefined;
/**
* Get the forward vector of the entity.
*/
GetForwardVector(): Vector;
/**
* Get the health of this entity.
*
* @both
*/
GetHealth(): number;
/**
* Get the left vector of the entity.
*/
GetLeftVector(): Vector;
/**
* Get entity local pitch, yaw, roll as a QAngle.
*/
GetLocalAngles(): QAngle;
/**
* Maybe local angvel.
*/
GetLocalAngularVelocity(): QAngle;
/**
* Get entity local origin as a Vector.
*/
GetLocalOrigin(): Vector;
GetLocalScale(): number;
/**
* Get Entity relative velocity.
*/
GetLocalVelocity(): Vector;
/**
* Get the mass of an entity. (returns 0 if it doesn't have a physics object).
*/
GetMass(): number;
/**
* Get the maximum health of this entity.
*
* @both
*/
GetMaxHealth(): number;
/**
* Returns the name of the model.
*/
GetModelName(): string;
/**
* If in hierarchy, retrieves the entity's parent.
*/
GetMoveParent(): CBaseEntity;
GetOrigin(): Vector;
/**
* Gets this entity's owner.
*/
GetOwner(): CBaseEntity;
/**
* Get the owner entity, if there is one.
*/
GetOwnerEntity(): CBaseEntity;
/**
* Get the right vector of the entity. WARNING: This produces a left-handed
* coordinate system. Use GetLeftVector instead (which is aligned with the y axis
* of the entity).
*/
GetRightVector(): Vector;
/**
* If in hierarchy, walks up the hierarchy to find the root parent.
*/
GetRootMoveParent(): CBaseEntity;
/**
* Returns float duration of the sound. Takes soundname and optional
* actormodelname.
*/
GetSoundDuration(soundname: string, actormodel: string): number;
/**
* Returns the spawn group handle of this entity.
*/
GetSpawnGroupHandle(): SpawnGroupHandle;
/**
* Get the team number of this entity.
*/
GetTeam(): DOTATeam_t;
/**
* Get the team number of this entity.
*
* @both
*/
GetTeamNumber(): DOTATeam_t;
/**
* Get the up vector of the entity.
*/
GetUpVector(): Vector;
GetVelocity(): Vector;
/**
* See if an entity has a particular attribute.
*/
HasAttribute(name: string): boolean;
/**
* Is this entity alive?
*/
IsAlive(): boolean;
/**
* Is this entity an CDOTA_BaseNPC?
*
* @both
*/
IsBaseNPC(): this is CDOTA_BaseNPC;
/**
* Is this entity a Dota NPC?
*/
IsDOTANPC(): boolean;
/** @both */
IsInstance<T extends CBaseEntity>(classOrClassName: DotaConstructor<T>): this is T;
/**
* Is this entity an CAI_BaseNPC?
*/
IsNPC(): boolean;
/**
* Back compat: Is this entity a player pawn *or* controller?
*/
IsPlayer(): this is CDOTAPlayerController;
/**
* Is this entity a player controller?
*/
IsPlayerController(): this is CDOTAPlayerController;
/**
* Is this entity a player pawn?
*/
IsPlayerPawn(): this is CBasePlayerPawn;
Kill(): void;
NextMovePeer(): CBaseEntity;
/**
* Precache a sound for later playing.
*/
PrecacheScriptSound(soundname: string): void;
/**
* Removes the render effect flag.
*/
RemoveEffects(flags: EntityEffects): void;
/**
* Set entity pitch, yaw, roll by component.
*/
SetAbsAngles(pitch: number, yaw: number, roll: number): void;
SetAbsOrigin(origin: Vector): void;
SetAbsScale(scale: number): void;
/**
* Set entity pitch, yaw, roll by component.
*/
SetAngles(pitch: number, yaw: number, roll: number): void;
/**
* Set the local angular velocity.
*/
SetAngularVelocity(pitchVel: number, yawVel: number, rollVel: number): void;
/**
* Set the position of the constraint.
*/
SetConstraint(pos: Vector): void;
/**
* Store any key/value pair in this entity's dialog contexts. Value must be a
* string. Will last for duration (set 0 to mean 'forever').
*/
SetContext(name: string, value: string, duration: number): void;
/**
* Store any key/value pair in this entity's dialog contexts. Value must be a
* number (int or float). Will last for duration (set 0 to mean 'forever').
*/
SetContextNum(name: string, value: number, duration: number): void;
/**
* Set a think function on this entity.
*
* @both
*/
SetContextThink(
contextName: string,
thinkFunc: ((this: this) => number | undefined) | undefined,
interval: number,
): void;
/**
* Set the name of an entity.
*/
SetEntityName(name: string): void;
/**
* Set the orientation of the entity to have this forward vector.
*/
SetForwardVector(v: Vector): void;
/**
* Set PLAYER friction, ignored for objects.
*/
SetFriction(friction: number): void;
/**
* Set PLAYER gravity, ignored for objects.
*/
SetGravity(gravity: number): void;
/**
* Set the health of this entity.
*/
SetHealth(health: number): void;
/**
* Set entity local pitch, yaw, roll by component.
*/
SetLocalAngles(pitch: number, yaw: number, roll: number): void;
/**
* Set entity local origin from a Vector.
*/
SetLocalOrigin(origin: Vector): void;
SetLocalScale(scale: number): void;
/**
* Set the mass of an entity. (does nothing if it doesn't have a physics object).
*/
SetMass(mass: number): void;
/**
* Set the maximum health of this entity.
*/
SetMaxHealth(amt: number): void;
SetOrigin(v: Vector): void;
/**
* Sets this entity's owner. This entity will be returned by GetOwner() and
* GetOwnerEntity(). GetPlayerOwner() and GetPlayerOwnerID() will be automatically
* inferred from this entity.
*/
SetOwner(owner: CBaseEntity): void;
/**
* Set the parent for this entity.
*/
SetParent(parent: CBaseEntity, attachmentname: string): void;
SetTeam(teamNum: DOTATeam_t): void;
/**
* Set a think function on this entity. Uses `CBaseEntity:SetContextThink`
* internally.
*
* Note: optional parameters can be given in any order.
*
* @param functionName If `context` is provided, think function would perform a
* dynamic lookup on `context` table. Otherwise searches for
* that function name in caller scope.
* @param contextName Defaults to `functionName` if it's a string.
* @param initialDelay Defaults to 0 (next game frame).
* @both
*/
SetThink(
functionName: ((entity: CBaseEntity) => number | undefined) | string,
context: object | undefined,
contextName: string | undefined,
initialDelay: number | undefined,
): void;
SetVelocity(vecVelocity: Vector): void;
/**
* Stops a named sound playing from this entity.
*/
StopSound(soundname: string): void;
/**
* Stops thinker created with `CBaseEntity.SetThink`.
*
* Alias for `CBaseEntity:SetContextThink(contextName, nil, 0)`.
*
* @both
*/
StopThink(contextName: string): void;
/**
* Apply damage to this entity. Use CreateDamageInfo() to create a damageinfo
* object.
*/
TakeDamage(damageInfo: CTakeDamageInfo): number;
/**
* Returns the input Vector transformed from entity to world space.
*/
TransformPointEntityToWorld(point: Vector): Vector;
/**
* Returns the input Vector transformed from world to entity space.
*/
TransformPointWorldToEntity(point: Vector): Vector;
/**
* Fires off this entity's OnTrigger responses.
*/
Trigger(): void;
/**
* Validates the private script scope and creates it if one doesn't exist.
*/
ValidatePrivateScriptScope(): void;
__kind__: 'instance';
}
declare const CBaseFlex: DotaConstructor<CBaseFlex>;
/** @client */
declare const C_BaseFlex: typeof CBaseFlex;
declare interface CBaseFlex extends CBaseAnimatingActivity {
/**
* Returns the instance of the oldest active scene entity (if any).
*/
GetCurrentScene(): CSceneEntity | undefined;
/**
* Returns the instance of the scene entity at the specified index.
*/
GetSceneByIndex(index: number): CSceneEntity | undefined;
/**
* Play specified vcd file.
*/
ScriptPlayScene(scene: string, delay: number): number;
__kind__: 'instance';
}
declare const CBaseModelEntity: DotaConstructor<CBaseModelEntity>;
/** @client */
declare const C_BaseModelEntity: typeof CBaseModelEntity;
declare interface CBaseModelEntity extends CBaseEntity {
/**
* Get the attachment id's angles as a p,y,r vector.
*/
GetAttachmentAngles(attachment: number): Vector;
/**
* Get the attachment id's forward vector.
*/
GetAttachmentForward(attachment: number): Vector;
/**
* Get the attachment id's origin vector.
*/
GetAttachmentOrigin(attachment: number): Vector;
/**
* Get the material group hash of this entity.
*/
GetMaterialGroupHash(): number;
/**
* Get the mesh group mask of this entity.
*/
GetMaterialGroupMask(): Uint64;
/**
* Get scale of entity's model.
*/
GetModelScale(): number;
/**
* Get the alpha modulation of this entity.
*
* @both
*/
GetRenderAlpha(): number;
/**
* Get the render color of the entity.
*/
GetRenderColor(): Vector;
/**
* Get the named attachment id.
*/
ScriptLookupAttachment(attachmentName: string): number;
/**
* Sets a bodygroup.
*/
SetBodygroup(bodyGroup: number, choice: number): void;
/**
* Sets a bodygroup by name.
*/
SetBodygroupByName(name: string, value: number): void;
/**
* Set the material group of this entity.
*/
SetMaterialGroup(materialGroup: string): void;
/**
* Set the material group hash of this entity.
*/
SetMaterialGroupHash(hash: number): void;
/**
* Set the mesh group mask of this entity.
*/
SetMaterialGroupMask(meshGroupMask: Uint64): void;
SetModel(modelName: string): void;
/**
* Set scale of entity's model.
*/
SetModelScale(scale: number): void;
/**
* Set the alpha modulation of this entity.
*/
SetRenderAlpha(alpha: number): void;
/**
* Sets the render color of the entity.
*/
SetRenderColor(r: number, g: number, b: number): void;
/**
* Sets the render mode of the entity.
*/
SetRenderMode(mode: number): void;
/**
* Set a single mesh group for this entity.
*/
SetSingleMeshGroup(meshGroupName: string): void;
SetSize(mins: Vector, maxs: Vector): void;
SetSkin(skin: number): void;
__kind__: 'instance';
}
declare const CBasePlayerController: DotaConstructor<CBasePlayerController>;
declare interface CBasePlayerController extends CBaseEntity {
/**
* Returns the pawn for this controller.
*/
GetPawn(): object;
__kind__: 'instance';
}
declare const CBasePlayerPawn: DotaConstructor<CBasePlayerPawn>;
declare interface CBasePlayerPawn extends CBaseCombatCharacter {
/**
* Returns the controller for this pawn.
*/
GetController(): object;
/**
* Returns an array of all the equipped weapons.
*/
GetEquippedWeapons(): object;
/**
* Gets the number of weapons currently equipped.
*/
GetWeaponCount(): number;
/**
* Returns true if the player is in noclip mode.
*/
IsNoclipping(): boolean;
__kind__: 'instance';
}
declare const CBaseTrigger: DotaConstructor<CBaseTrigger>;
declare interface CBaseTrigger extends CBaseEntity {
/**
* Disable's the trigger.
*/
Disable(): void;
/**
* Enable the trigger.
*/
Enable(): void;
/**
* Checks whether the passed entity is touching the trigger.
*/
IsTouching(ent: CBaseEntity): boolean;
__kind__: 'instance';
}
/** @both */
declare const CBodyComponent: DotaConstructor<CBodyComponent>;
declare interface CBodyComponent {
/**
* Apply an impulse at a worldspace position to the physics.
*
* @both
*/
AddImpulseAtPosition(arg1: Vector, arg2: Vector): void;
/**
* Add linear and angular velocity to the physics object.
*
* @both
*/
AddVelocity(arg1: Vector, arg2: Vector): void;
/**
* Detach from its parent.
*
* @both
*/
DetachFromParent(): void;
/**
* Is attached to parent.
*
* @both
*/
IsAttachedToParent(): boolean;
/** @both */
SetAngularVelocity(arg1: Vector): void;
/** @both */
SetMaterialGroup(arg1: string): void;
/** @both */
SetVelocity(arg1: Vector): void;
__kind__: 'instance';
}
/**
* The type used for validation of custom events.
*
* This type may be augmented via interface merging.
*/
interface CustomGameEventDeclarations {}
declare namespace CCustomGameEventManager {
type InferEventType<T extends string | object, TUntyped> = T extends string
? T extends keyof CustomGameEventDeclarations
? CustomGameEventDeclarations[T]
: TUntyped
: T;
}
declare const CustomGameEventManager: CCustomGameEventManager;
declare const CCustomGameEventManager: DotaConstructor<CCustomGameEventManager>;
declare interface CCustomGameEventManager {
/**
* Register a callback to be called when a particular custom event arrives.
* Returns a listener ID that can be used to unregister later.
*/
RegisterListener<T extends string | object>(
eventName: (T extends string ? T : string) | keyof CustomGameEventDeclarations,
listener: (
userId: EntityIndex,
event: NetworkedData<CCustomGameEventManager.InferEventType<T, object> & { PlayerID: PlayerID }>,
) => void,
): CustomGameEventListenerID;
Send_ServerToAllClients<T extends string | object>(
eventName: (T extends string ? T : string) | keyof CustomGameEventDeclarations,
eventData: CCustomGameEventManager.InferEventType<T, never>,
): void;
Send_ServerToPlayer<T extends string | object>(
player: CDOTAPlayerController,
eventName: (T extends string ? T : string) | keyof CustomGameEventDeclarations,
eventData: CCustomGameEventManager.InferEventType<T, never>,
): void;
Send_ServerToTeam<T extends string | object>(
team: DOTATeam_t,
eventName: (T extends string ? T : string) | keyof CustomGameEventDeclarations,
eventData: CCustomGameEventManager.InferEventType<T, never>,
): void;
/**
* Unregister a specific listener.
*/
UnregisterListener(listenerId: CustomGameEventListenerID): void;
__kind__: 'instance';
}
/**
* The type used for validation of custom net tables.
*
* This type may be augmented via interface merging.
*/
interface CustomNetTableDeclarations {}
declare const CustomNetTables: CCustomNetTableManager;
/** @both */
declare const CCustomNetTableManager: DotaConstructor<CCustomNetTableManager>;
declare interface CCustomNetTableManager {
/** @both */
GetTableValue<
TName extends keyof CustomNetTableDeclarations,
T extends CustomNetTableDeclarations[TName],
K extends keyof T,
>(
tableName: TName,
keyName: K,
): NetworkedData<T[K]>;
SetTableValue<
TName extends keyof CustomNetTableDeclarations,
T extends CustomNetTableDeclarations[TName],
K extends keyof T,
>(
tableName: TName,
keyName: K,
value: T[K],
): boolean;
__kind__: 'instance';
}
declare const debugoverlay: CDebugOverlayScriptHelper;
/** @both */
declare const CDebugOverlayScriptHelper: DotaConstructor<CDebugOverlayScriptHelper>;
declare interface CDebugOverlayScriptHelper {
/**
* Draws an axis. Specify origin + orientation in world space.
*
* @both
*/
Axis(arg1: Vector, arg2: unknown, arg3: number, arg4: boolean, arg5: number): void;
/**
* Draws a world-space axis-aligned box. Specify bounds in world space.
*
* @both
*/
Box(
arg1: Vector,
arg2: Vector,
arg3: number,
arg4: number,
arg5: number,
arg6: number,
arg7: boolean,
arg8: number,
): void;
/**
* Draws an oriented box at the origin. Specify bounds in local space.
*
* @both
*/
BoxAngles(
arg1: Vector,
arg2: Vector,
arg3: Vector,
arg4: unknown,
arg5: number,
arg6: number,
arg7: number,
arg8: number,
arg9: boolean,
arg10: number,
): void;
/**
* Draws a capsule. Specify base in world space.
*
* @both
*/
Capsule(
arg1: Vector,
arg2: unknown,
arg3: number,
arg4: number,
arg5: number,
arg6: number,
arg7: number,
arg8: number,
arg9: boolean,
arg10: number,
): void;
/**
* Draws a circle. Specify center in world space.
*
* @both
*/
Circle(
arg1: Vector,
arg2: unknown,
arg3: number,
arg4: number,
arg5: number,
arg6: number,
arg7: number,
arg8: boolean,
arg9: number,
): void;
/**
* Draws a circle oriented to the screen. Specify center in world space.
*
* @both
*/
CircleScreenOriented(
arg1: Vector,
arg2: number,
arg3: number,
arg4: number,
arg5: number,
arg6: number,
arg7: boolean,
arg8: number,
): void;
/**
* Draws a wireframe cone. Specify endpoint and direction in world space.
*
* @both
*/
Cone(
arg1: Vector,
arg2: Vector,
arg3: number,
arg4: number,
arg5: number,
arg6: number,
arg7: number,
arg8: number,
arg9: boolean,
arg10: number,
): void;
/**
* Draws a screen-aligned cross. Specify origin in world space.
*
* @both
*/
Cross(
arg1: Vector,
arg2: number,
arg3: number,
arg4: number,
arg5: number,
arg6: number,
arg7: boolean,
arg8: number,
): void;
/**
* Draws a world-aligned cross. Specify origin in world space.
*
* @both
*/
Cross3D(
arg1: Vector,
arg2: number,
arg3: number,
arg4: number,
arg5: number,
arg6: number,
arg7: boolean,
arg8: number,
): void;
/**
* Draws an oriented cross. Specify origin in world space.
*
* @both
*/
Cross3DOriented(
arg1: Vector,
arg2: unknown,
arg3: number,
arg4: number,
arg5: number,
arg6: number,
arg7: number,
arg8: boolean,
arg9: number,
): void;
/**
* Draws a dashed line. Specify endpoints in world space.
*
* @both
*/
DrawTickMarkedLine(
arg1: Vector,
arg2: Vector,
arg3: number,
arg4: number,
arg5: number,
arg6: number,
arg7: number,
arg8: number,
arg9: boolean,
arg10: number,
): void;
/**
* Draws the attachments of the entity.
*
* @both
*/
EntityAttachments(arg1: number, arg2: number, arg3: number): void;
/**
* Draws the axis of the entity origin.
*
* @both
*/
EntityAxis(arg1: number, arg2: number, arg3: boolean, arg4: number): void;
/**
* Draws bounds of an entity.
*
* @both
*/
EntityBounds(
arg1: number,
arg2: number,
arg3: number,
arg4: number,
arg5: number,
arg6: boolean,
arg7: number,
): void;
/**
* Draws the skeleton of the entity.
*
* @both
*/
EntitySkeleton(arg1: number, arg2: number): void;
/**
* Draws text on an entity.
*
* @both
*/
EntityText(
arg1: number,
arg2: number,
arg3: string,
arg4: number,
arg5: number,
arg6: number,
arg7: number,
arg8: number,
): void;
/**
* Draws a screen-space filled 2D rectangle. Coordinates are in pixels.
*
* @both
*/
FilledRect2D(arg1: never, arg2: never, arg3: number, arg4: number, arg5: number, arg6: number, arg7: number): void;
/**
* Draws a horizontal arrow. Specify endpoints in world space.
*
* @both
*/
HorzArrow(
arg1: Vector,
arg2: Vector,
arg3: number,
arg4: number,
arg5: number,
arg6: number,
arg7: number,
arg8: boolean,
arg9: number,
): void;
/**
* Draws a line between two points.
*
* @both
*/
Line(
arg1: Vector,
arg2: Vector,
arg3: number,
arg4: number,
arg5: number,
arg6: number,
arg7: boolean,
arg8: number,
): void;
/**
* Draws a line between two points in screenspace.
*
* @both
*/
Line2D(arg1: never, arg2: never, arg3: number, arg4: number, arg5: number, arg6: number, arg7: number): void;
/**
* Pops the identifier used to group overlays. Overlays marked with this
* identifier can be deleted in a big batch.
*
* @both
*/
PopDebugOverlayScope(): void;
/**
* Pushes an identifier used to group overlays. Deletes all existing overlays
* using this overlay id.
*
* @both
*/
PushAndClearDebugOverlayScope(arg1: string): void;
/**
* Pushes an identifier used to group overlays. Overlays marked with this
* identifier can be deleted in a big batch.
*
* @both
*/
PushDebugOverlayScope(arg1: string): void;
/**
* Removes all overlays marked with a specific identifier, regardless of their
* lifetime.
*
* @both
*/
RemoveAllInScope(arg1: string): void;
/**
* Draws a solid cone. Specify endpoint and direction in world space.
*
* @both
*/
SolidCone(
arg1: Vector,
arg2: Vector,
arg3: number,
arg4: number,
arg5: number,
arg6: number,
arg7: number,
arg8: number,
arg9: boolean,
arg10: number,
): void;
/**
* Draws a wireframe sphere. Specify center in world space.
*
* @both
*/
Sphere(
arg1: Vector,
arg2: number,
arg3: number,
arg4: number,
arg5: number,
arg6: number,
arg7: boolean,
arg8: number,
): void;
/**
* Draws a swept box. Specify endpoints in world space and the bounds in local
* space.
*
* @both
*/
SweptBox(
arg1: Vector,
arg2: Vector,
arg3: Vector,
arg4: Vector,
arg5: unknown,
arg6: number,
arg7: number,
arg8: number,
arg9: number,
arg10: number,
): void;
/**
* Draws 2D text. Specify origin in world space.
*
* @both
*/
Text(
arg1: Vector,
arg2: number,
arg3: string,
arg4: number,
arg5: number,
arg6: number,
arg7: number,
arg8: number,
arg9: number,
): void;
/**
* Draws a screen-space texture. Coordinates are in pixels.
*
* @both
*/
Texture(
arg1: string,
arg2: never,
arg3: never,
arg4: number,
arg5: number,
arg6: number,
arg7: number,
arg8: never,
arg9: never,
arg10: number,
): void;
/**
* Draws a filled triangle. Specify vertices in world space.
*
* @both
*/
Triangle(
arg1: Vector,
arg2: Vector,
arg3: Vector,
arg4: number,
arg5: number,
arg6: number,
arg7: number,
arg8: boolean,
arg9: number,
): void;
/**
* Draws 3D text. Specify origin + orientation in world space.
*
* @both
*/
VectorText3D(
arg1: Vector,
arg2: unknown,
arg3: string,
arg4: number,
arg5: number,
arg6: number,
arg7: number,
arg8: boolean,
arg9: number,
): void;
/**
* Draws a vertical arrow. Specify endpoints in world space.
*
* @both
*/
VertArrow(
arg1: Vector,
arg2: Vector,
arg3: number,
arg4: number,
arg5: number,
arg6: number,
arg7: number,
arg8: boolean,
arg9: number,
): void;
/**
* Draws a arrow associated with a specific yaw. Specify endpoints in world space.
*
* @both
*/
YawArrow(
arg1: Vector,
arg2: number,
arg3: number,
arg4: number,
arg5: number,
arg6: number,
arg7: number,
arg8: number,
arg9: boolean,
arg10: number,
): void;
__kind__: 'instance';
}
declare const CDOTA_Ability_Aghanim_Spear: DotaConstructor<CDOTA_Ability_Aghanim_Spear>;
declare interface CDOTA_Ability_Aghanim_Spear extends CDOTABaseAbility {
/**
* Launch Spear to a target position from a source position.
*/
LaunchSpear(target: Vector, start: Vector): void;
__kind__: 'instance';
}
declare const CDOTA_Ability_Animation_Attack: DotaConstructor<CDOTA_Ability_Animation_Attack>;
declare interface CDOTA_Ability_Animation_Attack extends CDOTABaseAbility {
/**
* Override playbackrate.
*/
SetPlaybackRate(rate: number): void;
__kind__: 'instance';
}
declare const CDOTA_Ability_Animation_TailSpin: DotaConstructor<CDOTA_Ability_Animation_TailSpin>;
declare interface CDOTA_Ability_Animation_TailSpin extends CDOTABaseAbility {
/**
* Override playbackrate.
*/
SetPlaybackRate(rate: number): void;
__kind__: 'instance';
}
declare const CDOTA_Ability_DataDriven: DotaConstructor<CDOTA_Ability_DataDriven>;
declare interface CDOTA_Ability_DataDriven extends CDOTABaseAbility {
/**
* Applies a data driven modifier to the target.
*/
ApplyDataDrivenModifier(
caster: CDOTA_BaseNPC,
target: CDOTA_BaseNPC,
modifierName: string,
modifierTable: object | undefined,
): CDOTA_Buff;
/**
* Applies a data driven thinker at the location.
*/
ApplyDataDrivenThinker(
caster: CDOTA_BaseNPC,
location: Vector,
modifierName: string,
modifierTable: object | undefined,
): CDOTA_Buff;
__kind__: 'instance';
}
declare const CDOTA_Ability_Lua: DotaConstructor<CDOTA_Ability_Lua>;
/** @client */
declare const C_DOTA_Ability_Lua: typeof CDOTA_Ability_Lua;
declare interface CDOTA_Ability_Lua extends CDOTABaseAbility {
/**
* Determine whether an issued command with no target is valid.
*
* @both
*/
CastFilterResult(): UnitFilterResult;
/**
* Determine whether an issued command on a location is valid.
*
* @both
*/
CastFilterResultLocation(location: Vector): UnitFilterResult;
/**
* Determine whether an issued command on a target is valid.
*
* @both
*/
CastFilterResultTarget(target: CDOTA_BaseNPC): UnitFilterResult;
/** @both */
GetAbilityChargeRestoreTime(level: number): number;
/**
* Allows code overriding of the ability texture shown in the HUD.
*
* @client
*/
GetAbilityTextureName(): string;
/**
* Controls the size of the AOE casting cursor.
*
* @both
*/
GetAOERadius(): number;
/**
* Returns abilities that are stolen simultaneously, or otherwise related in
* functionality.
*/
GetAssociatedPrimaryAbilities(): string;
/**
* Returns other abilities that are stolen simultaneously, or otherwise related in
* functionality. Generally hidden abilities.
*/
GetAssociatedSecondaryAbilities(): string;
/**
* Return cast behavior type of this ability.
*
* @both
*/
GetBehavior(): DOTA_ABILITY_BEHAVIOR | Uint64;
/**
* Return casting animation of this ability.
*/
GetCastAnimation(): GameActivity_t;
/**
* Return cast point of this ability.
*
* @both
*/
GetCastPoint(): number;
/**
* Return cast range of this ability.
*
* @both
*/
GetCastRange(location: Vector, target: CDOTA_BaseNPC | undefined): number;
/** @both */
GetCastRangeBonus(target: object, pseudoCastRange: number): number;
/**
* Return channel animation of this ability.
*/
GetChannelAnimation(): GameActivity_t;
/**
* Return health cost per second of channeling at the given level (-1 is current).
*
* @both
*/
GetChannelledHealthCostPerSecond(level: number): number;
/**
* Return mana cost at the given level per second while channeling (-1 is current).
*
* @both
*/
GetChannelledManaCostPerSecond(level: number): number;
/**
* Return the channel start time of this ability.
*
* @both
*/
GetChannelStartTime(): number;
/**
* Return the channel time of this ability.
*
* @both
*/
GetChannelTime(): number;
/**
* Return who hears speech when this spell is cast.
*/
GetConceptRecipientType(): number;
/**
* Return cooldown of this ability.
*
* @both
*/
GetCooldown(level: number): number;
/**
* Return the error string of a failed command with no target.
*
* @both
*/
GetCustomCastError(): string;
/**
* Return the error string of a failed command on a location.
*
* @both
*/
GetCustomCastErrorLocation(location: Vector): string;
/**
* Return the error string of a failed command on a target.
*
* @both
*/
GetCustomCastErrorTarget(target: CDOTA_BaseNPC): string;
/**
* (DOTA_INVALID_ORDERS nReason) Return the error string of a failed order.
*
* @both
*/
GetCustomHudErrorMessage(reason: number): string;
/**
* Return cast range of this ability, accounting for modifiers.
*
* @both
*/
GetEffectiveCastRange(location: Vector, target: object): number;
/**
* Return gold cost at the given level (-1 is current).
*
* @both
*/
GetGoldCost(level: number): number;
/**
* Return health cost at the given level (-1 is current).
*
* @both
*/
GetHealthCost(level: number): number;
/**
* Returns the name of the modifier applied passively by this ability.
*/
GetIntrinsicModifierName(): string;
/**
* Return mana cost at the given level (-1 is current).
*
* @both
*/
GetManaCost(level: number): number;
/**
* Return the animation rate of the cast animation.
*/
GetPlaybackRateOverride(): number;
/**
* Is this ability an Attribute Bonus.
*
* @both
*/
IsAttributeBonus(): boolean;
/**
* Is this a cosmetic only ability?
*/
IsCosmetic(entity: object): boolean;
/**
* Returns true if this ability can be used when not on the action panel.
*
* @both
*/
IsHiddenAbilityCastable(): boolean;
/**
* Returns true if this ability is hidden when stolen by Spell Steal.
*/
IsHiddenWhenStolen(): boolean;
/**
* Returns true if this ability is refreshed by Refresher Orb.
*/
IsRefreshable(): boolean;
/**
* Returns true if this ability can be stolen by Spell Steal.
*/
IsStealable(): boolean;
/**
* Cast time did not complete successfully.
*/
OnAbilityPhaseInterrupted(): void;
/**
* Cast time begins (return true for successful cast).
*/
OnAbilityPhaseStart(): boolean;
/**
* The ability was pinged.
*/
OnAbilityPinged(playerId: PlayerID, ctrlHeld: boolean): void;
OnAbilityUpgrade(upgradeAbility: object): void;
/**
* Channel finished.
*/
OnChannelFinish(interrupted: boolean): void;
/**
* Channeling is taking place.
*/
OnChannelThink(interval: number): void;
/**
* Caster (hero only) gained a level, skilled an ability, or received a new stat
* bonus.
*/
OnHeroCalculateStatBonus(): void;
/**
* A hero has died in the vicinity (ie Urn), takes table of params.
*/
OnHeroDiedNearby(unit: CDOTA_BaseNPC, attacker: CDOTA_BaseNPC, event: object): void;
/**
* Caster gained a level.
*/
OnHeroLevelUp(): void;
/**
* Caster inventory changed.
*/
OnInventoryContentsChanged(): void;
/**
* Caster equipped item.
*/
OnItemEquipped(item: CDOTA_Item): void;
/**
* Caster died.
*/
OnOwnerDied(): void;
/**
* Caster respawned or spawned for the first time.
*/
OnOwnerSpawned(): void;
/**
* Projectile has collided with a given target or reached its destination. If
* 'true` is returned, projectile would be destroyed.
*/
OnProjectileHit(target: CDOTA_BaseNPC | undefined, location: Vector): boolean | void;
/**
* Projectile has collided with a given target or reached its destination. If
* 'true` is returned, projectile would be destroyed.
*/
OnProjectileHit_ExtraData(target: CDOTA_BaseNPC | undefined, location: Vector, extraData: object): boolean | void;
/**
* Projectile has collided with a given target or reached its destination. If
* 'true` is returned, projectile would be destroyed.
*/
OnProjectileHitHandle(
target: CDOTA_BaseNPC | undefined,
location: Vector,
projectileHandle: ProjectileID,
): boolean | void;
/**
* Projectile is actively moving.
*/
OnProjectileThink(location: Vector): void;
/**
* Projectile is actively moving.
*/
OnProjectileThink_ExtraData(location: Vector, extraData: object): void;
/**
* Projectile is actively moving.
*/
OnProjectileThinkHandle(projectileHandle: ProjectileID): void;
/**
* Cast time finished, spell effects begin.
*/
OnSpellStart(): void;
/**
* Special behavior when stolen by Spell Steal.
*/
OnStolen(sourceAbility: CDOTABaseAbility): void;
/**
* Ability is toggled on/off.
*/
OnToggle(): void;
/**
* Special behavior when lost by Spell Steal.
*/
OnUnStolen(): void;
/**
* Ability gained a level.
*/
OnUpgrade(): void;
OtherAbilitiesAlwaysInterruptChanneling(): boolean;
/**
* Returns true if this ability will generate magic stick charges for nearby
* enemies.
*/
ProcsMagicStick(): boolean;
/**
* Does this ability need the caster to face the target before executing?
*/
RequiresFacing(): boolean;
/**
* Returns true if this ability should return to the default toggle state when its
* parent respawns.
*/
ResetToggleOnRespawn(): boolean;
/**
* Return the type of speech used.
*/
SpeakTrigger(): number;
/**
* Called first when ability entity is created.
*
* @abstract
* @both
*/
Init?(): void;
/** @abstract */
Precache?(context: CScriptPrecacheContext): void;
/**
* Called when ability entity is created, after Init.
*
* @abstract
* @both
*/
Spawn?(): void;
__kind__: 'instance';
}
declare const CDOTA_Ability_Nian_Dive: DotaConstructor<CDOTA_Ability_Nian_Dive>;
declare interface CDOTA_Ability_Nian_Dive extends CDOTABaseAbility {
/**
* Override playbackrate.
*/
SetPlaybackRate(rate: number): void;
__kind__: 'instance';
}
declare const CDOTA_Ability_Nian_Leap: DotaConstructor<CDOTA_Ability_Nian_Leap>;
declare interface CDOTA_Ability_Nian_Leap extends CDOTABaseAbility {
/**
* Override playbackrate.
*/
SetPlaybackRate(rate: number): void;
__kind__: 'instance';
}
declare const CDOTA_Ability_Nian_Roar: DotaConstructor<CDOTA_Ability_Nian_Roar>;
declare interface CDOTA_Ability_Nian_Roar extends CDOTABaseAbility {
/**
* Number of times Nian has used the roar.
*/
GetCastCount(): number;
__kind__: 'instance';
}
declare const CDOTA_BaseNPC: DotaConstructor<CDOTA_BaseNPC>;
/** @client */
declare const C_DOTA_BaseNPC: typeof CDOTA_BaseNPC;
declare interface CDOTA_BaseNPC extends CBaseFlex {
/**
* Add an ability to this unit by name.
*/
AddAbility(abilityName: string): CDOTABaseAbility;
/**
* Add an activity modifier that affects future StartGesture calls.
*
* @param name The name of the activity modifier to add, e.g. 'haste'.
*/
AddActivityModifier(name: string): void;
/**
* Add an item to this unit's inventory.
*/
AddItem(item: CDOTA_Item): CDOTA_Item;
/**
* Add an item to this unit's inventory.
*/
AddItemByName(itemName: string): CDOTA_Item;
/**
* Add a modifier to this unit.
*/
AddNewModifier(
caster: CDOTA_BaseNPC | undefined,
ability: CDOTABaseAbility | undefined,
modifierName: string,
modifierTable: object | undefined,
): CDOTA_Buff;
/**
* Adds the no draw flag.
*/
AddNoDraw(): void;
/**
* Add a speech bubble(1-4 live at a time) to this NPC.
*/
AddSpeechBubble(bubble: number, speech: string, duration: number, unOffsetX: number, unOffsetY: number): void;
AlertNearbyUnits(attacker: CDOTA_BaseNPC, ability: CDOTABaseAbility): void;
AngerNearbyUnits(): void;
AttackNoEarlierThan(time: number, timeDisparityTolerance: number): void;
AttackReady(): boolean;
BoundingRadius2D(): number;
CalculateGenericBonuses(): void;
CanBeSeenByAnyOpposingTeam(): boolean;
/**
* Check FoW to see if an entity is visible.
*/
CanEntityBeSeenByMyTeam(entity: CDOTA_BaseNPC): boolean;
/**
* Query if this unit can sell items.
*/
CanSellItems(): boolean;
/**
* Cast an ability immediately.
*/
CastAbilityImmediately(ability: CDOTABaseAbility, playerIndex: number): void;
/**
* Cast an ability with no target.
*/
CastAbilityNoTarget(ability: CDOTABaseAbility, playerIndex: number): void;
/**
* Cast an ability on a position.
*/
CastAbilityOnPosition(position: Vector, ability: CDOTABaseAbility, playerIndex: number): void;
/**
* Cast an ability on a target entity.
*/
CastAbilityOnTarget(target: CDOTA_BaseNPC, ability: CDOTABaseAbility, playerIndex: number): void;
/**
* Toggle an ability.
*/
CastAbilityToggle(ability: CDOTABaseAbility, playerIndex: number): void;
ChangeTeam(teamNum: number): void;
/**
* Clear Activity modifiers.
*/
ClearActivityModifiers(): void;
/**
* Consume the item, deleting it from the inventory and granting the hero the
* specified bonuses.
*/
ConsumeItem(item: object): void;
DestroyAllSpeechBubbles(): void;
/**
* Disassemble the passed item in this unit's inventory.
*/
DisassembleItem(item: CDOTA_Item): void;
/**
* Drop an item at a given point.
*/
DropItemAtPosition(dest: Vector, item: CDOTA_Item): void;
/**
* Immediately drop a carried item at a given position.
*/
DropItemAtPositionImmediate(item: CDOTA_Item, position: Vector): void;
/**
* Drops the selected item out of this unit's stash.
*/
EjectItemFromStash(item: CDOTA_Item): void;
/**
* This unit will be set to face the target point.
*/
FaceTowards(target: Vector): void;
/**
* Fade and remove the given gesture activity.
*/
FadeGesture(activity: GameActivity_t): void;
/**
* Retrieve an ability by name from the unit.
*
* @both
*/
FindAbilityByName(abilityName: string): CDOTABaseAbility | undefined;
/**
* Returns a table of all of the modifiers on the NPC.
*/
FindAllModifiers(): CDOTA_Buff[];
/**
* Returns a table of all of the modifiers on the NPC with the passed name
* (modifierName).
*/
FindAllModifiersByName(modifierName: string): CDOTA_Buff[];
/**
* Get handle to first item in inventory, else nil.
*/
FindItemInInventory(itemName: string): CDOTA_Item | undefined;
/**
* Return a handle to the modifier of the given name if found, else nil (string
* Name ).
*/
FindModifierByName(modifierName: string): CDOTA_Buff | undefined;
/**
* Return a handle to the modifier of the given name from the passed caster if
* found, else nil.
*/
FindModifierByNameAndCaster(modifierName: string, caster: CDOTA_BaseNPC): CDOTA_Buff | undefined;
/**
* Kill this unit immediately.
*/
ForceKill(reincarnate: boolean): void;
/**
* Play an activity once, and then go back to idle.
*/
ForcePlayActivityOnce(activity: GameActivity_t): void;
/**
* Retrieve an ability by index from the unit.
*/
GetAbilityByIndex(index: number): CDOTABaseAbility | undefined;
/** @both */
GetAbilityCount(): number;
/**
* Gets the range at which this unit will auto-acquire.
*/
GetAcquisitionRange(): number;
/**
* Combat involving this creature will have this weight added to the music
* calcuations.
*/
GetAdditionalBattleMusicWeight(): number;
/**
* Returns this unit's aggro target.
*/
GetAggroTarget(): CDOTA_BaseNPC | undefined;
GetAttackAnimationPoint(): number;
GetAttackCapability(): DOTAUnitAttackCapability_t;
/**
* Returns a random integer between the minimum and maximum base damage of the
* unit.
*/
GetAttackDamage(): number;
/**
* Gets the attack range buffer.
*/
GetAttackRangeBuffer(): number;
/** @both */
GetAttackSpeed(ignoreTempAttackSpeed: boolean): number;
/** @both */
GetAttacksPerSecond(ignoreTempAttackSpeed: boolean): number;
GetAttackTarget(): CDOTA_BaseNPC | undefined;
/**
* Returns the average value of the minimum and maximum damage values.
*/
GetAverageTrueAttackDamage(target: CDOTA_BaseNPC | undefined): number;
GetBaseAttackRange(): number;
/** @both */
GetBaseAttackTime(): number;
/**
* Get the maximum attack damage of this unit.
*/
GetBaseDamageMax(): number;
/**
* Get the minimum attack damage of this unit.
*/
GetBaseDamageMin(): number;
/**
* Returns the vision range before modifiers.
*/
GetBaseDayTimeVisionRange(): number;
GetBaseHealthBarOffset(): number;
GetBaseHealthRegen(): number;
/**
* Returns base magical armor value.
*
* @both
*/
GetBaseMagicalResistanceValue(): number;
/**
* Gets the base max health value.
*/
GetBaseMaxHealth(): number;
/** @both */
GetBaseMoveSpeed(): number;
/**
* Returns the vision range after modifiers.
*/
GetBaseNightTimeVisionRange(): number;
/**
* This Mana regen is derived from constant bonuses like Basilius.
*/
GetBonusManaRegen(): number;
GetCastPoint(attack: boolean