Krawler
FLIP: You can target up to 2 "Krawler" monsters in your GY; add them to your hand.
If this face-up card in its owner's control leaves the field because of an opponent's card effect: You can Special Summon 2 "Krawler" monsters with different names from your Deck in face-down Defense Position, except "Krawler Ranvier". You can only use each effect of "Krawler Ranvier" once per turn.
local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
local SETCARD_ID_0 = 0x104 --Krawler

local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
local SETCARD_ID_0 = 0x104 --Krawler
local s, id, o = GetID()
function s.initial_effect(c)
	--flip
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_TOHAND)
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_FLIP + EFFECT_TYPE_TRIGGER_O)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DELAY)
	e1:SetCountLimit(1, id)
	e1:SetTarget(s.target)
	e1:SetOperation(s.operation)
	c:RegisterEffect(e1)
	--spsummon
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e2:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_DAMAGE_STEP)
	e2:SetCode(EVENT_LEAVE_FIELD)
	e2:SetCountLimit(1, id + 1)
	e2:SetCondition(s.spcon)
	e2:SetTarget(s.sptg)
	e2:SetOperation(s.spop)
	c:RegisterEffect(e2)
end
function s.filter(c)
	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(s.filter, tp, LOCATION_GRAVE, 0, 1, nil)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_GRAVE, 0, 1, 2, nil)
	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
end
function s.operation(e, tp, eg, ep, ev, re, r, rp)
	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
	if g:GetCount() > 0 then
		Duel.SendtoHand(g, nil, REASON_EFFECT)
	end
end
function s.spcon(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer() == 1 - tp
end
function s.filter1(c, e, tp)
	return c:IsSetCard(SETCARD_ID_0) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEDOWN_DEFENSE)
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
			return false
		end
		if Duel.GetLocationCount(tp, LOCATION_MZONE) < 2 then
			return false
		end
		local g = Duel.GetMatchingGroup(s.filter1, tp, LOCATION_DECK, 0, nil, e, tp)
		return g:GetClassCount(Card.GetCode) >= 2
	end
	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 2, tp, LOCATION_DECK)
end
function s.spop(e, tp, eg, ep, ev, re, r, rp)
	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
		return
	end
	if Duel.GetLocationCount(tp, LOCATION_MZONE) < 2 then
		return
	end
	local g = Duel.GetMatchingGroup(s.filter1, tp, LOCATION_DECK, 0, nil, e, tp)
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
	local sg = g:SelectSubGroup(tp, aux.dncheck, false, 2, 2)
	if sg then
		Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEDOWN_DEFENSE)
		Duel.ConfirmCards(1 - tp, sg)
	end
end


Krawler
FLIP: You can target up to 2 "Krawler" monsters in your GY; add them to your hand.
If this face-up card in its owner's control leaves the field because of an opponent's card effect: You can Special Summon 2 "Krawler" monsters with different names from your Deck in face-down Defense Position, except "Krawler Ranvier". You can only use each effect of "Krawler Ranvier" once per turn.
-- Krawler
local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
local SETCARD_ID_0 = 0x104 --Krawler
local s, id, o = GetID()
function s.initial_effect(c)
	--flip
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_TOHAND)
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_FLIP + EFFECT_TYPE_TRIGGER_O)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DELAY)
	e1:SetCountLimit(1, id)
	e1:SetTarget(s.target)
	e1:SetOperation(s.operation)
	c:RegisterEffect(e1)
	--spsummon
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e2:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_DAMAGE_STEP)
	e2:SetCode(EVENT_LEAVE_FIELD)
	e2:SetCountLimit(1, id + 1)
	e2:SetCondition(s.spcon)
	e2:SetTarget(s.sptg)
	e2:SetOperation(s.spop)
	c:RegisterEffect(e2)
end
function s.filter(c)
	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(s.filter, tp, LOCATION_GRAVE, 0, 1, nil)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_GRAVE, 0, 1, 2, nil)
	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
end
function s.operation(e, tp, eg, ep, ev, re, r, rp)
	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
	if g:GetCount() > 0 then
		Duel.SendtoHand(g, nil, REASON_EFFECT)
	end
end
function s.spcon(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer() == 1 - tp
end
function s.filter1(c, e, tp)
	return c:IsSetCard(SETCARD_ID_0) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEDOWN_DEFENSE)
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
			return false
		end
		if Duel.GetLocationCount(tp, LOCATION_MZONE) < 2 then
			return false
		end
		local g = Duel.GetMatchingGroup(s.filter1, tp, LOCATION_DECK, 0, nil, e, tp)
		return g:GetClassCount(Card.GetCode) >= 2
	end
	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 2, tp, LOCATION_DECK)
end
function s.spop(e, tp, eg, ep, ev, re, r, rp)
	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
		return
	end
	if Duel.GetLocationCount(tp, LOCATION_MZONE) < 2 then
		return
	end
	local g = Duel.GetMatchingGroup(s.filter1, tp, LOCATION_DECK, 0, nil, e, tp)
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
	local sg = g:SelectSubGroup(tp, aux.dncheck, false, 2, 2)
	if sg then
		Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEDOWN_DEFENSE)
		Duel.ConfirmCards(1 - tp, sg)
	end
end

