name: Vampire
card_text: Cannot be Normal Summoned/Set. Must be Special Summoned (from your hand) by banishing 1 "Vampire Lord" you control. Once per turn: You can discard 1 Zombie monster to the GY, then target 1 Zombie monster in your GY with a Level less than the discarded Zombie monster's; Special Summon that target.
external_ids: local CARD_ID_0 = 53839837 --Vampire Lord
  
lua: local CARD_ID_0 = 53839837 --Vampire Lord
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	--cannot special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	c:RegisterEffect(e1)
  	--spsummon proc
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_SPSUMMON_PROC)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e2:SetRange(LOCATION_HAND)
  	e2:SetCondition(s.hspcon)
  	e2:SetTarget(s.hsptg)
  	e2:SetOperation(s.hspop)
  	c:RegisterEffect(e2)
  	--spsummon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e3:SetCountLimit(1)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTarget(s.sptg)
  	e3:SetOperation(s.spop)
  	c:RegisterEffect(e3)
  end
  function s.hspfilter(c, tp)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0) and c:IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp, c) > 0
  end
  function s.hspcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	return Duel.IsExistingMatchingCard(s.hspfilter, tp, LOCATION_MZONE, 0, 1, nil, tp)
  end
  function s.hsptg(e, tp, eg, ep, ev, re, r, rp, chk, c)
  	local g = Duel.GetMatchingGroup(s.hspfilter, tp, LOCATION_MZONE, 0, nil, tp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local tc = g:SelectUnselect(nil, tp, false, true, 1, 1)
  	if tc then
  		e:SetLabelObject(tc)
  		return true
  	else
  		return false
  	end
  end
  function s.hspop(e, tp, eg, ep, ev, re, r, rp, c)
  	local g = e:GetLabelObject()
  	Duel.Remove(g, POS_FACEUP, REASON_SPSUMMON)
  end
  function s.cfilter(c, e, tp)
  	return c:IsRace(RACE_ZOMBIE) and c:IsDiscardable() and Duel.IsExistingTarget(s.spfilter, tp, LOCATION_GRAVE, 0, 1, nil, e, tp, c:GetOriginalLevel())
  end
  function s.spfilter(c, e, tp, lv)
  	local clv = c:GetLevel()
  	return clv > 0 and clv < lv and c:IsRace(RACE_ZOMBIE) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return false
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DISCARD)
  	local g1 = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_HAND, 0, 1, 1, nil, e, tp)
  	Duel.SendtoGrave(g1, REASON_COST + REASON_DISCARD)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g2 = Duel.SelectTarget(tp, s.spfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil, e, tp, g1:GetFirst():GetOriginalLevel())
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g2, 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and tc:IsRace(RACE_ZOMBIE) then
  		Duel.SpecialSummon(tc, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  
source_text: Vampire
  Cannot be Normal Summoned/Set. Must be Special Summoned (from your hand) by banishing 1 "Vampire Lord" you control. Once per turn: You can discard 1 Zombie monster to the GY, then target 1 Zombie monster in your GY with a Level less than the discarded Zombie monster's; Special Summon that target.
target_text: -- Vampire
  local CARD_ID_0 = 53839837 --Vampire Lord
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	--cannot special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	c:RegisterEffect(e1)
  	--spsummon proc
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_SPSUMMON_PROC)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e2:SetRange(LOCATION_HAND)
  	e2:SetCondition(s.hspcon)
  	e2:SetTarget(s.hsptg)
  	e2:SetOperation(s.hspop)
  	c:RegisterEffect(e2)
  	--spsummon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e3:SetCountLimit(1)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTarget(s.sptg)
  	e3:SetOperation(s.spop)
  	c:RegisterEffect(e3)
  end
  function s.hspfilter(c, tp)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0) and c:IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp, c) > 0
  end
  function s.hspcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	return Duel.IsExistingMatchingCard(s.hspfilter, tp, LOCATION_MZONE, 0, 1, nil, tp)
  end
  function s.hsptg(e, tp, eg, ep, ev, re, r, rp, chk, c)
  	local g = Duel.GetMatchingGroup(s.hspfilter, tp, LOCATION_MZONE, 0, nil, tp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local tc = g:SelectUnselect(nil, tp, false, true, 1, 1)
  	if tc then
  		e:SetLabelObject(tc)
  		return true
  	else
  		return false
  	end
  end
  function s.hspop(e, tp, eg, ep, ev, re, r, rp, c)
  	local g = e:GetLabelObject()
  	Duel.Remove(g, POS_FACEUP, REASON_SPSUMMON)
  end
  function s.cfilter(c, e, tp)
  	return c:IsRace(RACE_ZOMBIE) and c:IsDiscardable() and Duel.IsExistingTarget(s.spfilter, tp, LOCATION_GRAVE, 0, 1, nil, e, tp, c:GetOriginalLevel())
  end
  function s.spfilter(c, e, tp, lv)
  	local clv = c:GetLevel()
  	return clv > 0 and clv < lv and c:IsRace(RACE_ZOMBIE) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return false
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DISCARD)
  	local g1 = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_HAND, 0, 1, 1, nil, e, tp)
  	Duel.SendtoGrave(g1, REASON_COST + REASON_DISCARD)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g2 = Duel.SelectTarget(tp, s.spfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil, e, tp, g1:GetFirst():GetOriginalLevel())
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g2, 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and tc:IsRace(RACE_ZOMBIE) then
  		Duel.SpecialSummon(tc, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  