Ir para conteúdo

Mega Evolution System (PxG)


zipter98

Posts Recomendados

Hm, tenta o seguinte:

Troque:

if table ~= "" then 
    min = getSpecialAttack(cid) * table.f * 0.1   --alterado v1.6
    max = min + (isSummon(cid) and getMasterLevel(cid) or getPokemonLevel(cid))
 
 
    if spell == "Selfdestruct" then
        min = getCreatureHealth(cid)  --alterado v1.6
        max = getCreatureHealth(cid)
    end
 
    if not isSummon(cid) and not isInArray({"Demon Puncher", "Demon Kicker"}, spell) then --alterado v1.7
        doCreatureSay(cid, string.upper(spell).."!", TALKTYPE_MONSTER)
    end
    if isNpcSummon(cid) then
        local mnn = {" use ", " utilize ", " "}
        local use = mnn[math.random(#mnn)]
        doCreatureSay(getCreatureMaster(cid), getPlayerStorageValue(cid, 1007)..","..use..""..doCorrectString(spell).."!", TALKTYPE_MONSTER)
    end
else
    print("Error trying to use move "..spell..", move not specified in the pokemon table.")
end 
por:
if spell ~= "Mega Evolution" then
    if table ~= "" then 
        min = getSpecialAttack(cid) * table.f * 0.1   --alterado v1.6
        max = min + (isSummon(cid) and getMasterLevel(cid) or getPokemonLevel(cid))
 
 
        if spell == "Selfdestruct" then
            min = getCreatureHealth(cid)  --alterado v1.6
            max = getCreatureHealth(cid)
        end
 
        if not isSummon(cid) and not isInArray({"Demon Puncher", "Demon Kicker"}, spell) then --alterado v1.7
            doCreatureSay(cid, string.upper(spell).."!", TALKTYPE_MONSTER)
        end
        if isNpcSummon(cid) then
            local mnn = {" use ", " utilize ", " "}
            local use = mnn[math.random(#mnn)]
            doCreatureSay(getCreatureMaster(cid), getPlayerStorageValue(cid, 1007)..","..use..""..doCorrectString(spell).."!", TALKTYPE_MONSTER)
        end
    else
        print("Error trying to use move "..spell..", move not specified in the pokemon table.")
    end 
end

Sobre o goback, se possível, poste o código aqui. E aparece algum erro na distro relacionado a este arquivo (quando você tenta usar o pokémon mega)?

 

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

Olhe quando dou look no pokemon com a mega stone.

01:26 You see a Icone using.
It contains a Mega Charizard X.
 $Price: 18000.
UID: [79692]
It's holding a(n) Charizardite X.

Não da erro nenhum na distro sobre o goback,

 

Exemplo, transformei ele em mega, voltei ele pra ball, mais ele ainda é mega, dando look no icone dele aparece o nome do mega, e soltando ele novamente ele destransforma, e o certo seria ao voltar o mega para a ball ele ja destransformar neh. e se eu tirar ele do slot transformado em mega dai nao da mais para colocalo no slot,

Link para o comentário
Compartilhar em outros sites

@Taiger

Se possível, poste tanto o look.lua e o goback.lua.

Escrevi o sistema para o PDA 1.9 do Slicer, sem modificações adicionais. Logo, sistemas como o de ícones pode causar problemas.

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

goback.lua

 

local EFFECTS = {
--[OutfitID] = {Effect}
["Magmar"] = 35,   
["Magmortar"] = 35,   
["Shiny Magmar"] = 35,
["Jynx"] = 17,          --alterado v2.5
["Shiny Jynx"] = 17,  
   ["Mamoswine"] = 205,  
   ["Piloswine"] = 205,  --alterado v2.8
   ["Swinub"] = 205,  
}
 
function onUse(cid, item, frompos, item2, topos)
 
 
--if getPlayerStorageValue(cid,130130) >= 1 then 
--doPlayerSendTextMessage(cid, 19, "Nao Pode Dar Goback Nessa Area.")
--return true
--end
 
if exhaustion.get(cid, 6666) and exhaustion.get(cid, 6666) > 0 then return true end
 
if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 
or getPlayerStorageValue(cid, 75846) >= 1 or getPlayerStorageValue(cid, 5700) >= 1  then    --alterado v2.9 <<
   return true                                                                                                                        
end
 
local ballName = getItemAttribute(item.uid, "poke")
local btype = getPokeballType(item.itemid)
local usando = pokeballs[btype].use
 
local effect = pokeballs[btype].effect
if not effect then
effect = 21
end
 
unLock(item.uid) --alterado v2.8
if item.itemid == usando then
--if getPlayerGroupId == 8 then
--doPlayerSendTextMessage(cid, 19, "TESTS 1!")
--setPlayerGroupId(cid,1) 
--return true
--end  
 
 
                          
   if getPlayerStorageValue(cid, 990) == 1 then -- GYM
doPlayerSendCancel(cid, "Você não pode voltar o seu pokemon durante as batalhas de ginásio.")
  return true
end
 
if #getCreatureSummons(cid) > 1 and getPlayerStorageValue(cid, 212124) <= 0 then     --alterado v2.6
       if getPlayerStorageValue(cid, 637501) == -2 or getPlayerStorageValue(cid, 637501) >= 1 then  
          BackTeam(cid)       
       end
    end 
    
    if #getCreatureSummons(cid) == 2 and getPlayerStorageValue(cid, 212124) >= 1 then
       doPlayerSendCancel(cid, "Você não pode fazer isso enquanto está controlando a mente de um pokémon")
       return true     --alterado v2.5
    end
    
if #getCreatureSummons(cid) <= 0 then
   if isInArray(pokeballs[btype].all, item.itemid) then
   doTransformItem(item.uid, pokeballs[btype].on)
doItemSetAttribute(item.uid, "hp", 1)
--setPlayerGroupId(cid,1)
doPlayerSendCancel(cid, "[Ball-Desbloqueado] Balls Desbloqueado com Sucesso!")
doPlayerSendTextMessage(cid, 21, "[Ball-Desbloqueado] Balls Desbloqueado com Sucesso!")
           doSendMagicEffect(getThingPos(cid), 29)
           doSendAnimatedText(getCreaturePosition(cid),"Unlock",math.random(1,255)) 
   return true
end
    end
 
   if #getCreatureSummons(cid) > 1 then
        for _, s in pairs(getCreatureSummons(cid)) do
            if getCreatureName(s) == "Unown" then
                doRemoveCreature(s)
            end
        end
    end
 
    local cd = getCD(item.uid, "blink", 30)
    if cd > 0 then
       setCD(item.uid, "blink", 0)
    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
--doPlayerSendTextMessage(cid, 19, "TESTS 3!")
--setPlayerGroupId(cid,8) 
 
if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
doPlayerSendCancel(cid, "Você deve colocar o seu pokeball no lugar correto!")
return TRUE
end
 
local thishp = getItemAttribute(item.uid, "hp")
 
if thishp <= 0 then
if isInArray(pokeballs[btype].all, item.itemid) then
doTransformItem(item.uid, pokeballs[btype].off)
doItemSetAttribute(item.uid, "hp", 0)
doPlayerSendCancel(cid, "Este pokemon é desmaiou.")
         return true
end
end
 
local pokemon = getItemAttribute(item.uid, "poke")
 
if not pokes[pokemon] then
  return true
end
 
    if pokemon:find("Mega") then
        local normalPoke = megaEvolutions[getItemAttribute(item.uid, "megaStone")][1]
        if normalPoke then
            doItemSetAttribute(item.uid, "poke", normalPoke)
            pokemon = normalPoke
        end
    end
 
----------------------- Sistema de nao poder carregar mais que 3 pokes lvl baixo e + q 1 poke de lvl medio/alto ---------------------------------
if not isInArray({5, 6}, getPlayerGroupId(cid)) then                          --alterado v2.9 \/
   local balls = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)
   local low = {}
   local lowPokes = {"Rattata", "Caterpie", "Weedle", "Oddish", "Pidgey", "Paras", "Poliwag", "Bellsprout", "Magikarp", "Hoppip", "Sunkern"}
   if #balls >= 1 then
      for _, uid in ipairs(balls) do
          local nome = getItemAttribute(uid, "poke")
          if not isInArray(lowPokes, pokemon) and nome == pokemon then
             return doPlayerSendTextMessage(cid, 27, "Desculpe, mas você não pode transportar dois pokemons é igual!")
          else
             if nome == pokemon then
                table.insert(low, nome)
             end
          end
      end
   end
if #low >= 3 then
   return doPlayerSendTextMessage(cid, 27, "Desculpe, mas você não pode transportar mais de três pokemons é igual a de baixo nível!")
end   
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, "O nível do seu pokemon é muito maior do que o seu, você não pode usá-lo.")
  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                                                  --alterado v2.8 \/
       if pokemon == "Shiny Hitmonchan" or pokemon == "Hitmonchan" then
          if not getItemAttribute(item.uid, "hands") then
             doSetItemAttribute(item.uid, "hands", 0)
          end
          local hands = getItemAttribute(item.uid, "hands")
          doSetCreatureOutfit(pk, {lookType = hitmonchans[pokemon][hands].out}, -1)
       end
    end
-------------------------------------------------------------------------
    ---------movement magmar, jynx-------------
    if EFFECTS[getCreatureName(pk)] then             
       markPosEff(pk, getThingPos(pk))
       sendMovementEffect(pk, EFFECTS[getCreatureName(pk)], getThingPos(pk)) --alterado v2.5
    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)
--if getItemAttribute(item.uid, "ehditto") then
  ---  doCreatureSetNick(pk, "Ditto")
   -- end
doAddPokemonInOwnList(cid, pokemon)
 
doTransformItem(item.uid, item.itemid+1)
 
local pokename = getPokeName(pk) --alterado v2.7 
 
local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)
doCreatureSay(cid, mgo, TALKTYPE_ORANGE_1)
 
