-
Total de itens
16 -
Registro em
-
Última visita
Tudo que kmmyrawr postou
-
(Pedido)Npc Que Vende Mas Nao Por Dinhero Normal
tópico respondeu ao laravita de kmmyrawr em Lixeira Pública
Só esqueceu de arrumar a linha 38 .-. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end --------------------------------------------------------------------------------- ATÉ AQUI NÃO MODIFIQUE local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'dragon scale mail') then ---------------------- NOME DO ITEM QUE VOCE QUER VENDER selfSay('Do you want to buy a Dragon Scale Mail from me?', cid) --- PERGUNTA talkState[talkUser] = 1 elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then local qntd = XXX ------------------------------------------------- QUANTIDADE DO DETERMINADO ITEM local itemid = XXXX ---------------------------------------------- ID DO ITEM if getPlayerItemCount(cid, itemid) >= qnt then selfSay('Voce comprou TAL item!', cid) ----------- CONFIRMAÇAO DA COMPRA doPlayerRemoveItem(cid, itemid, qntd) doPlayerAddItem(cid, YYYY, 1) -------------------- ID DO ITEM QUE RECEBERA talkState[talkUser] = 0 else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa de "..qnt.." "..getItemNameById(itemid).." para comprar.") end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) -
(Pedido)Npc Que Vende Mas Nao Por Dinhero Normal
tópico respondeu ao laravita de kmmyrawr em Lixeira Pública
Exemplo: Editando o NPC Oldrak: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end --------------------------------------------------------------------------------- ATÉ AQUI NÃO MODIFIQUE local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'dragon scale mail') then ---------------------- NOME DO ITEM QUE VOCE QUER VENDER selfSay('Do you want to buy a Dragon Scale Mail from me?', cid) --- PERGUNTA talkState[talkUser] = 1 elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then local qntd = XXX ------------------------------------------------- QUANTIDADE DO DETERMINADO ITEM local itemid = XXXX ---------------------------------------------- ID DO ITEM if getPlayerItemCount(cid, itemid) > qnt then selfSay('Voce comprou TAL item!', cid) ----------- CONFIRMAÇAO DA COMPRA doPlayerRemoveItem(cid, itemid, qntd) doPlayerAddItem(cid, YYYY, 1) -------------------- ID DO ITEM QUE RECEBERA talkState[talkUser] = 0 else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa de "..qnt.." "..getItemNameById(itemid).." para comprar.") end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Veja o que deseja modificar e pronto -
Dando detected no Avast!. Alguem abriu e conferiu se é seguro?
-
- Nick: Full Moon Paladin - - World: Saphira - - Vocation: Paladin - - Level: 34 - - Magic Level: 10 - - Skills: 71/53 - Antes de Prints, gostaria de fazer uma breve apresentação: - Nunca usei BOT - Nunca fui Premium Havia parado de jogar, mas estou voltando. Sim, é possivel, para nós Free's, conseguir motivos para levantar um char desse tipo. - EQUIPMENT LOG - Level 34 - LEVEL LOG - Level 34 - SKILL LOG - Skills 71/53
-
[Encerrado] Editar Porta Do Cliente
tópico respondeu ao dragonfight de kmmyrawr em Tópicos Sem Resposta
Não sei se funciona no seu HEX editor, mas eu sempre fiz assim: >> 1B8864 << Mas se precisar, é claro, mude o prefixo. 03 1C é para port 7171 Mas como voce quer 7172: 04 1C é para port 7172 -
Os Monster D Meu Ot Server Na Ta Dando Itens
tópico respondeu ao MARIANETH de kmmyrawr em Lixeira Pública
Abra o config.lua na pasta do seu servidor. Aperte CTRL + F, escreva Loot e clique em Procurar. Na linha onde ele encontrar a palavra Loot, vai ser quantas vezes a chance de dropar um item. Ex: Se voce colocar 2, a chance de dropar o item vai dobrar. Então mude como quiser, feche e salve. -
[Encerrado] Editar Porta Do Cliente
tópico respondeu ao dragonfight de kmmyrawr em Tópicos Sem Resposta
Bom, geralmente se voce usa um Client Maker ou aquele Site onde se cria Clients, tem a opção da porta do seu servidor. Diz ae como voce faz para criar seu Client que facilita muito. -
Tente este: Vá em data/creaturescripts/scripts Crie um arquivo.lua e renomeie para firstitems.lua Coloque nele: local firstItems = {} firstItems[0] = { 2525, 8819, 8820, 2468, 2647, 2643 } firstItems[1] = { 2525, 2190, 2124, 2457, 2647, 2643 } firstItems[2] = { 2525, 2182, 2124, 2457, 2647, 2643 } firstItems[3] = { 2525, 2399, 2124, 2457, 2647, 2643 } firstItems[4] = { 2525, 2428, 2124, 2457, 2647, 2643 } function onLogin(cid) if getPlayerStorageValue(cid, 30001) == -1 then for i = 1, table.maxn(firstItems[getPlayerVocation(cid)]) do doPlayerAddItem(cid, firstItems[getPlayerVocation(cid)][i], 1) end if getPlayerSex(cid) == 0 then doPlayerAddItem(cid, 2463, 1) else doPlayerAddItem(cid, 2463, 1) end local bag = doPlayerAddItem(cid, 11235, 1) doAddContainerItem(bag, 2554, 1) doAddContainerItem(bag, 2120, 1) doAddContainerItem(bag, 7618, 1) setPlayerStorageValue(cid, 30001, 1) end local bag = doPlayerAddItem(cid, 11235, 1) doAddContainerItem(bag, 2152, 100) doAddContainerItem(bag, 2554, 1) doAddContainerItem(bag, 2120, 1) doAddContainerItem(bag, 7618, 1) setPlayerStorageValue(cid, 30001, 1) return TRUE end Depois vá no creaturescripts.xml e adicione: <event type="login" name="FirstItems" event="script" value="firstitems.lua"/> Edite os IDs a seu gosto, lembrando que: Linha vermelha: None ou Rooker (Rookgard) Llinha verde: Sorcerer Linha rosa: Druid Linha azul: Paladin Linha roxa: Knight FONTE: First Items - XTibia TODOS os creditos aos que contribuiram com o script no link.
-
Nossa, muito bom. É um sistema automático de punição por chingamento. Adorei. Poupa MUITO trabalho com as denúncias... Simplesmente incrível e inovador. Obrigado, continue postando scripts do tipo.
-
Os Monster D Meu Ot Server Na Ta Dando Itens
tópico respondeu ao MARIANETH de kmmyrawr em Lixeira Pública
Veja no config.lua se o rate de drop esta zero ou algo parecido. -
Gostei. Vou colocar no meu servidor, é mais uma garantia. Se der problema eu posto aqui. Ja usei meu REP, entao mal ae.
-
Bom, vamos começar. Creio que você ja tenha todos os arquivos do Sistema Vip. Então no arquivo vipaccplayer.lua: function onSay(cid, words, param, channel) if words == "/buyvip" then local price = 1000000 local days = 0 if doPlayerRemoveMoney(cid, price) then doPlayerAddItem(cid, XXXX, 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce comprou o VIP Item!") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa de "..price.." para adicionar "..days.." dia(s) de vip.") end elseif words == "/vipdays" then local duration = getVipDate(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você possui "..getVipDays(cid).." dia(s) de vip."..(duration and (" Ela irá durar até "..duration..".") or "")) end return TRUE end Mude o "XXXX" para o ID do item que ao ser usado vai adicionar o numero de dias de VIP. Em data\actions\actions.xml adicione em algum lugar: <action itemid="XXXX" event="script" value="itemvip.lua"/> Mude o "XXXX" para o ID do item que ao ser usado vai adicionar o numero de dias de VIP. E por último, crie um arquivo com o nome itemvip.lua em data\actions\scripts\ function onUse(cid, words, param, channel) if doPlayerRemoveItem(cid,XXXX,1) then addVipDays(cid, days) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você adicionou "..days.." dia(s) de vip, agora você possui "..getVipDays(cid).." dia(s) de vip.") end return TRUE end Mude o "XXXX" para o ID do item que ao ser usado vai adicionar o numero de dias de VIP.
-
Provavelmente sim, o estranho é que derrepente o problema começou entao algo deve ter corrompido.
-
Tem sim. O que voce deve fazer: Escolher o item que ao ser uzado adicione os dias de vip. Depois voce tera que criar uma action com o id do item que ao clicar vai adicionar a vip. no momento eu to usando um celular mas assim que possivel e se voce nao conseguir eu edito aqui e coloco o script pra voce. Boa sorte.
-
Nao, nao da. parece tudo estar correto. O que voce poderia fazer é apenas retirar as mensagens, tudo continuaria funcional, mas os players ficariam desorientados.
-
Iii problema no distro
-
O unbinder so e funcional ate algumas versoes mas nao sei informar quais.
-
É simples, deve ter essas areas aí: Mas antes acho que voce precisa colocar o unbinder na pasta onde esta o Tibia.exe Title Param - Nome do Client que voce quer extrair. Deve ser Tibia mesmo. Client Param - Coloque a versão do tibia sem pontos ou virgulas. Exemplo: 854 para 8.54 Inject - Inicia o processo de extração. Exit - Sai do programa. Acho que é só isso.
-
poketibia [Encerrado] Help! O Cm E Gm Nao Tao Funfando No Meu Server
tópico respondeu ao lukebsm de kmmyrawr em Tópicos Sem Resposta
A ultima solução é abrir a pasta data\talkactions\scripts e ver se os arquivos correspondentes aos comandos de CM e GM estão lá. Pra adicionar Monsters do zero, voce vai precisar das Sprites deles. Então voce usa um Sprite Editor pra colocar as sprites do Pokemon la que voce pode até substituir por outro monstro. Depois voce vai precisar fazer o script do monstro, sugiro que copie um já existente e arrume o Outfit ID, HP, e essas coisas. Se os Sprites ja á estiverem feitos e no Tibia.spr, voce só precisa fazer os scripts. Como não sou scripter de Poketibia não posso te ajudar muito nisso, mas o nescessário a fazer está ai. -
poketibia [Encerrado] Help! O Cm E Gm Nao Tao Funfando No Meu Server
tópico respondeu ao lukebsm de kmmyrawr em Tópicos Sem Resposta
Sim no seu caso esta na talkactions.xml Baixei um server que deve ser a mesma versao que o seu, e aqui está: <!-- Community Managers --> <talkaction log="yes" words="/s" access="4" event="script" value="summon.lua"/> <talkaction log="yes" words="/n" access="4" event="script" value="creature.lua"/> <talkaction log="yes" words="/m" access="4" event="script" value="creature.lua"/> <talkaction log="yes" words="/reload" access="4" event="script" value="reload.lua"/> <talkaction log="yes" words="/raid" access="4" event="script" value="raid.lua"/> <talkaction log="yes" words="/newtype" access="4" event="script" value="newtype.lua"/> <talkaction log="yes" words="/r" access="4" event="script" value="remove.lua"/> <talkaction log="yes" words="/owner" access="4" event="script" value="owner.lua"/> <talkaction log="yes" words="/storage" access="4" event="script" value="storage.lua"/> <talkaction log="yes" words="/config" access="4" event="script" value="configinfo.lua"/> <talkaction log="yes" words="/i" access="4" event="script" value="createitem.lua"/> <talkaction log="yes" words="/bc" access="4" event="script" value="broadcastclass.lua"/> <talkaction log="yes" access="4" words="/mkick" event="script" value="masskick.lua"/> <talkaction access="4" words="/z" event="script" value="magiceffect.lua"/> <talkaction access="4" words="/x" event="script" value="animationeffect.lua"/> <talkaction access="4" words="/y" event="script" value="animatedtext.lua"/> <!-- Gamemasters --> <talkaction log="yes" words="/ghost;/invisible" access="3" event="function" value="ghost"/> <talkaction log="yes" words="/squelch" access="3" event="script" value="gamemaster.lua"/> <talkaction log="yes" words="/cliport" access="3" event="script" value="gamemaster.lua"/> <talkaction log="yes" words="/t" access="3" event="script" value="teleportmaster.lua"/> <talkaction log="yes" words="/c" access="3" event="script" value="teleporthere.lua"/> <talkaction log="yes" words="/goto" access="3" event="script" value="teleportto.lua"/> <talkaction log="yes" words="/a" access="3" event="script" value="teleporttiles.lua"/> <talkaction log="yes" words="/kick" access="3" event="script" value="kick.lua"/> <talkaction log="yes" words="/send" access="3" event="script" value="teleportsend.lua"/> <talkaction log="yes" words="/unban" access="3" event="script" value="unban.lua"/> <talkaction log="yes" words="/town" access="3" event="script" value="teleporttown.lua"/> <talkaction log="yes" words="/up" access="3" event="script" value="teleportfloor.lua"/> <talkaction log="yes" words="/down" access="3" event="script" value="teleportfloor.lua"/> <talkaction log="yes" words="/save" access="3" event="script" value="save.lua"/> <talkaction log="yes" words="/clean" access="3" event="script" value="clean.lua"/> <talkaction log="yes" words="/reports" access="3" event="script" value="reports.lua"/> <talkaction log="yes" words="/mc" access="3" event="script" value="multicheck.lua"/> <talkaction log="yes" words="/wp" access="3" event="script" value="waypoints.lua"/> <talkaction log="yes" words="/jail;/unjail" access="3" event="script" value="jail.lua"/> Espero que resolva, talvez os values tambem estejam deletados, ai teria que te mandar por um link. -
poketibia [Encerrado] Help! O Cm E Gm Nao Tao Funfando No Meu Server
tópico respondeu ao lukebsm de kmmyrawr em Tópicos Sem Resposta
Poe la na commands.xml provavelmente na \data\XML\ -- Senior Gamemasters <command cmd="/m" access="4" /> -- Summon a "wild" monster <command cmd="/info" access="4" /> -- Info about a player <command cmd="/z" access="4" /> -- Check effects -- Gamemasters <command cmd="/b" access="3" /> -- IP BAN a player <command cmd="/t" access="3" /> -- Teleport to your temple <command cmd="/gethouse" access="3" /> -- Info about house of a player <command cmd="/bans" access="3" /> -- Info about who are banished <command cmd="/town" access="3" /> -- Go to your town <command cmd="/save" access="3" /> -- Cast Server save <command cmd="/invisible" access="3" /> -- Info about house of a player <command cmd="/promote" access="3" /> -- Promote a player <command cmd="/up" access="3" /> -- Teleport a floor up <command cmd="/bc" access="3" /> -- Broadcast to players in colors <command cmd="/down" access="3" /> -- Teleport a floor down <command cmd="/raid" access="3" /> -- Execute a raid <command cmd="/premium" access="3" /> -- Give someone a premium account <command cmd="/a" access="3" /> -- Teleport by SQMs <command cmd="/kick" access="3" /> -- Kick a player <command cmd="/exiva" access="3" /> -- Find a player <command cmd="/goto" access="3" /> -- Teleport to players, creatures or NPCs <command cmd="/c" access="3" /> -- Teleport a player Ta ai, arrume os acess. E desculpe, aqui o GOD é 5 e não 6. Varia por cada OT. -
Abra o arquivo default.lua em data\npcs\scripts\ e troque tudo por isso: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end npcHandler:addModule(FocusModule:new()) No arquivo npchandler.lua em \data\npc\lib\npcsystem Troque tudo por: -- Advanced NPC System (Created by Jiddo), -- Modified by Talaturen. if(NpcHandler == nil) then -- Constant talkdelay behaviors. TALKDELAY_NONE = 0 -- No talkdelay. Npc will reply immedeatly. TALKDELAY_ONTHINK = 1 -- Talkdelay handled through the onThink callback function. (Default) TALKDELAY_EVENT = 2 -- Not yet implemented -- Currently applied talkdelay behavior. TALKDELAY_ONTHINK is default. NPCHANDLER_TALKDELAY = TALKDELAY_ONTHINK -- Constant conversation behaviors. CONVERSATION_DEFAULT = 0 -- Conversation through default window, like it was before 8.2 update. CONVERSATION_PRIVATE = 1 -- Conversation through NPCs chat window, as of 8.2 update. (Default) --Small Note: Private conversations also means the NPC will use multi-focus system. -- Currently applied conversation behavior. CONVERSATION_DEFAULT is default. NPCHANDLER_CONVBEHAVIOR = CONVERSATION_DEFAULT -- Constant indexes for defining default messages. MESSAGE_GREET = 1 -- When the player greets the npc. MESSAGE_FAREWELL = 2 -- When the player unGreets the npc. MESSAGE_BUY = 3 -- When the npc asks the player if he wants to buy something. MESSAGE_ONBUY = 4 -- When the player successfully buys something via talk. MESSAGE_BOUGHT = 5 -- When the player bought something through the shop window. MESSAGE_SELL = 6 -- When the npc asks the player if he wants to sell something. MESSAGE_ONSELL = 7 -- When the player successfully sells something via talk. MESSAGE_SOLD = 8 -- When the player sold something through the shop window. MESSAGE_MISSINGMONEY = 9 -- When the player does not have enough money. MESSAGE_NEEDMONEY = 10 -- Same as above, used for shop window. MESSAGE_MISSINGITEM = 11 -- When the player is trying to sell an item he does not have. MESSAGE_NEEDITEM = 12 -- Same as above, used for shop window. MESSAGE_NEEDSPACE = 13 -- When the player don't have any space to buy an item MESSAGE_NEEDMORESPACE = 14 -- When the player has some space to buy an item, but not enough space MESSAGE_IDLETIMEOUT = 15 -- When the player has been idle for longer then idleTime allows. MESSAGE_WALKAWAY = 16 -- When the player walks out of the talkRadius of the npc. MESSAGE_DECLINE = 17 -- When the player says no to something. MESSAGE_SENDTRADE = 18 -- When the npc sends the trade window to the player MESSAGE_NOSHOP = 19 -- When the npc's shop is requested but he doesn't have any MESSAGE_ONCLOSESHOP = 20 -- When the player closes the npc's shop window MESSAGE_ALREADYFOCUSED = 21 -- When the player already has the focus of this npc. MESSAGE_PLACEDINQUEUE = 22 -- When the player has been placed in the costumer queue. -- Constant indexes for callback functions. These are also used for module callback ids. CALLBACK_CREATURE_APPEAR = 1 CALLBACK_CREATURE_DISAPPEAR = 2 CALLBACK_CREATURE_SAY = 3 CALLBACK_ONTHINK = 4 CALLBACK_GREET = 5 CALLBACK_FAREWELL = 6 CALLBACK_MESSAGE_DEFAULT = 7 CALLBACK_PLAYER_ENDTRADE = 8 CALLBACK_PLAYER_CLOSECHANNEL= 9 CALLBACK_ONBUY = 10 CALLBACK_ONSELL = 11 -- Addidional module callback ids CALLBACK_MODULE_INIT = 12 CALLBACK_MODULE_RESET = 13 -- Constant strings defining the keywords to replace in the default messages. TAG_PLAYERNAME = '|PLAYERNAME|' TAG_ITEMCOUNT = '|ITEMCOUNT|' TAG_TOTALCOST = '|TOTALCOST|' TAG_ITEMNAME = '|ITEMNAME|' TAG_QUEUESIZE = '|QUEUESIZE|' NpcHandler = { keywordHandler = nil, focuses = nil, talkStart = nil, idleTime = 90, talkRadius = 4, talkDelayTime = 1, -- Seconds to delay outgoing messages. queue = nil, talkDelay = nil, callbackFunctions = nil, modules = nil, shopItems = nil, -- They must be here since ShopModule uses "static" functions messages = { -- These are the default replies of all npcs. They can/should be changed individually for each npc. [MESSAGE_GREET] = 'Welcome, |PLAYERNAME|! I have been expecting you.', [MESSAGE_FAREWELL] = 'Good bye, |PLAYERNAME|!', [MESSAGE_BUY] = 'Do you want to buy |ITEMCOUNT| |ITEMNAME| for |TOTALCOST| gold coins?', [MESSAGE_ONBUY] = 'It was a pleasure doing business with you.', [MESSAGE_BOUGHT] = 'Bought |ITEMCOUNT|x |ITEMNAME| for |TOTALCOST| gold.', [MESSAGE_SELL] = 'Do you want to sell |ITEMCOUNT| |ITEMNAME| for |TOTALCOST| gold coins?', [MESSAGE_ONSELL] = 'Thank you for this |ITEMNAME|, |PLAYERNAME| gold.', [MESSAGE_SOLD] = 'Sold |ITEMCOUNT|x |ITEMNAME| for |TOTALCOST| gold.', [MESSAGE_MISSINGMONEY] = 'Sorry, you don\'t have enough money.', [MESSAGE_NEEDMONEY] = 'You do not have enough money.', [MESSAGE_MISSINGITEM] = 'You don\'t even have that item, |PLAYERNAME|!', [MESSAGE_NEEDITEM] = 'You do not have this object.', [MESSAGE_NEEDSPACE] = 'You do not have enough capacity.', [MESSAGE_NEEDMORESPACE] = 'You do not have enough capacity for all items.', [MESSAGE_IDLETIMEOUT] = 'Next, please!', [MESSAGE_WALKAWAY] = 'How rude!', [MESSAGE_DECLINE] = 'Not good enough, is it... ?', [MESSAGE_SENDTRADE] = 'Here\'s my offer, |PLAYERNAME|. Don\'t you like it?', [MESSAGE_NOSHOP] = 'Sorry, I\'m not offering anything.', [MESSAGE_ONCLOSESHOP] = 'Thank you, come back when you want something more.', [MESSAGE_ALREADYFOCUSED] = '|PLAYERNAME|! I am already talking to you...', [MESSAGE_PLACEDINQUEUE] = '|PLAYERNAME|, please wait for your turn. There are |QUEUESIZE| customers before you.' } } -- Creates a new NpcHandler with an empty callbackFunction stack. function NpcHandler:new(keywordHandler) local obj = {} obj.callbackFunctions = {} obj.modules = {} if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then obj.focuses = {} obj.talkStart = {} else obj.queue = Queue:new(obj) obj.focuses = 0 obj.talkStart = 0 end obj.talkDelay = {} obj.keywordHandler = keywordHandler obj.messages = {} obj.shopItems = {} setmetatable(obj.messages, self.messages) self.messages.__index = self.messages setmetatable(obj, self) self.__index = self return obj end -- Re-defines the maximum idle time allowed for a player when talking to this npc. function NpcHandler:setMaxIdleTime(newTime) self.idleTime = newTime end -- Attackes a new keyword handler to this npchandler function NpcHandler:setKeywordHandler(newHandler) self.keywordHandler = newHandler end -- Function used to change the focus of this npc. function NpcHandler:addFocus(newFocus) if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then if(self:isFocused(newFocus)) then return end table.insert(self.focuses, newFocus) else self.focuses = newFocus end self:updateFocus() end NpcHandler.changeFocus = NpcHandler.addFocus --"changeFocus" looks better for CONVERSATION_DEFAULT -- Function used to verify if npc is focused to certain player function NpcHandler:isFocused(focus) if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then for k,v in pairs(self.focuses) do if v == focus then return true end end return false end return (self.focuses == focus) end -- This function should be called on each onThink and makes sure the npc faces the player it is talking to. -- Should also be called whenever a new player is focused. function NpcHandler:updateFocus() if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then for pos, focus in pairs(self.focuses) do if(focus ~= nil) then doNpcSetCreatureFocus(focus) return end end doNpcSetCreatureFocus(0) else doNpcSetCreatureFocus(self.focuses) end end -- Used when the npc should un-focus the player. function NpcHandler:releaseFocus(focus) if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then if(not self:isFocused(focus)) then return end local pos = nil for k,v in pairs(self.focuses) do if v == focus then pos = k end end table.remove(self.focuses, pos) self.talkStart[focus] = nil if isPlayer(focus) then closeShopWindow(focus) --Even if it can not exist, we need to prevent it. end self:updateFocus() else if isPlayer(focus) then closeShopWindow(focus) end self:changeFocus(0) end end -- Returns the callback function with the specified id or nil if no such callback function exists. function NpcHandler:getCallback(id) local ret = nil if(self.callbackFunctions ~= nil) then ret = self.callbackFunctions[id] end return ret end -- Changes the callback function for the given id to callback. function NpcHandler:setCallback(id, callback) if(self.callbackFunctions ~= nil) then self.callbackFunctions[id] = callback end end -- Adds a module to this npchandler and inits it. function NpcHandler:addModule(module) if(self.modules ~= nil) then table.insert(self.modules, module) module:init(self) end end -- Calls the callback function represented by id for all modules added to this npchandler with the given arguments. function NpcHandler:processModuleCallback(id, ...) local ret = true for i, module in pairs(self.modules) do local tmpRet = true if(id == CALLBACK_CREATURE_APPEAR and module.callbackOnCreatureAppear ~= nil) then tmpRet = module:callbackOnCreatureAppear(...) elseif(id == CALLBACK_CREATURE_DISAPPEAR and module.callbackOnCreatureDisappear ~= nil) then tmpRet = module:callbackOnCreatureDisappear(...) elseif(id == CALLBACK_CREATURE_SAY and module.callbackOnCreatureSay ~= nil) then tmpRet = module:callbackOnCreatureSay(...) elseif(id == CALLBACK_PLAYER_ENDTRADE and module.callbackOnPlayerEndTrade ~= nil) then tmpRet = module:callbackOnPlayerEndTrade(...) elseif(id == CALLBACK_PLAYER_CLOSECHANNEL and module.callbackOnPlayerCloseChannel ~= nil) then tmpRet = module:callbackOnPlayerCloseChannel(...) elseif(id == CALLBACK_ONBUY and module.callbackOnBuy ~= nil) then tmpRet = module:callbackOnBuy(...) elseif(id == CALLBACK_ONSELL and module.callbackOnSell ~= nil) then tmpRet = module:callbackOnSell(...) elseif(id == CALLBACK_ONTHINK and module.callbackOnThink ~= nil) then tmpRet = module:callbackOnThink(...) elseif(id == CALLBACK_GREET and module.callbackOnGreet ~= nil) then tmpRet = module:callbackOnGreet(...) elseif(id == CALLBACK_FAREWELL and module.callbackOnFarewell ~= nil) then tmpRet = module:callbackOnFarewell(...) elseif(id == CALLBACK_MESSAGE_DEFAULT and module.callbackOnMessageDefault ~= nil) then tmpRet = module:callbackOnMessageDefault(...) elseif(id == CALLBACK_MODULE_RESET and module.callbackOnModuleReset ~= nil) then tmpRet = module:callbackOnModuleReset(...) end if(not tmpRet) then ret = false break end end return ret end -- Returns the message represented by id. function NpcHandler:getMessage(id) local ret = nil if(self.messages ~= nil) then ret = self.messages[id] end return ret end -- Changes the default response message with the specified id to newMessage. function NpcHandler:setMessage(id, newMessage) if(self.messages ~= nil) then self.messages[id] = newMessage end end -- Translates all message tags found in msg using parseInfo function NpcHandler:parseMessage(msg, parseInfo) local ret = msg for search, replace in pairs(parseInfo) do ret = string.gsub(ret, search, replace) end return ret end -- Makes sure the npc un-focuses the currently focused player function NpcHandler:unGreet(cid) if(not self:isFocused(cid)) then return end local callback = self:getCallback(CALLBACK_FAREWELL) if(callback == nil or callback()) then if(self:processModuleCallback(CALLBACK_FAREWELL)) then if(self.queue == nil or not self.queue:greetNext()) then local msg = self:getMessage(MESSAGE_FAREWELL) local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid) } msg = self:parseMessage(msg, parseInfo) self:say(msg, cid, true) self:releaseFocus(cid) end end end end -- Greets a new player. function NpcHandler:greet(cid) if(cid ~= 0) then local callback = self:getCallback(CALLBACK_GREET) if(callback == nil or callback(cid)) then if(self:processModuleCallback(CALLBACK_GREET, cid)) then local msg = self:getMessage(MESSAGE_GREET) local parseInfo = { [TAG_PLAYERNAME] = getCreatureName(cid) } msg = self:parseMessage(msg, parseInfo) self:say(msg, cid, true) else return end else return end end self:addFocus(cid) end -- Handles onCreatureAppear events. If you with to handle this yourself, please use the CALLBACK_CREATURE_APPEAR callback. function NpcHandler:onCreatureAppear(cid) local callback = self:getCallback(CALLBACK_CREATURE_APPEAR) if(callback == nil or callback(cid)) then if(self:processModuleCallback(CALLBACK_CREATURE_APPEAR, cid)) then -- end end end -- Handles onCreatureDisappear events. If you with to handle this yourself, please use the CALLBACK_CREATURE_DISAPPEAR callback. function NpcHandler:onCreatureDisappear(cid) local callback = self:getCallback(CALLBACK_CREATURE_DISAPPEAR) if(callback == nil or callback(cid)) then if(self:processModuleCallback(CALLBACK_CREATURE_DISAPPEAR, cid)) then if(self:isFocused(cid)) then self:unGreet(cid) end end end end -- Handles onCreatureSay events. If you with to handle this yourself, please use the CALLBACK_CREATURE_SAY callback. function NpcHandler:onCreatureSay(cid, msgtype, msg) local callback = self:getCallback(CALLBACK_CREATURE_SAY) if(callback == nil or callback(cid, msgtype, msg)) then if(self:processModuleCallback(CALLBACK_CREATURE_SAY, cid, msgtype, msg)) then if(not self:isInRange(cid)) then return end if(self.keywordHandler ~= nil) then if(self:isFocused(cid) and (msgtype == TALKTYPE_PRIVATE_PN or NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT) or (not self:isFocused(cid))) then local ret = self.keywordHandler:processMessage(cid, msg) if(not ret) then local callback = self:getCallback(CALLBACK_MESSAGE_DEFAULT) if(callback ~= nil and callback(cid, msgtype, msg)) then if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then self.talkStart[cid] = os.time() else self.talkStart = os.time() end end else if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then self.talkStart[cid] = os.time() else self.talkStart = os.time() end end end end end end end -- Handles onPlayerEndTrade events. If you wish to handle this yourself, use the CALLBACK_PLAYER_ENDTRADE callback. function NpcHandler:onPlayerEndTrade(cid) local callback = self:getCallback(CALLBACK_PLAYER_ENDTRADE) if(callback == nil or callback(cid)) then if(self:processModuleCallback(CALLBACK_PLAYER_ENDTRADE, cid, msgtype, msg)) then if(self:isFocused(cid)) then local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid) } local msg = self:parseMessage(self:getMessage(MESSAGE_ONCLOSESHOP), parseInfo) self:say(msg, cid) end end end end -- Handles onPlayerCloseChannel events. If you wish to handle this yourself, use the CALLBACK_PLAYER_CLOSECHANNEL callback. function NpcHandler:onPlayerCloseChannel(cid) local callback = self:getCallback(CALLBACK_PLAYER_CLOSECHANNEL) if(callback == nil or callback(cid)) then if(self:processModuleCallback(CALLBACK_PLAYER_CLOSECHANNEL, cid, msgtype, msg)) then if(self:isFocused(cid)) then self:unGreet(cid) end end end end -- Handles onBuy events. If you wish to handle this yourself, use the CALLBACK_ONBUY callback. function NpcHandler:onBuy(cid, itemid, subType, amount) local callback = self:getCallback(CALLBACK_ONBUY) if(callback == nil or callback(cid, itemid, subType, amount)) then if(self:processModuleCallback(CALLBACK_ONBUY, cid, itemid, subType, amount)) then -- end end end -- Handles onSell events. If you wish to handle this yourself, use the CALLBACK_ONSELL callback. function NpcHandler:onSell(cid, itemid, subType, amount) local callback = self:getCallback(CALLBACK_ONSELL) if(callback == nil or callback(cid, itemid, subType, amount)) then if(self:processModuleCallback(CALLBACK_ONSELL, cid, itemid, subType, amount)) then -- end end end -- Handles onThink events. If you wish to handle this yourself, please use the CALLBACK_ONTHINK callback. function NpcHandler:onThink() local callback = self:getCallback(CALLBACK_ONTHINK) if(callback == nil or callback()) then if(NPCHANDLER_TALKDELAY == TALKDELAY_ONTHINK) then if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then for cid, talkDelay in pairs(self.talkDelay) do if(talkDelay.time ~= nil and talkDelay.message ~= nil and os.time() >= talkDelay.time) then selfSay(talkDelay.message, cid, talkDelay.publicize and TRUE or FALSE) self.talkDelay[cid] = nil end end elseif(self.talkDelay.time ~= nil and self.talkDelay.message ~= nil and os.time() >= self.talkDelay.time) then selfSay(self.talkDelay.message) self.talkDelay.time = nil self.talkDelay.message = nil end end if(self:processModuleCallback(CALLBACK_ONTHINK)) then if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then for pos, focus in pairs(self.focuses) do if(focus ~= nil) then if(not self:isInRange(focus)) then self:onWalkAway(focus) elseif((os.time() - self.talkStart[focus]) > self.idleTime) then self:unGreet(focus) else self:updateFocus() end end end elseif(self.focuses ~= 0) then if(not self:isInRange(self.focuses)) then self:onWalkAway(self.focuses) elseif(os.time()-self.talkStart > self.idleTime) then self:unGreet(self.focuses) else self:updateFocus() end end end end end -- Tries to greet the player with the given cid. function NpcHandler:onGreet(cid) if(self:isInRange(cid)) then if(NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE) then if(not self:isFocused(cid)) then self:greet(cid) return end elseif(NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT) then if(self.focuses == 0) then self:greet(cid) elseif(self.focuses == cid) then local msg = self:getMessage(MESSAGE_ALREADYFOCUSED) local parseInfo = { [TAG_PLAYERNAME] = getCreatureName(cid) } msg = self:parseMessage(msg, parseInfo) self:say(msg) else if(not self.queue:isInQueue(cid)) then self.queue:push(cid) end local msg = self:getMessage(MESSAGE_PLACEDINQUEUE) local parseInfo = { [TAG_PLAYERNAME] = getCreatureName(cid), [TAG_QUEUESIZE] = self.queue:getSize() } msg = self:parseMessage(msg, parseInfo) self:say(msg) end end end end -- Simply calls the underlying unGreet function. function NpcHandler:onFarewell(cid) self:unGreet(cid) end -- Should be called on this npc's focus if the distance to focus is greater then talkRadius. function NpcHandler:onWalkAway(cid) if(self:isFocused(cid)) then local callback = self:getCallback(CALLBACK_CREATURE_DISAPPEAR) if(callback == nil or callback()) then if(self:processModuleCallback(CALLBACK_CREATURE_DISAPPEAR, cid)) then if(self.queue == nil or not self.queue:greetNext()) then local msg = self:getMessage(MESSAGE_WALKAWAY) local playerName = getPlayerName(cid) if not playerName then playerName = -1 end local parseInfo = { [TAG_PLAYERNAME] = playerName } msg = self:parseMessage(msg, parseInfo) self:say(msg, cid, true) self:releaseFocus(cid) end end end end end -- Returns true if cid is within the talkRadius of this npc. function NpcHandler:isInRange(cid) if not isPlayer(cid) then return false end local distance = getDistanceTo(cid) or -1 if distance == -1 then return false end return (distance <= self.talkRadius) end -- Resets the npc into it's initial state (in regard of the keyrodhandler). -- All modules are also receiving a reset call through their callbackOnModuleReset function. function NpcHandler:resetNpc() if(self:processModuleCallback(CALLBACK_MODULE_RESET)) then self.keywordHandler:reset() end end -- Makes the npc represented by this instance of NpcHandler say something. -- This implements the currently set type of talkdelay. -- shallDelay is a boolean value. If it is false, the message is not delayed. Default value is true. function NpcHandler:say(message, focus, publicize, shallDelay) if(shallDelay == nil) then shallDelay = true end if(NPCHANDLER_TALKDELAY == TALKDELAY_NONE or shallDelay == false) then if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then selfSay(message, focus, publicize and TRUE or FALSE) return else selfSay(message) return end end if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then self.talkDelay[focus] = { message = message, time = os.time() + self.talkDelayTime, publicize = publicize } else self.talkDelay = { message = message, time = os.time() + self.talkDelayTime } end end end O erro está certamente nesse arquivo npchandler.lua, mas como deram varios erros, é mais facil substituir tudo pra nao dar confusão.
-
Tenta esse: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid -- Conversa Jogador/NPC if(msgcontains(msg, 'list')) then selfSay('Eu vendo {Special Hat}, {Special Armor}, {Special Legs}, {Special Boots}, {Special Shield}, {Special BackPack}, {Vip Star}, {Special Wand} , {Special Sword}, {Special Axe}, {Special Club}, {Second Addon},por Moedas VIP', cid) elseif(msgcontains(msg, 'Special Hat')) then selfSay('Voc\ê quer comprar um Special Hat por 10 VIP coins?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'Special Armor')) then selfSay('Voc\ê quer comprar Special Armor por 12 VIP coins?', cid) talkState[talkUser] = 2 elseif(msgcontains(msg, 'Special Legs') )then selfSay('Voc\ê quer comprar Special Legs por 12 VIP coins?', cid) talkState[talkUser] = 3 elseif(msgcontains(msg, 'Special Boots') )then selfSay('Voc\ê quer comprar Special Boots por 12 VIP coins?', cid) talkState[talkUser] = 4 elseif(msgcontains(msg, 'Special Backpack') )then selfSay('Voc\ê quer comprar Special Backpack por 10 VIP coins?', cid) talkState[talkUser] = 5 elseif(msgcontains(msg, 'Vip Star') )then selfSay('Voc\ê quer comprar Vip Star por 15 VIP coins?', cid) talkState[talkUser] = 6 elseif(msgcontains(msg, 'Special Wand') )then selfSay('Voc\ê quer comprar Special Wand por 15 VIP coins?', cid) talkState[talkUser] = 7 elseif(msgcontains(msg, 'Special Sword') )then selfSay('Voc\ê quer comprar Special Sword por 15 VIP coins?', cid) talkState[talkUser] = 8 elseif(msgcontains(msg, 'Special Axe') )then selfSay('Voc\ê quer comprar Special Axe por 15 VIP coins?', cid) talkState[talkUser] = 9 elseif(msgcontains(msg, 'Special Club') )then selfSay('Voc\ê quer comprar Special Club por 15 VIP coins?', cid) talkState[talkUser] = 10 elseif(msgcontains(msg, 'Second Addon') )then selfSay('Voc\ê quer comprar Second Addon por 3 VIP coins?', cid) talkState[talkUser] = 11 elseif(msgcontains(msg, 'Special Shield') )then selfSay('Voc\ê quer comprar Second Addon por 12 VIP coins?', cid) talkState[talkUser] = 12 end -- Confirmação da Compra elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if(doPlayerRemoveItem(cid, 2157, 10) == true) then selfSay('Obrigado por comprar!', cid) doPlayerAddItem(cid, 6096, 1) talkState[talkUser] = 0 else selfSay('Voc\ê n\ão tem 10 VIP coins', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then if(doPlayerRemoveItem(cid, 2157, 12) == true) then selfSay('Obrigado por comprar!', cid) doPlayerAddItem(cid, 2653, 1) talkState[talkUser] = 0 else selfSay('Voc\ê n\ão tem 12 VIP coins', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 3) then if(doPlayerRemoveItem(cid, 2157, 12) == true) then selfSay('Obrigado por comprar!', cid) doPlayerAddItem(cid, 5918, 1) talkState[talkUser] = 0 else selfSay('Voc\ê n\ão tem 12 VIP coins', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 4) then if(doPlayerRemoveItem(cid, 2157, 12) == true) then selfSay('Obrigado por comprar!', cid) doPlayerAddItem(cid, 5462, 1) talkState[talkUser] = 0 else selfSay('Voc\ê n\ão tem 12 VIP coins', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 5) then if(doPlayerRemoveItem(cid, 2157, 10) == true) then selfSay('Obrigado por comprar!', cid) doPlayerAddItem(cid, 10518, 1) talkState[talkUser] = 0 else selfSay('Voc\ê n\ão tem 10 VIP coins', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 6) then if(doPlayerRemoveItem(cid, 2157, 15) == true) then selfSay('Obrigado por comprar!', cid) doPlayerAddItem(cid, 7366, 1) talkState[talkUser] = 0 else selfSay('Voc\ê n\ão tem 15 VIP coins', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 7) then if(doPlayerRemoveItem(cid, 2157, 15) == true) then selfSay('Obrigado por comprar!', cid) doPlayerAddItem(cid, 3961, 1) talkState[talkUser] = 0 else selfSay('Voc\ê n\ão tem 15 VIP coins', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 8) then if(doPlayerRemoveItem(cid, 2157, 15) == true) then selfSay('Obrigado por comprar!', cid) doPlayerAddItem(cid, 7366, 1) talkState[talkUser] = 0 else selfSay('Voc\ê n\ão tem 15 VIP coins', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 9) then if(doPlayerRemoveItem(cid, 2157, 15) == true) then selfSay('Obrigado por comprar!', cid) doPlayerAddItem(cid, 7453, 1) talkState[talkUser] = 0 else selfSay('Voc\ê n\ão tem 15 VIP coins', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 10) then if(doPlayerRemoveItem(cid, 2157, 15) == true) then selfSay('Obrigado por comprar!', cid) doPlayerAddItem(cid, 8929, 1) talkState[talkUser] = 0 else selfSay('Voc\ê n\ão tem 15 VIP coins', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 11) then if(doPlayerRemoveItem(cid, 2157, 3) == true) then selfSay('Obrigado por comprar!', cid) doPlayerAddItem(cid, 6527, 1) talkState[talkUser] = 0 else selfSay('Voc\ê n\ão tem 3 VIP coins', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 12) then if(doPlayerRemoveItem(cid, 2157, 12) == true) then selfSay('Obrigado por comprar!', cid) doPlayerAddItem(cid, 2527, 1) talkState[talkUser] = 0 else selfSay('Voc\ê n\ão tem 12 VIP coins', cid) talkState[talkUser] = 0 end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) T+
-
Procure se o arquivo npcsystem.lua existe na pasta do seu OT em seuot\data\npc\lib\npcsystem Caso não exista, crie um com isso dentro (talvez nao funcione por causa da versão) if(NpcSystem == nil) then -- Loads the underlying classes of the npcsystem. dofile('data/npc/lib/npcsystem/keywordhandler.lua') dofile('data/npc/lib/npcsystem/queue.lua') dofile('data/npc/lib/npcsystem/npchandler.lua') dofile('data/npc/lib/npcsystem/modules.lua') -- Global npc constants: -- Keyword nestling behavior. For more information look at the top of keywordhandler.lua KEYWORD_BEHAVIOR = BEHAVIOR_NORMAL_EXTENDED -- Greeting and unGreeting keywords. For more information look at the top of modules.lua FOCUS_GREETWORDS = {'hi', 'hello', 'hey'} FOCUS_FAREWELLWORDS = {'bye', 'farewell', 'cya'} -- The word for requesting trade window. For more information look at the top of modules.lua SHOP_TRADEREQUEST = {'offer', 'trade'} -- The word for accepting/declining an offer. CAN ONLY CONTAIN ONE FIELD! For more information look at the top of modules.lua SHOP_YESWORD = {'yes'} SHOP_NOWORD = {'no'} -- Pattern used to get the amount of an item a player wants to buy/sell. PATTERN_COUNT = '%d+' -- Talkdelay behavior. For more information, look at the top of npchandler.lua. NPCHANDLER_TALKDELAY = TALKDELAY_ONTHINK -- Conversation behavior. For more information, look at the top of npchandler.lua. NPCHANDLER_CONVBEHAVIOR = CONVERSATION_DEFAULT -- Constant strings defining the keywords to replace in the default messages. -- For more information, look at the top of npchandler.lua... TAG_PLAYERNAME = '|PLAYERNAME|' TAG_ITEMCOUNT = '|ITEMCOUNT|' TAG_TOTALCOST = '|TOTALCOST|' TAG_ITEMNAME = '|ITEMNAME|' TAG_QUEUESIZE = '|QUEUESIZE|' NpcSystem = {} -- Gets an npcparameter with the specified key. Returns nil if no such parameter is found. function NpcSystem.getParameter(key) local ret = getNpcParameter(tostring(key)) if((type(ret) == 'number' and ret == 0) or ret == nil) then return nil else return ret end end -- Parses all known parameters for the npc. Also parses parseable modules. function NpcSystem.parseParameters(npcHandler) local ret = NpcSystem.getParameter('idletime') if(ret ~= nil) then npcHandler.idleTime = tonumber(ret) end local ret = NpcSystem.getParameter('talkradius') if(ret ~= nil) then npcHandler.talkRadius = tonumber(ret) end local ret = NpcSystem.getParameter('message_greet') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_GREET, ret) end local ret = NpcSystem.getParameter('message_farewell') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_FAREWELL, ret) end local ret = NpcSystem.getParameter('message_decline') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_DECLINE, ret) end local ret = NpcSystem.getParameter('message_needmorespace') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDMORESPACE, ret) end local ret = NpcSystem.getParameter('message_needspace') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDSPACE, ret) end local ret = NpcSystem.getParameter('message_sendtrade') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_SENDTRADE, ret) end local ret = NpcSystem.getParameter('message_noshop') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NOSHOP, ret) end local ret = NpcSystem.getParameter('message_oncloseshop') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ONCLOSESHOP, ret) end local ret = NpcSystem.getParameter('message_onbuy') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ONBUY, ret) end local ret = NpcSystem.getParameter('message_onsell') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ONSELL, ret) end local ret = NpcSystem.getParameter('message_missingmoney') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_MISSINGMONEY, ret) end local ret = NpcSystem.getParameter('message_needmoney') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDMONEY, ret) end local ret = NpcSystem.getParameter('message_missingitem') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_MISSINGITEM, ret) end local ret = NpcSystem.getParameter('message_needitem') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDITEM, ret) end local ret = NpcSystem.getParameter('message_idletimeout') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_IDLETIMEOUT, ret) end local ret = NpcSystem.getParameter('message_walkaway') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_WALKAWAY, ret) end local ret = NpcSystem.getParameter('message_alreadyfocused') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ALREADYFOCUSED, ret) end local ret = NpcSystem.getParameter('message_placedinqueue') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_PLACEDINQUEUE, ret) end local ret = NpcSystem.getParameter('message_buy') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_BUY, ret) end local ret = NpcSystem.getParameter('message_sell') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_SELL, ret) end local ret = NpcSystem.getParameter('message_bought') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_BOUGHT, ret) end local ret = NpcSystem.getParameter('message_sold') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_SOLD, ret) end -- Parse modules. for parameter, module in pairs(Modules.parseableModules) do local ret = NpcSystem.getParameter(parameter) if(ret ~= nil) then local number = tonumber(ret) if(number ~= 0 and module.parseParameters ~= nil) then local instance = module:new() npcHandler:addModule(instance) instance:parseParameters() end end end end end
-
[Encerrado] Tentando Colocar Serve On
tópico respondeu ao alexmadalena de kmmyrawr em Tópicos Sem Resposta
Voces precisam liberar as portas do Roteador também. E eu digo a voces, é possivel hostear server com internet compartilhada ( a minha é! ) Não vou fazer um tutorial pois demora muito e não é valido para todos os roteadores. Procure mais a respeito sobre o seu roteador e descubra como liberar as portas para o tibia. Tutoriais que podem ajudar: Criando OT com Compartilhada Liberar portas do Modem
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.