SA

Npc Que Troca Dinheiro

Por samuli, 19 de jan. de 2006 em NPCs, monsters e raids

script
23
6.4k
samuliS
19 de janeiro de 2006 às 21:00

vo bota aqui como cria pq naum sei mexe com o baguio pa baxa arquivos =/ mais ta ai

1º crie um arquivo com o nome Pepe.xml na pasta npc (data/npc) e coloque os seguintes texto

<?xml version="1.0"?>

<npc name="Pepe" script="data/npc/scripts/coin.lua" access="3">

  <look type="134" head="77" body="114" legs="114" feet="114"/>

</npc>

2º agora crie 1 arquivo com o nome coin.lua na pasta script (data/npc/srcipt) e coloque o seguinte texto

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 charge gold, platinum and crystal coin.')

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

     sell(cid,2973,1,100)

    elseif msgcontains(msg, '10 platinum') then

     sell(cid,2973,10,1000)

    elseif msgcontains(msg, '5 platinum') then

     sell(cid,2973,5,500)

    elseif msgcontains(msg, 'crystal') then

     sell(cid,2989,1,10000)

    elseif msgcontains(msg, '5 crystal') then

     sell(cid,2989,5,50000)

    elseif msgcontains(msg, '10 crystal') then

     sell(cid,2989,10,100000)

    elseif msgcontains(msg, '2 platinum') then

     sell(cid,2973,2,200)

  elseif msgcontains(msg, '3 platinum') then

     sell(cid,2973,3,300)

   

    elseif msgcontains(msg, '4 platinum') and focus == cid then

     sell(cid,2973,4,400)

    elseif msgcontains(msg, '10 gold') or msgcontains(msg, 'boots of haste') and focus == cid then

     sell(cid,2969,10,10)

    elseif msgcontains(msg, 'platinum')  then

     selfSay('I trade 1, 2, 3, 4, 5 and 10 platinum coin.')

  elseif msgcontains(msg, '50 gold') or msgcontains(msg, 'mpa') then

     sell(cid,2969,50,50)

    elseif msgcontains(msg, 'crystal')  then

     selfSay('I charge 1, 5 and 10 crystal coin.')

 

    elseif msgcontains(msg, 'gold')  then

     selfSay('I charge 10 and 50 gold coin.')

    elseif string.find(msg, '(%a*)bye(%a*)')  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

pronto npc criado ;D

creditos by me

cometa aew povo ¬¬

Editado Janeiro 19 por samuli

Gm justicaG
22 de janeiro de 2006 às 23:23

Nao baxei e nao testei.. mas se funciona gratz.. bom npc!

Cria 1 padre que funcione.. os que tem nao funcionam :/

2 semanas depois...
AddictA
31 de janeiro de 2006 às 18:18

Bem ele nao vai ser muito ultilizado afinal todos os ots ja tem sistema de o proprio player fazer change..

arioA
01 de fevereiro de 2006 às 16:14

Eu não acho ele mt util mas vlw ai mt bom o npc.

ImperiI
01 de fevereiro de 2006 às 17:32

Creio que sera inutil.

Pois eu prefiro o sistema das actions.

f

u

i

Fusion32F
04 de fevereiro de 2006 às 19:21

bom vai se inutil + vlw a intençao e ja q funciona vlw pelo bom trabalho

2 semanas depois...
zoReiaZ
12 de fevereiro de 2006 às 15:57

inútil esse NPC

seu trabalho ficou legal, mas 90% dos ots hj em dia usa action...

como disse o GM justica, crie um padre... fica mais legal!

1 mês depois...
gutococaG
21 de março de 2006 às 21:01

naum axei muito massa

2 meses depois...
fidadF
21 de maio de 2006 às 16:25

Mano!!!!

vlwwwwww tava kerenu mtoo esse nPc procurei em mtoss sites..

+ c ficar direitin eu agradeço >:)

gratz...

Hail xtibia :D

inquanto issu vo :music: nirvana e :w4: jackass =D

GM CrazyG
21 de maio de 2006 às 21:19

nao vai ser muito usado mesmo

BraboB
21 de maio de 2006 às 21:23

TUto muito bom

e npc muito util tbm ^^

grats cara

favoreftyF
22 de maio de 2006 às 00:42

Desculpa ae cara,

mais você teve trabalho atoa,

e praticamente fez um npc inutíl

porque a maioria dos OTServ hoje

tem como trocar dinheiro.

Mas o que vale é a intenção.

flw

Abraços,

Favorefty.

23 de maio de 2006 às 15:45

Isso, todo mundo fala q é inutil, flooda

Nem vou falar nada

Inútil? Talvez sejam voces q estejam acabando com o RPG dos OTS hj em dia

O player ta na cave, faz 800kk de dinheiro sem precisar sair. Isso é RPG?

Ou, o player faz 4k, bp cheia, precisa ir no banco trocar dinheiro, depositar no depot, etc etc etc...

No more~~

//CF

_SuKKeR__
23 de maio de 2006 às 20:14

cara lamento te informar (XD) mas axo q vai ser inutil mano, hoj em dia tod mundo prefere a action de transformar o dinhero!!!

BatataB
23 de maio de 2006 às 21:37

Ei nenhum mod viu a assinatura do cara? Aquela imagem da mulher dançando, não sei se isso é contra as regras, mas é meio....