--Etherveil Lich King local cid,id=GetID() function cid.initial_effect(c) c:SetUniqueOnField(1,0,id) --fusion material c:EnableReviveLimit() aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x312),2,true) aux.AddContactFusionProcedure(c,cid.ffilter,LOCATION_MZONE,0,Duel.Remove,POS_FACEDOWN,REASON_COST) --spsummon condition local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetValue(cid.splimit) c:RegisterEffect(e1) --change effect type local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCode(21022007) e2:SetRange(LOCATION_MZONE) e2:SetTargetRange(1,0) c:RegisterEffect(e2) --tohand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id) e3:SetCost(cid.setcost) e3:SetTarget(cid.settg) e3:SetOperation(cid.setop) c:RegisterEffect(e3) end function cid.ffilter(c) return c:IsAbleToRemoveAsCost(POS_FACEDOWN) end function cid.splimit(e,se,sp,st) return e:GetHandler():GetLocation()~=LOCATION_EXTRA end function cid.filter(c) return c:IsSetCard(0x312) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() end function cid.cfilter(c) return c:IsFacedown() and c:IsAbleToDeckAsCost() end function cid.setcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.cfilter,tp,LOCATION_REMOVED,0,2,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,cid.cfilter,tp,LOCATION_REMOVED,0,2,2,nil) if #g>0 then Duel.SendtoDeck(g,nil,2,REASON_COST) end end function cid.settg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(cid.filter,tp,LOCATION_DECK,0,1,nil) end end function cid.setop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local g=Duel.SelectMatchingCard(tp,cid.filter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SSet(tp,g:GetFirst()) Duel.ConfirmCards(1-tp,g) end end