You are not logged in.

Applications: [GameMaster: OPEN] | [Volunteer Testers: OPEN]


This forum will be permanently shut down on Friday 13.07.2018
Please copy or save all important information from old forum before they will be deactivated
We have moved to new board. https://forum.runesofmagic.gameforge.com/Come join us.

1

Tuesday, November 27th 2012, 11:16pm

Problem with UnitMaxHealth

When I call UnitMaxHealth("target") it is returning a value ranging from 0-100, not the max HP value as I expected. The method returns the expected values for a UnitId of "player".

Is this a known bug? Is there a way to get the max HP of a target?

thanx

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

2

Wednesday, December 5th 2012, 6:33am

I know this is a little late, but thought I'd clarify for others.

The reason you get a value from 0 to 100 is that for targets the game doesn't give you the actual health/mana values but instead returns a percentage.

Therefore the return value given is by design.
2013... The year from hell....

3

Wednesday, December 5th 2012, 1:51pm

Quoted from "Peryl;579786"

I know this is a little late, but thought I'd clarify for others.

The reason you get a value from 0 to 100 is that for targets the game doesn't give you the actual health/mana values but instead returns a percentage.

Therefore the return value given is by design.


Thanx for the response/clarification.

Is there another function that can return the max HP for a target?

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

4

Wednesday, December 5th 2012, 3:05pm

None that I know of.

What most unit frame add-ons (such as qUnitFrames, Ikarus, etc) do each time you damage/heal a mob, it calculates an estimate based on the amount damaged/healed and the change in percentage. Averaged over time this can give you a fairly accurate value. It typically also saves these values in some internal database so that the next time you meet this mob, it can use the previous calculated value.

Of course, the above assumes certain conditions and may not be appropriate for any one add-on. It is fine for unit frames type add-ons, but wouldn't work for something that just gets triggered from time to time.
2013... The year from hell....