Dota 2 Workshop Tools/Scripting/API/Global.ApplyDamage

From Valve Developer Community
< Dota 2 Workshop Tools‎ | Scripting‎ | API
Revision as of 21:48, 27 February 2017 by Yunten (talk | contribs) (Function Description)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Note: This page is automatically generated. Any changes may be overwritten

Function Description

float ApplyDamage(handle DamageTable)

Applies damage to a unit.

Table Inputs: victim, attacker, damage, damage_type, damage_flags, ability

--Apply 500 pure damage from player 1's hero to itself

playerHero = PlayerResource:GetPlayer(1):GetAssignedHero()

local damageTable = {
	victim = playerHero,
	attacker = playerHero,
	damage = 500,
	damage_type = DAMAGE_TYPE_PURE,
	damage_flags = DOTA_DAMAGE_FLAG_NONE, --Optional.
	ability = playerHero:GetAbilityByIndex(0), --Optional.



Type Name Description
handle DamageTable a table containing Unit Victim, Unit attacker, float damage, and DAMAGE_TYPE type


float - damage done after reductions