[Solved] Remove Stat Damage Scaling (for specific hero)

--------------------------------------------------------------------------
Perhaps someone has a better solution

My primary issue is that I have a hero who has Inferno-Meteor thing as their projectile (falling from the sky (from summon inferno ability) -- NOT the archimonde boulder throw), but i am struggling to make damage delayed until the meteor lands.

Changing the damage point and backswing, I managed to make it so the FIRST attack properly deals damage only after the meteor hits the target. But on subsequent attacks the damage is dealt way earlier. (Changing attack cooldown didnt fix this)

SO my "solution" is to make the hero deal 0 damage, then apply damage via trigger on "unit is attacked"
NOTE: (changing damage dice to 0 makes them just have no attack option... so I made them have 1 dice with 0 sides, and 0 base damage)
--------------------------------------------------------------------------



--------------------------------------------------------------------------
HOWEVER

Primary Attribute increases this damage. Making it so I can't have them do 0 damage without making their primary attribute 0.

I dont want to do this though as I planned to:
  • have ability damage scaled by stats
  • maintain stat buff to things like mana, movespeed, and hp
  • have damage trigger be modified by primary attribute
I also dont want to entirely remove the concept of primary attribute buffing hero damage - as i want it to do so for all other heroes
--------------------------------------------------------------------------



--------------------------------------------------------------------------
My current Idea I am going to try but am hoping to avoid... [SOLUTION - this works]
  • Have variables storing what I want their base damage to be. (or just hardset it directly, which will mean if you apply it via more than one trigger, then you will have to change it in multiple places)
  • have variables storing what I want their damage dice to do. (or just hardset it directly, which will mean if you apply it via more than one trigger, then you will have to change it in multiple places)
  • apply these variables to the hero whenever they level up, or on map init (so i can still spawn them in with levels)...
Idk if this will work though, as I imagine that the attribute damage is applied ontop of these values (and they arent directly changed by attributes)
--------------------------------------------------------------------------



--------------------------------------------------------------------------
Alternative Idea
  • Find buff/debuff that can remove damage
  • have this buff subtract 1000000 damage (or reduce damage to 0% if thats possible)

Idk what ability to use to do this though. I tried item damage increase, but it didnt allow negatives.
--------------------------------------------------------------------------



--------------------------------------------------------------------------
[Additional Question]
- hoping i can do same thing for attackspeed. I dont want agility to make them attack faster as it ruins the animation.

EDIT (No Solution) (see next green edit below): setting attack interval via trigger editor (as mentioned in the solution) doesnt seem to work despite it working for damage

NOTE:

The "set attack interval" has weapon index going from 1-2,
while the damage ones have it going from
0-1...
possibly this is the issue and its not solvable for attack 1 (index 0) and the error is on blizzards side.


EDIT:
Found half the solution now.
Setting Interval to be = to
(1 + 0.02 x agility) x Basic
Must have stored original basic so this doesnt keep changing each time
Doesnt stop the animation from being faster though...


EDIT: Actually solved this. made another post about this part. Solution was to to apply custom "slow" ability on the unit, with an algorithm modifying this slow ability to perfectly match the attackspeed bonus from agility

--------------------------------------------------------------------------



--------------------------------------------------------------------------
EDIT

I have started trying to do the first idea... it "works" but it has an issue due to my hero being complicated.

They have a custom morph ability. The one i want to modify is their morphed form. I currently store this second form as variable, but I can only do so after morphing back to the original. Because I use the "Triggering Unit" from the trigger where the morph is cast, to capture the unit for the form1 and form2.

Because of this, I cant directly modify the second form until the 2nd transform.

And unfortunately, morph doesnt trigger "unit enters playable area".

If someone can help me capture the unit the hero morphs into, in the trigger where they morph, thatd help alot
--------------------------------------------------------------------------
EDIT 2:

Fixed this by selecting units within 500 of the triggering unit, and making form2 equal to the picked unit if it matches the morph2 type.
Would be fucked if there were multiple of this hero. But this entire hero wouldnt work if there was more than 1, so i dont care.


As is tradition, I previously spent like 15 hours trying to figure a better solution for that without coming up with anything... but within 10 minutes of posting here about it, I figure it out...
--------------------------------------------------------------------------
 
Last edited:
I think the simplest solution is to do the following:
  1. Change the unit's projectile to "None" in the object editor and set the missile speed to a large number, e.g. 10000
  2. Add a trigger to detect when that unit-type is about to deal damage
  3. Set the damage to 0 via triggers, capture the actual damage that was supposed to be dealt, and add the infernal effect
  4. Once the infernal effect is over, apply the damage again
This is pretty straightforward on patch 1.32+ since they have support for "a unit is about to take damage" events (with the option to modify the damage dealt). If you need support for an older patch, you can do the same thing with a DDS (Damage Detection System).

Here are some sample triggers, and a sample map below that works pretty well. It should work with haste, attack bonuses, attributes, etc. since it is preserving the amount of damage they would've dealt (and simply "delaying" it). I use dynamic indexing to delay the damage until after 0.8 seconds have passed (roughly how long the infernal effect lasts), you can read about it here: Visualize: Dynamic Indexing
  • InfernalAttack
    • Events
      • Unit - A unit About to take damage
    • Conditions
      • (Unit-type of (Damage source)) Equal to Lich
      • (Damage From Normal Attack) Equal to True
    • Actions
      • -------- --------
      • -------- Store the damage details so we can apply it after the inferno effect --------
      • -------- --------
      • Set VariableSet IA_Count = (IA_Count + 1)
      • Set VariableSet IA_DamageSource[IA_Count] = (Damage source)
      • Set VariableSet IA_DamageTarget[IA_Count] = (Damage Target)
      • Set VariableSet IA_Damage[IA_Count] = (Damage taken)
      • Set VariableSet IA_ElapsedTime[IA_Count] = 0.00
      • Set VariableSet IA_AttackType[IA_Count] = (Damage Attack Type)
      • Set VariableSet IA_DamageType[IA_Count] = (Damage Type)
      • -------- --------
      • -------- Erase the damage and trigger the effect --------
      • -------- Apply the damage again once the effect finishes --------
      • -------- --------
      • Event Response - Set Damage of Unit Damaged Event to 0.00
      • Set VariableSet IA_EffectPoint = (Position of (Damage Target))
      • Special Effect - Create a special effect at IA_EffectPoint using Units\Demon\Infernal\InfernalBirth.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_IA_EffectPoint)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IA_Count Equal to 1
        • Then - Actions
          • Trigger - Turn on InfernalAttackLoop <gen>
        • Else - Actions
  • InfernalAttackLoop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • For each (Integer IA_LoopInteger) from 1 to IA_Count, do (Actions)
        • Loop - Actions
          • Set VariableSet IA_ElapsedTime[IA_Count] = (IA_ElapsedTime[IA_LoopInteger] + 0.05)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IA_ElapsedTime[IA_LoopInteger] Greater than or equal to 0.80
            • Then - Actions
              • -------- --------
              • -------- Apply the damage once the infernal effect ends --------
              • -------- Be sure to disable the InfernalAttack trigger before applying damage so this doesn't recursively loop --------
              • -------- --------
              • Trigger - Turn off InfernalAttack <gen>
              • Unit - Cause IA_DamageSource[IA_LoopInteger] to damage IA_DamageTarget[IA_LoopInteger], dealing IA_Damage[IA_LoopInteger] damage of attack type IA_AttackType[IA_LoopInteger] and damage type IA_DamageType[IA_LoopInteger]
              • Trigger - Turn on InfernalAttack <gen>
              • -------- --------
              • -------- Recycle this index --------
              • -------- --------
              • Set VariableSet IA_DamageSource[IA_LoopInteger] = IA_DamageSource[IA_Count]
              • Set VariableSet IA_DamageTarget[IA_LoopInteger] = IA_DamageTarget[IA_Count]
              • Set VariableSet IA_Damage[IA_LoopInteger] = IA_Damage[IA_Count]
              • Set VariableSet IA_ElapsedTime[IA_LoopInteger] = IA_ElapsedTime[IA_Count]
              • Set VariableSet IA_AttackType[IA_LoopInteger] = IA_AttackType[IA_Count]
              • Set VariableSet IA_DamageType[IA_LoopInteger] = IA_DamageType[IA_Count]
              • Set VariableSet IA_Count = (IA_Count - 1)
              • Set VariableSet IA_LoopInteger = (IA_LoopInteger - 1)
              • -------- --------
              • -------- If there are no more active attacks in progress, stop this timer --------
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • IA_Count Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
The main issues are that orbs will apply damage/debuffs instantly since they will apply when the unit's projectile lands (e.g. orb of venom, orb of corruption). And splash damage from fire orb/cleave will do 0 damage, so you'll need to trigger your own splash damage if needed.
 

Attachments

  • InfernalAttackSample.w3m
    20.3 KB · Views: 2
Top