Jump to content

Recommended Posts

Ola, desculpa de for flood :/ o sistema esta optimo porem eu fui la pegar o Healing Wish (m7) e Moonblast (m8) da gardevoir (que foram adicionados recentemente por min) e quando fui usar no smeargle nada acontece só fala assim:

 

01:53 [ADM] Evary [501]: Smeargle, use Healing Wish!

01:53 [ADM] Evary [501]: m7

01:53 [ADM] Evary [501]: Smeargle, Moonblast!

01:53 [ADM] Evary [501]: m8

 

e no log aparesce

 

[29/12/2015 01:56:04] [Error - TalkAction Interface]
[29/12/2015 01:56:04] data/talkactions/scripts/move1.lua:onSay
[29/12/2015 01:56:04] Description:
[29/12/2015 01:56:04] data/lib/pokemon moves.lua:126: attempt to index local 'table' (a nil value)
[29/12/2015 01:56:04] stack traceback:
[29/12/2015 01:56:04] data/lib/pokemon moves.lua:126: in function 'docastspell'
[29/12/2015 01:56:04] data/talkactions/scripts/move1.lua:210: in function <data/talkactions/scripts/move1.lua:20>
meu move1.lua

local msgs = {"use ", ""}
function doAlertReady(cid, id, movename, n, cd)
if not isCreature(cid) then return true end
local myball = getPlayerSlotItem(cid, 8)
if myball.itemid > 0 and getItemAttribute(myball.uid, cd) == "cd:"..id.."" then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(myball.uid).." - "..movename.." (m"..n..") is ready!")
return true
end
local p = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)
if not p or #p <= 0 then return true end
for a = 1, #p do
if getItemAttribute(p[a], cd) == "cd:"..id.."" then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (m"..n..") is ready!")
return true
end
end
end
function onSay(cid, words, param, channel)
if param ~= "" then return true end
if string.len(words) > 3 then return true end
if #getCreatureSummons(cid) == 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need a pokemon to use moves.")
return 0
end
--alterado v1.5
local mypoke = getCreatureSummons(cid)[1]
if getCreatureCondition(cid, CONDITION_EXHAUST) then return true end
if getCreatureName(mypoke) == "Evolution" then return true end
if getCreatureName(mypoke) == "Ditto" or getCreatureName(mypoke) == "Shiny Ditto" then
name = getPlayerStorageValue(mypoke, 1010) --edited
else
name = getCreatureName(mypoke)
end
--local name = getCreatureName(mypoke) == "Ditto" and getPlayerStorageValue(mypoke, 1010) or getCreatureName(mypoke)
local it = string.sub(words, 2, 3)
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
if getPlayerStorageValue(mypoke, 212123) >= 1 then
cdzin = "cm_move"..it..""
else
cdzin = "move"..it.."" --alterado v1.5
end
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
if not move then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")
return true
end
if getPlayerLevel(cid) < move.level then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need be atleast level "..move.level.." to use this move.")
return true
end
if getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (move.cd + 2) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." seconds to use "..move.name.." again.")
return true
end
if getTileInfo(getThingPos(mypoke)).protection then
doPlayerSendCancel(cid, "Your pokemon cannot use moves while in protection zone.")
return true
end
if getPlayerStorageValue(mypoke, 3894) >= 1 then
return doPlayerSendCancel(cid, "You can't attack because you is with fear") --alterado v1.3
end
--alterado v1.6
if (move.name == "Team Slice" or move.name == "Team Claw") and #getCreatureSummons(cid) < 2 then
doPlayerSendCancel(cid, "Your pokemon need be in a team for use this move!")
return true
end
--alterado v1.7 \/\/\/
if isCreature(getCreatureTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getCreatureTarget(cid))) then
local target = getCreatureTarget(cid)
if math.random(1, 100) <= passivesChances["Evasion"][getCreatureName(target)] then
if isCreature(getMasterTarget(target)) then --alterado v1.6
doSendMagicEffect(getThingPos(target), 211)
doSendAnimatedText(getThingPos(target), "TOO BAD", 215)
doTeleportThing(target, getClosestFreeTile(target, getThingPos(mypoke)), false)
doSendMagicEffect(getThingPos(target), 211)
doFaceCreature(target, getThingPos(mypoke))
return true --alterado v1.6
end
end
end
if move.target == 1 then
if not isCreature(getCreatureTarget(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don\'t have any targets.")
return 0
end
if getCreatureCondition(getCreatureTarget(cid), CONDITION_INVISIBLE) then
return 0
end
if getCreatureHealth(getCreatureTarget(cid)) <= 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your have already defeated your target.")
return 0
end
if not isCreature(getCreatureSummons(cid)[1]) then
return true
end
if getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid))) > move.dist then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Get closer to the target to use this move.")
return 0
end
if not isSightClear(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid)), false) then
return 0
end
end
local newid = 0
if isSleeping(mypoke) or isSilence(mypoke) then --alterado v1.5
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.")
return 0
else
newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, move.cd)
end
if getPlayerStorageValue(mypoke, 93828) > os.time() then
return doPlayerSendCancel(cid, "Your pokemon can't use moves right now.")
end
doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..move.name.."!", TALKTYPE_SAY)
local summons = getCreatureSummons(cid) --alterado v1.6
addEvent(doAlertReady, move.cd * 1000, cid, newid, move.name, it, cdzin)
for i = 2, #summons do
if isCreature(summons) and getPlayerStorageValue(cid, 637501) >= 1 then
docastspell(summons, move.name) --alterado v1.6
end
end
docastspell(mypoke, move.name)
doCreatureAddCondition(cid, playerexhaust)
if useKpdoDlls then
doUpdateCooldowns(cid)
end
return 0
end


