nao entendi direito, entendi que é um sistema de forja, mas como faço para forja, da uma explicada aew, abçs
- Fórum
- OTServ
- Recursos
- Scripting
- Actions e Talkactions
- Sisteminha De Forja
info
Grupo: Campones
Registrado: 11/02/10
Posts: 80
Reputação: +7
Char no Tibia: Lord Slashin

info
Grupo: Barão
Registrado: 18/10/10
Posts: 246
Reputação: +89
Char no Tibia: Elite Pamcadaum

Seguinte:
Você configura alí na lib isso
[2] = {dif = 10, -- Mercenary Sword
re = {{2401, 1},
{9971, 5},
{5887, 3},
{5892, 2},
},
ma = {7386, 1}
},
re = {{2401, 1},
{9971, 5},
Aí você coloca os ítens que vão ser precisos para forjar e a quantidade. no caso:
1 item de id 2401
5 item de id 9971.
ma = {7386, 1}
E aí você coloca o id do item que vai ser forjado e a quantidade.
Quando o cara colocar todos em cima de uma bigorna e usar um iron hammer nele, depedendo da dificuldade e da sorte do cara. Ele forja o item [:
info
Grupo: Campones
Registrado: 11/02/10
Posts: 80
Reputação: +7
Char no Tibia: Lord Slashin

tem alguma talkaction para mostrar essas receitas ??, tipo !forj ai mostra as combinações ?
e tipo quando o player fazer o item fikar tipo, Fodim's Dragon Slayer, sem querer pedir muito,
se conseguir REP+
ah descobri um bug, quando coloca 2 ids da pra forjar so com 1 dos items
Editado Dezembro 17 por Fodim


info
Grupo: Barão
Registrado: 18/10/10
Posts: 246
Reputação: +89
Char no Tibia: Elite Pamcadaum
#Introdução
Vish, eu tava aqui de boa vasculhando meus scripts e achei esse sistema de Forja, é antigo e pode conter bugs, então quem encontrar por favor reporte (:
#Instalação
@Actions
Na pasta scripts copie qualquer arquivo com a extenção lua, e renomeie ele para Smith, abra, delete tudo que houver dentro dele, copie esse conteúdo e salve:
--[[ ################################################ ## Smith System ## ## Author: Maxwell Denisson(MaXwEllDeN) ## ## Version: 1.0 ## ################################################ ]] function onUse(cid, item, frompos, item2, topos) local tekz, takz, tikz, XTz = {}, {}, {}, {} for _, v in pairs(getAllItemsInPos(topos, {1642, 1643, 1644, 1645, 1617, 1618, 1620, 1621})) do table.insert(takz, v) end for _, v in pairs(takz) do if not isInArray(tikz, v.uid) then if (v.itemid ~= 2555) then table.insert(XTz, v) end table.insert(tikz, v.uid) table.insert(tekz, v.itemid) end end if not (isInArray(tekz, 2555)) then return false end local u, d = _SMITHY_.getRevenue(topos) if (u == 0) then for i, v in pairs(d) do if (math.random(100) > 49) then local tp = (v.type > 0) and v.type or 1 doRemoveItem(v.uid, tp) end end if (#d > 0) then doSendMagicEffect(topos, 3) doPlayerSendTextMessage(cid, 21, "Failure!") end return true end local rec = _SMITHY_.receitas[u] if (math.random(10) + _SMITHY_.getLevel(cid) < rec.dif) then for i, v in pairs(d) do if (math.random(100) > 49) then local tp = (v.type > 0) and v.type or 1 doRemoveItem(v.uid, tp) end end doSendMagicEffect(topos, 3) return doPlayerSendTextMessage(cid, 21, "Failure!") end local xp = math.random(10) + rec.dif doSendAnimatedText(getThingPos(cid), xp, 125) _SMITHY_.addExp(cid, xp) if (_SMITHY_.getExp(cid) >= _SMITHY_.getExpToNextLevel(cid)) then doPlayerSendTextMessage(cid, 22, "You advanced from level ".. _SMITHY_.getLevel(cid) .. " to level ".. _SMITHY_.getLevel(cid) + 1 .. ", in smithy skills.") _SMITHY_.addLevel(cid, 1) end doPlayerSendTextMessage(cid, 27, "Experience: ".. _SMITHY_.getExp(cid) .. "/".. _SMITHY_.getExpLevel(_SMITHY_.getLevel(cid) + 1) ..".") for _, v in pairs(d) do local tp = (v.type > 0) and v.type or 1 doRemoveItem(v.uid, tp) end doSendMagicEffect(topos, 3) doPlayerSendTextMessage(cid, 25, "You've forged a ".. getItemNameById(rec.ma[1]) .. "!") return doCreateItem(rec.ma[1], rec.ma[2], topos) endTAG:
@Libs
Na pasta lib copie qualquer arquivo com a extenção lua, e renomeie ele para SmithLib, abra, delete tudo que houver dentro dele, copie esse conteúdo e salve:
--[[ ################################################ ## Smith System ## ## Author: Maxwell Denisson(MaXwEllDeN) ## ## Version: 1.0 ## ################################################ ]] _SMITHY_ = { exp_b = 40, receitas = { --dif = Dificuldade [1] = {dif = 5, -- Staff re = {{5892, 2}, }, ma = {2401, 1} }, [2] = {dif = 10, -- Mercenary Sword re = {{2401, 1}, {9971, 5}, {5887, 3}, {5892, 2}, }, ma = {7386, 1} }, [3] = {dif = 3, -- Huge chuck of crude iron re = {{5880, 20}, }, ma = {5892, 1} }, [4] = {dif = 20, -- Piece of Royal Steel re = {{5880, 10}, {2475, 1}, }, ma = {5887, 3} }, } } _SMITHY_.getRevenue = function (pos) local recs = {} local ipos = {} local posi = {} local block = {1642, 1643, 1644, 1645, 1617, 1618, 1620, 1621, 2555} local IDEx = 0 for i, v in pairs(_SMITHY_.receitas) do recs[i] = {} for _, a in pairs(v.re) do for b = 1, a[2] do table.insert(recs[i], a[1]) end end end local Zk = {} for _, v in pairs(getAllItemsInPos(pos, block)) do if not isInArray(Zk, v.uid) then table.insert(ipos, v) table.insert(Zk, v.uid) end end for _, v in pairs(ipos) do local t = (v.type > 0) and v.type or 1 for te = 1, t do table.insert(posi, v.itemid) end end for _, v in pairs(recs) do local AE = true for x, i in pairs(posi) do if (AE) then if (not isInArray(v, i)) or (#v ~= #posi) then AE = false else IDEx = _ end end end end if (#recs < 1) then return 0, ipos else return IDEx, ipos end end _SMITHY_.getExp = function (uid) if (getPlayerStorageValue(uid, 58913) < 1) then setPlayerStorageValue(uid, 58913, 0) end return getPlayerStorageValue(uid, 58913) end _SMITHY_.getLevel = function (uid) if (getPlayerStorageValue(uid, 58912) < 1) then setPlayerStorageValue(uid, 58912, 1) end return getPlayerStorageValue(uid, 58912) end _SMITHY_.addLevel = function (uid, ammount) local level = _SMITHY_.getLevel(uid) return setPlayerStorageValue(uid, 58912, level + ammount) end _SMITHY_.getExpToNextLevel = function (uid) return _SMITHY_.getExpLevel(_SMITHY_.getLevel(uid) + 1) end _SMITHY_.getExpLevel = function (level) return level * (_SMITHY_.exp_b) + (level - 1* (_SMITHY_.exp_b)) end _SMITHY_.setExp = function (uid, ammount) return setPlayerStorageValue(uid, 58913, ammount) end _SMITHY_.addExp = function (uid, ammount) local xp = _SMITHY_.getExp(uid) return _SMITHY_.setExp(uid, xp + ammount) end function getAllItemsInPos(pos, block) local results = {} for _ = 1, 255 do local findPos = {x = pos.x, y = pos.y, z = pos.z, stackpos = _} local item = getThingFromPos(findPos) if (not isInArray(block, item.itemid)) and (item.uid > 1) then table.insert(results, item) end end return results end#Configuração
-- Mercenary Sword [2] = {dif = 10, -- Dificuldade para forjar o item(Influencia na experiência ganha) re = { -- RECEITA DO ITEM -- ID, QUANTIDADE {2401, 1}, {9971, 5}, {5887, 3}, {5892, 2}, }, -- RESULTADO DA FORJA -- ID, QUANTIDADE ma = {7386, 1} },Bye [: