• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

GUI Trigger Help - Inserting an Integer into a Damage Event

Status
Not open for further replies.
Level 11
Joined
Aug 24, 2012
Messages
429
I need help with this trigger - I want to set the damage as Arthas Strenght x 2 but I do not know how do load a variable (an integer) into a damage event...it just does not seem to be on the list. I don't know if this makes sense...

  • Arthas Strenght
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set ArthasStrenght = (Strength of Arthas (Include bonuses))
  • Holy Smite Bonus
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to Arthas
      • ((Attacked unit) has buff Breath of Fire) Equal to True
    • Actions
      • Unit - Cause Arthas to damage (Attacked unit), dealing 500.00 damage of attack type Spells and damage type Normal
I want the damage to be 2 X Arthas' Strenght. But if I click on the 500 flat number I get no options to insert the Integer Variable ArthasStrenght, only some Aritmetic options.

I know that Unit is Attacked is not a reliable Event but for me it will do just fine.
 
Level 6
Joined
May 20, 2014
Messages
228
  • Actions
    • Set integer = (Strength of (Triggering unit) (Include bonuses))
This function is via Integer > Hero - Hero attribute in the drop list. Then use an arithmetic to multiply it by 2, and you should have the answer. I wouldn't recommend that you set Arthas's strength to an integer variable every 2 seconds, just declare the integer variable when that specific situation happens (like that last trigger).

Also, I recommend you use the search function; threads like this has been posted over and over.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
As Daffa the Mage said, you should do:
  • Unit - Cause DDS_Source to damage DDS_Target, dealing (Real((Strength of DDS_Source (Include bonuses))) x 2.00) damage of attack type Spells and damage type Normal
Or you could just increase the value of the damage using the DDS.
It gives you a value of how much damage is dealt and you can increase that (if you want to use the same attack and damage types).
Be aware that DDS do not take proper resistance calculation in honor.
 
Level 11
Joined
Aug 24, 2012
Messages
429
I know I'm supposed to use a DDS but I'm not sure learning to use one is worth it...Attacked Unit is fine for the moment, it's just a campaign and one unit, I'm not worried about people abusing it.

Does using a DDS imply that all damage in the campaign will have to be triggered? Because I definitely don't want that.

Anyway thank you all in particular Daffa, what I was looking for was the Convert Integer to Real.
 
Level 11
Joined
Aug 24, 2012
Messages
429
Care to elaborate? If for example I have a DDS implemented in my map and I only want to use it for a few attacks and maybe a couple of abilities, would un-triggered abilities or triggered abilities that don't use the DDS (instead they use the unit is target of ability cast) be affected?

Damage would be dealt through a GUI deal damage event anyway, and that is separate from a DDS right? Why would a DDS affect resistances, since it is only meant to detect the damage being dealt and the unit that dealt the damage?
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Because of a slight flaw in how a DDS works.
WC3 API only gives you an event of on-damage after the damage value has been reduced by armor, attack-type vs armor type, abilities that change the value, etc, etc, etc.
Every DDS works with that event, so if I deal 100 damage to you, and you have reduced it to 50 because of your armor, the DDS will say that I have dealt 50 damage.

Here is where the inaccuracy comes in place, changing that value (50) to 50 + 200 (because I got a triggered ability that deals 200 additional damage on attack), the final value will be 250.
However, if I added that 200 before calculating the final value (before armor and stuff), that would be (100 + 200) / 2 = 150, which is only 60% of the value we had before.
So changing that number is not really nice in most DDS.

Also, most DDS work with an ability that only reduces spell damage.
They use it to invert spell damage so negative damage comes from spells.
However, because of that WC3 only supports one spell damage reduction per unit, this will overwrite elune's grace, runed bracers, etc (or elune's grace, runed bracers, etc will overwrite the one by the DDS).
 
Status
Not open for further replies.
Top