modifier_lily_01_effect_think = class({})

local public = modifier_lily_01_effect_think

function public:IsHidden()
	return true
end

function public:IsDebuff()
	return false
end

function public:IsPurgable()
	return false
end

function public:GetAttributes()
	return MODIFIER_ATTRIBUTE_IGNORE_INVULNERABLE
end

function public:OnIntervalThink()
	if IsServer() then
		local caster = self:GetParent()
		local ability = self:GetAbility()

		if ability:IsCooldownReady() and ability:IsFullyCastable() and SpawnSystem.IsUnLimited == false then		
			if caster.thtd_lily_01_effectIndex == nil then
				caster.thtd_lily_01_effectIndex = ParticleManager:CreateParticle("particles/heroes/lily/ability_lily_01_ready.vpcf", PATTACH_CUSTOMORIGIN, caster)
				ParticleManager:SetParticleControlEnt(caster.thtd_lily_01_effectIndex , 0, caster, 5, "follow_origin", Vector(0,0,0), true)
			end
		elseif caster.thtd_lily_01_effectIndex ~= nil then
			ParticleManager:DestroyParticleSystem(caster.thtd_lily_01_effectIndex,true)
			caster.thtd_lily_01_effectIndex = nil
		end
	end
end

function public:OnCreated(kv)
	if IsServer() then
		self:StartIntervalThink(self:GetAbility():GetSpecialValueFor("effect_tick"))
	end
end


function public:OnDestroy(kv)
	if IsServer() then
		self:StartIntervalThink(-1)
	end
end

