Ir para conteúdo
Entre para seguir isso  
Kevox

[N:Fácil] Npc de Addon [ Diferente ]

Recommended Posts

Kevox    0
Kevox

.: Criando um NPC Addon de Troca :.

 

 

 

Vá a sua pasta Data>Npc e copie um arquivo qualquer de lá ( sem ser um pasta, obviamente ). Renomei-o para Charlie. Abra e substitua tudo que está lá por:

 

<?xml version="1.0"?>

<npc name="Charlie" script="data/npc/scripts/addon.lua" access="3" lookdir="3">
   <health now="1" max="1"/>
<look type="129" head="114" body="119" legs="114" feet="114"/>
</npc>

 

 

 

Agora abra a pasta Scripts. Copie um arquivo qualquer renomeando-o para Addon. Abra-o e substitua tudo por:

 

 

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('Ate mais.')

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)

 

-- greeting phrase

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

if isPremium(cid) then

selfSay('Ola' .. creatureGetName(cid) .. '! Eu posso lhe oferecer addons!.')

focus = cid

selfLook(cid)

talk_start = os.clock()

else

selfSay('Desculpe, apenas jogadores com premmium account podem ter addons!.')

focus = 0

talk_start = 0

end

 

elseif focus == cid then

talk_start = os.clock()

 

 

if msgcontains(msg, 'addons') then

 

selfSay('Qual addon voce deseja?Eu lhe ofereco tres tipos sao eles! primeiro addon, segundo addon e terceiro addon.')

 

 

elseif msgcontains(msg, 'primeiro addon') then

queststatus = getPlayerStorageValue(cid,7101)

if queststatus == -1 then

itemstatus = doPlayerRemoveItem(cid,5877)

if itemstatus == -1 then

selfSay('Hummmm.. Para o primeiro addon, eu preciso 1 green dragon leathers, dropadas em Dragoes!')

else

addon(cid,1)

setPlayerStorageValue(cid,7101,1)

focus = 0

talk_start = 0

end

else

selfSay('Meu Deus!Voce tem as 1 green dragon leathers!Parabens, aqui esta seu addon!De Set Outfit e veja!.')

focus = 0

talk_start = 0

end

 

elseif msgcontains(msg, 'segundo addon') then

queststatus = getPlayerStorageValue(cid,7102)

if queststatus == -1 then

itemstatus = doPlayerRemoveItem(cid,5882)

if itemstatus == -1 then

selfSay('Eu preciso que me traga, 1 red dragon scale!')

else

addon(cid,1)

setPlayerStorageValue(cid,7102,1)

focus = 0

talk_start = 0

end

else

selfSay('Meu Deus!Voce tem 1 red dragon scale!!Parabens!Aqui esta seu addon!De set ouftit e veja!.')

focus = 0

talk_start = 0

end

 

elseif msgcontains(msg, 'third addon') then

queststatus = getPlayerStorageValue(cid,7103)

if queststatus == -1 then

itemstatus = doPlayerRemoveItem(cid,2178)

if itemstatus == -1 then

selfSay('I want a Mind Stone first from you')

else

addon(cid,1)

setPlayerStorageValue(cid,7103,1)

focus = 0

talk_start = 0

end

else

selfSay('Bloody adventurers, always looking for things! I\'ve already give you a addon.')

focus = 0

talk_start = 0

end

 

 

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

selfSay('Ate mais!, ' .. creatureGetName(cid) .. '!')

focus = 0

talk_start = 0

end

end

end

 

 

function onCreatureChangeOutfit(creature)

 

end

 

 

function onThink()

 

if focus == 0 then

selfWalk(4)

end

 

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

if focus > 0 then

selfSay('Proximo por favor!...')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Ate mais.')

focus = 0

end

end

end

 

 

EXPLICANDO:

 

 

Vermelho: Só aceitará os itens pedidos posteriormente caso o player for Premmy Account.

Verde: Se o player não tiver feito a quest ele poderá fazer, pois seu QuestStatus será -1, caso ele já tenha feito o QuestStatus ficará 0.

Roxo: ID dos itens necessários para obter o Primeiro Addon.

Laranja: ID dos itens necessários para obter o Segundo Addon.

Azul: ID do item necessário para obter o Terceiro Addon.

 

 

 

© 2007 Kevox Corporation. All rights reserved.

Compartilhar este post


Link para o post
Compartilhar em outros sites
Razor    1
Razor

Ateh entao isso seria um script, mas como voce explicou as funcoes direitinho acho q vale como um tutorial.

Entao vou aprovar.

 

esK~

Compartilhar este post


Link para o post
Compartilhar em outros sites
Kevox    0
Kevox

É bom explicar esse tipo de script, já que 99,9% das pessoas gostam de fazer modificações no mesmo pra adequar ao seu servidor.

 

 

 

 

Edit:

 

Pro pessoal que não sabe o que é 3º addon, são os dois addons iniciais juntos, ou seja, se ativar o 1º com o 2º, vira 3º wink.gif

Compartilhar este post


Link para o post
Compartilhar em outros sites
jonatas    0
jonatas

GOSTEI rolleyes.gifrolleyes.gif

Compartilhar este post


Link para o post
Compartilhar em outros sites
Macrok    0
Macrok

Tudo q eu tava querendo!!!

Só 1 coisa!

Azul: ID do item necessário para obter o Terceiro Addon.[/b]

3º addon??

xD,numca vi serve com 3º addon!

+ ta valendo!

VLw e FLw

Compartilhar este post


Link para o post
Compartilhar em outros sites
Hommer Is The Best    0
Hommer Is The Best

no caso ai oq vem no 3º addon?

Compartilhar este post


Link para o post
Compartilhar em outros sites
Hommer Is The Best    0
Hommer Is The Best

no caso ai oq vem no 3º addon?

Compartilhar este post


Link para o post
Compartilhar em outros sites
ReDBuLL    0
ReDBuLL

existe 3° addon?

 

o.o

Compartilhar este post


Link para o post
Compartilhar em outros sites
ReDBuLL    0
ReDBuLL

existe 3° addon?

 

o.o

Compartilhar este post


Link para o post
Compartilhar em outros sites
Muadogib    0
Muadogib

tb vou perguntar qq vem no terceiro addon tongue.gif

tuto mto bem explicado...soh tenho 2 duvidas...

serve no zorzin 1.1? e esse ncp iria pega item soh pra um outfit? dai eu ia ter q fazer outro npc c o msm script pra liberar os outros, certo?

se for, acho perfeito tongue.gif

Compartilhar este post


Link para o post
Compartilhar em outros sites
Muadogib    0
Muadogib

tb vou perguntar qq vem no terceiro addon tongue.gif

tuto mto bem explicado...soh tenho 2 duvidas...

serve no zorzin 1.1? e esse ncp iria pega item soh pra um outfit? dai eu ia ter q fazer outro npc c o msm script pra liberar os outros, certo?

se for, acho perfeito tongue.gif

Compartilhar este post


Link para o post
Compartilhar em outros sites
redondo    0
redondo

eu não entendi nada você não falou de nenhuma pasta não entendo nada explica de um outro jeito aew plz

Compartilhar este post


Link para o post
Compartilhar em outros sites
Lord Slayer    0
Lord Slayer

existe 3° addon?

 

o.o

 

Bom, Para Muitos Que Não Sabem O Terceiro Addon são O Primeiro E o Segundo Juntos...

 

Mas Ainda Nada comprovou isto...

 

Bom Tutorial Explicado.

Aprovado. ;)

 

____________________________________________________________________

LORD SLAYER RULEZ !! Doe Ot's =DD

darkpsyiu6.png

gordinserv.servegame.com PORT:7171

Versão: 8.1

I'm...

50%Mapper

49%Scripter

1%Web Designer

No Tibia Há Varias Razões Para Se Jogar...Algumas Irei Citar: No Tibia, Sempre Vivendo,Morrendo,Matando e Aprendendo =)

xddddng8uq9.gif

Compartilhar este post


Link para o post
Compartilhar em outros sites
lolkiller    0
lolkiller

aff posta u q tem de kada outfit

Compartilhar este post


Link para o post
Compartilhar em outros sites
jonathan14    0
jonathan14

CARALHO... Essa porra nao da certo nao... Ele fala: "Preciso de um red scale"...

 

E dps? nao faiz mais nada... NEm o addon ele dá.

Compartilhar este post


Link para o post
Compartilhar em outros sites
Dark    3
Dark

@ jonathan14

 

Se em sua casa você faz uso dessas palavras, por favor, diga apenas nela, ok?

 

 

 

Vejam a data do tópico, ele tem quase 1 ano, prestem mais atenção aonde vocês postam.

Compartilhar este post


Link para o post
Compartilhar em outros sites
Sergio Charizard    0
Sergio Charizard

aff q merda, eu falo hi e o cara fala bye, q merda

Compartilhar este post


Link para o post
Compartilhar em outros sites
goiabinha    0
goiabinha

só n entedi

elaz fala ke precisa di 1 dragon leather lá...

dai eu n sei oque faala pra ela liverar

tipo

"yes"

e ele da o addon -.-

Compartilhar este post


Link para o post
Compartilhar em outros sites
Lord.maagnus    0
Lord.maagnus

Obviio qe exiiste . in to server ameriican . ;~

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.

×