Ir para conteúdo

Mateus Robeerto

Héroi
  • Registro em

  • Última visita

Tudo que Mateus Robeerto postou

  1. Sobre não ser possível usar essas funções, como por exemplo 'onStatsChange', 'onHealthChange' e 'onManaChange', no onUse... apenas em CreatureScript. Então, fiz uma adaptação aqui... Você deve substituir tudo isso e, em seguida, adicionar em suas 'actions'. Clique no item e terá informações sobre o dano percentual, etc. creaturescripts. CRITICAL_DAMAGE_PERCENTAGE = 0.5 local config = { SKILL_ID = 0, multiplier = 1.5, percentual = CRITICAL_DAMAGE_PERCENTAGE, } function onLogin(cid) registerCreatureEvent(cid, "critical") registerCreatureEvent(cid, "comcriti") return true end function onStatsChange(cid, attacker, type, combat, value) if isPlayer(attacker) and (not (attacker == cid)) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then local chance = (getPlayerSkillLevel(attacker, config.SKILL_ID) * config.percentual) * 10 if math.random(1, 1400) <= chance then local dano = math.ceil(value * config.multiplier) doTargetCombatHealth(attacker, cid, combat, -dano, -dano, 255) return false end end return true end function onCombat(cid, target) if isPlayer(cid) and isMonster(target) then registerCreatureEvent(target, "critical") end return true end actions. function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == 12575 then local percentage = CRITICAL_DAMAGE_PERCENTAGE * 100 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Seu percentual de dano crítico é de " .. percentage .. "%.") return true end return false end tentar..
  2. wft? Você marcou como resolvido para o Leozin e não para mim? Hahaha
  3. local config = { effectonuse = 14, levelsdamage = 100, storagedamage = 14335 } function onUse(cid, item, frompos, item2, topos) local currentDamage = getPlayerStorageValue(cid, config.storagedamage) or 0 if currentDamage < config.levelsdamage then local newDamage = currentDamage + 1 doRemoveItem(item.uid, 1) doSendMagicEffect(topos, config.effectonuse) setPlayerStorageValue(cid, config.storagedamage, newDamage) local message = string.format("Seu damage foi aumentado para [%d/100].", newDamage) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, message) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você já atingiu o nível máximo de damage.\nParabéns!!!!") return false end local damage = getPlayerStorageValue(cid, config.storagedamage) or 0 local calculatedDamage = damage * 2.5 -- Fórmula para calcular o damage baseado no valor storage. local finalMessage = string.format('Seu damage atual é: %d', calculatedDamage) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, finalMessage) return true end Se o tópico estiver resolvido, por favor, marque como resolvido e crie outro tópico para suas dúvidas/ajuda, etc. Isso ajuda a evitar scams, já que muitos usuários estão procurando pelo sistema necessário. Pode ficar confuso aqui. É melhor marcar como resolvido e criar outro tópico apenas para suas dúvidas.
  4. Parabéns pelo projeto! O mapa está belíssimo... No entanto, o market system é bem diferente... Gostei muito!.
  5. Você poderia compilar o disto e postar aqui para eu baixar e testar? Não tenho paciência para tentar compilar a partir dessa versão do Canary. Gostaria de conhecer alguns sistemas e mapas. obg...
  6. local levels = { [-1] = {itemid = 6541, chance = 10}, [10] = {itemid = 6542, chance = 20}, [20] = {itemid = 6543, chance = 5}, [30] = {itemid = 6544, chance = 30}, [40] = {itemid = 6545, chance = 80}, } local config = { storage = 19333, chance = 1, --- chance de achar um item ou não k = 1, --- constante de level.. quanto maior, mais fácil é upar. (a fórmula é level ao quadrado dividido pela constante) experience = 19334 } local terra = {11787} function getDrops(cid) local drops = {} for i = -1, getPlayerStorageValue(cid, config.storage) do if levels[i] then local item = levels[i].itemid local chance = levels[i].chance if config.chance >= math.random(1, 100) then -- Ajustado para um intervalo de 1 a 100 if math.random(1, 100) <= chance then table.insert(drops, item) end end end end return drops end function onUse(cid, item, fromPosition, itemEx, toPosition) local drops = {} if isInArray(terra, itemEx.itemid) then drops = getDrops(cid) doPlayerSetStorageValue(cid, config.experience, getPlayerStorageValue(cid, config.experience) + 1) local experience = getPlayerStorageValue(cid, config.experience) if experience >= (8 + (getPlayerStorageValue(cid, config.storage) ^ 2)) / config.k then doPlayerSetStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage) + 1) doPlayerSendTextMessage(cid, 27, "Parabens, voce subiu de nivel! Seu nivel atual e " .. getPlayerStorageValue(cid, config.storage) .. ".") if getPlayerStorageValue(cid, config.storage) == 100 then doPlayerSendTextMessage(cid, 20, "[MINING] --> Por alcancar o nivel " .. getPlayerStorageValue(cid, config.storage) .. " voce foi premiado com o capacete de mineracao.") doPlayerAddItem(cid, 7497, 1, true) end end if config.chance >= math.random(1, 150) then if #drops >= 1 then local item = drops[math.random(1, #drops)] doPlayerSendTextMessage(cid, 27, "[MINING] --> Voce encontrou um(a) " .. getItemNameById(item) .. ".") doSendAnimatedText(toPosition, "Sucesso", 210) doPlayerAddItem(cid, item, 1, true) end doSendMagicEffect(toPosition, 3) else doSendAnimatedText(toPosition, "Tack", 215) doSendMagicEffect(toPosition, 2) return true end elseif itemEx.itemid == item.itemid then doPlayerSendTextMessage(cid, 27, "[MINING] --> Seu nivel na mineracao e: [" .. getPlayerStorageValue(cid, config.storage) .. "].") else return false end return true end
  7. @leozincorsairTem um link aqui. Basta clicar e abrirá em outro navegador. Há dois tipos: OTX ou TFS. Não sei qual você usa como base, então dê uma olhada aqui
  8. local config = { effectonuse = 14, levelsdamage = 100, storagedamage = 14335 } function onUse(cid, item, frompos, item2, topos) local currentDamage = getPlayerStorageValue(cid, config.storagedamage) or 0 if currentDamage < config.levelsdamage then local newDamage = currentDamage + 1 doRemoveItem(item.uid, 1) doSendMagicEffect(topos, config.effectonuse) setPlayerStorageValue(cid, config.storagedamage, newDamage) local message = string.format("Seu dano foi aumentado para [%d/100].", newDamage) doPlayerSendTextMessage(cid, 22, message) else doPlayerSendTextMessage(cid, 22, "Você já atingiu o nível máximo de dano.\nParabéns!!!!") return false end return true end Recomendo que você coloque o dano por reset na source com valor de 1.0 ou 1.5 no máximo. Se for 2.0 ou mais, o dano alto é muito exagerado. Por isso, recomendo um valor menor, entre 1.0 e 1.5. Seria legal ter o dano por cada reset ou item ao clicar, por exemplo, 1/100 de evolução.
  9. Boa tarde! Fiz um script melhor e bem simples. É possível entender o script, Segue o GIF para ver como ele funciona e foi testado no tfs 0.4, tudo certo. Divirta-se function onUse(cid, item, frompos, item2, topos) local playerLocation = getCreaturePosition(cid) local itemData = { {itemId = 2400, x = 722, y = 658, z = 7}, {itemId = 2401, x = 722, y = 657, z = 7}, {itemId = 2376, x = 724, y = 658, z = 7} -- Adicione mais itens para combinação aqui } local newItemId = 2406 -- ID do novo item após a combinação local newItemPosition = {x = 724, y = 657, z = 7} -- Posição para o novo item local foundItems = {} local hasAllItems = true for _, data in ipairs(itemData) do local tileItem = getTileItemById({x = data.x, y = data.y, z = data.z}, data.itemId) if tileItem.uid > 0 then table.insert(foundItems, tileItem.uid) else hasAllItems = false break end end if hasAllItems then for _, uid in ipairs(foundItems) do if not doRemoveItem(uid, 1) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Erro ao remover um dos itens necessários.") return false end end local newItem = doCreateItem(newItemId, 1, newItemPosition) if newItem ~= LUA_ERROR then doSendMagicEffect(newItemPosition, 39) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Erro ao criar o novo item.") return false end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não possui todos os itens necessários para a combinação.") return false end return true end @deza 20231130_150112.mp4
  10. function onUse(cid, item, frompos, item2, topos) local playerLocation = getCreaturePosition(cid) local combinationItems = { [ItemID1] = {x = X1, y = Y1, z = Z1}, [ItemID2] = {x = X2, y = Y2, z = Z2}, [ItemID3] = {x = X3, y = Y3, z = Z3}, [ItemID4] = {x = X4, y = Y4, z = Z4}, [ItemID5] = {x = X5, y = Y5, z = Z5} -- Adicione mais itens para combinação aqui } local function hasItems(items) for itemID, position in pairs(items) do local tileItem = getTileItemById(position, itemID) if not tileItem then return false end end return true end local function combineItems(items) if hasItems(items) then for itemID, position in pairs(items) do doRemoveItem(getTileItemById(position, itemID).uid, 1) end local newItemID = 9999 -- aqui id novo doPlayerAddItem(cid, newItemID, 1) doSendMagicEffect(playerLocation, 39) return true end return false end if not combineItems(combinationItems) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Não há itens suficientes para combinar.") doSendMagicEffect(playerLocation, CONST_ME_POFF) end return true end
  11. pode sim Você pode utilizar essa seção 'storage' local resets = getPlayerStorageValue(cid, 14335) or 0 local damage = resets * 2.5 -- Calcula o damage por reset
  12. function onUse(cid, item, frompos, item2, topos) local playerLocation = getCreaturePosition(cid) local enchantments = { [2361] = {amount = 1, transformId = 2453}, [2159] = {amount = 10, transformId = 2646}, -- Adicione mais itens de encantamento aqui [OutroID] = {amount = QuantidadeNecessaria, transformId = IDTransformacao} } local weaponEnchantmentTable = { { weaponId = 7735, positions = { weaponTable = {x = 32352, y = 31912, z = 7}, enchantmentTable = {x = 32354, y = 31912, z = 7} }, enchantmentIds = {2361} }, { weaponId = 6132, positions = { weaponTable = {x = 32356, y = 31912, z = 7}, enchantmentTable = {x = 32358, y = 31912, z = 7} }, enchantmentIds = {2159} } -- Adicione mais armas e suas respectivas posições aqui -- Exemplo: {weaponId = IDDaArma, positions = {posicaoDaArma, posicaoDoEncantamento}, enchantmentIds = {IDDoEncantamento1, IDDoEncantamento2, ...}} } local function hasItems(items) for itemID, enchantmentData in pairs(items) do local enchantment = getTileItemById(enchantmentData.positions.enchantmentTable, itemID) if not enchantment or enchantment.type < enchantmentData.amount then return false end end return true end local function enchantWeapon(enchantmentData) for _, data in pairs(enchantmentData) do local weapon = getTileItemById(data.positions.weaponTable, data.weaponId) if weapon then local enchantmentsNeeded = data.enchantmentIds if hasItems(enchantmentsNeeded) then for _, enchantmentID in ipairs(enchantmentsNeeded) do local enchantment = getTileItemById(data.positions.enchantmentTable, enchantmentID) if enchantment then local requiredAmount = enchantments[enchantmentID].amount doRemoveItem(enchantment.uid, requiredAmount) end end doRemoveItem(weapon.uid, 1) doPlayerAddItem(cid, enchantments[enchantmentID].transformId, 1) doSendMagicEffect(playerLocation, 39) return true end end end return false end if not enchantWeapon(weaponEnchantmentTable) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sem itens necessários para o encantamento.") doSendMagicEffect(playerLocation, CONST_ME_POFF) end return true end
  13. Você quer que o NPC exiba quanto de dano você tem por reset, correto? entao, procura essa linha . elseif msgcontains(msg, 'quantity') then selfSay('You have a total of '..getResets(cid)..' reset(s).', cid) talkState[talkUser] = 0 end e substitua tudo. elseif msgcontains(msg, 'quantity') then selfSay('Voce possui um total de ' .. getResets(cid) .. ' reset(s).', cid) talkState[talkUser] = 0 elseif msgcontains(msg, 'damage') then local resets = getPlayerStorageValue(cid, 14335) or 0 local damage = resets * 2.5 -- Calcula o damage por reset selfSay('Seu damage por reset atual e: ' .. damage, cid) -- Exibe o damage por reset ao jogador talkState[talkUser] = 0 end experimentar...
  14. já tem aqui no fórum... apenas você pode pegar o script e adaptar para seu jeito. Já tem explicado tudo sobre como funciona etc...
  15. https://tibiaking.com/forums/topic/111239-reset-system-otx-2/?tab=comments#comment-573049
  16. local maxPlayers = 5 function onThink(interval, lastExecution) local t, ret = {}, "TOP " .. math.min(maxPlayers, getWorldCreatures(0)) .. " Rank Level e Reset (LIVE):\n" for _, cid in ipairs(getPlayersOnline()) do table.insert(t, {cid, getPlayerLevel(cid), getPlayerStorageValue(cid, 54676)}) end table.sort(t, function(a, b) return a[2] > b[2] end) for i = 1, math.min(#t, maxPlayers) do ret = ret .. "\n" .. i .. " - " .. getCreatureName(t[i][1]) .. ": Level: [" .. t[i][2] .. "] - Reset: [" .. t[i][3] .. "]" end print(ret) end
  17. Também antes pesquisava e achava muito rápido. Sempre escrevia 'system reset tibiaking' e apareciam vários tópicos diferentes, certo? Hoje em dia, coloco no Google da mesma forma que escrevia antes e quase não aparece nada. Muito estranho.
  18. Mano, você fez um script para TFS 1.X, mas o cara que pediu está utilizando o TFS 0.4... Só para te avisar mesmo, rs.
  19. local DamageMultiplierLib = {} -- Function to get the player's damage multiplier function DamageMultiplierLib.getPlayerDamageMultiplier(playerId) local playerMultiplier = getPlayerDamageMultiplier(playerId) return playerMultiplier end -- Function to set the player's damage multiplier function DamageMultiplierLib.setPlayerDamageMultiplier(playerId, value) setPlayerDamageMultiplier(playerId, value) end -- Return the library table return DamageMultiplierLib tentar.. Ele adicionou isso 'local player = Player(playerId) if player then', que é especificamente para TFS 1.x+. Acredito que tenha adicionado isso por acidente. Então, eu peguei e adaptei corretamente para o TFS 0.4. Veja se funcionou ou não. TFS 1.X player:getDamageMultiplier TFS 0.4 getPlayerDamageMultiplier
  20. Essa store é client da CipSoft, certo? Tenho um módulo semelhante a este para OTC... Vou aproveitar e usá-lo nela, já que está funcionando e é compatível. Adorei... hehehe... Na verdade, não gosto muito do client da CipSoft.
  21. Se for client da CipSoft, não há source aberto disponível. No entanto, existem opções de código aberto, como o OTC v8 ou Mehah, para a comunidade. Você pode baixar qualquer um desses source, seja o v8 ou o Mehah. Eu recomendo baixar o OTC do Mehah, pois oferece alguns recursos interessantes que combinam bem com Pokémon e tem outras coisas legais.
  22. Muito obrigado, era isso que eu precisava para entender sobre opcode. Agora entendo muito bem. Obrigado e que Deus abençoe.
  23. Já existe o código aberto para a comunidade, sim. Basta procurar lá na OTLand, tem sim. void Creature::onGainExperience(double& gainExp, bool fromMonster, bool multiplied) { if (gainExp <= 0) return; if (master) { gainExp /= 2; master->onGainExperience(gainExp, fromMonster, multiplied); } else if (!multiplied) { gainExp *= g_config.getDouble(ConfigManager::RATE_EXPERIENCE); } int16_t color = g_config.getNumber(ConfigManager::EXPERIENCE_COLOR); if (color < 0) { color = random_range(0, 255); } std::stringstream ss; if (gainExp >= 1e9) // Bilhões { ss << "EXP: " << static_cast<uint64_t>(gainExp / 1e6) << "KKK"; } else if (gainExp >= 1e6) // Milhões { ss << "EXP: " << static_cast<uint64_t>(gainExp / 1e3) << "KK"; } else if (gainExp >= 1e3) // Milhares { ss << "EXP: " << static_cast<uint64_t>(gainExp); } else { ss << "EXP: " << static_cast<uint64_t>(gainExp); } g_game.addAnimatedText(getPosition(), static_cast<uint8_t>(color), ss.str()); } Já existe o código aberto para a comunidade, sim. Basta procurar lá na OTLand, tem sim.

Informação Importante

Confirmação de Termo