alguem?

Edited by josegvb
Link to comment
Share on other sites

Se o Smeargle copiar 1 spell que eu criei, ele fica com a imagem dela na cd bar mas a spell não funciona, é só com as que criei, e da 1 erro na distro no move1 também, 1 pessoa ja postou o erro que da no move1 aqui, o meu é igual o dela. poderia dizer o que adicionar/alterar em cada script isso de "troque tudo por isto" é inviável, pois diversos outros sistemas que coloquei, teve que mexer nesses arquivos, se eu trocar pelo seu, perderei o que j adicionei :p

Link to comment
Share on other sites

  • 2 weeks later...

é o msm problema :/

 

Olá, consegui concertar e resolvi explicar aqui, vai ajudar caso alguém com a mesma dúvida veja esse tópico

 

 

As novas magias criadas provavelmente não foram adicionadas em um arquivo chamado moves

 

local do arquivo: data\lib\moves.lua

 

ao abrir é bem simples, você vai até a ultima spell , copia ela como base , cola embaixo e edita, só colocar o nome da spell,tipo e força.

 

As ultimas magias nesse arquivo do meu server eram essas:

 ["Signal Beam"] = {f = 80, t = "Bug"}, 
["Aqua Jet"] = {f = 80, t = "Water"}, 
["Protection"] = {f = 0, t = "normal"},  

 

Adcionei uma spell de água, chamada Giant Water Gun, embaixo de protection eu coloquei isso:

 

["Giant Water Gun"] = {f = 80, t = "water"},  

 

Pronto, essa spell já funciona caso o smeargle copie ela.

Link to comment
Share on other sites

 

Olá, consegui concertar e resolvi explicar aqui, vai ajudar caso alguém com a mesma dúvida veja esse tópico

 

 

As novas magias criadas provavelmente não foram adicionadas em um arquivo chamado moves

 

local do arquivo: data\lib\moves.lua

 

ao abrir é bem simples, você vai até a ultima spell , copia ela como base , cola embaixo e edita, só colocar o nome da spell,tipo e força.

 

As ultimas magias nesse arquivo do meu server eram essas:

 ["Signal Beam"] = {f = 80, t = "Bug"}, 
["Aqua Jet"] = {f = 80, t = "Water"}, 
["Protection"] = {f = 0, t = "normal"},  

Adcionei uma spell de água, chamada Giant Water Gun, embaixo de protection eu coloquei isso:

["Giant Water Gun"] = {f = 80, t = "water"},  

Pronto, essa spell já funciona caso o smeargle copie ela.

 

reputado valeu

Link to comment
Share on other sites

  • 2 weeks later...

@

 

o lockedCds e LockedPokes não funciona, eu fiz o seguinte, coloquei no configuration.lua a tabela lockCds, dai ela passou a funcionar, mas a dos pokes não funciona nem se por no configuration, pode dar uma olhada?

Link to comment
Share on other sites

@

 

o lockedCds e LockedPokes não funciona, eu fiz o seguinte, coloquei no configuration.lua a tabela lockCds, dai ela passou a funcionar, mas a dos pokes não funciona nem se por no configuration, pode dar uma olhada?

 

EDITED: Perdão, eu lembrei que não funcionava no meu ot, dai eu peguei algumas partes daqui e outras de um outro ot que tinha o smeargle system funcionando, modifiquei algumas coisas e tal, agora funciona, mas sem o order (foi unico jeito que funcinou) eu só clico no pokemon adversário e dps no sketch e copia, para funcionar os atks e pokemons bloqueados eu criei 2 exceções no pokemon moves.lua e a tabela coloquei no configuration, agr funciona 100% (tirando a parte q tem q dar order, é só clicar no sketch com target q copia)

Funciona no pda 1.9?

Só testando para saber, recomendo fazer backup de tudo que for mexer, ou então da pasta inteira do server logo (mais prático)

e se funcionar, certifique-se que não comprometeu nada, aqui não funcionava, eu tive que pegar algumas partes daqui e outras de uma outra base que tinha um smeargle system um pouco diferente, funcionou com alguns "poréms" que dps fui arrumando, quando tentei trocar os arquivos do meu server mencionados aqui pelos de outra base que ja tinha esse system, funciou mas bugou varias coisas, dai voltei atrás e fui colocando um pouco de cada até funcionar sem problemas em outras coisas (eu acho, pq tenho alguns erros na distro que não sei se foram por causa disso ou não)

Link to comment
Share on other sites

  • 3 weeks later...

cara eu tentei 5 vezes e as 5 deu erros na distro, eu n entendi nada do tópico vc n explicava direito mano, a hora que você falou, não esqueça de adicionar no spells.xml cara tu n explico nada e eu já sou lerdo ai eu me fodi, será que teria como tu me ajudar mais detalhadamente?

Link to comment
Share on other sites

  • 5 months later...
  • 3 months later...
Em 12/04/2015 at 18:53, gabrielbsales disse:

 

16:42 Adm [1010]: Smeargle, Sketch 4!

16:42 Adm [1010]: m4

 

Entao acontece isso e o attack nao vai 

 

[26/11/2016 16:42:04] [Error - Spell Interface] 

[26/11/2016 16:42:04] data/spells/scripts/ps/Poison Powder.lua:onCastSpell

[26/11/2016 16:42:04] Description: 

[26/11/2016 16:42:04] data/lib/pokemon moves.lua:83: attempt to perform arithmetic on global 'const_distance_delay' (a nil value)

[26/11/2016 16:42:04] stack traceback:

[26/11/2016 16:42:04]     data/lib/pokemon moves.lua:83: in function 'docastspell'

[26/11/2016 16:42:04]     data/spells/scripts/ps/Poison Powder.lua:5: in function <data/spells/scripts/ps/Poison Powder.lu

Em 17/01/2016 at 19:02, samlecter disse:

é o msm problema
:/

 

Olá, consegui concertar e resolvi explicar aqui, vai ajudar caso alguém com a mesma dúvida veja esse tópico

 

 

As novas magias criadas provavelmente não foram adicionadas em um arquivo chamado    moves

 

local do arquivo: data\lib\moves.lua

 

ao abrir é bem simples, você vai até a ultima spell , copia ela como base , cola embaixo e edita, só colocar o nome da spell,tipo e força.

 

As ultimas magias nesse arquivo do meu server eram essas:

 ["Signal Beam"] = {f = 80, t = "Bug"}, ["Aqua Jet"] = {f = 80, t = "Water"}, ["Protection"] = {f = 0, t = "normal"},  

 

Adcionei uma spell de água, chamada Giant Water Gun, embaixo de protection eu coloquei isso:

 

["Giant Water Gun"] = {f = 80, t = "water"},  

 

Pronto, essa spell já funciona caso o smeargle copie ela.

Entao mesmo q o attack ja esteja ai em data\lib\moves1.lua nao funciona poderia me ajudar e isso so acontece quando foca o outro pokemon 

 

Edited by Nikolass
esqueci de emplementar uma coisa
Link to comment
Share on other sites

  • 1 year later...
Em 12/04/2015 em 6:53 PM, gabrielbsales disse:

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:

  Mostrar conteúdo oculto

 



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:

  Mostrar conteúdo oculto

 



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:

 

  Mostrar conteúdo oculto

 



