WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Arcane Charges (https://www.wowinterface.com/forums/showthread.php?t=56965)

doofus 01-10-19 05:27 AM

Arcane Charges
 
I have been using
local arcaneCharges = UnitPower("player", 16);

to determine the number of Arcane Charges (0 .. 4) and I have observed that in plenty of cases I get one less charges than are actually available. It seems there is a delay between the Arcane Blast "landing" and the API registering the charge. The GUI however works properly and properly shows the charges.

Is there an other way to know the proper number of charges ?

To explain, it is hard to count the Arcane Charges manually since it registers when a spell is cast successfully or when it hits something (Arcane Explosion), or in case it misses, can spells miss? On the combat log it would appear that the count increases before the hit is registered but in the same block.

I could perhaps implement own count by reading the event UNIT_SPELLCAST_SUCCEEDED but it is hard work, when there is a perfectly good API available.

Any suggestions please?

jlam 01-10-19 09:18 AM

Quote:

Originally Posted by doofus (Post 331340)
I have been using
local arcaneCharges = UnitPower("player", 16);

to determine the number of Arcane Charges (0 .. 4) and I have observed that in plenty of cases I get one less charges than are actually available. It seems there is a delay between the Arcane Blast "landing" and the API registering the charge. The GUI however works properly and properly shows the charges.

The GUI just listens for UNIT_POWER_FREQUEST and calls UnitPower() from the handler (Interface/Addons/Blizzard_Nameplates), so it doesn't seem to be doing anything differently from what you are trying to do.

doofus 01-10-19 10:42 AM

Thank you very much for the prompt reply.


All times are GMT -6. The time now is 06:41 PM.

vBulletin © 2021, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI