Líderes
-
-
-
xWhiteWolf
HéroiPontos3605Total de itens -
Conteúdo Popular
Exibindo conteúdo com a maior reputação em 12/04/15 em todas áreas
-
Shop Admin Gesior 2012 (TFS 0.3.6 ~ 0.4, 1.0)
Shop Admin Gesior 2012 (TFS 0.3.6 ~ 0.4, 1.0)
Rodrigo94 e um outro reagiu a dezon por uma resposta no tópico
2 pontos[+] Shop Admin Gesior 2012 (TFS 0.3.6 ~ 0.4, 1.0) [+] [+] Nova versão 2015 [+] Olá pessoal! Quero apresentar a mais nova versão do meu script para administrar Web Shop do Gesior 2012. [+] O que tem de novo?: O script foi revisado; Comentado as principais partes; Escrito algumas funções e ações novas; Revisado anti-inject; Agora você pode adicionar pontos para quem fizer doação; De uma forma geral, foi revisado de cabo à rabo ! [+] Imagens: [+] Galeria de imagens online http://postimg.org/gallery/1ssnwbf1i/ [+] Instalação: Basta você ter o Gesior 2012 instalado junto aos scripts LUA de shop do mesmo; Ter o banco de dados instalado e um servidor TFS 0.3.6+, TFS 1.0, 1 rodando também. + Vá na pata {seu_web_server}\www ou htdocs\pages\ e renomeie o arquivo 'shopadmin.php' para 'shopadmin.php.old'; + Faça download do script novo e cole na pasta que citei à cima; + Faça download desse arquivo http://item-images.ots.me/items_images_1076.zip; + Copie e cole a pasta que vem dentro desse arquivo e cole na pasta {seu_web_server}\www ou htdocs\images\ ficando assim {seu_web_server}\www ou htdocs\images\items\ e dentro dessa pasta as imagens dos itens do tibia; + Pronto! [+] Download: http://www.mediafire.com/view/z62d9zxylpg36dz/shopadmin.php [+] Scan: https://www.virustotal.com/pt/file/c06a2f7e1c1909b34f4dee2a7c27930a6c7cad1882edfcdf101689b0b61899d9/analysis/1399682407/ [+] ATENÇÃO: Bug encontrado: Na realidade o shopadmin.php desenvolvido por mim, não contém bug's, ele faz o registro das ofertas corretamente, o que eu não consegui consertar foi o data/globalevents/scripts/others/shop.lua. Ele não consegue criar o container e adicionar os itens dentro desse container da oferta cadastrada, exemplo: se você criar uma BP de SD, dá o seguinte erro: Lua Script Error: [GlobalEvent Interface] data/globalevents/scripts/others/shop.lua:onThink LuaScriptInterface::luaPlayerAddItemEx(). Item not found stack traceback: [C]: in function 'addItemEx' data/lib/compat/compat.lua:363: in function 'doPlayerAddItemEx' data/globalevents/scripts/others/shop.lua:50: in function <data/globalev ents/scripts/others/shop.lua:7> Claro que estou correndo atrás de resolver esse problema, mas se por um acaso alguém tiver a solução, peço que por gentileza, poste aqui que darei os devidos créditos! [+] Como adicionar items? Para adicionar items ao shopping é muito fácil, basta você seguir igual eu postei nas fotos a configuração, respeitando o ID do item, Quantidade, o Tipo da oferta e etc, assim você enviará uma nova oferta para o seu site. Para adicionar uma oferta do tipo Container (Bp, Bag, etc) é fácil também, basta você preencher como na imagem à seguir: [+] Explicando: Coloque o 'Nome' da oferta. Insira uma 'Descrição' para essa oferta. Diga a quantidade de 'Premium points' necessários. Selecione o tipo da oferta: 'Item' ou 'Container'. Coloque o 'ID Item 1' à ser vendido, caso seja um item normal: armadura, espada, etc. Preencha a 'Qtde. Item 1' que o player irá receber quando comprar essa oferta. Deixe em branco 'ID Item 2' e 'Qtde. Item 2'. Caso seja BP, selecione o tipo para 'Container', no 'ID Item 1' coloque o Id da BP. Em 'Qtde. Item 1' você deve colocar a quantidade para cada item dentro do container, exemplo: se for BP de Runa, para preencher a BP você terá um total de 20 slots preenchidos pela quantidade de runas do 'Qtde. Item 2', então coloque 20, pois representa a quantidade de slots dentro do container. Agora em 'ID Item 2' você coloca o ID da Runa ou do item que você está vendendo dentro do container. Preencha a 'Qtde. Item 2' com a quantidade para cada slot do container que você está vendendo. Clique em salvar. Pronto, adicionado! [+] Isso é necessário: Lembrando que você precisa estar já com os scripts em lua funcionando corretamente do sistema de shop do Gesior 2012, você pode encontrá-los aqui: http://otland.net/threads/gesior2012-items-shop-installation-administration.170654/ Obrigado à todos!!!2 pontos -
10.80+ Grimvale Full + Medusa Tower + Hero Fortress
Eai galera do TK Estou afim de trazer para a comunidade algumas áreas que não encontradas por ai, sei que muitos vendem essas áreas, inclusive já me ofereceram diversas vezes e não irei citar nomes, mas estou trazendo para vocês free! Se eu gostar dos likes quem sabe não trago as outras (tenho todas)! Enjoy Grimvale - Coordenadas do mapa: x:33350 y:31683 z:7 Download: http://www.mediafire.com/download/b1gys0531n309vi/Grimvale_viking_tibia.rar Senha para extrair: www.vikingtibia.com.br Scan: https://www.virustotal.com/pt/file/e748e7dd90555fdd8bde43af1da0715c242694469ce4ddcaa7956ae3f25191a6/analysis/1449240145/ Medusa Tower - Coordenadas do mapa: x:32872 y:32833 z:7 Download: http://www.mediafire.com/download/898bdqpejajnm95/MEDUSA_TOWER_viking_tibia.rar Senha para extrair: www.vikingtibia.com.br Scan: https://www.virustotal.com/pt/file/98260b40637d4e75a7a24a0fec05d9b5a731ea1c5a174c0dddbd6b7653a816c0/analysis/1449240581/ Hero Fortress - Coordenadas do mapa: 33223, 31649, 7 Download: http://www.mediafire.com/download/psa4o1kx74cg2a3/Hero_Fortress_Viking_tibia.rar Senha para extrair: www.vikingtibia.com.br Scan: https://www.virustotal.com/pt/file/4ff4ac064964187f8da36da5b8801ee665d5a6204fe466df29a88354f69be40c/analysis/1449241032/ Ajudei? REP+ Créditos: VikingTibia e Romenes Hasvu de outro forum (que sou eu também )2 pontos
-
Perfect Upgrade System
1 pontoNome: Perfect Upgrade System Tipo: Biblioteca, Action, Sistema Autor: Oneshot Essa é a versão final do Perfect Refine System ou Perfect Upgrade System criado por mim. É um sistema construído em cima de funções em POO (orientação a objetos), o que o torna muito versátil, possibilitando a outros programadores/scripters criarem seus próprios sistemas com base na biblioteca. A função do sistema é simples. Não passa de um sistema de refino, presente em todos os servidores, onde você usa um item em um equipamento e este fica mais forte e ganha um nome caracterizando o nível de força - bem clichê - mas muito interessante. Meu sistema é um pouco diferente dos outros, pois possui algumas características exclusivas, listadas abaixo: O nível máximo configurável é praticamente ilimitado O sistema funciona com armas de combate corpo-a-corpo, bows e crossbows. O refino pode falhar, não acontecendo nada, regredindo o nível ou resetando ele. Há um sistema nativo de broadcasts, que são enviados quando um jogador consegue refinar um equipamento até um certo nível ou maior. As chances são configuradas manualmente e sua randomização é muito precisa. Há dois modos de instalar o sistema em seu servidor, o primeiro é baixar a pasta com os scripts necessários e apenas copiar as chaves nos arquivos XMLs ou então seguir o curto tutorial de instalação. Crie um arquivo chamado upgradesystem.lua na pasta data/lib e copie o conteúdo abaixo: --[[ 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] = {100, false, false}, [2] = {90, false, false}, [3] = {75, false, false}, [4] = {60, true, false}, [5] = {45, true, false}, [6] = {30, true, false}, [7] = {25, true, false}, [8] = {20, true, true}, [9] = {15, true, true}, [10] = {10, true, true}, [11] = {10, true, true}, [12] = {5, true, true} }, broadcast = 7, attributes = { ["attack"] = 2, ["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}}, }, 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(self.levels[self.item.level][3] == true and (self:chance().erase * 100) > math.random(1, 10000)) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.erase:format(self.item.name)) self:setItemName(self.item.name) for key, value in pairs(self.attributes) do if self.item[key] > 0 then doItemSetAttribute(self.item.uid, key, self.item[key]) end end elseif(self.levels[self.item.level][2] == true and (self:chance().downgrade * 100) > math.random(1, 10000)) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.downgrade:format(self.item.name, (self.item.level - 1))) self:setItemName((self.item.level == 1 and self.item.name or self:getItemName():gsub("%+(%d+)", "+".. (self.item.level - 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[key] + value * (self.item.level - 1))) end end else doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.fail:format(self.item.name, (self.item.level + 1))) end return "fail" end end Crie um arquivo chamado upgrade.lua em data/actions/scripts e cole o conteúdo abaixo: function onUse(cid, item, fromPosition, itemEx, toPosition) if isCreature(itemEx.uid) then return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) end local obj = UpgradeHandler:new(itemEx) if(obj == false) then return doPlayerSendCancel(cid, UpgradeHandler.message.notupgradeable) end local status = obj:refine(cid, item) if status == "success" then --doSendAnimatedText(toPosition, "Success!", COLOR_GREEN) doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN) elseif status == "fail" then --doSendAnimatedText(toPosition, "Fail!", COLOR_RED) doSendMagicEffect(toPosition, CONST_ME_POFF) else doSendMagicEffect(toPosition, CONST_ME_POFF) end return true end No arquivo actions.xml, cole a seguinte linha: <action itemid="8306" event="script" value="upgrade.lua"/> Para adicionar mais níveis de refino no sistema, edite a seguinte tabela: levels = { [1] = {100, false, false}, [2] = {90, false, false}, [3] = {75, false, false}, [4] = {60, true, false}, [5] = {45, true, false}, [6] = {30, true, false}, [7] = {25, true, false}, [8] = {20, true, true}, [9] = {15, true, true}, [10] = {10, true, true} }, Por padrão, ela já está configurado como na maioria dos MMORPGs, 10 níveis de refino, com chances de sucesso, regressão e "quebra". Mas se você quiser, por exemplo, adicionar mais dois níveis, siga o modelo, sempre colocando uma vírgula no final com exceção da última linha da tabela: levels = { [1] = {100, false, false}, [2] = {90, false, false}, [3] = {75, false, false}, [4] = {60, true, false}, [5] = {45, true, false}, [6] = {30, true, false}, [7] = {25, true, false}, [8] = {20, true, true}, [9] = {15, true, true}, [10] = {10, true, true}, [11] = {10, true, true}, [12] = {5, true, true} }, O primeiro valor é chance de sucesso, o segundo se o item pode regredir na tentativa e o terceiro é se o item para "quebrar" (perder todo o nível de refino). Para criar novas ferramentas (itens) de refinar, configure a tabela abaixo: tools = { [8306] = {range = {0, 10}, info = {chance = 0, removeable = true}}, }, Seguindo o mesmo esquema da tabela anterior, vírgulas em todas as linhas com exceção da última, seguindo o modelo abaixo. Por exemplo, uma ferramenta de ID 8303 que refine do level +6 ao +10, que dê 10% de chance bônus e que seja finita, eu faço assim: tools = { [8306] = {range = {0, 10}, info = {chance = 0, removeable = true}}, [8310] = {range = {6, 10}, info = {chance = 10, removeable = true}} }, Em breve vídeo de demonstração com sistema em funcionamento. Perfect Upgrade System.rar1 ponto
-
[v32] GlobalFull 11/12 - New Asuras, Falcons, Warzones 4,5,6 . (Updates Frequentes)
[v32] GlobalFull 11/12 - New Asuras, Falcons, Warzones 4,5,6 . (Updates Frequentes)
anderson de souza reagiu a Qwizer por uma resposta no tópico
1 pontoGlobal 11/12x [v32] - New Falcons - New Asuras - Warzone 4,5,6 - Exercise Training - Raids 100% - Monstros 100% - Trainer Offline 100% - Trainer Online 100% - Taming system funcionando 100%; - Database completa - War System 100% - Global MAP Full - Store 100% - Imbuement - Prey System - Entre outros sistemas. Projeto no: GITHUB Scan Vírus Total IMAGES Créditos:1 ponto -
[TUTORIAL] Cortando sprites 32x32 (rápido)
Com esse tutorial vou ensinar a cortar sprites de forma rápida. Utilizei o Adobe Photoshop CS6 (inglês) no tutorial mas acredito que versões anteriores tenham as mesmas ferramentas. O tutorial será todo com imagens qualquer dúvida que aparecer eu esclareço. 1° Passo: 2° Passo: 3° Passo: obs: Não é necessário colocar "8 e 6", isso é a quantidade de linhas e colunas. 4° Passo: 5° Passo: Resultado:1 ponto
-
[TFS 1.1] Monster Tasks
1 pontoEsse npc permite escolher qual task o player irá fazer : Adonai.xml <?xml version="1.0" encoding="UTF-8"?> <npc name="Adonai" script="tasks.lua" walkinterval="2000" speed ="0" floorchange="0"> <health now="100" max="100"/> <look type="433" head="58" body="113" legs="50" feet="78" addons="1" mount="688"/> </npc> tasks.lua local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local xmsg = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local storage = 62003 local monsters = { ["Dragons"] = {storage = 5010, mstorage = 19000, amount = 10, exp = 5000, items = {{id = 2157, count = 1}, {id = 2160, count = 3}}}, ["Dragon Lords"] = {storage = 5011, mstorage = 19001, amount = 10, exp = 10000, items = {{id = 2492, count = 1}, {id = 2160, count = 5}}}, ["Hydras"] = {storage = 5012, mstorage = 19002, amount = 10, exp = 18000, items = {{id = 2195, count = 1}, {id = 2157, count = 8}}}, ["Demons"] = {storage = 5013, mstorage = 19003, amount = 10, exp = 20000, items = {{id = 2520, count = 1}, {id = 2160, count = 10}}} } local function getItemsFromTable(itemtable) local text = "" for v = 1, #itemtable do count, info = itemtable[v].count, ItemType(itemtable[v].id) local ret = ", " if v == 1 then ret = "" elseif v == #itemtable then ret = " and " end text = text .. ret text = text .. (count > 1 and count or info:getArticle()).." "..(count > 1 and info:getPluralName() or info:getName()) end return text end local function Cptl(f, r) return f:upper()..r:lower() end function creatureSayCallback(cid, type, msg) local player, cmsg = Player(cid), msg:gsub("(%a)([%w_']*)", Cptl) if not npcHandler:isFocused(cid) then if msg == "hi" or msg == "hello" then npcHandler:addFocus(cid) if player:getStorageValue(storage) == -1 then local text, n = "", 0 for k, x in pairs(monsters) do if player:getStorageValue(x.mstorage) < x.amount then n = n + 1 text = text .. ", " text = text .. ""..x.amount.." {"..k.."}" end end if n > 1 then npcHandler:say("I have several tasks for you to kill monsters"..text..", which one do you choose? I can also show you a {list} with rewards and you can {stop} a task if you want.", cid) npcHandler.topic[cid] = 1 xmsg[cid] = msg elseif n == 1 then npcHandler:say("I have one last task for you"..text..".", cid) npcHandler.topic[cid] = 1 else npcHandler:say("You already did all tasks, I have nothing for you to do anymore, good job though.", cid) end elseif player:getStorageValue(storage) == 1 then for k, x in pairs(monsters) do if player:getStorageValue(x.storage) == 1 then npcHandler:say("Did you kill "..x.amount.." "..k.."?", cid) npcHandler.topic[cid] = 2 xmsg[cid] = k end end end else return false end elseif monsters[cmsg] and npcHandler.topic[cid] == 1 then if player:getStorageValue(monsters[cmsg].storage) == -1 then npcHandler:say("Good luck, come back when you killed "..monsters[cmsg].amount.." "..cmsg..".", cid) player:setStorageValue(storage, 1) player:setStorageValue(monsters[cmsg].storage, 1) else npcHandler:say("You already did the "..cmsg.." mission.", cid) end npcHandler.topic[cid] = 0 elseif msgcontains(msg, "yes") and npcHandler.topic[cid] == 2 then local x = monsters[xmsg[cid]] if player:getStorageValue(x.mstorage) >= x.amount then npcHandler:say("Good job, here is your reward, "..getItemsFromTable(x.items)..".", cid) for g = 1, #x.items do player:addItem(x.items[g].id, x.items[g].count) end player:addExperience(x.exp) player:setStorageValue(x.storage, 2) player:setStorageValue(storage, -1) npcHandler.topic[cid] = 3 else npcHandler:say("You didn't kill them all, you still need to kill "..x.amount -(player:getStorageValue(x.mstorage) + 1).." "..xmsg[cid]..".", cid) end elseif msgcontains(msg, "task") and npcHandler.topic[cid] == 3 then local text, n = "", 0 for k, x in pairs(monsters) do if player:getStorageValue(x.mstorage) < x.amount then n = n + 1 text = text .. (n == 1 and "" or ", ") text = text .. "{"..k.."}" end end if text ~= "" then npcHandler:say("Want to do another task? You can choose "..text..".", cid) npcHandler.topic[cid] = 1 else npcHandler:say("You already did all tasks.", cid) end elseif msgcontains(msg, "no") and npcHandler.topic[cid] == 1 then npcHandler:say("Ok then.", cid) npcHandler.topic[cid] = 0 elseif msgcontains(msg, "stop") then local text, n = "", 0 for k, x in pairs(monsters) do if player:getStorageValue(x.mstorage) < x.amount then n = n + 1 text = text .. (n == 1 and "" or ", ") text = text .. "{"..k.."}" if player:getStorageValue(x.storage) == 1 then player:setStorageValue(x.storage, -1) end end end if player:getStorageValue(storage) == 1 then npcHandler:say("Alright, let me know if you want to continue an other task, you can still choose "..text..".", cid) else npcHandler:say("You didn't start any new task yet, if you want to start one, you can choose "..text..".", cid) end player:setStorageValue(storage, -1) npcHandler.topic[cid] = 1 elseif msgcontains(msg, "list") then local text = "Tasks\n\n" for k, x in pairs(monsters) do if player:getStorageValue(x.mstorage) < x.amount then text = text ..k .." ["..(player:getStorageValue(x.mstorage) + 1).."/"..x.amount.."]:\n Rewards:\n "..getItemsFromTable(x.items).."\n "..x.exp.." experience \n\n" else text = text .. k .." [DONE]\n" end end player:showTextDialog(1949, "" .. text) npcHandler:say("Here you are.", cid) elseif msgcontains(msg, "bye") then npcHandler:say("Bye.", cid) npcHandler:releaseFocus(cid) else npcHandler:say("What?", cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) creaturescripts.xml <event type="kill" name="Tasks" script="killtasks.lua"/> login.lua player:registerEvent("Tasks") killtasks.lua local config = { ['dragon'] = {amount = 10, storage = 19000, startstorage = 5010, startvalue = 1}, ['dragon lord'] = {amount = 10, storage = 19001, startstorage = 5011, startvalue = 1}, ['hydra'] = {amount = 10, storage = 19002, startstorage = 5012, startvalue = 1}, ['demon'] = {amount = 10, storage = 19003, startstorage = 5013, startvalue = 1} } function onKill(player, target) local monster = config[target:getName():lower()] if target:isPlayer() or not monster or target:getMaster() then return true end local stor = player:getStorageValue(monster.storage)+1 if stor < monster.amount and player:getStorageValue(monster.startstorage) >= monster.startvalue then player:setStorageValue(monster.storage, stor) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, 'Task message: '..(stor +1)..' of '..monster.amount..' '..target:getName()..'s killed.') end if (stor +1) == monster.amount then player:sendTextMessage(MESSAGE_INFO_DESCR, 'Congratulations, you have killed '..(stor +1)..' '..target:getName()..'s and completed the '..target:getName()..'s mission.') player:setStorageValue(monster.storage, stor +1) end return true end ___________________________________________________________________________________________ Como funciona ? O NPC oferece-lhe várias task, você pode escolher qual você deseja fazer. Se você não matar todos os monstros, o NPC irá dizer-lhe quantos você ainda tem que matar. Você pode para ver a lista de recompensa e as tasks que você já fez. Você pode parar com as tasks e ir fazer outra e depois continuar a antiga. Ao terminar as task elas não serão mais mencionados pelo NPC mas será mostrado como terminado na lista. Quando terminar as task o npc, dirá que todas foram completadas. Créditos : Limos, Summ1 ponto
-
[GlobalEvents] ServeSave - Shutdown/Automático
[GlobalEvents] ServeSave - Shutdown/Automático
premii reagiu a Natanael Beckman por uma resposta no tópico
1 pontoGalera é um script muito simples, porém pra mim é muito ÚTIL. Abra a pasta data/globalevents/scripts crie um arquivo .lua com o nome GlobalSave.lua, em seguida adicone o code: function prepareShutdown(minutes) if(minutes <= 0) then doSetGameState(GAMESTATE_SHUTDOWN) return false end if(minutes == 1) then doBroadcastMessage("Server is going down in " .. minutes .. " minute for global save, please log out now!") elseif(minutes <= 3) then doBroadcastMessage("Server is going down in " .. minutes .. " minutes for global save, please log out.") else doBroadcastMessage("Server is going down in " .. minutes .. " minutes for global save.") end shutdownEvent = addEvent(prepareShutdown, 60000, minutes - 1) return true end function onTime() return prepareShutdown(5) -- Quantos minutos pra executar o ServeSave. end Ajustes: Quando quiser modificar os minutos altere: -return prepareShutdown(5) - (5) = 5 minutos, eu recomendo no mínimo 5 minutos, em outras palavras não mexa. Em globalevents.xml adicione a tag seguinte: <globalevent name="GlobalSave" time="05:30" event="script" value="GlobalSave.lua"/> No meu ServeSave é feito as 05:30 da manhã, modifique pro horário desejado! Em config.lua verifique essa regra: Se tiver TRUE deixa, assim ele fecha o .exe se não tiver no seu config.lua não tem problema closeInstanceOnShutdown = true - - - Esse tutorial é só isso, clique em GOSTEI, e comente no tópico, muito obrigado! -------------------------------------------------------------------------------------------------------------------------------------------------------- AUTO RESTART -------------------------------------------------------------------------------------------------------------------------------------------------------- Pra você que utiliza Windows esse é perfeito: Dezon OT Admin [restarter] Pra você que utiliza Linux: Baixe esse arquivo, TFS.SH, bote dentro da pasta do seu OT. Esse arquivo está configurado pra abrir outro arquivo chamado tfs caso o seu seja outro nome mude pra esse, tfs. Sempre que for abrir seu OT execute esse comando ./tfs.sh& e assim toda vez que o OT cair ele renicia automaticamente.1 ponto -
[TalkAction] Scripts para PokeTIBIA
Olá a todos! Estou aqui para mostrar um script aonde será bem útil a servidores de Pokémon. Não é nada mais do quem um SHOP in-game. Como assim? Com estes 3 comandos será possível comprar Revives, Hyper Potions, Ultra Balls, trocar de nome pelo jogo e até mesmo comprar o Ditto. Detalhe o tipo de moeda que utilizei foi Small Diamonds, caso queria modificar leia passo a passo. Como se percebe, a maioria de servidores hoje em dia vende apenas estes items e outros, mais esses são os padrões. Chega de enrolação e vamos direto ao script. Changename Script: Primeiramente crie um arquivo em otserv/talkactions/scripts chamado changename.lua e adicione isso em seu arquivo. (Este script serve para modificar o nome do jogador pelo jogo). -- Creditos a Doughell function onSay(cid, words, param) local maxLen = 15 -- tamanho maximo do nome local itemid = 2145 ------ Numero do Item que será removido local proibido = [{"!","@","*"}-- simbolos proibidos for i = 1, #proibido do if string.find(tostring(param), proibido[i]) then doPlayerSendCancel(cid,"[AUTO SHOP] You can not use symbols in their name.") return TRUE end end if tostring(param) == "" then -- checkar se não é nome vazio doPlayerSendCancel(cid, "[AUTO SHOP] Choose a name to make the change of his surname.") return TRUE end if string.len(tostring(param)) > maxLen then doPlayerSendCancel(cid, "[AUTO SHOP] You can use a maximum of " .. maxLen .. " letters.") return TRUE end if not getTilePzInfo(getCreaturePosition(cid)) then doPlayerSendCancel(cid,"[AUTO SHOP] Can only be used in Protection Zone.") return TRUE end if getPlayerItemCount(cid, itemid) >= 1 then doPlayerRemoveItem(cid, itemid, 5) db.executeQuery("UPDATE `players` SET `name` = '"..param.."' WHERE `id` = "..getPlayerGUID(cid)..";") doPlayerSendTextMessage(cid,25,"[AUTO SHOP] You will be logged out in 5 seconds for the changes to be made.") addEvent(doRemoveCreature, 5*1000, cid, true) else doPlayerSendCancel(cid,"[AUTO SHOP] You don't have " .. getItemNameById(itemid) .. " to make the purchase of changename.") end return TRUE end Agora em talkactions.xml adicione em Players: <talkaction words="!changename" event="script" value="changename.lua"/> -- Explicação do Script (Changename): local maxLen = 15 -- tamanho maximo do nome O número 15 e a quantidade máxima de caracteres que poderá ser utilizado na troca de nome. local itemid = 2145 ------ Numero do Item que será removido Este e o ID do item que será removido, no caso do 2145 e Small Diamonds (moeda principal do PokeXGames). Aconselho a usar Small Diamonds. local proibido = {"!","@","*"} -- simbolos proibidos Estes e os símbolos proibidos, caso queria adicionar mais faça o seguinte: {"!","@","*","?"} adicionando dessa seguinte maneira: ,"?"} Ditto Script: Crie um arquivo em otserv/talkactions/scripts com o nome de ditto2.lua e adicione isso em seu arquivo: (Este script serve para adicionar a caixa do Ditto no jogador). function onSay(cid,words,param) if doPlayerRemoveItem(cid,2145,10) == TRUE then doPlayerAddItem(cid,1738,1) doCreatureSay(cid,"[AUTO SHOP] You bought your Pokemon Ditto, it cost 10 diamonds.",TALKTYPE_ORANGE_1) else doCreatureSay(cid,"[AUTO SHOP] You do not have two diamonds to make the purchase.",TALKTYPE_ORANGE_1) end end Agora em talkactions.xml adicione em Players: <talkaction words="!buyditto" event="script" value="ditto2.lua"/> A segunda parte do script você precisa ir otserv/actions/scripts crie um arquivo chamado ditto_.lua e adicione o seguinte: (Este script serve para o id da caixa ser usado para conseguir o Ditto) function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, 15215) <= 100 then doPlayerSendTextMessage(cid, 20,"[AUTO SHOP] Thank donations.") setPlayerStorageValue(cid, 15215, 1) local pox = getTownTemplePosition(1) local health = 325 local maxhealth = 325 local description = "Contains a Ditto." local poke1 = "This is Ditto's pokeball. HP = ["..health.."/"..maxhealth.."]" item = doCreateItemEx(2219) doItemSetAttribute(item, "poke", poke1) doItemSetAttribute(item, "nome", "Ditto") doItemSetAttribute(item, "apelido", "Ditto") doItemSetAttribute(item, "description", description) doPlayerAddItemEx(cid, item, true) doTransformItem(item, 2222) doPlayerSendTextMessage(cid, 27, "[AUTO SHOP] You just get the Pokemon Ditto.") doPlayerSendTextMessage(cid, 27, "Do not forget to donate this item has a cost of 10 diamonds, and you can not get this Pokemon through quests / npcs / catchs.") doTeleportThing(cid, pox) doSendMagicEffect(pox, 21) doPlayerAddSoul(cid, 1) doPlayerRemoveItem(cid,1738,1) setPlayerStorageValue(cid, 54842, "Ditto, ") return TRUE else doPlayerSendTextMessage(cid, 20, "Have you got this Pokemon.") end end Agora em actions.xml adicione: <action itemid="1738" event="script" value="ditto_.lua"/> -- Explicação do Script (Ditto): PARTE DAS TALKACTIONS if doPlayerRemoveItem(cid,2145,10) == TRUE then O número 2145 e o id da Small Diamonds, já o número 10 e a quantidade de Small Diamonds que precisa para comprar o Ditto. doPlayerAddItem(cid,1738,1) O número 1738 e o id da box, caso modificar este número modifique tambem em actions.xml! PARTE DAS ACTIONS doSendMagicEffect(pox, 21) O número 21 e o número do efeito que vai ser utilizado ao abrir a box, pode ser modificado em qual você preferir. doPlayerAddSoul(cid, 1) Será adicionado 1 de soul, como se fosse 1 de catch (dependendo de alguns servidores) se preferir retire a linha inteira. doPlayerRemoveItem(cid,1738,1) Este e o id da box, caso você muda-lá na talkactions, e na actions.xml mude aqui tambem. Kit Script: Crie um arquivo em otserv/talkactions/scripts chamado kit.lua e adicione isso dentro dele: (Este script serve para receber Revives, Ultra Balls e Hyper Potions). function onSay(cid,words,param) if doPlayerRemoveItem(cid,2145,2) == TRUE then doPlayerAddItem(cid,2269,100) doPlayerAddItem(cid,2275,100) doPlayerAddItem(cid,2146,100) doCreatureSay(cid,"[AUTO-SHOP]: You just buy ultra ball 100x, 100x revive and 100x hyper potion. All this will cost 2 diamonds!",TALKTYPE_ORANGE_1) else doCreatureSay(cid,"[AUTO-SHOP]: You do not have two diamonds to make the purchase.",TALKTYPE_ORANGE_1) end end Agora em talkactions.xml adicione: <talkaction words="!buykit" event="script" value="kit.lua"/> -- Explicação do Script (Kit): if doPlayerRemoveItem(cid,2145,2) == TRUE then O id 2145 e o Small Diamonds e o número 2 e a quantidade que será retirada para a realização da compra do kit. doPlayerAddItem(cid,2269,100) O id 2269 e o da Ultra Ball e o número 100 e a quantidade que o player receberá de Ultra Balls. doPlayerAddItem(cid,2275,100) O id 2275 e o do Revive, e o número 100 e a quantidade que o player receberá de Revives. doPlayerAddItem(cid,2146,100) O id 2146 e o da Hyper Potion, e o número 100 e a quantidade que o player receberá de Hyper Potions. Bom, estes são os scripts prometido, mas se alguém quiser coloca outras talkactions como a !buykit vou colocar abaixo o que poderam usar de base: function onSay(cid,words,param) if doPlayerRemoveMoney(cid,10000) == TRUE then doPlayerAddItem(cid,2173,1) doCreatureSay(cid,"Mensagem que ele conseguiu comprar o item.",TALKTYPE_ORANGE_1) else doCreatureSay(cid,"Mensagem quando não possui dinheiro ou diamantes suficientes.",TALKTYPE_ORANGE_1) end end if doPlayerRemoveMoney(cid,10000) == TRUE then Essa função diz que irá remover 10k para comprar o item, se você quiser que remova outra coisa por exemplo um shield você adiciona a seguinte função no lugar dessa: doPlayerRemoveItem(cid,1738,1) ficando assim: doPlayerRemoveItem(cid,1738,1) = TRUE then O id do shield você modifica no 1738 e a quantidade no número 1. doPlayerAddItem(cid,2173,1) Esas função adiciona o item e a quantidade no jogador, exemplo: 2173 e o ID do item, e o número 1 e a quantidade só modificar do seu gosto. O que você pode adicionar em um script? Efeitos, para adicionar um efeito basta colocar essa função: doSendMagicEffect(getThingPos(cid), 132) O número 132 e o número do efeito, para pesquisar mais procure pelo jogo no GOD o seguinte: /z 1, /z 2, /z 3 até o seu limite. É isso ai galera, qualquer dúvida postem ou dêem sujestões! Detalhe: as cores nos scripts foram retiradas por bug, em outra hora adicionarei novamente!1 ponto
-
[C++] doStartTrade(cid, target, item)
[C++] doStartTrade(cid, target, item)
Drazyn1291 reagiu a grafit por uma resposta no tópico
1 pontoBom dia! Há um certo tempo eu tive um servidor de Tibia que possuía um sistema bem interessante de tradevip. Funcionava da seguinte maneira, o player que possuísse premdays(ou VIP) usava o comando !tradevip [DIAS], [Nome do Jogador] e automaticamente gerava uma janela de trade com um item e assim poderiam ser vendidos dias de premium sem o perigo de ninguém ser roubado. Por padrão isso não é possível no Tibia, mas um usuário chamado Oneshot fez modificações nas sources para tornar isso possível. Segue agora as modificações que permitem funcionar esse sistema: Em luascript.h, adicione essa linha, abaixo das linhas parecidas. static int32_t luaDoStartTrade(lua_State* L); Em luascript.cpp, adicione isso perto das linhas parecidas. //doStartTrade(cid, target, item) lua_register(m_luaState, "doStartTrade", LuaInterface::luaDoStartTrade); Ainda em luascript.cpp, adicione isso logo abaixo de alguma estrutura parecida. int32_t LuaInterface::luaDoStartTrade(lua_State* L) { ScriptEnviroment* env = getEnv(); Item* item = env->getItemByUID(popNumber(L)); if(!item) { errorEx(getError(LUA_ERROR_ITEM_NOT_FOUND)); lua_pushboolean(L, false); return 1; } Player* target = env->getPlayerByUID(popNumber(L)); Player* player = env->getPlayerByUID(popNumber(L)); if(!player || !target) { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); return 1; } if(g_game.internalStartTrade(player, target, item)) { lua_pushboolean(L, true); return 1; } return 1; } Agora use sua imaginação para criar seus scripts. Créditos: Oneshot1 ponto -
Sprite do cp do Pxg, e itens do Pxg
Sprite do cp do Pxg, e itens do Pxg
Allone reagiu a Developer Berg por uma resposta no tópico
1 pontoOlá Galerinha como eu estou " Bonzinho Hoje " heuheu venho aqui ter a honra de passar para vcs vários itens do PXG, é isso mesmo que vc leu e quais são esses itens ? ( Sabem aquele novo cp que o Pxg tem ? aquele bonito que teve agr no update ? Ss é ele mesmo, fora outros itens muito massas que vou deixar os prints ) Obs: coloquei esse tópico nessa área por causa que no tópico " Download De Sprites " n ta podendo + criar tópico lá, então Agradeço se moverem pra o lugar Certo Link do download --->>> http://www.mediafire.com/download/9v349c4kjdv94s1/Sprites+fodas.rar Scan --->>>https://www.virustotal.com/pt/file/c16b849d74e50f467c2a048957e7b604016d2cfdd5b218b34ba86115a92b06b8/analysis/1430576442/ Obs: quando for abrir no Object Builder vc precisa marcar as opções Estendido e Transparência1 ponto -
NTO B&W - Editada por PedroSTT
1 pontoBom , hoje vou postar aqui no TK ( Tibia king ) A base B&W editada por mim. Download no final da topico Estou postando porque eu estava com um projeto chamado "Naruto Space" , mas desisti e vou postar a edição que fiz na B&W. È necessario trocar a DISTRO , pois ela bugou , então recomendo [+] Distro nova [+] Novidades [+] Bugs [+] Prints [+] DISTRO NOVA [+] NOVIDADES E CARACTERISTICAS [+] BUGS [+] PRINTS [+] DOWNLOAD Client Scan -- Detectou virus , mas não tem , acredite se quiser <-____________-> Servidor Scan -- Detectou virus , mas não tem , acredite se quiser [+] CREDITOS -leozynho123 Pelo TFS - Madara Rinnegan (servidor base) - [ADM] Johnata Editar Praticamente Todo o Servidor - Eytor por acrescentar algumas coisas - Eu por acrescentar mais algumas coisas1 ponto
-
Tibia está zerado + preview [GPS SYSTEM]
Tibia está zerado + preview [GPS SYSTEM]
davidvietro reagiu a xWhiteWolf por uma resposta no tópico
1 pontoGraças ao nosso marvilhoso colega Elwyn o tibia foi zerado hoje dia 09/03/2015 haha. Ele lançou uma função crucial pra fazer qualquer script relacionado à movimentação ao combinar o algoritmo de pathFinding da source à uma função Lua. Sei que muita gente não frequenta a seção de programming OU não entendeu nada doque eu falei mas pqp, deem uma rápida olhada noque dá pra criar: Isso é um GIF de um sistema que eu to tentando fazer desde novembro de 2014 e que agora eu finalmente consegui terminar graças à genialidade desse mito. Trata-se de uma talkaction que vc digita !Lugarquevcquerir e o personagem vai andando automaticamente até o local e quando chega ele manda uma msg avisando que vc chegou ao destino, semelhante a um GPS!!!!!11111 Fora que com isso podemos controlar os movimentos do NPCS!!!!111 Dá pra fazer uma fucking quest que vc tem que seguir o npc até um altar secreto e seilá, ele é um npc normal que vende backpack/rope/shovel mas qnd dá 18h de um certo dia ele visita a tumba e volta pra cidade (e vc tem que seguir ele pra descobrir isso). SUCH RPG!!!!! Sei lá, eu animei demais com isso >.< As possibilidades são tantas que eu não consigo nem me conter AUHIEUHIUHI dá pra fazer MUITA coisa cara, inclusive vou tentar trazer os scripts relacionados à essa função pra vocês. Se você gostou das idéias, sério, não clica em gostei no meu tópico, vai lá no tópico do elwyn e clica... ele é o verdadeiro mito que resolveu isso.1 ponto -
[C] Checar acesso com criptografia simples
antes de dar minhas considerações esqueçam a palavra encriptar e codificado. é um termo horrível para tentar se expressar, a melhor definição é algoritmos para esconder o real conteúdo. nem sempre é possível realizar a operação reversa. se eu te dar um hash você consegue fazer o inverso sabendo o algoritmo que foi utilizado? Existe sim algoritmo de criptografia de mão única, eles são trabalhosas de fazer a operação inversa, mas existe sim. Também tem a TrapDoor que são aquelas que normalmente tem uma outra chave para de fator executar o processo reverso, quando possível. Leia sobre RSA e me diga o que ela é. Criptografia é um algoritmo para esconder o real texto através de cálculos macabros. O algoritmo que seu código utiliza, pelo que eu entendi, ele só pegar o char code e decrementa dois números do original. void DCript(char p[20]) { int i; for(i=0; p[i] != '\0'; i++) p[i] = p[i]-2; } O que aconteceu com o MD5, SHA1 não foi simplesmente fazer o processo reverso e sim mapeá-la. Ai que é que está a sacada. O Crackstation, serviço que fornece online password hash crack, simplesmente foram criptografando praticamente de A-Z, 0-9, caracteres especiais e todas as combinações entre eles e indexaram o hash. dai quando tu joga lá no site, ele olha no se eles tem aquele hash. O MD5 por ser mais velho, já mapearam bem mais.1 ponto
-
Recentes Trabalhos - Mapping
Recentes Trabalhos - Mapping
FidelixMonte reagiu a montanha13 por uma resposta no tópico
1 ponto1 ponto- (Resolvido)[AJUDA] npchandler.lua:394
vai em \data\npc\lib\npcsystem abra o npchandler.lua e cole isto dentro -- Advanced NPC System (Created by Jiddo), -- Modificado por Yan Liima - Night if(NpcHandler == nil) then -- Constant talkdelay behaviors. TALKDELAY_NONE = 0 -- No talkdelay. Npc will reply immedeatly. TALKDELAY_ONTHINK = 1 -- Talkdelay handled through the onThink callback function. (Default) TALKDELAY_EVENT = 2 -- Not yet implemented -- Currently applied talkdelay behavior. TALKDELAY_ONTHINK is default. NPCHANDLER_TALKDELAY = TALKDELAY_ONTHINK -- Constant conversation behaviors. CONVERSATION_DEFAULT = 0 -- Conversation through default window, like it was before 8.2 update. CONVERSATION_PRIVATE = 1 -- Conversation through NPCs chat window, as of 8.2 update. (Default) --Small Note: Private conversations also means the NPC will use multi-focus system. -- Currently applied conversation behavior. CONVERSATION_PRIVATE is default. NPCHANDLER_CONVBEHAVIOR = CONVERSATION_PRIVATE -- Constant indexes for defining default messages. MESSAGE_GREET = 1 -- When the player greets the npc. MESSAGE_FAREWELL = 2 -- When the player unGreets the npc. MESSAGE_BUY = 3 -- When the npc asks the player if he wants to buy something. MESSAGE_ONBUY = 4 -- When the player successfully buys something via talk. MESSAGE_BOUGHT = 5 -- When the player bought something through the shop window. MESSAGE_SELL = 6 -- When the npc asks the player if he wants to sell something. MESSAGE_ONSELL = 7 -- When the player successfully sells something via talk. MESSAGE_SOLD = 8 -- When the player sold something through the shop window. MESSAGE_MISSINGMONEY = 9 -- When the player does not have enough money. MESSAGE_NEEDMONEY = 10 -- Same as above, used for shop window. MESSAGE_MISSINGITEM = 11 -- When the player is trying to sell an item he does not have. MESSAGE_NEEDITEM = 12 -- Same as above, used for shop window. MESSAGE_NEEDSPACE = 13 -- When the player don't have any space to buy an item MESSAGE_NEEDMORESPACE = 14 -- When the player has some space to buy an item, but not enough space MESSAGE_IDLETIMEOUT = 15 -- When the player has been idle for longer then idleTime allows. MESSAGE_WALKAWAY = 16 -- When the player walks out of the talkRadius of the npc. MESSAGE_DECLINE = 17 -- When the player says no to something. MESSAGE_SENDTRADE = 18 -- When the npc sends the trade window to the player MESSAGE_NOSHOP = 19 -- When the npc's shop is requested but he doesn't have any MESSAGE_ONCLOSESHOP = 20 -- When the player closes the npc's shop window MESSAGE_ALREADYFOCUSED = 21 -- When the player already has the focus of this npc. MESSAGE_PLACEDINQUEUE = 22 -- When the player has been placed in the costumer queue. -- Constant indexes for callback functions. These are also used for module callback ids. CALLBACK_CREATURE_APPEAR = 1 CALLBACK_CREATURE_DISAPPEAR = 2 CALLBACK_CREATURE_SAY = 3 CALLBACK_ONTHINK = 4 CALLBACK_GREET = 5 CALLBACK_FAREWELL = 6 CALLBACK_MESSAGE_DEFAULT = 7 CALLBACK_PLAYER_ENDTRADE = 8 CALLBACK_PLAYER_CLOSECHANNEL = 9 CALLBACK_ONBUY = 10 CALLBACK_ONSELL = 11 -- Addidional module callback ids CALLBACK_MODULE_INIT = 12 CALLBACK_MODULE_RESET = 13 -- Constant strings defining the keywords to replace in the default messages. TAG_PLAYERNAME = '|PLAYERNAME|' TAG_ITEMCOUNT = '|ITEMCOUNT|' TAG_TOTALCOST = '|TOTALCOST|' TAG_ITEMNAME = '|ITEMNAME|' TAG_QUEUESIZE = '|QUEUESIZE|' NpcHandler = { keywordHandler = nil, focuses = nil, talkStart = nil, idleTime = 300, talkRadius = 3, talkDelayTime = 1, -- Seconds to delay outgoing messages. queue = nil, talkDelay = nil, callbackFunctions = nil, modules = nil, shopItems = nil, -- They must be here since ShopModule uses "static" functions messages = { -- These are the default replies of all npcs. They can/should be changed individually for each npc. [MESSAGE_GREET] = 'Bem vindo, |PLAYERNAME|! Eu estive esperando voce!', [MESSAGE_FAREWELL] = 'Adeus, |PLAYERNAME|!', [MESSAGE_BUY] = 'Voce deseja comprar |ITEMCOUNT| |ITEMNAME| por |TOTALCOST| gold coins?', [MESSAGE_ONBUY] = 'Adeus, volte quando quiser.', [MESSAGE_BOUGHT] = 'Bought |ITEMCOUNT|x |ITEMNAME| for |TOTALCOST| gold.', [MESSAGE_SELL] = 'Voce deseja vender |ITEMCOUNT| |ITEMNAME| por |TOTALCOST| gold coins?', [MESSAGE_ONSELL] = 'Thank you for this |ITEMNAME|, |PLAYERNAME| gold.', [MESSAGE_SOLD] = 'Sold |ITEMCOUNT|x |ITEMNAME| for |TOTALCOST| gold.', [MESSAGE_MISSINGMONEY] = 'Desculpe, voce não tem nenhum dinheiro.', [MESSAGE_NEEDMONEY] = 'Voce não tem dinheiro suficiente.', [MESSAGE_MISSINGITEM] = 'You don\'t even have that item, |PLAYERNAME|!', [MESSAGE_NEEDITEM] = 'Voce não tem este objeto.', [MESSAGE_NEEDSPACE] = 'Voce não tem cap suficiente.', [MESSAGE_NEEDMORESPACE] = 'Voce não tem capacidade para todos os itens.', [MESSAGE_IDLETIMEOUT] = 'Próximo, por favor!', [MESSAGE_WALKAWAY] = 'Até mais!', [MESSAGE_DECLINE] = 'Not good enough, is it... ?', [MESSAGE_SENDTRADE] = 'Essa é minha oferta, |PLAYERNAME|. Deseja algo?', [MESSAGE_NOSHOP] = 'Desculpe, eu não comercializo nada.', [MESSAGE_ONCLOSESHOP] = 'Obrigado, volte sempre que precisar.', [MESSAGE_ALREADYFOCUSED]= '|PLAYERNAME|! Já estou falando com voce...', [MESSAGE_PLACEDINQUEUE] = '|PLAYERNAME|, please wait for your turn. There are |QUEUESIZE| customers before you.' } } -- Creates a new NpcHandler with an empty callbackFunction stack. function NpcHandler:new(keywordHandler) local obj = {} obj.callbackFunctions = {} obj.modules = {} if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then obj.focuses = {} obj.talkStart = {} else obj.queue = Queue:new(obj) obj.focuses = 0 obj.talkStart = 0 end obj.talkDelay = {} obj.keywordHandler = keywordHandler obj.messages = {} obj.shopItems = {} setmetatable(obj.messages, self.messages) self.messages.__index = self.messages setmetatable(obj, self) self.__index = self return obj end -- Re-defines the maximum idle time allowed for a player when talking to this npc. function NpcHandler:setMaxIdleTime(newTime) self.idleTime = newTime end -- Attackes a new keyword handler to this npchandler function NpcHandler:setKeywordHandler(newHandler) self.keywordHandler = newHandler end -- Function used to change the focus of this npc. function NpcHandler:addFocus(newFocus) if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then if(self:isFocused(newFocus)) then return end table.insert(self.focuses, newFocus) else self.focuses = newFocus end self:updateFocus() end NpcHandler.changeFocus = NpcHandler.addFocus --"changeFocus" looks better for CONVERSATION_DEFAULT -- Function used to verify if npc is focused to certain player function NpcHandler:isFocused(focus) if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then for k,v in pairs(self.focuses) do if v == focus then return true end end return false end return (self.focuses == focus) end -- This function should be called on each onThink and makes sure the npc faces the player it is talking to. -- Should also be called whenever a new player is focused. function NpcHandler:updateFocus() if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then for pos, focus in pairs(self.focuses) do if(focus ~= nil) then doNpcSetCreatureFocus(focus) return end end doNpcSetCreatureFocus(0) else doNpcSetCreatureFocus(self.focuses) end end -- Used when the npc should un-focus the player. function NpcHandler:releaseFocus(focus) if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then if(not self:isFocused(focus)) then return end local pos = nil for k,v in pairs(self.focuses) do if v == focus then pos = k end end table.remove(self.focuses, pos) self.talkStart[focus] = nil closeShopWindow(focus) --Even if it can not exist, we need to prevent it. self:updateFocus() else closeShopWindow(focus) self:changeFocus(0) end end -- Returns the callback function with the specified id or nil if no such callback function exists. function NpcHandler:getCallback(id) local ret = nil if(self.callbackFunctions ~= nil) then ret = self.callbackFunctions[id] end return ret end -- Changes the callback function for the given id to callback. function NpcHandler:setCallback(id, callback) if(self.callbackFunctions ~= nil) then self.callbackFunctions[id] = callback end end -- Adds a module to this npchandler and inits it. function NpcHandler:addModule(module) if(self.modules == nil or module == nil) then return false end module:init(self) if(module.parseParameters ~= nil) then module:parseParameters() end table.insert(self.modules, module) return true end -- Calls the callback function represented by id for all modules added to this npchandler with the given arguments. function NpcHandler:processModuleCallback(id, ...) local ret = true for i, module in pairs(self.modules) do local tmpRet = true if(id == CALLBACK_CREATURE_APPEAR and module.callbackOnCreatureAppear ~= nil) then tmpRet = module:callbackOnCreatureAppear(unpack(arg)) elseif(id == CALLBACK_CREATURE_DISAPPEAR and module.callbackOnCreatureDisappear ~= nil) then tmpRet = module:callbackOnCreatureDisappear(unpack(arg)) elseif(id == CALLBACK_CREATURE_SAY and module.callbackOnCreatureSay ~= nil) then tmpRet = module:callbackOnCreatureSay(unpack(arg)) elseif(id == CALLBACK_PLAYER_ENDTRADE and module.callbackOnPlayerEndTrade ~= nil) then tmpRet = module:callbackOnPlayerEndTrade(unpack(arg)) elseif(id == CALLBACK_PLAYER_CLOSECHANNEL and module.callbackOnPlayerCloseChannel ~= nil) then tmpRet = module:callbackOnPlayerCloseChannel(unpack(arg)) elseif(id == CALLBACK_ONBUY and module.callbackOnBuy ~= nil) then tmpRet = module:callbackOnBuy(unpack(arg)) elseif(id == CALLBACK_ONSELL and module.callbackOnSell ~= nil) then tmpRet = module:callbackOnSell(unpack(arg)) elseif(id == CALLBACK_ONTHINK and module.callbackOnThink ~= nil) then tmpRet = module:callbackOnThink(unpack(arg)) elseif(id == CALLBACK_GREET and module.callbackOnGreet ~= nil) then tmpRet = module:callbackOnGreet(unpack(arg)) elseif(id == CALLBACK_FAREWELL and module.callbackOnFarewell ~= nil) then tmpRet = module:callbackOnFarewell(unpack(arg)) elseif(id == CALLBACK_MESSAGE_DEFAULT and module.callbackOnMessageDefault ~= nil) then tmpRet = module:callbackOnMessageDefault(unpack(arg)) elseif(id == CALLBACK_MODULE_RESET and module.callbackOnModuleReset ~= nil) then tmpRet = module:callbackOnModuleReset(unpack(arg)) end if(not tmpRet) then ret = false break end end return ret end -- Returns the message represented by id. function NpcHandler:getMessage(id) local ret = nil if(self.messages ~= nil) then ret = self.messages[id] end return ret end -- Changes the default response message with the specified id to newMessage. function NpcHandler:setMessage(id, newMessage) if(self.messages ~= nil) then self.messages[id] = newMessage end end -- Translates all message tags found in msg using parseInfo function NpcHandler:parseMessage(msg, parseInfo) local ret = msg for search, replace in pairs(parseInfo) do ret = string.gsub(ret, search, replace) end return ret end -- Makes sure the npc un-focuses the currently focused player function NpcHandler:unGreet(cid) if(not self:isFocused(cid)) then return end local callback = self:getCallback(CALLBACK_FAREWELL) if(callback == nil or callback(cid)) then if(self:processModuleCallback(CALLBACK_FAREWELL)) then if(self.queue == nil or not self.queue:greetNext()) then local msg = self:getMessage(MESSAGE_FAREWELL) local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid) } msg = self:parseMessage(msg, parseInfo) self:say(msg, cid) self:releaseFocus(cid) self:say(msg) end end end end -- Greets a new player. function NpcHandler:greet(cid) if(cid ~= 0) then local callback = self:getCallback(CALLBACK_GREET) if(callback == nil or callback(cid)) then if(self:processModuleCallback(CALLBACK_GREET, cid)) then local msg = self:getMessage(MESSAGE_GREET) local parseInfo = { [TAG_PLAYERNAME] = getCreatureName(cid) } msg = self:parseMessage(msg, parseInfo) self:say(msg) self:addFocus(cid) self:say(msg, cid) end end end end -- Handles onCreatureAppear events. If you with to handle this yourself, please use the CALLBACK_CREATURE_APPEAR callback. function NpcHandler:onCreatureAppear(cid) local callback = self:getCallback(CALLBACK_CREATURE_APPEAR) if(callback == nil or callback(cid)) then if(self:processModuleCallback(CALLBACK_CREATURE_APPEAR, cid)) then -- end end end -- Handles onCreatureDisappear events. If you with to handle this yourself, please use the CALLBACK_CREATURE_DISAPPEAR callback. function NpcHandler:onCreatureDisappear(cid) local callback = self:getCallback(CALLBACK_CREATURE_DISAPPEAR) if(callback == nil or callback(cid)) then if(self:processModuleCallback(CALLBACK_CREATURE_DISAPPEAR, cid)) then if(self:isFocused(cid)) then self:unGreet(cid) end end end end -- Handles onCreatureSay events. If you with to handle this yourself, please use the CALLBACK_CREATURE_SAY callback. function NpcHandler:onCreatureSay(cid, class, msg) local callback = self:getCallback(CALLBACK_CREATURE_SAY) if(callback == nil or callback(cid, class, msg)) then if(self:processModuleCallback(CALLBACK_CREATURE_SAY, cid, class, msg)) then if(not self:isInRange(cid)) then return end if(self.keywordHandler ~= nil) then if((self:isFocused(cid) and (class == TALKTYPE_PRIVATE_PN or NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT)) or not self:isFocused(cid)) then local ret = self.keywordHandler:processMessage(cid, msg) if(not ret) then local callback = self:getCallback(CALLBACK_MESSAGE_DEFAULT) if(callback ~= nil and callback(cid, class, msg)) then if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then self.talkStart[cid] = os.time() else self.talkStart = os.time() end end else if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then self.talkStart[cid] = os.time() else self.talkStart = os.time() end end end end end end end -- Handles onPlayerEndTrade events. If you wish to handle this yourself, use the CALLBACK_PLAYER_ENDTRADE callback. function NpcHandler:onPlayerEndTrade(cid) local callback = self:getCallback(CALLBACK_PLAYER_ENDTRADE) if(callback == nil or callback(cid)) then if(self:processModuleCallback(CALLBACK_PLAYER_ENDTRADE, cid, class, msg)) then if(self:isFocused(cid)) then local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid) } local msg = self:parseMessage(self:getMessage(MESSAGE_ONCLOSESHOP), parseInfo) self:say(msg, cid) end end end end -- Handles onPlayerCloseChannel events. If you wish to handle this yourself, use the CALLBACK_PLAYER_CLOSECHANNEL callback. function NpcHandler:onPlayerCloseChannel(cid) local callback = self:getCallback(CALLBACK_PLAYER_CLOSECHANNEL) if(callback == nil or callback(cid)) then if(self:processModuleCallback(CALLBACK_PLAYER_CLOSECHANNEL, cid, class, msg)) then if(self:isFocused(cid)) then self:unGreet(cid) end end end end -- Handles onBuy events. If you wish to handle this yourself, use the CALLBACK_ONBUY callback. function NpcHandler:onBuy(cid, itemid, subType, amount, ignoreCap, inBackpacks) local callback = self:getCallback(CALLBACK_ONBUY) if(callback == nil or callback(cid, itemid, subType, amount, ignoreCap, inBackpacks)) then if(self:processModuleCallback(CALLBACK_ONBUY, cid, itemid, subType, amount, ignoreCap, inBackpacks)) then -- end end end -- Handles onSell events. If you wish to handle this yourself, use the CALLBACK_ONSELL callback. function NpcHandler:onSell(cid, itemid, subType, amount, ignoreCap, inBackpacks) local callback = self:getCallback(CALLBACK_ONSELL) if(callback == nil or callback(cid, itemid, subType, amount, ignoreCap, inBackpacks)) then if(self:processModuleCallback(CALLBACK_ONSELL, cid, itemid, subType, amount, ignoreCap, inBackpacks)) then -- end end end -- Handles onThink events. If you wish to handle this yourself, please use the CALLBACK_ONTHINK callback. function NpcHandler:onThink() local callback = self:getCallback(CALLBACK_ONTHINK) if(callback == nil or callback()) then if(NPCHANDLER_TALKDELAY == TALKDELAY_ONTHINK) then if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then for cid, talkDelay in pairs(self.talkDelay) do if(talkDelay.time ~= nil and talkDelay.message ~= nil and os.time() >= talkDelay.time) then selfSay(talkDelay.message, cid) self.talkDelay[cid] = nil end end elseif(self.talkDelay.time ~= nil and self.talkDelay.message ~= nil and os.time() >= self.talkDelay.time) then selfSay(self.talkDelay.message) self.talkDelay.time = nil self.talkDelay.message = nil end end if(self:processModuleCallback(CALLBACK_ONTHINK)) then if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then for pos, focus in pairs(self.focuses) do if(focus ~= nil) then if(not self:isInRange(focus)) then self:onWalkAway(focus) elseif((os.time() - self.talkStart[focus]) > self.idleTime) then self:unGreet(focus) else self:updateFocus() end end end elseif(self.focuses ~= 0) then if(not self:isInRange(self.focuses)) then self:onWalkAway(self.focuses) elseif(os.time()-self.talkStart > self.idleTime) then self:unGreet(self.focuses) else self:updateFocus() end end end end end -- Tries to greet the player with the given cid. function NpcHandler:onGreet(cid) if(self:isInRange(cid)) then if(NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE) then if(not self:isFocused(cid)) then self:greet(cid) return end elseif(NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT) then if(self.focuses == 0) then self:greet(cid) elseif(self.focuses == cid) then local msg = self:getMessage(MESSAGE_ALREADYFOCUSED) local parseInfo = { [TAG_PLAYERNAME] = getCreatureName(cid) } msg = self:parseMessage(msg, parseInfo) self:say(msg) else if(not self.queue:isInQueue(cid)) then self.queue:push(cid) end local msg = self:getMessage(MESSAGE_PLACEDINQUEUE) local parseInfo = { [TAG_PLAYERNAME] = getCreatureName(cid), [TAG_QUEUESIZE] = self.queue:getSize() } msg = self:parseMessage(msg, parseInfo) self:say(msg) end end end end -- Simply calls the underlying unGreet function. function NpcHandler:onFarewell(cid) self:unGreet(cid) end -- Should be called on this npc's focus if the distance to focus is greater then talkRadius. function NpcHandler:onWalkAway(cid) if(self:isFocused(cid)) then local callback = self:getCallback(CALLBACK_CREATURE_DISAPPEAR) if(callback == nil or callback(cid)) then if(self:processModuleCallback(CALLBACK_CREATURE_DISAPPEAR, cid)) then if(self.queue == nil or not self.queue:greetNext()) then local msg = self:getMessage(MESSAGE_WALKAWAY) local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid) } msg = self:parseMessage(msg, parseInfo) self:say(msg, cid) self:releaseFocus(cid) self:say(msg) end end end end end -- Returns true if cid is within the talkRadius of this npc. function NpcHandler:isInRange(cid) local distance = getDistanceBetween(getCreaturePosition(getNpcCid()), getCreaturePosition(cid)) if(distance == -1) then return false end return (distance <= self.talkRadius) end -- Resets the npc into it's initial state (in regard of the keyrodhandler). -- All modules are also receiving a reset call through their callbackOnModuleReset function. function NpcHandler:resetNpc() if(self:processModuleCallback(CALLBACK_MODULE_RESET)) then self.keywordHandler:reset() end end -- Makes the npc represented by this instance of NpcHandler say something. -- This implements the currently set type of talkdelay. -- shallDelay is a boolean value. If it is false, the message is not delayed. Default value is false. function NpcHandler:say(message, focus, shallDelay) local shallDelay = shallDelay or false if(NPCHANDLER_TALKDELAY == TALKDELAY_NONE or not shallDelay) then if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then selfSay(message, focus) return else selfSay(message) return end end -- TODO: Add an event handling method for delayed messages if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then self.talkDelay[focus] = { message = message, time = os.time() + self.talkDelayTime, } else self.talkDelay = { message = message, time = os.time() + self.talkDelayTime } end end end Depois abra npcsystem.lua e cole isto: -- Advanced NPC System (Created by Jiddo), -- Modificado por Yan Liima - Night if(NpcSystem == nil) then -- Loads the underlying classes of the npcsystem. dofile(getDataDir() .. 'npc/lib/npcsystem/keywordhandler.lua') dofile(getDataDir() .. 'npc/lib/npcsystem/queue.lua') dofile(getDataDir() .. 'npc/lib/npcsystem/npchandler.lua') dofile(getDataDir() .. 'npc/lib/npcsystem/modules.lua') -- Global npc constants: -- Keyword nestling behavior. For more information look at the top of keywordhandler.lua KEYWORD_BEHAVIOR = BEHAVIOR_NORMAL_EXTENDED -- Greeting and unGreeting keywords. For more information look at the top of modules.lua FOCUS_GREETWORDS = {'hi', 'hello', 'hey'} FOCUS_FAREWELLWORDS = {'bye', 'farewell', 'cya'} -- The word for requesting trade window. For more information look at the top of modules.lua SHOP_TRADEREQUEST = {'offer', 'trade'} -- The word for accepting/declining an offer. CAN ONLY CONTAIN ONE FIELD! For more information look at the top of modules.lua SHOP_YESWORD = {'yes'} SHOP_NOWORD = {'no'} -- Pattern used to get the amount of an item a player wants to buy/sell. PATTERN_COUNT = '%d+' -- Talkdelay behavior. For more information, look at the top of npchandler.lua. NPCHANDLER_TALKDELAY = TALKDELAY_ONTHINK -- Conversation behavior. For more information, look at the top of npchandler.lua. NPCHANDLER_CONVBEHAVIOR = CONVERSATION_PRIVATE -- Constant strings defining the keywords to replace in the default messages. -- For more information, look at the top of npchandler.lua... TAG_PLAYERNAME = '|PLAYERNAME|' TAG_ITEMCOUNT = '|ITEMCOUNT|' TAG_TOTALCOST = '|TOTALCOST|' TAG_ITEMNAME = '|ITEMNAME|' TAG_QUEUESIZE = '|QUEUESIZE|' NpcSystem = {} -- Gets an npcparameter with the specified key. Returns nil if no such parameter is found. function NpcSystem.getParameter(key) local ret = getNpcParameter(tostring(key)) if((type(ret) == 'number' and ret == 0) or ret == nil) then return nil else return ret end end -- Parses all known parameters for the npc. Also parses parseable modules. function NpcSystem.parseParameters(npcHandler) local ret = NpcSystem.getParameter('idletime') if(ret ~= nil) then npcHandler.idleTime = tonumber(ret) end local ret = NpcSystem.getParameter('talkradius') if(ret ~= nil) then npcHandler.talkRadius = tonumber(ret) end local ret = NpcSystem.getParameter('message_greet') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_GREET, ret) end local ret = NpcSystem.getParameter('message_farewell') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_FAREWELL, ret) end local ret = NpcSystem.getParameter('message_decline') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_DECLINE, ret) end local ret = NpcSystem.getParameter('message_needmorespace') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDMORESPACE, ret) end local ret = NpcSystem.getParameter('message_needspace') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDSPACE, ret) end local ret = NpcSystem.getParameter('message_sendtrade') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_SENDTRADE, ret) end local ret = NpcSystem.getParameter('message_noshop') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NOSHOP, ret) end local ret = NpcSystem.getParameter('message_oncloseshop') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ONCLOSESHOP, ret) end local ret = NpcSystem.getParameter('message_onbuy') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ONBUY, ret) end local ret = NpcSystem.getParameter('message_onsell') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ONSELL, ret) end local ret = NpcSystem.getParameter('message_missingmoney') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_MISSINGMONEY, ret) end local ret = NpcSystem.getParameter('message_needmoney') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDMONEY, ret) end local ret = NpcSystem.getParameter('message_missingitem') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_MISSINGITEM, ret) end local ret = NpcSystem.getParameter('message_needitem') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDITEM, ret) end local ret = NpcSystem.getParameter('message_idletimeout') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_IDLETIMEOUT, ret) end local ret = NpcSystem.getParameter('message_walkaway') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_WALKAWAY, ret) end local ret = NpcSystem.getParameter('message_alreadyfocused') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ALREADYFOCUSED, ret) end local ret = NpcSystem.getParameter('message_placedinqueue') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_PLACEDINQUEUE, ret) end local ret = NpcSystem.getParameter('message_buy') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_BUY, ret) end local ret = NpcSystem.getParameter('message_sell') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_SELL, ret) end local ret = NpcSystem.getParameter('message_bought') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_BOUGHT, ret) end local ret = NpcSystem.getParameter('message_sold') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_SOLD, ret) end -- Parse modules. for parameter, module in pairs(Modules.parseableModules) do local ret = NpcSystem.getParameter(parameter) if(ret ~= nil) then local number = tonumber(ret) if(number ~= nil and number ~= 0) then npcHandler:addModule(module:new()) end end end end end1 ponto- [C++] doStartTrade(cid, target, item)
[C++] doStartTrade(cid, target, item)
Drazyn1291 reagiu a igorlabanca por uma resposta no tópico
1 pontoNão @pablobion ele não abre o trade do npc, ele abre o trade normal por exemplo com esse script também é possível fazer um trade a distancia...1 ponto- (Resolvido)Erro na Distro!
(Resolvido)Erro na Distro!
AndreAzevedo reagiu a Tricoder por uma resposta no tópico
1 pontoTroca seu war.lua por esse: function onSay(cid, words, param, channel) local guild = getPlayerGuildId(cid) if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER) then doPlayerSendChannelMessage(cid, "", "You cannot execute this talkaction.", TALKTYPE_CHANNEL_W, 0) return true end local t = string.explode(param, ",") if(not t[2]) then doPlayerSendChannelMessage(cid, "", "Not enough param(s).", TALKTYPE_CHANNEL_W, 0) return true end local enemy = getGuildId(t[2]) if(not enemy) then doPlayerSendChannelMessage(cid, "", "Guild \"" .. t[2] .. "\" does not exists.", TALKTYPE_CHANNEL_W, 0) return true end if(enemy == guild) then doPlayerSendChannelMessage(cid, "", "You cannot perform war action on your own guild.", TALKTYPE_CHANNEL_W, 0) return true end local enemyName, tmp = "", db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. enemy) if(tmp:getID() ~= -1) then enemyName = tmp:getDataString("name") tmp:free() end if(isInArray({"accept", "reject", "cancel"}, t[1])) then local query = "`guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild if(t[1] == "cancel") then query = "`guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy end tmp = db.getResult("SELECT `id`, `begin`, `end`, `payment` FROM `guild_wars` WHERE " .. query .. " AND `status` = 0") if(tmp:getID() == -1) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending invitation for a war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end if(t[1] == "accept") then local _tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = _tmp:getID() < 0 or _tmp:getDataInt("balance") < tmp:getDataInt("payment") _tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low to accept this invitation.", TALKTYPE_CHANNEL_W, 0) return true end db.query("UPDATE `guilds` SET `balance` = `balance` - " .. tmp:getDataInt("payment") .. " WHERE `id` = " .. guild) end query = "UPDATE `guild_wars` SET " local msg = "accepted " .. enemyName .. " invitation to war." if(t[1] == "reject") then query = query .. "`end` = " .. os.time() .. ", `status` = 2" msg = "rejected " .. enemyName .. " invitation to war." elseif(t[1] == "cancel") then query = query .. "`end` = " .. os.time() .. ", `status` = 3" msg = "canceled invitation to a war with " .. enemyName .. "." else query = query .. "`begin` = " .. os.time() .. ", `end` = " .. (tmp:getDataInt("end") > 0 and (os.time() + ((tmp:getDataInt("begin") - tmp:getDataInt("end")) / 86400)) or 0) .. ", `status` = 1" end query = query .. " WHERE `id` = " .. tmp:getDataInt("id") if(t[1] == "accept") then doGuildAddEnemy(guild, enemy, tmp:getDataInt("id"), WAR_GUILD) doGuildAddEnemy(enemy, guild, tmp:getDataInt("id"), WAR_ENEMY) end tmp:free() db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. msg, MESSAGE_EVENT_ADVANCE) return true end if(t[1] == "invite") then local str = "" tmp = db.getResult("SELECT `guild_id`, `status` FROM `guild_wars` WHERE `guild_id` IN (" .. guild .. "," .. enemy .. ") AND `enemy_id` IN (" .. enemy .. "," .. guild .. ") AND `status` IN (0, 1)") if(tmp:getID() ~= -1) then if(tmp:getDataInt("status") == 0) then if(tmp:getDataInt("guild_id") == guild) then str = "You have already invited " .. enemyName .. " to war." else str = enemyName .. " have already invited you to war." end else str = "You are already on a war with " .. enemyName .. "." end tmp:free() end if(str ~= "") then doPlayerSendChannelMessage(cid, "", str, TALKTYPE_CHANNEL_W, 0) return true end local frags = tonumber(t[3]) if(frags ~= nil) then frags = math.max(10, math.min(1000, frags)) else frags = 100 end local payment = tonumber(t[4]) if(payment ~= nil) then payment = math.max(100000, math.min(1000000000, payment)) tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = tmp:getID() < 0 or tmp:getDataInt("balance") < payment tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low for such payment.", TALKTYPE_CHANNEL_W, 0) return true end db.query("UPDATE `guilds` SET `balance` = `balance` - " .. payment .. " WHERE `id` = " .. guild) else payment = 0 end local begining, ending = os.time(), tonumber(t[5]) if(ending ~= nil and ending ~= 0) then ending = begining + (ending * 86400) else ending = 0 end db.query("INSERT INTO `guild_wars` (`guild_id`, `enemy_id`, `begin`, `end`, `frags`, `payment`) VALUES (" .. guild .. ", " .. enemy .. ", " .. begining .. ", " .. ending .. ", " .. frags .. ", " .. payment .. ");") doBroadcastMessage(getPlayerGuildName(cid) .. " has invited " .. enemyName .. " to war till " .. frags .. " frags.", MESSAGE_EVENT_ADVANCE) return true end if(not isInArray({"end", "finish"}, t[1])) then return false end local status = (t[1] == "end" and 1 or 4) tmp = db.getResult("SELECT `id` FROM `guild_wars` WHERE `guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy .. " AND `status` = " .. status) if(tmp:getID() ~= -1) then local query = "UPDATE `guild_wars` SET `end` = " .. os.time() .. ", `status` = 5 WHERE `id` = " .. tmp:getDataInt("id") tmp:free() doGuildRemoveEnemy(guild, enemy) doGuildRemoveEnemy(enemy, guild) db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. (status == 4 and "mend fences" or "ended up a war") .. " with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end if(status == 4) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending war truce from " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end tmp = db.getResult("SELECT `id`, `end` FROM `guild_wars` WHERE `guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild .. " AND `status` = 1") if(tmp:getID() ~= -1) then if(tmp:getDataInt("end") > 0) then tmp:free() doPlayerSendChannelMessage(cid, "", "You cannot request ending for war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end local query = "UPDATE `guild_wars` SET `status` = 4, `end` = " .. os.time() .. " WHERE `id` = " .. tmp:getDataInt("id") tmp:free() db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has signed an armstice declaration on a war with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end doPlayerSendChannelMessage(cid, "", "Currently there's no active war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end Depois poste se resolveu, por favor.1 ponto- Recentes Trabalhos - Mapping
1 pontoMeus ultimos trabalhos antes de eu parar de mapper em 20131 ponto- [Global] Original Sem Bugs
[Global] Original Sem Bugs
wellingtontds reagiu a Gustavo Ferreira por uma resposta no tópico
1 pontoCidades! Spoiler Ankrahmun Ab'Dendriel Carlin Cormaya Darashia Edron Farmine Fibula Greenshore Kazordoon Liberty Bay Meluna Mintwallin Northport Orc Land (Orc Fortress) Outlaw Camp Port Hope Plains of Havoc Rookgaard Shadowthorn (Elven Village) Svargrond Thais Venore Zao (With North) 2 Cidades VIP's (Ethno e Gengia) Quests! Spoiler Arena Quest Demon Oak Demon Helmet Inquisition Quest Anihileator Quest Pits of Infernum (POI) HOTA Quest Crown Quest Behemonth Quest Blue Legs BK Bright Sword Naginata Vamp Shield Fire Axe Mermaid Comb Orc Fortress Medusa Shield Dark Shield Noble Armor Desert Quest Stealth Ring Mad Mage Room Entre varias outras... Informações do Server: War System (Escudos) Distro DEV_0.4 Spells 8.6 100% Npc's Igual RL Sem bugs (dinheiro, entre outros). Server pronto para por Online. Outros: Kiwi Guard DDOS Protect! War Of Emperium! Zombie Event! Website http://www.4shared.com/rar/nYSDhqKT/Gesior_Acc_860_By_ADM_DaNgeR_2.html Downloads Server: Download Dlls e Distro: Download Scan Dlls e Distro: Scan Créditos: - Gustavo - XLac - Doidin - Comedinhas - TFS Team - Alissow Team1 ponto- getCreaturePathTo
1 pontoPara TFS 0.4/0.3.6 e OTX2 Em luascript.h depois de: static int32_t luaGetCreatureName(lua_State* L); Adicionar: static int32_t luaGetCreaturePathTo(lua_State* L); Em luascript.cpp depois de: //getCreatureName(cid) lua_register(m_luaState, "getCreatureName", LuaInterface::luaGetCreatureName); Adicionar: //getCreaturePathTo(cid, pos, maxSearchDist) lua_register(m_luaState, "getCreaturePathTo", LuaInterface::luaGetCreaturePathTo); Depois de: int32_t LuaInterface::luaGetCreatureName(lua_State* L) { //getCreatureName(cid) ScriptEnviroment* env = getEnv(); if(Creature* creature = env->getCreatureByUID(popNumber(L))) lua_pushstring(L, creature->getName().c_str()); else { errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND)); lua_pushboolean(L, false); } return 1; } Adicionar: int32_t LuaInterface::luaGetCreaturePathTo(lua_State* L) { //getCreaturePathTo(cid, pos, maxSearchDist) ScriptEnviroment* env = getEnv(); int32_t maxSearchDist = popNumber(L); PositionEx position; popPosition(L, position); Creature* creature = env->getCreatureByUID(popNumber(L)); if (!creature) { lua_pushnil(L); return 1; } std::list<Direction> dirList; lua_newtable(L); if (g_game.getPathTo(creature, position, dirList, maxSearchDist)) { std::list<Direction>::const_iterator it = dirList.begin(); for (int32_t index = 1; it != dirList.end(); ++it, ++index) { lua_pushnumber(L, index); lua_pushnumber(L, (*it)); pushTable(L); } } else { lua_pushboolean(L, false); } return 1; } E sejam felizes! getCreaturePathTo(cid, position, maxSearchDist) retornará uma tabela com as direções que o jogador deve seguir para chegar no ponto position. Não contem as posições que ele deve passar por. maxSearchDist é o valor máximo de passos que ele vai dar em direção à essa position e na via das dúvidas coloque o maior valor de distancia entre as duas posições.1 ponto- [PEDIDO] Quero um poketibia server
[PEDIDO] Quero um poketibia server
Eduardo3562 reagiu a Thayam por uma resposta no tópico
1 pontoQue tipo de servidor você prefere? Com Sources? Pda? Enfim, de qualquer jeito, de uma olhada nos seguintes: Poke Kdpo Poke Pyrus Erondino (by AEROS) Erondino (v15) DarkxPoke Algum destes deve te ajudar Espero que encontre o que procura!1 ponto- Script staff
Script staff
Eder Marchioli reagiu a GOD Vitor por uma resposta no tópico
1 pontoCriando va em data\talkactions\scripts Primeiro passo-crie uma pasta .lua,renomeie para "staff" cole isso dentro dele: function onSay(cid, words, param) pos = {x=1056, y=1049, z=7} doSendMagicEffect(getPlayerPosition(cid),21) doPlayerSendCancel(cid,"Você foi teleportado para area staff!") doTeleportThing(cid,pos) end cole isso dentro dela: <talkaction words="!staff" access="3" script="staff.lua"/> salve e pronto! Editando: pos = {x=1056, y=1049, z=7} é as cordenadas para quando usar o tal comando,o staff vai se teleportar. doPlayerSendCancel(cid,"Você foi teleportado para a area staff!") é a mensagem que vai aparecer,quando o staff se teleportar.1 ponto- [Gesior Acc] Lista de Vítimas
1 pontoCréditos: Xampy Funciona com TFS 0.3.5, 0.3.6 & 0.4. Como Instalar: Cole o seguinte código após a lista de mortes em characters.php: Código PHP: //frags list by GodMarini $frags_limit = 10; // frags limit to show? // default: 10 $player_frags = $SQL->query('SELECT `player_deaths`.*, `players`.`name`, `killers`.`unjustified` FROM `player_deaths` LEFT JOIN `killers` ON `killers`.`death_id` = `player_deaths`.`id` LEFT JOIN `player_killers` ON `player_killers`.`kill_id` = `killers`.`id` LEFT JOIN `players` ON `players`.`id` = `player_deaths`.`player_id` WHERE `player_killers`.`player_id` = '.$player->getId().' ORDER BY `date` DESC LIMIT 0,'.$frags_limit.';'); if(count($player_frags)) { $frags = 0; $frag_add_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><br><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Victims</B></TD></TR>'; foreach($player_frags as $frag) { $frags++; if(is_int($number_of_rows / 2)) $bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder']; $number_of_rows++; $frag_add_content .= "<tr bgcolor=\"".$bgcolor."\"> <td width=\"20%\" align=\"center\">".date("j M Y, H:i", $frag['date'])."</td> <td>".(($player->getSex() == 0) ? 'She' : 'He')." fragged <a href=\"index.php?subtopic=characters&name=".$frag[name]."\">".$frag[name]."</a> at level ".$frag[level].""; $frag_add_content .= ". (".(($frag[unjustified] == 0) ? "<font size=\"1\" color=\"green\">Justified</font>" : "<font size=\"1\" color=\"red\">Unjustified</font>").")</td></tr>"; } if($frags >= 1) $main_content .= $frag_add_content . '</TABLE>'; } // end of frags list by GodMarini Imagem:1 ponto- [Pedido]Duvidas Sobre Gesior
[Pedido]Duvidas Sobre Gesior
AndreAzevedo reagiu a sdhufsihf por uma resposta no tópico
1 pontoOlá a todos , que estão vendo o tópico Estou com algumas grandes duvidas a questão do gesior - Como adicionar fotos no latest news? - Como adicionar foto em uma pagina do Site? Por exemplo uma foto de um logo de um banco para as doações. - Como tirar os bugs das letras ? Por exemplo quando vou colocar alguma coisa que tenha por exemplo ç ã é ó , acentos e cedilhas dá um erro parecendo um ponto de interrogação dentro de um quadradinho - Como fazer a letra ficar maior em um post? Por exemplo numa pagina ter um titulo e o texto , ou algo destacado . - Quando eu adiciono algum item no shop , tem que ter o id das imagens do site ou do game? Colocando as imagens no shop ,coloquei uma magic plate armor para vender então pus o id do game... porém quando eu cliquei para edit/delete oferts eu percebi que só aparecia o nome dos itens embaixo do id se o id fosse igual as imagens do site (as imagens do site vem com nomeadas com numeros e quando eu coloquei pra vender a magic plate armor com esses numeros da imagem apareceu o id e embaixo (Magic Plate Armor) qual dois devo colocar??? Caso alguem me ajude darei REP+ Att Sdhufslhf1 ponto- [Pedido]Duvidas Sobre Gesior
[Pedido]Duvidas Sobre Gesior
BetterWar ATS reagiu a joadson por uma resposta no tópico
1 pontoComo adicionar fotos no latest news? Usando as tags HTML <img ="link da imagem">Descrição</img> Como adicionar foto em uma pagina do Site? Por exemplo uma foto de um logo de um banco para as doações. Mesma coisa do processo acima, dúvidas dê uma estuda em HTML Como tirar os bugs das letras ? Por exemplo quando vou colocar alguma coisa que tenha por exemplo ç ã é ó , acentos e cedilhas dá um erro parecendo um ponto de interrogação dentro de um quadradinho Simples, abra qualquer arquivo que esteja com esse problema e antes do <?php, colque esse codigo <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> Como fazer a letra ficar maior em um post? Por exemplo numa pagina ter um titulo e o texto , ou algo destacado . Usando as tags HTML, <h1>(texto grande), <h2>(texto medio>, <h3>, <h4> e <h5>. e o das imagens no shop, tem que ser o ID que estiver na database, exemplo, adicionei uma PLegs, ela ficou como ID 5 na database, irei colocar 5 na imagem. Espero ter sanado todas suas dúvidas.1 ponto- Velocidade de Push/empurrar player
Velocidade de Push/empurrar player
tibiaprosz reagiu a xxxcrimsxxx por uma resposta no tópico
1 pontokkk, provavelmente vc viu isso no meu server IUDHiudhIUD pushCreatureDelay = 2 * 1000 O numero 2 e a velocidade, se vc botar 0 igual no meu sv vai fikar mt fast1 ponto- Push Player
Push Player
tibiaprosz reagiu a Felipe TibiaScript por uma resposta no tópico
1 pontoPo valeu man pega nada, só falei isso para da uma publicadinha do site rsrsrs Ah!!! entra la no site agora tem WEST diagonal baixo e cima e também EAST diagonal baixo e cima HEHE. Valeu ai man.1 pontoLíderes está configurado para São Paulo/GMT-03:00 - (Resolvido)[AJUDA] npchandler.lua:394
Informação Importante
Confirmação de Termo