Ir para conteúdo
  • Cadastre-se

Sistema [8.6][MODS] AutoLoot By Account! [+Item]


Posts Recomendados

Olá @Vodkart que prazer poder falar aqui em sua publicação! A algum tempo venho me dedicando com OT e muitas vezes vi sua ajuda, dei os rep + haha

 

Estou com o mesmo problema do @IceWar
b85d3d6240.png

 

Quero resolver esse problema enquanto o server ainda está com poucos players, onde eu deveria focar? Os 2 estão matando demon vip e behemoth vip, seus corpos respectivos são de dead demon e dead behemoth...

 

Obrigado desde já!

Link para o post
Compartilhar em outros sites
  • 2 weeks later...
  • Respostas 79
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Sistema removido.     Nova versão sem Bugs somente no Discord: vodkart#6090

coleta sim, coleta teu pênis de 20cm tbm.   isso mesmo, o autoloot coleta os 3 tipos de moeda automaticamente..   primeiro vou passar o task  4.0 para tfs 1.2 com ajuda do @KotZl

@tetheuscunha   eu fiz uma versão por account + item e outra versão por talk, era só procurar nesta mesmo seção!   obrigado ao @Sekk pela ajuda

Posted Images

Em 09/10/2017 em 11:22, lucasprimolemos disse:

Olá @Vodkart que prazer poder falar aqui em sua publicação! A algum tempo venho me dedicando com OT e muitas vezes vi sua ajuda, dei os rep + haha

 

Estou com o mesmo problema do @IceWar
b85d3d6240.png

 

Quero resolver esse problema enquanto o server ainda está com poucos players, onde eu deveria focar? Os 2 estão matando demon vip e behemoth vip, seus corpos respectivos são de dead demon e dead behemoth...

 

Obrigado desde já!

Meu problema continua, também não sei a solução ahsuahus

Baiak 24h -> www.baiakinfinity.ml

Link para o post
Compartilhar em outros sites
  • 1 month later...
  • 1 month later...
ALTER TABLE `accounts` ADD loot_time INT(15) NOT NULL DEFAULT 0;

 

 

Como agregar y en donde ?

Quiere saber de mis proyectos ?

 

Link para o post
Compartilhar em outros sites
  • 4 weeks later...
Em 04/02/2017 em 03:24, Vodkart disse:

ALTER TABLE `accounts` ADD loot_time INT(15) NOT NULL DEFAULT 0;

onde eu ponho isso ? sou novo nessas coias :)

Link para o post
Compartilhar em outros sites
Em 28/01/2018 em 01:31, Roy disse:

@Vodkart


BlockMonsters = {dragon lord},

Monstros com espaços nos nomes não funciona, não da pra executar o comando!

 

o cero seria:

 

BlockMonsters = {"dragon lord"}

 

sempre usando as aspas.

 

exemplo:

 

BlockMonsters = {"dragon lord", "rat", "demon", "hydra"}

 

etc...

 

16 horas atrás, kldedu disse:

onde eu ponho isso ? sou novo nessas coias :)

 

executa no banco de dados do ot. o seu é com site ou sqlite?

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
  • 3 weeks later...
  • 2 months later...

Aqui esta dando esse erro quando uso o item

1bdee10bb7dde6234ec7d01f8d839938.png

 

Mods:

Spoiler

<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Loot System" version="1.0" author="Vodkart And Mkalo" contact="none.com" enabled="yes">
<config name="Loot_func"><![CDATA[
info = {
    AutomaticDeposit = true,
    BlockMonsters = {},
    BlockItemsList = {2123,2515},
    Max_Slots = {free = 2, premium = 5},
    Storages = {27000,28001,28002}
}
function getAutoLootTime(cid)
    return db.getResult("SELECT `loot_time` FROM `accounts` WHERE `id` = "..getPlayerAccountId(cid)):getDataInt("loot_time")
end
function setAutoLootTime(cid, time)
    return db.query("UPDATE `accounts` SET `loot_time` = "..time.." WHERE `id` = "..getPlayerAccountId(cid))
end
function getAutoLootDays(cid)
    local days = math.ceil((getAutoLootTime(cid) - os.time())/(86400))
    return days <= 0 and 0 or days
end
function addAutoLootDays(cid, days)
    local add = (days <= 0 and 1 or days)*86400
    local time = getAutoLootDays(cid) == 0 and (os.time() + add) or (getAutoLootTime(cid) + add)
    return setAutoLootTime(cid, time)
end
function setPlayerStorageTable(cid, storage, tab)
    local tabstr = "&"
    for i,x in pairs(tab) do
        tabstr = tabstr .. i .. "," .. x .. ";"
    end
    setPlayerStorageValue(cid, storage, tabstr:sub(1, #tabstr-1))
end
function getPlayerStorageTable(cid, storage)
    local tabstr = getPlayerStorageValue(cid, storage)
    local tab = {}
    if type(tabstr) ~= "string" then
        return {}
    end
    if tabstr:sub(1,1) ~= "&" then
        return {}
    end
    local tabstr = tabstr:sub(2, #tabstr)
    local a = string.explode(tabstr, ";")
    for i,x in pairs(a) do
        local b = string.explode(x, ",")
        tab[tonumber(b[1]) or b[1]] = tonumber(b[2]) or b[2]
    end
    return tab
end
function isInTable(cid, item)
    for _,i in pairs(getPlayerStorageTable(cid, info.Storages[1]))do
        if tonumber(i) == tonumber(item) then
            return true
        end
    end
    return false
end
function addItemTable(cid, item)
    local x = {}
    for i = 1,#getPlayerStorageTable(cid, info.Storages[1]) do
        table.insert(x,getPlayerStorageTable(cid, info.Storages[1]))
    end
    if x ~= 0 then
        table.insert(x,tonumber(item))
        setPlayerStorageTable(cid, info.Storages[1], x)
    else
        setPlayerStorageTable(cid, info.Storages[1], {item})
    end
end
function removeItemTable(cid, item)
    local x = {}
    for i = 1,#getPlayerStorageTable(cid, info.Storages[1]) do
        table.insert(x,getPlayerStorageTable(cid, info.Storages[1]))
    end
    for i,v in ipairs(x) do
        if tonumber(v) == tonumber(item) then
            table.remove(x,i)
        end
    end
    return setPlayerStorageTable(cid, info.Storages[1], x)
end
function ShowItemsTabble(cid)
    local n,str = 0,"[+] Auto Loot Commands [+]\n\n!autoloot item name --> To add ou Remove item from list.\n!autoloot money --> To collect gold automatically.\n!autoloot clear --> To clear the list.\n!autoloot on/off --> To enable or disable the collecting of items in the system.\n\n[+] Auto Loot Info [+]\n\nSystem: "..(getPlayerStorageValue(cid, info.Storages[3]) <= 0 and "Activated" or "Disabled")..".\nTime: "..(getAutoLootTime(cid) > 0 and "you have ["..getAutoLootDays(cid).."] days --> ends in "..os.date("%d/%m/%y %X", getAutoLootTime(cid)).."." or "no have Auto Loot time.").."\nGold Collecting: "..(getPlayerStorageValue(cid, info.Storages[2]) > 0 and "Activated" or "Disabled")..".\nBalance Total: ["..getPlayerBalance(cid).."] gp's.\nMaximum Slots: ["..#getPlayerStorageTable(cid, info.Storages[1]).."/"..(isPremium(cid) and info.Max_Slots.premium or info.Max_Slots.free).."]\n\n[+] Auto Loot Slots [+]\n\n"
    for i = 1,#getPlayerStorageTable(cid, info.Storages[1]) do
        n = n + 1
        str = str.."Slot "..n.." - "..getItemNameById(getPlayerStorageTable(cid, info.Storages[1])).."\n"
    end
    return doPlayerPopupFYI(cid, str)
end
function getContainerItems(containeruid)
    local items = {}
    local containers = {}
    if type(getContainerSize(containeruid)) ~= "number" then
        return false
    end
    for slot = 0, getContainerSize(containeruid)-1 do
        local item = getContainerItem(containeruid, slot)
        if item.itemid == 0 then
            break
        end
        if isContainer(item.uid) then
            table.insert(containers, item.uid)
        end
        table.insert(items, item)
    end
    if #containers > 0 then
        for i,x in ipairs(getContainerItems(containers[1])) do
            table.insert(items, x)
        end
        table.remove(containers, 1)
    end
    return items
end
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
function getItemsInContainerById(container, itemid) -- Function By Kydrai
    local items = {}
    if isContainer(container) and getContainerSize(container) > 0 then
        for slot=0, (getContainerSize(container)-1) do
            local item = getContainerItem(container, slot)
            if isContainer(item.uid) then
                local itemsbag = getItemsInContainerById(item.uid, itemid)
                for i=0, #itemsbag do
                    table.insert(items, itemsbag)
                end
            else
                if itemid == item.itemid then
                    table.insert(items, item.uid)
                end
            end
        end
    end
    return items
end
function doPlayerAddItemStacking(cid, itemid, amount) -- revisado
    local item, _G = getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, itemid), 0
    if #item > 0 then
        for _ ,x in pairs(item) do
            local ret = getThing(x)
            if ret.type < 100 then
                doTransformItem(ret.uid, itemid, ret.type+amount)
                if ret.type+amount > 100 then
                    doPlayerAddItem(cid, itemid, ret.type+amount-100)
                end
                break
            else
                _G = _G+1
            end
        end
        if _G == #item then
            doPlayerAddItem(cid, itemid, amount)
        end
    else
        return doPlayerAddItem(cid, itemid, amount)
    end
end
function AutomaticDeposit(cid,item,n)
    local deposit = item == tonumber(2160) and (n*10000) or tonumber(item) == 2152 and (n*100) or (n*1)
    return doPlayerDepositMoney(cid, deposit)
end
function corpseRetireItems(cid, pos)
    local check = false
    for i = 0, 255 do
        pos.stackpos = i
        tile = getTileThingByPos(pos)
        if tile.uid > 0 and isCorpse(tile.uid) then
            check = true break
        end
    end
    if check == true then
        local items = getContainerItems(tile.uid)
        for i,x in pairs(items) do
            if isInArray(getPlayerStorageTable(cid, info.Storages[1]), tonumber(x.itemid)) or getPlayerStorageValue(cid, info.Storages[2]) > 0 and isInArray({2148,2152,2160},tonumber(x.itemid)) then
                if isItemStackable(x.itemid) then
                    doPlayerAddItemStacking(cid, x.itemid, x.type)
                    if info.AutomaticDeposit == true and isInArray({2148,2152,2160}, tonumber(x.itemid)) then
                        AutomaticDeposit(cid,x.itemid,x.type)
                    end
                else
                    doPlayerAddItem(cid, x.itemid)
                end
                doRemoveItem(x.uid)
            end
        end
    end
end
]]></config>
<event type="login" name="LootLogin" event="script"><![CDATA[
function onLogin(cid)
    registerCreatureEvent(cid, "LootEventKIll")
    if isPremium(cid) and getPlayerStorageValue(cid, 27001) <= 0 then
        setPlayerStorageValue(cid, 27001, 1)
    elseif getPlayerStorageValue(cid, 27001) > 0 and not isPremium(cid) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[Auto Loot] You premium is Over, Start a new list!")
        setPlayerStorageValue(cid, 27001, -1)
        setPlayerStorageValue(cid, info.Storages[1], -1)
    end
    return true
end]]></event>
<event type="kill" name="LootEventKIll" event="script"><![CDATA[
domodlib('Loot_func')
function onKill(cid, target, lastHit)
    if isPlayer(cid) and getAutoLootDays(cid) > 0 and getPlayerStorageValue(cid, info.Storages[3]) <= 0 and isMonster(target) and not isInArray(info.BlockMonsters, getCreatureName(target):lower()) then
        addEvent(corpseRetireItems, 0, cid ,getThingPos(target))
    end
    return true
end]]></event>
<talkaction words="!autoloot;/autoloot" event="buffer"><![CDATA[
domodlib('Loot_func')
local param, slots = param:lower(), isPremium(cid) and info.Max_Slots.premium or info.Max_Slots.free
if not param or param == "" then
    ShowItemsTabble(cid) return true
elseif tonumber(param) then
    doPlayerSendCancel(cid, "enter commands: !autoloot item name [+] !autoloot clean [+] !autoloot money [+] !autoloot on/off") return true
elseif isInArray({"clean","limpar", "clear"}, param) then
    setPlayerStorageValue(cid, info.Storages[1], -1)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] Your list has been cleaned.") return true
elseif isInArray({"start","stop","on","off"}, param) then
    setPlayerStorageValue(cid, info.Storages[3], getPlayerStorageValue(cid, info.Storages[3]) <= 0 and 1 or 0)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] "..(getPlayerStorageValue(cid, info.Storages[3]) > 0 and "Stopped" or "Started")..".") return true
elseif isInArray({"money","gold","gps","dinheiro"}, param) then
    setPlayerStorageValue(cid, info.Storages[2], getPlayerStorageValue(cid, info.Storages[2]) <= 0 and 1 or 0)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] Gold Colleting "..(getPlayerStorageValue(cid, info.Storages[2]) > 0 and "Activated" or "disabled")..".") return true
end
local item = ExistItemByName(tostring(param))
if not item then
    doPlayerSendCancel(cid, "This item does not exist.") return true
end
local item = getItemIdByName(tostring(param))
local var = isInTable(cid, item)
if isInArray({2148,2152,2160},item) then
    doPlayerSendTextMessage(cid, MESSAGE_FIRST, "Enter !autoloot money to add money in your list!") return true    
elseif isInArray(info.BlockItemsList, item) then
    doPlayerSendTextMessage(cid, MESSAGE_FIRST, "You can not add this item in the list!") return true
elseif not var and #getPlayerStorageTable(cid, info.Storages[1]) >= slots then
    doPlayerSendTextMessage(cid, MESSAGE_FIRST, "max "..slots.." from auto loot") return true
end
if not var then
    addItemTable(cid, item)
else
    removeItemTable(cid, item)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,not var and "you added the item "..param.." in the list" or "you removed the item "..param.." from the list")
return true]]></talkaction>
<action itemid="7703" event="script"><![CDATA[
domodlib('Loot_func')
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local days = 3
    addAutoLootDays(cid, days)
    doSendMagicEffect(getCreaturePosition(cid), 29)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You received "..days.." days of AutoLoot, you have "..getAutoLootDays(cid).." auto loot days.")
    doRemoveItem(item.uid)
    return true
end]]></action>
</mod>

 

 

fico no agurado de uma resposta... o/

Link para o post
Compartilhar em outros sites
5 minutos atrás, Deathstroke disse:

Aqui esta dando esse erro quando uso o item

1bdee10bb7dde6234ec7d01f8d839938.png

 

Mods:

  Mostrar conteúdo oculto

<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Loot System" version="1.0" author="Vodkart And Mkalo" contact="none.com" enabled="yes">
<config name="Loot_func"><![CDATA[
info = {
    AutomaticDeposit = true,
    BlockMonsters = {},
    BlockItemsList = {2123,2515},
    Max_Slots = {free = 2, premium = 5},
    Storages = {27000,28001,28002}
}
function getAutoLootTime(cid)
    return db.getResult("SELECT `loot_time` FROM `accounts` WHERE `id` = "..getPlayerAccountId(cid)):getDataInt("loot_time")
end
function setAutoLootTime(cid, time)
    return db.query("UPDATE `accounts` SET `loot_time` = "..time.." WHERE `id` = "..getPlayerAccountId(cid))
end
function getAutoLootDays(cid)
    local days = math.ceil((getAutoLootTime(cid) - os.time())/(86400))
    return days <= 0 and 0 or days
end
function addAutoLootDays(cid, days)
    local add = (days <= 0 and 1 or days)*86400
    local time = getAutoLootDays(cid) == 0 and (os.time() + add) or (getAutoLootTime(cid) + add)
    return setAutoLootTime(cid, time)
end
function setPlayerStorageTable(cid, storage, tab)
    local tabstr = "&"
    for i,x in pairs(tab) do
        tabstr = tabstr .. i .. "," .. x .. ";"
    end
    setPlayerStorageValue(cid, storage, tabstr:sub(1, #tabstr-1))
end
function getPlayerStorageTable(cid, storage)
    local tabstr = getPlayerStorageValue(cid, storage)
    local tab = {}
    if type(tabstr) ~= "string" then
        return {}
    end
    if tabstr:sub(1,1) ~= "&" then
        return {}
    end
    local tabstr = tabstr:sub(2, #tabstr)
    local a = string.explode(tabstr, ";")
    for i,x in pairs(a) do
        local b = string.explode(x, ",")
        tab[tonumber(b[1]) or b[1]] = tonumber(b[2]) or b[2]
    end
    return tab
end
function isInTable(cid, item)
    for _,i in pairs(getPlayerStorageTable(cid, info.Storages[1]))do
        if tonumber(i) == tonumber(item) then
            return true
        end
    end
    return false
end
function addItemTable(cid, item)
    local x = {}
    for i = 1,#getPlayerStorageTable(cid, info.Storages[1]) do
        table.insert(x,getPlayerStorageTable(cid, info.Storages[1]))
    end
    if x ~= 0 then
        table.insert(x,tonumber(item))
        setPlayerStorageTable(cid, info.Storages[1], x)
    else
        setPlayerStorageTable(cid, info.Storages[1], {item})
    end
end
function removeItemTable(cid, item)
    local x = {}
    for i = 1,#getPlayerStorageTable(cid, info.Storages[1]) do
        table.insert(x,getPlayerStorageTable(cid, info.Storages[1]))
    end
    for i,v in ipairs(x) do
        if tonumber(v) == tonumber(item) then
            table.remove(x,i)
        end
    end
    return setPlayerStorageTable(cid, info.Storages[1], x)
end
function ShowItemsTabble(cid)
    local n,str = 0,"[+] Auto Loot Commands [+]\n\n!autoloot item name --> To add ou Remove item from list.\n!autoloot money --> To collect gold automatically.\n!autoloot clear --> To clear the list.\n!autoloot on/off --> To enable or disable the collecting of items in the system.\n\n[+] Auto Loot Info [+]\n\nSystem: "..(getPlayerStorageValue(cid, info.Storages[3]) <= 0 and "Activated" or "Disabled")..".\nTime: "..(getAutoLootTime(cid) > 0 and "you have ["..getAutoLootDays(cid).."] days --> ends in "..os.date("%d/%m/%y %X", getAutoLootTime(cid)).."." or "no have Auto Loot time.").."\nGold Collecting: "..(getPlayerStorageValue(cid, info.Storages[2]) > 0 and "Activated" or "Disabled")..".\nBalance Total: ["..getPlayerBalance(cid).."] gp's.\nMaximum Slots: ["..#getPlayerStorageTable(cid, info.Storages[1]).."/"..(isPremium(cid) and info.Max_Slots.premium or info.Max_Slots.free).."]\n\n[+] Auto Loot Slots [+]\n\n"
    for i = 1,#getPlayerStorageTable(cid, info.Storages[1]) do
        n = n + 1
        str = str.."Slot "..n.." - "..getItemNameById(getPlayerStorageTable(cid, info.Storages[1])).."\n"
    end
    return doPlayerPopupFYI(cid, str)
end
function getContainerItems(containeruid)
    local items = {}
    local containers = {}
    if type(getContainerSize(containeruid)) ~= "number" then
        return false
    end
    for slot = 0, getContainerSize(containeruid)-1 do
        local item = getContainerItem(containeruid, slot)
        if item.itemid == 0 then
            break
        end
        if isContainer(item.uid) then
            table.insert(containers, item.uid)
        end
        table.insert(items, item)
    end
    if #containers > 0 then
        for i,x in ipairs(getContainerItems(containers[1])) do
            table.insert(items, x)
        end
        table.remove(containers, 1)
    end
    return items
end
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
function getItemsInContainerById(container, itemid) -- Function By Kydrai
    local items = {}
    if isContainer(container) and getContainerSize(container) > 0 then
        for slot=0, (getContainerSize(container)-1) do
            local item = getContainerItem(container, slot)
            if isContainer(item.uid) then
                local itemsbag = getItemsInContainerById(item.uid, itemid)
                for i=0, #itemsbag do
                    table.insert(items, itemsbag)
                end
            else
                if itemid == item.itemid then
                    table.insert(items, item.uid)
                end
            end
        end
    end
    return items
end
function doPlayerAddItemStacking(cid, itemid, amount) -- revisado
    local item, _G = getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, itemid), 0
    if #item > 0 then
        for _ ,x in pairs(item) do
            local ret = getThing(x)
            if ret.type < 100 then
                doTransformItem(ret.uid, itemid, ret.type+amount)
                if ret.type+amount > 100 then
                    doPlayerAddItem(cid, itemid, ret.type+amount-100)
                end
                break
            else
                _G = _G+1
            end
        end
        if _G == #item then
            doPlayerAddItem(cid, itemid, amount)
        end
    else
        return doPlayerAddItem(cid, itemid, amount)
    end
end
function AutomaticDeposit(cid,item,n)
    local deposit = item == tonumber(2160) and (n*10000) or tonumber(item) == 2152 and (n*100) or (n*1)
    return doPlayerDepositMoney(cid, deposit)
end
function corpseRetireItems(cid, pos)
    local check = false
    for i = 0, 255 do
        pos.stackpos = i
        tile = getTileThingByPos(pos)
        if tile.uid > 0 and isCorpse(tile.uid) then
            check = true break
        end
    end
    if check == true then
        local items = getContainerItems(tile.uid)
        for i,x in pairs(items) do
            if isInArray(getPlayerStorageTable(cid, info.Storages[1]), tonumber(x.itemid)) or getPlayerStorageValue(cid, info.Storages[2]) > 0 and isInArray({2148,2152,2160},tonumber(x.itemid)) then
                if isItemStackable(x.itemid) then
                    doPlayerAddItemStacking(cid, x.itemid, x.type)
                    if info.AutomaticDeposit == true and isInArray({2148,2152,2160}, tonumber(x.itemid)) then
                        AutomaticDeposit(cid,x.itemid,x.type)
                    end
                else
                    doPlayerAddItem(cid, x.itemid)
                end
                doRemoveItem(x.uid)
            end
        end
    end
end
]]></config>
<event type="login" name="LootLogin" event="script"><![CDATA[
function onLogin(cid)
    registerCreatureEvent(cid, "LootEventKIll")
    if isPremium(cid) and getPlayerStorageValue(cid, 27001) <= 0 then
        setPlayerStorageValue(cid, 27001, 1)
    elseif getPlayerStorageValue(cid, 27001) > 0 and not isPremium(cid) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[Auto Loot] You premium is Over, Start a new list!")
        setPlayerStorageValue(cid, 27001, -1)
        setPlayerStorageValue(cid, info.Storages[1], -1)
    end
    return true
end]]></event>
<event type="kill" name="LootEventKIll" event="script"><![CDATA[
domodlib('Loot_func')
function onKill(cid, target, lastHit)
    if isPlayer(cid) and getAutoLootDays(cid) > 0 and getPlayerStorageValue(cid, info.Storages[3]) <= 0 and isMonster(target) and not isInArray(info.BlockMonsters, getCreatureName(target):lower()) then
        addEvent(corpseRetireItems, 0, cid ,getThingPos(target))
    end
    return true
end]]></event>
<talkaction words="!autoloot;/autoloot" event="buffer"><![CDATA[
domodlib('Loot_func')
local param, slots = param:lower(), isPremium(cid) and info.Max_Slots.premium or info.Max_Slots.free
if not param or param == "" then
    ShowItemsTabble(cid) return true
elseif tonumber(param) then
    doPlayerSendCancel(cid, "enter commands: !autoloot item name [+] !autoloot clean [+] !autoloot money [+] !autoloot on/off") return true
elseif isInArray({"clean","limpar", "clear"}, param) then
    setPlayerStorageValue(cid, info.Storages[1], -1)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] Your list has been cleaned.") return true
elseif isInArray({"start","stop","on","off"}, param) then
    setPlayerStorageValue(cid, info.Storages[3], getPlayerStorageValue(cid, info.Storages[3]) <= 0 and 1 or 0)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] "..(getPlayerStorageValue(cid, info.Storages[3]) > 0 and "Stopped" or "Started")..".") return true
elseif isInArray({"money","gold","gps","dinheiro"}, param) then
    setPlayerStorageValue(cid, info.Storages[2], getPlayerStorageValue(cid, info.Storages[2]) <= 0 and 1 or 0)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] Gold Colleting "..(getPlayerStorageValue(cid, info.Storages[2]) > 0 and "Activated" or "disabled")..".") return true
end
local item = ExistItemByName(tostring(param))
if not item then
    doPlayerSendCancel(cid, "This item does not exist.") return true
end
local item = getItemIdByName(tostring(param))
local var = isInTable(cid, item)
if isInArray({2148,2152,2160},item) then
    doPlayerSendTextMessage(cid, MESSAGE_FIRST, "Enter !autoloot money to add money in your list!") return true    
elseif isInArray(info.BlockItemsList, item) then
    doPlayerSendTextMessage(cid, MESSAGE_FIRST, "You can not add this item in the list!") return true
elseif not var and #getPlayerStorageTable(cid, info.Storages[1]) >= slots then
    doPlayerSendTextMessage(cid, MESSAGE_FIRST, "max "..slots.." from auto loot") return true
end
if not var then
    addItemTable(cid, item)
else
    removeItemTable(cid, item)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,not var and "you added the item "..param.." in the list" or "you removed the item "..param.." from the list")
