Npc Q Testa Voce

R@U£
Por R@U£
em NPCs, monsters e raids

R@U£

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/12/05Posts: 51Char no Tibia: Falcler Knight

awe esse npc e o npc de test muito rox manow

primeiro va em npc/scripts e fas um assim

focus = 0

contador = 0

talk_start = 0

target = 0

following = false

attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)

end

function onCreatureAppear(creature)

end

function onCreatureDisappear(id, stackpos)

if id == focus then

focus = 0

contador = 0

selfSay("Ate breve.")

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 ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 3 then

selfSay('HeheheHaHaHae ' .. creatureGetName(cid) .. ' Quer testar suas abilidades! Se vc quiser fale ok?')

contador = 1

focus = cid

talk_start = os.clock()

end

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

selfSay('Só tem lugar pra um ' .. creatureGetName(cid) .. '.')

end

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

jogar = getPlayerStorageValue(cid,3333)

if jogar == 1 then

selfSay('Podemos começar?')

contador = 5

setPlayerStorageValue(cid,3333,1)

end

if jogar == -1 then

selfSay('Desculpe, voce ja participou.')

end

end

if msgcontains(msg, 'sim') and focus == cid and contador == 5 then

selfSay('Vamos lá! Primeira Pergunta: Qual é o bixo mais forte? 1-demon, 2-snake, 3-monk, 4-worms')

contador = 2

talk_start = os.clock()

end

if string.find(msg, '(%a*)worms(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 2 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)monk(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 2 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)snake(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 2 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if msgcontains(msg, 'sim') and focus == cid and contador == 1 then

talk_start = os.clock()

queststatus = getPlayerStorageValue(cid,2563)

if queststatus == -1 then

selfSay('Vamos para a primeira pergunta, esta pronto?')

contador = 3

else

selfSay('Voce ja perdeu...')

end

end

if msgcontains(msg, 'demon') and focus == cid and contador == 2 then

selfSay('Certa a Resposta! Podemos continuar?')

contador = 6

talk_start = os.clock()

end

if msgcontains(msg, 'sim') and focus == cid and contador == 6 then

selfSay('Vamos lá! Segunda Pergunta: com q se pesca? 1-worms, 2-laranja, 3-pedra, 4-mato.')

contador = 7

talk_start = os.clock()

end

if string.find(msg, '(%a*)laranja(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 7 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)mato(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 7 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)pedra(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 7 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if msgcontains(msg, 'worms') and focus == cid and contador == 7 then

selfSay('Certa a Resposta! Podemos continuar?')

contador = 8

talk_start = os.clock()

end

if msgcontains(msg, 'sim') and focus == cid and contador == 8 then

selfSay('Vamos lá! Terceira Pergunta: qual a cidade mais chata de jodar? 1-carlin, 2-thais, 3-Edron, 4-darashia.')

contador = 9

talk_start = os.clock()

end

if string.find(msg, '(%a*)darashia(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 9 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)edron(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 9 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)thais(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 9 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if msgcontains(msg, 'carlin') and focus == cid and contador == 9 then

selfSay('Certa a Resposta! Podemos continuar?')

contador = 10

talk_start = os.clock()

end

if msgcontains(msg, 'sim') and focus == cid and contador == 10 then

selfSay('Vamos lá! Quarta Pergunta: qual e o estado do brasil? 1-brasilia, 2-sao paulo, 3-itobi, 4-vgs.')

contador = 11

talk_start = os.clock()

end

if string.find(msg, '(%a*)vgs(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)sao paulo(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)itobi(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if msgcontains(msg, 'brasilia') and focus == cid and contador == 11 then

selfSay('Certa a Resposta! Podemos continuar?')

contador = 12

talk_start = os.clock()

end

if msgcontains(msg, 'sim') and focus == cid and contador == 12 then

selfSay('Vamos lá! Última Pergunta!!! qual é o bixo q vc tem mais medo de morre? 1-Orshabaal, 2-ciclop, 3-worms, 4-troll.')

contador = 11

talk_start = os.clock()

end

if string.find(msg, '(%a*)troll(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)ciclop(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)worms(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if msgcontains(msg, 'orshabaal') and focus == cid and contador == 11 and getDistanceToCreature(cid) < 3 then

selfSay('Certa a Resposta!!!!! Voce ganhou seu premio!')

selfSay('Let\'s go!')

    selfSay('/send ' .. creatureGetName(cid) .. ', 275 86 4')end

if msgcontains(msg, 'nao') or msgcontains(msg, 'não') and focus == cid and getDistanceToCreature(cid) < 3 then

selfSay('OK, mas perdeu uma grande chance!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 then

selfSay('Adeus, Boa Sorte. HahahaHeheHAhae')

focus = 0

talk_start = 0

end

end

function onCreatureChangeOutfit(creature)

end

function onThink()

if (os.clock() - talk_start) > 40 then

if focus > 0 then

selfSay('Quem qr testar suas abilidades!?')

end

focus = 0

end

--nothing special has happened

--but perhaps we want to walk around a bit?

if focus == 0 then

cx, cy, cz = selfGetPosition()

randmove = math.random(1,50)

if randmove == 1 then

nx = cx + 1

end

if randmove == 2 then

nx = cx - 1

end

if randmove == 3 then

ny = cy + 1

end

if randmove == 4 then

ny = cy - 1

end

if randmove >= 5 then

nx = cx

ny = cy

end

moveToPosition(nx, ny, cz)

--summons = 30

--summons2 = 30

end

end

dpois de ter feito isso va em word/npc e coloke

<npc name="Test" x="145" y="51" z="7" dir="0"/>

Creditos By R@U£

Quarquer duvida ou erro poste

ai vlwsssss

flwsssssss

Ablank

.-.
avatar
Campones
Campones

INFOS

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

Npc rox so não entendi uma coisa...

quando o player é teleportado ele mesmo sumona os orsha??? ou tem q pro no map editor?

//Yours Ablankzin

Att.

Ablankzin

R@U£

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/12/05Posts: 51Char no Tibia: Falcler Knight

dpende do seu mapa

manow

thebard

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 03/07/06Posts: 11

gostei mano

vo adicionar no meu ot

Angel Of Ilusions

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 11/12/05Posts: 108

aew cara..

não entendi direito o que o NPC faz não cara..

você poderia explicar melhor..

ficar lendo os códigos pra entender o tópico fica ruim :confused:

mas depois de ler os códigos já entendi melhor =P

só isso..explica melhor no inicio do tópico cara =]~

vlws

flws ae

fuiz!!

mmansur

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 14/10/05Posts: 1

Eu tenho um ot 7.8, mas queria saber, como que coloco ou tiro npcs do mapa... Não tem o arquivo npc na pasta world.

newcahr

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 09/07/06Posts: 23

muito bom esse npc pra zuar com players

auhhaus

vlws aí

sem mais,

Atenciosamente

Newcahr

LadyeGata

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 29/08/06Posts: 18

Roxxx

Kenzo

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 08/10/06Posts: 131Char no Tibia: Kenzo Phoenix

if msgcontains(msg, 'sim') and focus == cid and contador == 10 then

selfSay('Vamos lá! Quarta Pergunta: qual e o estado do brasil? 1-brasilia, 2-sao paulo, 3-itobi, 4-vgs.')

contador = 11

talk_start = os.clock()

end

if string.find(msg, '(%a*)vgs(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)sao paulo(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)itobi(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if msgcontains(msg, 'brasilia') and focus == cid and contador == 11 then

selfSay('Certa a Resposta! Podemos continuar?')

contador = 12

talk_start = os.clock()

end

VOCÊ NUNCA ESTUDO GEOGRFIA??

BRASILIA NON É ESTADO --'

É UM DISTRITO OU SEJA A RESPOSTA SCERTA É SÃO PAULO

Tirando isto VeryGood. Mais acho qe tem um aprecido no [Retirado] u.u

//Kenzo

Visite a melhor parte do Fórum XTibia! Basta você apenas clicar aqui e deixar sua opinião sobre qualquer um dos assuntos!

Está com dúvidas no Tibia? Quer dicas de como melhorar seu character? Mande uma PM e lhe responderei a medida do possível.

"Tonight
I'm gonna have myself a real good time
I feel alive
And the world is turning inside out
Yeah!
And floating around in ecstasy

So don't stop me now
Don't stop me
'Cause I'm having a good time
I'm having a good time

I'm a shooting star leaping through the sky
Like a tiger defying the laws of gravity
I'm a racing car passing by like Lady Godiva
I'm gonna go go go
There's no stopping me...
"

Dont Stop me Now - McFly

moskitinho

Weiter lieben
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 31/05/06Posts: 1074Gênero: Masculino

Heheheh Muito Massa Quando Eu Consegui Desbugar Meu Mapa Global eu Vo Coloca Esse NPC Muito Rox , Mas Vc Devia expliar oq Ele Faz pq Fica Lendo a script N é Muito Legal =P

Angelina_Me_by_msklotz.png

 

moskitinho © 2006


 

Rocksody

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 23/09/06Posts: 66

desculpe nao aprovo: codigos errados, respostas de questoes erradas e pessimo tuto. logo mais editarei mostrando os erros e explicando como por o npc no seu ots

Retired de tibia nao do xtibia...
Jogando Hero Online,
abco!

Greh

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 10/06/06Posts: 87

Olá

Tambem não gostei

Umas perguntas nada a ve, e respondendo a de alguns usuários acima,

O npc te pergunta as coisas e tals, quando vc chega na ultima pergunta e diz orshabal ele te teletransporta pra um lugar e que no caso o objetivo seria de ter um orshabaal pra vc morrer...

//Greh

Felipe Moraes

Java Developer
avatar
Grão-Duque
Grão-Duque

INFOS

Grupo: Grão-DuqueRegistrado: 02/10/06Posts: 3285Gênero: Masculino

Ta maneiro

SO q algumas respostas estao erradas

E se o kra chegou ate a ultima pergunta é pq o kra é burro pq respondeu tudo errado

Se ele for esperto nao morre (quase nao existe inteligentes)

Se ele for burro morre (a maioria é burra msm)

Bricandeira so pra tirar esse clima pesado daki

Mas o tuto esta bom parabens

FLW

~A nossa maior glória não reside no fato de nunca cairmos, mas sim em levantarmo-nos sempre depois de cada queda.~

 

 

 

 

Clique aqui para ver meus tutoriais !

 

 

 

Gamertag: cpmoraes

 

 

_Alef_

avatar
Banidos
Banidos

INFOS

Grupo: BanidosRegistrado: 07/10/06Posts: 156

sux, error deportugues, perguntas idiotas, sei q pode melhora.

~~Flws

Usuário BANIDO
Conduta destrutiva. Ofensa a membros do XTibia.

RiCk.xD

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 17/10/06Posts: 61

zuadinho nao gostei bah =/

//RiCk.xD