Ir para conteúdo
  • Cadastre-se

Derivado [Ajuda]Erro na distrito de pokemon


Posts Recomendados

Queria saber como resolver este bug que está na distro, e tá largando demais o servidor... Por favor, ajudem. Serei muito grato a quem puder ^^

 


[15/05/2016 04:13:56] [Error - CreatureScript Interface] 
[15/05/2016 04:13:56] In a timer event called from: 
[15/05/2016 04:13:56] data/creaturescripts/scripts/spawn.lua:onSpawn
[15/05/2016 04:13:56] Description: 
[15/05/2016 04:13:56] (luaDoCreatureSetStorage) Creature not found

Link para o post
Compartilhar em outros sites

local shinys = {
"Oddish"}
local raros = {"Dragonite"}    

function isNpcSummon(cid)
return isNpc(getCreatureMaster(cid))
end

local function doShiny(cid)
if isCreature(cid) then
   if isSummon(cid) then return true end
   if isNpcSummon(cid) then return true end
   
if isInArray(shinys, getCreatureName(cid)) then
   chance = 100    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then 
   chance = 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 doSetRandomGender(cid)
    if not isCreature(cid) then return true end
    if isSummon(cid) then return true end
    local gender = 0
    local rate = 70
        if getCreatureName(cid) == "Nidoran Male" then
            gender = 4
        elseif getCreatureName(cid) == "Nidoran Female" then
            gender = 3
        elseif getCreatureName(cid) == "Dragonite" then
            gender = 0
        elseif getCreatureName(cid) == "Magneton" then
            gender = 0
        else
            if rate == 0 then
                gender = 3
            elseif rate == 100 then
                gender = 4
            elseif rate == -1 then
                gender = 0
            elseif math.random(1, 100) <= rate then
                gender = 4
            else
                gender = 3
            end
        end
    doCreatureSetSkullType(cid, gender)
end

local function ShinyName(cid)
if isCreature(cid) then
   if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("Shiny (.*)")             
      doUpdateNick(cid, newName)
   end
end
end

function setPokemonWildStatus(cid)
    if isMonster(cid) and pokes[getCreatureName(cid)] then
        local plvl = 0
        local b = getCreatureOutfit(cid).lookBody
        local lvl = pokes[getCreatureName(cid)].level
        local maxh = (pokes[getCreatureName(cid)].cons * lvl)
        setCreatureMaxHealth(cid, (maxh +pokes[getCreatureName(cid)].vida))
        doCreatureAddHealth(cid,  getCreatureMaxHealth(cid))
    end
return true
end

function onSpawn(cid)
    registerCreatureEvent(cid, "Exp")

    if isSummon(cid) then
        registerCreatureEvent(cid, "DiePoke")
        if not getItemAttribute(getPlayerSlotItem(getCreatureMaster(cid), CONST_SLOT_FEET).uid, "ExpLevel") then
            doItemSetAttribute(getPlayerSlotItem(getCreatureMaster(cid), CONST_SLOT_FEET).uid, "ExpLevel", 1)
        end
    return true
    end
    
    if not isPlayer(cid) and not isSummon(cid) then
        registerCreatureEvent(cid, "Aloot")
        if pokes[getCreatureName(cid)] then
            setPlayerStorageValue(cid, 993615, pokes[getCreatureName(cid)].level)
        end
        --addEvent(setPokemonWildStatus, 5, cid)
    end
    
    addEvent(doSetRandomGender, 5, cid)
    addEvent(doShiny, 10, cid)
    addEvent(ShinyName, 15, cid)
    
return true
end
 

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