doSendMagicEffect(getCreaturePosition(pk), effect)
 
if useOTClient then
 doPlayerSendCancel(cid, '12//,show') --alterado v2.7
   end
 
local pk = getCreatureSummons(cid)[1]
                local pb = getPlayerSlotItem(cid, 8).uid
                local look = getItemAttribute(pb,"addon")
                if not look then
                                doSetItemAttribute(pb,"addon",0)
                return false
                end
                if look > 0 then
                                doSetCreatureOutfit(pk, {lookType = look}, -1)
                return true
                end
 
else
    doPlayerSendCancel(cid, "Esse pokemon desmaiou.")
end
 
if useKpdoDlls then
doUpdateMoves(cid)
end
return true
end

 



look.lua

 


local NPCBattle = {
["Brock"] = {artig = "He is", cidbat = "Pewter"},
["Misty"] = {artig = "She is", cidbat = "Cerulean"}, 
["Blaine"] = {artig = "He is", cidbat = "Cinnabar"},
["Sabrina"] = {artig = "She is", cidbat = "Saffron"},         --alterado v2.9 \/ peguem tudo!
["Kira"] = {artig = "She is", cidbat = "Viridian"},
["Koga"] = {artig = "He is", cidbat = "Fushcia"},
["Erika"] = {artig = "She is", cidbat = "Celadon"},
["Surge"] = {artig = "He is", cidbat = "Vermilion"},
}
 
function onLook(cid, thing, position, lookDistance)
 
 
 
local str = {}
 
if not isCreature(thing.uid) then
   local iname = getItemInfo(thing.itemid)
   if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then
      
      unLock(thing.uid)
      local lock = getItemAttribute(thing.uid, "lock")        
      local pokename = getItemAttribute(thing.uid, "poke")
 
      table.insert(str, "Você Vê "..iname.article.." "..iname.name..".")                                                               ---\n [Bonus level: +"..bonus_level.."]
      if getItemAttribute(thing.uid, "unique") then                                                                                       
         table.insert(str, "Esta ball é unica.")                                                                                             
      end
      local bonus_level = getItemAttribute(thing.uid, "b_level") or 0
 if getItemAttribute(thing.uid, "ehditto") == 1 then
 table.insert(str, "\nEssa call comtém um "..getArticle(pokename).." "..pokename.." (Ditto) [level "..getItemAttribute(thing.uid, "level").."].\n [Bonus level: +"..bonus_level.."].\n") 
 elseif getItemAttribute(thing.uid, "ehshinyditto") == 1 then
 table.insert(str, "\nEssa call comtém um "..getArticle(pokename).." "..pokename.." (Shiny Ditto) [level "..getItemAttribute(thing.uid, "level").."].\n [Bonus level: +"..bonus_level.."].\n")
      else 
