UnitOwner (GUID), identifying guardians and pets.
At the moment if the client doesn't see the guardian being summoned (like mage's mirror image for instance), there is no way to know who is its owner.
In the other hand, if we hover over the guardian, the tooltip immediately tells who owns it, so the client holds this information and could be easily queried by UnitOwner (GuardianOrPetGUID). Its a simple thing, but, solves tons of issues. |
In the meantime, you can try something like this if you encounter a guardian without witnessing its creation.
Lua Code:
This example will probably only work on english clients, however there are a number of entries in GlobalStrings.lua that could potentially be matched against the line in the tooltip. Lua Code:
|
Thanks, seems to work here and did a workaround for the workaround, rofl:
Iterating between raid members doing: GuardianOwnerTooltipTextLeft2:GetText():find (UnitName ("raid" .. i)) Its ugly, cpu heavily but fix the language at least while in raid. |
You only need to call it if you didn't actually witness the summoning event so it shouldn't be that bad, but it is relatively costly to do that kind of pattern matching.
Looping over the raid names could produce false positives if a member's name is part of another member's name (or their name was "Minion" or something). You might want to only fall back on that if the first attempt fails. If matching the apostrophe fails, then it would be faster to split the tooltip line on spaces and attempt to call UnitGUID on each result than looping over the entire raid looking for names. Assuming the name is separated from the rest of the string by whitespace then it would be as effective as running find(UnitName('raid'..i)) but quite a bit faster. |
That's right, didn't thought about that, thanks again.
Gosh, i hope this UnitOwner get implemented on day, too much workarounds to get a simple information :mad: |
Hi, 6,5 years later, do you know if this functionality is implemented nowadays? Thank you!
|
When you find a better way let me know ;) I try to have my own damagemeter and tracking the owner is difficult ... I use this monster ... (stolen from different sources)
Lua Code:
|
All times are GMT -6. The time now is 12:33 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI