

MatheusGlad
Conde-
Total de itens
528 -
Registro em
-
Última visita
-
Dias Ganhos
30
Tudo que MatheusGlad postou
-
So em baixo de doTransformItem(getThingFromPos(tilepos).uid, 406) isso: doSendMagicEffect(tilepos, EFEITODASPURPURINAS)
-
Demonstraçao: data/movements/questname.lua: local route = { {0,0,0,0,0,1,0,0,0}, {0,0,0,0,1,0,1,0,0}, {1,0,0,1,0,0,0,1,1}, {0,1,1,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0} } local extrtilepos = {x=88, y=310, z=7} -- Posiçao do tile << /\ local start = {x=87, y=312, z=7} -- Posiçao do tile que o cara vai estar antes de começar a pisar nos tiles pretos. local final = {x=97, y=312, z=7} -- Posiçao do tile que o cara vai estar dps de ter passado pelo percurso function isPosInRoute(tilesroutepos, tilepos) for i,s in pairs(tilesroutepos) do if s.x == tilepos.x and s.y == tilepos.y and s.z == tilepos.z then return TRUE end end return FALSE end function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition) local tilesroutepos = {} for i, t in pairs(route) do for s, p in pairs(t) do if p == 1 then table.insert(tilesroutepos, {x=extrtilepos.x+s-1, y=extrtilepos.y+i-1, z=extrtilepos.z}) end end end if toPosition.x == final.x and toPosition.y == final.y and toPosition.z == final.z then for i,x in pairs(tilesroutepos) do x.stackpos = 0 doTransformItem(getThingFromPos(x).uid, 407) end return TRUE end if toPosition.x == start.x and toPosition.y == start.y and toPosition.z == start.z then for i,x in pairs(tilesroutepos) do x.stackpos = 0 doTransformItem(getThingFromPos(x).uid, 407) end return TRUE end if fromPosition.x == final.x and fromPosition.y == final.y and fromPosition.z == final.z then doTeleportThing(cid, fromPosition) return doPlayerSendCancel(cid, "Enter in the teleport.") end if isPosInRoute(tilesroutepos, toPosition) then local tilepos = toPosition tilepos.stackpos = 0 doTransformItem(getThingFromPos(tilepos).uid, 406) else doTeleportThing(cid, start) for i,x in pairs(tilesroutepos) do x.stackpos = 0 doTransformItem(getThingFromPos(x).uid, 407) end end return TRUE end data/movements/movements.xml: <movevent type="StepIn" actionid="123666" event="script" value="questname.lua"/> Em quais tiles botar o actionid 123666: Editar a rota que o player tem que fazer: local route = { {0,0,0,0,0,1,0,0,0}, {0,0,0,0,1,0,1,0,0}, {1,0,0,1,0,0,0,1,1}, {0,1,1,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0} } So mudar essa table. Aonde eh 1 eh por onde o player tem que passar.
-
Como Cria Uma Magia Que Cria Itens Em Volta De Você Por Um Tempo Para Trapar?
tópico respondeu ao LucasM010203 de MatheusGlad em Lixeira Pública
O tempo é no items.xml: <item id="1499" article="a" name="rush wood"> <attribute key="type" value="magicfield" /> <attribute key="decayTo" value="0" /> <attribute key="duration" value="45" /> </item> duration = 45 segundos. O negocio de nao fazer no templo eu nao sei, so se nao fosse spell e sim talkaction. -
Como Cria Uma Magia Que Cria Itens Em Volta De Você Por Um Tempo Para Trapar?
tópico respondeu ao LucasM010203 de MatheusGlad em Lixeira Pública
data/spells/scripts/trapw.lua: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH) setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1499) local area = { {0, 1, 1, 1, 1, 1, 0}, {1, 1, 0, 0, 0, 1, 1}, {1, 0, 0, 0, 0, 0, 1}, {1, 0, 0, 3, 0, 0, 1}, {1, 0, 0, 0, 0, 0, 1}, {1, 1, 0, 0, 0, 1, 1}, {0, 1, 1, 1, 1, 1, 0} } setCombatArea(combat, createCombatArea(area)) function onCastSpell(cid, var) return doCombat(cid, combat, var) end data/spells/spells.xml: <instant name="Trap Wild" words="exevo mas trap" lvl="50" mana="160" prem="1" selftarget="1" exhaustion="2000" needlearn="0" event="script" value="trapw.lua"> </instant> Nao precisa fazer a runa, pra isso existe o machete. Caso ainda queria a runa eh so falar. -
E o miih sempre de brinks com a galeris. function executeClean() doCleanMap() doBroadcastMessage("Game map cleaned, next clean in 24 hours.") return true end function onTimer() doBroadcastMessage("Game map cleaning within 1 minute, please pick up your items!") addEvent(executeClean, 60000) return true end Roubei seu rep+ miih.
-
Funçao: Pega os uids de criaturas de uma area quadrada. function getUidsInArea(extr1, extr2) local dat = {} for i = 1, (extr2.y-extr1.y)+1 do for s = 1, (extr2.x-extr1.x)+1 do if isCreature(getThingFromPos({x=extr1.x+s-1, y=extr1.y+i-1, z=extr1.z, stackpos=255}).uid) then table.insert(dat, getThingFromPos({x=extr1.x+s-1, y=extr1.y+i-1, z=extr1.z, stackpos=255}).uid) end end end return dat end Como usar: O parametro extr1 e extr2 sao as pos de 2 "vertices" opostos de uma area quadrada. local uids = getUidsInArea({x = 3, y = 5, z = 7}, {x = 17, y = 15, z = 7}) Eu acho que tem uma funçao parecida no tibia, getSpectators, mas essa é mais facil de usar. OBS: Retorna uma table com todas as uids da pos.
-
function string.explode(str, sep) -- function by MatheusMkalo local dat = {} local lastsep = 0 for i = 1, #str do if str: sub(i, i+#sep-1) == sep then local addt = lastsep == 0 and str: sub(1, i-1) or str: sub(lastsep+#sep, i-1) if addt ~= "" then table.insert(dat, addt) end str = str:sub(1, i-1) .. str:sub(i+#sep-1) lastsep = i-#sep+1 end if #dat == 0 and i == #str then table.insert(dat, str) break end if i == #str then table.insert(dat, str: sub(lastsep+#sep, #str)) end end return dat end Funçao string.explode dos ots em lua... N funfa com pattern
-
Nao deu em nada tbm @Edit ACHEI O ERRO, O CHAR QUE EU TAVA TENTANDO NAO ERA PREMMY EU SOU MUITO BURRO PQP
-
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) talkState[cid] = 0 end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end if msgcontains(msg:lower(), "addon") and getPlayerStorageValue(cid, 55413) == 2 then if os.time()-getPlayerStorageValue(cid, 55414) >= 2*60 then doPlayerAddOutfit(cid, 128, 1) doPlayerAddOutfit(cid, 136, 1) return selfSay("Just in time! Your backpack is finished. Here you go, I hope you like it.", cid) else return selfSay("Uh... I didn't expect you to return that early. Sorry, but I'm not finished yet with your backpack. I'm doing the best I can, promised.", cid) end end if msgcontains(msg:lower(), "addon") then selfSay("Sorry, the backpack I wear is not for sale. It's handmade from rare minotaur leather.", cid) elseif msgcontains(msg:lower(), "minotaur leather") then selfSay("Well, if you really like this backpack, I could make one for you, but minotaur leather is hard to come by these days. Are you willing to put some work into this?", cid) talkState[cid] = 1 elseif msgcontains(msg:lower(), "yes") and talkState[cid] == 1 then selfSay("Alright then, if you bring me 100 pieces of fine minotaur leather I will see what I can do for you. You probably have to kill really many minotaurs though... so good luck!", cid) setPlayerStorageValue(cid, 55413, 1) talkState[cid] = 0 elseif msgcontains(msg:lower(), "no") and talkState[cid] == 1 then selfSay("So what you want from me?", cid) talkState[cid] = 0 end if msgcontains(msg:lower(), "backpack") and getPlayerStorageValue(cid, 55413) == 1 then selfSay("Ah, right, almost forgot about the backpack! Have you brought me 100 pieces of minotaur leather as requested?", cid) talkState[cid] = 2 elseif msgcontains(msg:lower(), "yes") and talkState[cid] == 2 then if doPlayerRemoveItem(cid, 5878, 100) then selfSay("Great! Alright, I need a while to finish this backpack for you. Come ask me later, okay?", cid) setPlayerStorageValue(cid, 55413, 2) setPlayerStorageValue(cid, 55414, os.time()) else selfSay("You don't have 100 pieces of minotaur leather", cid) end talkState[cid] = 0 elseif msgcontains(msg:lower(), "no") and talkState[cid] == 2 then selfSay("So, come back when you have the 100 minotaur leathers.", cid) talkState[cid] = 0 end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Nao ta adicionando o addon n sei pq, mas tipo ele manda a msg: Just in time! Your backpack is finished. Here you go, I hope you like it. Entao ele executou a funçao pra add o addon mais n adicionou '-' Quem conseguir ganha um pirulito.
-
Em todos os scripts bote essas funçoes: CreatureEventChecker = function(event, ...) -- Colex if isCreature(arg[1]) then event(unpack(arg)) end end creatureEvent = function(event, delay, ...) -- Colex addEvent(CreatureEventChecker, delay, event, unpack(arg)) end Mude todos addEvent por creatureEvent. Funções by Colex.
-
Falta informaçao: Ao clicar na estatua, ele perdera algum item/dinheiro? Precisa de level? ...
-
Erro: local tabela = { {nome="Bruno", idade=22, sexo="Masculino"}, {nome="Thiago", idade=17, sexo="Masculino"}, {nome="Marina", idade=16, sexo="Feminino"} } tabela[1][1] nao retorna Bruno, somente tabela[1].nome retorna bruno ou tabela[1]["nome"] Tirando isso ta bom o tutorial
-
em vez de print usa error(), so botar error(msg)
-
Faz um script.lua na pasta actions/scripts com o nome de hota e bota esse script: function onUse(cid, item) local recompensa = 2342 -- | local ids = {2335,2336,2337,2338,2339,2340,2341} -- | Mude se precisar local tilepos = {x=32807,y=32270,z=12} -- | local tab = {} local value = true if getPlayerStorageValue(cid, 66654) >= 1 then return doPlayerSendCancel(cid, "Voce ja fez essa quest.") end for i = 1,7 do tab[i] = getThingFromPos({x=tilepos.x,y=tilepos.y,z=tilepos.z,stackpos=i}).itemid end for i = 1,7 do if not table.find(ids, tab[i]) then value = false break end ids[table.find(ids, tab[i])] = nil end if value then doPlayerAddItem(cid, recompensa) setPlayerStorageValue(cid, 66654, 1) for i = 1,7 do doRemoveItem(getThingFromPos({x=tilepos.x,y=tilepos.y,z=tilepos.z,stackpos=1}).uid) end end return TRUE end Agora va em actions.xml e bote essa tag: <action actionid="66654" event="script" value="hota.lua"/> Ai é so voce botar o ActionID 66654 em uma alavanca pedra, tanto faz que quando der use nela vai retirar os items do tile e da um hota pro player
-
Script Ser Expluso Da Sala Apos -Xx- Segundos
tópico respondeu ao cucara de MatheusGlad em Lixeira Pública
Quando vai começar a contar? Quando ele passar por uma porta? Entrar num teleport? Pisar em um chao? E tambem quando vai terminar, somente quando os segundos acabarem? -
Item Ou Potion De Double Exp.
tópico respondeu ao MatheusGlad de MatheusGlad em Mods, funções e outros
Tem que botar o tempo nos dois scripts, eles devem ser iguais ... -
nunca mesmo '-' Jv no gmail: eu: Voce ainda me acha puxa saco? '-' jvchequer: aquilo nao fui eu que fiz -.-
-
[Pedido] Copiar Arquivos E Mudar O Seu Texto.
pergunta respondeu ao drakylucas de MatheusGlad em Scripts
function doAddMonsterInXML(monstername, file) local monsterxml = "C:/Users/user/Desktop/Snowz Thyranic 3.1 (8.6)/data/monster/monsters.xml" local fil = io.open(monsterxml, "r") local text = fil:read("*a") local fil2 = io.open(monsterxml, "w") local k,x = text:find("</monsters>") local tex = text:sub(1, k-1) .. '\n <monster name="' .. monstername .. '" file="' .. file .. '"/>' .. "\n </monsters>" fil2:write(tex) return TRUE end doAddMonsterInXML("Dragon", "Apes/dragon.xml") Ai voce edita o monsterxml pra o local do seu monsters.xml -
[Pedido] Copiar Arquivos E Mudar O Seu Texto.
pergunta respondeu ao drakylucas de MatheusGlad em Scripts
function doEditName(file, newname, oldname) local fil = io.open(file, "a+") local text = fil:read("*all") fil:close() local k,x = text:find(oldname) local wrt = text:sub(1, k-1) .. newname .. text:sub(x+1) local fip = io.open(file, "w") fip:write(wrt) fip:close() return TRUE end doEditName("C:/Users/user/Desktop/Snowz Thyranic 3.1 (8.6)/data/monster/Apes/sibang.xml", "Dragon", "Sibang") function doCopyFile(file, newfile) local fil = io.open(file, "r") local text = fil:read("*a") local fil2 = io.open(newfile, "a+") fil2:write(text) fil2:close() fil:close() return TRUE end doCopyFile("C:/Users/user/Desktop/Snowz Thyranic 3.1 (8.6)/data/monster/Apes/sibang.xml", "C:/Users/user/Desktop/Snowz Thyranic 3.1 (8.6)/data/monster/Apes/dragon.xml") -
data/actions/scripts/itemlife.lua: function onUse(cid, item) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+10000) doRemoveItem(item.uid, 1) return TRUE end TAG: <action itemid="ITEMID" event="script" value="itemlife.lua"/> Aonde ta ITEMID voce bota o id do item que vai dar 10k de life.
-
Como Cria Quest Presisando De Npc Itens
tópico respondeu ao srjoao de MatheusGlad em Lixeira Pública
oO Cara e as informaçoes dos itens? frases? npc? -
Bem eu nao botei opçao pra vip e outras pois o autor do pedido nao pediu isso, se eu estivesse postando, concerteza botaria. A pra nao aparecer no default, esqueci de por um baguizin: function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function onSay(cid, words) if not getHouseByPlayerGUID(getPlayerGUID(cid)) then return doPlayerSendCancel(cid, "Voce nao tem casa.") end local pos = getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))) if getCreatureCondition(cid, CONDITION_INFIGHT) then return doPlayerSendCancel(cid, "Voce tem que estar sem battle.") end if not getTilePzInfo({x=pos.x-1, y=pos.y, z=pos.z}) and isWalkable({x=pos.x-1, y=pos.y, z=pos.z}) then pos = {x=pos.x-1, y=pos.y, z=pos.z} elseif not getTilePzInfo({x=pos.x+1, y=pos.y, z=pos.z}) and isWalkable({x=pos.x+1, y=pos.y, z=pos.z}) then pos = {x=pos.x+1, y=pos.y, z=pos.z} elseif not getTilePzInfo({x=pos.x, y=pos.y+1, z=pos.z}) and isWalkable({x=pos.x, y=pos.y+1, z=pos.z}) then pos = {x=pos.x, y=pos.y+1, z=pos.z} elseif not getTilePzInfo({x=pos.x, y=pos.y-1, z=pos.z}) and isWalkable({x=pos.x, y=pos.y-1, z=pos.z}) then pos = {x=pos.x, y=pos.y-1, z=pos.z} end doTeleportThing(cid, pos) return TRUE end
-
Va em data/talkactions/scripts adicione um script.lua com o nome de home e bote esse script: function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function onSay(cid, words) if not getHouseByPlayerGUID(getPlayerGUID(cid)) then return doPlayerSendCancel(cid, "Voce nao tem casa.") end local pos = getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))) if getCreatureCondition(cid, CONDITION_INFIGHT) then return doPlayerSendCancel(cid, "Voce tem que estar sem battle.") end if not getTilePzInfo({x=pos.x-1, y=pos.y, z=pos.z}) and isWalkable({x=pos.x-1, y=pos.y, z=pos.z}) then pos = {x=pos.x-1, y=pos.y, z=pos.z} elseif not getTilePzInfo({x=pos.x+1, y=pos.y, z=pos.z}) and isWalkable({x=pos.x+1, y=pos.y, z=pos.z}) then pos = {x=pos.x+1, y=pos.y, z=pos.z} elseif not getTilePzInfo({x=pos.x, y=pos.y+1, z=pos.z}) and isWalkable({x=pos.x, y=pos.y+1, z=pos.z}) then pos = {x=pos.x, y=pos.y+1, z=pos.z} elseif not getTilePzInfo({x=pos.x, y=pos.y-1, z=pos.z}) and isWalkable({x=pos.x, y=pos.y-1, z=pos.z}) then pos = {x=pos.x, y=pos.y-1, z=pos.z} end doTeleportThing(cid, pos) end Agora va em talkactions.xml e adicione essa linha: <talkaction words="!home" event="script" value="home.lua"/>
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.