Mega Evolution System (PxG)

zipter98
em Mods, funções e outros

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Base usada: PDA by Slicer, v1.9

 

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).

 

  • Instalação do sistema (atenção nos detalhes)

 

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 returnValueend
No código da função doUpdateMoves(cid), troque o segundo:
table.insert(ret, "n/n,")

por:

local mEvolveif 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    endendif 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, health_percent_lost = getThingPos(cid), getCreatureLookDir(cid), (getCreatureMaxHealth(cid) - getCreatureHealth(cid)) * 100 / getCreatureMaxHealth(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)                    doCreatureAddHealth(newPoke, -(health_percent_lost * getCreatureMaxHealth(newPoke) / 100))                    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 trueend

 

Depois, em goback.lua:
Abaixo de:
if not pokes[pokemon] then    return trueend

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]    endend

 

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}    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!"enddoCreatureSay(cid, getPokeName(mypoke)..", "..spellMessage, TALKTYPE_SAY)

 

 

  • Se não quiser que o "Mega" 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 clã 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.")    endend

 

Finalizando o tópico após uma pequena reestruturação na indexação, gostaria de levantar algo que acredito ser bem claro: o sistema é cheio de detalhes, muitas vezes minuciosos. Um simples erro e bugs aparecem por toda parte. Se você encontrou algum, pelo menos uma das duas seguintes condições acontecem:
  1. Base DIFERENTE da usada. Peço desculpas, mas não pretendo adaptar o sistema para todas as bases diferentes que aparecerem.
  2. Se a base for a mesma, você com certeza errou em algum ponto da instalação. O sistema foi testado inúmeras vezes, não apenas por mim, e seu funcionamento foi seguidamente comprovado.

 

Façam bom uso, invocadores.

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

FlamesAdmin

avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 28/01/12Posts: 1550Gênero: Masculino

Lol, muito bom, irei testar.

 

#Edit

Fiz td certo, pois acontece isso.

[22/06/2015 22:47:28] Admin Gabriel has logged in.

[22/06/2015 22:47:28] [Error - CreatureScript Interface] 
[22/06/2015 22:47:28] data/creaturescripts/scripts/login.lua:onLogin
[22/06/2015 22:47:28] Description: 
[22/06/2015 22:47:28] (luaGetCreatureName) Creature not found

[22/06/2015 22:47:28] [Error - CreatureScript Interface] 
[22/06/2015 22:47:28] data/creaturescripts/scripts/login.lua:onLogin
[22/06/2015 22:47:28] Description: 
[22/06/2015 22:47:28] data/lib/cooldown bar.lua:128: attempt to index a boolean value
[22/06/2015 22:47:28] stack traceback:
[22/06/2015 22:47:28] 	data/lib/cooldown bar.lua:128: in function 'doUpdateMoves'
[22/06/2015 22:47:28] 	data/creaturescripts/scripts/login.lua:230: in function <data/creaturescripts/scripts/login.lua:6>
[22/06/2015 22:47:28] Admin Gabriel has logged out.

[Show off] Mapping Pokémon (OLD)

[PDA] Pokeball Icon System

 

 

[Mapping] Mapinha Johto = Para conferir, clique Aqui
[Mapping] Outland RockPara conferir, clique Aqui
[Mapping] Centro Pokémon de Cinnabar e cidade de Hamlin(PxG) Para conferir, clique Aqui
[Mapping] Antigo Trade Center(PvP) do PxG Para conferir, clique Aqui
[PDA] Reformulação do level das magias e level dos Pokemons Para conferir, clique Aqui
[PDA] Comando de Clan sem task = Para conferir, clique Aqui
[Utilitário] OT Restarter by: Gabrielbsales(Featzen) Para conferir, clique Aqui
[Database] Descriptografia MD5 & SHA1 = Para conferir, clique Aqui
[Scripting] Level Máximo = Para conferir, clique Aqui

 

Fuuin Fake

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 13/10/12Posts: 168Char no Tibia: Fuuin Fake

PORRA CARA SEGURA MEU RP + CARA TU E MT FODA VELHO PARABENS <3

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Ops, esqueci uma informação específica no segundo passo de instalação do sistema (doUpdateMoves). Editado.

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

FlamesAdmin

avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 28/01/12Posts: 1550Gênero: Masculino

Parabéns zipter, funcionou perfeitamente.

[Show off] Mapping Pokémon (OLD)

[PDA] Pokeball Icon System

 

 

[Mapping] Mapinha Johto = Para conferir, clique Aqui
[Mapping] Outland RockPara conferir, clique Aqui
[Mapping] Centro Pokémon de Cinnabar e cidade de Hamlin(PxG) Para conferir, clique Aqui
[Mapping] Antigo Trade Center(PvP) do PxG Para conferir, clique Aqui
[PDA] Reformulação do level das magias e level dos Pokemons Para conferir, clique Aqui
[PDA] Comando de Clan sem task = Para conferir, clique Aqui
[Utilitário] OT Restarter by: Gabrielbsales(Featzen) Para conferir, clique Aqui
[Database] Descriptografia MD5 & SHA1 = Para conferir, clique Aqui
[Scripting] Level Máximo = Para conferir, clique Aqui

 

Gabrieltxu

O Héroi
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 12/06/12Posts: 2180Gênero: MasculinoChar no Tibia: Supreme Player

auheuahe Boa barcia , deixei meu rep ai para contribuir :v

Canal do facebook de lives!! cola la galera me ajudar seguindo a pagina hehe ! ❤️

 

               https://www.facebook.com/Tuxao0

Luga03

Gabriel Lucena :D
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/04/15Posts: 956Gênero: Masculino

Krl man, nem preciso testar que sei que tu é 10 e vai funfar ^^ vo testar aqui auehaueh mt top vc


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[font='Helvetica Neue', Arial, Verdana, sans-serif]."!", TALKTYPE_SAY)[/font]

Ei man, eu procurei por esta primeira tag que vc falou, e eu n achei! mas achei uma que tinha esta table.f:

min = 5 + getPokemonLevel(cid) + (table.f / 100 * movetype * specialoffenseRate)
max = min + getPokemonLevel(cid) * levelFactor


e de código msm na minha pokemon moves tinha isto:

 

const_distance_delay = 56
 
RollOuts = {
["Voltorb"] = {lookType = 638},
["Electrode"] = {lookType = 637},
["Sandshrew"] = {lookType = 635},
["Sandslash"] = {lookType = 636},
["Omastar"] = {lookType = 1811},
["Shiny Omastar"] = {lookType = 1811},
["Phanpy"] = {lookType = 1005},
["Shiny Phanpy"] = {lookType = 1705},
["Donphan"] = {lookType = 1456},
["Shiny Donphan"] = {lookType = 1590},
["Pink Donphan"] = {lookType = 1837},
["Miltank"] = {lookType = 1006},                --alterado v2.6  peguem o script todo!!
["Golem"] = {lookType = 639},
["Shiny Sandshrew"] = {lookType = 1615},
["Shiny Sandslash"] = {lookType = 1617},
["Shiny Electrode"] = {lookType = 1387},
["Shiny Golem"] = {lookType = 1403},
["Shiny Voltorb"] = {lookType = 1388}
}
 
--//////////////////////////////////////////////////////////////////////////////////////////////////////////--
local function getSubName(cid, target)
if not isCreature(cid) then return "" end
if getCreatureName(cid) == "Ditto" and pokes[getPlayerStorageValue(cid, 1010)] and getPlayerStorageValue(cid, 1010) ~= "Ditto" then
   return getPlayerStorageValue(cid, 1010)
elseif pokeHaveReflect(cid) and isCreature(target) then
   return getCreatureName(target)
else                                                                --alterado v2.6.1
   return getCreatureName(cid)
end
end
 
local function getThingName(cid)
if not isCreature(cid) then return "" end   --alterado v2.6
return getCreatureName(cid)
end
 
function getTableMove(cid, move)               --alterado v2.6
local backup = {f = 0, t = ""}
if getThingName(cid) == "Ditto" and pokes[getPlayerStorageValue(cid, 1010)] and getPlayerStorageValue(cid, 1010) ~= "Ditto" then
   name = getPlayerStorageValue(cid, 1010)
else
   name = getThingName(cid)
end
if not isCreature(cid) or name == "" or not move then return backup end
local x = movestable[name]
if not x then return "" end   
local z = {x.move1, x.move2, x.move3, x.move4, x.move5, x.move6, x.move7, x.move8, x.move9, x.move10, x.move11, x.move12, x.passive1, x.passive2, x.passive3, x.tmove1, x.tmove2, x.tmove3}
if getPlayerStorageValue(cid, 21103) ~= -1 then
   local sto = getPlayerStorageValue(cid, 21103) 
   setPlayerStorageValue(cid, 21103, -1) 
   return {f = sto, t = ""} 
end
for j = 1, 15 do
  if z[j] and z[j].name == move then
     return z[j]
  end
end
return movesinfo[move]
end
 
function getMasterTarget(cid)
if isCreature(cid) and getPlayerStorageValue(cid, 21101) ~= -1 then
   return getPlayerStorageValue(cid, 21101)   --alterado v2.6
end
    if isSummon(cid) then
   return getCreatureTarget(getCreatureMaster(cid))
else
   return getCreatureTarget(cid)
    end
end
 
local function getSubName(cid, target)
if not isCreature(cid) then return "" end
if getCreatureName(cid) == "Shiny Ditto" and pokes[getPlayerStorageValue(cid, 1010)] and getPlayerStorageValue(cid, 1010) ~= "Shiny Ditto" then
   return getPlayerStorageValue(cid, 1010)
elseif pokeHaveReflect(cid) and isCreature(target) then
   return getCreatureName(target)
else                                                                --alterado v2.6.1
   return getCreatureName(cid)
end
end
 
local function getThingName(cid)
if not isCreature(cid) then return "" end   --alterado v2.6
return getCreatureName(cid)
end
 
function getTableMove(cid, move)               --alterado v2.6
local backup = {f = 0, t = ""}
if getThingName(cid) == "Shiny Ditto" and pokes[getPlayerStorageValue(cid, 1010)] and getPlayerStorageValue(cid, 1010) ~= "Shiny Ditto" then
   name = getPlayerStorageValue(cid, 1010)
else
   name = getThingName(cid)
end
if not isCreature(cid) or name == "" or not move then return backup end
local x = movestable[name]
if not x then return "" end   
local z = {x.move1, x.move2, x.move3, x.move4, x.move5, x.move6, x.move7, x.move8, x.move9, x.move10, x.move11, x.move12, x.passive1, x.passive2, x.passive3, x.tmove1, x.tmove2, x.tmove3}
if getPlayerStorageValue(cid, 21103) ~= -1 then
   local sto = getPlayerStorageValue(cid, 21103) 
   setPlayerStorageValue(cid, 21103, -1) 
   return {f = sto, t = ""} 
end
for j = 1, 15 do
  if z[j] and z[j].name == move then
     return z[j]
  end
end
return movesinfo[move]
end
 
function getMasterTarget(cid)
if isCreature(cid) and getPlayerStorageValue(cid, 21101) ~= -1 then
   return getPlayerStorageValue(cid, 21101)   --alterado v2.6
end
    if isSummon(cid) then
   return getCreatureTarget(getCreatureMaster(cid))
else
   return getCreatureTarget(cid)
    end
end
--////////////////////////////////////////////////////////////////////////////////////////////////////////--
 
function docastspell(cid, spell, mina, maxa)
 
local target = 0
local getDistDelay = 0
 
if not isCreature(cid) or getCreatureHealth(cid) <= 0 then return false end --alterado v2.6
if isSleeping(cid) and getPlayerStorageValue(cid, 21100) <= -1 then return true end   --alterado v2.6
 
if isCreature(getMasterTarget(cid)) then
target = getMasterTarget(cid)
getDistDelay = getDistanceBetween(getThingPosWithDebug(cid), getThingPosWithDebug(target)) * const_distance_delay
end
 
if isMonster(cid) and not isSummon(cid) then
if getCreatureCondition(cid, CONDITION_EXHAUST) then
return true
end
doCreatureAddCondition(cid, wildexhaust)
end
 
local mydir = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
 
local min = 0
local max = 0 
local movetype = getSpecialAttack(cid) 
local table = getTableMove(cid, spell) --alterado v2.6                                                                                                                                                                                                                                                                   
                                                                                       --alterado v2.7 \/\/
if ehMonstro(cid) and isCreature(getMasterTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getMasterTarget(cid))) then 
   local target = getMasterTarget(cid)
   if math.random(1, 100) <= passivesChances["Evasion"][getCreatureName(target)] then                                                                                      
      if isCreature(getMasterTarget(target)) then   
         doSendMagicEffect(getThingPosWithDebug(target), 211)
         doSendAnimatedText(getThingPosWithDebug(target), "TOO BAD", 215)                                 
         doTeleportThing(target, getClosestFreeTile(target, getThingPosWithDebug(cid)), false)
         doSendMagicEffect(getThingPosWithDebug(target), 211)
         doFaceCreature(target, getThingPosWithDebug(cid)) 
         return false   --alterado v2.8
      end
    end    
