--Dottrina Sacra di Elyria --Script by XGlitchy30 function c38648118.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:SetCondition(c38648118.condition) e1:SetTarget(c38648118.target) e1:SetOperation(c38648118.activate) c:RegisterEffect(e1) end --filters function c38648118.filter(c,e,tp) return c:IsSetCard(0xe841) and c:IsType(TYPE_NORMAL) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and ((c:IsFaceup() and c:IsLocation(LOCATION_EXTRA)) or c:IsLocation(LOCATION_GRAVE)) end --Activate function c38648118.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 end function c38648118.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and Duel.GetLocationCountFromEx(tp)>0 and Duel.IsExistingMatchingCard(c38648118.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(c38648118.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE+LOCATION_EXTRA) end function c38648118.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end if Duel.GetLocationCountFromEx(tp)<0 then return end local g1=Duel.GetMatchingGroup(aux.NecroValleyFilter(c38648118.filter),tp,LOCATION_GRAVE,0,nil,e,tp) local g2=Duel.GetMatchingGroup(c38648118.filter,tp,LOCATION_EXTRA,0,nil,e,tp) if g1:GetCount()==0 or g2:GetCount()==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg1=g1:Select(tp,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg2=g2:Select(tp,1,1,nil) sg1:Merge(sg2) Duel.SpecialSummon(sg1,0,tp,tp,false,false,POS_FACEUP) end