Npc Que Vende Intrumentos Musicais

Noxidy__
em NPCs, monsters e raids

Noxidy__

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 11/09/06Posts: 87

:D

tive uma ideia tosca para exercer minhas praticas nPC makernicais ;D

e resolvi cria um NPC ki vende instrumentos musicas

nao sei si alguem jah tinha pensado ou criado

isso mais eu nunk vi

itaum resolvi cria

;D

vamos lah

1- va na pasta do Seu ot.. abra a pasta Data e depois a NPC

2- crie um novo arquivo .XML e renomeie para Lombard

3- abra e adicione isso dentro:

<?xml version="1.0"?>

<npc name="Lombard" script="data/npc/scripts/musica.lua" access="3" lookdir="1">

<health now="1" max="1"/>

<look type="57" head="20" body="30" legs="40" feet="50" corpse="3128"/>

</npc>

3a) depois feche e salve.

4- Após ter feito isso va na pasta script (dentro da pasta NPC) e crie um novo arquivo .LUA

5- Renomeie para musica

6- Dentro Coloque assim:

------------------- NPC TOTAL BY NOXIDY -------------------

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('Opa ' .. creatureGetName(cid) .. '! eu vendo drum, simple fanfare, fanfare, royal fanfare, post horn, panpipes, lyre, lute e flute (Todas 100gp cada. Qual voce Quer?')

    focus = cid

    talk_start = os.clock()

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

    selfSay('Calma ae, ' .. creatureGetName(cid) .. '! eu falo com voce depois.')

  elseif focus == cid then

  talk_start = os.clock()

  if msgcontains(msg, 'drum') then

  buy(cid,2073,1,100)

  elseif msgcontains(msg, 'simple fanfare') then

  buy(cid,2368,1,100)

  elseif msgcontains(msg, 'fanfare') then

  buy(cid,2076,1,100)

  elseif msgcontains(msg, 'royal fanfare') then

  buy(cid,2077,1,100)

  elseif msgcontains(msg, 'lute') then

  buy(cid,2370,1,100)

  elseif msgcontains(msg, 'post horn') then

  buy(cid,2364,1,100)

  elseif msgcontains(msg, 'panpipes') then

  buy(cid,2373,1,100)

  elseif msgcontains(msg, 'lyre') then

  buy(cid,2372,1,100)

                elseif msgcontains(msg, 'flute') then

  buy(cid,2374,1,100)

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

  selfSay('Xau, ' .. 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('Proximo...')

    end

  focus = 0

  end

  if focus ~= 0 then

  if getDistanceToCreature(focus) > 5 then

    selfSay('Adeus.')

    focus = 0

  end

  end

end

6a) Feche e salve!

Pronto Seu NPC de Musica esta criado!!

Creditos by: Noxidy__

~* COMENTS *~

noxxxdlm8.jpg

Sou:
64zw4.jpg

NPC MAKER

Contact me:
j.jungblut@hotmail.com

aiola

avatar
Campones
Campones

INFOS

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

e bem divertido e lgl pra quem gosta de ter um server com um monte de npcs esse e bem diferente

Noxidy__

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 11/09/06Posts: 87

@aiola

valeu pelo comentario :D

@Xtibia

axo ki meus npc nem agradam muito =/

noxxxdlm8.jpg

Sou:
64zw4.jpg

NPC MAKER

Contact me:
j.jungblut@hotmail.com

Eigenlieb

Ex-Diretor
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 11/01/06Posts: 300Char no Tibia: Lippisch

Olá!

Tópico Movido

Poste sempre seus Npc's na seção correta ;)

Abraços

Sou um ótimo avaliador de caráter! O meu, por exemplo, é péssimo.

PedrinhuHenrique

; Hail WARs! ;
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 05/10/06Posts: 381

cara como coloka npc no mapa naum sei tem como me ajudar?

Rocksody

avatar
Campones
Campones

INFOS

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

@Pedrinhu

Dentro da pasta com os arquivos do seu ots tem uma pasta chamada data.

Dentro de datas tem outra chamada world.

Dentro da world tem um arquivo chamado npc.

Abra esse arquivo, copie uma das linhas com qualquer otro npc e troque o nome para Lombard e as coordenadas de acordo a onde voce quer que ele fique.

Desculpa falei meio rapido e enrrolado que tenho que sair, espero ter ajudado, otro dia editarei.

@Noxidy__

O npc nao e tosco nao! ja sabia fazer mas nunca tive essa ideia! curti! vlw xD

o/ Paz

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

Sky Hunter

avatar
Banidos
Banidos

INFOS

Grupo: BanidosRegistrado: 03/10/06Posts: 227

Tem alguns instrumentos que ficam fixos no chão, vou ter que tirar eles da lista. Gostei do script, semelhante ao Tibia Rl.

[Usuário banido por comportamento destrutivo]

Rocksody

avatar
Campones
Campones

INFOS

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

~sky hunter

eu tiver esse problema tambem mas ai o npc fica sem graca, portanto tente mudar as configuracoes dos items no arquio item.otb

abco

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

skynagerloas

Ex-Moderador
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 13/11/05Posts: 715Char no Tibia: Lord'Skyxt

Tópico contendo somente 1 NpC,

essa seção é para DataPacks com 3 ou mais Npcs,

~o{Tópico Movido}o~,

Abraços.

Atenciosamente, Sky - Lord'Skyxt;

 

Antes de postar, leia isso:



Regras.

[Lord'SkyXT] [FloGão]