Ir para conteúdo

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
https://xtibia.com/forum/topic/235005-mega-evolution-system-pxg/page/3/#findComment-1658121
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
https://xtibia.com/forum/topic/235005-mega-evolution-system-pxg/page/3/#findComment-1658123
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
https://xtibia.com/forum/topic/235005-mega-evolution-system-pxg/page/3/#findComment-1658158
Compartilhar em outros sites

goback.lua

  Mostrar conteúdo oculto



look.lua

  Mostrar conteúdo oculto

 

Link para o comentário
https://xtibia.com/forum/topic/235005-mega-evolution-system-pxg/page/3/#findComment-1658167
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:

 

  Mostrar conteúdo oculto

 

Editado por zipter98
Link para o comentário
https://xtibia.com/forum/topic/235005-mega-evolution-system-pxg/page/3/#findComment-1658188
Compartilhar em outros sites

Só que o seu OT é outra base.

  Em 23/06/2015 em 01:27, zipter98 disse:

Sistema escrito para PDA by Slicer, v1.9.

 

Editado por zipter98
Link para o comentário
https://xtibia.com/forum/topic/235005-mega-evolution-system-pxg/page/3/#findComment-1658226
Compartilhar em outros sites

  Em 27/06/2015 em 23:06, zipter98 disse:

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:

 

  Mostrar conteúdo oculto

 

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
https://xtibia.com/forum/topic/235005-mega-evolution-system-pxg/page/3/#findComment-1658234
Compartilhar em outros sites

  Em 23/06/2015 em 01:27, zipter98 disse:

 

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
https://xtibia.com/forum/topic/235005-mega-evolution-system-pxg/page/3/#findComment-1658561
Compartilhar em outros sites

  Em 01/07/2015 em 12:01, FlamesAdmin disse:

@NlalGlalTlo

pokemon moves.lua, na pasta lib.

E em relação ao efeito ? Se eu não tenho no meu cliente qual o processo para adicionar e coloca-lo junto a Mega evolução ?

Link para o comentário
https://xtibia.com/forum/topic/235005-mega-evolution-system-pxg/page/3/#findComment-1658584
Compartilhar em outros sites

  Em 01/07/2015 em 14:46, NlalGlalTlo disse:

E em relação ao efeito ? Se eu não tenho no meu cliente qual o processo para adicionar e coloca-lo junto a Mega evolução ?

Explique melhor por favor.

Link para o comentário
https://xtibia.com/forum/topic/235005-mega-evolution-system-pxg/page/3/#findComment-1658585
Compartilhar em outros sites

×
×
  • Criar Novo...