table.insert(str, "\Essa ball comtém um "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n [Bonus level: +"..bonus_level.."].\n") 
 end
      if lock and lock > 0 then
         table.insert(str, "Essa ball vai desbloquear no dia ".. os.date("%d/%m/%y %X", lock)..".\n")  
      end
      local boost = getItemAttribute(thing.uid, "boost") or 0
 local extraInfo, megaStone = "", getItemAttribute(thing.uid, "megaStone")
if megaStone then
    extraInfo = getItemNameById(megaStone)   
    if pokename:find("Mega") then
        pokename = megaEvolutions[megaStone][1]
    end
end
      if boost > 0 then
         table.insert(str, "Boost level: [+"..boost.."]\n")
      end
     -- if getItemAttribute(thing.uid, "nick") then
     --    table.insert(str, "It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n")
      --end
      if getItemAttribute(thing.uid, "gender") == SEX_MALE then
         table.insert(str, "Este Pokémon é macho.\n")
      elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
         table.insert(str, "Este Pokémon é femia.\n")      
      else
         table.insert(str, "Este Pokémon é indefinido.\n")
      end
    --[[ if pokesPrice[pokename] then
         table.insert(str, "Price: $"..pokesPrice[pokename].price..".\n")
      else
         table.insert(str, "Price: unsellable.\n")
      end  --]]
  table.insert(str, "\n[Status]")    
      table.insert(str, "\n[Offense]: "..math.floor(getItemAttribute(thing.uid, "offense")).." Defense: "..math.floor(getItemAttribute(thing.uid, "defense")).."\n")
      table.insert(str, "[Agility]: "..math.floor(getItemAttribute(thing.uid, "speed")).." Sp. Attack: "..math.floor(getItemAttribute(thing.uid, "specialattack")).."\n")
      table.insert(str, "[Vitality]: "..math.floor(getItemAttribute(thing.uid, "vitality")).."")
if extraInfo ~= "" then
    table.insert(str, "\nIt's holding a(n) "..extraInfo..".")
end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then
      
      table.insert(str, "Você vê um "..string.lower(iname.name).." ["..getItemAttribute(thing.uid, "level").."]. ")    
     -- if isContainer(thing.uid) then
       --  table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")")
      --end
      table.insert(str, "\n")
 
      if getItemAttribute(thing.uid, "gender") == SEX_MALE then
         table.insert(str, "Este pokémon é macho.")
      elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
         table.insert(str, "Este pokémon é femia.")
      else
         table.insert(str, "Este pokémon é indefinido.")
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   elseif isContainer(thing.uid) then     --containers
      
      if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then
         table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ")
         table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ")
         table.insert(str, getItemAttribute(thing.uid, "attacker")..".")
      else   
         table.insert(str, "Você vê "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").")
      end
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")     
         local pos = getThingPos(thing.uid)
         table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")  
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   elseif getItemAttribute(thing.uid, "unique") then    --alterado v2.8 \/
      local p = getThingPos(thing.uid)
   
      table.insert(str, "Você vê ")
      if thing.type > 1 then
         table.insert(str, thing.type.." "..iname.plural..".")
      else
         table.insert(str, iname.article.." "..iname.name..".")
      end
      table.insert(str, " Essa ball é unica.\n"..iname.description)
      
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")
         table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]")
      end
   
      sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   else
      return true
   end
end
 
local npcname = getCreatureName(thing.uid)
if isNpc(thing.uid) and NPCBattle[npcname] then    --npcs duel
   table.insert(str, "Você vê "..npcname..". "..NPCBattle[npcname].artig.." líder do ginásio de "..NPCBattle[npcname].cidbat..".")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
end
if getPlayerStorageValue(thing.uid, 697548) ~= -1 then    --npcs de TV
   table.insert(str, getPlayerStorageValue(thing.uid, 697548))                                   
   local pos = getThingPos(thing.uid)
   if youAre[getPlayerGroupId(cid)] then
      table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")
   end
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) 
   return false
end
 
if not isPlayer(thing.uid) and not isMonster(thing.uid) then    
   table.insert(str, "Você Vê "..getCreatureName(thing.uid)..".")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
end
local torneio =  (getPlayerStorageValue(thing.uid,130131) +1)
   local loses =  (getPlayerStorageValue(thing.uid,19998) +1)
     local wins = (getPlayerStorageValue(thing.uid,19999) +1)
     local rank = (getPlayerClanRank(thing.uid)+0)
if isPlayer(thing.uid) then
table.insert(str, "Você se vê "..getCreatureName(thing.uid).." Level: ["..getPlayerLevel(thing.uid).."].\n")
if getPlayerTown(thing.uid) == 1 then
table.insert(str, "City: [Saffron City].\n")
elseif getPlayerTown(thing.uid) == 2 then
table.insert(str, "City: [Cerulean City].\n")
elseif getPlayerTown(thing.uid) == 3 then
table.insert(str, "City: [Lavender Town].\n")
elseif getPlayerTown(thing.uid) == 4 then
table.insert(str, "City: [Fuchsia City].\n")
elseif getPlayerTown(thing.uid) == 5 then
table.insert(str, "City: [Celadon City].\n")
elseif getPlayerTown(thing.uid) == 6 then
table.insert(str, "City: [Viridian City].\n")
elseif getPlayerTown(thing.uid) == 7 then
table.insert(str, "City: [Vermilion City].\n")
elseif getPlayerTown(thing.uid) == 8 then
table.insert(str, "City: [Pewter City].\n")
elseif getPlayerTown(thing.uid) == 9 then
table.insert(str, "City: [Pallet Town].\n")
elseif getPlayerTown(thing.uid) == 10 then
table.insert(str, "City: [Cinnabar Island].\n")
elseif getPlayerTown(thing.uid) == 11 then
table.insert(str, "City: [Snow City].\n")
elseif getPlayerTown(thing.uid) == 12 then
table.insert(str, "City: [Venesis Island].\n")
else
table.insert(str, "City: [Unknown Town].\n")
end
table.insert(str, "Guild: ["..getPlayerGuildName(thing.uid).."].\nWins: ["..wins.."]. Loses: ["..loses.."].\n")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
return false
end
 
if getCreatureName(thing.uid) == "Evolution" then return false end
 
if not isSummon(thing.uid) then
   table.insert(str, "Você vê um "..string.lower(getCreatureName(thing.uid)).." [level "..getPokemonLevel(thing.uid).."] selvagem.\n")
   if getPokemonGender(thing.uid)  == SEX_MALE then
      table.insert(str, "Este pokémon é macho.")
   elseif getPokemonGender(thing.uid)  == SEX_FEMALE then
      table.insert(str, "Este pokémon é femia.")
   else
      table.insert(str, "Este pokémon é indefinido.")
   end
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
   
elseif isSummon(thing.uid) and not isPlayer(thing.uid) then
   local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
   local boostshow = " + "..boostlevel.."]"
   if showBoostSeparated then
      boostshow = "] [+"..boostlevel.."]"
   end
   local levelinfo = "["..getPokemonLevel(thing.uid)..""..boostshow..""
   if getCreatureMaster(thing.uid) == cid then
      local myball = getPlayerSlotItem(cid, 8).uid
      local nexp = getItemAttribute(myball, "nextlevelexp")
      table.insert(str, "Você vê "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".")
      table.insert(str, "\nVida: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
      table.insert(str, "\n"..getPokemonHappinessDescription(thing.uid))
      if getItemAttribute(myball, "level") <= 299 then
         table.insert(str, "\nExperiencia Para Proximo Level: ["..nexp.."].")
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   else
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você Vê "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".\nVida: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
   end
   return false
end
return true
end

 

 

Link para o comentário
Compartilhar em outros sites

Eu sinceramente não pretendia adaptar o código para outras bases, mas enfim.

Sobre o goback, não encontrei nenhum erro que pudesse estar causando isso. Você colocou e configurou a tabela corretamente em configuration.lua?

E use este look:

 

 

local NPCBattle = {
["Brock"] = {artig = "He is", cidbat = "Pewter"},
["Misty"] = {artig = "She is", cidbat = "Cerulean"}, 
["Blaine"] = {artig = "He is", cidbat = "Cinnabar"},
["Sabrina"] = {artig = "She is", cidbat = "Saffron"},         --alterado v2.9 \/ peguem tudo!
["Kira"] = {artig = "She is", cidbat = "Viridian"},
["Koga"] = {artig = "He is", cidbat = "Fushcia"},
["Erika"] = {artig = "She is", cidbat = "Celadon"},
["Surge"] = {artig = "He is", cidbat = "Vermilion"},
}
 
function onLook(cid, thing, position, lookDistance)
 
 
 
local str = {}
 
if not isCreature(thing.uid) then
   local iname = getItemInfo(thing.itemid)
   if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then
      
      unLock(thing.uid)
      local lock = getItemAttribute(thing.uid, "lock")        
      local pokename = getItemAttribute(thing.uid, "poke")
 
        table.insert(str, "Você Vê "..iname.article.." "..iname.name..".")                                                               ---\n [Bonus level: +"..bonus_level.."]
        if getItemAttribute(thing.uid, "unique") then                                                                                       
            table.insert(str, "Esta ball é unica.")                                                                                             
        end
        local extraInfo, megaStone = "", getItemAttribute(thing.uid, "megaStone")
        if megaStone then
            extraInfo = getItemNameById(megaStone)   
            if pokename:find("Mega") then
                pokename = megaEvolutions[megaStone][1]
            end
        end
        local bonus_level = getItemAttribute(thing.uid, "b_level") or 0
        if getItemAttribute(thing.uid, "ehditto") == 1 then
            table.insert(str, "\nEssa call comtém um "..getArticle(pokename).." "..pokename.." (Ditto) [level "..getItemAttribute(thing.uid, "level").."].\n [Bonus level: +"..bonus_level.."].\n") 
        elseif getItemAttribute(thing.uid, "ehshinyditto") == 1 then
            table.insert(str, "\nEssa call comtém um "..getArticle(pokename).." "..pokename.." (Shiny Ditto) [level "..getItemAttribute(thing.uid, "level").."].\n [Bonus level: +"..bonus_level.."].\n")
        else 
            table.insert(str, "\Essa ball comtém um "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n [Bonus level: +"..bonus_level.."].\n") 
        end
        if lock and lock > 0 then
            table.insert(str, "Essa ball vai desbloquear no dia ".. os.date("%d/%m/%y %X", lock)..".\n")  
        end
        local boost = getItemAttribute(thing.uid, "boost") or 0
        if boost > 0 then
            table.insert(str, "Boost level: [+"..boost.."]\n")
        end
     -- if getItemAttribute(thing.uid, "nick") then
     --    table.insert(str, "It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n")
      --end
        if getItemAttribute(thing.uid, "gender") == SEX_MALE then
            table.insert(str, "Este Pokémon é macho.\n")
        elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
            table.insert(str, "Este Pokémon é femia.\n")      
        else
            table.insert(str, "Este Pokémon é indefinido.\n")
        end
    --[[ if pokesPrice[pokename] then
         table.insert(str, "Price: $"..pokesPrice[pokename].price..".\n")
      else
         table.insert(str, "Price: unsellable.\n")
      end  --]]
        table.insert(str, "\n[Status]")    
        table.insert(str, "\n[Offense]: "..math.floor(getItemAttribute(thing.uid, "offense")).." Defense: "..math.floor(getItemAttribute(thing.uid, "defense")).."\n")
        table.insert(str, "[Agility]: "..math.floor(getItemAttribute(thing.uid, "speed")).." Sp. Attack: "..math.floor(getItemAttribute(thing.uid, "specialattack")).."\n")
        table.insert(str, "[Vitality]: "..math.floor(getItemAttribute(thing.uid, "vitality")).."")
        if extraInfo ~= "" then
            table.insert(str, "\nIt's holding a(n) "..extraInfo..".")
        end
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
        return false
      
   elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then
      
      table.insert(str, "Você vê um "..string.lower(iname.name).." ["..getItemAttribute(thing.uid, "level").."]. ")    
     -- if isContainer(thing.uid) then
       --  table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")")
      --end
      table.insert(str, "\n")
 
      if getItemAttribute(thing.uid, "gender") == SEX_MALE then
         table.insert(str, "Este pokémon é macho.")
      elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
         table.insert(str, "Este pokémon é femia.")
      else
         table.insert(str, "Este pokémon é indefinido.")
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   elseif isContainer(thing.uid) then     --containers
      
      if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then
         table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ")
         table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ")
         table.insert(str, getItemAttribute(thing.uid, "attacker")..".")
      else   
         table.insert(str, "Você vê "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").")
      end
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")     
         local pos = getThingPos(thing.uid)
         table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")  
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   elseif getItemAttribute(thing.uid, "unique") then    --alterado v2.8 \/
      local p = getThingPos(thing.uid)
   
      table.insert(str, "Você vê ")
      if thing.type > 1 then
         table.insert(str, thing.type.." "..iname.plural..".")
      else
         table.insert(str, iname.article.." "..iname.name..".")
      end
      table.insert(str, " Essa ball é unica.\n"..iname.description)
      
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")
         table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]")
      end
   
      sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   else
      return true
   end
end
 
local npcname = getCreatureName(thing.uid)
if isNpc(thing.uid) and NPCBattle[npcname] then    --npcs duel
   table.insert(str, "Você vê "..npcname..". "..NPCBattle[npcname].artig.." líder do ginásio de "..NPCBattle[npcname].cidbat..".")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
end
if getPlayerStorageValue(thing.uid, 697548) ~= -1 then    --npcs de TV
   table.insert(str, getPlayerStorageValue(thing.uid, 697548))                                   
   local pos = getThingPos(thing.uid)
   if youAre[getPlayerGroupId(cid)] then
      table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")
   end
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) 
   return false
end
 
if not isPlayer(thing.uid) and not isMonster(thing.uid) then    
   table.insert(str, "Você Vê "..getCreatureName(thing.uid)..".")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
end
local torneio =  (getPlayerStorageValue(thing.uid,130131) +1)
   local loses =  (getPlayerStorageValue(thing.uid,19998) +1)
     local wins = (getPlayerStorageValue(thing.uid,19999) +1)
     local rank = (getPlayerClanRank(thing.uid)+0)
if isPlayer(thing.uid) then
table.insert(str, "Você se vê "..getCreatureName(thing.uid).." Level: ["..getPlayerLevel(thing.uid).."].\n")
if getPlayerTown(thing.uid) == 1 then
table.insert(str, "City: [Saffron City].\n")
elseif getPlayerTown(thing.uid) == 2 then
table.insert(str, "City: [Cerulean City].\n")
elseif getPlayerTown(thing.uid) == 3 then
table.insert(str, "City: [Lavender Town].\n")
elseif getPlayerTown(thing.uid) == 4 then
table.insert(str, "City: [Fuchsia City].\n")
elseif getPlayerTown(thing.uid) == 5 then
table.insert(str, "City: [Celadon City].\n")
elseif getPlayerTown(thing.uid) == 6 then
table.insert(str, "City: [Viridian City].\n")
elseif getPlayerTown(thing.uid) == 7 then
table.insert(str, "City: [Vermilion City].\n")
elseif getPlayerTown(thing.uid) == 8 then
table.insert(str, "City: [Pewter City].\n")
elseif getPlayerTown(thing.uid) == 9 then
table.insert(str, "City: [Pallet Town].\n")
elseif getPlayerTown(thing.uid) == 10 then
table.insert(str, "City: [Cinnabar Island].\n")
elseif getPlayerTown(thing.uid) == 11 then
table.insert(str, "City: [Snow City].\n")
elseif getPlayerTown(thing.uid) == 12 then
table.insert(str, "City: [Venesis Island].\n")
else
table.insert(str, "City: [Unknown Town].\n")
end
table.insert(str, "Guild: ["..getPlayerGuildName(thing.uid).."].\nWins: ["..wins.."]. Loses: ["..loses.."].\n")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
return false
end
 
if getCreatureName(thing.uid) == "Evolution" then return false end
 
if not isSummon(thing.uid) then
   table.insert(str, "Você vê um "..string.lower(getCreatureName(thing.uid)).." [level "..getPokemonLevel(thing.uid).."] selvagem.\n")
   if getPokemonGender(thing.uid)  == SEX_MALE then
      table.insert(str, "Este pokémon é macho.")
   elseif getPokemonGender(thing.uid)  == SEX_FEMALE then
      table.insert(str, "Este pokémon é femia.")
   else
      table.insert(str, "Este pokémon é indefinido.")
   end
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
   
