Npc Que Vende Rings!

thedarkhell
em NPCs, monsters e raids

thedarkhell

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 15/02/07Posts: 144Char no Tibia: Buster of Flame

e um npc comum com addon

fiz ele no map dorion 7.9 do xedegux intao eu n testei em outros servidores

ele vendi roh,tr,lr,sr,ar,cr e uns ae q eu achu q eskeci ^^

 

tomara de ajude lah vai

 

<?xml version="1.0"?>

 

<npc name="Senhor Dos Aneis" script="data/npc/scripts/rings.lua" access="3" lookdir="3">

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

<look type="146" head="0" body="40" legs="114" feet="0" corpse="3128"/>

</npc>

 

 

agora o script dele

 

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 sell life ring (2k), ring of healing (4k), club ring (2k), axe ring (3k), power ring (3k), energy ring (5k), time ring (6k) and sword ring (3k).')

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

buy(cid,2168,1,3000)

elseif msgcontains(msg, 'sword ring') then

buy(cid,2207,1,2000)

elseif msgcontains(msg, 'ring of healing') then

buy(cid,2214,1,4000)

elseif msgcontains(msg, 'club ring') then

buy(cid,2209,1,2000)

elseif msgcontains(msg, 'axe ring') then

buy(cid,2208,1,3000)

elseif msgcontains(msg, 'power ring') then

buy(cid,2166,1,3000)

elseif msgcontains(msg, 'energy ring') then

buy(cid,2167,1,5000)

elseif msgcontains(msg, 'time ring') then

buy(cid,2169,1,6000)

 

 

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 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('Next Please...')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Good bye then.')

focus = 0

end

end

end

 

 

TOMARA Q VC USEM NO SERVE DE VCS ^^

RETIRED DO XTIBIA!! UM DIA EU VOLTO :)




"DEUS FEZ AS PRIMAS, PARA NOS NÃO COMERMOS AS IRMÃS"

Bfalcao

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 02/12/06Posts: 6

Po cara muito util para aqueles ots que nao veem com npc de rings.

Valeu ae


pra vc yasmine minha feiticera q me encanta

Sidebone

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 29/05/06Posts: 1

Rox, mas tipo, como faz pra mudar o valor q vende cada um? e como faz pra vender só axe/sword/club e life ring?

Vlw :laughing:

thedarkhell

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 15/02/07Posts: 144Char no Tibia: Buster of Flame
Rox, mas tipo, como faz pra mudar o valor q vende cada um? e como faz pra vender só axe/sword/club e life ring?

Vlw :laughing:

 

 

e simples

 

if msgcontains(msg, 'life ring') then

buy(cid,2168,1,3000)

elseif msgcontains(msg, 'sword ring') then

buy(cid,2207,1,2000)

elseif msgcontains(msg, 'ring of healing') then

buy(cid,2214,1,4000)

elseif msgcontains(msg, 'club ring') then

buy(cid,2209,1,2000)

elseif msgcontains(msg, 'axe ring') then

buy(cid,2208,1,3000)

elseif msgcontains(msg, 'power ring') then

buy(cid,2166,1,3000)

elseif msgcontains(msg, 'energy ring') then

buy(cid,2167,1,5000)

elseif msgcontains(msg, 'time ring') then

buy(cid,2169,1,6000)

 

aki vc muda td q vc ker o cid n muda ,, o premero numero e o id do item tbm n muda o 1 e a quantidade e o 3 numero e o preçu tipow se vc por 10000 vai ser 10k ser por 1000 vai ser um

 

espero ter ajudado

RETIRED DO XTIBIA!! UM DIA EU VOLTO :)




"DEUS FEZ AS PRIMAS, PARA NOS NÃO COMERMOS AS IRMÃS"

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]

jmazzacaro

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 25/11/07Posts: 29Char no Tibia: PsyKina

cara nao entendi aonde eu boto cada coisa vc pode me explicar me mandando um email para johann_castor@hotmail.com

tavax

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 24/06/07Posts: 104Char no Tibia: Tavas

eu estava pensando fazer esse npc mas tinha um perguiça enorme de o fazer XD vlw

Nome

amarant_072

avatar
Campones
Campones

INFOS

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

hey vc sabe como q cria um npc de quests , ex: vc da pra ele 100 carlin sword ai vc ganha uma soft boots se vc souber fala cmg

meu pc :

Processador : intel celeron 420, 1600 MHz
Memoria ran : 1024 GB, Disponivel :656 MB
Sistema Operacional : Microsoft Windows XP Profissional
DirectX : DirectX 9.0c
Adaptador gráfico : NV GeForce 7300 SE/7200 GS (512 MB)
acelerador D : nVIDIA GeForce 7200 GS
Monitor : Proview Ma782KC [17' LCD] (6033000000) (traduzindo : monitor de 17 polegadas LCD)
Adaptador de som : Realtek AlC888/S/T @ Intel 82801GB ICH7 - High Definition Audio Controller
Disco Rígido : SAMSUNG HD082GJ (80 GB, 7200 RPM, SATA-II)
Impressora : EPSON Stylus CX5600 Series

Twopac

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 03/06/07Posts: 57Char no Tibia: No have

Ty vo ussa ele no ot

:smile_positivo:



ƒลвเии
...

erick95suave

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 15/07/10Posts: 15Char no Tibia: Sir Eurides

eu to com problemas pois o meu nao fala nada =X