Ir para conteúdo

Vodkart

Héroi
  • Registro em

Tudo que Vodkart postou

  1. tenta if potion.health then doTargetCombatHealth(0, target, COMBAT_HEALING, potion.health[1], potion.health[2]) end if potion.mana then doTargetCombatMana(0, target, COMBAT_MANADRAIN, potion.mana[1], potion.mana[2]) end
  2. ué, testa assim local config = { level_add = 20, max_ofertas = 5, ofertas_pz = true, itens_bloqueados = {2165, 2152, 2148, 2160, 2166, 2167, 2168, 2169, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2343, 2433, 2640, 6132, 6300, 6301, 9932, 9933} } function onSay(player, words, param) if (param == 'saldo') then local consulta = db.storeQuery("SELECT * FROM `players` WHERE `id` = " .. player:getGuid() .. ";") local saldo = result.getNumber(consulta, "auction_balance") player:sendTextMessage(MESSAGE_INFO_DESCR, "Seu saldo é de " .. saldo .. " gps de suas vendas no mercado!") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Seu saldo é de " .. saldo .. " gps de suas vendas no mercado!") return true end if(param == '') or (param == 'info') then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Comandos para utilizar este sistema:\n!oferta saldo\nUse este comando para verificar o saldo de suas vendas.\n!oferta add, nomedoitem, preço, qtd\nexemplo: !oferta add,plate armor,500,1\n\n\n!oferta comprar,id_da_compra\nexemplo: !oferta comprar,1943\n\n\n!oferta remover,id_da_compra\nexemplo: !oferta remover,1943\n\n\n!oferta sacar, qtd\nexemplo: !oferta sacar, 1000.\n") return true end local split = param:split(",") if split[2] == nil then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Parâmetros necessários. Use !oferta info para mais informações!") return false end split[2] = split[2]:gsub("^%s*(.-)$", "%1") _BUSCA_DB = db.storeQuery("SELECT * FROM `auction_system` WHERE `player` = " .. player:getGuid()) if(split[1] == "add") then if(not tonumber(split[3]) or (not tonumber(split[4]))) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Use somente números.") return true end if(string.len(split[3]) > 7 or (string.len(split[4]) > 3)) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Este preço ou a quantidade itens é muito alta.") return true end local itemType, item_s = ItemType(split[2]), ItemType(split[2]):getId() if(not item_s) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "O item "..itemType.." não existe!") return true end if(player:getLevel() < config.level_add) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas vcê precisa de level igual ou superior a (" .. config.level_add .. ") para continuar.") return true end if(isInArray(config.itens_bloqueados, item_s)) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode adicionar este item.") return true end if(player:getItemCount(item_s) < tonumber(split[4])) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você não tem este item.") return true end local amount, tmp_BUSCA_DB = 0, _BUSCA_DB while tmp_BUSCA_DB ~= false do tmp_BUSCA_DB = result.next(_BUSCA_DB) amount = amount + 1 end if _BUSCA_DB ~= false then local limit = amount >= config.max_ofertas if limit then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você atingiu o limite máximo(" .. config.max_ofertas .. ") de publicações de venda de itens.") return true end if(config.SendOffersOnlyInPZ) then if(not getTilePzInfo(player:getPosition())) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você só pode usar este comando estando em protection zone.") return true end end end if(tonumber(split[4]) < 1 or (tonumber(split[3]) < 1)) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você precisa informar um número maior que 0.") return true end local itemcount, costgp = math.floor(split[4]), math.floor(split[3]) player:removeItem(item_s, itemcount) db.query("INSERT INTO `auction_system` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`) VALUES (" .. player:getGuid() .. ", \"" .. split[2] .. "\", " .. item_s .. ", " .. itemcount .. ", " .. costgp ..", " .. os.time() .. ")") player:sendTextMessage(MESSAGE_INFO_DESCR, "Parabéns! Você adicionou para à venda " .. itemcount .." " .. split[2] .." por " .. costgp .. " gps!") end if(split[1] == "comprar") then _BUSCA_DB = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = ".. tonumber(split[2])) local player_id, player_vendas, item_ids, costs, item_names, counts = player:getGuid(), result.getNumber(_BUSCA_DB, "player"), result.getNumber(_BUSCA_DB, "item_id"), result.getNumber(_BUSCA_DB, "cost"), result.getString(_BUSCA_DB, "item_name"), result.getNumber(_BUSCA_DB, "count") if(not tonumber(split[2])) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas somente números são aceitos.") return true end if(_BUSCA_DB ~= false) then local total_custo = costs - player:getMoney() if(player:getMoney() < costs) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você não possuí a quantia necessária para comprar. São necessários: "..costs.."gps para comprar o item: "..item_names..". Você tem: " .. player:getMoney() .. "gps. Você precisa de: "..total_custo.." gps.") return true end if(player_id == player_vendas) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você não pode comprar seu próprio item.") return true end if player:removeMoney(costs) then if(isItemStackable((item_ids))) then player:addItem(item_ids, counts) else for i = 1, counts do player:addItem(item_ids, 1) end end db.query("DELETE FROM `auction_system` WHERE `id` = " .. split[2] .. ";") player:sendTextMessage(MESSAGE_INFO_DESCR, "Parabéns! Você comprou " .. counts .. " ".. item_names .. " por " .. costs .. " gps com sucesso!") db.query("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. costs .. " WHERE `id` = " .. player_vendas .. ";") end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas o ID "..split[2].." não existe!.") end end if(split[1] == "remover") then local _BUSCA_DB = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = ".. tonumber(split[2])) local player_id, player_vendas, item_ids, costs, item_names, counts = player:getGuid(), result.getNumber(_BUSCA_DB, "player"), result.getNumber(_BUSCA_DB, "item_id"), result.getNumber(_BUSCA_DB, "cost"), result.getString(_BUSCA_DB, "item_name"), result.getNumber(_BUSCA_DB, "count") if((not tonumber(split[2]))) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas somente números são aceitos.") return true end if(config.SendOffersOnlyInPZ) then if(not getTilePzInfo(player:getPosition())) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you remove offerts from database.") return true end end if(_BUSCA_DB ~= false) then if(player_id == player_vendas) then db.query("DELETE FROM `auction_system` WHERE `id` = " .. split[2] .. ";") if(isItemStackable(item_ids)) then player:addItem(item_ids, counts) else for i = 1, counts do player:addItem(item_ids, 1) end end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns! A oferta "..split[2].." foi removida com sucesso do mercado.\nVocê recebeu: "..counts.." "..item_names..".") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas essa oferta não é sua.") end result.free(resultado) else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas este ID não existe.") end end if(split[1] == "sacar") then if((not tonumber(split[2]))) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas somente números são aceitos.") return true end local balance = db.storeQuery("SELECT * FROM `players` WHERE `id` = " .. player:getGuid() .. ";") local auction_balance = result.getNumber(balance, "auction_balance") <= 0 and 0 or result.getNumber(balance, "auction_balance") if(auction_balance < 1) then player:sendTextMessage(MESSAGE_INFO_DESCR, "Você não possuí saldo suficiente para sacar.") result.free(balance) return true elseif tonumber(split[2]) <= 0 or tonumber(split[2]) > auction_balance then player:sendTextMessage(MESSAGE_INFO_DESCR,tonumber(split[2]) <= 0 and "Você tem que digitar um valor maior que 0." or "Você somente pode sacar o total de "..auction_balance..".") result.free(balance) return true end local tz = auction_balance - tonumber(split[2]) player:sendTextMessage(MESSAGE_INFO_DESCR, "Você sacou " .. split[2] .. " gps de suas vendas no mercado! Seu saldo é de: "..tz.."gps.") player:addMoney(tz) db.query("UPDATE `players` SET `auction_balance` = ".. tz .." WHERE `id` = " .. player:getGuid() .. ";") result.free(balance) end return true end
  3. Acho que desse jeito não terá problemas, nem se colocar um número negativo! local config = { level_add = 20, max_ofertas = 5, ofertas_pz = true, itens_bloqueados = {2165, 2152, 2148, 2160, 2166, 2167, 2168, 2169, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2343, 2433, 2640, 6132, 6300, 6301, 9932, 9933} } function onSay(player, words, param) if (param == 'saldo') then local consulta = db.storeQuery("SELECT * FROM `players` WHERE `id` = " .. player:getGuid() .. ";") local saldo = result.getNumber(consulta, "auction_balance") player:sendTextMessage(MESSAGE_INFO_DESCR, "Seu saldo é de " .. saldo .. " gps de suas vendas no mercado!") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Seu saldo é de " .. saldo .. " gps de suas vendas no mercado!") return true end if(param == '') or (param == 'info') then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Comandos para utilizar este sistema:\n!oferta saldo\nUse este comando para verificar o saldo de suas vendas.\n!oferta add, nomedoitem, preço, qtd\nexemplo: !oferta add,plate armor,500,1\n\n\n!oferta comprar,id_da_compra\nexemplo: !oferta comprar,1943\n\n\n!oferta remover,id_da_compra\nexemplo: !oferta remover,1943\n\n\n!oferta sacar, qtd\nexemplo: !oferta sacar, 1000.\n") return true end local split = param:split(",") if split[2] == nil then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Parâmetros necessários. Use !oferta info para mais informações!") return false end split[2] = split[2]:gsub("^%s*(.-)$", "%1") _BUSCA_DB = db.storeQuery("SELECT * FROM `auction_system` WHERE `player` = " .. player:getGuid()) if(split[1] == "add") then if(not tonumber(split[3]) or (not tonumber(split[4]))) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Use somente números.") return true end if(string.len(split[3]) > 7 or (string.len(split[4]) > 3)) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Este preço ou a quantidade itens é muito alta.") return true end local itemType, item_s = ItemType(split[2]), ItemType(split[2]):getId() if(not item_s) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "O item "..itemType.." não existe!") return true end if(player:getLevel() < config.level_add) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas vcê precisa de level igual ou superior a (" .. config.level_add .. ") para continuar.") return true end if(isInArray(config.itens_bloqueados, item_s)) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode adicionar este item.") return true end if(player:getItemCount(item_s) < tonumber(split[4])) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você não tem este item.") return true end local amount, tmp_BUSCA_DB = 0, _BUSCA_DB while tmp_BUSCA_DB ~= false do tmp_BUSCA_DB = result.next(_BUSCA_DB) amount = amount + 1 end if _BUSCA_DB ~= false then local limit = amount >= config.max_ofertas if limit then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você atingiu o limite máximo(" .. config.max_ofertas .. ") de publicações de venda de itens.") return true end if(config.SendOffersOnlyInPZ) then if(not getTilePzInfo(player:getPosition())) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você só pode usar este comando estando em protection zone.") return true end end end if(tonumber(split[4]) < 1 or (tonumber(split[3]) < 1)) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você precisa informar um número maior que 0.") return true end local itemcount, costgp = math.floor(split[4]), math.floor(split[3]) player:removeItem(item_s, itemcount) db.query("INSERT INTO `auction_system` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`) VALUES (" .. player:getGuid() .. ", \"" .. split[2] .. "\", " .. item_s .. ", " .. itemcount .. ", " .. costgp ..", " .. os.time() .. ")") player:sendTextMessage(MESSAGE_INFO_DESCR, "Parabéns! Você adicionou para à venda " .. itemcount .." " .. split[2] .." por " .. costgp .. " gps!") end if(split[1] == "comprar") then _BUSCA_DB = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = ".. tonumber(split[2])) local player_id, player_vendas, item_ids, costs, item_names, counts = player:getGuid(), result.getNumber(_BUSCA_DB, "player"), result.getNumber(_BUSCA_DB, "item_id"), result.getNumber(_BUSCA_DB, "cost"), result.getString(_BUSCA_DB, "item_name"), result.getNumber(_BUSCA_DB, "count") if(not tonumber(split[2])) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas somente números são aceitos.") return true end if(_BUSCA_DB ~= false) then local total_custo = costs - player:getMoney() if(player:getMoney() < costs) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você não possuí a quantia necessária para comprar. São necessários: "..costs.."gps para comprar o item: "..item_names..". Você tem: " .. player:getMoney() .. "gps. Você precisa de: "..total_custo.." gps.") return true end if(player_id == player_vendas) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você não pode comprar seu próprio item.") return true end if player:removeMoney(costs) then if(isItemStackable((item_ids))) then player:addItem(item_ids, counts) else for i = 1, counts do player:addItem(item_ids, 1) end end db.query("DELETE FROM `auction_system` WHERE `id` = " .. split[2] .. ";") player:sendTextMessage(MESSAGE_INFO_DESCR, "Parabéns! Você comprou " .. counts .. " ".. item_names .. " por " .. costs .. " gps com sucesso!") db.query("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. costs .. " WHERE `id` = " .. player_vendas .. ";") end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas o ID "..split[2].." não existe!.") end end if(split[1] == "remover") then local _BUSCA_DB = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = ".. tonumber(split[2])) local player_id, player_vendas, item_ids, costs, item_names, counts = player:getGuid(), result.getNumber(_BUSCA_DB, "player"), result.getNumber(_BUSCA_DB, "item_id"), result.getNumber(_BUSCA_DB, "cost"), result.getString(_BUSCA_DB, "item_name"), result.getNumber(_BUSCA_DB, "count") if((not tonumber(split[2]))) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas somente números são aceitos.") return true end if(config.SendOffersOnlyInPZ) then if(not getTilePzInfo(player:getPosition())) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you remove offerts from database.") return true end end if(_BUSCA_DB ~= false) then if(player_id == player_vendas) then db.query("DELETE FROM `auction_system` WHERE `id` = " .. split[2] .. ";") if(isItemStackable(item_ids)) then player:addItem(item_ids, counts) else for i = 1, counts do player:addItem(item_ids, 1) end end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns! A oferta "..split[2].." foi removida com sucesso do mercado.\nVocê recebeu: "..counts.." "..item_names..".") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas essa oferta não é sua.") end result.free(resultado) else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas este ID não existe.") end end if(split[1] == "sacar") then if((not tonumber(split[2]))) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas somente números são aceitos.") return true end local balance = db.storeQuery("SELECT * FROM `players` WHERE `id` = " .. player:getGuid() .. ";") local auction_balance = result.getNumber(balance, "auction_balance") <= 0 and 0 or result.getNumber(balance, "auction_balance") if(auction_balance < 1) then player:sendTextMessage(MESSAGE_INFO_DESCR, "Você não possuí saldo suficiente para sacar.") result.free(balance) return true elseif split[2] <= 0 or split[2] > auction_balance then player:sendTextMessage(MESSAGE_INFO_DESCR, split[2] <= 0 and "Você tem que digitar um valor maior que 0." or "Você somente pode sacar o total de "..auction_balance..".") result.free(balance) return true end local tz = auction_balance - split[2] player:sendTextMessage(MESSAGE_INFO_DESCR, "Você sacou " .. split[2] .. " gps de suas vendas no mercado! Seu saldo é de: "..tz.."gps.") player:addMoney(tz) db.query("UPDATE `players` SET `auction_balance` = ".. tz .." WHERE `id` = " .. player:getGuid() .. ";") result.free(balance) end return true end
  4. vou anexar no post para vc baixar, fiz a alteração que pediu. Sistema Labia Vip.rar
  5. nessa linha: for i = 1, count do o certo seria for i = 1, counts do
  6. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    posta o código
  7. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    não tem esse monstro do seu servidor... esse smaug
  8. Que estranho, para que esta executando várias vezes o mesmo movements... é otx seu servidor?
  9. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    <globalevent name="MonsterEvent" interval="60" script="nome do seu script.lua"/> no caso vai executar a cada 60 segundos... se o seu servidor for em milisegundos, usa assim: <globalevent name="MonsterEvent" interval="60000" script="nome do seu script.lua"/> ai vc pode aumentar por exemplo para 1 hora: interval="3600" ou em mile segundos: interval="3600000"
  10. não tem essa função na sua lib, tenta adicionar na lib: function getItemLevelDoor(itemid) local item = getItemInfo(itemid) return item and item.levelDoor or false end
  11. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    ´é um globalevents, ele fica excutando a cada x horas se não me engano(no servidor dele)
  12. qual seu sistema vip?
  13. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    Como assim? direção horrível, não entendi...
  14. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    abaixo da função main: function onSay(cid, words, param, channel) adicione: local param = not param or param == "" and getCreatureName(cid) or param
  15. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    local pozycje = { {pos = {x = 661, y = 396, z = 15}, mob="smaug"}, {pos = {x = 1712, y = 449, z = 14}, mob="ancalagon"}, {pos = {x = 2286, y = 462, z = 9}, mob="Scatha"}, {pos = {x = 1241, y = 498, z = 11}, mob="Adramelech"}, {pos = {x = 1208, y = 734, z = 7}, mob="Emelianenko"}, {pos = {x = 614, y = 478, z = 0}, mob="The Necromancer"}, } local radius = {10, 10} -- n mexa function HaveCreatureInArea(position, radiusx, radiusy, name) for x = position.x - radiusx, position.x + radiusx do for y = position.y - radiusy, position.y + radiusy do local pos = {x= x, y= y, z= position.z} local m = getTopCreature(pos).uid if m ~= 0 and isMonster(m) and getCreatureName(m):lower() == name:lower() then return true end end end return false end function onThink(interval, lastExecution, thinkInterval) if math.random(1, 1000) < 900 then -- 1000 = 100%, np. 500 to 50% local var = pozycje[math.random(1, #pozycje)] if not HaveCreatureInArea(var.pos, radius[1], radius[2], var.mob) then doCreateMonster(var.mob, var.pos, false) end end return true end Desse jeito? Cara sinceramente aprende a especificar o minimo antes de fazer um pedido, pegou um script de um fórum polonês e não dá detalhes do que realmente quer, desse jeito que não vou mais ajudar não, tenha o bom senso de criar um tópico explicando passo a passo o que quer que o código faça, do contrário não tem como te ajudar. Ta ai o script, se não for isso boa sorte em estudar o BÁSICO de LUA para fazer você mesmo seu código.
  16. talk local config = { --[vocation id] = { level, nova voc, looktype, efeito} -- Goku [1] = { 30, 2, 69, 32}, [2] = { 50, 4, 37, 32}, [4] = { 75, 5, 18, 32}, [5] = { 100, 6, 71, 32} [6] = { 150, 8, 70, 32}, [8] = { 180, 9, 367, 32}, [9] = { 200, 10, 366, 32}, } function onSay(cid, words, param, channel) local voc = config[getPlayerVocation(cid)] if voc then if getPlayerLevel(cid) >= voc[1] then doPlayerSetVocation(cid, voc[2]) setPlayerStorageValue(cid, 787548, voc[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce se transformou!") doCreatureSay(cid, "Transformar", 19) local outfit = {lookType = voc[3]} doCreatureChangeOutfit(cid, outfit) doSendMagicEffect(getCreaturePosition(cid), voc[4]) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce precisa estar no level " .. voc[1] .. " para transformar.") end else doPlayerSendCancel(cid, "Nao é possível se transformar.") end return true end Login.lua local config = { loginMessage = getConfigValue('loginMessage'), useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')) } function onLogin(cid) local loss = getConfigValue('deathLostPercent') if(loss ~= nil) then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10) end local accountManager = getPlayerAccountManager(cid) if(accountManager == MANAGER_NONE) then local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage if(lastLogin > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "." end doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) elseif(accountManager == MANAGER_NAMELOCK) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?") elseif(accountManager == MANAGER_ACCOUNT) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type {account} to manage your account and if you want to start over then type {cancel}.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type {account} to create an account or type {recover} to recover an account.") end if(not isPlayerGhost(cid)) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) end registerCreatureEvent(cid, "Mail") registerCreatureEvent(cid, "SkullCheck") registerCreatureEvent(cid, "NoPartyAttack") registerCreatureEvent(cid, "TiraBattle") registerCreatureEvent(cid, "Idle") if(config.useFragHandler) then registerCreatureEvent(cid, "SkullCheck") registerCreatureEvent(cid, "Reward") end registerCreatureEvent(cid, "FullHpMana") registerCreatureEvent(cid, "AdvanceSave") registerCreatureEvent(cid, "ZombieAttack") registerCreatureEvent(cid, "BlessCheck") registerCreatureEvent(cid, "advance") registerCreatureEvent(cid, "SkullCheck") registerCreatureEvent(cid, "ReportBug") registerCreatureEvent(cid, "Outfit") registerCreatureEvent(cid, "Voc") registerCreatureEvent(cid, "FragReward") registerCreatureEvent(cid, "Niwdeath") registerCreatureEvent(cid, "AdvanceSave") registerCreatureEvent(cid, "LevelRecompense") registerCreatureEvent(cid, "BoasVindas") registerCreatureEvent(cid, "BroadDeath") registerCreatureEvent(cid, "SaveStamina") registerCreatureEvent(cid, "AmoebaTask") registerCreatureEvent(cid, "killboss") registerCreatureEvent(cid, "Busque") registerCreatureEvent(cid, "BlessedPlayer") --------- SHOP --------- --registerCreatureEvent(cid, "VocGoku") --registerCreatureEvent(cid, "VocShenron") --registerCreatureEvent(cid, "VocVegetto") --registerCreatureEvent(cid, "VocTapion") --registerCreatureEvent(cid, "VocKame") --registerCreatureEvent(cid, "VocKagome") --registerCreatureEvent(cid, "VocKingVegeta") --registerCreatureEvent(cid, "VocZaiko") --registerCreatureEvent(cid, "VocChilled") --registerCreatureEvent(cid, "VocBills") --registerCreatureEvent(cid, "NoPartyAttack") registerCreatureEvent(cid, "RemovedorDeFrags") --------------- REFLECT ---------------- registerCreatureEvent(cid, "Reflect") if getPlayerStorageValue(cid, 3482101) ~= 0 then setPlayerStorageValue(cid, 3482101, 0) end if getPlayerStorageValue(cid, 787548) > 0 then doPlayerSetVocation(cid, getPlayerStorageValue(cid, 787548)) end return true end
  17. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    local pozycje = { {pos = {x = 661, y = 396, z = 15}, mob="smaug"}, {pos = {x = 1712, y = 449, z = 14}, mob="ancalagon"}, {pos = {x = 2286, y = 462, z = 9}, mob="Scatha"}, {pos = {x = 1241, y = 498, z = 11}, mob="Adramelech"}, {pos = {x = 1208, y = 734, z = 7}, mob="Emelianenko"}, {pos = {x = 614, y = 478, z = 0}, mob="The Necromancer"}, } local radius = {10, 10} -- n mexa function HaveCreatureInArea(position, radiusx, radiusy, name) for x = position.x - radiusx, position.x + radiusx do for y = position.y - radiusy, position.y + radiusy do local pos = {x= x, y= y, z= position.z} local m = getTopCreature(pos).uid if m ~= 0 and isMonster(m) and getCreatureName(m):lower() == name:lower() then return true end end end return false end function onThink(interval, lastExecution, thinkInterval) if(math.random(1, 1000) < 900) then -- 1000 = 100%, np. 500 to 50% for _, var in ipairs(pozycje) do if not HaveCreatureInArea(var.pos, radius[1], radius[2], var.mob) then doCreateMonster(var.mob, var.pos, false) end end end return true end
  18. executa no seu bando de dados essa query ALTER TABLE `accounts` ADD loot_time INT(15) NOT NULL DEFAULT 0; pelo menos irá parar o erro quando abrir o servidor
  19. acho que na hora de você copiar deve ter faltado algo! [19/12/2020 11:57:54] > Loading new_perfect_autoloot_tfs.xml... done. tenta copiar do pastebin: https://pastebin.com/raw/0Xah6UFK
  20. Estranho, no meu coleta normalmente, por favor testem dessa maneira: Existe um MOD antigo do meu autoloot no seu servidor ainda!! Remova ele!! Eu tinha feito uma outra versão, mas já tirei site pq ele tinha alguns bugs. ---------------------- @RaafaGobetti9494 ou também você pode executar no seu banco de dados: ALTER TABLE `accounts` ADD loot_time INT(15) NOT NULL DEFAULT 0; creio que irá parar com esse erro, porém é melhor deletar esse autoloot antigo, já que ele tinha alguns bugs que foram fixados nessa nova versão.
  21. deve estar instalado esse autoloot antigo ainda, teria que remover, quero ver o print do erro para ver onde ele esta! engraçado, estou usando a mesma função do antigo!
  22. GetAutolootDays? Esse não usa essa função, você está usando o mesmo sistema?
  23. Tem que ver no config lua se está ativado o bank system do seu servidor, em alguns servidores ele vem desativado. bankSystem = true
  24. que estranho, no meu server funcionou, testei num baiak 8.6... pode ser que a função seja diferente, tenta colocar 2 desse jeito para ver se aumenta a taxa de up <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Exp Potion" version="1.0" author="Vodkart" contact="DISCORD: vodkart#6090" enabled="yes"> <config name="exppotion"><![CDATA[ Potions_Rates = { [14562] = {name = "Exp Potion", skill = SKILL__LEVEL, storages = {987681, 987682}, minutes = 2, new_rate = 2}, [14565] = {name = "Fist Potion", skill = SKILL_FIST, storages = {987683, 987684}, minutes = 2, new_rate = 2}, [14566] = {name = "Distance Potion", skill = SKILL_DISTANCE, storages = {987685, 987686}, minutes = 2, new_rate = 2} } function convertTime(a) if(type(tonumber(a)) == "number" and a > 0) then if (a <= 3599) then local minute = math.floor(a/60) local second = a - (60 * minute) if(second == 0) then return ((minute)..((minute > 1) and " minutos" or " minuto")) else return ((minute ~= 0) and ((minute>1) and minute.." minutos e " or minute.." minuto e ").. ((second>1) and second.." segundos" or second.." segundo") or ((second>1) and second.." segundos" or second.. " segundo")) end else local hour = math.floor(a/3600) local minute = math.floor((a - (hour * 3600))/60) local second = (a - (3600 * hour) - (minute * 60)) if (minute == 0 and second > 0) then return (hour..((hour > 1) and " horas e " or " hora e "))..(second..((second > 1) and " segundos" or " segundo")) elseif (second == 0 and minute > 0) then return (hour..((hour > 1) and " horas e " or " hora e "))..(minute..((minute > 1) and " minutos" or " minuto")) elseif (second == 0 and minute == 0) then return (hour..((hour > 1) and " horas" or " hora")) end return (hour..((hour > 1) and " horas, " or " hora, "))..(minute..((minute > 1) and " minutos e " or " minuto e "))..(second..((second > 1) and " segundos" or " segundo")) end end end ]]></config> <event type="login" name="ExpPotionLogin" event="script"><![CDATA[ domodlib('exppotion') function onLogin(cid) for _, ret in pairs(Potions_Rates) do if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then registerCreatureEvent(cid, "ExpPotionThink") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ainda tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de "..ret.name..".") if ret.skill == SKILL__LEVEL then doPlayerSetExperienceRate(cid, ret.new_rate) else doPlayerSetRate(cid, ret.skill, ret.new_rate) end setPlayerStorageValue(cid, ret.storages[2], 1) -- registro end end return true end]]></event> <event type="think" name="ExpPotionThink" event="script"><![CDATA[ domodlib('exppotion') function onThink(cid, interval) for _, ret in pairs(Potions_Rates) do if getPlayerStorageValue(cid, ret.storages[2]) > 0 and getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua ".. ret.name .." acabou!") if ret.skill == SKILL__LEVEL then doPlayerSetExperienceRate(cid, 1) else doPlayerSetRate(cid, ret.skill, 1) end setPlayerStorageValue(cid, ret.storages[2], 0) -- registro end end return true end]]></event> <talkaction words="!scrolltime;/scrolltime;!tscroll;/tscroll" event="buffer"><![CDATA[ domodlib('exppotion') local str ="# POTIONS INFO #\n\n" for _, ret in pairs(Potions_Rates) do str = str.."["..ret.name.."] -> "..(getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 and "Não ativo" or "voce tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de ".. ret.name).."\n" end return doPlayerPopupFYI(cid, str) ]]></talkaction> <action itemid="14562;14565;14566" event="script"><![CDATA[ domodlib('exppotion') function onUse(cid, item, fromPosition, itemEx, toPosition) if not Potions_Rates[item.itemid] then return true end local ret = Potions_Rates[item.itemid] if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não pode usar outra "..ret.name..". Você já possui uma Ativa. E Ainda restam: "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time())..".") return true end local rates = 1 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ativou ".. ret.name .." por "..ret.minutes.." minutos! Durante este tempo, você receberá + ".. string.format("%.1f", ret.new_rate) * 100 .."% de skill Extra de Qualquer Mob. Para saber o tempo, digite: /scrolltime") setPlayerStorageValue(cid, ret.storages[1], os.time()+ret.minutes*60) setPlayerStorageValue(cid, ret.storages[2], 1) if ret.skill == SKILL__LEVEL then doPlayerSetExperienceRate(cid, ret.new_rate) else doPlayerSetRate(cid, ret.skill, ret.new_rate) end registerCreatureEvent(cid, "ExpPotionThink") doRemoveItem(item.uid) return true end]]></action> </mod>
  25. @AidanNarutoHellDust testa assim <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Exp Potion" version="1.0" author="Vodkart" contact="DISCORD: vodkart#6090" enabled="yes"> <config name="exppotion"><![CDATA[ Potions_Rates = { [14562] = {name = "Exp Potion", skill = SKILL__LEVEL, storages = {987681, 987682}, minutes = 2, new_rate = 0.5}, -- 50% [14565] = {name = "Fist Potion", skill = SKILL_FIST, storages = {987683, 987684}, minutes = 2, new_rate = 0.5}, -- 50% [14566] = {name = "Distance Potion", skill = SKILL_DISTANCE, storages = {987685, 987686}, minutes = 2, new_rate = 0.5} -- 50% } function convertTime(a) if(type(tonumber(a)) == "number" and a > 0) then if (a <= 3599) then local minute = math.floor(a/60) local second = a - (60 * minute) if(second == 0) then return ((minute)..((minute > 1) and " minutos" or " minuto")) else return ((minute ~= 0) and ((minute>1) and minute.." minutos e " or minute.." minuto e ").. ((second>1) and second.." segundos" or second.." segundo") or ((second>1) and second.." segundos" or second.. " segundo")) end else local hour = math.floor(a/3600) local minute = math.floor((a - (hour * 3600))/60) local second = (a - (3600 * hour) - (minute * 60)) if (minute == 0 and second > 0) then return (hour..((hour > 1) and " horas e " or " hora e "))..(second..((second > 1) and " segundos" or " segundo")) elseif (second == 0 and minute > 0) then return (hour..((hour > 1) and " horas e " or " hora e "))..(minute..((minute > 1) and " minutos" or " minuto")) elseif (second == 0 and minute == 0) then return (hour..((hour > 1) and " horas" or " hora")) end return (hour..((hour > 1) and " horas, " or " hora, "))..(minute..((minute > 1) and " minutos e " or " minuto e "))..(second..((second > 1) and " segundos" or " segundo")) end end end ]]></config> <event type="login" name="ExpPotionLogin" event="script"><![CDATA[ domodlib('exppotion') function onLogin(cid) for _, ret in pairs(Potions_Rates) do if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then registerCreatureEvent(cid, "ExpPotionThink") local rates = 1 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ainda tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de "..ret.name..".") if ret.skill == SKILL__LEVEL then doPlayerSetExperienceRate(cid, rates + ret.new_rate) else doPlayerSetRate(cid, ret.skill, rates + ret.new_rate) end setPlayerStorageValue(cid, ret.storages[2], 1) -- registro end end return true end]]></event> <event type="think" name="ExpPotionThink" event="script"><![CDATA[ domodlib('exppotion') function onThink(cid, interval) for _, ret in pairs(Potions_Rates) do if getPlayerStorageValue(cid, ret.storages[2]) > 0 and getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua ".. ret.name .." acabou!") local rates = 1 if ret.skill == SKILL__LEVEL then doPlayerSetExperienceRate(cid, rates - ret.new_rate) else doPlayerSetRate(cid, ret.skill, rates - ret.new_rate) end setPlayerStorageValue(cid, ret.storages[2], 0) -- registro end end return true end]]></event> <talkaction words="!scrolltime;/scrolltime;!tscroll;/tscroll" event="buffer"><![CDATA[ domodlib('exppotion') local str ="# POTIONS INFO #\n\n" for _, ret in pairs(Potions_Rates) do str = str.."["..ret.name.."] -> "..(getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 and "Não ativo" or "voce tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de ".. ret.name).."\n" end return doPlayerPopupFYI(cid, str) ]]></talkaction> <action itemid="14562;14565;14566" event="script"><![CDATA[ domodlib('exppotion') function onUse(cid, item, fromPosition, itemEx, toPosition) if not Potions_Rates[item.itemid] then return true end local ret = Potions_Rates[item.itemid] if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não pode usar outra "..ret.name..". Você já possui uma Ativa. E Ainda restam: "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time())..".") return true end local rates = 1 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ativou ".. ret.name .." por "..ret.minutes.." minutos! Durante este tempo, você receberá + ".. string.format("%.1f", ret.new_rate) * 100 .."% de skill Extra de Qualquer Mob. Para saber o tempo, digite: /scrolltime") setPlayerStorageValue(cid, ret.storages[1], os.time()+ret.minutes*60) setPlayerStorageValue(cid, ret.storages[2], 1) if ret.skill == SKILL__LEVEL then doPlayerSetExperienceRate(cid, rates + ret.new_rate) else doPlayerSetRate(cid, ret.skill, rates + ret.new_rate) end registerCreatureEvent(cid, "ExpPotionThink") doRemoveItem(item.uid) return true end]]></action> </mod>

Informação Importante

Confirmação de Termo