Hahahaha cara, não entendo muito de scripts, mas pelo que entendi o player compra o(a) boneco(a), e aí ele começa a andar por aí?
Bem criativo =P
@Conde Sapo
Fizeram uma entrevista comigo!
Da uma passada lá depois, tá na parte: entrevista/geral
E também, tem um novo tutorial meu para avaliação: Criando Tavernas e Depots.
Aguardo seus comentarios!
Abraços.
Pain













info
Grupo: Visconde
Registrado: 14/08/07
Posts: 322
Reputação: +4
Char no Tibia: Conde Sapo (Secura)
Exclusivo para XTibia
favor não postar em outro forum
HUHU
Vamos brincar de boneca ???
(meu Tutorial n° 24 - UIIII)
Agora temos o NPC Baby Doll
(AhuheHhuahUheE)
1° - Vamos acertar uma das BPs
Confira seu data\items\items.xml
Se estiver assim :
troca por isto :
=======================================================================
2° - Criando o NPC
data\npc\BabyDoll.xml
Altere o look type a gosto.
A velocidade de andar e mover eu puz 200
(quase não fica parado e anda na velocidade BOH)
=======================================================================
3° - Criando o Script
data\npc\scripts\doll.lua
local focus = 0 local talk_start = 0 local target = 0 local following = false local 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 all types of Dolls for 10k each.') 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, 'dolls') then selfSay('I sell doll 1 (1) , doll 2 (2) , vodoo doll (3) , voodoo doll (4) , mysterious fetish (5) , wooden doll (6) , Guido doll (7) , santa doll (8) , panda teddy (9) , bear (10) , panda bear (11).') selfSay('I can sell specials voodoo skull (12) , stuffed dragon (13) , stuffed rabbit (14).') elseif msgcontains(msg, 'doll 1') or msgcontains(msg, '1') then buy(cid,2110,1,10000) elseif msgcontains(msg, 'doll 2') or msgcontains(msg, '2') then buy(cid,2322,1,10000) elseif msgcontains(msg, 'vodoo doll') or msgcontains(msg, '3') then buy(cid,3955,1,10000) elseif msgcontains(msg, 'voodoo doll') or msgcontains(msg, '4') then buy(cid,5810,1,10000) elseif msgcontains(msg, 'mysterious fetish') or msgcontains(msg, '5') then buy(cid,2194,1,10000) elseif msgcontains(msg, 'wooden doll') or msgcontains(msg, '6') then buy(cid,2108,1,2000) elseif msgcontains(msg, 'guido doll') or msgcontains(msg, '7') then buy(cid,6579,1,10000) elseif msgcontains(msg, 'santa doll') or msgcontains(msg, '8') then buy(cid,6512,1,10000) elseif msgcontains(msg, 'panda teddy') or msgcontains(msg, '9') then buy(cid,6568,1,10000) elseif msgcontains(msg, 'bear') or msgcontains(msg, '10') then buy(cid,3954,1,10000) elseif msgcontains(msg, 'panda bear') or msgcontains(msg, '11') then buy(cid,5080,1,10000) elseif msgcontains(msg, 'voodoo skull') or msgcontains(msg, '12') then buy(cid,5669,1,10000) elseif msgcontains(msg, 'stuffed dragon') or msgcontains(msg, '13') then buy(cid,5791,1,10000) elseif msgcontains(msg, 'stuffed rabbit') or msgcontains(msg, '14') then buy(cid,2355,1,10000) 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() doNpcSetCreatureFocus(focus) 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 endSe sua versão é 8.0
Substitua isto :
Esse é Panda Teddy igual o Panda Bear (que já tá ae)
por isto :
Esse é a foquinha
O Player vai poder comprar a Boneca pelo nome ou pelo número.
Todas bonecas valem 10K.
Exemplo :
Trecho da fala do NPC
Trecho do Script
Se o Player falar "guido doll" ou "7" ele vai comprar a boneca do Guido por 10K.
(alterar o preço se desejar)
Acho que é só....
:XTibia_smile:
Editado Outubro 24 por Conde Sapo