elseif isSummon(thing.uid) and not isPlayer(thing.uid) then
   local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
   local boostshow = " + "..boostlevel.."]"
   if showBoostSeparated then
      boostshow = "] [+"..boostlevel.."]"
   end
   local levelinfo = "["..getPokemonLevel(thing.uid)..""..boostshow..""
   if getCreatureMaster(thing.uid) == cid then
      local myball = getPlayerSlotItem(cid, 8).uid
      local nexp = getItemAttribute(myball, "nextlevelexp")
      table.insert(str, "Você vê "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".")
      table.insert(str, "\nVida: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
      table.insert(str, "\n"..getPokemonHappinessDescription(thing.uid))
      if getItemAttribute(myball, "level") <= 299 then
         table.insert(str, "\nExperiencia Para Proximo Level: ["..nexp.."].")
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   else
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você Vê "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".\nVida: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
   end
   return false
end
return true
end

 

 

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

Eu sinceramente não pretendia adaptar o código para outras bases, mas enfim.

Sobre o goback, não encontrei nenhum erro que pudesse estar causando isso. Você colocou e configurou a tabela corretamente em configuration.lua?

E use este look:

 

 

local NPCBattle = {
["Brock"] = {artig = "He is", cidbat = "Pewter"},
["Misty"] = {artig = "She is", cidbat = "Cerulean"}, 
["Blaine"] = {artig = "He is", cidbat = "Cinnabar"},
["Sabrina"] = {artig = "She is", cidbat = "Saffron"},         --alterado v2.9 \/ peguem tudo!
["Kira"] = {artig = "She is", cidbat = "Viridian"},
["Koga"] = {artig = "He is", cidbat = "Fushcia"},
["Erika"] = {artig = "She is", cidbat = "Celadon"},
["Surge"] = {artig = "He is", cidbat = "Vermilion"},
}
 
function onLook(cid, thing, position, lookDistance)
 
 
 
local str = {}
 
if not isCreature(thing.uid) then
   local iname = getItemInfo(thing.itemid)
   if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then
      
      unLock(thing.uid)
      local lock = getItemAttribute(thing.uid, "lock")        
      local pokename = getItemAttribute(thing.uid, "poke")
 
        table.insert(str, "Você Vê "..iname.article.." "..iname.name..".")                                                               ---\n [Bonus level: +"..bonus_level.."]
        if getItemAttribute(thing.uid, "unique") then                                                                                       
            table.insert(str, "Esta ball é unica.")                                                                                             
        end
        local extraInfo, megaStone = "", getItemAttribute(thing.uid, "megaStone")
        if megaStone then
            extraInfo = getItemNameById(megaStone)   
            if pokename:find("Mega") then
                pokename = megaEvolutions[megaStone][1]
            end
        end
        local bonus_level = getItemAttribute(thing.uid, "b_level") or 0
        if getItemAttribute(thing.uid, "ehditto") == 1 then
            table.insert(str, "\nEssa call comtém um "..getArticle(pokename).." "..pokename.." (Ditto) [level "..getItemAttribute(thing.uid, "level").."].\n [Bonus level: +"..bonus_level.."].\n") 
        elseif getItemAttribute(thing.uid, "ehshinyditto") == 1 then
            table.insert(str, "\nEssa call comtém um "..getArticle(pokename).." "..pokename.." (Shiny Ditto) [level "..getItemAttribute(thing.uid, "level").."].\n [Bonus level: +"..bonus_level.."].\n")
        else 
            table.insert(str, "\Essa ball comtém um "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n [Bonus level: +"..bonus_level.."].\n") 
        end
        if lock and lock > 0 then
            table.insert(str, "Essa ball vai desbloquear no dia ".. os.date("%d/%m/%y %X", lock)..".\n")  
        end
        local boost = getItemAttribute(thing.uid, "boost") or 0
        if boost > 0 then
            table.insert(str, "Boost level: [+"..boost.."]\n")
        end
     -- if getItemAttribute(thing.uid, "nick") then
     --    table.insert(str, "It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n")
      --end
        if getItemAttribute(thing.uid, "gender") == SEX_MALE then
            table.insert(str, "Este Pokémon é macho.\n")
        elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
            table.insert(str, "Este Pokémon é femia.\n")      
        else
            table.insert(str, "Este Pokémon é indefinido.\n")
        end
    --[[ if pokesPrice[pokename] then
         table.insert(str, "Price: $"..pokesPrice[pokename].price..".\n")
      else
         table.insert(str, "Price: unsellable.\n")
      end  --]]
        table.insert(str, "\n[Status]")    
        table.insert(str, "\n[Offense]: "..math.floor(getItemAttribute(thing.uid, "offense")).." Defense: "..math.floor(getItemAttribute(thing.uid, "defense")).."\n")
        table.insert(str, "[Agility]: "..math.floor(getItemAttribute(thing.uid, "speed")).." Sp. Attack: "..math.floor(getItemAttribute(thing.uid, "specialattack")).."\n")
        table.insert(str, "[Vitality]: "..math.floor(getItemAttribute(thing.uid, "vitality")).."")
        if extraInfo ~= "" then
            table.insert(str, "\nIt's holding a(n) "..extraInfo..".")
        end
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
        return false
      
   elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then
      
      table.insert(str, "Você vê um "..string.lower(iname.name).." ["..getItemAttribute(thing.uid, "level").."]. ")    
     -- if isContainer(thing.uid) then
       --  table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")")
      --end
      table.insert(str, "\n")
 
      if getItemAttribute(thing.uid, "gender") == SEX_MALE then
         table.insert(str, "Este pokémon é macho.")
      elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
         table.insert(str, "Este pokémon é femia.")
      else
         table.insert(str, "Este pokémon é indefinido.")
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   elseif isContainer(thing.uid) then     --containers
      
      if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then
         table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ")
         table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ")
         table.insert(str, getItemAttribute(thing.uid, "attacker")..".")
      else   
         table.insert(str, "Você vê "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").")
      end
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")     
         local pos = getThingPos(thing.uid)
         table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")  
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   elseif getItemAttribute(thing.uid, "unique") then    --alterado v2.8 \/
      local p = getThingPos(thing.uid)
   
      table.insert(str, "Você vê ")
      if thing.type > 1 then
         table.insert(str, thing.type.." "..iname.plural..".")
      else
         table.insert(str, iname.article.." "..iname.name..".")
      end
      table.insert(str, " Essa ball é unica.\n"..iname.description)
      
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")
         table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]")
      end
   
      sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   else
      return true
   end
end
 
local npcname = getCreatureName(thing.uid)
if isNpc(thing.uid) and NPCBattle[npcname] then    --npcs duel
   table.insert(str, "Você vê "..npcname..". "..NPCBattle[npcname].artig.." líder do ginásio de "..NPCBattle[npcname].cidbat..".")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
