diegozemo
2015-11-08T05:06:40Z
Hey Guys I need help to scripting the effect of a card I made, the card says:

Once per turn you can send from your deck to the graveyard 1 monster card that has "Dark Magician" in his card name; the name, attribute and level of this card becomes the name, attribute and level of the monster sent to the graveyard by this effect.

The problem is when I send the monster card, the other monster copy the attribute and level, but not the name, so
if anyone can help I will be grateful.

This is the script:

--
function c400.initial_effect(c)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(400,1))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,400)
e1:SetTarget(c400.tgtg)
e1:SetOperation(c400.tgop)
c:RegisterEffect(e1)
end
function c400.tgfilter(c)
return c:IsSetCard(0xa2) and c:IsAbleToGrave()
end
function c400.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c400.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c400.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c400.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(tc:GetAttribute())
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_LEVEL)
e2:SetValue(tc:GetLevel())
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CHANGE_CODE)
e3:SetValue(e:GetLabel())
c:RegisterEffect(e3)
end
end
raivost
2015-11-09T15:49:07Z
try this:
function c400.initial_effect(c)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(400,1))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,400)
e1:SetTarget(c400.tgtg)
e1:SetOperation(c400.tgop)
c:RegisterEffect(e1)
end
function c400.tgfilter(c)
return c:IsSetCard(0xa2) and c:IsAbleToGrave()
end
function c400.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c400.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c400.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c400.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
local code=tc:GetOriginalCode()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(tc:GetAttribute())
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_LEVEL)
e2:SetValue(tc:GetLevel())
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CHANGE_CODE)
e3:SetValue(code)
c:RegisterEffect(e3)
end
end
diegozemo
2015-11-15T02:58:28Z
Originally Posted by: raivost 

try this:
function c400.initial_effect(c)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(400,1))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,400)
e1:SetTarget(c400.tgtg)
e1:SetOperation(c400.tgop)
c:RegisterEffect(e1)
end
function c400.tgfilter(c)
return c:IsSetCard(0xa2) and c:IsAbleToGrave()
end
function c400.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c400.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c400.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c400.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
local code=tc:GetOriginalCode()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(tc:GetAttribute())
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_LEVEL)
e2:SetValue(tc:GetLevel())
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CHANGE_CODE)
e3:SetValue(code)
c:RegisterEffect(e3)
end
end



It works thank you.
By the way I have other problems with another effect, I hope you can help me.

Its a magic card and the second effect says:
You can banish this card from your graveyard, then special summon 1 "Dark Magician" or "Dark Magician Girl" from your Deck. this monster cannot declare attack.