Albion
This card's name becomes "Fallen of Albaz" while on the field or in the GY. If this card is in your hand or GY: You can send 1 "Fallen of Albaz" or 1 "Branded" Spell/Trap from your hand or Deck to the GY; apply the following effect based on where you sent it from.
● Hand: Special Summon this card.
● Deck: Place this card on the bottom of the Deck, then, if you placed this card from your hand, draw 1 card.
You can only use this effect of "Albion the Shrouded Dragon" once per turn.
local CARD_ID_0 = 68468459 --Fallen of Albaz
local SETCARD_ID_0 = 0x15d --Branded

local CARD_ID_0 = 68468459 --Fallen of Albaz
local SETCARD_ID_0 = 0x15d --Branded
local s, id, o = GetID()
function s.initial_effect(c)
	--change name
	aux.EnableChangeCode(c, CARD_ID_0, LOCATION_MZONE + LOCATION_GRAVE)
	--to grave
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetType(EFFECT_TYPE_IGNITION)
	e1:SetRange(LOCATION_HAND + LOCATION_GRAVE)
	e1:SetCountLimit(1, id)
	e1:SetTarget(s.target)
	e1:SetOperation(s.operation)
	c:RegisterEffect(e1)
end
function s.costfilter(c)
	return (c:IsCode(CARD_ID_0) or c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_SPELL + TYPE_TRAP)) and c:IsAbleToGraveAsCost()
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
	local c = e:GetHandler()
	local b1 = Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_HAND, 0, 1, c) and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
	local b2 = Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_DECK, 0, 1, nil) and c:IsAbleToDeck() and (c:IsLocation(LOCATION_GRAVE) or Duel.IsPlayerCanDraw(tp, 1))
	if chk == 0 then
		return b1 or b2
	end
	local g = Group.CreateGroup()
	local g1 = Duel.GetMatchingGroup(s.costfilter, tp, LOCATION_HAND, 0, c)
	local g2 = Duel.GetMatchingGroup(s.costfilter, tp, LOCATION_DECK, 0, nil)
	if b1 then
		g:Merge(g1)
	end
	if b2 then
		g:Merge(g2)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
	local tc = g:Select(tp, 1, 1, nil):GetFirst()
	if tc:IsLocation(LOCATION_HAND) then
		e:SetLabel(1)
		e:SetCategory(CATEGORY_SPECIAL_SUMMON)
		Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
	end
	if tc:IsLocation(LOCATION_DECK) and c:IsLocation(LOCATION_HAND) then
		e:SetLabel(2)
		e:SetCategory(CATEGORY_TODECK + CATEGORY_DRAW)
		Duel.SetOperationInfo(0, CATEGORY_TODECK, c, 1, 0, 0)
		Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, 1)
	end
	if tc:IsLocation(LOCATION_DECK) and c:IsLocation(LOCATION_GRAVE) then
		e:SetLabel(3)
		e:SetCategory(CATEGORY_TODECK)
		Duel.SetOperationInfo(0, CATEGORY_TODECK, c, 1, 0, 0)
	end
	Duel.SendtoGrave(tc, REASON_COST)
end
function s.operation(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	if not c:IsRelateToEffect(e) then
		return
	end
	local label = e:GetLabel()
	if label == 1 then
		Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
	end
	if label == 2 then
		if Duel.SendtoDeck(c, nil, SEQ_DECKBOTTOM, REASON_EFFECT) ~= 0 and c:IsLocation(LOCATION_DECK) then
			Duel.BreakEffect()
			Duel.Draw(tp, 1, REASON_EFFECT)
		end
	end
	if label == 3 then
		Duel.SendtoDeck(c, nil, SEQ_DECKBOTTOM, REASON_EFFECT)
	end
end


Albion
This card's name becomes "Fallen of Albaz" while on the field or in the GY. If this card is in your hand or GY: You can send 1 "Fallen of Albaz" or 1 "Branded" Spell/Trap from your hand or Deck to the GY; apply the following effect based on where you sent it from.
● Hand: Special Summon this card.
● Deck: Place this card on the bottom of the Deck, then, if you placed this card from your hand, draw 1 card.
You can only use this effect of "Albion the Shrouded Dragon" once per turn.
-- Albion
local CARD_ID_0 = 68468459 --Fallen of Albaz
local SETCARD_ID_0 = 0x15d --Branded
local s, id, o = GetID()
function s.initial_effect(c)
	--change name
	aux.EnableChangeCode(c, CARD_ID_0, LOCATION_MZONE + LOCATION_GRAVE)
	--to grave
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetType(EFFECT_TYPE_IGNITION)
	e1:SetRange(LOCATION_HAND + LOCATION_GRAVE)
	e1:SetCountLimit(1, id)
	e1:SetTarget(s.target)
	e1:SetOperation(s.operation)
	c:RegisterEffect(e1)
end
function s.costfilter(c)
	return (c:IsCode(CARD_ID_0) or c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_SPELL + TYPE_TRAP)) and c:IsAbleToGraveAsCost()
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
	local c = e:GetHandler()
	local b1 = Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_HAND, 0, 1, c) and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
	local b2 = Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_DECK, 0, 1, nil) and c:IsAbleToDeck() and (c:IsLocation(LOCATION_GRAVE) or Duel.IsPlayerCanDraw(tp, 1))
	if chk == 0 then
		return b1 or b2
	end
	local g = Group.CreateGroup()
	local g1 = Duel.GetMatchingGroup(s.costfilter, tp, LOCATION_HAND, 0, c)
	local g2 = Duel.GetMatchingGroup(s.costfilter, tp, LOCATION_DECK, 0, nil)
	if b1 then
		g:Merge(g1)
	end
	if b2 then
		g:Merge(g2)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
	local tc = g:Select(tp, 1, 1, nil):GetFirst()
	if tc:IsLocation(LOCATION_HAND) then
		e:SetLabel(1)
		e:SetCategory(CATEGORY_SPECIAL_SUMMON)
		Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
	end
	if tc:IsLocation(LOCATION_DECK) and c:IsLocation(LOCATION_HAND) then
		e:SetLabel(2)
		e:SetCategory(CATEGORY_TODECK + CATEGORY_DRAW)
		Duel.SetOperationInfo(0, CATEGORY_TODECK, c, 1, 0, 0)
		Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, 1)
	end
	if tc:IsLocation(LOCATION_DECK) and c:IsLocation(LOCATION_GRAVE) then
		e:SetLabel(3)
		e:SetCategory(CATEGORY_TODECK)
		Duel.SetOperationInfo(0, CATEGORY_TODECK, c, 1, 0, 0)
	end
	Duel.SendtoGrave(tc, REASON_COST)
end
function s.operation(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	if not c:IsRelateToEffect(e) then
		return
	end
	local label = e:GetLabel()
	if label == 1 then
		Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
	end
	if label == 2 then
		if Duel.SendtoDeck(c, nil, SEQ_DECKBOTTOM, REASON_EFFECT) ~= 0 and c:IsLocation(LOCATION_DECK) then
			Duel.BreakEffect()
			Duel.Draw(tp, 1, REASON_EFFECT)
		end
	end
	if label == 3 then
		Duel.SendtoDeck(c, nil, SEQ_DECKBOTTOM, REASON_EFFECT)
	end
end

