poxa cara bem legal gostei mesmo continue assim q vc vai longe.
- Fórum
- OTServ
- Recursos
- Scripting
- NPCs, monsters e raids
- Npc Diferente.
info
Grupo: Artesão
Registrado: 21/02/07
Posts: 137
Reputação: +1
Char no Tibia: GOD Grimrath

Não sei se tá funfando, mas se tivé fico bom mesmo, parabéns ![]()
info
Grupo: Campones
Registrado: 20/11/07
Posts: 70
Reputação: +1
Char no Tibia: inactivo :P

v testar
parece tar bom ![]()
Sim, teste e diga o que achou...
Vlws
info
Grupo: Lenda
Registrado: 10/10/05
Posts: 2.2k
Reputação: +63
Char no Tibia: Master Chequer

Olá Xtibiano,
Parabéns, o tópico está ótimo.
Mais está na seção errada.
Tópico Movido. :forward:
Atenciosamente,
JV Chequer *Sub-Administrador do Fórum Xtibia.com*
^-^
Gosto de ajudar.
Quando puder estarei fazendo novos tutoriais.
Até mais.
info
Grupo: Campones
Registrado: 29/09/07
Posts: 63
Reputação: 0
Char no Tibia: Ventura Dragonar

Uu Muito Bom Cara e a 1º vez Que Vejo Iso
Muito Bom Scarab Coins Por Vip ou Premy....
E Uma Otima ideia, Pos Iscarab Coin e Uma Moeda nao utilizada no tibia
so Achei que fico Muito Grande o Topico...
Mas Ta Muiot Manero !!!





