--Flame Noble Knight Lord Carolus Magnus --Created and Scripted by Swaggy local m=8002104 local cm=_G["c"..m] function cm.initial_effect(c) --synchro summon aux.AddSynchroProcedure(c,cm.sfilter,aux.NonTuner(nil),1) c:EnableReviveLimit() --Aid me, my useless knight local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,m) e1:SetCondition(cm.sscon) e1:SetTarget(cm.sstg) e1:SetOperation(cm.ssop) c:RegisterEffect(e1) --Reinforcements of le arme local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(m,0)) e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetRange(LOCATION_MZONE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1,m+100) e2:SetCost(cm.thcost) e2:SetTarget(cm.thtg) e2:SetOperation(cm.thop) c:RegisterEffect(e2) end function cm.sfilter(c) return c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_FIRE) end function cm.sscon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) end function cm.filter(c,e,tp) local lv=c:GetLevel() return lv>0 and c:IsType(TYPE_MONSTER) and c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(cm.eqfilter,tp,LOCATION_DECK,0,c:GetLevel(),nil) end function cm.eqfilter(c) return c:IsType(TYPE_EQUIP) and c:IsType(TYPE_SPELL) and c:IsAbleToGrave() end function cm.sstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter(chkc,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local lv=g:GetFirst():GetLevel() Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,lv,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function cm.ssop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() local lv=tc:GetLevel() if not tc or not tc:IsRelateToEffect(e) or lv<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,cm.eqfilter,tp,LOCATION_DECK,0,lv,lv,nil) if #g<=0 then return end if Duel.SendtoGrave(g,REASON_EFFECT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupEx(tp,cm.sfilter,1,e:GetHandler()) end local g=Duel.SelectReleaseGroupEx(tp,cm.sfilter,1,1,e:GetHandler()) Duel.Release(g,REASON_COST) end function cm.thfilter(c,tp) return (c:IsType(TYPE_DUAL) or (c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_FIRE))) and c:IsAbleToHand() end function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function cm.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end