TellMeWhen

TellMeWhen

24M Downloads

For Evoker: Track the current empower level of the spell

Betaskill opened this issue ยท 10 comments

commented

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

commented

Has this been resolved yet?

commented
commented

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...

commented

Added in b30b8cb

commented

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

commented

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,
		
})
commented

Still broken in 10.0.5

commented

Still broken in 10.1.5

commented

Still broken in 10.2