function onUse(cid) local monster = { ["Dragon"] = {1, 1800}, ["Dragon Lord"] = {1801, 2000}, ["Demon"] = {2001, 99999} } local summon = getCreatureSummons(cid) local pLevel = getPlayerLevel(cid) for l, m in pairs(monster) do if pLevel <= m[2] then doConvinceCreature(cid, doSummonCreature(l, getCreaturePosition(cid))) doCreatureSay(cid, "Lets go to Battle!", TALKTYPE_ORANGE_1) doSendMagicEffect(getThingPos(cid), 10) break end end if summon then for n, p in ipairs(summon) do doRemoveCreature(p) end end return true end




info
Grupo: Campones
Registrado: 31/08/18
Posts: 15
Reputação: 0
Quero mudar isso, o que eu tenho ja esta com lvl, mas o que eu quero é que use apenas um Doll, e a cada lvl extipulado mude o Pet.
local dolls = {
[9955] = {pet = "pet aniquilador",lvl = 8},
[2353] = {pet = "pet giant", lvl = 101},
[6579] = {pet = "pet jurema", lvl = 151},
[9019] = {pet = "pet gremilie", lvl = 201},
[2354] = {pet = "pet gladiador", lvl = 301}
}
function onUse(cid, item, frompos, item2, topos)
if (getPlayerVocation(cid) ~= 5) and (getPlayerAccess(cid) ~= 5) then
return doPlayerSendCancel(cid, "Somente Domadores são dignos de usar Pets")
end
local go = dolls[item.itemid]
if getPlayerLevel(cid) >= go.lvl then
local summon = getCreatureSummons(cid)
if #summon >= 1 then
for _, pid in ipairs(summon) do
doRemoveCreature(pid)
doCreatureSay(cid, "Can go rest ["..go.pet.."]", TALKTYPE_ORANGE_1)
end
return true
end
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, "Let battle ["..go.pet.."]", TALKTYPE_ORANGE_1)
else
return doPlayerSendCancel(cid, "Voce nao tem level suficiente para usar este pet.")
end
return true
end