--created by LeonDuvall, coded by Lyris --Shimmering Concentrated Magitate local s,id,o=GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.AddLinkProcedure(c,s.mfilter,1,1) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_DESTROYED) e1:SetRange(LOCATION_REMOVED) e1:HOPT() e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCategory(CATEGORY_TODECK+CATEGORY_GRAVE_ACTION+CATEGORY_DRAW) e1:SetCondition(s.drcon) e1:SetCost(s.drcost) e1:SetTarget(s.drtg) e1:SetOperation(s.drop) c:RegisterEffect(e1) end function s.mfilter(c) return c:IsLevelBelow(4) and not c:IsLinkAttribute(ATTRIBUTE_DARK) and c:IsSetCard(0xd16) end function s.cfilter(c,tp) return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:GetPreviousLevelOnField()==5 and c:IsPreviousSetCard(0xd16) end function s.drcon(e,tp,eg) return eg:IsExists(s.cfilter,1,nil,tp) end function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToExtraAsCost() end Duel.SendtoDeck(c,nil,SEQ_DECKTOP,REASON_COST) end function s.filter(c) return c:IsFaceup() and c:IsSetCard(0xd16) and c:IsAbleToDeck() end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,5,nil) and Duel.IsPlayerCanDraw(tp,2) end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,5,tp,LOCATION_GRAVE+LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2) end function s.drop(e,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,5,5,nil) Duel.HintSelection(g) if #g<5 or Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)<5 then return end if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end if g:IsExists(aux.NOT(Card.IsLocation),1,nil,LOCATION_DECK+LOCATION_EXTRA) then return end Duel.Draw(tp,2,REASON_EFFECT) end