Guloso Forum
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Guloso Forum

~~> Tibia FanSite ~~> Um bocadinho de tudo! | ©Guloso | ~~

PeakBux
vcBux

Você não está conectado. Conecte-se ou registre-se

Criar Npc De Compra, explicadinhuuu!! =D

5 participantes

Ir para baixo  Mensagem [Página 1 de 1]

1Criar Npc De Compra, explicadinhuuu!! =D Empty Criar Npc De Compra, explicadinhuuu!! =D Qua maio 30, 2007 7:26 am

Guloso

Guloso
Administrador
Administrador

Primeiro va na pasta do seu ot e va em data/npc/scripts

Copie e cole o seller como bloco de notas na mesma pasta so mudar o nome se vc quiser que o nome seja Vendedor se poe vendedor...ai vai estar 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 ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello, ' .. creatureGetName(cid) .. '! I sell ropes (50gps), shovels (20gps), backpacks (10gps), manafluids (100gps), lifefluids (60gps) and fishing rods (100gps). I buy vials (10gps).')
focus = cid
talk_start = os.clock()

elseif string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

elseif msgcontains(msg, 'rope') and focus == cid then
buy(cid,2941,1,50)
talk_start = os.clock()

elseif msgcontains(msg, 'shovel') and focus == cid then
buy(cid,3395,1,20)
talk_start = os.clock()

elseif msgcontains(msg, 'backpack') and focus == cid then
buy(cid,2792,1,10)
talk_start = os.clock()

elseif msgcontains(msg, 'manafluid') or msgcontains(msg, 'mana fluid') and focus == cid then
buy(cid,2812,7,100)
talk_start = os.clock()

elseif msgcontains(msg, 'lifefluid') or msgcontains(msg, 'life fluid') and focus == cid then
buy(cid,2812,10,60)
talk_start = os.clock()

elseif msgcontains(msg, 'fishing rod') and focus == cid then
buy(cid,3421,1,100)
talk_start = os.clock()

elseif (msgcontains(msg, 'vial') or msgcontains(msg, 'flask')) and focus == cid then
sell(cid,2812,1,10)
talk_start = os.clock()

elseif string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
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

Agora faca assim:

elseif msgcontains(msg, 'rope') and focus == cid then
buy(cid,2941,1,50)
talk_start = os.clock()

Ai vc quer vende crown armor vc vai la em rope e muda por crown armor e aonde ta buy(cid,2941,1,50) vc poe o ID da crown armor

para funcionar procure a frase:

I sell ropes (50gps), shovels (20gps), backpacks (10gps), manafluids (100gps), lifefluids (60gps) and fishing rods (100gps). I buy vials (10gps).')

E mude por

I sell crown armor (10k), shovels (20gps), backpacks (10gps), manafluids (100gps), lifefluids (60gps) and fishing rods (100gps). I buy vials (10gps).')

E assim vai =D

ai se vai mudando todos

Para por ele no mapa vc vai em

World/npc.xml

Abra-o como bloco de notas

Vai estar por exemplo assim:

<?xml version="1.0"?>
<npclist>
<npc name="Seller" x="145" y="50" z="7" dir="3"/>
<npc name="Dark Rodo" x="129" y="50" z="6" dir="0"/>
<npc name="Mad" x="145" y="51" z="6" dir="3"/>
<npc name="Lector" x="127" y="49" z="7" dir="1"/>
<npc name="Perac" x="144" y="54" z="5" dir="0"/>
<npc name="Dufi" x="128" y="55" z="7" dir="1"/>
<npc name="Seller" x="208" y="80" z="7" dir="3"/>
<npc name="Dark Rodo" x="207" y="71" z="7" dir="2"/>
<npc name="Cody" x="129" y="30" z="7" dir="2"/>
<npc name="Pirate Jack" x="177" y="64" z="7" dir="1"/>
<npc name="Guild Master" x="129" y="51" z="5" dir="0"/>
<npc name="Obi" x="173" y="46" z="7" dir="1"/>

<npc name="Fargum" x="171" y="64" z="7" dir="1"/>
<npc name="Nimral" x="122" y="117" z="7" dir="3"/>

<npc name="Dagor" x="132" y="29" z="7" dir="2"/>
<npc name="Diamati" x="132" y="29" z="6" dir="2"/>
<npc name="Azemor" x="132" y="29" z="5" dir="2"/>
<npc name="Shanti" x="132" y="29" z="4" dir="2"/>

<npc name="Orlan" x="127" y="49" z="4" dir="1"/>
<npc name="The Oracle" x="96" y="207" z="6"/>
<npc name="Sally" x="74" y="220" z="7" dir="1"/>
</npclist>

Voce adiciona o seu tipo

<xml>
<npclist>
<npc>
<npc><npc>
<npc>
<npc>
<npc>
<npc>
<npc>
<npc>
<npc>
<npc>
<npc>
<npc>

<npc>
<npc>

<npc>
<npc>
<npc>
<npc>

<npc>
<npc>
<npc>
</npclist>

Creditos: GM Rotciv, eu

Fui, duvidas é so postar ai que eu respondo! Wink

https://guloso.forumeiros.com

GM Leon xD

GM Leon xD
Mapper
Mapper

Ae vc pode me ajdua eu to afim de fazer uma igraja sera q vc pode em passa um tipo de npc padre fala tudo q fala numa igreja fciaria legal e outro pra vende anel de casamento plz eu to falandoo q isso pode ajuda o forum pq eu nunca vi em nnehum lugar!!!

GM Leon xD

GM Leon xD
Mapper
Mapper

eu to tentando cira o meu mas n sei se vai dah o q eu quero exatamente entendeu!!!

Guloso

Guloso
Administrador
Administrador

ok gm leon vo postar esse script no forum! ;P

https://guloso.forumeiros.com

crisnaelmattoss

crisnaelmattoss
Iniciante

Opa queria uma ajuda aew..
boto o ip serto mas o serv dis q comtinua of(mas eu boto on tah)
eu fasso tudo serto.
nao seu q tah dandu..
algume mi ajuda aew..
vlw seria menhor q me add nu msn.
quem quiser add tah aew.=terra_crisnael@hotmail.com

GM Leon xD

GM Leon xD
Mapper
Mapper

provavelmente vc iria pracisa de bota o ip do hamachi q vc baixa no www.baixaki.com.br a e n pode fexa o hamachi e vc posto tb no local erroado!!!

Guloso

Guloso
Administrador
Administrador

Local Errado como disse o leon...
Mais atenção!

https://guloso.forumeiros.com

Gm Renan

Gm Renan
Iniciante

Boa explicação

thx

Uchiha

Uchiha
Supremo

fiko rox em xD adorei esse tutorial ake

Conteúdo patrocinado



Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos