Eai Galera do TK, tranquilo ? Hoje uma pessoa do TibiaKing me procurou pedindo ajuda com Account Manager no TIBIA DBO pelo motivo de não ter dinheiro para hospedar o site, porem no TIBIA DBO pelo que pesquisei ele não tem Account Manager e não dá pra criar por conta de algumas Sources que não tem, e realmente no OT DBO dele dava BUG ao tentar criar por Account Manager (Que eu mesmo criei por conta de não ter).
Mas vamos ao que Interessa. Acabei fazendo o NPC Yaman (do começo do jogo) de NPC de escolha de Vocação, e quero disponibilizar pra quem estiver com o mesmo problema e não tenha site.
1º Vai na pasta data/npc/scripts/ e abre a Script do NPC Yaman;
2º Copie o código abaixo e cole lá;
3º Salve, abra o jogo e desfrute.
OBS: O player sempre quando morre volta para o mesmo lugar, então coloquei uma validação de que se o Player já estiver com uma vocação ele apenas vai ser teleportado para a city.
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
local pos = {x=99, y=188, z=7}
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Hey!.')
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)
if getPlayerVocation(cid) == 0 then
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 5 then
selfSay('Olá, Escolha sua Vocacao: Goku, Vegeta, Piccolo, C17, Gohan, Trunks, Cell, Freeza, Majin Boo, Broly, C18, Uub, Goten, Chibi Trunks, Cooler, Dende, Tsuful, Bardock, Kuririn, Pan, Kaio, Videl, Janemba, Tenshinhan, Jenk, Raditz, C16, Turles, Bulma, Shenron.')
talk_start = 1
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 5 then
selfSay('Sorry, ' .. getCreatureName(cid) .. '! ????????.')
elseif focus == cid then
talk_start = os.clock()
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 5 then
selfSay('Good bye, ' .. getCreatureName(cid) .. '!')
focus = 0
talk_start = 0
elseif(msgcontains(msg, 'goku') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar um Goku ?')
talk_start = 2
idVocacao = 1
elseif(msgcontains(msg, 'vegeta') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Vegeta ?')
talk_start = 2
idVocacao = 17
elseif(msgcontains(msg, 'piccolo') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Piccolo ?')
talk_start = 2
idVocacao = 32
elseif(msgcontains(msg, 'c17') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar C17 ?')
talk_start = 2
idVocacao = 45
elseif(msgcontains(msg, 'gohan') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Gohan ?')
talk_start = 2
idVocacao = 57
elseif(msgcontains(msg, 'trunks') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Trunks ?')
talk_start = 2
idVocacao = 71
elseif(msgcontains(msg, 'cell') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Cell ?')
talk_start = 2
idVocacao = 83
elseif(msgcontains(msg, 'freeza') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Freeza ?')
talk_start = 2
idVocacao = 95
elseif(msgcontains(msg, 'majin boo') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Majin Boo ?')
talk_start = 2
idVocacao = 111
elseif(msgcontains(msg, 'broly') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Broly ?')
talk_start = 2
idVocacao = 127
elseif(msgcontains(msg, 'c18') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar C18 ?')
talk_start = 2
idVocacao = 140
elseif(msgcontains(msg, 'uub') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Uub ?')
talk_start = 2
idVocacao = 152
elseif(msgcontains(msg, 'goten') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Goten ?')
talk_start = 2
idVocacao = 164
elseif(msgcontains(msg, 'chibi trunks') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Chibi Trunks ?')
talk_start = 2
idVocacao = 178
elseif(msgcontains(msg, 'cooler') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Cooler ?')
talk_start = 2
idVocacao = 192
elseif(msgcontains(msg, 'dende') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Dende ?')
talk_start = 2
idVocacao = 206
elseif(msgcontains(msg, 'tsuful') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Tsuful ?')
talk_start = 2
idVocacao = 218
elseif(msgcontains(msg, 'bardock') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Bardock ?')
talk_start = 2
idVocacao = 230
elseif(msgcontains(msg, 'kuririn') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Kuririn ?')
talk_start = 2
idVocacao = 244
elseif(msgcontains(msg, 'pan') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Pan ?')
talk_start = 2
idVocacao = 256
elseif(msgcontains(msg, 'kaio') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Kaio ?')
talk_start = 2
idVocacao = 268
elseif(msgcontains(msg, 'videl') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Videl ?')
talk_start = 2
idVocacao = 280
elseif(msgcontains(msg, 'janemba') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Janemba ?')
talk_start = 2
idVocacao = 292
elseif(msgcontains(msg, 'tenshinhan') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Tenshinhan ?')
talk_start = 2
idVocacao = 304
elseif(msgcontains(msg, 'jenk') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Jenk ?')
talk_start = 2
idVocacao = 316
elseif(msgcontains(msg, 'raditz') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Raditz ?')
talk_start = 2
idVocacao = 328
elseif(msgcontains(msg, 'c16') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar C16 ?')
talk_start = 2
idVocacao = 340
elseif(msgcontains(msg, 'turles') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Turles ?')
talk_start = 2
idVocacao = 352
elseif(msgcontains(msg, 'bulma') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Bulma ?')
talk_start = 2
idVocacao = 364
elseif(msgcontains(msg, 'shenron') and talk_start == 1) then
selfSay('Voce Deseja Realmente se tornar Shenron ?')
talk_start = 2
idVocacao = 376
elseif(msgcontains(msg, 'yes') and talk_start == 2) then
doPlayerSetVocation(cid, idVocacao)
doTeleportThing(cid, pos)
talk_start = 0
end
else
doTeleportThing(cid, pos)
end
end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 45 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 6 then
selfSay('Good bye then.')
focus = 0
end
end
end