• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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