Incrivel o sistema muito interessate ele adorei, rep++
Irei implantar no meu serve ;D
info
Grupo: Artesão
Registrado: 06/01/08
Posts: 137
Reputação: +10
Char no Tibia: LarissaxD

Incrivel o sistema muito interessate ele adorei, rep++
Irei implantar no meu serve ;D
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

kk queria aprender a usar POO em .lua '--'
fico muito bom ms... to usando muito esse sistema no diablo 3 kk ty
info
Grupo: Barão
Registrado: 18/10/10
Posts: 246
Reputação: +89
Char no Tibia: Elite Pamcadaum

Skyen, você não sabe o quanto eu procurei esse script quando eu não sabia programar e ele não estava mais no outro fórum. Belo sistema parabéns por fazer códigos tão bons de ser lidos e muito funcionais, é ótimo ver você um pouco ativo no mundo dos OTS novamente.
Olha uma versão que eu fiz do teu sistema:
info
Registrado: 31/12/69
Posts: 0
Reputação: 0
Skyen, você não sabe o quanto eu procurei esse script quando eu não sabia programar e ele não estava mais no outro fórum. Belo sistema parabéns por fazer códigos tão bons de ser lidos e muito funcionais, é ótimo ver você um pouco ativo no mundo dos OTS novamente. Olha uma versão que eu fiz do teu sistema:
Wow! Gostei bem mais do seu! Como fez essa janelinha de seleção?
info
Grupo: Barão
Registrado: 18/10/10
Posts: 246
Reputação: +89
Char no Tibia: Elite Pamcadaum