end
if getPlayerStorageValue(thing.uid, 697548) ~= -1 then    --npcs de TV
   table.insert(str, getPlayerStorageValue(thing.uid, 697548))                                   
   local pos = getThingPos(thing.uid)
   if youAre[getPlayerGroupId(cid)] then
      table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")
   end
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) 
   return false
end
 
if not isPlayer(thing.uid) and not isMonster(thing.uid) then    
   table.insert(str, "Você Vê "..getCreatureName(thing.uid)..".")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
end
local torneio =  (getPlayerStorageValue(thing.uid,130131) +1)
   local loses =  (getPlayerStorageValue(thing.uid,19998) +1)
     local wins = (getPlayerStorageValue(thing.uid,19999) +1)
     local rank = (getPlayerClanRank(thing.uid)+0)
if isPlayer(thing.uid) then
table.insert(str, "Você se vê "..getCreatureName(thing.uid).." Level: ["..getPlayerLevel(thing.uid).."].\n")
if getPlayerTown(thing.uid) == 1 then
table.insert(str, "City: [Saffron City].\n")
elseif getPlayerTown(thing.uid) == 2 then
table.insert(str, "City: [Cerulean City].\n")
elseif getPlayerTown(thing.uid) == 3 then
table.insert(str, "City: [Lavender Town].\n")
elseif getPlayerTown(thing.uid) == 4 then
table.insert(str, "City: [Fuchsia City].\n")
elseif getPlayerTown(thing.uid) == 5 then
table.insert(str, "City: [Celadon City].\n")
elseif getPlayerTown(thing.uid) == 6 then
table.insert(str, "City: [Viridian City].\n")
elseif getPlayerTown(thing.uid) == 7 then
table.insert(str, "City: [Vermilion City].\n")
elseif getPlayerTown(thing.uid) == 8 then
table.insert(str, "City: [Pewter City].\n")
elseif getPlayerTown(thing.uid) == 9 then
table.insert(str, "City: [Pallet Town].\n")
elseif getPlayerTown(thing.uid) == 10 then
table.insert(str, "City: [Cinnabar Island].\n")
elseif getPlayerTown(thing.uid) == 11 then
table.insert(str, "City: [Snow City].\n")
elseif getPlayerTown(thing.uid) == 12 then
table.insert(str, "City: [Venesis Island].\n")
else
table.insert(str, "City: [Unknown Town].\n")
end
table.insert(str, "Guild: ["..getPlayerGuildName(thing.uid).."].\nWins: ["..wins.."]. Loses: ["..loses.."].\n")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
return false
end
 
if getCreatureName(thing.uid) == "Evolution" then return false end
 
if not isSummon(thing.uid) then
   table.insert(str, "Você vê um "..string.lower(getCreatureName(thing.uid)).." [level "..getPokemonLevel(thing.uid).."] selvagem.\n")
   if getPokemonGender(thing.uid)  == SEX_MALE then
      table.insert(str, "Este pokémon é macho.")
   elseif getPokemonGender(thing.uid)  == SEX_FEMALE then
      table.insert(str, "Este pokémon é femia.")
   else
      table.insert(str, "Este pokémon é indefinido.")
   end
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
   
