Ir para conteúdo
Propaganda

luzetti06

Membro
  • Total de Posts

    6
  • Registro em

  • Última visita

Sobre luzetti06

Últimos Visitantes

O bloco dos últimos visitantes está desativado e não está sendo visualizado por outros usuários.

luzetti06's Achievements

Rookie

Rookie (2/14)

  • One Month Later
  • First Post
  • Conversation Starter Rara
  • Week One Done
  • Reacting Well

Emblemas Recentes

7

Reputação

  1. local storage = 121212 --storage da quest function onUse(cid, item, frompos, item2, topos) if #getCreatureSummons(cid) > 0 then doPlayerSendCancel(cid, "Você não pode usar revive com o pokemon para fora.") return true end if getPlayerStorageValue(cid, storage) == 0 then doPlayerSendCancel(cid, "Você já usou o maximo de revive permitido nessa quest.") return true elseif getPlayerStorageValue(cid, 990) >= 1 then doPlayerSendCancel(cid, "Você não pode usar revive em batalhas de ginásio.") return true elseif getPlayerStorageValue(cid, 52481) >= 1 then doPlayerSendCancel(cid, "Você não pode usar revive em batalhas.") --alterado v1.6 return true elseif isPlayer(item2.uid) then doPlayerSendCancel(cid, "Por favor, coloque seu pokemon na pokebola.") return true end for a, b in pairs (pokeballs) do if not item2.itemid == b.on or not item2.itemid == b.off then doPlayerSendCancel(cid, "O revive se usa nas pokebolas, não diretamente no pokemon.") return true end end local pokeball = getPlayerSlotItem(cid, 8) for a, b in pairs (pokeballs) do if item2.itemid == b.on or item2.itemid == b.off then --edited deixei igual ao do PXG doTransformItem(item2.uid, b.on) doSetItemAttribute(item2.uid, "hp", 1) for c = 1, 15 do local str = "move"..c setCD(item2.uid, str, 0) end setCD(item2.uid, "control", 0) setCD(item2.uid, "blink", 0) --alterado v1.6 doSendMagicEffect(getThingPos(cid), 13) doRemoveItem(item.uid, 1) doCureBallStatus(item2.uid, "all") doCureStatus(cid, "all", true) doUpdateHealthPokeInfo(true, cid, getPlayerSlotItem(cid, CONST_SLOT_FEET).uid) cleanBuffs2(item2.uid) --alterado v1.5 if useOTClient then onPokeHealthChange(cid) --alterei aki doOTCSendPokemonHealth(cid) doUpdatePokeInfo(cid) onPokeBarLife(cid) end if getPlayerStorageValue(cid, storage) > 0 then setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage)-1) end return true end end return true end @Angel.php
  2. OPA GALERINHA HOJE TRAGO AQUI UM SISTEMA DE KILL DROP, ELE FUNCIONA ASSIM: VOCE COLOCA NO CODIGO O ITEM QUE VC DESEJA, E O EFEITO. local itens = { -- Cada item tem um id, um efeito e uma mensagem {id = 12162, efeito = 173, mensagem = "DROP ESPECIAL."}, {id = 12161, efeito = 173, mensagem = "Você usou uma pedra vermelha."}, {id = 1002, efeito = 173, mensagem = "Você usou uma pedra verde."}, {id = 1003, efeito = 173, mensagem = "Você usou uma pedra amarela."} } local function isDrop(itemid) for i, item in ipairs(itens) do if item.id == itemid then return true end end return false end local function getEffectAndMessage(itemid) for i, item in ipairs(itens) do if item.id == itemid then return item.efeito, item.mensagem end end return nil end local function sendTimedAnimatedText(cid, pos, text, color, duration) if not isCreature(cid) then return true end local ticks = duration / 1000 local interval = 1 local totalTicks = ticks / interval local currentTick = 0 local function sendText() if currentTick >= totalTicks then return end currentTick = currentTick + 1 doSendAnimatedText(pos, text, color) addEvent(sendText, interval * 1000) end sendText() end local function sendTimedMagicEffect(pos, effect, duration) if not pos or not effect then return end doSendMagicEffect(pos, effect) addEvent(doSendMagicEffect, duration, pos, CONST_ME_NONE) end local function useItem(cid, position, corpseid) if not isCreature(cid) then return true end local corpse = getTileItemById(position, corpseid).uid if corpse <= 1 or not isContainer(corpse) then return true end local player = getCreatureMaster(cid) if not isPlayer(player) then return true end local itemsToAdd = {} local itemsToRemove = {} for slot = 0, (getContainerSize(corpse) - 1) do local item = getContainerItem(corpse, slot) if item.uid > 1 then if isDrop(item.itemid) then local effect, message = getEffectAndMessage(item.itemid) table.insert(itemsToAdd, {itemid = item.itemid, count = item.type}) sendTimedMagicEffect(position, effect, 10000) sendTimedAnimatedText(position, message, math.random(150, 190), 10000) table.insert(itemsToRemove, item.uid) end end end for _, uid in ipairs(itemsToRemove) do doRemoveItem(uid) end for _, itemData in ipairs(itemsToAdd) do doPlayerAddItem(player, itemData.itemid, itemData.count) end end function onKill(cid, target, lastHit) if not ehMonstro(target) then return true end local corpse = getMonsterInfo(getCreatureName(target)).lookCorpse addEvent(useItem, 5, getCreatureSummons(cid)[1], getThingPos(target), corpse) return true end registra isso no login.lua \/ registerCreatureEvent(cid, "killdrop") isso no creaturescript.lua <event type="kill" name="killdrop" event="script" value="killdrop.lua"/> APÓS REGISTRADO E CONFIGURADO O SCRIPT FUNCIONARA DA SEGUINTE FORMA: SEMPRE QUE UM DESSES ITENS CAIR DO CORPO DO POKEMON ELES IRAO AUTOMATICO PARA A BAG DO PLAYER CASO QUEIRAM TESTAR FIQUEM A VONTADE, JA FIZ TESTE PELO /M E O LOOT VAI PRA QUEM INVOCO NO CASO EU, E FIZ NA PESCA COM PLAYER O OUTRO PLAYER MATO MAIS NAO OBTEVE O LOOT, E SIM EU, POIS FOI EU QUE O SCRIPT MARCO COMO ALVO.
  3. local a = { [11638] = { pokemons = {"Aron", "Bagon", "Slowpoke", "Magnemite", "Doduo", "Seel", "Grimer", "Drowzee", "Voltorb", "Cubone", "Koffing", "Cyndaquil", "Pidgeotto", "Weepinbell", "Wooper", "Dratini", "Dunsparce", "Pichu", "Slugma", "Remoraid", "Ledyba", "Goldeen", "Vulpix", "Tentacool", "Bulbasaur", "Charmander", "Squirtle", "Metapod", "Kakuna", "Teddiursa", "Chikorita", "Chinchou", "Cleffa", "Marill", "Natu", "Smoochum", "Phanpy", "Slugma", "Ekans", "Abra", "Mankey", "Psyduck", "Sandshrew", "Kabuto", "Beedrill", "Omanyte", "Butterfree", "Snubbul", "Togepi", "Zubat", "Diglett", "Venonat", "Shuckle", "Mareep", "Meowth", "Poliwag", "Growlithe", "Machop", "Ponyta", "Geodude", "Hoothoot", "Pineco", "Sentret", "Swinub", "Totodile" }, items = {2006, 2007, 2008, 2010, 2015, 2016, 2031, 2032} }, [11639] = {pokemons = {"Lairon", "Shelgon", "Skiploom", "Raticate", "Ariados", "Flaffy", "Delibird", "Fearow", "Clefairy", "Arbok", "Nidorino", "Nidorina", "Elekid", "Magby", "Ledian", "Dodrio", "Golbat", "Gloom", "Parasect", "Venomoth", "Dugtrio", "Persian", "Poliwhirl", "Machoke", "Quilava", "Yanma", "Graveler", "Slowbro", "Magneton", "Farfetch'd", "Kingler", "Electrode", "Weezing", "Seadra", "Bayleef", "Croconaw", "Qwilfish", "Tyrogue", "Jigglypuff", "Seaking", "Tauros", "Starmie", "Eevee", "Charmeleon", "Wartortle", "Ivysaur", "Pikachu" }, items = {2006, 2007, 2008, 2010, 2015, 2016, 2031, 2032} }, [11640] = {pokemons = {"Salamence", "Politoed", "Magcargo", "Noctowl", "Poliwrath", "Nidoking", "Pidgeot", "Sandslash", "Ninetales", "Vileplume", "Primeape", "Nidoqueen", "Granbull", "Jumpluff", "Golduck", "Kadabra", "Rapidash", "Azumarill", "Murkrow", "Clefable", "Wigglytuff", "Dewgong", "Onix", "Cloyster", "Hypno", "Exeggutor", "Marowak", "Hitmonchan", "Quagsire", "Stantler", "Xatu", "Hitmonlee", "Bellossom", "Lanturn", "Pupitar", "Smeargle", "Lickitung", "Golem", "Chansey", "Tangela", "Mr. Mime", "Pinsir", "Espeon", "Umbreon", "Vaporeon", "Jolteon", "Flareon", "Porygon", "Dragonair", "Hitmontop", "Octillery", "Sneasel" }, items = {2006, 2007, 2008, 2010, 2015, 2016, 2031, 2032} }, [11641] = {pokemons = {"Absol", "Dragonite", "Snorlax", "Kabutops", "Omastar", "Kingdra", "Ampharos", "Blissey", "Donphan", "Girafarig", "Mantine", "Miltank", "Porygon2", "Skarmory", "Lapras", "Gyarados", "Magmar", "Electabuzz", "Jynx", "Scyther", "Kangaskhan", "Venusaur", "Crobat", "Heracross", "Meganium", "Piloswine", "Scizor", "Machamp", "Arcanine", "Charizard", "Blastoise", "Tentacruel", "Alakazam", "Feraligatr", "Houndoom", "Rhydon", "Misdreavus", "Wobbuffet", "Raichu", "Slowking", "Steelix", "Sudowoodo", "Typhlosion", "Tyranitar", "Ursaring" }, items = {2006, 2007, 2008, 2010, 2015, 2016, 2031, 2032} }, [12331] = {pokemons = {"Shiny Abra"}, items = {2006, 2007, 2008, 2010, 2015, 2016, 2031, 2032} }, [12227] = {pokemons = {"Shiny Weezing", "Shiny Swampert", "Shiny Sceptile", "Shiny Tropius", "Shiny Venusaur", "Shiny Charizard", "Shiny Blastoise", "Shiny Arcanine", "Shiny Alakazam", "Shiny Ninetales", "Shiny Scyther", "Shiny Umbreon", "Shiny Pidgeot", "Shiny Raichu", "Shiny Tentacruel", "Shiny Ampharos", "Shiny Feraligatr", "Shiny Jynx", "Shiny Gyarados", "Shiny Politoed", "Shiny Typhlosion", "Shiny Tauros", "Shiny Venomoth", "Shiny Espeon", "Shiny Magneton", "Shiny Larvitar", "Shiny Golbat", "Shiny Kingler", "Shiny Farfetch'd", "Shiny Pinsir", "Shiny Dratini", "Shiny Electrode", "Shiny Muk", "Shiny Stantler", "Shiny Seadra", "Shiny Mr. Mime"}, items = {14440, 2160, 22003, 11442, 11441, 11447, 12401, 21079, 21998} }, [15488] = {pokemons = {"Mega Absol", "Mega Steelix", "Mega Lucario", "Mega Swampert", "Mega Sceptile", "Mega Wobbuffet", "Mega Blaziken", "Mega Raichu", "Mega Blastoise", "Mega Alakazam", "Mega Slowbro", "Mega Aerodactyl", "Mega Scizor", "Mega Tyranitar", "Mega Gengar", "Mega Glalie", "Mega Kangaskhan", "Mega Ampharos", "Mega Venusaur"}, items = {2006, 2007, 2008, 2010, 2015, 2016, 2031, 2032} }, [1990] = {pokemons = {"Ditto"}, items = {2006, 2007, 2008, 2010, 2015, 2016, 2031, 2032} }, [15432] = {pokemons = {"Shedinja", "Shiny Hitmonlee", "Shiny Hitmonchan", "Wailord", "Electivire", "Magmortar", "Banette", "Sableye", "Honchkrow", "Abomasnow", "Swellow", "Shiftry", "Tropius", "Armaldo", "Ludicolo", "Togekiss", "Luxray", "Bronzong", "Lucario", "Tangrowth", "Flygon", "Aggron", "Mawile", "Slaking", "Duskinoir", "Glalie", "Ninjask", "Gardevoir", "Toxicroak", "Rhyperior", "Altaria"}, items = {2006, 2007, 2008, 2010, 2015, 2016, 2031, 2032} } --se for por mais box por uma , ali na parte de cima } local uniqueItems = { [14440] = true, } local lostItems = { [14440] = true, } function onUse(cid, item, frompos, item2, topos) local b = a[item.itemid] if not isPlayer(cid) then return true end if not b then return true end local pokemon = b.pokemons[math.random(#b.pokemons)] if not pokes[pokemon] then return true end local prizeItemId = b.items[math.random(#b.items)] -- Seleciona um item aleatorio da lista de itens local prizeItemName = getItemNameById(prizeItemId) -- obtem o nome do item pelo ID local quantity = 1 -- Por padrao, assume que o item é unico if lostItems[prizeItemId] then -- Se o item está na tabela lostItems, reduza a chance de aparecer if math.random(300) <= 150 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você abriu uma caixa de prêmios Pokémon, mas perdeu o item surpresa: "..prizeItemName..". Mais sorte na próxima vez!") doRemoveItem(item.uid, 1) -- Adiciona o poke independentemente do resultado do item perdido addPokeToPlayer(cid, pokemon, 0, nil, btype) -- Alterado v1.9 return true end else -- Se o item nao esta na tabela lostItems, gera uma quantidade aleatorio de 1 a 5 quantity = math.random(1, 5) end doPlayerSendTextMessage(cid, 27, "Você abriu uma caixa de prêmios Pokémon!") doPlayerSendTextMessage(cid, 27, "O Pokémon prêmio era um "..pokemon.." e você também recebeu "..quantity.." "..prizeItemName.."(s). Parabéns!") doSendMagicEffect(getThingPos(cid), 29) addPokeToPlayer(cid, pokemon, 0, nil, btype) -- Alterado v1.9 if isPlayerOnline(cid) then doPlayerAddItem(cid, prizeItemId, quantity) -- Adiciona a quantidade aleatoria do item ao jogador doRemoveItem(item.uid, 1) if useOTClient then doCreatureExecuteTalkAction(cid, "/salvar") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are not online. Please log in to receive your prize.") end return true end <action itemid="11638-11641" event="script" value="box2.lua"/> <action itemid="12331" event="script" value="box2.lua"/> <action itemid="15512" event="script" value="boxpascoa.lua"/> <action itemid="15511" event="script" value="box2.lua"/> <action itemid="1990" event="script" value="box2.lua"/> <action itemid="12227" event="script" value="box2.lua"/> <action itemid="15432" event="script" value="box2.lua"/> <action itemid="15488" event="script" value="box2.lua"/> BEM GALERA, ESSA É UMA VERSÃO ATUALIZADA DAS BOX POKEMONS, AGORA PODENDO VIR ITENS ALEATORIOS JUNTO, NELA CONTEM TABELA DE UNIQUEITENS E LOSTITENS. UNIQUE= OS ITENS INSERIDOS NA TABELA UNIQUE SÓ PODERA VIR UMA UNICA VEZ EXE: 11440 = BIKE, SÓ PODE VIR 1 DE SURPRESA JA NA TABELA: LOSTITES SE O ITEM 11440 ESTIVER NELA AS CHANCES DO ITEM VIR É RANDOMICO (300) <= 150, POREM O POKEMON CONTINUA VINDO NORMAL, O QUE NAO VEM É O ITEM INSERIDO NA TABELA LOST. É ISSO ESPERO QUE GOSTEM.
  4. Galera, tava fazendo esse sistema, mais depois desanimei dele... segue abaixo. local itemAura = 4853 local auraEffects = { 44, -- Efeito visual 1 (substitua pelo efeito real) } local auraDuration = 10 -- 10 segundos local auraInterval = 1000 -- 1000 milissegundos (1 segundo) function displayAuraByDuration(cid, effect, duration, interval) doSendMagicEffect(getCreaturePosition(cid), effect) duration = duration - interval/1000 if duration > 0 then addEvent(function(cid) if isCreature(cid) then displayAuraByDuration(cid, effect, duration, interval) end end, interval, cid) end end -- Função para pegar um conteúdo aleatório de uma tabela function getRandomAuraEffect() local randomIndex = math.random(1, #auraEffects) return auraEffects[randomIndex] end function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == itemAura then if not isCreature(itemEx.uid) or isPlayer(itemEx.uid) then doPlayerSendCancel(cid, "Você não pode usar este item aqui.") return true end local summon = getCreatureSummons(cid)[1] if not summon or not isCreature(summon) then doPlayerSendCancel(cid, "Você não tem um Pokémon invocado.") return true end local auraEffect = getRandomAuraEffect() displayAuraByDuration(summon, auraEffect, auraDuration, auraInterval) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você adicionou uma aura ao seu Pokémon!") -- Agende a remoção da aura após a duração especificada addEvent(function() if isCreature(summon) then doSendMagicEffect(getCreaturePosition(summon), CONST_ME_POFF) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "A aura em seu Pokémon se dissipou.") end end, auraDuration * 1000) doRemoveItem(item.uid, 1) return true end return false end Minha ideia era: Colocar pra que quando o player caisse a conexao, ou voltasse pra ball ou morresse, ele nao perdesse a aura, também ele puxaria atributos de ganho de vida, defesa, speed etc, e criar um aviso de que o poke ja esta com aura, e evitar ao dar reload a aura sumir. Essas eram minhas ideias. porem nao consegui por elas em pratica, e também tinha uma que nao levei a fundo, que seria cada aura removesse uma condition, tipo a desse script, ela removeria condition de agua, e ganharia defesa de atributo e speed tudo configurado no script. Enfim venho aqui disponibilizar a voces, caso alguem se voluntarie em fazer essas melhorias a vontade, vamos manter o topico atualizado, obg a todos.
  5. aqui vc retiro o damageAmount mais a ideia é boa
  6. Olá galera, eu estava atrás de um npc onde o player poderia acessar varios locais escondidos através de um npc, porém, nao estava conseguindo, hoje que saiu o npc...ou seja como funciona. O player chega no npc fala hi, o npc pede pra ele dizer a palavra chave secreta, caso ele acerte, ele é teleportado em 1 das 10 posições disponiveis no script, porem caso ele erre a palavra chave, ele leva um hit de dano na hp. local cfg = { keyword = "SENHA_AQUI", -- A SENHA, MUDE A SEU CRITÉRIO damageAmount = 100, -- QUANTIDADE DE DANOS NO HP teleportPositions = { -- LISTA DAS 10 POSIÇÕES {x = 1506, y = 742, z = 6}, {x = 1510, y = 746, z = 6}, {x = 1499, y = 738, z = 6}, {x = 1515, y = 748, z = 6}, {x = 1495, y = 736, z = 6}, {x = 1520, y = 750, z = 6}, {x = 1490, y = 734, z = 6}, {x = 1525, y = 752, z = 6}, {x = 1485, y = 732, z = 6}, {x = 1530, y = 754, z = 6} }, correctKeywordEffect = 30, -- EFEITO CASO ACERTE A PALAVRA CHAVE incorrectKeywordEffect = 11 -- EFEITO CASO ERRE A PALAVRA CHAVE } 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 -- FUNÇÃO DE TELEPORTE CASO A SENHA SEJA CORRETA function teleportToRandomPosition(cid) local randomIndex = math.random(1, #cfg.teleportPositions) local randomPosition = cfg.teleportPositions[randomIndex] doTeleportThing(cid, randomPosition) end function creatureSayCallback(cid, type, msg) if (not npcHandler:isFocused(cid)) then return false end if msgcontains(msg, cfg.keyword) then -- Palavra-chave correta, teletransporte o jogador e exiba o efeito correto selfSay("Palavra-chave correta! Teleportando você para o local secreto.") doSendMagicEffect(getCreaturePosition(cid), cfg.correctKeywordEffect) teleportToRandomPosition(cid) -- Teleporte o NPC para uma posição aleatória doSendMagicEffect(getCreaturePosition(cid), 21) -- Teleport effect else -- Palavra-chave incorreta, causa dano e exibe o efeito incorreto selfSay("Palavra-chave incorreta! Você sofre danos de vida.") doSendMagicEffect(getCreaturePosition(cid), cfg.incorrectKeywordEffect) doCreatureAddHealth(cid, -cfg.damageAmount) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) XML <?xml version="1.0" encoding="UTF-8"?> <npc name="Room Guardian" script="tphit.lua" walkinterval="3000" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="1158" head="114" body="119" legs="114" feet="114" corpse="2212"/> <health now="150" max="150"/> <look type="520" head="115" body="88" legs="114" feet="0"/> <parameters> <parameter key="message_greet" value="Eu posso te levar a alguns lugares secreto, diga a senha correta!"/> <parameter key="message_walkaway" value="Boa Sorte aventureiro!"/> </parameters> </npc>
×
  • Criar Novo...