local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 40)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.3, -30, -0.6, 0)
local arr = {
{0, 0, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 3, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 0, 0}
}
local area = createCombatArea(arr)
setCombatArea(combat, area)
local storage = 98745 -- n mexa
local time = 10 -- sem segundos
local a = {1, 2, 5, 6}
function onUse(cid, item, frompos, item2, topos)
if isInArray(a, getPlayerVocation(cid)) then
if getPlayerStorageValue(cid, storage) <= os.time() then
var = numberToVariant(cid)
doCombat(cid, combat, var)
setPlayerStorageValue(cid, storage, os.time()+time)
else
doPlayerSendCancel(cid,"You are exausted for ".. getPlayerStorageValue(cid, storage) - os.time() .." seconds.")
return 0
end
else
doPlayerSendTextMessage(cid, 22, "Only druids and sorcerers can Use this Potion.")
return 0
end
return 1
end