Cannot be normal summoned or set. Cannot be specialsummoned except by tributing 1 face-up "Beaver Warrior" you control. You can tribute this face-up card to draw cards until you have 7 in your hand. You can return 5 monster cards from your graveyard to your deck to specialsummon 1 level 4 or lower monster from your deck. You can pay half your life points to add 2 of your banished cards to your hand.
function cXXXXXXXX.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(cXXXXXXXX.spcon)
e2:SetOperation(cXXXXXXXX.spop)
c:RegisterEffect(e2)
---draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(XXXXXXXX,0))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(cXXXXXXXX.cost)
e3:SetTarget(cXXXXXXXX.drtg)
e3:SetOperation(cXXXXXXXX.drop)
c:RegisterEffect(e3)
----to hand
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCost(cXXXXXXXX.cost1)
e4:SetTarget(cXXXXXXXX.target)
e4:SetOperation(cXXXXXXXX.activate)
c:RegisterEffect(e4)
end
function cXXXXXXXX.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function cXXXXXXXX.rfilter(c)
return c:IsCode(32452818)
end
function cXXXXXXXX.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and Duel.CheckReleaseGroup(c:GetControler(),cXXXXXXXX.rfilter,1,nil)
end
function cXXXXXXXX.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(c:GetControler(),cXXXXXXXX.rfilter,1,1,nil)
Duel.Release(g,REASON_COST)
end
function cXXXXXXXX.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
local ht=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if ht<7 then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,7-ht)
end
end
function cXXXXXXXX.drop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ht=Duel.GetFieldGroupCount(p,LOCATION_HAND,0)
if ht<7 then
Duel.Draw(p,7-ht,REASON_EFFECT)
end
end
function cXXXXXXXX.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function cXXXXXXXX.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and chkc:IsAbleToHand()end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_REMOVED,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_REMOVED,0,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,2,0,0)
end
function cXXXXXXXX.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
This is what I have so far. As you can see, however, I still need the pot of avarice-like effect, but I have no idea how to make it work ._.
Any help, please?
Greetings
VB99