--Arcane-Study White Mage function c249000703.initial_effect(c) --search local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetRange(LOCATION_HAND) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCondition(c249000703.spcon) e1:SetTarget(c249000703.sptg) e1:SetOperation(c249000703.spop) c:RegisterEffect(e1) --recover local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_RECOVER) e2:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCountLimit(1) e2:SetCondition(c249000703.reccon) e2:SetTarget(c249000703.rectg) e2:SetOperation(c249000703.recop) c:RegisterEffect(e2) --recover local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_DRAW) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetCountLimit(1) e3:SetRange(LOCATION_MZONE) e3:SetCost(c249000703.cost) e3:SetTarget(c249000703.target) e3:SetOperation(c249000703.operation) c:RegisterEffect(e3) end function c249000703.spcon(e,tp,eg,ep,ev,re,r,rp) local ec=eg:GetFirst() return ec:IsControler(tp) and ec:IsSetCard(0x1E6) end function c249000703.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function c249000703.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) c:CompleteProcedure() end end function c249000703.reccon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()==tp end function c249000703.rectg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local ct=Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_MZONE,0,nil) Duel.SetTargetPlayer(tp) Duel.SetTargetParam(ct*400) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*600) end function c249000703.recop(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_MZONE,0,nil) Duel.Recover(tp,ct*400,REASON_EFFECT) end function c249000703.filter(c) return c:IsAbleToDeckOrExtraAsCost() and (c:IsSetCard(0x1E6) or c:IsSetCard(0x1E7)) end function c249000703.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c249000703.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,3,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,c249000703.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,3,3,nil) Duel.SendtoDeck(g,nil,2,REASON_COST) end function c249000703.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(2) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2) end function c249000703.operation(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) end