end
 
--- FEAR / ROAR / SILENCE ---
if (isWithFear(cid) or isSilence(cid)) and getPlayerStorageValue(cid, 21100) <= -1 then
return true                                      --alterado v2.6!!
end
----------------------------
 
if mina and maxa then
min = math.abs(mina)
max = math.abs(maxa)
elseif not isPlayer(cid) then
if table ~= "" then   --alterado v2.6
   if table.t == "fighting" then   --alterado v2.6
movetype = getOffense(cid) * 0.95 + getSpecialAttack(cid) * 0.45      
elseif table.t == "normal" then  --alterado v2.6
movetype = movetype * 0.6 + getOffense(cid) * 0.6
end                                --alterado v2.6
   min = 5 + getPokemonLevel(cid) + (table.f / 100 * movetype * specialoffenseRate)
   max = min + getPokemonLevel(cid) * levelFactor
 
   if spell == "Selfdestruct" then
      min = getCreatureHealth(cid)  --alterado v2.6
      max = getCreatureHealth(cid)
        end
        
if not isSummon(cid) and not isInArray({"Demon Puncher", "Demon Kicker"}, spell) then --alterado v2.7
doCreatureSay(cid, string.upper(spell).."!", TALKTYPE_MONSTER)
end
if isNpcSummon(cid) then
local mnn = {" use ", " "}
local use = mnn[math.random(#mnn)]
doCreatureSay(getCreatureMaster(cid), getPlayerStorageValue(cid, 1007)..","..use..""..doCorrectString(spell).."!", 1)
end
else
   print("Error trying to use move "..spell..", move not specified in the pokemon table.")
end
 
end
--- FOCUS ----------------------------------            
if getPlayerStorageValue(cid, 253) >= 0 and table ~= "" and table.f ~= 0 then  --alterado v2.6
min = min * 2
max = max * 2
setPlayerStorageValue(cid, 253, -1)
end
--- Shredder Team -------------------------------
if getPlayerStorageValue(cid, 637501) >= 1 then
   if #getCreatureSummons(cid) == 1 then
      docastspell(getCreatureSummons(cid)[1], spell)
   elseif #getCreatureSummons(cid) == 2 then
      docastspell(getCreatureSummons(cid)[1], spell)
      docastspell(getCreatureSummons(cid)[2], spell)
   end    
      
elseif getPlayerStorageValue(cid, 637500) >= 1 then
   min = 0
   max = 0                                     
end
------------------Miss System--------------------------
local cd = getPlayerStorageValue(cid, conds["Miss"])
local cd2 = getPlayerStorageValue(cid, conds["Confusion"])      --alterado v2.5
local cd3 = getPlayerStorageValue(cid, conds["Stun"]) 
if cd >= 0 or cd2 >= 0 or cd3 >= 0 then                                                         --alterado v2.7
   if not isInArray({"Aromateraphy", "Emergency Call", "Magical Leaf", "Sunny Day", "Safeguard", "Rain Dance"}, spell) and getPlayerStorageValue(cid, 21100) <= -1 then
      if math.random(1, 100) > 30 then                                                                                       --alterado v2.6
         doSendAnimatedText(getThingPosWithDebug(cid), "MISS", 215)
         return false
      end
   end
end
---------------GHOST DAMAGE-----------------------
ghostDmg = GHOSTDAMAGE
psyDmg = PSYCHICDAMAGE
 
if getPlayerStorageValue(cid, 999457) >= 1 and table ~= "" and table.f ~= 0 then    --alterado v2.6
   psyDmg = MIRACLEDAMAGE                                                              
   ghostDmg = DARK_EYEDAMAGE
   addEvent(setPlayerStorageValue, 50, cid, 999457, -1)
end
--------------------REFLECT----------------------
setPlayerStorageValue(cid, 21100, -1)                 --alterado v2.6
if not isInArray({"Psybeam", "Sand Attack", "Flamethrower"}, spell) then  --alterado v2.8
   setPlayerStorageValue(cid, 21101, -1)
end
setPlayerStorageValue(cid, 21102, spell)
---------------------------------------------------

 



o resto tudo era as magias!

Hello! How are you? It's fine? 

 

Okay, so you like my helps? if yes, then do you can like my post, give-me a reputation, you can't?

 

Good morning for everyone! And have a good day!

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Troque:

 

min = 5 + getPokemonLevel(cid) + (table.f / 100 * movetype * specialoffenseRate)
por:
min = 5 + getPokemonLevel(cid) + ((table and table.f or 0) / 100 * movetype * specialoffenseRate)

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

Luga03

Gabriel Lucena :D
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/04/15Posts: 956Gênero: Masculino

ai man funcionou! mas teria como por para "desevoluir" por um comando?? e se o player passar com mais de 2 minutos, com ele transformado, ele se destransforma sósinho?? apqp agr é só puxar o poke que ele já volta ao normal ._.

Hello! How are you? It's fine? 

 

Okay, so you like my helps? if yes, then do you can like my post, give-me a reputation, you can't?

 

Good morning for everyone! And have a good day!

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Recomendo ler o terceiro parágrafo do tópico.

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

Luga03

Gabriel Lucena :D
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/04/15Posts: 956Gênero: Masculino

Eu li, a parte do temporário, mas int poderia fazer uma talkactions onde ele se destransforma sem precisar do go/back?

Hello! How are you? It's fine? 

 

Okay, so you like my helps? if yes, then do you can like my post, give-me a reputation, you can't?

 

Good morning for everyone! And have a good day!

nociam

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 04/02/13Posts: 541Gênero: Masculino

Nao seria interessante se o icon da mega evoluçao so aparecer se o pokemon estiver com o atribute da mega evolucao? ai fica 100% PXG.

 

sem mega evoluçao

 

qKH6mdx.png

 

com o atribute mega

 

1IqtA1F.png

 

 

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Seria sim, mas não programo no OTClient. No entanto, li um pouco do código da barra de magias de lá e pensei que a modificação que fiz em cooldown bar.lua a alteraria. Você testou o sistema depois da última atualização?

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

Fuuin Fake

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 13/10/12Posts: 168Char no Tibia: Fuuin Fake
[24/06/2015 00:24:48] [Error - CreatureScript Interface] 
[24/06/2015 00:24:48] data/creaturescripts/scripts/look.lua:onLook
[24/06/2015 00:24:48] Description: 
[24/06/2015 00:24:48] data/creaturescripts/scripts/look.lua:198: attempt to concatenate global 'extraInfo' (a nil value)
[24/06/2015 00:24:48] stack traceback:
[24/06/2015 00:24:48] 	data/creaturescripts/scripts/look.lua:198: in function <data/creaturescripts/scripts/look.lua:27>
[24/06/2015 00:25:00] > Broadcasted message: "Quando você conseguir algo importante ou for sair do servidor , use o comando !save para salvar o seu char.".


meu 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 v1.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"},
}

local shinys = {
["Shiny Abra"] = "Dark Abra",
["Shiny Onix"] = "Crystal Onix",
["Shiny Gyarados"] = "Red Gyarados",
["Shiny Charizard"] = "Elder Charizard",
["Shiny Venusaur"] = "Ancient Venusaur",
["Shiny Blastoise"] = "Ancient Blastoise",
["Shiny Farfetch'd"] = "Elite Farfetch'd",
["Shiny Hitmonlee"] = "Elite Hitmonlee",
["Shiny Himonchan"] = "Elite Hitmonchan",
["Shiny Snorlax"] = "Big Snorlax",
}

-- tabela adicionado ao configuration só procura por price = ..--

function onLook(cid, thing, position, lookDistance)
                                                                                                                  
local str = {}
local iname = getItemInfo(thing.itemid)
                                                                                          
if not isCreature(thing.uid) then
   if not iname or not iname.name then return true end
   if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then --alterado aki       
      local owner = getItemAttribute(thing.uid, "firstpoke")
      local pokename = getItemAttribute(thing.uid, "poke")
      unLock(thing.uid)
      local lock = getItemAttribute(thing.uid, "lock")          
      if shinys[pokename] then
         pokename = shinys[pokename]
      end
          
      local ballName = iname.name
      if getItemAttribute(thing.uid, 'ball') then
         ballName = getItemAttribute(thing.uid, 'ball').. " ball"
      end
      table.insert(str, "You see "..iname.article.." "..ballName..".")  
      if getItemAttribute(thing.uid, "unique") then                    
         table.insert(str, " It's an unique item.")   
      end
      if lock and lock > 0 then
         table.insert(str, "\nIt will unlock in ".. os.date("%d/%m/%y %X", lock)..".")  
      end
      table.insert(str, "\nContains "..getArticle(pokename).." "..pokename)
          
      if getItemAttribute(thing.uid, "nick") then
         table.insert(str, " ("..getItemAttribute(thing.uid, "nick")..")")
      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)
      end
      if prices[pokename] then
         table.insert(str, ". $Price: ".. prices[pokename].."")
      else
         table.insert(str, ". Price: unsellable")
      end
      table.insert(str, ".")
          
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false         
   elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then     
      local name = iname.name
            name = string.gsub(name, "fainted ", "")
            name = string.gsub(name, "defeated ", "")
            name = doCorrectPokemonName(name)
      if shinys[name] then
         name = shinys[name]
      end
      name = "fainted "..name:lower()
           
      table.insert(str, "You see "..iname.article.." "..name..". ")     
      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, "It is male.")
      elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
         table.insert(str, "It is female.")
      else
         table.insert(str, "It is genderless.")
      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, "You see "..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    
      local p = getThingPos(thing.uid)
   
      table.insert(str, "You see ")
      if thing.type > 1 then
         table.insert(str, thing.type.." "..iname.plural..".")
      else
         table.insert(str, iname.article.." "..iname.name..".")
      end
      table.insert(str, " It's an unique item.\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 ehNPC(thing.uid) and NPCBattle[npcname] then    --npcs duel
   table.insert(str, "You see "..npcname..". "..NPCBattle[npcname].artig.." leader of the gym from "..NPCBattle[npcname].cidbat..".")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
end
if getPlayerStorageValue(thing.uid, 697548) ~= -1 then    
   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    --outros npcs
   table.insert(str, "You see "..getCreatureName(thing.uid)..".")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
end

if isPlayer(thing.uid) then     --player
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getPlayerDesc(cid, thing.uid, false))  
return false
end

