API

From Valve Developer Community
< Dota 2 Workshop Tools‎ | Scripting
Revision as of 17:04, 6 August 2014 by VDCBot (talk | contribs) (Dota 2 Workshop Tools docs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Accessing the DOTA 2 Scripting API from Lua

While Lua is dynamically typed, the DOTA 2 engine is written primarily in C++, which is statically typed. Thus, you'll need to be conscious of your data types when calling the API. (If you try to pass the wrong type to an API function, you'll get an error message in Vconsole telling you what you passed and what it was expecting.)

Global Scope

bool SpawnEntityGroupFromTable(handle, bool, handle) ( groupSpawnTables, bAsync, hCallback )Hierarchically spawn an entity group from a set of spawn tables.

float GetFrostyBoostAmount(int, int)

handle EntIndexToHScript(int) Turn an entity index integer to an HScript representing that entity's script instance.

void StopEffect(handle, string) (hEntity, szEffectName)

void Say(handle, string, bool) Have Entity say string, and teamOnly or not

void DebugDrawBoxDirection(Vector, Vector, Vector, Vector, Vector, float, float) Draw a debug forward box (cent, min, max, forward, vRgb, a, duration)

void PrecacheItemByNameAsync(string, handle) Asynchronously precaches a DOTA item by its dota_npc_items.txt name, provides a callback when it's finished.

float GetGoldFrostyBoostAmount(int, int)

int RandomInt(int, int) Get a random int within a range

bool RollPercentage(int) Rolls a number from 1 to 100 and returns true if the roll is less than or equal to the number specified

void SendToConsole(string) Send a string to the console as a client command

QAngle VectorToAngles(Vector) Get Qangles (with no roll) for a Vector.

bool IsDedicatedServer() Returns true if this server is a dedicated server.

Vector SplineVectors(Vector, Vector, float) (vector,vector,float) very basic interpolation of v0 to v1 over t on [0,1]

void Msg(string) Print a message

bool rr_AddDecisionRule(handle) Add a rule to the decision database.

void FindClearSpaceForUnit(handle, Vector, bool) Place a unit somewhere not already occupied.

table LoadKeyValues(string) Creates a table from the specified keyvalues text file

bool TraceLine(handle) Pass table - Inputs: startpos, endpos, mask, ignore -- outputs: pos, fraction, hit, enthit, startsolid

int ListenToGameEvent(string, handle, handle) Register as a listener for a game event from script. ( szEventName, hFunctionNameToCall, hContext )

Tip.png Tip: In addition to listening for standard engine events, you can also create your own events by placing them in /scripts/custom_events.txt.

float GetWorldMinY() Gets the world's minimum Y position.

handle CreateItemOnPositionSync(Vector, handle) Create a physical item at a given location

float ExponentialDecay(float, float, float) Smooth curve decreasing slower as it approaches zero

handle GetListenServerHost() Get the local player on a listen server.

bool StopListeningToGameEvent(int) Stop listening to a particular game event.

void FireEntityIOInputVec(ehandle, string, Vector) Fire Entity's Action Input with passed Vector ( hEntity, szActionName, vector )

void DoEntFire(string, string, string, float, handle, handle) EntFire: Generate an entity i/o event ( szTarget, szAction, szValue, flDelay, hActivator, hCaller )

bool IsMarkedForDeletion(handle) Returns true if the entity is valid and marked for deletion.

Vector RotatePosition(Vector, QAngle, Vector) Rotate a Vector around a point.

string GetMapName() Get the name of the map.

void PrintLinkedConsoleMessage(string, string) Print a console message with a linked console command

int MakeStringToken(string) Checks to see if the given hScript is a valid entity

Quaternion RotateQuaternionByAxisAngle(Quaternion, Vector, float) Rotates a quaternion by the specified angle around the specified vector axis

void UTIL_Remove(handle) Removes the specified entity

void DebugDrawText(Vector, string, bool, float) Draw text in 3d (origin, text, bViewCheck, duration)

void ReloadMOTD() Reloads the MotD file

void DebugDrawLine_vCol(Vector, Vector, Vector, bool, float) Draw a debug line using color vec (start, end, vRgb, a, ztest, duration)

void PrecacheEntityFromTable(string, handle, handle) Precache an entity from KeyValues in table

void UTIL_RemoveImmediate(handle) Immediately removes the specified entity

void SetQuestPhase(int) Set the current quest phase.

void DebugDrawBox(Vector, Vector, Vector, int, int, int, int, float) Draw a debug overlay box (origin, mins, maxs, forward, r, g, b, a, duration )

Vector RandomVector(float) Get a random 2D vector. Argument (float) is the minimum length of the returned vector.

void FireEntityIOInputString(ehandle, string, string) Fire Entity's Action Input with passed String - you own the memory

int GetGoldFrostyPointsForRound(int, int, int)

float GetWorldMaxX() Gets the world's maximum X position.

void UpdateEventPoints(handle)

int CreateUnitByNameAsync(string, Vector, bool, handle, handle, int, handle) Creates a DOTA unit by its dota_npc_units.txt name ( szUnitName, vLocation, bFindClearSpace, hNPCOwner, hUnitOwner, iTeamNumber, hCallback )

handle CreateTriggerRadiusApproximate(Vector, float) CreateTriggerRadiusApproximate( vecOrigin, flRadius ) : Creates and returns an AABB trigger thats bigger than the radius provided

Vector GetPhysVelocity(handle) Get Velocity for VPHYS or normal object

bool CreateEffect(handle) Pass table - Inputs: entity, effect

void PrecacheItemByNameSync(string, handle) Precaches a DOTA item by its dota_npc_items.txt name

QAngle RotationDelta(QAngle, QAngle) Find the delta between two QAngles.

void InitLogFile(string, string) If the given file doesn't exist, creates it with the given contents; does nothing if it exists

bool IsValidEntity(handle) Checks to see if the given hScript is a valid entity

void PrecacheUnitByNameSync(string, handle) Precaches a DOTA unit by its dota_npc_units.txt name

bool TraceHull(handle) Pass table - Inputs: start, end, min, max, mask, ignore -- outputs: pos, fraction, hit, enthit, startsolid

void SetOpvarFloatAll(string, string, string, float) Sets an opvar value for all players

Quaternion AxisAngleToQuaternion(Vector, float) (vector,float) constructs a quaternion representing a rotation by angle around the specified vector axis

void DebugDrawSphere(Vector, Vector, float, float, bool, float) Draw a debug sphere (center, vRgb, a, rad, ztest, duration)

void Warning(string) Print a warning

handle CreateItem(string, handle, handle) Create a DOTA item ( szScriptName, hParent, hOwner )

void DebugDrawClear() Try to clear all the debug overlay info

float cvar_getf(string) Gets the value of the given cvar, as a float.

bool cvar_setf(string, float) Sets the value of the given cvar, as a float.

void EmitSoundOn(string, handle) Play named sound on Entity

int SpawnEntityListFromTableAsynchronous(handle, handle) Asynchronously spawn an entity group from a list of spawn table's. A callback will be triggered when the spawning is complete

void EmitGlobalSound(string) Play named sound for all players

float AngleDiff(float, float) Returns the number of degrees difference between two yaw angles

string GetSystemDate() Get the current real world date

void DebugBreak() Breaks in the debugger

Vector GetPhysAngularVelocity(handle) Get Angular Velocity for VPHYS or normal object

Vector GetGroundPosition(Vector, handle) Returns the supplied position moved to the ground. Second parameter is an NPC for measuring movement collision hull offset.

handle SpawnEntityFromTableSynchronous(string, handle) Synchronously spawns a single entity from a table

bool DoIncludeScript(string, handle) Execute a script (internal)

void SendToServerConsole(string) Send a string to the console as a server command

table FindUnitsInRadius(int, Vector, handle, float, int, int, int, int, bool) Finds the units in a given radius with the given flags. ( iTeamNumber, vPosition, hCacheUnit, flRadius, iTeamFilter, iTypeFilter, iFlagFilter, iOrder, bCanGrowCache )

void DebugDrawCircle(Vector, Vector, float, float, bool, float) Draw a debug circle (center, vRgb, a, rad, ztest, duration)

void SetQuestName(string) Set the current quest name.

void SendFrostyPointsMessageToGC(handle)

float FrameTime() Get the time spent on the server in the last frame

handle CreateUnitByName(string, Vector, bool, handle, handle, int) Creates a DOTA unit by its dota_npc_units.txt name ( szUnitName, vLocation, bFindClearSpace, hNPCOwner, hUnitOwner, iTeamNumber )

float GetWorldMaxY() Gets the world's maximum Y position.

void PrecacheEntityListFromTable(handle, handle) Precache a list of entity KeyValues table's

handle CreateTrigger(Vector, Vector, Vector) CreateTrigger( vecMin, vecMax ) : Creates and returns an AABB trigger

int GetFrameCount() Returns the engines current frame count

void DoEntFireByInstanceHandle(handle, string, string, float, handle, handle) EntFireByHandle:Generate and entity i/o event

string DoUniqueString(string) UniqueString:Generate a string guaranteed to be unique across the life of the script VM, with an optional root string. Useful for adding data to table's when not sure what keys are already in use in that table.

string GetSystemTime() Get the current real world time

handle PlayerInstanceFromIndex(int) Get a script instance of a player by index.

void StartSoundEvent(string, handle) Start a sound event

handle CreateHeroForPlayer(string, handle) Creates a DOTA hero by its dota_npc_units.txt name and sets it as the given player's controlled hero

int GetFrostyPointsForRound(int, int, int)

void ShowGenericPopupToPlayer(handle, string, string, string, string, int) Show a generic popup dialog to a specific player.

void ShowGenericPopup(string, string, string, string, int) Show a generic popup dialog for all players.

void DebugDrawLine(Vector, Vector, int, int, int, bool, float) Draw a debug overlay line (origin, target, r, g, b, ztest, duration)

string FileToString(string) Reads a string from a file to send to script

void FireGameEventLocal(string, handle) Fire a game event without broadcasting to the client.

handle rr_GetResponseTargets() Retrieve a table of all available expresser targets, in the form { name : handle, name: handle }.

void SendFrostivusTimeElapsedToGC()

QAngle RotateOrientation(QAngle, QAngle) Rotate a QAngle by another QAngle.

void EmitSoundOnClient(string, handle) Play named sound only on the client for the passed in player

void ScreenShake(Vector, float, float, float, float, int, bool) Start a screenshake with the following parameters. vecCenter, flAmplitude, flFrequency, flDuration, flRadius, eCommand( SHAKE_START = 0, SHAKE_STOP = 1 ), bAirShake

void CancelEntityIOEvents(ehandle) Create all I/O events for a particular entity

float GetWorldMinX() Gets the world's minimum X position.

void AppendToLogFile(string, string) Appends a string to a log file on the server

void FireGameEvent(string, handle) Fire a game event.

void FireEntityIOInputNameOnly(ehandle, string) Fire Entity's Action Input w/no data

float Time() Get the current server time

void PrecacheResource(string, string, handle) Manually precache a single resource

void DoScriptAssert(bool, string) ScriptAssert:Asserts the passed in value. Prints out a message and brings up the assert dialog.

void PrecacheModel(string, handle) ( modelName, context ) - Manually precache a single model

void ShowMessage(string) Print a hud message on all clients

void PauseGame(bool) Pause or unpause the game.

Quaternion SplineQuaternions(Quaternion, Quaternion, float) (quaternion,quaternion,float) very basic interpolation of v0 to v1 over t on [0,1]

void StopSoundEvent(string, handle) Stops a sound event

float GetMaxOutputDelay(ehandle, string) Get the longest delay for all events attached to an output

void RemoveSpawnGroupFilterProxy(string) Remove the C proxy for a script-based spawn group filter

void DebugDrawScreenTextLine(float, float, int, string, int, int, int, int, float) Draw text with a line offset (x, y, lineOffset, text, r, g, b, a, duration)

void DebugScreenTextPretty(float, float, int, string, int, int, int, int, float, string, int, bool) Draw pretty debug text (x, y, lineOffset, text, r, g, b, a, duration, font, size, bBold)

handle SpawnEntityListFromTableSynchronous(handle) Synchronously spawn an entity group from a list of spawn table's.

void SetOpvarFloatPlayer(string, string, string, float, handle) Sets an opvar value for a single player ( szStackName, szOperatorName, szOpvarName, flOpvarValue, hEnt )

void PrecacheUnitByNameAsync(string, handle) Asynchronously precaches a DOTA unit by its dota_npc_units.txt name, provides a callback when it's finished.

bool StringToFile(string, string) Store a string to a file for later reading

void RegisterSpawnGroupFilterProxy(string) Create a C proxy for a script-based spawn group filter

void ExecuteOrderFromTable(handle) Issue an order from a script table

bool TakeDamage(handle) Pass table - Inputs: hVictim, flDamage, damage type index, vForce, vPosition, hAttacker

bool TraceCollideable(handle) Pass table - Inputs: start, end, ent, (optional mins, maxs) -- outputs: pos, fraction, hit, startsolid, normal

float RandomFloat(float, float) Get a random float within a range

void StopSoundOn(string, handle) Stop named sound on Entity

void UnloadSpawnGroup(string) Unload a spawn group by name

bool rr_QueryBestResponse(handle, handle, handle) Params: ( hEnt, hQuery, hResult ) // Static : tests 'query' against entity's response system and returns the best response found (or null if none found).

void UnloadSpawnGroupByHandle(int) Unload a spawn group by handle

void SetRenderingEnabled(ehandle, bool) Set rendering on/off for an ehandle

bool rr_CommitAIResponse(handle, handle) Commit the result of QueryBestResponse back to the given entity to play. Call with params (entity, airesponse)

void StopListeningToAllGameEvents(handle) Stop listening to all game events within a specific context.

table LoadKeyValuesFromString(string) Creates a table from the specified keyvalues string

Class CBaseEntity

Vector GetBaseVelocity() Get Base velocity

void SetSize(Vector, Vector)

void SetRenderColor(int, int, int) SetRenderColor( r, g, b ): Sets the render color of the entity.

void GatherCriteria(handle) 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.

void Trigger() Fires off this entity's OnTrigger responses

void SetOwner(handle) Sets this entity's owner

void SetAbsOrigin(Vector) SetAbsOrigin

void SetAngularVelocity(float, float, float) Set the local angular velocity - takes float pitch,yaw,roll velocities

handle GetOwner() Gets this entity's owner

handle GetOwnerEntity() Get the owner entity, if there is one

handle GetChildren() Get the entities parented to this entity.

void SetMaxHealth(int)

Vector GetCenter() Get vector to center of object - absolute coords

void Kill()

handle FirstMoveChild()

handle GetMoveParent() If in hierarchy, retrieves the entity's parent

void SetForwardVector(Vector) Set the orientation of the entity to have this forward vector

void SetContextNum(string, float, float) SetContext( name , value, duration ): 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').

Vector GetAbsOrigin()

Vector GetAngularVelocity() Get the local angular velocity - returns a vector of pitch,yaw,roll

handle NextMovePeer()

void ApplyLocalAngularVelocityImpulse(Vector) Apply an Ang Velocity Impulse

int GetMaxHealth()

void PrecacheScriptSound(string) Precache a sound for later playing.

void SetContextThink(string, handle, float) Set a think function on this entity.

table GetBounds() Get a table containing the 'Mins' & 'Maxs' vector bounds, centered on object

void SetTeam(int)

int GetHealth()

Vector GetForwardVector() Get the forward vector of the entity

Vector GetBoundingMaxs() Get a vector containing max bounds, centered on object

string GetModelName() Returns the name of the model

void SetContext(string, string, float) SetContext( name , value, duration ): 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').

void EmitSoundParams(string, int, float, float) Plays/modifies a sound from this entity. changes sound if nPitch and/or flVol or flSoundTime is > 0.

void SetVelocity(Vector)

int GetTeam()

