urielkama
2014-02-02T12:48:56Z
Need help to scrip a card, the effect is
1.once per turn, when i have a specific monster type /set name (0x123) on field
2.i reveal any number of the same type (0x123) or other one, in my hands and
3.i send the equal number of setted spell/trap from my opponent to his hand
if any one could help me would be n1

That was my final try,but dont get it to work condition must be furfill, but in mainphase it shown no option select for ask me if i want activate the effect what did i wrong q.q?
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88045405,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_PHASE+PHASE_MAIN1)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c88045405.con)
e1:SetTarget(c88045405.tg)
e1:SetOperation(c88045405.op)
c:RegisterEffect(e1)
end
function c88045405.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x95) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
end
function c88045405.con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExist(c88045405.cfilter,1,nil,tp)
end
function c88045405.rfilter(c)
return c:IsSetCard(0x95) and not c:IsPublic()
end
function c88045405.hfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c88045405.tg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if chk==0 then
local ct=Duel.GetMatchingGroupCount(c88045405.rfilter,tp,LOCATION_HAND,0,c)
local sel=0
if ct>0 and Duel.IsExistingMatchingCard(c88045405.hfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then sel=sel+1 end
end
local sel=e:GetLabel()
if sel==3 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(88045405,0))
sel=Duel.SelectOption(tp,aux.Stringid(88045405,1),aux.Stringid(88045405,2))+1 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sel,e:GetLabel(),0,0)
end
function c88045405.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sel=e:GetLabel()
if sel==1 then
local ct=Duel.GetMatchingGroupCount(c88045405.rfilter,tp,LOCATION_HAND,0,c)
local g=Duel.GetMatchingGroup(c88045405.hfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if ct>0 and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(88045405,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local dg=g:Select(tp,1,ct,nil)
Duel.HintSelection(dg)
Duel.SendtoHand(dg,REASON_EFFECT)
end
end
end
Would be nice if someone have any ideas how to keep it working thanks^^.
Percival18
2014-02-04T17:22:40Z
Just a quick glance, I haven't tested the script. You are mentioning (0x123) in your description but the script uses (0x95)
urielkama
2014-02-05T08:48:20Z
Originally Posted by: Percival18 

Just a quick glance, I haven't tested the script. You are mentioning (0x123) in your description but the script uses (0x95)



oh yeah the (0x123) was an example then i have create a new set name and added at with a cardmanager and tried it with (0x95),but it depends on which version i used the cardmanager from devpro which has set names til (0x96)
and wondered when i choose my custom card in cardmanager of devpro that (0x95) is the name for Artifacts now so i changed it again now it must be (0x97) sry for the trouble, if you find anything out i would be very appreciated for your help and guidance 🙂.
Users browsing this topic