Someone can do it for me?
Code:
local storage = 79845 --storage for exhaustion
local tempo = 5 --in seconds
local monsters = {
[1] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 2 },
[2] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 4 },
[5] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 4 },
[6] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 6 },
[9] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 6 },
[10] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 8 },
}
function onSay(cid, words, param, channel)
if exhaustion.check(cid, storage) then
doPlayerSendTextMessage(cid, 22, "You are exhausted.")
return true
end
--Player Status
local playerpos = getPlayerPosition(cid)
param = string.lower(param)
local loop = 0
function checkSummon()
for k, v in pairs(monsters[getPlayerVocation(cid)].summons) do
if param == k then
return true
end
end
return false
end
if not checkSummon() then
doPlayerSendCancel(cid, "You can't summon this monster.")
return true
end
for k, v in pairs(monsters[getPlayerVocation(cid)].summons) do
if (param == k) then
if (monsters[getPlayerVocation(cid)]) and #getCreatureSummons(cid) >= monsters[getPlayerVocation(cid)].maxSummons then
return doPlayerSendCancel(cid, "Você já tem sumons demais.")
else
--Summon
if getPlayerLevel(cid) < v.level then
return doPlayerSendCancel(cid, "Você não possui level suficiente.")
elseif getCreatureMana(cid) < v.mana then
return doPlayerSendCancel(cid, "Você não possui mana suficiente.")
end
doConvinceCreature(cid, doCreateMonster(param, playerpos))
doPlayerAddMana(cid, -v.mana, false)
exhaustion.set(cid, storage, tempo)
doSendMagicEffect(playerpos, 2)
return true
end
end
end
return true
end