• 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.
  • Vote for the theme of Hive's HD Modeling Contest #7! Click here to vote! - Please only vote if you plan on participating❗️

execute skill

Status
Not open for further replies.

311

311

Level 4
Joined
May 12, 2019
Messages
73
How would I go about triggering the damage for an execute ability?
I checked all the reals/integers in triggers but I cant find anything that would give me the # I am looking for.(Though I assume I am just missing how to do the arithmetic)

Basically, I want it so the more health the unit you are attacking is missing the more damage you do.
so for example 1000 max HP unit who currently has 800health remaining Execute would only do 200 damage. 1000-800=200 damage

If the 1000 max HP unit had 300 remaining health you would do 700 damage 1000-700= 300 damage

this of course before armor and everything, so you don't just auto kill anything once its 50%

life of the target unit isn't the current health,
I thought it would just be a simple units max HP- Units HP, but for some reason they are the same, as this would result in killing the unit if hes at max health.
 

Uncle

Warcraft Moderator
Level 71
Joined
Aug 10, 2018
Messages
7,590
This works:
  • Example Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Bolt
    • Actions
      • Set VariableSet dmg = ((Max life of (Target unit of ability being cast)) - (Life of (Target unit of ability being cast)))
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing dmg damage of attack type Hero and damage type Normal
I set Storm Bolt's damage to 0 just to test it out and it worked fine.
 
Status
Not open for further replies.
Top