View Single Post
03-24-15, 06:17 AM   #2
Quingar
A Deviate Faerie Dragon
Join Date: Apr 2011
Posts: 13
Hmm I was looking to the code which is there by default for Wild Mushrooms to see that overhaling done from Rejuv.
But I want to ask why is there 300 in those lines. I think there should be 30 not 300 right ?
Really would love to use realUI auras for this tracking of duration of Wild Mushrooms. Or else I will be forced to use weak auras

Code:
local nibRealUI = LibStub("AceAddon-3.0"):GetAddon("nibRealUI")

local _
local MODNAME = "AuraTracking_WildMushrooms"
local WildMushrooms = nibRealUI:NewModule(MODNAME, "AceEvent-3.0")

local AuraTracking = nibRealUI:GetModule("AuraTracking")

-- local ShroomID = 88747	-- Wild Mushrooms
local ShroomDuration = 300
local ShroomID = 145205	-- Wild Mushrooms
local ShroomName = ""
local BloomID = 102791	-- Wild Mushrooms: Bloom
local RejuvID = 774		-- Rejuvenation
local MaxHealthPercent = 2
local OverHealPercent = 1
local MinLevel = 84

local function GetMushroomTime()
	local time = 0
	local currentTime = GetTotemTimeLeft(1)
	if ( currentTime > 0 ) then
		time = currentTime
	else
		time = nil
	end
	return time
end

local function AuraUpdate(self)
	if self.inactive then return end

	-- Update Info
	if not(ShroomName) or not(self.texture) then
		local name,_,icon = GetSpellInfo(ShroomID)
		ShroomName = name
		self.activeSpellName = name
		self.texture = icon
		self.icon:SetTexture(icon)
	end

	-- Update Frame
	local shroomTime = GetMushroomTime()
	if shroomTime and self.AreShroomsDown then
		self.isActive = true
		
		-- Set Icon Desaturated
		self.icon:SetDesaturated(nil)

		-- Cooldown
		-- self.cd:SetCooldown(GetTime() - (300 - shroomTime), 300)
		-- self.cd:Show()
		-- self.count:SetParent(self.cd)

		-- Absorb
		if self.CurrentOverheal and (self.CurrentOverheal > 0) then
			if self.MaxOverheal > 0 then
				local per = self.CurrentOverheal / self.MaxOverheal
				-- local per = nibRealUI:Clamp(self.CurrentOverheal / self.MaxOverheal, 0, 1)
				self.count:SetFormattedText("%d.", per * 100)
				self.count:SetTextColor(nibRealUI:GetDurabilityColor(per))
			else
				self.count:SetText("100.")
				self.count:SetTextColor(nibRealUI:GetDurabilityColor(1))
			end
		else
			self.count:SetText("")
		end

		-- Show frame
		self:Show()
		if not self.isStatic then
			AuraTracking:FreeIndicatorUpdate(self, true)
		end
	else
		self.isActive = false
		if self.isStatic then
			self.icon:SetDesaturated(1)
		end

		-- self.cd:Hide()
		-- self.count:SetParent(self)
		self.count:SetText("")

		-- Hide frame
		if not self.isStatic then
			self:Hide()
			AuraTracking:FreeIndicatorUpdate(self, false)
		end
	end

	if self.isStatic then
		AuraTracking:StaticIndicatorUpdate(self)
	end
end
  Reply With Quote