Ir para conteúdo

[Encerrado] [PEDIDO] BUG GO/BACK DERRUBANDO SERVIDOR POKEMON


kbpaulo

Posts Recomendados

O ERRO E QUE QUANDO PLAYER TENTA USAR 1 DIGIMON CUJO A POKEBOLA BUGOU DA ESSE ERRO.

[17/08/2013 15:11:01] [Error - Action Interface]
[17/08/2013 15:11:01] data/actions/scripts/goback.lua:onUse
[17/08/2013 15:11:01] Description:
[17/08/2013 15:11:01] data/actions/scripts/goback.lua:74: attempt to compare nil with number
[17/08/2013 15:11:01] stack traceback:
[17/08/2013 15:11:01] data/actions/scripts/goback.lua:74: in function <data/actions/scripts/goback.lua:19>

SE ALGUEM PUDER AJUDA AGRADEÇO

Link para o comentário
Compartilhar em outros sites

 

 

local hitmonchans = {
["Hitmonchan"] = {
                         [0] = {out = 559, eff = 112, type = FIGHTINGDAMAGE},  --outfit normal
                         [1] = {out = 1075, eff = 35, type = FIREDAMAGE},    --outfit fogo
                         [2] = {out = 1077, eff = 48, type = ELECTRICDAMAGE},    --outfit raio
                         [3] = {out = 1078, eff = 43, type = ICEDAMAGE},    --outfit gelo
                         [4] = {out = 1076, eff = 140, type = GHOSTDAMAGE}   --outfit ghost
                  },
                  
["Shiny Hitmonchan"] = {              
                         --aconcelho trocar a outfit do shiny hitmonchan pela do elite hitmonchan do PO...
                         [0] = {out = 837, eff = 112, type = FIGHTINGDAMAGE},  --outfit normal
                         [1] = {out = 1080, eff = 35, type = FIREDAMAGE},    --outfit fogo
                         [2] = {out = 1081, eff = 48, type = ELECTRICDAMAGE},    --outfit raio
                         [3] = {out = 1082, eff = 43, type = ICEDAMAGE},    --outfit gelo
                         [4] = {out = 1079, eff = 140, type = GHOSTDAMAGE}   --outfit ghost
                       }
}
function onUse(cid, item, frompos, item2, topos)

    if exhaustion.get(cid, 6666) and exhaustion.get(cid, 6666) > 0 then return true end

    local owner = getItemAttribute(item.uid, "firstpoke")

    if owner and owner ~= getCreatureName(cid) then
        doPlayerSendCancel(cid, "This pokemon belongs to "..owner..", it is his first pokemon. Please, give it back to him.")
    return true
    end

if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 then
return true
end

local btype = getPokeballType(item.itemid)

local effect = pokeballs[btype].effect
    if not effect then
        effect = 21
    end

if item.itemid == pokeballs[btype].use then

    if getPlayerStorageValue(cid, 990) == 1 then -- GYM
        doPlayerSendCancel(cid, "You can't return your pokemon during gym battles.")
    return true
    end

    if #getCreatureSummons(cid) <= 0 then
        if isInArray(pokeballs[btype].all, item.itemid) then
            doTransformItem(item.uid, pokeballs[btype].off)
            doItemSetAttribute(item.uid, "hp", 0)
            doPlayerSendCancel(cid, "Seu pokemon Morreu.")
        return true
        end
    end

    local z = getCreatureSummons(cid)[1]

    if getCreatureCondition(z, CONDITION_INVISIBLE) and not isGhostPokemon(z) then
    return true
    end

    doReturnPokemon(cid, z, item, effect)

