name: Zefraxa,
card_text: Pendulum Scale = 7
  [ Pendulum Effect ]
  You cannot Pendulum Summon monsters, except "Nekroz" and "Zefra" monsters. This effect cannot be negated.
  ----------------------------------------
  [ Monster Effect ]
  While this card is in your hand or Graveyard, if a face-up "Nekroz" or "Zefra" card(s), except "Zefraxa, Flame Beast of the Nekroz", is destroyed by battle or card effect while in your Monster Zone or Pendulum Zone: You can Special Summon this card. You can only use this effect of "Zefraxa, Flame Beast of the Nekroz" once per turn.
external_ids: local SETCARD_ID_0 = 0xb4 --Nekroz
  
lua: local SETCARD_ID_0 = 0xb4 --Nekroz
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--splimit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetRange(LOCATION_PZONE)
  	e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_CAN_FORBIDDEN)
  	e2:SetTargetRange(1, 0)
  	e2:SetTarget(s.splimit)
  	c:RegisterEffect(e2)
  	--spsummon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY)
  	e3:SetRange(LOCATION_HAND + LOCATION_GRAVE)
  	e3:SetCode(EVENT_DESTROYED)
  	e3:SetCountLimit(1, id)
  	e3:SetCondition(s.condition)
  	e3:SetTarget(s.target)
  	e3:SetOperation(s.operation)
  	c:RegisterEffect(e3)
  end
  function s.splimit(e, c, sump, sumtype, sumpos, targetp)
  	if c:IsSetCard(SETCARD_ID_0, 0xc4) then
  		return false
  	end
  	return bit.band(sumtype, SUMMON_TYPE_PENDULUM) == SUMMON_TYPE_PENDULUM
  end
  function s.filter(c, tp)
  	return c:IsReason(REASON_BATTLE + REASON_EFFECT)
  		and c:IsSetCard(SETCARD_ID_0, 0xc4)
  		and not c:IsCode(id)
  		and c:IsPreviousControler(tp)
  		and ((c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)) or c:IsPreviousLocation(LOCATION_PZONE))
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.filter, 1, nil, tp)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
  end
  
  
source_text: Zefraxa,
  Pendulum Scale = 7
  [ Pendulum Effect ]
  You cannot Pendulum Summon monsters, except "Nekroz" and "Zefra" monsters. This effect cannot be negated.
  ----------------------------------------
  [ Monster Effect ]
  While this card is in your hand or Graveyard, if a face-up "Nekroz" or "Zefra" card(s), except "Zefraxa, Flame Beast of the Nekroz", is destroyed by battle or card effect while in your Monster Zone or Pendulum Zone: You can Special Summon this card. You can only use this effect of "Zefraxa, Flame Beast of the Nekroz" once per turn.
target_text: -- Zefraxa,
  local SETCARD_ID_0 = 0xb4 --Nekroz
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--splimit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetRange(LOCATION_PZONE)
  	e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_CAN_FORBIDDEN)
  	e2:SetTargetRange(1, 0)
  	e2:SetTarget(s.splimit)
  	c:RegisterEffect(e2)
  	--spsummon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY)
  	e3:SetRange(LOCATION_HAND + LOCATION_GRAVE)
  	e3:SetCode(EVENT_DESTROYED)
  	e3:SetCountLimit(1, id)
  	e3:SetCondition(s.condition)
  	e3:SetTarget(s.target)
  	e3:SetOperation(s.operation)
  	c:RegisterEffect(e3)
  end
  function s.splimit(e, c, sump, sumtype, sumpos, targetp)
  	if c:IsSetCard(SETCARD_ID_0, 0xc4) then
  		return false
  	end
  	return bit.band(sumtype, SUMMON_TYPE_PENDULUM) == SUMMON_TYPE_PENDULUM
  end
  function s.filter(c, tp)
  	return c:IsReason(REASON_BATTLE + REASON_EFFECT)
  		and c:IsSetCard(SETCARD_ID_0, 0xc4)
  		and not c:IsCode(id)
  		and c:IsPreviousControler(tp)
  		and ((c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)) or c:IsPreviousLocation(LOCATION_PZONE))
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.filter, 1, nil, tp)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
  end
  
  