Elementsaber
Once per turn: You can send 1 "Elementsaber" monster from your hand to the GY, then target 1 "Elementsaber" monster (except "Elementsaber Aina") or "Elemental Lord" monster (that has been properly Summoned) in your GY; Special Summon it, ignoring its Summoning conditions. Once per turn, if this card is in the GY: You can declare 1 Attribute; this card in the GY becomes that Attribute until the end of this turn.
local CARD_ID_0 = 61557074 --Palace of the Elemental Lords
local SETCARD_ID_0 = 0x400d --Elementsaber

local CARD_ID_0 = 61557074 --Palace of the Elemental Lords
local SETCARD_ID_0 = 0x400d --Elementsaber
local s, id, o = GetID()
function s.initial_effect(c)
	--special summon
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e1:SetType(EFFECT_TYPE_IGNITION)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e1:SetRange(LOCATION_MZONE)
	e1:SetCountLimit(1)
	e1:SetCost(s.spcost)
	e1:SetTarget(s.sptg)
	e1:SetOperation(s.spop)
	c:RegisterEffect(e1)
	--att change
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetType(EFFECT_TYPE_IGNITION)
	e2:SetRange(LOCATION_GRAVE)
	e2:SetCountLimit(1)
	e2:SetTarget(s.atttg)
	e2:SetOperation(s.attop)
	c:RegisterEffect(e2)
end
function s.costfilter(c)
	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
	local fe = Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0)
	local loc = LOCATION_HAND
	if fe then
		loc = LOCATION_HAND + LOCATION_DECK
	end
	if chk == 0 then
		return Duel.IsExistingMatchingCard(s.costfilter, tp, loc, 0, 1, nil)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
	local tc = Duel.SelectMatchingCard(tp, s.costfilter, tp, loc, 0, 1, 1, nil):GetFirst()
	if tc:IsLocation(LOCATION_DECK) then
		Duel.Hint(HINT_CARD, 0, CARD_ID_0)
		fe:UseCountLimit(tp)
	end
	Duel.SendtoGrave(tc, REASON_COST)
end
function s.spfilter(c, e, tp)
	return c:IsType(TYPE_MONSTER) and not c:IsCode(id) and c:IsSetCard(SETCARD_ID_0, 0x113) and c:IsCanBeSpecialSummoned(e, 0, tp, true, false)
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc, e, tp)
	end
	if chk == 0 then
		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingTarget(s.spfilter, tp, LOCATION_GRAVE, 0, 1, nil, e, tp)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
	local g = Duel.SelectTarget(tp, s.spfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil, e, tp)
	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, 1, 0, 0)
end
function s.spop(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	if tc:IsRelateToEffect(e) then
		Duel.SpecialSummon(tc, 0, tp, tp, true, false, POS_FACEUP)
	end
end
function s.atttg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return true
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATTRIBUTE)
	local att = Duel.AnnounceAttribute(tp, 1, ATTRIBUTE_ALL & ~e:GetHandler():GetAttribute())
	e:SetLabel(att)
	Duel.SetOperationInfo(0, CATEGORY_LEAVE_GRAVE, e:GetHandler(), 1, tp, LOCATION_GRAVE)
end
function s.attop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	if c:IsRelateToEffect(e) then
		local e1 = Effect.CreateEffect(c)
		e1:SetType(EFFECT_TYPE_SINGLE)
		e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
		e1:SetValue(e:GetLabel())
		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE + RESET_PHASE + PHASE_END)
		c:RegisterEffect(e1)
	end
end


Elementsaber
Once per turn: You can send 1 "Elementsaber" monster from your hand to the GY, then target 1 "Elementsaber" monster (except "Elementsaber Aina") or "Elemental Lord" monster (that has been properly Summoned) in your GY; Special Summon it, ignoring its Summoning conditions. Once per turn, if this card is in the GY: You can declare 1 Attribute; this card in the GY becomes that Attribute until the end of this turn.
-- Elementsaber
local CARD_ID_0 = 61557074 --Palace of the Elemental Lords
local SETCARD_ID_0 = 0x400d --Elementsaber
local s, id, o = GetID()
function s.initial_effect(c)
	--special summon
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e1:SetType(EFFECT_TYPE_IGNITION)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e1:SetRange(LOCATION_MZONE)
	e1:SetCountLimit(1)
	e1:SetCost(s.spcost)
	e1:SetTarget(s.sptg)
	e1:SetOperation(s.spop)
	c:RegisterEffect(e1)
	--att change
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetType(EFFECT_TYPE_IGNITION)
	e2:SetRange(LOCATION_GRAVE)
	e2:SetCountLimit(1)
	e2:SetTarget(s.atttg)
	e2:SetOperation(s.attop)
	c:RegisterEffect(e2)
end
function s.costfilter(c)
	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
	local fe = Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0)
	local loc = LOCATION_HAND
	if fe then
		loc = LOCATION_HAND + LOCATION_DECK
	end
	if chk == 0 then
		return Duel.IsExistingMatchingCard(s.costfilter, tp, loc, 0, 1, nil)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
	local tc = Duel.SelectMatchingCard(tp, s.costfilter, tp, loc, 0, 1, 1, nil):GetFirst()
	if tc:IsLocation(LOCATION_DECK) then
		Duel.Hint(HINT_CARD, 0, CARD_ID_0)
		fe:UseCountLimit(tp)
	end
	Duel.SendtoGrave(tc, REASON_COST)
end
function s.spfilter(c, e, tp)
	return c:IsType(TYPE_MONSTER) and not c:IsCode(id) and c:IsSetCard(SETCARD_ID_0, 0x113) and c:IsCanBeSpecialSummoned(e, 0, tp, true, false)
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc, e, tp)
	end
	if chk == 0 then
		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingTarget(s.spfilter, tp, LOCATION_GRAVE, 0, 1, nil, e, tp)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
	local g = Duel.SelectTarget(tp, s.spfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil, e, tp)
	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, 1, 0, 0)
end
function s.spop(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	if tc:IsRelateToEffect(e) then
		Duel.SpecialSummon(tc, 0, tp, tp, true, false, POS_FACEUP)
	end
end
function s.atttg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return true
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATTRIBUTE)
	local att = Duel.AnnounceAttribute(tp, 1, ATTRIBUTE_ALL & ~e:GetHandler():GetAttribute())
	e:SetLabel(att)
	Duel.SetOperationInfo(0, CATEGORY_LEAVE_GRAVE, e:GetHandler(), 1, tp, LOCATION_GRAVE)
end
function s.attop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	if c:IsRelateToEffect(e) then
		local e1 = Effect.CreateEffect(c)
		e1:SetType(EFFECT_TYPE_SINGLE)
		e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
		e1:SetValue(e:GetLabel())
		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE + RESET_PHASE + PHASE_END)
		c:RegisterEffect(e1)
	end
end

