Ir para conteúdo
  • Cadastre-se

Derivado Broadcast ao nascer um Shiny no mapa


Posts Recomendados

Gente gostaria de saber se alguem pode me ajudar, uma mensagem que aparece para todos no server falando que nasceu um shiny, tanto no mapa, tanto na Outland.

Ex: [Mensagem automatica]Nasceu um Shiny Magmar no mapa, temos que pegalo!

Se alguem puder me ajudar +rep

Link para o post
Compartilhar em outros sites

Se você já tem o script que faz nascer o Pokemon Shiny, no proprio script basta colocar essa linha:

doBroadcastMessage("Nasceu um Shiny Magmar no mapa, temos que pegalo!")
Link para o post
Compartilhar em outros sites
12 minutos atrás, Luis360 disse:

Se você já tem o script que faz nascer o Pokemon Shiny, no proprio script basta colocar essa linha:


doBroadcastMessage("Nasceu um Shiny Magmar no mapa, temos que pegalo!")

Mas no caso eu colocaria isso na spawn.lua ?? Lembrando que ñ é especificamente para o Sh Magmar, mas sim para qualquer Shiny.

Link para o post
Compartilhar em outros sites

A mensagem ali só coloquei de exemplo, poderia colocar uma mensagem indicando que nasceu um shiny assim abrange todos, sim seria no spawn.lua, caso tenha outro arquivo.lua que faz nascer shiny coloque em outro, se é o spawn.lua que faz nascer o shiny, coloque nele.

Editado por Luis360 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
14 minutos atrás, Luis360 disse:

A mensagem ali só coloquei de exemplo, poderia colocar uma mensagem indicando que nasceu um shiny assim abrange todos, sim seria no spawn.lua, caso tenha outro arquivo.lua que faz nascer shiny coloque em outro, se é o spawn.lua que faz nascer o shiny, coloque nele.

 

Colocaria em qual parte para ser mais exato ? Obrigado você esta ajudando bastante :)

spawn.lua

Segue meu SPAWN.LUA>>>>

 

local shinys = {
"Venusaur", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Farfetch'd", "Gengar", "Krabby", "Tauros",
"Kingler", "Cubone", "Horsea", "Seadra", "Weezing", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Meganium", "Alakazam", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode"}
 
