Player entering world event
If i register player_entering_world event and upon it i want to print this:
I will get nil.
Same goes for addon_loaded event ... at least 1st time (since addon_loaded fires more than once ?! :))
Is there any event that will at 1st login fire after everything is loaded?
You might try to use the spellid instead of the name.
"Using spellName or spellLink only returns the info if the spell is in your spellbook; otherwise it returns nil."
So perhaps your spellbook is not yet available (event SPELLS_CHANGED should tell you when its loaded).
I've found there's two sources of delay, especially in Classic: (a) asynchronously querying the localized spell name; and (b) waiting for the spell book to be available at PLAYER_LOGIN.
I quickly wrote the snippet below to convert spellIDs into localized names, but not to check the spell book until at least PLAYER_LOGIN and possibly later if asynchronous queries return info even later. This snippet also deletes non-existing spellIDs, which could happen for classic vs. retail differences.
If you are creating click-cast frames for use during combat, then you should change this to do as much as possible at PLAYER_LOGIN even if some spells are still slow loading -- its possible the player is logging in during a raid fight after the game crashed, and they will need to rejoin the fight on a best-effort basis before combat lockdown kicks in.
@Rilgamon spells_changed event also first time return nil...
@DahkCeles nice little piece of code... thank you for it... i will make use of it... im not doing anything fancy... all my code is for my own personal use.. i just want to display for my farming mage how many blizzards can i do with current mana and with regard of mana regen some prediction of how many ticks needed for next +1
In that case, you might be able to get away with just using spellID 190356. I'm not sure if this corresponds to any particular ranks or classic vs retail... this is just grabbing it off wowpedia really fast.
The script below loads the spell data, and once the data is available it then creates a font string and scripts it to update any time your mana changes.
Edit: disclaimer, I'm not a frost mage and I haven't tested this code.
Yup.. i did something similar... thank you.
Problem with spellid is that if you are not 60 and want the calc to scale with max rank of spell.
Anyhow.. i fixed my problem... it works fine... thank all for assistance. Cheers
|All times are GMT -6. The time now is 03:27 AM.|
vBulletin © 2021, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI