Ir para conteúdo

hiquezerah

Membro
  • Registro em

  • Última visita

  1. local RoomPosition = {x = 250, y = 114, z = 7} -- pos (centro) local rangex, rangey = 20, 10 -- quantos sqms x e y local specter = getSpectators(RoomPosition, rangex, rangey, false) for count, spec in pairs(specter) do if isPlayer(spec) then print(count) -- quantidade de jogadores na area end end Eu não conheço as funções da tfs 1.+ mas acredito que você so precisará modificar o getSpectators para game.getSpectators, acredito que seja isso que você deseja
  2. @Gustavots Você pode remover o "return true" no fim do script da sua spell. Ou você pode modificar seu spells.cpp e remover.
  3. hiquezerah postou uma resposta no tópico em Suporte Tibia OTServer
    0.4 você pode fazer facilmente por creaturescript utilizando value
  4. Atualizei o último post do código, testa agora, tinha esquecido uma coisa kkkk reseta sua storage para 0, e tenta novamente
  5. modifica o valor da storage que está na verificação para testar.
  6. local monsters = { [1] = {monstro = "Wolf", chance = 50, time = 10}, --[Ordem numerica] = {nome do monstro = Bulbasaur, chance = chance de aparecer esse monstro} [2] = {monstro = "Wolf Beast", chance = 40, time = 10}, --[Ordem numerica] = {nome do monstro = Bulbasaur, chance = chance de aparecer esse monstro} [3] = {monstro = "Bandit", chance = 80, time = 10} --[Ordem numerica] = {nome do monstro = Bulbasaur, chance = chance de aparecer esse monstro} } local function getRandomMonster(t) local i = math.random(1, #t) i = t[i] if math.random(1, 100) <= i.chance then return i end return getRandomMonster(t) end local chance = 60 -- 60% de chance de sucesso e 40% de falhar local shinys = {"Bandit"} -- adiciona o nome dos pokemons que não deverão sumir aqui. function onStepIn(cid, item, toPosition, fromPosition) if isPlayer(cid) and math.random(1, 100) <= chance and getPlayerStorageValue(cid, 74480) <= os.time() then local tempo = 1 local i = getRandomMonster(monsters) local monstro = doCreateMonster(i.monstro, getCreaturePosition(cid)) setPlayerStorageValue(cid, 74480, i.time + os.time()) doCreatureSay(monstro, "Um " ..i.monstro.. " Selvagem Apareceu!", TALKTYPE_MONSTER) addEvent(function() if isCreature(monstro) and not isInArray(shinys, i.monstro) then doRemoveCreature(monstro) end end, tempo*60*1000) end return true end
  7. colocar nome de bicho para desaparecer? nesse script eu coloquei um array para você adicionar os monstros que não deve desaparecer.
  8. @Aizuuu O último código que te enviei ja está com essa verificação, você testou?
  9. adaptar oque maninho? você fala do tempo de 10 segundos para ter chance de nascer algum monstro novamente?
  10. local monsters = { [1] = {monstro = "Wolf", chance = 50, time = 10}, --[Ordem numerica] = {nome do monstro = Bulbasaur, chance = chance de aparecer esse monstro} [2] = {monstro = "Wolf Beast", chance = 40, time = 10}, --[Ordem numerica] = {nome do monstro = Bulbasaur, chance = chance de aparecer esse monstro} [3] = {monstro = "Bandit", chance = 80, time = 10} --[Ordem numerica] = {nome do monstro = Bulbasaur, chance = chance de aparecer esse monstro} } local function getRandomMonster(t) local i = math.random(1, #t) i = t[i] if math.random(1, 100) <= i.chance then return i end return getRandomMonster(t) end local chance = 60 -- 60% de chance de sucesso e 40% de falhar local shinys = {"Bandit"} -- adiciona o nome dos pokemons que não deverão sumir aqui. function onStepIn(cid, item, toPosition, fromPosition) if isPlayer(cid) and math.random(1, 100) <= chance and getPlayerStorageValue(cid, 74480) <= os.time() then local tempo = 1 local i = getRandomMonster(monsters) local monstro = doCreateMonster(i.monstro, getCreaturePosition(cid)) setPlayerStorageValue(cid, 74480, i.time*1000 + os.time()) doCreatureSay(monstro, "Um " ..i.monstro.. " Selvagem Apareceu!", TALKTYPE_MONSTER) addEvent(function() if isCreature(monstro) and not isInArray(shinys, i.monstro) then doRemoveCreature(monstro) end end, tempo*60*1000) end return true end
  11. local shinys = { "bug", } local raros = { "bug", } local function ShinyName(cid) if isCreature(cid) then if string.find(tostring(getCreatureName(cid)), "Shiny") then local newName = tostring(getCreatureName(cid)):match("Shiny (.*)") doCreatureSetNick(cid, newNamed) if isMonster(cid) then doSetCreatureDropLoot(cid, false) end end end end local function doPokemonRegisterLevel(cid) if not isCreature(cid) then return true end if getWildPokemonLevel(cid) == -1 then setWildPokemonLevel(cid) if isCreature(cid) then local pokesLvl = {"Regice", "Registeel", "Regirock", "Furious Charizard", "Primal Kyogre", "Cresselia", "Regigigas", "Lugia", "Giratina", "Rayquaza", "Entei", "Suicune", "Raikou", "Celebi", "Shiny Celebi", "Latios", "Latias", "Shaymin", "Hoopa", "Mew", "Mewtwo", "Palkia", "Articuno", "Zapdos", "Moltres", "Kyogre", "Guardian Magmar", "Dialga", "Charizard Halloween", "Giant Gengar", "Marowak Halloween", "Jirachi", "Groudon", "Darkrai", "Darkrai Nightmare", "Primal Dialga", "Zekrom", "Kyurem", "White Kyurem", "Black Kyurem", "Reshiram"} if not isInArray(pokesLvl, getCreatureName(cid)) then local lvl = math.random(1, 10) local nick = ""..getCreatureName(cid).." ["..lvl.."]" doCreatureSetNick(cid, nick) setPlayerStorageValue(cid, 1000, lvl) else -- Classe 100-100 local lvl = 100 local nick = ""..getCreatureName(cid).." ["..lvl.."]" doCreatureSetNick(cid, nick) setPlayerStorageValue(cid, 1000, lvl) end if string.find(tostring(getCreatureName(cid)), "Shiny") then local lvl = math.random(5, 20) local nick = ""..getCreatureName(cid).." ["..lvl.."]" doCreatureSetNick(cid, nick) setPlayerStorageValue(cid, 1000, lvl) end end end end local function doSetRandomGender(cid) if not isCreature(cid) then return true end if isSummon(cid) then return true end local gender = 0 local name = getCreatureName(cid) if not newpokedex[name] then return true end local rate = newpokedex[name].gender if rate == 0 then gender = 3 elseif rate == 1000 then gender = 4 elseif rate == -1 then gender = 1 elseif math.random(1, 1000) <= rate then gender = 4 else gender = 3 end doCreatureSetSkullType(cid, gender) end local function doShiny(cid) if isCreature(cid) then if isSummon(cid) then return true end if getPlayerStorageValue(cid, 74469) >= 1 then return true end if getPlayerStorageValue(cid, 22546) >= 1 then return true end if isNpcSummon(cid) then return true end if getPlayerStorageValue(cid, 637500) >= 1 then return true end --alterado v1.9 if isInArray(shinys, getCreatureName(cid)) then --alterado v1.9 \/ chance = 0.1 --1% chance elseif isInArray(raros, getCreatureName(cid)) then --n coloquem valores menores que 0.1 !! chance = 0.1 --1% chance else return true end if math.random(1, 1000) <= chance*10 and getPlayerStorageValue(cid, 74480) <= os.time() then doSendMagicEffect(getThingPos(cid), 18) local name, pos = "Shiny ".. getCreatureName(cid), getThingPos(cid) doRemoveCreature(cid) local tempo = 1 -- tempo para sumir os monstros sumonados. local shi = doCreateMonster(name, pos, false) setPlayerStorageValue(shi, 74469, 1) setPlayerStorageValue(cid, 74480, 10000 + os.time()) addEvent(function() if isCreature(shi) then doRemoveCreature(shi) end end, tempo*60*1000) else setPlayerStorageValue(cid, 74469, 1) end --/\ else return true end end function onSpawn(cid) registerCreatureEvent(cid, "Experience") registerCreatureEvent(cid, "GeneralConfiguration") registerCreatureEvent(cid, "DirectionSystem") registerCreatureEvent(cid, "CastSystem") if isSummon(cid) then registerCreatureEvent(cid, "SummonDeath") return true end addEvent(doPokemonRegisterLevel, 5, cid) addEvent(doSetRandomGender, 5, cid) addEvent(doShiny, 10, cid) -- addEvent(adjustWildPoke, 5, cid) return true end testa
  12. local shinys = { "bug", } local raros = { "bug", } local function ShinyName(cid) if isCreature(cid) then if string.find(tostring(getCreatureName(cid)), "Shiny") then local newName = tostring(getCreatureName(cid)):match("Shiny (.*)") doCreatureSetNick(cid, newNamed) if isMonster(cid) then doSetCreatureDropLoot(cid, false) end end end end local function doPokemonRegisterLevel(cid) if not isCreature(cid) then return true end if getWildPokemonLevel(cid) == -1 then setWildPokemonLevel(cid) if isCreature(cid) then local pokesLvl = {"Regice", "Registeel", "Regirock", "Furious Charizard", "Primal Kyogre", "Cresselia", "Regigigas", "Lugia", "Giratina", "Rayquaza", "Entei", "Suicune", "Raikou", "Celebi", "Shiny Celebi", "Latios", "Latias", "Shaymin", "Hoopa", "Mew", "Mewtwo", "Palkia", "Articuno", "Zapdos", "Moltres", "Kyogre", "Guardian Magmar", "Dialga", "Charizard Halloween", "Giant Gengar", "Marowak Halloween", "Jirachi", "Groudon", "Darkrai", "Darkrai Nightmare", "Primal Dialga", "Zekrom", "Kyurem", "White Kyurem", "Black Kyurem", "Reshiram"} if not isInArray(pokesLvl, getCreatureName(cid)) then local lvl = math.random(1, 10) local nick = ""..getCreatureName(cid).." ["..lvl.."]" doCreatureSetNick(cid, nick) setPlayerStorageValue(cid, 1000, lvl) else -- Classe 100-100 local lvl = 100 local nick = ""..getCreatureName(cid).." ["..lvl.."]" doCreatureSetNick(cid, nick) setPlayerStorageValue(cid, 1000, lvl) end if string.find(tostring(getCreatureName(cid)), "Shiny") then local lvl = math.random(5, 20) local nick = ""..getCreatureName(cid).." ["..lvl.."]" doCreatureSetNick(cid, nick) setPlayerStorageValue(cid, 1000, lvl) end end end end local function doSetRandomGender(cid) if not isCreature(cid) then return true end if isSummon(cid) then return true end local gender = 0 local name = getCreatureName(cid) if not newpokedex[name] then return true end local rate = newpokedex[name].gender if rate == 0 then gender = 3 elseif rate == 1000 then gender = 4 elseif rate == -1 then gender = 1 elseif math.random(1, 1000) <= rate then gender = 4 else gender = 3 end doCreatureSetSkullType(cid, gender) end local function doShiny(cid) if isCreature(cid) then if isSummon(cid) then return true end if getPlayerStorageValue(cid, 74469) >= 1 then return true end if getPlayerStorageValue(cid, 22546) >= 1 then return true end if isNpcSummon(cid) then return true end if getPlayerStorageValue(cid, 637500) >= 1 then return true end --alterado v1.9 if isInArray(shinys, getCreatureName(cid)) then --alterado v1.9 \/ chance = 0.1 --1% chance elseif isInArray(raros, getCreatureName(cid)) then --n coloquem valores menores que 0.1 !! chance = 0.1 --1% chance else return true end if math.random(1, 1000) <= chance*10 then doSendMagicEffect(getThingPos(cid), 18) local name, pos = "Shiny ".. getCreatureName(cid), getThingPos(cid) doRemoveCreature(cid) local tempo = 1 -- tempo para sumir os monstros sumonados. local shi = doCreateMonster(name, pos, false) setPlayerStorageValue(shi, 74469, 1) addEvent(function() if isCreature(shi) then doRemoveCreature(shi) end end, tempo*60*1000) else setPlayerStorageValue(cid, 74469, 1) end --/\ else return true end end function onSpawn(cid) registerCreatureEvent(cid, "Experience") registerCreatureEvent(cid, "GeneralConfiguration") registerCreatureEvent(cid, "DirectionSystem") registerCreatureEvent(cid, "CastSystem") if isSummon(cid) then registerCreatureEvent(cid, "SummonDeath") return true end addEvent(doPokemonRegisterLevel, 5, cid) addEvent(doSetRandomGender, 5, cid) addEvent(doShiny, 10, cid) -- addEvent(adjustWildPoke, 5, cid) return true end tenta
  13. Você precisa postar o seu outro sistema para que as pessoas possam te ajudar maninho. kkkkkk eu entendi que você adicionaria os shinys para nascer nesse mesmo script e eles não deveriam sumir. Poste o seu spawn.lua

Informação Importante

Confirmação de Termo