
eduardogaier
Mapper-
Total de Posts
7 -
Registro em
-
Última visita
Tipo de Conteúdo
Fóruns
Downloads
Galeria
Perfis
Tudo que eduardogaier postou
-
Fiz um ajuste no meu assim que eu tiver tempo eu atualizo o tópico
-
Tutorial para Integração do Módulo de Chat no Otcv8 Passo 1: Colar o Arquivo module game_chat na Pasta modules Copie o arquivo game_chat. Navegue até a pasta modules do seu projeto. Cole o arquivo game_chat dentro da pasta modules. Cole as fontes da pasta "fontes" dentro do diretorio: data/fontes. Passo 2: Colocar as Pastas de Imagens e Seus Respectivos Diretórios Diretório das Imagens: Chat: data/imagens/game/chat Console: data/imagens/game/console Player Info: data/imagens/game/playerinfo Passo 3: Editar o Arquivo 10-buttons.otui Abra o arquivo data/styles/10-buttons.otui no seu editor de texto. Pesquise por TabButton < UIButton. Acima dessa linha, cole o seguinte código: TabChatButton < UIButton size: 24 24 image-source: /images/game/chat/tabBarButtons image-clip: 0 0 24 24 icon-color: white opacity: 0.6 $hover: image-clip: 0 24 24 24 opacity: 1.0 $disabled: icon-color: #888888 opacity: 0.5 Passo 4: Editar o Arquivo interface.lua Abra o arquivo module/game_interface/interface.lua. Pesquise pela função bindKeys(): function bindKeys() gameRootPanel:setAutoRepeatDelay(10) local lastAction = 0 g_keyboard.bindKeyPress('Escape', function() if lastAction + 50 > g_clock.millis() then return end lastAction = g_clock.millis() g_game.cancelAttackAndFollow() end, gameRootPanel) g_keyboard.bindKeyPress('Ctrl+=', function() if g_game.getFeature(GameNoDebug) then return end gameMapPanel:zoomIn() end, gameRootPanel) g_keyboard.bindKeyPress('Ctrl+-', function() if g_game.getFeature(GameNoDebug) then return end gameMapPanel:zoomOut() end, gameRootPanel) g_keyboard.bindKeyDown('Ctrl+Q', function() tryLogout(false) end, gameRootPanel) g_keyboard.bindKeyDown('Ctrl+L', function() tryLogout(false) end, gameRootPanel) g_keyboard.bindKeyDown('Ctrl+W', function() g_map.cleanTexts() modules.game_textmessage.clearMessages() end, gameRootPanel) end Abaixo dessa função, adicione o seguinte código: function unbindWalkKey(key) g_keyboard.unbindKeyDown(key, gameRootPanel) g_keyboard.unbindKeyUp(key, gameRootPanel) g_keyboard.unbindKeyPress(key, gameRootPanel) end Passo 5: Remover o Chat Antigo Abra o arquivo modules/gameinterface/gameinterface.otmod. Remova a referência para game_console, deixando apenas game_chat. Passo 6: Editar textmessage.lua Abra o arquivo modules/textmessage.lua. Encontre a seguinte linha: if msgtype.consoleTab ~= nil and (msgtype.consoleOption == nil or modules.client_options.getOption(msgtype.consoleOption)) then modules.game_console.addText(text, msgtype, tr(msgtype.consoleTab)) end Altere para: if msgtype.consoleTab ~= nil and (msgtype.consoleOption == nil or modules.client_options.getOption(msgtype.consoleOption)) then modules.game_chat.addText(text, msgtype, tr(msgtype.consoleTab)) end Conclusão Seguindo esses passos, o novo módulo de chat deve estar corretamente integrado ao seu jogo. Certifique-se de verificar a identação e qualquer erro de sintaxe ao longo do processo. Boa sorte! Obs: O tutorial ensina a instalação do chat e remoção do próprio do otc, porem a configuração da janela na interface fica por conta do usuário. Scan:[Hidden Content]== Module custom chat.rar
- 11 respostas
-
- 56
-
-
-
-
-
NpcDialog Modal Completo
eduardogaier respondeu ao tópico de eduardogaier em TFS 0.X, Compartilhe seu código C++, LUA, PHP e etc
Salve postado -
NpcDialog Modal Completo
eduardogaier postou um tópico no fórum em TFS 0.X, Compartilhe seu código C++, LUA, PHP e etc
Tutorial de Instalação e Configuração do Módulo npcdialog Instalação Colocar a pasta do módulo no cliente: Copie a pasta game interface e cole na pasta modules do seu cliente ou utilize o arquivo de exemplo da pasta para comparar com o seu. Adicionar o arquivo da biblioteca no servidor: Copie o arquivo npcdialog_lib e cole na pasta /servidor/data/lib do seu servidor. No Arquivo lib.lua adicione a referencia do arquivo . "dofile('data/lib/npcdialog.lib')" Inserir arquivos de exemplo do NPC: Pegue o arquivo de NPC de exemplo chamado prefeito. Coloque os arquivos eduardo.lua e eduardo.xml na pasta dos NPCs. Configuração para Habilitar a Modal ao Clicar no NPC Editar a interface do jogo: Dentro da pasta game interface, abra o arquivo necessário. Procurar pela função específica: Procure pela função function processMouseAction. Substituir o código: Substitua o conteúdo da função processMouseAction pelo código fornecido a seguir. function processMouseAction(menuPosition, mouseButton, autoWalkPos, lookThing, useThing, creatureThing, attackCreature, marking) local keyboardModifiers = g_keyboard.getModifiers() if g_app.isMobile() then if mouseButton == MouseRightButton then createThingMenu(menuPosition, lookThing, useThing, creatureThing) return true end if mouseButton ~= MouseLeftButton and mouseButton ~= MouseTouch2 and mouseButton ~= MouseTouch3 then return false end local action = getLeftAction() if action == "look" then if lookThing then resetLeftActions() g_game.look(lookThing) return true end return true elseif action == "use" then if useThing then resetLeftActions() if useThing:isContainer() then if useThing:getParentContainer() then g_game.open(useThing, useThing:getParentContainer()) else g_game.open(useThing) end return true elseif useThing:isMultiUse() then startUseWith(useThing) return true else g_game.use(useThing) return true end end return true elseif action == "attack" then if attackCreature and attackCreature ~= player then resetLeftActions() g_game.attack(attackCreature) return true elseif creatureThing and creatureThing ~= player and creatureThing:getPosition().z == autoWalkPos.z then resetLeftActions() g_game.attack(creatureThing) return true end return true elseif action == "follow" then if attackCreature and attackCreature ~= player then resetLeftActions() g_game.follow(attackCreature) return true elseif creatureThing and creatureThing ~= player and creatureThing:getPosition().z == autoWalkPos.z then resetLeftActions() g_game.follow(creatureThing) return true end return true elseif not autoWalkPos and useThing then createThingMenu(menuPosition, lookThing, useThing, creatureThing) return true end elseif not modules.client_options.getOption('classicControl') then if keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton then createThingMenu(menuPosition, lookThing, useThing, creatureThing) return true elseif lookThing and keyboardModifiers == KeyboardShiftModifier and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then g_game.look(lookThing) return true elseif useThing and keyboardModifiers == KeyboardCtrlModifier and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then if useThing:isContainer() then if useThing:getParentContainer() then g_game.open(useThing, useThing:getParentContainer()) else g_game.open(useThing) end return true elseif useThing:isMultiUse() then startUseWith(useThing) return true else g_game.use(useThing) return true end return true elseif attackCreature and g_keyboard.isAltPressed() and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then g_game.attack(attackCreature) return true elseif creatureThing and creatureThing:getPosition().z == autoWalkPos.z and g_keyboard.isAltPressed() and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then g_game.attack(creatureThing) return true elseif creatureThing.isNpc() and g_keyboard.isAltPressed() and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then local destPos = attackCreature:getPosition() local myPos = g_game.getLocalPlayer():getPosition() if ((destPos.x >= myPos.x - 3) and (destPos.x <= myPos.x + 3) and (destPos.y >= myPos.y - 3) and (destPos.y <= myPos.y + 3)) then scheduleEvent(g_game.talkChannel(11,0,"hi"), 500) else modules.game_textmessage.displayFailureMessage("Você não pode conversar com o NPC pois você está muito longe. Aproxime-se e tente novamente.") end return true end else if useThing and keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton and not g_mouse.isPressed(MouseLeftButton) then local player = g_game.getLocalPlayer() if attackCreature and attackCreature ~= player then if not attackCreature:isNpc() then g_game.attack(attackCreature) else local destPos = attackCreature:getPosition() local myPos = player:getPosition() if ((destPos.x >= myPos.x - 3) and (destPos.x <= myPos.x + 3) and (destPos.y >= myPos.y - 3) and (destPos.y <= myPos.y + 3)) then scheduleEvent(g_game.talkChannel(11,0,"hi"), 500) else modules.game_textmessage.displayFailureMessage("Você não pode conversar com o NPC pois você está muito longe. Aproxime-se e tente novamente.") end end return true elseif creatureThing and creatureThing ~= player and creatureThing:getPosition().z == autoWalkPos.z then g_game.attack(creatureThing) return true elseif useThing:isContainer() then if useThing:getParentContainer() then g_game.open(useThing, useThing:getParentContainer()) return true else g_game.open(useThing) return true end elseif useThing:isMultiUse() then startUseWith(useThing) return true else g_game.use(useThing) return true end return true elseif lookThing and keyboardModifiers == KeyboardShiftModifier and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then g_game.look(lookThing) return true elseif lookThing and ((g_mouse.isPressed(MouseLeftButton) and mouseButton == MouseRightButton) or (g_mouse.isPressed(MouseRightButton) and mouseButton == MouseLeftButton)) then g_game.look(lookThing) return true elseif useThing and keyboardModifiers == KeyboardCtrlModifier and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then createThingMenu(menuPosition, lookThing, useThing, creatureThing) return true elseif attackCreature and g_keyboard.isAltPressed() and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then g_game.attack(attackCreature) return true elseif creatureThing and creatureThing:getPosition().z == autoWalkPos.z and g_keyboard.isAltPressed() and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then g_game.attack(creatureThing) return true end end local player = g_game.getLocalPlayer() player:stopAutoWalk() if autoWalkPos and keyboardModifiers == KeyboardNoModifier and (mouseButton == MouseLeftButton or mouseButton == MouseTouch2 or mouseButton == MouseTouch3) then local autoWalkTile = g_map.getTile(autoWalkPos) if autoWalkTile and not autoWalkTile:isWalkable(true) then modules.game_textmessage.displayFailureMessage(tr('Sorry, not possible.')) return false end player:autoWalk(autoWalkPos) return true end return false end Dentro da pasta fornecida com os arquivos tem o arquivo interface.lua, não utilize-o , ele serve para você poder comparar a linha, facilitando o trabalho. Pronto só aproveitar o module. SCAM:[Hidden Content] Créditos:Thales script para clicar no Npc. NpcDialog.rar- 6 respostas
-
- 27
-
-
-
Sistema de Roleta
eduardogaier postou um tópico no fórum em TFS 0.X, Compartilhe seu código C++, LUA, PHP e etc
Olá galera estou disponibilizando o script da Roleta, como mostra a imagem abaixo tem que fazer comforme a imagem , não sei se funciona se aumentar a quantidade de itens, mas pode criar mais de um script e colocar em actroleta.luaions diferentes. Deixo os créditos do meu RL " Olivera " e " Nyedson " que fizeram esse script. -
Opa estou criando esse npc onde ele me dara 5 missoes para fazer, é atualizado no questlog, é claro que cada missao libera a proxima, estou meio perdido na separação das missoes e to achando o codigo muito grande com muitas checagens de storage, se alguem puder dar uma olhada e me dar laguma dica de como otimizar agradeço. local internalNpcName = "Wagner" local npcType = Game.createNpcType(internalNpcName) local npcConfig = {} npcConfig.name = internalNpcName npcConfig.description = internalNpcName npcConfig.health = 100 npcConfig.maxHealth = npcConfig.health npcConfig.walkInterval = 1000 npcConfig.walkRadius = 2 npcConfig.outfit = { lookType = 432, lookHead = 114, lookBody = 0, lookLegs = 114, lookFeet = 0, lookAddons = 3 } npcConfig.flags = { floorchange = false } --- Mensagens automaticas que seram ditas sem a interação npcConfig.voices = { interval = 15000, chance = 50, { text = 'Sentindo-se perdido, meu filho? Peça-me dicas ou ajuda!' }, { text = 'Sou o cidadão Mais antigo de todos!' }, { text = 'Bem-vindo a cidade de RookLand!' }, { text = 'Vendo Backpack de UH venha conferir!' } } local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) npcType.onThink = function(npc, interval) npcHandler:onThink(npc, interval) end npcType.onAppear = function(npc, creature) npcHandler:onAppear(npc, creature) end npcType.onDisappear = function(npc, creature) npcHandler:onDisappear(npc, creature) end npcType.onMove = function(npc, creature, fromPosition, toPosition) npcHandler:onMove(npc, creature, fromPosition, toPosition) end npcType.onSay = function(npc, creature, type, message) npcHandler:onSay(npc, creature, type, message) end npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end local topic = {} local renown = {} local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() if not npcHandler:checkInteraction(npc, creature) then return false end if MsgContains(message, 'no') or MsgContains(message, 'não') then npcHandler:say('Ok, até a próxima.', npc, creature) npcHandler:removeInteraction(npc, creature) npcHandler:resetNpc(creature) elseif MsgContains(message, 'trabalho') then if player:getStorageValue(60163) == -1 then npcHandler:say('Ok, Anderson o Alquimista está me devendo 5 blank Runes, você poderia buscar para mim? {yes} ou {no}', npc, creature) topic[playerId] = 1 elseif player:getStorageValue(60163) == 1 then npcHandler:say('Você já está participando da missão. Lembre-se de trazer as runas. {Entregar}', npc, creature) elseif player:getStorageValue(60164) == 2 then npcHandler:say('Iai trouxe as runas ? {Entregar}', npc, creature) end elseif topic[playerId] == 1 and (MsgContains(message, 'yes') or MsgContains(message, 'sim')) then npcHandler:say('Ótimo! Vá até a saída sul esquerda da cidade e fale com o Anderson e me traga as Blank Runes.', npc, creature) player:setStorageValue(60163, 1) player:setStorageValue(60164, 1) npcHandler:removeInteraction(npc, creature) npcHandler:resetNpc(creature) elseif MsgContains(message, 'Entregar') then if player:getItemCount(3147) >= 5 then if player:getStorageValue(60164) == 2 then npcHandler:say('Você me trouxe as runas? {yes} ou {no}', npc, creature) topic[playerId] = 2 else npcHandler:say('Volte lá e me traga as runas logo.', npc, creature) npcHandler:removeInteraction(npc, creature) npcHandler:resetNpc(creature) end else npcHandler:say('Volte lá e me traga as runas logo.', npc, creature) npcHandler:removeInteraction(npc, creature) npcHandler:resetNpc(creature) end end if topic[playerId] == 2 and (MsgContains(message, 'yes') or MsgContains(message, 'sim')) then if player:removeItem(3147, 5) then npcHandler:say('Parabéns! Você concluiu seu primeiro trabalho. Aqui está sua recompensa.', npc, creature) -- entrega os itens e já dá a xp, não precisa de mais nada além disso player:addExperience(500, true) player:setStorageValue(60164, 3) else npcHandler:say('Você não possui os itens necessários.', npc, creature) end npcHandler:removeInteraction(npc, creature) npcHandler:resetNpc(creature) elseif player:getStorageValue(60164) == 3 and topic[playerId] ~= 2 then npcHandler:say('Você já concluiu esta missão. Vamos para a missão {mission2} ?', npc, creature) topic[playerId] = 3 end if topic[playerId] == 3 and (MsgContains(message, 'yes') or MsgContains(message, 'sim')) then if player:getStorageValue(60164) == 3 then npcHandler:say('Você já concluiu esta missão. Vamos para a missão {mission2} ?', npc, creature) topic[playerId] = 4 else npcHandler:say('Você já concluiu esta missão. O que você quer fazer agora?', npc, creature) npcHandler:removeInteraction(npc, creature) npcHandler:resetNpc(creature) end end if topic[playerId] == 4 and MsgContains(message, 'mission2') then if player:getStorageValue(60164) == 3 then if player:getStorageValue(60165) == 1 then npcHandler:say('Ok, pegue esta foice e corte 5 trigos.', npc, creature) player:setStorageValue(60165, 2) else npcHandler:say('Você já pegou a foice. Vá cortar os trigos!', npc, creature) end else npcHandler:say('Você já concluiu esta missão. O que você quer fazer agora?', npc, creature) end npcHandler:removeInteraction(npc, creature) npcHandler:resetNpc(creature) end return true end local function onReleaseFocus(npc, creature) local playerId = creature:getId() topic[playerId], renown[playerId] = nil, nil end keywordHandler:addKeyword({'informação'}, StdModule.say, {npcHandler = npcHandler, text = 'A ok eu gosto de ser objetivo tenho alguns tópicos que talvez te interessar como:\n {minha vida} \n{rookland} \n{missões}.'}) keywordHandler:addKeyword({'minha vida'}, StdModule.say, {npcHandler = npcHandler, text = 'Eu sempre fiquei na frente do DP runando UH, para vender para outros guerreiros, não fiquei rico, mas consegui me manter por um tempo.\n Assim adquiri muito conhecimento da cidade e conheci muitas pessoas, por isso pode me perguntar qualquer coisa que poderei te ajudar.\n só não me peça para fazer LMMs que tenho uma péssima lembrança sobre isso, consegui chegar apenas até o nível 24, mas quem sabe posso te ajudar a alcançar este nível também! {informação} '}) keywordHandler:addKeyword({'rookland'}, StdModule.say, {npcHandler = npcHandler, text = 'Rookland é um pequeno vilarejo de fazendeiros, onde há inúmeras possibilidades de trabalhos e missões, onde você pode provar o seu valor, ter sua casa, sua plantação e se tornar um ótimo Guerreiro, Druida, Sorcerer, Paladino ou até mesmo um arqueiro, logo te darei mais informações, no momento estou meio ocupado, tenho que entregar algumas UHSS.'}) keywordHandler:addKeyword({'missões'}, StdModule.say, {npcHandler = npcHandler, text = 'Humm! você veio da batalha e não tem nada, mas eu posso arranjar algum trabalho para você se reerguer, porem não sairá de graça. Você aceita o {trabalho} ?'}) npcHandler:setMessage(MESSAGE_GREET, 'Olá |PLAYERNAME|, Olá eu posso te ajudar com alguma, {informação} ?') npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:setCallback(CALLBACK_REMOVE_INTERACTION, onReleaseFocus) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) -- npcType registering the npcConfig table npcType:register(npcConfig)
- 2 respostas
-
- 13
-
-
×
- Criar Novo...