Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, if a Beast, Beast-Warrior, or Plant monster you control would be destroyed by battle, it is not destroyed. * The above text is unofficial and describes the card's functionality in the OCG.
--神聖なる森
--Spiritual Forest
local s,id=GetID()
function s.initial_effect(c)
	--Activate
	local e1=Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	c:RegisterEffect(e1)
	--
	local e2=Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_FIELD)
	e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
	e2:SetRange(LOCATION_SZONE)
	e2:SetTargetRange(LOCATION_MZONE,0)
	e2:SetTarget(s.indtg)
	e2:SetCountLimit(1)
	e2:SetValue(s.valcon)
	c:RegisterEffect(e2)
end
function s.indtg(e,c)
	return c:IsRace(RACE_PLANT|RACE_BEAST|RACE_BEASTWARRIOR)
end
function s.valcon(e,re,r,rp)
	return (r&REASON_BATTLE)~=0
end