NO

Npc

Por Noxidy__, 10 de fev. de 2007 em Actions e Talkactions

otserv
tibia
script
10
2.4k
Noxidy__N
10 de fevereiro de 2007 às 23:15

seguintee

lembram do topico do colex com uma action da estatua..

 

Mover Estatua, passagem secreta

http://www.xtibia.com/forum/index.php?show...c=8385&hl=Colex

 

intaum..

mais cmo vamo conseguir a runa ki precisa para abrir a estatua?

 

kria um NPC ;)..

 

vamo

lah

o npc vai se o seguinte.. vc da um item pra ele.. e ele te dah a rune :)

vamos

lah

..

cria um documento .XML.. na pasta data/npc.. e renomeie para Asour ( ou o nome ki kise xD eu dei o nome dele dessi )..

 

intaum coloque assim:

 

<?xml version="1.0"?>

<npc name="Asour" script="data/npc/scripts/runeestatu.lua" access="3" lookdir="2">

<mana now="0" max="0"/>

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

<look type="134" head="95" body="22" legs="10" feet="95"/>

</npc>

 

fexe e salve..

entre na pasta.. data/npc/script.. crie um arquivo .lua ...

 

renomeie para runeestatu

 

e coloque 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) .. '! What you have for me? .')

    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, 'present') and focus == cid then

itemstatus = doPlayerRemoveItem(cid,1990)

if itemstatus == -1 then

selfSay('Where is the item?')

else

setPlayerStorageValue(cid,6019)

selfSay('Here it is...')

buy(cid,2270,1,0)

talk_start = os.clock()

end

 

  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 (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

 

 

explicando..

 

Azul - ID do item ki o player deve dar ao NPC - no caso aki eh um present

 

Vermelho - ID da runa ki vai abri a estatua.. no caso eh a mesma runa ki o colex uso :)

 

OBS: " E se vc quiser vc pode acrecentar embaixo do else um

setPlayerStorageValue(cid,6019)

Que fará com que o NPC so troque uma vez o item!! "

 

--

 

Creditos: NPC -> eu.. Noxidy__

Action -> Colex

 

espero ki gostem u.u

 

 

//Noxidy__

Editado Fevereiro 11 por Noxidy__

kamikazexK
10 de fevereiro de 2007 às 23:42

uia kra, mto doido, axo q vo usa aki ^^ vlw

 

 

agr soh falta uma action d fexa a estatua dps de entrar =/

Noxidy__N
11 de fevereiro de 2007 às 11:03

@kamikaze

 

bom voce ter gostado !!

 

@Forum

 

poh vamo comenta aee !! u.u

LampardL
12 de fevereiro de 2007 às 19:08

ta rox mais tente ser mais explicativo.

Noxidy__N
14 de fevereiro de 2007 às 08:45

@Lampard

 

eh meio dificil fazer mais explicado ki isso.. falei tudo ki o kra tem ki faze

e mostrei o que ele tem keh muda e tals

mais vlw por dise ki tah rox

 

//Noxidy__

Felipe MoraesF
14 de fevereiro de 2007 às 09:12

bem legal msm noxi...ficou um bo tuto,parabens

LokefrsL
14 de fevereiro de 2007 às 10:15

Tutorial muito bom

Eu gostei

Bem explicado e tals

Parabéns...

Noxidy__N
15 de fevereiro de 2007 às 10:52

@pekeboi

@Lokefrs

 

 

Obrigado, eh bom quando agente sab que ajuo as pessoas

:*

vini_xxeV
17 de fevereiro de 2007 às 09:27

Bem legal msmo

To usando aki no meu ot

Flws

1 mês depois...
JvchequerJ
14 de março de 2007 às 21:18

Movido para Actions.