esse erro no console
"atempt do call global ..." significa que está tentando puxar um funçao da LIB que não existe.
você não tem na LIB a função "doReborn"
cola essa função em qualquer lib sua e reabra o OT
function doReborn(cid, level, looktype, vocation)
local playerID = getPlayerGUID(cid)
setPlayerStorageValue(cid, 30023, 4)
setPlayerStorageValue(cid, 30025, looktype)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+50250)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+50250)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid))
if isCreature(cid) then
doRemoveCreature(cid, true)
end
db.query("UPDATE `players` SET `level` = " .. level .. " WHERE `id` = " .. playerID .. ";")
db.query("UPDATE `players` SET `looktype` = " .. looktype .. " WHERE `id` = " .. playerID .. ";")
db.query("UPDATE `players` SET `vocation` = " .. vocation .. " WHERE `id` = " .. playerID .. ";")
return TRUE
end
e use esse código aqui como reborn, otimizei ele pra outro DBO:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg:lower()) end
function onThink() npcHandler:onThink() end
local talkState = {}
local config = {
-- [voc atual] = {level apos reborn, looktype após reborn, pra qual vocação vai}
[5] = {to_level = 8, looktype = 10, to_voc = 6},
[18] = {to_level = 8, looktype = 821, to_voc = 19},
[36] = {to_level = 8, looktype = 38, to_voc = 37},
[49] = {to_level = 8, looktype = 50, to_voc = 50},
[62] = {to_level = 8, looktype = 909, to_voc = 63},
[75] = {to_level = 8, looktype = 842, to_voc = 76},
[87] = {to_level = 8, looktype = 81, to_voc = 87},
[99] = {to_level = 8, looktype = 88, to_voc = 100},
[115] = {to_level = 8, looktype = 1373, to_voc = 116},
[131] = {to_level = 8, looktype = 113, to_voc = 132},
[144] = {to_level = 8, looktype = 50, to_voc = 145},
[156] = {to_level = 8, looktype = 128, to_voc = 157},
[168] = {to_level = 8, looktype = 144, to_voc = 169},
[181] = {to_level = 8, looktype = 153, to_voc = 182},
[210] = {to_level = 8, looktype = 169, to_voc = 211},
[222] = {to_level = 8, looktype = 180, to_voc = 223},
[234] = {to_level = 8, looktype = 194, to_voc = 235},
[248] = {to_level = 8, looktype = 205, to_voc = 249},
[260] = {to_level = 8, looktype = 212, to_voc = 261},
[272] = {to_level = 8, looktype = 221, to_voc = 273},
[284] = {to_level = 8, looktype = 227, to_voc = 285},
[296] = {to_level = 8, looktype = 235, to_voc = 297},
[308] = {to_level = 8, looktype = 246, to_voc = 309},
[320] = {to_level = 8, looktype = 257, to_voc = 321},
[332] = {to_level = 8, looktype = 265, to_voc = 333},
[344] = {to_level = 8, looktype = 277, to_voc = 345},
[356] = {to_level = 8, looktype = 285, to_voc = 357},
[368] = {to_level = 8, looktype = 296, to_voc = 369},
[380] = {to_level = 8, looktype = 302, to_voc = 381},
[392] = {to_level = 8, looktype = 308, to_voc = 393},
[404] = {to_level = 8, looktype = 321, to_voc = 405},
[417] = {to_level = 8, looktype = 335, to_voc = 418},
[429] = {to_level = 8, looktype = 347, to_voc = 430},
[441] = {to_level = 8, looktype = 357, to_voc = 442},
[453] = {to_level = 8, looktype = 368, to_voc = 454},
[465] = {to_level = 8, looktype = 375, to_voc = 466},
[482] = {to_level = 8, looktype = 578, to_voc = 483},
[503] = {to_level = 8, looktype = 556, to_voc = 504},
--pra inserir mais é só copiar e colar e mudar da mesma forma
}
local need_level = {200, 600}
local rstorage = 149501
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
local msg = string.lower(msg)
local vocation = getPlayerVocation(cid)
local t = config[vocation]
local levelP = getPlayerLevel(cid)
if isInArray({"reborn", "rebornar", "reset", "resetar"}, msg) then
if getPlayerStorageValue(cid, 30023) == 4 then
npcHandler:say("Desculpe! Você ja está rebornado!", cid)
npcHandler:releaseFocus(cid)
return true
end
if not t then
npcHandler:say("Você precisa estar na ultima transformação para rebornar!", cid)
return true
end
if t then
if levelP < need_level[1] or levelP > need_level[2] then
npcHandler:say("Apenas level 200 até 600 podem rebornar!", cid)
return true
else
npcHandler:say("Você tem certeza que deseja rebornar?", cid)
talkState[talkUser] = 1
end
end
elseif isInArray({"yes", "sim", "quero", "yeah"}, msg) and talkState[talkUser] == 1 then
setPlayerStorageValue(cid, rstorage, getPlayerLevel(cid))
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
doReborn(cid, t.to_level, t.looktype, t.to_voc)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())