Ir para conteúdo

Bodak Reborn

Membro
  • Registro em

  • Última visita

Tudo que Bodak Reborn postou

  1. Realmente, bem estranho... bugou hard ;P Enfim, editei com o post certo.
  2. local fishing = { [-1] = { segs = 8, pokes = {{"Magikarp",5},{"Feebas",5}} }, [13490] = { segs = 8, pokes = {{"Horsea",5}, {"Remoraid",3}, {"Goldeen",3}, {"Poliwag",2}, {"Swinub",2}} }, -- pega no client da pxg [13491] = { segs = 5, pokes = {{"Tentacool",3}, {"Staryu",2}, {"Krabby",3}, {"Shellder",2}, {"Omanyte",3}} }, [13492] = { segs = 5, pokes = {{"Seel",2}, {"Chinchou",2}, {"Slowpoke",2}, {"Kabuto",2}, {"Psyduck",2}, {"Wooper",2}} }, [13493] = { segs = 5, pokes = {{"Seaking",2}, {"Seadra",2}, {"Poliwhirl",2}, {"Squirtle",2}, {"Totodile",2}} }, [13494] = { segs = 5, pokes = {{"Starmie",2}, {"Kingler",2}, {"Corsola",2}, {"Qwilfish",2}} }, -- pega no client da pxg [13495] = { segs = 5, pokes = {{"Lanturn",2}, {"Dewgong",2}, {"Slowbro",2}, {"Azumarill",2}} }, [13497] = { segs = 5, pokes = {{"Cloyster",2}, {"Poliwrath",2}, {"Politoed",2}, {"Octillery",2}} }, [13496] = { segs = 5, pokes = {{"Dratini",3}, {"Quagsire",2}, {"Dragonair",2}, {"Omastar",2}, {"Lapras",1}} }, [13498] = { segs = 5, pokes = {{"Gyarados",3}, {"Mantine",3}, {"Tentacruel",3}, {"Kingdra",3}, {"Giant Magikarp",3}, {"Feraligatr",3}, {"Blastoise",3}} }, } local storageP = 154585 local sto_iscas = 5648454 --muda aki pra sto q ta no script da isca local storageExhausted = 984654 local timeToFish = 3 -- tempo em segundos. local bonus = 100 local limite = 100 local function doFish(cid, pos, ppos, interval) if getPlayerStorageValue (cid, storageExhausted) < os.time () then if not isCreature(cid) then return false end if getThingPos(cid).x ~= ppos.x or getThingPos(cid).y ~= ppos.y then return false end doSendMagicEffect(pos, CONST_ME_LOSEENERGY) if interval > 0 then addEvent(doFish, 1000, cid, pos, ppos, interval-1) return true end local peixe = 0 local playerpos = getClosestFreeTile(cid, getThingPos(cid)) local fishes = fishing[getPlayerStorageValue(cid, sto_iscas)] local random = {} if getPlayerSkillLevel(cid, 6) < limite then doPlayerAddSkillTry(cid, 6, bonus * 15) end --[[if math.random(1, 100) <= chance then if getPlayerSkillLevel(cid, 6) < limite then doPlayerAddSkillTry(cid, 6, bonus * 5) end]] random = fishes.pokes[math.random(#fishes.pokes)] for i = 1, math.random(random[2]) do peixe = doSummonCreature(random[1], playerpos) if not isCreature(peixe) then setPlayerStorageValue(cid, storageP, -1) return true end doCreatureSetLookDir(cid, getDirectionTo(getThingPos(cid), getThingPos(peixe))) --alterado ver depois if #getCreatureSummons(cid) >= 1 then doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 0) doChallengeCreature(getCreatureSummons(cid)[1], peixe) else doSendMagicEffect(getThingPos(cid), 0) doChallengeCreature(cid, peixe) end end setPlayerStorageValue(cid, storageP, -1) setPlayerStorageValue (cid, storageExhausted, timeToFish * 1000 + os.time()) else doPlayerSendCancel (cid, "Você está exhaustado.") end return true end local waters = {4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825} function onUse(cid, item, fromPos, itemEx, toPos) if getPlayerGroupId(cid) == 11 then return true end local checkPos = toPos checkPos.stackpos = 0 if getTileThingByPos(checkPos).itemid <= 0 then doPlayerSendCancel(cid, '!') return true end if not isInArray(waters, getTileInfo(toPos).itemid) then return true end if (getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1) and not canFishWhileSurfingOrFlying then doPlayerSendCancel(cid, "You can't fish while surfing/flying.") return true end if isInArray(waters, getTileInfo(getThingPos(cid)).itemid) then doPlayerSendCancel(cid, "You can\'t fish while surfing neither flying above water.") return true end if getTileInfo(getThingPos(getCreatureSummons(cid)[1] or cid)).protection then doPlayerSendCancel(cid, "You can't fish pokémons if you or your pokémon is in protection zone.") return true end local delay = fishing[getPlayerStorageValue(cid, sto_iscas)].segs if getPlayerStorageValue(cid, sto_iscas) ~= -1 then if getPlayerItemCount(cid, getPlayerStorageValue(cid, sto_iscas)) >= 1 then doPlayerRemoveItem(cid, getPlayerStorageValue(cid, sto_iscas), 1) else setPlayerStorageValue(cid, sto_iscas, -1) end end doFish(cid, toPos, getThingPos(cid), math.random(5, delay)) return true end
  3. Tenta trocar local function isMC (cid) for _, pid in ipairs(getPlayersOnline()) do if cid ~= pid and getPlayerIp(cid) == getPlayerIp(pid) then return true end end return true end por local function isMC (cid) for _, pid in ipairs(getPlayersOnline()) do if cid ~= pid and getPlayerIp(cid) == getPlayerIp(pid) then return false end end return true end
  4. A função em si não foi eu quem fez, não recordo o nome do criador, mas realmente é bem útil. (: Olha, tem uma função que eu usei em outro tópico (o nome do criador está no final do meu post) que remove os monstros na área X. Eu fiz um globalevents, ou seja, é por tempo. Você pode fazer para verificar se tem X monstro na área a partir dela. De novo, estou meio sem tempo, então só passarei o link do post. Boa sorte.
  5. Ué... tenta trocar if not isMC (cid) then por if isMC (cid) then
  6. Tenta assim local config = { monster = {"Demon", "Dragon"}, -- nome dos monstros, separado por vírgulas. item = {[1] = 2160, [2] = 2159}, -- [um numero maior que o anterior] = ID do item1, ID do item2, ID do item3... qnt = {[1] = 2, [2] = 5}, -- [um numero maior que o anterior] = quantidade do item1, quantidade do item2, quantidade do item3... effect = 27, -- efeito ao matar o monstro. } local function isMC (cid) for _, pid in ipairs(getPlayersOnline()) do if cid ~= pid and getPlayerIp(cid) == getPlayerIp(pid) then return true end end return true end function onKill(cid, target) if not isMC (cid) then if isInArray(config.monster, getCreatureName(target)) then for i = 1, #config.item do doPlayerAddItem (cid, config.item[i], config.qnt[i]) end doPlayerSendTextMessage (cid, 19, "Você receberá uma recompensa por derrotar o "..getCreatureName(target)..".") doSendMagicEffect (getThingPos (cid), config.effect) end else doPlayerSendTextMessage (cid, 19, "MSG caso esteja de MC.") end return true end
  7. Não achei o erro no meu script, mas okay. ;P
  8. Bodak Reborn postou uma resposta no tópico em Suporte Tibia OTServer
    Eu já te respondi, por que reabriu?
  9. ... local config = { monster = {"Demon", "Dragon"}, -- nome dos monstros, separado por vírgulas. item = {[1] = 2160, [2] = 2159}, -- [um numero maior que o anterior] = ID do item1, ID do item2, ID do item3... qnt = {[1] = 2, [2] = 5}, -- [um numero maior que o anterior] = quantidade do item1, quantidade do item2, quantidade do item3... effect = 27, -- efeito ao matar o monstro. } local function isMC (cid) for _, pid in pairs(getPlayersOnline()) do if(cid ~= pid and getPlayerIp(cid) == getPlayerIp(pid)) then doPlayerSendTextMessage (cid, MESSAGE_STATUS_CONSOLE_BLUE, "MSG caso seja MC.") return true end end return true end function onKill(cid, target) if not isMC (cid) then if isInArray(config.monster, getCreatureName(target)) then for i = 1, #config.item do doPlayerAddItem (cid, config.item[i], config.qnt[i]) end doPlayerSendTextMessage (cid, 19, "Você receberá uma recompensa por derrotar o "..getCreatureName(target)..".") doSendMagicEffect (getThingPos (cid), config.effect) end else doPlayerSendTextMessage (cid, 19, ".....") end return true end
  10. Eu estou um pouco sem tempo agora, eu faria exemplos e tal. Enfim, faça como eu fiz no movements: É só remover a verificação se o player tem X storage (que era para saber se ele tinha usado o item), pois seu sistema é por NPC. Acho que não terá muitas dificuldades, por ser scripter. A função verifica se tem algum jogador na área, caso não tiver, teleporta para a área. Se tiver, o jogador é teleportado para o tile anterior e não poderá entrar. Você poderia usar o os.time() para fazer seu script, mas caso alguém morresse lá dentro, ninguém ia poder entrar até acabar o tempo. Reforçando o que eu disse no tópico: o teleport é sem coordenadas, você dá coordenadas para o tile no qual ele fica em cima, pelo script. Boa sorte.
  11. @Vodkart, caso o jogador escolha um rank que seja maior que 5, ele voltará para o rank 1. function onSay(cid, words, param, channel) local t = string.explode(param:lower(), ",") local clans = {'Volcanic', 'Seavell', 'Orebound', 'Wingeon', 'Malefic', 'Gardestrike', 'Psycraft', 'Naturia', 'Raibolt'} if param == "" then sendMsgToPlayer(cid, 20, "Estao faltam os parametros! [clan name], [rank]") return true elseif not isInArray(clans, t[1], false) then sendMsgToPlayer(cid, 20, t[1].." nao é um clan valido!") return true elseif not tonumber(t[2]) then sendMsgToPlayer(cid, 20, "Parametros errados! [clan name], [rank].") return true elseif tonumber (t[2]) > 5 then sendMsgToPlayer (cid, 20, "O rank "..t[2].." não é válido. Por favor, escolha um rank de 1 a 5.") return false end local clan, rank = t[1], tonumber(t[2]) if getPlayerItemCount(cid, 2145) < 10 then doPlayerSendCancel(cid, "Você precisa de 10 diamonds para entrar em um clan.") return true elseif getPlayerLevel(cid) < 80 then doPlayerSendCancel(cid, "Você precisa estar no level 80.") return true end doPlayerSendTextMessage(cid, 27, "Agora você pertence ao clan "..clan..", rank: "..rank.."") doPlayerRemoveItem(cid, 2145, 10) setPlayerClan(cid, clan) setPlayerClanRank(cid, rank) return true end
  12. Essa linha é pra fazer a porcentagem. Você deve ter configurado errado, eu testei aqui e funcionou.
  13. A verificação é a mesma. Só colocar a função que eu postei lá acima da função onKill. if not isMC (cid) then --código else doPlayerSendTextMessage (cid, 19, "Você não irá receber a recompensa por estar com Multi Client.") end
  14. function onUse(cid, item, frompos, item2, topos) local item = { [1] = {2156, 1, 1}, [2] = {3000, 1, 5}, [3] = {2113, 1, 10}, [4] = {2156, 1, 40}, [5] = {2160, 10, 60}, -- [um número maior que o anterior] = {ID do item, quantidade, chance} } local randomItem = math.random (1, 100) for i = 1, #item do if randomItem > 0 and randomItem <= item[i][3] then if doPlayerAddItem (cid, item[i][1], item[i][2]) then if randomItem == 1 then doBroadcastMessage ("Parabéns, "..getCreatureName (cid).."! Você achou a "..getItemNameById (item[i][1]).."!") end break; end end end doRemoveItem (item2.uid, 1) if randomItem > item[#item][3] then doPlayerSendTextMessage (cid, 19, "Seu item falhou.") end return true end
  15. Eu postei essa função para você em algum pedido seu, só pegá-la e aplicar ai.
  16. function onUse(cid, item, frompos, item2, topos) local item = { [1] = {2156, 1, 1}, [2] = {3000, 1, 5}, [3] = {2113, 1, 10}, [4] = {2156, 1, 40}, [5] = {2160, 10, 60}, -- [um número maior que o anterior] = {ID do item, quantidade, chance} } local randomItem = math.random (1, 100) for i = 1, #item do if randomItem > 0 and randomItem <= item[i][3] then if doPlayerAddItem (cid, item[i][1], item[i][2]) then break; end end end doRemoveItem (item2.uid, 1) if randomItem > item[#item][3] then doPlayerSendTextMessage (cid, 19, "Seu item falhou.") end return true end
  17. Só para ter certeza, no seu script está "getItemAttribute" invés de apenas "Attribute", certo? E o Ditto realmente ganha life ao transformar?
  18. Exato. O elseif seria algo como "SE não for o IF, mas for ~condição~, faça:". Ele é linkado com o if, como se fosse um else com condição. O último else seria para caso nenhuma das condições do IF/ELSEIF for verdadeira. "Traduzindo" para português, ficaria: SE verde for igual a laranja, faça: imprime: verde é igual a laranja. SE verde não for igual a laranja, mas SE verde for igual a marrom, faça: imprime: verde é igual a marrom. SE verde não for igual a marrom, mas SE verde for igual a vermelho, faça: imprime: verde é igual a vermelho. SE verde não for igual a vermelho, mas SE verde for igual a amarelo faça: imprime: verde é igual a amarelo. se não for, faça: imprime: verde é igual a roxo. end Verde não é igual a roxo, mas como todos os IF/ELSEIF são falsos, vai imprimir: verde é igual a roxo. Espero que tenha entendido. (:
  19. getItemAttribute(pokeball.uid, "ehditto") Esse atributo é para saber se o pokémon que está na pokeball é um Ditto, para poder transformar em Ditto novamente. Eu penso que o problema seja com o !revert, porque possivelmente o Ditto aumenta sua life enquanto está transformado em X pokémon, então quando você reverte, ele está com X life, e quando solta, ele está com Y. Exemplo: meu Ditto normal tem 50k de life, transformado em um Blastoise tem 80k. Você reverte ele com 80k de life e quando você solta ele está com 50k. Não sei se é esse o problema, mas foi a única coisa que eu pensei. Só para constar, você não copiou a linha inteira, certo? Pois isso não existe: Attribute(pokeball.uid, "ehditto") o certo seria: getItemAttribute(pokeball.uid, "ehditto") Estou pensando em como fazer para corrigir se o erro foi esse como eu citei, da life e tal. Eu te aviso caso eu pense em algo.

Informação Importante

Confirmação de Termo