if getCreatureName(thing.uid) == "Evolution" then return false end

if not isSummon(thing.uid) then   --monstros
   
   table.insert(str, "You see a wild "..string.lower(getCreatureName(thing.uid))..".\n")
   if getPokemonGender(thing.uid) == SEX_MALE then
      table.insert(str, "It is male.")
   elseif getPokemonGender(thing.uid) == SEX_FEMALE then
      table.insert(str, "It is female.")
   else
      table.insert(str, "It is genderless.")
   end
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false

elseif isSummon(thing.uid) and not isPlayer(thing.uid) then  --summons

   local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
   if getCreatureMaster(thing.uid) == cid then
      local myball = getPlayerSlotItem(cid, 8).uid
      table.insert(str, "You see your "..string.lower(getCreatureName(thing.uid))..".")
      if boostlevel > 0 then
         table.insert(str, "\nBoost level: +"..boostlevel..".")
      end
      table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
      table.insert(str, "\n"..getPokemonHappinessDescription(thing.uid))
      if extraInfo ~= "" then
    table.insert(str, "\nIt's holding a(n) "..extraInfo..".")
end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   else
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid))..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
   end
   return false
end
return true
end

FlamesAdmin

avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 28/01/12Posts: 1550Gênero: Masculino

Nao seria interessante se o icon da mega evoluçao so aparecer se o pokemon estiver com o atribute da mega evolucao? ai fica 100% PXG.

 

sem mega evoluçao

 

qKH6mdx.png

 

com o atribute mega

 

1IqtA1F.png

 

 

Pelo que eu testei aqui, ja esta assim

[Show off] Mapping Pokémon (OLD)

[PDA] Pokeball Icon System

 

 

[Mapping] Mapinha Johto = Para conferir, clique Aqui
[Mapping] Outland RockPara conferir, clique Aqui
[Mapping] Centro Pokémon de Cinnabar e cidade de Hamlin(PxG) Para conferir, clique Aqui
[Mapping] Antigo Trade Center(PvP) do PxG Para conferir, clique Aqui
[PDA] Reformulação do level das magias e level dos Pokemons Para conferir, clique Aqui
[PDA] Comando de Clan sem task = Para conferir, clique Aqui
[Utilitário] OT Restarter by: Gabrielbsales(Featzen) Para conferir, clique Aqui
[Database] Descriptografia MD5 & SHA1 = Para conferir, clique Aqui
[Scripting] Level Máximo = Para conferir, clique Aqui