Ir para conteúdo

Vodkart

Héroi
  • Registro em

Tudo que Vodkart postou

  1. No caso teria que remover o frag do server inteiro, isso não tem problema também... Mas acho que no casos seria legal dar todo domingo, toda semana, não uma vez por mês! eu já fiz um rank frags, no caso só pegar o 1° colocado(nick) e dar a premiação, direto pelo DP(pra caso estiver offline)
  2. Esta é uma mensagem automática! Este tópico foi movido para a área correta. Pedimos que você leia as regras do fórum. function onUse(cid, item, frompos, item2, topos) local storage = 88888 if getPlayerStorageValue(cid,storage) > 0 then return doPlayerSendTextMessage(cid,22,"voce ja pego! vaza rapa!") end doPlayerSendTextMessage(cid,22,"Voce conseguiu a Imperium Earth Sword!") doPlayerAddItem(cid,7767,1) setPlayerStorageValue(cid,storage,1) return true end
  3. manda o script das chest pra mim ver
  4. esse é um sistema de pontos diferentes, o que você quer que adicione é 'premium_points'
  5. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    vai no config.lua e procure por "bank" deixe assim: bankSystem = "yes" -- Bank system ou se for caso entre 'true' ou 'false' bankSystem = true
  6. Se o evento for só de matar durante X tempo e for coisa simples eu posso criar um do 0 totalmente automatico que faz o balance dos players depois que eles entrarem em uma wait room. ai tendo restrições de level, multi IP, etc...
  7. sim mas eu revi o meu cṕdigo e não encontrei erro... como inicia o seu evento? as storages para os jogadores são adicionadas?
  8. <event type="PrepareDeath" name="EventDeath" event="script" value="nome do seu script.lua"/> no login.lua adc registerCreatureEvent(cid, "EventDeath")
  9. se me mostrar o sistema todo eu posso olhar, porque acho que funciona sim
  10. registrou o evento no onLogin?
  11. local storageIdGreen = 10001 local storageIdRed = 10002 local config = { pos_rock_green = {x=489, y=281, z=7, stackpos=1}, pos_TP_green = {x=488, y=278, z=7, stackpos=1}, pos_rock_red = {x=479, y=278, z=7, stackpos=1}, pos_TP_red = {x=477, y=281, z=7, stackpos=1}, townid = 13 } function onPrepareDeath(cid, deathList) if isPlayer(cid) and getPlayerStorageValue(cid, storageIdRed) > 0 or getPlayerStorageValue(cid, storageIdGreen) > 0 then local storage = getPlayerStorageValue(cid, storageIdRed) > 0 and eventconfig.GSG or eventconfig.GSR setGlobalStorageValue(storage, getGlobalStorageValue(storage)+1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce deu ponto para a equipe adversaria ! Total: ["..getGlobalStorageValue(storage).."]") if getGlobalStorageValue(storage) == eventconfig.narrow then doCreateItem(1285,1,config.pos_rock_green) doCreateItem(1285,1,config.pos_TP_green) doCreateItem(1285,1,config.pos_rock_red) doCreateItem(1285,1,config.pos_TP_red) doBroadcastMessage("O "..(storage == eventconfig.GSG and "{RED TEAM}" or "{GREEN TEAM}").." é o vencedor do evento ! Total: ["..eventconfig.narrow.."] Kills !", 25) for _, cid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(cid, storageIdRed) > 0 or getPlayerStorageValue(cid, storageIdGreen) > 0 then doTeleportThing(cid, getTownTemplePosition(config.townid)) end end setGlobalStorageValue(eventconfig.GSG, 0) setGlobalStorageValue(eventconfig.GSR, 0) end end return true end
  12. faz por onPrepareDeath já que eu acho que o jogador não chega a morrer né?
  13. Vodkart postou uma resposta no tópico em Playground (Off-topic)
    não entendi
  14. Introdução a Tabelas Tabelas antes de mais nada são variáveis que podem armazenar vários valores,que também podem ser sub-tabelas,sejam elas indexes ou valores(strings ou números). Logo,se elas são variáveis,para abrir uma tabela em um script como devemos começar? Como se declara um variável em um script? Simples!declaramos a tabela assim: local tabble = {} Pergunta: Mais poderia ser qualquer outra variável de vez de "tabble"? Resposta: Sim,poderia ser dado qualquer outro nome para sua variável exemplo: local vodkart = {} ou local xtibia = {} ou local config = {} ou local x = {} ... Não importa o nome da sua variável,apenas certifique-se que ela está lá. ----------------------------------------------- Obs: Lembre-se que tabelas sempre usam chaves, é como se fosse um "if" e um "end",abriu uma chave "{" você deve fecha-lá "}". ----------------------------------------------- Manipulando e pegando valores dentro de Tabelas já aprendemos como declarar uma tabela certo?,agora iremos colocar alguns valores dentro dela...Mas como fazer isso? OH MY GOD! Vou escolher alguns números aleátorios e colocar dentro da nossa tabela: local tabble = {150, 410, 25} Pronto, nós já tem uma tabela! Viram como é easy? Agora prestem atenção a explicação cambada de vagabundo! Para pegar os valores de uma tabela é mais fácil ainda,conforme você vai adicionando o elemento dentro de uma tabela elas vão ganhando posições,por exemplo: 150 = 1° posição 410 = 2° posição 25 = 3° posição Então como pegar esses valores na tabela? Você deve primeiro usar o nome da sua tabela seguido de colhetes "[]",entre esses colchetes ficam o valor de posição do que você quer pegar,exemplo: Vamos supor que queremos pegar o valor 150 em um script e a nossa tabela foi declarada assim: local tabble = {150, 410, 25} logo para pegar o valor 150 fariamos assim: tabble[1] Ou sejá: tabble[1] retornaria 150 tabble[2] retornaria 410 tabble[3] retornaria 25 Tudo certo por aqui? espero que sim. Criando tabelas avançadas: Agora vamos estudar sub-tabelas e indexes,vou propor o seguinte problema: Marco é um empregado que trabalha em um escritório de registros,e ele precisa fazer uma tabela com nome,idade e sexo das pessoas. Crie uma tabela para ajudar-lo,seguem as pessoas abaixo: Bruno: idade 22, masculino Thiago: idade 17, masculino Marina: idade 16, feminino Como prosseguir? Primeiro de tudo vamos declarar nossa tabela: local tabela = {} Agora vamos criar os chamados indexes,quais os index que temos nesse problema? nome,idade e sexo certo? Então : local tabela = {nome="", idade=, sexo=""} Mais espera,como é uma tabela de múltiplas linhas devemos separar por vírgulas e abrir mais algumas chaves para surgir as sub-tabelas: local tabela = { {nome="", idade=, sexo=""}, {nome="", idade=, sexo=""}, {nome="", idade=, sexo=""} } ----------------------------------------------- Obs: Porque Nome e sexo tem ""? "" significa string,são usados para nome e palavras. ----------------------------------------------- Peço que vocês preencham a tabela antes de abrir o spoiler para que vocês possam aprender,depois que vocês preencherem sua tabela abram o spoiler para ver se está tudo de acordo. Hmm e agora vamos para a parte complicadinha,vamos pegar os valores dentro da tabela,como fazer isso? Nesse caso faríamos assim: tabela[linha].index ----------------------------------------------- Obs: se a tabela tivesse só uma linha por exemplo: local tabela = {idade=22, nome="Bruno", sexo="masculino"} para pegar o nome você usaria tabela.index ou seja: tabela.idade --> retornaria 22 tabela.nome --> retornaria "Bruno" tabela.sexo --> retornaria "masculino" ----------------------------------------------- Agora quando a tabela tem várias linhas é preciso consultar os valores assim: tabela[linha].index Pegando o nosso exemplo local tabela = { {nome="Bruno", idade=22, sexo="Masculino"}, {nome="Thiago", idade=17, sexo="Masculino"}, {nome="Marina", idade=16, sexo="Feminino"} } Se quiséssemos retornar o nome da linha 2 como faríamos? tabela[2].index ou seja tabela[2].nome retornaria "Thiago" tabela[2].idade retornaria 17 tabela[1].idade retornaria 22 tabela[1].sexo retornaria "Masculino" tabela[3].nome retornaria "Marina"
  15. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    No caso o seu sistema é por global storage, a guild vencedora tem o ID da guild colocado na storage global 100006. E sobre esse banco de dados, é para outro sistema.
  16. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    -- Anti Mage Bomb System otimizado por Killua local config = { max = 3, -- Quantos acc manager o mesmo ip pode logar de uma vez acc_name = "Account Manager", -- Nome do account manager ip_banishment = "true", -- Se logar mais acc manager do que o permitido, leva ban? "true" ou "false" days = 20 } local accepted_ip_list = {""} -- lista dos ips permitidos a logar varios acc manager, exemplo: {""} function antiMC(cid) if not isCreature(cid) then return LUA_ERROR end if (#getPlayersByIp(getPlayerIp(cid)) >= config.max) then if config.ip_banishment == "true" then doAddIpBanishment(getPlayerIp(cid), days * 24 * 60 * 60) end doRemoveCreature(cid) end return true end function onLogin(cid) if getPlayerName(cid) == config.acc_name then if #accepted_ip_list > 0 and isInArray(accepted_ip_list, doConvertIntegerToIp(getPlayerIp(cid))) then return true else addEvent(antiMC, 1000, cid) end end return true end
  17. USHUHSUSHSUHUSHSU no seriado que eu assisto você faz o papel principal viado
  18. me passa teu mods editado pra mim ver
  19. feito
  20. sim só modificar a lib pra dar update numa função... manda private
  21. function getDeathsAndKills(cid, type) -- by vodka local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0 if (query:getID() ~= -1) then repeat d = d+1 until not query:next() query:free() end return d end if isPlayer(thing.uid) then doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Matou: ["..getDeathsAndKills(thing.uid, "kill").."] Jogadores.\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Morreu: ["..getDeathsAndKills(thing.uid, "death").."] Jogadores") end <?xml version = "1.0" encoding = "UTF-8"?> <mod name = "Military Ranks" version = "1.0" author = "Teckman" enabled = "yes"> <config name = "ranks"><![CDATA[ titles = { [5] = "Private First Class", [10] = "Specialist", [15] = "Corporal", [20] = "Sergeant", [25] = "Staff Sergeant", [30] = "Sergeant First Class", [35] = "Master Sergeant", [40] = "First Sergeant", [45] = "Sergeant Major", [50] = "Command Sergeant Major", [55] = "Sergeant Major of the Army", [60] = "Second Lieutenant", [65] = "First Lieutenant", [70] = "Captain", [75] = "Major", [80] = "Lieutenant Colonel", [90] = "Colonel", [100] = "Brigadier General", [110] = "Major General", [120] = "Lieutenant General", [140] = "General", [170] = "General of the Army" } fragsStorage = 600 function getDeathsAndKills(cid, type) -- by vodka local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0 if (query:getID() ~= -1) then repeat d = d+1 until not query:next() query:free() end return d end ]]></config> <event type = "look" name = "ranksLook" event = "script"><![CDATA[ domodlib("ranks") function onLook(cid, thing, position, lookDistance) if(isPlayer(thing.uid)) then local rank = {rank = "Private", frags = 0} for k, v in pairs(titles) do if(math.max(0, getPlayerStorageValue(thing.uid, fragsStorage)) > k - 1) then if(k - 1 > rank.frags) then rank.rank, rank.frags = v, k - 1 end end end doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Matou: ["..getDeathsAndKills(thing.uid, "kill").."] Jogadores.\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Morreu: ["..getDeathsAndKills(thing.uid, "death").."] Vezes.\n Military rank: " .. rank.rank) end return true end ]]></event> <event type = "kill" name = "ranksKill" event = "script"><![CDATA[ domodlib("ranks") function onKill(cid, target) if(isPlayer(target)) then setPlayerStorageValue(cid, fragsStorage, math.max(0, getPlayerStorageValue(cid, fragsStorage) + 1)) if(titles[getPlayerStorageValue(cid, fragsStorage)]) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You advanced to military rank: " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. ". Congratulations " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. "!") end end return true end ]]></event> <event type = "login" name = "ranksLogin" event = "script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "ranksKill") registerCreatureEvent(cid, "ranksLook") return true end ]]></event> </mod>
  22. já declarou todos os itens na tabela? se sim, deixa eu ver ele terminado. local specialQuests = { [2001] = 30015 --Annihilator } local questsExperience = { [30015] = 10000 } function onUse(cid, item, fromPosition, itemEx, toPosition) if(getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF, cid) return true end local storage = specialQuests[item.actionid] if(not storage) then storage = item.uid if(storage > 65535) then return false end end if(getPlayerStorageValue(cid, storage) > 0) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.") return false end local items = {} local reward = 0 local size = isContainer(item.uid) and getContainerSize(item.uid) or 0 if(size == 0) then reward = doCopyItem(item, false) else for i = 0, size do local tmp = getContainerItem(item.uid, i) if(tmp.itemid > 0) then table.insert(items, tmp) end end end size = table.maxn(items) if(size == 1) then reward = doCopyItem(items[1], true) end local result = "" if(reward ~= 0) then local ret = getItemDescriptions(reward.uid) if(reward.type > 0 and isItemRune(reward.itemid)) then result = reward.type .. " charges " .. ret.name elseif(reward.type > 0 and isItemStackable(reward.itemid)) then result = reward.type .. " " .. ret.plural else result = ret.article .. " " .. ret.name end else if(size > 20) then reward = doCopyItem(item, false) elseif(size > 8) then reward = getThing(doCreateItemEx(1988, 1)) else reward = getThing(doCreateItemEx(1987, 1)) end for i = 1, size do local tmp = doCopyItem(items[i], true) if(doAddContainerItemEx(reward.uid, tmp.uid) ~= RETURNVALUE_NOERROR) then print("[Warning] QuestSystem:", "Could not add quest reward") else local ret = ", " if(i == 2) then ret = " and " elseif(i == 1) then ret = "" end result = result .. ret ret = getItemDescriptions(tmp.uid) if(tmp.type > 0 and isItemRune(tmp.itemid)) then result = result .. tmp.type .. " charges " .. ret.name elseif(tmp.type > 0 and isItemStackable(tmp.itemid)) then result = result .. tmp.type .. " " .. ret.plural else result = result .. ret.article .. " " .. ret.name end end end end if(doPlayerAddItemEx(cid, reward.uid, false) ~= RETURNVALUE_NOERROR) then result = "You have found a reward weighing " .. getItemWeight(reward.uid) .. " oz. It is too heavy or you have not enough space." else result = "You have found " .. result .. "." setPlayerStorageValue(cid, storage, 1) if(questsExperience[storage] ~= nil) then doPlayerAddExp(cid, questsExperience[storage]) doSendAnimatedText(getCreaturePosition(cid), questsExperience[storage], TEXTCOLOR_WHITE) end end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, result) return true end
  23. function installVipSystem() local func = db.query or db.executeQuery if func("CREATE TABLE `killua_vip_time` (`account_id` int(11) NOT NULL default '0', `time` varchar(255) NOT NULL default '0')") then return print(os.date("%X").." - Killua VIP System instalado com sucesso.") and true end return print(os.date("%X").." - Killua VIP System ja esta instalado.") and false end function getAccountVipTime(accid) local time_ = db.getResult("SELECT `time` FROM `killua_vip_time` WHERE `account_id` = "..accid) if time_:getID() ~= -1 then return time_:getDataInt("time") end return false end function setAccountVipTime(accid, time) local func = db.query or db.executeQuery local time_ = db.getResult("SELECT `time` FROM `killua_vip_time` WHERE `account_id` = "..accid) if time_:getID() ~= -1 then func("UPDATE `killua_vip_time` SET `time` = '"..time.."' WHERE `account_id` = "..accid) time_:free() return true end return func("INSERT INTO `killua_vip_time` (`account_id`, `time`) VALUES ('"..accid.."', '"..time.."')") end function isVip(cid) if getAccountVipTime(getPlayerAccountId(cid)) then return getAccountVipTime(getPlayerAccountId(cid)) >= os.time() end return false end function doPlayerSetVipDays(cid, days) if days and tonumber(days) and tonumber(days) >= 0 then if tonumber(days) == 0 then return setAccountVipTime(getPlayerAccountId(cid), days) end return setAccountVipTime(getPlayerAccountId(cid), (os.time() + (days * 60 * 60 * 24))) end return print("Aviso: Nao foi possivel executar a funcao doPlayerAddVipDays. O parametro days deve ser um numero.") end function getPlayerVipDays(cid) if getAccountVipTime(getPlayerAccountId(cid)) then return getAccountVipTime(getPlayerAccountId(cid)) > 0 and math.ceil((getAccountVipTime(getPlayerAccountId(cid)) - os.time()) / 60 / 60 / 24) or 0 end return 0 end
  24. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    TIER_STORAGE = 785201 TIER_BRONZE = 1 TIER_PRATA = 2 TIER_OURO = 3 TIER_PLATINA = 4 TIER_DIAMANTE = 5 TIER_MESTRE = 6 TIER_DESAFIANTE = 7 TIER_TYPES = { [1] = "Bronze", [2] = "Prata", [3] = "Ouro", [4] = "Platina", [5] = "Diamante", [6] = "Mestre", [7] = "Desafiante" } function getPlayerTier(cid) local var = { [{0, 10}] = TIER_BRONZE, [{11, 25}] = TIER_PRATA, [{26, 50}] = TIER_OURO, [{51, 100}] = TIER_PLATINA, [{101, 250}] = TIER_DIAMANTE, [{251, 400}] = TIER_MESTRE, [{401, math.huge}] = TIER_DESAFIANTE } local tier = getPlayerStorageValue(cid, TIER_STORAGE) <= 0 and 0 or getPlayerStorageValue(cid, TIER_STORAGE) for v , r in pairs(var) do if tier >= v[1] and tier <= v[2] then return r end end end ai qndo for dar no bau de quest por exemplo 5 points vc usa: local amount = 5 -- qntos pontos vc vai dar local tier = getPlayerStorageValue(cid, TIER_STORAGE) <= 0 and 0 or getPlayerStorageValue(cid, TIER_STORAGE) setPlayerStorageValue(cid, TIER_STORAGE, tier+amount)
  25. Não entendi, posta os códigos... Você está alterando o valor da lib por uma talk?

Informação Importante

Confirmação de Termo