return true]]></talkaction>
<action itemid="7703" event="script"><![CDATA[
domodlib('Loot_func')
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local days = 3
    addAutoLootDays(cid, days)
    doSendMagicEffect(getCreaturePosition(cid), 29)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You received "..days.." days of AutoLoot, you have "..getAutoLootDays(cid).." auto loot days.")
    doRemoveItem(item.uid)
    return true
end]]></action>
</mod>

 

 

fico no agurado de uma resposta... o/

 

 

A query nao foi executada, não está achando a coluna na DB

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
8 minutos atrás, Vodkart disse:

 

 

A query nao foi executada, não está achando a coluna na DB

Entendo...

 

No caso, o server esta em Sqlite. Porém quando eu deixo em ' db.executeQuery'  não da pra clicar no item/ sistema não funciona.

E quando eu coloco ''db.query' da pra clicar no item, mas ai aparece o erro que citei acima

Link para o post
Compartilhar em outros sites
  • 2 months later...
  • 3 weeks later...

@Vodkart No meu server tem uma moeda o GoldIngot, como faço para o autoloot reconhecer ele como dinheiro e já enviar direto pro banco??? Ele só "deposita" a gold coin, platinum coin e crystal coin. Quero que ele pegue a GoldIngot também

Editado por tetheuscunha (veja o histórico de edições)

Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.

Link para o post
Compartilhar em outros sites

@vodkar TFS 0.4.3 otclient 8.60, coloquei tudo certinho, mas quando ele coleta o gold, não mostra nada no depot nem na bag.
Outra coisa pior, quando ele pega item tipo meat, ou outros ao invés dele puxar do loot do bixo pra sua bp, ele cópia o loot do bixo jogando na sua bp, e você pode abrir o corpo do monstro e o loot ainda estar lá '--' tipo ele clona, não exatamente puxa do monstro pra bp.. mo bug, dá pra consertar ? Não ta dando nenhum erro no distro.

Link para o post
Compartilhar em outros sites
  • 4 months later...

@Vodkart estou usando um servidor derivado, 8.54, consigo adicionar o sistema sem problemas e até adicionar itens, porém, ele não pega nada dos corpses...

estou aguardando ajuda!

tumblr_o70wteR8521r9n6kzo1_400.gif

Link para o post
Compartilhar em outros sites
  • 3 months later...
  • 4 months later...

Como coloca pra coletar os dinheiros sem precisar ter os dias de autoloot?

Estou usando essa outra versão que tu vez por causa do erro!!






<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Loot System" version="1.0" author="Vodkart And Mkalo" contact="none.com" enabled="yes">
<config name="Loot_func"><![CDATA[
info = {
    AutomaticDeposit = true,
    BlockMonsters = {},
    BlockItemsList = {2123,2515},
    Max_Slots = {free = 2, premium = 5},
    Storages = {27000,28001,28002}
}
function getAutoLootTime(cid)
    return db.getResult("SELECT `loot_time` FROM `accounts` WHERE `id` = "..getPlayerAccountId(cid)):getDataInt("loot_time")
end
function setAutoLootTime(cid, time)
    return db.executeQuery("UPDATE `accounts` SET `loot_time` = "..time.." WHERE `id` = "..getPlayerAccountId(cid))
end
function getAutoLootDays(cid)
    local days = math.ceil((getAutoLootTime(cid) - os.time())/(86400))
    return days <= 0 and 0 or days
end
function addAutoLootDays(cid, days)
    local add = (days <= 0 and 1 or days)*86400
    local time = getAutoLootDays(cid) == 0 and (os.time() + add) or (getAutoLootTime(cid) + add)
    return setAutoLootTime(cid, time) 
end
function setPlayerStorageTable(cid, storage, tab)
    local tabstr = "&"
    for i,x in pairs(tab) do
        tabstr = tabstr .. i .. "," .. x .. ";"
    end
    setPlayerStorageValue(cid, storage, tabstr:sub(1, #tabstr-1))
end
function getPlayerStorageTable(cid, storage)
    local tabstr = getPlayerStorageValue(cid, storage)
    local tab = {}
    if type(tabstr) ~= "string" then
        return {}
    end
    if tabstr:sub(1,1) ~= "&" then
        return {}
    end
    local tabstr = tabstr:sub(2, #tabstr)
    local a = string.explode(tabstr, ";")
    for i,x in pairs(a) do
        local b = string.explode(x, ",")
        tab[tonumber(b[1]) or b[1]] = tonumber(b[2]) or b[2]
    end
    return tab
end
function isInTable(cid, item)
    for _,i in pairs(getPlayerStorageTable(cid, info.Storages[1]))do
        if tonumber(i) == tonumber(item) then
            return true
        end
    end
    return false
end
function addItemTable(cid, item)
    local x = {}
    for i = 1,#getPlayerStorageTable(cid, info.Storages[1]) do
        table.insert(x,getPlayerStorageTable(cid, info.Storages[1])[i])
    end
    if x ~= 0 then
        table.insert(x,tonumber(item))
        setPlayerStorageTable(cid, info.Storages[1], x)
    else
        setPlayerStorageTable(cid, info.Storages[1], {item})
    end
end
function removeItemTable(cid, item)
    local x = {}
    for i = 1,#getPlayerStorageTable(cid, info.Storages[1]) do
        table.insert(x,getPlayerStorageTable(cid, info.Storages[1])[i])
    end
    for i,v in ipairs(x) do
        if tonumber(v) == tonumber(item) then
            table.remove(x,i)
        end
    end
    return setPlayerStorageTable(cid, info.Storages[1], x)
end
function ShowItemsTabble(cid)
    local n,str = 0,"[+] Auto Loot Commands [+]\n\n!autoloot item name --> To add ou Remove item from list.\n!autoloot money --> To collect gold automatically.\n!autoloot clear --> To clear the list.\n!autoloot on/off --> To enable or disable the collecting of items in the system.\n\n[+] Auto Loot Info [+]\n\nSystem: "..(getPlayerStorageValue(cid, info.Storages[3]) <= 0 and "Activated" or "Disabled")..".\nTime: "..(getAutoLootTime(cid) > 0 and "you have ["..getAutoLootDays(cid).."] days --> ends in "..os.date("%d/%m/%y %X", getAutoLootTime(cid)).."." or "no have Auto Loot time.").."\nGold Collecting: "..(getPlayerStorageValue(cid, info.Storages[2]) > 0 and "Activated" or "Disabled")..".\nBalance Total: ["..getPlayerBalance(cid).."] gp's.\nMaximum Slots: ["..#getPlayerStorageTable(cid, info.Storages[1]).."/"..(isPremium(cid) and info.Max_Slots.premium or info.Max_Slots.free).."]\n\n[+] Auto Loot Slots [+]\n\n"
    for i = 1,#getPlayerStorageTable(cid, info.Storages[1]) do
        n = n + 1
        str = str.."Slot "..n.." - "..getItemNameById(getPlayerStorageTable(cid, info.Storages[1])[i]).."\n"
    end
    return doPlayerPopupFYI(cid, str)
end
function getContainerItems(containeruid)
    local items = {}
    local containers = {}
    if type(getContainerSize(containeruid)) ~= "number" then
        return false
    end
    for slot = 0, getContainerSize(containeruid)-1 do
        local item = getContainerItem(containeruid, slot)
        if item.itemid == 0 then
            break
        end
        if isContainer(item.uid) then
            table.insert(containers, item.uid)
        end
        table.insert(items, item)
    end
    if #containers > 0 then
        for i,x in ipairs(getContainerItems(containers[1])) do
            table.insert(items, x)
        end
        table.remove(containers, 1)
    end
    return items
end
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
function getItemsInContainerById(container, itemid) -- Function By Kydrai
    local items = {}
    if isContainer(container) and getContainerSize(container) > 0 then
        for slot=0, (getContainerSize(container)-1) do
            local item = getContainerItem(container, slot)
            if isContainer(item.uid) then
                local itemsbag = getItemsInContainerById(item.uid, itemid)
                for i=0, #itemsbag do
                    table.insert(items, itemsbag[i])
                end
            else
                if itemid == item.itemid then
                    table.insert(items, item.uid)
                end
            end
        end
    end
    return items
end
function doPlayerAddItemStacking(cid, itemid, amount) -- revisado
    local item, _G = getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, itemid), 0
    if #item > 0 then
        for _ ,x in pairs(item) do
            local ret = getThing(x)
            if ret.type < 100 then
                doTransformItem(ret.uid, itemid, ret.type+amount) 
                if ret.type+amount > 100 then
                    doPlayerAddItem(cid, itemid, ret.type+amount-100)
                end
                break
            else
                _G = _G+1
            end
        end
        if _G == #item then
            doPlayerAddItem(cid, itemid, amount)
        end
    else
        return doPlayerAddItem(cid, itemid, amount)
    end
end
function AutomaticDeposit(cid,item,n)
    local deposit = item == tonumber(2160) and (n*10000) or tonumber(item) == 2152 and (n*100) or (n*1)
    return doPlayerDepositMoney(cid, deposit)
end
function corpseRetireItems(cid, pos)
    local check = false
    for i = 0, 255 do
        pos.stackpos = i
        tile = getTileThingByPos(pos)
        if tile.uid > 0 and isCorpse(tile.uid) then
            check = true break
        end
    end
    if check == true then
        local items = getContainerItems(tile.uid)
        for i,x in pairs(items) do
            if isInArray(getPlayerStorageTable(cid, info.Storages[1]), tonumber(x.itemid)) or getPlayerStorageValue(cid, info.Storages[2]) > 0 and isInArray({2148,2152,2160},tonumber(x.itemid)) then
                if isItemStackable(x.itemid) then
                    doPlayerAddItemStacking(cid, x.itemid, x.type)
                    if info.AutomaticDeposit == true and isInArray({2148,2152,2160}, tonumber(x.itemid)) then
                        AutomaticDeposit(cid,x.itemid,x.type)
                    end
                else
                    doPlayerAddItem(cid, x.itemid)
                end
                doRemoveItem(x.uid)
            end
        end
    end
end
]]></config>
<event type="login" name="LootLogin" event="script"><![CDATA[
function onLogin(cid)
    registerCreatureEvent(cid, "LootEventKIll")
    if isPremium(cid) and getPlayerStorageValue(cid, 27001) <= 0 then
        setPlayerStorageValue(cid, 27001, 1)
    elseif getPlayerStorageValue(cid, 27001) > 0 and not isPremium(cid) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[Auto Loot] You premium is Over, Start a new list!")
        setPlayerStorageValue(cid, 27001, -1)
        setPlayerStorageValue(cid, info.Storages[1], -1)
    end
    return true
end]]></event>
<event type="kill" name="LootEventKIll" event="script"><![CDATA[
domodlib('Loot_func')
function onKill(cid, target, lastHit) 
    if isPlayer(cid) and getAutoLootDays(cid) > 0 and getPlayerStorageValue(cid, info.Storages[3]) <= 0 and isMonster(target) and not isInArray(info.BlockMonsters, getCreatureName(target):lower()) then
        addEvent(corpseRetireItems, 0, cid ,getThingPos(target))
    end
    return true
end]]></event>
<talkaction words="!autoloot;/autoloot" event="buffer"><![CDATA[
domodlib('Loot_func')
local param, slots = param:lower(), isPremium(cid) and info.Max_Slots.premium or info.Max_Slots.free
if not param or param == "" then
    ShowItemsTabble(cid) return true
elseif tonumber(param) then
    doPlayerSendCancel(cid, "enter commands: !autoloot item name [+] !autoloot clean [+] !autoloot money [+] !autoloot on/off") return true
elseif isInArray({"clean","limpar", "clear"}, param) then
    setPlayerStorageValue(cid, info.Storages[1], -1)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] Your list has been cleaned.") return true
elseif isInArray({"start","stop","on","off"}, param) then
    setPlayerStorageValue(cid, info.Storages[3], getPlayerStorageValue(cid, info.Storages[3]) <= 0 and 1 or 0)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] "..(getPlayerStorageValue(cid, info.Storages[3]) > 0 and "Stopped" or "Started")..".") return true
elseif isInArray({"money","gold","gps","dinheiro"}, param) then
    setPlayerStorageValue(cid, info.Storages[2], getPlayerStorageValue(cid, info.Storages[2]) <= 0 and 1 or 0)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] Gold Colleting "..(getPlayerStorageValue(cid, info.Storages[2]) > 0 and "Activated" or "disabled")..".") return true
end
local item = ExistItemByName(tostring(param))
if not item then
    doPlayerSendCancel(cid, "This item does not exist.") return true
end
local item = getItemIdByName(tostring(param))
local var = isInTable(cid, item)
if isInArray({2148,2152,2160},item) then 
    doPlayerSendTextMessage(cid, MESSAGE_FIRST, "Enter !autoloot money to add money in your list!") return true    
elseif isInArray(info.BlockItemsList, item) then
    doPlayerSendTextMessage(cid, MESSAGE_FIRST, "You can not add this item in the list!") return true
elseif not var and #getPlayerStorageTable(cid, info.Storages[1]) >= slots then
    doPlayerSendTextMessage(cid, MESSAGE_FIRST, "max "..slots.." from auto loot") return true
end
if not var then
    addItemTable(cid, item)
else
    removeItemTable(cid, item)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,not var and "you added the item "..param.." in the list" or "you removed the item "..param.." from the list")
