--Neo World Magician function c249001254.initial_effect(c) aux.AddLinkProcedure(c,nil,2,2,c249001254.lcheck) --search local e1=Effect.CreateEffect(c) e1:SetDescription(510) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(c249001254.setcon) e1:SetTarget(c249001254.settg) e1:SetOperation(c249001254.setop) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCost(c249001254.cost) e2:SetTarget(c249001254.target) e2:SetOperation(c249001254.operation) c:RegisterEffect(e2) end function c249001254.lcheck(g,lc) return g:IsExists(Card.IsSetCard,1,nil,0x236) end function c249001254.setcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) end function c249001254.setfilter(c) return c:IsSetCard(0x236) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() end function c249001254.settg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c249001254.setfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end end function c249001254.setop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c249001254.setfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) local tc=g:GetFirst() if tc then Duel.SSet(tp,tc) end end function c249001254.cost(e,tp,eg,ep,ev,re,r,rp,chk) e:SetLabel(1) return true end function c249001254.costfilter(c,ec,tp) if not c:IsSetCard(0x236) then return false end return Duel.IsExistingTarget(c249001254.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c,c,ec) end function c249001254.desfilter(c,tc,ec) return c:GetEquipTarget()~=tc end function c249001254.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsOnField() and chkc~=c end if chk==0 then if not Duel.IsPlayerCanDraw(tp,1) then return false end if e:GetLabel()==1 then e:SetLabel(0) return Duel.CheckReleaseGroup(REASON_COST,tp,c249001254.costfilter,1,nil,c,tp) else return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end end if e:GetLabel()==1 then e:SetLabel(0) local sg=Duel.SelectReleaseGroup(REASON_COST,tp,c249001254.costfilter,1,1,nil,c,tp) Duel.Release(sg,REASON_COST) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function c249001254.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then Duel.Draw(tp,1,REASON_EFFECT) end end