Ir para conteúdo

Featured Replies

Postado

.Qual servidor ou website você utiliza como base? 

TFS 0.4

Qual o motivo deste tópico? 

Mudei recentemente para TFS 0.4 e estou com este problema neste script de Reborn.

Grato a quem puder ajudar.

Está surgindo algum erro? Se sim coloque-o aqui. 

Citar

image.thumb.png.895212c6a905669c0f407eada90288d1.png

 

Você tem o código disponível? Se tiver publique-o aqui: 

 

Citar

local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)
end

function onCreatureAppear(creature)
end

function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('???')
focus = 0
talk_start = 0
end
end

function onCreatureTurn(creature)
end

function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end

function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Olá! Se voce está pronto, diga "reborn".')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Desculpe, ' .. getCreatureName(cid) .. '! Hey!.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'reborn') and getPlayerStorageValue(cid,30023) == 4 then
selfSay('Desculpe, mas voce já é rebornado.')
focus = 0
talk_start = 0
elseif msgcontains(msg, 'reborn') and (getPlayerLevel(cid) < 200 and getPlayerStorageValue(cid,30023) ~= 4) or (getPlayerLevel(cid) > 600 and getPlayerStorageValue(cid,30023) ~= 4) then
selfSay('Apenas level 200 até 600 podem rebornar.')
focus = 0
talk_start = 0
elseif msgcontains(msg, 'reborn') then
selfSay('Realmente quer isto?')
talk_state = 2
--_GOKU_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 8 then
doReborn(cid,1,872,9)
talk_state = 0

--_VEGETA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 23 then
doReborn(cid,1,880,24)
talk_state = 0

--_PICCOLO_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 36 then
doReborn(cid,1,42,37)
talk_state = 0

--_C17_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 49 then
doReborn(cid,1,50,50)
talk_state = 0

--_GOHAN_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 63 then
doReborn(cid,1,62,64)
talk_state = 0

--_TRUNKS_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 77 then
doReborn(cid,1,74,78)
talk_state = 0

--_CELL_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 87 then
doReborn(cid,1,81,88)
talk_state = 0

--_FREEZA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 101 then
doReborn(cid,1,88,102)
talk_state = 0

--_MAJIN BOO_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 117 then
doReborn(cid,1,98,118)
talk_state = 0

--_BROLY_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 131 then
doReborn(cid,1,113,132)
talk_state = 0

--_C18_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 144 then
doReborn(cid,1,50,145)
talk_state = 0

--_UUB_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 156 then
doReborn(cid,1,128,157)
talk_state = 0

--_GOTEN_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 170 then
doReborn(cid,1,142,171)
talk_state = 0

--_CHIBI TRUNKS_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 184 then
doReborn(cid,1,151,185)
talk_state = 0

--_COOLER_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 197 then
doReborn(cid,1,153,198)
talk_state = 0

--_DENDE_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 210 then
doReborn(cid,1,169,211)
talk_state = 0

--_TSUFUL_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 222 then
doReborn(cid,1,180,223)
talk_state = 0

--_BARDOCK_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 235 then
doReborn(cid,1,194,236)
talk_state = 0

--_KURIRIN_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 248 then
doReborn(cid,1,205,249)
talk_state = 0

--_PAN_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 260 then
doReborn(cid,1,212,261)
talk_state = 0

--_KAIO_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 272 then
doReborn(cid,1,221,273)
talk_state = 0

--_VIDEL_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 284 then
doReborn(cid,1,227,285)
talk_state = 0

--_JANEMBA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 296 then
doReborn(cid,1,234,297)
talk_state = 0

--_TENSHINHAN_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 308 then
doReborn(cid,1,246,309)
talk_state = 0

--_JENK_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 320 then
doReborn(cid,1,257,321)
talk_state = 0

--_RADITZ_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 332 then
doReborn(cid,1,265,333)
talk_state = 0

--_C16_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 344 then
doReborn(cid,1,277,345)
talk_state = 0

--_TURLES_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 356 then
doReborn(cid,1,285,357)
talk_state = 0

--_BULMA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 368 then
doReborn(cid,1,296,369)
talk_state = 0

--_SHENRON_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 380 then
doReborn(cid,1,302,381)
talk_state = 0

--_VEGETTO_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 392 then
doReborn(cid,1,308,393)
talk_state = 0

--_TAPION_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 404 then
doReborn(cid,1,321,405)
talk_state = 0

--_KAME_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 417 then
doReborn(cid,1,335,418)
talk_state = 0

--_KING VEGETA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 429 then
doReborn(cid,1,347,430)
talk_state = 0

--_KAGOME_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 441 then
doReborn(cid,1,357,442)
talk_state = 0

--_ZAIKO_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 453 then
doReborn(cid,1,368,454)
talk_state = 0

--_LORD CHILLED_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 465 then
doReborn(cid,1,375,466)
talk_state = 0

--_C8_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 482 then
doReborn(cid,1,578,483)
talk_state = 0

--_JIREN_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 503 then
doReborn(cid,1,556,504)
talk_state = 0

--_BILLS_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 518 then
doReborn(cid,1,620,519)
talk_state = 0

--_GOKU JR_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 534 then
doReborn(cid,1,627,535)
talk_state = 0

--_BILLS FURIE_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 549 then
doReborn(cid,1,501,550)
talk_state = 0

--_TUPPER_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 564 then
doReborn(cid,1,642,565)
talk_state = 0

--_ZENNO SAMA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 579 then
doReborn(cid,1,651,580)
talk_state = 0

--_C13_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 594 then
doReborn(cid,1,660,595)
talk_state = 0

--_GIN_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 609 then
doReborn(cid,1,668,610)
talk_state = 0

--_BOTAMO_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 624 then
doReborn(cid,1,677,625)
talk_state = 0

--_FROST_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 639 then
doReborn(cid,1,713,640)
talk_state = 0

--_KITERA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 654 then
doReborn(cid,1,746,655)
talk_state = 0

--_KUSHI_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 669 then
doReborn(cid,1,755,670)
talk_state = 0

--_ALERQUINA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 684 then
doReborn(cid,1,692,685)
talk_state = 0

--_ MR SATAN_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 699 then
doReborn(cid,1,772,700)
talk_state = 0

--_ ZAMASU_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 714 then
doReborn(cid,1,807,715)
talk_state = 0

--_ KYABE_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 729 then
doReborn(cid,1,704,730)
talk_state = 0

--_ GOKU BLACK_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 744 then
doReborn(cid,1,723,745)
talk_state = 0

--_ HITTO_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 759 then
doReborn(cid,1,737,760)
talk_state = 0

--_ LIQUIR_--_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 774 then
doReborn(cid,1,764,775)
talk_state = 0

--_ VERMOUTH_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 789 then
doReborn(cid,1,784,790)
talk_state = 0

elseif msgcontains(msg, 'yes') and talk_state == 2 then
selfSay('Desculpe, ' .. getCreatureName(cid) .. '! Voce deve estar na ultima transformação.')


elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Adeus!')
focus = 0
talk_start = 0
end
end
end

function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 45 then
if focus > 0 then
selfSay('Próximo por favor...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Adeus!')
focus = 0
end
end
end

 

Editado por Maahzeera (veja o histórico de edições)

Resolvido por FeeTads

Ir para solução
Postado
  • Solução
1 hora atrás, Maahzeera disse:

Grato a quem puder ajudar.

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())

 

Postado
  • Autor
16 horas atrás, FeeTads disse:

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())

 

Deu certo, muito obrigado !

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo