local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatArea(combat, createCombatArea(AREA_SQUARE1X1))
function onTargetCreature(cid, target) return doChallengeCreature(cid, target) end
setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
function onCastSpell(cid, var)
local pos = getThingPos(cid)
local maxSummons = 1
local creatureName = 'Wolf'
if(#getCreatureSummons(cid) >= maxSummons) then
doPlayerSendCancel(cid, 'You are unable to summon more.')
return false
end
local v = doSummonCreature(creatureName, pos)
doConvinceCreature(cid, v)
doSendMagicEffect(getThingPos(v), CONST_ME_TELEPORT)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doCombat(cid, combat, numberToVariant(v))
return true
end