• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    Quest por tiempo

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    1Thông báo Quest por tiempo Vie Ago 23, 2013 11:43 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    Bueno estuve bagando por las calles de google y me encontre con este script que me llamo la atencion y se los traigo para que le den un buen uso.

    Quest por tiempo DxrEu5

    empesemos nos vamos a data/actions/actions.xml

    agregamos esta linea.-
    Código:

    <action uniqueid="4005" event="script" value="timechest.lua"/>
    Nos vamos a data/actions/script y copiamos cualquier archivo y pegamos esto dentro y lo guardamos con el nombre de timechest.lua

    Código:
    -- Time Chest by Limos
    local config = {
     exhausttime = 7200, -- time in seconds
     exhauststorage = 2301,
     level = 50 -- minimum level to open the chest
    }
     
    function onUse(cid, item, fromPosition, itemEx, toPosition)
     
    local rewarditems = {
     {id = 2152, count = math.random(1, 50)},
     {id = 2498, count = 1},
     {id = 2492, count = 1},
     {id = 2488, count = 1}
    }
     
    if(getPlayerLevel(cid) < config.level) then
     doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
    doPlayerSendCancel(cid, "You need to be level "..config.level.." to open the chest.")
     return true
     end
     if(exhaustion.check(cid, config.exhauststorage)) then
     local time = exhaustion.get(cid, config.exhauststorage)
     local hours, minutes, seconds = math.floor (time / 3600), math.floor ((time - ((math.floor (time / 3600)) * 3600))/ 60), time - ((math.floor (time/60)) * 60)
     if time >= 3600 then
     text = hours.." "..(hours > 1 and "hours" or "hour")..", "..minutes.." "..(minutes > 1 and "minutes" or "minute").." and "..seconds.." "..(seconds > 1 and "seconds" or "second")
     elseif time >= 120 then
     text = minutes.." "..(minutes > 1 and "minutes" or "minute").." and "..seconds.." "..(seconds > 1 and "seconds" or "second")
     else
     text = seconds.." "..(seconds > 1 and "seconds" or "second")
     end
     doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "It is empty. You need to wait "..text.." before you can get a reward again.")
     return true
     end
     local i = math.random(1, #rewarditems)
     local info = getItemInfo(rewarditems[i].id)
     if(rewarditems[i].count > 1) then
    text = rewarditems[i].count .. " " .. info.plural
     else
                    text = info.article .. " " .. info.name
     end
     local item = doCreateItemEx(rewarditems[i].id, rewarditems[i].count)
     if(doPlayerAddItemEx(cid, item, false) ~= RETURNVALUE_NOERROR) then
     doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
     text = "You have found a reward. It is to heavy or you have not enough space."
     else
     text = "You have found " .. text .. "."
     exhaustion.set(cid, config.exhauststorage, config.exhausttime)
     end
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, text)
     return true
    end
    la de arriva es la version normal que te da un item al randon.
    ahora esta es la que te da chance de sacar o no sacar cualquier item al randon. es decir que es posible que no saques nada.

    Código:
    -- Time Chest by Limos
    local config = {
     exhausttime = 7200, -- time in seconds
     exhauststorage = 2301,
     level = 50 -- minimum level to open the chest
    }
     
    function onUse(cid, item, fromPosition, itemEx, toPosition)
     
    local rewarditems = {
     {id = 2492, chance = 5, count = 1}, -- start with the lowest chances
     {id = 2498, chance = 10, count = 1},
     {id = 2488, chance = 15, count = 1},
     {id = 2152, chance = 70, count = math.random(1, 50)}
    }
     
    if(getPlayerLevel(cid) < config.level) then
     doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
    doPlayerSendCancel(cid, "You need to be level "..config.level.." to open the chest.")
     return true
     end
     
    if(exhaustion.check(cid, config.exhauststorage)) then
     local time = exhaustion.get(cid, config.exhauststorage)
     local hours, minutes, seconds = math.floor (time / 3600), math.floor ((time - ((math.floor (time / 3600)) * 3600))/ 60), time - ((math.floor (time/60)) * 60)
     if time >= 3600 then
     text = hours.." "..(hours > 1 and "hours" or "hour")..", "..minutes.." "..(minutes > 1 and "minutes" or "minute").." and "..seconds.." "..(seconds > 1 and "seconds" or "second")
     elseif time >= 120 then
     text = minutes.." "..(minutes > 1 and "minutes" or "minute").." and "..seconds.." "..(seconds > 1 and "seconds" or "second")
     else
     text = seconds.." "..(seconds > 1 and "seconds" or "second")
     end
     doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "It is empty. You need to wait "..text.." before you can get a reward again.")
     return true
     end
     
    local chance = math.random(1,100)
     for i = 1, #rewarditems, 1 do
     if(chance < rewarditems[i].chance) then
     local info = getItemInfo(rewarditems[i].id)
     if(rewarditems[i].count > 1) then
    text = rewarditems[i].count .. " " .. info.plural
     else
                     text = info.article .. " " .. info.name
     end
     
    local item = doCreateItemEx(rewarditems[i].id, rewarditems[i].count)
     if(doPlayerAddItemEx(cid, item, false) ~= RETURNVALUE_NOERROR) then
     doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
     text = "You have found a reward. It is to heavy or you have not enough space."
     else
     text = "You have found " .. text .. "."
     exhaustion.set(cid, config.exhauststorage, config.exhausttime)
     end
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, text)
     return true
     else
     chance = chance - rewarditems[i].chance
     end
     end
    end
    la de arravi solo tiene chance wuao que buen script pero ahora le integramos level mas chance. ahora hay item para un nivel dado y con chance de sacar el item o no.

    Código:
    -- Time Chest by Limos
    local config = {
     exhausttime = 7200, -- time in seconds
     exhauststorage = 2301,
     level = 25 -- minimum level to open the chest
    }
     
    function onUse(cid, item, fromPosition, itemEx, toPosition)
     
    local rewarditems = {
     [25] = {
     tilllevel = 50,
     {id = 3982, chance = 5, count = 1}, -- start with the lowest chances
     {id = 2476, chance = 10, count = 1},
     {id = 2479, chance = 15, count = 1},
     {id = 2148, chance = 70, count = math.random(1, 50)}
     },
     [50] = {
     tilllevel = 100,
     {id = 7730, chance = 5, count = 1},
    {id = 2466, chance = 10, count = 1},
     {id = 2497, chance = 15, count = 1},
     {id = 2152, chance = 70, count = math.random(1, 20)}
     },
     [100] = {
     tilllevel = 200,
     {id = 2492, chance = 5, count = 1},
    {id = 2498, chance = 10, count = 1},
     {id = 2195, chance = 15, count = 1},
     {id = 2152, chance = 70, count = math.random(20, 50)}
     },
     [200] = {
     tilllevel = 10000,
     {id = 2472, chance = 5, count = 1},
    {id = 2470, chance = 10, count = 1},
     {id = 2157, chance = 15, count = 1},
     {id = 2160, chance = 70, count = math.random(1, 5)}
     }
    }
     
    if(getPlayerLevel(cid) < config.level) then
     doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
    doPlayerSendCancel(cid, "You need to be level "..config.level.." to open the chest.")
     return true
     end
     
    if(exhaustion.check(cid, config.exhauststorage)) then
     local time = exhaustion.get(cid, config.exhauststorage)
     local hours, minutes, seconds = math.floor (time / 3600), math.floor ((time - ((math.floor (time / 3600)) * 3600))/ 60), time - ((math.floor (time/60)) * 60)
     if time >= 3600 then
     text = hours.." "..(hours == 1 and "hour" or "hours")..", "..minutes.." "..(minutes == 1 and "minute" or "minutes").." and "..seconds.." "..(seconds == 1 and "second" or "seconds")
     elseif time >= 120 then
     text = minutes.." "..(minutes == 1 and "minute" or "minutes").." and "..seconds.." "..(seconds == 1 and "second" or "seconds")
     else
     text = seconds.." "..(seconds == 1 and "second" or "seconds")
     end
     doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "It is empty. You need to wait "..text.." before you can get a reward again.")
     return true
     end
     
    local chance = math.random(1,100)
     for v, x in pairs(rewarditems) do
     if(getPlayerLevel(cid) >= v and getPlayerLevel(cid) < x.tilllevel) then
     level = v
     end
     end
     
    for i = 1, #rewarditems[level], 1 do
     if(chance < rewarditems[level][i].chance) then
     local info = getItemInfo(rewarditems[level][i].id)
     if(rewarditems[level][i].count > 1) then
    text = rewarditems[level][i].count .. " " .. info.plural
     else
                     text = info.article .. " " .. info.name
     end
     
    local item = doCreateItemEx(rewarditems[level][i].id, rewarditems[level][i].count)
     if(doPlayerAddItemEx(cid, item, false) ~= RETURNVALUE_NOERROR) then
     doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
     text = "You have found a reward. It is to heavy or you have not enough space."
     else
     text = "You have found " .. text .. "."
     exhaustion.set(cid, config.exhauststorage, config.exhausttime)
     end
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, text)
     return true
     else
     chance = chance - rewarditems[level][i].chance
     end
     end
    end

    Quest por tiempo JJvx9t

    espero que le haya gustado

    la parte editables es (id = #, chance = #)

    bueno saluds atte: god maya

    creditos Limo otland



    Quest por tiempo YNU5B25
    3 participantes
    http://www.tibiaface.com

    2Thông báo Re: Quest por tiempo Sáb Ago 24, 2013 6:35 pm

    "♣Marre♣™"

    Quest por tiempo 462-68
    Miembro
    Miembro
    Super Pava Wn
    Esta fino para usar en un server de Alta Exp como Lvl Scroll Very Happy 10/10

    3 participantes

    3Thông báo Re: Quest por tiempo Sáb Ago 24, 2013 7:31 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    ♣Marre♣™ escribió:Super Pava Wn
    Esta fino para usar en un server de Alta Exp como Lvl Scroll :D10/10

    mare esto e suna prueva sera que me puedes res ponder



    Quest por tiempo YNU5B25
    3 participantes
    http://www.tibiaface.com

    4Thông báo Re: Quest por tiempo Lun Ago 26, 2013 7:38 am

    Psycho

    Psycho
    Moderador
    Moderador
    Buen script lo provare en mi ot



    AFC By Psycho & DMOT Server
    [Tienes que estar registrado y conectado para ver este vínculo]
    3 participantes
    http://digidarkss.com

    5Thông báo Re: Quest por tiempo Lun Ago 26, 2013 9:39 am

    "♣Marre♣™"

    Quest por tiempo 462-68
    Miembro
    Miembro
    God Maya escribió:mare esto e suna prueva sera que me puedes res ponder
    No te entendi Bien
    Pero como una prueva

    3 participantes

    6Thông báo Re: Quest por tiempo Lun Ago 26, 2013 3:26 pm

    Invitado

    Anonymous
    Invitado
    Chatbox Mas raro que un alien JAJAJA

    3 participantes

    7Thông báo Re: Quest por tiempo Lun Ago 26, 2013 3:38 pm

    Psycho

    Psycho
    Moderador
    Moderador
    por q raro?



    AFC By Psycho & DMOT Server
    [Tienes que estar registrado y conectado para ver este vínculo]
    3 participantes
    http://digidarkss.com

    Contenido patrocinado


    3 participantes

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).