• 🏆 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!

[Trigger] Increasing Damage Taken using Ability

Status
Not open for further replies.
Level 7
Joined
Aug 5, 2010
Messages
147
Im trying to make it so when a certain ability is cast on a unit that unit takes 25% extra damage.

Here is the trigger i created

  • Assassins Mark
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacked unit) has buff Mark of the Assassin ) Equal to True
        • Then - Actions
          • Set AssMark = ((Life of (Attacked unit)) - ((Damage taken) x 1.25))
          • Unit - Set life of (Attacked unit) to AssMark
        • Else - Actions
          • Do nothing
It doesn't work because the 'damage taken' part has no event to respond to and the event im using doesn't have a damage taken event.

I created a unit variable to store the unit that is effected by the ability but i cant use the variable for the event 'a specific unit is attacked' so i cant use the 'specific unit' event to get it to work.
 
You're on the right track! Unfortunately, (Damage Taken) responds to "Unit - <Unit> takes damage". You can't detect the damage taken from "Unit - A unit Is attacked". Although, the issue with the "takes damage" event is that it requires you to put in a particular unit. That is pretty inconvenient.

As such, we generally use damage detection systems. I personally recommend Bribe's Damage Engine for GUI:
http://www.hiveworkshop.com/forums/spells-569/gui-damage-engine-v2-2-1-0-a-201016/

Make sure you read the instructions and check out the test map to see how to use it. I'll help you get started with this trigger though.

Instead of the usual events, Bribe's DDS (Damage Detection System) gives you custom events:
  • Example
    • Events
      • Game - DamageEvent Equal to 1.00
      • ---- ^ Use this when you want to detect damage normally ----
      • Game - DamageEvent Equal to 2.00
      • ---- ^ Use this when you want to detect 0 damage things (special cases) ----
      • Game - DamageModifierEvent Equal to 1.00
      • ---- ^ Use this when you want to MODIFY damage ----
I added comments above to show what each event does. The one we want is "DamageModifierEvent Equal to 1.00", since we want to change the amount of damage done to a target with that buff. His system provides you with variables "DamageEventAmount", "DamageEventSource", and "DamageEventTarget" to retrieve the amount of damage dealt, who did it, and who received it.

I won't go into detail explaining how it works, but here is how your trigger would essentially look:
  • Assassins Mark
    • Events
      • Game - DamageModifierEvent Equal to 1.00
    • Conditions
      • ((DamageEventTarget) has buff Mark of the Assassin) Equal to True
    • Actions
      • Set DamageEventAmount = (DamageEventAmount x 1.25)
It is as simple as that! Using a DDS is incredibly helpful, and it allows you to do amazing things with incredible ease. I highly recommend giving it a look, it'll open up a ton of possibilities for spell mechanics.
 
Status
Not open for further replies.
Top