Ir para conteúdo
  • Cadastre-se

Posts Recomendados

.Qual servidor ou website você utiliza como base? otx

 

Qual o motivo deste tópico? estou tentando implementar um sistema de task por client module no otc. Adicionei os modules no client, mas está ocorrendo um erro ao ler a lib da task, alguém poderia verificar pra mim e ver se tem algum erro?

 

 

 

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

 TABLE_RANKS_OTC = {
   [-1] = {"D"},
   [0] = {"D","C"},
   [1] = {"D","C","B"},
   [2] = {"D","C","B","A"},
   [3] = {"D","C","B","A","S"}
} 

TABLE_RANK_LEVEL = {
   ["D"] = {{1,49}, -1, points = 1},
   ["C"] = {{50,79}, 0, points = 25},
   ["B"] = {{80,129}, 1, points = 999},
   ["A"] = {{130,199}, 2, points = 999},
   ["S"] = {{200,math.huge}, 3, points = 999}
}      

TABLE_RANKS = {"D","C","B","A","S"}
TABLE_DELAY_SAMPLER = 59*10 -- 10 minutos

TABLE_TASKS = { 
  ["rat"]                 = {id = 0,  level = 01, count = 040, exp = 550,   point = 1, delay = (59*1), lookType = {327}, msg = "You can kill the boss Big Rat in the sewer of Goa Kingdom." },
  ["beggar"]              = {id = 1,  level = 01, count = 040, exp = 600,   point = 1, delay = (59*3), lookType = {256,153,273}},
  ["joker bee/god wind"]  = {id = 2,  level = 05, count = 070, exp = 900,   point = 3, delay = (59*3), lookType = {51,53}, msg = "You can kill the Amethite in one of the mountains of Goa Kingdom." },
  ["spider"]              = {id = 3,  level = 05, count = 080, exp = 1000,  point = 3, delay = (59*5), lookType = {276}},
  ["slug"]                = {id = 4,  level = 05, count = 080, exp = 1150,  point = 3, delay = (59*5), lookType = {34}},
  ["hedgehog"]            = {id = 5,  level = 05, count = 060, exp = 900,   point = 2, delay = (59*5), lookType = {283}}, 
  ["rotworm"]             = {id = 6,  level = 10, count = 080, exp = 1350,  point = 3, lookType = {287, 288}},
  ["rocky boar"]          = {id = 7,  level = 10, count = 100, exp = 1850,  point = 4, lookType = {302}, msg = "You can kill the Enraged Rocky Boar in one of the mountains of Goa Kingdom." },
  ["arboreal spectrum"]   = {id = 8,  level = 20, count = 150, exp = 4500,  point = 10, lookType = {322}}, 
  ["salamander"]          = {id = 9,  level = 20, count = 150, exp = 3000,  point = 9, lookType = {283}}, 
  ["slime"]               = {id = 10, level = 25, count = 070, exp = 3000,  point = 6, lookType = {357}, msg = "You can kill the Goome in the slime cave of Shell Town."},
  ["imp"]                 = {id = 11, level = 25, count = 070, exp = 3500,  point = 6, lookType = {317}, msg = "You can kill the Dharkos in the imp cave of Shell Town."},
  ["ladybug"]             = {id = 12, level = 15, count = 200, exp = 3100,  point = 8, lookType = {433}, msg = "You can kill the Cydaea in the ladybug mountain of Shell Town."},
  ["boar"]                = {id = 13, level = 25, count = 300, exp = 10000, point = 17, lookType = {291}, msg = "You can kill the Hunger in the florest of Orange Town."},
  ["crocodile"]           = {id = 14, level = 25, count = 300, exp = 10000, point = 17, lookType = {309}},
  ["crypt shambler"]      = {id = 15, level = 25, count = 200, exp = 12000, point = 19, lookType = {414}}, 
  ["dwarves"]             = {id = 16, level = 20, count = 350, exp = 8500,  point = 14, lookType = {447, 448, 449}, msg = "You can kill the Grief in the mine of Orange Town."},
  ["giant lobster"]       = {id = 17, level = 30, count = 200, exp = 14500, point = 22, delay = (59*15), lookType = {102}, msg = "You can kill the Yaomo in a cave of Syrup Village."},
  ["spikeshell tortoise"] = {id = 18, level = 30, count = 200, exp = 17000, point = 24, delay = (59*15), lookType = {415}}, 
  ["coryms"]              = {id = 19, level = 25, count = 500, exp = 15000, point = 30, lookType = {451, 452, 453}},
  ["tremor"]              = {id = 20, level = 45, count = 150, exp = 18000, point = 35, delay = (59*20), lookType = {436}, msg = "You can kill the Laken in the rock mountain of Syrup Village."},
  ["wyvern"]              = {id = 21, level = 30, count = 150, exp = 15500, point = 26, delay = (59*20), lookType = {361}, msg = "You can kill the Toxic Fiend in the rock mountain of Cocoyashi Village."},
  ["dragon"]              = {id = 22, level = 50, count = 300, exp = 23500, point = 1, delay = (59*30), lookType = {313,459}},
  ["gosme"]               = {id = 23, level = 10, count = 300, exp = 5600,  point = 9, lookType = {83}}, 
  ["cobra"]               = {id = 24, level = 15, count = 150, exp = 3150,  point = 9, lookType = {81}},
  ["tortoise"]            = {id = 25, level = 20, count = 200, exp = 3500,  point = 10, lookType = {461}, msg = "You can kill the boss Dahu below the mountain of Syrup Village." },
  ["poisonous toad"]      = {id = 26, level = 20, count = 200, exp = 4500,  point = 13, lookType = {297}},
  ["orcs"]                = {id = 27, level = 20, count = 250, exp = 4500,  point = 14, lookType = {380, 381, 379, 382, 386}},
  ["buffalo"]             = {id = 28, level = 25, count = 300, exp = 10000, point = 17, lookType = {80}},
  ["grotesque"]           = {id = 29, level = 25, count = 200, exp = 14500, point = 22, lookType = {419}, msg = "You can kill the boss Greek in the undeads of Orange Town." },
  ["scarlet widow"]       = {id = 30, level = 30, count = 150, exp = 14500, point = 28, delay = (59*20), lookType = {315}},
  ["fierce crab"]         = {id = 31, level = 40, count = 200, exp = 21000, point = 35, delay = (59*20), lookType = {416}, msg = "You can kill the boss Karkinos in the Fierce Crab cave of Syrup Village." },
  ["venom spider"]        = {id = 32, level = 45, count = 250, exp = 18000, point = 33, delay = (59*20), lookType = {465}},
  ["necromancer"]         = {id = 33, level = 50, count = 500, exp = 25000, point = 50, delay = (59*30), lookType = {418}, msg = "You can kill the boss Mergos in the undeads of Orange Town." },
  ["giant spider"]        = {id = 34, level = 50, count = 200, exp = 23000, point = 1, delay = (59*30), lookType = {316}, msg = "You can kill the boss Freja the Queen in the Giant Spider cave of Loguetown." },
  ["bonebeast"]           = {id = 35, level = 50, count = 100, exp = 15000, point = 1, delay = (59*30), lookType = {90},  msg = "You can kill the boss Tibicena in the undeads cave of Orange Town." },
  ["trolls"]              = {id = 36, level = 50, count = 500, exp = 24000, point = 1, delay = (59*30), lookType = {352, 353, 354, 355}, msg = "You can kill the boss Kappa in the trolls cave of Loguetown." },
  ["swamp thing"]         = {id = 37, level = 50, count = 225, exp = 22000, point = 1, delay = (59*30), lookType = {483}},
  ["swamp monster"]       = {id = 38, level = 55, count = 225, exp = 23500, point = 1, delay = (59*30), lookType = {484}, msg = "You can kill the boss Amygdala in the swamp mountain of Loguetown." },
  ["fishmans"]            = {id = 39, level = 55, count = 500, exp = 26000, point = 1, delay = (59*30), lookType = {408, 405, 404, 406, 407}, msg = "You can kill the boss Rom the Fishman in the fishman cave of Cocoyashi Village." },
  ["ducksheep"]           = {id = 40, level = 60, count = 150, exp = 17000, point = 1, delay = (59*30), lookType = {400}, msg = "You can kill the boss Orthrus in the Island of Rare Animals." },
  ["zebird"]              = {id = 41, level = 60, count = 150, exp = 20500, point = 1, delay = (59*30), lookType = {395}},
  ["rhinoroo"]            = {id = 42, level = 60, count = 300, exp = 26000, point = 1, delay = (59*30), lookType = {402}, msg = "You can kill the boss Panes in the Rhinoroo cave of the Island of Rare Animals." },  
}

TABLE_TASKS_MONSTERS = { -- NOME DOS BIXOS MINUSCULO !!!!!!!!!!!!!
  ["shabby beggar"]      = "beggar",
  ["crazed beggar"]      = "beggar",
  ["god wind"]           = "joker bee/god wind",
  ["joker bee"]          = "joker bee/god wind",
  ["big rotworm"]        = "rotworm",
  ["dwarf miner"]        = "dwarves",
  ["dwarf warrior"]      = "dwarves",
  ["dwarf brave"]        = "dwarves",
  ["corym charlatan"]    = "coryms",
  ["corym skirmisher"]   = "coryms",
  ["corym vanguard"]     = "coryms",
  ["dragon"]             = "dragon",
  ["dirt dragon"]        = "dragon",
  ["orc"]                = "orcs", 
  ["orc warrior"]        = "orcs",
  ["orc creeper"]        = "orcs",
  ["orc shaman"]         = "orcs",
  ["orc rider"]          = "orcs",
  ["troll"]              = "trolls",
  ["troll warrior"]      = "trolls",
  ["troll berserker"]    = "trolls",
  ["troll commander"]    = "trolls",
  ["fishman punk"]       = "fishmans",
  ["fishman bandit"]     = "fishmans",
  ["fishman thug"]       = "fishmans",
  ["sabresword fishman"] = "fishmans",
  ["fishman lancer"]     = "fishmans",
}

TABLE_TASK_UNDEAD_SOPHIA = { -- ['nome do bixo minusculo'] = pontos_que_da_na_task_da_sophia, 
  ['vielmond skeleton']      = 1,
  ['vielmond ghost']         = 1,
  ['vielmond shambler']      = 1,
  ['vielmond raise']         = 1,
  ['vielmond grotesque']     = 1,
}

TABLE_TASK_BUSINESS_AROUND_THE_WORLD = {
  ['troll']           = {count = 30, storage_multiplier = 1000000},
  ['troll warrior']   = {count = 20, storage_multiplier = 10000},
  ['troll berserker'] = {count = 10, storage_multiplier = 100},
  ['troll commander'] = {count =  2, storage_multiplier = 1},
}
TOTAL_VALUE_FROM_TASK_BUSINESS_AROUND_THE_WORLD = table.foldr(TABLE_TASK_BUSINESS_AROUND_THE_WORLD, 0, function (acc, task) return acc + task.count * task.storage_multiplier end)

TABLE_TASK_SAVING_BUGGY_BIRDS = {
  ['baby bird']  = {count = 250, storage_multiplier = 1},
  ['big bird']   = {count =  80, storage_multiplier = 1000},
}
TOTAL_VALUE_FROM_TASK_SAVING_BUGGY_BIRDS = table.foldr(TABLE_TASK_SAVING_BUGGY_BIRDS, 0, function (acc, task) return acc + task.count * task.storage_multiplier end)
-------------------------------------------------------------------------------- 
task = {
  avaiable = function(cid, taskname)
    return true      
  end, 

  getStorage = function(index, offset)  
    return STORAGE_TASK.START + (index * STORAGE_TASK.CONST.OFFSET_COUNT) + offset
  end,

  finished = function(cid, taskname) -- se matou all e ja reportou no npc   
    return getPlayerStorageValue(cid, task.getStorage(TABLE_TASKS[taskname].id, STORAGE_TASK.CONST.OFFSET.FINISHED)) == 1
  end,      

  kills = function(cid, taskname) -- quantidade de vezes que ja matou determinado bixo
    return getPlayerStorageValue(cid, task.getStorage(TABLE_TASKS[taskname].id, STORAGE_TASK.CONST.OFFSET.KILLS))
  end,
  
  killedNeededCount = function(cid, taskname)
    return task.kills(cid, taskname) >= TABLE_TASKS[taskname].count
  end,
  
  slot = function(cid, number) -- tem no maximo "STORAGE_TASK.CONST.MAX_TASKS_TOGETHER" de slots
    if number > STORAGE_TASK.CONST.MAX_TASKS_TOGETHER then
      print("[ERROR] lib_Tasks.lua excedeu o limite de slots!!!!!!!!!!!!!!!!!!!!!!")
    end         
    return getPlayerStorageValue(cid, STORAGE_TASK.ACTIVE_NAMES + number) 
  end,                        
  
  doing = function(cid, taskname) -- ve se essa task ja nao esta sendo feita por mim
    for i = 1, STORAGE_TASK.CONST.MAX_TASKS_TOGETHER do
      if task.slot(cid, i) == taskname then
        return true
      end
    end
    return false -- nao esta fazendo esta task  
  end, 
  
  doEraseSlot = function(cid, taskname)
    for i = 1, STORAGE_TASK.CONST.MAX_TASKS_TOGETHER do
      if task.slot(cid, i) == taskname then
        setPlayerStorageValue(cid, STORAGE_TASK.ACTIVE_NAMES + i, "")
        break
      end
    end
  end,
  
  doSaveSlot = function(cid, taskname)
    if task.doing(cid, taskname) then -- ja esta fazendo essa task em algum slot 
      return false
    end
    for i = 1, STORAGE_TASK.CONST.MAX_TASKS_TOGETHER do
      if not TABLE_TASKS[ task.slot(cid, i) ]  then -- linha vazia   
        setPlayerStorageValue(cid, STORAGE_TASK.ACTIVE_NAMES + i, taskname)
        return true  
      end   
    end
    
    return false -- nao encontrou nenhum slot disponivel 
  end,
  
  doSetKills = function(cid, taskname, count) -- define a quantidade de monstros matados em determinado slot 
    setPlayerStorageValue(cid, task.getStorage(TABLE_TASKS[taskname].id, STORAGE_TASK.CONST.OFFSET.KILLS), count)  
    task.doParseTask(cid, taskname)
  end,  
  
  doSetBossKill = function(cid, taskname, count)
    setPlayerStorageValue(cid, task.getStorage(TABLE_TASKS[taskname].id, STORAGE_TASK.CONST.OFFSET.KILLED_BOSS), count)
  end,
  
  doSetFinished = function(cid, taskname, count) -- define se ja terminou (-1 = nunca tentou, 0 = não terminou, 1 = terminou)
    setPlayerStorageValue(cid, task.getStorage(TABLE_TASKS[taskname].id, STORAGE_TASK.CONST.OFFSET.FINISHED), count)
  end,
  
  doParseTask = function(cid, taskname)
     local __buffer = {}                 
     local rank = ((getPlayerStorageValue(cid,STORAGE_TASK.VIEW) == -1) and "D" or getPlayerStorageValue(cid,STORAGE_TASK.VIEW))
     local avaiableTasks = getAvaiableTasks(cid)
     for creature, taskInfo in pairs(avaiableTasks) do
        if taskInfo.lookType then
           if TABLE_RANK_LEVEL[rank] then
              if getPlayerStorageValue(cid, STORAGE_TASK.RANK) >= TABLE_RANK_LEVEL[rank][2] then
                 if getPlayerLevel(cid) >= TABLE_RANK_LEVEL[rank][1][1] and taskInfo.level >= TABLE_RANK_LEVEL[rank][1][1] and taskInfo.level <= TABLE_RANK_LEVEL[rank][1][2] then      
                    if creature == taskname then
                       __buffer[1] = {}    
                       __buffer[1].id = creature                               
                       __buffer[1].level = taskInfo.level                                               
                       __buffer[1].lookType = taskInfo.lookType
                       __buffer[1].reward = taskInfo.exp.." Experience and "..taskInfo.point.." Point(s)."                        
                       __buffer[1].doing = task.doing(cid, creature)
                       if taskInfo.msg then
                          __buffer[1].msg = taskInfo.msg     
                       end
                       __buffer[1].count = taskInfo.count 
                       __buffer[1].kills = (task.kills(cid, creature) == -1) and 0 or task.kills(cid, creature)
                       break
                    end
                 end
              end
           end
        end
     end
     doSendPlayerExtendedOpcode(cid, GameServerOpcodes.TaskModule, table.tostring(__buffer))
  end,
  
  doParseTasks = function(cid)   
     function compare(a,b)
        return a.level < b.level
     end
     local __buffer = {}  
     local __resetBuffer = {}              
     local rank = ((getPlayerStorageValue(cid,STORAGE_TASK.VIEW) == -1) and "D" or getPlayerStorageValue(cid,STORAGE_TASK.VIEW))
     local avaiableTasks = getAvaiableTasks(cid)
     for creature, taskInfo in pairs(avaiableTasks) do
        if taskInfo.lookType then
           if TABLE_RANK_LEVEL[rank] then
              if getPlayerStorageValue(cid, STORAGE_TASK.RANK) >= TABLE_RANK_LEVEL[rank][2] then
                 if getPlayerLevel(cid) >= TABLE_RANK_LEVEL[rank][1][1] and taskInfo.level >= TABLE_RANK_LEVEL[rank][1][1] and taskInfo.level <= TABLE_RANK_LEVEL[rank][1][2] then  
                    local bufferid = #__buffer + 1
                    __buffer[bufferid] = {}    
                    __buffer[bufferid].id = creature                               
                    __buffer[bufferid].level = taskInfo.level                                               
                    __buffer[bufferid].lookType = taskInfo.lookType
                    __buffer[bufferid].reward = taskInfo.exp.." Experience and "..taskInfo.point.." Point(s)."                        
                    __buffer[bufferid].doing = task.doing(cid, creature)
                    if taskInfo.msg then
                       __buffer[bufferid].msg = taskInfo.msg     
                    end
                    __buffer[bufferid].count = taskInfo.count 
                    __buffer[bufferid].kills = (task.kills(cid, creature) == -1) and 0 or task.kills(cid, creature)
                    table.sort(__buffer, compare)
                 end
              end
           end
        end                                                  
     end                             
     doSendPlayerExtendedOpcode(cid, GameServerOpcodes.TaskModule, "[resetList]")
     doSendPlayerExtendedOpcode(cid, GameServerOpcodes.TaskModule, table.tostring(__buffer))
  end,
  
  doParsePlayer = function(cid)
     local ranks = TABLE_RANKS_OTC[getPlayerStorageValue(cid, STORAGE_TASK.RANK)]
     local __buffer = {}
     __buffer["[pointsHave]"] = getPlayerStorageValue(cid, STORAGE_TASK.POINTS)       
     if ranks then
        __buffer["[unlockedRanks]"] = ranks
     end                    
     doSendPlayerExtendedOpcode(cid, GameServerOpcodes.TaskModule, table.tostring(__buffer))
  end,
  
  doCancel = function(cid, taskname) -- cancelar slot de task (ou por cancelar ou quando termina mesmo) 
     if task.doing(cid, taskname) then    
        task.doEraseSlot(cid, taskname)
        task.doSetBossKill(cid, taskname, 0)         
        task.doSetFinished(cid, taskname, 0)  
        task.doSetKills(cid, taskname, 0)  
        return true
     end
     return false     
  end,
  
  doStart = function(cid, taskname) -- se o storage == 0, entao ele ja comecou essa task alguma vez na vida 
    task.doSetFinished(cid, taskname, 0) 
    setPlayerStorageValue(cid, STORAGE_TASK.APPEAR_QUESTLOG, 0) -- aparecer na quest log    
    task.doSetKills(cid, taskname, 0)
  end,
  
  doComplete = function(cid, taskname)  
    if not TABLE_TASKS[taskname].delay then
       TABLE_TASKS[taskname].delay = TABLE_DELAY_SAMPLER
    end 
    doPlayerAddExp(cid, TABLE_TASKS[taskname].exp)
    setPlayerStorageValue(cid, task.getStorage(TABLE_TASKS[taskname].id, STORAGE_TASK.CONST.OFFSET.DELAY), os.time() + TABLE_TASKS[taskname].delay)
    setPlayerStorageValue(cid, STORAGE_TASK.POINTS, TABLE_TASKS[taskname].point + getPlayerStorageValue(cid, STORAGE_TASK.POINTS))
    if TABLE_TASKS[taskname].msg ~= nil then
       doPlayerSendTextMessage(cid, 20, TABLE_TASKS[taskname].msg)
    end           
    task.doCancel(cid, taskname)     
    task.doSetFinished(cid, taskname, 1)
    task.doParsePlayer(cid)   
  end,
  
  getTaskTableByTarget = function(cid, targetname)
    --for index, v in pairs(TABLE_TASKS) do
    --  if isInArray(v.creatures, targetname) then
    --    return v
    --  end
    --end    
    --return nil -- daqui pra cima era o metodo antigo 
    if TABLE_TASKS[targetname] then
      return targetname, TABLE_TASKS[targetname] 
    elseif TABLE_TASKS_MONSTERS[targetname] then -- da mesma especie mas tem nome diferente Ex: dragon lord
      return TABLE_TASKS_MONSTERS[targetname], TABLE_TASKS[ TABLE_TASKS_MONSTERS[targetname] ]
    end
    return nil
  end,
  
}
--------------------------------------------------------------------------------

