#Critical hit

1 messages · Page 1 of 1 (latest)

soft basalt
#

is it possible to somehow create a global function to determine that a hero has dealt a critical hit? all my abilities and items with crits are custom

steep topaz
#

Sure. When your unit uses a modifier which triggers a critical hit, call a function that stores it on the caster, with other properties such as triggering modifier, current dota time etc.

#

Then you can make another function that can fetch critical hits based on stats such as time difference or damage, etc.

soft basalt
outer lake
#

the hacky solution is usually to register a crit property, set its getcritdamage to 1 and then listen for a roll in the property itself

#

if it isn't triggered, you crit

#

its rolled on attackrecord, so you can then listen to onattack and say "it didn't trigger, therefore this is a crit"

#

but if all your shit is custom you can just tell your code you crit

#

add a flag to the unit or whatever