elseif item.itemid == pokeballs[btype].on then

    if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
        doPlayerSendCancel(cid, "You must put your Digivace in the correct place!")
    return TRUE
    end

    local thishp = getItemAttribute(item.uid, "hp")

    if thishp <= 1 then
        if isInArray(pokeballs[btype].all, item.itemid) then
            doTransformItem(item.uid, pokeballs[btype].off)
            doItemSetAttribute(item.uid, "hp", 1)
            doPlayerSendCancel(cid, "Seu pokemon Morreu.")
        return true
        end
    end

    local pokemon = getItemAttribute(item.uid, "poke")

    if not pokes[pokemon] then
    return true
    end

    local x = pokes[pokemon]
    local boosts = getItemAttribute(item.uid, "boost") or 0

    if getPlayerLevel(cid) + pokemonMaxLevelAbovePlayer < getItemAttribute(item.uid, "level") + boosts then
    doPlayerSendCancel(cid, "Your pokemon's level is much higher than yours, you can't use him.")
    return true
    end

    doSummonMonster(cid, pokemon)

    local pk = getCreatureSummons(cid)[1]
    if not isCreature(pk) then return true end
    ------------------------passiva hitmonchan------------------------------
    if isSummon(pk) then
       --local e = getCreatureMaster(cid)
       local nameHIT = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke")
       local hands = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "hands")
       if nameHIT == "Shiny Hitmonchan" or nameHIT == "Hitmonchan" then
          if getItemAttribute(getPlayerSlotItem(cid, 8).uid, "hands") then
             doSetCreatureOutfit(pk, {lookType = hitmonchans[nameHIT][hands].out}, -1)
          else
              doPlayerSendTextMessage(cid, 27, "Contact a GameMaster! Error in passive system! Attribute \"hands\" missing")  
          end
       end
    end
    -------------------------------------------------------------------------      

    if getCreatureName(pk) == "Ditto" then

        local left = getItemAttribute(item.uid, "transLeft")
        local name = getItemAttribute(item.uid, "transName")

        if left and left > 0 then
            setPlayerStorageValue(pk, 1010, name)
            doSetCreatureOutfit(pk, {lookType = getItemAttribute(item.uid, "transOutfit")}, -1)
            addEvent(deTransform, left * 1000, pk, getItemAttribute(item.uid, "transTurn"))
            doItemSetAttribute(item.uid, "transBegin", os.clock())
        else
            setPlayerStorageValue(pk, 1010, "Ditto")
        end
    end

    if isGhostPokemon(pk) then doTeleportThing(pk, getPosByDir(getThingPos(cid), math.random(0, 7)), false) end

    doCreatureSetLookDir(pk, 2)

    adjustStatus(pk, item.uid, true, false, true)
    doAddPokemonInOwnList(cid, pokemon)

    doTransformItem(item.uid, item.itemid+1)

    local pokename = getItemAttribute(item.uid, "nick") or getCreatureName(pk)

    local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)
    doCreatureSay(cid, mgo, TALKTYPE_SAY)

    doSendMagicEffect(getCreaturePosition(pk), effect)

else

    doPlayerSendCancel(cid, "Seu pokemon Morreu.")

end
return true
end

 

 

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

tenta usar isso:

 

 

local hitmonchans = {
["Hitmonchan"] = {
                         [0] = {out = 559, eff = 112, type = FIGHTINGDAMAGE},  --outfit normal
                         [1] = {out = 1075, eff = 35, type = FIREDAMAGE},    --outfit fogo
                         [2] = {out = 1077, eff = 48, type = ELECTRICDAMAGE},    --outfit raio
                         [3] = {out = 1078, eff = 43, type = ICEDAMAGE},    --outfit gelo
                         [4] = {out = 1076, eff = 140, type = GHOSTDAMAGE}   --outfit ghost
                  },
                  
["Shiny Hitmonchan"] = {              
                         --aconcelho trocar a outfit do shiny hitmonchan pela do elite hitmonchan do PO...
                         [0] = {out = 837, eff = 112, type = FIGHTINGDAMAGE},  --outfit normal
                         [1] = {out = 1080, eff = 35, type = FIREDAMAGE},    --outfit fogo
                         [2] = {out = 1081, eff = 48, type = ELECTRICDAMAGE},    --outfit raio
                         [3] = {out = 1082, eff = 43, type = ICEDAMAGE},    --outfit gelo
                         [4] = {out = 1079, eff = 140, type = GHOSTDAMAGE}   --outfit ghost
                       }
}
function onUse(cid, item, frompos, item2, topos)

    if exhaustion.get(cid, 6666) and exhaustion.get(cid, 6666) > 0 then return true end

    local owner = getItemAttribute(item.uid, "firstpoke")

    if owner and owner ~= getCreatureName(cid) then
        doPlayerSendCancel(cid, "This pokemon belongs to "..owner..", it is his first pokemon. Please, give it back to him.")
    return true
    end

if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 then
return true
end

local btype = getPokeballType(item.itemid)

local effect = pokeballs[btype].effect
    if not effect then
        effect = 21
    end

if item.itemid == pokeballs[btype].use then

    if getPlayerStorageValue(cid, 990) == 1 then -- GYM
        doPlayerSendCancel(cid, "You can't return your pokemon during gym battles.")
    return true
    end

    if #getCreatureSummons(cid) <= 0 then
        if isInArray(pokeballs[btype].all, item.itemid) then
            doTransformItem(item.uid, pokeballs[btype].off)
            doItemSetAttribute(item.uid, "hp", 0)
            doPlayerSendCancel(cid, "Seu pokemon Morreu.")
        return true
        end
    end

    local z = getCreatureSummons(cid)[1]

    if getCreatureCondition(z, CONDITION_INVISIBLE) and not isGhostPokemon(z) then
    return true
    end

    doReturnPokemon(cid, z, item, effect)

elseif item.itemid == pokeballs[btype].on then

    if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
        doPlayerSendCancel(cid, "You must put your Digivace in the correct place!")
    return TRUE
    end

    local thishp = getItemAttribute(item.uid, "hp")

    if thishp == nil then
        if isInArray(pokeballs[btype].all, item.itemid) then
            doTransformItem(item.uid, pokeballs[btype].off)
            doItemSetAttribute(item.uid, "hp", 1)
            doPlayerSendCancel(cid, "Seu pokemon Morreu.")
        return true
        end
    end
    
    if thishp <= 1 then
        if isInArray(pokeballs[btype].all, item.itemid) then
            doTransformItem(item.uid, pokeballs[btype].off)
            doItemSetAttribute(item.uid, "hp", 1)
            doPlayerSendCancel(cid, "Seu pokemon Morreu.")
        return true
        end
    end

    local pokemon = getItemAttribute(item.uid, "poke")

    if not pokes[pokemon] then
    return true
    end

    local x = pokes[pokemon]
    local boosts = getItemAttribute(item.uid, "boost") or 0

    if getPlayerLevel(cid) + pokemonMaxLevelAbovePlayer < getItemAttribute(item.uid, "level") + boosts then
    doPlayerSendCancel(cid, "Your pokemon's level is much higher than yours, you can't use him.")
    return true
    end

    doSummonMonster(cid, pokemon)

    local pk = getCreatureSummons(cid)[1]
    if not isCreature(pk) then return true end
    ------------------------passiva hitmonchan------------------------------
    if isSummon(pk) then
       --local e = getCreatureMaster(cid)
       local nameHIT = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke")
       local hands = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "hands")
       if nameHIT == "Shiny Hitmonchan" or nameHIT == "Hitmonchan" then
          if getItemAttribute(getPlayerSlotItem(cid, 8).uid, "hands") then
             doSetCreatureOutfit(pk, {lookType = hitmonchans[nameHIT][hands].out}, -1)
          else
              doPlayerSendTextMessage(cid, 27, "Contact a GameMaster! Error in passive system! Attribute \"hands\" missing")  
          end
       end
    end
    -------------------------------------------------------------------------      

    if getCreatureName(pk) == "Ditto" then

        local left = getItemAttribute(item.uid, "transLeft")
        local name = getItemAttribute(item.uid, "transName")

        if left and left > 0 then
            setPlayerStorageValue(pk, 1010, name)
            doSetCreatureOutfit(pk, {lookType = getItemAttribute(item.uid, "transOutfit")}, -1)
            addEvent(deTransform, left * 1000, pk, getItemAttribute(item.uid, "transTurn"))
            doItemSetAttribute(item.uid, "transBegin", os.clock())
        else
            setPlayerStorageValue(pk, 1010, "Ditto")
        end
    end

    if isGhostPokemon(pk) then doTeleportThing(pk, getPosByDir(getThingPos(cid), math.random(0, 7)), false) end

    doCreatureSetLookDir(pk, 2)

    adjustStatus(pk, item.uid, true, false, true)
    doAddPokemonInOwnList(cid, pokemon)

    doTransformItem(item.uid, item.itemid+1)

    local pokename = getItemAttribute(item.uid, "nick") or getCreatureName(pk)

    local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)
    doCreatureSay(cid, mgo, TALKTYPE_SAY)

    doSendMagicEffect(getCreaturePosition(pk), effect)

else

    doPlayerSendCancel(cid, "Seu pokemon Morreu.")

end
return true
end

 

 

Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...

O HP TEM QUE SER COMPARADO A 0 PARA FALAR QUE MORREU... FICA CHATO COMPARA-LO A 1 SENDO QUE 1 AINDA ESTA VIVO....OQ ACONTECER E O SISTEMA NÃO CONSEGUI SOLTAR O MONSTRO BUGADO POR ISSO DA O ERRO DE NIL.

Link para o comentário
Compartilhar em outros sites

so add isso na database

 

CREATE TABLE IF NOT EXISTS `shop_history` (  `id` int(11) NOT NULL AUTO_INCREMENT,
  `product` int(11) NOT NULL,
  `session` varchar(256) NOT NULL,
  `player` varchar(256) NOT NULL,
  `date` int(10) NOT NULL,
  `processed` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=31 ;


-- --------------------------------------------------------


--
-- Table structure for table `shop_offer`
--


CREATE TABLE IF NOT EXISTS `shop_offer` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `points` int(11) NOT NULL DEFAULT '0',
  `category` int(11) NOT NULL DEFAULT '1',
  `type` int(11) NOT NULL DEFAULT '1',
  `item` int(11) NOT NULL DEFAULT '0',
  `count` int(11) NOT NULL DEFAULT '0',
  `description` text NOT NULL,
  `name` varchar(256) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ;


--
-- Estructura de tabla para la tabla `shop_donation_history`
--


CREATE TABLE IF NOT EXISTS `shop_donation_history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `method` varchar(256) NOT NULL,
  `receiver` varchar(256) NOT NULL,
  `buyer` varchar(256) NOT NULL,
  `account` varchar(256) NOT NULL,
  `points` int(11) NOT NULL,
  `date` int(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;


--
-- Volcar la base de datos para la tabla `shop_donation_history`

 

 

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

  • 4 years later...
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
Compartilhar em outros sites

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