• 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.

[Solved] Need damage formula for part of custom spell

Status
Not open for further replies.
Level 11
Joined
Sep 14, 2009
Messages
284
Not really sure what to name the thread, anyways.

I'm making a custom spell which deals calculated damage (triggered). That part is easy.

Now the hard part. All units in this map has 100 mana. I want the spells effect to use the current mana of the casting unit as percentage as to how much damage the spell will deal.

For example, if the unit has 50 mana, the spell will deal 50% damage etc etc...
So my question is what can I use as formula for this spell?

The original formula is something like this:
Cause Unit to deal (X+(1.5*Intelligence of Hero)).
I want it to be like this:
Cause Unit to deal (X+(1.5*Intelligence of Hero)) x (Current mana of Unit as percentage)
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
You can use the Real value "Unit - Percentage of mana". It works with the current mana of the unit as as percentage
 
Because your mana is always in 0,100 interval I suggest.
Use real variables
and formula: Damage = X * ((Mana of (Triggering unit)) * 0.01)

where X can be anything, ability level * number, or hero int, hero str, any real number etc etc.

JASS:
//        --------Spell Damage--------     ---This will go from 0.00 to 1.00---
 Damage = (X+(1.5*Intelligence of Hero)) * ((Mana of (Triggering unit)) * 0.01)
 
Status
Not open for further replies.
Top