Pesquisar na Comunidade
Mostrando resultados para as tags ''Action''.
Encontrado 122 registros
-
[TFS 0.4] Treasure Chest Lottery + PHP Page
Olá, pessoal! Acabei encontrando um script que tinha feito a um tempo atrás. Estou compartilhando aqui para quem quiser usar ou melhorar. É bem parecido com os outros sistemas de roleta, igual deste tópico: https://tibiaking.com/forums/topic/101557-action-cassino-roleta-de-items/ Como funciona? O "Treasure Chest" é um item custom, onde o jogador têm a possibilidade de ganhar itens raros ou bem meia boca. Tudo dependerá da sorte. O jogador precisa tacar o treasure chest na bancada e acionar a alavanca. O treasure chest irá se transformar em vários itens de forma randômica no qual o jogador poderá ou não ganhar. No final, apenas um item é entregue ao jogador. Para entender melhor o seu funcionamento, segue o GIF abaixo: em data > actions > actions.xml em data > actions > scripts > crie um arquivo chamado leverTreasureChest.lua no banco de dados do servidor, adicione o seguinte código em "SQL": Também estou disponibilizando uma página PHP, para quem quiser usar no site do servidor. Na página tem informações sobre o funcionamento, quais são os possíveis prêmios e a lista de jogadores que ganharam os itens raros. Espero ter ajudado de alguma forma! : ) treasure_chest.php
- Algem Me Pode arrumar algum scrip casino igual ou semelhante à imagem
-
[RevScripts] Action Remover Skull
Action: Remover skull
-
Check de monster em um determinado lugar.
TFS 0.4 8.60 SEGUINTE.. Estava procurando aqui no fórum algum script que checa se existe monstros em uma determinada área, se tiver monstros o cara não pode clicar no bau ate matar todos os monstros. É pra um sistema de arena que estou desenvolvendo de arena, até encontrei algo mas não funciona function onUse(cid, item, position, fromPosition) local area = {{x = 539, y = 592, z = 7}, {x = 556, y = 607, z = 7}} function CheckMonsters(area) for x = area[1].x - 1, area[2].x + 1 do for y = area[1].y - 1, area[2].y + 1 do local pos = {x=x, y=y, z=area[1].z} local m = getTopCreature(pos).uid if m ~= 0 and isMonster(m) then doPlayerSendTextMessage(cid,22,"Ainda existe monstros na arena!") else doTeleportThing(cid,{x = 556, y = 607, z = 7}) doSendMagicEffect(getCreaturePosition(cid), 30) doPlayerAddArenaPoints(cid, 1) doPlayerSendTextMessage(cid,22,"Você recebeu 1 Arena Points!") end end end end end Basicamente o código é esse porem se estiver monstros eu clico e ganho o premio acho que postei em lugar errado se der pra apagar aqui vlw.
-
Alavanca de troca [X itens por Y itens]
Olá, Bom... teve um pedido no Discord da TK feito por algum usuário (não estou recordando o nome) que estava tendo dificuldades em fazer determinado script, então decidi fazê-lo. É algo simples, eu já tinha enviado lá no canal de suporte, porém, como já de conhecimento por muitos, o canal foi removido. Decidi refazer de uma forma melhor e mais prática. * Sobre o Script * Quando o jogador utilizar a alavanca para ganhar determinado(s) item(s), ele terá que ter deixado em POSIÇÕES DEFINIDAS alguns itens, sendo assim, possível efetuar a troca. Simples, não? Caso ainda não tenha entendido, tem imagem abaixo de como funciona o mesmo. * Imagens demonstração * Tentando efetuar a troca sem tá com os itens posicionados de forma correta... Efetuando a troca de forma correta. * Instalando o Script * Em data/actions/scripts/ crie um arquivo chamado alavanca_troca.lua e cole isto dentro: --[[ Lordzetros - TK ]] local config_itens = { {id = 2666, pos = {144,63,6}, count = 1}, -- ID DO ITEM NECESSÁRIO, POSIÇÃO QUE DEVE FICAR, QUANTIDADE DE ITEM NECESSÁRIO {id = 2667, pos = {145,63,6}, count = 1}, {id = 2671, pos = {146,63,6}, count = 1}, -- Caso queira colocar outro item, basta seguir esse modelo (ctrl + c) } local config_troca = { msg_falha = "Falha na troca do item. Necessario: %dx %s em sua devida posicao!", msg_sucesso = "A troca foi efetuada com sucesso!", recompensas = {{id = 2003, count = 1}, {id = 2004, count = 1}} -- Para deixar apenas uma recompensa, apenas deixe recompensas = {{id = ID_DO_ITEM_A_GANHAR, count = QUANTIDADE_A_GANHAR}} } function onUse(player, item, fromPosition, target, toPosition, isHotkey) local ax_t = {} for i, v in ipairs(config_itens) do local vt = Tile(Position(v.pos[1], v.pos[2], v.pos[3])) local item_t = vt:getItemById(v.id) if (not item_t or item_t:getCount() < v.count) then player:getPosition():sendMagicEffect(CONST_ME_POFF) player:sendTextMessage(36, config_troca.msg_falha:format(v.count, ItemType(v.id):getName())) return false end table.insert(ax_t, {item_t, v.count}) end for i, v in ipairs(ax_t) do v[1]:remove(v[2]) end for i, v in ipairs(config_troca.recompensas) do player:addItem(v.id, v.count) end player:sendTextMessage(36, config_troca.msg_sucesso) player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_RED) return true end Em seguida, coloque esta linha de código abaixo de uma semelhante em data/actions/actions.xml <action actionid="30258" script="alavanca_troca.lua" /> Para finalizar, abre seu editor de mapa e coloque em algum alavanca o actionID = 30258 * Configurando o Script * Tá tudo comentado no código, portanto, vou falar só por cima. {id = 2666, pos = {144,63,6}, count = 1} Nesta parte, você deve colocar o id do item necessário, a posição que ele deve ficar e a quantidade. E nesta parte você configura a recompensa do jogador recompensas = {{id = 2003, count = 1}, {id = 2004, count = 1}} Id do item que ele ganhará e quantidade Enfim, script simples, porém, pode ser útil para muitos, assim como acredito que será para o usuário que solicitou, :). Abraços.
-
Baú/Chest shop - Comprar mesmo item com 2 moedas diferentes
Vim disponibilizar esse código de chest que eu tava precisando e não achei em lugar algum. Agradecimento ao @Sttorm que me ajudou a entender a estrutura do código. Comprar mesmo item com 2 moedas diferentes! (Chest Action) 23:31 Sao necessarios 50 gold coin e 50 crystal coin para realizar esta compra. 23:32 Voce comprou crown backpack por 50 gold coin e 50 crystal coin data/actions/actions.xml: (mude baus/bau01.lua se o seu esquema for diferente) <action actionid="6012" event="script" value="baus/bau01.lua"/> data/actions/scripts/baus/bau01.lua: ( " ) local coin = 2148 -- id da primeira moeda local coin2 = 2160 -- id da segunda moeda local eff = 28 -- efeito mágico ao comprar o item local lever = { [7017] = {50, 50, 10522} -- [actionid] = {quantidade da moeda 1, quantidade da moeda 2, id do item a comprar} } function onUse(cid,item,fromPosition,itemEx,toPosition) if getPlayerItemCount(cid, coin) >= (lever[item.actionid][1]) and getPlayerItemCount(cid, coin2) >= (lever[item.actionid][2]) then doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) doPlayerRemoveItem(cid,coin2,lever[item.actionid][2]) doPlayerAddItem(cid,lever[item.actionid][3], isItemStackable(lever[item.actionid][3]) and 1) doPlayerSendTextMessage(cid,22,"Voce comprou " .. getItemNameById(lever[item.actionid][3]) .." por "..lever[item.actionid][1].." " ..getItemNameById(coin).. " e "..lever[item.actionid][2].." " ..getItemNameById(coin2)) doSendMagicEffect(getCreaturePosition(cid), config.eff) else return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sao necessarios "..lever[item.actionid][1].." " ..getItemNameById(coin).. " e "..lever[item.actionid][2].." " ..getItemNameById(coin2).. " para realizar esta compra.") end end
-
Bau diário
Opa galera beleza? Eu vi um cidadão aqui do forum pedindo, e para não reviver o tópico resolvi desenvolver 1 e postar @ADM Mayk on BaiakME Ta ai o script que tu pediu. Crie um arquivo com o nome de Bau_Diario.lua local config = { items = { [1] = {2160, 10}, [2] = {2159, 10} }, level = 100, tempo = 24*60*60, -- 24 horas stoTime = 31402 } function onUse(player, item, fromPosition, itemEx, toPosition) if player:getLevel() >= config.level then if player:getStorageValue(config.stoTime) - os.time() < 0 then player:setStorageValue(config.stoTime, os.time() + config.tempo) for _, table in pairs(config.items) do for i=1, #config.items do player:addItem(table[i]) end end else player:getStorageValue(config.stoTime, 0) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Wait: %s.", string.diff(player:getStorageValue(config.stoTime)-os.time()))) end else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Voce nao tem level "..config.level..".") end end Adicione a TAG em actions.xml <action actionid="22164" script="Bau_Diario.lua"/> Créditos: Eu
-
[ACTIONS] Tm System -
Olá pessoal, venho hoje aqui para postar um sistema de pokemon muito procurado, o famoso, Tm System. Siga o tutorial a risca ou seu trabalho será invão. Quote Seu Funcionameto: Basícamente funciona assim; ele adiciona um "Attack" novo a um pokemon ou substitui um existente, dependendo da vontado do player. Versões testadas: Qualquer derivado do PDA http://www.havencrest.co.uk/images/page-divider 2.jpg Vamos ao que interessa, vá em actions.xml e cole a seguinte tag: <action itemid="id do item que será usado" event="script" value="tmSystem.lua"/> Atenção o item que será usado no system, não deve ter o attributo "Usable" ou você terá erros. Agora crie um arquivo em {data/actions/scripts} chamado tmSystem.lua e cole o seguinte script dentro: function onUse(cid, item, frompos, item2, topos) local tm = tmabilities local pokemon = getCreatureSummons(cid)[1] local slotball = getPlayerSlotItem(cid, 8).uid local tmname = getItemNameById(item2.itemid) local i = item2.itemid if #getCreatureSummons(cid) == 0 then return doPlayerSendCancel(cid, "Need pokemon to learn a "..tmname..".") end if getItemAttribute(slotball, "TM") == tmname then return doPlayerSendCancel(cid, "Your pokemon was learned this TM.") end if isInArray(tm[""..tmname..""], getPokemonName(pokemon)) then doPlayerSetVocation(cid, 49) openChannelDialog(cid) else doPlayerSendCancel(cid, "This TM not compatible in your pokemon.") end return true end http://www.havencrest.co.uk/images/page-divider 2.jpg Agora vamos em {creaturescripts.xml} e colaremos a seguinte tag: <event type="joinchannel" name="TmChoose" event="script" value="tmsys.lua"/> Agora crie o arquivo tmsys.lua em {creaturescripts/scripts} e cole isso dentro: [CODE] function onJoinChannel(cid, channelId, users, isTv) if getPlayerVocation(cid) == 49 then else return true end local summon = getCreatureSummons(cid)[1] local moves = movestable[getCreatureName(summon)] local n = 1 for a = 1, 12 do local b = getNewMoveTable(moves, a) if b then n = n + 1 end end for b = 13, 23 do if channelId == b then local tm = tmabilities local pokemon = getCreatureSummons(cid)[1] local slotball = getPlayerSlotItem(cid, 8).uid local slotm = getPlayerSlotItem(cid, 9) local tmname = getItemNameById(slotm.itemid) if n >= channelId - 11 then doPlayerSendTextMessage(cid, 27, "Congralutions! Your "..getPokemonName(pokemon).." learn a new TM ("..tmname..").") doItemSetAttribute(slotball, "TM", tmname) doItemSetAttribute(slotball, "TMN", channelId - 11) doSendMagicEffect(getThingPosition(pokemon), 28) doSendMagicEffect(getThingPosition(pokemon), 29) doRemoveItem(slotm.uid) if useKpdoDlls then doUpdateMoves(cid) end else doPlayerSendCancel(cid, "Put tm on at last empty slot.") end return false end end return true end http://www.havencrest.co.uk/images/page-divider 2.jpgNesta parte você precisa de muita atenção, você terá que criar 10 channels como no modelo abaixo: <channel id="13" name="[Put on M1]"> <vocation id="49"/> </channel> <channel id="14" name="[Put on M2]"> <vocation id="49"/> </channel> Em channel id você seguira a ordem 13 a 23, em vocations id pode deixar do jeito que esta. Agora crie uma vocation com o id 49 ou cole a seguinte tag no vocations.xml: <vocation id="49" name="TM" description="pokemon trainer" needpremium="0" gaincap="0" gainhp="55" gainmana="0" gainhpticks="0" gainhpamount="0" gainmanaticks="0" gainmanaamount="0" manamultiplier="1.1" attackspeed="-1" soulmax="251" gainsoulticks="-1" fromvoc="1" lessloss="0"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="2" club="2" sword="2" axe="2" distance="2" shielding="2" fishing="2" experience="1.1"/> </vocation> Imagem Postada http://www.havencrest.co.uk/images/page-divider 2.jpgAgora vamos em {data/lib} e crie um arquivo chamado tmSystem.lua e cole as seguintes linhas nele: tmabilities = { ["Solar Beam"] = {"Blastoise", "Venusaur", "Charizard"}, ["Fire Blast"] = {"Blastoise", "Venusaur", "Charizard"}, } Nesta parte você edita, para cada magia[""] = nome dos pokemons que poderam ter essa magia por tm. Tipo do jeito que esta ai, se você for tentar colocar um fire blast em um bulba não vai pegar.. Para adicionar mais magias, basta copiar a linha e colocar o nome da magia nova e seus respectivos pokemons. http://www.havencrest.co.uk/images/page-divider 2.jpg Preste atenção, para cada magia feita, terá que haver um item com o nome da magia. E o id deste item deve ser colocado na tag da actions. ou seja(exemplo): abra o item.xml pegue o item que deseje usar e coloque o nome "Solar Beam"(do mesmo jeito da lib), pegue o id dele e cole na tag da actions. Espero que tenham intendido está parte. http://www.havencrest.co.uk/images/page-divider 2.jpg A ultima parte da instalção, vamos em {data/talkactions/scripts} e abra o arquivo move1.lua e substitua a parte de "if it = 1" até o ultimo "end" antes da parte "if not move then": local msgs = {"use ", ""} function doAlertReady(cid, id, movename, n, cd) if not isCreature(cid) then return true end local myball = getPlayerSlotItem(cid, 8) if myball.itemid > 0 and getItemAttribute(myball.uid, cd) == "cd:"..id.."" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(myball.uid).." - "..movename.." (m"..n..") is ready!") return true end local p = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid) if not p or #p <= 0 then return true end for a = 1, #p do if getItemAttribute(p[a], cd) == "cd:"..id.."" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (m"..n..") is ready!") return true end end end function onSay(cid, words, param, channel) if param ~= "" then return true end if string.len(words) > 3 then return true end if #getCreatureSummons(cid) == 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need a pokemon to use moves.") return 0 end --alterado v1.5 local mypoke = getCreatureSummons(cid)[1] if getCreatureCondition(cid, CONDITION_EXHAUST) then return true end if getCreatureName(mypoke) == "Evolution" then return true end if getCreatureName(mypoke) == "Ditto" or getCreatureName(mypoke) == "Shiny Ditto" then name = getPlayerStorageValue(mypoke, 1010) --edited else name = getCreatureName(mypoke) end --local name = getCreatureName(mypoke) == "Ditto" and getPlayerStorageValue(mypoke, 1010) or getCreatureName(mypoke) local it = string.sub(words, 2, 3) local move = movestable[name].move1 local cdzin = "move"..it.."" local slotball = getPlayerSlotItem(cid, 8).uid local tmname = getItemAttribute(slotball, "TM") if it == "2" then if getItemAttribute(slotball, "TMN") == 2 then move = {name = ""..tmname.."", level = 0, cd = 12, dist = 0, target = 0} else move = movestable[name].move2 end elseif it == "3" then if getItemAttribute(slotball, "TMN") == 3 then move = {name = ""..tmname.."", level = 0, cd = 12, dist = 0, target = 0} else move = movestable[name].move3 end elseif it == "4" then if getItemAttribute(slotball, "TMN") == 4 then move = {name = ""..tmname.."", level = 0, cd = 12, dist = 0, target = 0} else move = movestable[name].move4 end elseif it == "5" then if getItemAttribute(slotball, "TMN") == 5 then move = {name = ""..tmname.."", level = 0, cd = 12, dist = 0, target = 0} else move = movestable[name].move5 end elseif it == "6" then if getItemAttribute(slotball, "TMN") == 6 then move = {name = ""..tmname.."", level = 0, cd = 12, dist = 0, target = 0} else move = movestable[name].move6 end elseif it == "7" then if getItemAttribute(slotball, "TMN") == 7 then move = {name = ""..tmname.."", level = 0, cd = 12, dist = 0, target = 0} else move = movestable[name].move7 end elseif it == "8" then if getItemAttribute(slotball, "TMN") == 8 then move = {name = ""..tmname.."", level = 0, cd =15, dist = 0, target = 0} else move = movestable[name].move8 end elseif it == "9" then if getItemAttribute(slotball, "TMN") == 9 then move = {name = ""..tmname.."", level = 0, cd = 12, dist = 0, target = 0} else move = movestable[name].move9 end elseif it == "10" then if getItemAttribute(slotball, "TMN") == 10 then move = {name = ""..tmname.."", level = 0, cd = 12, dist = 0, target = 0} else move = movestable[name].move10 end elseif it == "11" then if getItemAttribute(slotball, "TMN") == 11 then move = {name = ""..tmname.."", level = 0, cd = 12, dist = 0, target = 0} else move = movestable[name].move11 end elseif it == "12" then if getItemAttribute(slotball, "TMN") == 12 then move = {name = ""..tmname.."", level = 0, cd = 12, dist = 0, target = 0} else move = movestable[name].move12 end end if not move then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.") return true end if getPlayerLevel(cid) < move.level then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need be atleast level "..move.level.." to use this move.") return true end if getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (move.cd + 2) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." seconds to use "..move.name.." again.") return true end if getTileInfo(getThingPos(mypoke)).protection then doPlayerSendCancel(cid, "Your pokemon cannot use moves while in protection zone.") return true end if getPlayerStorageValue(mypoke, 3894) >= 1 then return doPlayerSendCancel(cid, "You can't attack because you is with fear") --alterado v1.3 end --alterado v1.6 if (move.name == "Team Slice" or move.name == "Team Claw") and #getCreatureSummons(cid) < 2 then doPlayerSendCancel(cid, "Your pokemon need be in a team for use this move!") return true end --alterado v1.6 if isCreature(getCreatureTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getCreatureTarget(cid))) and math.random(1, 100) <= 10 then local target = getCreatureTarget(cid) if isCreature(getMasterTarget(target)) then --alterado v1.6 doSendMagicEffect(getThingPos(target), 211) doSendAnimatedText(getThingPos(target), "TOO BAD", 215) doTeleportThing(target, getClosestFreeTile(target, getThingPos(mypoke)), false) doSendMagicEffect(getThingPos(target), 211) doFaceCreature(target, getThingPos(mypoke)) return true --alterado v1.6 end end if move.target == 1 then if not isCreature(getCreatureTarget(cid)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don\'t have any targets.") return 0 end if getCreatureCondition(getCreatureTarget(cid), CONDITION_INVISIBLE) then return 0 end if getCreatureHealth(getCreatureTarget(cid)) <= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your have already defeated your target.") return 0 end if not isCreature(getCreatureSummons(cid)[1]) then return true end if getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid))) > move.dist then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Get closer to the target to use this move.") return 0 end if not isSightClear(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid)), false) then return 0 end end local newid = 0 if isSleeping(mypoke) or isSilence(mypoke) then --alterado v1.5 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.") return 0 else newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, move.cd) end doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..move.name.."!", TALKTYPE_SAY) local summons = getCreatureSummons(cid) --alterado v1.6 addEvent(doAlertReady, move.cd * 1000, cid, newid, move.name, it, cdzin) for i = 2, #summons do if isCreature(summons[i]) and getPlayerStorageValue(cid, 637501) >= 1 then docastspell(summons[i], move.name) --alterado v1.6 end end docastspell(mypoke, move.name) doCreatureAddCondition(cid, playerexhaust) if useKpdoDlls then doUpdateCooldowns(cid) end return 0 end Até que enfim.. Se fizeram tudo certo o sistema vai funcionar se não.... Caso não itendam alguma parte da explicação podem me perguntar por aqui... Creditos Smix
-
[TFS 1.3] Goldchange - Converter 100 gold coin em 1 platinum coin e 100 platinum coin em 1 crystal coin
[TFS 1.3] Goldchange - Converter 100 gold coin em 1 platinum coin e 100 platinum coin em 1 crystal coin Muitos dos novos servers não tem mais esta função facilitadora que os jogadores tanto adoram! Por este motivo venho compartilhar aqui com vocês. gold_change.lua Em Data/Scripts/Actions/Other/ crie um arquivo .lua chamado gold_change.lua e insira o código abaixo: CRÉDITOS: @EddyHavoc
-
Town Portal System (based Dota 2)
Buenas, TK! Um mano gringo aí pediu algo do tipo, e eu precisava me familiarizar melhor com a orientação a objetos usada em Lua do TFS 1.3, então fiz esse action, onde o player que possui um scroll pode fazer um portal para seu templo, que é usado dando USE mesmo, e sua party inteira pode ir junto para seus respectivos templos se não estiverem pz locked ou com battle, e caso o player não esteja em uma party, apenas o mesmo pode entrar no portal. Tags XML: <action itemid="PORTALID HERE" script="townportalsystem.lua"/> <action itemid="SCROLLID HERE" script="townportalsystem.lua"/> Arquivo townportalsystem.lua em actions/scripts/: -- Town Portal Scroll System based in Dota 2 -- by Nazo (tibiaking.com) local config = { portalId = 1231, -- change to portal item id portalTime = 30, -- portal duration in seconds scrollId = 1232, -- change to scroll item id effect = CONST_ME_POFF -- effect id or CONST that appears at the end of time } local function removePortal(portal) if(portal) portal:remove() portal:getPosition():sendMagicEffect(config.effect) else print("Admin excluiu o portal, parabéns") end end function onUse(player, item, fromPosition, target, toPosition, isHotkey) if(item:getId()==config.scrollId) then portal = Game.createItem(config.portalId, 1, player:getPosition()) if(player:getParty()) then portal:setCustomAttribute("party", player:getParty()) else portal:setCustomAttribute("owner", player:getName()) end addEvent(removePortal, config.portalTime * 1000, portal) item:remove() else if(not player:isPzLocked() and not player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT)) then if(item:getCustomAttribute("party")) then if(player:getParty()==item:getCustomAttribute("party")) then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You do not participate in the portal creator's party.") end elseif(item:getCustomAttribute("name") and player:getName() == item:getCustomAttribute("name")) then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You isn't the owner.") end else player:popupFYI("You are PZ locked or in battle.") end end return true end
-
Estatua ou porta de Teleport.
Bom galera é o seguinte, eu tentei criar um NPC que teleporta por X item. Mas sempre dava um erro quando vai adiciona-lo no mapa. Ai resolvi fazer uma Script que quando você clica na Estatua, porta, parede ou coisa do tipo você é teleportado se tiver X Item. ( PS: Quando vc é teleportado o item não é removido de sua bag. Você cotinua com o item, como se fosse uma permissão !! ) Bom, vamos deixar de papo furado, e vamos ao que interessa. Vai em: data/actions/scripts crie um arquivo .lua com o nome que você quiser e cole isso: Agora vá em actions.xml e cole essa tag: Action ID Nome do arquivo que você criou em: data/actions/scripts
-
Elements - Advanced Mining System (skills + coins + levels)
Trago a vocês esse sistema, originalmente produzido para um servidor custom 8.60. (testado em 0.4 - firelement). Acredito que será mais útil pra vocês do que pra mim nesse momento. Se alguém puder acrescentar informações a respeito do uso em diferentes tfs agradeço. ? INFORMAÇÕES P = Posso mineirar vários itens nesse sistema? R = Sim, existem quatro elementos e quatro categorias, possibilitando gerar até 16 produtos finais nas minas. Essa configuração pode ser editada facilmente. Caso queira usar da maneira como o script está feito, ao mineirar você poderá coletar as seguintes pedras: P = Mas as pedras caem aleatoriamente? R = Não, esse mining possui um SKILL, conforme você mineira o skill aumenta e consecutivamente o seu LEVEL. Inicia com pedras Light, depois pure, rare e massive. Você pode editar facilmente o modo como a exp sobe, os leveis necessários para executar cada ação e as pedras. P = Qual a utilidade das pedras elementares? R = Na ideia original, projetei o sistema para que as pedras fossem gastas ao comprar itens em baús, mas fica a seu critério como utilizá-las. Por exemplo, um colar de proteção earth/ice precisaria ser pago com pedras de earth e ice. Incluirei no tópico o script utilizado no baú e o script para trocar as pedras quando atingir 100 unidades cada. Veja o exemplo: INSTALAÇÃO Em data/actions/script crie um arquivo .lua chamado elementalmining e cole o código dentro: local config = { maxmininglevel = 100, storagemining = 10000, expperlevel = 1000, experiencemining = 10001 } local stone = { blue = {8637, 8633, 9798, 1354}, green = {8640, 8636, 9791, 1353}, lightblue = {8638, 8634, 9790, 12344}, red = {8639, 8635, 9788, 1355}, } local stones = { crystal = {stone.blue[1], stone.green[1], stone.lightblue[1], stone.red[1]}, lcrystal = {stone.blue[2], stone.green[2], stone.lightblue[2], stone.red[2]}, pcrystal = {stone.blue[3], stone.green[3], stone.lightblue[3], stone.red[3]}, scrystal = {stone.blue[4], stone.green[4], stone.lightblue[4], stone.red[4]}, } local ore = { blue = {2146, 7759, 5905, 8302}, green = {2149, 7761, 12396 ,8298}, lightblue = {2150, 7762, 12575, 8303}, red = {2147, 7760, 5906, 8299}, } local ores = { ore.blue[1], ore.blue[2], ore.blue[3], ore.blue[4], ore.green[1], ore.green[2], ore.green[3], ore.green[4], ore.lightblue[1], ore.lightblue[2], ore.lightblue[3], ore.lightblue[4], ore.red[1], ore.red[2], ore.red[3], ore.red[4]} local levels = { { level = {0,19}, stone = {stones.crystal[1], stones.crystal[2], stones.crystal[3], stones.crystal[4]}, items = {ores[1],ores[5], ores[9], ores[13]}, iselect = 0, bstart = 1, gstart = 2, lbstart = 3, rstart = 4, chance = 10, -- 30 qtdmax = 1, expgainmin = 1, --15 expgainmax = 1 --50 }, { level = {20,49}, stone = {stones.crystal[1], stones.crystal[2], stones.crystal[3], stones.crystal[4], stones.lcrystal[1], stones.lcrystal[2], stones.lcrystal[3], stones.lcrystal[4]}, items = {ores[1],ores[2], ores[5], ores[6], ores[9],ores[10], ores[13], ores[14]}, iselect = 1, bstart = 1, gstart = 3, lbstart = 5, rstart = 7, chance = 10, qtdmax = 1, expgainmin = 1, expgainmax = 1 }, { level = {50,69}, stone = {stones.crystal[1], stones.crystal[2], stones.crystal[3], stones.crystal[4], stones.lcrystal[1], stones.lcrystal[2], stones.lcrystal[3], stones.lcrystal[4], stones.pcrystal[1], stones.pcrystal[2], stones.pcrystal[3], stones.pcrystal[4]}, items = {ores[1],ores[2], ores[3], ores[5], ores[6], ores[7], ores[9],ores[10], ores[11], ores[13], ores[14], ores[15]}, iselect = 2, bstart = 1, gstart = 4, lbstart = 7, rstart = 10, chance = 10, qtdmax = 1, expgainmin = 1, expgainmax = 1 }, { level = {70,89}, stone = {stones.crystal[1], stones.crystal[2], stones.crystal[3], stones.crystal[4], stones.lcrystal[1], stones.lcrystal[2], stones.lcrystal[3], stones.lcrystal[4], stones.pcrystal[1], stones.pcrystal[2], stones.pcrystal[3], stones.pcrystal[4], stones.scrystal[1], stones.scrystal[2], stones.scrystal[3], stones.scrystal[4]}, items = {ores[1],ores[2], ores[3], ores[4], ores[5], ores[6], ores[7], ores[8], ores[9],ores[10], ores[11], ores[12], ores[13], ores[14], ores[15], ores[16]}, iselect = 3, bstart = 1, gstart = 5, lbstart = 9, rstart = 13, chance = 10, qtdmax = 1, expgainmin = 1, expgainmax = 1 }, { level = {90,100}, stone = {stones.crystal[1], stones.crystal[2], stones.crystal[3], stones.crystal[4], stones.lcrystal[1], stones.lcrystal[2], stones.lcrystal[3], stones.lcrystal[4], stones.pcrystal[1], stones.pcrystal[2], stones.pcrystal[3], stones.pcrystal[4], stones.scrystal[1], stones.scrystal[2], stones.scrystal[3], stones.scrystal[4]}, items = {ores[1],ores[2], ores[3], ores[4], ores[5], ores[6], ores[7], ores[8], ores[9],ores[10], ores[11], ores[12], ores[13], ores[14], ores[15], ores[16]}, iselect = 3, bstart = 1, gstart = 5, lbstart = 9, rstart = 13, chance = 10, qtdmax = 1, expgainmin = 1, expgainmax = 1 } } function onUse(cid, item, fromPosition, itemEx, toPosition) local getMiningLevel = getPlayerStorageValue(cid, config.storagemining) local getMiningExp = getPlayerStorageValue(cid, config.experiencemining) if getMiningLevel == -1 then setPlayerStorageValue(cid, config.storagemining, 0) end if getMiningExp < 0 then setPlayerStorageValue(cid, config.experiencemining, 0) end if (isInArray(stones.crystal, itemEx.itemid) or isInArray(stones.lcrystal, itemEx.itemid) or isInArray(stones.pcrystal, itemEx.itemid) or isInArray(stones.scrystal, itemEx.itemid)) then for a = 1, #levels do min = levels[a].level[1]; max = levels[a].level[2] if (getMiningLevel >= min and getMiningLevel <= max) then if isInArray(levels[a].stone, itemEx.itemid) then if (math.random(1, 100) <= levels[a].chance) then quantity = math.random(1, levels[a].qtdmax) experience = math.random(levels[a].expgainmin, levels[a].expgainmax) if isInArray(stone.blue, itemEx.itemid) then iselection = math.random(levels[a].bstart, levels[a].bstart + levels[a].iselect) collect = levels[a].items[iselection] end if isInArray(stone.green, itemEx.itemid) then iselection = math.random(levels[a].gstart, levels[a].gstart + levels[a].iselect) collect = levels[a].items[iselection] end if isInArray(stone.lightblue, itemEx.itemid) then iselection = math.random(levels[a].lbstart, levels[a].lbstart + levels[a].iselect) collect = levels[a].items[iselection] end if isInArray(stone.red, itemEx.itemid) then iselection = math.random(levels[a].rstart, levels[a].rstart + levels[a].iselect) collect = levels[a].items[iselection] end if getMiningLevel == 100 then doSendMagicEffect(toPosition, 9) doPlayerSendTextMessage(cid, 22, text) doPlayerAddItem(cid, collect, quantity) elseif getMiningLevel <= 99 then if getMiningExp >= config.expperlevel then doSendMagicEffect(getCreaturePosition(cid), 49) setPlayerStorageValue(cid, config.storagemining, getMiningLevel + 1) setPlayerStorageValue(cid, config.experiencemining, getMiningExp - config.expperlevel) text = "You collected " ..quantity.. " matter" ..(quantity > 1 and "s" or "").. ". \n You have gained " ..experience.. " experience points in Mining. \n You advanced from mining skill level " ..getMiningLevel.. " to mining skill level " ..(getMiningLevel + 1).. "." else setPlayerStorageValue(cid, config.experiencemining, getMiningExp + experience) text = "You collected " ..quantity.. " matter" ..(quantity > 1 and "s" or "").. ". \n You have gained " ..experience.. " experience points in Mining. \n" ..(config.expperlevel - getMiningExp - experience).. " experience points left to next level. \nCurrent Mining Skill: " ..getMiningLevel.. "." end doSendMagicEffect(toPosition, 9) doPlayerSendTextMessage(cid, 22, text) doPlayerAddItem(cid, collect, quantity) end else doSendMagicEffect(toPosition, 3) doSendAnimatedText(getCreaturePosition(cid), "Working!", COLOR_WHITE) end else doPlayerSendTextMessage(cid, 22, "You need to get better in Mining to mining this.") end end end else doSendMagicEffect(getCreaturePosition(cid), 2) doPlayerSendTextMessage(cid, 22, "You can't mining this.") end end Em data/actions/actions.xml use: <!-- MINING --> <action itemid="2553" event="script" value="elementalmining.lua"/> Se tiver dúvidas a respeito de como configurar pergunte no tópico. As partes editáveis são: Local config, local Stone, local Ore, local Levels. Note que local Levels indica que algumas pedras só podeerão ser mineiradas ao ter mining level superior. Configurações das pedras: Em data/items/items.xml troque os nomes de cada pedra (os nomes ficam a seu critério ;p) <item id="2149" article="a" name="light earth substance" plural="light earth substance"> <attribute key="weight" value="1000" /> </item> <item id="2146" article="a" name="light ice substance" plural="light ice substance"> <attribute key="weight" value="1000" /> </item> <item id="2147" article="a" name="light fire substance" plural="light fire substance"> <attribute key="weight" value="1000" /> </item> <item id="2150" article="a" name="light energy substance" plural="light energy substance"> <attribute key="weight" value="1000" /> </item> <item id="7761" article="a" name="pure earth substance" plural="pure earth substance"> <attribute key="weight" value="1000" /> </item> <item id="7759" article="a" name="pure ice substance" plural="pure ice substance"> <attribute key="weight" value="1000" /> </item> <item id="7760" article="a" name="pure fire substance" plural="pure fire substance"> <attribute key="weight" value="1000" /> </item> <item id="7762" article="a" name="pure energy substance" plural="pure energy substance"> <attribute key="weight" value="1000" /> </item> <item id="12396" article="a" name="rare earth matter" plural="rare earth substance"> <attribute key="weight" value="1000" /> </item> <item id="6551" article="a" name="rare ice substance" plural="rare ice substance"> <attribute key="weight" value="1000" /> </item> <item id="6550" article="a" name="rare fire substance" plural="rare fire substance"> <attribute key="weight" value="1000" /> </item> <item id="12575" article="a" name="rare energy substance" plural="rare energy substance"> <attribute key="weight" value="1000" /> </item> <item id="8298" name="massive earth substance" plural="massive earth substance"> <attribute key="weight" value="1000" /> </item> item id="8302" name="massive ice substance" plural="massive ice substance"> <attribute key="weight" value="1000" /> </item> <item id="8303" name="massive energy substance" plural="massive energy substance"> <attribute key="weight" value="1000" /> </item> <item id="8299" name="massive fire substance" plural="massive fire substance"> <attribute key="weight" value="1000" /> </item> TRANSFORMAR PEDRAS EM MOEDAS Em data/actions/scripts/tools crie um arquivo .lua e nomeie como changecoin: local COINS = { LIGHT = { EARTH_SUBSTANCE = 2149, ICE_SUBSTANCE = 2146, ENERGY_SUBSTANCE = 2150, FIRE_SUBSTANCE = 2147 }, PURE = { EARTH_SUBSTANCE = 7761, ICE_SUBSTANCE = 7759, ENERGY_SUBSTANCE = 7762, FIRE_SUBSTANCE = 7760 }, RARE = { EARTH_SUBSTANCE = 12396, ICE_SUBSTANCE = 6551, ENERGY_SUBSTANCE = 12575, FIRE_SUBSTANCE = 6550 }, MASSIVE = { EARTH_SUBSTANCE = 8298, ICE_SUBSTANCE = 8302, ENERGY_SUBSTANCE = 8303, FIRE_SUBSTANCE = 8299 } } local TRANSFORM = { [COINS.LIGHT.EARTH_SUBSTANCE] = { TO = COINS.PURE.EARTH_SUBSTANCE }, [COINS.LIGHT.ICE_SUBSTANCE] = { TO = COINS.PURE.ICE_SUBSTANCE }, [COINS.LIGHT.ENERGY_SUBSTANCE] = { TO = COINS.PURE.ENERGY_SUBSTANCE }, [COINS.LIGHT.FIRE_SUBSTANCE] = { TO = COINS.PURE.FIRE_SUBSTANCE }, [COINS.PURE.EARTH_SUBSTANCE] = { FROM = COINS.LIGHT.EARTH_SUBSTANCE, TO = COINS.RARE.EARTH_SUBSTANCE }, [COINS.PURE.ICE_SUBSTANCE] = { FROM = COINS.LIGHT.ICE_SUBSTANCE, TO = COINS.RARE.ICE_SUBSTANCE }, [COINS.PURE.ENERGY_SUBSTANCE] = { FROM = COINS.LIGHT.ENERGY_SUBSTANCE, TO = COINS.RARE.ENERGY_SUBSTANCE }, [COINS.PURE.FIRE_SUBSTANCE] = { FROM = COINS.LIGHT.FIRE_SUBSTANCE, TO = COINS.RARE.FIRE_SUBSTANCE }, [COINS.RARE.EARTH_SUBSTANCE] = { FROM = COINS.PURE.EARTH_SUBSTANCE, TO = COINS.MASSIVE.EARTH_SUBSTANCE }, [COINS.RARE.ICE_SUBSTANCE] = { FROM = COINS.PURE.ICE_SUBSTANCE, TO = COINS.MASSIVE.ICE_SUBSTANCE }, [COINS.RARE.ENERGY_SUBSTANCE] = { FROM = COINS.PURE.ENERGY_SUBSTANCE, TO = COINS.MASSIVE.ENERGY_SUBSTANCE }, [COINS.RARE.FIRE_SUBSTANCE] = { FROM = COINS.PURE.FIRE_SUBSTANCE, TO = COINS.MASSIVE.FIRE_SUBSTANCE }, [COINS.MASSIVE.EARTH_SUBSTANCE] = { FROM = COINS.RARE.EARTH_SUBSTANCE }, [COINS.MASSIVE.ICE_SUBSTANCE] = { FROM = COINS.RARE.ICE_SUBSTANCE }, [COINS.MASSIVE.ENERGY_SUBSTANCE] = { FROM = COINS.RARE.ENERGY_SUBSTANCE }, [COINS.MASSIVE.FIRE_SUBSTANCE] = { FROM = COINS.RARE.FIRE_SUBSTANCE } } function onUse(cid, item, fromPosition, itemEx, toPosition) if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then return false end local COIN = TRANSFORM[item.itemid] if(not COIN) then return false end if(COIN.TO ~= nil and item.type == ITEMCOUNT_MAX) then doChangeTypeItem(item.uid, item.type - item.type) doPlayerAddItem(cid, COIN.TO, 1) elseif(COIN.FROM ~= nil) then doChangeTypeItem(item.uid, item.type - 1) doPlayerAddItem(cid, COIN.FROM, ITEMCOUNT_MAX) end return true end Em data/actions/actions.xml acrescente: <action itemid="2149" event="script" value="tools/changecoin.lua"/> <action itemid="2146" event="script" value="tools/changecoin.lua"/> <action itemid="2150" event="script" value="tools/changecoin.lua"/> <action itemid="2147" event="script" value="tools/changecoin.lua"/> <action itemid="7761" event="script" value="tools/changecoin.lua"/> <action itemid="7759" event="script" value="tools/changecoin.lua"/> <action itemid="7762" event="script" value="tools/changecoin.lua"/> <action itemid="7760" event="script" value="tools/changecoin.lua"/> <action itemid="12396" event="script" value="tools/changecoin.lua"/> <action itemid="6551" event="script" value="tools/changecoin.lua"/> <action itemid="12575" event="script" value="tools/changecoin.lua"/> <action itemid="6550" event="script" value="tools/changecoin.lua"/> <action itemid="8298" event="script" value="tools/changecoin.lua"/> <action itemid="8302" event="script" value="tools/changecoin.lua"/> <action itemid="8303" event="script" value="tools/changecoin.lua"/> <action itemid="8299" event="script" value="tools/changecoin.lua"/> Script adicional: Bau/Chest - Comprar mesmo item com duas moedas diferentes Isso é tudo, façam bom uso!
-
Eu procuro um tipo de cassino ao mesmo da imagem ou semelhante para tibia 8.6
-
Sistema de Mineração
Achei esse sistema bem interessante e ao mesmo tempo é um script bem simples, tenho certeza que muitos irão gostar... Imagem: Abra o bloco de notas, cole o script abaixo e salve o arquivo como minerar.lua e coloque-o na pasta scripts (data/actions/scripts). --Lumberjack by: Lwkass --Version: 1.1.5 --Configs-- local configs = { sign = {{level = {0,9}, quant = {1,2}, percent = 40}, {level = {10,19}, quant = {2,4}, percent = 45}, {level = {20,29}, quant = {3,6}, percent = 50}, {level = {30,39}, quant = {4,8}, percent = 55}, {level = {40,49}, quant = {5,10}, percent = 60}, {level = {50,59}, quant = {6,12}, percent = 65}, {level = {60,69}, quant = {7,14}, percent = 70}, {level = {70,79}, quant = {8,16}, percent = 75}, {level = {80,89}, quant = {9,18}, percent = 80}, {level = {90,99}, quant = {10,20}, percent = 85}, {level = {100}, quant = {11,22}, percent = 90}}, stones = {1285, 1356}, gold = {{2157, 'all'}}, stone_delay = 15, MaxLevel = 100 } --END Configs-- function onUse(cid, item, fromPosition, itemEx, toPosition) local STORAGE_SKILL_LEVEL = 20000 local STORAGE_SKILL_TRY = 20001 local skillLevel = getPlayerStorageValue(cid,STORAGE_SKILL_LEVEL) local skillTry = getPlayerStorageValue(cid,STORAGE_SKILL_TRY) local objeto2 = getThingFromPos(toPosition) local player = getCreaturePosition(cid) if skillLevel == -1 then setPlayerStorageValue(cid,STORAGE_SKILL_LEVEL,1) end for Q = 1, #configs.sign do if configs.sign[Q].level[2] == nil then configs.sign[Q].level[2] = configs.sign[Q].level[1] end if skillLevel >= configs.sign[Q].level[1] and skillLevel <= configs.sign[Q].level[2] then quant = math.random(configs.sign[Q].quant[1],configs.sign[Q].quant[2]) percent = configs.sign[Q].percent break end end for i = 1, #configs.stones do if objeto2.itemid == configs.stones[i] then if math.random(1,100) <= percent then possible_gold = {{},{}} for h = 1, #configs.gold do if configs.gold[h][2] == objeto2.itemid then possible_gold[1][#possible_gold[1]+1] = configs.gold[h][1] else if configs.gold[h][2] == 'all' then possible_gold[2][#possible_gold[2]+1] = configs.gold[h][1] end end end if possible_gold[1][1] == nil and possible_gold[2][1] == nil then doPlayerSendTextMessage(cid,22,"This stone can not be mined.") elseif possible_gold[1][1] ~= nil then doPlayerAddItem(cid,possible_gold[1][math.random(1,#possible_gold[1])],quant) elseif possible_gold[1][1] == nil and possible_gold[2][1] ~= nil then doPlayerAddItem(cid,possible_gold[2][math.random(1,#possible_gold[2])],quant) end if possible_gold[1][1] ~= nil or possible_gold[2][1] ~= nil then if skillTry >= 0 then setPlayerStorageValue(cid,STORAGE_SKILL_TRY,skillTry + 1) else setPlayerStorageValue(cid,STORAGE_SKILL_TRY,1) end doSendMagicEffect(getCreaturePosition(cid), 12) doPlayerSendTextMessage(cid,22,"You got "..quant.." gold "..getItemNameById(objeto2.itemid)..".") doSendAnimatedText(getCreaturePosition(cid), ''..quant..'', 192, cid) setItemName(objeto2.uid, 'A remains of '..getItemNameById(objeto2.itemid)) doSendMagicEffect(toPosition, 3) addEvent(dostoneReturn,configs.stone_delay * 1000,toPosition,objeto2.itemid) doTransformItem(objeto2.uid, 3610) break end else doPlayerSendCancel(cid,"You got nothing") doSendMagicEffect(toPosition, 3) setItemName(objeto2.uid, 'A remains of '..getItemNameById(objeto2.itemid)) doSendAnimatedText(getCreaturePosition(cid), 'Fail!', 180, cid) addEvent(dostoneReturn,configs.stone_delay * 1000,toPosition,objeto2.itemid) doTransformItem(objeto2.uid, 3610) break end else doPlayerSendCancel(cid,"You can only mine stones") end end if skillTry >= ((skillLevel+1)*3) then if skillLevel == configs.MaxLevel then doPlayerSendTextMessage(cid, 22, "Max level reached in mining.") setPlayerStorageValue(cid,STORAGE_SKILL_TRY,0) else setPlayerStorageValue(cid,STORAGE_SKILL_LEVEL,skillLevel + 1) setPlayerStorageValue(cid,STORAGE_SKILL_TRY,0) doPlayerSendTextMessage(cid, 22, "You advanced from level ".. skillLevel .." to level ".. skillLevel + 1 .." in Mining.") doSendMagicEffect(getCreaturePosition(cid),14) doSendAnimatedText(getCreaturePosition(cid), 'Advance!', 18, cid) end end end function dostoneReturn(itemposition,oldid) local pos = getThingfromPos(itemposition) doTransformItem(pos.uid,oldid) setItemName(pos.uid, getItemNameById(oldid)) doSendMagicEffect(itemposition,math.random(28,30)) end --Lumberjack by: Lwkass Feito isso, vá em data/actions/actions.xml e adicione esta tag: <action itemid="2553" event="script" value="minerar.lua"/> Lembrando que o itemid 2553 no caso é a pick, mas você pode utilizar qualquer outro item que tenha 'use with'. Você gostou deste conteúdo!? Este conteúdo te ajudou!? Isso será realmente útil pra você!? Então, se possível, faça uma doação (de qualquer valor) que estará me ajudando também!
-
Fishing Monsters
To adicionando uns scripts no me servidor, sistemas e to achando super dahora e vejo que não tem por aqui, vim disponibilizar pra vocês. actions.xml <action itemid="2580" script="monsterFishing.lua" allowfaruse="1"/> scripts/monsterFishing.lua local waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 7236, 10499, 15401, 15402} local lootTrash = {2234, 2238, 2376, 2509, 2667} local lootCommon = {2152, 2167, 2168, 2669, 7588, 7589} local lootRare = {2143, 2146, 2149, 7158, 7159} local lootVeryRare = {7632, 7633, 10220} local useWorms = true -- Config for monster fishing local config = { enabled = true, -- ativar ou desativar a pesca monstro debug = false, -- ativar mensagens de depuração no console verifyMonsters = false, -- desabilite isso se você estiver tendo problemas com o Monster fishing :: Warning - Invalid monster name chance = 50, -- chance de pegar um monstro em% - 50 significa que você tem 50/50 de chance de pegar um monstro ou um peixe bossLevel = 300, -- nível mínimo para pegar um "boss" bossSkill = 90, -- min habilidade de pesca para pegar um "boss" monsters = { -- [minLevel] = {"monster", "names", "for", "level"} [100] = {"Quara Hydromancer", "Quara Constrictor", "Quara Mantassin", "Idontexist"}, [150] = {"Quara Pincher", "Quara Predator"}, [200] = {"Serpent Spawn", "Wyrm"}, [300] = {"Sea Serpent"}, }, bosses = { -- Monsters that can only be caught with atleast "bossLevel" and "bossSkill" "Titan Goddess of Water", } } -- Validate monsters configuration if config.verifyMonsters then local m = {} for minLevel, monsters in pairs(config.monsters) do m[minLevel] = {} if config.debug then print("#monsters", #monsters) end for i = 1, #monsters do if MonsterType(monsters[i]) then table.insert(m[minLevel], monsters[i]) else print("Monster fishing::Warning - Invalid monster name:", monsters[i]) end end if config.debug then print("Monster fishing::Debug - #monsters added", #m[minLevel]) end end config.monsters = m end function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey) local targetId = itemEx.itemid if not isInArray(waterIds, itemEx.itemid) then return false end if targetId == 10499 then local targetItem = Item(itemEx.uid) local owner = targetItem:getAttribute(ITEM_ATTRIBUTE_CORPSEOWNER) if owner ~= 0 and owner ~= player:getId() then player:sendTextMessage(MESSAGE_STATUS_SMALL, "You are not the owner.") return true end toPosition:sendMagicEffect(CONST_ME_WATERSPLASH) targetItem:remove() local rareChance = math.random(1, 100) if rareChance == 1 then player:addItem(lootVeryRare[math.random(#lootVeryRare)], 1) elseif rareChance <= 3 then player:addItem(lootRare[math.random(#lootRare)], 1) elseif rareChance <= 10 then player:addItem(lootCommon[math.random(#lootCommon)], 1) else player:addItem(lootTrash[math.random(#lootTrash)], 1) end return true end if targetId ~= 7236 then toPosition:sendMagicEffect(CONST_ME_LOSEENERGY) end if targetId == 493 or targetId == 15402 then return true end player:addSkillTries(SKILL_FISHING, 1) if math.random(1, 100) <= math.min(math.max(10 + (player:getEffectiveSkillLevel(SKILL_FISHING) - 10) * 0.597, 10), 50) then if useWorms and not player:removeItem("worm", 1) then return true end if targetId == 15401 then local targetItem = Item(itemEx.uid) targetItem:transform(targetId + 1) targetItem:decay() if math.random(1, 100) >= 97 then player:addItem(15405, 1) return true end elseif targetId == 7236 then local targetItem = Item(itemEx.uid) targetItem:transform(targetId + 1) targetItem:decay() local rareChance = math.random(1, 100) if rareChance == 1 then player:addItem(7158, 1) return true elseif rareChance <= 4 then player:addItem(2669, 1) return true elseif rareChance <= 10 then player:addItem(7159, 1) return true end end if config.enabled and math.random(100) <= config.chance then local level = player:getLevel() local skill = player:getSkillLevel(SKILL_FISHING) local tmpMonsters = {} for minLevel, monsters in pairs(config.monsters) do if config.debug then print("Monster fishing::Debug - Level check:", level, ">=", minLevel) end if level >= minLevel then if config.debug then print("Monster fishing::Debug - Level check passed - #monsters:", #monsters) end for i = 1, #monsters do if config.debug then print("Monster fishing::Debug - Found monster:", monsters[i]) end table.insert(tmpMonsters, monsters[i]) end end end if level >= config.bossLevel and skill >= config.bossSkill then for i = 1, #config.bosses do table.insert(tmpMonsters, config.bosses[i]) end end if config.debug then print("Monster fishing::Debug - #tmpMonsters: "..#tmpMonsters) end if #tmpMonsters > 0 then local pos = player:getPosition() Game.createMonster(tmpMonsters[math.random(1, #tmpMonsters)], pos) return true end end player:addItem("fish", 1) end return true end Caso na hora de pescar venha esse item ao invés do fish, é por causa dos items.xml, dai é só você mudar player:addItem("2667", 1) e adicionar o ID do fish.
-
Quest Skeleton[by Cerberus]
Tópico que tirei as fotos: Clique aqui Vim colaborar com o Tk, estava meio sumido... está sempre usando o Tk para tirar minha duvida e achei a resposta para ela em 1 topico que antigo e incompleto pois não terminou Script... Resolvi fazer o script e da suport para quem quiser a Quest. Segue abaixo as fotos , são do topico antigo que peguei use ela como base e fiz o script... Vamos começar com a Tag <action itemid="6524" event="script" value="Quest_skeleton.lua"/> Crie o arquivo Quest_skeleton.lua na pasta Actions e ponha a Tag no action.XML , e action na caveira 20021 Skeleton na lava parte 2 , lembrando de por o actionId = 20020 na lava LavaId = 598 que vai por o skeleton. TAg <action itemid="2843" event="script" value="skeleton_lava.lua"/>
-
(Resolvido)Alavanca que teleporta Time para quest
Muito boa tarde a todos, há um tempo atrás dei uma pausa com um projeto meu e resolvi voltar agora que estou com um tempinho livre. Gostaria de pedir uma ajuda dos especialistas, pois sou bem leigo quando o assunto é scripts. Estou há um bom tempo procurando nas comunidades um script de teleport por alavanca, onde 4 jogadores em posições determinadas acionam uma alavanca e são transportados para uma posição determinada. Mas para isso, os quatro jogadores devem ser exatamente level 100, qualquer level abaixo ou acima disso não é permitida a entrada e todos os 4 devem possuir x item para poder ir para a quest. Ao serem teleportados o item é removido. Se possível, o script possuir as seguintes funções: caso já tenha um grupo na quest, outros não poderão entrar somente quando o grupo atual finalizar. E Para evitar jogadores "Espertinhos" que tentem bloquear a quest de alguma forma, um limite de tempo para terminar a quest e ao termino o time todo é teleportado de volta para a saida (posição determinada por mim). Sei que pode ser muita coisa, mas peço que me ajudem pois, por mais simples que seja o script, já procurei muito e não encontro nenhum que funcione na minha versão do servidor. Todos os que eu achei foram pra versões anteriores do TFS e não consegui por pra rodar no meu. Versão do meu servidor: 11.00 TFS: 1.3
-
Item ao usar, se transforma em outro
Bom dia/tarde / noite pessoa, gostaria de pedir um scritp muito simples, mas como não entendo disso, não é tão simples pra mim shaushau é o seguinte, um script que quando eu do use no item, ele se transforma em outro e quando eu use ele denovo, ele volta a ser o anterior Obs: quando eu fiz a script, ele transformava, só que o item aparecia na bag e nao no lugar (ring) teria como deixar o item no lugar quando transformava ? OOObrigado Eu descobri como fazer, tenho certeza que tem um jeito mais facil, mas o que eu fiz foi assim: Criei 2 arquivos pros 2 item (um se transformando em outro) e coloquei la dentro do primeiro: function onUse(cid, item) doTransformItem(item.uid,12665) end Nas actions.xml eu botei o id 12666 e do item que vai se transforma eu botei: function onUse(cid, item) doTransformItem(item.uid,12666) end Nas actions eu coloquei 12665 Bom, pelo menos aqui deu certo
-
Encontrar itens e códigos escondidos no Mapa
Existe a possibilidade de você baixar um mapa com algumas "manhas", e alguns players sabendo disso podem se beneficiar em seu servidor. Por exemplo, uma bag com crystal coins, uma action numa parede que te teleporte até a sala de recompensas da POI, etc. Abaixo mostrarei como encontrar itens e códigos escondidos no mapa: No menu superior, Edit - Find Item (CTRL + F). No quadro de pesquisa CTRL + F (Search for item), selecione o item clique em OK, você será teleportado até a posição em que o item está e poderá removê-lo. Se ele estiver atrás de uma árvore por exemplo, você pode usar a tecla de atalho G (ghost loose items), que deixa as sprites transparentes. No menu superior, Edit - Find Unique / Action. Também é possível cadastrar action/unique ids e criar quests escondidas no mapa. Essa opção te mostra todos os uniqueids e actionids que existem. Clique nas opções da lista para ir até a posição. No menu superior, Edit - Find Containers Esta opção mostra os containers que existem no mapa. Chests e bookcases, bags e backpacks, corpses e coffins, boxes, barrels e tudo que da pra clicar, abrir e pegar um item dentro. Clique nas opções da lista para ser teleportado até o item. ______________________________________________________
-
Pokeflutes
Pokekflute (Deixa Seu Pokemon Feliz) Blizardflute (Tira o Status De Gelo) Hungreflute (Deixa Seu Pokemon Sem Fome, Mas Porem Com Raiva) Dragonflute (Deixa o Status De Burn Dos Pokemon Em Zero.) Pokekflute (Deixa Seu Pokemon Feliz) Blizardflute (Tira o Status De Gelo) Hungreflute (Deixa Seu Pokemon Sem Fome, Mas Porem Com Raiva) Dragonflute (Deixa o Status De Burn Dos Pokemon Em Zero.) Tag: <action itemid="id da sua flauta" script="nome do arquivo.lua" />
-
Scroll Multiplicar XP/min
Só avisando não foi eu quem fiz! Mas achei interessante passar para todos, pois é difícil encontrar um script desses que é da época do Epa. Testado em: Servidor Styller Yourots Premium versão 1.1.2 Nome: Scroll que multiplica exp por um determinado tempo. Instalação: Action Vamos ao script. Na pasta scripts, em actions, crie um arquivo lua com esse script. XXXXX.lua (Escolha um nome para seu script). Ex: Scrollexp.lua function onUse(cid, item, frompos, item2, topos) local pausa = 30*60*1000 -- "1000 = 1 segundo" Tempo que durará a exp multiplicada! "a adicionada dura 15min" local texto = "Voce Recebeu, 3x de exp por, 15min" -- Texto que aparece ao utilizar o Scroll. Pode mudar como quizer, Ex: "Utilizando o Scroll, agora você receberá 5x a mais de exp...." textofinal = "Seu tempo acabou." -- Texto que finaliza o scroll, avisando que o tempo terminou. Igual ao de cima! local exp = 3 -- Por quanto X será multiplicada a experiencia do jogador quando der use no item. Exp de 20x - usando multiplicará para 60x por 15min. expfinal = 1 -- A exp que retornará ao player, que utilizar, caso coloque 2 ou mais o personagem ganhará Eterno xp multiplicada. Isso serve para exp voltar ao normal. if item.itemid == XXXX then -- Id do Item que servirá como Sua Scroll. Mude o XXXX por o ID de sua escolha. doRemoveItem(item.uid,1) doPlayerSetExperienceRate(cid,exp) doSendMagicEffect(frompos,13) doPlayerSendTextMessage(cid,22,texto) addEvent(potion,pausa,cid) end end function potion(pos, cid) doPlayerSetExperienceRate(pos,expfinal) doPlayerSendTextMessage(pos,22,textofinal) end Em actions.xml (faça isso junto com o nome que você criou seu script.) <action itemid="XXXX" event="script" value="XXXX.lua" /> Escreva em XXXX.lua o nome que você criou para sua script. E em ItemID="Coloque ID escolhido na citação anterior." Há o outro script feito por @vankk, podem estar utilizando-o pois já é mais atualizado que este de cima! local config = { rate = 3.0, -- Rate que vai ficar o Scroll. time = 24, -- Tempo dado pelo Scroll. storage = 20011 } local function endExpRate(cid) if not isPlayer(cid) then return end doPlayerSetRate(cid, SKILL__LEVEL, 6.0) setPlayerStorageValue(cid, config.storage, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your extra experience time has ended.") end function onUse(cid, item, fromPosition, itemEx, toPosition) local timeLeft = getPlayerStorageValue(cid, 20011) if timeLeft > os.time() then local timeTable = os.date('*t', timeLeft - (os.time() + 3600)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("You still have %d %s %d %s %d %s left of extra experience.", timeTable.hour, timeTable.hour > 1 and "hours" or "hour", timeTable.min, timeTable.min > 1 and "minutes" or "minute", timeTable.sec, timeTable.sec > 1 and "seconds" or "second")) return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, string.format("Your extra experience rate is now: %d. It will last for %d hours.", config.rate, config.time)) doPlayerSetRate(cid, SKILL__LEVEL, config.rate) setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600 * 1000) addEvent(endExpRate, config.time * 3600 * 1000, cid) doRemoveItem(item.uid, 1) return true end Pelo que entendi do Script, corrijam se eu estiver Errado, você deverá adicionar a action ID na tag e adicionar isto no item! Relembrando esse script, não é meu era um script que tinha guardado a anos, e não o vi na internet e gostaria de mostrar para vocês. Não fui o criador dele, mesmo que seja tão simples. Créditos ao verdadeiro dono seja ele quem for!
-
Scroll de Level
Esse script funciona da seguinte maneira, é um scroll, que ao usa-lo você recebe avança um lvl, você pode coloca-lo como recompensa de uma quest ou sei lá, basta usar a imaginação. Scroll de experiência Vá até data > actions > actions.xml e adicione a tag: <action itemid="6119" event="script" value="Exp_Scroll.lua"/> crie um arquivo "Exp_Scroll.lua" e coloque na pasta data > actions > scripts -- Scripted By Perfection -- local itemID = 6119 local lvl = 1 function onUse(cid, item, frompos, item2, topos) if item.itemid == itemID then doPlayerAddLevel(cid, lvl) doPlayerSendTextMessage(cid,22,"You Recieved 1 Level !") doRemoveItem(cid, item.uid, 1) end return 1 end Crétidos: perfection.
-
Alavanca que troca itens
Olá pessoal da comunidade de Tibia! Bom, hoje trouxe um pequeno e simples script, mas que pode ajudar muita gente. Vi alguns posts referindo aos NPCs que trocam determinados itens por outros, então tive a ideia de fazer algo que possa ter uma função semelhante e que funcione de uma maneira rápida. Fique à vontade em utilizá-la da maneira que quiser. Como funciona? O usuário vai usar a alavanca e irá adicionar um item em troca de outra item que você configurou no script. Em outras palavras, o usuário irá ganhar uma determinada quantidade de um item em troca de outra quantidade de um item diferente. (Tudo configurável) VERSÃO TESTADA: 8.60 - OTX --> Começando... Crie um arquivo com nome de changeItem.lua no diretório data/actions/scripts/ Logo após, adicione esse código dentro do arquivo criado: -- Script por Lordzetros para o forum Tibia King. local config = { itemNec = 2160, -- ID do item que necessita para efetuar a troca qtNec = 50, -- Quantidade do item que necessita para efetuar a troca itemNovo = 10137, -- ID do item que sera adicionado ao efetuar a troca qtNova = 1, -- Quantidade do item que sera adicionado ao efetuar a troca stor = 25869, -- Storage, ou seja, a numeracao que identificara se o usuario fez ou nao fez a quest ainda } function onUse(cid, item, fromPosition, itemEx, toPosition) pos = getPlayerPosition(cid) if getPlayerStorageValue(cid,config.stor) ~= -1 then doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"So eh permitido fazer a troca de itens apenas uma vez!") doSendMagicEffect(pos, CONST_ME_POFF) elseif getPlayerStorageValue(cid,config.stor) == -1 then if item.itemid == 1945 then if getPlayerItemCount(cid,config.itemNec) >= config.qtNec then doPlayerAddItem(cid, config.itemNovo,config.qtNova) doPlayerRemoveItem(cid,config.itemNec,config.qtNec) doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Voce acabou de trocar "..config.qtNec.." "..getItemNameById(config.itemNec).." por "..config.qtNova.." "..getItemNameById(config.itemNovo)..".") doSendMagicEffect(pos, CONST_ME_HOLYAREA) setPlayerStorageValue(cid, config.stor, 1) else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Voce nao tem "..config.qtNec.." "..getItemNameById(config.itemNec).." para trocar por "..config.qtNova.." "..getItemNameById(config.itemNovo)..".") doSendMagicEffect(pos, CONST_ME_POFF) end end end end Em seguida, abra o arquivo com nome actions.xml que está localizada em data/actions/ E adicione essa linha de código no mesmo: <action actionid="9139" event="script" value="changeItem.lua"/> Preste atenção, pois o actionid será o número que irá colocar na alavanca em seu editor de mapa, ou seja, no caso acima está como 9139, logo, na alavanca terá que está como a seguinte imagem: Obs1.: Reparem que na imagem tem outro número destacado, que é o ID 1945, CERTIFIQUE-SE que a alavanca que irá utilizar no seu OT tenha esse mesmo ID, caso não tenha, basta mudar o número no código do script para o que irá utilizar no seu servidor. Obs2.: O código está configurado para que o usuário efetue a troca APENAS 1 VEZ, caso queira que ele troque quantas vezes quiser, apenas remova o seguinte comando do código: setPlayerStorageValue(cid, config.stor, 1) Obs3.: O resto que tinha que explicar está no próprio código, apenas faça um esforço de ler, agradeço. É isso, pessoal, espero que goste e aproveite. Como falei antes, é um código simples, pois comecei agora com Script, pretendo avançar no nível e funções que os mesmos desempenham, isso é só o começo, leve isso como uma prática de uma atividade para iniciante em scripts.
-
[8.6] Reunindo Fragmentos
Sobre* OBS: ISSO É UM INCREMENTO PARA QUEST/TASK. Acabei desenvolvendo esse sisteminha(se é que da pra chamar de sistema euheu) quando fui ajudar um membro do fórum, o Npc dele setava(dava) ao player a mesma storage com valores diferentes, ai eu pensei um pouco e saiu isso aqui, achei legal e estou trazendo aqui O sistema ocorre da seguinte maneira: Você deve procurar por itens no mapa e dar use neles, ao dar use você recebe um fragmento e depois usa esses fragmentos para outra função a qual você desejar, como liberar a entrada de uma quest por exemplo ou até mesmo trocar por outros itens. Ex: Ao falar com um npc, ele te da a seguinte task. Procure este item pelo mapa ao encontrar recolha o item escondido dentro dele. Escolha o item que quiser, coloque mais de um item próximos assim a dificuldade aumenta (apenas um item terá a actionid, os demais seriam para confundir o jogador). Exemplo da localização dos itens. Lembrando que você pode dificultar um pouco a procura por esses itens colocando eles em cidades diferentes, assim o player demora um tempinho até reunir todos os fragmentos. Instalando* Em data/actions/scripts, crie um arquivo .lua com o nome que desejar e em seguida adicione o script abaixo dentro. Agora em data/actions, abra o arquivo actions.xml e adicione a seguinte tag nele. ( Coloque os ActionID's dos itens espalhados pelo mapa em sequência. Ex: 2001, 2002, 2003, 2004.... Assim fica mais facíl para registrar o script, pois basta colocar: fromaid = 2001, toaid = 2010) Mais e menos itens* Eu criei o script para 10 itens, ou seja, terá 10 itens espalhados pelo mapa. Para aumentar ou diminuir o número de itens, olhe explicações abaixo. Mais itens* Menos itens* Edit: Modifiquei algumas coisas no tópico, também arrumei o script para ficar melhor de compreender, e adicionei a ele o que o @Vodkart falou .
-
Stamina Refuel
Olá pessoal, para quem não sabe esse script funciona da seguinte maneira, você escolhe um X item, ao dar use neste X item, a Stamina do player enche X tempo que você determinar. Crie um arquivo com o nome stamina_refuel.lua em actions/scripts e coloque isso dentro: local stamina_full = 42 -- horas (stamina full) function onUse(player, item, fromPosition, target, toPosition, isHotkey) if player:getStamina() >= (stamina_full * 60) then player:sendCancelMessage("Your stamina is already full.") else player:setStamina(stamina_full * 60) player:sendTextMessage(MESSAGE_INFO_DESCR, "Your stamina has been refilled.") player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) item:remove(1) end return true end E em actions.xml adcione a tag: <action itemid="ITEMID" script="stamina_refuel.lua"/> Para editar é fácil, nesta parte: local stamina_full = 42 -- horas (stamina full) Acima você escolhe o tempo (em horas) que encherá ao usar o stamina refuel. Bem simples né pessoal ?! Espero ter ajudado, abraços!