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

How to make [Death Pact] to heal you for 33% of your max health?

Status
Not open for further replies.
Level 39
Joined
Feb 27, 2007
Messages
5,031
Do you always want it to restore 33% or should it restore up to 33% based on the life of the unit you sacrifice? I would make Death Pact not restore any life in the OE and then add this trigger:
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to Death Pact
  • Actions
    • Unit - Set life of (Triggering Unit) to ((Life of triggering Unit) + (0.33 x (Max life of (Triggering Unit))))
    • -------- or to base it on sac'd unit life: --------
    • Set LifeMax = (0.33 x (Max life of (Triggering Unit)))
    • Set LifeMax = Maximum(LifeMax, (Life of (Target Unit of Ability Being Cast)))
    • Unit - Set life of (Triggering Unit) to ((Life of triggering Unit) + LifeMax)
 
Level 39
Joined
Feb 27, 2007
Messages
5,031
In my limited testing with this just now it appears that the “percentage” flag in death pact actually does the exact opposite. Most Wc3 spells expect percentages in those type of fields so 0.33 = 33%, it’s just how % works.
 
Status
Not open for further replies.
Top