Npc Oracle

XPaulo
Por XPaulo
em NPCs, monsters e raids

XPaulo

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 10/02/07Posts: 129

Proucurei pelo Forum e não encontrei nenhum npc 7.92,

 

por isso fiz o tutorial, tentei deixar bem parecido com o do global,

 

dê sua nota(5 a 10), leve em consideração que e meu primeiro.

 

Crie um arquivo com nome de oracle.lua e coloque isso dentro dele:

data/npc/scripts/oracle.lua

 

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('Good bye then.')

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)

pos = {x=100, y=100, z=7}

 

-- greeting phrase

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

selfSay('Hello, young adventurer! Are you ready to face your destiny?')

focus = cid

talk_start = os.clock()

 

elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then

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

 

elseif focus == cid then

talk_start = os.clock()

 

 

 

 

if msgcontains(msg, 'yes') and talk_state ~= 458 then

if getPlayerLevel(cid) >= 8 then

selfSay('Great! What would you like to be? A sorcerer, a druid, a paladin or a knight?')

talk_state = 459

else

selfSay('Sorry, you need level 8 to leave rookgaard.')

talk_state = 0

end

 

elseif msgcontains(msg, 'no') then

selfSay('Come back when you are ready then.')

talk_state = 0

 

elseif talk_state == 459 then

vocationid = 0

talk_state = 458

 

if msgcontains(msg, 'sorcerer') then

selfSay('A mighty sorcerer! Are you sure?')

vocationid = 1

 

elseif msgcontains(msg, 'knight') then

selfSay('A valorous knight! Are you sure?')

vocationid = 4

 

elseif msgcontains(msg, 'paladin') then

selfSay('A nimble paladin! Are you sure?')

vocationid = 3

 

elseif msgcontains(msg, 'druid') then

selfSay('A mysterious druid! Are you sure?')

vocationid = 2

 

else

selfSay('Sorry, I can\'t understand that. Please type your vocation again.')

talk_state = 459

end

 

 

 

elseif talk_state == 458 then

if msgcontains(msg, 'yes') then

selfSay('Great! Where would you like to go? I can take you to NOME DA CIDADE.')

talk_state = 452

else

selfSay('What vocation do you want then?')

talk_state = 459

end

 

elseif talk_state == 452 then

if msgcontains(msg, 'now') then

doPlayerSetVocation(cid,vocationid)

doPlayerSetMasterPos(cid,pos)

selfSay('/send '.. creatureGetName(cid) ..', 100 100 7') - Troque para sua codernadas

end

end

talk_state = 0

talk_start = 0

 

 

 

elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then

selfSay('Good bye, ' .. creatureGetName(cid) .. '!')

focus = 0

talk_start = 0

end

end

end

 

 

function onCreatureChangeOutfit(creature)

 

end

 

 

function onThink()

 

if (os.clock() - talk_start) > 30 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

 

 

 

Va em creatures.xml e adicione isso:

 

<creature look type="138" name="The Oracle" head="78" body="119" legs="119" feet="76" type="npc"/>

 

 

Va em data/npc e faça um novo .xml e coloque isso:

 

<?xml version="1.0"?>

<npc name="The Oracle" script="data/npc/scripts/oracle.lua" access="3">

<look type="138" head="78" body="119" legs="119" feet="76" />

</npc>

 

 

OBS:Para adicionar mas cidades basta duplica a que ja tem ai.

 

 

Lembrando sempre torque as coordenadas para que se adapte ao seu mapa.

 

Se encontrarem algum erro mim notifique que eu editarei.

 

 

Creditos: By Paulo.

 

 

 

Att

(¯`·._.·[ Regras ]·._.·´¯)
(¯`·._.·[ Lista de Servidores ]·._.·´¯)
(¯`·._.·[ Notícias ]·._.·´¯)
(¯`·._.·[Recomende o XTibia]·._.·´¯)

NetBSD

Powered By FreeBSD
avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 15/01/07Posts: 139

