Não tenho nada pra dizer além de:
Muito BOM... Não... "Muito BOM" não... ÓTIMO tutorial!!
Por Conde Sapo, 08 de out. de 2007 em NPCs, monsters e raids
info
Grupo: Campones
Registrado: 22/09/07
Posts: 69
Reputação: 0
Char no Tibia: Nero
Não tenho nada pra dizer além de:
Muito BOM... Não... "Muito BOM" não... ÓTIMO tutorial!!
info
Grupo: Cavaleiro
Registrado: 02/11/05
Posts: 179
Reputação: 0
Char no Tibia: Dehby Dias, Hacked
Assino em Baxo Nero
Ta muito bom aleluia um que funcione certinho, Conde vc é o cara mano
Na minha opnião vc merece um cargo maior nesse forum, pois vc ajuda e manja muito
Aprovado Parabens
info
Grupo: Visconde
Registrado: 14/08/07
Posts: 322
Reputação: +4
Char no Tibia: Conde Sapo (Secura)

AhuheUahuENa minha opnião vc merece um cargo maior nesse forum,
Brigadúúúú pelo carinho.
Quem tem cargo , tem que manter a postura.
Sem cargo eu posso falar mal dos outros.
Prefiro poder falar mal dos outros.
Aewwwwwwww.
Falei isto em outro tópico
Não quero levar esta Cruz. É muito pesada.........Tenho dó dos moderadores que veem coisas assim todos os diasmas tem que manter a postura.

Editado Outubro 8 por Conde Sapo
info
Grupo: Cavaleiro
Registrado: 02/11/05
Posts: 179
Reputação: 0
Char no Tibia: Dehby Dias, Hacked
AhuheUahuE
Brigadúúúú pelo carinho.
Quem tem cargo , tem que manter a postura.
Sem cargo eu posso falar mal dos outros.
Prefiro poder falar mal dos outros.
SHAUShuaHSuh.
Poder Falar mal dos outros é bom sim, concordo plenamente com vc.
Mais vai falar que vc não gostaria dum cargo maior??
xP
Abraços ae
info
Grupo: Banidos
Registrado: 22/09/07
Posts: 74
Reputação: +1
BOM! Outros Npc's desses que eu vi em outros tutoriais. sempre com algum defeito!
Agora ele foi reformado com sucesso!
Cya.
Anteciosamente: GoD Fakezin
Editado Outubro 9 por GODFakezin
info
Grupo: Campones
Registrado: 06/08/07
Posts: 77
Reputação: 0
Char no Tibia: SpOt VuL
Testei Aki
Funciono Tudo certinho
Cya~~
Parabéns Conde Sapo, depois eu tentei fazer sem as funções <io>, mais não consegui e fiquei pouco tempo no pc ![]()
Mas parabéns, vai ajudar muita gente que não conseguiu colocar em seu ot.
Por mim: APROVADISSÍMO
Abraços.
Editado Outubro 10 por BlackHero
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.
info
Grupo: Campones
Registrado: 17/10/07
Posts: 75
Reputação: +3
Char no Tibia: Dan Nero

Ja vou colocar no meu Ot =]
info
Grupo: Campones
Registrado: 17/10/07
Posts: 75
Reputação: +3
Char no Tibia: Dan Nero

Cara Tipo aki no meu ot quando a pessoa n tem o dinheiro pra depositar ele deposita do mesmo jeito oO como arrumo?
info
Grupo: Visconde
Registrado: 14/08/07
Posts: 322
Reputação: +4
Char no Tibia: Conde Sapo (Secura)

Tem um erro que foge a minha compreensão...Cara Tipo aki no meu ot quando a pessoa n tem o dinheiro pra depositar ele deposita do mesmo jeito oO como arrumo?
é numa parte que JÁ VEM NO SERVER
Não é minha... só aproveitei um recurso que já existia.
Neste lugar aqui : data\npc\scripts\lib\npc.lua
Esse arquivo é do SERVER.
No lugar disto :
elseif doPlayerRemoveMoney(cid,value) then
Colocar isto :
elseif doPlayerRemoveMoney(cid,value) == TRUE then
Já acertei no tutorial.
Vlw pela dica.
Mandei PM pra todos que responderam neste tutorial
Quem pegou o banqueiro e nem falou nada , talvez esteja com o BUG ainda.
Cópia da mensagem enviada :
Estou enviando esta mensagem a TODOS que responderam no meu tutorial do NPC Banqueiro
Npc Banqueiro, sem IO.Open <-- Clicar
Acharam um erro que foge à minha compreensão
Acertei lá
Desculpa se causei algum dano em seu SERVER
[ ]s
Editado Janeiro 18 por Conde Sapo
Alguns Npc Seus Vem com a Seguinte Funçao Se Posso chamar assim:
local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)
Essas Coisa Dao erro no meu Ot ..
Help Me :_
info
Grupo: Grão-Duque
Registrado: 02/10/06
Posts: 3.3k
Reputação: +151
Gênero: Masculino

