Addon help
So here's a tiny module i recently added in my UI. Basically what it does amongst other things is, whenever i target one of those new rares in Tanaan jungle, it lists a custom group and when the rare is dead, it disbands the raid.
It's working just fine exept that, every time it disbands the raid, it also throws an error and i don't understand why. I even added a 5 seconds delay thinking it was doing it too fast after PLAYER_REGEN_ENABLED but that didn't help. Anyway, here's the code and the error below it: Code:
caelUI.rares:SetScript("OnEvent", function(self, event, addon, arg) Code:
ID: 1 |
This function is protected, and may only be called in response to hardware event.
|
Quote:
Also, while i'm at it, how could i improve the whole PLAYER_REGEN_ENABLED part, i'm playing mainly a hunter and if i feign death, i go out of combat so it triggers that part of the code when it shouldn't have. |
Quote:
Lua Code:
Confirm that you're not feigning death or keep checking until you no longer are (C_Timer.NewTicker) before proceeding with your delayed function. |
One more question, is it possible to check from within an addon if i have already looted the rare ? I was thinking to use that as a trigger to disband/leave group.
|
Looting a rare should be marked by Blizzard completing a specific quest for each rare. This type of quest is just a marker quest and does not show up in a quest list. However, when using Blizzard APIs to determine if a quest is complete it will work with these marker quests. Therefore, you would want for each rare to know the associated Blizzard marker quest and use the API with that value to see whether the person has looted that rare.
|
Yeah no, that's not what i meant, you're referring to IsQuestFlaggedCompleted, but that's not what i'm trying to know here.
I'm not trying to know if i have already looted "that" rare sometimes today. I'm trying to know if i looted the mob i was in combat with a few seconds ago so i can leave the group. |
Lua Code:
|
You didn't see my last post i guess :)
|
I'm confused. If there is a new quest completion after combat ends then you have your answer…
|
I'm not looking for a quest completion, i'm trying to know if i looted something after killing it.
Let's just say something that would work with any mob, not just rares. Edit: Besides, if i'm not mistaken, IsQuestFlaggedCompleted would tell me i killed it, not that i looted it :) |
Aren't you going to want to wait with disbanding until everyone else has looted?
|
Quote:
Code:
local champions = {"Deathtalon", "Doomroller", "Terrorfist", "Vengeance"} |
Quote:
|
But i'm not interested in any specific loot, i just want to know if i looted it, not what was inside :)
So basically, you're saying something like this would suffice ? (untested, drycoded) Code:
local champions = {"Deathtalon", 95053, "Doomroller", 95056, "Terrorfist", 95044, "Vengeance", 95054} |
In my addon Grail, I look for LOOT_CLOSED events in specific zones to handle looting chests (and it happens to work with looting monsters too). Grail then checks the quests that are completed to note which ones have just been done to know what is happening. This is how it can show you a list of all the treasures that you have not completed yet, for example. The same for rare monsters, etc. Therefore, you can definitely make use of this, but I am not sure I would do what you are doing here. Actually, if I were using Grail, I would do something like what is done in the Grail-When loadable addon, where I just register with Grail as an observer when a quest is complete, and if that quest is on one of the list of rares in which one has interest, do whatever you want (like leave the group). Grail would only tell you that you have completed the quests after you had done LOOT_CLOSED after killing a rare. Note that you might not actually loot the monster, or lack bag space, etc. so your check might want to be more extensive that what Grail does.
|
Quote:
Something like this, or instead of using "tonumber" just convert the npc IDs in your table to strings. Lua Code:
|
Quote:
Quote:
|
All times are GMT -6. The time now is 07:17 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI