Ir para conteúdo

Vodkart

Héroi
  • Registro em

Tudo que Vodkart postou

  1. @subhe de boa man, ja ia fazer de outra forma para te enviar kkk é nois
  2. function convertTime(minutes,seconds) local hours = 0 repeat if seconds >= 60 then minutes = minutes + 1; seconds = seconds - 60 elseif minutes >= 60 then hours = hours + 1; minutes = minutes - 60 end until seconds < 60 and minutes < 60 return {hours = hours, seconds = seconds, minutes = minutes} end function doTeleportTimer(pos, seconds) local t = convertTime(0, seconds) doSendAnimatedText(pos, t.minutes > 0 and t.minutes..":"..t.seconds or t.seconds, 145) if seconds ~= 1 then addEvent(doTeleportTimer, 1000, pos, seconds-1) end end local storage, minutos = 48748, 10 -- 10 minutos local level = 130 local redo = {status = false, storageValue = 61111} -- true para ilimitado, false para somente uma vez local config = { { vocations = {3, 7}, playerPos = {x=1117, y=1150, z=6}, -- Initial position in the Stone tile newPos = {x=1114, y=1142, z=8}, -- Position of the reward room. }, { vocations = {2, 6}, playerPos = {x=1123, y=1157, z=6}, -- Initial position in the Stone tile newPos = {x=1114, y=1142, z=8}, -- Position of the reward room. }, { vocations = {1, 5}, playerPos = {x=1127, y=1155, z=6}, -- Initial position in the Stone tile newPos = {x=1114, y=1142, z=8}, -- Position of the reward room. }, { vocations = {4, 8}, playerPos = {x=1123, y=1147, z=6}, -- Initial position in the Stone tile newPos = {x=1114, y=1142, z=8}, --Position of the reward room. } } local msgs = { [1] = "Todos os jogadores devem estar em seus respectivos pisos!", [2] = "Todos os players devem ser level " .. level .. " ou maior.", [3] = "Um jogador em seu time ja fez a Fishing Rod and Pick Quest!", [4] = "Não há jogadores suficientes." } function onUse(cid, item, fromPosition, itemEx, toPosition) if getGlobalStorageValue(storage) - os.time() > 0 then doPlayerSendTextMessage(cid, 25, "Você não pode usar a alavanca agora.") return true end local players, msgID = {}, 0 for i, v in pairs(config) do local player = getTopCreature(v.playerPos).uid if player ~= 0 and isPlayer(player) then if not isInArray(v.vocations, getPlayerVocation(player)) then msgID = 1 break elseif getPlayerLevel(player) < level then msgID = 2 break elseif not redo.status then if getPlayerStorageValue(player, redo.storageValue) ~= -1 then msgID = 3 break end end table.insert(players, {player = player, newPos = v.newPos}) end end if msgID ~= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, msgs[msgID]) return true end if #players ~= #config then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, msgs[4]) return true end for i = 1, #players do local p = players if not redo.status then end doSendMagicEffect(getPlayerPosition(p.player), CONST_ME_POFF) doTeleportThing(p.player, p.newPos) doSendMagicEffect(p.newPos, CONST_ME_TELEPORT) end setGlobalStorageValue(storage, os.time() + minutos*60) doTeleportTimer(toPosition, minutos*60) return true end
  3. local items = { 2365, -- backpack of holding 10518, -- demon backpack 10016, -- batwing hat 2152 -- platinum coin } function onUse(cid, item, fromPosition, itemEx, toPosition) local r = items[math.random(#items)] return doPlayerSendTextMessage(cid,22,"O item gerado foi: "..getItemNameById(r)) end
  4. @subhe vc está testando com char de gm ou god?
  5. local config = { lottery_hour = "2 hours", -- Tempo ate a proxima loteria (Esse tempo vai aparecer somente como broadcast message) rewards = { {itemid = 2494, amount = 1}, {itemid = 2472, amount = 1}, {itemid = 2514, amount = 1}, {itemid = 2160, amount = 10}, {itemid = 12672, amount = 1} }, crystal_counts = 10, -- Usado somente se a rewards_id for crystal coin (ID: 2160). website = "yes", -- Only if you have php scripts and table `lottery` in your database! days = { "Monday-08:00", "Monday-13:00", "Monday-19:30", "Tuesday-08:00", "Tuesday-13:00", "Tuesday-19:30", "Wednesday-08:00", "Wednesday-13:00", "Wednesday-19:30", "Thursday-08:00", "Thursday-13:00", "Thursday-19:30", "Friday-01:22", "Friday-13:00", "Friday-19:30", "Saturday-21:27", "Saturday-21:28", "Saturday-21:29", "Sunday-08:00", "Sunday-13:00", "Sunday-19:30" } } local function getPlayerWorldId(cid) if not(isPlayer(cid)) then return false end local pid = getPlayerGUID(cid) local worldPlayer = 0 local result_plr = db.getResult("SELECT * FROM `players` WHERE `id` = "..pid..";") if(result_plr:getID() ~= -1) then worldPlayer = tonumber(result_plr:getDataInt("world_id")) result_plr:free() return worldPlayer end return false end local function getOnlineParticipants() local players = {} for _, pid in pairs(getPlayersOnline()) do if getPlayerAccess(pid) <= 2 and getPlayerStorageValue(pid, 281821) <= os.time() then table.insert(players, pid) end end if #players > 0 then return players end return false end function onThink(cid, interval) if table.find(config.days, os.date("%A-%H:%M")) then if(getWorldCreatures(o) <= 0)then return true end local query = db.query or db.executeQuery local data = os.date("%d/%m/%Y - %H:%M:%S") local online = getOnlineParticipants() if online then local x = config.rewards[math.random(1, #config.rewards)] local winner = online[math.random(1, #online)] local world = tonumber(getPlayerWorldId(winner)) doPlayerSetStorageValue(winner, 281821, os.time() + 3600 * 24) if isItemStackable(x.itemid) or x.amount == 1 then doPlayerAddItem(winner, x.itemid, x.amount) else for i = 1, x.amount do doPlayerAddItem(winner, x.itemid, 1) end end doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: "..x.amount.."x " ..getItemNameById(x.itemid).. "! Congratulations! (Next lottery in " .. config.lottery_hour .. ")") if(config.website == "yes") then query("INSERT INTO `lottery` (`name`, `item`, `world_id`, `item_name`, `date`) VALUES ('".. getCreatureName(winner).."', '".. x.itemid .."', '".. world .."', '".. getItemNameById(x.itemid) .."', '".. data .."');") end else print("Ninguem OnLine pra ganhar na loteria") end end return true end
  6. outra alternativa seria criar uma tabela extra para substituir o nome dos monstro na hora que matar. exemplo local m = { ["cyclops"] = "ancient cyclops", ["wisp"] = "ancient wisp" } local x = "cyclops" -- nome do monstro no onKill quando matar if m[x] then -- escopo end
  7. @maleskinho como assim? o texto aparecer para o jogador que clicou depois de 2 minutos? não entendi man usa assim if item.itemid ~= 11253 then doCreatureSay(cid, "Wait 2 minutes to use a pile.", TALKTYPE_ORANGE_1, false, 0, getCreaturePosition(cid)) return true end
  8. @maleskinho de boa, usa a mesma TAG que te passei e no código assim: function onUse(cid, item, fromPosition, itemEx, toPosition) local minutes = 2 local rand = math.random(1, 100) if item.itemid ~= 11253 then return true end if getPlayerStorageValue(cid, 45490) <= 0 then doPlayerSendCancel(cid, "Speak with Sandomo to use this item.") return true end if rand > 25 then doCreateMonster("guzzlemaw", getCreaturePosition(cid)) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You ransack the pile but fail to find any useful parts.") doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED) else setPlayerStorageValue(cid, 45491, getPlayerStorageValue(cid, 45491)+1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Amidst the pile of various bones you find a large, hollow part, similar to a pipe."); doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN) end doTransformItem(item.uid, 12688) addEvent(function() doTransformItem(getThingfromPos(toPosition).uid, 11253) end, minutes*60000) return true end
  9. @maleskinho usa o action assim <action actionid="45492" script="nome do seu script.lua"/> ai la no item do MAPA deixa o item 11253 com o AID 45492 e qndo clica nele vai funcionar, eu testei aqui vc editou a position do item ali em cima né?
  10. @maleskinho erro meu!! perdão!! function onUse(cid, item, frompos, item2, topos) local minutes = 2 local rand = math.random(1, 100) local pos = {x = 138, y = 52, z=7} -- position do item if item.itemid ~= 11253 then return true end if getPlayerStorageValue(cid, 45490) <= 0 then doPlayerSendCancel(cid, "Speak with Sandomo to use this item.") return true end if rand > 25 then doCreateMonster("guzzlemaw", getCreaturePosition(cid)) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You ransack the pile but fail to find any useful parts.") doSendMagicEffect(topos, CONST_ME_MAGIC_RED) else setPlayerStorageValue(cid, 45491, getPlayerStorageValue(cid, 45491)+1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Amidst the pile of various bones you find a large, hollow part, similar to a pipe."); doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN) end doTransformItem(item.uid, 12688) addEvent(function() doTransformItem(getTileItemById(pos, 12688).uid, 11253) end, minutes*60000) return true end testa desde o começo agora!!
  11. @maleskinho eu fiz um novo código ai em cima, testa ele. até pq só funciona se for o item 11253
  12. @maleskinho Deve ser porque quando vira o item 12688 ele perde o actionID. o certo é fazer no proprio script, depois de 2 minutos, voltar a ser o item de antes; @maleskinho faz assim: function onUse(cid, item, frompos, item2, topos) local minutes = 2 local rand = math.random(1, 100) local pos = {x = 138, y = 52, z=7} -- position do item if getPlayerStorageValue(cid, 45490) <= 0 then doPlayerSendCancel(cid, "Speak with Sandomo to use this item.") return true end if rand > 25 then doCreateMonster("guzzlemaw", getCreaturePosition(cid)) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You ransack the pile but fail to find any useful parts.") doSendMagicEffect(topos, CONST_ME_MAGIC_RED) else setPlayerStorageValue(cid, 45491, getPlayerStorageValue(cid, 45491)+1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Amidst the pile of various bones you find a large, hollow part, similar to a pipe."); doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN) end doTransformItem(item.uid, 12688) addEvent(function() doTransformItem(getTileItemById(pos, 12688).uid, 11253) end, minutes*60000) return true end
  13. @maleskinho testa assim: function onUse(cid, item, frompos, item2, topos) local StorageExaust = 722404 -- Mude Aqui caso queira trocar a storage. local Time = 120 -- Valores em segundos que ele terá que esperar. local rand = math.random(1, 100) if item.itemid == 12688 and item.actionid == 45492 then if getPlayerStorageValue(cid, StorageExaust) > os.time() then doPlayerSendCancel(cid, "Você não pode usar este item agora.") return true end end if item.itemid == 11253 and item.actionid == 45492 then if getPlayerStorageValue(cid, 45490) <= 0 then doPlayerSendCancel(cid, "Speak with Sandomo to use this item.") return true end if rand > 25 then doCreateMonster("guzzlemaw", getCreaturePosition(cid), false, true) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You ransack the pile but fail to find any useful parts."); doSendMagicEffect(topos, CONST_ME_MAGIC_RED) else setPlayerStorageValue(cid, 45491, getPlayerStorageValue(cid, 45491)+1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Amidst the pile of various bones you find a large, hollow part, similar to a pipe."); doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN) end doTransformItem(item.uid, 12688) doDecayItem(item.uid) setPlayerStorageValue(cid, StorageExaust, os.time() + Time) end return true end
  14. Olá, estou querendo desenvolver um CASTLE WAR parecido com esse do TibiaRPGBrasil, porém se alguém tiver uma ideia para implementar o sistema, vai ser de grande ajuda! Algumas ideias minhas já estão em desenvolvimento, por exemplo: [ + ] Ao dominar o castelo, todos da guild que participaram, irão receber um premio [ + ] Premio diário para todos da Guild dona do castelo( ex: 20:00 Horas) Vai receber mesmo estando offline, porque vai para o DP. [ + ] Premio para o player que deu mais dano da Guild [ + ] Premio: As 4 vocação(sorc,druid,kina,pala) que mais bateu ganharia prêmios aleatórios. [ + ] Sala com geradores onde os dono do castelo poderão subir sua stamina mais rápido [ + ] Exp Bônus [ + ] O castelo será resetado todo domingo as 05:00 da manhã e irá abrir as 20:00 para disputa do mesmo(configurável) Tópico base:
  15. Alguém sabe se já fizeram? estou querendo fazer para postar!
  16. @poko360 tinha mta coisa faltando, quando vc copiou saiu várias funções n sei pq pega daqui: https://pastebin.com/raw/kF7TLf9A
  17. @poko360 mas ele já da esse erro direto? digamos que vc criar uma conta e digitar !task, já aparece isso? deixa eu ver como ficou seu mods editado?
  18. @poko360 vc fez aquele negócio da database para trocar por int? e vc editou a alguma parte da talk? testei aqui e funcionou
  19. @poko360 https://pastebin.com/raw/nCaiMc35
  20. function onSay(player, words, param) local ret, t = db.storeQuery('SELECT `item_id` FROM `player_autoloot` WHERE `player_id` = '..getPlayerGUID(player)),{} if ret then repeat t[#t+1] = result.getNumber(ret, 'item_id') until not result.next(ret) result.free(ret) end for _, var in pairs(t) do player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, var) end return true end
  21. @Naze local t = { {chance = 10, amount = 5}, {chance = 20, amount = 4}, {chance = 40, amount = 3}, {chance = 50, amount = 2} } function GiveRewards(cid, items) local var = items[math.random(#items)] local chance = var.chance if chance > math.random(1, 100) then local backpack, str = doPlayerAddItem(cid, 1999, 1), '' -- backpackID local amount = var.amount for i = 1, amount do doAddContainerItem(backpack, 8300, 1) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Você abriu uma Box e Ganhou: "..amount.." "..getItemNameById(8300)..".") else GiveRewards(cid, items) end return true end function onUse(cid, item, fromPosition, itemEx, toPosition) doSendAnimatedText(getPlayerPosition(cid), "Box!", TEXTCOLOR_GREEN) GiveRewards(cid, t) doRemoveItem(item.uid) return true end @Zazeros sim, mas só colocar para checar se tem a cap, se nao tiver manda para o dp
  22. @grillo1995 Ah sim, meu eu tinha feito por actionID. Você quer tudo em um TP só? agora entendi, vou refazer quando tiver um tempo
  23. local rewards = { {chance = 50, itemid = 8300,amount = 1}, {chance = 10, itemid = 2494,amount = 1}, {chance = 100, itemid = 2159,amount = 20}, {chance = 100, itemid = 2160,amount =100} } function GiveRewards(cid, items) local backpack,str = doPlayerAddItem(cid, 1999, 1), '' -- backpackID for i = 1, table.maxn(items) do local chance, itemid, amount = items[i].chance, items[i].itemid,items[i].amount if chance > math.random(1, 100) then if isItemStackable(itemid) or amount == 1 then doAddContainerItem(backpack, itemid, amount) else for i = 1, amount do doAddContainerItem(backpack, itemid, 1) end end str = str .. amount .. ' ' .. getItemNameById(itemid) str = i ~= table.maxn(items) and str .. ', ' or str .. '.' end end return str end function onUse(cid, item, fromPosition, itemEx, toPosition) doSendAnimatedText(getPlayerPosition(cid), "Box!", TEXTCOLOR_GREEN) local t = GiveRewards(cid, rewards) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Você abriu uma Box e Ganhou: "..t) doRemoveItem(item.uid) return true end OBS: Coloquei para vir mais que um item, ou seja, dependendo da sorte do player, poderá receber mais que um... ou você só quer 1 item de toda essa tabela?
  24. posta o codigo ai pra mim ver como ficou. eu ja tinha terminado o codigo de tarde no escritorio onde eu trabalho, mas dá nada.

Informação Importante

Confirmação de Termo