Ir para conteúdo
  • 0

[Resolvido] [Ajuda] Erro Spawn.lua


Vini Original

Pergunta

Ola Amigos  do Xtibia, Estou com um erro e quem poder ajudar Agradeço..

 

Esse e o erro:

 

Xt.png.51947c91a626b5e08dda9dcf1f4837c7.png

 

 

Meu Spawn.lua

Citar

local shinys = {
"Venusaur", "Charizard", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Zubat", "Golbat", "Paras", "Parasect", 
"Venonat", "Venomoth", "Growlithe", "Arcanine", "Abra", "Alakazam", "Tentacool", "Tentacruel", "Farfetch'd", "Grimer", "Muk", "Gengar", "Onix", "Krabby", 
"Kingler", "Voltorb", "Electrode", "Cubone", "Marowak", "Hitmonlee", "Hitmonchan", "Tangela", "Horsea", "Seadra", "Scyther", "Jynx", "Electabuzz", "Pinsir", 
"Magikarp", "Gyarados", "Snorlax", "Dragonair", "Dratini", "Magmar", "Absol", "Chandelure", "Wobbuffet", "Tyranitar", "Gallade", "Treecko", "Emboar", "Serperior", "Weezing",
"Aerodactyl", "Golem", "Ninetales", "Fearow", "Hypno", "Vaporeon", "Typhlosion", "Staryu", "Miltank", "Exeggutor", "Kingdra", "Gloom", "Spiritomb", "Drapion", "Gardevoir", "Milotic",
"Roserade", "Clefable", "Flygon", "Tangrowth", "Vileplume", "Ariados", "Cradily", "Oddish", "Sceptile", "Lileep", "Tropius", "Gliscor", "Probopass", "Metagross", "Rhyperior", "Slaking",
"Chansey", "Lapras", "Lucario", "Blissey", "Steelix", "Togekiss", "Porygon", "Salamence", "Wigglytuff", "Shelgon", "Metang", "Beldum", "Aron", "Bagon", "Aggron", "Lairon", "Magby", "Dodrio",
"Stantler", "Umbreon", "Politoed", "Espeon", "Magneton", "Rhydon", "Nidoking", "Jolteon", "Flareon", "Gyarados", "Gyarados", "Hitmontop", "Caterpie", "Arbok"
}

local raros = {"Dragonite"}  
                             
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

local function doZorua(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 os.date("%X") >= "00:00:00" and os.date("%X") <= "03:00:00" then 
chance = 0.75 
elseif os.date("%X") >= "03:01:00" and os.date("%X") <= "05:00:00" then 
chance = 1.50 
elseif os.date("%X") >= "05:01:00" and os.date("%X") <= "07:00:00" then 
chance = 1 
elseif os.date("%X") >= "07:00:00" and os.date("%X") <= "12:00:00" then 
chance = 0.20 
elseif os.date("%X") >= "12:01:00" and os.date("%X") <= "16:00:00" then 
chance = 0.10 
elseif os.date("%X") >= "16:01:00" and os.date("%X") <= "18:00:00" then 
chance = 0.10 
elseif os.date("%X") >= "18:01:00" and os.date("%X") <= "20:00:00" then 
chance = 0.15 
elseif os.date("%X") >= "20:01:00" and os.date("%X") <= "22:00:00" then 
chance = 3
elseif os.date("%X") >= "22:01:00" and os.date("%X") <= "23:59:59" then 
chance = 0.30 
else 
hance = 0 
end 

local test = math.random(1,20000) 
if test <= chance*5 then 
doSendMagicEffect(getThingPos(cid), 18)      
local lvl = math.random(10, 30)     
local name, pos = "Zorua", getThingPos(cid) 
local shi = doCreateMonster(name, pos , false)      
doSetCreatureOutfit(shi, getCreatureOutfit(cid), -1) 
 doCreatureSetNick(shi, getCreatureName(cid)) 
 setPlayerStorageValue(shi, 1000, lvl) 
 doRemoveCreature(cid) 
 setPlayerStorageValue(shi, 74469, 1)     
 print("Um " .. name .. " foi spawnado em X=" .. pos.x .. " Y=" .. pos.y .. " Z=" .. pos.z)     
 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(doSetRandomGender, 5, cid)
    addEvent(doShiny, 10, cid)
    addEvent(doZorua, 10, cid)
    addEvent(adjustWildPoke, 5, cid)
return true
end

 

Editado por Vini Original
Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0
  • Diretor
A questão neste tópico de suporte foi respondida e/ou o autor do tópico resolveu o problema. Este tópico está fechado e foi movido para Suporte - Resolvidos. Se você tiver outras dúvidas, crie um novo tópico.
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...