o tuto tá até bom por ser seu primeiro^^mas isso aqui não existe em 7.8x pra cima

Va no spawn dos npc e coloque isso:

 

QUOTE

<spawn centerx="196" centery="216" centerz="6" radius="5">

<npc name="The Oracle" x="-1" y="0"/>

</spawn>

Nas versões 7.8x pra cima você adiciona os npcs pelo map editor ¬¬ corrija isso^^ Nota: 5

 

 

//Sasky

"The Power To Serve"

 

freebsd-logo1.png

Gui Pontes Luiz

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 06/01/07Posts: 15

Até que ficou bom, se eu pudesse dar uma nota maior.....

mas irei dar nota 6 pra vc =D

olha que estou sendo generoso =P

 

Atenciosamente: Guilherme

Ae ot rox rpg gostoso.serevegame.com 7.81

Tyler

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 03/02/07Posts: 80

O Tutorial foi bom , da para aprender a editar e cria 1 novo oracule .. Nota 8,0 !^^



é meu fan ? te ajudei ? foi totalmente com a minha cara ? ta aew a fan bar ^^!



Fan de




UhUl LePaRkOuR

Lordfire

TFS Maintainer
avatar
Lenda
Lenda

INFOS

Grupo: LendaRegistrado: 04/10/06Posts: 2605Gênero: MasculinoChar no Tibia: Knight Orion

nota 3

pelos dioversops erros que encontrei

1º que se add npcs pelo map editor né

2º explica como se deve fazer uma nova cidade

3º seu script está errado

Bl4Nk

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 11/02/07Posts: 126

Bom, achei o tutorial mto bom,

dou nota 8,0.

Giftfodadomalvadao


.Gifts:
[*] [*] [*] [*] [*] [*] [*] [*] [*] [*] [*]

.FanBar:



GOD Zé

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 03/12/06Posts: 255

@Sasky Òtimo Você Dar Sua Opinião :) ^^ bom os kra compartilhar idéias corrigir bugs :D

mas tah bom flws ótimo tópico

QUOTE
Aí GaLeRa CoM Um BrAçO Só ( _o/ _o/ _o/ ) AgOrAaa cOm O OuTrO ( \o_ \o_ \o_ ) AgOraaa COm Os DoiS ( \o/ \o/ \o/ ) VaMo Lá!! MãO Na CaBeÇa ( <o> <o> <o> ) PrA CimA (|o| |o| |o|) AGorA NenhUm DoS doiS ( _o_ _o_ _o_ ) IsSo... aGoRa QuErU VeR GeRaL PrUm LaDo ( o/ o/ o/ ) GeRaL PrO OuTrO ( \o \o \o ) BaTeNu PaLmInHa ( /o\ \o/ /o\ ) AgOrA AnImAe!¡!¡!

Universal Storm Ats União :-)

~*~~*~
Use minha fan bar
~*~~*~

Jvchequer

"Veni, vidi, vici."
avatar
Lenda
Lenda

INFOS

Grupo: LendaRegistrado: 10/10/05Posts: 2161Char no Tibia: Master Chequer

Isto, é 1 script, portanto movido para a seção correta.

 

Cya

1271330714-U1306.gif

 

~ Fiz parte da Equipe Xtibia em um tempo que Tibia era minha família. Saudades de todos vocês.

Dekooo

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 21/05/07Posts: 377Char no Tibia: Sirke Amere *( AsTeRa )*

esse oracle ae pra ot q tem tpw rook?

resposta plx

assinatura bugada, vide sobre mim

Rato_375

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 15/07/07Posts: 23

Cara vc poderia por ele em 8.0

coyotestark

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 15/02/11Posts: 259Char no Tibia: Aias Laf Du

eu usei este oracle no wodbo by jao. imagino que seja um 8.50 ou 53. nao sei ao certo. e da um erro.

blablabla.lua: 122

"eof" expected near "end"

385417_122391137880813_100003297811828_101325_1909172176_n.jpg

Nao sou Gigante mas grande o suficiente para entender tudo a minha volta.