Spawn Aleatorio de Megas (Igual os Shinys)

fhoenix00
em Scripts
  • 1
  • 2

fhoenix00

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 03/04/13Posts: 29

Galera Seguinte, Queria adicionar um Spawn aleatorio de pokemons megas no meu servidor...

Tentei fazer de um jeito que vi aqui no forum só que bugou tudo meu server, os ataques em area dos pokemons selvagens começaram a acertar os outros selvagens...

 

Este é meu Spawn.lua

 

Spoiler
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", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}                               

local function ShinyName(cid)
if isCreature(cid) then
   if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("(.*)")          
      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 = 2
        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 = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --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(doShiny, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

 

 

Pf ajudem ai Rep+++

Benny

nvr gv p
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 22/12/12Posts: 1958Gênero: MasculinoChar no Tibia: Marley
local megas = {"Venusaur", "Blastoise"} 
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", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}                               

local function ShinyName(cid)
if isCreature(cid) then
   if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("(.*)")          
      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 = 2
        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 = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --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

local function doMega(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(megas, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 100.0    --1% chance        
   return true
end    
    if math.random(1, 500) <= chance*10 then  
      doSendMagicEffect(getThingPos(cid), 18)               
      local name, pos = "Mega ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

 

Não tenho certeza se vai funcionar, mas testa aí. Adiciona ali os mega que tem. Tá com 100% de chance de spawnar só pra testar, dps vc coloca a chance que vc quiser ai.

Atenção: Siga o prefixo de postagem, primeiro aviso.

 

?

 

fhoenix00

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 03/04/13Posts: 29
14 minutos atrás, bXnny disse:
local megas = {"Venusaur", "Blastoise"} 
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", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}                               

local function ShinyName(cid)
if isCreature(cid) then
   if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("(.*)")          
      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 = 2
        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 = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --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

local function doMega(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(megas, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 100.0    --1% chance        
   return true
end    
    if math.random(1, 500) <= chance*10 then  
      doSendMagicEffect(getThingPos(cid), 18)               
      local name, pos = "Mega ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

 

Não tenho certeza se vai funcionar, mas testa aí. Adiciona ali os mega que tem. Tá com 100% de chance de spawnar só pra testar, dps vc coloca a chance que vc quiser ai.

Atenção: Siga o prefixo de postagem, primeiro aviso.

 

13 minutos atrás, bXnny disse:
local megas = {"Venusaur", "Blastoise"} 
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", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}                               

local function ShinyName(cid)
if isCreature(cid) then
   if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("(.*)")          
      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 = 2
        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 = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --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

local function doMega(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(megas, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 100.0    --1% chance        
   return true
end    
    if math.random(1, 500) <= chance*10 then  
      doSendMagicEffect(getThingPos(cid), 18)               
      local name, pos = "Mega ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

 

Não tenho certeza se vai funcionar, mas testa aí. Adiciona ali os mega que tem. Tá com 100% de chance de spawnar só pra testar, dps vc coloca a chance que vc quiser ai.

Atenção: Siga o prefixo de postagem, primeiro aviso.

 

Amigo eu testei aqui... Infelizmente não funcionou e ainda apareceu esse erro na distro: 

 

[Error - CreatureScript Interface]
In a timer event called from:
data/creaturescripts/scripts/spawn.lua:onSpawn
Description:
data/creaturescripts/scripts/spawn.lua:82: attempt to perform arithmetic on global 'chance' (a nil value)
stack traceback:
        data/creaturescripts/scripts/spawn.lua:82: in function <data/creaturescripts/scripts/spawn.lua:70>

Benny

nvr gv p
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 22/12/12Posts: 1958Gênero: MasculinoChar no Tibia: Marley

Erro meu

local megas = {"Venusaur", "Blastoise"} 
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", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}                               

local function ShinyName(cid)
if isCreature(cid) then
   if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("(.*)")          
      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 = 2
        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 = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --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

local function doMega(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(megas, getCreatureName(cid)) then  --alterado v1.9 \/
   local chancemega = 100.0    --1% chance        
   return true
end    
    if math.random(1, 500) <= chancemega*10 then  
      doSendMagicEffect(getThingPos(cid), 18)               
      local name, pos = "Mega ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

 

?

 

fhoenix00

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 03/04/13Posts: 29
9 minutos atrás, bXnny disse:

Erro meu

local megas = {"Venusaur", "Blastoise"} 
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", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}                               

local function ShinyName(cid)
if isCreature(cid) then
   if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("(.*)")          
      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 = 2
        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 = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --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

local function doMega(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(megas, getCreatureName(cid)) then  --alterado v1.9 \/
   local chancemega = 100.0    --1% chance        
   return true
end    
    if math.random(1, 500) <= chancemega*10 then  
      doSendMagicEffect(getThingPos(cid), 18)               
      local name, pos = "Mega ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

começou a dar esse erro sem parar! 

image.png
127.12 KB1 downloads

 

Refe

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/07/10Posts: 645Gênero: Masculino

Manda seu creaturescripts.xml

Contato:

 

 

Email: contato@ceetros.com

Discord: Ceetros#5376

Telegram: @ceetros

 

 

Benny

nvr gv p
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 22/12/12Posts: 1958Gênero: MasculinoChar no Tibia: Marley
local megas = {"Venusaur", "Blastoise"}
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", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

  local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}

  local function ShinyName(cid)
    if isCreature(cid) then
      if string.find(tostring(getCreatureName(cid)), "Shiny") then
        local newName = tostring(getCreatureName(cid)):match("(.*)")
        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 = 2
    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 = 10.0    --1% chance
      elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
        chance = 5.8   --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

  local function doMega(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(megas, getCreatureName(cid)) then  --alterado v1.9 \/
        local chancemega = 100.0    --1% chance
        return true
      end
      if math.random(1, 500) <= chancemega*10 then
        doSendMagicEffect(getThingPos(cid), 18)
        local name, pos = "Mega ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

    return true
  end

 

Cara, tá achando um caractere que nem tem no script.
Copia do jeito que tá e na hora de jogar no notepad++ da um ctr+a e seleciona essa opção: 

image.png

?

 

fhoenix00

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 03/04/13Posts: 29
16 minutos atrás, bXnny disse:
local megas = {"Venusaur", "Blastoise"}
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", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

  local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}

  local function ShinyName(cid)
    if isCreature(cid) then
      if string.find(tostring(getCreatureName(cid)), "Shiny") then
        local newName = tostring(getCreatureName(cid)):match("(.*)")
        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 = 2
    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 = 10.0    --1% chance
      elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
        chance = 5.8   --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

  local function doMega(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(megas, getCreatureName(cid)) then  --alterado v1.9 \/
        local chancemega = 100.0    --1% chance
        return true
      end
      if math.random(1, 500) <= chancemega*10 then
        doSendMagicEffect(getThingPos(cid), 18)
        local name, pos = "Mega ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

    return true
  end

 

Cara, tá achando um caractere que nem tem no script.
Copia do jeito que tá e na hora de jogar no notepad++ da um ctr+a e seleciona essa opção: 

image.png

 

Nada ainda :( 

 

image.thumb.png.c80b851b3790f318e68939f3146e4eda.png

19 minutos atrás, Refe disse:

Manda seu creaturescripts.xml

<?xml version="1.0" encoding="UTF-8"?>

<creaturescripts>


    
     <event type="joinchannel" name="ShowPokedex" event="script" value="newpokedex.lua"/>
    <event type="leavechannel" name="ClosePokedex" event="script" value="newpokedex.lua"/>
    <event type="kill" name="pokemons" event="script" value="bosses.lua"/>
    <event type="login" name="aloot_reg" event="script" value="aloot.lua"/>
    <event type="kill" name="aloot_kill" event="script" value="aloot.lua"/>
    <event type="kill" name="dropStone" script="dropStone.lua"/>
    <event type="login" name="PlayerLogin" event="script" value="login.lua"/>
     <event type="login" name="AntiMc" event="script" value="antimc.lua"/>
    <event type="kill" name="ExpBonus" event="script" value="exp.lua"/>
    <event type="login" name="ExpVip" event="script" value="vipexp.lua"/>    
    <event type="logout" name="flylogoutno" registerTo="player" event="script" value="Flylogout.lua"/>
    <event type="logout" name="surflogoutno" registerTo="player" event="script" value="Surflogout.lua"/>
    <event type="logout" name="ridelogoutno" registerTo="player" event="script" value="Ridelogout.lua"/>


        <event type="death" name="ArticunoTeleport" script="tparticuno.lua"/>

       <event type="death" name="tel" event="script" value="tel.lua"/>

    <event type="receivemail" name="Mail" event="script" value="mail.lua"/>

    <event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
    
    <event type="think" name="Idle" event="script" value="idle.lua"/>


    <event type="death" name="Experience" event="script" value="pokeexp.lua"/>

    <event type="spawn" name="Spawn" event="script" value="spawn.lua"/>

    <event type="think" name="t" event="script" value="wildpoke.lua"/>

    <event type="think" name="PokemonIdle" event="script" value="poketele.lua"/>

    <event type="statschange" name="GeneralConfiguration" event="script" value="exp2.0.lua"/>
    <event type="advance" name="EffectOnAdvance" event="script" value="levelup.lua"/>


    <event type="direction" name="DirectionSystem" event="script" value="wildpoke.lua"/>
    <event type="attack" name="AttackSystem" event="script" value="wildpoke.lua"/>
    <event type="cast" name="CastSystem" event="script" value="wildpoke.lua"/>
    <event type="target" name="WildAttack" event="script" value="playerattack.lua"/>
    <event type="death" name="tp1" event="script" value="Tp-Celebi.lua"/>
    <event type="death" name="tp2" event="script" value="Tp-Heatran.lua"/>
    <event type="death" name="tp3" event="script" value="Tp-Keldeo.lua"/>
    <event type="death" name="tp4" event="script" value="Tp-Zekrom.lua"/>
    <event type="death" name="tp5" event="script" value="Tp-Giratina.lua"/>
    <event type="death" name="tp6" event="script" value="Tp-Arceus.lua"/>
    <event type="death" name="tp7" event="script" value="Tp-Cresselia.lua"/>    
    <event type="death" name="tp8" event="script" value="Tp-Terrakion.lua"/>
    <event type="death" name="tp9" event="script" value="Tp-Ho-oh.lua"/>    
    <event type="death" name="tp10" event="script" value="Tp-Cobalion.lua"/>
    <event type="death" name="tp11" event="script" value="Tp-Reshiram.lua"/>
    <event type="death" name="tp12" event="script" value="Tp-Genesect.lua"/>    


    <event type="look" name="LookSystem" event="script" value="look.lua"/>


    <event type="death" name="SummonDeath" event="script" value="goback.lua"/>
    <event type="logout" name="PlayerLogout" event="script" value="goback.lua"/>


    <event type="traderequest" name="T2" event="script" value="trade system.lua"/>

    <event type="tradeaccept" name="T1" event="script" value="trade system.lua"/>
    
    
</creaturescripts>
 

Ta ai 

Refe

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/07/10Posts: 645Gênero: Masculino
2 minutos atrás, fhoenix00 disse:

 

Nada ainda :( 

 

image.thumb.png.c80b851b3790f318e68939f3146e4eda.png

<?xml version="1.0" encoding="UTF-8"?>

<creaturescripts>


    
     <event type="joinchannel" name="ShowPokedex" event="script" value="newpokedex.lua"/>
    <event type="leavechannel" name="ClosePokedex" event="script" value="newpokedex.lua"/>
    <event type="kill" name="pokemons" event="script" value="bosses.lua"/>
    <event type="login" name="aloot_reg" event="script" value="aloot.lua"/>
    <event type="kill" name="aloot_kill" event="script" value="aloot.lua"/>
    <event type="kill" name="dropStone" script="dropStone.lua"/>
    <event type="login" name="PlayerLogin" event="script" value="login.lua"/>
     <event type="login" name="AntiMc" event="script" value="antimc.lua"/>
    <event type="kill" name="ExpBonus" event="script" value="exp.lua"/>
    <event type="login" name="ExpVip" event="script" value="vipexp.lua"/>    
    <event type="logout" name="flylogoutno" registerTo="player" event="script" value="Flylogout.lua"/>
    <event type="logout" name="surflogoutno" registerTo="player" event="script" value="Surflogout.lua"/>
    <event type="logout" name="ridelogoutno" registerTo="player" event="script" value="Ridelogout.lua"/>


        <event type="death" name="ArticunoTeleport" script="tparticuno.lua"/>

       <event type="death" name="tel" event="script" value="tel.lua"/>

    <event type="receivemail" name="Mail" event="script" value="mail.lua"/>

    <event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
    
    <event type="think" name="Idle" event="script" value="idle.lua"/>


    <event type="death" name="Experience" event="script" value="pokeexp.lua"/>

    <event type="spawn" name="Spawn" event="script" value="spawn.lua"/>

    <event type="think" name="t" event="script" value="wildpoke.lua"/>

    <event type="think" name="PokemonIdle" event="script" value="poketele.lua"/>

    <event type="statschange" name="GeneralConfiguration" event="script" value="exp2.0.lua"/>
    <event type="advance" name="EffectOnAdvance" event="script" value="levelup.lua"/>


    <event type="direction" name="DirectionSystem" event="script" value="wildpoke.lua"/>
    <event type="attack" name="AttackSystem" event="script" value="wildpoke.lua"/>
    <event type="cast" name="CastSystem" event="script" value="wildpoke.lua"/>
    <event type="target" name="WildAttack" event="script" value="playerattack.lua"/>
    <event type="death" name="tp1" event="script" value="Tp-Celebi.lua"/>
    <event type="death" name="tp2" event="script" value="Tp-Heatran.lua"/>
    <event type="death" name="tp3" event="script" value="Tp-Keldeo.lua"/>
    <event type="death" name="tp4" event="script" value="Tp-Zekrom.lua"/>
    <event type="death" name="tp5" event="script" value="Tp-Giratina.lua"/>
    <event type="death" name="tp6" event="script" value="Tp-Arceus.lua"/>
    <event type="death" name="tp7" event="script" value="Tp-Cresselia.lua"/>    
    <event type="death" name="tp8" event="script" value="Tp-Terrakion.lua"/>
    <event type="death" name="tp9" event="script" value="Tp-Ho-oh.lua"/>    
    <event type="death" name="tp10" event="script" value="Tp-Cobalion.lua"/>
    <event type="death" name="tp11" event="script" value="Tp-Reshiram.lua"/>
    <event type="death" name="tp12" event="script" value="Tp-Genesect.lua"/>    


    <event type="look" name="LookSystem" event="script" value="look.lua"/>


    <event type="death" name="SummonDeath" event="script" value="goback.lua"/>
    <event type="logout" name="PlayerLogout" event="script" value="goback.lua"/>


    <event type="traderequest" name="T2" event="script" value="trade system.lua"/>

    <event type="tradeaccept" name="T1" event="script" value="trade system.lua"/>
    
    
</creaturescripts>
 

Ta ai 

Utilize a opção image.png para postar seus códigos, por favor.

Contato:

 

 

Email: contato@ceetros.com

Discord: Ceetros#5376

Telegram: @ceetros

 

 

Kooask

Aprendendo Lua
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 06/10/12Posts: 80Char no Tibia: Lian Colbert

@UP

 

Fui testar o script e no meu server ta dando isso .. 

[24/02/2019 07:52:56] >> Cargando scripts
[24/02/2019 07:52:58] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/spawn.lua:115: unexpected symbol near 'ï'
[24/02/2019 07:52:58] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/spawn.lua)
[24/02/2019 07:52:58] data/creaturescripts/scripts/spawn.lua:115: unexpected symbol near 'ï'
[24/02/2019 07:52:58] >> Cargando chat channels

Esse "symbol near 'i' " aparecia quando eu editava os .lua por bloco de notas, comecei a abrir em Notepad ++ e tinha parado de dar esse error, provavelmente era a formatação do bloco de notas. Mas mesmo no Notepad ++ ta dando esse error, mesmo formatando para ANSI como você @bXnny sugeriu .

❝Eu prefiro confiar e me arrepender do que duvidar e me arrepender.❞

Kirito-Kun

Refe

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/07/10Posts: 645Gênero: Masculino
4 horas atrás, Kooask disse:

@UP

 

Fui testar o script e no meu server ta dando isso .. 

[24/02/2019 07:52:56] >> Cargando scripts
[24/02/2019 07:52:58] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/spawn.lua:115: unexpected symbol near 'ï'
[24/02/2019 07:52:58] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/spawn.lua)
[24/02/2019 07:52:58] data/creaturescripts/scripts/spawn.lua:115: unexpected symbol near 'ï'
[24/02/2019 07:52:58] >> Cargando chat channels

Esse "symbol near 'i' " aparecia quando eu editava os .lua por bloco de notas, comecei a abrir em Notepad ++ e tinha parado de dar esse error, provavelmente era a formatação do bloco de notas. Mas mesmo no Notepad ++ ta dando esse error, mesmo formatando para ANSI como você @bXnny sugeriu .

Me envia a linha 115

Contato:

 

 

Email: contato@ceetros.com

Discord: Ceetros#5376

Telegram: @ceetros

 

 

Kooask

Aprendendo Lua
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 06/10/12Posts: 80Char no Tibia: Lian Colbert
2 horas atrás, Refe disse:

Me envia a linha 115

Foi falta de curiosidade minha não olhar a linha 115 ... Ela estava assim   

Citar

end

 O problema que deu agora foi exatamente onde o guri ali tinha falado 

 

Citar

  local function doMega(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(megas, getCreatureName(cid)) then  --alterado v1.9 \/
        local chancemega = 100.0    --1% chance                 
        return true
      end
      if math.random(1, 500) <= chancemega*10 then
        doSendMagicEffect(getThingPos(cid), 18)
        local name, pos = "Mega ".. 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

 O problema ta vindo dessa linha 79 e 82 que coloquei em Amarelo. No executável fica mostrando error nesse 'chancemega'

❝Eu prefiro confiar e me arrepender do que duvidar e me arrepender.❞

Kirito-Kun

Marshmello

Alone ~ [✖‿✖]
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 21/04/16Posts: 831Gênero: Masculino

@fhoenix00 Teste

 

Spoiler

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", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}                               

local Mega = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}            -- pokes megas aqui                   


local function ShinyName(cid)
if isCreature(cid) then
   if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("(.*)")          
      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 = 2
        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 = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --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


local function doMega(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(Mega, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --1% chance       
else
   return true
end    
    if math.random(1, 500) <= chance*10 then  
      doSendMagicEffect(getThingPos(cid), 18)               
      local name, pos = "Megas ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

 

placa1.png.90a184502351cebe72cd7b69751e551d.png

Meu Facebook

INFOS:

Citar

CIDADE: Rio de janeiro

Idade: 22 anos
SOU: {"Scripter(lua)", "WebMaster", "ProgramadorC++"}
 

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}
if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end

 

 

 

fhoenix00

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 03/04/13Posts: 29
Em 26/02/2019 em 11:33, Marshmello disse:

@fhoenix00 Teste

 

  Ocultar conteúdo

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", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}                               

local Mega = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}            -- pokes megas aqui                   


local function ShinyName(cid)
if isCreature(cid) then
   if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("(.*)")          
      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 = 2
        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 = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --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


local function doMega(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(Mega, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --1% chance       
else
   return true
end    
    if math.random(1, 500) <= chance*10 then  
      doSendMagicEffect(getThingPos(cid), 18)               
      local name, pos = "Megas ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

 

ok vou testar, qualquer coisa eu aviso

Acabei de testar aqui e não funcionou :/

Kooask

Aprendendo Lua
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 06/10/12Posts: 80Char no Tibia: Lian Colbert

@UP

❝Eu prefiro confiar e me arrepender do que duvidar e me arrepender.❞

Kirito-Kun

  • 1
  • 2