Ir para conteúdo

maikons

Campones
  • Total de itens

    77
  • Registro em

  • Última visita

Histórico de Reputação

  1. Upvote
    maikons deu reputação a Night Wolf em [2016] Update - O Novo Xtibia #01/3   
    uma rodada pra geral no barzinho do Ékz por minha conta!
  2. Upvote
    maikons deu reputação a Night Wolf em O Novo Xtibia #02/3   
    nossa eu quase sangrei pelos olhos pra conseguir ler tudo isso (to com conjuntivite) mas valeu a pena kkk ficou muito boa essa atualização. Notável o trabalho que vc tem feito com o ékz, @Daniel. Sucesso pra nossa equipe!
  3. Upvote
    maikons deu reputação a Night Wolf em [OLDClient-DLL] OrochiElf   
    não é meu estilo de client, mas até q não ficou tão ruim ein
  4. Upvote
    maikons deu reputação a Night Wolf em spell onTagetTile   
    coloca local na frente do function spellCallback. Tá sendo uma função global e por isso tá conflitando.
  5. Upvote
    maikons deu reputação a Night Wolf em Porque ser ladrão não vale apena!   
    o cara tem 320 players no servidor dele e não te pagou... eu liberava no fórum o sistema

    obs: Tamo junto
     
  6. Upvote
    maikons deu reputação a Night Wolf em Alguma função   
    posso dar uma opinião? se vc vai usar roleta então provavelmente os itens são muito bem definidos, vc pode usar getTileItemById (pos, itemid) q nem o @Poccnn bem colocou.
    Pra mim é a função mais "confiável" de se usar, as outras vc vai ter que ficar checando possiveis bugs e falhas no sistema o tempo todo e isso acaba sendo mais pesado pro número de execuções do que a própria definição da função via source. Qualquer dúvida tamo aí
  7. Upvote
    maikons deu reputação a Night Wolf em Ajuda aumentar chances se o item for 8300   
    editei, desculpe não ter notado..
  8. Upvote
    maikons deu reputação a dalvorsn em Ajuda aumentar chances se o item for 8300   
    Voce pode fazer na mão o calculo, como o @Night Wolf fez. Porém se for usar em uma tabela muito grande isso pode ser bem massivo e desgastante.
    Para resolver tu pode fazer um algoritimo que leva como base a soma das rates, e vai somando-as até que se chegue no numero sorteado.
    Em lua quando se usa a função math.random() sem parametros ela retorna um numero flutuante de 0.0 a 1.0
     
    Genericamente poderia ser escrita uma função assim:
     
    function randomItemsTable(itemsTable) local total = 0 for _, it in ipairs(itemsTable) do total = total + it.rate end table.sort(itemsTable, function(a, b) return a.rate < b.rate end) local rand = math.random() local sum = 0 for _, it in ipairs(itemsTable) do sum = sum + it.rate/total if sum > rand then return it.id end endend  
    Exemplo de uso, com estatistica pra tu ver a precisão:
    function randomItemsTable(itemsTable) local total = 0 for _, it in ipairs(itemsTable) do total = total + it.rate end table.sort(itemsTable, function(a, b) return a.rate < b.rate end) local rand = math.random() local sum = 0 for _, it in ipairs(itemsTable) do sum = sum + it.rate/total if sum > rand then return it.id end endendlocal items = { {id = 50, rate = 1}; {id = 60, rate = 2}; {id = 51, rate = 1}; {id = 80, rate = 3}; {id = 123, rate = 8}}local results = {}for _, it in ipairs(items) do results[it.id] = 0endlocal tries = 500000math.randomseed(os.time())for i = 0, tries do id = randomItemsTable(items) results[id] = results[id] + 1endprint("Number of tries: ".. tries)for _, it in ipairs(items) do print(string.format("ID: %d\t\tRate: %d\t\tRate percent: %.2f%%\tSorted times: %d", it.id, it.rate, 100 * results[it.id]/tries, results[it.id]))end

  9. Upvote
    maikons deu reputação a Night Wolf em Ajuda aumentar chances se o item for 8300   
    --PERFECT UPGRADE SYSTEM UpgradeHandler = { nameLv = { [1] = "UNIQ", [2] = "RARE", [3] = "EPIC" }, levels = { [1] = {50, false, false}, [2] = {20, false, false}, [3] = {10, true, true} }, broadcast = 3, attributes = { ["attack"] = 3, ["defense"] = 2, ["armor"] = 1 }, message = { console = "Trying to refine %s to level +%s with %s%% success rate.", success = "You have upgraded %s to level +%s", fail = "You have failed in upgrade of %s to level +%s", downgrade = "The upgrade level of %s has downgraded to +%s", erase = "The upgrade level of %s has been erased.", maxlevel = "The targeted %s is already on max upgrade level.", notupgradeable = "This item is not upgradeable.", broadcast = "The player %s was successful in upgrading %s to level +%s.\nCongratulations!!", invalidtool = "This is not a valid upgrade tool.", toolrange = "This upgrade tool can only be used in items with level between +%s and +%s" }, tools = { [8306] = {range = {0, 10}, info = {chance = 1, removeable = true}}, [8300] = {range = {0, 10}, info = {chance = 2, removeable = true}} }, isEquipment = function(self) local weaponType = self:getItemWeaponType() return ((weaponType > 0 and weaponType < 7) or self.item.armor ~= 0) end, setItemName = function(self, name) return doItemSetAttribute(self.item.uid, "name", name) end, chance = function(self) local chances = {} chances.upgrade = (self.levels[self.item.level + 1][1] or 100) chances.downgrade = (self.item.level * 5) chances.erase = (self.item.level * 3) return chances end } function UpgradeHandler:new(item) local obj, ret = {} obj.item = {} obj.item.level = 0 obj.item.uid = item.uid for key, value in pairs(getItemInfo(item.itemid)) do obj.item[key] = value end ret = setmetatable(obj, { __index = function(self, index) if _G[index] then return (setmetatable({callback = _G[index]}, {__call = function(self, ...) return self.callback(item.uid, ...) end} )) else return UpgradeHandler[index] end end}) if ret:isEquipment() then ret:update() return ret end return false end function UpgradeHandler:update() -- this will return the level by the quality or 0 if it has no quality. self.item.level = 0 for r, v in ipairs(self.nameLv) do if self:getItemName():find(v) then self.item.level = r end end end function UpgradeHandler:refine(uid, item) if (self.item.level >= 3) then return true end if not self.item then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.notupgradeable) return "miss" end local tool = self.tools[item.itemid] if(tool == nil) then doPlayerSendTextMessage(uid, MESSAGE_EVENT_DEFAULT, self.message.invalidtool) return "miss" end if(self.item.level > #self.levels) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.maxlevel:format(self.item.name)) return "miss" end if(self.item.level < tool.range[1] or self.item.level >= tool.range[2]) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.toolrange:format(unpack(tool.range))) return "miss" end local chance = (self:chance().upgrade * tool.info.chance) doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.console:format(self.item.name, (self.item.level + 1), math.min(100, chance))) if(tool.info.removeable == true) then doRemoveItem(item.uid, 1) end if chance * 100 > math.random(1, 10000) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_ORANGE, self.message.success:format(self.item.name, (self.item.level + 1))) if (self.item.level + 1) >= self.broadcast then doBroadcastMessage(self.message.broadcast:format(getCreatureName(uid), self.item.name, (self.item.level + 1))) end -- it says if the item's level is greater then 0 (meaning is level equal to 1 or more) if it is add 1 more -- if the current level equals 0 add 1 to it self:setItemName(self.item.level > 0 and self.nameLv[self.item.level + 1].." "..(self:getItemName():gsub(self.nameLv[self.item.level].." ", "")) or self.nameLv[1].." "..self:getItemName()) for key, value in pairs(self.attributes) do if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then doItemSetAttribute(self.item.uid, key, (self.item.level > 0 and getItemAttribute(self.item.uid, key) or self.item[key]) + value) end end return "success" else if item.itemid == 8300 then if self.item.level > 0 then -- this will remove any number with a + sign in front of it from the string self:setItemName(self:getItemName():gsub((self.nameLv[self.item.level].." "), "")) for key, value in pairs(self.attributes) do if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then doItemSetAttribute(self.item.uid, key, getItemAttribute(self.item.uid, key) - self.item.level * value) end end end else doRemoveItem(self.item.uid, 1) end doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, item.itemid == 8300 and "Your item level has been reseted." or "You have broken your item while trying to upgrade it.") end end agora vc edita ali na chance da tools: 8306 é 1x e 8300 é 2x.
  10. Upvote
    maikons deu reputação a rorix em [Encerrado] Como o underwar faz pra dar aquele save que kicka e depois voltar?   
    se vc leu o que eu escrevi acima vc ia ver que não é so um save.
    qdo server cai todas storages das quests voltam ao 'original', por exemplo da anihi, que so pode ser feita 1x ao dia
  11. Upvote
    maikons deu reputação a rorix em [Encerrado] Como o underwar faz pra dar aquele save que kicka e depois voltar?   
    não reiniciam a maquina nao. apenas tem restarter no server, qdo cai ele volta sozinho. o server fica mais leve pq qdo cai todos items do chao somem (chao é limpo) e varios players de bot que nao tem reconect nao logam. com isso menos player e menos item no chao, server com menos lag
  12. Upvote
    maikons deu reputação a rorix em [Encerrado] Como o underwar faz pra dar aquele save que kicka e depois voltar?   
    eles fazem apenas para dar save mesmo, o bom de fazer isso é que todas storages voltam ao normal (por exemplo alguns ots so podem fazer anihi 1 team por dia), ai quando reinicia é como se 'zerasse os storages' e voltasse tudo ao normal
    não tem nada haver com deixar mais 'liso'
  13. Upvote
    maikons recebeu reputação de TarciisioFilho em [Arquivado]O atual cenário OTserv   
    Pelo menos pra mim tem, não aguento jogar essa mesmice
  14. Upvote
    maikons deu reputação a SkyLigh em Suporte script refinamento oneshot (dou 10reps)   
    --[[
     
    PERFECT UPGRADE SYSTEM
    2.0
     
    Criado por Oneshot
     
    É proibido a venda ou a cópia sem os devidos créditos desse script.
     
    ]]--
     
    UpgradeHandler = {
    levels = {
    [1] = {90, false, false},
    [2] = {80, false, false},
    [3] = {70, false, false},
    [4] = {60, true, false},
    [5] = {40, true, true}
    },
    broadcast = 8,
    attributes = {
    ["attack"] = 1,
    ["defense"] = 1,
    ["armor"] = 1
    },
    message = {
    console = "Trying to refine %s to level +%s with %s%% success rate.",
    success = "You have upgraded %s to level +%s",
    fail = "You have failed in upgrade of %s to level +%s",
    downgrade = "The upgrade level of %s has downgraded to +%s",
    erase = "The upgrade level of %s has been erased.",
    maxlevel = "The targeted %s is already on max upgrade level.",
    notupgradeable = "This item is not upgradeable.",
    broadcast = "The player %s was successful in upgrading %s to level +%s.\nCongratulations!!",
    invalidtool = "This is not a valid upgrade tool.",
    toolrange = "This upgrade tool can only be used in items with level between +%s and +%s"
    },
    tools = {
    [8306] = {range = {0, 10}, info = {chance = 0, removeable = true}},
    [8300] = {range = {0, 10}, info = {chance = 0, removeable = true}}
    },
     
    isEquipment = function(self)
    local weaponType = self:getItemWeaponType()
    return ((weaponType > 0 and weaponType < 7) or self.item.armor ~= 0)
    end,
     
    setItemName = function(self, name)
    return doItemSetAttribute(self.item.uid, "name", name)
    end,
     
    chance = function(self)
    local chances = {}
    chances.upgrade = (self.levels[self.item.level + 1][1] or 100)
    chances.downgrade = (self.item.level * 5)
    chances.erase = (self.item.level * 3)
     
    return chances
    end
    }
     
    function UpgradeHandler:new(item)
    local obj, ret = {}
    obj.item = {}
     
    obj.item.level = 0
    obj.item.uid = item.uid
    for key, value in pairs(getItemInfo(item.itemid)) do
    obj.item[key] = value
    end
     
    ret = setmetatable(obj, {__index = function(self, index)
    if _G[index] then
    return (setmetatable({callback = _G[index]}, {__call = function(self, ...)
    return self.callback(item.uid, ...)
    end}))
    else
    return UpgradeHandler[index]
    end
    end})
     
    if ret:isEquipment() then
    ret:update()
    return ret
    end
    return false
    end
     
    function UpgradeHandler:update()
    self.item.level = (tonumber(self:getItemName():match("%+(%d+)")) or 0)
    end
     
    function UpgradeHandler:refine(uid, item)
    if not self.item then
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.notupgradeable)
    return "miss"
    end
     
    local tool = self.tools[item.itemid]
     
    if(tool == nil) then
    doPlayerSendTextMessage(uid, MESSAGE_EVENT_DEFAULT, self.message.invalidtool)
    return "miss"
    end
     
    if(self.item.level > #self.levels) then
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.maxlevel:format(self.item.name))
    return "miss"
    end
     
    if(self.item.level < tool.range[1] or self.item.level >= tool.range[2]) then
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.toolrange:format(unpack(tool.range)))
    return "miss"
    end
     
    local chance = (self:chance().upgrade + tool.info.chance)
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.console:format(self.item.name, (self.item.level + 1), math.min(100, chance)))
     
    if(tool.info.removeable == true) then
    doRemoveItem(item.uid, 1)
    end
     
    if chance * 100 > math.random(1, 10000) then
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_ORANGE, self.message.success:format(self.item.name, (self.item.level + 1)))
    if (self.item.level + 1) >= self.broadcast then
    doBroadcastMessage(self.message.broadcast:format(getCreatureName(uid), self.item.name, (self.item.level + 1)))
    end
     
    self:setItemName((self.item.level > 0 and self:getItemName():gsub("%+(%d+)", "+".. (self.item.level + 1)) or (self:getItemName() .." +1")))
    for key, value in pairs(self.attributes) do
    if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then
    doItemSetAttribute(self.item.uid, key, (self.item.level > 0 and getItemAttribute(self.item.uid, key) or self.item[key]) + value)
    end
    end
    return "success"
    else
    if item.itemid == 8300 then
    if self.item.level > 0 then
    self:setItemName(self:getItemName():gsub("%+(%d+)", ""))
    for key, value in pairs(self.attributes) do
    if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then
    doItemSetAttribute(self.item.uid, key, getItemAttribute(self.item.uid, key) - self.item.level * value)
    end
    end
    end
    else
    doRemoveItem(self.item.uid, 1)
    end
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, item.itemid == 8300 and "Your item level has been reseted." or "You have broken your item while trying to upgrade it.")
    end
    end

     
  15. Upvote
    maikons recebeu reputação de Administrador em Não deixar mandar parcel pra rook   
    o problema das vesões 8.6 é que não tem essa aba de "your imbox", tinha que ter um jeito de não poder mandar o parcel ou se tive-se parcel no dp dos rookers deleta-se e checava toda vez q eles pisava no lugar do dp
  16. Upvote
    maikons deu reputação a SkyLigh em Problemas com espaços no final   
    --[[
     
    PERFECT UPGRADE SYSTEM
    2.0
     
    Criado por Oneshot
     
    É proibido a venda ou a cópia sem os devidos créditos desse script.
     
    ]]--
     
    UpgradeHandler = {
    levels = {
    [1] = {90, false, false},
    [2] = {80, false, false},
    [3] = {70, false, false},
    [4] = {60, true, false},
    [5] = {40, true, true}
    },
    broadcast = 8,
    attributes = {
    ["attack"] = 1,
    ["defense"] = 1,
    ["armor"] = 1
    },
    message = {
    console = "Trying to refine %s to level +%s with %s%% success rate.",
    success = "You have upgraded %s to level +%s",
    fail = "You have failed in upgrade of %s to level +%s",
    downgrade = "The upgrade level of %s has downgraded to +%s",
    erase = "The upgrade level of %s has been erased.",
    maxlevel = "The targeted %s is already on max upgrade level.",
    notupgradeable = "This item is not upgradeable.",
    broadcast = "The player %s was successful in upgrading %s to level +%s.\nCongratulations!!",
    invalidtool = "This is not a valid upgrade tool.",
    toolrange = "This upgrade tool can only be used in items with level between +%s and +%s"
    },
    tools = {
    [8306] = {range = {0, 10}, info = {chance = 0, removeable = true}},
    [8300] = {range = {0, 10}, info = {chance = 0, removeable = true}}
    },
     
    isEquipment = function(self)
    local weaponType = self:getItemWeaponType()
    return ((weaponType > 0 and weaponType < 7) or self.item.armor ~= 0)
    end,
     
    setItemName = function(self, name)
    return doItemSetAttribute(self.item.uid, "name", name)
    end,
     
    chance = function(self)
    local chances = {}
    chances.upgrade = (self.levels[self.item.level + 1][1] or 100)
    chances.downgrade = (self.item.level * 5)
    chances.erase = (self.item.level * 3)
     
    return chances
    end
    }
     
    function UpgradeHandler:new(item)
    local obj, ret = {}
    obj.item = {}
     
    obj.item.level = 0
    obj.item.uid = item.uid
    for key, value in pairs(getItemInfo(item.itemid)) do
    obj.item[key] = value
    end
     
    ret = setmetatable(obj, {__index = function(self, index)
    if _G[index] then
    return (setmetatable({callback = _G[index]}, {__call = function(self, ...)
    return self.callback(item.uid, ...)
    end}))
    else
    return UpgradeHandler[index]
    end
    end})
     
    if ret:isEquipment() then
    ret:update()
    return ret
    end
    return false
    end
     
    function UpgradeHandler:update()
    self.item.level = (tonumber(self:getItemName():match("%+(%d+)")) or 0)
    end
     
    function UpgradeHandler:refine(uid, item)
    if not self.item then
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.notupgradeable)
    return "miss"
    end
     
    local tool = self.tools[item.itemid]
     
    if(tool == nil) then
    doPlayerSendTextMessage(uid, MESSAGE_EVENT_DEFAULT, self.message.invalidtool)
    return "miss"
    end
     
    if(self.item.level > #self.levels) then
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.maxlevel:format(self.item.name))
    return "miss"
    end
     
    if(self.item.level < tool.range[1] or self.item.level >= tool.range[2]) then
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.toolrange:format(unpack(tool.range)))
    return "miss"
    end
     
    local chance = (self:chance().upgrade + tool.info.chance)
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.console:format(self.item.name, (self.item.level + 1), math.min(100, chance)))
     
    if(tool.info.removeable == true) then
    doRemoveItem(item.uid, 1)
    end
     
    if chance * 100 > math.random(1, 10000) then
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_ORANGE, self.message.success:format(self.item.name, (self.item.level + 1)))
    if (self.item.level + 1) >= self.broadcast then
    doBroadcastMessage(self.message.broadcast:format(getCreatureName(uid), self.item.name, (self.item.level + 1)))
    end
     
    self:setItemName((self.item.level > 0 and self:getItemName():gsub("%+(%d+)", "+".. (self.item.level + 1)) or (self:getItemName() .." +1")))
    for key, value in pairs(self.attributes) do
    if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then
    doItemSetAttribute(self.item.uid, key, (self.item.level > 0 and getItemAttribute(self.item.uid, key) or self.item[key]) + value)
    end
    end
    return "success"
    else
    if item.itemid == 8300 then
    if self.item.level > 0 then
    self:setItemName(self:getItemName():gsub("%+(%d+)",""))
    for key, value in pairs(self.attributes) do
    if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then
    doItemSetAttribute(self.item.uid, key, getItemAttribute(self.item.uid, key) - self.item.level * value)
    end
    end
    end
    else
    doRemoveItem(self.item.uid, 1)
    end
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, item.itemid == 8300 and "Your item level has been reseted." or "You have broken your item while trying to upgrade it.")
    end
    end

     
  17. Upvote
    maikons deu reputação a SkyLigh em Problemas com espaços no final   
    --[[ PERFECT UPGRADE SYSTEM 2.0 Criado por Oneshot É proibido a venda ou a cópia sem os devidos créditos desse script. ]]-- UpgradeHandler = { levels = { [1] = {90, false, false}, [2] = {80, false, false}, [3] = {70, false, false}, [4] = {60, true, false}, [5] = {40, true, true} }, broadcast = 8, attributes = { ["attack"] = 1, ["defense"] = 1, ["armor"] = 1 }, message = { console = "Trying to refine %s to level +%s with %s%% success rate.", success = "You have upgraded %s to level +%s", fail = "You have failed in upgrade of %s to level +%s", downgrade = "The upgrade level of %s has downgraded to +%s", erase = "The upgrade level of %s has been erased.", maxlevel = "The targeted %s is already on max upgrade level.", notupgradeable = "This item is not upgradeable.", broadcast = "The player %s was successful in upgrading %s to level +%s.\nCongratulations!!", invalidtool = "This is not a valid upgrade tool.", toolrange = "This upgrade tool can only be used in items with level between +%s and +%s" }, tools = { [8306] = {range = {0, 10}, info = {chance = 0, removeable = true}}, [8300] = {range = {0, 10}, info = {chance = 0, removeable = true}} }, isEquipment = function(self) local weaponType = self:getItemWeaponType() return ((weaponType > 0 and weaponType < 7) or self.item.armor ~= 0) end, setItemName = function(self, name) return doItemSetAttribute(self.item.uid, "name", name) end, chance = function(self) local chances = {} chances.upgrade = (self.levels[self.item.level + 1][1] or 100) chances.downgrade = (self.item.level * 5) chances.erase = (self.item.level * 3) return chances end } function UpgradeHandler:new(item) local obj, ret = {} obj.item = {} obj.item.level = 0 obj.item.uid = item.uid for key, value in pairs(getItemInfo(item.itemid)) do obj.item[key] = value end ret = setmetatable(obj, {__index = function(self, index) if _G[index] then return (setmetatable({callback = _G[index]}, {__call = function(self, ...) return self.callback(item.uid, ...) end})) else return UpgradeHandler[index] end end}) if ret:isEquipment() then ret:update() return ret end return false end function UpgradeHandler:update() self.item.level = (tonumber(self:getItemName():match("%+(%d+)")) or 0) end function UpgradeHandler:refine(uid, item) if not self.item then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.notupgradeable) return "miss" end local tool = self.tools[item.itemid] if(tool == nil) then doPlayerSendTextMessage(uid, MESSAGE_EVENT_DEFAULT, self.message.invalidtool) return "miss" end if(self.item.level > #self.levels) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.maxlevel:format(self.item.name)) return "miss" end if(self.item.level < tool.range[1] or self.item.level >= tool.range[2]) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.toolrange:format(unpack(tool.range))) return "miss" end local chance = (self:chance().upgrade + tool.info.chance) doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.console:format(self.item.name, (self.item.level + 1), math.min(100, chance))) if(tool.info.removeable == true) then doRemoveItem(item.uid, 1) end if chance * 100 > math.random(1, 10000) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_ORANGE, self.message.success:format(self.item.name, (self.item.level + 1))) if (self.item.level + 1) >= self.broadcast then doBroadcastMessage(self.message.broadcast:format(getCreatureName(uid), self.item.name, (self.item.level + 1))) end self:setItemName((self.item.level > 0 and self:getItemName():gsub("%+(%d+)", "+".. (self.item.level + 1)) or (self:getItemName() .." +1"))) for key, value in pairs(self.attributes) do if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then doItemSetAttribute(self.item.uid, key, (self.item.level > 0 and getItemAttribute(self.item.uid, key) or self.item[key]) + value) end end return "success" else if item.itemid == 8300 then if self.item.level > 0 then self:setItemName(self:getItemName():gsub("%+(%d+)", "")) for key, value in pairs(self.attributes) do if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then doItemSetAttribute(self.item.uid, key, getItemAttribute(self.item.uid, key) - self.item.level * value) end end end else doRemoveItem(self.item.uid, 1) end doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, item.itemid == 8300 and "Your item level has been reseted." or "You have broken your item while trying to upgrade it.") end end acho que agora vai
  18. Upvote
    maikons deu reputação a SkyLigh em Problemas com espaços no final   
    Mas o resto funcionou bem? ou não?
  19. Upvote
    maikons deu reputação a SkyLigh em Problemas com espaços no final   
    --[[ PERFECT UPGRADE SYSTEM 2.0 Criado por Oneshot É proibido a venda ou a cópia sem os devidos créditos desse script. ]]-- UpgradeHandler = { levels = { [1] = {90, false, false}, [2] = {80, false, false}, [3] = {70, false, false}, [4] = {60, true, false}, [5] = {40, true, true} }, broadcast = 8, attributes = { ["attack"] = 1, ["defense"] = 1, ["armor"] = 1 }, message = { console = "Trying to refine %s to level +%s with %s%% success rate.", success = "You have upgraded %s to level +%s", fail = "You have failed in upgrade of %s to level +%s", downgrade = "The upgrade level of %s has downgraded to +%s", erase = "The upgrade level of %s has been erased.", maxlevel = "The targeted %s is already on max upgrade level.", notupgradeable = "This item is not upgradeable.", broadcast = "The player %s was successful in upgrading %s to level +%s.\nCongratulations!!", invalidtool = "This is not a valid upgrade tool.", toolrange = "This upgrade tool can only be used in items with level between +%s and +%s" }, tools = { [8306] = {range = {0, 10}, info = {chance = 0, removeable = true}}, [8300] = {range = {0, 10}, info = {chance = 0, removeable = true}}, }, isEquipment = function(self) local weaponType = self:getItemWeaponType() return ((weaponType > 0 and weaponType < 7) or self.item.armor ~= 0) end, setItemName = function(self, name) return doItemSetAttribute(self.item.uid, "name", name) end, chance = function(self) local chances = {} chances.upgrade = (self.levels[self.item.level + 1][1] or 100) chances.downgrade = (self.item.level * 5) chances.erase = (self.item.level * 3) return chances end } function UpgradeHandler:new(item) local obj, ret = {} obj.item = {} obj.item.level = 0 obj.item.uid = item.uid for key, value in pairs(getItemInfo(item.itemid)) do obj.item[key] = value end ret = setmetatable(obj, {__index = function(self, index) if _G[index] then return (setmetatable({callback = _G[index]}, {__call = function(self, ...) return self.callback(item.uid, ...) end})) else return UpgradeHandler[index] end end}) if ret:isEquipment() then ret:update() return ret end return false end function UpgradeHandler:update() self.item.level = (tonumber(self:getItemName():match("%+(%d+)")) or 0) end function UpgradeHandler:refine(uid, item) if not self.item then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.notupgradeable) return "miss" end local tool = self.tools[item.itemid] if(tool == nil) then doPlayerSendTextMessage(uid, MESSAGE_EVENT_DEFAULT, self.message.invalidtool) return "miss" end if(self.item.level > #self.levels) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.maxlevel:format(self.item.name)) return "miss" end if(self.item.level < tool.range[1] or self.item.level >= tool.range[2]) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.toolrange:format(unpack(tool.range))) return "miss" end local chance = (self:chance().upgrade + tool.info.chance) doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.console:format(self.item.name, (self.item.level + 1), math.min(100, chance))) if(tool.info.removeable == true) then doRemoveItem(item.uid, 1) end if chance * 100 > math.random(1, 10000) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_ORANGE, self.message.success:format(self.item.name, (self.item.level + 1))) if (self.item.level + 1) >= self.broadcast then doBroadcastMessage(self.message.broadcast:format(getCreatureName(uid), self.item.name, (self.item.level + 1))) end self:setItemName((self.item.level > 0 and self:getItemName():gsub("%+(%d+)", "+".. (self.item.level + 1)) or (self:getItemName() .." +1"))) for key, value in pairs(self.attributes) do if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then doItemSetAttribute(self.item.uid, key, (self.item.level > 0 and getItemAttribute(self.item.uid, key) or self.item[key]) + value) end end return "success" else if item.itemid == 8300 then if self.item.level >= 0 then self:setItemName(self:getItemName():gsub("%+(%d+)", "")) for key, value in pairs(self.attributes) do if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then doItemSetAttribute(self.item.uid, key, getItemAttribute(self.item.uid, key) - self.item.level * value) end end end else doRemoveItem(self.item.uid, 1) end doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, item.itemid == 8300 and "Your item level has been reseted." or "You have broken your item while trying to upgrade it.") end end veja agora
  20. Upvote
    maikons deu reputação a SkyLigh em Problemas com espaços no final   
    tente assim
    --[[ PERFECT UPGRADE SYSTEM 2.0 Criado por Oneshot É proibido a venda ou a cópia sem os devidos créditos desse script. ]]-- UpgradeHandler = { levels = { [1] = {90, false, false}, [2] = {80, false, false}, [3] = {70, false, false}, [4] = {60, true, false}, [5] = {40, true, true} }, broadcast = 8, attributes = { ["attack"] = 1, ["defense"] = 1, ["armor"] = 1 }, message = { console = "Trying to refine %s to level +%s with %s%% success rate.", success = "You have upgraded %s to level +%s", fail = "You have failed in upgrade of %s to level +%s", downgrade = "The upgrade level of %s has downgraded to +%s", erase = "The upgrade level of %s has been erased.", maxlevel = "The targeted %s is already on max upgrade level.", notupgradeable = "This item is not upgradeable.", broadcast = "The player %s was successful in upgrading %s to level +%s.\nCongratulations!!", invalidtool = "This is not a valid upgrade tool.", toolrange = "This upgrade tool can only be used in items with level between +%s and +%s" }, tools = { [8306] = {range = {0, 10}, info = {chance = 0, removeable = true}}, [8300] = {range = {0, 10}, info = {chance = 0, removeable = true}}, }, isEquipment = function(self) local weaponType = self:getItemWeaponType() return ((weaponType > 0 and weaponType < 7) or self.item.armor ~= 0) end, setItemName = function(self, name) return doItemSetAttribute(self.item.uid, "name", name) end, chance = function(self) local chances = {} chances.upgrade = (self.levels[self.item.level + 1][1] or 100) chances.downgrade = (self.item.level * 5) chances.erase = (self.item.level * 3) return chances end } function UpgradeHandler:new(item) local obj, ret = {} obj.item = {} obj.item.level = 0 obj.item.uid = item.uid for key, value in pairs(getItemInfo(item.itemid)) do obj.item[key] = value end ret = setmetatable(obj, {__index = function(self, index) if _G[index] then return (setmetatable({callback = _G[index]}, {__call = function(self, ...) return self.callback(item.uid, ...) end})) else return UpgradeHandler[index] end end}) if ret:isEquipment() then ret:update() return ret end return false end function UpgradeHandler:update() self.item.level = (tonumber(self:getItemName():match("%+(%d+)")) or 0) end function UpgradeHandler:refine(uid, item) if not self.item then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.notupgradeable) return "miss" end local tool = self.tools[item.itemid] if(tool == nil) then doPlayerSendTextMessage(uid, MESSAGE_EVENT_DEFAULT, self.message.invalidtool) return "miss" end if(self.item.level > #self.levels) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.maxlevel:format(self.item.name)) return "miss" end if(self.item.level < tool.range[1] or self.item.level >= tool.range[2]) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.toolrange:format(unpack(tool.range))) return "miss" end local chance = (self:chance().upgrade + tool.info.chance) doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.console:format(self.item.name, (self.item.level + 1), math.min(100, chance))) if(tool.info.removeable == true) then doRemoveItem(item.uid, 1) end if chance * 100 > math.random(1, 10000) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_ORANGE, self.message.success:format(self.item.name, (self.item.level + 1))) if (self.item.level + 1) >= self.broadcast then doBroadcastMessage(self.message.broadcast:format(getCreatureName(uid), self.item.name, (self.item.level + 1))) end self:setItemName((self.item.level > 0 and self:getItemName():gsub("%+(%d+)", "+".. (self.item.level + 1)) or (self:getItemName() .." +1"))) for key, value in pairs(self.attributes) do if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then doItemSetAttribute(self.item.uid, key, (self.item.level > 0 and getItemAttribute(self.item.uid, key) or self.item[key]) + value) end end return "success" else if item.itemid == 8300 then if self.item.level < 0 then self:setItemName(self:getItemName():gsub("%+(%d+)", "")) for key, value in pairs(self.attributes) do if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then doItemSetAttribute(self.item.uid, key, getItemAttribute(self.item.uid, key) - self.item.level * value) end end end else doRemoveItem(self.item.uid, 1) end doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, item.itemid == 8300 and "Your item level has been reseted." or "You have broken your item while trying to upgrade it.") end end
  21. Upvote
    maikons recebeu reputação de jvcasarin em Erro ao aceitar WAR (War System)   
  22. Upvote
    maikons deu reputação a jvcasarin em Erro ao aceitar WAR (War System)   
    Não cara, pra funcionar, basta ter o parâmetro -D__WAR_SYSTEM__

    Baixa ai olha:
    CLIQUE AQUI
     
    Ai tem um distro TFS 0.4 com CAST SYSTEM, WAR SYSTEM, PLAINTEXT LIBERADO, ALGUMAS FUNÇÕES EXTRAS e as libs..
  23. Upvote
    maikons deu reputação a jvcasarin em Erro ao aceitar WAR (War System)   
    Esse parâmetro eh obrigatório... Posta aí o erro que está dando, talvez possamos resolver aqui no XT xD
  24. Upvote
    maikons deu reputação a zipter98 em Ajuda como modificar action do oneshot   
  25. Upvote
    maikons deu reputação a jvcasarin em Erro ao aceitar WAR (War System)   
    Ai, eu vou dormir, amanhã eu edito esse post, falando oq fazer, tenho uma pasta aqui, com tudo necessário pra rodar o war System, e eu passo pra vc o TFS 0.4 que eu compilei!
     
    Tem cast System, war System, retirei verificação de sha1 e tem algumas funções como
     
    getCreaturePathTo()
     
    Até mais!
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...