• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Max Hp Spell

Status
Not open for further replies.
Level 3
Joined
Aug 28, 2005
Messages
48
Ive been messin round with it, just cant find it i guess... But how would you make a spell that when it hits, it does damage equal to a percent of targets max hp?
 
Code:
Some Spell
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to "some spell"
    Actions
        Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing ((Max life of (Target unit of ability being cast)) x 0.20) damage of attack type Spells and damage type Normal
Just do the math. 0.20 x Max life is 1/5 of max life, 0.50 is 1/2, 0.10 is 1/10 etc.
 
Status
Not open for further replies.
Back
Top