local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
function onCastSpell(cid, var)
local cfg = {
refuel = 1 * 60 * 1000,
amount_of_soul = 200
}
if getPlayerSoul(cid) == cfg.amount_of_soul then
doPlayerAddSoul(cid, -cfg.amount_of_soul)
doPlayerSetStamina(cid, cfg.refuel)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
return doCombat(cid, combat, var) and true
end
return doPlayerSendCancel(cid, "You must have ".. cfg.amount_of_soul .." soul points to refuel your stamina."), doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) and true
end