if getTileThingByPos(checkpos).uid <= 0 then return true end

 

 

Adicione:

  Mostrar conteúdo oculto

 




 
--------SKETCH---------------
local lockedpokes = {"Mew", "Mewtwo", "Unown Legion", "Entei", "Raikou", "Suicune", "Zapdos", "Moltres", "Articuno", "Rocket Team", "Unown", "Lugia", "Celebi", "Ho-oh", "Mew_", "Mewtwo_"}
if isPlayer(cid) and #getCreatureSummons(cid) > 0 and getCreatureName(getCreatureSummons(cid)[1]) == "Smeargle" and getPlayerStorageValue(getCreatureSummons(cid)[1], 18554) > 0 then
if isMonster(item2.uid) and isInArray(lockedpokes, getCreatureName(item2.uid)) then
doPlayerSendTextMessage(cid, 20, "You can't copy this move.")
return true
end
local lockedcds = {"Divine Punishment", "Unown Rush", "Unown Help", "Mysterious Power", "Power Wave", "Shredder Team", "Double Team", "Team Slice", "Ancient Fury", "Camouflage", "Future Sight", "Acid Armor", "Rollout", "Flame Wheel", "Elemental Hands", "Super Vines", "ExplodeAll", "Aerial Ace", "Stampage", "Iron Defense", "Minimize", "Team Claw", ""}
for x=1, 8 do
table.insert(lockedcds, "Sketch "..x)
end
local canShiny = true
local smeargle = getCreatureSummons(cid)[1]
local tocopy = item2.uid
local selfball = getPlayerSlotItem(cid, 8).uid
if (isShinyName(getCreatureName(item2.uid)) and canShiny) or not isShinyName(getCreatureName(item2.uid)) then
if getPlayerStorageValue(smeargle, 18554) then
for x=1, 8 do
if getPlayerStorageValue(smeargle, 18554) == x and movestable[getCreatureName(tocopy)] and movestable[getCreatureName(tocopy)]["move"..(x)] and not isInArray(lockedcds, movestable[getCreatureName(tocopy)]["move"..(x)].name) then
if not smeargleHaveSpell(cid, movestable[getCreatureName(tocopy)]["move"..(x)].name) then
doItemSetAttribute(selfball, "skt"..(x), getCreatureName(tocopy))
else
doPlayerSendTextMessage(cid, 20, "You smeargle already have this move.")
end
end
end
setPlayerStorageValue(smeargle, 18554, -1)
end
doUpdateMoves(cid)
return true
else
doPlayerSendTextMessage(cid, 20, "You can't copy moves of shinyes pokemons.")
end
end

 



4 - Se seu servidor ja tiver os spells, sketch 1, sketch 2... Substitua por esses(data/lib/pokemon moves.lua):
 

  Mostrar conteúdo oculto

 



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:

  Mostrar conteúdo oculto

 



local move = movestable[name].move1

 

 

Por

 

  Mostrar conteúdo oculto

 



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:

 

  Mostrar conteúdo oculto

 



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:

 

  Mostrar conteúdo oculto

 



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á:

  Mostrar conteúdo oculto


xocwS2Z.png
IW7P57G.png


Como usar:



Créditos: Eu(Todo o script)

 

2 minutos atrás, delcinei disse:

 

eu fiz todo o procedimento porém ao adicionar a 2 parte do move1.lua deu os seguintes erros...

 

[16/05/2018 19:19:29] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/move1.lua)
[16/05/2018 19:19:29] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/move1.lua)
[16/05/2018 19:19:29] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/move1.lua)
[16/05/2018 19:19:29] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/move1.lua)
[16/05/2018 19:19:29] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/move1.lua)
[16/05/2018 19:19:29] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/move1.lua)
[16/05/2018 19:19:29] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/move1.lua)
[16/05/2018 19:19:29] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/move1.lua)
[16/05/2018 19:19:29] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/move1.lua)
[16/05/2018 19:19:29] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/move1.lua)
[16/05/2018 19:19:29] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/move1.lua)
[16/05/2018 19:19:29] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/move1.lua)
[16/05/2018 19:19:29] data/talkactions/scripts/move1.lua:54: 'then' expected near 'ï'
[16/05/2018 19:19:29] Reloaded talk actions.
[16/05/2018 19:19:29] [Lua Error]
[16/05/2018 19:19:29] (luaAddEvent) No valid script interface!

 

