Forum Rules

  • No flaming or derogatory remarks, directly or through insinuation.
  • No discussion, sharing or referencing illegal software such as hacks, keygen, cracks and pirated software.
  • No offensive contents, including but not limited to, racism, gore or pornography.
  • No excessive spam/meme, i.e. copious one liners in a short period of time, typing with all caps or posting meme responses (text/image).
  • No trolling, including but not limited to, flame incitation, user provocation or false information distribution.
  • No link spamming or signature advertisements for content not specific to Dota 2.
  • No Dota 2 key requests, sell, trade etc.
  • You may not create multiple accounts for any purpose, including ban evasion, unless expressly permitted by a moderator.

  • Please search before posting. One thread per issue. Do not create another thread if there is an existing one already.
  • Before posting anything, make sure you check out all sticky threads (e.g., this). Do not create new threads about closed ones.
  • It is extremely important that you post in correct forum section.

  • Balance discussion only in Misc.
  • All art related (such as hero model) feedbacks go to Art Feedback Forum.
  • All matchmaking feedback should go here: Matchmaking Feedback
  • All report/low priority issues should go here: Commend/Report/Ban Feedback
  • No specific workshop item feedback. These should go to workshop page of that item.
  • When posting in non-bugs section (such as this), use [Bugs], [Discussion] or [Suggestion] prefix in your thread name.

In case you object some action by a moderator, please contact him directly through PM and explain your concerns politely. If you are still unable to resolve the issue, contact an administrator. Do not drag these issues in public.

All rules are meant to augment common sense, please use them when not conflicted with aforementioned policies.
See more
See less

[Suggestion] Expose information about attacks being currently in progress

  • Filter
  • Time
  • Show
Clear All
new posts

  • [Suggestion] Expose information about attacks being currently in progress

    In events like "OnOrbImpact", OnAttackStart", "OnAttackLanded", and OnAttack" it would be helpful to be able to use some information about the attack like the actual damage of the attack or if the attack will miss.

    Some abilities want to work on the exact damage an attack would do. For example you might want to mana burn scaling with attack damage. Currently you would have to use caster:AttackDamage or caster:GetAverageTrueAttackDamage which work but are not exact. Having this available would be helpful.
    If this is taken a step further you would even be able to change those values on the fly. It could include things like projectile speed so you could make an orb effect that can change it's speed over time for example.

  • #2
    You should look into damage filters, which were recently added and give you much more control. tutorial_assist_game has an example:

    GameRules:GetGameModeEntity():SetDamageFilter( Dynamic_Wrap( CTutorialAG, "FilterDamage" ), self )
    function CTutorialAG:FilterDamage( filterTable )
    --	for k, v in pairs( filterTable ) do
    --		print("Damage: " .. k .. " " .. tostring(v) )
    --	end
    	if ( filterTable["entindex_victim_const"] == nil or filterTable["entindex_attacker_const"] == nil ) then
    --		for k, v in pairs( filterTable ) do
    --			print("Damage: " .. k .. " " .. tostring(v) )
    --		end		
    		return true
    	local hVictim = EntIndexToHScript( filterTable["entindex_victim_const"] )
    	local hAttacker = EntIndexToHScript( filterTable["entindex_attacker_const"] )
    	if ( hVictim ~= nil ) then
    		if ( hVictim:IsBoss() ) then
    			self:_IncrementAlert( ALERT_ROSHAN, 1.0 )
    	local heroUnit = PlayerResource:GetSelectedHeroEntity( 0 )
    	if ( hVictim ~= nil and hAttacker ~= nil and heroUnit ~= nil ) then
    		if ( hVictim:IsCreep() and hAttacker:IsCreep() and hVictim:GetTeamNumber() == heroUnit:GetTeamNumber() and not self._bLateGame ) then
    			if ( hVictim:GetRangeToUnit( heroUnit ) < 800 ) then
    --				print("Want to increase creep damage " .. tostring(filterTable["damage"]) .. " -> " .. tostring(1.15*filterTable["damage"]) )
    				filterTable["damage"] = 1.15*filterTable["damage"]
    	return true

    I believe the return value indicates whether the attack should hit or not.