Bloser
2018-06-12T16:46:20Z
Need help for a card effect
i will make it short
The supreme servent Clear wing dragon has the effect that i can you back in the extra deck and special summon 2 servent dragon.
I want the same but my Monster is a effect Monster thats why it needs to go back in the deck
Hope anybody can help with this simple effect[:laugh:] [:laugh:]
SotheY
2018-06-12T19:12:43Z
Try this:

function c511009517.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
	Duel.SendtoDeck(e:GetHandler(),nil,0,REASON_COST)
end

Not sure if it actually works, I just replaced "Extra" with "Deck" ... [:laugh:]
Bloser
2018-06-13T15:12:02Z
Originally Posted by: SotheY 

Try this:

function c511009517.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
	Duel.SendtoDeck(e:GetHandler(),nil,0,REASON_COST)
end

Not sure if it actually works, I just replaced "Extra" with "Deck" ... [:laugh:]


Thanks for the try but it doesnt work[:laugh:] [:laugh:]
Bloser
2018-06-13T15:13:19Z
and it needs the effect to special summon the 2 servent dragon
SotheY
2018-06-13T17:20:37Z
Originally Posted by: Bloser 

and it needs the effect to special summon the 2 servent dragon



Well, that's a straight-up copy from Supreme King Servant Dragon Clear Wing, so you just need to modify the cost to make it work.
Bloser
2018-06-14T14:54:34Z
Originally Posted by: SotheY 

Originally Posted by: Bloser 

and it needs the effect to special summon the 2 servent dragon



Well, that's a straight-up copy from Supreme King Servant Dragon Clear Wing, so you just need to modify the cost to make it work.



it sounds easy but i cant get it to work? can you pls help me
SotheY
2018-06-14T17:12:51Z
What do you have so far?
Bloser
2018-06-14T17:23:30Z
Originally Posted by: SotheY 

What do you have so far?


thats what i have,maybe im missing something?
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(95923441,0))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetHintTiming(0,TIMING_END_PHASE)
e5:SetRange(LOCATION_MZONE)
e5:SetCost(c511009517.spcost)
e5:SetTarget(c511009517.sptg)
e5:SetOperation(c511009517.spop2)
c:RegisterEffect(e5)
end
function c511009517.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,0,REASON_COST)
end
function c511009517.spfilter2(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x20f8) and c:IsType(TYPE_EFFECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c511009517.sptg(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 e:GetHandler():GetFlagEffect(511009517)==0
and Duel.IsExistingMatchingCard(c511009517.spfilter2,tp,LOCATION_DECK,0,2,nil,e,tp) end
e:GetHandler():RegisterFlagEffect(511009517,RESET_CHAIN,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function c511009517.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(c511009517.spfilter2,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,2,2,nil)
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)==0 then return end
local ag=Duel.GetMatchingGroup(c511009517.filter,tp,0,LOCATION_MZONE,nil)
local tc=ag:GetFirst()
while tc do
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_ATTACK_FINAL)
e2:SetValue(0)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
tc=ag:GetNext()
end
end
end
SotheY
2018-06-14T22:08:32Z
Well, 511009517 is the card number of Supreme King Servant Dragon Clear Wing. So if you don't intend to change the script of that card, you need to replace all 511009517 with the card ID of your custom card.
Bloser
2018-06-15T10:46:59Z
Originally Posted by: SotheY 

Well, 511009517 is the card number of Supreme King Servant Dragon Clear Wing. So if you don't intend to change the script of that card, you need to replace all 511009517 with the card ID of your custom card.



Ok im trying to have the same kind of effect, but with 2 Differrences:
My Monster is a effect Monster =location Deck not Extra Deck
And instead of summon 2 supreme pendulum dragon i want to summon 2 effect Monster of my own archetyp
(setcode 600)
but it doesnt work:

--spsummon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(95923441,0))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetHintTiming(0,TIMING_END_PHASE)
e5:SetRange(LOCATION_MZONE)
e5:SetCost(c136.spcost)
e5:SetTarget(c136.sptg)
e5:SetOperation(c136.spop2)
c:RegisterEffect(e5)
end
function c136.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,0,REASON_COST)
end
function c136.spfilter2(c,e,tp)
return c:IsFaceup() and c:IsSetCard(600) and c:IsType(TYPE_EFFECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c136.sptg(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 e:GetHandler():GetFlagEffect(136)==0
and Duel.IsExistingMatchingCard(c136.spfilter2,tp,LOCATION_DECK,0,2,nil,e,tp) end
e:GetHandler():RegisterFlagEffect(136,RESET_CHAIN,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function c136.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(c136.spfilter2,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,2,2,nil)
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)==0 then return end
local ag=Duel.GetMatchingGroup(c136.filter,tp,0,LOCATION_MZONE,nil)
local tc=ag:GetFirst()
while tc do
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_ATTACK_FINAL)
e2:SetValue(0)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
tc=ag:GetNext()
end
end
end
SotheY
2018-06-15T12:16:09Z
Just found the Metaphys archetype has that kind of cost "shuffle into deck; do x"

Try this function:

function cXXXXXXXXX.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),tp,2,REASON_COST)
end
Bloser
2018-06-15T13:49:15Z
Originally Posted by: SotheY 

Just found the Metaphys archetype has that kind of cost "shuffle into deck; do x"

Try this function:

function cXXXXXXXXX.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),tp,2,REASON_COST)
end



It still doesnt work[:confu:]
I just need to find a way to shuffle it back and special summon from my deck the 2 Monsters?
i dont get it, doesnt sound to complicated to script.
SotheY
2018-06-15T15:12:48Z
I think I got it now. I was so focused on the cost that I didn't pay attention to your script.

I think the problem is this part:

function c136.spfilter2(c,e,tp)
return c:IsFaceup() and c:IsSetCard(600) and c:IsType(TYPE_EFFECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end

The script searches for monsters that are FACE-UP in your deck. Since monsters in the deck cannot be face-up (except some strange cards), the script fails to find a valid target to summon. Delete that part and you might be grand.
Bloser
2018-06-15T17:34:40Z
Originally Posted by: SotheY 

I think I got it now. I was so focused on the cost that I didn't pay attention to your script.

I think the problem is this part:

function c136.spfilter2(c,e,tp)
return c:IsFaceup() and c:IsSetCard(600) and c:IsType(TYPE_EFFECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end

The script searches for monsters that are FACE-UP in your deck. Since monsters in the deck cannot be face-up (except some strange cards), the script fails to find a valid target to summon. Delete that part and you might be grand.



Thanks man i really mist that part[:tongue:]
I needed to delete
function c136.spfilter2(c,e,tp)
return c:IsFaceup() and c:IsSetCard(600) and c:IsType(TYPE_EFFECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
now it works
Users browsing this topic