TellMeWhen icon indicating copy to clipboard operation
TellMeWhen copied to clipboard

For Evoker: Track the current empower level of the spell

Open Betaskill opened this issue 2 years ago • 9 comments

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like

First of all thanks for the great addon and the time that is used for making it happen.

I would like to have a condition (or icon) where you can track the current empower level of the spell that is casting, with: make the icon visible if you are, like, at level 2 of the spell. So with the new class Evoker, like for example, the ppl are able to see it via a dogtag like "stacks" at which level their spell is at the moment or whatever they wanna use that information for.

Describe alternatives you've considered No that I can think of.

Is something like this possible?

Greetings

Betaskill avatar Nov 24 '22 21:11 Betaskill

Added in b30b8cb

ascott18 avatar Nov 25 '22 21:11 ascott18

Blizzard... please...

Turns out UnitChannelInfo() returns nil when in the final stage of an empowered cast. I.. just... what...? So @arieh my clean solution doesn't work...

ascott18 avatar Nov 26 '22 08:11 ascott18

Logged https://github.com/Stanzilla/WoWUIBugs/issues/355

ascott18 avatar Nov 26 '22 08:11 ascott18

They really made such a bad implementation our of this new feature it's crazy.

arieh avatar Nov 27 '22 05:11 arieh

temp slove

local TMW = TMW
local CNDT = TMW.CNDT
local Env = CNDT.Env
local L = TMW.L

local DogTag = LibStub("LibDogTag-3.0")
local cache = {}
local GetEmpowerStageForCurrent = function()
	local unit = "player"
	local name, _, _, start, _, _, _, _, _, numStages = UnitChannelInfo(unit);
	if not numStages or numStages == 0 then
		if cache[unit] then
			if numStages == 0 then return 0 end
			needClear = false
			for i = #cache[unit], 1,-1 do
				
				if TMW.time > cache[unit][i] then
					
					if i < #cache[unit] then
						return #cache[unit] - 1
					else
						needClear = true
						break  
					end
				end
			end
			if needClear then cache[unit] = nil end
		end
		return 0
	end
	
	if not cache[unit]  then
		cache[unit] = {}
		local stageEnd = start
		for i = 1, numStages,1 do
			local duration = GetUnitEmpowerStageDuration(unit, i-1)
			stageEnd = stageEnd + duration
			cache[unit][i] = stageEnd/1000
		end
		cache[unit][numStages+1] = (stageEnd + GetUnitEmpowerHoldAtMaxTime(unit))/1000
	end
	for i = #cache[unit], 1,-1 do
		if TMW.time > cache[unit][i] then
			return i
		end
		
	end
	return 0
	
end


if DogTag.Tags.Unit.EmpowerStage then return end
DogTag:AddTag("Unit","EmpowerStage",{
		code = GetEmpowerStageForCurrent,
		arg = {
			'icon','string','@req',	
		},
		ret = "number",
		events =  "Update;UNIT_SPELLCAST_EMPOWER_START#player;UNIT_SPELLCAST_EMPOWER_UPDATE#player;UNIT_SPELLCAST_EMPOWER_STOP#player",
		noDoc = true,
		
})

EKE00372 avatar Dec 06 '22 07:12 EKE00372

Still broken in 10.0.5

ascott18 avatar Jan 27 '23 05:01 ascott18

Still broken in 10.1.5

ascott18 avatar Jul 29 '23 05:07 ascott18

Still broken in 10.2

Jack-Pettersson avatar Dec 08 '23 10:12 Jack-Pettersson

Has this been resolved yet?

Somebodyy avatar Apr 28 '24 14:04 Somebodyy