• TibiaFace

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

    .
    demo menumenu

    Afiliados



    Votar:

    (AYUDA) NECESITO UN SCRIPT O MOD DE AUTOLOOT!

    Compartir:

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

    Gm Lurran

    Gm Lurran
    Miembro
    Miembro
    Hola amigos

    e estado revisando el foro y e probado algunos mods que hay aqui pero no me an funcionado asi que queria ver si alguno de ustedes tendra algun  AUTOLOOT!

    FUNCIONABLE EN  

    tibia 8.60
    consola : The OTX Server Version: (2.15)


    no necesito que sea muy actual , ni muy avansado solo agregar algo asi para mi ot para que los players tengan algo de variedad , espero no incomodar .

    ojala haya algun buen samaritano que me pueda ayudar saludos a todos gracias de antemano y  apoyo con su like  : D!

    3 participantes

    SoyFabi

    SoyFabi
    Miembro
    Miembro
    data/mods/autoloot.lua

    Código:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <mod name="Autoloot Revolution BT" version="1.0" author="Millhiore BT" contact="none.com" enabled="yes">
    <config name="AutolootRevolutionBT">
    <![CDATA[
    ---@ You configurations:
    autolootConfig = {}
    autolootConfig.storageItems = 27000
    autolootConfig.blockMonsters = {}
    autolootConfig.goldToBank = true
    autolootConfig.goldBankAnimation = true
    autolootConfig.distanceLooting = 7
    autolootConfig.freeSlots = 3
    autolootConfig.premiumSlots = 6
    autolootConfig.vipStorage = {0,0}
    autolootConfig.playerLevel = 8
    autolootConfig.corpseEffect = CONST_ME_NONE
    autolootConfig.golds = {2148, 2152, 2160}
    autolootConfig.tittle = "Welcomen to Autoloot System\nCreate by Millhiore BT\n\nOptions: help, clear, add, remove\n"
    autolootConfig.notHaveCapDrop = false
    ---@ getPlayerPremiumEnabled(cid)
    --# Return boolean
    --# Create by Millhiore BT
    function getPlayerPremiumEnabled(cid)
        if getConfigValue("freePremium") then
            return true
        end
        return getPlayerPremiumDays(cid) > 0
    end
    ---@ getPlayerAutolootVip(cid)
    --# Return boolean
    --# Create by Millhiore BT
    function getPlayerAutolootVip(cid)
        if autolootConfig.vipStorage[1] > 0 then
            if autolootConfig.vipStorage[2] > 0 then
                return getPlayerStorageValue(cid, autolootConfig.vipStorage[1]) == autolootConfig.vipStorage[2]
            else
                return getPlayerStorageValue(cid, autolootConfig.vipStorage[1]) >= os.time()
            end
        end
        return true
    end
    ---@ getPositionDistance(position, positionEx)
    --# Return number
    --# Create by Millhiore BT
    function getPositionDistance(position, positionEx)
        return math.max(math.max(math.abs(position.x - positionEx.x), math.abs(position.y - positionEx.y)), math.abs(position.z - positionEx.z))
    end
    ---@ getPositionCorpse(pos [, itemid])
    --# Return thing/nil
    --# Create by Millhiore BT
    function getPositionCorpse(pos, itemid)
        local tile = getTileInfo(pos)
        for index = 0, tile.things do
            pos.stackpos = index
            local corpse = getThingFromPos(pos, false)
            if corpse.itemid > 1 and isCorpse(corpse.uid) then
                local itemid = itemid or corpse.itemid
                if corpse.itemid == itemid then
                    return corpse
                end
            end
        end
    end
    ---@ getContainerItems(uid [, array])
    --# Return array
    --# Create by Millhiore BT
    function getContainerItems(container, array, haveCap)
        array = array or {}
        haveCap = haveCap or false
        if not isContainer(container.uid) or getContainerSize(container.uid) == 0 then
            array[#array +1] = container
        else
            local size = getContainerSize(container.uid)
            haveCap = (getContainerCap(container.uid) -size) > 0
            for slot = 0, (size -1) do
                local item = getContainerItem(container.uid, slot)
                if item.itemid > 1 then
                    getContainerItems(item, array, haveCap)
                end
            end
        end
        return #array >= 1 and array, haveCap
    end
    ---@ getContainerItemsById(array/uid, itemid)
    --# Return array
    --# Create by Millhiore BT
    function getContainerItemsById(container, itemid)
        local founds = {}
        local items = not container.uid and container or getContainerItems(container)
        for index, item in pairs(items) do
            if item.itemid == itemid then
                founds[#founds +1] = item
            end
        end
        return #founds >= 1 and founds
    end
    ---@ doPlayerAddItemStackable(cid, itemid, count)
    --# Return boolean
    --# Create by Millhiore BT
    function doPlayerAddItemStackable(cid, itemid, count)
        local container = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)
        if container.itemid > 1 then
            local items = getContainerItemsById(container, itemid)
            if not items then
                return doPlayerAddItem(cid, itemid, count)
            else
                local piles = #items
                for index, item in pairs(items) do
                    if item.type < 100 then
                        local sum = item.type + count
                        local result = doTransformItem(item.uid, itemid, sum)
                        if sum <= 100 then
                            return result
                        else
                            return doPlayerAddItem(cid, itemid, sum - 100)
                        end
                    else
                        piles = piles - 1
                        if piles == 0 then
                            return doPlayerAddItem(cid, itemid, count)
                        end
                    end
                end
            end
        end
        return false
    end
    ---@ getContainerMoneys(items)
    --# Return array/false
    --# Create by Millhiore BT
    function getContainerMoneys(items)
        local moneys = {}
        for slot, item in pairs(items) do
            if isInArray(autolootConfig.golds, item.itemid) then
                moneys[#moneys +1] = item
            end
        end
        return #moneys > 0 and moneys
    end
    ---@ doCorpseAutoloot(cid, pos itemid)
    --# Return boolean/nil
    --# Create by Millhiore BT
    function doCorpseAutoloot(cid, pos, itemid, moneys)
        if not getPlayerAutolootVip(cid) or getPositionDistance(getThingPosition(cid), pos) > autolootConfig.distanceLooting
        or getPlayerLevel(cid) < autolootConfig.playerLevel then
            return nil
        end
        local corpse = getPositionCorpse(pos, itemid)
        if corpse and isContainer(corpse.uid) then
            local items, haveCap = moneys or getContainerItems(corpse)
            local sendEffect = false
            if items then
                for slot, item in pairs(items) do
                    if isInArray(getPlayerAutolootItems(cid), item.itemid) then
                        sendEffect = true
                        local removeIt = false
                        local goldToBank = autolootConfig.goldToBank and isInArray(autolootConfig.golds, item.itemid)
                        if not goldToBank then
                            if not haveCap and autolootConfig.notHaveCapDrop then
                                return doCorpseAutoloot(cid, pos, itemid, getContainerMoneys(items))
                            end
                            if isItemStackable(item.itemid) then
                                removeIt = doPlayerAddItemStackable(cid, item.itemid, item.type)
                            else
                                removeIt = doPlayerAddItem(cid, item.itemid)
                            end
                        else
                            local add = (getItemInfo(item.itemid).worth * item.type)
                            removeIt = doPlayerSetBalance(cid, getPlayerBalance(cid) + add)
                            if autolootConfig.goldBankAnimation then
                                doSendAnimatedText(pos, string.format("+%u gps", add), TEXTCOLOR_YELLOW, cid)
                            end
                        end
                        if removeIt then
                            doRemoveItem(item.uid)
                        end
                    end
                end
                if sendEffect then
                    doSendMagicEffect(pos, autolootConfig.corpseEffect, cid)
                end
                return true
            end
        end
    end
    ---@ getPlayerAutolootItems(cid)
    --# Return array
    --# Create by Millhiore BT
    function getPlayerAutolootItems(cid)
        local array = {}
        local content = tostring(getPlayerStorageValue(cid, autolootConfig.storageItems))
        for itemid in string.gmatch(content, "(%d+):") do
            array[#array +1] = tonumber(itemid)
        end
        return array
    end
    ---@ getPlayerAutolootItem(cid, itemid)
    --# Return number/nil
    --# Create by Millhiore BT
    function getPlayerAutolootItem(cid, itemid)
        local autolootItems = getPlayerAutolootItems(cid)
        for index, id in pairs(autolootItems) do
            if itemid == id then
                return index
            end
        end
    end
    ---@ setPlayerAutolootItems(cid [, array])
    --# Return boolean
    --# Create by Millhiore BT
    function setPlayerAutolootItems(cid, array)
        local array = array or {}
        local content = "&"
        for index, itemid in pairs(array) do
            content = string.format("%s%u:", content, itemid)
        end
        return setPlayerStorageValue(cid, autolootConfig.storageItems, content)
    end
    ---@ addPlayerAutolootItem(cid, itemid)
    --# Return boolean
    --# Create by Millhiore BT
    function addPlayerAutolootItem(cid, itemid)
        local autolootItems = getPlayerAutolootItems(cid)
        local found = getPlayerAutolootItem(cid, itemid)
        if not found then
            autolootItems[#autolootItems +1] = itemid
            return setPlayerAutolootItems(cid, autolootItems)
        end
    end
    ---@ removePlayerAutolootItem(cid, itemid)
    --# Return boolean/nil
    --# Create by Millhiore BT
    function removePlayerAutolootItem(cid, itemid)
        local autolootItems = getPlayerAutolootItems(cid)
        local found = getPlayerAutolootItem(cid, itemid)
        if found then
            table.remove(autolootItems, found)
            return setPlayerAutolootItems(cid, autolootItems)
        end
    end
    ---@ showPlayerAutoloot(cid)
    --# Return boolean
    --# Create by Millhiore BT
    function showPlayerAutoloot(cid)
        local maxItems = getPlayerPremiumEnabled(cid) and autolootConfig.premiumSlots or autolootConfig.freeSlots
        local content = string.format("%sYou available slots: %u\n\n%s", autolootConfig.tittle, maxItems, "Your autoloot items:\n")
        local autolootItems = getPlayerAutolootItems(cid)
        for index, itemid in pairs(autolootItems) do
            local it = getItemInfo(itemid)
            content = string.format("%s %c %s\n", content, 155, it.name)
        end
        return doShowTextDialog(cid, 2529, content)
    end
    ---@ showPlayerAutolootHelp(cid)
    --# Return boolean
    --# Create by Millhiore BT
    function showPlayerAutolootHelp(cid)
        local content = autolootConfig.tittle .. "For you info:\n"
        for key, value in pairs(autolootConfig) do
            if not isInArray({"storageItems", "blockMonsters", "vipStorage", "golds", "tittle"}, key) then
                content = string.format("%s%c %s: %s\n", content, 155, tostring(key), tostring(value))
            end
        end
        return doShowTextDialog(cid, 2529, content)
    end
    ]]>
    </config>
    <event type="login" name="AutolootRBTLogin" event="script">
    <![CDATA[
    function onLogin(cid)
        local maxItems = getPlayerPremiumEnabled(cid) and autolootConfig.premiumSlots or autolootConfig.freeSlots
        local autolootItems = getPlayerAutolootItems(cid)
        if #autolootItems > maxItems then
            for index = autolootConfig.premiumSlots, autolootConfig.freeSlots, -1 do
                table.remove(autolootItems, index)
            end
            setPlayerAutolootItems(cid, autolootItems)
            doPlayerSendCancel(cid, "Your list of items overflowed, you should check your list.")
        end
        registerCreatureEvent(cid, "AutolootRBTCombat")
        return true
    end
    ]]>
    </event>
    <event type="death" name="AutolootRBTDeath" event="script">
    <![CDATA[
    domodlib("AutolootRevolutionBT")
    function onDeath(cid, corpse, deathList)
        local killer = deathList[1]
        local position = getThingPosition(cid)
        if corpse.itemid > 1 then
            addEvent(doCorpseAutoloot, 100, killer, position, corpse.itemid)
        end
        return true
    end
    ]]>
    </event>
    <event type="combat" name="AutolootRBTCombat" event="script">
    <![CDATA[
    if isPlayer(cid) and isMonster(target) then
        registerCreatureEvent(target, "AutolootRBTDeath")
    end
    return true
    ]]>
    </event>
    <talkaction words="!autoloot;/autoloot" event="buffer">
    <![CDATA[
    domodlib("AutolootRevolutionBT")
    local split = string.explode(param, ",") or {}
    local action = tostring(split[1]):lower()
    local name = tostring(split[2])
    local itemid = getItemIdByName(name, false)
    local it = getItemInfo(itemid and itemid or 0)
    local position = getThingPosition(cid)
    if action == "add" then
        if not it then
            doPlayerSendCancel(cid, string.format("This item %s does not exist.", name))
        else
            local maxItems = getPlayerPremiumEnabled(cid) and autolootConfig.premiumSlots or autolootConfig.freeSlots
            local autolootItems = getPlayerAutolootItems(cid)
            if #autolootItems > maxItems then
                for index = autolootConfig.premiumSlots, autolootConfig.freeSlots, -1 do
                    table.remove(autolootItems, index)
                end
                setPlayerAutolootItems(cid, autolootItems)
                doPlayerSendCancel(cid, "Your list of items overflowed, you should check your list.")
            elseif #autolootItems == maxItems then
                doPlayerSendCancel(cid, string.format("Your maximum limit is %u items, you must eliminate one to add another.", maxItems))
            elseif addPlayerAutolootItem(cid, itemid) then
                doPlayerSendCancel(cid, string.format("You added the item %s in the list.", name))
            else
                doSendMagicEffect(position, CONST_ME_POFF, cid)
                doPlayerSendCancel(cid, string.format("This item %s already in the list.", name))
            end
        end
    elseif action == "remove" then
        if not it then
            doPlayerSendCancel(cid, string.format("This item %s does not exist.", name))
        else
            if removePlayerAutolootItem(cid, itemid) then
                doPlayerSendCancel(cid, string.format("You removed the item %s from the list.", name))
            else
                doPlayerSendCancel(cid, string.format("This item %s is not in the list.", name))
            end
        end
    elseif action == "help" then
        showPlayerAutolootHelp(cid)
    elseif action == "clear" then
        setPlayerAutolootItems(cid)
        doPlayerSendCancel(cid, "The list of items is now empty.")
    else
        showPlayerAutoloot(cid)
    end
    return true
    ]]>
    </talkaction>
    </mod>

    Los comandos:
    Código:
    !autoloot
    !autoloot help
    !autoloot clear
    !autoloot add
    !autoloot remove

    Configuracion:
    Código:
    ---@ You configurations:
    autolootConfig = {}
    autolootConfig.storageItems = 27000
    autolootConfig.blockMonsters = {}
    autolootConfig.goldToBank = true
    autolootConfig.goldBankAnimation = true
    autolootConfig.distanceLooting = 7
    autolootConfig.freeSlots = 3
    autolootConfig.premiumSlots = 6
    autolootConfig.vipStorage = {0,0}
    autolootConfig.playerLevel = 8
    autolootConfig.corpseEffect = CONST_ME_NONE
    autolootConfig.golds = {2148, 2152, 2160}
    autolootConfig.tittle = "Welcomen to Autoloot System\nCreate by Millhiore BT\n\nOptions: help, clear, add, remove\n"
    autolootConfig.notHaveCapDrop = false

    3 participantes

    Gm Lurran

    Gm Lurran
    Miembro
    Miembro
    SoyFabi escribió:data/mods/autoloot.lua

    Código:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <mod name="Autoloot Revolution BT" version="1.0" author="Millhiore BT" contact="none.com" enabled="yes">
    <config name="AutolootRevolutionBT">
    <![CDATA[
    ---@ You configurations:
    autolootConfig = {}
    autolootConfig.storageItems = 27000
    autolootConfig.blockMonsters = {}
    autolootConfig.goldToBank = true
    autolootConfig.goldBankAnimation = true
    autolootConfig.distanceLooting = 7
    autolootConfig.freeSlots = 3
    autolootConfig.premiumSlots = 6
    autolootConfig.vipStorage = {0,0}
    autolootConfig.playerLevel = 8
    autolootConfig.corpseEffect = CONST_ME_NONE
    autolootConfig.golds = {2148, 2152, 2160}
    autolootConfig.tittle = "Welcomen to Autoloot System\nCreate by Millhiore BT\n\nOptions: help, clear, add, remove\n"
    autolootConfig.notHaveCapDrop = false
    ---@ getPlayerPremiumEnabled(cid)
    --# Return boolean
    --# Create by Millhiore BT
    function getPlayerPremiumEnabled(cid)
        if getConfigValue("freePremium") then
            return true
        end
        return getPlayerPremiumDays(cid) > 0
    end
    ---@ getPlayerAutolootVip(cid)
    --# Return boolean
    --# Create by Millhiore BT
    function getPlayerAutolootVip(cid)
        if autolootConfig.vipStorage[1] > 0 then
            if autolootConfig.vipStorage[2] > 0 then
                return getPlayerStorageValue(cid, autolootConfig.vipStorage[1]) == autolootConfig.vipStorage[2]
            else
                return getPlayerStorageValue(cid, autolootConfig.vipStorage[1]) >= os.time()
            end
        end
        return true
    end
    ---@ getPositionDistance(position, positionEx)
    --# Return number
    --# Create by Millhiore BT
    function getPositionDistance(position, positionEx)
        return math.max(math.max(math.abs(position.x - positionEx.x), math.abs(position.y - positionEx.y)), math.abs(position.z - positionEx.z))
    end
    ---@ getPositionCorpse(pos [, itemid])
    --# Return thing/nil
    --# Create by Millhiore BT
    function getPositionCorpse(pos, itemid)
        local tile = getTileInfo(pos)
        for index = 0, tile.things do
            pos.stackpos = index
            local corpse = getThingFromPos(pos, false)
            if corpse.itemid > 1 and isCorpse(corpse.uid) then
                local itemid = itemid or corpse.itemid
                if corpse.itemid == itemid then
                    return corpse
                end
            end
        end
    end
    ---@ getContainerItems(uid [, array])
    --# Return array
    --# Create by Millhiore BT
    function getContainerItems(container, array, haveCap)
        array = array or {}
        haveCap = haveCap or false
        if not isContainer(container.uid) or getContainerSize(container.uid) == 0 then
            array[#array +1] = container
        else
            local size = getContainerSize(container.uid)
            haveCap = (getContainerCap(container.uid) -size) > 0
            for slot = 0, (size -1) do
                local item = getContainerItem(container.uid, slot)
                if item.itemid > 1 then
                    getContainerItems(item, array, haveCap)
                end
            end
        end
        return #array >= 1 and array, haveCap
    end
    ---@ getContainerItemsById(array/uid, itemid)
    --# Return array
    --# Create by Millhiore BT
    function getContainerItemsById(container, itemid)
        local founds = {}
        local items = not container.uid and container or getContainerItems(container)
        for index, item in pairs(items) do
            if item.itemid == itemid then
                founds[#founds +1] = item
            end
        end
        return #founds >= 1 and founds
    end
    ---@ doPlayerAddItemStackable(cid, itemid, count)
    --# Return boolean
    --# Create by Millhiore BT
    function doPlayerAddItemStackable(cid, itemid, count)
        local container = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)
        if container.itemid > 1 then
            local items = getContainerItemsById(container, itemid)
            if not items then
                return doPlayerAddItem(cid, itemid, count)
            else
                local piles = #items
                for index, item in pairs(items) do
                    if item.type < 100 then
                        local sum = item.type + count
                        local result = doTransformItem(item.uid, itemid, sum)
                        if sum <= 100 then
                            return result
                        else
                            return doPlayerAddItem(cid, itemid, sum - 100)
                        end
                    else
                        piles = piles - 1
                        if piles == 0 then
                            return doPlayerAddItem(cid, itemid, count)
                        end
                    end
                end
            end
        end
        return false
    end
    ---@ getContainerMoneys(items)
    --# Return array/false
    --# Create by Millhiore BT
    function getContainerMoneys(items)
        local moneys = {}
        for slot, item in pairs(items) do
            if isInArray(autolootConfig.golds, item.itemid) then
                moneys[#moneys +1] = item
            end
        end
        return #moneys > 0 and moneys
    end
    ---@ doCorpseAutoloot(cid, pos itemid)
    --# Return boolean/nil
    --# Create by Millhiore BT
    function doCorpseAutoloot(cid, pos, itemid, moneys)
        if not getPlayerAutolootVip(cid) or getPositionDistance(getThingPosition(cid), pos) > autolootConfig.distanceLooting
        or getPlayerLevel(cid) < autolootConfig.playerLevel then
            return nil
        end
        local corpse = getPositionCorpse(pos, itemid)
        if corpse and isContainer(corpse.uid) then
            local items, haveCap = moneys or getContainerItems(corpse)
            local sendEffect = false
            if items then
                for slot, item in pairs(items) do
                    if isInArray(getPlayerAutolootItems(cid), item.itemid) then
                        sendEffect = true
                        local removeIt = false
                        local goldToBank = autolootConfig.goldToBank and isInArray(autolootConfig.golds, item.itemid)
                        if not goldToBank then
                            if not haveCap and autolootConfig.notHaveCapDrop then
                                return doCorpseAutoloot(cid, pos, itemid, getContainerMoneys(items))
                            end
                            if isItemStackable(item.itemid) then
                                removeIt = doPlayerAddItemStackable(cid, item.itemid, item.type)
                            else
                                removeIt = doPlayerAddItem(cid, item.itemid)
                            end
                        else
                            local add = (getItemInfo(item.itemid).worth * item.type)
                            removeIt = doPlayerSetBalance(cid, getPlayerBalance(cid) + add)
                            if autolootConfig.goldBankAnimation then
                                doSendAnimatedText(pos, string.format("+%u gps", add), TEXTCOLOR_YELLOW, cid)
                            end
                        end
                        if removeIt then
                            doRemoveItem(item.uid)
                        end
                    end
                end
                if sendEffect then
                    doSendMagicEffect(pos, autolootConfig.corpseEffect, cid)
                end
                return true
            end
        end
    end
    ---@ getPlayerAutolootItems(cid)
    --# Return array
    --# Create by Millhiore BT
    function getPlayerAutolootItems(cid)
        local array = {}
        local content = tostring(getPlayerStorageValue(cid, autolootConfig.storageItems))
        for itemid in string.gmatch(content, "(%d+):") do
            array[#array +1] = tonumber(itemid)
        end
        return array
    end
    ---@ getPlayerAutolootItem(cid, itemid)
    --# Return number/nil
    --# Create by Millhiore BT
    function getPlayerAutolootItem(cid, itemid)
        local autolootItems = getPlayerAutolootItems(cid)
        for index, id in pairs(autolootItems) do
            if itemid == id then
                return index
            end
        end
    end
    ---@ setPlayerAutolootItems(cid [, array])
    --# Return boolean
    --# Create by Millhiore BT
    function setPlayerAutolootItems(cid, array)
        local array = array or {}
        local content = "&"
        for index, itemid in pairs(array) do
            content = string.format("%s%u:", content, itemid)
        end
        return setPlayerStorageValue(cid, autolootConfig.storageItems, content)
    end
    ---@ addPlayerAutolootItem(cid, itemid)
    --# Return boolean
    --# Create by Millhiore BT
    function addPlayerAutolootItem(cid, itemid)
        local autolootItems = getPlayerAutolootItems(cid)
        local found = getPlayerAutolootItem(cid, itemid)
        if not found then
            autolootItems[#autolootItems +1] = itemid
            return setPlayerAutolootItems(cid, autolootItems)
        end
    end
    ---@ removePlayerAutolootItem(cid, itemid)
    --# Return boolean/nil
    --# Create by Millhiore BT
    function removePlayerAutolootItem(cid, itemid)
        local autolootItems = getPlayerAutolootItems(cid)
        local found = getPlayerAutolootItem(cid, itemid)
        if found then
            table.remove(autolootItems, found)
            return setPlayerAutolootItems(cid, autolootItems)
        end
    end
    ---@ showPlayerAutoloot(cid)
    --# Return boolean
    --# Create by Millhiore BT
    function showPlayerAutoloot(cid)
        local maxItems = getPlayerPremiumEnabled(cid) and autolootConfig.premiumSlots or autolootConfig.freeSlots
        local content = string.format("%sYou available slots: %u\n\n%s", autolootConfig.tittle, maxItems, "Your autoloot items:\n")
        local autolootItems = getPlayerAutolootItems(cid)
        for index, itemid in pairs(autolootItems) do
            local it = getItemInfo(itemid)
            content = string.format("%s %c %s\n", content, 155, it.name)
        end
        return doShowTextDialog(cid, 2529, content)
    end
    ---@ showPlayerAutolootHelp(cid)
    --# Return boolean
    --# Create by Millhiore BT
    function showPlayerAutolootHelp(cid)
        local content = autolootConfig.tittle .. "For you info:\n"
        for key, value in pairs(autolootConfig) do
            if not isInArray({"storageItems", "blockMonsters", "vipStorage", "golds", "tittle"}, key) then
                content = string.format("%s%c %s: %s\n", content, 155, tostring(key), tostring(value))
            end
        end
        return doShowTextDialog(cid, 2529, content)
    end
    ]]>
    </config>
    <event type="login" name="AutolootRBTLogin" event="script">
    <![CDATA[
    function onLogin(cid)
        local maxItems = getPlayerPremiumEnabled(cid) and autolootConfig.premiumSlots or autolootConfig.freeSlots
        local autolootItems = getPlayerAutolootItems(cid)
        if #autolootItems > maxItems then
            for index = autolootConfig.premiumSlots, autolootConfig.freeSlots, -1 do
                table.remove(autolootItems, index)
            end
            setPlayerAutolootItems(cid, autolootItems)
            doPlayerSendCancel(cid, "Your list of items overflowed, you should check your list.")
        end
        registerCreatureEvent(cid, "AutolootRBTCombat")
        return true
    end
    ]]>
    </event>
    <event type="death" name="AutolootRBTDeath" event="script">
    <![CDATA[
    domodlib("AutolootRevolutionBT")
    function onDeath(cid, corpse, deathList)
        local killer = deathList[1]
        local position = getThingPosition(cid)
        if corpse.itemid > 1 then
            addEvent(doCorpseAutoloot, 100, killer, position, corpse.itemid)
        end
        return true
    end
    ]]>
    </event>
    <event type="combat" name="AutolootRBTCombat" event="script">
    <![CDATA[
    if isPlayer(cid) and isMonster(target) then
        registerCreatureEvent(target, "AutolootRBTDeath")
    end
    return true
    ]]>
    </event>
    <talkaction words="!autoloot;/autoloot" event="buffer">
    <![CDATA[
    domodlib("AutolootRevolutionBT")
    local split = string.explode(param, ",") or {}
    local action = tostring(split[1]):lower()
    local name = tostring(split[2])
    local itemid = getItemIdByName(name, false)
    local it = getItemInfo(itemid and itemid or 0)
    local position = getThingPosition(cid)
    if action == "add" then
        if not it then
            doPlayerSendCancel(cid, string.format("This item %s does not exist.", name))
        else
            local maxItems = getPlayerPremiumEnabled(cid) and autolootConfig.premiumSlots or autolootConfig.freeSlots
            local autolootItems = getPlayerAutolootItems(cid)
            if #autolootItems > maxItems then
                for index = autolootConfig.premiumSlots, autolootConfig.freeSlots, -1 do
                    table.remove(autolootItems, index)
                end
                setPlayerAutolootItems(cid, autolootItems)
                doPlayerSendCancel(cid, "Your list of items overflowed, you should check your list.")
            elseif #autolootItems == maxItems then
                doPlayerSendCancel(cid, string.format("Your maximum limit is %u items, you must eliminate one to add another.", maxItems))
            elseif addPlayerAutolootItem(cid, itemid) then
                doPlayerSendCancel(cid, string.format("You added the item %s in the list.", name))
            else
                doSendMagicEffect(position, CONST_ME_POFF, cid)
                doPlayerSendCancel(cid, string.format("This item %s already in the list.", name))
            end
        end
    elseif action == "remove" then
        if not it then
            doPlayerSendCancel(cid, string.format("This item %s does not exist.", name))
        else
            if removePlayerAutolootItem(cid, itemid) then
                doPlayerSendCancel(cid, string.format("You removed the item %s from the list.", name))
            else
                doPlayerSendCancel(cid, string.format("This item %s is not in the list.", name))
            end
        end
    elseif action == "help" then
        showPlayerAutolootHelp(cid)
    elseif action == "clear" then
        setPlayerAutolootItems(cid)
        doPlayerSendCancel(cid, "The list of items is now empty.")
    else
        showPlayerAutoloot(cid)
    end
    return true
    ]]>
    </talkaction>
    </mod>

    Los comandos:
    Código:
    !autoloot
    !autoloot help
    !autoloot clear
    !autoloot add
    !autoloot remove

    Configuracion:
    Código:
    ---@ You configurations:
    autolootConfig = {}
    autolootConfig.storageItems = 27000
    autolootConfig.blockMonsters = {}
    autolootConfig.goldToBank = true
    autolootConfig.goldBankAnimation = true
    autolootConfig.distanceLooting = 7
    autolootConfig.freeSlots = 3
    autolootConfig.premiumSlots = 6
    autolootConfig.vipStorage = {0,0}
    autolootConfig.playerLevel = 8
    autolootConfig.corpseEffect = CONST_ME_NONE
    autolootConfig.golds = {2148, 2152, 2160}
    autolootConfig.tittle = "Welcomen to Autoloot System\nCreate by Millhiore BT\n\nOptions: help, clear, add, remove\n"
    autolootConfig.notHaveCapDrop = false




    gracias por responder bro lo e probado en este momento y me salio lo siguiente veras

    me arrojo este error!

    [Tienes que estar registrado y conectado para ver este vínculo]



    cuando quise agregar un royal helmet paso lo siguiente :

    [Tienes que estar registrado y conectado para ver este vínculo]


    no se agrega a la lista solo me sale este mensaje !

    [Tienes que estar registrado y conectado para ver este vínculo]




    que podra ser :/

    3 participantes

    SoyFabi

    SoyFabi
    Miembro
    Miembro
    Vi que tiene problemas con el 0.3.6 :/

    Usa este:
    Código:
    <talkaction words="!autoloot" event="script" value="Auto Loot.lua"/>

    data/scripts/talkactions/Auto Loot
    Código:
    -- Sistema de auto loot criado por Vítor Bertolucci - Killua

    function ExistItemByName(name) -- by vodka
       local items = io.open("data/items/items.xml", "r"):read("*all")
       local get = items:match('name="' .. name ..'"')
       if get == nil or get == "" then
          return false
       end
       return true
    end

    local function getPlayerList(cid)
       local tab = {}
       if getPlayerStorageValue(cid, 04420021) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420021))
       end
       if getPlayerStorageValue(cid, 04420031) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420031))
       end
       if getPlayerStorageValue(cid, 04420041) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420041))
       end
       if getPlayerStorageValue(cid, 04420051) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420051))
       end
       if #tab > 0 then
          return tab
       end
       return false
    end

    local function addToList(cid, name)
       local itemid = getItemIdByName(name)
       if getPlayerList(cid) and isInArray(getPlayerList(cid), itemid) then
          return false
       end
       if getPlayerStorageValue(cid, 04420021) == -1 then
          return doPlayerSetStorageValue(cid, 04420021, itemid)
       elseif getPlayerStorageValue(cid, 04420031) == -1 then
          return doPlayerSetStorageValue(cid, 04420031, itemid)
       elseif getPlayerStorageValue(cid, 04420041) == -1 then   
          return doPlayerSetStorageValue(cid, 04420041, itemid)
       elseif getPlayerStorageValue(cid, 04420051) == -1 then
          return doPlayerSetStorageValue(cid, 04420051, itemid)
       end
    end

    local function removeFromList(cid, name)
       local itemid = getItemIdByName(name)
       if getPlayerStorageValue(cid, 04420021) == itemid then
          return doPlayerSetStorageValue(cid, 04420021, -1)
       elseif getPlayerStorageValue(cid, 04420031) == itemid then
          return doPlayerSetStorageValue(cid, 04420031, -1)
       elseif getPlayerStorageValue(cid, 04420041) == itemid then
          return doPlayerSetStorageValue(cid, 04420041, -1)
       elseif getPlayerStorageValue(cid, 04420051) == itemid then
          return doPlayerSetStorageValue(cid, 04420051, -1)
       end
       return false
    end

    function onSay(cid, words, param)
       if param == "" then
          local fi = getPlayerStorageValue(cid, 04420021) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420021)) or ""
          local se = getPlayerStorageValue(cid, 04420031) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420031)) or ""
          local th = not vip.hasVip(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 04420041) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420041)) or ""
          local fo = not vip.hasVip(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 04420051) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420051)) or ""
          local stt = getPlayerStorageValue(cid, 04421011) == 1 and "sim" or "não"
          local str = getPlayerStorageValue(cid, 04421001) == 1 and "sim" or "não"
          doPlayerPopupFYI(cid, "{Auto-Loot} ---Menu Auto Loot do jogador\n{Auto-Loot} ----------------\n{Auto-Loot} ---Coletar dinheiro: "..stt..". Para ligar/desligar: !autoloot gold \n{Auto-Loot} ---Coletar itens únicos: "..str..". Para ligar/desligar: !autoloot power\n{Auto-Loot} --Configuração dos slots:\n{Auto-Loot} ---Slot 1: "..fi.."\n{Auto-Loot} ---Slot 2: "..se.."\n{Auto-Loot} ---Slot 3: "..th.."\n{Auto-Loot} ---Slot 4: "..fo.."\n{Auto-Loot} ---Para adicionar um novo item aos slots: !autoloot add, <nome do item>\n{Auto-Loot} ---Para retirar um item dos slots: !autoloot remove, <nome do item>\n{Auto-Loot} ---Para limpar todos os slots utilize: !autoloot clear\n{Auto-Loot} ---Para informações de quanto você já fez utilizando a coleta de dinheiro, use: !autoloot goldinfo\n\nSe seu autoloot bugar use !autoloot desbug\n\n{Auto-Loot} ----------------")
          return true
       end
       
       local t = string.explode(param, ",")
       
       if t[1] == "power" then
          local check = getPlayerStorageValue(cid, 04421001) == -1 and "ligou" or "desligou"
          doPlayerSetStorageValue(cid, 04421001, getPlayerStorageValue(cid, 04421001) == -1 and 1 or -1)
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você "..check.." o auto loot.")
       elseif t[1] == "gold" then
          local check = getPlayerStorageValue(cid, 04421011) == -1 and "ligou" or "desligou"
          doPlayerSetStorageValue(cid, 04421011, getPlayerStorageValue(cid, 04421011) == -1 and 1 or -1)
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você "..check.." a coleta de dinheiro.")
          doPlayerSetStorageValue(cid, 04421021, 0)
       elseif t[1] == "goldinfo" then
          local str = getPlayerStorageValue(cid, 04421011) == -1 and "O sistema de coleta de dinheiro está desligado" or "O sistema já coletou "..getPlayerStorageZero(cid, 04421021).." gold coins"
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, str)
       elseif t[1] == "add" then
          if ExistItemByName(t[2]) then
             local item = getItemIdByName(t[2])
             if isInArray({2160, 2148, 2152}, item) then
                return doPlayerSendCancel(cid, "Você não pode adicionar moedas no autoloot. Para coletar dinheiro use !autoloot gold")
             end
             if vip.hasVip(cid) then
                if getPlayerStorageValue(cid, 04420011) < 3 then
                   if addToList(cid, t[2]) then
                      doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) + 1)
                      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado à sua lista do auto loot! Para ver sua lista diga !autoloot list")
                   else
                      doPlayerSendCancel(cid, t[2].." já está em sua lista!")
                   end
                else
                   doPlayerSendCancel(cid, "Sua lista já tem 4 itens! Você deve remover algum antes de adicionar outro.")
                end
             else
                if getPlayerStorageValue(cid, 04420011) < 1 then
                   if addToList(cid, t[2]) then
                      doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) + 1)
                      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado à sua lista do auto loot! Para ver sua lista diga !autoloot")
                   else
                      doPlayerSendCancel(cid, t[2].." já está em sua lista!")
                   end
                else
                   doPlayerSendCancel(cid, "Você já tem um item adicionado no auto loot! Para adicionar outro, você deve remover o item atual.")
                end
             end
          else
             doPlayerSendCancel(cid, "Este item não existe!")
          end
       elseif t[1] == "remove" then
          if ExistItemByName(t[2]) then
             if removeFromList(cid, t[2]) then
                doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) - 1)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." removido da sua lista do auto loot!")
             else
                doPlayerSendCancel(cid, "Este item não está na sua lista!")
             end
          else
             doPlayerSendCancel(cid, "Este item não existe!")
          end
       elseif t[1] == "clear" then
          if getPlayerStorageValue(cid, 04420011) > -1 then
             doPlayerSetStorageValue(cid, 04420011, -1)
             doPlayerSetStorageValue(cid, 04420021, -1)
             doPlayerSetStorageValue(cid, 04420031, -1)
             doPlayerSetStorageValue(cid, 04420041, -1)
             doPlayerSetStorageValue(cid, 04420051, -1)
             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Lista limpa!")
          else
             doPlayerSendCancel(cid, "Sua lista ja esta limpa!")
          end
       elseif t[1] == "desbug" or t[1] == "desbugar" then
          doPlayerSetStorageValue(cid, 04420011, -1)
          doPlayerSetStorageValue(cid, 04420021, -1)
          doPlayerSetStorageValue(cid, 04420031, -1)
          doPlayerSetStorageValue(cid, 04420041, -1)
          doPlayerSetStorageValue(cid, 04420051, -1)
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Desbugado!")
       elseif t[1] == "list" then
          local fi = getPlayerStorageValue(cid, 04420021) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420021)).."\n" or ""
          local se = getPlayerStorageValue(cid, 04420031) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420031)).."\n" or ""
          local th = getPlayerStorageValue(cid, 04420041) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420041)).."\n" or ""
          local fo = getPlayerStorageValue(cid, 04420051) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420051)).."\n" or ""
          doPlayerPopupFYI(cid, "O sistema auto loot está coletando:\n "..fi..""..se..""..th..""..fo)
       end
       return true
    end

    data/creaturescripts/scripts/kill

    Código:
    local aloot_boost = {[2406] = 36, [2537] = 4800, [2377] = 480, [2663] = 600, [2472] = 195000, [2398] = 36, [2475] = 7200, [2519] = 6500, [2497] = 10700, [2523] = 180000, [2494] = 325000, [2400] = 144000, [2491] = 6000, [2421] = 325000, [2646] = 260000, [2477] = 7200, [2413] = 84, [2656] = 18000, [2498] = 52000, [2647] = 600, [2534] = 32500, [7402] = 19500, [2466] = 26000, [2465] = 240, [2408] = 120000, [2518] = 1800, [2500] = 3000, [2376] = 30, [2470] = 91000, [2388] = 24, [2645] = 26000, [2434] = 2400, [2463] = 480, [2536] = 11700, [2387] = 240, [2396] = 4800, [2381] = 240, [2528] = 4800, [2409] = 1800, [2414] = 12000, [2427] = 9000, [2407] = 7200, [2458] = 42, [2383] = 960, [2392] = 3600, [2488] = 18000, [2525] = 120, [2423] = 240, [7382] = 13000, [2462] = 1300, [2520] = 39000, [2390] = 180000, [2417] = 72, [2436] = 1200, [5741] = 52000, [2378] = 120, [2487] = 24000, [2476] = 6500, [8891] = 36000, [2459] = 36, [2195] = 52000, [2391] = 7200, [2464] = 120, [8889] = 72000, [2432] = 13000, [2431] = 108000, [2492] = 52000, [2515] = 240, [2430] = 2400, [2393] = 13000, [7419] = 36000, [2522] = 130000, [2514] = 65000}

    local function getPlayerStorageZero(cid, storage) -- By Killua
        local sto = getPlayerStorageValue(cid, storage)
        if tonumber(sto) then
            return tonumber(sto) > tonumber(0) and tonumber(sto) or tonumber(0)
        end
        return tonumber(0)
    end

    local tabela = {}

    local function getPlayerList(cid)
       local tab = {}
       if getPlayerStorageValue(cid, 04420021) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420021))
       end
       if getPlayerStorageValue(cid, 04420031) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420031))
       end
       if getPlayerStorageValue(cid, 04420041) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420041))
       end
       if getPlayerStorageValue(cid, 04420051) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420051))
       end
       if #tab > 0 then
          return tab
       end
       return {}
    end

    local function boost(cid)
       return tonumber(getPlayerStorageValue(cid,722381)) >= os.time()
    end

    local function autoLoot(cid, pos)
       if not isPlayer(cid) then return end
       local check = false
       local str = ""
       local position = {}
       for i = 1, 255 do
          pos.stackpos = i
          if getThingFromPos(pos).uid and getThingFromPos(pos).uid > 0 and isContainer(getThingFromPos(pos).uid) then
             position = pos
             check = true
             break
          end
       end
       if check then
          local corpse = getContainerItemsInfo(getThingFromPos(position).uid)      
          if corpse then
             for index, info in pairs(corpse) do
                if index < countTable(corpse) then
                   if info.uid and info.itemid then
                      if isContainer(info.uid) then
                         local bag = getContainerItemsInfo(info.uid)
                         for i = 1, countTable(bag) do
                            if isInArray(getPlayerList(cid), bag[i].itemid) then
                               if bag[i].quant > 1 then
                                  doRemoveItem(bag[i].uid, bag[i].quant)
                                  doPlayerAddItem(cid, bag[i].itemid, bag[i].quant)
                                  str = str.." "..bag[i].quant.." "..getItemNameById(bag[i].itemid).." +"
                               else
                                  doRemoveItem(bag[i].uid)
                                  if boost(cid) then
                                     if aloot_boost[bag[i].itemid] then
                                        doPlayerSetBalance(cid,getPlayerBalance(cid) + aloot_boost[bag[i].itemid])
                                        str = str.." 1 "..getItemNameById(bag[i].itemid).." ("..aloot_boost[bag[i].itemid].."gp no banco) +"
                                     else
                                        doPlayerAddItem(cid, bag[i].itemid, 1)
                                        str = str.." 1 "..getItemNameById(bag[i].itemid).." +"
                                     end
                                  else
                                     doPlayerAddItem(cid, bag[i].itemid, 1)
                                     str = str.." 1 "..getItemNameById(bag[i].itemid).." +"
                                  end
                               end
                            end
                         end
                      end
                   end
                end
                if isInArray(getPlayerList(cid), info.itemid) then
                   if info.quant > 1 then
                      doRemoveItem(info.uid, info.quant)
                      doPlayerAddItem(cid, info.itemid, info.quant)
                      str = str.." "..info.quant.." "..getItemNameById(info.itemid).." +"
                   else
                      doRemoveItem(info.uid)
                      if boost(cid) then
                         if aloot_boost[info.itemid] then
                            doPlayerSetBalance(cid,getPlayerBalance(cid) + aloot_boost[info.itemid])
                            str = str.." 1 "..getItemNameById(info.itemid).." ("..aloot_boost[info.itemid].."gps no banco) +"
                         else
                            doPlayerAddItem(cid, info.itemid, 1)
                            str = str.." 1 "..getItemNameById(info.itemid).." +"
                         end
                      else
                         doPlayerAddItem(cid, info.itemid, 1)
                         str = str.." 1 "..getItemNameById(info.itemid).." +"
                      end
                   end
                end
             end
          end
       end
       setPlayerTableStorage(cid,822564,{[1] = str, [2] = 0})
    end

    local function autoGold(cid, pos)
       if not isPlayer(cid) then return end
       local check = false
       local total = 0
       local position = {}
       for i = 1, 255 do
          pos.stackpos = i
          if getThingFromPos(pos).uid and getThingFromPos(pos).uid > 0 and isContainer(getThingFromPos(pos).uid) then
             position = pos
             check = true
             break
          end
       end
       if check then
          local corpse = getContainerItemsInfo(getThingFromPos(position).uid)
          if corpse then
             for index, info in pairs(corpse) do
                if info.uid and info.itemid then
                   if index < countTable(corpse) then
                      if isContainer(info.uid) then
                         local bag = getContainerItemsInfo(info.uid)
                         for i = 1, countTable(bag) do
                            if isInArray({2148, 2152, 2160}, bag[i].itemid) then
                               local multiplie = 1
                               if bag[i].itemid == 2148 then
                                  multiplie = 1
                               elseif bag[i].itemid == 2152 then
                                  multiplie = 100
                               elseif bag[i].itemid == 2160 then
                                  multiplie = 10000
                               end
                               doRemoveItem(bag[i].uid, bag[i].quant)
                               doPlayerSetBalance(cid, getPlayerBalance(cid) + tonumber(bag[i].quant) * multiplie)
                               total = total + bag[i].quant * multiplie
                               doPlayerSetStorageValue(cid, 04421021, tonumber(getPlayerStorageZero(cid, 04421021)) + tonumber(info.quant) * tonumber(multiplie))
                            end
                         end
                      end
                   end
                   if isInArray({2148, 2152, 2160}, info.itemid) then
                      local multiplie = 1
                      if info.itemid == 2148 then
                         multiplie = 1
                      elseif info.itemid == 2152 then
                         multiplie = 100
                      elseif info.itemid == 2160 then
                         multiplie = 10000
                      end
                      doRemoveItem(info.uid, info.quant)
                      doPlayerSetBalance(cid, getPlayerBalance(cid) + info.quant * multiplie)
                      doPlayerSetStorageValue(cid, 04421021, tonumber(getPlayerStorageZero(cid, 04421021)) + tonumber(info.quant) * tonumber(multiplie))
                      total = total + info.quant * multiplie
                   end
                end
             end
          end
       end
       if total > 0 then
          total = total - (total * 0.2)
          total = math.ceil(total)
          doPlayerSetBalance(cid,getPlayerBalance(cid) + total)
          local tab = getPlayerTableStorage(cid,822564)
          tab[2] = total
          setPlayerTableStorage(cid,822564,tab)
       end
    end

    local function sendMsg(cid)
       if not isPlayer(cid) then return end
       local tab = getPlayerTableStorage(cid,822564)
       if countTable(tab) >= 1 then
          if tab[1] then
             if tab[2] and tab[2] > 0 then
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: ".. tab[1] .." ".. tab[2] .." gold coins.")
             else
                if type(tab[1]) == "string" and string.len(tab[1]) > 1 then
                   doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: "..tab[1])
                end
             end
          elseif not tab[1] then
             if tab[2] then
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: "..tab[2].." gold coins.")
             end
          end
       end
       doPlayerSetStorageValue(cid,822564,-1)
    end

    local bosses = {
        ["Striker Cyclope"] = {
            {itemid = 9971, count = {min = 5, max = 15}},
       {itemid = 12396, count = {min = 1, max = 1}},
       {itemid = 2346, count = {min = 0, max = 1}},
            {itemid = 12575, count = {min = 1, max = 1}}
        },
        ["Bk Ferumbras"] = {
            {itemid = 8305, count = {min = 1, max = 2}},
       {itemid = 8981, count = {min = 1, max = 1}},
       {itemid = 9971, count = {min = 50, max = 80}},
       {itemid = 12396, count = {min = 3, max = 5}},
            {itemid = 12575, count = {min = 3, max = 5}}
        },
    }

    local wzUmBoss = {
        ["Gonka"] = {
            {itemid = 9971, count = {min = 5, max = 15}},
       {itemid = 12396, count = {min = 1, max = 1}},
       {itemid = 2346, count = {min = 0, max = 1}},
            {itemid = 12575, count = {min = 1, max = 1}}
        }
    }

    local wzDoisBoss = {
        ["Jabuti"] = {
            {itemid = 9971, count = {min = 5, max = 15}},
       {itemid = 12396, count = {min = 1, max = 1}},
       {itemid = 2346, count = {min = 0, max = 1}},
            {itemid = 12575, count = {min = 1, max = 1}}
        }
    }

    function getRotate(uid)
        local pos = getCreaturePosition(uid)
        return
        {
            {x = pos.x, y = pos.y-1, z = pos.z},
            {x = pos.x, y = pos.y+1, z = pos.z},
            {x = pos.x-1, y = pos.y, z = pos.z},
            {x = pos.x+1, y = pos.y, z = pos.z}
        }
    end

    function getRotateUm(uid)
        local pos = getCreaturePosition(uid)
        return
        {
            {x = pos.x-1, y = pos.y-1, z = pos.z},
            {x = pos.x+1, y = pos.y+1, z = pos.z},
            {x = pos.x+1, y = pos.y-1, z = pos.z},
            {x = pos.x-1, y = pos.y+1, z = pos.z}
        }
    end

    function getRotateDois(uid)
        local pos = getCreaturePosition(uid)
        return
        {
            {x = pos.x, y = pos.y-1, z = pos.z},
            {x = pos.x, y = pos.y+1, z = pos.z},
            {x = pos.x-1, y = pos.y, z = pos.z},
            {x = pos.x+1, y = pos.y, z = pos.z}
        }
    end

    function DelTp()
       posWzDois = {x = 132, y = 138, z = 15}
            local t = getTileItemById(posWzDois, 1387)
            if t then
                    doRemoveItem(t.uid, 1)
                    doSendMagicEffect(posWzDois, CONST_ME_POFF)
            end
    end

    function DelTpWz()
       posWzUm = {x = 153, y = 278, z = 14}
            local t = getTileItemById(posWzUm, 1387)
            if t then
                    doRemoveItem(t.uid, 1)
                    doSendMagicEffect(posWzUm, CONST_ME_POFF)
            end
    end

    function onKill(cid, target, lastHit)
        local bid = bosses[getCreatureName(target)]
        local wzUm = wzUmBoss[getCreatureName(target)]
        local wzDois = wzDoisBoss[getCreatureName(target)]
        local level = 400
        local item,count = 5925,1
        local monster = getCreatureName(target)
        local room = getArenaMonsterIdByName(monster)

        if room > 0 then
       setPlayerStorageValue(cid, room, 1)
       doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT,'Voce pode ir para a proxima sala!')
        end

        if isPlayer(target) and isPlayer(cid) then
            local pid = getPlayersOnline()
            for i = 1, #pid do
                doPlayerSendChannelMessage(pid[i], "", "O jogador ".. getCreatureName(cid) .." [".. getPlayerLevel(cid) .."]  acabou de matar o noob " .. getCreatureName(target) .. " [".. getPlayerLevel(target) .."]!", TALKTYPE_CHANNEL_HIGHLIGHT, 8)
            end

       if getPlayerLevel(target) >= 400 then
                if getPlayerIp(cid) ~= getPlayerIp(target) then
              if getPlayerLevel(target) >= 400 and getPlayerLevel(target) <= 449 then
                 exppg = getExperienceStage(getPlayerLevel(cid))
                 doPlayerAddExp(cid, 22000 * exppg)
                 doSendAnimatedText(getThingPos(cid), 12000 * exppg, 210)
              elseif getPlayerLevel(target) >= 450 and getPlayerLevel(target) <= 499 then
                 exppg = getExperienceStage(getPlayerLevel(cid))
                 doPlayerAddExp(cid, 26000 * exppg)
                 doSendAnimatedText(getThingPos(cid), 12000 * exppg, 210)
              elseif getPlayerLevel(target) >= 500 and getPlayerLevel(target) <= 549 then
                 exppg = getExperienceStage(getPlayerLevel(cid))
                 doPlayerAddExp(cid, 32000 * exppg)
                 doSendAnimatedText(getThingPos(cid), 15000 * exppg, 210)
              elseif getPlayerLevel(target) >= 550 then
                 exppg = getExperienceStage(getPlayerLevel(cid))
                 doPlayerAddExp(cid, 36000 * exppg)
                 doSendAnimatedText(getThingPos(cid), 20000 * exppg, 210)
                   end
          if getPlayerStorageValue(cid,22867) >= 1 and getPlayerStorageValue(cid,34765) <= 30 then
             setPlayerStorageValue(cid, 34765, getPlayerStorageValue(cid, 34765) + 1)
          end
                end
       end
        end

        if isPlayer(cid) and isPlayer(target) and getPlayerIp(target) ~= getPlayerIp(cid) then
       doPlayerAddItem(cid, item, count)
        end

        if isPlayer(cid) and isMonster(target) then
       if getPlayerStorageValue(cid, 04421001) == 1 and #getPlayerList(cid) > 0 then
          local pos = getCreaturePosition(target)
          addEvent(autoLoot, 500, cid, pos)
       end
       if getPlayerStorageValue(cid, 04421011) == 1 then
          local pos = getCreaturePosition(target)
          addEvent(autoGold, 540, cid, pos)
       end
       if getPlayerStorageValue(cid, 04421001) == 1 or getPlayerStorageValue(cid, 04421011) == 1 then
          addEvent(sendMsg, 560, cid)
       end
        end

        if isMonster(target) and bid and getStorage(33999) <= os.time() then
            doCreatureSetDropLoot(target, nil)
            for _, v in ipairs(bid) do
                doCreateItem(v.itemid, math.random(v.count.min, v.count.max), getRotate(target)[_])
           doCreateItem(v.itemid, math.random(v.count.min, v.count.max), getRotateUm(target)[_])
           doCreateItem(v.itemid, math.random(v.count.min, v.count.max), getRotateDois(target)[_])
                doSendMagicEffect(getRotate(target)[_], 6)
            end
            doSetStorage(33999, os.time() + 5)
        end

        if isMonster(target) and wzUm then
       doCreateTeleport(1387, {x=204, y=179, z=15}, {x=153, y=278, z=14})
       setPlayerStorageValue(cid, 45698, 1)
       addEvent(DelTpWz, 60 * 1000)
        end

        if isMonster(target) and wzDois then
       doCreateTeleport(1387, {x=204, y=179, z=15}, {x=132,y=138,z=15})
       setPlayerStorageValue(cid, 45699, 1)
       addEvent(DelTp, 60 * 1000)
        end
        return true
    end

    data/creaturescripts/login
    Código:
    registerCreatureEvent(cid, "Kills")

    data/creaturescripts/creaturescripts.xml
    Código:
     <event type="kill" name="Kills" event="script" value="kill.lua"/>

    data/libs/crear nuevo archivo llamado 049-vipsys

    colocar esto dentro:
    Código:
    vip = {
    name = "VIP System";
    author = "Mock";
    version = "1.0.0.0";
    query="ALTER TABLE `accounts` ADD `vip_time` INTEGER";
    query2="ALTER TABLE `accounts` ADD `vip_time` INT(15) NOT NULL"
    }

    function vip.setTable()
    dofile('config.lua')
    if sqlType == "sqlite" then
       db.query(vip.query)
    else
          db.query(vip.query2)
    end
    end

    function vip.getVip(cid)
           assert(tonumber(cid),'Parameter must be a number')
           if isPlayer(cid) == FALSE then error('Player don\'t find') end;
           ae = db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..getPlayerAccount(cid).."';")
           if ae:getID() == -1 then
             return 0
           end

    local retee = ae:getDataInt("vip_time") or 0
    ae:free()
           return retee
    end

    function vip.getVipByAcc(acc)
           assert(acc,'Account is nil')
           local a = db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..acc.."';")
           if a:getID() ~= -1 then
              return a:getDataInt("vip_time") or 0, a:free()
           else
              error('Account don\'t find.')
           end
    end

    function vip.setVip(cid,time)
           dofile("config.lua")
           assert(tonumber(cid),'Parameter must be a number')
           assert(tonumber(time),'Parameter must be a number')
           if isPlayer(cid) == FALSE then error('Player don\'t find') end;
           db.query("UPDATE `"..sqlDatabase.."`.`accounts` SET `vip_time` = '"..(os.time()+time).."' WHERE `accounts`.`name` ='".. getPlayerAccount(cid).."';")
    end

    function vip.getVipByAccount(acc)
           assert(acc,'Account is nil')
           return db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..acc.."';"):getDataInt("vip_time") or 0
    end                           

    function vip.hasVip(cid)
           assert(tonumber(cid),'Parameter must be a number')
           if isPlayer(cid) == FALSE then return end;
           local t = vip.getVip(cid) or 0
           if os.time(day) < t then
             return TRUE
           else
             return FALSE
           end
    end

    function vip.hasVips(cid)
           assert(tonumber(cid),'Parameter must be a number')
           if isPlayer(cid) == FALSE then return end;
           local t = vip.getVip(cid)
           if os.time(day) < t then
             return TRUE
           else
             return FALSE
           end
    end

    function vip.accountHasVip(acc)
           assert(acc,'Account is nil')
           if os.time() < vip.getVipByAccount(acc) then
             return TRUE
           else
             return FALSE
           end
    end
    function vip.getDays(days)
    return (3600 * 24 * days)
    end

    function vip.addVipByAccount(acc,time)
    assert(acc,'Account is nil')
    assert(tonumber(time),'Parameter must be a number')
    local a = vip.getVipByAcc(acc)
    a = os.difftime(a,os.time())
    if a < 0 then a = 0 end;
    a = a+time
    return vip.setVipByAccount(acc,a)
    end

    function vip.setVipByAccount(acc,time)
           dofile("config.lua")
           assert(acc,'Account is nil')
           assert(tonumber(time),'Parameter must be a number')
           db.query("UPDATE `accounts` SET `vip_time` = '"..(os.time()+time).."' WHERE `accounts`.`name` ='"..acc.."';")
           return TRUE
    end

    function vip.returnVipString(cid)
    assert(tonumber(cid),'Parameter must be a number')
    if isPlayer(cid) == TRUE then
        return os.date("%d %B %Y %X ", vip.getVip(cid))
    end
    end

    crear otro archivo nuevo llamado arena
    Código:
    -- arena script
    InitArenaScript = 0
    arena_room_max_time = 240 -- time in seconds for one arena room
    arenaKickPosition = {x=160, y=54, z=7} -- position where kick from arena when you leave/you did arena level
    arena_monsters = {}
    arena_monsters[42300] = 'frostfur' -- first monster from 1 arena
    arena_monsters[42301] = 'bloodpaw'
    arena_monsters[42302] = 'bovinus'
    arena_monsters[42303] = 'achad'
    arena_monsters[42304] = 'colerian the barbarian'
    arena_monsters[42305] = 'the hairy one'
    arena_monsters[42306] = 'axeitus headbanger'
    arena_monsters[42307] = 'rocky'
    arena_monsters[42308] = 'cursed gladiator'
    arena_monsters[42309] = 'orcus the cruel'
    arena_monsters[42310] = 'avalanche' -- first monster from 2 arena
    arena_monsters[42311] = 'kreebosh the exile'
    arena_monsters[42312] = 'the dark dancer'
    arena_monsters[42313] = 'the hag'
    arena_monsters[42314] = 'slim'
    arena_monsters[42315] = 'grimgor guteater'
    arena_monsters[42316] = 'drasilla'
    arena_monsters[42317] = 'spirit of earth'
    arena_monsters[42318] = 'spirit of water'
    arena_monsters[42319] = 'spirit of fire'
    arena_monsters[42320] = 'webster' -- first monster from 3 arena
    arena_monsters[42321] = 'darakan the executioner'
    arena_monsters[42322] = 'norgle glacierbeard'
    arena_monsters[42323] = 'the pit lord'
    arena_monsters[42324] = 'svoren the mad'
    arena_monsters[42325] = 'the masked marauder'
    arena_monsters[42326] = 'gnorre chyllson'
    arena_monsters[42327] = "fallen mooh'tah master ghar"
    arena_monsters[42328] = 'deathbringer'
    arena_monsters[42329] = 'the obliverator'

    function getArenaMonsterIdByName(name)
        name = string.lower(tostring(name))
        for i = 42300, 42329 do
            if tostring(arena_monsters[i]) == name then
                return i
            end
        end
        return 0
    end 

    y por ultimo crear otro archivo llamado killua's lib
    Código:
    -- lib and functions by Vitor Bertolucci (Killua)

    function warnPlayersWithStorage(storage, value, class, message) -- By Killua
        if not value then value = 1 end
       if not class then class = MESSAGE_SATUS_CONSOLE_WARNING end
       if not storage or not message then return end
        if #getPlayersOnline() == 0 then
            return
        end
        for _, pid in pairs(getPlayersOnline()) do
            if getPlayerStorageValue(pid, storage) == value then
                doPlayerSendTextMessage(pid, class, message)
          end
       if getPlayerAccess(pid) >= 4 then   
          doPlayerSendTextMessage(pid, class, "Message to those with storage "..storage..message) -- Gms will always receive the messages
       end
        end
    end

    function getPlayerStorageZero(cid, storage) -- By Killua
        local sto = getPlayerStorageValue(cid, storage)
        return sto > 0 and sto or 0
    end

    function getStorageZero(storage) -- By Killua
        local sto = getGlobalStorageValue(storage)
        return sto > 0 and sto or 0
    end

    function countTable(table) -- By Killua
        local y = 0
        if type(table) == "table" then
            for _ in pairs(table) do
                y = y + 1
            end
            return y
        end
        return false
    end

    function getPlayersInArea(frompos, topos) -- By Killua
        local players_ = {}
        local count = 1
        for _, pid in pairs(getPlayersOnline()) do
            if isInArea(getCreaturePosition(pid), frompos, topos) then
                players_[count] = pid
                count = count + 1
            end
        end
        return countTable(players_) > 0 and players_ or false
    end

    function getGuildNameById(gid) -- By Killua
        local query = db.getResult("SELECT `name` FROM `guilds` WHERE `id` = '"..gid.."'")
        if query:getID() == -1 then
            return ""
        end
        local name = query:getDataString("name")
        query:free()
        return name
    end

    function getContainerItemsInfo(containerUid) -- By Killua
        local table = {}
        if containerUid and containerUid > 0 then
            local a = 0 
            for i = 0, getContainerSize(containerUid) - 1 do
                local item = getContainerItem(containerUid,i)
                a = a + 1
                table[a] = {uid = item.uid, itemid = item.itemid, quant = item.type}
            end
            return table
        end
        return false
    end

    function getTableEqualValues(table) -- By Killua
        local ck = {}
        local eq = {}
        if type(table) == "table" then
             if countTable(table) and countTable(table) > 0 then
                 for i = 1, countTable(table) do
                   if not isInArray(ck, table[i]) then
                        ck[i] = table[i]
                    else
                        eq[i] = table[i]
                    end
                end
                return countTable(eq) > 0 and eq or 0
            end
        end
        return false
    end

    function killuaGetItemLevel(uid) -- By Killua
       local name = getItemName(uid)
       local pos = 0
       for i = 1, #name do
          if string.byte(name:sub(i,i)) == string.byte('+') then
             pos = i + 1
             break
          end
       end
       return tonumber(name:sub(pos,pos))
    end

    k_table_storage_lib = {
       filtrateString = function(str) -- By Killua
          local tb, x, old, last = {}, 0, 0, 0
          local first, second, final = 0, 0, 0
          if type(str) ~= "string" then
             return tb
          end
          for i = 2, #str-1 do
             if string.byte(str:sub(i,i)) == string.byte(':') then
                x, second, last = x+1, i-1, i+2
                for t = last,#str-1 do
                   if string.byte(str:sub(t,t)) == string.byte(',') then
                      first = x == 1 and 2 or old
                      old, final = t+2, t-1
                      local index, var = str:sub(first,second), str:sub(last,final)
                      tb[tonumber(index) or tostring(index)] = tonumber(var) or tostring(var)
                      break
                   end
                end
             end
          end
          return tb
       end,

       translateIntoString = function(tb) -- By Killua
          local str = ""
          if type(tb) ~= "table" then
             return str
          end
          for i, t in pairs(tb) do
             str = str..i..": "..t..", "
          end
          str = "a"..str.."a"
          return tostring(str)
       end
    }

    function setPlayerTableStorage(cid, key, value) -- By Killua
       return doPlayerSetStorageValue(cid, key, k_table_storage_lib.translateIntoString(value))
    end

    function getPlayerTableStorage(cid, key) -- By Killua
       return k_table_storage_lib.filtrateString(getPlayerStorageValue(cid, key))
    end

    function setGlobalTableStorage(key, value) -- By Killua
       return setGlobalStorageValue(key, k_table_storage_lib.translateIntoString(value))
    end

    function getGlobalTableStorage(key) -- By Killua
       return k_table_storage_lib.filtrateString(getGlobalStorageValue(key))
    end

    function printTable(table, includeIndices,prnt) -- By Killua
        if includeIndices == nil then includeIndices = true end
        if prnt == nil then prnt = true end
        if type(table) ~= "table" then
            error("Argument must be a table")
            return
        end
        local str, c = "{", ""
        for v, b in pairs(table) do
            if type(b) == "table" then
                str = includeIndices and str..c.."["..v.."]".." = "..printTable(b,true,false) or str..c..printTable(b,false,false)
            else
                str = includeIndices and str..c.."["..v.."]".." = "..b or str..c..b
            end
            c = ", "
        end
        str = str.."}"
        if prnt then print(str) end
        return str
     end
     
    function checkString(str) -- By Killua
       local check = true
       for i = 1, #str do
          local letra = string.byte(str:sub(i,i))
          if letra >= string.byte('a') and letra <= string.byte('z') or letra >= string.byte('A') and letra <= string.byte('Z') or letra >= string.byte('0') and letra <= string.byte('9') then
             check = true
          else
             check = false
             break
          end
       end
       return check
    end

    function isArmor(itemid) -- By Killua
       return getItemInfo(itemid).armor > 0
    end

    function isWeapon(uid) -- By Killua
       return getItemWeaponType(uid) ~= 0
    end

    function isShield(uid) -- By Killua
       return getItemWeaponType(uid) == 5
    end

    function isSword(uid) -- By Killua
       return getItemWeaponType(uid) == 1
    end

    function isClub(uid) -- By Killua
       return getItemWeaponType(uid) == 2
    end

    function isAxe(uid) -- By Killua
       return getItemWeaponType(uid) == 3
    end

    function isBow(uid) -- By Killua
       return getItemWeaponType(uid) == 4
    end

    function isWand(uid) -- By Killua
       return getItemWeaponType(uid) == 7
    end

    Ya quedaria perfecto, ahora a utilizar el autoloot.









    3 participantes

    Gm Lurran

    Gm Lurran
    Miembro
    Miembro
    SoyFabi escribió:Vi que tiene problemas con el 0.3.6 :/

    Usa este:
    Código:
    <talkaction words="!autoloot" event="script" value="Auto Loot.lua"/>

    data/scripts/talkactions/Auto Loot
    Código:
    -- Sistema de auto loot criado por Vítor Bertolucci - Killua

    function ExistItemByName(name) -- by vodka
       local items = io.open("data/items/items.xml", "r"):read("*all")
       local get = items:match('name="' .. name ..'"')
       if get == nil or get == "" then
          return false
       end
       return true
    end

    local function getPlayerList(cid)
       local tab = {}
       if getPlayerStorageValue(cid, 04420021) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420021))
       end
       if getPlayerStorageValue(cid, 04420031) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420031))
       end
       if getPlayerStorageValue(cid, 04420041) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420041))
       end
       if getPlayerStorageValue(cid, 04420051) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420051))
       end
       if #tab > 0 then
          return tab
       end
       return false
    end

    local function addToList(cid, name)
       local itemid = getItemIdByName(name)
       if getPlayerList(cid) and isInArray(getPlayerList(cid), itemid) then
          return false
       end
       if getPlayerStorageValue(cid, 04420021) == -1 then
          return doPlayerSetStorageValue(cid, 04420021, itemid)
       elseif getPlayerStorageValue(cid, 04420031) == -1 then
          return doPlayerSetStorageValue(cid, 04420031, itemid)
       elseif getPlayerStorageValue(cid, 04420041) == -1 then   
          return doPlayerSetStorageValue(cid, 04420041, itemid)
       elseif getPlayerStorageValue(cid, 04420051) == -1 then
          return doPlayerSetStorageValue(cid, 04420051, itemid)
       end
    end

    local function removeFromList(cid, name)
       local itemid = getItemIdByName(name)
       if getPlayerStorageValue(cid, 04420021) == itemid then
          return doPlayerSetStorageValue(cid, 04420021, -1)
       elseif getPlayerStorageValue(cid, 04420031) == itemid then
          return doPlayerSetStorageValue(cid, 04420031, -1)
       elseif getPlayerStorageValue(cid, 04420041) == itemid then
          return doPlayerSetStorageValue(cid, 04420041, -1)
       elseif getPlayerStorageValue(cid, 04420051) == itemid then
          return doPlayerSetStorageValue(cid, 04420051, -1)
       end
       return false
    end

    function onSay(cid, words, param)
       if param == "" then
          local fi = getPlayerStorageValue(cid, 04420021) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420021)) or ""
          local se = getPlayerStorageValue(cid, 04420031) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420031)) or ""
          local th = not vip.hasVip(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 04420041) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420041)) or ""
          local fo = not vip.hasVip(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 04420051) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420051)) or ""
          local stt = getPlayerStorageValue(cid, 04421011) == 1 and "sim" or "não"
          local str = getPlayerStorageValue(cid, 04421001) == 1 and "sim" or "não"
          doPlayerPopupFYI(cid, "{Auto-Loot} ---Menu Auto Loot do jogador\n{Auto-Loot} ----------------\n{Auto-Loot} ---Coletar dinheiro: "..stt..". Para ligar/desligar: !autoloot gold \n{Auto-Loot} ---Coletar itens únicos: "..str..". Para ligar/desligar: !autoloot power\n{Auto-Loot} --Configuração dos slots:\n{Auto-Loot} ---Slot 1: "..fi.."\n{Auto-Loot} ---Slot 2: "..se.."\n{Auto-Loot} ---Slot 3: "..th.."\n{Auto-Loot} ---Slot 4: "..fo.."\n{Auto-Loot} ---Para adicionar um novo item aos slots: !autoloot add, <nome do item>\n{Auto-Loot} ---Para retirar um item dos slots: !autoloot remove, <nome do item>\n{Auto-Loot} ---Para limpar todos os slots utilize: !autoloot clear\n{Auto-Loot} ---Para informações de quanto você já fez utilizando a coleta de dinheiro, use: !autoloot goldinfo\n\nSe seu autoloot bugar use !autoloot desbug\n\n{Auto-Loot} ----------------")
          return true
       end
       
       local t = string.explode(param, ",")
       
       if t[1] == "power" then
          local check = getPlayerStorageValue(cid, 04421001) == -1 and "ligou" or "desligou"
          doPlayerSetStorageValue(cid, 04421001, getPlayerStorageValue(cid, 04421001) == -1 and 1 or -1)
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você "..check.." o auto loot.")
       elseif t[1] == "gold" then
          local check = getPlayerStorageValue(cid, 04421011) == -1 and "ligou" or "desligou"
          doPlayerSetStorageValue(cid, 04421011, getPlayerStorageValue(cid, 04421011) == -1 and 1 or -1)
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você "..check.." a coleta de dinheiro.")
          doPlayerSetStorageValue(cid, 04421021, 0)
       elseif t[1] == "goldinfo" then
          local str = getPlayerStorageValue(cid, 04421011) == -1 and "O sistema de coleta de dinheiro está desligado" or "O sistema já coletou "..getPlayerStorageZero(cid, 04421021).." gold coins"
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, str)
       elseif t[1] == "add" then
          if ExistItemByName(t[2]) then
             local item = getItemIdByName(t[2])
             if isInArray({2160, 2148, 2152}, item) then
                return doPlayerSendCancel(cid, "Você não pode adicionar moedas no autoloot. Para coletar dinheiro use !autoloot gold")
             end
             if vip.hasVip(cid) then
                if getPlayerStorageValue(cid, 04420011) < 3 then
                   if addToList(cid, t[2]) then
                      doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) + 1)
                      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado à sua lista do auto loot! Para ver sua lista diga !autoloot list")
                   else
                      doPlayerSendCancel(cid, t[2].." já está em sua lista!")
                   end
                else
                   doPlayerSendCancel(cid, "Sua lista já tem 4 itens! Você deve remover algum antes de adicionar outro.")
                end
             else
                if getPlayerStorageValue(cid, 04420011) < 1 then
                   if addToList(cid, t[2]) then
                      doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) + 1)
                      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado à sua lista do auto loot! Para ver sua lista diga !autoloot")
                   else
                      doPlayerSendCancel(cid, t[2].." já está em sua lista!")
                   end
                else
                   doPlayerSendCancel(cid, "Você já tem um item adicionado no auto loot! Para adicionar outro, você deve remover o item atual.")
                end
             end
          else
             doPlayerSendCancel(cid, "Este item não existe!")
          end
       elseif t[1] == "remove" then
          if ExistItemByName(t[2]) then
             if removeFromList(cid, t[2]) then
                doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) - 1)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." removido da sua lista do auto loot!")
             else
                doPlayerSendCancel(cid, "Este item não está na sua lista!")
             end
          else
             doPlayerSendCancel(cid, "Este item não existe!")
          end
       elseif t[1] == "clear" then
          if getPlayerStorageValue(cid, 04420011) > -1 then
             doPlayerSetStorageValue(cid, 04420011, -1)
             doPlayerSetStorageValue(cid, 04420021, -1)
             doPlayerSetStorageValue(cid, 04420031, -1)
             doPlayerSetStorageValue(cid, 04420041, -1)
             doPlayerSetStorageValue(cid, 04420051, -1)
             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Lista limpa!")
          else
             doPlayerSendCancel(cid, "Sua lista ja esta limpa!")
          end
       elseif t[1] == "desbug" or t[1] == "desbugar" then
          doPlayerSetStorageValue(cid, 04420011, -1)
          doPlayerSetStorageValue(cid, 04420021, -1)
          doPlayerSetStorageValue(cid, 04420031, -1)
          doPlayerSetStorageValue(cid, 04420041, -1)
          doPlayerSetStorageValue(cid, 04420051, -1)
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Desbugado!")
       elseif t[1] == "list" then
          local fi = getPlayerStorageValue(cid, 04420021) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420021)).."\n" or ""
          local se = getPlayerStorageValue(cid, 04420031) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420031)).."\n" or ""
          local th = getPlayerStorageValue(cid, 04420041) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420041)).."\n" or ""
          local fo = getPlayerStorageValue(cid, 04420051) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420051)).."\n" or ""
          doPlayerPopupFYI(cid, "O sistema auto loot está coletando:\n "..fi..""..se..""..th..""..fo)
       end
       return true
    end

    data/creaturescripts/scripts/kill

    Código:
    local aloot_boost = {[2406] = 36, [2537] = 4800, [2377] = 480, [2663] = 600, [2472] = 195000, [2398] = 36, [2475] = 7200, [2519] = 6500, [2497] = 10700, [2523] = 180000, [2494] = 325000, [2400] = 144000, [2491] = 6000, [2421] = 325000, [2646] = 260000, [2477] = 7200, [2413] = 84, [2656] = 18000, [2498] = 52000, [2647] = 600, [2534] = 32500, [7402] = 19500, [2466] = 26000, [2465] = 240, [2408] = 120000, [2518] = 1800, [2500] = 3000, [2376] = 30, [2470] = 91000, [2388] = 24, [2645] = 26000, [2434] = 2400, [2463] = 480, [2536] = 11700, [2387] = 240, [2396] = 4800, [2381] = 240, [2528] = 4800, [2409] = 1800, [2414] = 12000, [2427] = 9000, [2407] = 7200, [2458] = 42, [2383] = 960, [2392] = 3600, [2488] = 18000, [2525] = 120, [2423] = 240, [7382] = 13000, [2462] = 1300, [2520] = 39000, [2390] = 180000, [2417] = 72, [2436] = 1200, [5741] = 52000, [2378] = 120, [2487] = 24000, [2476] = 6500, [8891] = 36000, [2459] = 36, [2195] = 52000, [2391] = 7200, [2464] = 120, [8889] = 72000, [2432] = 13000, [2431] = 108000, [2492] = 52000, [2515] = 240, [2430] = 2400, [2393] = 13000, [7419] = 36000, [2522] = 130000, [2514] = 65000}

    local function getPlayerStorageZero(cid, storage) -- By Killua
        local sto = getPlayerStorageValue(cid, storage)
        if tonumber(sto) then
            return tonumber(sto) > tonumber(0) and tonumber(sto) or tonumber(0)
        end
        return tonumber(0)
    end

    local tabela = {}

    local function getPlayerList(cid)
       local tab = {}
       if getPlayerStorageValue(cid, 04420021) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420021))
       end
       if getPlayerStorageValue(cid, 04420031) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420031))
       end
       if getPlayerStorageValue(cid, 04420041) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420041))
       end
       if getPlayerStorageValue(cid, 04420051) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420051))
       end
       if #tab > 0 then
          return tab
       end
       return {}
    end

    local function boost(cid)
       return tonumber(getPlayerStorageValue(cid,722381)) >= os.time()
    end

    local function autoLoot(cid, pos)
       if not isPlayer(cid) then return end
       local check = false
       local str = ""
       local position = {}
       for i = 1, 255 do
          pos.stackpos = i
          if getThingFromPos(pos).uid and getThingFromPos(pos).uid > 0 and isContainer(getThingFromPos(pos).uid) then
             position = pos
             check = true
             break
          end
       end
       if check then
          local corpse = getContainerItemsInfo(getThingFromPos(position).uid)      
          if corpse then
             for index, info in pairs(corpse) do
                if index < countTable(corpse) then
                   if info.uid and info.itemid then
                      if isContainer(info.uid) then
                         local bag = getContainerItemsInfo(info.uid)
                         for i = 1, countTable(bag) do
                            if isInArray(getPlayerList(cid), bag[i].itemid) then
                               if bag[i].quant > 1 then
                                  doRemoveItem(bag[i].uid, bag[i].quant)
                                  doPlayerAddItem(cid, bag[i].itemid, bag[i].quant)
                                  str = str.." "..bag[i].quant.." "..getItemNameById(bag[i].itemid).." +"
                               else
                                  doRemoveItem(bag[i].uid)
                                  if boost(cid) then
                                     if aloot_boost[bag[i].itemid] then
                                        doPlayerSetBalance(cid,getPlayerBalance(cid) + aloot_boost[bag[i].itemid])
                                        str = str.." 1 "..getItemNameById(bag[i].itemid).." ("..aloot_boost[bag[i].itemid].."gp no banco) +"
                                     else
                                        doPlayerAddItem(cid, bag[i].itemid, 1)
                                        str = str.." 1 "..getItemNameById(bag[i].itemid).." +"
                                     end
                                  else
                                     doPlayerAddItem(cid, bag[i].itemid, 1)
                                     str = str.." 1 "..getItemNameById(bag[i].itemid).." +"
                                  end
                               end
                            end
                         end
                      end
                   end
                end
                if isInArray(getPlayerList(cid), info.itemid) then
                   if info.quant > 1 then
                      doRemoveItem(info.uid, info.quant)
                      doPlayerAddItem(cid, info.itemid, info.quant)
                      str = str.." "..info.quant.." "..getItemNameById(info.itemid).." +"
                   else
                      doRemoveItem(info.uid)
                      if boost(cid) then
                         if aloot_boost[info.itemid] then
                            doPlayerSetBalance(cid,getPlayerBalance(cid) + aloot_boost[info.itemid])
                            str = str.." 1 "..getItemNameById(info.itemid).." ("..aloot_boost[info.itemid].."gps no banco) +"
                         else
                            doPlayerAddItem(cid, info.itemid, 1)
                            str = str.." 1 "..getItemNameById(info.itemid).." +"
                         end
                      else
                         doPlayerAddItem(cid, info.itemid, 1)
                         str = str.." 1 "..getItemNameById(info.itemid).." +"
                      end
                   end
                end
             end
          end
       end
       setPlayerTableStorage(cid,822564,{[1] = str, [2] = 0})
    end

    local function autoGold(cid, pos)
       if not isPlayer(cid) then return end
       local check = false
       local total = 0
       local position = {}
       for i = 1, 255 do
          pos.stackpos = i
          if getThingFromPos(pos).uid and getThingFromPos(pos).uid > 0 and isContainer(getThingFromPos(pos).uid) then
             position = pos
             check = true
             break
          end
       end
       if check then
          local corpse = getContainerItemsInfo(getThingFromPos(position).uid)
          if corpse then
             for index, info in pairs(corpse) do
                if info.uid and info.itemid then
                   if index < countTable(corpse) then
                      if isContainer(info.uid) then
                         local bag = getContainerItemsInfo(info.uid)
                         for i = 1, countTable(bag) do
                            if isInArray({2148, 2152, 2160}, bag[i].itemid) then
                               local multiplie = 1
                               if bag[i].itemid == 2148 then
                                  multiplie = 1
                               elseif bag[i].itemid == 2152 then
                                  multiplie = 100
                               elseif bag[i].itemid == 2160 then
                                  multiplie = 10000
                               end
                               doRemoveItem(bag[i].uid, bag[i].quant)
                               doPlayerSetBalance(cid, getPlayerBalance(cid) + tonumber(bag[i].quant) * multiplie)
                               total = total + bag[i].quant * multiplie
                               doPlayerSetStorageValue(cid, 04421021, tonumber(getPlayerStorageZero(cid, 04421021)) + tonumber(info.quant) * tonumber(multiplie))
                            end
                         end
                      end
                   end
                   if isInArray({2148, 2152, 2160}, info.itemid) then
                      local multiplie = 1
                      if info.itemid == 2148 then
                         multiplie = 1
                      elseif info.itemid == 2152 then
                         multiplie = 100
                      elseif info.itemid == 2160 then
                         multiplie = 10000
                      end
                      doRemoveItem(info.uid, info.quant)
                      doPlayerSetBalance(cid, getPlayerBalance(cid) + info.quant * multiplie)
                      doPlayerSetStorageValue(cid, 04421021, tonumber(getPlayerStorageZero(cid, 04421021)) + tonumber(info.quant) * tonumber(multiplie))
                      total = total + info.quant * multiplie
                   end
                end
             end
          end
       end
       if total > 0 then
          total = total - (total * 0.2)
          total = math.ceil(total)
          doPlayerSetBalance(cid,getPlayerBalance(cid) + total)
          local tab = getPlayerTableStorage(cid,822564)
          tab[2] = total
          setPlayerTableStorage(cid,822564,tab)
       end
    end

    local function sendMsg(cid)
       if not isPlayer(cid) then return end
       local tab = getPlayerTableStorage(cid,822564)
       if countTable(tab) >= 1 then
          if tab[1] then
             if tab[2] and tab[2] > 0 then
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: ".. tab[1] .." ".. tab[2] .." gold coins.")
             else
                if type(tab[1]) == "string" and string.len(tab[1]) > 1 then
                   doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: "..tab[1])
                end
             end
          elseif not tab[1] then
             if tab[2] then
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: "..tab[2].." gold coins.")
             end
          end
       end
       doPlayerSetStorageValue(cid,822564,-1)
    end

    local bosses = {
        ["Striker Cyclope"] = {
            {itemid = 9971, count = {min = 5, max = 15}},
       {itemid = 12396, count = {min = 1, max = 1}},
       {itemid = 2346, count = {min = 0, max = 1}},
            {itemid = 12575, count = {min = 1, max = 1}}
        },
        ["Bk Ferumbras"] = {
            {itemid = 8305, count = {min = 1, max = 2}},
       {itemid = 8981, count = {min = 1, max = 1}},
       {itemid = 9971, count = {min = 50, max = 80}},
       {itemid = 12396, count = {min = 3, max = 5}},
            {itemid = 12575, count = {min = 3, max = 5}}
        },
    }

    local wzUmBoss = {
        ["Gonka"] = {
            {itemid = 9971, count = {min = 5, max = 15}},
       {itemid = 12396, count = {min = 1, max = 1}},
       {itemid = 2346, count = {min = 0, max = 1}},
            {itemid = 12575, count = {min = 1, max = 1}}
        }
    }

    local wzDoisBoss = {
        ["Jabuti"] = {
            {itemid = 9971, count = {min = 5, max = 15}},
       {itemid = 12396, count = {min = 1, max = 1}},
       {itemid = 2346, count = {min = 0, max = 1}},
            {itemid = 12575, count = {min = 1, max = 1}}
        }
    }

    function getRotate(uid)
        local pos = getCreaturePosition(uid)
        return
        {
            {x = pos.x, y = pos.y-1, z = pos.z},
            {x = pos.x, y = pos.y+1, z = pos.z},
            {x = pos.x-1, y = pos.y, z = pos.z},
            {x = pos.x+1, y = pos.y, z = pos.z}
        }
    end

    function getRotateUm(uid)
        local pos = getCreaturePosition(uid)
        return
        {
            {x = pos.x-1, y = pos.y-1, z = pos.z},
            {x = pos.x+1, y = pos.y+1, z = pos.z},
            {x = pos.x+1, y = pos.y-1, z = pos.z},
            {x = pos.x-1, y = pos.y+1, z = pos.z}
        }
    end

    function getRotateDois(uid)
        local pos = getCreaturePosition(uid)
        return
        {
            {x = pos.x, y = pos.y-1, z = pos.z},
            {x = pos.x, y = pos.y+1, z = pos.z},
            {x = pos.x-1, y = pos.y, z = pos.z},
            {x = pos.x+1, y = pos.y, z = pos.z}
        }
    end

    function DelTp()
       posWzDois = {x = 132, y = 138, z = 15}
            local t = getTileItemById(posWzDois, 1387)
            if t then
                    doRemoveItem(t.uid, 1)
                    doSendMagicEffect(posWzDois, CONST_ME_POFF)
            end
    end

    function DelTpWz()
       posWzUm = {x = 153, y = 278, z = 14}
            local t = getTileItemById(posWzUm, 1387)
            if t then
                    doRemoveItem(t.uid, 1)
                    doSendMagicEffect(posWzUm, CONST_ME_POFF)
            end
    end

    function onKill(cid, target, lastHit)
        local bid = bosses[getCreatureName(target)]
        local wzUm = wzUmBoss[getCreatureName(target)]
        local wzDois = wzDoisBoss[getCreatureName(target)]
        local level = 400
        local item,count = 5925,1
        local monster = getCreatureName(target)
        local room = getArenaMonsterIdByName(monster)

        if room > 0 then
       setPlayerStorageValue(cid, room, 1)
       doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT,'Voce pode ir para a proxima sala!')
        end

        if isPlayer(target) and isPlayer(cid) then
            local pid = getPlayersOnline()
            for i = 1, #pid do
                doPlayerSendChannelMessage(pid[i], "", "O jogador ".. getCreatureName(cid) .." [".. getPlayerLevel(cid) .."]  acabou de matar o noob " .. getCreatureName(target) .. " [".. getPlayerLevel(target) .."]!", TALKTYPE_CHANNEL_HIGHLIGHT, 8)
            end

       if getPlayerLevel(target) >= 400 then
                if getPlayerIp(cid) ~= getPlayerIp(target) then
              if getPlayerLevel(target) >= 400 and getPlayerLevel(target) <= 449 then
                 exppg = getExperienceStage(getPlayerLevel(cid))
                 doPlayerAddExp(cid, 22000 * exppg)
                 doSendAnimatedText(getThingPos(cid), 12000 * exppg, 210)
              elseif getPlayerLevel(target) >= 450 and getPlayerLevel(target) <= 499 then
                 exppg = getExperienceStage(getPlayerLevel(cid))
                 doPlayerAddExp(cid, 26000 * exppg)
                 doSendAnimatedText(getThingPos(cid), 12000 * exppg, 210)
              elseif getPlayerLevel(target) >= 500 and getPlayerLevel(target) <= 549 then
                 exppg = getExperienceStage(getPlayerLevel(cid))
                 doPlayerAddExp(cid, 32000 * exppg)
                 doSendAnimatedText(getThingPos(cid), 15000 * exppg, 210)
              elseif getPlayerLevel(target) >= 550 then
                 exppg = getExperienceStage(getPlayerLevel(cid))
                 doPlayerAddExp(cid, 36000 * exppg)
                 doSendAnimatedText(getThingPos(cid), 20000 * exppg, 210)
                   end
          if getPlayerStorageValue(cid,22867) >= 1 and getPlayerStorageValue(cid,34765) <= 30 then
             setPlayerStorageValue(cid, 34765, getPlayerStorageValue(cid, 34765) + 1)
          end
                end
       end
        end

        if isPlayer(cid) and isPlayer(target) and getPlayerIp(target) ~= getPlayerIp(cid) then
       doPlayerAddItem(cid, item, count)
        end

        if isPlayer(cid) and isMonster(target) then
       if getPlayerStorageValue(cid, 04421001) == 1 and #getPlayerList(cid) > 0 then
          local pos = getCreaturePosition(target)
          addEvent(autoLoot, 500, cid, pos)
       end
       if getPlayerStorageValue(cid, 04421011) == 1 then
          local pos = getCreaturePosition(target)
          addEvent(autoGold, 540, cid, pos)
       end
       if getPlayerStorageValue(cid, 04421001) == 1 or getPlayerStorageValue(cid, 04421011) == 1 then
          addEvent(sendMsg, 560, cid)
       end
        end

        if isMonster(target) and bid and getStorage(33999) <= os.time() then
            doCreatureSetDropLoot(target, nil)
            for _, v in ipairs(bid) do
                doCreateItem(v.itemid, math.random(v.count.min, v.count.max), getRotate(target)[_])
           doCreateItem(v.itemid, math.random(v.count.min, v.count.max), getRotateUm(target)[_])
           doCreateItem(v.itemid, math.random(v.count.min, v.count.max), getRotateDois(target)[_])
                doSendMagicEffect(getRotate(target)[_], 6)
            end
            doSetStorage(33999, os.time() + 5)
        end

        if isMonster(target) and wzUm then
       doCreateTeleport(1387, {x=204, y=179, z=15}, {x=153, y=278, z=14})
       setPlayerStorageValue(cid, 45698, 1)
       addEvent(DelTpWz, 60 * 1000)
        end

        if isMonster(target) and wzDois then
       doCreateTeleport(1387, {x=204, y=179, z=15}, {x=132,y=138,z=15})
       setPlayerStorageValue(cid, 45699, 1)
       addEvent(DelTp, 60 * 1000)
        end
        return true
    end

    data/creaturescripts/login
    Código:
    registerCreatureEvent(cid, "Kills")

    data/creaturescripts/creaturescripts.xml
    Código:
     <event type="kill" name="Kills" event="script" value="kill.lua"/>

    data/libs/crear nuevo archivo llamado 049-vipsys

    colocar esto dentro:
    Código:
    vip = {
    name = "VIP System";
    author = "Mock";
    version = "1.0.0.0";
    query="ALTER TABLE `accounts` ADD `vip_time` INTEGER";
    query2="ALTER TABLE `accounts` ADD `vip_time` INT(15) NOT NULL"
    }

    function vip.setTable()
    dofile('config.lua')
    if sqlType == "sqlite" then
       db.query(vip.query)
    else
          db.query(vip.query2)
    end
    end

    function vip.getVip(cid)
           assert(tonumber(cid),'Parameter must be a number')
           if isPlayer(cid) == FALSE then error('Player don\'t find') end;
           ae = db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..getPlayerAccount(cid).."';")
           if ae:getID() == -1 then
             return 0
           end

    local retee = ae:getDataInt("vip_time") or 0
    ae:free()
           return retee
    end

    function vip.getVipByAcc(acc)
           assert(acc,'Account is nil')
           local a = db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..acc.."';")
           if a:getID() ~= -1 then
              return a:getDataInt("vip_time") or 0, a:free()
           else
              error('Account don\'t find.')
           end
    end

    function vip.setVip(cid,time)
           dofile("config.lua")
           assert(tonumber(cid),'Parameter must be a number')
           assert(tonumber(time),'Parameter must be a number')
           if isPlayer(cid) == FALSE then error('Player don\'t find') end;
           db.query("UPDATE `"..sqlDatabase.."`.`accounts` SET `vip_time` = '"..(os.time()+time).."' WHERE `accounts`.`name` ='".. getPlayerAccount(cid).."';")
    end

    function vip.getVipByAccount(acc)
           assert(acc,'Account is nil')
           return db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..acc.."';"):getDataInt("vip_time") or 0
    end                           

    function vip.hasVip(cid)
           assert(tonumber(cid),'Parameter must be a number')
           if isPlayer(cid) == FALSE then return end;
           local t = vip.getVip(cid) or 0
           if os.time(day) < t then
             return TRUE
           else
             return FALSE
           end
    end

    function vip.hasVips(cid)
           assert(tonumber(cid),'Parameter must be a number')
           if isPlayer(cid) == FALSE then return end;
           local t = vip.getVip(cid)
           if os.time(day) < t then
             return TRUE
           else
             return FALSE
           end
    end

    function vip.accountHasVip(acc)
           assert(acc,'Account is nil')
           if os.time() < vip.getVipByAccount(acc) then
             return TRUE
           else
             return FALSE
           end
    end
    function vip.getDays(days)
    return (3600 * 24 * days)
    end

    function vip.addVipByAccount(acc,time)
    assert(acc,'Account is nil')
    assert(tonumber(time),'Parameter must be a number')
    local a = vip.getVipByAcc(acc)
    a = os.difftime(a,os.time())
    if a < 0 then a = 0 end;
    a = a+time
    return vip.setVipByAccount(acc,a)
    end

    function vip.setVipByAccount(acc,time)
           dofile("config.lua")
           assert(acc,'Account is nil')
           assert(tonumber(time),'Parameter must be a number')
           db.query("UPDATE `accounts` SET `vip_time` = '"..(os.time()+time).."' WHERE `accounts`.`name` ='"..acc.."';")
           return TRUE
    end

    function vip.returnVipString(cid)
    assert(tonumber(cid),'Parameter must be a number')
    if isPlayer(cid) == TRUE then
        return os.date("%d %B %Y %X ", vip.getVip(cid))
    end
    end

    crear otro archivo nuevo llamado arena
    Código:
    -- arena script
    InitArenaScript = 0
    arena_room_max_time = 240 -- time in seconds for one arena room
    arenaKickPosition = {x=160, y=54, z=7} -- position where kick from arena when you leave/you did arena level
    arena_monsters = {}
    arena_monsters[42300] = 'frostfur' -- first monster from 1 arena
    arena_monsters[42301] = 'bloodpaw'
    arena_monsters[42302] = 'bovinus'
    arena_monsters[42303] = 'achad'
    arena_monsters[42304] = 'colerian the barbarian'
    arena_monsters[42305] = 'the hairy one'
    arena_monsters[42306] = 'axeitus headbanger'
    arena_monsters[42307] = 'rocky'
    arena_monsters[42308] = 'cursed gladiator'
    arena_monsters[42309] = 'orcus the cruel'
    arena_monsters[42310] = 'avalanche' -- first monster from 2 arena
    arena_monsters[42311] = 'kreebosh the exile'
    arena_monsters[42312] = 'the dark dancer'
    arena_monsters[42313] = 'the hag'
    arena_monsters[42314] = 'slim'
    arena_monsters[42315] = 'grimgor guteater'
    arena_monsters[42316] = 'drasilla'
    arena_monsters[42317] = 'spirit of earth'
    arena_monsters[42318] = 'spirit of water'
    arena_monsters[42319] = 'spirit of fire'
    arena_monsters[42320] = 'webster' -- first monster from 3 arena
    arena_monsters[42321] = 'darakan the executioner'
    arena_monsters[42322] = 'norgle glacierbeard'
    arena_monsters[42323] = 'the pit lord'
    arena_monsters[42324] = 'svoren the mad'
    arena_monsters[42325] = 'the masked marauder'
    arena_monsters[42326] = 'gnorre chyllson'
    arena_monsters[42327] = "fallen mooh'tah master ghar"
    arena_monsters[42328] = 'deathbringer'
    arena_monsters[42329] = 'the obliverator'

    function getArenaMonsterIdByName(name)
        name = string.lower(tostring(name))
        for i = 42300, 42329 do
            if tostring(arena_monsters[i]) == name then
                return i
            end
        end
        return 0
    end  

    y por ultimo crear otro archivo llamado killua's lib
    Código:
    -- lib and functions by Vitor Bertolucci (Killua)

    function warnPlayersWithStorage(storage, value, class, message) -- By Killua
        if not value then value = 1 end
       if not class then class = MESSAGE_SATUS_CONSOLE_WARNING end
       if not storage or not message then return end
        if #getPlayersOnline() == 0 then
            return
        end
        for _, pid in pairs(getPlayersOnline()) do
            if getPlayerStorageValue(pid, storage) == value then
                doPlayerSendTextMessage(pid, class, message)
          end
       if getPlayerAccess(pid) >= 4 then   
          doPlayerSendTextMessage(pid, class, "Message to those with storage "..storage..message) -- Gms will always receive the messages
       end
        end
    end

    function getPlayerStorageZero(cid, storage) -- By Killua
        local sto = getPlayerStorageValue(cid, storage)
        return sto > 0 and sto or 0
    end

    function getStorageZero(storage) -- By Killua
        local sto = getGlobalStorageValue(storage)
        return sto > 0 and sto or 0
    end

    function countTable(table) -- By Killua
        local y = 0
        if type(table) == "table" then
            for _ in pairs(table) do
                y = y + 1
            end
            return y
        end
        return false
    end

    function getPlayersInArea(frompos, topos) -- By Killua
        local players_ = {}
        local count = 1
        for _, pid in pairs(getPlayersOnline()) do
            if isInArea(getCreaturePosition(pid), frompos, topos) then
                players_[count] = pid
                count = count + 1
            end
        end
        return countTable(players_) > 0 and players_ or false
    end

    function getGuildNameById(gid) -- By Killua
        local query = db.getResult("SELECT `name` FROM `guilds` WHERE `id` = '"..gid.."'")
        if query:getID() == -1 then
            return ""
        end
        local name = query:getDataString("name")
        query:free()
        return name
    end

    function getContainerItemsInfo(containerUid) -- By Killua
        local table = {}
        if containerUid and containerUid > 0 then
            local a = 0  
            for i = 0, getContainerSize(containerUid) - 1 do
                local item = getContainerItem(containerUid,i)
                a = a + 1
                table[a] = {uid = item.uid, itemid = item.itemid, quant = item.type}
            end
            return table
        end
        return false
    end

    function getTableEqualValues(table) -- By Killua
        local ck = {}
        local eq = {}
        if type(table) == "table" then
             if countTable(table) and countTable(table) > 0 then
                  for i = 1, countTable(table) do
                    if not isInArray(ck, table[i]) then
                        ck[i] = table[i]
                    else
                        eq[i] = table[i]
                    end
                end
                return countTable(eq) > 0 and eq or 0
            end
        end
        return false
    end

    function killuaGetItemLevel(uid) -- By Killua
       local name = getItemName(uid)
       local pos = 0
       for i = 1, #name do
          if string.byte(name:sub(i,i)) == string.byte('+') then
             pos = i + 1
             break
          end
       end
       return tonumber(name:sub(pos,pos))
    end

    k_table_storage_lib = {
       filtrateString = function(str) -- By Killua
          local tb, x, old, last = {}, 0, 0, 0
          local first, second, final = 0, 0, 0
          if type(str) ~= "string" then
             return tb
          end
          for i = 2, #str-1 do
             if string.byte(str:sub(i,i)) == string.byte(':') then
                x, second, last = x+1, i-1, i+2
                for t = last,#str-1 do
                   if string.byte(str:sub(t,t)) == string.byte(',') then
                      first = x == 1 and 2 or old
                      old, final = t+2, t-1
                      local index, var = str:sub(first,second), str:sub(last,final)
                      tb[tonumber(index) or tostring(index)] = tonumber(var) or tostring(var)
                      break
                   end
                end
             end
          end
          return tb
       end,

       translateIntoString = function(tb) -- By Killua
          local str = ""
          if type(tb) ~= "table" then
             return str
          end
          for i, t in pairs(tb) do
             str = str..i..": "..t..", "
          end
          str = "a"..str.."a"
          return tostring(str)
       end
    }

    function setPlayerTableStorage(cid, key, value) -- By Killua
       return doPlayerSetStorageValue(cid, key, k_table_storage_lib.translateIntoString(value))
    end

    function getPlayerTableStorage(cid, key) -- By Killua
       return k_table_storage_lib.filtrateString(getPlayerStorageValue(cid, key))
    end

    function setGlobalTableStorage(key, value) -- By Killua
       return setGlobalStorageValue(key, k_table_storage_lib.translateIntoString(value))
    end

    function getGlobalTableStorage(key) -- By Killua
       return k_table_storage_lib.filtrateString(getGlobalStorageValue(key))
    end

    function printTable(table, includeIndices,prnt) -- By Killua
        if includeIndices == nil then includeIndices = true end
        if prnt == nil then prnt = true end
        if type(table) ~= "table" then
            error("Argument must be a table")
            return
        end
        local str, c = "{", ""
        for v, b in pairs(table) do
            if type(b) == "table" then
                str = includeIndices and str..c.."["..v.."]".." = "..printTable(b,true,false) or str..c..printTable(b,false,false)
            else
                str = includeIndices and str..c.."["..v.."]".." = "..b or str..c..b
            end
            c = ", "
        end
        str = str.."}"
        if prnt then print(str) end
        return str
     end
     
    function checkString(str) -- By Killua
       local check = true
       for i = 1, #str do
          local letra = string.byte(str:sub(i,i))
          if letra >= string.byte('a') and letra <= string.byte('z') or letra >= string.byte('A') and letra <= string.byte('Z') or letra >= string.byte('0') and letra <= string.byte('9') then
             check = true
          else
             check = false
             break
          end
       end
       return check
    end

    function isArmor(itemid) -- By Killua
       return getItemInfo(itemid).armor > 0
    end

    function isWeapon(uid) -- By Killua
       return getItemWeaponType(uid) ~= 0
    end

    function isShield(uid) -- By Killua
       return getItemWeaponType(uid) == 5
    end

    function isSword(uid) -- By Killua
       return getItemWeaponType(uid) == 1
    end

    function isClub(uid) -- By Killua
       return getItemWeaponType(uid) == 2
    end

    function isAxe(uid) -- By Killua
       return getItemWeaponType(uid) == 3
    end

    function isBow(uid) -- By Killua
       return getItemWeaponType(uid) == 4
    end

    function isWand(uid) -- By Killua
       return getItemWeaponType(uid) == 7
    end

    Ya quedaria perfecto, ahora a utilizar el autoloot.


















    MUCHISIMAS GRACIAS BRO ... ME FUNCIONO PERFECTO !!


    SOLO QUE VEO QUE SON 4 SLOTS Y  2 DE ELLOS SON PARA VIP  ::.


    NO SE SI SERIA MUCHO PEDIR QUE ME EXPLICARAS COMO INSERTAR LA TABLA EN MYSQL YA QUE SOY NUEVO EN ESE SISTEMA PHPMYADMIND,  SIEMPRE E USADO   ACCOUNT MANAGER ,   O ELIMINARLO Y DEJARLO FULL FREE CREES QUE PUEDAS APOYARME AHI?

    con ese sistema que me mandaste funciono perfecto solo el detalle de los dos slots para vips : /

    me arroja esto ... !  solo seria eso para cerrar el tema te dejo tus likes : D


    [Tienes que estar registrado y conectado para ver este vínculo]


    MIL GRACIAS : D

    3 participantes

    akane

    akane
    Miembro
    Miembro
    no tienes la columna vip_time por eso el error, debes de agregarla en la tabla accounts - una vez clickeada la tabla accounts vas al botón estructura o structure, al final de la lista aparecerá un menú que dice agregar x cantidad de columna al después de tal columna (como se ve en la imagen) [Tienes que estar registrado y conectado para ver este vínculo] le das a continuar.

    Luego en la ventana que se abrirá colocas el nombre de la tabla, en este caso vip_time, lo dejas como int y con valor 15 tal como aparece en la imagen: [Tienes que estar registrado y conectado para ver este vínculo]

    Lógicamente todo esto se hace desde el phpmyadmin, y con eso se debería solucionar el error.

    3 participantes

    Gm Lurran

    Gm Lurran
    Miembro
    Miembro
    SoyFabi escribió:Vi que tiene problemas con el 0.3.6 :/

    Usa este:
    Código:
    <talkaction words="!autoloot" event="script" value="Auto Loot.lua"/>

    data/scripts/talkactions/Auto Loot
    Código:
    -- Sistema de auto loot criado por Vítor Bertolucci - Killua

    function ExistItemByName(name) -- by vodka
       local items = io.open("data/items/items.xml", "r"):read("*all")
       local get = items:match('name="' .. name ..'"')
       if get == nil or get == "" then
          return false
       end
       return true
    end

    local function getPlayerList(cid)
       local tab = {}
       if getPlayerStorageValue(cid, 04420021) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420021))
       end
       if getPlayerStorageValue(cid, 04420031) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420031))
       end
       if getPlayerStorageValue(cid, 04420041) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420041))
       end
       if getPlayerStorageValue(cid, 04420051) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420051))
       end
       if #tab > 0 then
          return tab
       end
       return false
    end

    local function addToList(cid, name)
       local itemid = getItemIdByName(name)
       if getPlayerList(cid) and isInArray(getPlayerList(cid), itemid) then
          return false
       end
       if getPlayerStorageValue(cid, 04420021) == -1 then
          return doPlayerSetStorageValue(cid, 04420021, itemid)
       elseif getPlayerStorageValue(cid, 04420031) == -1 then
          return doPlayerSetStorageValue(cid, 04420031, itemid)
       elseif getPlayerStorageValue(cid, 04420041) == -1 then   
          return doPlayerSetStorageValue(cid, 04420041, itemid)
       elseif getPlayerStorageValue(cid, 04420051) == -1 then
          return doPlayerSetStorageValue(cid, 04420051, itemid)
       end
    end

    local function removeFromList(cid, name)
       local itemid = getItemIdByName(name)
       if getPlayerStorageValue(cid, 04420021) == itemid then
          return doPlayerSetStorageValue(cid, 04420021, -1)
       elseif getPlayerStorageValue(cid, 04420031) == itemid then
          return doPlayerSetStorageValue(cid, 04420031, -1)
       elseif getPlayerStorageValue(cid, 04420041) == itemid then
          return doPlayerSetStorageValue(cid, 04420041, -1)
       elseif getPlayerStorageValue(cid, 04420051) == itemid then
          return doPlayerSetStorageValue(cid, 04420051, -1)
       end
       return false
    end

    function onSay(cid, words, param)
       if param == "" then
          local fi = getPlayerStorageValue(cid, 04420021) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420021)) or ""
          local se = getPlayerStorageValue(cid, 04420031) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420031)) or ""
          local th = not vip.hasVip(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 04420041) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420041)) or ""
          local fo = not vip.hasVip(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 04420051) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420051)) or ""
          local stt = getPlayerStorageValue(cid, 04421011) == 1 and "sim" or "não"
          local str = getPlayerStorageValue(cid, 04421001) == 1 and "sim" or "não"
          doPlayerPopupFYI(cid, "{Auto-Loot} ---Menu Auto Loot do jogador\n{Auto-Loot} ----------------\n{Auto-Loot} ---Coletar dinheiro: "..stt..". Para ligar/desligar: !autoloot gold \n{Auto-Loot} ---Coletar itens únicos: "..str..". Para ligar/desligar: !autoloot power\n{Auto-Loot} --Configuração dos slots:\n{Auto-Loot} ---Slot 1: "..fi.."\n{Auto-Loot} ---Slot 2: "..se.."\n{Auto-Loot} ---Slot 3: "..th.."\n{Auto-Loot} ---Slot 4: "..fo.."\n{Auto-Loot} ---Para adicionar um novo item aos slots: !autoloot add, <nome do item>\n{Auto-Loot} ---Para retirar um item dos slots: !autoloot remove, <nome do item>\n{Auto-Loot} ---Para limpar todos os slots utilize: !autoloot clear\n{Auto-Loot} ---Para informações de quanto você já fez utilizando a coleta de dinheiro, use: !autoloot goldinfo\n\nSe seu autoloot bugar use !autoloot desbug\n\n{Auto-Loot} ----------------")
          return true
       end
       
       local t = string.explode(param, ",")
       
       if t[1] == "power" then
          local check = getPlayerStorageValue(cid, 04421001) == -1 and "ligou" or "desligou"
          doPlayerSetStorageValue(cid, 04421001, getPlayerStorageValue(cid, 04421001) == -1 and 1 or -1)
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você "..check.." o auto loot.")
       elseif t[1] == "gold" then
          local check = getPlayerStorageValue(cid, 04421011) == -1 and "ligou" or "desligou"
          doPlayerSetStorageValue(cid, 04421011, getPlayerStorageValue(cid, 04421011) == -1 and 1 or -1)
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você "..check.." a coleta de dinheiro.")
          doPlayerSetStorageValue(cid, 04421021, 0)
       elseif t[1] == "goldinfo" then
          local str = getPlayerStorageValue(cid, 04421011) == -1 and "O sistema de coleta de dinheiro está desligado" or "O sistema já coletou "..getPlayerStorageZero(cid, 04421021).." gold coins"
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, str)
       elseif t[1] == "add" then
          if ExistItemByName(t[2]) then
             local item = getItemIdByName(t[2])
             if isInArray({2160, 2148, 2152}, item) then
                return doPlayerSendCancel(cid, "Você não pode adicionar moedas no autoloot. Para coletar dinheiro use !autoloot gold")
             end
             if vip.hasVip(cid) then
                if getPlayerStorageValue(cid, 04420011) < 3 then
                   if addToList(cid, t[2]) then
                      doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) + 1)
                      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado à sua lista do auto loot! Para ver sua lista diga !autoloot list")
                   else
                      doPlayerSendCancel(cid, t[2].." já está em sua lista!")
                   end
                else
                   doPlayerSendCancel(cid, "Sua lista já tem 4 itens! Você deve remover algum antes de adicionar outro.")
                end
             else
                if getPlayerStorageValue(cid, 04420011) < 1 then
                   if addToList(cid, t[2]) then
                      doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) + 1)
                      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado à sua lista do auto loot! Para ver sua lista diga !autoloot")
                   else
                      doPlayerSendCancel(cid, t[2].." já está em sua lista!")
                   end
                else
                   doPlayerSendCancel(cid, "Você já tem um item adicionado no auto loot! Para adicionar outro, você deve remover o item atual.")
                end
             end
          else
             doPlayerSendCancel(cid, "Este item não existe!")
          end
       elseif t[1] == "remove" then
          if ExistItemByName(t[2]) then
             if removeFromList(cid, t[2]) then
                doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) - 1)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." removido da sua lista do auto loot!")
             else
                doPlayerSendCancel(cid, "Este item não está na sua lista!")
             end
          else
             doPlayerSendCancel(cid, "Este item não existe!")
          end
       elseif t[1] == "clear" then
          if getPlayerStorageValue(cid, 04420011) > -1 then
             doPlayerSetStorageValue(cid, 04420011, -1)
             doPlayerSetStorageValue(cid, 04420021, -1)
             doPlayerSetStorageValue(cid, 04420031, -1)
             doPlayerSetStorageValue(cid, 04420041, -1)
             doPlayerSetStorageValue(cid, 04420051, -1)
             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Lista limpa!")
          else
             doPlayerSendCancel(cid, "Sua lista ja esta limpa!")
          end
       elseif t[1] == "desbug" or t[1] == "desbugar" then
          doPlayerSetStorageValue(cid, 04420011, -1)
          doPlayerSetStorageValue(cid, 04420021, -1)
          doPlayerSetStorageValue(cid, 04420031, -1)
          doPlayerSetStorageValue(cid, 04420041, -1)
          doPlayerSetStorageValue(cid, 04420051, -1)
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Desbugado!")
       elseif t[1] == "list" then
          local fi = getPlayerStorageValue(cid, 04420021) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420021)).."\n" or ""
          local se = getPlayerStorageValue(cid, 04420031) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420031)).."\n" or ""
          local th = getPlayerStorageValue(cid, 04420041) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420041)).."\n" or ""
          local fo = getPlayerStorageValue(cid, 04420051) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420051)).."\n" or ""
          doPlayerPopupFYI(cid, "O sistema auto loot está coletando:\n "..fi..""..se..""..th..""..fo)
       end
       return true
    end

    data/creaturescripts/scripts/kill

    Código:
    local aloot_boost = {[2406] = 36, [2537] = 4800, [2377] = 480, [2663] = 600, [2472] = 195000, [2398] = 36, [2475] = 7200, [2519] = 6500, [2497] = 10700, [2523] = 180000, [2494] = 325000, [2400] = 144000, [2491] = 6000, [2421] = 325000, [2646] = 260000, [2477] = 7200, [2413] = 84, [2656] = 18000, [2498] = 52000, [2647] = 600, [2534] = 32500, [7402] = 19500, [2466] = 26000, [2465] = 240, [2408] = 120000, [2518] = 1800, [2500] = 3000, [2376] = 30, [2470] = 91000, [2388] = 24, [2645] = 26000, [2434] = 2400, [2463] = 480, [2536] = 11700, [2387] = 240, [2396] = 4800, [2381] = 240, [2528] = 4800, [2409] = 1800, [2414] = 12000, [2427] = 9000, [2407] = 7200, [2458] = 42, [2383] = 960, [2392] = 3600, [2488] = 18000, [2525] = 120, [2423] = 240, [7382] = 13000, [2462] = 1300, [2520] = 39000, [2390] = 180000, [2417] = 72, [2436] = 1200, [5741] = 52000, [2378] = 120, [2487] = 24000, [2476] = 6500, [8891] = 36000, [2459] = 36, [2195] = 52000, [2391] = 7200, [2464] = 120, [8889] = 72000, [2432] = 13000, [2431] = 108000, [2492] = 52000, [2515] = 240, [2430] = 2400, [2393] = 13000, [7419] = 36000, [2522] = 130000, [2514] = 65000}

    local function getPlayerStorageZero(cid, storage) -- By Killua
        local sto = getPlayerStorageValue(cid, storage)
        if tonumber(sto) then
            return tonumber(sto) > tonumber(0) and tonumber(sto) or tonumber(0)
        end
        return tonumber(0)
    end

    local tabela = {}

    local function getPlayerList(cid)
       local tab = {}
       if getPlayerStorageValue(cid, 04420021) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420021))
       end
       if getPlayerStorageValue(cid, 04420031) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420031))
       end
       if getPlayerStorageValue(cid, 04420041) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420041))
       end
       if getPlayerStorageValue(cid, 04420051) ~= -1 then
          table.insert(tab, getPlayerStorageValue(cid, 04420051))
       end
       if #tab > 0 then
          return tab
       end
       return {}
    end

    local function boost(cid)
       return tonumber(getPlayerStorageValue(cid,722381)) >= os.time()
    end

    local function autoLoot(cid, pos)
       if not isPlayer(cid) then return end
       local check = false
       local str = ""
       local position = {}
       for i = 1, 255 do
          pos.stackpos = i
          if getThingFromPos(pos).uid and getThingFromPos(pos).uid > 0 and isContainer(getThingFromPos(pos).uid) then
             position = pos
             check = true
             break
          end
       end
       if check then
          local corpse = getContainerItemsInfo(getThingFromPos(position).uid)      
          if corpse then
             for index, info in pairs(corpse) do
                if index < countTable(corpse) then
                   if info.uid and info.itemid then
                      if isContainer(info.uid) then
                         local bag = getContainerItemsInfo(info.uid)
                         for i = 1, countTable(bag) do
                            if isInArray(getPlayerList(cid), bag[i].itemid) then
                               if bag[i].quant > 1 then
                                  doRemoveItem(bag[i].uid, bag[i].quant)
                                  doPlayerAddItem(cid, bag[i].itemid, bag[i].quant)
                                  str = str.." "..bag[i].quant.." "..getItemNameById(bag[i].itemid).." +"
                               else
                                  doRemoveItem(bag[i].uid)
                                  if boost(cid) then
                                     if aloot_boost[bag[i].itemid] then
                                        doPlayerSetBalance(cid,getPlayerBalance(cid) + aloot_boost[bag[i].itemid])
                                        str = str.." 1 "..getItemNameById(bag[i].itemid).." ("..aloot_boost[bag[i].itemid].."gp no banco) +"
                                     else
                                        doPlayerAddItem(cid, bag[i].itemid, 1)
                                        str = str.." 1 "..getItemNameById(bag[i].itemid).." +"
                                     end
                                  else
                                     doPlayerAddItem(cid, bag[i].itemid, 1)
                                     str = str.." 1 "..getItemNameById(bag[i].itemid).." +"
                                  end
                               end
                            end
                         end
                      end
                   end
                end
                if isInArray(getPlayerList(cid), info.itemid) then
                   if info.quant > 1 then
                      doRemoveItem(info.uid, info.quant)
                      doPlayerAddItem(cid, info.itemid, info.quant)
                      str = str.." "..info.quant.." "..getItemNameById(info.itemid).." +"
                   else
                      doRemoveItem(info.uid)
                      if boost(cid) then
                         if aloot_boost[info.itemid] then
                            doPlayerSetBalance(cid,getPlayerBalance(cid) + aloot_boost[info.itemid])
                            str = str.." 1 "..getItemNameById(info.itemid).." ("..aloot_boost[info.itemid].."gps no banco) +"
                         else
                            doPlayerAddItem(cid, info.itemid, 1)
                            str = str.." 1 "..getItemNameById(info.itemid).." +"
                         end
                      else
                         doPlayerAddItem(cid, info.itemid, 1)
                         str = str.." 1 "..getItemNameById(info.itemid).." +"
                      end
                   end
                end
             end
          end
       end
       setPlayerTableStorage(cid,822564,{[1] = str, [2] = 0})
    end

    local function autoGold(cid, pos)
       if not isPlayer(cid) then return end
       local check = false
       local total = 0
       local position = {}
       for i = 1, 255 do
          pos.stackpos = i
          if getThingFromPos(pos).uid and getThingFromPos(pos).uid > 0 and isContainer(getThingFromPos(pos).uid) then
             position = pos
             check = true
             break
          end
       end
       if check then
          local corpse = getContainerItemsInfo(getThingFromPos(position).uid)
          if corpse then
             for index, info in pairs(corpse) do
                if info.uid and info.itemid then
                   if index < countTable(corpse) then
                      if isContainer(info.uid) then
                         local bag = getContainerItemsInfo(info.uid)
                         for i = 1, countTable(bag) do
                            if isInArray({2148, 2152, 2160}, bag[i].itemid) then
                               local multiplie = 1
                               if bag[i].itemid == 2148 then
                                  multiplie = 1
                               elseif bag[i].itemid == 2152 then
                                  multiplie = 100
                               elseif bag[i].itemid == 2160 then
                                  multiplie = 10000
                               end
                               doRemoveItem(bag[i].uid, bag[i].quant)
                               doPlayerSetBalance(cid, getPlayerBalance(cid) + tonumber(bag[i].quant) * multiplie)
                               total = total + bag[i].quant * multiplie
                               doPlayerSetStorageValue(cid, 04421021, tonumber(getPlayerStorageZero(cid, 04421021)) + tonumber(info.quant) * tonumber(multiplie))
                            end
                         end
                      end
                   end
                   if isInArray({2148, 2152, 2160}, info.itemid) then
                      local multiplie = 1
                      if info.itemid == 2148 then
                         multiplie = 1
                      elseif info.itemid == 2152 then
                         multiplie = 100
                      elseif info.itemid == 2160 then
                         multiplie = 10000
                      end
                      doRemoveItem(info.uid, info.quant)
                      doPlayerSetBalance(cid, getPlayerBalance(cid) + info.quant * multiplie)
                      doPlayerSetStorageValue(cid, 04421021, tonumber(getPlayerStorageZero(cid, 04421021)) + tonumber(info.quant) * tonumber(multiplie))
                      total = total + info.quant * multiplie
                   end
                end
             end
          end
       end
       if total > 0 then
          total = total - (total * 0.2)
          total = math.ceil(total)
          doPlayerSetBalance(cid,getPlayerBalance(cid) + total)
          local tab = getPlayerTableStorage(cid,822564)
          tab[2] = total
          setPlayerTableStorage(cid,822564,tab)
       end
    end

    local function sendMsg(cid)
       if not isPlayer(cid) then return end
       local tab = getPlayerTableStorage(cid,822564)
       if countTable(tab) >= 1 then
          if tab[1] then
             if tab[2] and tab[2] > 0 then
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: ".. tab[1] .." ".. tab[2] .." gold coins.")
             else
                if type(tab[1]) == "string" and string.len(tab[1]) > 1 then
                   doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: "..tab[1])
                end
             end
          elseif not tab[1] then
             if tab[2] then
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: "..tab[2].." gold coins.")
             end
          end
       end
       doPlayerSetStorageValue(cid,822564,-1)
    end

    local bosses = {
        ["Striker Cyclope"] = {
            {itemid = 9971, count = {min = 5, max = 15}},
       {itemid = 12396, count = {min = 1, max = 1}},
       {itemid = 2346, count = {min = 0, max = 1}},
            {itemid = 12575, count = {min = 1, max = 1}}
        },
        ["Bk Ferumbras"] = {
            {itemid = 8305, count = {min = 1, max = 2}},
       {itemid = 8981, count = {min = 1, max = 1}},
       {itemid = 9971, count = {min = 50, max = 80}},
       {itemid = 12396, count = {min = 3, max = 5}},
            {itemid = 12575, count = {min = 3, max = 5}}
        },
    }

    local wzUmBoss = {
        ["Gonka"] = {
            {itemid = 9971, count = {min = 5, max = 15}},
       {itemid = 12396, count = {min = 1, max = 1}},
       {itemid = 2346, count = {min = 0, max = 1}},
            {itemid = 12575, count = {min = 1, max = 1}}
        }
    }

    local wzDoisBoss = {
        ["Jabuti"] = {
            {itemid = 9971, count = {min = 5, max = 15}},
       {itemid = 12396, count = {min = 1, max = 1}},
       {itemid = 2346, count = {min = 0, max = 1}},
            {itemid = 12575, count = {min = 1, max = 1}}
        }
    }

    function getRotate(uid)
        local pos = getCreaturePosition(uid)
        return
        {
            {x = pos.x, y = pos.y-1, z = pos.z},
            {x = pos.x, y = pos.y+1, z = pos.z},
            {x = pos.x-1, y = pos.y, z = pos.z},
            {x = pos.x+1, y = pos.y, z = pos.z}
        }
    end

    function getRotateUm(uid)
        local pos = getCreaturePosition(uid)
        return
        {
            {x = pos.x-1, y = pos.y-1, z = pos.z},
            {x = pos.x+1, y = pos.y+1, z = pos.z},
            {x = pos.x+1, y = pos.y-1, z = pos.z},
            {x = pos.x-1, y = pos.y+1, z = pos.z}
        }
    end

    function getRotateDois(uid)
        local pos = getCreaturePosition(uid)
        return
        {
            {x = pos.x, y = pos.y-1, z = pos.z},
            {x = pos.x, y = pos.y+1, z = pos.z},
            {x = pos.x-1, y = pos.y, z = pos.z},
            {x = pos.x+1, y = pos.y, z = pos.z}
        }
    end

    function DelTp()
       posWzDois = {x = 132, y = 138, z = 15}
            local t = getTileItemById(posWzDois, 1387)
            if t then
                    doRemoveItem(t.uid, 1)
                    doSendMagicEffect(posWzDois, CONST_ME_POFF)
            end
    end

    function DelTpWz()
       posWzUm = {x = 153, y = 278, z = 14}
            local t = getTileItemById(posWzUm, 1387)
            if t then
                    doRemoveItem(t.uid, 1)
                    doSendMagicEffect(posWzUm, CONST_ME_POFF)
            end
    end

    function onKill(cid, target, lastHit)
        local bid = bosses[getCreatureName(target)]
        local wzUm = wzUmBoss[getCreatureName(target)]
        local wzDois = wzDoisBoss[getCreatureName(target)]
        local level = 400
        local item,count = 5925,1
        local monster = getCreatureName(target)
        local room = getArenaMonsterIdByName(monster)

        if room > 0 then
       setPlayerStorageValue(cid, room, 1)
       doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT,'Voce pode ir para a proxima sala!')
        end

        if isPlayer(target) and isPlayer(cid) then
            local pid = getPlayersOnline()
            for i = 1, #pid do
                doPlayerSendChannelMessage(pid[i], "", "O jogador ".. getCreatureName(cid) .." [".. getPlayerLevel(cid) .."]  acabou de matar o noob " .. getCreatureName(target) .. " [".. getPlayerLevel(target) .."]!", TALKTYPE_CHANNEL_HIGHLIGHT, 8)
            end

       if getPlayerLevel(target) >= 400 then
                if getPlayerIp(cid) ~= getPlayerIp(target) then
              if getPlayerLevel(target) >= 400 and getPlayerLevel(target) <= 449 then
                 exppg = getExperienceStage(getPlayerLevel(cid))
                 doPlayerAddExp(cid, 22000 * exppg)
                 doSendAnimatedText(getThingPos(cid), 12000 * exppg, 210)
              elseif getPlayerLevel(target) >= 450 and getPlayerLevel(target) <= 499 then
                 exppg = getExperienceStage(getPlayerLevel(cid))
                 doPlayerAddExp(cid, 26000 * exppg)
                 doSendAnimatedText(getThingPos(cid), 12000 * exppg, 210)
              elseif getPlayerLevel(target) >= 500 and getPlayerLevel(target) <= 549 then
                 exppg = getExperienceStage(getPlayerLevel(cid))
                 doPlayerAddExp(cid, 32000 * exppg)
                 doSendAnimatedText(getThingPos(cid), 15000 * exppg, 210)
              elseif getPlayerLevel(target) >= 550 then
                 exppg = getExperienceStage(getPlayerLevel(cid))
                 doPlayerAddExp(cid, 36000 * exppg)
                 doSendAnimatedText(getThingPos(cid), 20000 * exppg, 210)
                   end
          if getPlayerStorageValue(cid,22867) >= 1 and getPlayerStorageValue(cid,34765) <= 30 then
             setPlayerStorageValue(cid, 34765, getPlayerStorageValue(cid, 34765) + 1)
          end
                end
       end
        end

        if isPlayer(cid) and isPlayer(target) and getPlayerIp(target) ~= getPlayerIp(cid) then
       doPlayerAddItem(cid, item, count)
        end

        if isPlayer(cid) and isMonster(target) then
       if getPlayerStorageValue(cid, 04421001) == 1 and #getPlayerList(cid) > 0 then
          local pos = getCreaturePosition(target)
          addEvent(autoLoot, 500, cid, pos)
       end
       if getPlayerStorageValue(cid, 04421011) == 1 then
          local pos = getCreaturePosition(target)
          addEvent(autoGold, 540, cid, pos)
       end
       if getPlayerStorageValue(cid, 04421001) == 1 or getPlayerStorageValue(cid, 04421011) == 1 then
          addEvent(sendMsg, 560, cid)
       end
        end

        if isMonster(target) and bid and getStorage(33999) <= os.time() then
            doCreatureSetDropLoot(target, nil)
            for _, v in ipairs(bid) do
                doCreateItem(v.itemid, math.random(v.count.min, v.count.max), getRotate(target)[_])
           doCreateItem(v.itemid, math.random(v.count.min, v.count.max), getRotateUm(target)[_])
           doCreateItem(v.itemid, math.random(v.count.min, v.count.max), getRotateDois(target)[_])
                doSendMagicEffect(getRotate(target)[_], 6)
            end
            doSetStorage(33999, os.time() + 5)
        end

        if isMonster(target) and wzUm then
       doCreateTeleport(1387, {x=204, y=179, z=15}, {x=153, y=278, z=14})
       setPlayerStorageValue(cid, 45698, 1)
       addEvent(DelTpWz, 60 * 1000)
        end

        if isMonster(target) and wzDois then
       doCreateTeleport(1387, {x=204, y=179, z=15}, {x=132,y=138,z=15})
       setPlayerStorageValue(cid, 45699, 1)
       addEvent(DelTp, 60 * 1000)
        end
        return true
    end

    data/creaturescripts/login
    Código:
    registerCreatureEvent(cid, "Kills")

    data/creaturescripts/creaturescripts.xml
    Código:
     <event type="kill" name="Kills" event="script" value="kill.lua"/>

    data/libs/crear nuevo archivo llamado 049-vipsys

    colocar esto dentro:
    Código:
    vip = {
    name = "VIP System";
    author = "Mock";
    version = "1.0.0.0";
    query="ALTER TABLE `accounts` ADD `vip_time` INTEGER";
    query2="ALTER TABLE `accounts` ADD `vip_time` INT(15) NOT NULL"
    }

    function vip.setTable()
    dofile('config.lua')
    if sqlType == "sqlite" then
       db.query(vip.query)
    else
          db.query(vip.query2)
    end
    end

    function vip.getVip(cid)
           assert(tonumber(cid),'Parameter must be a number')
           if isPlayer(cid) == FALSE then error('Player don\'t find') end;
           ae = db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..getPlayerAccount(cid).."';")
           if ae:getID() == -1 then
             return 0
           end

    local retee = ae:getDataInt("vip_time") or 0
    ae:free()
           return retee
    end

    function vip.getVipByAcc(acc)
           assert(acc,'Account is nil')
           local a = db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..acc.."';")
           if a:getID() ~= -1 then
              return a:getDataInt("vip_time") or 0, a:free()
           else
              error('Account don\'t find.')
           end
    end

    function vip.setVip(cid,time)
           dofile("config.lua")
           assert(tonumber(cid),'Parameter must be a number')
           assert(tonumber(time),'Parameter must be a number')
           if isPlayer(cid) == FALSE then error('Player don\'t find') end;
           db.query("UPDATE `"..sqlDatabase.."`.`accounts` SET `vip_time` = '"..(os.time()+time).."' WHERE `accounts`.`name` ='".. getPlayerAccount(cid).."';")
    end

    function vip.getVipByAccount(acc)
           assert(acc,'Account is nil')
           return db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..acc.."';"):getDataInt("vip_time") or 0
    end                           

    function vip.hasVip(cid)
           assert(tonumber(cid),'Parameter must be a number')
           if isPlayer(cid) == FALSE then return end;
           local t = vip.getVip(cid) or 0
           if os.time(day) < t then
             return TRUE
           else
             return FALSE
           end
    end

    function vip.hasVips(cid)
           assert(tonumber(cid),'Parameter must be a number')
           if isPlayer(cid) == FALSE then return end;
           local t = vip.getVip(cid)
           if os.time(day) < t then
             return TRUE
           else
             return FALSE
           end
    end

    function vip.accountHasVip(acc)
           assert(acc,'Account is nil')
           if os.time() < vip.getVipByAccount(acc) then
             return TRUE
           else
             return FALSE
           end
    end
    function vip.getDays(days)
    return (3600 * 24 * days)
    end

    function vip.addVipByAccount(acc,time)
    assert(acc,'Account is nil')
    assert(tonumber(time),'Parameter must be a number')
    local a = vip.getVipByAcc(acc)
    a = os.difftime(a,os.time())
    if a < 0 then a = 0 end;
    a = a+time
    return vip.setVipByAccount(acc,a)
    end

    function vip.setVipByAccount(acc,time)
           dofile("config.lua")
           assert(acc,'Account is nil')
           assert(tonumber(time),'Parameter must be a number')
           db.query("UPDATE `accounts` SET `vip_time` = '"..(os.time()+time).."' WHERE `accounts`.`name` ='"..acc.."';")
           return TRUE
    end

    function vip.returnVipString(cid)
    assert(tonumber(cid),'Parameter must be a number')
    if isPlayer(cid) == TRUE then
        return os.date("%d %B %Y %X ", vip.getVip(cid))
    end
    end

    crear otro archivo nuevo llamado arena
    Código:
    -- arena script
    InitArenaScript = 0
    arena_room_max_time = 240 -- time in seconds for one arena room
    arenaKickPosition = {x=160, y=54, z=7} -- position where kick from arena when you leave/you did arena level
    arena_monsters = {}
    arena_monsters[42300] = 'frostfur' -- first monster from 1 arena
    arena_monsters[42301] = 'bloodpaw'
    arena_monsters[42302] = 'bovinus'
    arena_monsters[42303] = 'achad'
    arena_monsters[42304] = 'colerian the barbarian'
    arena_monsters[42305] = 'the hairy one'
    arena_monsters[42306] = 'axeitus headbanger'
    arena_monsters[42307] = 'rocky'
    arena_monsters[42308] = 'cursed gladiator'
    arena_monsters[42309] = 'orcus the cruel'
    arena_monsters[42310] = 'avalanche' -- first monster from 2 arena
    arena_monsters[42311] = 'kreebosh the exile'
    arena_monsters[42312] = 'the dark dancer'
    arena_monsters[42313] = 'the hag'
    arena_monsters[42314] = 'slim'
    arena_monsters[42315] = 'grimgor guteater'
    arena_monsters[42316] = 'drasilla'
    arena_monsters[42317] = 'spirit of earth'
    arena_monsters[42318] = 'spirit of water'
    arena_monsters[42319] = 'spirit of fire'
    arena_monsters[42320] = 'webster' -- first monster from 3 arena
    arena_monsters[42321] = 'darakan the executioner'
    arena_monsters[42322] = 'norgle glacierbeard'
    arena_monsters[42323] = 'the pit lord'
    arena_monsters[42324] = 'svoren the mad'
    arena_monsters[42325] = 'the masked marauder'
    arena_monsters[42326] = 'gnorre chyllson'
    arena_monsters[42327] = "fallen mooh'tah master ghar"
    arena_monsters[42328] = 'deathbringer'
    arena_monsters[42329] = 'the obliverator'

    function getArenaMonsterIdByName(name)
        name = string.lower(tostring(name))
        for i = 42300, 42329 do
            if tostring(arena_monsters[i]) == name then
                return i
            end
        end
        return 0
    end 

    y por ultimo crear otro archivo llamado killua's lib
    Código:
    -- lib and functions by Vitor Bertolucci (Killua)

    function warnPlayersWithStorage(storage, value, class, message) -- By Killua
        if not value then value = 1 end
       if not class then class = MESSAGE_SATUS_CONSOLE_WARNING end
       if not storage or not message then return end
        if #getPlayersOnline() == 0 then
            return
        end
        for _, pid in pairs(getPlayersOnline()) do
            if getPlayerStorageValue(pid, storage) == value then
                doPlayerSendTextMessage(pid, class, message)
          end
       if getPlayerAccess(pid) >= 4 then   
          doPlayerSendTextMessage(pid, class, "Message to those with storage "..storage..message) -- Gms will always receive the messages
       end
        end
    end

    function getPlayerStorageZero(cid, storage) -- By Killua
        local sto = getPlayerStorageValue(cid, storage)
        return sto > 0 and sto or 0
    end

    function getStorageZero(storage) -- By Killua
        local sto = getGlobalStorageValue(storage)
        return sto > 0 and sto or 0
    end

    function countTable(table) -- By Killua
        local y = 0
        if type(table) == "table" then
            for _ in pairs(table) do
                y = y + 1
            end
            return y
        end
        return false
    end

    function getPlayersInArea(frompos, topos) -- By Killua
        local players_ = {}
        local count = 1
        for _, pid in pairs(getPlayersOnline()) do
            if isInArea(getCreaturePosition(pid), frompos, topos) then
                players_[count] = pid
                count = count + 1
            end
        end
        return countTable(players_) > 0 and players_ or false
    end

    function getGuildNameById(gid) -- By Killua
        local query = db.getResult("SELECT `name` FROM `guilds` WHERE `id` = '"..gid.."'")
        if query:getID() == -1 then
            return ""
        end
        local name = query:getDataString("name")
        query:free()
        return name
    end

    function getContainerItemsInfo(containerUid) -- By Killua
        local table = {}
        if containerUid and containerUid > 0 then
            local a = 0 
            for i = 0, getContainerSize(containerUid) - 1 do
                local item = getContainerItem(containerUid,i)
                a = a + 1
                table[a] = {uid = item.uid, itemid = item.itemid, quant = item.type}
            end
            return table
        end
        return false
    end

    function getTableEqualValues(table) -- By Killua
        local ck = {}
        local eq = {}
        if type(table) == "table" then
             if countTable(table) and countTable(table) > 0 then
                 for i = 1, countTable(table) do
                   if not isInArray(ck, table[i]) then
                        ck[i] = table[i]
                    else
                        eq[i] = table[i]
                    end
                end
                return countTable(eq) > 0 and eq or 0
            end
        end
        return false
    end

    function killuaGetItemLevel(uid) -- By Killua
       local name = getItemName(uid)
       local pos = 0
       for i = 1, #name do
          if string.byte(name:sub(i,i)) == string.byte('+') then
             pos = i + 1
             break
          end
       end
       return tonumber(name:sub(pos,pos))
    end

    k_table_storage_lib = {
       filtrateString = function(str) -- By Killua
          local tb, x, old, last = {}, 0, 0, 0
          local first, second, final = 0, 0, 0
          if type(str) ~= "string" then
             return tb
          end
          for i = 2, #str-1 do
             if string.byte(str:sub(i,i)) == string.byte(':') then
                x, second, last = x+1, i-1, i+2
                for t = last,#str-1 do
                   if string.byte(str:sub(t,t)) == string.byte(',') then
                      first = x == 1 and 2 or old
                      old, final = t+2, t-1
                      local index, var = str:sub(first,second), str:sub(last,final)
                      tb[tonumber(index) or tostring(index)] = tonumber(var) or tostring(var)
                      break
                   end
                end
             end
          end
          return tb
       end,

       translateIntoString = function(tb) -- By Killua
          local str = ""
          if type(tb) ~= "table" then
             return str
          end
          for i, t in pairs(tb) do
             str = str..i..": "..t..", "
          end
          str = "a"..str.."a"
          return tostring(str)
       end
    }

    function setPlayerTableStorage(cid, key, value) -- By Killua
       return doPlayerSetStorageValue(cid, key, k_table_storage_lib.translateIntoString(value))
    end

    function getPlayerTableStorage(cid, key) -- By Killua
       return k_table_storage_lib.filtrateString(getPlayerStorageValue(cid, key))
    end

    function setGlobalTableStorage(key, value) -- By Killua
       return setGlobalStorageValue(key, k_table_storage_lib.translateIntoString(value))
    end

    function getGlobalTableStorage(key) -- By Killua
       return k_table_storage_lib.filtrateString(getGlobalStorageValue(key))
    end

    function printTable(table, includeIndices,prnt) -- By Killua
        if includeIndices == nil then includeIndices = true end
        if prnt == nil then prnt = true end
        if type(table) ~= "table" then
            error("Argument must be a table")
            return
        end
        local str, c = "{", ""
        for v, b in pairs(table) do
            if type(b) == "table" then
                str = includeIndices and str..c.."["..v.."]".." = "..printTable(b,true,false) or str..c..printTable(b,false,false)
            else
                str = includeIndices and str..c.."["..v.."]".." = "..b or str..c..b
            end
            c = ", "
        end
        str = str.."}"
        if prnt then print(str) end
        return str
     end
     
    function checkString(str) -- By Killua
       local check = true
       for i = 1, #str do
          local letra = string.byte(str:sub(i,i))
          if letra >= string.byte('a') and letra <= string.byte('z') or letra >= string.byte('A') and letra <= string.byte('Z') or letra >= string.byte('0') and letra <= string.byte('9') then
             check = true
          else
             check = false
             break
          end
       end
       return check
    end

    function isArmor(itemid) -- By Killua
       return getItemInfo(itemid).armor > 0
    end

    function isWeapon(uid) -- By Killua
       return getItemWeaponType(uid) ~= 0
    end

    function isShield(uid) -- By Killua
       return getItemWeaponType(uid) == 5
    end

    function isSword(uid) -- By Killua
       return getItemWeaponType(uid) == 1
    end

    function isClub(uid) -- By Killua
       return getItemWeaponType(uid) == 2
    end

    function isAxe(uid) -- By Killua
       return getItemWeaponType(uid) == 3
    end

    function isBow(uid) -- By Killua
       return getItemWeaponType(uid) == 4
    end

    function isWand(uid) -- By Killua
       return getItemWeaponType(uid) == 7
    end

    Ya quedaria perfecto, ahora a utilizar el autoloot.











    [Tienes que estar registrado y conectado para ver este vínculo]
    mil gracias bro me funciono perfecto te dejo tu increible like

    una ultima cosa al testearlo mas a fondo note que duplica el dinero que se envia al banco !!

    no se si sea un error o sea asi el sistema? solo quisiera saber eso para cerrar el tema ya que si es mucho !




    [Tienes que estar registrado y conectado para ver este vínculo] gracias bro solucione el problema del vip time : )
    te deje igual tu increible like : D

    3 participantes

    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).