Link to comment
Share on other sites

  • 1 year later...
  • 4 months later...
Em 12/04/2015 em 16:53, gabrielbsales disse:

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:

  Ocultar conteúdo

 



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:

  Ocultar conteúdo

 



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:

 

  Ocultar conteúdo

 



if getTileThingByPos(checkpos).uid <= 0 then return true end

 

 

Adicione:

  Ocultar conteúdo

 




 
--------SKETCH---------------
local lockedpokes = {"Mew", "Mewtwo", "Unown Legion", "Entei", "Raikou", "Suicune", "Zapdos", "Moltres", "Articuno", "Rocket Team", "Unown", "Lugia", "Celebi", "Ho-oh", "Mew_", "Mewtwo_"}
if isPlayer(cid) and #getCreatureSummons(cid) > 0 and getCreatureName(getCreatureSummons(cid)[1]) == "Smeargle" and getPlayerStorageValue(getCreatureSummons(cid)[1], 18554) > 0 then
if isMonster(item2.uid) and isInArray(lockedpokes, getCreatureName(item2.uid)) then
doPlayerSendTextMessage(cid, 20, "You can't copy this move.")
return true
end
local lockedcds = {"Divine Punishment", "Unown Rush", "Unown Help", "Mysterious Power", "Power Wave", "Shredder Team", "Double Team", "Team Slice", "Ancient Fury", "Camouflage", "Future Sight", "Acid Armor", "Rollout", "Flame Wheel", "Elemental Hands", "Super Vines", "ExplodeAll", "Aerial Ace", "Stampage", "Iron Defense", "Minimize", "Team Claw", ""}
for x=1, 8 do
table.insert(lockedcds, "Sketch "..x)
end
local canShiny = true
local smeargle = getCreatureSummons(cid)[1]
local tocopy = item2.uid
local selfball = getPlayerSlotItem(cid, 8).uid
if (isShinyName(getCreatureName(item2.uid)) and canShiny) or not isShinyName(getCreatureName(item2.uid)) then
if getPlayerStorageValue(smeargle, 18554) then
for x=1, 8 do
if getPlayerStorageValue(smeargle, 18554) == x and movestable[getCreatureName(tocopy)] and movestable[getCreatureName(tocopy)]["move"..(x)] and not isInArray(lockedcds, movestable[getCreatureName(tocopy)]["move"..(x)].name) then
if not smeargleHaveSpell(cid, movestable[getCreatureName(tocopy)]["move"..(x)].name) then
doItemSetAttribute(selfball, "skt"..(x), getCreatureName(tocopy))
else
doPlayerSendTextMessage(cid, 20, "You smeargle already have this move.")
end
end
end
setPlayerStorageValue(smeargle, 18554, -1)
end
doUpdateMoves(cid)
return true
else
doPlayerSendTextMessage(cid, 20, "You can't copy moves of shinyes pokemons.")
end
end

 



4 - Se seu servidor ja tiver os spells, sketch 1, sketch 2... Substitua por esses(data/lib/pokemon moves.lua):
 

  Mostrar conteúdo oculto

 



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:

  Ocultar conteúdo

 



local move = movestable[name].move1

 

 

Por

 

  Ocultar conteúdo

 



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:

 

  Ocultar conteúdo

 



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:

 

  Ocultar conteúdo

 



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á:

  Ocultar conteúdo


xocwS2Z.png
IW7P57G.png


Como usar:



Créditos: Eu(Todo o script)

 

[25/01/2020 20:39:21] [Error - Spell Interface] 
[25/01/2020 20:39:21] data/spells/scripts/ps/Inferno.lua:onCastSpell
[25/01/2020 20:39:21] Description: 
[25/01/2020 20:39:21] (luaGetThingFromPos) Tile not found

[25/01/2020 20:41:10] [Error - TalkAction Interface] 
[25/01/2020 20:41:10] In a timer event called from: 
[25/01/2020 20:41:10] data/talkactions/scripts/move1.lua:onSay
[25/01/2020 20:41:10] Description: 
[25/01/2020 20:41:10] (luaGetThingFromPos) Tile not found

 

 

Link to comment
Share on other sites

×
×
  • Create New...