Ir para conteúdo
  • Cadastre-se

Scripting [7.72]MOD Autoloot - mostrar comandos


Posts Recomendados

.Qual servidor ou website você utiliza como base? 

The OTX Server Version: (2.100 - 6000) - Codename: (FINAL)

 

Qual o motivo deste tópico? 

 

Tenho um mod de autoloot que funciona perfeitamennte bem, a não ser pelo comando básico dele de mostrar os comandos disponíveis e informações do mod. Os comandos de add, remover item, etc funcionam perfeitamente e ele recolhe todos os itens, mas o comando "/autoloot" da erro na console, conforme informações abaixo.

 

Está surgindo algum erro? Se sim coloque-o aqui. 

Citar

[3/1/2021 9:30:32] [Error - TalkAction Interface]
[3/1/2021 9:30:32] local cid = 268448572
[3/1/2021 9:30:32] local words = "/autoloot"
[3/1/2021 9:30:32] local param = ""
[3/1/2021 9:30:32] local channel = 65534
[3/1/2021 9:30:32] domodlib('Loot_func')
[3/1/2021 9:30:32] local param, slots = param:lower(), isPremium(cid) and info.Max_Slots.premium or info.Max_Slots.free
[3/1/2021 9:30:32] if not param or param == "" then
[3/1/2021 9:30:32] ShowItemsTabble(cid) return true
[3/1/2021 9:30:32] elseif tonumber(param) then
[3/1/2021 9:30:32] doPlayerSendCancel(cid, "enter commands: !autoloot item name [+] !autoloot clean [+] !autoloot money [+] !autoloot on/off") return true
[3/1/2021 9:30:32] elseif isInArray({"clean","limpar", "clear"}, param) then
[3/1/2021 9:30:32] if existsAutoloot(cid) then doCleanAutoloot(cid) end
[3/1/2021 9:30:32] doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] Your list has been cleaned.") return true
[3/1/2021 9:30:32] elseif isInArray({"start","stop","on","off"}, param) then
[3/1/2021 9:30:32] setPlayerStorageValue(cid, info.Storages[1], getPlayerStorageValue(cid, info.Storages[1]) <= 0 and 1 or 0)
[3/1/2021 9:30:32] doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Auto Loot "..(getPlayerStorageValue(cid, info.Storages[1]) > 0 and "Stopped" or "Started")..".") return true
[3/1/2021 9:30:32] elseif isInArray({"warn","aviso"}, param) then
[3/1/2021 9:30:32] setPlayerStorageValue(cid, info.Storages[3], getPlayerStorageValue(cid, info.Storages[3]) <= 0 and 1 or 0)
[3/1/2021 9:30:32] doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Auto Loot Backpack Warn "..(getPlayerStorageValue(cid, info.Storages[3]) > 0 and "disabled" or "Activated")..".") return true
[3/1/2021 9:30:32] elseif isInArray({"mensagem","message","mensagen","msg"}, param) then
[3/1/2021 9:30:32] setPlayerStorageValue(cid, info.Storages[6], getPlayerStorageValue(cid, info.Storages[6]) <= 0 and 1 or 0)
[3/1/2021 9:30:32] doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Auto Loot Message "..(getPlayerStorageValue(cid, info.Storages[6]) > 0 and "disabled" or "Activated")..".") return true
[3/1/2021 9:30:32] elseif isInArray({"cor","color","type"}, param) then
[3/1/2021 9:30:32] setPlayerStorageValue(cid, info.Storages[5], getPlayerColorLootMessage(cid) == #Color_Loot and 0 or getPlayerColorLootMessage(cid)+1)
[3/1/2021 9:30:32] doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Auto Loot Message Color Changed to "..Color_Loot[getPlayerColorLootMessage(cid)][2]..".") return true
[3/1/2021 9:30:32] elseif isInArray({"money","gold","gps","dinheiro"}, param) then
[3/1/2021 9:30:32] setPlayerStorageValue(cid, info.Storages[2], getPlayerStorageValue(cid, info.Storages[2]) <= 0 and 1 or 0)
[3/1/2021 9:30:32] doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Auto Loot Gold Colleting "..(getPlayerStorageValue(cid, info.Storages[2]) > 0 and "Activated" or "disabled")..".") return true
[3/1/2021 9:30:32] elseif isInArray({"deposito","bank","gbank","deposit","autodeposit"}, param) then
[3/1/2021 9:30:32] setPlayerStorageValue(cid, info.Storages[4], getPlayerStorageValue(cid, info.Storages[4]) <= 0 and 1 or 0)
[3/1/2021 9:30:32] doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] Automatic Gold Bank "..(getPlayerStorageValue(cid, info.Storages[4]) > 0 and "Activated" or "disabled")..".") return true
[3/1/2021 9:30:32] end
[3/1/2021 9:30:32] local item = ExistItemByName(tostring(param))
[3/1/2021 9:30:32] if not item then
[3/1/2021 9:30:32] doPlayerSendCancel(cid, "This item does not exist.") return true
[3/1/2021 9:30:32] end
[3/1/2021 9:30:32] local item = getItemIdByName(tostring(param))
[3/1/2021 9:30:32] local var = isInTable(cid, item)
[3/1/2021 9:30:32] if isInArray(info.Money_ids, item) then
[3/1/2021 9:30:32] doPlayerSendTextMessage(cid, MESSAGE_FIRST, "Enter !autoloot money to add money in your list!") return true
[3/1/2021 9:30:32] elseif isInArray(info.BlockItemsList, item) then
[3/1/2021 9:30:32] doPlayerSendCancel(cid, "You can not add this item in the list!") return true
[3/1/2021 9:30:32] elseif not var and #getItensFromAutoloot(cid) >= slots then
[3/1/2021 9:30:32] doPlayerSendCancel(cid, "max "..slots.." from auto loot") return true
[3/1/2021 9:30:32] elseif getPlayerStorageValue(cid, info.Storages[7]) - os.time() > 0 then
[3/1/2021 9:30:32] doPlayerSendCancel(cid, "Wait a second to use this command again.") return true
[3/1/2021 9:30:32] end
[3/1/2021 9:30:32] if not var then
[3/1/2021 9:30:32] doAddItemFromAutoloot(cid, item)
[3/1/2021 9:30:32] else
[3/1/2021 9:30:32] doremoveItemFromAutoloot(cid, item)
[3/1/2021 9:30:32] end
[3/1/2021 9:30:32] setPlayerStorageValue(cid, info.Storages[7], os.time()+info.Talkaction_delay)
[3/1/2021 9:30:32] 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, please wait 5 seconds to save the directory.")
[3/1/2021 9:30:32] return true
[3/1/2021 9:30:32] Description:
[3/1/2021 9:30:32] [string "info = {..."]:85: attempt to call global 'doPlayerPopupFYI' (a nil value)

 

Você tem o código disponível? Se tiver publique-o aqui: 

<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Perfect Auto Loot" version="1.0" author="Vodkart" contact="none.com" enabled="yes">
<config name="Loot_func"><![CDATA[

info = {
    directory = "data/logs/autoloot",
    Warn_Bp_Slots = 5, -- quando tiver 5 ou menos slots na BP vai avisar o jogador
    Talkaction_delay = 3, -- em segundos // delay para remover e adicionar item
    BlockMonsters = {},
    BlockItemsList = {2123,2515},
    Money_ids = {2148, 2152, 2160}, -- id das moedas do ot
    Max_Slots = {free = 20, premium = 20},
    Storages = {988801, 988802, 988803, 988804, 988805, 988806, 988807}
}

Color_Loot = {
           [0] = {MESSAGE_EVENT_ORANGE, "Orange"},
           [1] = {MESSAGE_STATUS_CONSOLE_BLUE, "Blue"},
           [2] = {MESSAGE_INFO_DESCR, "Green"},
           [3] = {MESSAGE_STATUS_CONSOLE_RED, "Red"},
           [4] = {MESSAGE_STATUS_SMALL, "White"}
}

function getPlayerColorLootMessage(cid)
    return getPlayerStorageValue(cid, info.Storages[5]) <= 0 and 0 or getPlayerStorageValue(cid, info.Storages[5])
end
function isInTable(cid, item)
    for _,i in pairs(getItensFromAutoloot(cid)) do
        if tonumber(i) == tonumber(item) then
            return true
        end
    end
    return false
end
function doremoveItemFromAutoloot(cid, itemid)
    local file, fileContent = io.open(info.directory.."/"..getCreatureName(cid)..".txt", 'r'),{}
    for line in file:lines() do
     if line ~= "" and tonumber(line) ~= tonumber(itemid) then
             fileContent[#fileContent + 1] = line
        end
    end
    io.close(file)
    file = io.open(info.directory.."/"..getCreatureName(cid)..".txt", 'w')
    for index, value in ipairs(fileContent) do
    file:write(value..'\n')
    end
    io.close(file)
end
function doAddItemFromAutoloot(cid, itemid)
         if not existsAutoloot(cid) then
            doCreateLootUserName(cid, itemid) return true
         end 
         local file = io.open(info.directory.."/"..getCreatureName(cid)..".txt", "a+")                            
         file:write('\n'..itemid)
         file:close()
end
function existsAutoloot(cid)
  local f = io.open(info.directory.."/"..getCreatureName(cid)..".txt", "rb")
  if f then f:close() end
  return f ~= nil
end
function doCreateLootUserName(cid, itemid)
    newFile = io.open(info.directory.."/"..getCreatureName(cid)..".txt", "w+" )
    newFile:write(itemid)
    newFile:close()
end
function getItensFromAutoloot(cid)
  if not existsAutoloot(cid) then return {} end
  lines = {}
  for line in io.lines(info.directory.."/"..getCreatureName(cid)..".txt") do
      if line ~= "" then
              lines[#lines + 1] = tonumber(line)
      end
  end
  return lines
end
function doCleanAutoloot(cid)
return os.remove(info.directory.."/"..getCreatureName(cid)..".txt")
end
function ShowItemsTabble(cid)
    local auto_list = getItensFromAutoloot(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!autoloot message --> To enable or disable message from Collect items.\n!autoloot color --> To change Color message in Auto Loot Collect.\n!autoloot warn --> To enable or disable message warning of "..info.Warn_Bp_Slots.." or less slots in the backpack.\n!autoloot deposit --> To enable or disable automatic money deposit at the bank.\n\n[+] Auto Loot Info [+]\n\nSystem: "..(getPlayerStorageValue(cid, info.Storages[1]) <= 0 and "Activated" or "Disabled")..".\nGold Collecting: "..(getPlayerStorageValue(cid, info.Storages[2]) > 0 and "Activated" or "Disabled")..".\nMessage: "..(getPlayerStorageValue(cid, info.Storages[6]) <= 0 and "Activated" or "Disabled")..".\nColor Message: "..Color_Loot[getPlayerColorLootMessage(cid)][2]..".\nWarn Backpack: "..(getPlayerStorageValue(cid, info.Storages[3]) <= 0 and "Activated" or "Disabled")..".\nAutomatic Gold Deposit: "..(getPlayerStorageValue(cid, info.Storages[4]) > 0 and "Activated" or "Disabled")..".\nTotal Bank Balance: ["..getPlayerBalance(cid).."]\nMaximum Slots: ["..#auto_list.."/"..(isPremium(cid) and info.Max_Slots.premium or info.Max_Slots.free).."]\n\n[+] Auto Loot Slots [+]\n\n"
    if #auto_list > 0 then
        for i = 1, #auto_list do
            n = n + 1
            str = str.."Slot "..n.." - "..getItemNameById(auto_list[i]).."\n"
        end
    end
    return doPlayerPopupFYI(cid, str)
end
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
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
function AutomaticDeposit(cid, item, n)
    local deposit = item == tonumber(2160) and (n*10000) or tonumber(item) == 2152 and (n*100) or (n)
    return doPlayerDepositMoney(cid, deposit)
end
function getAllContainerFree(container) -- by vodka
    local containers,soma = {},0
    for i = 0, getContainerSize(container)-1 do
        local item = getContainerItem(container, i)
        if isContainer(item.uid) then
            table.insert(containers, item.uid)
        end
    end
    for _, check in pairs(containers) do
        soma = soma + getContainerSlotsFree(check)    
    end
    return (soma + getContainerSlotsFree(container))
end
function getContainerSlotsFree(container) -- by vodka
         return getContainerCap(container)-getContainerSize(container)
end
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
function corpseRetireItems(cid, pos)
    local check, slots = false, 0
    for i = 0, 255 do
        pos.stackpos = i
        if getThingFromPos(pos).uid > 0 and isContainer(getThingFromPos(pos).uid) then
            corpse = getThingFromPos(pos)
            check = true 
            break
        end
    end
    if check == true then
        local str, id_list = "", getItensFromAutoloot(cid)
        for _, item in pairs(getContainerItems(corpse)) do
            local id = item.itemid
            if #id_list > 0 and isInArray(id_list, id) or getPlayerStorageValue(cid, info.Storages[2]) > 0 and isInArray(info.Money_ids, id) then
                local amount = isItemStackable(id) and item.type or 1
                local total_cap = getItemWeightById(id, amount)
                if getPlayerSlotItem(cid, 3).itemid ~= 0 then
                    slots = getAllContainerFree(getPlayerSlotItem(cid, 3).uid)
                end
                if slots > 0 and getPlayerFreeCap(cid) >= total_cap then
                    str = str.." " .. getItemInfoLoot(id, amount)
                    if isItemStackable(id) then
                        doPlayerAddItemStackable(cid, id, amount)
                        if isInArray(info.Money_ids, id) and getPlayerStorageValue(cid, info.Storages[4]) > 0 then
                            AutomaticDeposit(cid, id, amount)
                        end
                    else
                        doPlayerAddItem(cid, id)
                    end 
                    doRemoveItem(item.uid)    
                end
            end
        end
        if str ~= "" and getPlayerStorageValue(cid, info.Storages[6]) <= 0 then 
            doPlayerSendTextMessage(cid, Color_Loot[getPlayerColorLootMessage(cid)][1],"[Auto Loot Collect]:"..string.sub(str, 1, -2)..".") 
        end
        if getPlayerStorageValue(cid, info.Storages[3]) <= 0 and slots > 0 and slots <= info.Warn_Bp_Slots then
            doPlayerSendTextMessage(cid,18, "[Auto Loot Warn] You only have "..slots.." slots free in your backpack!") 
        end
    end
end
function ExistItemByName(name) -- by vodka
    local items = io.open("data/items/items.xml", "r"):read("*all")
    local get = items:lower():match('name="' .. name:lower() ..'"')
    if get == nil or get == "" then
        return false
    end
return true
end
function getItemInfoLoot(id, amount)
    local info = getItemInfo(id)
    return isItemStackable(id) and amount.." "..(amount > 1 and info.plural or info.name).."," or info.article.." " .. info.name ..","
end
]]></config>
<event type="login" name="LootLogin" event="script"><![CDATA[
domodlib('Loot_func')
function onLogin(cid)
    registerCreatureEvent(cid, "LootEventKIll")
    if isPremium(cid) and getPlayerStorageValue(cid, 853608) <= 0 then
        setPlayerStorageValue(cid, 853608, 1)
    elseif getPlayerStorageValue(cid, 853608) > 0 and not isPremium(cid) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[Auto Loot] You premium is Over, Start a new list!")
        setPlayerStorageValue(cid, 853608, -1)
        doCleanAutoloot(cid)
    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 getPlayerStorageValue(cid, info.Storages[1]) <= 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
    if existsAutoloot(cid) then doCleanAutoloot(cid) end
    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[1], getPlayerStorageValue(cid, info.Storages[1]) <= 0 and 1 or 0)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Auto Loot "..(getPlayerStorageValue(cid, info.Storages[1]) > 0 and "Stopped" or "Started")..".") return true
elseif isInArray({"warn","aviso"}, 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 Backpack Warn "..(getPlayerStorageValue(cid, info.Storages[3]) > 0 and "disabled" or "Activated")..".") return true
elseif isInArray({"mensagem","message","mensagen","msg"}, param) then
    setPlayerStorageValue(cid, info.Storages[6], getPlayerStorageValue(cid, info.Storages[6]) <= 0 and 1 or 0)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Auto Loot Message "..(getPlayerStorageValue(cid, info.Storages[6]) > 0 and "disabled" or "Activated")..".") return true
elseif isInArray({"cor","color","type"}, param) then
    setPlayerStorageValue(cid, info.Storages[5], getPlayerColorLootMessage(cid) == #Color_Loot and 0 or getPlayerColorLootMessage(cid)+1)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Auto Loot Message Color Changed to "..Color_Loot[getPlayerColorLootMessage(cid)][2]..".") 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
elseif isInArray({"deposito","bank","gbank","deposit","autodeposit"}, param) then
    setPlayerStorageValue(cid, info.Storages[4], getPlayerStorageValue(cid, info.Storages[4]) <= 0 and 1 or 0)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] Automatic Gold Bank "..(getPlayerStorageValue(cid, info.Storages[4]) > 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(info.Money_ids, item) then 
    doPlayerSendTextMessage(cid, MESSAGE_FIRST, "Enter !autoloot money to add money in your list!") return true    
elseif isInArray(info.BlockItemsList, item) then
    doPlayerSendCancel(cid, "You can not add this item in the list!") return true
elseif not var and #getItensFromAutoloot(cid) >= slots then
    doPlayerSendCancel(cid, "max "..slots.." from auto loot") return true
elseif getPlayerStorageValue(cid, info.Storages[7]) - os.time() > 0 then
        doPlayerSendCancel(cid, "Wait a second to use this command again.") return true
end
if not var then
    doAddItemFromAutoloot(cid, item)
else
    doremoveItemFromAutoloot(cid, item)
end
setPlayerStorageValue(cid, info.Storages[7], os.time()+info.Talkaction_delay)
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, please wait 5 seconds to save the directory.")
return true]]></talkaction>
</mod> 

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

autoloot.thumb.JPG.d603ee933c22ef09be68ac150845c8d5.JPG

 

 

Link para o post
Compartilhar em outros sites

Consegui fazer funcionar. Nessa versão não existe a janela For Your Information (FYI), então o código foi alterado para um texto comum:

 

Trocado

return doPlayerPopupFYI(cid, str)

Para:

doShowTextDialog(cid, 1961, str)

 

Link para o post
Compartilhar em outros sites

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 cloudrun2023
      CloudRun - Sua Melhor Escolha para Hospedagem de OTServer!
      Você está procurando a solução definitiva para hospedar seu OTServer com desempenho imbatível e segurança inigualável? Não procure mais! Apresentamos a CloudRun, sua parceira confiável em serviços de hospedagem na nuvem.
       
      Recursos Exclusivos - Proteção DDoS Avançada:
      Mantenha seu OTServer online e seguro com nossa robusta proteção DDoS, garantindo uma experiência de jogo ininterrupta para seus jogadores.
       
      Servidores Ryzen 7 Poderosos: Desfrute do poder de processamento superior dos servidores Ryzen 7 para garantir um desempenho excepcional do seu OTServer. Velocidade e estabilidade garantidas!
       
      Armazenamento NVMe de Alta Velocidade:
      Reduza o tempo de carregamento do jogo com nosso armazenamento NVMe ultrarrápido. Seus jogadores vão adorar a rapidez com que podem explorar o mundo do seu OTServer.
       
      Uplink de até 1GB:
      Oferecemos uma conexão de alta velocidade com até 1GB de largura de banda, garantindo uma experiência de jogo suave e livre de lag para todos os seus jogadores, mesmo nos momentos de pico.
       
      Suporte 24 Horas:
      Estamos sempre aqui para você! Nossa equipe de suporte está disponível 24 horas por dia, 7 dias por semana, para resolver qualquer problema ou responder a qualquer pergunta que você possa ter. Sua satisfação é a nossa prioridade.
       
      Fácil e Rápido de Começar:
      Configurar seu OTServer na CloudRun é simples e rápido. Concentre-se no desenvolvimento do seu jogo enquanto cuidamos da hospedagem.
       
      Entre em Contato Agora!
      Website: https://central.cloudrun.com.br/index.php?rp=/store/cloud-ryzen-brasil
      Email: [email protected]
      Telefone: (47) 99902-5147

      Não comprometa a qualidade da hospedagem do seu OTServer. Escolha a CloudRun e ofereça aos seus jogadores a melhor experiência de jogo possível. Visite nosso site hoje mesmo para conhecer nossos planos e começar!
       
      https://central.cloudrun.com.br/index.php?rp=/store/cloud-ryzen-brasil
       
      CloudRun - Onde a Velocidade Encontra a Confiabilidade!
       

    • Por FeeTads
      SALVE rapaziada do TK, esses dias vim pensando em novos scripts pro meu OT, e em um deles eu precisava que determinada area não contasse frag pro player que matasse outros, PORÉM eu precisava que os players que morressem nessa area ainda assim tivessem as penalidades da sua morte, procurei por ai, achei alguns scripts que apenas tiravam o SKULL e não realmente o FRAG do player.

      **script atualizado 22/10/2023** - melhorado e otimizado, levei o script pra puxar as infos por .lua / creatureScripts

      vou disponibilizar o code aqui, e o que fazer pra determinada area não contar frag.

      SOURCE OTX 2 / TFS 0.x, Funciona em TFS 1.x mudando as tags e ajeitando as sintaxes.

      vá em creatureevent.cpp

      procure por:
      else if(type == "preparedeath") _type = CREATURE_EVENT_PREPAREDEATH;
      Adiciona abaixo:
      else if(type == "nocountfrag") _type = CREATURE_EVENT_NOCOUNTFRAG;

      procure por:
      case CREATURE_EVENT_PREPAREDEATH: return "onPrepareDeath";  
      Adicione abaixo: 
      case CREATURE_EVENT_NOCOUNTFRAG: return "noCountFragArea";

      procure por:
      case CREATURE_EVENT_PREPAREDEATH: return "cid, deathList";
      Adicione abaixo:
      case CREATURE_EVENT_NOCOUNTFRAG: return "cid, target";

      agora no mesmo arquivo, vá até o final do arquivo e adicione essa função:
      uint32_t CreatureEvent::executeNoCountFragArea(Creature* creature, Creature* target) { //noCountFragArea(cid, target) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(creature->getPosition()); std::ostringstream scriptstream; scriptstream << "local cid = " << env->addThing(creature) << std::endl; scriptstream << "local target = " << env->addThing(target) << std::endl; if(m_scriptData) scriptstream << *m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ std::ostringstream desc; desc << creature->getName(); env->setEvent(desc.str()); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(creature->getPosition()); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(creature)); lua_pushnumber(L, env->addThing(target)); bool result = m_interface->callFunction(2); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::noCountFragArea] Call stack overflow." << std::endl; return 0; } }

      agora vá em creatureevent.h

      procure por:
      CREATURE_EVENT_PREPAREDEATH
      adicione abaixo:
      CREATURE_EVENT_NOCOUNTFRAG

      procure por:
      uint32_t executePrepareDeath(Creature* creature, DeathList deathList);
      Adicione abaixo:
      uint32_t executeNoCountFragArea(Creature* creature, Creature* target);

      agora vá em player.cpp

      procure por:
      bool Player::onKilledCreature(Creature* target, DeathEntry& entry)
      abaixo de:
      War_t enemy; if(targetPlayer->getEnemy(this, enemy)) { if(entry.isLast()) IOGuild::getInstance()->updateWar(enemy); entry.setWar(enemy); }
      Adicione o seguinte código:
      if (targetPlayer){ CreatureEventList killEvents = getCreatureEvents(CREATURE_EVENT_NOCOUNTFRAG); for (const auto &event : killEvents) { if (!event->executeNoCountFragArea(this, target)) { return true; } } }

      //

      Feito isso, tudo completo na sua source, agora é necessário adicionar o creaturescript dentro do servidor

      vá até creaturescripts/scripts
      crie um arquivo chamado, "noCountFragInArea.lua"
      e dentro dele cole o código:
       
      --[[ script feito por feetads / TibiaKing ]]-- --[[ discord: feetads / FeeTads#0246 ]]-- -- Add positions here for which you do not want to count frags local areas = { [1] = {from = {x = 91, y = 122, z = 7}, to = {x = 98, y = 127, z = 7}}, -- from = area superior esquerda / to = area inferior direita (formando um quadrado) } local onlyKillerInArea = false -- only killer need to be in area? function noCountFragArea(cid, target) if not isCreature(cid) or not isCreature(target) then return true end local posKiller = getPlayerPosition(cid) local posTarget = getPlayerPosition(target) for i = 1, #areas do local area = areas[i] if isInArea(posKiller, area.from, area.to) then if onlyKillerInArea then return false elseif isInArea(posTarget, area.from, area.to) then return false end end end return true end
      agora em creaturescripts.xml
      <event type="nocountfrag" name="fragarea" event="script" value="noCountFragInArea.lua"/>
      agora em creaturescripts/scripts/login.lua
       procure por OU semelhante a esse:
      registerCreatureEvent(cid, "AdvanceSave")
      e abaixo adicione:
      registerCreatureEvent(cid, "fragarea")

      //


      Agora tudo certo, quando quiser adiciona uma area que não pega frag, vá até o script e apenas coloque a area, igual o demonstrado no script

      Exemplo:
      local areas = { [1] = {from = {x = 91, y = 122, z = 7}, to = {x = 98, y = 127, z = 7}}, [2] = {from = {x = 1000, y = 1000, z = 7}, to = {x = 1100, y = 1100, z = 7}}, }
      assim somente colocando a area no script e abrindo o server ou dando /reload, já funcionará a area como não pegar frag.
      Esse sistema pode ser bom pra areas de pvp ativo, onde você ainda quer que o player que morrer perca os atributos, como se fosse uma morte normal, porém não conta frag pra quem matar.
      Bom pra sistemas tipo castle 48h (guild war), onde há diversas mortes e risco de pegar red, atrapalhando a war.

      Façam bom proveito dos scripts, e deixem os créditos no script rsrs

      **Eu fiz as alterações e o simples código por isso vim disponibilizar, créditos meus**
    • Por Muvuka
      Abri canal a força creaturescript acho que funcione no creaturescript cria script creaturescript
       
      <channel id="9" name="HELP" logged="yes"/>
      <channel id="12" name="Report Bugs" logged="yes"/>
      <channel id="13" name="Loot" logged="yes"/>
      <channel id="14" name="Report Character Rules Tibia Rules" logged="yes"/>
      <channel id="15" name="Death Channel"/>
      <channel id="6548" name="DexSoft" level="1"/>
      <channel id="7" name="Reports" logged="yes"/>
       
      antes de 
              if(lastLogin > 0) then adicione isso:
                      doPlayerOpenChannel(cid, CHANNEL_HELP) doPlayerOpenChannel(cid, 1,  2, 3) = 1,2 ,3 Channels, entendeu? NÃO FUNCIONA EU QUERO UM MEIO DE ABRI SEM USA A SOURCE
       
      EU NÃO CONSEGUI ABRI EU NÃO TENHO SOURCE
       
       
    • Por bolachapancao
      Rapaziada seguinte preciso de um script que ao utilizar uma alavanca para até 4 jogadores.
      Os jogadores serão teleportados para hunt durante uma hora e depois de uma hora os jogadores serão teleportados de volta para o templo.
       
      Observação: caso o jogador morra ou saia da hunt o evento hunt é cancelado.

      Estou a base canary
      GitHub - opentibiabr/canary: Canary Server 13.x for OpenTibia community.
       
    • Por RAJADAO
      .Qual servidor ou website você utiliza como base? 
      Sabrehaven 8.0
      Qual o motivo deste tópico? 
      Ajuda com novos efeitos
       
      Olá amigos, gostaria de ajuda para introduzir os seguintes efeitos no meu servidor (usando o Sabrehaven 8.0 como base), adicionei algumas runas novas (avalanche, icicle, míssil sagrado, stoneshower & Thunderstorm) e alguns novos feitiços (exevo mas san, exori san, exori tera, exori frigo, exevo gran mas frigo, exevo gran mas tera, exevo tera hur, exevo frigo hur) mas nenhum dos efeitos dessas magias parece existir no servidor, alguém tem um link para um tutorial ou algo assim para que eu possa fazer isso funcionar?
      Desculpe pelo mau inglês, sou brasileiro.

      Obrigado!


      AVALANCHE RUNE id:3161 \/
      (COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_ICEAREA)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)

      STONESHOWER RUNE id:3175 \/
      (COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_STONES)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH)

      THUNDERSTORM RUNE id:3202 \/
      (COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_E NERGYHIT)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL)

      ICICLE RUNE id:3158 \/
      COMBAT_ICEDAMAGE
      CONST_ME_ICEAREA
      CONST_ANI_ICE

      SANTO MÍSSIL RUNA id:3182 \/
      (COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)

      CONST_ME_PLANTATTACK (exevo gran mas tera)
      CONST_ME_ICETORNADO (exevo gran mas frigo)
      CONST_ME_SMALLPLANTS (exevo tera hur)
      CONST_ME_ICEAREA (exevo frigo hur)
      CONST_ME_ICEATTACK (exori frigo)
      CONST_ME_CARNIPHILA (exori tera)

      EXORI SAN \/
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY)
      CONST_ME_HOLYDAM IDADE

      EXEVO MAS SAN \/
      CONST_ME_HOLYAREA
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo