Difference between revisions of "List of Dota 2 Script Functions"

From Valve Developer Community
Jump to: navigation, search
(CDOTA_PlayerResource)
 
(17 intermediate revisions by 9 users not shown)
Line 1: Line 1:
This list contains all engine-related Lua variables, functions, and constants available for [[VScript]] in {{game link|Dota 2}}.
+
#REDIRECT [[Dota_2_Workshop_Tools/Scripting/API]]
 
 
 
 
=== CScriptParticleManager ===
 
''!Used to create and manage particle effects''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| CreateParticle
 
| <code>int CreateParticle( string particleName, int [[#Particle_Attach_Types | ParticleAttach]], [[#CBaseEntity | Entity]] owningEntity)</code>
 
| Creates a new particle effect.  Returns the particle id
 
|-
 
| CreateParticleForPlayer
 
| <code>int CreateParticleForPlayer( string particleName, int [[#Particle_Attach_Types | ParticleAttach]], [[#CBaseEntity | Entity]] owningEntity, [[#CDOTAPlayer | Player]] viewingPlayer)</code>
 
| Creates a new particle effect that only plays for the specified player
 
|-
 
| SetParticleControl
 
| <code>void SetParticleControl( int particleId, int controlIndex, vector controlData)</code>
 
| Set the control point data for a control on a particle effect
 
|-
 
| ReleaseParticleIndex
 
| <code>void ReleaseParticleIndex( int particleId )</code>
 
| Frees the specified particle index
 
|}
 
 
 
=== CDOTAGamerules ===
 
''!DOTA GameRules''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| State_Get
 
| <code>[[#Gamerules_State | GameState]] State_Get()</code>
 
| Get the current Gamerules state
 
|-
 
| GetGameTime
 
| <code>float GetGameTime()</code>
 
| Returns the number of seconds elapsed since map start. This time doesn't count up when the game is paused
 
|-
 
| GetDifficulty
 
| <code>int GetDifficulty()</code>
 
| Returns difficulty level of the custom game mode
 
|-
 
| Defeated
 
| <code>void Defeated()</code>
 
| Kills the ancient, etc.
 
|-
 
| ResetDefeated
 
| <code>void ResetDefeated()</code>
 
| Restart after killing the ancient, etc.
 
|-
 
| SetGameWinner
 
| <code>void SetGameWinner( int )</code>
 
| Makes ths specified team win
 
|-
 
| MakeTeamLose
 
| <code>void MakeTeamLose( int [[#Teams | team]] )</code>
 
| Makes ths specified team lose
 
|-
 
| GetDroppedItem
 
| <code>[[#CDOTA_Item | Item]] GetDroppedItem( int dropIndex)</code>
 
| Gets the Xth dropped item
 
|-
 
| NumDroppedItems
 
| <code>int NumDroppedItems()</code>
 
| Returns the number of items currently dropped on the ground
 
|-
 
| SendCustomMessage
 
| <code>void SendCustomMessage( string stringText, int, int )</code>
 
| Sends a string to the defined team.
 
|-
 
| SetHeroRespawnEnabled
 
| <code>void SetHeroRespawnEnabled( bool canRespawn )</code>
 
| Control if the normal DOTA hero respawn rules apply.
 
|-
 
| Playtesting_UpdateCustomKeyValues
 
| <code>void Playtesting_UpdateCustomKeyValues()</code>
 
| Updates custom hero, unit and ability KeyValues in memory with the latest values from disk
 
|-
 
| ResetToHeroSelection
 
| <code>void ResetToHeroSelection()</code>
 
| Restart the game at hero selection
 
|-
 
| SetTreeRegrowTime
 
| <code>void SetTreeRegrowTime( float seconds)</code>
 
| Sets the tree regrow time in seconds.
 
|-
 
| SetHeroSelectionTime
 
| <code>void SetHeroSelectionTime( float seconds)</code>
 
| Sets the amount of time players have to pick their hero.
 
|-
 
| SetPreGameTime
 
| <code>void SetPreGameTime( float seconds)</code>
 
| Sets the amount of time players have between picking their hero and game start.
 
|-
 
| SetPostGameTime
 
| <code>void SetPostGameTime( float seconds)</code>
 
| Sets the amount of time players have between the game ending and the server disconnecting them.
 
|-
 
| SetRuneSpawnTime
 
| <code>void SetRuneSpawnTime( float seconds)</code>
 
| Sets the amount of time between rune spawns.
 
|-
 
| SetSameHeroSelectionEnabled
 
| <code>void SetSameHeroSelectionEnabled( bool enabled)</code>
 
| When true, players can repeatedly pick the same hero.
 
|-
 
| SetUseUniversalShopMode
 
| <code>void SetUseUniversalShopMode( bool enabled)</code>
 
| When true, all items are available at as long as any shop is in range.
 
|-
 
| SetTimeOfDay
 
| <code>void SetTimeOfDay( float time)</code>
 
| Set the time of day.
 
|-
 
| SetOverlayHealthBarUnit
 
| <code>void SetOverlayHealthBarUnit( [[##CDOTA_BaseNPC | Unit]] unit, int style)</code>
 
| Show this unit's health on the overlay health bar
 
|-
 
| SetHeroMinimapIconSize
 
| <code>void SetHeroMinimapIconSize( int iconSize)</code>
 
| (nMinimapHeroIconSize) - Set the hero minimap icon size.
 
|-
 
| SetCreepMinimapIconScale
 
| <code>void SetCreepMinimapIconScale( float creepScale)</code>
 
| (flMinimapCreepIconScale) - Scale the creep icons on the minimap.
 
|-
 
| SetRuneMinimapIconScale
 
| <code>void SetRuneMinimapIconScale( float runeScale)</code>
 
| (flMinimapRuneIconScale) - Scale the rune icons on the minimap.
 
|-
 
| SetSafeToLeave
 
| <code>void SetSafeToLeave( bool safeToLeave)</code>
 
| (bSafeToLeave) - Mark this game as safe to leave.
 
|}
 
 
 
=== CEntities ===
 
''!The global list of entities''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| First
 
| <code>[[#CBaseEntity | Entity]] First()</code>
 
| Begin an iteration over the list of entities
 
|-
 
| Next
 
| <code>[[#CBaseEntity | Entity]] Next( [[#CBaseEntity | Entity]] startFrom)</code>
 
| Continue an iteration over the list of entities, providing reference to a previously found entity
 
|-
 
| CreateByClassname
 
| <code>[[#CBaseEntity | Entity]] CreateByClassname( string className)</code>
 
| Creates an entity by classname
 
|-
 
| FindByClassname
 
| <code>[[#CBaseEntity | Entity]] FindByClassname( [[#CBaseEntity | Entity]] startFrom, string className)</code>
 
| Find entities by class name. Pass 'nil' to start an iteration, or reference to a previously found entity to continue a search
 
|-
 
| FindAllByClassname
 
| <code>table FindAllByClassname( string className)</code>
 
| Find entities by class name.
 
|-
 
| FindByName
 
| <code>[[#CBaseEntity | Entity]] FindByName( [[#CBaseEntity | Entity]] startFrom, string entName)</code>
 
| Find entities by name. Pass 'nil' to start an iteration, or reference to a previously found entity to continue a search
 
|-
 
| FindAllByName
 
| <code>table FindAllByName( string name)</code>
 
| Find entities by name; returns an array of everything found.
 
|-
 
| FindInSphere
 
| <code>[[#CBaseEntity | Entity]] FindInSphere( [[#CBaseEntity | Entity]] startFrom, vector origin, float radius)</code>
 
| Find entities within a radius. Pass 'nil' to start an iteration, or reference to a previously found entity to continue a search
 
|-
 
| FindAllInSphere
 
| <code>table FindAllInSphere( vector origin, float radius)</code>
 
| Find entities within a radius.
 
|-
 
| FindByTarget
 
| <code>[[#CBaseEntity | Entity]] FindByTarget( [[#CBaseEntity | Entity]] startFrom, string targetName)</code>
 
| Find entities by targetname. Pass 'nil' to start an iteration, or reference to a previously found entity to continue a search
 
|-
 
| FindAllByTarget
 
| <code>table FindAllByTarget( string targetName)</code>
 
| Find entities by targetname.
 
|-
 
| FindByModel
 
| <code>[[#CBaseEntity | Entity]] FindByModel( [[#CBaseEntity | Entity]] startFrom, string modelName)</code>
 
| Find entities by model name. Pass 'nil' to start an iteration, or reference to a previously found entity to continue a search
 
|-
 
| FindAllByModel
 
| <code>table FindAllByModel( string modelName)</code>
 
| Find entities by model name.
 
|-
 
| FindByNameNearest
 
| <code>[[#CBaseEntity | Entity]] FindByNameNearest( string entityName, vector origin, float radius )</code>
 
| Find entities by name nearest to a point.
 
|-
 
| FindByNameWithin
 
| <code>[[#CBaseEntity | Entity]] FindByNameWithin( [[#CBaseEntity | Entity]] startFrom, string entityName, vector origin, float radius)</code>
 
| Find entities by name within a radius. Pass 'nil' to start an iteration, or reference to a previously found entity to continue a search
 
|-
 
| FindAllByNameWithin
 
| <code>table FindAllByNameWithin( stringentityName, vector origin, float radius)</code>
 
| Find entities by name within a radius.
 
|-
 
| FindByClassnameNearest
 
| <code>[[#CBaseEntity | Entity]] FindByClassnameNearest( string className, vector origin, float radius)</code>
 
| Find entities by class name nearest to a point.
 
|-
 
| FindByClassnameWithin
 
| <code>[[#CBaseEntity | Entity]] FindByClassnameWithin( [[#CBaseEntity | Entity]] startFrom, string className, vector origin, float radius)</code>
 
| Find entities by class name within a radius. Pass 'nil' to start an iteration, or reference to a previously found entity to continue a search
 
|-
 
| FindAllByClassnameWithin
 
| <code>table FindAllByClassnameWithin( string className, vector origin, float radius)</code>
 
| Find entities by class name within a radius.
 
|}
 
 
 
=== CScriptHeroList ===
 
''!The global list of heroes''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| GetHero
 
| <code>[[#CDOTA_BaseNPC_Hero | Hero]] GetHero( int heroId)</code>
 
| Get the Nth hero in the Hero List
 
|-
 
| GetHeroCount
 
| <code>int GetHeroCount()</code>
 
| Returns the number of heroes in the world
 
|-
 
| GetAllHeroes
 
| <code>table GetAllHeroes()</code>
 
| Returns all the [[#CDOTA_BaseNPC_Hero | heroes]] in the world
 
|}
 
 
 
=== Convars ===
 
''!Access to convar functions''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| GetFloat
 
| <code>float GetFloat( string varName)</code>
 
| GetFloat(name) : returns the convar as a float. May return nil if no such convar.
 
|-
 
| SetFloat
 
| <code>void SetFloat( string varName, float value)</code>
 
| SetFloat(name) : sets the convar to a float, if it exists.
 
|-
 
| GetStr
 
| <code>string GetStr( string varName)</code>
 
| GetFloat(name) : returns the convar as a string. May return nil if no such convar.
 
|-
 
| GetBool
 
| <code>bool GetBool( string varName)</code>
 
| GetBool(name) : returns the convar as a boolean flag. May return nil if no such convar.
 
|-
 
| SetBool
 
| <code>void SetBool( string varName, bool value)</code>
 
| SetBool(name, value) : sets the convar to a boolean value, if it exists.
 
|-
 
| RegisterCommand
 
| <code>void RegisterCommand( string varName, function func, string helpText, int [[#ConVar_Flags | flags]])</code>
 
| Register a console command.
 
|-
 
| RegisterConvar
 
| <code>void RegisterConvar( string name, string default, string helpText, int [[#ConVar_Flags | flags]])</code>
 
| Register a new console variable.
 
|-
 
| GetCommandClient
 
| <code>[[#CDOTAPlayer | Player]] GetCommandClient()</code>
 
| GetCommandClient() : returns the player who issued this console command.
 
|}
 
 
 
=== CBaseEntity ===
 
''Root class of all server-side entities''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| ConnectOutput
 
| <code>void ConnectOutput( string, string )</code>
 
| Adds an I/O connection that will call the named function when the specified output fires
 
|-
 
| DisconnectOutput
 
| <code>void DisconnectOutput( string, string )</code>
 
| Removes a connected script function from an I/O event.
 
|-
 
| GetHealth
 
| <code>int GetHealth()</code>
 
|
 
|-
 
| SetHealth
 
| <code>void SetHealth( int hp)</code>
 
|
 
|-
 
| GetMaxHealth
 
| <code>int GetMaxHealth()</code>
 
|
 
|-
 
| SetMaxHealth
 
| <code>void SetMaxHealth( int hp)</code>
 
|
 
|-
 
| IsAlive
 
| <code>bool IsAlive()</code>
 
|
 
|-
 
| Remove
 
| <code>void Remove()</code>
 
|
 
|-
 
| SetModel
 
| <code>void SetModel( string modelName)</code>
 
|
 
|-
 
| GetModelName
 
| <code>string GetModelName()</code>
 
| Returns the name of the model
 
|-
 
| EmitSound
 
| <code>void EmitSound( string soundName)</code>
 
| Plays a sound from this entity.
 
|-
 
| EmitSoundParams
 
| <code>void EmitSoundParams( string soundName, int pitch, float volume)</code>
 
| Plays/modifies a sound from this entity. changes sound if nPitch and/or flVol is > 0.
 
|-
 
| StopSound
 
| <code>void StopSound( string soundName)</code>
 
| Stops a named sound playing from this entity.
 
|-
 
| PrecacheSoundScript
 
| <code>void PrecacheSoundScript( string soundName)</code>
 
| Precache a sound for later playing.
 
|-
 
| GetSoundDuration
 
| <code>float GetSoundDuration( string soundName, string actorModelname)</code>
 
| Returns float duration of the sound. Takes soundname and optional actormodelname.
 
|-
 
| GetClassname
 
| <code>string GetClassname()</code>
 
|
 
|-
 
| GetName
 
| <code>string GetName()</code>
 
|
 
|-
 
| GetPreTemplateName
 
| <code>string GetPreTemplateName()</code>
 
| Get the entity name stripped of template unique decoration
 
|-
 
| GetOrigin
 
| <code>vector GetOrigin()</code>
 
|
 
|-
 
| SetAbsOrigin
 
| <code>void SetAbsOrigin( vector vec)</code>
 
| SetOrigin
 
|-
 
| SetOrigin
 
| <code>void SetOrigin( vector vec)</code>
 
|
 
|-
 
| GetForwardVector
 
| <code>vector GetForwardVector()</code>
 
| Get the forward vector of the entity
 
|-
 
| GetLeftVector
 
| <code>vector GetLeftVector()</code>
 
| Get the left vector of the entity
 
|-
 
| GetUpVector
 
| <code>vector GetUpVector()</code>
 
| Get the up vector of the entity
 
|-
 
| SetForwardVector
 
| <code>void SetForwardVector( vector forward)</code>
 
| Set the orientation of the entity to have this forward vector
 
|-
 
| GetVelocity
 
| <code>vector GetVelocity()</code>
 
|
 
|-
 
| SetVelocity
 
| <code>void SetVelocity( vector velocity)</code>
 
| This may crash the client
 
|-
 
| SetAngularVelocity
 
| <code>void SetAngularVelocity( float pitch, float yaw, float roll)</code>
 
| Set the local angular velocity
 
|-
 
| GetAngularVelocity
 
| <code>vector GetAngularVelocity()</code>
 
| Get the local angular velocity - returns a vector of pitch,yaw,roll
 
|-
 
| GetCenter
 
| <code>vector GetCenter()</code>
 
| Get vector to center of object - absolute coords
 
|-
 
| EyePosition
 
| <code>vector EyePosition()</code>
 
| Get vector to eye position - absolute coords
 
|-
 
| SetAngles
 
| <code>void SetAngles( float pitch, float yaw, float roll)</code>
 
| Set entity pitch, yaw, roll
 
|-
 
| GetAngles
 
| <code>vector GetAngles()</code>
 
| Get entity pitch, yaw, roll as a vector
 
|-
 
| SetSize
 
| <code>void SetSize( vector, vector )</code>
 
|
 
|-
 
| GetBoundingMins
 
| <code>vector GetBoundingMins()</code>
 
| Get a vector containing min bounds, centered on object
 
|-
 
| GetBoundingMaxs
 
| <code>vector GetBoundingMaxs()</code>
 
| Get a vector containing max bounds, centered on object
 
|-
 
| Destroy
 
| <code>void Destroy()</code>
 
|
 
|-
 
| SetOwner
 
| <code>void SetOwner( [[#CBaseEntity | Entity]] parent)</code>
 
| Sets the parent of the entity.  This does not give a player control over the entity
 
|-
 
| GetTeam
 
| <code>int GetTeam()</code>
 
|
 
|-
 
| SetTeam
 
| <code>void SetTeam( int [[#Teams| team]])</code>
 
| Sets the team of the entity
 
|-
 
| GetMoveParent
 
| <code>[[#CBaseEntity | Entity]] GetMoveParent()</code>
 
| If in hierarchy, retrieves the entity's parent
 
|-
 
| GetRootMoveParent
 
| <code>[[#CBaseEntity | Entity]] GetRootMoveParent()</code>
 
| If in hierarchy, walks up the hierarchy to find the root parent
 
|-
 
| FirstMoveChild
 
| <code>[[#CBaseEntity | Entity]] FirstMoveChild()</code>
 
|
 
|-
 
| NextMovePeer
 
| <code>[[#CBaseEntity | Entity]] NextMovePeer()</code>
 
|
 
|-
 
| __KeyValueFromString
 
| <code>bool __KeyValueFromString( string, string )</code>
 
| @
 
|-
 
| __KeyValueFromFloat
 
| <code>bool __KeyValueFromFloat( string, float )</code>
 
| @
 
|-
 
| __KeyValueFromInt
 
| <code>bool __KeyValueFromInt( string, int )</code>
 
| @
 
|-
 
| __KeyValueFromVector
 
| <code>bool __KeyValueFromVector( string, vector )</code>
 
| @
 
|-
 
| Trigger
 
| <code>void Trigger()</code>
 
| Fires off this entity's OnTrigger responses
 
|-
 
| ValidateScriptScope
 
| <code>bool ValidateScriptScope()</code>
 
| Ensure that an entity's script scope has been created
 
|-
 
| GetScriptScope
 
| <code>hscript GetScriptScope()</code>
 
| Retrieve the script-side data associated with an entity
 
|-
 
| GetScriptId
 
| <code>string GetScriptId()</code>
 
| Retrieve the unique identifier used to refer to the entity within the scripting system
 
|-
 
| GetOwner
 
| <code>[[#CBaseEntity | Entity]] GetOwner()</code>
 
| Gets this entity's owner
 
|-
 
| entindex
 
| <code>int entindex()</code>
 
|
 
|}
 
 
 
=== CDOTA_PlayerResource ===
 
:::::extends [[#CBaseEntity | CBaseEntity]]
 
 
 
''Interface to player data''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| SetHasRepicked
 
| <code>void SetHasRepicked( int playerId)</code>
 
| marks if the playerId player has repicked
 
|-
 
| HasRepicked
 
| <code>bool HasRepicked( int playerId)</code>
 
| returns true if playerId has repicked
 
|-
 
| SetHasRandomed
 
| <code>void SetHasRandomed( int playerId)</code>
 
|
 
|-
 
| HasRandomed
 
| <code>bool HasRandomed( int playerId)</code>
 
|
 
|-
 
| IsValidTeamPlayerID
 
| <code>bool IsValidTeamPlayerID( int playerId)</code>
 
|
 
|-
 
| IsValidTeamPlayer
 
| <code>bool IsValidTeamPlayer( int playerId)</code>
 
|
 
|-
 
| IsValidPlayerID
 
| <code>bool IsValidPlayerID( int playerId)</code>
 
|
 
|-
 
| IsValidPlayer
 
| <code>bool IsValidPlayer( int playerId)</code>
 
|
 
|-
 
| GetLevel
 
| <code>int GetLevel( int playerId)</code>
 
|
 
|-
 
| IncrementKills
 
| <code>void IncrementKills( int playerId, int kills)</code>
 
|
 
|-
 
| IncrementAssists
 
| <code>void IncrementAssists( int playerId)</code>
 
|
 
|-
 
| IncrementDeaths
 
| <code>void IncrementDeaths( int playerId)</code>
 
|
 
|-
 
| GetKills
 
| <code>int GetKills( int playerId)</code>
 
|
 
|-
 
| GetAssists
 
| <code>int GetAssists( int playerId)</code>
 
|
 
|-
 
| GetDeaths
 
| <code>int GetDeaths( int playerId)</code>
 
|
 
|-
 
| GetStuns
 
| <code>float GetStuns( int playerId)</code>
 
|
 
|-
 
| GetHealing
 
| <code>float GetHealing( int playerId)</code>
 
|
 
|-
 
| GetTowerKills
 
| <code>int GetTowerKills( int playerId)</code>
 
|
 
|-
 
| GetRoshanKills
 
| <code>int GetRoshanKills( int playerId)</code>
 
|
 
|-
 
| GetTeamKills
 
| <code>int GetTeamKills( int playerId)</code>
 
|
 
|-
 
| IncrementStreak
 
| <code>void IncrementStreak( int playerId)</code>
 
|
 
|-
 
| ClearStreak
 
| <code>void ClearStreak( int playerId)</code>
 
|
 
|-
 
| GetStreak
 
| <code>int GetStreak( int playerId)</code>
 
|
 
|-
 
| ModifyGold
 
| <code>int ModifyGold( int playerId, int goldAmt, bool reliable, int )</code>
 
| In frostivus it is <code>hero:ModifyGold( int goldAmt, bool reliable, int )</code>
 
|-
 
| SetGold
 
| <code>void SetGold( int playerId, int goldAmt, bool reliable)</code>
 
|
 
|-
 
| SpendGold
 
| <code>void SpendGold( int playerId, int amt, int )</code>
 
|
 
|-
 
| GetGold
 
| <code>int GetGold( int playerId)</code>
 
|
 
|-
 
| GetReliableGold
 
| <code>int GetReliableGold( int playerId)</code>
 
|
 
|-
 
| GetUnreliableGold
 
| <code>int GetUnreliableGold( int playerId)</code>
 
|
 
|-
 
| ResetTotalEarnedGold
 
| <code>void ResetTotalEarnedGold( int playerId)</code>
 
|
 
|-
 
| GetTotalEarnedGold
 
| <code>int GetTotalEarnedGold( int playerId)</code>
 
|
 
|-
 
| GetTotalGoldSpent
 
| <code>int GetTotalGoldSpent( int playerId)</code>
 
|
 
|-
 
| AddGoldSpentOnSupport
 
| <code>void AddGoldSpentOnSupport( int, int )</code>
 
|
 
|-
 
| GetGoldSpentOnSupport
 
| <code>int GetGoldSpentOnSupport( int playerId)</code>
 
|
 
|-
 
| GetGoldSpentOnConsumables
 
| <code>int GetGoldSpentOnConsumables( int playerId)</code>
 
|
 
|-
 
| GetGoldSpentOnItems
 
| <code>int GetGoldSpentOnItems( int playerId)</code>
 
|
 
|-
 
| GetGoldLostToDeath
 
| <code>int GetGoldLostToDeath( int playerId)</code>
 
|
 
|-
 
| GetGoldSpentOnBuybacks
 
| <code>int GetGoldSpentOnBuybacks( int playerId)</code>
 
|
 
|-
 
| GetGoldPerMin
 
| <code>float GetGoldPerMin( int playerId)</code>
 
|
 
|-
 
| GetXPPerMin
 
| <code>float GetXPPerMin( int playerId)</code>
 
|
 
|-
 
| GetAegisPickups
 
| <code>int GetAegisPickups( int playerId)</code>
 
|
 
|-
 
| AddAegisPickup
 
| <code>void AddAegisPickup( int playerId)</code>
 
|
 
|-
 
| GetRunePickups
 
| <code>int GetRunePickups( int playerId)</code>
 
|
 
|-
 
| AddRunePickup
 
| <code>void AddRunePickup( int playerId)</code>
 
|
 
|-
 
| GetNumConsumablesPurchased
 
| <code>int GetNumConsumablesPurchased( intplayerId )</code>
 
|
 
|-
 
| GetNumItemsPurchased
 
| <code>int GetNumItemsPurchased( int playerId)</code>
 
|
 
|-
 
| GetTimeOfLastItemPurchase
 
| <code>float GetTimeOfLastItemPurchase( int playerId)</code>
 
|
 
|-
 
| GetTimeOfLastConsumablePurchase
 
| <code>float GetTimeOfLastConsumablePurchase( int playerId)</code>
 
|
 
|-
 
| GetTimeOfLastDeath
 
| <code>float GetTimeOfLastDeath( int playerId)</code>
 
|
 
|-
 
| GetRespawnSeconds
 
| <code>int GetRespawnSeconds( int playerId)</code>
 
|
 
|-
 
| IncrementTotalEarnedXP
 
| <code>void IncrementTotalEarnedXP( int playerId, int amt)</code>
 
|
 
|-
 
| GetTotalEarnedXP
 
| <code>int GetTotalEarnedXP( int playerId)</code>
 
|
 
|-
 
| AddClaimedFarm
 
| <code>void AddClaimedFarm( int playerId, float farm)</code>
 
|
 
|-
 
| GetClaimedFarm
 
| <code>float GetClaimedFarm( int playerId)</code>
 
|
 
|-
 
| GetRawPlayerDamage
 
| <code>int GetRawPlayerDamage( int playerId)</code>
 
|
 
|-
 
| ClearRawPlayerDamageMatrix
 
| <code>void ClearRawPlayerDamageMatrix( int playerId)</code>
 
|
 
|-
 
| ClearKillsMatrix
 
| <code>void ClearKillsMatrix( int playerId)</code>
 
|
 
|-
 
| GetTowerDamageTaken
 
| <code>int GetTowerDamageTaken( int playerId)</code>
 
|
 
|-
 
| GetCreepDamageTaken
 
| <code>int GetCreepDamageTaken( int playerId)</code>
 
|
 
|-
 
| GetHeroDamageTaken
 
| <code>int GetHeroDamageTaken( int playerId)</code>
 
|
 
|-
 
| GetDamageDoneToHero
 
| <code>int GetDamageDoneToHero( int playerId, int heroId)</code>
 
|
 
|-
 
| GetKillsDoneToHero
 
| <code>int GetKillsDoneToHero( int playerId, int heroId)</code>
 
|
 
|-
 
| GetSelectedHeroName
 
| <code>string GetSelectedHeroName( int playerId)</code>
 
|
 
|-
 
| GetSelectedHeroID
 
| <code>int GetSelectedHeroID( int playerId)</code>
 
|
 
|-
 
| IsHeroSelected
 
| <code>bool IsHeroSelected( string heroName)</code>
 
|
 
|-
 
| WhoSelectedHero
 
| <code>int WhoSelectedHero( string heroName)</code>
 
| returns playerId
 
|-
 
| GetSelectedHeroEntity
 
| <code>[[#CBaseEntity | Entity]] GetSelectedHeroEntity( int playerId)</code>
 
|
 
|-
 
| HasSelectedHero
 
| <code>bool HasSelectedHero( int playerId)</code>
 
|
 
|-
 
| GetPlayer
 
| <code>[[#CDOTAPlayer | Player]] GetPlayer( int playerId)</code>
 
|
 
|-
 
| GetNthPlayerIDOnTeam
 
| <code>int GetNthPlayerIDOnTeam( int index, int [[#Teams | team]])</code>
 
| returns the playerId
 
|-
 
| IncrementLastHits
 
| <code>void IncrementLastHits( int playerId)</code>
 
|
 
|-
 
| GetLastHits
 
| <code>int GetLastHits( int playerId)</code>
 
|
 
|-
 
| IncrementGoldBagsCollected
 
| <code>void IncrementGoldBagsCollected( int playerId)</code>
 
|
 
|-
 
| GetGoldBagsCollected
 
| <code>int GetGoldBagsCollected( int playerId)</code>
 
|
 
|-
 
| IncrementLastHitStreak
 
| <code>void IncrementLastHitStreak( int playerId)</code>
 
|
 
|-
 
| ClearLastHitStreak
 
| <code>void ClearLastHitStreak( int playerId)</code>
 
|
 
|-
 
| GetLastHitStreak
 
| <code>int GetLastHitStreak( int playerId)</code>
 
|
 
|-
 
| IncrementLastHitMultikill
 
| <code>void IncrementLastHitMultikill( int playerId)</code>
 
|
 
|-
 
| ClearLastHitMultikill
 
| <code>void ClearLastHitMultikill( int playerId)</code>
 
|
 
|-
 
| GetLastHitMultikill
 
| <code>int GetLastHitMultikill( int playerId)</code>
 
|
 
|-
 
| IncrementNearbyCreepDeaths
 
| <code>void IncrementNearbyCreepDeaths( int playerId)</code>
 
|
 
|-
 
| GetNearbyCreepDeaths
 
| <code>int GetNearbyCreepDeaths( int playerId)</code>
 
|
 
|-
 
| IncrementDenies
 
| <code>void IncrementDenies( int playerId)</code>
 
|
 
|-
 
| GetDenies
 
| <code>int GetDenies( int playerId)</code>
 
|
 
|-
 
| IncrementClaimedMisses
 
| <code>void IncrementClaimedMisses( int playerId)</code>
 
|
 
|-
 
| GetClaimedMisses
 
| <code>int GetClaimedMisses( int playerId)</code>
 
|
 
|-
 
| IncrementClaimedDenies
 
| <code>void IncrementClaimedDenies( int playerId)</code>
 
|
 
|-
 
| GetClaimedDenies
 
| <code>int GetClaimedDenies( int playerId )</code>
 
|
 
|-
 
| IncrementMisses
 
| <code>void IncrementMisses( int playerId)</code>
 
|
 
|-
 
| GetMisses
 
| <code>int GetMisses( int playerId)</code>
 
|
 
|-
 
| UpdateTeamSlot
 
| <code>void UpdateTeamSlot( int playerId, int slot)</code>
 
|
 
|-
 
| GetTeam
 
| <code>int GetTeam( int playerId)</code>
 
| returns [[#Teams | teamId]]
 
|-
 
| IsBroadcaster
 
| <code>bool IsBroadcaster( int playerId)</code>
 
|
 
|-
 
| GetBroadcasterChannel
 
| <code>uint GetBroadcasterChannel( int playerId)</code>
 
|
 
|-
 
| GetBroadcasterChannelSlot
 
| <code>uint GetBroadcasterChannelSlot( int playerId)</code>
 
|
 
|-
 
| GetSteamAccountID
 
| <code>uint GetSteamAccountID( int playerId)</code>
 
|
 
|-
 
| IsFakeClient
 
| <code>bool IsFakeClient( int playerId)</code>
 
|
 
|-
 
| HaveAllPlayersJoined
 
| <code>bool HaveAllPlayersJoined()</code>
 
|
 
|-
 
| GetPlayerLoadedCompletely
 
| <code>bool GetPlayerLoadedCompletely( int playerId)</code>
 
|
 
|-
 
| SetPlayerReservedState
 
| <code>void SetPlayerReservedState( int playerId, bool reserved)</code>
 
|
 
|-
 
| GetPlayerReservedState
 
| <code>bool GetPlayerReservedState( int playerId)</code>
 
|
 
|-
 
| GetConnectionState
 
| <code>unknown_variant_type GetConnectionState( int playerId)</code>
 
|
 
|-
 
| HeroLevelUp
 
| <code>void HeroLevelUp( int playerId)</code>
 
|
 
|-
 
| SetLastBuybackTime
 
| <code>void SetLastBuybackTime( int playerId, int time)</code>
 
|
 
|-
 
| GetPlayerName
 
| <code>string GetPlayerName( int playerId)</code>
 
|
 
|-
 
| GetUnitShareMaskForPlayer
 
| <code>int GetUnitShareMaskForPlayer( int playerId, int otherPlayerId)</code>
 
|
 
|-
 
| IsHeroSharedWithPlayerID
 
| <code>bool IsHeroSharedWithPlayerID( int playerId, int otherPlayerId)</code>
 
|
 
|-
 
| AreUnitsSharedWithPlayerID
 
| <code>bool AreUnitsSharedWithPlayerID( int playerId, int otherPlayerId)</code>
 
|
 
|-
 
| IsDisableHelpSetForPlayerID
 
| <code>bool IsDisableHelpSetForPlayerID( int playerId, int otherPlayerId)</code>
 
|
 
|-
 
| SetUnitShareMaskForPlayer
 
| <code>void SetUnitShareMaskForPlayer( int, int, int, bool )</code>
 
|
 
|-
 
| GetNumCouriersForTeam
 
| <code>int GetNumCouriersForTeam( int [[#Teams | team]])</code>
 
|
 
|-
 
| GetNthCourierForTeam
 
| <code>hscript GetNthCourierForTeam( int index, int [[#Teams | team]])</code>
 
|
 
|-
 
| SetBuybackCooldownTime
 
| <code>void SetBuybackCooldownTime( int playerId, float cooldown)</code>
 
|
 
|-
 
| SetBuybackGoldLimitTime
 
| <code>void SetBuybackGoldLimitTime( int playerId, float buybackGold)</code>
 
|
 
|-
 
| ResetBuybackCostTime
 
| <code>void ResetBuybackCostTime( int playerId)</code>
 
|
 
|}
 
 
 
=== CDOTABaseGameMode ===
 
:::::extends [[#CBaseEntity | CBaseEntity]]
 
''Base game mode class''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| BeginThink
 
| <code>bool BeginThink( string thinkName, function func, float intervalInSeconds)</code>
 
| Start a think callback. Takes a function and an interval
 
|-
 
| EndThink
 
| <code>void EndThink( string thinkName )</code>
 
| Stop a think callback.
 
|-
 
| SetAlwaysShowPlayerInventory
 
| <code>void SetAlwaysShowPlayerInventory( bool alwaysShow)</code>
 
| Show the player hero's inventory in the HUD, regardless of what unit is selected.
 
|-
 
| SetGoldSoundDisabled
 
| <code>void SetGoldSoundDisabled( bool playSound)</code>
 
| Turn the sound when gold is acquired off/on. Takes a bool.
 
|-
 
| SetRecommendedItemsDisabled
 
| <code>void SetRecommendedItemsDisabled( bool disableRecItems)</code>
 
| Turn the panel for showing recommended items at the shop off/on. Takes a bool.
 
|-
 
| SetCameraDistanceOverride
 
| <code>void SetCameraDistanceOverride( float cameraDistance)</code>
 
| Set a different camera distance; dota default is 1134.
 
|-
 
| SetOverrideSelectionEntity
 
| <code>void SetOverrideSelectionEntity( [[#CDOTA_BaseNPC | Unit]] unit)</code>
 
| Set an override for the default selection entity, instead of each player's hero.
 
|-
 
| SetRemoveIllusionsOnDeath
 
| <code>void SetRemoveIllusionsOnDeath( bool removeIllusions)</code>
 
| Make it so illusions are immediately removed upon death, rather than sticking around for a few seconds.
 
|-
 
| ClientLoadGridNav
 
| <code>void ClientLoadGridNav()</code>
 
| Tell clients that they need to load gridnav information. Used for things like allowing clients to identify valid locations to place buildings.
 
|}
 
 
 
=== CBaseAnimating ===
 
:::::extends [[#CBaseEntity | CBaseEntity]]
 
''Animating models''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| LookupAttachment
 
| <code>int LookupAttachment( string attachmentName )</code>
 
| Get the named attachement id
 
|-
 
| GetAttachmentOrigin
 
| <code>vector GetAttachmentOrigin( int attachmentId )</code>
 
| Get the attachement id's origin vector
 
|-
 
| GetAttachmentAngles
 
| <code>vector GetAttachmentAngles( int attachmentId)</code>
 
| Get the attachement id's angles as a p,y,r vector
 
|-
 
| IsSequenceFinished
 
| <code>bool IsSequenceFinished()</code>
 
| Ask whether the main sequence is done playing
 
|-
 
| SetBodygroup
 
| <code>void SetBodygroup( int, int )</code>
 
| Sets a bodygroup
 
|-
 
| SetModelScale
 
| <code>void SetModelScale( float scale, float fadeTimeSeconds)</code>
 
| Set the model scale
 
|}
 
 
 
 
 
=== CBaseFlex ===
 
:::::extends [[#CBaseAnimating | CBaseAnimating ]]
 
''Animated characters who have vertex flex capability.''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| GetCurrentScene
 
| <code>hscript GetCurrentScene()</code>
 
| Returns the instance of the oldest active scene entity (if any).
 
|-
 
| GetSceneByIndex
 
| <code>hscript GetSceneByIndex( int )</code>
 
| Returns the instance of the scene entity at the specified index.
 
|}
 
 
 
 
 
=== CDOTA_BaseNPC ===
 
:::::extends [[#CBaseFlex | CBaseFlex ]]
 
''A Dota NPC Unit''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| IsCreature
 
| <code>bool IsCreature()</code>
 
| Is this a Creature type NPC
 
|-
 
| IsHero
 
| <code>bool IsHero()</code>
 
| Is this a hero or hero illusion?
 
|-
 
| IsRealHero
 
| <code>bool IsRealHero()</code>
 
| Is this a real hero?
 
|-
 
| IsTower
 
| <code>bool IsTower()</code>
 
| Is this a tower?
 
|-
 
| IsAlive
 
| <code>bool IsAlive()</code>
 
| Is this unit alive?
 
|-
 
| IsMechanical
 
| <code>bool IsMechanical()</code>
 
| Is the unit mechanical?
 
|-
 
| IsPhantom
 
| <code>bool IsPhantom()</code>
 
| Is this a phantom unit?
 
|-
 
| SetInitialGoalEntity
 
| <code>void SetInitialGoalEntity( [[#CBaseEntity | Entity]] goalEntity)</code>
 
| Sets the initial waypoint goal for this NPC
 
|-
 
| GetInitialGoalEntity
 
| <code>[[#CBaseEntity | Entity]] GetInitialGoalEntity()</code>
 
| Returns the initial waypoint goal for this NPC
 
|-
 
| SetMustReachEachGoalEntity
 
| <code>void SetMustReachEachGoalEntity( bool mustReach)</code>
 
| Set whether this NPC is required to reach each goal entity, rather than being allowed to 'unkink' their path
 
|-
 
| GetMustReachEachGoalEntity
 
| <code>bool GetMustReachEachGoalEntity()</code>
 
| Get whether this NPC is required to reach each goal entity, rather than being allowed to 'unkink' their path
 
|-
 
| AddNewModifier
 
| <code>void AddNewModifier( [[#CDOTA_BaseNPC | Unit]] caster, [[#CDOTABaseAbility | Ability]] optionalSrcAbility, string modifierName, table modifierData)</code>
 
| Add a modifier to this unit. 
 
|-
 
| HasModifier
 
| <code>bool HasModifier( string modifierName)</code>
 
| Sees if this unit has a given modifier
 
|-
 
| RemoveModifierByName
 
| <code>void RemoveModifierByName( string modifierName)</code>
 
| Removes a modifier
 
|-
 
| RemoveModifierByNameAndCaster
 
| <code>void RemoveModifierByNameAndCaster( string name, [[#CDOTA_BaseNPC | Unit]] caster)</code>
 
| Removes a modifier that was cast by the given caster
 
|-
 
| AddItem
 
| <code>void AddItem( [[#CDOTA_Item | Item]] itemName)</code>
 
| Add an item to this unit's inventory.
 
|-
 
| AddAbility
 
| <code>void AddAbility( string abilityName)</code>
 
| Add an ability to this unit by name.
 
|-
 
| RemoveAbility
 
| <code>void RemoveAbility( string abilityName)</code>
 
| Remove an ability from this unit by name as defined in the keyvalues
 
|-
 
| HasAbility
 
| <code>bool HasAbility( string abilityName)</code>
 
| See whether this unit has an ability by name.
 
|-
 
| FindAbilityByName
 
| <code>hscript FindAbilityByName( string abilityName)</code>
 
| Retrieve an ability by name from the unit.
 
|-
 
| GetGoldBounty
 
| <code>int GetGoldBounty()</code>
 
| Get the gold bounty on this unit
 
|-
 
| SetDeathXP
 
| <code>void SetDeathXP( int xpBounty)</code>
 
| Set the XP bounty on this unit
 
|-
 
| GetDeathXP
 
| <code>int GetDeathXP()</code>
 
| Get the XP bounty on this unit
 
|-
 
| GetUnitName
 
| <code>string GetUnitName()</code>
 
| Get the name of this unit.
 
|-
 
| GetTeamNumber
 
| <code>int GetTeamNumber()</code>
 
| Get the team number of this unit.
 
|-
 
| GetPlayerOwner
 
| <code>hscript GetPlayerOwner()</code>
 
| Returns the player that owns this unit
 
|-
 
| SetMaximumGoldBounty
 
| <code>void SetMaximumGoldBounty( int goldBounty)</code>
 
| Set the maximum gold bounty for this unit.
 
|-
 
| SetMinimumGoldBounty
 
| <code>void SetMinimumGoldBounty( int goldBounty)</code>
 
| Set the minimum gold bounty for this unit.
 
|-
 
| GetTotalPurchasedUpgradeGoldCost
 
| <code>int GetTotalPurchasedUpgradeGoldCost()</code>
 
| Get how much gold has been spent on ability upgrades.
 
|-
 
| ForceKill
 
| <code>void ForceKill( bool playAegisLines)</code>
 
| Kill this unit immediately.
 
|-
 
| GetBaseDamageMin
 
| <code>int GetBaseDamageMin()</code>
 
| Get the minimum attack damage of this unit.
 
|-
 
| GetBaseDamageMax
 
| <code>int GetBaseDamageMax()</code>
 
| Get the maximum attack damage of this unit.
 
|-
 
| Heal
 
| <code>void Heal( int amount, [[#CDOTA_BaseNPC | Unit]] source)</code>
 
| Heal this unit.
 
|-
 
| GetMaxHealth
 
| <code>int GetMaxHealth()</code>
 
| Get the maximum health of this unit.
 
|-
 
| GetHealthPercent
 
| <code>int GetHealthPercent()</code>
 
| Get the current health percent of the unit.
 
|-
 
| SetMana
 
| <code>void SetMana( float mana)</code>
 
| Set the mana on this unit.
 
|-
 
| GetMaxMana
 
| <code>float GetMaxMana()</code>
 
| Get the maximum mana of this unit.
 
|-
 
| RespawnUnit
 
| <code>void RespawnUnit()</code>
 
| Respawns the target unit if it can be respawned.
 
|-
 
| GetLevel
 
| <code>int GetLevel()</code>
 
| Returns the level of this unit.
 
|-
 
| GetItemInSlot
 
| <code>hscript GetItemInSlot( int slotId)</code>
 
| Returns nth item in inventory slot (index is zero based)
 
|-
 
| CastAbilityOnTarget
 
| <code>void CastAbilityOnTarget( [[#CDOTA_BaseNPC | Unit]] target, [[#CDOTABaseAbility | Ability ]] ability, int )</code>
 
| Cast an ability on a specified target.  Third Param can be 0 or -1. 
 
|-
 
| CastAbilityNoTarget
 
| <code>void CastAbilityNoTarget( [[#CDOTABaseAbility | Ability ]] ability, int )</code>
 
| Cast an ability. Third Param can be 0 or -1. 
 
|-
 
| SetOriginalModel
 
| <code>void SetOriginalModel( string originalModel)</code>
 
| Sets the original model of this entity, which it will tend to fall back to anytime its state changes
 
|-
 
| AddNoDraw
 
| <code>void AddNoDraw()</code>
 
| Adds the no draw flag.
 
|-
 
| RemoveNoDraw
 
| <code>void RemoveNoDraw()</code>
 
| Remove the no draw flag.
 
|-
 
| GetPlayerOwnerID
 
| <code>int GetPlayerOwnerID()</code>
 
| Get the owner player ID for this unit.
 
|-
 
| IsRangedAttacker
 
| <code>bool IsRangedAttacker()</code>
 
| Is this unit a ranged attacker?
 
|}
 
 
 
=== CDOTA_BaseNPC_Building ===
 
:::::extends [[#CDOTA_BaseNPC | CDOTA_BaseNPC ]]
 
''A building.''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| GetInvulnCount
 
| <code>int GetInvulnCount()</code>
 
| Get the invulnerability count for a building.
 
|-
 
| SetInvulnCount
 
| <code>void SetInvulnCount( int )</code>
 
| Set the invulnerability counter of this building.
 
|}
 
 
 
 
 
=== CDOTA_BaseNPC_Creature ===
 
:::::extends [[#CDOTA_BaseNPC | CDOTA_BaseNPC ]]
 
''A Dota NPC Unit''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| CreatureLevelUp
 
| <code>void CreatureLevelUp( int numLevels)</code>
 
| Level the creature up by the specified number of levels
 
|-
 
| AddItemDrop
 
| <code>void AddItemDrop( [[#CDOTA_Item_Physical | PhysicalItem]] item )</code>
 
| Add the specified item drop to this creature
 
|-
 
| SetChampion
 
| <code>void SetChampion( bool champion)</code>
 
| Flag this unit as a champion creature.
 
|-
 
| IsChampion
 
| <code>bool IsChampion()</code>
 
| Is this unit a champion?
 
|-
 
| SetHPGain
 
| <code>void SetHPGain( int hpPerLevel)</code>
 
| Set the hit points gained per level on this creature.
 
|-
 
| SetManaGain
 
| <code>void SetManaGain( int manaPerLevel)</code>
 
| Set the mana points gained per level on this creature.
 
|-
 
| SetHPRegenGain
 
| <code>void SetHPRegenGain( float regenPerLevel)</code>
 
| Set the hit points regen gained per level on this creature.
 
|-
 
| SetManaRegenGain
 
| <code>void SetManaRegenGain( float manaRegenGain)</code>
 
| Set the mana points regen gained per level on this creature.
 
|-
 
| SetDamageGain
 
| <code>void SetDamageGain( int damageGain)</code>
 
| Set the damage gained per level on this creature.
 
|-
 
| SetArmorGain
 
| <code>void SetArmorGain( float armorGain)</code>
 
| Set the armor gained per level on this creature.
 
|-
 
| SetMagicResistanceGain
 
| <code>void SetMagicResistanceGain( float magicResistGain)</code>
 
| Set the magic resistance gained per level on this creature.
 
|-
 
| SetDisableResistanceGain
 
| <code>void SetDisableResistanceGain( float disableResist)</code>
 
| Set the disable resistance gained per level on this creature.
 
|-
 
| SetAttackTimeGain
 
| <code>void SetAttackTimeGain( float attackSpeedGain)</code>
 
| Set the attack time gained per level on this creature.
 
|-
 
| SetMoveSpeedGain
 
| <code>void SetMoveSpeedGain( int moveSpeedGain)</code>
 
| Set the move speed gained per level on this creature.
 
|-
 
| SetBountyGain
 
| <code>void SetBountyGain( int bountyGain)</code>
 
| Set the bounty gold gained per level on this creature.
 
|-
 
| SetXPGain
 
| <code>void SetXPGain( int xpGain)</code>
 
| Set the xp reward gained per level on this creature.
 
|}
 
 
 
=== CDOTA_BaseNPC_Hero ===
 
:::::extends [[#CDOTA_BaseNPC | CDOTA_BaseNPC ]]
 
''A Dota Hero NPC''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| ModifyGold
 
| <code>int ModifyGold( int goldAmmount, bool reliable, int )</code>
 
| Gives this hero some gold
 
|-
 
| GetGold
 
| <code>int GetGold()</code>
 
| Returns gold amount for the player owning this hero
 
|-
 
| SetGold
 
| <code>void SetGold( int goldAmmount, bool reliable)</code>
 
| Sets the gold amount for the player owning this hero
 
|-
 
| GetCurrentXP
 
| <code>int GetCurrentXP()</code>
 
| Returns the amount of XP
 
|-
 
| GetPlayerID
 
| <code>int GetPlayerID()</code>
 
| Returns player ID of the player owning this hero
 
|-
 
| RespawnHero
 
| <code>void RespawnHero( bool buyback, bool, bool )</code>
 
| Respawn this hero.
 
|}
 
 
 
 
 
=== CDOTABaseAbility ===
 
:::::extends [[#CBaseEntity  | CBaseEntity ]]
 
''An ability''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| GetAbilityName
 
| <code>string GetAbilityName()</code>
 
| Returns the name of this ability.
 
|-
 
| GetSpecialValueFor
 
| <code>variant GetSpecialValueFor( string specialValue)</code>
 
| Gets a value from this ability's special value block for its current level.  Ability must have a "AbilitySpecial" block defined in it's KeyValues.
 
|-
 
| GetCastRange
 
| <code>int GetCastRange()</code>
 
| Gets the cast range of the ability.
 
|-
 
| IsFullyCastable
 
| <code>bool IsFullyCastable()</code>
 
| Returns whether the ability can be cast.
 
|-
 
| IsChanneling
 
| <code>bool IsChanneling()</code>
 
| Returns whether the ability is currently channeling.
 
|-
 
| IsInAbilityPhase
 
| <code>bool IsInAbilityPhase()</code>
 
| Returns whether the ability is currently casting.
 
|-
 
| GetCooldown
 
| <code>float GetCooldown( int level)</code>
 
| Get the cooldown duration for this ability at a given level, not the amount of cooldown actually left.
 
|-
 
| MarkAbilityButtonDirty
 
| <code>void MarkAbilityButtonDirty()</code>
 
| Mark the ability button for this ability as needing a refresh
 
|-
 
| SetLevel
 
| <code>void SetLevel( int abilityLevel)</code>
 
| Sets the level of this ability.
 
|}
 
 
 
=== CDotaQuestBase ===
 
''A quest''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| SetTextReplaceValue
 
| <code>void SetTextReplaceValue( int [[#Quest_Text_Replacement | questText]], int value)</code>
 
| Set a quest value
 
|-
 
| CompleteQuest
 
| <code>void CompleteQuest()</code>
 
| Mark this quest complete
 
|-
 
| SetTextReplaceString
 
| <code>void SetTextReplaceString( string replace )</code>
 
| Set the text replace string for this quest
 
|}
 
 
 
=== CDOTA_Item ===
 
:::::extends [[#CDOTABaseAbility | CDOTABaseAbility ]]
 
''A usable item.''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| SetPurchaseTime
 
| <code>void SetPurchaseTime( float purchaseTime)</code>
 
| Set the purchase time of this item
 
|-
 
| GetPurchaseTime
 
| <code>float GetPurchaseTime()</code>
 
| Get the purchase time of this item
 
|-
 
| SetPurchaser
 
| <code>void SetPurchaser( [[#CDOTA_BaseNPC | Unit]] unit )</code>
 
| Set the purchaser of record for this item.
 
|-
 
| GetInitialCharges
 
| <code>int GetInitialCharges()</code>
 
| Get the initial number of charges this item has.
 
|-
 
| GetCurrentCharges
 
| <code>int GetCurrentCharges()</code>
 
| Get the number of charges this item currently has.
 
|-
 
| SetCurrentCharges
 
| <code>void SetCurrentCharges( int charges)</code>
 
| Set the number of charges on this item
 
|-
 
| GetPurchaser
 
| <code>[[#CDOTA_BaseNPC | Unit]] GetPurchaser()</code>
 
| Get the purchaser for this item.
 
|-
 
| Think
 
| <code>void Think()</code>
 
| Think this item
 
|-
 
| IsPermanent
 
| <code>bool IsPermanent()</code>
 
| Is this a permanent item?
 
|-
 
| StacksWithOtherOwners
 
| <code>bool StacksWithOtherOwners()</code>
 
|
 
|-
 
| SetStacksWithOtherOwners
 
| <code>void SetStacksWithOtherOwners( bool stacks)</code>
 
|
 
|-
 
| GetShareability
 
| <code>int GetShareability()</code>
 
| returns [[#Item_Sharing_Types | Item Sharing Type]]
 
|-
 
| GetCost
 
| <code>int GetCost()</code>
 
|
 
|-
 
| GetContainer
 
| <code>hscript GetContainer()</code>
 
| Get the container for this item.
 
|}
 
 
 
=== CDOTA_Item_Physical ===
 
:::::extends [[#CBaseAnimating | CBaseAnimating ]]
 
''A physical item dropped in the world''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| GetCreationTime
 
| <code>float GetCreationTime()</code>
 
| Returns the game time when this item was created in the world
 
|-
 
| GetContainedItem
 
| <code>[[#CDOTA_Item | Item]] GetContainedItem()</code>
 
| Returned the contained item.
 
|-
 
| SetContainedItem
 
| <code>void SetContainedItem( [[#CDOTA_Item | Item]] item)</code>
 
| Set the contained item.
 
|}
 
 
 
=== CDOTAPlayer ===
 
:::::extends [[#CBaseAnimating | CBaseAnimating ]]
 
''the Player''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| GetPlayerID
 
| <code>int GetPlayerID()</code>
 
| Get the player's official PlayerID; notably is -1 when the player isn't yet on a team.
 
|-
 
| ReplaceHeroWith
 
| <code>hscript ReplaceHeroWith( string, int, int )</code>
 
| (heroClassName, gold, XP) - replaces the player's hero with a new one of the specified class, gold and XP
 
|-
 
| GetAssignedHero
 
| <code>hscript GetAssignedHero()</code>
 
| Get the player's hero.
 
|-
 
| SetKillCamUnit
 
| <code>void SetKillCamUnit( hscript )</code>
 
| Set the kill cam unit for this hero.
 
|-
 
| SetMusicStatus
 
| <code>void SetMusicStatus( int, float )</code>
 
| (nMusicStatus, flIntensity) - Set the music status for this player, note this will only really apply if dota_music_battle_enable is off.
 
|}
 
 
 
 
 
=== CTriggerCamera ===
 
:::::extends [[#CBaseEntity | CBaseEntity ]]
 
''Server-side camera entity''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| GetFov
 
| <code>int GetFov()</code>
 
| get camera's current fov setting as integer
 
|-
 
| SetFov
 
| <code>void SetFov( int degrees, float rate)</code>
 
| set camera's current fov in integer degrees and fov change rate as float
 
|-
 
| ScreenFade
 
| <code>void ScreenFade( int, int, int, int, float, float, int )</code>
 
| set screen fade effect
 
|-
 
| Enable
 
| <code>void Enable()</code>
 
| enable camera
 
|}
 
 
 
=== CSceneEntity ===
 
:::::extends [[#CBaseEntity | CBaseEntity ]]
 
''Choreographed scene which controls animation and/or dialog on one or more actors.''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| EstimateLength
 
| <code>float EstimateLength()</code>
 
| Returns length of this scene in seconds.
 
|-
 
| IsPlayingBack
 
| <code>bool IsPlayingBack()</code>
 
| If this scene is currently playing.
 
|-
 
| IsPaused
 
| <code>bool IsPaused()</code>
 
| If this scene is currently paused.
 
|-
 
| Start
 
| <code>void Start( [[#CBaseEntity | Entity]] activator)</code>
 
| Start scene playback, takes activatorEntity as param
 
|-
 
| Cancel
 
| <code>void Cancel()</code>
 
| Cancel scene playback
 
|-
 
| AddBroadcastTeamTarget
 
| <code>void AddBroadcastTeamTarget( int [[#Teams | team]])</code>
 
| Adds a team (by index) to the broadcast list
 
|-
 
| RemoveBroadcastTeamTarget
 
| <code>void RemoveBroadcastTeamTarget( int entityIndex)</code>
 
| Removes a team (by index) from the broadcast list
 
|-
 
| FindNamedEntity
 
| <code>[[#CBaseEntity | Entity]] FindNamedEntity( string entityReference)</code>
 
| given an entity reference, such as !target, get actual entity from scene object
 
|-
 
| LoadSceneFromString
 
| <code>bool LoadSceneFromString( string sceneName, string vcdFile)</code>
 
| given a dummy scene name and a vcd string, load the scene
 
|-
 
| LoadSceneFromString
 
| <code>[[#CTriggerCamera | Camera]] FindCamera()</code>
 
| Get the camera
 
|}
 
 
 
=== CEnvProjectedTexture ===
 
:::::extends [[#CBaseEntity | CBaseEntity ]]
 
''Dynamic, shadow casting light source''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| SetLinearAttenuation
 
| <code>void SetLinearAttenuation( float attenuation)</code>
 
| Set light linear attenuation value
 
|-
 
| SetQuadraticAttenuation
 
| <code>void SetQuadraticAttenuation( float attenuation)</code>
 
| Set light quadratic attenuation value
 
|-
 
| SetNearRange
 
| <code>void SetNearRange( float nearRange)</code>
 
| Set light minimum range
 
|-
 
| SetFarRange
 
| <code>void SetFarRange( float farRange)</code>
 
| Set light maximum range
 
|-
 
| SetVolumetrics
 
| <code>void SetVolumetrics( bool on, float intensity, float noise, int planes, float planeOffset)</code>
 
| Turn on/off light volumetrics
 
|}
 
 
 
=== CEnvEntityMaker ===
 
:::::extends [[#CBaseEntity | CBaseEntity ]]
 
''env_entity_maker''
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| SpawnEntity
 
| <code>void SpawnEntity()</code>
 
| Create an entity at the location of the maker
 
|-
 
| SpawnEntityAtEntityOrigin
 
| <code>void SpawnEntityAtEntityOrigin( [[#CBaseEntity | Entity]] entity)</code>
 
| Create an entity at the location of a specified entity instance
 
|-
 
| SpawnEntityAtNamedEntityOrigin
 
| <code>void SpawnEntityAtNamedEntityOrigin( string entityName)</code>
 
| Create an entity at the location of a named entity
 
|-
 
| SpawnEntityAtLocation
 
| <code>void SpawnEntityAtLocation( vector location, vector orientation)</code>
 
| Create an entity at a specified location and orientaton, orientation is Euler angle in degrees (pitch, yaw, roll)
 
|}
 
 
 
=== Other Functions ===
 
{| class="standard-table" style="width: 100%;"
 
! Function
 
! Signature
 
! Description
 
|-
 
| RandomInt
 
| <code>int RandomInt( int min, int max)</code>
 
| Get a random int within a range
 
|-
 
| RandomFloat
 
| <code>float RandomFloat( float min, float max)</code>
 
| Get a random float within a range
 
|-
 
| RandomVector
 
| <code>vector RandomVector( float distance)</code>
 
| Get a random vector within a range
 
|-
 
| RollPercentage
 
| <code>bool RollPercentage( int percent)</code>
 
| Rolls a number from 1 to 100 and returns true if the roll is less than or equal to the number specified
 
|-
 
| DoIncludeScript
 
| <code>bool DoIncludeScript( string scriptName, hscript )</code>
 
| Execute a script (internal)
 
|-
 
| ShowMessage
 
| <code>void ShowMessage( string message)</code>
 
| Print a hud message on all clients. Does not appear to work
 
|-
 
| GetMapName
 
| <code>string GetMapName()</code>
 
| Get the name of the map.
 
|-
 
| SendToConsole
 
| <code>void SendToConsole( string conCommand)</code>
 
| Send a string to the console as a client command
 
|-
 
| SendToServerConsole
 
| <code>void SendToServerConsole( string conCommand)</code>
 
| Send a string to the console as a server command
 
|-
 
| PrintLinkedConsoleMessage
 
| <code>void PrintLinkedConsoleMessage( string message, string conCommand)</code>
 
| Print a console message with a linked console command
 
|-
 
| InitLogFile
 
| <code>void InitLogFile( string fileName, string log)</code>
 
| If the given file doesn't exist, creates it with the given contents; does nothing if it exists
 
|-
 
| AppendToLogFile
 
| <code>void AppendToLogFile( string message, string log)</code>
 
| Appends a string to a log file on the server
 
|-
 
| GetWorldMinX
 
| <code>float GetWorldMinX()</code>
 
| Gets the world's minimum X position.
 
|-
 
| GetWorldMinY
 
| <code>float GetWorldMinY()</code>
 
| Gets the world's maximum Y position.
 
|-
 
| GetWorldMaxX
 
| <code>float GetWorldMaxX()</code>
 
| Gets the world's minimum X position.
 
|-
 
| GetWorldMaxY
 
| <code>float GetWorldMaxY()</code>
 
| Gets the world's maximum Y position.
 
|-
 
| Time
 
| <code>float Time()</code>
 
| Get the current server time
 
|-
 
| GetSystemTime
 
| <code>string GetSystemTime()</code>
 
| Get the current real world time
 
|-
 
| GetSystemDate
 
| <code>string GetSystemDate()</code>
 
| Get the current real world date
 
|-
 
| UTIL_RemoveImmediate
 
| <code>void UTIL_RemoveImmediate( [[#CBaseEntity | Entity]] entity)</code>
 
| Immediately removes the specified entity
 
|-
 
| DoEntFire
 
| <code>void DoEntFire( string target, string action, string value, float delay, [[#CBaseEntity | Entity]] activator, hscript )</code>
 
| #EntFire:Generate and entity i/o event
 
|-
 
| EntFireByHandle
 
| <code>void EntFireByHandle( [[#CBaseEntity | Entity]] entity, string target, string value, float delay, [[#CBaseEntity | Entity]] activator, hscript )</code>
 
| Generate and entity i/o event
 
|-
 
| IsValidEntity
 
| <code>bool IsValidEntity( [[#CBaseEntity | Entity]] entity)</code>
 
| Checks to see if the given hScript is a valid entity
 
|-
 
| IsMarkedForDeletion
 
| <code>bool IsMarkedForDeletion( [[#CBaseEntity | Entity]] entity)</code>
 
| Returns true if the entity is valid and marked for deletion.
 
|-
 
| DoUniqueString
 
| <code>string DoUniqueString( string uniqueString)</code>
 
| #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 tables when not sure what keys are already in use in that table.
 
|-
 
| ListenToGameEvent
 
| <code>void ListenToGameEvent( string eventName, function listener, table luaOwner)</code>
 
| Register as a listener for a game event from script. 
 
|-
 
| FireGameEvent
 
| <code>void FireGameEvent( string eventName, table params)</code>
 
| Fire a game event.
 
|-
 
| FireGameEventLocal
 
| <code>void FireGameEventLocal( string eventName, table params)</code>
 
| Fire a game event without broadcasting to the client.
 
|-
 
| PauseGame
 
| <code>void PauseGame( bool pause)</code>
 
| Pause or unpause the game.
 
|-
 
| EntIndexToHScript
 
| <code>[[#CBaseEntity | Entity]] entityEntIndexToHScript( int entIndex)</code>
 
| Turn an entity index integer to an HScript representing that entity's script instance.
 
|-
 
| PlayerInstanceFromIndex
 
| <code>[[#CDOTAPlayer | Player]] PlayerInstanceFromIndex( int playerIndex)</code>
 
| Get a script instance of a player by index.
 
|-
 
| GetListenServerHost
 
| <code>[[#CDOTAPlayer | Player]] GetListenServerHost()</code>
 
| Get the local player on a listen server.
 
|-
 
| ScreenShake
 
| <code>void ScreenShake( vector center, float aplitude, float frequency, float duration, float radius, int shakeStatus, bool airShake)</code>
 
| Start a screenshake with the following parameters. shakeStatus( SHAKE_START = 0, SHAKE_STOP = 1 )
 
|-
 
| SpawnEntityFromTable
 
| <code>bool SpawnEntityFromTable( string className, table spawnTable, [[#CBaseEntity | Entity]] owner, function spawnCallback, hscript )</code>
 
| Spawns a single entity from a table.  Last param seems to always be nil.  maybe player owner?
 
|-
 
| SpawnEntityGroupFromTable
 
| <code>bool SpawnEntityGroupFromTable( hscript, bool, hscript )</code>
 
| Hierarchically spawn an entity group from a set of spawn tables.
 
|-
 
| PrecacheEntityFromTable
 
| <code>bool PrecacheEntityFromTable( table keyValues )</code>
 
| Precache an entity from KeyValues in table
 
|-
 
| VectorToAngles
 
| <code>qangle VectorToAngles( vector )</code>
 
| Get Qangles (with no roll) for a Vector.
 
|-
 
| RotatePosition
 
| <code>vector RotatePosition( vector vec, qangle angle, vector origin)</code>
 
| Rotate a Vector around a point.
 
|-
 
| RotateOrientation
 
| <code>qangle RotateOrientation( qangle an1, qangle ang2)</code>
 
| Rotate a QAngle by another QAngle.
 
|-
 
| RotationDelta
 
| <code>qangle RotationDelta( qangle ang1, qangle ang2)</code>
 
| Find the delta between two angles.
 
|-
 
| EmitSoundOn
 
| <code>void EmitSoundOn( string soundName, [[#CBaseEntity | Entity]] entity)</code>
 
| Play named sound on Entity
 
|-
 
| EmitSoundOnClient
 
| <code>void EmitSoundOnClient( string soundName, [[ #CDOTAPlayer | Player]] listeningPlayer)</code>
 
| Play named sound only on the client for the passed in player
 
|-
 
| EmitGlobalSound
 
| <code>void EmitGlobalSound( string soundName )</code>
 
| Play named sound for all players
 
|-
 
| StopSoundOn
 
| <code>void StopSoundOn( string, hscript )</code>
 
| Stop named sound on Entity
 
|-
 
| GetPhysVelocity
 
| <code>vector GetPhysVelocity( [[#CBaseEntity | Entity]] object)</code>
 
| Get Velocity for VPHYS or normal object
 
|-
 
| GetPhysAngularVelocity
 
| <code>vector GetPhysAngularVelocity( [[#CBaseEntity | Entity]] object)</code>
 
| Get Angular Velocity for VPHYS or normal object
 
|-
 
| Say
 
| <code>void Say( [[ #CDOTAPlayer | Player]] from, string text, bool team)</code>
 
| Have Entity say string, and teamOnly or not.  First param can be nil for an unowned broadcast
 
|-
 
| AddThinkToEnt
 
| <code>void AddThinkToEnt( [[#CBaseEntity | Entity]] entity, string functionName)</code>
 
| Adds a late bound think function to the C++ think tables for the obj
 
|-
 
| LoadKeyValues
 
| <code>variant LoadKeyValues( string file)</code>
 
| Creates a table from the specified keyvalues text file
 
|-
 
| LoadKeyValuesFromString
 
| <code>variant LoadKeyValuesFromString( string kvString)</code>
 
| Creates a table from the specified keyvalues string
 
|-
 
| DebugDrawScreenTextLine
 
| <code>void DebugDrawScreenTextLine( float x, float y, int lineOffset, string text, int r, int g, int b, int a, float duration)</code>
 
| Draw text with a line offset
 
|-
 
| DebugDrawText
 
| <code>void DebugDrawText( vector origin, string text, bool useViewCheck, float duration)</code>
 
| Draw text in 3d
 
|-
 
| DebugDrawBox
 
| <code>void DebugDrawBox( vector origin, vector min, vector max, int r, int g, int b, int a, float duration)</code>
 
| Draw a debug overlay box
 
|-
 
| DebugDrawLine
 
| <code>void DebugDrawLine( vector start, vector end, int r, int g, int b, bool zTest, float duration)</code>
 
| Draw a debug overlay line
 
|-
 
| DebugDrawCircle
 
| <code>void DebugDrawCircle( vector center, vector radius, vector rgb, float a, bool ztest, float duration)</code>
 
| Draw a debug circle
 
|-
 
| DebugDrawLine_vCol
 
| <code>void DebugDrawLine_vCol( vector start, vector end, vector rgb, bool ztest, float duration)</code>
 
| Draw a debug line using color vec
 
|-
 
| DebugDrawBoxDirection
 
| <code>void DebugDrawBoxDirection( vector center, vector min, vector max, vector forward, vector rgb, float a, float duration)</code>
 
| Draw a debug forward box
 
|-
 
| DebugDrawClear
 
| <code>void DebugDrawClear()</code>
 
| Try to clear all the debug overlay info
 
|-
 
| GetFrameCount
 
| <code>int GetFrameCount()</code>
 
| Returns the engines current frame count
 
|-
 
| IsDedicatedServer
 
| <code>bool IsDedicatedServer()</code>
 
| Returns true if this server is a dedicated server.
 
|-
 
| CreateUnitByName
 
| <code>hscript CreateUnitByName( string name, vector origin, bool findOpenSpot, hscript, hscript, int [[#Teams | team]])</code>
 
| Creates a DOTA unit by its dota_npc_units.txt name. 
 
|-
 
| CreateHeroForPlayer
 
| <code>hscript CreateHeroForPlayer( string heroName, [[#CDOTAPlayer | Player]] owningPlayer)</code>
 
| Creates a DOTA hero by its dota_npc_units.txt name and sets it as the given player's controlled hero
 
|-
 
| CreateItem
 
| <code>hscript CreateItem( string itemName, [[ #CDOTA_BaseNPC | Unit]] owningUnit, [[#CDOTA_BaseNPC | Unit]] unitToGetOrigin)</code>
 
| Create a DOTA item
 
|-
 
| CreateItemOnPosition
 
| <code>[[#CDOTA_Item_Physical | PhysicalItem]] CreateItemOnPosition( vector position )</code>
 
| Create a physical item at a given location
 
|-
 
| FindClearSpaceForUnit
 
| <code>void FindClearSpaceForUnit( [[ #CDOTA_BaseNPC | Unit]] npc, vector origin, bool )</code>
 
| Place a unit somewhere not already occupied.
 
|-
 
| FindUnitsInRadius
 
| <code>table FindUnitsInRadius( int [[#Teams | targetTeam]], vector position, [[#CEntities | Entity]] ent, float radius, int [[#Unit_Targetting | targetTypeTeam]], int [[#Unit_Targetting | targetTypeUnit]], int x, int y, bool )</code>
 
| Finds the units in a given radius with the given flags. 3rd param Entity appears to always be null, last 3 appear to be 0,0, false always
 
|-
 
| PrecacheUnit
 
| <code>void PrecacheUnit( string unitName)</code>
 
| Precaches all the resources for a given unit.
 
|-
 
| GetFrostyPointsForRound
 
| <code>int GetFrostyPointsForRound( int playerId, int difficulty, int roundNumber)</code>
 
|
 
|-
 
| GetGoldFrostyPointsForRound
 
| <code>int GetGoldFrostyPointsForRound( int playerId, int difficulty, int roundNumber )</code>
 
|
 
|-
 
| GetFrostyBoostAmount
 
| <code>float GetFrostyBoostAmount( int playerId, int )</code>
 
|
 
|-
 
| GetGoldFrostyBoostAmount
 
| <code>float GetGoldFrostyBoostAmount( int, int )</code>
 
|
 
|-
 
| SendFrostyPointsMessageToGC
 
| <code>void SendFrostyPointsMessageToGC( table data)</code>
 
|
 
|-
 
| SendFrostivusTimeElapsedToGC
 
| <code>void SendFrostivusTimeElapsedToGC()</code>
 
|
 
|-
 
| ExecuteOrderFromTable
 
| <code>void ExecuteOrderFromTable( table )</code>
 
| Issue an order from a script table. table structure appears to contain <code> { int UnitIndex, int [[#Unit_Order_Types | OrderType]], vector Position, bool Queue, int AbilityIndex, int TargetIndex } </code>.  UnitIndex is the unit to order.  OrderType is the linked enum.  Position is needed if the OrderType requires a position (move, castPoint, etc).  Queue is used if the ability should be executed after the current order.  AbilityIndex is used if OrderType is a cast, and TargetIndex is used if OrderType is a targeted cast. 
 
|}
 
 
 
=== Global Accessors ===
 
 
 
{| class="standard-table" style="width: 100%;"
 
! Accessor Name
 
! Description
 
|-
 
| <code> [[#CEntities | Entities]] </code>
 
| Instance of CEntities
 
|-
 
| <code> [[#Convars| ConVars]] </code>
 
| Instance of ConVars
 
|-
 
| <code> [[#CDOTA_PlayerResource| PlayerResource]] </code>
 
| Instance of CDOTA_PlayerResource
 
|-
 
| <code> [[#CScriptParticleManager | ParticleManager ]] </code>
 
| Instance of CScriptParticleManager
 
|-
 
| <code> [[#CScriptHeroList | HeroList ]] </code>
 
| Instance of HeroList
 
|}
 
 
 
=== Constants ===
 
 
 
==== Picking States ====
 
 
 
* DOTA_HEROPICK_STATE_NONE
 
* DOTA_HEROPICK_STATE_AP_SELECT
 
* DOTA_HEROPICK_STATE_SD_SELECT
 
* DOTA_HEROPICK_STATE_INTRO_SELECT
 
* DOTA_HEROPICK_STATE_RD_SELECT
 
* DOTA_HEROPICK_STATE_CM_INTRO
 
* DOTA_HEROPICK_STATE_CM_BAN1
 
* DOTA_HEROPICK_STATE_CM_BAN2
 
* DOTA_HEROPICK_STATE_CM_BAN3
 
* DOTA_HEROPICK_STATE_CM_BAN4
 
* DOTA_HEROPICK_STATE_CM_BAN5
 
* DOTA_HEROPICK_STATE_CM_BAN6
 
* DOTA_HEROPICK_STATE_CM_BAN7
 
* DOTA_HEROPICK_STATE_CM_BAN8
 
* DOTA_HEROPICK_STATE_CM_BAN9
 
* DOTA_HEROPICK_STATE_CM_BAN10
 
* DOTA_HEROPICK_STATE_CM_SELECT1
 
* DOTA_HEROPICK_STATE_CM_SELECT2
 
* DOTA_HEROPICK_STATE_CM_SELECT3
 
* DOTA_HEROPICK_STATE_CM_SELECT4
 
* DOTA_HEROPICK_STATE_CM_SELECT5
 
* DOTA_HEROPICK_STATE_CM_SELECT6
 
* DOTA_HEROPICK_STATE_CM_SELECT7
 
* DOTA_HEROPICK_STATE_CM_SELECT8
 
* DOTA_HEROPICK_STATE_CM_SELECT9
 
* DOTA_HEROPICK_STATE_CM_SELECT10
 
* DOTA_HEROPICK_STATE_CM_PICK
 
* DOTA_HEROPICK_STATE_AR_SELECT
 
* DOTA_HEROPICK_STATE_MO_SELECT
 
* DOTA_HEROPICK_STATE_FH_SELECT
 
* DOTA_HEROPICK_STATE_COUNT
 
 
 
==== Teams ====
 
 
 
* DOTA_TEAM_GOODGUYS
 
* DOTA_TEAM_BADGUYS
 
* DOTA_TEAM_NEUTRALS
 
* DOTA_TEAM_NOTEAM
 
 
 
==== Unit Targetting ====
 
 
 
* DOTA_UNIT_TARGET_TEAM_NONE
 
* DOTA_UNIT_TARGET_TEAM_FRIENDLY
 
* DOTA_UNIT_TARGET_TEAM_ENEMY
 
* DOTA_UNIT_TARGET_TEAM_CUSTOM
 
* DOTA_UNIT_TARGET_TEAM_BOTH
 
* DOTA_UNIT_TARGET_NONE
 
* DOTA_UNIT_TARGET_HERO
 
* DOTA_UNIT_TARGET_CREEP
 
* DOTA_UNIT_TARGET_BUILDING
 
* DOTA_UNIT_TARGET_MECHANICAL
 
* DOTA_UNIT_TARGET_COURIER
 
* DOTA_UNIT_TARGET_OTHER
 
* DOTA_UNIT_TARGET_TREE
 
* DOTA_UNIT_TARGET_CUSTOM
 
* DOTA_UNIT_TARGET_BASIC
 
* DOTA_UNIT_TARGET_ALL
 
* DOTA_UNIT_TARGET_FLAG_NONE
 
* DOTA_UNIT_TARGET_FLAG_RANGED_ONLY
 
* DOTA_UNIT_TARGET_FLAG_MELEE_ONLY
 
* DOTA_UNIT_TARGET_FLAG_DEAD
 
* DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES
 
* DOTA_UNIT_TARGET_FLAG_NOT_MAGIC_IMMUNE_ALLIES
 
* DOTA_UNIT_TARGET_FLAG_INVULNERABLE
 
* DOTA_UNIT_TARGET_FLAG_FOW_VISIBLE
 
* DOTA_UNIT_TARGET_FLAG_NO_INVIS
 
* DOTA_UNIT_TARGET_FLAG_NOT_ANCIENTS
 
* DOTA_UNIT_TARGET_FLAG_PLAYER_CONTROLLED
 
* DOTA_UNIT_TARGET_FLAG_NOT_DOMINATED
 
* DOTA_UNIT_TARGET_FLAG_NOT_SUMMONED
 
* DOTA_UNIT_TARGET_FLAG_NOT_ILLUSIONS
 
* DOTA_UNIT_TARGET_FLAG_NOT_ATTACK_IMMUNE
 
* DOTA_UNIT_TARGET_FLAG_MANA_ONLY
 
* DOTA_UNIT_TARGET_FLAG_CHECK_DISABLE_HELP
 
* DOTA_UNIT_TARGET_FLAG_NOT_CREEP_HERO
 
* DOTA_UNIT_TARGET_FLAG_OUT_OF_WORLD
 
* DOTA_UNIT_TARGET_FLAG_NOT_NIGHTMARED
 
 
 
==== Find Types ====
 
 
 
* FIND_UNITS_EVERYWHERE
 
* FIND_CLOSEST
 
* FIND_FARTHEST
 
* FIND_ANY_ORDER
 
 
 
==== Quest Text Replacement ====
 
 
 
* QUEST_TEXT_REPLACE_VALUE_CURRENT_VALUE
 
* QUEST_TEXT_REPLACE_VALUE_TARGET_VALUE
 
* QUEST_TEXT_REPLACE_VALUE_ROUND
 
* QUEST_TEXT_REPLACE_VALUE_REWARD
 
* QUEST_NUM_TEXT_REPLACE_VALUES
 
 
 
==== Particle Attach Types ====
 
 
 
* PATTACH_ABSORIGIN
 
* PATTACH_ABSORIGIN_FOLLOW
 
* PATTACH_CUSTOMORIGIN
 
* PATTACH_CUSTOMORIGIN_FOLLOW
 
* PATTACH_POINT
 
* PATTACH_POINT_FOLLOW
 
* PATTACH_EYES_FOLLOW
 
* PATTACH_OVERHEAD_FOLLOW
 
* PATTACH_WORLDORIGIN
 
* PATTACH_ROOTBONE_FOLLOW
 
* PATTACH_POINT_FOLLOW_SUBSTEPPED
 
* PATTACH_RENDERORIGIN_FOLLOW
 
* MAX_PATTACH_TYPES
 
 
 
==== Inventory Constants ====
 
 
 
* DOTA_ITEM_MAX
 
* DOTA_ITEM_INVENTORY_SIZE
 
* DOTA_ITEM_STASH_SIZE
 
* DOTA_ITEM_STASH_MIN
 
* DOTA_ITEM_STASH_MAX
 
 
 
==== Item Types ====
 
 
 
* DOTA_ITEM_TRANSIENT_ITEM
 
* DOTA_ITEM_TRANSIENT_RECIPE
 
* DOTA_ITEM_TRANSIENT_CAST_ITEM
 
 
 
==== Inventory Access Flags ====
 
 
 
* DOTA_INVENTORY_ALLOW_NONE
 
* DOTA_INVENTORY_ALLOW_MAIN
 
* DOTA_INVENTORY_ALLOW_STASH
 
* DOTA_INVENTORY_ALLOW_DROP_ON_GROUND
 
* DOTA_INVENTORY_ALLOW_DROP_AT_FOUNTAIN
 
* DOTA_INVENTORY_ALL_ACCESS
 
 
 
==== Gamerules State ====
 
 
 
* DOTA_GAMERULES_STATE_INIT
 
* DOTA_GAMERULES_STATE_WAIT_FOR_PLAYERS_TO_LOAD
 
* DOTA_GAMERULES_STATE_HERO_SELECTION
 
* DOTA_GAMERULES_STATE_STRATEGY_TIME
 
* DOTA_GAMERULES_STATE_PRE_GAME
 
* DOTA_GAMERULES_STATE_GAME_IN_PROGRESS
 
* DOTA_GAMERULES_STATE_POST_GAME
 
* DOTA_GAMERULES_STATE_DISCONNECT
 
* DOTA_GAMERULES_STATE_LAST
 
 
 
==== Lobby/GC Teams ====
 
 
 
* DOTA_GC_TEAM_GOOD_GUYS
 
* DOTA_GC_TEAM_BAD_GUYS
 
* DOTA_GC_TEAM_BROADCASTER
 
* DOTA_GC_TEAM_SPECTATOR
 
* DOTA_GC_TEAM_PLAYER_POOL
 
* DOTA_GC_TEAM_NOTEAM
 
 
 
==== Gold Modifiers ====
 
 
 
* DOTA_ModifyGold_Unspecified
 
* DOTA_ModifyGold_Death
 
* DOTA_ModifyGold_Buyback
 
* DOTA_ModifyGold_PurchaseConsumable
 
* DOTA_ModifyGold_PurchaseItem
 
* DOTA_ModifyGold_AbandonedRedistribute
 
* DOTA_ModifyGold_SellItem
 
* DOTA_ModifyGold_AbilityCost
 
 
 
==== Unit Order Types ====
 
 
 
* DOTA_UNIT_ORDER_NONE
 
* DOTA_UNIT_ORDER_MOVE_TO_POSITION
 
* DOTA_UNIT_ORDER_MOVE_TO_TARGET
 
* DOTA_UNIT_ORDER_ATTACK_MOVE
 
* DOTA_UNIT_ORDER_ATTACK_TARGET
 
* DOTA_UNIT_ORDER_CAST_POSITION
 
* DOTA_UNIT_ORDER_CAST_TARGET
 
* DOTA_UNIT_ORDER_CAST_TARGET_TREE
 
* DOTA_UNIT_ORDER_CAST_NO_TARGET
 
* DOTA_UNIT_ORDER_CAST_TOGGLE
 
* DOTA_UNIT_ORDER_HOLD_POSITION
 
* DOTA_UNIT_ORDER_TRAIN_ABILITY
 
* DOTA_UNIT_ORDER_DROP_ITEM
 
* DOTA_UNIT_ORDER_GIVE_ITEM
 
* DOTA_UNIT_ORDER_PICKUP_ITEM
 
* DOTA_UNIT_ORDER_PICKUP_RUNE
 
* DOTA_UNIT_ORDER_PURCHASE_ITEM
 
* DOTA_UNIT_ORDER_SELL_ITEM
 
* DOTA_UNIT_ORDER_DISASSEMBLE_ITEM
 
* DOTA_UNIT_ORDER_MOVE_ITEM
 
* DOTA_UNIT_ORDER_CAST_TOGGLE_AUTO
 
* DOTA_UNIT_ORDER_STOP
 
* DOTA_UNIT_ORDER_TAUNT
 
* DOTA_UNIT_ORDER_BUYBACK
 
* DOTA_UNIT_ORDER_GLYPH
 
* DOTA_UNIT_ORDER_EJECT_ITEM_FROM_STASH
 
* DOTA_UNIT_ORDER_CAST_RUNE
 
 
 
==== Item Sharing Types ====
 
 
 
* ITEM_FULLY_SHAREABLE
 
* ITEM_PARTIALLY_SHAREABLE
 
* ITEM_NOT_SHAREABLE
 
 
 
==== Music Status ====
 
 
 
* DOTA_MUSIC_STATUS_NONE
 
* DOTA_MUSIC_STATUS_EXPLORATION
 
* DOTA_MUSIC_STATUS_BATTLE
 
* DOTA_MUSIC_STATUS_PRE_GAME_EXPLORATION
 
* DOTA_MUSIC_STATUS_DEAD
 
 
 
==== ConVar Flags ====
 
 
 
* FCVAR_UNREGISTERED
 
* FCVAR_DEVELOPMENTONLY
 
* FCVAR_HIDDEN
 
* FCVAR_PROTECTED
 
* FCVAR_SPONLY
 
* FCVAR_ARCHIVE
 
* FCVAR_NOTIFY
 
* FCVAR_USERINFO
 
* FCVAR_PRINTABLEONLY
 
* FCVAR_UNLOGGED
 
* FCVAR_NEVER_AS_STRING
 
* FCVAR_REPLICATED
 
* FCVAR_CHEAT
 
* FCVAR_SS
 
* FCVAR_DEMO
 
* FCVAR_DONTRECORD
 
* FCVAR_NOT_CONNECTED
 
* FCVAR_VCONSOLE_SET_FOCUS
 
 
 
== See also ==
 
* [[L4D2 Vscripts]]
 
* [[L4D2 Vscript Examples]]
 
* {{csgo}} [[List of Counter-Strike: Global Offensive Script Functions]]
 
* {{portal2}} [[List of Portal 2 Script Functions]]
 
 
 
[[Category:Dota 2]]
 
[[Category:Scripting]]
 

Latest revision as of 00:37, 9 August 2014