name: Conquistador
card_text: Special Summon this card as a Normal Monster (Zombie/LIGHT/Level 5/ATK 500/DEF 1800) (this card is also still a Trap), then, if you control "Eldlich the Golden Lord", you can destroy 1 face-up card on the field. During the End Phase: You can banish this card from your GY; Set 1 "Eldlixir" Spell/Trap directly from your Deck. You can only use 1 "Conquistador of the Golden Land" effect per turn, and only once that turn.
external_ids: local CARD_ID_0 = 95440946 --Eldlich the Golden Lord
  local SETCARD_ID_0 = 0x2142 --Eldlixir
  
lua: local CARD_ID_0 = 95440946 --Eldlich the Golden Lord
  local SETCARD_ID_0 = 0x2142 --Eldlixir
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id)
  	e1:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_END_PHASE)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--set
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetCondition(s.setcon)
  	e2:SetCountLimit(1, id)
  	e2:SetHintTiming(TIMING_END_PHASE)
  	e2:SetCost(aux.bfgcost)
  	e2:SetTarget(s.settg)
  	e2:SetOperation(s.setop)
  	c:RegisterEffect(e2)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:IsCostChecked()
  			and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  			and Duel.IsPlayerCanSpecialSummonMonster(tp, id, 0, TYPES_NORMAL_TRAP_MONSTER, 500, 1800, 5, RACE_ZOMBIE, ATTRIBUTE_LIGHT)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not Duel.IsPlayerCanSpecialSummonMonster(tp, id, 0, TYPES_NORMAL_TRAP_MONSTER, 500, 1800, 5, RACE_ZOMBIE, ATTRIBUTE_LIGHT) then
  		return
  	end
  	c:AddMonsterAttribute(TYPE_NORMAL + TYPE_TRAP)
  	if
  		Duel.SpecialSummon(c, 0, tp, tp, true, false, POS_FACEUP) ~= 0
  		and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_ONFIELD, 0, 1, nil)
  		and Duel.IsExistingMatchingCard(Card.IsFaceup, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, nil)
  		and Duel.SelectYesNo(tp, aux.Stringid(id, 2))
  	then
  		Duel.BreakEffect()
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  		local g = Duel.SelectMatchingCard(tp, Card.IsFaceup, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, 1, nil)
  		Duel.HintSelection(g)
  		local tc = g:GetFirst()
  		if tc then
  			Duel.Destroy(tc, REASON_EFFECT)
  		end
  	end
  end
  function s.setfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_SPELL + TYPE_TRAP) and c:IsSSetable()
  end
  function s.setcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetCurrentPhase() == PHASE_END
  end
  function s.settg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.setfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  end
  function s.setop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SET)
  	local g = Duel.SelectMatchingCard(tp, s.setfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	if #g > 0 then
  		Duel.SSet(tp, g)
  	end
  end
  
  
source_text: Conquistador
  Special Summon this card as a Normal Monster (Zombie/LIGHT/Level 5/ATK 500/DEF 1800) (this card is also still a Trap), then, if you control "Eldlich the Golden Lord", you can destroy 1 face-up card on the field. During the End Phase: You can banish this card from your GY; Set 1 "Eldlixir" Spell/Trap directly from your Deck. You can only use 1 "Conquistador of the Golden Land" effect per turn, and only once that turn.
target_text: -- Conquistador
  local CARD_ID_0 = 95440946 --Eldlich the Golden Lord
  local SETCARD_ID_0 = 0x2142 --Eldlixir
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id)
  	e1:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_END_PHASE)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--set
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetCondition(s.setcon)
  	e2:SetCountLimit(1, id)
  	e2:SetHintTiming(TIMING_END_PHASE)
  	e2:SetCost(aux.bfgcost)
  	e2:SetTarget(s.settg)
  	e2:SetOperation(s.setop)
  	c:RegisterEffect(e2)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:IsCostChecked()
  			and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  			and Duel.IsPlayerCanSpecialSummonMonster(tp, id, 0, TYPES_NORMAL_TRAP_MONSTER, 500, 1800, 5, RACE_ZOMBIE, ATTRIBUTE_LIGHT)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not Duel.IsPlayerCanSpecialSummonMonster(tp, id, 0, TYPES_NORMAL_TRAP_MONSTER, 500, 1800, 5, RACE_ZOMBIE, ATTRIBUTE_LIGHT) then
  		return
  	end
  	c:AddMonsterAttribute(TYPE_NORMAL + TYPE_TRAP)
  	if
  		Duel.SpecialSummon(c, 0, tp, tp, true, false, POS_FACEUP) ~= 0
  		and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_ONFIELD, 0, 1, nil)
  		and Duel.IsExistingMatchingCard(Card.IsFaceup, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, nil)
  		and Duel.SelectYesNo(tp, aux.Stringid(id, 2))
  	then
  		Duel.BreakEffect()
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  		local g = Duel.SelectMatchingCard(tp, Card.IsFaceup, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, 1, nil)
  		Duel.HintSelection(g)
  		local tc = g:GetFirst()
  		if tc then
  			Duel.Destroy(tc, REASON_EFFECT)
  		end
  	end
  end
  function s.setfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_SPELL + TYPE_TRAP) and c:IsSSetable()
  end
  function s.setcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetCurrentPhase() == PHASE_END
  end
  function s.settg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.setfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  end
  function s.setop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SET)
  	local g = Duel.SelectMatchingCard(tp, s.setfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	if #g > 0 then
  		Duel.SSet(tp, g)
  	end
  end
  
  