XU
pedido scripts

Shiny Aleatório na Outland

Por xurupita360, 19 de jul. de 2018 em Scripts

7
2.5k
xurupita360X
19 de julho de 2018 às 20:21

Boa noite, estou com uma dúvida e venho fazer um pedido de shinys que nasçam aleatoriamente dentro da Outland, no servidor do Huatson. Tentei mexer dentro do spawn no creaturescripts mas acabei não conseguindo fazer, alguém conseguiria ajudar? Estarei deixando o código do spawn abaixo.

 

Spoiler

local shinysName = {
"Blastoise", "Venusaur", "Butterfree", "Beedrill", "Flygon", "Heracross", "Milotic", "Lapras", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Gengar", "Krabby", "Tauros", 
"Kingler", "Cubone", "Horsea", "Seadra","Slowking", "Weezing","Mr. mime","Sandslash", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Meganium", "Alakazam", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode"}

function onSpawn(cid)

    if getCreatureName(cid) == "" or getCreatureName(cid) == nil then
       setPlayerStorageValue(cid, 510, getCreatureNick(cid))
    end
    
    --if isTwoGerenetion(doCorrectString(getCreatureName(cid))) then doRemoveCreature(cid) return false end
    registerCreatureEvent(cid, "GeneralConfiguration")
    registerCreatureEvent(cid, "WildAttack")
    registerCreatureEvent(cid, "Experience")
    registerCreatureEvent(cid, "Matou")
    registerCreatureEvent(cid, "PokeWalk")
    registerCreatureEvent(cid, "StatsChange")
    
    if not ehMonstro(cid) then
        registerCreatureEvent(cid, "Target")
        registerCreatureEvent(cid, "Matou")
        registerCreatureEvent(cid, "SummonDeath")
        getPokeDistanceToTeleport(cid)
        setPokemonGhost(cid)
        if getCreatureName(cid):find("Shiny ") then
           setPlayerStorageValue(cid, storages.EhShiny, 1)
        end
    return true
    end
    
    addEvent(doShiny, 5, cid)
    addEvent(Camuflagear, 5, cid)
    addEvent(adjustWildPoke, 5, cid)
    setPokemonGhost(cid)
    doMarkedPos(cid, getThingPos(cid))
    
       if isPokePassive(cid) then
          setPokemonPassive(cid, true)
       end
    
return true
end

function PonerSigno(cid)
if isWild(cid)  then
  setCreatureName(cid, getCreatureName(cid).."[?]", "a salvaje "..getCreatureName(cid))
    end
end

function Camuflagear(cid)
if getCreatureName(cid) == "Kecleon" and isWild(cid)  then
if isSummon(cid) then return true end    
setPlayerStorageValue(cid, 89899, -1)   
    KecleonCamuWildOn(cid)
    end
    
end


function doShiny(cid)
    if isCreature(cid) then
           if isSummon(cid) then return true end
           if isNpcSummon(cid) then return true end
            local chance = 0
            if isInArray(shinysName, doCorrectString(getCreatureName(cid))) then  --alterado v1.9 \/
               chance = 12    --1.2% chance  
            end    
            local sid = cid
            if math.random(1, 1000) <= chance then  
              doSendMagicEffect(getThingPos(cid), 18)               
              local name, pos = "Shiny ".. getCreatureName(cid), getThingPos(cid)
              if not pokes[name] then return true end
              doRemoveCreature(cid)
              --print(name .. ", " .. retireShinyName(name))
              local shi = doCreateMonsterNick(sid, name, retireShinyName(name), pos, false)          
           end  
    else 
                                                               
    return true
    end
end

 

spawn.lua

Editado Julho 19 por xurupita360

2 semanas depois...
CrypterC
27 de julho de 2018 às 08:27

testa 

Spoiler
local shinysName = {
"Blastoise", "Venusaur", "Butterfree?", "Beedrill", "Flygon", "Heracross", "Milotic", "Lapras", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Gengar?", "Krabby", "Tauros", 
"Kingler", "Cubone", "Horsea", "Seadra","Slowking", "Weezing","Mr. mime","Sandslash", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Meganium", "Alakazam", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode"}

local OutlandShinysName = {
"Blastoise", "Venusaur", "Butterfree?", "Beedrill", "Flygon", "Heracross", "Milotic", "Lapras", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Gengar?", "Krabby", "Tauros", 
"Kingler", "Cubone", "Horsea", "Seadra","Slowking", "Weezing","Mr. mime","Sandslash", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Meganium", "Alakazam", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode"}

local OUTLAND1 = {x=12,y=12,z=7} -- parte superior esquerda da outland // (< /\)
local OUTLAND2 = {x=14,y=14,z=7} -- parte inferior direita da outland  // (> \/)

function onSpawn(cid)

    if getCreatureName(cid) == "" or getCreatureName(cid) == nil then
       setPlayerStorageValue(cid, 510, getCreatureNick(cid))
    end
    
    --if isTwoGerenetion(doCorrectString(getCreatureName(cid))) then doRemoveCreature(cid) return false end
    registerCreatureEvent(cid, "GeneralConfiguration")
    registerCreatureEvent(cid, "WildAttack")
    registerCreatureEvent(cid, "Experience")
    registerCreatureEvent(cid, "Matou")
    registerCreatureEvent(cid, "PokeWalk")
    registerCreatureEvent(cid, "StatsChange")
    
    if not ehMonstro(cid) then
        registerCreatureEvent(cid, "Target?")
        registerCreatureEvent(cid, "Matou")
        registerCreatureEvent(cid, "SummonDeath")
        getPokeDistanceToTeleport(cid)
        setPokemonGhost(cid)
        if getCreatureName(cid):find("Shiny ") then
           setPlayerStorageValue(cid, storages.EhShiny, 1)
        end
    return true
    end
    
    addEvent(doShiny, 5, cid)
    addEvent(Camuflagear, 5, cid)
    addEvent(adjustWildPoke, 5, cid)
    setPokemonGhost(cid)
    doMarkedPos(cid, getThingPos(cid))
    
       if isPokePassive(cid) then
          setPokemonPassive(cid, true)
       end
    
return true
end

function PonerSigno(cid)
if isWild(cid)  then
  setCreatureName(cid, getCreatureName(cid).."[?]", "a salvaje "..getCreatureName(cid))
    end
end

function Camuflagear(cid)
if getCreatureName(cid) == "Kecleon" and isWild(cid)  then
if isSummon(cid) then return true end    
setPlayerStorageValue(cid, 89899, -1)   
    KecleonCamuWildOn(cid)
    end
    
end


function doShiny(cid)
    if isCreature(cid) then
           if isSummon(cid) then return true end
           if isNpcSummon(cid) then return true end
            local chance = 0
            if isInArray(shinysName, doCorrectString(getCreatureName(cid))) then  --alterado v1.9 \/
               chance = 12    --1.2% chance     
			elseif isInArea(getCreaturePosition(cid),OUTLAND1,OUTLAND2) and isInArray(OutlandShinysName, doCorrectString(getCreatureName(cid))) then  --alterado v1.9 \/
               chance = 25    --2.5% chance  
            end    
            local sid = cid
            if math.random(1, 1000) <= chance then  
              doSendMagicEffect(getThingPos(cid), 18)               
              local name, pos = "Shiny ".. getCreatureName(cid), getThingPos(cid)
              if not pokes[name] then return true end
              doRemoveCreature(cid)
              --print(name .. ", " .. retireShinyName(name))
              local shi = doCreateMonsterNick(sid, name, retireShinyName(name), pos, false)          
           end  
    else 
                                                               
    return true
    end
end

 

 

xurupita360X
28 de julho de 2018 às 12:22

Não funcionou :/

CrypterC
29 de julho de 2018 às 14:09
Em 28/07/2018 em 12:22, xurupita360 disse:

Não funcionou :/

Configura as posição corretamente e poem uma rate alta pra dar respawn de shiny, difícil ñ funcionar

nociamN
29 de julho de 2018 às 14:18

nao sei mais se observar ele entra no if porque tem os mesmo pokemon nas tabelas e nao vai entrar no else?

 

if isInArray(shinysName, doCorrectString(getCreatureName(cid))) then --alterado v1.9 \/

chance = 12 --1.2% chance

elseif isInArea(getCreaturePosition(cid),OUTLAND1,OUTLAND2) and isInArray(OutlandShinysName doCorrectString(getCreatureName(cid))) then --alterado v1.9 \/

chance = 25 --2.5% chance

Editado Julho 29 por nociam

1 mês depois...
klein no arK
21 de agosto de 2018 às 14:09

Conseguiu colocar ?

1 ano depois...
KaboFlowK
08 de maio de 2020 às 12:24
Em 21/08/2018 em 12:09, klein no ar disse:

Conseguiu colocar ?

nao :S