KNIGHTWING_222
2016-08-10T22:44:26Z
How or what do I reference to script the following:

You can Xyz Summon this card by attaching two "xxx" you control whose combined Ranks equal 30 or more to this card as Xyz Material.(Xyz Materials on those cards gets attached to this card as Xyz Materials. This summon is treated as a Xyz Summon)
Valossa
2016-08-10T22:49:50Z
See something similar to sphere fild a anime continuous spell card then you can aply your condition on it
[YOL]Edo9300
2016-08-11T02:25:32Z
now for your "xxx" i set xyz monster as filter, this is te script:
function cxxxx.initial_effect(c)
	--xyz summon
	c:EnableReviveLimit()
	local e1=Effect.CreateEffect(c)
	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetCode(EFFECT_SPSUMMON_PROC)
	e1:SetRange(LOCATION_EXTRA)
	e1:SetCondition(cxxxx.xyzcon)
	e1:SetOperation(cxxxx.xyzop)
	e1:SetValue(SUMMON_TYPE_XYZ)
	c:RegisterEffect(e1)
end
function cxxxx.mfilter(c,xyzc)
	return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsCanBeXyzMaterial(xyzc)
end
function cxxxx.xyzfilter1(c,g)
	return g:IsExists(cxxxx.xyzfilter2,1,c,c:GetRank())
end
function cxxxx.xyzfilter2(c,rk)
	return c:GetRank()+rk>=30
end
function cxxxx.xyzcon(e,c,og)
	if c==nil then return true end
	local tp=c:GetControler()
	local mg=nil
	if og then
		mg=og:Filter(cxxxx.mfilter,nil,c)
	else
		mg=Duel.GetMatchingGroup(cxxxx.mfilter,tp,LOCATION_MZONE,0,nil,c)
	end
	return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
		and mg:IsExists(cxxxx.xyzfilter1,1,nil,mg)
end
function cxxxx.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og)
	local g=nil
	local sg=Group.CreateGroup()
	if og then
		g=og
		local tc=og:GetFirst()
		while tc do
			sg:Merge(tc:GetOverlayGroup())
			tc=og:GetNext()
		end
	else
		local mg=Duel.GetMatchingGroup(cxxxx.mfilter,tp,LOCATION_MZONE,0,nil)
		Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
		g=mg:FilterSelect(tp,cxxxx.xyzfilter1,1,1,nil,mg)
		local tc1=g:GetFirst()
		Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
		local g2=mg:FilterSelect(tp,cxxxx.xyzfilter2,1,1,tc1,tc1:GetRank())
		local tc2=g2:GetFirst()
		g:Merge(g2)
		sg:Merge(tc1:GetOverlayGroup())
		sg:Merge(tc2:GetOverlayGroup())
	end
	if sg:GetCount()~=0 then
		Duel.Overlay(c,sg)
	end
	c:SetMaterial(g)
	Duel.Overlay(c,g)
end
KNIGHTWING_222
2016-08-11T02:47:12Z
[YOL wrote:

Edo9300;157273]now for your "xxx" i set xyz monster as filter, this is te script:

function cxxxx.initial_effect(c)
	--xyz summon
	c:EnableReviveLimit()
	local e1=Effect.CreateEffect(c)
	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetCode(EFFECT_SPSUMMON_PROC)
	e1:SetRange(LOCATION_EXTRA)
	e1:SetCondition(cxxxx.xyzcon)
	e1:SetOperation(cxxxx.xyzop)
	e1:SetValue(SUMMON_TYPE_XYZ)
	c:RegisterEffect(e1)
end
function cxxxx.mfilter(c,xyzc)
	return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsCanBeXyzMaterial(xyzc)
end
function cxxxx.xyzfilter1(c,g)
	return g:IsExists(cxxxx.xyzfilter2,1,c,c:GetRank())
end
function cxxxx.xyzfilter2(c,rk)
	return c:GetRank()+rk>=30
end
function cxxxx.xyzcon(e,c,og)
	if c==nil then return true end
	local tp=c:GetControler()
	local mg=nil
	if og then
		mg=og:Filter(cxxxx.mfilter,nil,c)
	else
		mg=Duel.GetMatchingGroup(cxxxx.mfilter,tp,LOCATION_MZONE,0,nil,c)
	end
	return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
		and mg:IsExists(cxxxx.xyzfilter1,1,nil,mg)
end
function cxxxx.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og)
	local g=nil
	local sg=Group.CreateGroup()
	if og then
		g=og
		local tc=og:GetFirst()
		while tc do
			sg:Merge(tc:GetOverlayGroup())
			tc=og:GetNext()
		end
	else
		local mg=Duel.GetMatchingGroup(cxxxx.mfilter,tp,LOCATION_MZONE,0,nil)
		Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
		g=mg:FilterSelect(tp,cxxxx.xyzfilter1,1,1,nil,mg)
		local tc1=g:GetFirst()
		Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
		local g2=mg:FilterSelect(tp,cxxxx.xyzfilter2,1,1,tc1,tc1:GetRank())
		local tc2=g2:GetFirst()
		g:Merge(g2)
		sg:Merge(tc1:GetOverlayGroup())
		sg:Merge(tc2:GetOverlayGroup())
	end
	if sg:GetCount()~=0 then
		Duel.Overlay(c,sg)
	end
	c:SetMaterial(g)
	Duel.Overlay(c,g)
end



In the process of testing the script now.

On a related but unrelated note, I looked at Cardcar D and Summon Breakers effect to Skip to the End Phase of the turn. I was wondering how to take the script of those cards to script the following effect:

After the Draw Phase, it becomes the End Phase of the Turn.
[YOL]Edo9300
2016-08-11T02:53:12Z
the operation would be like cardcar d:
function cxxxx.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.SkipPhase(tp,PHASE_STANDBY+PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
	local e1=Effect.CreateEffect(e:GetHandler())
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
	e1:SetTargetRange(1,0)
	e1:SetCode(EFFECT_CANNOT_BP)
	e1:SetReset(RESET_PHASE+PHASE_END)
	Duel.RegisterEffect(e1,tp)
end
for the effect you must use: SetCode(EVENT_PHASE+PHASE_DRAW), then it depends on how you want to make the effect
KNIGHTWING_222
2016-08-11T03:35:57Z
[YOL wrote:

Edo9300;157277]the operation would be like cardcar d:

function cxxxx.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.SkipPhase(tp,PHASE_STANDBY+PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
	local e1=Effect.CreateEffect(e:GetHandler())
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
	e1:SetTargetRange(1,0)
	e1:SetCode(EFFECT_CANNOT_BP)
	e1:SetReset(RESET_PHASE+PHASE_END)
	Duel.RegisterEffect(e1,tp)
end
for the effect you must use: SetCode(EVENT_PHASE+PHASE_DRAW), then it depends on how you want to make the effect



Like this:

-- IMMEDIATE END PHASE
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(90516154,0))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_DRAW)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(c90516154.operation1)
c:RegisterEffect(e3)