local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_NONE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREATTACK)

local maxsummons = 1

local spell = Spell("instant")

function spell.onCastSpell(creature, var)
	local summoncount = creature:getSummons()
	if #summoncount < 1 then
		mid = Game.createMonster("Fire Elemental", { x = creature:getPosition().x + math.random(-1, 1), y = creature:getPosition().y + math.random(-1, 1), z = creature:getPosition().z })
		if not mid then
			return
		end
		mid:setMaster(creature)
	end
	return combat:execute(creature, var)
end

spell:name("demon summon")
spell:words("###240")
spell:blockWalls(true)
spell:needLearn(true)
spell:register()