return true]]></talkaction>
<action itemid="5956" event="script"><![CDATA[
domodlib('Loot_func')
function onUse(cid, item, fromPosition, itemEx, toPosition) 
    local days = 30
    addAutoLootDays(cid, days)
    doSendMagicEffect(getCreaturePosition(cid), 29)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You received "..days.." days of AutoLoot, you have "..getAutoLootDays(cid).." auto loot days.")
    doRemoveItem(item.uid)
    return true
end]]></action>
<action itemid="9663" event="script"><![CDATA[
domodlib('Loot_func')
function onUse(cid, item, fromPosition, itemEx, toPosition) 
    local days = 7
    addAutoLootDays(cid, days)
    doSendMagicEffect(getCreaturePosition(cid), 29)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You received "..days.." days of AutoLoot, you have "..getAutoLootDays(cid).." auto loot days.")
    doRemoveItem(item.uid)
    return true
end]]></action>
<action itemid="7723" event="script"><![CDATA[
domodlib('Loot_func')
function onUse(cid, item, fromPosition, itemEx, toPosition) 
    local days = 1
    addAutoLootDays(cid, days)
    doSendMagicEffect(getCreaturePosition(cid), 29)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You received "..days.." days of AutoLoot, you have "..getAutoLootDays(cid).." auto loot days.")
    doRemoveItem(item.uid)
    return true
end]]></action>
</mod>

Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.

