Ir para conteúdo
Entre para seguir isso  
Convidado sepito

Npc que so fala com premmy e Andam sem complicacao 7.81+

Recommended Posts

Convidado sepito   
Convidado sepito

Aew galera eu sei que tem otros topicos que ensinam como fazer npc andar... mas desse jeito que eu vou ensinar eh mais facil.

Eu nunk vi nenhum tutorial q ensinava igual vou ensinar. Lembrando que eh somente para 7.81 esse tutorial

 

Vou pegar um npc de Aol que eh Muito Muito simples mesmo...

 

focus = 0

talk_start = 0

target = 0

following = false

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)

 

  if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then

   selfSay('Hello ' .. creatureGetName(cid) .. '! I sell scarfs (1k) and aols (40k).')

   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, 'aol') then

  buy(cid,2173,1,40000)

 elseif msgcontains(msg, 'scarf') then

  buy(cid,2661,1,1000)

 

 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 focus > 0 then  

x, y, z = creatureGetPosition(focus)

myx, myy, myz = selfGetPosition()

if ((myy-y==0) and (myx-x<=0 and myx-x>=-4)) then

      selfTurn(0)

end  

if ((myy-y==0) and (myx-x>=0 and myx-x<=4)) then

      selfTurn(2)

end

      if ((myx-x==0) and (myy-y<=0 and myy-y>=-4)) then

      selfTurn(1)

end

if ((myx-x==0) and (myy-y>=0 and myy-y<=4)) then

      selfTurn(3)

end

if ((myy-y==-2) and (myx-x>=-1 and myx-x<=1)) then

      selfTurn(1)

end

if ((myy-y==2) and (myx-x>=-1 and myx-x<=1)) then

       selfTurn(3)

end

if ((myx-x==2) and (myy-y>=-1 and myy-y<=1)) then

       selfTurn(2)

end

if ((myx-x==-2) and (myy-y>=-1 and myy-y<=1)) then

       selfTurn(0)

end

if ((myy-y==-3) and (myx-x>=-2 and myx-x<=2)) then

       selfTurn(1)

end

if ((myy-y==3) and (myx-x>=-2 and myx-x<=2)) then

       selfTurn(3)

end

if ((myx-x==3) and (myy-y>=-2 and myy-y<=2)) then

       selfTurn(2)

end

if ((myx-x==-3) and (myy-y>=-2 and myy-y<=2)) then

       selfTurn(0)

end

if ((myy-y==-4) and (myx-x>=-3 and myx-x<=3)) then

       selfTurn(1)

end

if ((myy-y==4) and (myx-x>=-3 and myx-x<=3)) then

       selfTurn(3)

end

if ((myx-x==4) and (myy-y>=-3 and myy-y<=3)) then

       selfTurn(2)

end

if ((myx-x==-4) and (myy-y>=-3 and myy-y<=3)) then

       selfTurn(0)

end

end

 

  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

Ate ai tudo bem... ai agora vcs vao procurar a funcao Onthink usem ctrl+f para axar, ela esta exatamente assim

function onThink()

 

 

agora voces vao copiar e colar logo em baixo da linha do function onThink() o seguinte

 

if focus == 0 then

selfWalk(4)

end

 

e depois que voce colar isso essa parte ficara mais ou menos assim

 

function onThink()

if focus == 0 then  

selfWalk(4)  

end

e no final seu script acabara ficando assim

 

focus = 0

talk_start = 0

target = 0

following = false

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)

 

  if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then

   selfSay('Hello ' .. creatureGetName(cid) .. '! I sell scarfs (1k) and aols (40k).')

   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, 'aol') then

  buy(cid,2173,1,40000)

 elseif msgcontains(msg, 'scarf') then

  buy(cid,2661,1,1000)

 

 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 focus == 0 then  

selfWalk(4)  

end

 

if focus > 0 then  

x, y, z = creatureGetPosition(focus)

myx, myy, myz = selfGetPosition()

if ((myy-y==0) and (myx-x<=0 and myx-x>=-4)) then

      selfTurn(0)

end  

if ((myy-y==0) and (myx-x>=0 and myx-x<=4)) then

      selfTurn(2)

end

      if ((myx-x==0) and (myy-y<=0 and myy-y>=-4)) then

      selfTurn(1)

end

if ((myx-x==0) and (myy-y>=0 and myy-y<=4)) then

      selfTurn(3)

end

if ((myy-y==-2) and (myx-x>=-1 and myx-x<=1)) then

      selfTurn(1)

end

if ((myy-y==2) and (myx-x>=-1 and myx-x<=1)) then

       selfTurn(3)

end

if ((myx-x==2) and (myy-y>=-1 and myy-y<=1)) then

       selfTurn(2)

end

if ((myx-x==-2) and (myy-y>=-1 and myy-y<=1)) then

       selfTurn(0)

end

if ((myy-y==-3) and (myx-x>=-2 and myx-x<=2)) then

       selfTurn(1)

end