table GetContext(string) GetContext( name ): looks up a context and returns it if available. May return string, float, or null (if the context isn't found)

QAngle GetAngles()

void SetHealth(int)

bool IsAlive()

void SetParent(handle, string) Set the parent for this entity.

Vector GetAnglesAsVector() Get entity pitch, yaw, roll as a vector

void EmitSound(string) Plays a sound from this entity.

void SetAngles(float, float, float) Set entity pitch, yaw, roll

QAngle EyeAngles() Get the qangles that this entity is looking at.

Vector EyePosition() Get vector to eye position - absolute coords

void ApplyAbsVelocityImpulse(Vector) Apply a Velocity Impulse

handle GetRootMoveParent() If in hierarchy, walks up the hierarchy to find the root parent

void OverrideFriction(float, float) Takes duration, value for a temporary override

void SetFriction(float) Set PLAYER friction, ignored for objects

void SetModel(string)

Vector GetUpVector() Get the up vector of the entity

void SetGravity(float) Set PLAYER gravity, ignored for objects

bool IsPlayer() Is this a player entity?

Vector GetVelocity()

Vector GetLocalVelocity() Get Entity relative velocity

void StopSound(string) Stops a named sound playing from this entity.

void SetOrigin(Vector)

float GetSoundDuration(string, string) Returns float duration of the sound. Takes soundname and optional actormodelname.

QAngle GetLocalAngularVelocity() Maybe local angvel

Vector GetOrigin()

Vector GetBoundingMins() Get a vector containing min bounds, centered on object

Vector GetRightVector() Get the right vector of the entity

Class CEntities

handle First() Begin an iteration over the list of entities

table FindAllByModel(string) Find entities by model name.

handle FindByName(handle, string) Find entities by name. Pass null to start an iteration, or reference to a previously found entity to continue a search

handle FindByNameWithin(handle, string, Vector, float) Find entities by name within a radius. Pass null to start an iteration, or reference to a previously found entity to continue a search

table FindAllByTarget(string) Find entities by targetname.

handle FindByClassname(handle, string) Find entities by class name. Pass null to start an iteration, or reference to a previously found entity to continue a search

table FindAllByName(string) Find all entities by name. Returns an array containing all the found entities in it.

table FindAllByClassnameWithin(string, Vector, float) Find entities by class name within a radius.

handle FindByModel(handle, string) Find entities by model name. Pass null to start an iteration, or reference to a previously found entity to continue a search

table FindAllByNameWithin(string, Vector, float) Find entities by name within a radius.

handle FindByClassnameWithin(handle, string, Vector, float) Find entities by class name within a radius. Pass null to start an iteration, or reference to a previously found entity to continue a search

handle FindByClassnameNearest(string, Vector, float) Find entities by class name nearest to a point.

table FindAllByClassname(string) Finds all entities by class name. Returns an array containing all the found entities.

handle FindByTarget(handle, string) Find entities by targetname. Pass null to start an iteration, or reference to a previously found entity to continue a search

handle FindByNameNearest(string, Vector, float) Find entities by name nearest to a point.

handle CreateByClassname(string) Creates an entity by classname

table FindAllInSphere(Vector, float) Find entities within a radius.

handle Next(handle) Continue an iteration over the list of entities, providing reference to a previously found entity

handle FindInSphere(handle, Vector, float) Find entities within a radius. Pass null to start an iteration, or reference to a previously found entity to continue a search

handle FindByModelWithin(handle, string, Vector, float) Find entities by model name within a radius. Pass null to start an iteration, or reference to a previously found entity to continue a search

Class CEntityInstance

int GetEntityIndex()

void DisconnectRedirectedOutput(string, string, handle) Removes a connected script function from an I/O event on the passed entity.

handle GetOrCreatePublicScriptScope() Retrieve, creating if necessary, the public script-side data associated with an entity

handle GetOrCreatePrivateScriptScope() Retrieve, creating if necessary, the private per-instance script-side data associated with an entity

handle GetPrivateScriptScope() Retrieve the private per-instance script-side data associated with an entity

void RedirectOutput(string, string, handle) Adds an I/O connection that will call the named function on the passed entity when the specified output fires.

int GetIntAttr(string) Get Integer Attribute

void FireOutput(string, handle, handle, table, float) Fire an entity output

string GetDebugName() Get the entity name w/help if not defined (i.e. classname/etc)

void DisconnectOutput(string, string) Removes a connected script function from an I/O event on this entity.

void Destroy()

string GetClassname()

string GetName()

void ConnectOutput(string, string) Adds an I/O connection that will call the named function on this entity when the specified output fires.

int entindex()

ehandle GetEntityHandle() Get the entity as an EHANDLE

void RemoveSelf() Delete this entity

void SetIntAttr(string, int) Set Integer Attribute

handle GetPublicScriptScope() Retrieve the public script-side data associated with an entity

Class CDOTABaseAbility

bool GetAnimationIgnoresModelScale()

bool IsSharedWithTeammates()

void OnHeroLevelUp()

void OnChannelFinish(bool)

void ToggleAutoCast()

float GetDuration()

bool IsChanneling() Returns whether the ability is currently channeling.

int GetAbilityTargetType()

string GetAbilityName()

bool PlaysDefaultAnimWhenStolen()

bool IsActivated()

void OnAbilityPhaseInterrupted()

void SetHidden(bool)

bool IsPassive()

int GetCastRange()

float GetBackswingTime()

float GetCooldownTime()

void PayManaCost()

string GetAssociatedSecondaryAbilities()

string GetStolenActivityModifier()

bool SpeakTrigger()

void PayGoldCostForUpgrade()

float GetModifierValue()

bool GetCursorTargetingNothing()

float GetCooldownTimeRemaining()

float GetChannelStartTime()

Vector GetCursorPosition()

bool GetToggleState()

bool IsInAbilityPhase() Returns whether the ability is currently casting.

bool ProcsMagicStick()

float GetCooldown(int) Get the cooldown duration for this ability at a given level, not the amount of cooldown actually left.

void ToggleAbility()

bool IsHiddenWhenStolen()

void OnSpellStart()

void CastAbility()

int GetChannelledManaCostPerSecond(int)

string GetIntrinsicModifierName()

bool IsOwnersGoldEnough(int)

bool IsHidden()

table GetLevelSpecialValueFor(string, int)

int GetGoldCost(int)

void SetChanneling(bool)

void SetInAbilityPhase(bool)

void SetAbilityIndex(int)

int GetAbilityTargetTeam()

void SpeakAbilityConcept(int)

bool IsCooldownReady()

bool IsToggle()

float GetCastPoint()

void OnUpgrade()

int GetLevel() Get the current level of the ability

table GetSpecialValueFor(string)

void DecrementModifierRefCount()

int GetAbilityType()

void UseResources(bool, bool, bool)

bool IsAttributeBonus()

void MarkAbilityButtonDirty() Mark the ability button for this ability as needing a refresh

void OnChannelThink(float)

bool HeroXPChange(float)

int GetAbilityTargetFlags()

void OnHeroCalculateStatBonus()

void SetOverrideCastPoint(float)

int GetAbilityDamageType()

bool RefCountsModifiers()

void CreateVisibilityNode(Vector, float, float)

bool ResetToggleOnRespawn()

float GetPlaybackRateOverride()

bool IsStealable()

void EndChannel(bool) Param: bool bInterrupted

int GetGoldCostForUpgrade(int)

void SetRefCountsModifiers(bool)

bool OnAbilityPhaseStart()

void UpgradeAbility()

void SetActivated(bool)

bool ShouldUseResources()

string GetAssociatedPrimaryAbilities()

bool IsOwnersGoldEnoughForUpgrade()

int GetManaCost(int)

float GetModifierValueBonus()

void OnOwnerDied()

bool IsFullyCastable() Returns whether the ability can be cast.

int GetMaxLevel()

void PayGoldCost()

void OnOwnerSpawned()

void OnInventoryContentsChanged()

int GetConceptRecipientType()

int GetBehavior()

handle GetCloneSource()

string GetSharedCooldownName()

bool ContinueCasting()

int GetAbilityDamage()

bool IsStolen()

bool IsOwnersManaEnough()

void SetLevel(int) Sets the level of this ability.

int GetAbilityIndex()

int NumModifiersUsingAbility()

bool IsCosmetic()

bool IsItem()

void EndCooldown() Clear the cooldown remaining on this ability.

int GetHeroLevelRequiredToUpgrade()

void OnAbilityPinged()

void SetStolen(bool)

bool GetAutoCastState()

float GetChannelTime()

handle GetCaster()

void StartCooldown(float) param: flCooldown

void RefundManaCost()

void IncrementModifierRefCount()

bool IsTrained()

handle GetCursorTarget()

void OnToggle()

Class CDOTA_Ability_Animation_Attack

void SetPlaybackRate(float) Override playbackrate

Class CDOTA_Ability_Animation_TailSpin

void SetPlaybackRate(float) Override playbackrate

Class CDOTA_Ability_Nian_Leap

void SetPlaybackRate(float) Override playbackrate

Class CDOTA_Ability_Nian_Dive

void SetPlaybackRate(float) Override playbackrate

Class CDOTA_Ability_Nian_Roar

int GetCastCount() Number of times Nian has used the roar

Class CDOTA_Item

float GetPurchaseTime() Get the purchase time of this item

int GetInitialCharges() Get the initial number of charges this item has.

handle GetContainer() Get the container for this item.

void SetPurchaseTime(float) Set the purchase time of this item

void Think() Think this item

void LaunchLoot(bool, float, float, Vector)

void SetPurchaser(handle) Set the purchaser of record for this item.

int GetCurrentCharges() Get the number of charges this item currently has.

handle GetPurchaser() Get the purchaser for this item.

int GetShareability()

int GetCost()

void SetCurrentCharges(int) Set the number of charges on this item

bool IsPermanent() Is this a permanent item?

bool StacksWithOtherOwners()

void SetStacksWithOtherOwners(bool)

Class CDOTA_Item_Physical

float GetCreationTime() Returns the game time when this item was created in the world

void SetContainedItem(handle) Set the contained item.

handle GetContainedItem() Returned the contained item.

Class CDOTA_Item_DataDriven

void ApplyDataDrivenModifier(handle, handle, string, handle) Applies a data driven modifier to the target

Class CDOTA_Unit_Nian

handle GetTail() Is the Nian's tail broken?

bool IsTailAlive() Is the Nian's tail broken?

bool IsHornAlive() Is the Nian's horn broken?

handle GetHorn() Is the Nian horn?

Class CBasePlayer

bool IsNoclipping() Returns true if the player is in noclip mode.

Class CDOTAPlayer

handle GetControlledRPGUnit() Get the RPG unit this player controls.

handle GetAssignedHero() Get the player's hero.

int GetPlayerID() Get the player's official PlayerID; notably is -1 when the player isn't yet on a team.

void SetKillCamUnit(handle) Set the kill cam unit for this hero.

void SetMusicStatus(int, float) (nMusicStatus, flIntensity) - Set the music status for this player, note this will only really apply if dota_music_battle_enable is off.

void MakeRandomHeroSelection() Randoms this player's hero.

Class CDOTA_PlayerResource

int GetDenies(int)

int GetGoldSpentOnConsumables(int)

bool GetPlayerReservedState(int)

int GetEventPremiumPointsGranted(int)

bool IsValidPlayerID(int)

int GetTeam(int)

int GetNthPlayerIDOnTeam(int, int)

int GetCustomBuybackCost(int)

bool IsValidTeamPlayer(int)

string GetPlayerName(int)

int GetEventPointsForPlayerID(int)

void SetCustomBuybackCooldown(int, float) Set the buyback cooldown for this player.

int GetTowerDamageTaken(int)

int GetAegisPickups(int)

void SetHasRandomed(int)

void SetCameraTarget(int, handle) (playerID, entity) - force the given player's camera to follow the given entity

void IncrementLastHitMultikill(int)

int GetEventRankGranted(int)

bool IsDisableHelpSetForPlayerID(int, int)

int GetRoshanKills(int)

int GetMisses(int)

void SetCustomBuybackCost(int, int) Set the buyback cost for this player.

handle ReplaceHeroWith(int, string, int, int) (playerID, heroClassName, gold, XP) - replaces the player's hero with a new one of the specified class, gold and XP

int GetClaimedDenies(int)

void IncrementTotalEarnedXP(int, int)

int GetLastHits(int)

bool IsValidPlayer(int)

void SetBuybackGoldLimitTime(int, float)

void SetBuybackCooldownTime(int, float)

void ClearLastHitMultikill(int)

int ModifyGold(int, int, bool, int) ( iPlayerID, iGoldChange, bReliable, iReason )

handle GetNthCourierForTeam(int, int)

int GetGoldSpentOnSupport(int)

int GetNumCouriersForTeam(int)

void AddRunePickup(int)

bool AreUnitsSharedWithPlayerID(int, int) ( nPlayerID, nOtherPlayerID )

void SetUnitShareMaskForPlayer(int, int, int, bool) ( nPlayerID, nOtherPlayerID, nFlag, bState )

bool IsHeroSharedWithPlayerID(int, int)

int GetUnitShareMaskForPlayer(int, int)

<unknown> GetSteamAccountID(int)

int GetCreepDamageTaken(int)

void SetLastBuybackTime(int, int)

float GetTimeOfLastConsumablePurchase(int)

float GetTimeOfLastItemPurchase(int)

int GetGold(int)

void HeroLevelUp(int)

<unknown> GetConnectionState(int)

float GetCustomBuybackCooldown(int)

void SetPlayerReservedState(int, bool)

int GetRawPlayerDamage(int)

void IncrementStreak(int)

void IncrementClaimedMisses(int)

int GetTotalEarnedXP(int)

int GetGoldSpentOnItems(int)

string GetSelectedHeroName(int)

int GetRespawnSeconds(int)

bool GetPlayerLoadedCompletely(int)

bool HaveAllPlayersJoined()

bool IsFakeClient(int)

int GetDamageDoneToHero(int, int)

bool IsHeroSelected(string)

<unknown> GetBroadcasterChannelSlot(int)

<unknown> GetBroadcasterChannel(int)

int GetLevel(int)

bool HasRandomed(int)

int GetTeamKills(int)

bool IsBroadcaster(int)

bool IsValidTeamPlayerID(int)

void SpendGold(int, int, int)

float GetHealing(int)

void IncrementLastHits(int)

void IncrementMisses(int)

int GetTotalGoldSpent(int)

void IncrementClaimedDenies(int)

handle GetPlayer(int)

void IncrementDenies(int)

void SetGold(int, int, bool)

float GetXPPerMin(int)

float GetTimeOfLastDeath(int)

int GetGoldBagsCollected(int)

int GetUnreliableGold(int)

int GetAssists(int)

float GetGoldPerMin(int)

int GetDeaths(int)

int WhoSelectedHero(string)

int GetLastHitMultikill(int)

void IncrementKills(int, int)

int GetLastHitStreak(int)

void IncrementAssists(int)

void IncrementLastHitStreak(int)

void ClearLastHitStreak(int)

int GetKills(int)

void IncrementNearbyCreepDeaths(int)

int GetTotalEarnedGold(int)

void IncrementGoldBagsCollected(int)

void ResetBuybackCostTime(int)

void UpdateTeamSlot(int, int)

int GetGoldSpentOnBuybacks(int)

float GetStuns(int)

handle GetSelectedHeroEntity(int)

int GetClaimedMisses(int)

bool HasSelectedHero(int)

int GetNearbyCreepDeaths(int)

int GetNumConsumablesPurchased(int)

void ClearRawPlayerDamageMatrix(int)

int GetStreak(int)

int GetKillsDoneToHero(int, int)

int GetTowerKills(int)

void AddAegisPickup(int)

void AddClaimedFarm(int, float)

void ResetTotalEarnedGold(int)

int GetHeroDamageTaken(int)

void IncrementDeaths(int)

void AddGoldSpentOnSupport(int, int)

int GetSelectedHeroID(int)

int GetRunePickups(int)

int GetNumItemsPurchased(int)

float GetClaimedFarm(int)

int GetReliableGold(int)

bool HasRepicked(int)

void SetHasRepicked(int)

void ClearStreak(int)

int GetGoldLostToDeath(int)

void ClearKillsMatrix(int)

Class CDOTA_BaseNPC

void ForceKill(bool) Kill this unit immediately.

int GetAbilityCount()

float GetAdditionalBattleMusicWeight() Combat involving this creature will have this weight added to the music calcuations

int GetPlayerOwnerID() Get the owner player ID for this unit.

void EjectItemFromStash(handle) Drops the selected item out of this unit's stash.

int GetBaseDayTimeVisionRange() Returns the vision range before modifiers.

bool IsMuted()

bool IsAttackingEntity(handle)

bool IsMechanical() Is the unit mechanical?

bool IsRealHero() Is this a real hero?

void SetDayTimeVisionRange(int) Set the base vision range.

float GetModelRadius()

int GetAverageTrueAttackDamage() Returns the average value of the minimum and maximum damage values.

void RemoveModifierByName(string) Removes a modifier

void DropItemAtPositionImmediate(handle, Vector) Immediately drop a carried item at a given position.

float GetPaddedCollisionRadius() Get the collision hull radius (including padding) of this NPC

float GetAttackSpeed()

float GetManaRegen()

void MoveToTargetToAttack(handle) Move to a target to attack.

bool IsDeniable()

void SetHullRadius(float) Set the collision hull radius of this NPC

float GetAttackRange() Gets this unit's attack range after all modifiers.

void SetMana(float) Set the mana on this unit.

handle GetInitialGoalEntity() Returns the initial waypoint goal for this NPC

string GetUnitName()

void RespawnUnit() Respawns the target unit if it can be respawned.

float GetRangeToUnit(handle)

void CastAbilityImmediately(handle, int) Cast an ability immediately.

void SetNightTimeVisionRange(int) Set the base vision range.

void RemoveAbility(string) Remove an ability from this unit by name.

bool IsAncient() Is this creature an Ancient?

void SetStolenScepter(bool)

float GetHealthRegen()

int GetAttackDamage() Returns a random integer between the minimum and maximum base damage of the unit.

void Stop() Stop the current order.

handle GetAbilityByIndex(int) Retrieve an ability by index from the unit.

void SetInitialGoalEntity(handle) Sets the initial waypoint goal for this NPC

void SetOriginalModel(string) Sets the original model of this entity, which it will tend to fall back to anytime its state changes

bool IsOutOfGame()

float GetCreationTime()

void RemoveItem(handle) Removes the passed item from this unit's inventory.

int GetNightTimeVisionRange() Returns the vision range after modifiers.

void AngerNearbyUnits()

void InterruptChannel()

bool UnitCanRespawn()

bool NotOnMinimapForEnemies()

int GetHealthPercent() Get the current health percent of the unit.

bool IsPhantomBlocker()

void MakePhantomBlocker()

handle FindAbilityByName(string) Retrieve an ability by name from the unit.

bool HasAbility(string) See whether this unit has an ability by name.

void MakeVisibleDueToAttack(int)

bool IsInvulnerable()

float GetAttackRangeBuffer() Gets the attack range buffer.

void SetBaseDamageMin(int) Sets the minimum base damage.

bool IsFrozen()

int GetBaseNightTimeVisionRange() Returns the vision range before modifiers.

void DropItemAtPosition(Vector, handle) Drop an item at a given point.

void MakeVisibleToTeam(int, float) ( iTeam, flDuration )

int GetOpposingTeamNumber()

int GetModifierCount() How many modifiers does this unit have?

void SetCursorPosition(Vector)

float GetHullRadius() Get the collision hull radius of this NPC

bool IsOpposingTeam(int)

void SetIdleAcquire(bool)

bool ShouldIdleAcquire()

bool IsPositionInRange(Vector, float)

void InterruptMotionControllers(bool) Parameter boolean determines finding clear space.

void SetControllableByPlayer(int, bool) Set this unit controllable by the player with the passed ID.

void RemoveNoDraw() Remove the no draw flag.

void ReduceMana(float) Remove mana from this unit, this can be used for involuntary mana loss, not for mana that is spent.

void SetBaseManaRegen(float)

void Interrupt()

Vector GetCursorPosition()

float GetBaseAttackTime()

int GetDayTimeVisionRange() Returns the vision range after modifiers.

void MoveToNPC(handle) Move to follow a unit.

bool IsUnableToMiss()

void RemoveModifierByNameAndCaster(string, handle) Removes a modifier that was cast by the given caster

void SetForceAttackTarget(handle)

bool HasAttackCapability()

float GetAttacksPerSecond()

int GetBaseDamageMin() Gets the minimum base damage.

handle GetForceAttackTarget()

void AlertNearbyUnits(handle, handle)

bool IsCreature() Is this a Creature type NPC

handle GetAttackTarget()

void PerformAttack(handle, bool, bool, bool, bool) Performs an attack on a target. Params: Target, bUseCastAttackOrb, bProcessProcs, bSkipCooldown, bIgnoreInvis

int GetDeathXP() Get the XP bounty on this unit

void SetAttacking(handle)

void SetHasInventory(bool)

void ModifyHealth(int, handle, bool, int) Sets the health to a specific value, with optional flags or inflictors.

bool IsMagicImmune()

float GetAttackAnimationPoint()

float TimeUntilNextAttack()

void AttackNoEarlierThan(float)

void SetBaseMagicalResistanceValue(float) Sets base magical armor value.

void AddAbility(string) Add an ability to this unit by name.

bool HasItemInInventory(string) See whether this unit has an item by name.

bool AttackReady()

void SetDeathXP(int) Set the XP bounty on this unit

float GetBaseHealthRegen()

int GetTeamNumber() Get the team number of this unit.

float GetStatsBasedManaRegen() Returns mana regen rate per intelligence.

string GetUnitLabel()

bool IsHardDisarmed()

float GetMoveSpeedModifier(float)

float GetMana() Get the mana on this unit.

void AddNewModifier(handle, handle, string, handle) Add a modifier to this unit

void SwapAbilities(string, string, bool, bool) Swaps the slots of the two passed abilities and sets them enabled/disabled: const char* AbilityName1, const char* AbilityName2, bool bEnable1, bool bEnable2. The boolean controls which ability is active. The ability order is never swapped when swapping abilities, only the boolean statements are flipped.

void SetUnitName(string)

bool IsPhased()

void SetRangedProjectileName(string)

void SpendMana(float, handle) Spend mana from this unit, this can be used for spending mana from abilities or item usage.

int GetProjectileSpeed()

bool HasFlyingVision()

bool HasMovementCapability()

bool IsCommandRestricted()

bool HasGroundMovementCapability()

void SetMoveCapability(int)

void SellItem(handle) Sells the passed item in this unit's inventory.

bool IsSoftDisarmed()

float GetMagicalArmorValue() Returns current magical armor value.

void SetMinimumGoldBounty(int) Set the minimum gold bounty for this unit.

void SetAttackCapability(int)

bool HasScepter()

bool IsMovementImpaired()

bool IsIdle() Is this creature currently idle?

bool IsRangedAttacker() Is this unit a ranged attacker?

void SetBaseHealthRegen(float)

void SetBaseMoveSpeed(int)

void SetMaximumGoldBounty(int) Set the maximum gold bounty for this unit.

float GetPercentageBasedManaRegen() This Mana regen is derived from % bonuses (from items like Void Stone).

handle GetItemInSlot(int) Returns nth item in inventory slot (index is zero based)

bool NoTeamMoveTo()

int GetBaseDamageMax() Gets the minimum base damage.

int GetTotalPurchasedUpgradeGoldCost() Get how much gold has been spent on ability upgrades.

bool IsBlind()

void GiveMana(float) Give mana to this unit, this can be used for mana gained by abilities or item usage.

bool IsDominated()

bool GetMustReachEachGoalEntity() Get whether this NPC is required to reach each goal entity, rather than being allowed to 'unkink' their path

bool PassivesDisabled()

void PickupRune(handle) Pick up a rune.

int GetManaPercent() Get the percent of mana remaining.

bool IsStunned()

bool HasInventory()

void MoveToNPCToGiveItem(handle, handle) Give an item to another unit.

bool NoHealthBar()

bool IsLowAttackPriority()

bool NotOnMinimap()

handle GetCursorCastTarget()

bool IsInvisible()

bool HasFlyMovementCapability()

bool IsSpeciallyDeniable()

int GetGoldBounty() Get the gold bounty on this unit

void AddNoDraw() Adds the no draw flag.

void AddItem(handle) Add an item to this unit's inventory.

bool IsUnselectable()

void SetBaseAttackTime(float)

float GetBaseMoveSpeed()

bool IsBlockDisabled()

bool IsNightmared()

bool GetCursorTargetingNothing()

bool HasModifier(string) Sees if this unit has a given modifier

float GetHasteFactor()

bool NoUnitCollision()

bool IsHexed()

float GetCastPoint(bool) Parameter: bAttack

float GetConstantBasedManaRegen() This Mana regen is derived from constant bonuses like Basilius.

int GetLevel() Returns the level of this unit.

void SetCursorTargetingNothing(bool)

bool IsHero() Is this a hero or hero illusion?

string GetModifierNameByIndex(int) Get a modifier name by index.

bool IsSilenced()

bool IsAttackImmune()

bool IsDisarmed()

bool IsAttacking()

void MoveToPosition(Vector) Issue a Move-To command

bool ProvidesVision()

void MoveToPositionAggressive(Vector) Issue an Attack-Move-To command

void SetCursorCastTarget(handle)

void SetPhysicalArmorBaseValue(float) Sets base physical armor value.

bool IsRooted()

bool TriggerModifierDodge()

bool TriggerSpellAbsorb(handle) Query whether the passed ability will trigger spell absorb on this unit.

float GetIdealSpeed() Returns speed after all modifiers.

void MakeIllusion()

bool IsIllusion()

float GetSecondsPerAttack()

void SetMustReachEachGoalEntity(bool) Set whether this NPC is required to reach each goal entity, rather than being allowed to 'unkink' their path

int GetMaxHealth() Get the maximum health of this unit.

int GetBaseAttackRange() Gets this unit's attack range before modifiers.

bool IsEvadeDisabled()

float GetMaxMana() Get the maximum mana of this unit.

void SetBaseDamageMax(int) Sets the minimum base damage.

int GetHealth() Get the health of this unit.

int GetMainControllingPlayer() Returns the player ID of the controlling player.

void Heal(float, handle) Heal this unit.

float GetIncreasedAttackSpeed()

void PickupDroppedItem(handle) Pick up a dropped item.

bool IsPhantom() Is this a phantom unit?

void Hold() Hold position.

bool IsNeutralUnitType() Is this a neutral?

void DisassembleItem(handle) Disassemble the passed item in this unit's inventory.

float GetBaseMagicalResistanceValue() Returns base magical armor value.

float GetCollisionPadding() Returns the size of the collision padding around the hull.

bool IsAlive() Is this unit alive?

bool NoTeamSelect()

void CastAbilityOnTarget(handle, handle, int) Cast an ability on a target entity.

void CastAbilityOnPosition(Vector, handle, int) Cast an ability on a position.

handle GetPlayerOwner() Returns the player that owns this unit

bool IsSummoned() Is this unit summoned?

bool IsTower() Is this a tower?

void SetNeverMoveToClearSpace(bool) If set to true, we will never attempt to move this unit to clear space, even when it unphases.

void SetAdditionalBattleMusicWeight(float) Combat involving this creature will have this weight added to the music calcuations

float GetBaseMaxHealth() Gets the base max health value.

int GetHealthDeficit() Returns integer amount of health missing from max.

float GetAcquisitionRange() Gets the range at which this unit will auto-acquire.

float GetLastIdleChangeTime() Get the last game time that this unit switched to/from idle state.

void SetBaseMaxHealth(float) Set a new base max health value.

void Kill(handle, handle) Kills this NPC, with the params Ability and Attacker

void CastAbilityNoTarget(handle, int) Cast an ability with no target. ( hAbility, iPlayerIndex )

int GetCurrentVisionRange() Gets the current vision range.

void CastAbilityToggle(handle, int) Toggle an ability. ( hAbility, iPlayerIndex )

bool IsOwnedByAnyPlayer() Is this unit owned by any non-bot player?

float GetPhysicalArmorBaseValue() Returns base physical armor value.

handle GetCurrentActiveAbility() Get the ability this unit is currently casting.

bool IsControllableByAnyPlayer() Is this unit controlled by any non-bot player?

float GetPhysicalArmorValue() Returns current physical armor value.

float BoundingRadius2D()

Class CDOTA_BaseNPC_Hero

float GetPhysicalArmorValue() Hero armor is affected by attributes.

int GetDenies() Value is stored in PlayerResource.

float GetIntellect()

bool ShouldDoFlyHeightVisual()

int GetPlayerID() Returns player ID of the player owning this hero

int GetLastHits() Value is stored in PlayerResource.

float GetBaseAgility()

bool IsReincarnating()

void SetBaseAgility(float)

void IncrementLastHitMultikill() Value is stored in PlayerResource.

void RespawnHero(bool, bool, bool) Respawn this hero.

float GetBaseStrength()

int GetDeathGoldCost()

float GetManaRegen() Hero mana regen is affected by attributes.

void ClearLastHitMultikill() Value is stored in PlayerResource.

int ModifyGold(int, bool, int) Gives this hero some gold. Args: int nGoldChange, bool bReliable, int reason

float GetPrimaryStatValue()

void ClearStreak() Value is stored in PlayerResource.

float GetAgility()

void SetBuybackGoldLimitTime(float) Set the amount of time gold gain is limited after buying back.

void CalculateStatBonus() Recalculate all stats after the hero gains stats.

float GetBuybackCooldownTime() Return float value for the amount of time left on cooldown for this hero's buyback.

int GetGoldBounty()

float GetHealthRegen() Hero health regen is affected by attributes.

void IncrementStreak() Value is stored in PlayerResource.

bool IsBuybackDisabledByReapersScythe()

int GetBuybackCost() Return integer value for the gold cost of a buyback.

bool CanEarnGold() Returns boolean value result of buyback gold limit time less than game time.

float GetStrength()

float GetAgilityGain()

int GetNumAttackers()

int GetCurrentXP() Returns the amount of XP

void SetAbilityPoints(int) Sets the current unspent ability point's.

void SetRespawnPosition(Vector)

void ModifyIntellect(float) Adds passed value to base attribute value, then calls CalculateStatBonus.

void SpendGold(int, int) Args: int nGold, int nReason

bool UnitCanRespawn()

int GetGold() Returns gold amount for the player owning this hero

void PerformTaunt()

void HeroLevelUp(bool) Levels up the hero, true or false to play effects.

void SetGold(int, bool) Sets the gold amount for the player owning this hero

bool HasAnyAvailableInventorySpace()

void KilledHero(handle, handle) Args: Hero, Inflictor

int GetAbilityPoints() Gets the current unspent ability point's.

int HasRoomForItem(string, bool, bool) Args: const char* pItemName, bool bIncludeStashCombines, bool bAllowSelling

int GetAssists() Value is stored in PlayerResource.

void SetTimeUntilRespawn(float)

int GetDeaths() Value is stored in PlayerResource.

float GetTimeUntilRespawn()

void UpgradeAbility(handle) This upgrades the passed ability if it exists and the hero has enough ability point's.

void IncrementKills(int) Passed ID is for the victim, killer ID is ID of the current hero. Value is stored in PlayerResource.

int GetPrimaryAttribute() 0 = strength, 1 = agility, 2 = intelligence.

void IncrementAssists() Value is stored in PlayerResource.

bool HasFlyingVision()

int GetAttacker(int)

int GetKills() Value is stored in PlayerResource.

float GetIncreasedAttackSpeed() Hero attack speed is also affected by agility.

void IncrementLastHitStreak() Value is stored in PlayerResource.

bool HasOwnerAbandoned()

bool WillReincarnate()

bool AddExperience(float, bool) Params: Float XP, Bool applyBotDifficultyScaling

int GetMultipleKillCount()

void RecordLastHit()

void IncrementLastHits() Value is stored in PlayerResource.

float GetStatsBasedManaRegen() Returns only the regen based on Intelligence.

float GetBuybackGoldLimitTime() Returns the amount of time gold gain is limited after buying back.

void SetCustomDeathXP(int)

Sets a custom experience value for this hero.

Tip.png Tip: GameRules boolean must be set for this to work!

int GetBaseDamageMax() Hero damage is also affected by attributes.

int GetBaseDamageMin() Hero damage is also affected by attributes.

int GetStreak() Value is stored in PlayerResource.

float GetMostRecentDamageTime()

void SetBuyBackDisabledByReapersScythe(bool)

void Buyback() Spend the gold and buyback with this hero.

void SetBaseStrength(float)

void SetBaseIntellect(float)

float GetStrengthGain()

void IncrementDeaths() Value is stored in PlayerResource.

float GetRespawnTime()

void ModifyAgility(float) Adds passed value to base attribute value, then calls CalculateStatBonus.

float GetIntellectGain()

void ClearLastHitStreak() Value is stored in PlayerResource.

void IncrementNearbyCreepDeaths() Value is stored in PlayerResource.

float GetBaseIntellect()

void SetPlayerID(int)

void SetBuybackCooldownTime(float) Sets the buyback cooldown time.

int GetBonusDamageFromPrimaryStat()

void IncrementDenies() Value is stored in PlayerResource.

void ModifyStrength(float) Adds passed value to base attribute value, then calls CalculateStatBonus.

Class CDOTA_BaseNPC_Creature

void SetHPRegenGain(float) Set the hit point's regen gained per level on this creature.

void SetDisableResistanceGain(float) Set the disable resistance gained per level on this creature.

void SetAttackTimeGain(float) Set the attack time gained per level on this creature.

void SetMoveSpeedGain(int) Set the move speed gained per level on this creature.

void CreatureLevelUp(int) Level the creature up by the specified number of levels

void SetBountyGain(int) Set the bounty gold gained per level on this creature.

void SetXPGain(int) Set the xp reward gained per level on this creature.

void SetChampion(bool) Flag this unit as a champion creature.

void AddItemDrop(handle) Add the specified item drop to this creature

void SetManaRegenGain(float) Set the mana point's regen gained per level on this creature.

void SetDamageGain(int) Set the damage gained per level on this creature.

void SetMagicResistanceGain(float) Set the magic resistance gained per level on this creature.

void SetHPGain(int) Set the hit point's gained per level on this creature.

bool IsChampion() Is this unit a champion?

void SetManaGain(int) Set the mana point's gained per level on this creature.

void SetArmorGain(float) Set the armor gained per level on this creature.

Class CDOTA_BaseNPC_Building

void SetInvulnCount(int) Set the invulnerability counter of this building.

int GetInvulnCount() Get the invulnerability count for a building.

Class CRPG_Unit

bool IsFacing(Vector, float) ( vecTargetPosition, flAngleTolerance ) - returns true if the unit is within flAngleTolerance degrees of the target position

void SetSightConeAngle(float) ( flAngleDegrees ) - sets angle in which the unit can see things up to sight range

handle ActionState() return the ActionState object for this unit.

table FindSensedEnemies() returns list of all enemy units within this unit's sight cone or sensing sphere

string GetUnitName() get the unit name for this unit.

float GetMaxStamina() returns maximum stamina amount.

void SetBlocking(bool) ( bShouldBlock ) - Set the blocking state of this unit.

float GetStamina() returns current stamina amount.

handle GetMovementTargetEntity() Returs the movement target entity, if set.

bool IsBlocking() is this unit blocking?

float GetSensingSphereRange() returns range of unit's 360 degree sensing sphere

void SetMovementTargetEntity(handle, float) ( hTargetEntity, flTargetRange ) - Try to move this unit to the given range from the target entity.

void SetTurnRate(float) ( flTurnRate ) - sets unit's turn rate in degrees per second

float GetSightConeAngle() returns angle in which the unit can see things up to sight range

float GetMaxSpeed() returns unit's max speed

void GrantItem(string, bool) ( sItemName ) - grant an item to the unit by name.

void SetMovementTargetPosition(Vector, float) ( vecTargetPosition, flTargetRange ) - Try to move this unit to the given range from the target point.

void ClearMovementTarget() Clear any movement target entity/position.

void SetSightConeRange(float) ( fRange ) - set range of unit's sight cone

void SetMaxSpeed(float) ( flMaxSpeed ) - sets unit's max speed

float GetSightConeRange() returns range of unit's sight cone

float GetTurnRate() returns unit's turn rate in degrees per second

void SetSensingSphereRange(float) ( flSightRange ) - set range of unit's 360 degree sensing sphere

Class CDOTABaseGameMode

void SetCustomHeroMaxLevel(int) Allows definition of the max level heroes can achieve (default is 25).

void SetUseCustomHeroLevels(bool) Turn on custom-defined XP values for hero level ups. The table should be defined before switching this on.

void SetBuybackEnabled(bool) Enables or disables buyback completely

void SetCustomXPRequiredToReachNextLevel(handle) Allows definition of a table of hero XP values.

void SetBotThinkingEnabled(bool) Enables/Disables bot thinking. Requires a very Dota PvP-like map with 3 lanes, a shop, etc.

void SetCustomBuybackCostEnabled(bool) Turns on capability to define custom buyback costs.

void SetTopBarTeamValuesVisible(bool) Turning on/off the team values on the top game bar.

void SetTopBarTeamValuesOverride(bool) Override the values of the team values on the top game bar.

void SetAlwaysShowPlayerInventory(bool) Show the player hero's inventory in the HUD, regardless of what unit is selected.

void SetRemoveIllusionsOnDeath(bool) Make it so illusions are immediately removed upon death, rather than sticking around for a few seconds.

void ClientLoadGridNav() Tell clients that they need to load gridnav information. Used for things like allowing clients to identify valid locations to place buildings.

void SetFogOfWarDisabled(bool) Turn the fog of war on or off.

void SetRecommendedItemsDisabled(bool) Turn the panel for showing recommended items at the shop off/on. Takes a bool.

void SetGoldSoundDisabled(bool) Turn the sound when gold is acquired off/on. Takes a bool.

void SetTowerBackdoorProtectionEnabled(bool) Enables/Disables tower backdoor protection

void SetTopBarTeamValue(int, int) Set the team values on the top game bar.

void SetCustomBuybackCooldownEnabled(bool) Turns on capability to define custom buyback cooldowns.

void SetOverrideSelectionEntity(handle) Set an override for the default selection entity, instead of each player's hero.

void SetCameraDistanceOverride(float) Set a different camera distance; dota default is 1134.

Class CDotaQuest

void SetTextReplaceString(string) Set the text replace string for this quest

void CompleteQuest() Mark this quest complete

void RemoveSubquest(handle) Remove a subquest from this quest

void SetTextReplaceValue(int, int) Set a quest value

handle GetSubquest(int) Finds a subquest from this quest by index

handle GetSubquestByName(string) Finds a subquest from this quest by name

void AddSubquest(handle) Add a subquest to this quest

Class CDotaSubquestBase

void SetTextReplaceString(string) Set the text replace string for this subquest

void CompleteSubquest() Mark this subquest complete

void SetTextReplaceValue(int, int) Set a subquest value

Class CPhysicsComponent

bool ExpensiveInstantRayCast(Vector, Vector, handle) Do an instant (i.e. blocking) Ray Cast. Will do a handle/queue version later. Don't plan to use this for real!

Class CPointTemplate

void ForceSpawn() ForceSpawn() : Spawns all of the entities the point_template is pointing at.

handle GetSpawnedEntities() GetSpawnedEntities() : Get the list of the most recent spawned entities

void SetSpawnCallback(handle, handle) SetSpawnCallback( hCallbackFunc, hCallbackScope, hCallbackData ) : Set a callback for when the template spawns entities. The spawned entities will be passed in as an array.

void DeleteCreatedSpawnGroups() DeleteCreatedSpawnGroups() : Deletes any spawn groups that this point_template has spawned. Note: The point_template will not be deleted by this.

Class CBodyComponent

void SetAnimation(string) Pass string for the animation to play on this model

void SetVelocity(Vector)

void SetBodyGroup(string)

void AddImpulseAtPosition(Vector, Vector) Apply an impulse at a worldspace position to the physics

void SetMaterialGroup(utlstringtoken)

void SetAngularVelocity(Vector)

<unknown> LookupSequence(string) Returns a sequence id given a name

float SequenceDuration(string) Returns the duration in seconds of the specified sequence

void AddVelocity(Vector, Vector) Add linear and angular velocity to the physics object

bool IsAttachedToParent() Is attached to parent

void DetachFromParent() Detach from its parent

<unknown> GetSequence() Returns the active sequence

Class CBaseAnimating

bool IsSequenceFinished() Ask whether the main sequence is done playing

int ScriptLookupAttachment(string) Get the named attachment id

void SetModelScale(float) ( flScale ) - set scale of entity's model

Vector GetAttachmentAngles(int) Get the attachement id's angles as a p,y,r vector

float SetPoseParameter(string, float) Set the specified pose parameter to the specified value

Vector GetAttachmentOrigin(int) Get the attachement id's origin vector

void SetBodygroup(int, int) Sets a bodygroup

Class CBaseCombatCharacter

table GetEquippedWeapons() GetEquippedWeapons() : Returns an array of all the equipped weapons

int GetWeaponCount() GetWeaponCount() : Gets the number of weapons currently equipped

Class ProjectileManager

void ProjectileDodge(handle) Makes the specified unit dodge projectiles

int CreateLinearProjectile(handle) Creates a linear projectile and returns the projectile ID

void DestroyLinearProjectile(int) Destroys the linear projectile matching the argument ID

void CreateTrackingProjectile(handle) Creates a tracking projectile

Class CBaseTrigger

void Enable() Enable the trigger

bool IsTouching(handle) Checks whether the passed entity is touching the trigger.

void Disable() Disable the trigger

Class CEnvEntityMaker

void SpawnEntityAtEntityOrigin(handle) Create an entity at the location of a specified entity instance

void SpawnEntityAtNamedEntityOrigin(string) Create an entity at the location of a named entity

void SpawnEntityAtLocation(Vector, Vector) Create an entity at a specified location and orientaton, orientation is Euler angle in degrees (pitch, yaw, roll)

void SpawnEntity() Create an entity at the location of the maker

Class CDOTAVoteSystem

void StartVote(handle) Starts a vote, based upon a table of parameters

Class CMarkupVolumeTagged

bool HasTag(string) Does this volume have the given tag.

Class CScriptPrecacheContext

table GetValue(string) Reads a spawn key

void AddResource(string) Precaches a specific resource

Class CScriptKeyValues

table GetValue(string) Reads a spawn key

Class CScriptParticleManager

void SetParticleAlwaysSimulate(int)

void SetParticleControl(int, int, Vector) Set the control point data for a control on a particle effect

int CreateParticleForPlayer(string, int, handle, handle) Creates a new particle effect that only plays for the specified player

void ReleaseParticleIndex(int) Frees the specified particle index

string GetParticleReplacement(string, handle)

void SetParticleControlEnt(int, int, handle, int, string, Vector, bool)

int CreateParticle(string, int, handle) Creates a new particle effect

Class CScriptHeroList

handle GetHero(int) Get the Nth hero in the Hero List

table GetAllHeroes() Returns all the heroes in the world

int GetHeroCount() Returns the number of heroes in the world

Class CNativeOutputs

void Init(int) Initialize with number of outputs

void AddOutput(string, string) Add an output

Class CEnvProjectedTexture

void SetVolumetrics(bool, float, float, int, float) Turn on/off light volumetrics: bool bOn, float flIntensity, float flNoise, int nPlanes, float flPlaneOffset

void SetFarRange(float) Set light maximum range

void SetQuadraticAttenuation(float) Set light quadratic attenuation value

void SetNearRange(float) Set light minimum range

void SetLinearAttenuation(float) Set light linear attenuation value

Class CInfoData

string QueryString(utlstringtoken, string) Query string data for this key

float QueryNumber(utlstringtoken, float) Query number data for this key

int QueryInt(utlstringtoken, int) Query int data for this key

Vector QueryColor(utlstringtoken, Vector) Query color data for this key

Vector QueryVector(utlstringtoken, Vector) Query vector data for this key

float QueryFloat(utlstringtoken, float) Query float data for this key

Class CPhysicsProp

void DisableMotion() Enable motion for the prop

void EnableMotion() Enable motion for the prop

Class CDOTAGamerules

void SetPostGameTime(float) Sets the amount of time players have between the game ending and the server disconnecting them.

<unknown> State_Get() Get the current Gamerules state

void MakeTeamLose(int) Makes ths specified team lose

void Defeated() Kills the ancient, etc.

void ResetToHeroSelection() Restart the game at hero selection

void SendCustomMessage(string, int, int) Sends a string to the defined team.

void SetCreepMinimapIconScale(float) (flMinimapCreepIconScale) - Scale the creep icons on the minimap.

float GetNianFightStartTime() Gets the start time for the Nian fight

int NumDroppedItems() Returns the number of items currently dropped on the ground

void SetGoldTickTime(float) Set the time interval between auto gold increases.

bool GetMatchSignoutComplete() Have we received the post match signout message that includes reward information

int GetDifficulty() Returns difficulty level of the custom game mode

void ResetDefeated() Restart after killing the ancient, etc.

int GetNianTotalDamageTaken() For New Bloom, get total damage taken by the Nian / Year Beast

void SetHeroRespawnEnabled(bool) Control if the normal DOTA hero respawn rules apply.

void SetGameWinner(int) Makes ths specified team win

void SetHeroSelectionTime(float) Sets the amount of time players have to pick their hero.

void SetUseUniversalShopMode(bool) When true, all items are available at as long as any shop is in range.

void SetCustomGameDifficulty(int) Set the difficulty level of the custom game mode

void SetUseCustomHeroXPValues(bool) Allows heroes in the map to give a specific amount of XP (this value must be set).

void Playtesting_UpdateAddOnKeyValues() Updates custom hero, unit and ability KeyValues in memory with the latest values from disk

bool IsDaytime() Is it day time.

handle GetDroppedItem(int) Gets the Xth dropped item

void SetTreeRegrowTime(float) Sets the tree regrow time in seconds.

void SetFirstBloodActive(bool) Sets whether First Blood has been triggered.

handle GetGameModeEntity() Get the game mode entity

bool DidMatchSignoutTimeOut() true when we have waited some time after end of the game and not received signout

void SetTimeOfDay(float) Set the time of day.

int GetCustomGameDifficulty() Returns the difficulty level of the custom game mode

void SetOverlayHealthBarUnit(handle, int) Show this unit's health on the overlay health bar

void SetSameHeroSelectionEnabled(bool) When true, players can repeatedly pick the same hero.

void SetGoldPerTick(int) Set the auto gold increase per timed interval.

void SetPreGameTime(float) Sets the amount of time players have between picking their hero and game start.

float GetGameTime() Returns the number of seconds elapsed since map start. This time doesn't count up when the game is paused

void SetUseBaseGoldBountyOnHeroes(bool) Heroes will use the basic NPC functionality for determining their bounty, rather than DOTA specific formulas.

void SetRuneSpawnTime(float) Sets the amount of time between rune spawns.

void SetNianFightStartTime(float) Sets the start time for the Nian fight

void SetHeroMinimapIconSize(int) (nMinimapHeroIconSize) - Set the hero minimap icon size.

void SetSafeToLeave(bool) (bSafeToLeave) - Mark this game as safe to leave.

float GetTimeOfDay() Get the time of day

void SetRuneMinimapIconScale(float) (flMinimapRuneIconScale) - Scale the rune icons on the minimap.

Class CToneMapControllerComponent

float GetMinExposure() Gets min exposure for this tonemap controller

float GetMaxExposure() Gets max exposure for this tonemap controller

float GetBloomScale() Gets bloomscale for this tonemap controller

void SetMaxExposure(float) Sets max exposure for this tonemap controller

void SetMinExposure(float) Sets min exposure for this tonemap controller

void SetBloomScale(float) Sets bloom scale for this tonemap controller

Class CDebugOverlayScriptHelper

void VertArrow(Vector, Vector, float, int, int, int, int, bool, float) Draws a vertical arrow. Specify endpoint's in world space.

void Sphere(Vector, float, int, int, int, int, bool, float) Draws a wireframe sphere. Specify center in world space.

void YawArrow(Vector, float, float, float, int, int, int, int, bool, float) Draws a arrow associated with a specific yaw. Specify endpoint's in world space.

void Capsule(Vector, Quaternion, float, float, int, int, int, int, bool, float) Draws a capsule. Specify base in world space.

void SweptBox(Vector, Vector, Vector, Vector, Quaternion, int, int, int, int, float) Draws a swept box. Specify endpoint's in world space and the bounds in local space.

void EntitySkeleton(ehandle, float) Draws the skeleton of the entity

void Line2D(Vector2D, Vector2D, int, int, int, int, float) Draws a line between two point's in screenspace

void Texture(string, Vector2D, Vector2D, int, int, int, int, Vector2D, Vector2D, float) Draws a screen-space texture. Coordinates are in pixels.

void EntityAxis(ehandle, float, bool, float) Draws the axis of the entity origin

void Cross3D(Vector, float, int, int, int, int, bool, float) Draws a world-aligned cross. Specify origin in world space.

void PushAndClearDebugOverlayScope(utlstringtoken) Pushes an identifier used to group overlays. Deletes all existing overlays using this overlay id.

void Triangle(Vector, Vector, Vector, int, int, int, int, bool, float) Draws a filled triangle. Specify vertices in world space.

void Line(Vector, Vector, int, int, int, int, bool, float) Draws a line between two point's

void BoxAngles(Vector, Vector, Vector, Quaternion, int, int, int, int, bool, float) Draws an oriented box at the origin. Specify bounds in local space.

void Axis(Vector, Quaternion, float, bool, float) Draws an axis. Specify origin + orientation in world space.

void DrawTickMarkedLine(Vector, Vector, float, int, int, int, int, int, bool, float) Draws a dashed line. Specify endpoint's in world space.

void CircleScreenOriented(Vector, float, int, int, int, int, bool, float) Draws a circle oriented to the screen. Specify center in world space.

void Cross(Vector, float, int, int, int, int, bool, float) Draws a screen-aligned cross. Specify origin in world space.

void EntityText(ehandle, int, string, int, int, int, int, float) Draws text on an entity

void Circle(Vector, Quaternion, float, int, int, int, int, bool, float) Draws a circle. Specify center in world space.

void EntityAttachments(ehandle, float) Draws the attachments of the entity

void PopDebugOverlayScope() Pops the identifier used to group overlays. Overlays marked with this identifier can be deleted in a big batch.

void Cone(Vector, Vector, float, float, int, int, int, int, bool, float) Draws a wireframe cone. Specify endpoint and direction in world space.

void Box(Vector, Vector, int, int, int, int, bool, float) Draws a world-space axis-aligned box. Specify bounds in world space.

void Cross3DOriented(Vector, Quaternion, float, int, int, int, int, bool, float) Draws an oriented cross. Specify origin in world space.

void RemoveAllInScope(utlstringtoken) Removes all overlays marked with a specific identifier, regardless of their lifetime.

void EntityBounds(ehandle, int, int, int, int, bool, float) Draws bounds of an entity

void VectorText3D(Vector, Quaternion, string, int, int, int, int, bool, float) Draws 3D text. Specify origin + orientation in world space.

void FilledRect2D(Vector2D, Vector2D, int, int, int, int, float) Draws a screen-space filled 2D rectangle. Coordinates are in pixels.

void SolidCone(Vector, Vector, float, float, int, int, int, int, bool, float) Draws a solid cone. Specify endpoint and direction in world space.

void UnitTestCycleOverlayRenderType() Toggles the overlay render type, for unit tests

void HorzArrow(Vector, Vector, float, int, int, int, int, bool, float) Draws a horizontal arrow. Specify endpoint's in world space.

void PushDebugOverlayScope(utlstringtoken) Pushes an identifier used to group overlays. Overlays marked with this identifier can be deleted in a big batch.

void Text(Vector, int, string, float, int, int, int, int, float) Draws 2D text. Specify origin in world space.

Class CBaseFlex

handle GetCurrentScene() Returns the instance of the oldest active scene entity (if any).

handle GetSceneByIndex(int) Returns the instance of the scene entity at the specified index.

Class CSceneEntity

bool IsPaused() If this scene is currently paused.

float EstimateLength() Returns length of this scene in seconds.

bool LoadSceneFromString(string, string) given a dummy scene name and a vcd string, load the scene

void Start(handle) Start scene playback, takes activatorEntity as param

handle FindCamera() Get the camera

void Cancel() Cancel scene playback

bool IsPlayingBack() If this scene is currently playing.

void AddBroadcastTeamTarget(int) Adds a team (by index) to the broadcast list

void RemoveBroadcastTeamTarget(int) Removes a team (by index) from the broadcast list

handle FindNamedEntity(string) given an entity reference, such as !target, get actual entity from scene object

Class GridNav

bool IsTraversable(Vector) Checks whether the given position is traversable

bool IsNearbyTree(Vector, float, bool) (position, radius, checkFullTreeRadius?) Checks whether there are any trees overlapping the given point

bool IsBlocked(Vector) Checks whether the given position is blocked

int WorldToGridPosX(float) Get the X index of a given world X position

float GridPosToWorldCenterX(int) Get the X position of the center of a given X index

int WorldToGridPosY(float) Get the Y index of a given world Y position

float GridPosToWorldCenterY(int) Get the Y position of the center of a given Y index

void RegrowAllTrees() Causes all trees in the map to regrow

Class Convars

table GetFloat(string) GetFloat(name) : returns the convar as a float. May return null if no such convar.

table GetStr(string) GetStr(name) : returns the convar as a string. May return null if no such convar.

void SetStr(string, string) SetStr(name, val) : sets the value of the convar to the string.

void SetInt(string, int) SetInt(name, val) : sets the value of the convar to the int.

void RegisterCommand(string, handle, string, int) RegisterCommand(name, fn, helpString, flags) : register a console command.

handle GetDOTACommandClient() GetDOTACommandClient() : returns the DOTA player who issued this console command.

handle GetCommandClient() GetCommandClient() : returns the player who issued this console command.

table GetInt(string) GetInt(name) : returns the convar as an int. May return null if no such convar.

void SetFloat(string, float) SetFloat(name, val) : sets the value of the convar to the float.

void RegisterConvar(string, string, string, int) RegisterConvar(name, defaultValue, helpString, flags): register a new console variable.

table GetBool(string) GetBool(name) : returns the convar as a boolean flag.

void SetBool(string, bool) SetBool(name, val) : sets the value of the convar to the bool.