obble / modui

1.12 ui mods
53 stars 23 forks source link

Polymorph showing on all mob nameplates #25

Open VukisWasTaken opened 8 years ago

VukisWasTaken commented 8 years ago

whenever I Polymorph a mob it shows on all the enemies around me, also if I use a lower rank it shows the duration of the full rank.

obble commented 8 years ago

this is unfortunately a side-effect of working with vanilla code, and not too much can be done about it.

the first issue arises because the only way to match spells to units is by their name — and when there is more than one of the same mob with the same name with a nameplate on the screen there is no way in vanilla to compare them to see which the spell has been cast on. therefore all mobs show the effect.

the second issue is again because vanilla lacks the functionality to gauge any kind of spell data for what has been cast on the mob. I can only tell that a spell has been cast on the mob by finding the spell name and the unit name in the combat log entry, and adding a timer based on the duration which is found in a list i've manually created for spells — in these cases I have erred on inserting timers for max-rank spells because they get the most use.

what could be explored is the possibility of matching spells cast by you to the tooltip of the spell on the action button, finding the rank of the spell within that, and caching and matching it to a larger list of spell durations for each spell rank. this is only theoretical, problematic, and if it worked would also add additional heavy lifting to a function that is already fairly large.

that said, i'll leave this issue open to explore whether this is feasible in the long-term.

obble commented 8 years ago

other possible alternative; disabling aura tracking for non-player mobs. this would have to be weighed up against the cost of information and fallout from users who want to have access to this data despite its current untidy format.