Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For Evoker: Track the current empower level of the spell #2021

Open
Betaskill opened this issue Nov 24, 2022 · 10 comments
Open

For Evoker: Track the current empower level of the spell #2021

Betaskill opened this issue Nov 24, 2022 · 10 comments

Comments

@Betaskill
Copy link

Betaskill commented Nov 24, 2022

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 Betaskill changed the title For Evoker: See the current empower level of the spell For Evoker: Track the current empower level of the spell Nov 24, 2022
@ascott18
Copy link
Owner

Added in b30b8cb

@ascott18 ascott18 reopened this Nov 26, 2022
@ascott18
Copy link
Owner

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
Copy link
Owner

ascott18 commented Nov 26, 2022

Logged Stanzilla/WoWUIBugs#355

@arieh
Copy link
Contributor

arieh commented Nov 27, 2022

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

@EKE00372
Copy link

EKE00372 commented Dec 6, 2022

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

@ascott18
Copy link
Owner

Still broken in 10.0.5

@ascott18 ascott18 pinned this issue Jul 29, 2023
@ascott18
Copy link
Owner

Still broken in 10.1.5

@Jack-Pettersson
Copy link

Still broken in 10.2

@Somebodyy
Copy link

Has this been resolved yet?

@xeropresence
Copy link

Still broken in 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants