--created by NTA, coded by Remnance local s,id=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.spfilter(c,e,tp) return c:IsSetCard(0x4578) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.thfilter(c) return c:IsCode(id) and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local g1=Duel.GetFirstTarget() if g1:IsRelateToEffect(e) and Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)~=0 then local g2=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil) if g1:IsCode(id//100) and #g2>0 and Duel.SelectYesNo(tp,aux.Stringid(id//100,3)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g2=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g2>0 then Duel.SendtoHand(g2,tp,REASON_EFFECT) Duel.ConfirmCards(1-tp,g2) end end end end