a place for all your custom card needs you can post scripts pics and request for card to be made also please donate to the funding for a new server made for custom card duels
 
HomePortalCalendarFAQSearchMemberlistUsergroupsRegisterLog in

Share | .
 

 Please help me, I'm stuck ^^'

View previous topic View next topic Go down 
AuthorMessage
AoO

avatar


Member Title : Noob4ever
Posts : 241
Join date : 2014-04-25
Location : I only know that it is dark :/

PostSubject: Please help me, I'm stuck ^^'   Sat May 31, 2014 5:11 pm

I'm nearly done with the scripts of my very own archetype, but now I stuck with a card for a while.
This Rank 1 Xyz monster can deatch 1 Xyz material, to target one monster that is on the field or in the graveyard or banished and gain lifepoints equal to the atk of the monster. This is what I've done so far:
Code:
function c900000018.initial_effect(c)
   --xyz summon
   aux.AddXyzProcedure(c,aux.XyzFilterFunctionF(c,aux.FilterBoolFunction(Card.IsSetCard,0x3E8),1),2)
   c:EnableReviveLimit()
   --recover
   local e1=Effect.CreateEffect(c)
   e1:SetDescription(aux.Stringid(900000018,0))
   e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
   e1:SetCategory(CATEGORY_RECOVER)
   e1:SetType(EFFECT_TYPE_IGNITION)
   e1:SetRange(LOCATION_MZONE)
   e1:SetCountLimit(1)
   e1:SetCost(c900000018.cost)
   e1:SetTarget(c900000018.target)
   e1:SetOperation(c900000018.operation)
   c:RegisterEffect(e1)
end

function c900000018.cost(e,tp,eg,ep,ev,re,r,rp,chk)
   if chk==0 then return e:GetHandler():GetFlagEffect(900000018)==0
      and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
   e:GetHandler():RegisterFlagEffect(900000018,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
   Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
   e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c900000018.filter(c,e,tp)
   return c:IsType(TYPE_MONSTER) and c:IsFaceup()
end
function c900000018.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
   if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and chkc:IsFaceup() end
   if chk==0 then return Duel.IsExistingTarget(c900000018.filter,e:GetHandler(),LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
   return true
end
function c900000018.operation(e,tp,eg,ep,ev,re,r,rp)
   local dg=Duel.GetMatchingGroup(c900000018.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp)      
   Duel.Hint(HINT_SELECTMSG,e:GetHandler():GetControler(),HINTMSG_FACEUP)
   local tc=dg:Select(e:GetHandler():GetControler(),1,1,nil)      
   Duel.Recover(tp,tc:GetFirst():GetAttack(),REASON_EFFECT)
end


Mackpro tells me, that the parameter 5 in line 36 should be 'Card', but I don't know, what parameter I should replace with what. ^^'

_________________

Keep going, keep experiencing, keep learning AND: NEVER STOP!! >.<

Yugioh Custom Cards/ Decks/ Duels: https://www.youtube.com/channel/UCPil2ljKCm4HBhNT7wcNl-Q
Back to top Go down
View user profile
outlaw1994

avatar
Admin
Admin

Member Title : Red-Eyes Lord
Posts : 797
Join date : 2013-07-09
Age : 22
Location : bundaberg qld australia

PostSubject: Re: Please help me, I'm stuck ^^'   Sun Jun 01, 2014 3:57 am

here i have not tested but it should work you will have to change it a bit to match you effect this scripts eff is detach 1 xyz material from this card then target 1 face-up monster that is in either players grave field or banished except this card; gain lifepoints equal to the atk of the selected monster. hope it helps

Code:
function c900000018.initial_effect(c)
  --xyz summon
  aux.AddXyzProcedure(c,aux.XyzFilterFunctionF(c,aux.FilterBoolFunction(Card.IsSetCard,0x3E8),1),2)
  c:EnableReviveLimit()
  --recover
  local e1=Effect.CreateEffect(c)
  e1:SetDescription(aux.Stringid(900000018,0))
  e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  e1:SetCategory(CATEGORY_RECOVER)
  e1:SetType(EFFECT_TYPE_IGNITION)
  e1:SetRange(LOCATION_MZONE)
  e1:SetCountLimit(1)
  e1:SetCost(c900000018.cost)
  e1:SetTarget(c900000018.target)
  e1:SetOperation(c900000018.operation)
  c:RegisterEffect(e1)
end

function c900000018.cost(e,tp,eg,ep,ev,re,r,rp,chk)
  if chk==0 then return e:GetHandler():GetFlagEffect(900000018)==0
      and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
  e:GetHandler():RegisterFlagEffect(900000018,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
  Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
  e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c900000018.filter(c,e)
  return c:IsType(TYPE_MONSTER) and c:IsFaceup()
end
function c900000018.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
   if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(1-tp) and c900000018.filter(chkc) end
   if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and Duel.IsExistingTarget(c900000018.filter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED,1,e:GetHandler()) end
     Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
   Duel.SelectTarget(tp,c900000018.filter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED,1,1,e:GetHandler())
end
function c900000018.operation(e,tp,eg,ep,ev,re,r,rp)
   local c=e:GetHandler()
   local tc=Duel.GetFirstTarget() 
  Duel.Recover(tp,tc:GetAttack(),REASON_EFFECT)
end
Back to top Go down
View user profile http://mackpro.userboard.net
AoO

avatar


Member Title : Noob4ever
Posts : 241
Join date : 2014-04-25
Location : I only know that it is dark :/

PostSubject: Re: Please help me, I'm stuck ^^'   Sun Jun 01, 2014 1:24 pm

Thank you, it worked Very Happy

_________________

Keep going, keep experiencing, keep learning AND: NEVER STOP!! >.<

Yugioh Custom Cards/ Decks/ Duels: https://www.youtube.com/channel/UCPil2ljKCm4HBhNT7wcNl-Q
Back to top Go down
View user profile
outlaw1994

avatar
Admin
Admin

Member Title : Red-Eyes Lord
Posts : 797
Join date : 2013-07-09
Age : 22
Location : bundaberg qld australia

PostSubject: Re: Please help me, I'm stuck ^^'   Sun Jun 01, 2014 2:06 pm

np
Back to top Go down
View user profile http://mackpro.userboard.net
Sponsored content





PostSubject: Re: Please help me, I'm stuck ^^'   

Back to top Go down
 

Please help me, I'm stuck ^^'

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» Halogen Oven stuck on 220 degrees setting
» stuck throttle ring on cox .049 car engine
» Crankcase assembly tool stuck!!
» Which parts of Sailor Moon stuck with you when you first watched it?
» Stuck TD 0.9

Permissions in this forum:You cannot reply to topics in this forum
Mackpro :: MackPro :: Requests-