EsreverWoW / ClassicThreatMeter

A simple threat meter for WoW Classic (1.13.2)
37 stars 7 forks source link

[BUG] Threat Reduction doesn't seem to work #21

Closed mjoed closed 5 years ago

mjoed commented 5 years ago

What steps will reproduce the problem?

  1. get hit by (for example) Knock Away from Onyxia
  2. Threat won't be reduced

What version of ClassicThreatMeter are you using? (Stating 'latest' is not useful)

1.08

Do you have an error log of what happened?

I could provide videos if necessary.

Any additional information? (example: WoW language if not English) (Attach screenshots here if available, do not link externally)

Some things i could test/look into:

I have done some testing in the open to see if threat reduction in general works or if it is an ony specific issue and tried adding a SpellID i've looked up through the CombatLog (for example the Fireball from Legashi Hellcaller) into the threatHalveSpellIDs table (ThreatNPCModuleCore.lua #153) and the npcSpells table (ThreatClassic-1.0.lua #407 - probably unnecessary, but just to be safe) and tried it out with a friend of mine. it didn't do anything at all, so i think it may be a general problem.

also, while i think it is a general problem, when it comes to ony the spell id "10101" for Knock Away which is used in ThreatNPCModuleCore.lua (#206, #170) and ThreatClassic-1.0.lua (#410) doesn't seem to be the right one (at least not if CombatLog is correct). It definitely is (apparently initially assumed in the code) 19633 - see https://classic.warcraftlogs.com/reports/RMYCJT7LGycxV3j8#fight=last&type=damage-taken&ability=19633 for example, i can provide an actual combatlog where the ID is written by wow itself if necessary, but warcraftlogs just takes that value anyway. I don't know if Spell IDs from Combatlog Events ingame are different to the .txt that gets created by WoW, but that would be pretty strange.

also, i think the ony workaround in ThreatNPCModuleCore.lua #206 gets overwritten anyway in #209 if i understand lua correctly

cannonpalms commented 5 years ago

See https://github.com/EsreverWoW/LibThreatClassic/issues/7. This issue affects all knockbacks, not just onyxia.

EsreverWoW commented 5 years ago

This should now be solved.

mjoed commented 5 years ago

pretty sure it still doesn't work if i understand the code correctly/if it works with spell id's, spell id 10101 does not occur at all in the onyxia encounter, it is 19633 for knock away on onyxia, see attached combatlog for example. WoWCombatLog-archive-2019-09-26T20-40-32.605Z.txt

also, after some calculating over 3 ony logs/videos and some testing, we're decently certain that fireball (spell id 18392) is a 0.25 threat multiplier, i've modified the code to try it with those values it seems pretty accurate. the only thing i'm still trying to figure out is if a full absorb of a fireball will cause a threat change or not.

EsreverWoW commented 5 years ago

Classic does not return spellIDs in the payload for CLEU in-game, so it always returns spellID as 0. Because of this, I have to make a lookup by localized spellName to an arbitrary number. Since thre are multiple "Knock Away" spells, each with their own ID, I simply just used any ID that would return "Knock Away" as the name for the reverse lookup and then made a special handler on how to modify threat (threat 0.5 or threat 0.75) depending on the NPC it is being cast by.

https://github.com/EsreverWoW/LibThreatClassic/blob/master/ThreatNPCModuleCore.lua#L209 https://github.com/EsreverWoW/LibThreatClassic/blob/master/ThreatNPCModuleCore.lua#L138-L145 https://github.com/EsreverWoW/LibThreatClassic/blob/master/ThreatClassic-1.0.lua#L407-L430

It doesn't matter that the ID is "wrong". If I changed it, it would be "wrong" for other NPCs. Classic works differently, so you need a roundabout method.

EsreverWoW commented 5 years ago

Fireball seems to only affect the primary target of the cast as far as I can tell, and not any splash damage to nearby players that may have been hit as well (which will cause their own SPELL_CAST_DAMAGE events).

I've begun working on a solution that checks her target at the time of any SPELL_CAST_START event where Fireball is the cast and then storing that into a variable to reference for when modifying the threat on cast competition.

mjoed commented 5 years ago

ah, thanks very much for the explanation!