local raros = {"Dragonair", "Dratini", "Giant Magikarp", "Gyarados", "Magmortar", "Electivire", "Salamence", "Mantine"}  
local specialSummon = {
    chance = 0.5,                                                 --Chance, em porcentagem, do pokémon especial nascer.
    pokes = {
        {"Shiny Alakazam", "Shiny Arcanine", "Shiny Ampharos", "Shiny Ariados", "Shiny Blastoise", "Shiny Charizard", "Shiny Venusaur", "Shiny Crobat", "Shiny Cubone", "Shiny Marowak", "Shiny Zubat", "Shiny Golbat", "Shiny Salamence", "Shiny Gyarados", "Shiny Tentacruel", "Shiny Raichu", "Shiny Dratini", "Shiny Dragonair", "Shiny Feraligatr", "Shiny Grimer", "Shiny Muk", "Shiny Jynx", "Shiny Machamp", "Shiny Magcargo", "Shiny Magmar", "Shiny Ninetales", "Shiny Tangela", "Shiny Electrode"},    --Pokémons que podem ser summonados.
        {"Ancient Alakazam", "Ancient Dragonite", "Ancient Meganium", "Ancient Onix", "Ancient Scyther", "Ancient Snorlax", "Aviator Pidgeot", "Banshee Misdreavus", "Bone Marowak", "Boxer Hitmonchan", "Brave Blastoise", "Brave Charizard", "Brave Nidoking", "Brave Nidoqueen", "Brave Noctwol", "Brave Venusaur", "Brute Farfetch'd", "Brute Rhydon", "Brute Ursaring", "Capoeira Hitmontop", "Charged Raichu", "Dark Crobat", "Dragon Machamp", "Elder Arcanine", "Elder Blastoise", "Elder Charizard", "Elder Electabuzz", "Elder Gengar", "Elder Jynx", "Elder Marowak", "Elder Muk", "Elder Pidgeot", "Elder Pinsir", "Elder Tangela", "Elder Raichu", "Elder Tentacruel", "Elder Tyranitar", "Enigmatic Girafarig", "Enraged Typhlosion", "Evil Cloyster", "Freezing Dewgong", "Furios Ampharos", "Furios Mantine", "Furios Murkrow", "Furious Sandslash", "Furious Scyther", "Gordo Snorlax", "Hard Golem", "Heavy Piloswine", "Iron Steelix", "Lava Magmar", "Iron Steelix", "Milch-Miltank", "Milch-Miltank", "Roll Donphan", "Tribal Feraligatr", "Tribal Xatu", "War Heracross", "Ancient Kingdra", "Hard Rhydon"},   --Pokémons que, quando spawnados, há chance de summonar um dos pokémons acima.
    },
}
 
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, newName)
            if isMonster(cid) then
                doSetCreatureDropLoot(cid, false)  
            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 == 500 then
        gender = 4
    elseif rate == -1 then
        gender = 0
    elseif math.random(1, 500) <= 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 = 1.0    --1% chance        
        elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
            chance = 0.5   --1% chance       
        else
            return true
        end    
        if math.random(1, 500) <= 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(function()
        if isCreature(cid) then
            if isInArray(specialSummon.pokes[2], getCreatureName(cid)) then
                if math.random(1, 100) <= specialSummon.chance then
                    local position = getThingPos(cid)
                    doRemoveCreature(cid)
                    doCreateMonster(specialSummon.pokes[1][math.random(#specialSummon.pokes[1])], position)
                end
            end
        end
    end, 15)       
    addEvent(doShiny, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)
 
    return true
end

Editado por Theodorojose (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

@Theodorojose

 

Ve se Funciona!

 

local shinys = {
"Venusaur", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Farfetch'd", "Gengar", "Krabby", "Tauros",
"Kingler", "Cubone", "Horsea", "Seadra", "Weezing", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Meganium", "Alakazam", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode"}
 
local raros = {"Dragonair", "Dratini", "Giant Magikarp", "Gyarados", "Magmortar", "Electivire", "Salamence", "Mantine"}  
local specialSummon = {
    chance = 0.5,                                                 --Chance, em porcentagem, do pokémon especial nascer.
    pokes = {
        {"Shiny Alakazam", "Shiny Arcanine", "Shiny Ampharos", "Shiny Ariados", "Shiny Blastoise", "Shiny Charizard", "Shiny Venusaur", "Shiny Crobat", "Shiny Cubone", "Shiny Marowak", "Shiny Zubat", "Shiny Golbat", "Shiny Salamence", "Shiny Gyarados", "Shiny Tentacruel", "Shiny Raichu", "Shiny Dratini", "Shiny Dragonair", "Shiny Feraligatr", "Shiny Grimer", "Shiny Muk", "Shiny Jynx", "Shiny Machamp", "Shiny Magcargo", "Shiny Magmar", "Shiny Ninetales", "Shiny Tangela", "Shiny Electrode"},    --Pokémons que podem ser summonados.
        {"Ancient Alakazam", "Ancient Dragonite", "Ancient Meganium", "Ancient Onix", "Ancient Scyther", "Ancient Snorlax", "Aviator Pidgeot", "Banshee Misdreavus", "Bone Marowak", "Boxer Hitmonchan", "Brave Blastoise", "Brave Charizard", "Brave Nidoking", "Brave Nidoqueen", "Brave Noctwol", "Brave Venusaur", "Brute Farfetch'd", "Brute Rhydon", "Brute Ursaring", "Capoeira Hitmontop", "Charged Raichu", "Dark Crobat", "Dragon Machamp", "Elder Arcanine", "Elder Blastoise", "Elder Charizard", "Elder Electabuzz", "Elder Gengar", "Elder Jynx", "Elder Marowak", "Elder Muk", "Elder Pidgeot", "Elder Pinsir", "Elder Tangela", "Elder Raichu", "Elder Tentacruel", "Elder Tyranitar", "Enigmatic Girafarig", "Enraged Typhlosion", "Evil Cloyster", "Freezing Dewgong", "Furios Ampharos", "Furios Mantine", "Furios Murkrow", "Furious Sandslash", "Furious Scyther", "Gordo Snorlax", "Hard Golem", "Heavy Piloswine", "Iron Steelix", "Lava Magmar", "Iron Steelix", "Milch-Miltank", "Milch-Miltank", "Roll Donphan", "Tribal Feraligatr", "Tribal Xatu", "War Heracross", "Ancient Kingdra", "Hard Rhydon"},   --Pokémons que, quando spawnados, há chance de summonar um dos pokémons acima.
    },
}
 
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, newName)
            if isMonster(cid) then
                doSetCreatureDropLoot(cid, false)  
            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 == 500 then
        gender = 4
    elseif rate == -1 then
        gender = 0
    elseif math.random(1, 500) <= 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 = 1.0    --1% chance        
        elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
            chance = 0.5   --1% chance       
        else
            return true
        end    
        if math.random(1, 500) <= chance*10 then  
            doSendMagicEffect(getThingPos(cid), 18)               
            local name, pos = "Shiny ".. getCreatureName(cid), getThingPos(cid)
            doRemoveCreature(cid)
            doBroadcastMessage("Nasceu um "..name.." no mapa, temos que pegalo!")
            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(function()
        if isCreature(cid) then
            if isInArray(specialSummon.pokes[2], getCreatureName(cid)) then
                if math.random(1, 100) <= specialSummon.chance then
                    local position = getThingPos(cid)
                    doRemoveCreature(cid)
                    local w = specialSummon.pokes[1][math.random(#specialSummon.pokes[1])]
                    doCreateMonster(w, position)
                    doBroadcastMessage("Nasceu um "..w.." no mapa, temos que pegalo!")
                end
            end
        end
    end, 15)       
    addEvent(doShiny, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)
 
    return true
end

 

Link para o post
Compartilhar em outros sites

Funcionou perfeitamente, muito obrigado pela ajuda de vocês dois. REP +

Mas uma ultima duvida, para alternar a mensagem quando nasce um shiny no mapa normal e quando nasce na outland, basta acrescentar esse codigo aonde ?

Link para o post
Compartilhar em outros sites

@Theodorojose 

 

doBroadcastMessage("Nasceu um "..w.." no mapa, temos que pegalo!")

 

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por LeoTK
      Salve galera neste tópico irei postar algumas prints do mapa do servidor para quem queira acompanhar e quem sabe até utilizar de inspiração para mapear o seu NTO.
       
      #Att 11/08/2022

       
       
       
       
      Konoha (Em Desenvolvimento)
       
       
       
       
    • Por DiigooMix
      Como o título já diz, será que alguém possui sprite do hitto e se possível as transformações dele?
    • Por OmegaZero
      Olá gostaria que alguém me ajudasse com uma "scripting" não sei se é pela mesma, seria o seguinte uma determinada arma teria a chance de dar double hit e não sei oque fazer alguem poderia ajudar?

      OBS:não sei se é o local correto se não for mova, desculpe
    • Por Madarasenju
      Olá galera do Tibia King, queria por uns npc's no meu server que não tem função de trade nem nada do tipo, queria que eles só andassem como enfeite, Rep+ Pra quem me ajudar... grato desde já.
    • Por SilenceRoot
      A magia é assim o você usa a a magia e ela ficará ativado por 10 segundos, até que o inimigo lance a primeira magia ou todos de uma vez, quando ele lançar a primeira magia, ele não lhe acertará ou seja esquivando dela, e logo em seguida será teletransportado aleatoriamente ao redor do inimigo que usou.
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo