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

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 64
Joined
Aug 10, 2018
Messages
6,582
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