HeroRotation

HeroRotation

5M Downloads

Elemental Shaman Totem Times return 9999

Darkmoded opened this issue ยท 4 comments

commented

Player:BuffRemainsP(S.ResonanceTotemBuff) will always return 9999
the ResonanceTotemBuff does not have a time its true or false

You need: something like this to get the totem time.

local function updateTotemTime()
	local TTime ,T1,T2,T3, = 0,0,0,0
	for index=1,4 do
	  local arg1, totemName, startTime, duration = GetTotemInfo(index)
	  local est_dur = math.floor(startTime+duration-GetTime() + .5)
		  if est_dur > 0.1 then 
			if index == 1 then 
				T1 = est_dur
				TTime = est_dur	
			elseif index == 2 and est_dur > T1  then 
				T2 = est_dur
				TTime = est_dur	
			elseif index == 3 and (est_dur > T2 and est_dur > T1) then 
				T3 = est_dur
				TTime = est_dur				
			elseif index == 4 and (est_dur > T3 and est_dur > T2 and est_dur > T1)  then 
				TTime = est_dur	
			end 
		  end 
	end
	return TTime
end 



local TotemTime = updateTotemTime()

-- NOTE: S.TotemMastery:IsCastableP()  will return False when totem time is > 0 " Use IsReady "

if S.TotemMastery:IsReady() and (S.TotemMastery:IsAvailable() and (not Player:BuffP(S.ResonanceTotemBuff) or  TotemTime < 6)) then
  if HR.Cast(S.TotemMastery) then return "totem_mastery 585"; end
end
commented

I shortened this up to:

local function ResonanceTotemTime()
  for index=1,4 do
    local _, totemName, startTime, duration = GetTotemInfo(index)
    if totemName == "Totem Mastery" then
      return (floor(startTime + duration - GetTime() + 0.5)) or 0
    end
  end
  return 0
end

and then just called ResonanceTotemTime() in the time checks.

Merged in commit 896b5b8

commented

Hi,

I know this bug is closed, but is it possible to localize the totem name "Totem Mastery" somehow? Non-english version will not work anymore :/

Thank you!

commented

I changed the function in both Elemental and Enhancement to refer to S.TotemMastery:Name(), which should be the localized name of Totem Mastery. Please let me know if this works for you!

Change is in commit 83fe7f4

commented

The issue is fixed!
Thank you very much for the fast support!