Skada Damage Meter (Revisited)

Skada Damage Meter (Revisited)

71.5k Downloads

Rogue "secret technique" talent support

Zivres opened this issue · 6 comments

commented

When rogue uses the talent, his shadow clone is summoned and deals damage to the target.
This copy should be counted as a rogue pet, but it is counted as a separate actor named 'Akaari's soul'. This problem is reproducing only with other rogues, not when addon owner uses secret techique yourself.

My fix (it is kinda hardcoded, so I'm creating an issue instead of pull request):
There is GetPetOwnerFromTooltip function in Functions.lua that attempts to fix such issues, but rogue shadow clone has unusual tooltip. It inherits character tooltip, which means the 2nd line of tooltip is not like <character>'s minion but is like level 43 goblin rogue (while 1st line of the tooltip is charater name with title).
So I came up with scanning the first line of pet tooltip if no owner is found by other methods:
In GetPetOwnerFromTooltip after 2nd line analysis I've added the first line analysis:

	local text1 = _G["SkadaPetTooltipTextLeft1"] and _G["SkadaPetTooltipTextLeft1"]:GetText()
	if text1 and text1 ~= "" then
		for actorname, actor in pairs(actors) do
			local name = not actor.enemy and gsub(actorname, "%-.*", "")
			if name and find(text1, name) then
				return actor.id, actorname
			end
		end
	end

Note that not ValidatePetOwner(text1, name) but find(text1, name) is used! First line of the tooltip is the character name with title and does not include owner pattern.

commented

Hello @Zivres .. I hope you're doing good.
Can you please reach to me on Discord to send you the addon to test before updating please? If you can of course.
Can you please download and test the addon please? For Classic & DF if you can of course.
The update should fix (hopefully) the following issues: #5 , #7 and this one (for both Classic and DF)

commented

#5 is fixed. I reproduced this bug with old version and it is not reproducing with new version. Have tested on retail only.
Note: if skada window was hidden by /skada toggle with this bug (at previous version of the addon), it is still bugged after the addon update, and have to be explicitly showed with another /skada toggle. After that everything worked as intended.
Note: when you enter the combat with window showed by /skada toggle and then leave it, window does hide again. I think it is an expected behaviour, so this is just a note,

#7 is fixed. Tested with tank and dps specializations. Damage to summoned demons is ignored.

This issue will be tested later, I need the other rogue to go online to test it.

commented

@bkader
This issue is not fixed. Akaari's soul is still counted as a separate actor when secret technique is used by the other rogue (not an addon owner).
I see you have attempted to use the tooltip API. So I've dumped the tooltip retrieved inside GetPetOwnerFromTooltip with

for k,v in pairs(line) do
	print(k.." "..tostring(v))
end

and got (my comments are added to translate from Russian):

leftColor table: 000001D617508F60
type 2
leftText Гоб, Сокрушающий пламя //character name with title
unitToken player
leftColor table: 000001D617509000
type 0
leftText Гоблин 43-го уровня (игрок) //Level 43 goblin (player)
leftColor table: 000001D6175090A0
type 0
leftText Скрытность Разбойник //subtlety rogue
leftColor table: 000001D617509140
type 0
leftText Орда //Horde

The tooltip is inherited from a character, so it has no info about unit owner.

Also I have noticed that data.guid also points to a player. Maybe you can use it?
Something like that (don't know how it can affect other pets but it fixed Akaari's soul):

if guidToName[data.guid] ~= nil then
	return data.guid, guidToName[data.guid]
end

I have no hunter or warlock to test such fix did not broke common pets, but I've tested it with a shaman elemental and everything was OK.

commented

@Zivres thanks a lot for testing and the feedback.

In most scenarios data.guid seems to be poiting to the pet itself except when it comes to Akaari's Soul, so that might be helpful, and since I don't really have access to the game for in-depth testing, I just saw how it's handled elsewhere and adapted it 😉

Here is the updated Functions.lua file that you can place inside Skada\Core folder and replace the original one. Give it a test again and let me know if the issue is somehow fixed (**fingers crossed**).

Note:
For the /skada toggle behavior, when windows are meant to be shown only in combat, it's a normal and expected behavior to see them hide after combat end even when they are manually shown using the command.

commented

@bkader
This works. I have tested with myself and other rogue.
Big thanks for work!

commented

@Zivres Big thanks to you for the reports and tests!
I will wrap things up, do final checks a.s.a.p and push everything.