AL

Fazendo Npc Oracle

Por aleuba, 16 de jul. de 2008 em NPCs, monsters e raids

script
10
4k
aleubaA
16 de julho de 2008 às 18:41

e ai galera:) vo ensinar a fazer um Npc Teleport:)

 

1.Primeiro,abra a pasta de seu ot,vá em data>npc,e copie qualquer arkivo e cole na mesma pasta.

 

 

2.Neste arkivo ke foi colado,renomeie ele para The Oracle apague tudo ki tem dentro i substitua por :

<?xml version="1.0"?>

<npc name="The Oracle" script="data/npc/scripts/oracle.lua" access="1" monster="1" speed="50" lookdir="2" pushable="0" level="100">

<health now="150" max="150"/>

<look type="2010" head="57" body="59" legs="40" feet="76"/>

</npc>

 

3.Depois,va em scripts e copie e cole novamente um arkivo, e renomeie-o para oracle.A seguir, abra-o e apague tudo que esta ali dentro e substitua por:

 

 

focus = 0

talk_start = 0

target = 0

following = false

attacking = false

talk_state = 0

cname = ''

vocation = 0

mainlevel = 8

 

function onThingMove(creature, thing, oldpos, oldstackpos)

 

end

 

 

function onCreatureAppear(creature)

 

end

 

 

function onCreatureDisappear(cid, pos)

if focus == cid then

selfSay('Tchau.')

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)

cname = creatureGetName(cid)

msg = string.lower(msg)

 

if ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Ola ' .. cname .. '! Voce esta preparado para encarar o seu destino?')

talk_state = 0

focus = cid

talk_start = os.clock()

 

elseif string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then

selfSay('Sorry, ' .. cname .. '! I talk to you in a minute.')

 

elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 4 then

selfSay('Tchau, ' .. cname .. '!')

talk_state = 0

focus = 0

talk_start = 0 elseif focus == cid then

talk_start = os.clock() if talk_state == 0 then

if msgcontains(msg, 'sim') then -- confirmando decisao

level = getPlayerLevel(cname)

 

if level >= mainlevel then

selfSay('Otimo! O que voce quer ser? Um knight, um paladin, um sorcerer ou um druid?')

talk_state = 1

else

selfSay('Lamento, voce precisa de level ' .. mainlevel .. ' para ir para mainland.')

talk_state = 0

end

else

selfSay('Entao volte quando estiver preparado.')

talk_state = 0

end

 

elseif talk_state == 1 then -- telling vocation

talk_state = 2

 

if msgcontains(msg, 'sorcerer') then

selfSay('Um mistico sorcerer! Tem certeza?')

vocation = 1

elseif msgcontains(msg, 'druid') then

selfSay('Um misterioso druid! Tem certeza?')

vocation = 2

elseif msgcontains(msg, 'paladin') then

selfSay('Um certeiro paladin! Tem certeza?')

vocation = 3

elseif msgcontains(msg, 'knight') then

selfSay('Um incrivel knight! Tem certeza?')

vocation = 4

else

selfSay('Sorry, there is no such vocation.')

vocation = 0

talk_state = 1

end

 

elseif talk_state == 2 then -- confirmando voc

if msgcontains(msg, 'sim') then

selfSay('Otimo! Posso te mandar pra City. Para onde voce quer ir?')

talk_state = 3

else

selfSay('Que vocacao voce quer entao?')

talk_state = 1

end

 

elseif talk_state == 3 then -- telling city name

if msgcontains(msg, 'city') then

selfSay('Boa sorte, jovem aventureiro!')

setPlayerVocation(cid,vocation)

setPlayerMasterPos(cid,160,54,7)

selfSay('/send ' .. cname .. ', 160 54 7')

 

talk_state = 0

focus = 0

talk_start = 0

else

selfSay('Desculpe, nao existe essa cidade.')

talk_state = 3

end

end

end

end

 

 

function onCreatureChangeOutfit(creature)

 

end

 

 

function onThink()

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) > 5 then

selfSay('Good bye then.')

focus = 0

end

end

end

 

VERMELHO-lugar para onde o player sera transportado.

 

 

Creditos : 99% Hellnoob - por fazer

1% Eu - por corrigir, e postar denovo

 

Espero que ajude !

haiguriH
16 de julho de 2008 às 20:08

aff eu sou o hellnoob mas agora uso esse "haiguri"

então ponha créditos haiguri

PedretzP
17 de julho de 2008 às 16:20

Q legal!!!!Agora estou pensando se seria bom implementar rook...

MimowM
17 de julho de 2008 às 20:06

Comigo nunk da certo!

drax skylonD
17 de julho de 2008 às 20:27

esqueceu de falar que esse NPC é para OTs em versão XML e comigo nunca funciona também xP

 

Quero ver o The Oracle para versão SQLite (The Forgotten Server)

 

Abraços,

Drax//

RedZLR
17 de julho de 2008 às 23:27

Não vi quase nenhuma diferença deste tutorial para o anterior postado. A formatação continua ruim, além da ortografia ("...arkivo ke...").

Aguardo mudança.

aleubaA
18 de julho de 2008 às 00:43

outfit ta errado, alguem sabe u certo ? versao 8.10

2 semanas depois...
JvchequerJ
27 de julho de 2008 às 15:30

Olá Xtibiano,

 

Parabéns, o tópico está ótimo.

 

Mais está na seção errada.

 

 

Tópico Movido. :forward:

 

 

Atenciosamente,



JV Chequer *Sub-Administrador do Fórum Xtibia.com*

1 mês depois...
leoloko12L
14 de agosto de 2008 às 17:02

Boa kra muita boa ideia

 

Xd

abrass

5 meses depois...
lockypallyL
06 de janeiro de 2009 às 14:26

AFF !!! Que raiva eu ja tentei mais de 15 tutos de oracle !!! nenhum da certo !!! esse tudo bem.. o npc ta la bunitinho aih vc chega:

vc *LVL 8*:hi

npc: olha "name" ! vc esta pronto para o desfio??

vc *LVL 8 *: sim !!

npc: desculpe vc n tem lvl suficiente para ir para main !!!! sera que alguem pode me ajudar ??????

 

 

 

vlw...