27 lines
		
	
	
		
			573 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			573 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
| --ANIMATION
 | |
| function()
 | |
| 	if GetSpellCooldown("Memory of Lucid Dreams") then
 | |
| 		local start, dur = GetSpellCooldown("Memory of Lucid Dreams")
 | |
| 		local remcd = start + dur - GetTime()
 | |
| 		if remcd > 0 then
 | |
| 			remcd = 1 - aura_env.range(remcd, 0, 120, 1)
 | |
| 			return aura_env.grad(remcd)
 | |
| 		end
 | |
| 	end
 | |
| end
 | |
| 
 | |
| --INIT
 | |
| aura_env.grad = function(c)
 | |
| 	--c expected as [0, 1]
 | |
| 	if c > 0.5 then
 | |
| 		c = 1 - (2 * (c - 0.5))
 | |
| 		return c, 1, 0, 1
 | |
| 	else
 | |
| 		c = c * 2
 | |
| 		return 1, c, 0, 1
 | |
| 	end
 | |
| end
 | |
| aura_env.range = function(val, min, max, max2)
 | |
| 	val = 1 - (((max - val) / (max - min)) * max2)
 | |
| 	return val
 | |
| end |