elseif isSummon(thing.uid) and not isPlayer(thing.uid) then
   local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
   local boostshow = " + "..boostlevel.."]"
   if showBoostSeparated then
      boostshow = "] [+"..boostlevel.."]"
   end
   local levelinfo = "["..getPokemonLevel(thing.uid)..""..boostshow..""
   if getCreatureMaster(thing.uid) == cid then
      local myball = getPlayerSlotItem(cid, 8).uid
      local nexp = getItemAttribute(myball, "nextlevelexp")
      table.insert(str, "Você vê "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".")
      table.insert(str, "\nVida: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
      table.insert(str, "\n"..getPokemonHappinessDescription(thing.uid))
      if getItemAttribute(myball, "level") <= 299 then
         table.insert(str, "\nExperiencia Para Proximo Level: ["..nexp.."].")
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   else
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você Vê "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".\nVida: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
   end
   return false
end
return true
end

 

 

Servio de nada :p

 

[28/06/2015 15:00:22] [Error - TalkAction Interface]
[28/06/2015 15:00:22] data/talkactions/scripts/move1.lua:onSay
[28/06/2015 15:00:22] Description:
[28/06/2015 15:00:22] data/talkactions/scripts/move1.lua:115: attempt to index local 'moveTable' (a boolean value)
[28/06/2015 15:00:22] stack traceback:
[28/06/2015 15:00:22] data/talkactions/scripts/move1.lua:115: in function <data/talkactions/scripts/move1.lua:20>
Link para o comentário
Compartilhar em outros sites

 

Oi.

Sistema escrito para PDA by Slicer, v1.9. Sua adaptação para outras bases, entretanto, pode ser bem simples.

Para quem não conhece o sistema de mega evoluções, recomendo acessar este link. A diferença é que a pedra (mega stone) não ocupa o espaço de um Held Item tier Y (visto que não são todos os servidores que possuem Held Itens).

data/lib:

cooldown bar.lua:

Troque o código da função getNewMoveTable(table, n) por este:

function getNewMoveTable(table, n)
    if table == nil then
        return false
    end
    local moves = {table.move1, table.move2, table.move3, table.move4, table.move5, table.move6, table.move7, table.move8, table.move9, table.move10, table.move11, table.move12}
    local returnValue = moves
    if n then
        returnValue = moves[n]
    end
    return returnValue
end
No código da função doUpdateMoves(cid), troque o segundo:
table.insert(ret, "n/n,")
por:
local mEvolve
if not getCreatureName(summon):find("Mega") and getItemAttribute(getPlayerSlotItem(cid, 8).uid, "megaStone") then
    if not isInArray(ret, "Mega Evolution,") then
        table.insert(ret, "Mega Evolution,")
        mEvolve = true
    end
end
if not mEvolve then
    table.insert(ret, "n/n,")
end
Depois, em pokemon moves.lua:
Troque:
min = getSpecialAttack(cid) * table.f * 0.1   --alterado v1.6
por:
min = getSpecialAttack(cid) * (table and table.f or 0) * 0.1   --alterado v1.6
Código da spell:
elseif spell == "Mega Evolution" then
    local effect = xxx                          --Efeito de mega evolução.
    if isSummon(cid) then
        local pid = getCreatureMaster(cid)
        if isPlayer(pid) then
            local ball = getPlayerSlotItem(pid, 8).uid
            if ball > 0 then
                local attr = getItemAttribute(ball, "megaStone")
                if attr and megaEvolutions[attr] then
                    local oldPosition, oldLookdir = getThingPos(cid), getCreatureLookDir(cid)
                    doItemSetAttribute(ball, "poke", megaEvolutions[attr][2])
                    doSendMagicEffect(getThingPos(cid), effect)
                    doRemoveCreature(cid)
                    doSummonMonster(pid, megaEvolutions[attr][2])
                    local newPoke = getCreatureSummons(pid)[1]
                    doTeleportThing(newPoke, oldPosition, false)
                    doCreatureSetLookDir(newPoke, oldLookdir)
                    adjustStatus(newPoke, ball, true, false)
                    if useKpdoDlls then
                        addEvent(doUpdateMoves, 5, pid)
                    end
                end
            end
        end
    end
Depois, em configuration.lua:
megaEvolutions = {
    --[itemid] = {"poke_name", "mega_evolution"},
    [11638] = {"Charizard", "Mega Charizard X"},
    [11639] = {"Charizard", "Mega Charizard Y"},
}
Agora, em data/actions/scripts, código da mega stone:
function onUse(cid, item)
    local mEvolution, ball = megaEvolutions[item.itemid], getPlayerSlotItem(cid, 8).uid
    if not mEvolution then
        return doPlayerSendCancel(cid, "Sorry, this isn't a mega stone.")
    elseif ball < 1 then
        return doPlayerSendCancel(cid, "Put a pokeball in the pokeball slot.")
    elseif #getCreatureSummons(cid) > 0 then
        return doPlayerSendCancel(cid, "Return your pokemon.")
    elseif getItemAttribute(ball, "poke") ~= mEvolution[1] then
        return doPlayerSendCancel(cid, "Put a pokeball with a(n) "..mEvolution[1].." in the pokeball slot.")
    elseif getItemAttribute(ball, "megaStone") then
        return doPlayerSendCancel(cid, "Your pokemon is already holding a mega stone.")
    end
    doItemSetAttribute(ball, "megaStone", item.itemid)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Now your "..getItemAttribute(ball, "poke").." is holding a(n) "..getItemNameById(item.itemid)..".")
    doRemoveItem(item.uid)
    return true
end
Depois, em goback.lua:
Abaixo de:
if not pokes[pokemon] then
    return true
end
coloque:
    if pokemon:find("Mega") then
        local normalPoke = megaEvolutions[getItemAttribute(item.uid, "megaStone")][1]
        if normalPoke then
            doItemSetAttribute(item.uid, "poke", normalPoke)
            pokemon = normalPoke
        end
    end
Depois, em data/creaturescripts/scripts, look.lua:
Abaixo de:
local boost = getItemAttribute(thing.uid, "boost") or 0
coloque:
local extraInfo, megaStone = "", getItemAttribute(thing.uid, "megaStone")
if megaStone then
    extraInfo = getItemNameById(megaStone)   
    if pokename:find("Mega") then
        pokename = megaEvolutions[megaStone][1]
    end
end
Depois, acima do primeiro:
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
coloque:
if extraInfo ~= "" then
    table.insert(str, "\nIt's holding a(n) "..extraInfo..".")
end
Já em data/talkactions/scripts, move1.lua:
Abaixo de:
function doAlertReady(cid, id, movename, n, cd)
coloque:
if movename == "Mega Evolution" then return true end
Troque:
    if not move then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")
        return true
    end
por:
if not move then
        local isMega = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "megaStone")
        if not isMega or name:find("Mega") then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")
            return true
        end
        local moveTable, index = getNewMoveTable(movestable[name]), 0
        for i = 1, 12 do
            if not moveTable[i] then
                index = i
                break
            end
        end
        if tonumber(it) ~= index then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")
            return true
        end
        local needCds = true                   --Coloque false se o pokémon puder mega evoluir mesmo com spells em cooldown.
        if needCds then
            for i = 1, 12 do
                if getCD(getPlayerSlotItem(cid, 8).uid, "move"..i) > 0 then
                    return doPlayerSendCancel(cid, "To mega evolve, all the spells of your pokemon need to be ready.")
                end
            end
        end
        move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0, f = 0, t = "?"}
    end
E troque:
doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..move.name.."!", TALKTYPE_SAY)
por:
local spellMessage = msgs[math.random(#msgs)]..""..move.name.."!"
if move.name == "Mega Evolution" then
    spellMessage = "Mega Evolve!"
end
doCreatureSay(cid, getPokeName(mypoke)..", "..spellMessage, TALKTYPE_SAY)
Se quiser que o "Mega" não apareça no nome do pokémon, vá em data/lib, level system.lua:
Acima de:
if getItemAttribute(item, "nick") then
    nick = getItemAttribute(item, "nick")
end
coloque:
    if nick:find("Mega") then
        nick = nick:match("Mega (.*)")
        if not pokes[nick] then
            nick = nick:explode(" ")[1]
        end
    end

Caso queiram que cada mega evolução tenha um clan específico:

Em move1.lua, acima de:

move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0, f = 0, t = "?"}

coloque:

local megaEvoClans = {
    --[mega_stone_id] = "clan_name",
    [91912] = "Volcanic",
    [91913] = "Seavell",
    --etc,
}
if megaEvoClans[isMega] then
    if getPlayerClanName(cid) ~= megaEvoClans[isMega] then
        return doPlayerSendCancel(cid, "You can't mega evolve this pokemon.")
    end
end
Bem, é isso aí. Acho que não esqueci de nada.
Até mais.

 

 

Não entendi a parte ali do Codigo da Spell coloco onde ? Help me !

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...