--[[ old 
function getAvaiableTasks(cid)
  local retorno = ""
  for index, v in pairs(TABLE_TASKS) do
    if task.avaiable(cid, index) then -- index de string 
      retorno = retorno .. "{" .. index .. "}, "
    end
  end
  return string.sub(retorno, 1, string.len(retorno)-2) -- pra retirar o ultimo caracter (virgula) da string
end       ]]


function getAvaiableTasks(cid)
  local retorno = {}
  for index, v in pairs(TABLE_TASKS) do
    if task.avaiable(cid, index) then -- index de string    
      retorno[index] = v
    end
  end
  return retorno
end 
              
function getDoingTasks(cid)
  local retorno = ""
  for indexName, v in pairs(TABLE_TASKS) do
    if task.doing(cid, indexName) then -- index de string 
      retorno = retorno .. "{" .. indexName .. "}, "
    end
  end
  return string.sub(retorno, 1, string.len(retorno)-2) -- pra retirar o ultimo caracter (virgula) da string
end
--------------------------------------------------------------------------------
local function doGenerateTaskQuestLog()  
  local questxml = '  <quest name="Tasks" startstorageid="' .. STORAGE_TASK.APPEAR_QUESTLOG .. '" startstoragevalue="0" endstoragevalue="1"> \n' 
  for name, task_line in pairs(TABLE_TASKS) do -- gerar cada quest log
    local storage = task.getStorage(task_line.id, STORAGE_TASK.CONST.OFFSET.FINISHED)
    questxml = questxml ..
               '      <mission name="' .. name .. '" storageid="' .. storage .. '" startvalue="0" endvalue="1"> \n' .. 
               '        <missionstate id="0" description="Kill ' .. task_line.count .. ' ' ..  name .. 's and report to take you prize."/> \n' .. 
               '      </mission> \n ' 
  end  
  questxml = questxml .. '  </quest>\n'
  local file = io.open("data\\XML\\quests.xml", "w")
  file:write(questxml)
  file:close()
end

--doGenerateTaskQuestLog()

 

 

Screenshot_17.png

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