Link para o post
Compartilhar em outros sites
  • 11 months later...

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por luanluciano93
      Olá pessoal, estou desenvolvendo esse sistema vip para TFS 1.x, se precisarem de alguma função nova é só comentar, criei para usar em um servidor meu e resolvi postar, bom proveito a todos.
       
      É só ir no arquivo data/lib/core/player.lua e adicionar esse código no começo do script:
      -- ALTER TABLE `accounts` ADD `vip_time` BIGINT(20) NOT NULL DEFAULT 0; -- player:getVipTime() function Player.getVipTime(self) local resultId = db.storeQuery("SELECT `vip_time` FROM `accounts` WHERE `id` = '".. self:getAccountId() .."';") local time = resultId ~= false and result.getNumber(resultId, "vip_time") or 0 result.free(resultId) return time end -- player:isVip() function Player.isVip(self) return self:getVipTime() > os.time() and true or false end -- player:addVipDays(days) function Player.addVipDays(self, days) return(self:isVip() and tonumber((days * 86400))) and db.query("UPDATE `accounts` SET `vip_time` = '".. (self:getVipTime() + (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") or db.query("UPDATE `accounts` SET `vip_time` = '".. (os.time() + (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:removeVipDays(days) function Player.removeVipDays(self, days) return(self:isVip() and tonumber((days * 86400))) and db.query("UPDATE `accounts` SET `vip_time` = '".. (self:getVipTime() - (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") or db.query("UPDATE `accounts` SET `vip_time` = '".. (os.time() - (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:setVipDays(days) function Player.setVipDays(self, days) return db.query("UPDATE `accounts` SET `vip_time` = '".. (os.time() - (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:removeVip() function Player.removeVip(self) db.query("UPDATE `accounts` SET `vip_time` = '0' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:sendVipDaysMessage() function Player.sendVipDaysMessage(self) if self:isVip() then local vipTime = self:getVipTime() - os.time() local vipDays = 1 + (math.floor(vipTime / 86400)) return self:getVipTime() ~= false and self:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'You have '.. vipDays .. ' vip day(s) in your account.') end end -- player:checkVipLogin() function Player.checkVipLogin(self) if self:getVipTime() > 0 and not self:isVip() then return self:removeVip() and self:teleportTo(self:getTown():getTemplePosition()) end end  
       
      As funções são:
      • player:getVipTime() - Retorna o valor da tabela vip_time (igual esta na database).
      • player:isVip() - Retorna se o player é vip ou não.
      • player:addVipDays(days) - Usa-se em algum script para para adicionar dias de vip ao player (parâmetro de entrada "days").
      • player:removeVipDays(days) - Usa-se em algum script para para remover dias de vip do player (parâmetro de entrada "days").
      • player:setVipDays(days) - Usa-se em algum script para para mudar os dias de vip do player (parâmetro de entrada "days").
      • player:removeVip() - Usa-se em algum script para para remover todo tempo de vip do player.
      • player:sendVipDaysMessage() - Retorna uma mensagem no player mostrando os dias de vip que ainda restam ao player.
      • player:checkVipLogin() - Checa se a vip do player acabou, se sim teleporta ele para o templo.
       

      Qualquer dúvida ou erro/bug poste aqui.
    • Por Killua
      Como funciona?
      A cada monstro que vc mata, seus itens equipados ganham 1 de exp. Quando seus itens chegarem às quantidades de exp definidas, eles upam e ficam com o nome assim: Demon Helmet + 1. Helmets, armors, legs, e boots recebem 1 de arm a cada vez que upam. Armas recebem 1 de ataque e escudos 1 de defesa.
       
      Para o monstro contar, ele deve dar um mínimo de exp (definido no script). O número de exp a que me refiro é aquele um presente no arquivo .xml.
       
      Para instalar, crie Killua Items Upgrade.lua em data/creaturescripts/scripts e coloque:
        Em data/creaturescripts/creaturescripts.xml coloque essas duas tags:
      <event type="kill" name="Item level" event="script" value="Killua Items Upgrade.lua"/> <event type="login" name="Item levell" event="script" value="Killua Items Upgrade.lua"/> Configurando: Na tabela table_of_slots, coloque em quais slots os itens upam.
      min_exp é a experiência mínima que o monstro deve ter para contar exp para o item. Se vc colocar 500, somente os monstros que tem exp igual ou superior a 500 no arquivo.xml vão valer.
      exp_levels são os valores de exp que os itens devem atingir para upar. No meu caso, quando o item alcançar 50 de exp, ele upa para o level 1. Quando alcançar 50 de exp, upa para o level 2 e assim por diante.
    • Por Sekk
      Bom, procurei esse Castle por MUITO TEMPO, mas não achei em NENHUM LUGAR DA INTERNET. Ontem, eu estava vendo alguns mapas do @Deathrocks, e vi nos prints, que o mapa possuia o evento que eu queria!
       
      Então baixei o mapa e extrai o evento, então venho lhes trazer!
       
       
      Nome: Castle 24H
      Cliente: 8.6
      Versão TFS: 0.4
      Tipo: Evento
       
      Bom, para começar, vamos em actions/scripts e crie 2 arquivos:
       
      castledoor1.lua
       
      castlewar1.lua
       
        Agora em actions.xml adicione as tags:
       
      Agora em monster/traps crie 3 arquivos:
       
      porta.xml
       
      protectcastle.xml  
      statue.xml  
      Agora em monsters.xml adicione as tags:    
      Vamos para movements/scripts e crie 2 arquivos:
       
      castlewar2.lua
       
      level.lua  
      Agora em movements.xml adicione as tags:  
       
      Pronto. Agora você só precisa baixar o mapa, inserir o mesmo ao seu servidor, configurar os teleports, e as hunts dentro do castle etc.
       
      PRINTS:
      1ª parte
       
      2ª parte:
       
      Obs.: Todos os ActionID e monsters já estão no mapa! Você só precisa configurar as coordenadas dos teleports, e o que possui no castle!
       
      Obs².: Tudo o que você pode configurar, já está escrito em cada script!
       
       
      Créditos:
      @DeathRocks
      PC98
      mapa.rar
    • Por gpedro
      Testado: MySQL & SQLite
      Distro: TFS 0.4_SVN & TFS 0.3.6

      MySQL

      ALTER TABLE `players` ADD `resets` INT(11) NOT NULL DEFAULT "0"; SQLite ALTER TABLE players ADD resets INTEGER not null default 0 Adicionando nas sources player.h procure por: uint32_t level; logo abaixo, adicione: uint32_t resets; iologindata.cpp procure por query << "SELECT `id`, `account_id`, `group_id`, `world_id`, `sex`, `vocation`, `experience`, `level`," substitua por: query << "SELECT `id`, `account_id`, `group_id`, `world_id`, `sex`, `vocation`, `experience`, `level`, `resets`, " procure por player->level = std::max((uint32_t)1, (uint32_t)result->getDataInt("level")); logo abaixo adicione: player->resets = (uint32_t)result->getDataInt("resets"); procure por query << "`maglevel` = " << player->magLevel << ", "; logo abaixo adicione: query << "`resets` = " << player->resets << ", "; players.cpp procure por: s << " (Level " << level << ")"; substitua por: s << " (Level " << level << ") [Reset " << resets << "]"; players.h procure por: void setPromotionLevel(uint32_t pLevel); logo abaixo adicione: uint32_t getResets() { return resets;} void setResets(int32_t amount) { resets += amount; if (resets < 0) {resets = 0;} } luascript.cpp para 0.3.6 static int32_t luaDoPlayerSetIdleTime(lua_State* L); logo abaixo adicione: static int32_t luaGetResets(lua_State* L); static int32_t luaSetResets(lua_State* L); talkactions.xml <talkaction words="!rank;/rank" event="script" value="ranks.lua"/> <talkaction words="!reset;/reset" script="reset.lua"/> ranks.lua
      Créditos: Dark Skyllen, Marcryzius, Mock, Kydrai, Cykotitan, gpedro*.
      * adaptação para 0.4
    • Por VitorSubhi
      Apresentação: Olá galera do Tibia King, este é meu primeiro tutorial que desenvolvo após anos apenas sugando da comunidade, chegou a hora de compartilhar um pouco de conhecimento, rsrs...
      Após ver que muitos usuários tinham interesse em um sistema de Trade de Points in-game resolvi trazer um sistema totalmente completo para vocês.
       
      Funcionamento:
      Player 1 após adquirir os Points, pode iniciar uma negociação com o Player 2 através do comando /tradepoints Player 2, Quantidade. Será aberto uma Janela de Trade com o item referente aos Points. Após ambos aceitarem a negociação será realizado a troca de Points pelo item requisitado.
      Observações:
      Necessário ter acesso às Sources de sua Distro. Testado em servidor 8.6 (The Forgotten Server 0.4). Antes que venham falar que possui sistemas parecidos, veja o diferencial (Item não aparece em nenhum inventário, e não é necessário usar/comprar qualquer item).  
      Algumas Imagens:
       
      Instalação:
      Sources > Luascript.cpp Sources > Luascript.cpp Sources > Luascript.h  
       
      Server > Data > Lib > 050-function Server > Data > Creaturescripts > Scripts >Trade_Orbs.lua Server > Data > Creaturescripts > Creaturescripts.xml Server > Data > Creaturescripts > Scripts > Login.lua Server > Data > Talkactions > Scripts > Points_Trade.lua Server > Data > Talkactions > Talkactions.xml Créditos:
      Todo o sistema foi feito completamente por mim: Vítor Subhi.
      The Forgotten Server (Pelas Sources)
      Vodkart, White Wolf, Natanael Beckman, e a todos os demais membros do TK que não lembro o nome, que contribuíram indiretamente através de seus tutoriais.
       
       
       
       
       

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo