• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Attribute as damage

Status
Not open for further replies.
Level 28
Joined
Sep 26, 2009
Messages
2,520
You're way too vague with what you want.

The only thing I can help you actually with is that damage is a real, while attribute is an integer, so to add attribute to dmg you need to use the function "Convert integer to real".
  • Set dmg = (300.00 + Real(Intelligence of your_hero))
etc.

You cannot add extra dmg on an attack via triggers easily, as you will either overfill the event block with "specific unit takes damage" events or you'll use a global, but abusable "unit is attacked" event.
The best way to add dmg to an attack is to use a damage detection system and to completely trigger your own spells.
 
Last edited:
Level 14
Joined
Dec 12, 2012
Messages
1,007
Sry too lazy to search :p

@Nichilus, thanks but Im not clear. Can you send map?

You should put some effort into understanding their advices, otherwise you will get into trouble when the system doesn't behave as you expect. Its always a good idea to understand (in principle) the systems you are using.


Detect attack damage through adding a hidden spellbook ability to all units that contains a poison attack. Check in the DDS if the instance target has such poison buff, then remove the buff and declare the damage dealt as physical.

Once physical damage is declared, check if the hero is the preferred unit type and deal damage.

That won't work reliable. Plus the system you linked is bugged for damage modification and not maintained anymore.

Use a DDS that has support for damage type detection:

 
Level 28
Joined
Sep 26, 2009
Messages
2,520
@Nichilus, thanks but Im not clear. Can you send map?
I can't. I have no idea what you don't understand and what you want me to show you. Again, you're too vague.

The line in my post shows how to convert integer into real number. I even wrote you which option to choose to do so.
I can't show you how to increase dmg of some ability as that requires you to use the DDS and it depends on the DDS that you use (tho the principle is same) and also at your approach.
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
This is a very basic and simple way to add damage, the problem is the added damage isn't similar with the damage type of the attacking unit, also the damage isn't shown as a green additional damage near the original damage. What you actually need to achieve is a damage modification system.
  • Extra Damage via Attributes
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacking unit) is A Hero) Equal to True
        • Then - Actions
          • Set Extra_Damage = (Real((Strength of (Attacking unit) (Include bonuses))))
          • Unit - Cause (Attacking unit) to damage (Attacked unit), dealing Extra_Damage damage of attack type Normal and damage type Normal
        • Else - Actions
 
Status
Not open for further replies.
Top