info
Grupo: Barão
Registrado: 07/10/07
Posts: 224
Reputação: +1
Bem, como algum de voces devem ter visto, eu fiz um totorial sobre colocar Npc/Monsters no mapEditor.
Use-o para adicionar este npc á seu mapa:
(-Adicionando Monsters/Npcs no seu MapEditor-)
Mas agora eu venho trazer uma coisa que vi muitos membros pedirem e nao serem respondidos...
Um Npc que vende premium account por scarab coins, itens Vips por scarab coins, e promotion por gps.
Mao na massa:
Vá para pasta npc de seu OT (data\npc);
copie qualquer arquivo e cole renomeando para Pestar (que sera o nome do npc que eu usarei no topico, se preferir outro nome, Mude com sua preferencia).
Abra-o em um bloco de notas e apague tudo dentro e adicione isto no lugar:
local focus = 0 local talk_start = 0 local target = 0 local days = 0 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('Ola ' .. creatureGetName(cid) .. '! Eu vendo VIP e itens VIP.') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Desculpe, ' .. creatureGetName(cid) .. '! Falarei com voce em alguns instantes.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'promoted') or msgcontains(msg, 'promotion') then if getPlayerVocation(cid) > 4 then selfSay('Desculpe, voce ja esta promovido.') talk_state = 0 elseif getPlayerLevel(cid) < 20 then selfSay('Voce precisa ter no minimo level 20...') talk_state = 0 elseif not getPlayerPremium(cid) then selfSay('Compre vip antes, depois eu lhe promoverei.') talk_state = 0 else selfSay('Voce quer ser promovido por 20k?') talk_state = 1 end elseif msgcontains(msg, 'premium') or msgcontains(msg, 'vip') then selfSay('Voce quer comprar 15 dias de VIP por 50 scarab Coins?') talk_state = 2 elseif talk_state == 1 then if msgcontains(msg, 'yes') then if pay(cid,20000) then doPlayerSetVocation(cid, getPlayerVocation(cid)+4) selfSay('Voce foi promovido!') else selfSay('Voce nao tem dinheiro suficiente.') end end talk_state = 0 elseif talk_state == 2 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid,2159,50) == TRUE then addPremium(cid,16) selfSay('Voce recebeu 15 dias de premium!') else selfSay('Sorry, you do not have scarab Coins.') end end elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'shield of honor') then if doPlayerRemoveItem(cid,2159,200) == TRUE then doPlayerAddItem(cid,2535,1) selfSay('Voce recebeu Shield of Honor!') else selfSay('Sorry, you do not have scarab Coins.') end end if msgcontains(msg, 'helmet of honor') then if doPlayerRemoveItem(cid,2159,50) == TRUE then doPlayerAddItem(cid,2506,1) selfSay('Voce recebeu Helmet of Honor!') else selfSay('Sorry, you do not have scarab Coins.') end end if msgcontains(msg, 'armor of honor') then if doPlayerRemoveItem(cid,2159,50) == TRUE then doPlayerAddItem(cid,2505,1) selfSay('Voce recebeu Armor of Honor!') else selfSay('Sorry, you do not have scarab Coins.') end end if msgcontains(msg, 'legs of honor') then if doPlayerRemoveItem(cid,2159,50) == TRUE then doPlayerAddItem(cid,2507,1) selfSay('Voce recebeu Legs of Honor!') else selfSay('Sorry, you do not have scarab Coins.') end end if msgcontains(msg, 'sword of honor') then if doPlayerRemoveItem(cid,2159,200) == TRUE then doPlayerAddItem(cid,7382,1) selfSay('Voce recebeu Sword of Honor!') else selfSay('Sorry, you do not have scarab Coins.') end end if msgcontains(msg, 'axe of honor') then if doPlayerRemoveItem(cid,2159,200) == TRUE then doPlayerAddItem(cid,7388,1) selfSay('Voce recebeu Axe of Honor!') else selfSay('Sorry, you do not have scarab Coins.') end end if msgcontains(msg, 'club of honor') then if doPlayerRemoveItem(cid,2159,200) == TRUE then doPlayerAddItem(cid,7392,1) selfSay('Voce recebeu Club of Honor!') else selfSay('Sorry, you do not have scarab Coins.') end end if msgcontains(msg, 'damage ring') then if doPlayerRemoveItem(cid,2159,150) == TRUE then doPlayerAddItem(cid,2210,1) selfSay('Voce recebeu Damage Ring!') else selfSay('Sorry, you do not have scarab Coins.') end end if msgcontains(msg, 'warrior ring') then if doPlayerRemoveItem(cid,2159,150) == TRUE then doPlayerAddItem(cid,2211,1) selfSay('Voce recebeu Warrior Ring!') else selfSay('Sorry, you do not have scarab Coins.') end end if msgcontains(msg, 'magician ring') then if doPlayerRemoveItem(cid,2159,150) == TRUE then doPlayerAddItem(cid,2212,1) selfSay('Voce recebeu Magician Ring!') else selfSay('Sorry, you do not have scarab Coins.') end end if msgcontains(msg, 'flames sword') then if doPlayerRemoveItem(cid,2159,250) == TRUE then doPlayerAddItem(cid,7748,1) selfSay('Voce recebeu Flames Sword!') else selfSay('Sorry, you do not have scarab Coins.') end end if msgcontains(msg, 'united axe') then if doPlayerRemoveItem(cid,2159,250) == TRUE then doPlayerAddItem(cid,7751,1) selfSay('Voce recebeu United Axe!') else selfSay('Sorry, you do not have scarab Coins.') end end if msgcontains(msg, 'cranial club') then if doPlayerRemoveItem(cid,2159,250) == TRUE then doPlayerAddItem(cid,7756,1) selfSay('Voce recebeu Cranial Club!') else selfSay('Sorry, you do not have scarab Coins.') end end if msgcontains(msg, 'onyx arrow') then if doPlayerRemoveItem(cid,2159,200) == TRUE then doPlayerAddItem(cid,7365,1) selfSay('Voce recebeu Onix Arrow!') else selfSay('Sorry, you do not have scarab Coins.') end end talk_state = 0 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) > 4 then selfSay('Good bye then.') focus = 0 end end endEditando o NPC: (Usando exemplos do Script)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Ola ' .. creatureGetName(cid) .. '! Eu vendo VIP e itens VIP.')--Isso ele respondera ao player dizer 'hi'.
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Desculpe, ' .. creatureGetName(cid) .. '! Falarei com voce em alguns instantes.')--Isso ele respondera se chegar um player, dizer 'hi', mas outro player ja estiver falando com o Npc.
--Isso é o que o player dira para o Npc saber que ele quer comprar 'premium' ou 'vip'.
selfSay('Voce quer comprar 15 dias de VIP por 50 scarab Coins?')--Isso é a resposta do Npc para o player
--O player diz que 'yes', ou seja, aceita a compra de "premium".
--Aqui o Npc removera os scarab coins;
*2159 é o ID dos scarab coins;
*50 é a quantidade de scarab coins.
--O 15 é a quantidade de dias que o Npc deu ao player.
selfSay('Voce recebeu 15 dias de premium!')--Npc confirma a venda.
selfSay('Sorry, you do not have scarab Coins.')--Npc diz ao player que ele nao tem scarab coins o bastante para a venda.
--Player diz ao Npc que deseja compra o Cranial Club (nome do club em meu OT).
--Npc remove os scarab coins do player;
*2159 é o ID dos scarab coins;
*250 é a quantidade.
--Npc dá ao player o Cranial club;
*7756 é o ID do club.
*1 é a quantidade.
selfSay('Voce recebeu Cranial Club!')--Npc confirma a venda
selfSay('Sorry, you do not have scarab Coins.')--Npc diz ao player que ele nao tem scarab coins o bastante para efetuar a compra.
if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Next Please...')--Apos 30 segundos sem falar com o Npc, ele se despede do player dizendo 'Next please...'
Bem, é isso ai gente.
Agora aproveitem o Npc e editem o que quiserem, pois com o mesmo script da de fazer bastante coisas afins em seu OT.
CREDITOS: Topico 100% meu, sem direitos á CTRL+C ou CTRL+V.
Deixe seu comentario, please.
Obrigado, ate a proxima
--EDIT--
O npc estava com um erro que eu nao percebi, ja esta arrumado e 100% funcionando.
Vlw...
Editado Julho 27 por MUTAN0