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

K, i suck at math so here is the QUESTION :|

Status
Not open for further replies.
Level 18
Joined
Oct 18, 2007
Messages
930
:ash:Ok im making a heal spell so i realy need this :p.

Ok we have 3 values

V1 = The Casters MAX HP Value
v2 = The Targets MAX HP Value
v3 = The current HP Value of the Target

So how do i solve this that i always get a value that comes up in v2 and v3??

Like you heal 3000
your targets MAX health is 800
and its current health is 100

The result will be 700, but how do i solve this??? :p any ideas??

:cexc:AND YES I SUCK AT MATH :):cexc:
 
:ash:Ok im making a heal spell so i realy need this :p.

Ok we have 3 values

V1 = The Casters MAX HP Value
v2 = The Targets MAX HP Value
v3 = The current HP Value of the Target

So how do i solve this that i always get a value that comes up in v2 and v3??

Like you heal 3000
your targets MAX health is 800
and its current health is 100

The result will be 700, but how do i solve this??? :p any ideas??

:cexc:AND YES I SUCK AT MATH :):cexc:

~:bored: Anyone??

Do not double-post! Especially within 15 minutes of eachother. You can't expect replies immediately.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Not really :D
Use the Math's function Min(or whatever):
The minimal of (The amount you can heal, Target's Max health - target's current health)
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
@GhostWolf
HappyTauren did not answer the question...
@Element of Water
That is exactly what I proposed would do, but you have a small mistake: the "<" should be ">"
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
v1 = heal (what you had here made no sense)
v2 = The Targets MAX HP Value
v3 = The current HP Value of the Target

So how do i solve this that i always get a value that comes up in v2 and v3??

Like you heal 3000
your targets MAX health is 800
and its current health is 100

The result will be 700, but how do i solve this??? :p any ideas??

MIN(v1,v2-v3)
 
Status
Not open for further replies.
Top