Tudo que MaTTch postou
-
(Resolvido)NPCs respondendo em 2 Channels
Tenta fazer assim (não testei): Vai em data/npc/lib e procura por um arquivo chamado npchandler.lua, abra ele e procure pela função: function NpcHandler:greet(cid) e dentro dessa função, apague essa parte: self:say(msg) e veja se deu certo. OBS: é pra apagar onde esta self:say(msg) e não self:say(msg, cid).
- Summon criaturas especificas
-
[Function] getCombatAreaPos(centerpos, area)
Olá. A algum tempo atrás eu havia feito essa função, mas decidi compartilhar com vocês. Você pode instala-la definitivamente na sua libs ou pode apenas usar em algum script ocasional: function getCombatAreaPos(centerpos, area) -- by MaTTch if(type(area) ~= "table") then error("area is not a table") return false elseif(not centerpos) then return false end local t, center, ret = {}, {}, {} for n in ipairs(area) do for i = 2, 3 do if(table.find(area[n], i)) then center = {n, table.find(area[n], i)} break end end end if(#center == 0) then error("area do not have a number center") return false end for line in ipairs(area) do for _, value in ipairs(area[line]) do t[line] = t[line] and t[line] or {} if(value == 1 or value == 3) then table.insert(t[line], 1) else table.insert(t[line], 0) end end end for y in pairs(t) do for l, x in pairs(t[y]) do local ry, rx = y - center[1], l - center[2] if(#area == 1) then ry = 0 end if(x == 1) then table.insert(ret, {x=centerpos.x+(rx),y=centerpos.y+(ry),z=centerpos.z}) end end end return ret end - Como funciona? A função retorna uma tabela com as posições da area de combat. Exemplo: function onSay(cid, words, param) local area = { -- Area {1,0,0,0,0,0,1}, {0,1,0,0,0,1,0}, {0,0,1,0,1,0,0}, {0,0,0,2,0,0,0}, -- 2 ou 3 é o numero do centro {0,0,1,0,1,0,0}, {0,1,0,0,0,1,0}, {1,0,0,0,0,0,1} } for _, pos in pairs(getCombatAreaPos(getThingPos(cid), area)) do -- loop com todas as tabelas doSendMagicEffect(pos, 10) -- efeito em todas as posicoes da tabela end return true end Espero que tenham entendido... Créditos: MaTTch (eu)
-
Erro ao carregar scripts!
Como o Danihcv disse ali em cima, pode ser algum script interferindo.
-
Erro ao carregar scripts!
Vai no seu items.xml, procure por "fieldabsorbpercentfire" e apaga.
-
[Vault System] Sistema de Cofre
Verdade... Tinha me esquecido dessa função, farei uma futura edição disso pra galera aqui.
-
[Vault System] Sistema de Cofre
Tente registrar o item no items.xml.
-
[Vault System] Sistema de Cofre
:hum: Algo não esta certo... Poste seu script do look pra mim dar uma olhada.
-
[Vault System] Sistema de Cofre
Atualizei o tutorial, olhe no 5° passo. Eu tinha me esqueci dessa parte...
-
[Vault System] Sistema de Cofre
Não entendi... Não quer aparecer nada no look?
-
[Vault System] Sistema de Cofre
No client Tibia não... Uma forma é através de uma janela de opção, mas que só deve ser possível no OTClient. Você pode mudar dessa forma: local config = { [1] = {9999, math.floor(vaultMoney/getItemInfo(9999).worth)}, [2] = {ITEM_CRYSTAL_COIN, math.floor((vaultMoney/getItemInfo(ITEM_CRYSTAL_COIN).worth)-(math.floor(vaultMoney/getItemInfo(9999).worth)*100))}, [3] = {ITEM_PLATINUM_COIN, math.floor((vaultMoney/getItemInfo(ITEM_PLATINUM_COIN).worth)-(math.floor(vaultMoney/getItemInfo(ITEM_CRYSTAL_COIN).worth)*100))}, [4] = {ITEM_GOLD_COIN, math.floor(vaultMoney%100)} } No numero "9999" você coloca o ID do item que desejar, desde que ele seja uma moeda (tenha "worth").
-
(Resolvido)comando !online help me
local config = { showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand')) } function onSay(cid, words, param, channel) local strings, i, position, added = {""}, 1, 1, false for _, pid in ipairs(getPlayersOnline()) do if(added) then if(i > (position * 7)) then strings[position] = strings[position] .. "," position = position + 1 strings[position] = "" else strings[position] = i == 1 and "" or strings[position] .. ", " end end added = false if((config.showGamemasters or getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(pid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(pid))) then strings[position] = strings[position] .. getCreatureName(pid) .. "" i = i + 1 added = true end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player" .. ((i - 1) > 1 and "s" or "") .. " Online:") for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. "." end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Total: " .. (i - 1) .. " player" .. ((i - 1) > 1 and "s" or "") .. " online.") return true end
- error : unable to load actions Ajuda ?
- error : unable to load actions Ajuda ?
-
(Resolvido)(Dúvida) Como alterar essa mensagem "Gratis Premium Account"?
Isso fica no client, você precisa usar algum hex editor.
-
[Vault System] Sistema de Cofre
Bom galera eu resolvi fazer o Vault System a pedido de um amigo meu e decidi compartilhar com vocês. Testado em 8.60 TFS 0.4 EDIT -- O script foi arrumado, pois havia um bug que o player ganhava golds. Vamos lá. 1° - Vá em data/actions/scripts e crie um arquivo chamado vault.lua, e dentro você coloca isso: local vaultStorage = 99991 -- storage em que ficara armazenado os golds ------------------//* Functions //------------------- local function getPlayerFreeSpace(cid) -- by MaTTch local checkSlots, space = {3,5,6,10}, 0 local function getContainerFree(container) local free = 0 if(not isContainer(container.uid)) then return free end for i = 0, (getItemInfo(container.itemid).maxItems -1) do local item = getContainerItem(container.uid, i) if(item.itemid == 0) then free = free + 1 elseif(isContainer(item.uid)) then free = free + getContainerFree(item) end end return free end for _, i in ipairs(checkSlots) do local slotItem = getPlayerSlotItem(cid, i) if(i ~= CONST_SLOT_BACKPACK and slotItem.itemid == 0) then space = space + 1 elseif(isContainer(slotItem.uid)) then space = space + getContainerFree(slotItem) end end return space end local function withdrawMoneySecurity(cid, value, storage) -- by MaTTch local storageMoney, countValue = getPlayerStorageValue(cid, storage), 0 local config = { [1] = {ITEM_CRYSTAL_COIN, math.floor(value/getItemInfo(ITEM_CRYSTAL_COIN).worth)}, [2] = {ITEM_PLATINUM_COIN, math.floor((value/getItemInfo(ITEM_PLATINUM_COIN).worth)-(math.floor(value/getItemInfo(ITEM_CRYSTAL_COIN).worth)*100))}, [3] = {ITEM_GOLD_COIN, math.floor(value%100)} } for i = 1, #config do local count = config[i][2] if(count > 0) then while(count > 0) do storageMoney = getPlayerStorageValue(cid, storage) local a, itemCap = count > 100 and 100 or count, getItemInfo(config[i][1]).weight if(getPlayerFreeCap(cid) >= (itemCap*a)) then if(getPlayerFreeSpace(cid) >= 1) then doPlayerAddItem(cid, config[i][1], a) setPlayerStorageValue(cid, storage, (storageMoney - (getItemInfo(config[i][1]).worth * a))) countValue = countValue + (getItemInfo(config[i][1]).worth * a) count = count - a else return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You do not have enough space in container. You have took "..countValue.." gold"..(countValue > 1 and "s" or "").." from vault.") end else return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You do not have enough cap. You have took "..countValue.." gold"..(countValue > 1 and "s" or "").." from vault.") end end end end return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have took "..countValue.." gold"..(countValue > 1 and "s" or "").." from vault.") end ------------------//* End Functions //------------------- function onUse(cid, item, fromPosition, itemEx, toPosition) local cidMoney, vaultMoney = getPlayerMoney(cid), getPlayerStorageValue(cid, vaultStorage) if(vaultMoney <= 0) then if(cidMoney <= 0) then return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You do not have money.") end doPlayerRemoveMoney(cid, cidMoney) setPlayerStorageValue(cid, vaultStorage, cidMoney) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have added "..cidMoney.." gold"..(cidMoney > 1 and "s" or "").." to vault. Now your money is kept in the vault chest, you can take it whenever you want.") else withdrawMoneySecurity(cid, vaultMoney, vaultStorage) end return true end 2° - Agora em data/actions/actions.xml adicione a tag: <action itemid="ID" event="script" value="vault.lua"/> Em ID você escolhe o id do item que quiser. 3° - Agora em data/creaturescripts/scripts crie um arquivo com o nome vaultLook.lua, e dentro coloque isso: local config = { vaultId = ID, -- itemid do vault vaultStorage = 99991 -- storage em que ficara armazenado os golds } function onLook(cid, thing, position, lookDistance) local show = getPlayerStorageValue(cid, config.vaultStorage) if(thing.itemid == config.vaultId) then local str = "You see"..(getItemInfo(thing.itemid).article and " "..getItemInfo(thing.itemid).article.." " or " ")..getItemInfo(thing.itemid).name..".\nYou have "..(show < 0 and 0 or show).." gold"..(show > 1 and "s" or "").." in the vault." if(getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then str = str .. "\nItemID: ["..thing.itemid.."].\nPosition: [X: "..getThingPos(thing.uid).x.."] [Y: "..getThingPos(thing.uid).y.."] [Z: "..getThingPos(thing.uid).z.."]." end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str) return false end return true end 4° - Agora em data/creaturescripts/creaturescripts.xml adicione a tag: <event type="look" name="vaultLook" event="script" value="vaultLook.lua"/> 5° - Agora em data/creaturescripts/login.lua lá embaixo adicione junto dos outros: registerCreatureEvent(cid, "vaultLook") E agora o sistema já esta pronto para ser usado. - Aah mas como funciona? Você clica uma vez no cofre (vault) e deposita todo seu dinheiro nele, ao clicar de novo você pega-os de volta, e caso não tiver cap ou espaço na bag você pega somente o possível e o restante ficara la até você quiser pegar. --> Versão do Vault System em editText Créditos: MaTTch (eu)
-
Help Char sem Life e sem Nome
Da algum erro no console? Você adicionou recentemente algum creaturescript?
-
(Resolvido)(help) minhas pots nao heala enquanto ta andando e tem exausted de spell quando desce e sobe escada
Vá em config.lua e procure por: stairhopDelay e deixe-o no valor 0: stairhopDelay = 0
-
(Resolvido)[PEDIDO] Quest de livro escrito
Sim, mas use o que já esta em multilinguagem logo acima. Ai é você que decide, por NPC, Talkactions, Movements e etc... tem varias formas.
-
(Resolvido)[PEDIDO] Quest de livro escrito
Quem tem o storage 8971 maior ou igual a 2, ele respondera em português e quem tem menos de 2, ele respondera em inglês.
-
(Resolvido)[PEDIDO] Quest de livro escrito
local config = { langStorage = 8971, [55560] = {6533, eng = "Text1", pt = "Texto1"}, [55561] = {6533, eng = "Text2", pt = "Texto2"} } function onUse(cid, item, fromPosition, itemEx, toPosition) if(config[item.uid] ~= nil) then if(getPlayerStorageValue(cid, item.uid) == -1) then local book, text = doPlayerAddItem(cid, config[item.uid][1], 1), getPlayerStorageValue(cid, config.langStorage) >= 2 and config[item.uid].pt or config[item.uid].eng doSetItemText(book, text) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have found a "..getItemNameById(config[item.uid][1])..".") setPlayerStorageValue(cid, item.uid, 1) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "It's empty.") end end return true end
-
(Resolvido)[PEDIDO] Quest de livro escrito
local config = { --[uid] = {bookId, "texto"} [55560] = {6533, "Texto1"}, [55561] = {6533, "Texto2"} } Dentro do [ ] você coloca o uniqueid do baú, o 6533 é o ID do livro e o "Texto1" é o que vai ser escrito dentro, então se tu clicar no baú que tem o uid 55560, vai ganhar o item de id 6533 (livro) que dentro vai estar escrito "Texto1". em actions.xml você coloca: <action uniqueid="55560-55561" event="script" value="NOME_DO_ARQUIVO.lua"/> perceba que os números do uniqueid vai do 55560 ao 55561 que é o mesmo que esta no script, você pode muda-los.
-
[Pedido] Sistema de critical hit estilizado.
Esqueci das virgulas, tenta agora: local config = { specific_weapons = "yes", -- Somente armas especificas poderãoo dar critico? (("yes" / true) / ("no" / false)) critical_chance = 25, -- 1 a 100 critical_damage = 200, -- damage + critical_damage% critical_weapons = { [2400] = {30, 100}, [2222] = {25, 200} } } config.specific_weapons = getBooleanFromString(config.specific_weapons) function onStatsChange(cid, attacker, type, combat, value) if(type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then if(specific_weapons) then for weapon_ids, arrays in pairs(config.critical_weapons) do if(getPlayerSlotItem(attacker, CONST_SLOT_RIGHT).itemid == weapon_ids or getPlayerSlotItem(attacker, CONST_SLOT_LEFT).itemid == weapon_ids) then if(math.random(1,100) <= arrays[1]) then doTargetCombatHealth(attacker, cid, combat, -math.floor(value+(value*(arrays[2]/100))), -math.floor(value+(value*(arrays[2]/100))), CONST_ME_NONE) doSendAnimatedText(getThingPos(cid), "CRITICAL!", TEXTCOLOR_DARKRED) -- Só é permitido 9 caracteres return false end end end else if(math.random(1,100) <= config.critical_chance) then doTargetCombatHealth(attacker, cid, combat, -math.floor(value+(value*(config.critical_damage/100))), -math.floor(value+(value*(config.critical_damage/100))), CONST_ME_NONE) doSendAnimatedText(getThingPos(cid), "CRITICAL!", TEXTCOLOR_DARKRED) return false end end end return true end
-
(Resolvido)[PEDIDO] Quest de livro escrito
local config = { --[uid] = {bookId, "texto"} [55560] = {6533, "Texto1"}, [55561] = {6533, "Texto2"} } function onUse(cid, item, fromPosition, itemEx, toPosition) if(config[item.uid] ~= nil) then if(getPlayerStorageValue(cid, item.uid) == -1) then local book, text = doPlayerAddItem(cid, config[item.uid][1], 1), config[item.uid][2] doSetItemText(book, text) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have found a "..getItemNameById(config[item.uid][1])..".") setPlayerStorageValue(cid, item.uid, 1) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "It's empty.") end end return true end
-
[Pedido] Sistema de critical hit estilizado.
local config = { specific_weapons = "yes" -- Somente armas especificas poderãoo dar critico? (("yes" / true) / ("no" / false)) critical_chance = 25 -- 1 a 100 critical_damage = 200 -- damage + critical_damage% critical_weapons = { [2400] = {30, 100}, [2222] = {25, 200} } } config.specific_weapons = getBooleanFromString(config.specific_weapons) function onStatsChange(cid, attacker, type, combat, value) if(type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then if(specific_weapons) then for weapon_ids, arrays in pairs(config.critical_weapons) do if(getPlayerSlotItem(attacker, CONST_SLOT_RIGHT).itemid == weapon_ids or getPlayerSlotItem(attacker, CONST_SLOT_LEFT).itemid == weapon_ids) then if(math.random(1,100) <= arrays[1]) then doTargetCombatHealth(attacker, cid, combat, -math.floor(value+(value*(arrays[2]/100))), -math.floor(value+(value*(arrays[2]/100))), CONST_ME_NONE) doSendAnimatedText(getThingPos(cid), "CRITICAL!", TEXTCOLOR_DARKRED) -- Só é permitido 9 caracteres return false end end end else if(math.random(1,100) <= config.critical_chance) then doTargetCombatHealth(attacker, cid, combat, -math.floor(value+(value*(config.critical_damage/100))), -math.floor(value+(value*(config.critical_damage/100))), CONST_ME_NONE) doSendAnimatedText(getThingPos(cid), "CRITICAL!", TEXTCOLOR_DARKRED) return false end end end return true end Não testei. OBS: Magias também poderão dar critical.