Histórico de Curtidas
-
warriorfrog deu reputação a zipter98 em (Resolvido)BUG EM SCRIPT DE AURA SYSTEMlocal config = { [9] = 35; -- [VOCATION] = CORES; [10] = 66; [11] = 144; [12] = 205; } function effectText(cid) local texts, eff = "´ . ," for vocation, color in pairs(config) do if getPlayerVocation(cid) == vocation then eff = color break end end if eff then doSendAnimatedText(getThingPos(cid), texts, eff) addEvent(function() if isPlayer(cid) then effectText(cid) end end, 1000) end end function onLogin(cid) effectText(cid) return true end
-
warriorfrog deu reputação a zipter98 em Bug GobackAbaixo de: local x = pokes[pokemon] coloque: if #getCreatureSummons(cid) > 0 then return doPlayerSendCancel(cid, "You're already using a pokemon.") end
-
warriorfrog deu reputação a zipter98 em (Resolvido)[NPC] Function Error (HELP!)Como Lua é case-sensitive, letras maiúsculas e minúsculas fazem diferença no nome de uma função.
Troque:
player:SetStorageValue(cid, rankStorage, 0) por:
player:setStorageValue(cid, rankStorage, 0) -
warriorfrog deu reputação a zipter98 em NPC UpgraderOi, vi a ideia desse NPC em um lugar por aí e resolvi fazer.
Consiste em um NPC que aprimora seu item (deve estar em uma das mãos - esquerda ou direita) a troco de um outro item (configurável).
A cada nível de aprimoramento, seu item recebe um valor configurável no ataque, defesa e/ou armadura.
Você pode configurar o nível de aprimoramento máximo, chance de falhar, valor adicional que o item receberá a cada aprimoração e, como já dito antes, o item que será cobrado pelo NPC.
Em data/npc, crie um arquivo com extensão .XML, nomeie-o Upgrader, e coloque o seguinte conteúdo:
<?xml version="1.0" encoding="UTF-8"?> <npc name="Upgrader" script="upgradenpc.lua" walkinterval="3000" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="134" head="39" body="113" legs="38" feet="0" addons="3" corpse="2212"/> <parameters> <parameter key="message_greet" value="Olá |PLAYERNAME|, voce gostaria de aprimorar o seu equipamento?"/> </parameters> </npc> Em data/npc/scripts, crie um arquivo com extensão .lua, nomeie-o upgradenpc.lua, e coloque o seguinte conteúdo: 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) 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 local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local config = { items = {12343, 10}, --Respectivamente, ID do item que o NPC irá cobrar e quantidade. maxBoost = 10, --Nível máximo do equipamento. failChance = 20, --Em porcentagem. upgradeValue = 1, --Valor adicional que o item receberá a cada aprimoração. } if msgcontains(msg:lower(), "yes") then for slot = 5, 6 do local item = getPlayerSlotItem(cid, slot) if item.uid > 0 then if getItemAttack(item) > 0 or getItemDefense(item) > 0 or getItemArmor(item) > 0 then if doPlayerRemoveItem(cid, config.items[1], config.items[2]) then local newUpgrade = (getItemAttribute(item.uid, "upgrade") or 0) + 1 if newUpgrade <= config.maxBoost then if math.random(1, 100) > config.failChance then doItemSetAttribute(item.uid, "name", getItemInfo(item.itemid).name.." [+"..newUpgrade.."]") if getItemAttack(item) > 0 then setItemAttack(item, getItemAttack(item) + config.upgradeValue) end if getItemDefense(item) > 0 then setItemDefense(item, getItemDefense(item) + config.upgradeValue) end if getItemArmor(item) > 0 then setItemArmor(item, getItemArmor(item) + config.upgradeValue) end doItemSetAttribute(item.uid, "upgrade", newUpgrade) selfSay("Seu equipamento foi aprimorado com sucesso.", cid) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) else selfSay("Aah, parece que a aprimoração falhou! Mais sorte na próxima vez.", cid) end return true else return selfSay("Seu equipamento já alcançou o nível máximo.", cid) end else return selfSay("Você não tem "..config._item[2].."x "..getItemNameById(config._item[1])..(config._item[2] > 1 and "s" or "")..".", cid) end end end end selfSay("Parece que você não tem um item para aprimorar.", cid) elseif msgcontains(msg:lower(), "no") then selfSay("Tudo bem, então.") end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Versão testada: 8.54 Bem, é só isso, até mais. -
warriorfrog deu reputação a zipter98 em NPC "Pather" (não sou bom com nomes)ANTES DE TUDO: Você deve instalar a função getCreaturePathTo no seu servidor, disponibilizada pelo elwyn. ------------------------------------------------------------------------------------------------------------------------------------------- Oi, o código consiste num NPC que, a troco de dinheiro (configurável), caminha até determinado lugar (escolhido pelo jogador durante o diálogo). Tais lugares, assim como a mensagem que os representa, são configuráveis. Ao chegar no destino, o NPC fica parado durante alguns segundos. Depois, ele volta andando até sua posição de origem. Fiz alguns testes e não encontrei bug algum. Caso você ache, reporte aqui no tópico (ou resolva você mesmo). E se algum jogador/monstro/summon ficar no caminho do NPC, ele passará "por cima" da criatura. Well, em data/npc, crie um arquivo com extensão .XML, nomeie-o Pather, e coloque o seguinte conteúdo: <?xml version="1.0" encoding="UTF-8"?> <npc name="Jonathan" script="path.lua" walkinterval="350000" floorchange="0" speed="0"> <health now="150" max="150"/> <look type="134" head="39" body="113" legs="38" feet="0" addons="3" corpse="2212"/> <parameters> <parameter key="message_greet" value="Hello, wanna see the path of some place?"/> </parameters> </npc> Depois, em data/npc/scripts, crie um arquivo com extensão .lua, nomeie-o path, e coloque o seguinte conteúdo: 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) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local place = nil function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local config = { price = 1000, --Preço. backTime = 5, --Tempo para voltar, em segundos. places = { --["message"] = {to_position}, ["rat"] = {x = 1058, y = 912, z = 7}, ["troll"] = {x = 1059, y = 915, z = 7}, ["goblin"] = {x = 1060, y = 915, z = 7}, }, } local isWalking = getPlayerStorageValue(getNpcCid(), 8013) > -1 and true or false if not isWalking then if talkState[talkUser] == 1 then if config.places[msg:lower()] then selfSay("It will cost you "..config.price.." dollars. Are you sure?", cid) talkState[talkUser] = 2 place = msg:lower() return true else selfSay("I can't go to this place.", cid) return true end elseif msgcontains(msg:lower(), "yes") and talkState[talkUser] == 2 then if doPlayerRemoveMoney(cid, config.price) then selfSay("OK, let's go!", cid) local path = getCreaturePathTo(getNpcCid(), config.places[place], 50) setPlayerStorageValue(getNpcCid(), 8013, 1) local npc = getNpcCid() local npcPos = getNpcPos() for i = 1, #path do addEvent(function() doMoveCreature(npc, path[i]) if i == #path then doCreatureSay(npc, "And here we are!", TALKTYPE_SAY) addEvent(function() doCreatureSay(npc, "Well, I'm going back.", TALKTYPE_SAY) path = getCreaturePathTo(npc, npcPos, 50) for j = 1, #path do addEvent(function() doMoveCreature(npc, path[j]) if j == #path then setPlayerStorageValue(npc, 8013, -1) end end, j * 900) end end, config.backTime * 1000) end end, i * 900) end else selfSay("You do not have enough money.", cid) talkState[talkUser] = 0 return true end elseif msgcontains(msg:lower(), "no") and talkState[talkUser] == 2 then selfSay("Ok, then...", cid) talkState[talkUser] = 0 return true elseif msgcontains(msg:lower(), "yes") then local str = "" local z = {} for _, b in pairs(config.places) do table.insert(z, _) end for d = 1, #z do if str == "" then str = z[d] else str = str..(d == #z and " and " or ", ")..z[d] end end selfSay("I can show you the path for the following places: {"..str.."}. Which path do you wanna see?", cid) talkState[talkUser] = 1 return true elseif msgcontains(msg:lower(), "no") then selfSay("Ok, bye.") talkState[talkUser] = 0 return true end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) No momento estou de saída, logo não posso gravar um vídeo, tirar alguma screenshot ou fazer um gif. Caso esteja curioso, instale o código e teste-o. Até breve.
-
warriorfrog deu reputação a zipter98 em Ditto Memory System por talkactionOK, isto não é exatamente um sistema, visto que é composto por um único arquivo com um único callback, mas enfim.
Antes de começar a desenvolver o tópico, digo-lhes: o código é para poketibia, não outros derivados ou Tibia comum.
Introdução:
A pedidos de um amigo, resolvi escrever este script. Por não programar em OTClient, optei por escrevê-lo em uma talkaction. Para aqueles que não conhecem o sistema, consiste em praticidade para as transformações do Ditto: ao invés de repetir o cansativo processo de procurar o pokémon que deseja-se copiar, você pode simplesmente salvá-lo na memória do Ditto para, sempre que quiser, transformá-lo em um único comando.
Você pode configurar quantos slots de "memória" quiser.
Para usar os comandos, você deve colocar uma pokebola com um Ditto no slot 8/feet (a.k.a "pokeball slot"). Alguns, no entanto, necessitam também que o pokémon esteja "solto".
Comandos:
/memory check Use este comando para verificar os atuais slots de seu Ditto. /memory forget [slot] Use este comando para deletar uma memória salva, respectiva ao slot indicado. Ex.: /memory forget 1 /memory save [slot] Use este comando para salvar uma memória, respectiva ao slot indicado. A memória salva será do pokémon que seu Ditto estará transformado no momento. Ex.: /memory save 3 /memory [slot] Use este comando para transformar seu Ditto no pokémon que estiver armazenado no slot indicado. Ex.: /memory 2 PS: Você também pode usar !memory.
Instalação:
Em data/talkactions/scripts, crie um arquivo com extensão .lua, nomeie-o dittomemory e coloque o seguinte conteúdo:
Em data/talkactions, abra o arquivo talkactions.xml e coloque a seguinte tag: <talkaction words="/memory;!memory" event="script" value="dittomemory.lua"/> Versão testada: 8.54 Servidor testado: PDA by Slicer, versão 1.9 É um código bem simples, escrito em poucos minutos. Resolvi postá-lo pois gostei do resultado apresentado. Para alguns, pode não ser tão útil; para outros, espero que sim. É isso aí, até mais. -
warriorfrog deu reputação a zipter98 em (Resolvido)[PEDIDO] Desert quest (10 reps)OK, corrigido.
-
warriorfrog deu reputação a zipter98 em (Resolvido)[PEDIDO] Desert quest (10 reps)local config = { items = { {position = {x = x, y = y, z = z}, itemid = xxx}, --{position = posição_do_item, itemid = id_do_item}, {position = {x = x, y = y, z = z}, itemid = xxx}, {position = {x = x, y = y, z = z}, itemid = xxx}, --etc }, players = { {position = {x = x, y = y, z = z}, toPos = {x = x, y = y, z = z}, vocation = {xxx, xxx, ...}}, --{position = posição_do_jogador, toPos = posição_final, vocation = ID_das_vocações}, {position = {x = x, y = y, z = z}, toPos = {x = x, y = y, z = z}, vocation = {xxx, xxx, ...}}, {position = {x = x, y = y, z = z}, toPos = {x = x, y = y, z = z}, vocation = {xxx, xxx, ...}}, --etc } } function onUse(cid) local items, quest_players = {}, {} for _, item in pairs(config.items) do local position_item = getTileItemById(item.position, item.itemid).uid if position_item > 0 then table.insert(items, position_item) else return doPlayerSendCancel(cid, "There's missing some item(s).") end end for _, player in pairs(config.players) do local pid = getTopCreature(player.position).uid if isPlayer(pid) and isInArray(player.vocation, getPlayerVocation(pid)) then table.insert(quest_players, pid) else return doPlayerSendCancel(cid, "There's some player(s) missing or there's some wrong vocation(s).") end end for i = 1, #items do doRemoveItem(items[i]) end for i = 1, #quest_players do doPlayerSendTextMessage(quest_players[i], MESSAGE_INFO_DESCR, "Good luck at the quest!") doTeleportThing(quest_players[i], config.players[i].toPos) end return true end
-
warriorfrog deu reputação a Caronte em (Resolvido)[AJUDA] Ice rapier não quebra num hitFica com 100, eu acho...
Dá para criar só uma: /i 2396, 1
-
warriorfrog deu reputação a Sekk em (Resolvido)[AJUDA] Ice rapier não quebra num hitquando é o god q cria, fica infinito...