DamageByPercent

0zaru

Learning vJASS ;)
Reaction score
60
Is there anyway to damage a unit By a Percentaje of its main hit points ?

Example:
Code:
Unit comes withing 200 range of <Point>
Conditions
bla bla bla
Actions
DamageUnit by a 1% of it hitpoints //this is what i am missing =(

Any ideas ? (Without adding an ability) if not well i will know what to do (Use abilitys :( )

Jass ideas are good too..
 

NapaHero

Back from the dead...
Reaction score
43
Unit - Set life of (Unit) to ((Life of (Unit)) - ((Max life of (Unit)) / 100.00))

That's what you need?
 

0zaru

Learning vJASS ;)
Reaction score
60
That's the problem i want to damage dealing a 1% of the unit's life. I don't want a base amount

P.S Actually my trigger is in jass that's why i want the answer in GUI or JASS.
 

MoonSlinger

I Love using Cheap Tricks... only Results matters
Reaction score
74
I am not sure about using set life.... if the unit dies, its similar to action: unit - kill. So if you are counting kills, do note about that.

Anyway, I would suggest using a variable:
Code:
Set DamageToUnit = (((Max life of UnitY) / 100.00) x M)
Unit - Cause UnitX to damage UnitY, dealing DamageToUnit damage of attack type Spells and damage type Normal

M is a multiplier, so if you ability has a level, it will substitute M for accordingly :D
 

0zaru

Learning vJASS ;)
Reaction score
60
Great i think that that will work :D (I will test it and then edit :p)

EDIT: Works fine, +rep
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top