if ((myy-y==3) and (myx-x>=-2 and myx-x<=2)) then

       selfTurn(3)

end

if ((myx-x==3) and (myy-y>=-2 and myy-y<=2)) then

       selfTurn(2)

end

if ((myx-x==-3) and (myy-y>=-2 and myy-y<=2)) then

       selfTurn(0)

end

if ((myy-y==-4) and (myx-x>=-3 and myx-x<=3)) then

       selfTurn(1)

end

if ((myy-y==4) and (myx-x>=-3 and myx-x<=3)) then

       selfTurn(3)

end

if ((myx-x==4) and (myy-y>=-3 and myy-y<=3)) then

       selfTurn(2)

end

if ((myx-x==-4) and (myy-y>=-3 and myy-y<=3)) then

       selfTurn(0)

end

end

 

  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

 

Creditos para mim que fiz esse tutorial e que ao longo do tempo descobri esse novo jeito de fazer o npc andar! So testei no evolutions 0.6.3 e no Drakonia

 

Agora eu vou ensinar como fazer um npc falar Somente com premmy account's... esse tutorial eu nunca vi aqui no forum.

Eh o seguinte vou fazer com o npc de Aol denovo pq ele eh muito simples.

Voce pega um npc de aol e ele vai estar mais ou menos assim

 

focus = 0

talk_start = 0

target = 0

following = false

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)

 

  if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then

   selfSay('Hello ' .. creatureGetName(cid) .. '! I sell scarfs (1k) and aols (40k).')

   focus = cid

   talk_start = os.clock()

 

  elseif focus == cid then

 talk_start = os.clock()

 

 if msgcontains(msg, 'aol') then

  buy(cid,2173,1,40000)

 elseif msgcontains(msg, 'scarf') then

  buy(cid,2661,1,1000)

 

 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 focus == 0 then  

selfWalk(4)  

end

 

if focus > 0 then  

x, y, z = creatureGetPosition(focus)

myx, myy, myz = selfGetPosition()

if ((myy-y==0) and (myx-x<=0 and myx-x>=-4)) then

      selfTurn(0)

end  

if ((myy-y==0) and (myx-x>=0 and myx-x<=4)) then

      selfTurn(2)

end

      if ((myx-x==0) and (myy-y<=0 and myy-y>=-4)) then

      selfTurn(1)

end

if ((myx-x==0) and (myy-y>=0 and myy-y<=4)) then

      selfTurn(3)

end

if ((myy-y==-2) and (myx-x>=-1 and myx-x<=1)) then

      selfTurn(1)

end

if ((myy-y==2) and (myx-x>=-1 and myx-x<=1)) then

       selfTurn(3)

end

if ((myx-x==2) and (myy-y>=-1 and myy-y<=1)) then

       selfTurn(2)

end

if ((myx-x==-2) and (myy-y>=-1 and myy-y<=1)) then

       selfTurn(0)

end

if ((myy-y==-3) and (myx-x>=-2 and myx-x<=2)) then

       selfTurn(1)

end

if ((myy-y==3) and (myx-x>=-2 and myx-x<=2)) then

       selfTurn(3)

end

if ((myx-x==3) and (myy-y>=-2 and myy-y<=2)) then

       selfTurn(2)

end

if ((myx-x==-3) and (myy-y>=-2 and myy-y<=2)) then

       selfTurn(0)

end

if ((myy-y==-4) and (myx-x>=-3 and myx-x<=3)) then

       selfTurn(1)

end

if ((myy-y==4) and (myx-x>=-3 and myx-x<=3)) then

       selfTurn(3)

end

if ((myx-x==4) and (myy-y>=-3 and myy-y<=3)) then

       selfTurn(2)

end

if ((myx-x==-4) and (myy-y>=-3 and myy-y<=3)) then

       selfTurn(0)

end

end

 

  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

 

 

Agora voces vao procurar essa parte aqui

 

   if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then

   selfSay('Hello ' .. creatureGetName(cid) .. '! I sell scarfs (1k) and aols (40k).')

   focus = cid

   talk_start = os.clock()

quando axarem essa parte voces vao colocar

 

if isPremium(cid) then

Bem embaixo de onde ta escrito

if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then

 

entao essa parte ira ficar mais ou menos assim

 

  if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then

 if isPremium(cid) then

   selfSay('Hello ' .. creatureGetName(cid) .. '! I sell scarfs (1k) and aols (40k).')

   focus = cid

   talk_start = os.clock()

agora ele so fala com premmy accounts, mais ainda falta um pekeno detalhe, voce tem q coloca logo em baixo do

talk_start = os.clock()

voces vao colocar isso daki

 

else

selfSay('Sai daki gentalha... So falo com Premmy accounts! .')

focus = 0

talk_start = 0

 

ficando assim esse script

 

 

  if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then

 if isPremium(cid) then

   selfSay('Hello ' .. creatureGetName(cid) .. '! I sell scarfs (1k) and aols (40k).')

   focus = cid

   talk_start = os.clock()

else

  selfSay('Sai daki gentalha... So falo com Premmy accounts! .')

  focus = 0

  talk_start = 0

end

 

 

 

Eh isso ai galera, kem gostou fala ai porque gostou e quem nao gostou fala ai tambem pq nao gostou =p

Compartilhar este post


Link para o post
Compartilhar em outros sites
Convidado sepito   
Convidado sepito

Comentem ai galera =p mo trabalhao descobrir isso tudo

Compartilhar este post


Link para o post
Compartilhar em outros sites
Convidado sepito   
Convidado sepito

ninguem ker comentar?

Compartilhar este post


Link para o post
Compartilhar em outros sites
Flatronez    1
Flatronez

ficou muito bom !!!!

 

Ja fiz varios npc pra premmy =D

Compartilhar este post


Link para o post
Compartilhar em outros sites
Convidado diogo   
Convidado diogo

haha nossa vlw! eu mi cadastrei aki soh pra axar esse tutorial!!!

tava procurando o tuto de npc andar mais nenhum otro funcionava

e o de premmy veio junto tb! mto bom

Compartilhar este post


Link para o post
Compartilhar em outros sites
Convidado MarioToledo   
Convidado MarioToledo

Bom tuto, mas não seria download de scripts ????

Compartilhar este post


Link para o post
Compartilhar em outros sites
Convidado sepito   
Convidado sepito

nao kra eu ensinei tudo direitinho como tem q fazer pro npc falar soh com premmy e pro npc andar

eu nao simplesmente xeguei e postei o script =p por isso nao tem q ser download =p

Compartilhar este post


Link para o post
Compartilhar em outros sites
Convidado sepito   
Convidado sepito

Comentem ai galera >.<

Compartilhar este post


Link para o post
Compartilhar em outros sites
CapitaoX    0
CapitaoX

@sepito

 

Use o botao editar, vc mandou msg seguidas e isso é flood -.-"

 

Mais cuidado em

 

@sepito

 

seção errada:

Vai para :Downloads de scripts

 

É isso

Compartilhar este post


Link para o post
Compartilhar em outros sites
Razor    1
Razor

Tutorial aprovado!

E sepito alertado verbalmente por flood!

 

esK~

Compartilhar este post


Link para o post
Compartilhar em outros sites
Delvire    0
Delvire

Nuss véi vlw, agora n preciso mais fika fazendo premmy areas em q vc tem q atravessa ponte pra chega nelas, vlw, mto util :D

Compartilhar este post


Link para o post
Compartilhar em outros sites
Delvire    0
Delvire

Nuss véi vlw, agora n preciso mais fika fazendo premmy areas em q vc tem q atravessa ponte pra chega nelas, vlw, mto util :D

Compartilhar este post


Link para o post
Compartilhar em outros sites
Convidado sepito   
Convidado sepito

opa... toh d volta a comunidade do otserv !!!

hehehe

kem kiser ajuda ai nos scripts soh falar q eu ajudo

Compartilhar este post


Link para o post
Compartilhar em outros sites
Convidado diogo   
Convidado diogo

funciona pra 7.92? pq eu fiz pra 7.81 e nao sei si funciona em 7.92

Compartilhar este post


Link para o post
Compartilhar em outros sites
Convidado sepito   
Convidado sepito

funciona pra 7.92 sim...

Compartilhar este post


Link para o post
Compartilhar em outros sites
Darkzuk    0
Darkzuk

Tuto ROX

APROVADO

Compartilhar este post


Link para o post
Compartilhar em outros sites
AlexXx    0
AlexXx

ROX

 

!

 

xD

 

achei completo

 

_________________________

 

gaara2.jpg

 

 

Sou Fan:

 

tibiaworldbarmi6.png

fgikofanm9d9bfeeup7.png

dhsx1.gif

 

 

 

Quero ser

 

burguesuw6.jpg

 

 

Meu time de coração

 

porcovv5.gif

Compartilhar este post


Link para o post
Compartilhar em outros sites
Convidado sepito   
Convidado sepito

vlw ai pelo reconhecimento =p

duvidas falem comigo

Compartilhar este post


Link para o post
Compartilhar em outros sites
toninho_xd    0
toninho_xd

sepito..

preciso da sua ajuda..

to fazendo algo errado aki mais num sei uq eh..

tp

eu puis us npc q eu qria pra fala cum premmy..ai qnd eu reiniciei u ot pra atualiza isso,u ot num abria i mostrava nu programinha q num abre u ot q u problema era na config.lua dus npc q eu tinha posto para falar com premmy...

tem como ajuda???

=D

Compartilhar este post


Link para o post
Compartilhar em outros sites
BoY SoT    0
BoY SoT

r0x mais o Tuto... de faze o npc anda serve soh pra 7.81 ? ou eh mesma coisa pra 8.0 ?

 

ty

Compartilhar este post


Link para o post
Compartilhar em outros sites

Faça login para comentar

Você vai ser capaz de deixar um comentário após fazer o login



Entrar Agora
Entre para seguir isso  

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×