wangbao
2017-09-21T14:00:26Z
Hi, I have a Ritual Monster with details below:

Blue Storm Princess, Lynpia
[Spellcaster/Ritual/Pendulum/Effect] WATER | Level 4 | Scale 8
ATK/1500 DEF/1000

Pendulum Effect: Once per turn: You can Ritual Summon any “Blue Storm” Ritual Monster that is either in your hand or face-up in your Extra Deck, except “Blue Storm Princess, Lynpia”. You must also Tribute monsters from your hand or field whose total Levels exactly equal the Level of Ritual Monster you Ritual Summon.

Monster Effect: You can Ritual Summon this card with the effect of any “Blue Storm” card. If this card is Ritual Summoned: You can add 1 “Blue Storm Princess” Ritual Monster from your Deck to your hand, except “Blue Storm Princess, Lynpia”. If this card is Tributed for a Ritual Summon: You can place this card in your Pendulum Zone. You can only use each effect of “Blue Storm Princess, Lynpia” once per turn.

https://wangbao.devianta...rincess-Lynpia-700291991 

I have a trouble at Pendulum Effect when the New Master Rule is updated in YGOPro. I don't know how to fix my card's scripts:

This is my scripts for Pendulum Effect:

Quote:

--Blue Storm Princess, Lynpia
function c199000102.initial_effect(c)
c:EnableReviveLimit()
--pendulum summon
aux.EnablePendulumAttribute(c)
--Ritual Summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1)
e2:SetTarget(c199000102.rstg)
e2:SetOperation(c199000102.rsop)
c:RegisterEffect(e2)
end
----- e2
function c199000102.filter(c,filter,e,tp,m,ft)
if not (c:IsSetCard(199001) and not c:IsCode(199000102)) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if ft>0 then
return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetOriginalLevel(),1,99,c)
else
return mg:IsExists(c199000102.mfilterf,1,nil,tp,mg,c)
end
end
function c199000102.mfilterf(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) then
Duel.SetSelectedCard(c)
return mg:CheckWithSumEqual(Card.GetRitualLevel,rc:GetOriginalLevel(),0,99,rc)
else return false end
end
function c199000102.rstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(c199000102.filter,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,nil,filter,e,tp,mg,ft)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_EXTRA)
end
function c199000102.rsop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c199000102.filter,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,1,nil,filter,e,tp,mg,ft)
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
local mat=nil
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetOriginalLevel(),1,99,tc)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,c199000102.mfilterf,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetOriginalLevel(),0,99,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