--Pharaohnic Papyrus of Alchemy local id,cod=23251032,c23251032 function cod.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCost(cod.cost) e1:SetTarget(cod.target) e1:SetOperation(cod.activate) c:RegisterEffect(e1) end function cod.filter(c) return c:IsSetCard(0xd3e) or (c:IsCode(23251001) or c:IsCode(23251002) or c:IsCode(23251013)) end function cod.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-3 and Duel.CheckReleaseGroup(tp,cod.filter,3,nil) end local g=Duel.SelectReleaseGroup(tp,cod.filter,3,3,nil) Duel.Release(g,REASON_COST) end function cod.spfilter(c,e,tp) return c:IsCode(23251034) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) end function cod.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cod.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) end function cod.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,cod.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)>0 then g:GetFirst():CompleteProcedure() end end