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.










info
Grupo: Herói
Registrado: 20/09/12
Posts: 2.6k
Reputação: +1.1k
Gê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).
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 returnValueendtable.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,")endmin = getSpecialAttack(cid) * table.f * 0.1 --alterado v1.6por:
min = getSpecialAttack(cid) * (table and table.f or 0) * 0.1 --alterado v1.6elseif 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 endDepois, em configuration.lua:
megaEvolutions = { --[itemid] = {"poke_name", "mega_evolution"}, [11638] = {"Charizard", "Mega Charizard X"}, [11639] = {"Charizard", "Mega Charizard Y"},}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 trueendif not pokes[pokemon] then return trueendcoloque:
if pokemon:find("Mega") then local normalPoke = megaEvolutions[getItemAttribute(item.uid, "megaStone")][1] if normalPoke then doItemSetAttribute(item.uid, "poke", normalPoke) pokemon = normalPoke end endDepois, em data/creaturescripts/scripts, look.lua:
local boost = getItemAttribute(thing.uid, "boost") or 0coloque:
local extraInfo, megaStone = "", getItemAttribute(thing.uid, "megaStone")if megaStone then extraInfo = getItemNameById(megaStone) if pokename:find("Mega") then pokename = megaEvolutions[megaStone][1] endenddoPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))coloque:
if extraInfo ~= "" then table.insert(str, "\nIt's holding a(n) "..extraInfo..".")endfunction doAlertReady(cid, id, movename, n, cd)coloque:
if movename == "Mega Evolution" then return true endTroque:
if not move then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.") return true endpor:
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} endE 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)if getItemAttribute(item, "nick") then nick = getItemAttribute(item, "nick")endcoloque:
if nick:find("Mega") then nick = nick:match("Mega (.*)") if not pokes[nick] then nick = nick:explode(" ")[1] end endEm 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.") endendFaçam bom uso, invocadores.
Editado Dezembro 9 por zipter98