local s,id,o=GetID()
function s.initial_effect(c)
	--fusion material
	c:EnableReviveLimit()
	aux.AddFusionProcFun2(c,s.matfilter1,s.matfilter2,true)
    aux.AddContactFusionProcedure(c,Card.IsReleasable,LOCATION_MZONE,0,Duel.Release,REASON_COST+REASON_MATERIAL)
	--disable spsummon
	local e1=Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetRange(LOCATION_MZONE)
	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
	e1:SetTargetRange(0,1)
    e1:SetCondition(s.limcon)
	c:RegisterEffect(e1)
    --ind
    local e2=Effect.CreateEffect(c)
	e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
	e2:SetType(EFFECT_TYPE_FIELD)
	e2:SetRange(LOCATION_MZONE)
	e2:SetTargetRange(LOCATION_MZONE,0)
	e2:SetTarget(s.tg)
	e2:SetValue(1)
	c:RegisterEffect(e2)
    --ritual summon
	local e3=aux.AddRitualProcGreater2(c,s.filter,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,nil,nil,true)
	e3:SetDescription(aux.Stringid(id,0))
	e3:SetType(EFFECT_TYPE_QUICK_O)
	e3:SetRange(LOCATION_MZONE)
	e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
	e3:SetCountLimit(1)
	c:RegisterEffect(e3)
end
function s.matfilter1(c)
	return c:IsFusionType(TYPE_RITUAL) and c:IsRace(RACE_FAIRY)
end
function s.matfilter2(c)
	return c:IsRace(RACE_WARRIOR+RACE_FAIRY) and c:GetOriginalLevel()>=5
end
function s.limcon(e,tp,eg,ep,ev,re,r,rp,chk)
    local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
    return g:GetCount()>=3
end
function s.tg(e,c)
	return c:IsRace(RACE_FAIRY+RACE_WARRIOR)
end
function s.filter(c,e,tp,chk)
	return c:IsRace(RACE_FAIRY+RACE_WARRIOR)
end