Postado Setembro 27, 2022 3 anos Bom Dia, Eu To Procurando Um Script Que Nem Uma Planta Em Pokemon GBA Que Sumona Monster!, Citar Como Seria: Quando O Player Pisar No Piso Ele Tem Chance De Aparecer Algum Monster Ou Nao Aparecer!, Tipo: Nao Aparecer 40% Aparecer Bulbasaur 50% Aparecer Weedle 70% Aparecer Shiny Pikachu 0,1% E Depois De Um Minuto O Monster Sumir Se Ninguem Tiver Atacando! Bom, Eu Tenho Um Script Aki Que Nao Tem Porcentagem De Aparecer Monster E Tambem Ta Bugado Na Parte De Fazer O Monster Sumir! ( QUANDO SPAWNA MAIS DE 1 MONSTER O SEGUNDO NAO DESAPARECE! ) Citar function onStepIn(cid, item, toPosition, fromPosition) local time = 1 -- Tempo em minutos local rand = math.random(20, 50) local monsters = {"Bulbasaur", "Venusaur", "Ivysaur"} if isPlayer(cid) then if rand == 20 then created = doCreateMonster(monsters [math.random(1, #monsters)], getCreaturePosition(cid)) doCreatureSay(created, "Um Pokemon Salvagem Apareceu!", TALKTYPE_MONSTER) doSendMagicEffect(getCreaturePosition(created), 173) addEvent(function() if isMonster(created) then doRemoveCreature(created) end end, time *60 *1000) end end return true end Quem Poder Me Ajudar Agradeço! spawn.lua Spoiler 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 shi = doCreateMonster(name, pos, false) setPlayerStorageValue(shi, 74469, 1) 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 Editado Outubro 9, 2022 3 anos por Aizuuu esqueci de por o outro script (veja o histórico de edições)
Postado Setembro 28, 2022 3 anos 10 horas atrás, Aizuuu disse: Nao Aparecer 40% Aparecer Bulbasaur 50% Aparecer Weedle 70% Aparecer Shiny Pikachu 0,1% a chance total pra sumonar precisa ser 100% no total por essa contagem não faz muito sentido, pq tem chance de n aparecer nada, então fiz +/- assim: --[[ script edited by - Feetads TibiaKing ]]-- -- pode coloca essa function na LIB, e retirar o "local" pra usa-la em outro script sem precisar colocar de novo local function getMonstersFromArea(fromPos, toPos) local monsterInArea = {} for posx = fromPos.x, toPos.x do for posy = fromPos.y, toPos.y do for posz = fromPos.z, toPos.z do local tmp = getTopCreature({x=posx,y=posy,z=posz}).uid if(tmp > 0) then for s = 0, 255 do _search_pos = {x = posx, y = posy, z = posz, stackpos = s} tmpMonster = getThingfromPos(_search_pos).uid if tmpMonster > 0 and isMonster(tmpMonster) and not isSummon(tmpMonster) and not isInArray(monsterInArea, tmpMonster) then table.insert(monsterInArea, tmpMonster) end end end end end end return monsterInArea end local function func_createBoss(id_monster, player_pos) local fromPos = {x = 1000, y = 1000, z = 7} --canto superior esquerdo da sala (colocar mais SQM acima pra formar um quadrado EM VOLTA da sala) local toPos = {x = 1010, y = 1010, z = 7} --canto inferior direito da sala (colocar mais SQM abaixo pra formar um quadrado EM VOLTA da sala) local position_boss = {x = 1005, y = 1005, z = 7} -- POSIÇÃO QUE O BOSS IRÁ NASCER --local position_boss = player_pos -- caso queira que o boss nasça em cima do player, descomentar esse, E comentar o de cima local monsters = {"Bulbasaur", "Weedle", "Shiny Pikachu"} --nome dos monstros precisa corresponder ao que vc quer local checkMonster = getMonstersFromArea(fromPos, toPos) --função pra checar se tem monstro na sala if #checkMonster < 1 then -- < 1 é 0, ou seja, não tem created = doCreateMonster(monsters[id_monster], position_boss, false, true) --função pra forçar a criação do boss doCreatureSay(created, "Um Pokemon Salvagem Apareceu!", TALKTYPE_MONSTER) doSendMagicEffect(getCreaturePosition(created), 173) addEvent(function() if isCreature(created) and isMonster(created) then doRemoveCreature(created) end end, timer*60*1000) end end function onStepIn(cid, item, toPosition, fromPosition) local timer = 1 -- Tempo em minutos local rand = math.random(1, 1000) --numero random de 1 até 1000, NÃO MEXER local player_pos = getCreaturePosition(cid) if isCreature(cid) and isPlayer(cid) then if rand >= 1 and rand <= 400 then -- de 1 a 400 (40%) não aparece nada return true elseif rand > 400 and rand <= 700 -- de 400 a 700 (30%) aparece o bulbasaur func_createBoss(1, player_pos) elseif rand > 700 and rand <= 999 -- de 700 a 99 (29.9%) aparece o weedle func_createBoss(2, player_pos) elseif rand > 999 -- acima de 999 (0.1%) aparece o shyni pikachu func_createBoss(3, player_pos) end end return true end
Postado Setembro 29, 2022 3 anos Autor Em 28/09/2022 em 06:30, FeeTads disse: a chance total pra sumonar precisa ser 100% no total por essa contagem não faz muito sentido, pq tem chance de n aparecer nada, então fiz +/- assim: --[[ script edited by - Feetads TibiaKing ]]-- -- pode coloca essa function na LIB, e retirar o "local" pra usa-la em outro script sem precisar colocar de novo local function getMonstersFromArea(fromPos, toPos) local monsterInArea = {} for posx = fromPos.x, toPos.x do for posy = fromPos.y, toPos.y do for posz = fromPos.z, toPos.z do local tmp = getTopCreature({x=posx,y=posy,z=posz}).uid if(tmp > 0) then for s = 0, 255 do _search_pos = {x = posx, y = posy, z = posz, stackpos = s} tmpMonster = getThingfromPos(_search_pos).uid if tmpMonster > 0 and isMonster(tmpMonster) and not isSummon(tmpMonster) and not isInArray(monsterInArea, tmpMonster) then table.insert(monsterInArea, tmpMonster) end end end end end end return monsterInArea end local function func_createBoss(id_monster, player_pos) local fromPos = {x = 1000, y = 1000, z = 7} --canto superior esquerdo da sala (colocar mais SQM acima pra formar um quadrado EM VOLTA da sala) local toPos = {x = 1010, y = 1010, z = 7} --canto inferior direito da sala (colocar mais SQM abaixo pra formar um quadrado EM VOLTA da sala) local position_boss = {x = 1005, y = 1005, z = 7} -- POSIÇÃO QUE O BOSS IRÁ NASCER --local position_boss = player_pos -- caso queira que o boss nasça em cima do player, descomentar esse, E comentar o de cima local monsters = {"Bulbasaur", "Weedle", "Shiny Pikachu"} --nome dos monstros precisa corresponder ao que vc quer local checkMonster = getMonstersFromArea(fromPos, toPos) --função pra checar se tem monstro na sala if #checkMonster < 1 then -- < 1 é 0, ou seja, não tem created = doCreateMonster(monsters[id_monster], position_boss, false, true) --função pra forçar a criação do boss doCreatureSay(created, "Um Pokemon Salvagem Apareceu!", TALKTYPE_MONSTER) doSendMagicEffect(getCreaturePosition(created), 173) addEvent(function() if isCreature(created) and isMonster(created) then doRemoveCreature(created) end end, timer*60*1000) end end function onStepIn(cid, item, toPosition, fromPosition) local timer = 1 -- Tempo em minutos local rand = math.random(1, 1000) --numero random de 1 até 1000, NÃO MEXER local player_pos = getCreaturePosition(cid) if isCreature(cid) and isPlayer(cid) then if rand >= 1 and rand <= 400 then -- de 1 a 400 (40%) não aparece nada return true elseif rand > 400 and rand <= 700 -- de 400 a 700 (30%) aparece o bulbasaur func_createBoss(1, player_pos) elseif rand > 700 and rand <= 999 -- de 700 a 99 (29.9%) aparece o weedle func_createBoss(2, player_pos) elseif rand > 999 -- acima de 999 (0.1%) aparece o shyni pikachu func_createBoss(3, player_pos) end end return true end Obrigado Mais Nao E Assim Que Eu Queria, Era Mais Estilo GBA Msm Ai Ta Marcando a Localizaçao Do Spawn, Eu Queria Que O Monster Aparecese Quando Eu Pisar Em Um Piso Tlgd Msm Assim Agradeço
Postado Setembro 29, 2022 3 anos 39 minutos atrás, Aizuuu disse: Obrigado Mais Nao E Assim Que Eu Queria, Era Mais Estilo GBA Msm Ai Ta Marcando a Localizaçao Do Spawn, Eu Queria Que O Monster Aparecese Quando Eu Pisar Em Um Piso Tlgd Msm Assim Agradeço nunca joguei pokemon, n sei oq eh GBA kkkkkkkk tentei oq entendi pra te ajudar kkkkkk
Postado Setembro 29, 2022 3 anos Autor Agora, FeeTads disse: nunca joguei pokemon, n sei oq eh GBA kkkkkkkk tentei oq entendi pra te ajudar kkkkkk ata kkk de boa agradeço de qlqr forma
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.