Ir para conteúdo

Vodkart

Héroi
  • Registro em

Tudo que Vodkart postou

  1. esse erro não é do sistema é do seu próprio servidor que não está salvando as informações do jogador na db.
  2. não precisa colocar área "No Logout" pq o proprio código kika ele e o amigo(caso tiver) da cave mesmo estando offline!! E sim, coloca um TP na área para ele sair, ou se quiser eu posso adicionar um comando o "/caveleave" ou "/exitcave" para o jogador voltar a pos onde ele estava, exemplo, na área do npc ou no templo.
  3. okay!! Tenta voltar a função de antes então... deleta a coluna do banco de dados que vc ja criou e executa essa agora: CREATE TABLE exclusive_cave ( id INT NOT NULL AUTO_INCREMENT, account_id INTEGER NOT NULL, player_id INTEGER NOT NULL, player_name VARCHAR( 255 ) NOT NULL, cave_id INT NOT NULL DEFAULT 0, friend_id INT NOT NULL DEFAULT 0, time INTEGER NOT NULL, PRIMARY KEY ( id ) );
  4. @kimera28 Bom dia, qual versão do seu servidor? ------ tente trocar essa função da lib: function doPlayerAddCave(cid, cave_id, hours) return db.executeQuery("INSERT INTO `exclusive_cave` (`account_id`, `player_id`, `player_name`, `cave_id`, `friend_id`, `time`) VALUES ('".. getPlayerAccountId(cid) .."', '".. getPlayerGUID(cid).."', '".. getCreatureName(cid) .."', '".. cave_id .."', '0', '".. os.time()+hours*3600 .."');") end por function doPlayerAddCave(cid, cave_id, hours) return db.executeQuery("INSERT INTO `exclusive_cave` (`account_id`, `player_id`, `player_name`, `cave_id`, `friend_id`, `time`) VALUES ('".. getPlayerAccountId(cid) .."', '".. getPlayerGUID(cid).."', ".. getCreatureName(cid) ..", '".. cave_id .."', '0', '".. os.time()+hours*3600 .."');") end
  5. local items = {2152, 2160} -- id dos items local qtd = {5,13} -- quantidade function onDeath(cid, corpse, killer) local monstName = "Soberanus" -- nome do monstro if isMonster(cid) and isPlayer(killer[1]) then doPlayerSendTextMessage(killer[1], MESSAGE_STATUS_WARNING, "Voce deu Ultimo Golpe nos Boss.") doBroadcastMessage("O jogador "..getPlayerName(killer[1]).." Deu Ultimo Golpe no Boss e Ganho Itens.") doSendMagicEffect(getPlayerPosition(killer[1]), 65) doPlayerAddItem(killer[1], items[math.random(#items)], math.random(qtd[1], qtd[2])) end return true end
  6. tenta usar em lua tbm o fire e ve se ainda muda a vocation... me adc no discord tbm, ta na minha assinatura!!
  7. vc usa mods ou lua? nos eventos
  8. Não faço ideia, nenhuma linha do código tem a função de trocar a vocation...
  9. #Resolvido via Discord TK! Foi modificado action/lib e criado talkactions + função que retorna em tempo real o tempo, exemplo da alavanca + rank em tempo real em uso (para teste) e depois final do evento (teste)
  10. O serial fica no nome do item ou em alguma descrição?
  11. n existe o parâmetro false na função do seu servidor... usa assim: function ExistItemByName(name) -- by vodka local items = io.open("data/items/items.xml", "r"):read("*all") local get = items:lower():match('name="' .. name:lower() ..'"') if get == nil or get == "" then return false end return true end function onSay(cid, words, param) if param == '' or tonumber(param) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "/find item name") return true end local item = ExistItemByName(tostring(param)) if not item then doPlayerSendCancel(cid, "This item does not exist.") return true end local item_id = getItemIdByName(tostring(param)) local str, player_depotitems, players_items, tile_items = "",{},{},{} local dp = db.getResult("SELECT `player_id`, `count` FROM `player_depotitems` WHERE `itemtype` = "..item_id),{} if (dp:getID() ~= -1) then repeat player_depotitems[#player_depotitems+1] = {dp:getDataInt("player_id"), dp:getDataInt("count") } until not(dp:next()) dp:free() end local pi = db.getResult("SELECT `player_id`, `count` FROM `player_items` WHERE `itemtype` = "..item_id),{} if (pi:getID() ~= -1) then repeat players_items[#players_items+1] = {pi:getDataInt("player_id"), pi:getDataInt("count") } until not(pi:next()) pi:free() end local hi = db.getResult("SELECT `tile_id`, `count` FROM `tile_items` WHERE `itemtype` = "..item_id),{} if (hi:getID() ~= -1) then repeat local tile = db.getResult("SELECT `house_id`, `x`, `y`, `z` FROM `tiles` WHERE `id` = "..hi:getDataInt("tile_id")),{} tile_items[#tile_items+1] = {tile:getDataInt("house_id"),tile:getDataInt("x"),tile:getDataInt("y"),tile:getDataInt("z")} until not(hi:next()) hi:free() end if #player_depotitems > 0 then str = str .. "#DEPOT ITEMS#\nQuantidade - Jogador\n" for i = 1, table.maxn(player_depotitems) do str = str .. player_depotitems[i][2] .. ' ' .. getPlayerNameByGUID(player_depotitems[i][1]) ..' \n' end end if #players_items > 0 then str = str .. (str ~= "" and "--------------//-------------\n\n#PLAYER ITEMS#\nQuantidade - Jogador\n" or "#PLAYER ITEMS#\nQuantidade - Jogador\n") for i = 1, table.maxn(players_items) do str = str .. players_items[i][2] .. ' ' .. getPlayerNameByGUID(players_items[i][1]) ..' \n' end end if #tile_items > 0 then str = str .. (str ~= "" and "--------------//-------------\n\n#TILE ITEMS#\nHouse ID - Tile Position\n" or "#TILE ITEMS#\nHouse ID -Tile Position\n") for i = 1, table.maxn(tile_items) do str = str .. tile_items[i][1] .. ' - {x = ' .. tile_items[i][2] ..', y = ' .. tile_items[i][3] ..', z = ' .. tile_items[i][4] ..'} \n' end end return doShowTextDialog(cid,item_id, str) end
  12. Mas funcionou essa mudança?
  13. kd o topico principal? ta voltando para esse achei... local config = { minlevel = 150, --- level inical para resetar price = 10000, --- preço inicial para resetar newlevel = 20, --- level após reset priceByReset = 0, --- preço acrescentado por reset percent = 100, ---- porcentagem da vida/mana que você terá ao resetar (em relação à sua antiga vida total) maxresets = 50, levelbyreset = 0 --- quanto de level vai precisar a mais no próximo reset } local function getResets(cid) local query = db.getResult("SELECT `resets` FROM `players` WHERE `id`= "..getPlayerGUID(cid)) return query:getDataInt("resets") <= 0 and 0 or query:getDataInt("resets") end local function addReset(cid) doRemoveConditions(cid, false) local resets = getResets(cid) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) local hp = getCreatureMaxHealth(cid) local resethp = hp*(config.percent/100) setCreatureMaxHealth(cid, resethp) local differencehp = (hp - resethp) doCreatureAddHealth(cid, -differencehp) local mana = getCreatureMaxMana(cid) local resetmana = mana*(config.percent/100) setCreatureMaxMana(cid, resetmana) local differencemana = (mana - resetmana) doCreatureAddMana(cid, -differencemana) local guid = getPlayerGUID(cid) doRemoveCreature(cid) local description = resets+1 db.executeQuery("UPDATE `players` SET `description` = ' [Reset: "..description.."]', `level` = "..config.newlevel..", `experience`= 0, `resets`= "..description.." WHERE `players`.`id`= ".. guid) return true end function onSay(cid, words, param, channel) local var = getResets(cid) local newPrice = config.price + (var * config.priceByReset) local newminlevel = config.minlevel + (var * config.levelbyreset) if param == "quantity" then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have a total of '..var..' reset(s).') end if var >= config.maxresets then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,'You already have reached the maximum of '.. config.maxresets.. ' resets!') elseif getCreatureCondition(cid, CONDITION_INFIGHT) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este comando só pode ser usado fora de combate.") elseif not getTilePzInfo(getCreaturePosition(cid)) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"você precisa estar em protection zone pra poder teleportar.") elseif getPlayerMoney(cid) < newPrice then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,'Its necessary to have at least '..newPrice..' gp\'s for reseting!') elseif getPlayerLevel(cid) < newminlevel then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,'The minimum level for reseting is '..newminlevel..'!') end doPlayerRemoveMoney(cid,newPrice) doCreatureSetNoMove(cid, true) -- ele n vai andar addEvent(function() if isCreature(cid) and isPlayer(cid) then addReset(cid) end end, 3000) local number = var+1 local msg ="---[Reset: "..number.."]-- You have reseted! You'll be disconnected in 3 seconds." doPlayerPopupFYI(cid, msg) return true end
  14. Certo, preciso de algumas informações... 1 - Quando morrer, volta para a voc antiga? 2 - Pode voltar a voc antiga a qualquer hora? 3 - Quando eu estiver transformado por exemplo em sasuke (voc por tempo) e quiser me transformar em naruto, sem ser a voc antiga mas sim uma nova, eu posso? 4 - Vale a pena fazer por DB para pegar a voc e transmitir pelo site? ----------------------------------- OBS: quanto mais informação melhor... não vou fazer por agora pq estou terminando mais alguns sistemas, mas posso olhar quando tiver tempo.
  15. Vodkart postou uma resposta no tópico em Playground (Off-topic)
    se um dia se esquecer de vir dia 18 vai tomar perma ban!! valendo
  16. VERSÃO ATUALIZADA, INFORMAÇÕES ESTÃO DO TÓPICO!! DATA: 16/02/2021
  17. VERSÃO ATUALIZADA, INFORMAÇÕES ESTÃO DO TÓPICO!! DATA: 16/02/2021
  18. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    se eu nao me engano em 2012 fiz um npc disso... achei o link na otland function getAccountPoints(cid) local res = db.getResult('select `premium_points` from accounts where name = \''..getPlayerAccount(cid)..'\'') return res:getDataInt("premium_points") < 0 and 0 or res:getDataInt("premium_points") end function doAccountRemovePoints(cid, count) return db.executeQuery("UPDATE `accounts` SET `premium_points` = '".. getAccountPoints(cid) - count .."' WHERE `name` ='"..getPlayerAccount(cid).."'") end o npc: 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 local shopWindow = {} local t = { [2195] = 1, [2493] = 25, [2361] = 30, [8851] = 20, [8925] = 30, [2640] = 50, [2494] = 100, [9932] = 50, [2472] = 70, [8931] = 100 } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if t[item] and getAccountPoints(cid) < t[item] then selfSay("You need "..t[item].." points to buy this item.", cid) else doAccountRemovePoints(cid, t[item]) doPlayerAddItem(cid, item) selfSay("Here your item!", cid) end return true end if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then for var, ret in pairs(t) do table.insert(shopWindow, {id = var, subType = 0, buy = ret, sell = 0, name = getItemNameById(var)}) end openShopWindow(cid, shopWindow, onBuy, onSell) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  19. Ah verdade, achei que ele iria comprar mais caro, por exemplo (20 gp), e se ele tivesse muito desses itens já em estoque, vender mais barato, pela lei da oferta e demanda...
  20. Muito criativo esse sistema e você desenvolveu muito bem, parabéns!! Porém fazer por table storage, fica bem limitado o sistema, afinal, como você deve saber, existe uma certa quantia de caracteres/números que uma storage suporta. ° Um dos BUGS consiste em: O jogador vender 1000 itens de uma vez por um preço maior, e depois comprar o mesmo item e quantidade por um preço menor, refazer esses passos e fazer dinheiro fácil. Sobre a limitação do storage, você pode criar tabelas usando database ou criar um arquivo txt ou lua para salvar os dados e acessar quando quiser.
  21. acabei de acessar, não tem nenhum link quebrado...
  22. if potion.health then target:addHealth(math.random(potion.health[1], potion.health[2])) end if potion.mana then target:addMana(math.random(potion.mana[1], potion.mana[2])) end

Informação Importante

Confirmação de Termo