Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''1.x''.



Mais opções de pesquisa

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Fóruns

  • A Cidade OTBR
    • OTServ Brasil
    • Atendimento
    • Taverna
  • Projetos Open Source
    • Canary
    • OTServBR-Global
    • Mehah OTClient
    • MyAAC
  • OpenTibia
    • Notícias e Discussões
    • Suporte - Dúvidas, Bugs, Erros
    • Downloads
    • Tutoriais
    • Show-Off
  • Outros
    • Design

Encontrado 6 registros

  1. Base: The Forgotten Server 1.3 (GustavoContreiras) , Versão: 10.98. Qual é a sua pergunta? Olá amigos, Tenho as seguintes linhas dentro do meu arquivo Player.h, na source uint32_t getSkillPoints() const { return skillPoints; } void setSkillPoints(uint32_t value) { skillPoints = value; } E gostaria de chamar essa função getSkillPoints dentro de um script LUA tentei chamar a função usando player:getSkillPoints() em um talkaction só pra testar se estava me voltando algum valor. Mas a resposta que tive no distro foi esta: Tenho que adicionar alguma LIB pra conseguir isso? Você tem o código disponível? Se tiver poste-o na caixa de código que está dentro do spoiler abaixo: Player.h Você tem alguma imagem que possa auxiliar no problema? Se sim, anexe-a dentro do spoiler abaixo:
  2. Olá senhoras e senhores, eu estava precisando de uma função dessa para utilizar no meu Baiak, e então decidi criar, e vim compartilhar com os senhores. function Position.isPvPZone(self) local tile = Tile(self) if not tile then return false end return tile:hasFlag(TILESTATE_PVPZONE) end Como utilizar: player:getPosition():isPvPZone() function Position.isPZZone(self) local tile = Tile(self) if not tile then return false end return tile:hasFlag(TILESTATE_PROTECTIONZONE) end Como utilizar: player:getPosition():isPZZone()
  3. [TFS 1.x] Reedem Points

    Reedem Points by vankk Basicamente esse script é você utilizar essa talkaction, e o jogador resgatar os pontos baseado no código de transação do PagSeguro. Irei explicar as configurações do script no final. Vá em data/talkactions/scripts e crie um arquivo .lua e coloque o nome de reedem_points.lua após isso, adicione esse código dentro dele; local config = { tableName = 'pagseguro_log', -- nome da tabela em sua database estructureTable = 'transacaoid', -- nome da estrutura da tabela tablePoints = 'pontos', -- nome da estrutura da tabela do pagseguro que mostra a qntidade de pontos que o jogador recebeu pointsEstructure = 'coins', -- nome da tabela de points do seu servidor } function onSay(player, words, param) local tables = {config.tableName, config.estructureTable, config.pointsEstructure, config.tablePoints} for i = 1, #tables do if not tables[i] then player:sendTextMessage(MESSAGE_EVENT_ORANGE, 'Por favor contate o Administrador do servidor, parece que ele configurou errado o script.') return false end end local tmpParam = param if not tmpParam then player:sendTextMessage(MESSAGE_EVENT_ORANGE, 'Por favor coloque o código de transação do PagSeguro.') return false end local resultId = db.storeQuery(string.format('SELECT * FROM `%s` WHERE `%s` = %s AND `reemded` = 0 ', config.tableName, config.estructureTable, db.escapeString(tmpParam))) if not resultId then player:sendTextMessage(MESSAGE_EVENT_ORANGE, 'Não existe esse código em nossa database ou então já foi resgatado.') return false end local amountPoints = result.getDataInt(resultId, config.tablePoints) result.free(resultId) db.query(string.format('UPDATE `%s` SET `reemded` = 1 WHERE `%s` = %s', config.tableName, config.estructureTable, db.escapeString(tmpParam))) db.query(string.format('UPDATE `accounts` SET `%s` = `%s` + %d WHERE `id` = %d', config.pointsEstructure, config.pointsEstructure, amountPoints, player:getAccountId())) player:sendTextMessage(MESSAGE_INFO_DESCR, string.format('Você resgatou com sucesso %d pontos utilizando o código %s.', amountPoints, tmpParam)) return false end Agora vá em data/talkactions/talkactions.xml e adicione essa tag <talkaction words="!points" separator=" " script="players/reedem_points.lua" /> Execute essa query em seu phpMyAdmin, mas antes de executar leia a explicação! ALTER TABLE `pagseguro_log` ADD `reemded` INT(1) NOT NULL DEFAULT '1'; Então vamos lá para a explicação, é bem importante que você preste atenção nessa caralha se não vai dar merda. No script eu adicionei a tabela config, no qual funciona da seguinte maneira: tableName = É o nome da tabela que fica o seu log das transações do PagSeguro estructureTable = É o nome da estrutura que fica dentro do log da transação do pagSeguro no qual guarda o código de transação tablePoints = É o nome da estrutura que fica dentro do log da transaçÃo do pagSeguro no qual guarda quantos pontos o jogador recebeu pointsEstructure = É o nome da estrutura que fica dentro da tabela accounts que guarda os pontos dos jogadores. Agora que você já sabe o que é o tableName, na query na qual eu falei acima você precisará mudar para o nome da sua tabela do log do PagSeguro. Por exemplo, caso o nome da sua tabela seja pagseguro_transactions, você muda para a parte pagseguro_log para pagseguro_transactions. Lembrando que não dou suporte então, caso não entendeu, leia novamente o tópico até entender, porque está de uma maneira bem explicada. Atenciosamente, vankk.
  4. Offline Message by vankk Eu estava codando um sistema de Auction para o Aura, e precisou dessa função, e gostaria de compartilhar com vocês para caso vocês precisem também. Basicamente o script irá enviar uma message para um jogador contendo uma mensagem. Execute em seu phpMyAdmin essa query: CREATE TABLE `offline_message` ( `id` int(11) NOT NULL AUTO_INCREMENT, `player_name` varchar(64) NOT NULL, `message` TEXT NOT NULL, PRIMARY KEY (`id`), FOREIGN KEY (`player_name`) REFERENCES `players`(`name`) ON DELETE CASCADE ) ENGINE=MyISAM DEFAULT CHARSET=latin1 Em data/global.lua adicione function doSendOfflineMessage(targetName, message) db.query(string.format('INSERT INTO `offline_message` (player_name, message) VALUES (%s, %s)', db.escapeString(targetName), db.escapeString(message))) end function Player.checkOfflineMessage(self, playerName) local resultId = db.storeQuery(string.format('SELECT * FROM `offline_message` WHERE `player_name` = %s', db.escapeString(playerName))) if resultId ~= false then local message = result.getDataString(resultId, "message") local id = result.getDataString(resultId, "id") self:sendTextMessage(MESSAGE_INFO_DESCR, string.format('Offline Message:\n%s', message)) db.query(string.format('DELETE FROM `offline_message` WHERE `id` = %d', id)) end end Em data/creaturescripts/login.lua adicione essa linha em qualquer parte do código antes do return true: player:checkOfflineMessage(player:getName()) Para enviar uma mensagem para algum jogador é doSendOfflineMessage(playerName, message). Por exemplo: doSendOfflineMessage('Vankk', 'Aura é o melhor servidor baiak de todos os tempos. Parabéns.') Até a próxima . vankk.
  5. Funções: Ao utilizar o comando !checkitem, itemId irá visualizar todos os jogadores da database no qual possuí o item sendo carregado no personagem e irá falar in-game. Script: function onSay(player, words, param) if not player:getGroup():getAccess() then return true end if not param then player:sendCancelMessage('Please type the command: !checkItem, itemId') return false end local itemId = tonumber(param) if not itemId then player:sendCancelMessage('The value should be numeric.') return false end local resultId = db.storeQuery(string.format('SELECT `name`, `id` FROM `players` WHERE `id` IN (SELECT `player_id` FROM `player_items` WHERE `itemtype` = %d)', itemId)) local message = string.format('Results from the search from the itemId %d in our database:\n\n', itemId) if resultId ~= false then repeat local playerName = result.getDataString(resultId, "name") local playerId = result.getDataInt(resultId, "id") local checkOnline = db.storeQuery(string.format('SELECT `player_id` FROM `players_online` WHERE `players_online`.`player_id` = %d', playerId)) if checkOnline ~= false then status = 'Online' else status = 'Offline' end message = message .. playerName .." [".. status .."]\n" until not result.next(resultId) result.free(resultId) else message = message .. "There is no players with this item at our server." end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, message) return false end NOTAS: Na tag do talkaction.xml precisa ter separator = " " Esse script só funciona na versão TFS 1.x do The Forgotten Server Créditos ao van key key AKA eu.
  6. [TFS 1.2] Prision Boss Script

    Prision Bosses TFS 1.2 by vankk Eu estava com um código bem ruim dos bosses da Prision Key no Aura, e resolvi atualizar, e decidi compartilhar aqui com vocês. Caso vocês queiram ver o script em funcionamento entre já em Aura. Clique aqui para ir para o site. O sistema está bem fácil de ser configurado, está tudo em tabelas, esse script é para os bosses: Zavarash, Horadron, Terofar. data/actions/actions.xml <action itemid="22606" script="prision_bosses.lua"/> <action itemid="22605" script="prision_bosses.lua"/> <action itemid="22604" script="prision_bosses.lua"/> data/actions/prision_bosses.lua local config = { [22606] = { targetId = 22636, -- Target ID. bossName = 'Zavarash', -- boss name keyPlayerPosition = Position(296, 1650, 12), -- Where the player should be. newPosition = Position(220, 1591, 13), -- Position to teleport bossPosition = Position(216, 1587, 13), -- Boss Position centerPosition = Position(215, 1591, 13), -- Center Room exitPosition = Position(293, 1634, 12), -- Exit Position rangeX = 20, -- Range in X rangeY = 20, -- Range in Y time = 15, -- time in minutes to remove the player }, [22605] = { targetId = 22634, -- Target ID. bossName = 'Horadron', -- boss name keyPlayerPosition = Position(291, 1650, 12), -- Where the player should be. newPosition = Position(293, 1676, 13), -- Position to teleport bossPosition = Position(300, 1677, 13), -- Boss Position centerPosition = Position(296, 1678, 13), -- Center Room exitPosition = Position(293, 1634, 12), -- Exit Position rangeX = 20, rangeY = 20, time = 15, -- time in minutes to remove the player }, [22604] = { targetId = 22638, -- Target ID. bossName = 'Terofar', -- boss name keyPlayerPosition = Position(302, 1650, 12), -- Where the player should be. newPosition = Position(257, 1675, 13), -- Position to teleport bossPosition = Position(260, 1676, 13), -- Boss Position centerPosition = Position(255, 1678, 13), -- Center Room exitPosition = Position(293, 1634, 12), -- Exit Position rangeX = 20, rangeY = 20, time = 15, -- time in minutes to remove the player } } local function roomIsOccupied(centerPosition, rangeX, rangeY) local spectators = Game.getSpectators(centerPosition, false, false, rangeX, rangeX, rangeY, rangeY) if #spectators ~= 0 then return true end return false end function clearBossRoom(playerId, centerPosition, rangeX, rangeY, exitPosition) local spectators, spectator = Game.getSpectators(centerPosition, false, false, rangeX, rangeX, rangeY, rangeY) for i = 1, #spectators do spectator = spectators[i] if spectator:isPlayer() and spectator.uid == playerId then spectator:teleportTo(exitPosition) exitPosition:sendMagicEffect(CONST_ME_TELEPORT) end if spectator:isMonster() then spectator:remove() end end end function onUse(player, item, fromPosition, target, toPosition, isHotkey) local tmpConfig = config[item.itemid] if not tmpConfig then return true end if target.itemid ~= tmpConfig.targetId then return true end local creature = Tile(tmpConfig.keyPlayerPosition):getTopCreature() if not creature or not creature:isPlayer() then return true end if roomIsOccupied(tmpConfig.centerPosition, tmpConfig.rangeX, tmpConfig.rangeY) then player:sendCancelMessage("There is someone in the room.") return true end local monster = Game.createMonster(tmpConfig.bossName, tmpConfig.bossPosition) if not monster then return true end -- Send message player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have entered an ancient demon prison cell!') player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have fifteen minutes to kill and loot this boss, else you will lose that chance.') -- Let's roll addEvent(clearBossRoom, 60 * tmpConfig.time * 1000, player:getId(), tmpConfig.centerPosition, tmpConfig.rangeX, tmpConfig.rangeY, tmpConfig.exitPosition) item:remove() player:teleportTo(tmpConfig.newPosition) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) return true end Não ensinarei a configurar a tabela, isso é uma tarefa bem fácil, e para não ter nada de mão beijada também né,
×