• 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] Calculating percentage of Damage Dealt

Status
Not open for further replies.
Level 12
Joined
May 7, 2008
Messages
346
Greetings.

I'm trying to color damage which I'm using from Bribe's System in his variable called DamageEventAmount.

The damage would be stored in my own variable called Stored_Damage which then I could reference when needed.


Example:

20% of Damage Dealt out of 100% (Stored_Damage) - Green Text
50% of Damage Dealt out of 100% (Stored_Damage) - Orange Text
100% of Damage Dealt out of 100% (Stored_Damage) - Red Text

In conclusion, how can I count a percentage of DamageEventAmount, which is a Real type value?


Solution found, and it's this:

FP_Damage_Stored = Stored Damage
FP_Damage_Limit = an array that has precise values, such as 100, 150, 200, 250, 300, etc

  • FP_Damage_Stored Less than or equal to (FP_Damage_Limit[FP_Level] x 0.25)
 
Last edited:
Level 12
Joined
May 7, 2008
Messages
346
I am not sure what you want to do. Count what as a percentage of DamageEventAmount? A percentage is just (some number / total ) * 100.0. Percentages are usually reals.

Yeah It took me a while to brainstorm that.

I was planning to calculate how much 25% is of my Stored Real Damage that I've set in my variable.
I've found the solution thought, it was the trigger down below:

  • FP_Damage_Stored Greater than or equal to (FP_Damage_Limit[FP_Level] x 0.25)
Status: Solved!
 
Last edited:
Status
Not open for further replies.
Top