Ir para conteúdo

9k22

Membro
  • Registro em

  • Última visita

Tudo que 9k22 postou

  1. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    Bem, eu tenho um aki, vc pode configurar! Em action: function onUse(cid, item, fromPosition, itemEx, toPosition) local config = { creature = 'Summon Wolf', -- Nome da criatura maxsummon = 1, -- Numero maximo de summons level = 30, delay = 10, -- em minutos stor = 819902 } local function removeSummon(cid, summon) if not isCreature(cid) then return LUA_ERROR end if isCreature(summon) then doRemoveCreature(summon) end end if getPlayerLevel(cid) < config.level then return doPlayerSendCancel(cid, "Você precisa ter level "..config.level.." ou mais para usar o item.") elseif #getCreatureSummons(cid) >= config.maxsummon then return doPlayerSendCancel(cid, "Você já está com seu pet ativado.") elseif getPlayerStorageValue(cid, config.stor) >= os.time() then local minutos = math.floor((getPlayerStorageValue(cid,config.stor) - os.time())/(60)) return doPlayerSendCancel(cid, "Você deve esperar ".. (minutos <= 0 and getPlayerStorageValue(cid, config.stor) - os.time() or minutos) .." "..(minutos <= 0 and "segundos" or "minutos").." para usar esse item de novo.") elseif (getTilePzInfo(getCreaturePosition(cid))) then return doPlayerSendCancel(cid, "Você não pode usar esse item em PZ.") end local summon = doSummonCreature(config.creature, getCreaturePosition(cid)) doConvinceCreature(cid, summon) addEvent(removeSummon, config.delay*60*1000, cid, summon) setPlayerStorageValue(cid, config.stor, os.time()+config.delay*60) return true end Desculpa não lhe ajudar por completo, infelismente só dei uma passada aqui e vi teu tópic, anoite eu poderei lhe ajudar melhor! Qualquer coisa só postar...
  2. Esses duplicate não irá dar problema em nada, você pode abrir e testar normalmente... creio que não terá erro!
  3. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    Tenta ae (com warsystem): CREATE TABLE IF NOT EXISTS `guilds` ( `id` int(11) NOT NULL AUTO_INCREMENT, `world_id` tinyint(2) unsigned NOT NULL DEFAULT '0', `name` varchar(255) NOT NULL, `ownerid` int(11) NOT NULL, `creationdata` int(11) NOT NULL, `checkdata` int(11) NOT NULL, `motd` varchar(255) NOT NULL, `balance` bigint(20) unsigned NOT NULL, `description` text NOT NULL, `logo_gfx_name` varchar(255) NOT NULL DEFAULT '', `war` int(11) NOT NULL DEFAULT '0', `team` int(11) NOT NULL DEFAULT '0', `invited_to_war` int(11) NOT NULL DEFAULT '0', `join_date` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`,`world_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; Sem warsystem: CREATE TABLE IF NOT EXISTS `guilds` ( `id` int(11) NOT NULL AUTO_INCREMENT, `world_id` tinyint(2) unsigned NOT NULL DEFAULT '0', `name` varchar(255) NOT NULL, `ownerid` int(11) NOT NULL, `creationdata` int(11) NOT NULL, `checkdata` int(11) NOT NULL, `motd` varchar(255) NOT NULL, `balance` bigint(20) unsigned NOT NULL, `description` text NOT NULL, `logo_gfx_name` varchar(255) NOT NULL DEFAULT '', `team` int(11) NOT NULL DEFAULT '0', `join_date` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`,`world_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
  4. Intão chore ;x
  5. Ae galerinha, não sei se vocês já ouviram falar nesse game, mais ta ae. Hero Zero, é um jogo pareçido com gladiatus, tanoth etc... Você é um super nerd que gosta daqueles quadrinhos e que ser um heroi kkk Bem, o jogo não é muito facil, mais é divertido. Você Tem: Donuts para que serve? Simples ele pode ser usado pra diversa Formas por Exemplo: Vc pode comprar objetos preciosos Reduzir Tempos de Espera em missões ou treino Reabastecer sua Energia Adquirir Energéticos poderosos (50%) E muito mais Vamo galera, criaremos um time tibiaking e vamo domina, to lvl 34 XD http://br1.herozerogame.com/
  6. kkkkkkkk CARALHO EU RI MUITO com isso ksopAKSPOakso FeiaPraCaralho
  7. Vc está usando website? adicionou as query? Na pasta lib crie um arquivo .lua com o nome 101-war e adicione: WAR_GUILD = 0 WAR_ENEMY = 1 Ai você tenta...
  8. Retire a linha: ob_start("ob_gzhandler"); Ficando assim: <?PHP session_start(); ob_start("ob_gzhandler"); //require('./exaBD.php'); function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } $time_start = microtime_float(); //##### CONFIG ##### include('config-and-functions.php'); $action = $_REQUEST['action']; //##### LOGOUT ##### if($action == "logout") { unset($_SESSION['account']); unset($_SESSION['password']); }
  9. Tenta esse: function onSay(cid, words, param, channel) local guild = getPlayerGuildId(cid) if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER) then doPlayerSendChannelMessage(cid, "", "You cannot execute this talkaction.", TALKTYPE_CHANNEL_W, 0) return true end local t = string.explode(param, ",") if(not t[2]) then doPlayerSendChannelMessage(cid, "", "Not enough param(s).", TALKTYPE_CHANNEL_W, 0) return true end local enemy = getGuildId(t[2]) if(not enemy) then doPlayerSendChannelMessage(cid, "", "Guild \"" .. t[2] .. "\" does not exists.", TALKTYPE_CHANNEL_W, 0) return true end if(enemy == guild) then doPlayerSendChannelMessage(cid, "", "You cannot perform war action on your own guild.", TALKTYPE_CHANNEL_W, 0) return true end local enemyName, tmp = "", db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. enemy) if(tmp:getID() ~= -1) then enemyName = tmp:getDataString("name") tmp:free() end if(isInArray({"accept", "reject", "cancel"}, t[1])) then local query = "`guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild if(t[1] == "cancel") then query = "`guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy end tmp = db.getResult("SELECT `id`, `begin`, `end`, `payment` FROM `guild_wars` WHERE " .. query .. " AND `status` = 0") if(tmp:getID() == -1) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending invitation for a war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end if(t[1] == "accept") then local _tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = _tmp:getID() < 0 or _tmp:getDataInt("balance") < tmp:getDataInt("payment") _tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low to accept this invitation.", TALKTYPE_CHANNEL_W, 0) return true end db.executeQuery("UPDATE `guilds` SET `balance` = `balance` - " .. tmp:getDataInt("payment") .. " WHERE `id` = " .. guild) end query = "UPDATE `guild_wars` SET " local msg = "accepted " .. enemyName .. " invitation to war." if(t[1] == "reject") then query = query .. "`end` = " .. os.time() .. ", `status` = 2" msg = "rejected " .. enemyName .. " invitation to war." elseif(t[1] == "cancel") then query = query .. "`end` = " .. os.time() .. ", `status` = 3" msg = "canceled invitation to a war with " .. enemyName .. "." else query = query .. "`begin` = " .. os.time() .. ", `end` = " .. (tmp:getDataInt("end") > 0 and (os.time() + ((tmp:getDataInt("begin") - tmp:getDataInt("end")) / 86400)) or 0) .. ", `status` = 1" end query = query .. " WHERE `id` = " .. tmp:getDataInt("id") if(t[1] == "accept") then doGuildAddEnemy(guild, enemy, tmp:getDataInt("id"), WAR_GUILD) doGuildAddEnemy(enemy, guild, tmp:getDataInt("id"), WAR_ENEMY) end tmp:free() db.executeQuery(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. msg, MESSAGE_EVENT_ADVANCE) return true end if(t[1] == "invite") then local str = "" tmp = db.getResult("SELECT `guild_id`, `status` FROM `guild_wars` WHERE `guild_id` IN (" .. guild .. "," .. enemy .. ") AND `enemy_id` IN (" .. enemy .. "," .. guild .. ") AND `status` IN (0, 1)") if(tmp:getID() ~= -1) then if(tmp:getDataInt("status") == 0) then if(tmp:getDataInt("guild_id") == guild) then str = "You have already invited " .. enemyName .. " to war." else str = enemyName .. " have already invited you to war." end else str = "You are already on a war with " .. enemyName .. "." end tmp:free() end if(str ~= "") then doPlayerSendChannelMessage(cid, "", str, TALKTYPE_CHANNEL_W, 0) return true end local frags = tonumber(t[3]) if(frags ~= nil) then frags = math.max(10, math.min(1000, frags)) else frags = 100 end local payment = tonumber(t[4]) if(payment ~= nil) then payment = math.max(100000, math.min(1000000000, payment)) tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = tmp:getID() < 0 or tmp:getDataInt("balance") < payment tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low for such payment.", TALKTYPE_CHANNEL_W, 0) return true end db.executeQuery("UPDATE `guilds` SET `balance` = `balance` - " .. payment .. " WHERE `id` = " .. guild) else payment = 0 end local begining, ending = os.time(), tonumber(t[5]) if(ending ~= nil and ending ~= 0) then ending = begining + (ending * 86400) else ending = 0 end db.executeQuery("INSERT INTO `guild_wars` (`guild_id`, `enemy_id`, `begin`, `end`, `frags`, `payment`) VALUES (" .. guild .. ", " .. enemy .. ", " .. begining .. ", " .. ending .. ", " .. frags .. ", " .. payment .. ");") doBroadcastMessage(getPlayerGuildName(cid) .. " has invited " .. enemyName .. " to war till " .. frags .. " frags.", MESSAGE_EVENT_ADVANCE) return true end if(not isInArray({"end", "finish"}, t[1])) then return false end local status = (t[1] == "end" and 1 or 4) tmp = db.getResult("SELECT `id` FROM `guild_wars` WHERE `guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy .. " AND `status` = " .. status) if(tmp:getID() ~= -1) then local query = "UPDATE `guild_wars` SET `end` = " .. os.time() .. ", `status` = 5 WHERE `id` = " .. tmp:getDataInt("id") tmp:free() doGuildRemoveEnemy(guild, enemy) doGuildRemoveEnemy(enemy, guild) db.executeQuery(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. (status == 3 and "mend fences" or "ended up a war") .. " with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end if(status == 3) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending war truce from " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end tmp = db.getResult("SELECT `id`, `end` FROM `guild_wars` WHERE `guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild .. " AND `status` = 1") if(tmp:getID() ~= -1) then if(tmp:getDataInt("end") > 0) then tmp:free() doPlayerSendChannelMessage(cid, "", "You cannot request ending for war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end local query = "UPDATE `guild_wars` SET `status` = 4, `end` = " .. os.time() .. " WHERE `id` = " .. tmp:getDataInt("id") tmp:free() db.executeQuery(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has signed an armstice declaration on a war with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end doPlayerSendChannelMessage(cid, "", "Currently there's no active war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end Título do tópico editado e móvido! Leia as regras do fórum, por favor.
  10. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    Área errada denovo, você tem uma reputação muito baixa, cuidado cara! Movido...
  11. Tópico no lugar errado e titulo errado, leia as regras gerais por favor, tócico móvido!
  12. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    Up!
  13. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    uP! Me abandoranam kk
  14. Exato. Brigas não é aqui, se quiser falar algo, por favor envie um PM para ele ao invez de postar bobagem, isto é considerado flood. Leia as regras gerais, obrigado.
  15. Baixa por este site aqui: www.mpir.org/mpir-2.5.1.tar.bz2
  16. em config.lua no website: vc vai ver uma parte +/- assim você copia o meu e cola no seu: $vocation_name[0][0] = array(0 => 'None', 1 => 'Sorcerer', 2 => 'Druid', 3 => 'Paladin', 4 => 'Knight'); $vocation_name[0][1] = array(1 => 'Master Sorcerer', 2 => 'Elder Druid', 3 => 'Royal Paladin', 4 => 'Elite Knight'); $vocation_name[1][0] = array(0 => 'None', 1 => 'Sorcerer', 2 => 'Druid', 3 => 'Paladin', 4 => 'Knight'); $vocation_name[1][1] = array(1 => 'Master Sorcerer', 2 => 'Elder Druid', 3 => 'Royal Paladin', 4 => 'Elite Knight');
  17. em data>lib>vocations.lua Adicione as novas vocações!! Ou troque por este(fiz para vc): function isSorcerer(cid) return isInArray({1, 5, 9}, getPlayerVocation(cid)) end function isDruid(cid) return isInArray({2, 6, 10}, getPlayerVocation(cid)) end function isPaladin(cid) return isInArray({3, 7, 11}, getPlayerVocation(cid)) end function isKnight(cid) return isInArray({4, 8, 12}, getPlayerVocation(cid)) end function isRookie(cid) return isInArray({0}, getPlayerVocation(cid)) end
  18. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    Algum monstro na pasta monster está executando esses scripts, o erro apareçe pois esse script não existe em creaturescript, portanto, peço que vc axe o monstro e retire a função.
  19. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    Os grim reaper que você adicionou está tudo com 1 seg de respower, você não pode adiciona-los assim, vocÊ precisa remover e adiciona-los novamente (nunca segure o botão do mouse e saia adicionando o monstro).
  20. Nenhum faz o seguinte, ele deleta altomaticamente: Em globalevents/script coloca: ------------------------------------------------------------------------------* ----- [[> Automated Database Cleanup 1.1 Structure //By Cybermaster <]] ------| -------------- [[> System 2.0 Revamped by Teh Maverick <3 <]] ----------------| ------------- [[> Removal of empty accounts by darkaos <]] ---------------| --------------- [[> Function getDBPlayersCount() by Elf <]] ------------------| ------------------------------------------------------------------------------| ------------------------------------------------------------------------------| --- ~!READ THIS!~ ------------------------------------------------------------| --- Be sure to back up your database and test this on your server first, -----| --- I(Teh Maverick) cannot guarantee it will work the same for every core. ---| --- It is very easy to test, with the log file and values that are printed ---| -----------------------------------Enjoy!-------------------------------------| ------------------------------------------------------------------------------* function countRowsWhereInTable(table, field, condition) local result = db.getResult("SELECT COUNT(" .. field .. ") as count FROM " .. table .. " WHERE " .. field .. " = '" .. condition .. "';") local tmp = result:getDataInt("count") result:free() return tmp end function getDBPlayersCount() local result = db.getResult("SELECT COUNT(id) as count FROM `players`;") local tmp = result:getDataInt("count") result:free() return tmp end function getDBAccountsCount() local result = db.getResult("SELECT COUNT(id) as count FROM `accounts`;") local tmp = result:getDataInt("count") result:free() return tmp end function onstartup() local DB_BEFORE = {players = getDBPlayersCount(), accounts = getDBAccountsCount()} local result,result1, ii, numPlayersToDelete, numAccountsDeleted, tmp = 0, 0, 0, 0, 0 local pid, aid = {}, {} local dropCount = {players={},accounts={}} local config = { deleteAccountWithNoPlayers = true, cleanChildTables = true, printResult = true, saveResultToFile = true, logFileName = 'db_cleanup.txt' } --In each table, players with below specified level, and days of inactivity will be deleted from db on server startup local cleanup = { [1] = {level = 100, time = 7 * 24 * 60 * 60}, [2] = {level = 300, time = 60 * 24 * 60 * 60} } local childAttributeTables = { players = { [1] = {table = "`player_viplist`", idField = "`player_id`"}, [2] = {table = "`player_storage`", idField = "`player_id`"}, [3] = {table = "`player_spells`", idField = "`player_id`"}, [4] = {table = "`player_skills`", idField = "`player_id`"}, [5] = {table = "`player_namelocks`", idField = "`player_id`"}, [6] = {table = "`player_items`", idField = "`player_id`"}, [7] = {table = "`player_depotitems`", idField = "`player_id`"}, [8] = {table = "`houses`", idField = "`owner`"}, [9] = {table = "`house_auctions`", idField = "`player_id`"}, [10] = {table = "`players`", idField = "`id`"} -- Keep this as the last item in the array --Note: `houses` and `bans` are in the DB triggers for TFS so don't worry about them. --Also I did not want to put killers, or deaths on here because that is historic data, --do so at your ouwn risk. }, accounts = { [1] = {table = "`accounts`", idField = "`id`"}, [2] = {table = "`account_viplist`", idField = "`account_id`"} } } --Clean up all the players and player data for i = 1, #cleanup do result = db.getResult("SELECT `id`,`name`,`account_id` FROM `players` WHERE `level` < ".. cleanup[i].level .." AND `name` NOT IN('Account Manager', 'Sorcerer Sample', 'Druid Sample', 'Paladin Sample', 'Knight Sample', 'Rook Sample') AND `group_id` < 2 AND `lastlogin` < UNIX_TIMESTAMP() - ".. cleanup[i].time ..";") if(result:getID() ~= -1) then ii = 1 repeat pid[ii] = result:getDataInt("id") -- list the players id into an array aid[ii] = result:getDataInt("account_id") -- list the account id of each player being removed into an array ii = ii + 1 until not(result:next()) result:free() end numPlayersToDelete = ii - 1 --Drop players and their child table attribute data such as skills, items, etc. for j = 1, numPlayersToDelete do if(config.cleanChildTables) then for k = 1, #childAttributeTables.players do dropCount.players[k] = ((dropCount.players[k] or 0) + countRowsWhereInTable(childAttributeTables.players[k].table, childAttributeTables.players[k].idField, pid[j])) db.executeQuery("DELETE FROM " .. childAttributeTables.players[k].table .. " WHERE " .. childAttributeTables.players[k].idField .. " = '" .. pid[j] .. "';") end else db.executeQuery("DELETE FROM `players` WHERE `id` = '" .. pid[j] .. "';") end end end --Drop all the accounts that have 0 players linked to them (at the moment its only checking from the list of players removed) if config.deleteAccountWithNoPlayers then --This part was scripted by Darkhaos, modified/fixed by Teh Maverick --[[ for acc = 1, #aid do result1 = db.getResult("SELECT `id` FROM `accounts` WHERE `id` = '" .. aid[acc] .. "';") if result1:getID() ~= -1 then -- check to make sure the account exists result1:free() for i = 1, #childAttributeTables.accounts do --Make sure there are no other players on the account result1 = db.getResult("SELECT COUNT(id) as count FROM `players` WHERE `account_id` = '" .. aid[acc] .. "';") tmp = result1:getDataInt("count") if(tmp <= 0) then --Remove accounts dropCount.accounts[i] = ((dropCount.accounts[i] or 0) + countRowsWhereInTable(childAttributeTables.accounts[i].table, childAttributeTables.accounts[i].idField, aid[acc])) db.executeQuery("DELETE FROM " .. childAttributeTables.accounts[i].table .. " WHERE " .. childAttributeTables.accounts[i].idField .. " = '" .. aid[acc] .. "';") end end end end end --]] --Print and Save results (configurable) local DB_NOW = {players = DB_BEFORE.players - getDBPlayersCount(), accounts = DB_BEFORE.accounts - getDBAccountsCount()} if DB_NOW.players > 0 or DB_NOW.accounts > 0 then local text = ">> [DBCLEANUP] " .. DB_NOW.players .. " inactive players" .. (config.deleteAccountWithNoPlayers and " and " .. DB_NOW.accounts .. " empty accounts" or "") .. " have been deleted from the database." --Write to console if config.printResult then print("") print(text) if config.cleanChildTables then --Write player info for i = 1,#dropCount.players do print("[!] --> Dropped: " .. dropCount.players[i] .. " from " .. childAttributeTables.players[i].table .. " table") end --Write account info if config.deleteAccountWithNoPlayers then for i = 1,#dropCount.accounts do print("[!] --> Dropped: " .. dropCount.accounts[i] .. " from " .. childAttributeTables.accounts[i].table .. " table") end end print("") end end --Write to file if config.saveResultToFile then local file = io.open("data/logs/"..config.logFileName, "a") file:write("[" .. os.date("%d %B %Y %X ", os.time()) .. "] " .. text .. "\n") if config.cleanChildTables then --Write player info for i = 1, #dropCount.players do file:write("[!] --> Dropped: " .. dropCount.players[i] .. " from " .. childAttributeTables.players[i].table .. " table\n") end --Write account info if config.deleteAccountWithNoPlayers then for i = 1, #dropCount.accounts do file:write("[!] --> Dropped: " .. dropCount.accounts[i] .. " from " .. childAttributeTables.accounts[i].table .. " table\n") end end file:write("\n") end file:close() end end return true end [/code] Ai no mesmo lugar vc cria um arquivo .txt com o nome db_cleanup... Tag: [code] <globalevent name="dbcleaner" type="startup" event="script" value="dbcleaner.lua"/> Você só vai editar isso: [1] = {level = 100, time = 7 * 24 * 60 * 60}, [2] = {level = 300, time = 60 * 24 * 60 * 60} Level minimo e o tempo... Por exemplo: level 100- deletar acada 7 dias de inativo... level 300- deletar acada 2 meses de inativo...
  21. As town vai pelo config.lua caso seja acc manager, e vão pelo site quando vc usa website.
  22. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    Algumas coisas que eu quero perguntar... 1º - Se seu pc não possuir uma memória boa, infelismente não vai abrir um mapa! 2º - Quais são os erros que estão dando? tire uma foto de todos eles ou poste com mais clareza.
  23. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    aa eu tb gostaria de uma aula de script, assim não preciso me depender de outros kkk Brinkss, mais séria uma boa, aulas de mapper já tem, agr de script não vi.
  24. 9k22 postou uma resposta no tópico em Ouvidoria
    Aprovadissimo... Excluir contas com 0~2 posts que não entram a 6 meses +/- era uma boa ídeia. Mais de qualquer maneira, deletando ou não, não iria preojudicar nada.

Informação Importante

Confirmação de Termo