Bom, como um individuo(Vudi) não sabe cumprir o que fala, vou postar o sistema aqui.(não cabe ao post explicar aqui)
Bom, aqui está o smeargle system, igual o da PxG. Vamos lá.
1 - Vá na pasta Lib, substitua seu cooldown bar.lua por isso:
function getPlayerPokeballs(cid) --alterado v1.9 \/ local ret = {} local container = 0 if isCreature(cid) then container = getPlayerSlotItem(cid, 3).uid local myball = getPlayerSlotItem(cid, 8) if myball.uid > 0 then table.insert(ret, myball) end else container = cid end if isContainer(container) and getContainerSize(container) > 0 then for slot = 0, (getContainerSize(container) - 1) do local item = getContainerItem(container, slot) if isContainer(item.uid) then local itemsbag = getPlayerPokeballs(item.uid) if itemsbag and #itemsbag > 0 then for i = 0, #itemsbag do table.insert(ret, itemsbag[i]) end end elseif isPokeball(item.itemid) then table.insert(ret, item) end end end return ret end function doUpdatePokemonsBar(cid) if not isCreature(cid) then return true end if getPlayerStorageValue(cid, 656494) > 0 then return true end setPlayerStorageValue(cid, 656494, 1000) addEvent(setPlayerStorageValue, 100, cid, 656494, -1) local ret = {} table.insert(ret, "p#,") local balls = getPlayerPokeballs(cid) local times = 0 for a = 1, #balls do local item = balls[a] local hp = math.ceil(getItemAttribute(item.uid, "hp") * 100) local name = getItemAttribute(item.uid, "poke") local port = getPlayerSlotItem(cid, CONST_SLOT_LEGS) if fotos[name] >= 11137 and fotos[name] <= 11387 then times = times + 1 local foto = fotos[name] - 911 doItemSetAttribute(item.uid, "ballorder", times) table.insert(ret, foto..","..name..""..times..","..hp..",") elseif fotos[name] >= 12605 then times = times + 1 local foto = fotos[name] - 1178 --alterado v1.9 doItemSetAttribute(item.uid, "ballorder", times) table.insert(ret, foto..","..name..""..times..","..hp..",") else times = times + 1 local foto = fotos[name] - 928 doItemSetAttribute(item.uid, "ballorder", times) table.insert(ret, foto..","..name..""..times..","..hp..",") end end doPlayerSendCancel(cid, table.concat(ret)) end function getNewMoveTable(table, n) if table == nil or not n 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} return moves[n] or false end function doUpdateMoves(cid) if not isCreature(cid) then return true end local summon = getCreatureSummons(cid)[1] local ret = {} table.insert(ret, "12&,") if not summon then for a = 1, 12 do table.insert(ret, "n/n,") end doPlayerSendCancel(cid, table.concat(ret)) addEvent(doUpdateCooldowns, 100, cid) return true end if isTransformed(summon) then --alterado v1.9 moves = movestable[getPlayerStorageValue(summon, 1010)] else moves = getCreatureName(summon) == "Smeargle" and getSmeargleMoveTable(cid) or movestable[getCreatureName(summon)] end for a = 1, 12 do local b = getNewMoveTable(moves, a) if b then table.insert(ret, (b.name:find("Sketch") and "Sketch" or b.name)..",") else table.insert(ret, "n/n,") end end doPlayerSendCancel(cid, table.concat(ret)) addEvent(doUpdateCooldowns, 100, cid) end function doUpdateCooldowns(cid) if not isCreature(cid) then return true end local a = getPlayerSlotItem(cid, 8) local ret = {} table.insert(ret, "12|,") if a.uid <= 0 or #getCreatureSummons(cid) <= 0 then for cds = 1, 12 do if useOTClient then table.insert(ret, "-1|0,") else table.insert(ret, "-1,") end end doPlayerSendCancel(cid, table.concat(ret)) return true end for cds = 1, 12 do ---- local summon = getCreatureSummons(cid)[1] if summon and getPlayerStorageValue(summon, 212123) >= 1 then cdzin = "cm_move"..cds else cdzin = "move"..cds end ---- if isTransformed(summon) then --alterado v1.9 moves = movestable[getPlayerStorageValue(summon, 1010)] else moves = movestable[getCreatureName(summon)] end local b = getNewMoveTable(moves, cds) if not b then for cds = 1, 12 do if useOTClient then table.insert(ret, "-1|0,") else table.insert(ret, "-1,") end --alterado v1.9 end doPlayerSendCancel(cid, table.concat(ret)) return true end ---- if getCD(a.uid, cdzin) > 0 then if (useOTClient and b) then table.insert(ret, (getCD(a.uid, cdzin)).."|"..(1)..",") else table.insert(ret, (getCD(a.uid, cdzin))..",") end else if (useOTClient and b) then table.insert(ret, "0|"..(1)..",") else table.insert(ret, "0,") end end end doPlayerSendCancel(cid, table.concat(ret)) end function getBallsAttributes(item) local t = {"poke", "gender", "nick", "boost", "happy", "hp", "description", "transBegin", "hunger", "transLeft", "transTurn", "transOutfit", "transName", "trans", "light", "blink", "move1", "move2", "move3", "move4", "move5", "move6", "move7", "move8", "move9", "move10", "move11", "move12", "ballorder", "hands", "aura", "burn", "burndmg", "poison", "poisondmg", "confuse", "sleep", "miss", "missSpell", "missEff", "fear", "fearSkill", "silence", "silenceEff", "stun", "stunEff", "stunSpell", "paralyze", "paralyzeEff", "slow", "slowEff", "leech", "leechdmg", "Buff1", "Buff2", "Buff3", "Buff1skill", "Buff2skill", "Buff3skill", "control", "unique", "task", "lock"} local ret = {} for a = 1, #t do if getItemAttribute(item, t[a]) == "hands" then return end ret[t[a]] = getItemAttribute(item, t[a]) or false end return ret end function doChangeBalls(cid, item1, item2) if not isCreature(cid) then return true end if item1.uid == item2.uid then if #getCreatureSummons(cid) <= 0 then doGoPokemon(cid, getPlayerSlotItem(cid, 8)) else doReturnPokemon(cid, getCreatureSummons(cid)[1], getPlayerSlotItem(cid, 8), pokeballs[getPokeballType(getPlayerSlotItem(cid, 8).itemid)].effect) end return true end if item1.uid > 0 and item2.uid > 0 then local io = getBallsAttributes(item1.uid) local it = getBallsAttributes(item2.uid) for a, b in pairs (io) do if b then doItemSetAttribute(item2.uid, a, b) else doItemEraseAttribute(item2.uid, a) end end for a, b in pairs (it) do if b then doItemSetAttribute(item1.uid, a, b) else doItemEraseAttribute(item1.uid, a) end end local id = item2.itemid doTransformItem(item2.uid, item1.itemid) doTransformItem(item1.uid, id) doGoPokemon(cid, getPlayerSlotItem(cid, 8)) else local id = item2.itemid local b = getBallsAttributes(item2.uid) local a = doPlayerAddItem(cid, 2643, false) for c, d in pairs (b) do if d then doItemSetAttribute(a, c, d) else doItemEraseAttribute(a, c) end end doRemoveItem(item2.uid, 1) doTransformItem(a, id) doGoPokemon(cid, getPlayerSlotItem(cid, 8)) end end
2 - Ainda no Lib, no fim(depois do ultimo end) do Some Functions.lua, adicione isso:
function getSmeargleMoveTable(master) local ball = getPlayerSlotItem(master, 8).uid local moves = {} local skts = {"skt1", "skt2", "skt3", "skt4", "skt5", "skt6", "skt7", "skt8"} for x=1, #skts do moves["move"..x] = getItemAttribute(ball, skts[x]) and movestable[getItemAttribute(ball, skts[x])]["move"..x] and movestable[getItemAttribute(ball, skts[x])]["move"..x] ~= -1 and movestable[getItemAttribute(ball, skts[x])]["move"..x] or movestable["Smeargle"]["move"..x] end return moves end function smeargleHaveSpell(cid, spellname) local has = false local moves = getSmeargleMoveTable(cid) local ball = getPlayerSlotItem(cid, 8).uid local skts = {"skt1", "skt2", "skt3", "skt4", "skt5", "skt6", "skt7", "skt8"} for x=1, #skts do if getItemAttribute(ball, skts[x]) and moves["move"..x].name == spellname then has = true break end end return has end
3 - Agora no order.lua, do Actions, em baixo de:
if getTileThingByPos(checkpos).uid <= 0 then return true end
Adicione:
4 - Se seu servidor ja tiver os spells, sketch 1, sketch 2... Substitua por esses(data/lib/pokemon moves.lua):
elseif spell == "Sketch 1" then if isSummon(cid) and isPlayer(getCreatureMaster(cid)) then setPlayerStorageValue(cid, 18554, 1) addEvent(function() if isCreature(cid) then setPlayerStorageValue(cid, 18554, -1) end end, 3000) else local spells = {"Psy Pulse", "Shadow Ball", "Thunder Bolt", "Ember", "Rock Throw", "Razor Leaf", "Bubbles", "Ice Shards", "Egg Bomb", "Poison Bomb"} local random = math.random(1, #spells) local randommove = spells[random] local pos = getThingPosWithDebug(cid) pos.y = pos.y - 1 doSendMagicEffect(pos, 0) local function doMetronome(cid, skill) if not isCreature(cid) then return true end docastspell(cid, skill) end addEvent(doMetronome, 200, cid, randommove) end elseif spell == "Sketch 2" then if isSummon(cid) and isPlayer(getCreatureMaster(cid)) then setPlayerStorageValue(cid, 18554, 2) addEvent(function() if isCreature(cid) then setPlayerStorageValue(cid, 18554, -1) end end, 3000) else local spells = {"Mud Bomb", "Cyber Pulse", "Dark Pulse", "Rock Slide", "Magical Leaf", "Fireball", "Waterball", "Feather Dance"} local random = math.random(1, #spells) local randommove = spells[random] local pos = getThingPosWithDebug(cid) pos.y = pos.y - 1 doSendMagicEffect(pos, 0) local function doMetronome(cid, skill) if not isCreature(cid) then return true end docastspell(cid, skill) end addEvent(doMetronome, 200, cid, randommove) end elseif spell == "Sketch 3" then if isSummon(cid) and isPlayer(getCreatureMaster(cid)) then setPlayerStorageValue(cid, 18554, 3) addEvent(function() if isCreature(cid) then setPlayerStorageValue(cid, 18554, -1) end end, 3000) else local spells = {"Poison Gas", "Earthquake", "Petal Tornado", "Electro Field", "Flame Circle"} local random = math.random(1, #spells) local randommove = spells[random] local pos = getThingPosWithDebug(cid) pos.y = pos.y - 1 doSendMagicEffect(pos, 0) local function doMetronome(cid, skill) if not isCreature(cid) then return true end docastspell(cid, skill) end addEvent(doMetronome, 200, cid, randommove) end elseif spell == "Sketch 4" then if isSummon(cid) and isPlayer(getCreatureMaster(cid)) then setPlayerStorageValue(cid, 18554, 4) addEvent(function() if isCreature(cid) then setPlayerStorageValue(cid, 18554, -1) end end, 3000) else local spells = {"Thunder", "Night Slash", "Confusion", "Air Slash", "Confusion", "Night Shade"} local random = math.random(1, #spells) local randommove = spells[random] local pos = getThingPosWithDebug(cid) pos.y = pos.y - 1 doSendMagicEffect(pos, 0) local function doMetronome(cid, skill) if not isCreature(cid) then return true end docastspell(cid, skill) end addEvent(doMetronome, 200, cid, randommove) end elseif spell == "Sketch 5" then if isSummon(cid) and isPlayer(getCreatureMaster(cid)) then setPlayerStorageValue(cid, 18554, 5) addEvent(function() if isCreature(cid) then setPlayerStorageValue(cid, 18554, -1) end end, 3000) else local spells = {"Solar Beam", "Bullet Seed", "Raging Blast", "Fire Blast", "Bubble Blast", "Hydro Cannon", "Pin Missile"} local random = math.random(1, #spells) local randommove = spells[random] local pos = getThingPosWithDebug(cid) pos.y = pos.y - 1 doSendMagicEffect(pos, 0) local function doMetronome(cid, skill) if not isCreature(cid) then return true end docastspell(cid, skill) end addEvent(doMetronome, 200, cid, randommove) end elseif spell == "Sketch 6" then if isSummon(cid) and isPlayer(getCreatureMaster(cid)) then setPlayerStorageValue(cid, 18554, 6) addEvent(function() if isCreature(cid) then setPlayerStorageValue(cid, 18554, -1) end end, 3000) else local spells = {"Shockwave", "Petal Dance", "Hyper Beam", "Zap Cannon", "Aurora Beam", "Ice Beam", "Ground Chop"} local random = math.random(1, #spells) local randommove = spells[random] local pos = getThingPosWithDebug(cid) pos.y = pos.y - 1 doSendMagicEffect(pos, 0) local function doMetronome(cid, skill) if not isCreature(cid) then return true end docastspell(cid, skill) end addEvent(doMetronome, 200, cid, randommove) end elseif spell == "Sketch 7" then if isSummon(cid) and isPlayer(getCreatureMaster(cid)) then setPlayerStorageValue(cid, 18554, 7) addEvent(function() if isCreature(cid) then setPlayerStorageValue(cid, 18554, -1) end end, 3000) else local spells = {"Fear", "Sunny Day", "Scary Face", "Skull Bash", "Cotton Spore", "Sleep Powder"} local random = math.random(1, #spells) local randommove = spells[random] local pos = getThingPosWithDebug(cid) pos.y = pos.y - 1 doSendMagicEffect(pos, 0) local function doMetronome(cid, skill) if not isCreature(cid) then return true end docastspell(cid, skill) end addEvent(doMetronome, 200, cid, randommove) end elseif spell == "Sketch 8" then if isSummon(cid) and isPlayer(getCreatureMaster(cid)) then setPlayerStorageValue(cid, 18554, 8) addEvent(function() if isCreature(cid) then setPlayerStorageValue(cid, 18554, -1) end end, 3000) else local spells = {"Reflect", "Charm", "Agility", "Safeguard", "Synthesis", "Emergency Call", "Healarea", "Sing"} local random = math.random(1, #spells) local randommove = spells[random] local pos = getThingPosWithDebug(cid) pos.y = pos.y - 1 doSendMagicEffect(pos, 0) local function doMetronome(cid, skill) if not isCreature(cid) then return true end docastspell(cid, skill) end addEvent(doMetronome, 200, cid, randommove) end
Se não, use os mesmos acima, não esqueça de adicionar no spells.xml.
5 - Agora, vá em talkactions/scripst, abra o move1.lua e substitua:
local move = movestable[name].move1
Por
local idd = getPlayerSlotItem(cid, 8).uid local move = getCreatureName(mypoke) == "Smeargle" and getItemAttribute(idd, "skt1") and movestable[getItemAttribute(idd, "skt1")].move1 or movestable[name].move1
Depois:
if it == "2" then move = movestable[name].move2 elseif it == "3" then move = movestable[name].move3 elseif it == "4" then move = movestable[name].move4 elseif it == "5" then move = movestable[name].move5 elseif it == "6" then move = movestable[name].move6 elseif it == "7" then move = movestable[name].move7 elseif it == "8" then move = movestable[name].move8 elseif it == "9" then move = movestable[name].move9 elseif it == "10" then move = movestable[name].move10 elseif it == "11" then move = movestable[name].move11 elseif it == "12" then move = movestable[name].move12 elseif it == "13" then move = movestable[name].move13 end
Por:
if it == "2" then if getItemAttribute(idd, "skt2") then move = movestable[getItemAttribute(idd, "skt2")].move2 else move = movestable[name].move2 end elseif it == "3" then if getItemAttribute(idd, "skt3") then move = movestable[getItemAttribute(idd, "skt3")].move3 else move = movestable[name].move3 end elseif it == "4" then if getItemAttribute(idd, "skt4") then move = movestable[getItemAttribute(idd, "skt4")].move4 else move = movestable[name].move4 end elseif it == "4" then if getItemAttribute(idd, "skt4") then move = movestable[getItemAttribute(idd, "skt4")].move4 else move = movestable[name].move4 end elseif it == "5" then if getItemAttribute(idd, "skt5") then move = movestable[getItemAttribute(idd, "skt5")].move5 else move = movestable[name].move5 end elseif it == "6" then if getItemAttribute(idd, "skt6") then move = movestable[getItemAttribute(idd, "skt6")].move6 else move = movestable[name].move6 end elseif it == "7" then if getItemAttribute(idd, "skt7") then move = movestable[getItemAttribute(idd, "skt7")].move7 else move = movestable[name].move7 end elseif it == "8" then if getItemAttribute(idd, "skt8") then move = movestable[getItemAttribute(idd, "skt8")].move8 else move = movestable[name].move8 end elseif it == "9" then move = movestable[name].move9 elseif it == "10" then move = movestable[name].move10 elseif it == "11" then move = movestable[name].move11 elseif it == "12" then move = movestable[name].move12 elseif it == "13" then move = movestable[name].move13 end
Pronto, se tiver feito tudo certo, funcionará.
Como ficará:
Como usar:
Créditos: Eu(Todo o script)