bem legal rapaz...
realmente, mtus npcs banqueiros dao algum bug...
parabens ae
info
Grupo: Visconde
Registrado: 14/08/07
Posts: 322
Reputação: +4
Char no Tibia: Conde Sapo (Secura)

local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)
Essas Coisa Dao erro no meu Ot ..
São comandos do sistema JIDDO de NPCs
Se você não tem JIDDO não vai funcionar.
-- This file is part of Jiddo's advanced NpcSystem v3.0x. This npcsystem is free to use by anyone, for any purpuse. -- Initial release date: 2007-02-21 -- Credits: Jiddo, honux(I'm using a modified version of his Find function). -- Please include full credits whereever you use this system, or parts of it. -- For support, questions and updates, please consult the following thread: -- http://otfans.net/showthread.php?t=67810
Boa Sorte
:smile_positivo:
info
Grupo: Visconde
Registrado: 14/08/07
Posts: 322
Reputação: +4
Char no Tibia: Conde Sapo (Secura)
O inicio deste meu tutorial era assim :
Descobri que esse NPC é do COLEXDescula COLEX por dar créditos errados.
COLEX <-- Vejam quem é COLEX
----------------------------------------------------------------------------------------------------------------------------------
Exclusivo para XTibia
favor não postar em outro forum
----------------------------------------------------------------------------------------------------------------------------------
Vai ae um NPC Banqueiro que não usa comandos especiais.
data\npc\scripts\Palmares.lua
local focus = 0 local talk_start = 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('Hello ' .. creatureGetName(cid) .. '! wellcome to OT Bank System.') 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 if msgcontains(msg, 'balance') then balance(cid) talk_state = 0 talk_start = os.clock() elseif msgcontains(msg, 'deposit') and getCount(msg) > 0 then value = getCount(msg) selfSay('Would you really like to deposit '..value..' gold?') talk_state = 2 talk_start = os.clock() elseif msgcontains(msg, 'deposit') then selfSay('Please tell me how much gold it is you would like to deposit.') talk_state = 1 talk_start = os.clock() elseif talk_state == 1 then value = getCount(msg) if value > 0 then selfSay('Would you really like to deposit '..value..' gold?') talk_state = 2 else talk_state = 0 end elseif msgcontains(msg, 'yes') and talk_state == 2 then deposit(cid, value) talk_state = 0 elseif msgcontains(msg, 'transfer') and getCount(msg) > 0 then value = getCount(msg) selfSay('What Player NAME you want to Transfer '..value..' gold?') talk_state = 5 talk_start = os.clock() elseif talk_state == 5 then xid = getPlayerByName(msg) if xid == 0 then selfSay('Player "'..msg..'" not found!!!') talk_state = 0 elseif xid == cid then selfSay('You canot transfer money to yourself!!!') talk_state = 0 else NomeDele = getPlayerName(xid) selfSay('Are you sure you wish to transfer '..value..' gold from your bank to '..NomeDele..' bank?') talk_state = 8 end elseif msgcontains(msg, 'transfer') then selfSay('Please tell me how much gold you would like to transfer?') talk_state = 7 talk_start = os.clock() elseif talk_state == 7 then value = getCount(msg) if value > 0 then selfSay('What Player NAME you want to Transfer '..value..' gold?') talk_state = 5 talk_start = os.clock() else talk_state = 0 end elseif msgcontains(msg, 'yes') and talk_state == 8 then transfer(cid, value, xid) talk_state = 0 elseif msgcontains(msg, 'withdraw') and getCount(msg) > 0 then value = getCount(msg) selfSay('Are you sure you wish to withdraw '..value..' gold from your bank account?') talk_state = 3 talk_start = os.clock() elseif msgcontains(msg, 'withdraw') then talk_state = 4 selfSay('Please tell me how much gold you would like to withdraw.') talk_start = os.clock() elseif talk_state == 4 then value = getCount(msg) if value > 0 then selfSay('Are you sure you wish to withdraw '..value..' gold from your bank account?') talk_state = 3 else talk_state = 0 end elseif msgcontains(msg, 'yes') and talk_state == 3 then withdraw(cid, value) talk_state = 0 elseif msgcontains(msg, 'no') and talk_state == 2 then selfSay('As you wish. Is there something else I can do for you?') talk_state = 0 elseif msgcontains(msg, 'no') and talk_state == 3 then selfSay('The customer is king! Come back anytime you want to if you wish to withdraw your money.') talk_state = 0 elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Bye bye ' .. creatureGetName(cid) .. ', come back anytime you want talk about money.') focus = 0 talk_start = 0 elseif msg ~= "" then selfSay('You are in a Bank! Talk about Bank thinks.') talk_state = 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 money owner Please...') end focus = 0 talk_start = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good bye then. Good talk with you about money.') focus = 0 talk_start = 0 end end endPalmares é um amiguinho que pediu pra acertar este NPC
Em sua homenagem fiz com o nome dele.
Agora precisa a identificação do NPC
data\npc\Palmares.xml
Este NPC usa funções pré-estabelecidas que ficam no arquivo
data\npc\scripts\lib\npc.lua
-- Funçoes de BANCO function getCount(msg) b, e = string.find(msg, "%d+") if b == nil or e == nil then count = 1 else count = tonumber(string.sub(msg, b, e)) end if count > 100000 then count = 100000 elseif count == 0 then count = 1 end return count end function balance(cid) local storage = 666 local value = getPlayerStorageValue(cid, storage) if value > 0 then selfSay('Your account balance is '..value..' gold.') else setPlayerStorageValue(cid, storage, 0) selfSay('You don\'t have money in your bank account.') end end function withdraw(cid, value) local storage = 666 local balance = getPlayerStorageValue(cid, storage) if balance == -1 then -- Não tinha depositos ainda -> Iniciar com 0 setPlayerStorageValue(cid, storage, 0) end if value <= 0 then selfSay('You cannot withdraw invalid values.') elseif balance < value then selfSay('There is not enough gold on your account.') else selfSay('Here you are, '..value..' gold. Please let me know if there is something else I can do for you.') setPlayerStorageValue(cid, storage, balance-value) doPlayerAddMoney(cid,value) end end function deposit(cid, value) local storage = 666 local balance = getPlayerStorageValue(cid, storage) if balance == -1 then -- Não tinha depositos ainda -> Iniciar com 0 setPlayerStorageValue(cid, storage, 0) end if value < 0 then selfSay('You cannot deposit negative values.') elseif doPlayerRemoveMoney(cid,value) == TRUE then selfSay('Alright, we have added the amount of '..value..' gold to your balance. You can withdraw your money anytime you want to.') setPlayerStorageValue(cid, storage, balance + value) else selfSay('You do not have enough gold.') end end function transfer(cid, value, xid) local storage = 666 local balanceEu = getPlayerStorageValue(cid, storage) local balanceEle = getPlayerStorageValue(xid, storage) if value <= 0 then selfSay('You cannot transfer illegal values.') elseif balanceEu >= value then setPlayerStorageValue(cid, storage, balanceEu - value) setPlayerStorageValue(xid, storage, balanceEle + value) selfSay('Alright, we have transfered the amount of '..value..' gold from your balance to '..NomeDele..' balance.') doPlayerSendTextMessage(xid,4,'OT Bank System : '..getPlayerName(cid)..' transfered the amount of '..value..' gold to your balance.') selfSay(getPlayerName(xid)..' received confirmation about transfer.') else selfSay('You do not have enough gold.') end end function doPlayerGetMoney(cid) local gold = getPlayerItemCount(cid,2148) local platinum = getPlayerItemCount(cid,2152) local crystal = getPlayerItemCount(cid,2160) local total = gold + (platinum*100) + (crystal*10000) return total endCaso não tenha , incluir no FIM do arquivo.
A grana fica guardada no Storage 666
Caso esse número já esteja sendo usado , substituir.
UpDates
Acharam um erro que foge à minha compreensão
Numa parte que nem é minha.
Eu só usei um recurso que JÁ VEM NO SERVER
Aqui : data\npc\scripts\lib\npc.lua <--- Já vem pronto no server
Estava assim :
Troquei por :
Não entendi porque esse erro, mas o player depositava grana mesmo sem ter o valor.
TRANSFER
Função TRANSFER adicionada
sem os comandos de IO-OPEN só posso fazer TRANSFER pra player on-line
o player que ganhou esse TRANFER recebe a mensagem que houve uma transferência da grana para a conta dele.
Editado Janeiro 18 por Conde Sapo