Ir para conteúdo
  • 0

Shiny Aleatório na Outland


xurupita360

Pergunta

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 por xurupita360
Link para o comentário
Compartilhar em outros sites

6 respostass a esta questão

Posts Recomendados

  • 0

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

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

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 por nociam
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...