--Will of the Phantomb Lord local ref,id=GetID() function ref.initial_effect(c) --aux.AddRitualProcUltimate(c,ref.ritfilter,Card.GetRitualLevel,"Greater",LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA,nil,nil) --Auxiliary.AddRitualProcUltimate(c,filter,level_function,greater_or_equal,summon_location,grave_filter,mat_filter) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) --e1:SetCountLimit(2,id) e1:SetTarget(ref.acttg) e1:SetOperation(ref.actop) c:RegisterEffect(e1) end --function ref.ritfilter(c) -- return c:IsSetCard(0x732) --end function ref.ritfilter(c,e,tp,m1) --if c:IsLocation(LOCATION_HAND) then Debug.Message(c:GetType()) end if not (c:IsSetCard(0x732) and bit.band(c:GetType(),0x81)==0x81 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)) then return false end local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if c:IsLocation(LOCATION_EXTRA) then ft=Duel.GetLocationCountFromEx(tp) end if ft>0 then return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c) else return ft>-1 and mg:IsExists(ref.mfilterf,1,nil,tp,mg,c) end end function ref.mfilterf(c,tp,mg,rc) if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp,tp,c)>0) then Duel.SetSelectedCard(c) return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc) else return false end end function ref.acttg(e,tp,eg,ep,ev,re,r,rp,chk) local loc=LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA if chk==0 then local mg1=Duel.GetRitualMaterial(tp) return Duel.IsExistingMatchingCard(ref.ritfilter,tp,loc,0,1,nil,e,tp,mg1) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,loc) end function ref.actop(e,tp,eg,ep,ev,re,r,rp) local loc=LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA local mg1=Duel.GetRitualMaterial(tp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,ref.ritfilter,tp,loc,0,1,1,nil,e,tp,mg1) local tc=g:GetFirst() if tc then local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc) local mat=nil if tc:IsLocation(LOCATION_EXTRA) then ft=Duel.GetLocationCountFromEx(tp) end if ft>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc) else Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) mat=mg:FilterSelect(tp,ref.mfilterf,1,1,nil,tp,mg,tc) Duel.SetSelectedCard(mat) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc) mat:Merge(mat2) end tc:SetMaterial(mat) Duel.ReleaseRitualMaterial(mat) Duel.BreakEffect() Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) tc:CompleteProcedure() end end