Wow! Gostei bem mais do seu! Como fez essa janelinha de seleção?Skyen, você não sabe o quanto eu procurei esse script quando eu não sabia programar e ele não estava mais no outro fórum. Belo sistema parabéns por fazer códigos tão bons de ser lidos e muito funcionais, é ótimo ver você um pouco ativo no mundo dos OTS novamente. Olha uma versão que eu fiz do teu sistema:
Se não me engano o TFS do cliente 9.70 tem a função addPlayerDialog, algo assim. Eu tava jogando LOL ai tô no Janelas, quando eu for pro Linux eu posto o código aqui.
@Edit
Editado Janeiro 30 por MaXwEllDeN
info
Registrado: 31/12/69
Posts: 0
Reputação: 0
Vou postar alguns scripts meus que estiveram engavetados. Faz algum tempo que fiz estes scripts, então não vou postar screenshots ou como configurar, mas as configurações são fáceis de entender, então divirtam-se.
Esse é o remake de um dos meus melhores scripts, muito melhor que a primeira versão. Foi meu segundo script pra open tibia feito usando orientação a objetos (ao menos ao jeito OO de Lua).
Quem já jogou Diablo 2 vai entender do que se trata. Esse sistema consiste em vários "teleports", chamados de "warps", espalhados no seu mapa, aonde você quiser. Cada warp tem uma identificação, por exemplo "dark cave" ou "venore". Todos os warps são interligados, o que significa que o player pode ir de um warp à outro, desde que esteja pisando em cima de um warp. Porém, ele só pode ir para outro lugar caso tenha ativado o warp desse lugar antes: Se um player nunca esteve na "dark cave" ou não ativou o warp de lá, ele não pode usar um outro warp para ir para lá.
Para ativar um warp, o player deve dar "use" no warp ou pisar em cima dele.
Para ver a lista de warps ativados e as restrições de cada warp, o player deve dar "use" no warp.
Para ir de um warp para outro, o player deve satisfazer as condições de level ou mana do warp de destino e ter ativado o warp de destino antes. Além disso, deve saber a identificação do outro warp (que pode descobrir dando "use" em algum warp) e estar pisando em cima de algum warp, e então dizer "warp identificação do destino". Por exemplo, se eu estou em venore e quero ir para a dark cave, e já ativei o warp de lá antes, basta pisar em cima do warp de venore e dizer "warp dark cave".
Você pode usar o item que quiser como sendo um warp. Eu usava o item de ID 9742, mas parece que ele é moveable. Apenas tenha certeza de alterar o ID do item no actions.xml e no movements.xml.
Para criar um novo warp, coloque o item no mapa e abra o arquivo /data/lib/warpgate.lua, e vá até o final dele. Existem três warps de exemplo já adicionados. Apague-os e, para criar um novo, use o seguinte comando:
warp:new(1000, "Gate 1", {x=1, y=1, z=7}, 10, 20)Onde o 1000 é a StorageID do warp, "Gate 1" é a identificação do warp, {x=1, y=1, z=7} é a posição do warp, 10 é a mana necessária e 20 é o level necessário. A mana e o level podem ser omitidos.
Por exemplo, para configurar a dark cave com StorageID 5000:
warp:new(5000, "Dark Cave", {x=100, y=120, z=8})Agora, ao script:
/data/lib/warpgate.lua
-- This script is part of Warp Gate System -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. warp = { config = { statusInactive = -1, statusActive = 1, talkType = TALKTYPE_ORANGE_1, warpEffect = CONST_ME_MAGIC_GREEN, stepIn = CONST_ME_MAGIC_BLUE, stepOut = CONST_ME_POFF, listPrefix = " ", listHeadline = "You can warp to:", noWarp = "You must stand above a warp gate.", noDestiny = "The gate you want to warp doesn't exist.", noMana = "You can't support the mana consumed by the gate you want to warp.", noLevel = "You can't support the level required by the gate you want to warp.", inDestiny = "You can't warp the gate that you are standing.", notActive = "You must find and activate your destiny's gate before warp it.", inFight = "You cannot warp a gate while you are in battle.", }, name = "", pos = { x = nil, y = nil, z = nil, }, mana = 0, level = 0, gates = {}, } function warp:new(id, name, pos, mana, level) if self:getWarpById(id) then return self:getWarpById(id) end local object = {id=id or #warp.gates+1, name=name, pos=pos, mana=mana, level=level} local index = {} setmetatable(object, {__index = self}) warp.gates[id] = {} setmetatable(warp.gates[id], {__index = object}) return object end function warp:getList() return self.gates end function warp:getWarpById(id) return self.gates[id] end function warp:getWarpByName(name) for index, warp in pairs(self.gates) do if warp.name:lower() == name:lower() then return warp end end return false end function warp:getWarpByPosition(pos) for index, warp in pairs(self.gates) do if warp.pos.x == pos.x and warp.pos.y == pos.y and warp.pos.z == pos.z then return warp end end return false end function warp:isActive(cid) if getPlayerStorageValue(cid, self.id) == self.config.statusActive then return true end return false end function warp:activate(cid) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The Warp Gate is now active!") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE) return setPlayerStorageValue(cid, self.id, self.config.statusActive) end function warp:deactivate(cid) return setPlayerStorageValue(cid, self.id, self.config.statusInactive) end warp:new(1000, "Gate 1", {x=1, y=1, z=7}) warp:new(2000, "Gate 2", {x=2, y=2, z=7}) warp:new(3000, "Gate 3", {x=3, y=3, z=7})/data/actions/scripts/warpgate.lua
-- This script is part of Warp Gate System -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. function onUse(cid, item, frompos, itemEx, pos) local usedwarp = warp:getWarpByPosition(pos) if not usedwarp then return false end if not usedwarp:isActive(cid) then usedwarp:activate(cid) return true end local text, names = warp.config.listHeadline .. "\n", {} for index, gate in pairs(warp:getList()) do if gate:isActive(cid) then table.insert(names, gate.name) end end table.sort(names) for index, value in pairs(names) do text = text .. "\n" .. warp.config.listPrefix .. value if warp:getWarpByName(value).mana > 0 then text = text .. " [MP: " .. warp:getWarpByName(value).mana .. "]" end if warp:getWarpByName(value).level > 0 then text = text .. " [Lv: " .. warp:getWarpByName(value).level .. "]" end end doShowTextDialog(cid, item.itemid, text) return true end/data/actions/actions.xml
/data/movements/scripts/warpgate.lua
/data/movements/movements.xml
/data/talkactions/scripts/warpgate.lua
/data/talkactions/talkactions.xml