Ir para conteúdo

Posts Recomendados

gente eu queria saber como colocar para ganhar varios itens na loteria por que só ganhar 1kk mas eu quero que possa ganhar 1kk magic plate armor etc... mas ai eu arrumo os ids ta ai o script:

 

-- by vDk
local config = {
   lottery_hour = "30 Minutes", -- Time to next lottery (only for broadcast message, real time you can set on globalevents.xml)
   rewards_id = {2160}, -- Rewards ID
   crystal_counts = 100, -- Used only if on rewards_id is crystal coin (ID: 2160).
   website = "yes" -- Only if you have php scripts and table `lottery` in your database!
   }
function onThink(interval, lastExecution)
   local list = {}
   for i, tid in ipairs(getPlayersOnline()) do
   list[i] = tid
end

       local winner = list[math.random(1, #list)]
       local random_item = config.rewards_id[math.random(1, #config.rewards_id)]

       if(random_item == 2160) then
               doPlayerAddItem(winner, random_item, config.crystal_counts)
               doBroadcastMessage("[LOTTERY SYSTEM] Ganhador: " .. getCreatureName(winner) .. ", Prêmio: " .. config.crystal_counts .. " " .. getItemNameById(random_item) .. "s! Parabéns! (Proxima Loteria em " .. config.lottery_hour .. ")")
       else
               doBroadcastMessage("[LOTTERY SYSTEM] Ganhador: " .. getCreatureName(winner) .. ", Prêmio: " .. getItemNameById(random_item) .. "! Parabéns! (Proxima Loteria em " .. config.lottery_hour .. ")")
	doPlayerAddItem(winner, random_item, 1)
       end

       if(config.website == "yes") then
               db.query("INSERT INTO `lottery` (`name`, `item`) VALUES ('".. getCreatureName(winner) .."', '".. getItemNameById(random_item) .."');")
       end
       return true
end

Link para o comentário
https://xtibia.com/forum/topic/161737-lottery-ganhar-mais-itens-na-loteria/
Compartilhar em outros sites

×
×
  • Criar Novo...