Ir para conteúdo

[Encerrado] [Encerrado] me ajuda a mesclar esses 2 scripts?


Posts Recomendados

bom dia, tarde ou noite
eu estou com um problema em um script
neste script eu tenho partes de 4 systemas que são
ditto system, smeargle system, mega evolution system e TM system
porem eu não estou conseguindo fazer funcionar os 4
eu consigo deixar apenas 3 funcionando

ditto system, smeargle system & mega evolution system
ou ditto system, smeargle system TM system
não consigo deixar o TM e o MEGA funcionando juntos então separei em 2 scripts diferentes e vou postar os 2,
um que funciona o TM e outro que funcione o Mega espero que alguem possa me ajudar juntando os 2 script de uma forma que funcione todos os 4 system 

LEMBRANDO TAMBÉM QUE OS 2 SCRIPTS SÃO O MESMO COM ALGUMAS MODIFICAÇÕES
DESDE JA OBRIGADO

COM MEGA FUNCIONANDO

Spoiler

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
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 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) or (getCreatureName(mypoke) == "Shiny 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..""
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
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 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 = false                   --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, "para mega evoluir os cds do pokemon devem estar carregados.")
end
end
end
move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0, f = 0, t = "?"}
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
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
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
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)
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

 

 

 

 

COM TM FUNCIONANDO

Spoiler

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
if isInArray({"m1", "m2", "m3"}, n) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (t"..n..") is ready!")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (m"..n..") is ready!")
end
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
local mypoke = getCreatureSummons(cid)[1]
if getCreatureCondition(cid, CONDITION_EXHAUST) then return true end
if getCreatureName(mypoke) == "Evolution" then return true end
local name = getCreatureName(mypoke) == "Ditto" and getPlayerStorageValue(mypoke, 1010) or getCreatureName(mypoke)
local it = string.sub(words, 2, 3)
local move = movestable[name].move1
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) or (getCreatureName(mypoke) == "Shiny 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..""
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 == "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
elseif it == "m1" then
move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm1") or false
elseif it == "m2" then
move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm2") or false
elseif it == "m3" then
move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm3") or false
end
if isInArray({1,2,3,4,5,6,7,8,9,10,11,12,13}, it) then
mLevel = move.level
mCD = move.cd
mName = move.name
mTarget = move.target
mDist = move.dist
else
m = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "t"..it.."")
mLevel = tmList[m].level
mCD = tmList[m].cd
mName = m
mTarget = tmList[m].target
mDist = tmList[m].dist
end
if not move then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")
return true
end
if getPlayerLevel(cid) < mLevel then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need be atleast level "..mLevel.." to use this move.")
return true
end
if getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (mCD + 2) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." seconds to use "..mName.." again.")
return 0
end
if getTileInfo(getThingPos(mypoke)).protection then
doPlayerSendCancel(cid, "Your pokemon cannot use moves while in protection zone.")
return 0
end
if getPlayerStorageValue(mypoke, 3894) >= 1 then
return doPlayerSendCancel(cid, "You can't attack because you is with fear") --alterado v2.3
end
if (mName == "Team Slice" or mName == "Team Claw") and #getCreatureSummons(cid) < 2 then    --alterado v2.5
doPlayerSendCancel(cid, "Your pokemon need be in a team for use this move!")
return 0
end
if isCreature(getCreatureTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getCreatureTarget(cid))) and math.random(1, 100) <= 10 then
local target = getCreatureTarget(cid)    
if isCreature(getMasterTarget(target)) then
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
end    
end
if mTarget == 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))) > mDist 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 
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.")
return 0
else
newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, mCD)
end
doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..mName.."!", TALKTYPE_SAY)
local summons = getCreatureSummons(cid)
addEvent(doAlertReady, mCD * 1000, cid, newid, mName, it, cdzin)
for i = 2, #summons do
if isCreature(summons) and getPlayerStorageValue(cid, 637501) >= 1 then
docastspell(summons, mName)
end
end
docastspell(mypoke, mName)
doCreatureAddCondition(cid, playerexhaust)
if useKpdoDlls then
doUpdateCooldowns(cid)
end
return 0
end

 

Editado por Weverton Siri
Link para o comentário
Compartilhar em outros sites

Em 2017-6-5 at 23:24, DarkWore disse:

Utilize o Botão @UP isso é considerado flood comentar no topico.

não existe esse botão aqui, sei que ficava abaixo do titulo mas não tem nada la + não

 

 

 

Em 2017-6-6 at 08:15, Poccnn disse:

Possivelmente o player não tem a storage buscada. Resolva isso.

não ta dando Man eu estou com 4 partes de sistemas nesse arquivo que são

ditto system, smeargle system, TM system e Mega evolution system

eu estou conseguindo deixar apenas 3 funcionando

ou funciona o ditto, smeargle + TM

ou funciona o ditto, smeargle + Mega evolution

eu não estou conseguindo fazer funcionar os 4

ou melhor o TM + o Mega não se batem e tou tendo que escolher entre 1 e outro

vou deixar as 2 modificações do script, uma que funcione o TM e outro q funcione o mega

peço tua ajudar para mesclar as duas e fazer ambas funcionarem

 

 

com TM

Spoiler

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

if isInArray({"m1", "m2", "m3"}, n) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (t"..n..") is ready!")

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (m"..n..") is ready!")

end

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

local mypoke = getCreatureSummons(cid)[1]

if getCreatureCondition(cid, CONDITION_EXHAUST) then return true end

if getCreatureName(mypoke) == "Evolution" then return true end

local name = getCreatureName(mypoke) == "Ditto" and getPlayerStorageValue(mypoke, 1010) or getCreatureName(mypoke)

local it = string.sub(words, 2, 3)

local move = movestable[name].move1

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) or (getCreatureName(mypoke) == "Shiny 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..""

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 == "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

elseif it == "m1" then

move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm1") or false

elseif it == "m2" then

move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm2") or false

elseif it == "m3" then

move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm3") or false

end

if isInArray({1,2,3,4,5,6,7,8,9,10,11,12,13}, it) then

mLevel = move.level

mCD = move.cd

mName = move.name

mTarget = move.target

mDist = move.dist

else

m = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "t"..it.."")

mLevel = tmList[m].level

mCD = tmList[m].cd

mName = m

mTarget = tmList[m].target

mDist = tmList[m].dist

end

if not move then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")

return true

end

if getPlayerLevel(cid) < mLevel then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need be atleast level "..mLevel.." to use this move.")

return true

end

if getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (mCD + 2) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." seconds to use "..mName.." again.")

return 0

end

if getTileInfo(getThingPos(mypoke)).protection then

doPlayerSendCancel(cid, "Your pokemon cannot use moves while in protection zone.")

return 0

end

if getPlayerStorageValue(mypoke, 3894) >= 1 then

return doPlayerSendCancel(cid, "You can't attack because you is with fear") --alterado v2.3

end

if (mName == "Team Slice" or mName == "Team Claw") and #getCreatureSummons(cid) < 2 then    --alterado v2.5

doPlayerSendCancel(cid, "Your pokemon need be in a team for use this move!")

return 0

end

if isCreature(getCreatureTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getCreatureTarget(cid))) and math.random(1, 100) <= 10 then

local target = getCreatureTarget(cid)    

if isCreature(getMasterTarget(target)) then

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

end    

end

if mTarget == 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))) > mDist 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 

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.")

return 0

else

newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, mCD)

end

doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..mName.."!", TALKTYPE_SAY)

local summons = getCreatureSummons(cid)

addEvent(doAlertReady, mCD * 1000, cid, newid, mName, it, cdzin)

for i = 2, #summons do

if isCreature(summons) and getPlayerStorageValue(cid, 637501) >= 1 then

docastspell(summons, mName)

end

end

docastspell(mypoke, mName)

doCreatureAddCondition(cid, playerexhaust)

if useKpdoDlls then

doUpdateCooldowns(cid)

end

return 0

end

 

 

 

com mega

 

Spoiler

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

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 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) or (getCreatureName(mypoke) == "Shiny 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..""

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

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 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 = false                   --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, "para mega evoluir os cds do pokemon devem estar carregados.")

end

end

end

move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0, f = 0, t = "?"}

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

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

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

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)

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

 

Editado por Weverton Siri
Link para o comentário
Compartilhar em outros sites

Agora, Weverton Siri disse:

não existe esse botão aqui, sei que ficava abaixo do titulo mas não tem nada la + não

 

 

 

não ta dando Man eu estou com 4 partes de sistemas nesse arquivo que são

ditto system, smeargle system, TM system e Mega evolution system

eu estou conseguindo deixar apenas 3 funcionando

ou funciona o ditto, smeargle + TM

ou funciona o ditto, smeargle + Mega evolution

eu não estou conseguindo fazer funcionar os 4

ou melhor o TM + o Mega não se batem e tou tendo que escolher entre 1 e outro

vou deixar as 2 modificações do script, uma que funcione o TM e outro q funcione o mega

peço tua ajudar para mesclar as duas e fazer ambas funcionarem

 

 

com TM

  Mostrar conteúdo oculto

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

if isInArray({"m1", "m2", "m3"}, n) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (t"..n..") is ready!")

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (m"..n..") is ready!")

end

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

local mypoke = getCreatureSummons(cid)[1]

if getCreatureCondition(cid, CONDITION_EXHAUST) then return true end

if getCreatureName(mypoke) == "Evolution" then return true end

local name = getCreatureName(mypoke) == "Ditto" and getPlayerStorageValue(mypoke, 1010) or getCreatureName(mypoke)

local it = string.sub(words, 2, 3)

local move = movestable[name].move1

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) or (getCreatureName(mypoke) == "Shiny 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..""

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 == "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

elseif it == "m1" then

move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm1") or false

elseif it == "m2" then

move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm2") or false

elseif it == "m3" then

move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm3") or false

end

if isInArray({1,2,3,4,5,6,7,8,9,10,11,12,13}, it) then

mLevel = move.level

mCD = move.cd

mName = move.name

mTarget = move.target

mDist = move.dist

else

m = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "t"..it.."")

mLevel = tmList[m].level

mCD = tmList[m].cd

mName = m

mTarget = tmList[m].target

mDist = tmList[m].dist

end

if not move then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")

return true

end

if getPlayerLevel(cid) < mLevel then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need be atleast level "..mLevel.." to use this move.")

return true

end

if getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (mCD + 2) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." seconds to use "..mName.." again.")

return 0

end

if getTileInfo(getThingPos(mypoke)).protection then

doPlayerSendCancel(cid, "Your pokemon cannot use moves while in protection zone.")

return 0

end

if getPlayerStorageValue(mypoke, 3894) >= 1 then

return doPlayerSendCancel(cid, "You can't attack because you is with fear") --alterado v2.3

end

if (mName == "Team Slice" or mName == "Team Claw") and #getCreatureSummons(cid) < 2 then    --alterado v2.5

doPlayerSendCancel(cid, "Your pokemon need be in a team for use this move!")

return 0

end

if isCreature(getCreatureTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getCreatureTarget(cid))) and math.random(1, 100) <= 10 then

local target = getCreatureTarget(cid)    

if isCreature(getMasterTarget(target)) then

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

end    

end

if mTarget == 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))) > mDist 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 

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.")

return 0

else

newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, mCD)

end

doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..mName.."!", TALKTYPE_SAY)

local summons = getCreatureSummons(cid)

addEvent(doAlertReady, mCD * 1000, cid, newid, mName, it, cdzin)

for i = 2, #summons do

if isCreature(summons) and getPlayerStorageValue(cid, 637501) >= 1 then

docastspell(summons, mName)

end

end

docastspell(mypoke, mName)

doCreatureAddCondition(cid, playerexhaust)

if useKpdoDlls then

doUpdateCooldowns(cid)

end

return 0

end

 

 

 

com mega

 

  Mostrar conteúdo oculto

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

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 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) or (getCreatureName(mypoke) == "Shiny 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..""

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

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 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 = false                   --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, "para mega evoluir os cds do pokemon devem estar carregados.")

end

end

end

move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0, f = 0, t = "?"}

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

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

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

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)

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

 

@Frenvius poderia verificar o botão Up porque não aparece.

 

Grato.

Link para o comentário
Compartilhar em outros sites

  • Administrador
[mention=41440]Frenvius[/mention] poderia verificar o botão Up porque não aparece.

 

Grato.

 

 

q

 

52c926c4faa242c8bc358622dc65b4a0.png

 

Edit: Tava zuado mesmo, arrumei já, vlw

Link para o comentário
Compartilhar em outros sites

11 horas atrás, Weverton Siri disse:

não existe esse botão aqui, sei que ficava abaixo do titulo mas não tem nada la + não

 

 

 

não ta dando Man eu estou com 4 partes de sistemas nesse arquivo que são

ditto system, smeargle system, TM system e Mega evolution system

eu estou conseguindo deixar apenas 3 funcionando

ou funciona o ditto, smeargle + TM

ou funciona o ditto, smeargle + Mega evolution

eu não estou conseguindo fazer funcionar os 4

ou melhor o TM + o Mega não se batem e tou tendo que escolher entre 1 e outro

vou deixar as 2 modificações do script, uma que funcione o TM e outro q funcione o mega

peço tua ajudar para mesclar as duas e fazer ambas funcionarem

 

 

com TM

  Mostrar conteúdo oculto

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

if isInArray({"m1", "m2", "m3"}, n) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (t"..n..") is ready!")

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (m"..n..") is ready!")

end

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

local mypoke = getCreatureSummons(cid)[1]

if getCreatureCondition(cid, CONDITION_EXHAUST) then return true end

if getCreatureName(mypoke) == "Evolution" then return true end

local name = getCreatureName(mypoke) == "Ditto" and getPlayerStorageValue(mypoke, 1010) or getCreatureName(mypoke)

local it = string.sub(words, 2, 3)

local move = movestable[name].move1

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) or (getCreatureName(mypoke) == "Shiny 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..""

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 == "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

elseif it == "m1" then

move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm1") or false

elseif it == "m2" then

move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm2") or false

elseif it == "m3" then

move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm3") or false

end

if isInArray({1,2,3,4,5,6,7,8,9,10,11,12,13}, it) then

mLevel = move.level

mCD = move.cd

mName = move.name

mTarget = move.target

mDist = move.dist

else

m = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "t"..it.."")

mLevel = tmList[m].level

mCD = tmList[m].cd

mName = m

mTarget = tmList[m].target

mDist = tmList[m].dist

end

if not move then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")

return true

end

if getPlayerLevel(cid) < mLevel then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need be atleast level "..mLevel.." to use this move.")

return true

end

if getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (mCD + 2) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." seconds to use "..mName.." again.")

return 0

end

if getTileInfo(getThingPos(mypoke)).protection then

doPlayerSendCancel(cid, "Your pokemon cannot use moves while in protection zone.")

return 0

end

if getPlayerStorageValue(mypoke, 3894) >= 1 then

return doPlayerSendCancel(cid, "You can't attack because you is with fear") --alterado v2.3

end

if (mName == "Team Slice" or mName == "Team Claw") and #getCreatureSummons(cid) < 2 then    --alterado v2.5

doPlayerSendCancel(cid, "Your pokemon need be in a team for use this move!")

return 0

end

if isCreature(getCreatureTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getCreatureTarget(cid))) and math.random(1, 100) <= 10 then

local target = getCreatureTarget(cid)    

if isCreature(getMasterTarget(target)) then

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

end    

end

if mTarget == 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))) > mDist 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 

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.")

return 0

else

newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, mCD)

end

doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..mName.."!", TALKTYPE_SAY)

local summons = getCreatureSummons(cid)

addEvent(doAlertReady, mCD * 1000, cid, newid, mName, it, cdzin)

for i = 2, #summons do

if isCreature(summons) and getPlayerStorageValue(cid, 637501) >= 1 then

docastspell(summons, mName)

end

end

docastspell(mypoke, mName)

doCreatureAddCondition(cid, playerexhaust)

if useKpdoDlls then

doUpdateCooldowns(cid)

end

return 0

end

 

 

 

com mega

 

  Mostrar conteúdo oculto

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

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 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) or (getCreatureName(mypoke) == "Shiny 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..""

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

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 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 = false                   --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, "para mega evoluir os cds do pokemon devem estar carregados.")

end

end

end

move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0, f = 0, t = "?"}

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

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

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

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)

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

 

Sugiro arrumar um scripter para sua equipe pois isso ai tudo precisa ser revisto.

Link para o comentário
Compartilhar em outros sites

Ajudar eu até posso, só que o que tu quer da muito trabalho, além de precisar ficar testando as alterações o que eu não tenho como, pois meu servidor não é derivado e nem vou ter um pra testar nada.

Link para o comentário
Compartilhar em outros sites

12 horas atrás, Poccnn disse:

Ajudar eu até posso, só que o que tu quer da muito trabalho, além de precisar ficar testando as alterações o que eu não tenho como, pois meu servidor não é derivado e nem vou ter um pra testar nada.

os 2 scripts não são grandes e são praticamente o mesmos scripts a diferença entre eles não chega a 20 linhas 

eu quero que passe oque tem de diferente em um para o outro mesclar as partes diferentes de uma forma sem erro, eu tentei mas não consegui eu vou testando devagarzinho eu sei que voce tem conhecimento para me ajudar com isso ent por favor me ajude

 

 

o tutorial do mega evolution manda colocar isso no move1.lua, mas se eu colocar no da tm gera erros acredito que o motivo do erro seja a tabela existente no TM pois ela muda algumas coisas ja existentes exemplo no mega se usa move.name e no TM se usa mName  se os 2 ta junto gera o erro no name do move.name e por aee vai

Spoiler
Já em data/talkactions/scripts, move1.lua:
Abaixo de:
function doAlertReady(cid, id, movename, n, cd)

coloque:

if movename == "Mega Evolution" then return true end

Troque:

    if not move then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")        return true    end

por:

if not move then        local isMega = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "megaStone")        if not isMega or name:find("Mega") then            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")            return true        end        local moveTable, index = getNewMoveTable(movestable[name]), 0        for i = 1, 12 do            if not moveTable[i] then                index = i                break            end        end        if tonumber(it) ~= index then            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")            return true        end        local needCds = true                   --Coloque false se o pokémon puder mega evoluir mesmo com spells em cooldown.        if needCds then            for i = 1, 12 do                if getCD(getPlayerSlotItem(cid, 8).uid, "move"..i) > 0 then                    return doPlayerSendCancel(cid, "To mega evolve, all the spells of your pokemon need to be ready.")                end            end        end        move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0}    end

E troque:

doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..move.name.."!", TALKTYPE_SAY)

por:

local spellMessage = msgs[math.random(#msgs)]..""..move.name.."!"if move.name == "Mega Evolution" then    spellMessage = "Mega Evolve!"enddoCreatureSay(cid, getPokeName(mypoke)..", "..spellMessage, TALKTYPE_SAY)

 

 

Editado por Weverton Siri
Link para o comentário
Compartilhar em outros sites

Tu quer mesclar o mega e o tm né?

ta ai, se houver algum problema, não conte comigo.

Spoiler

local msgs = {"use ", ""}

function doAlertReady(cid, id, movename, n, cd)
local myball = getPlayerSlotItem(cid, 8):
local p = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)
    
    if not isCreature(cid) then return true end
    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
    if not p or #p <= 0 then return true end
    for a = 1, #p do
        if getItemAttribute(p[a], cd) == "cd:"..id.."" then
            if isInArray({"m1", "m2", "m3"}, n) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (t"..n..") is ready!")
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (m"..n..") is ready!")
            end
            return true
        end
    end
end

function onSay(cid, words, param, channel)

    if param ~= "" then return true 
    elseif string.len(words) > 3 then return true
    elseif #getCreatureSummons(cid) == 0 then return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need a pokemon to use moves.")
    elseif getCreatureCondition(cid, CONDITION_EXHAUST) then return true
    elseif getCreatureName(mypoke) == "Evolution" then return true
    end
    
local mypoke = getCreatureSummons(cid)[1]
local name = (getCreatureName(mypoke) == "Ditto" or getCreatureName(mypoke) == "Shiny 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) or (getCreatureName(mypoke) == "Shiny Smeargle" and getItemAttribute(idd, "skt1") and movestable[getItemAttribute(idd, "skt1")].move1 or movestable[name].move1)
local cdzin = (getPlayerStorageValue(mypoke, 212123) >= 1) and "cm_move"..it.."" or "move"..it..""

    if         it == "2"     then move = (getItemAttribute(idd, "skt2")) and movestable[getItemAttribute(idd, "skt2")].move2 or movestable[name].move2
    elseif it == "3"     then move = (getItemAttribute(idd, "skt3")) and movestable[getItemAttribute(idd, "skt3")].move3 or movestable[name].move3
    elseif it == "4"     then move = (getItemAttribute(idd, "skt4")) and movestable[getItemAttribute(idd, "skt4")].move4 or movestable[name].move4
    elseif it == "5"     then move = (getItemAttribute(idd, "skt5") ) and movestable[getItemAttribute(idd, "skt5")].move5 or movestable[name].move5
    elseif it == "6"     then move = (getItemAttribute(idd, "skt6")) and movestable[getItemAttribute(idd, "skt6")].move6 or movestable[name].move6
    elseif it == "7"     then move = (getItemAttribute(idd, "skt7")) and movestable[getItemAttribute(idd, "skt7")].move7 or movestable[name].move7
    elseif it == "8"     then move = (getItemAttribute(idd, "skt8")) and movestable[getItemAttribute(idd, "skt8")].move8 or 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
    elseif it == "m1" then move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm1") or false
    elseif it == "m2" then move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm2") or false
    elseif it == "m3" then move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm3") or false
    end
    
    if not move then
    local isMega = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "megaStone")
    local moveTable, index = getNewMoveTable(movestable[name]), 0
        if not isMega or name:find("Mega") then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")
            return true
        end
        for i = 1, 12 do
            if not moveTable then
                index = i
                break
            end
        end
        if tonumber(it) ~= index then 
            return true, doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")
        end
    local needCds = false                   --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, "para mega evoluir, os cds do pokemon devem estar carregados.")
                end
            end
        end
        move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0, f = 0, t = "?"}
    end
    
    if isInArray({1,2,3,4,5,6,7,8,9,10,11,12,13}, tonumber(it)) then
        mLevel = move.level
        mCD = move.cd
        mName = move.name
        mTarget = move.target
        mDist = move.dist
    else
        m = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "t"..it.."")
        mLevel = tmList[m].level
        mCD = tmList[m].cd
        mName = m
        mTarget = tmList[m].target
        mDist = tmList[m].dist
    end
    
    if getPlayerLevel(cid) < mLevel then
        return true,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need be atleast level "..mLevel.." to use this move.")
    elseif getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (mCD + 2) then
        return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." seconds to use "..mName.." again.")
    elseif getTileInfo(getThingPos(mypoke)).protection then
        return 0,doPlayerSendCancel(cid, "Your pokemon cannot use moves while in protection zone.")
    elseif getPlayerStorageValue(mypoke, 3894) >= 1 then
        return doPlayerSendCancel(cid, "You can't attack because you is with fear") --alterado v2.3
    elseif (mName == "Team Slice" or mName == "Team Claw") and #getCreatureSummons(cid) < 2 then    --alterado v2.5
        return 0,doPlayerSendCancel(cid, "Your pokemon need be in a team for use this move!")
    end
    
    if isCreature(getCreatureTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getCreatureTarget(cid))) and math.random(1, 100) <= 10 then
    local target = getCreatureTarget(cid)    
        if math.random(1, 100) <= passivesChances["Evasion"][getCreatureName(target)] then 
            if isCreature(getMasterTarget(target)) then
                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
            end    
        end
    end
    
    if mTarget == 1 then
        if not isCreature(getCreatureTarget(cid)) then
            return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don\'t have any targets.")
        elseif getCreatureCondition(getCreatureTarget(cid), CONDITION_INVISIBLE) then
            return 0
        elseif getCreatureHealth(getCreatureTarget(cid)) <= 0 then
            return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your have already defeated your target.")
        elseif not isCreature(getCreatureSummons(cid)[1]) then
            return true
        elseif getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid))) > mDist then
            return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Get closer to the target to use this move.")
        elseif not isSightClear(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid)), false) then
            return 0
        end
    end
    
    local newid = 0
    local spellMessage = msgs[math.random(#msgs)]..""..mName.."!"
    local summons = getCreatureSummons(cid)
    
    if isSleeping(mypoke) or isSilence(mypoke) then 
        return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.")
    else
        newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, mCD)
    end
    
    if mName == "Mega Evolution" then spellMessage = "Mega Evolve!" end
    doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..mName.."!", TALKTYPE_SAY)
    addEvent(doAlertReady, mCD * 1000, cid, newid, mName, it, cdzin)

    for i = 2, #summons do
        if isCreature(summons) and getPlayerStorageValue(cid, 637501) >= 1 then
            docastspell(summons, mName)
        end
    end
    docastspell(mypoke, mName)
    doCreatureAddCondition(cid, playerexhaust)
    if useKpdoDlls then doUpdateCooldowns(cid) end
    return 0
end

 

Editado por Poccnn
Link para o comentário
Compartilhar em outros sites

10 horas atrás, Poccnn disse:

Tu quer mesclar o mega e o tm né?

ta ai, se houver algum problema, não conte comigo.

  Ocultar conteúdo

local msgs = {"use ", ""}

function doAlertReady(cid, id, movename, n, cd)

local myball = getPlayerSlotItem(cid, 8):

local p = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)

    

    if not isCreature(cid) then return true end

    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

    if not p or #p <= 0 then return true end

    for a = 1, #p do

        if getItemAttribute(p[a], cd) == "cd:"..id.."" then

            if isInArray({"m1", "m2", "m3"}, n) then

                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (t"..n..") is ready!")

            else

                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (m"..n..") is ready!")

            end

            return true

        end

    end

end

function onSay(cid, words, param, channel)

    if param ~= "" then return true 

    elseif string.len(words) > 3 then return true

    elseif #getCreatureSummons(cid) == 0 then return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need a pokemon to use moves.")

    elseif getCreatureCondition(cid, CONDITION_EXHAUST) then return true

    elseif getCreatureName(mypoke) == "Evolution" then return true

    end

    

local mypoke = getCreatureSummons(cid)[1]

local name = (getCreatureName(mypoke) == "Ditto" or getCreatureName(mypoke) == "Shiny 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) or (getCreatureName(mypoke) == "Shiny Smeargle" and getItemAttribute(idd, "skt1") and movestable[getItemAttribute(idd, "skt1")].move1 or movestable[name].move1)

local cdzin = (getPlayerStorageValue(mypoke, 212123) >= 1) and "cm_move"..it.."" or "move"..it..""

    if         it == "2"     then move = (getItemAttribute(idd, "skt2")) and movestable[getItemAttribute(idd, "skt2")].move2 or movestable[name].move2

    elseif it == "3"     then move = (getItemAttribute(idd, "skt3")) and movestable[getItemAttribute(idd, "skt3")].move3 or movestable[name].move3

    elseif it == "4"     then move = (getItemAttribute(idd, "skt4")) and movestable[getItemAttribute(idd, "skt4")].move4 or movestable[name].move4

    elseif it == "5"     then move = (getItemAttribute(idd, "skt5") ) and movestable[getItemAttribute(idd, "skt5")].move5 or movestable[name].move5

    elseif it == "6"     then move = (getItemAttribute(idd, "skt6")) and movestable[getItemAttribute(idd, "skt6")].move6 or movestable[name].move6

    elseif it == "7"     then move = (getItemAttribute(idd, "skt7")) and movestable[getItemAttribute(idd, "skt7")].move7 or movestable[name].move7

    elseif it == "8"     then move = (getItemAttribute(idd, "skt8")) and movestable[getItemAttribute(idd, "skt8")].move8 or 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

    elseif it == "m1" then move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm1") or false

    elseif it == "m2" then move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm2") or false

    elseif it == "m3" then move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm3") or false

    end

    

    if not move then

    local isMega = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "megaStone")

    local moveTable, index = getNewMoveTable(movestable[name]), 0

        if not isMega or name:find("Mega") then

            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")

            return true

        end

        for i = 1, 12 do

            if not moveTable then

                index = i

                break

            end

        end

        if tonumber(it) ~= index then 

            return true, doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")

        end

    local needCds = false                   --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, "para mega evoluir, os cds do pokemon devem estar carregados.")

                end

            end

        end

        move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0, f = 0, t = "?"}

    end

    

    if isInArray({1,2,3,4,5,6,7,8,9,10,11,12,13}, tonumber(it)) then

        mLevel = move.level

        mCD = move.cd

        mName = move.name

        mTarget = move.target

        mDist = move.dist

    else

        m = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "t"..it.."")

        mLevel = tmList[m].level

        mCD = tmList[m].cd

        mName = m

        mTarget = tmList[m].target

        mDist = tmList[m].dist

    end

    

    if getPlayerLevel(cid) < mLevel then

        return true,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need be atleast level "..mLevel.." to use this move.")

    elseif getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (mCD + 2) then

        return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." seconds to use "..mName.." again.")

    elseif getTileInfo(getThingPos(mypoke)).protection then

        return 0,doPlayerSendCancel(cid, "Your pokemon cannot use moves while in protection zone.")

    elseif getPlayerStorageValue(mypoke, 3894) >= 1 then

        return doPlayerSendCancel(cid, "You can't attack because you is with fear") --alterado v2.3

    elseif (mName == "Team Slice" or mName == "Team Claw") and #getCreatureSummons(cid) < 2 then    --alterado v2.5

        return 0,doPlayerSendCancel(cid, "Your pokemon need be in a team for use this move!")

    end

    

    if isCreature(getCreatureTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getCreatureTarget(cid))) and math.random(1, 100) <= 10 then

    local target = getCreatureTarget(cid)    

        if math.random(1, 100) <= passivesChances["Evasion"][getCreatureName(target)] then 

            if isCreature(getMasterTarget(target)) then

                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

            end    

        end

    end

    

    if mTarget == 1 then

        if not isCreature(getCreatureTarget(cid)) then

            return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don\'t have any targets.")

        elseif getCreatureCondition(getCreatureTarget(cid), CONDITION_INVISIBLE) then

            return 0

        elseif getCreatureHealth(getCreatureTarget(cid)) <= 0 then

            return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your have already defeated your target.")

        elseif not isCreature(getCreatureSummons(cid)[1]) then

            return true

        elseif getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid))) > mDist then

            return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Get closer to the target to use this move.")

        elseif not isSightClear(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid)), false) then

            return 0

        end

    end

    

    local newid = 0

    local spellMessage = msgs[math.random(#msgs)]..""..mName.."!"

    local summons = getCreatureSummons(cid)

    

    if isSleeping(mypoke) or isSilence(mypoke) then 

        return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.")

    else

        newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, mCD)

    end

    

    if mName == "Mega Evolution" then spellMessage = "Mega Evolve!" end

    doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..mName.."!", TALKTYPE_SAY)

    addEvent(doAlertReady, mCD * 1000, cid, newid, mName, it, cdzin)

    for i = 2, #summons do

        if isCreature(summons) and getPlayerStorageValue(cid, 637501) >= 1 then

            docastspell(summons, mName)

        end

    end

    docastspell(mypoke, mName)

    doCreatureAddCondition(cid, playerexhaust)

    if useKpdoDlls then doUpdateCooldowns(cid) end

    return 0

end

 

desse jeito funciona apenas o TM

quando tento usar o Mega da esse erro

[10/06/2017 19:32:53] [Error - TalkAction Interface] 

[10/06/2017 19:32:53] data/talkactions/scripts/move1.lua:onSay

[10/06/2017 19:32:53] Description: 

[10/06/2017 19:32:53] (luaGetCreatureName) Creature not found

Link para o comentário
Compartilhar em outros sites

Em 2017-6-10 at 09:03, Poccnn disse:

Tu quer mesclar o mega e o tm né?

ta ai, se houver algum problema, não conte comigo.

  Mostrar conteúdo oculto

local msgs = {"use ", ""}

function doAlertReady(cid, id, movename, n, cd)

local myball = getPlayerSlotItem(cid, 8):

local p = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)

    

    if not isCreature(cid) then return true end

    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

    if not p or #p <= 0 then return true end

    for a = 1, #p do

        if getItemAttribute(p[a], cd) == "cd:"..id.."" then

            if isInArray({"m1", "m2", "m3"}, n) then

                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (t"..n..") is ready!")

            else

                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (m"..n..") is ready!")

            end

            return true

        end

    end

end

function onSay(cid, words, param, channel)

    if param ~= "" then return true 

    elseif string.len(words) > 3 then return true

    elseif #getCreatureSummons(cid) == 0 then return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need a pokemon to use moves.")

    elseif getCreatureCondition(cid, CONDITION_EXHAUST) then return true

    elseif getCreatureName(mypoke) == "Evolution" then return true

    end

    

local mypoke = getCreatureSummons(cid)[1]

local name = (getCreatureName(mypoke) == "Ditto" or getCreatureName(mypoke) == "Shiny 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) or (getCreatureName(mypoke) == "Shiny Smeargle" and getItemAttribute(idd, "skt1") and movestable[getItemAttribute(idd, "skt1")].move1 or movestable[name].move1)

local cdzin = (getPlayerStorageValue(mypoke, 212123) >= 1) and "cm_move"..it.."" or "move"..it..""

    if         it == "2"     then move = (getItemAttribute(idd, "skt2")) and movestable[getItemAttribute(idd, "skt2")].move2 or movestable[name].move2

    elseif it == "3"     then move = (getItemAttribute(idd, "skt3")) and movestable[getItemAttribute(idd, "skt3")].move3 or movestable[name].move3

    elseif it == "4"     then move = (getItemAttribute(idd, "skt4")) and movestable[getItemAttribute(idd, "skt4")].move4 or movestable[name].move4

    elseif it == "5"     then move = (getItemAttribute(idd, "skt5") ) and movestable[getItemAttribute(idd, "skt5")].move5 or movestable[name].move5

    elseif it == "6"     then move = (getItemAttribute(idd, "skt6")) and movestable[getItemAttribute(idd, "skt6")].move6 or movestable[name].move6

    elseif it == "7"     then move = (getItemAttribute(idd, "skt7")) and movestable[getItemAttribute(idd, "skt7")].move7 or movestable[name].move7

    elseif it == "8"     then move = (getItemAttribute(idd, "skt8")) and movestable[getItemAttribute(idd, "skt8")].move8 or 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

    elseif it == "m1" then move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm1") or false

    elseif it == "m2" then move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm2") or false

    elseif it == "m3" then move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm3") or false

    end

    

    if not move then

    local isMega = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "megaStone")

    local moveTable, index = getNewMoveTable(movestable[name]), 0

        if not isMega or name:find("Mega") then

            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")

            return true

        end

        for i = 1, 12 do

            if not moveTable then

                index = i

                break

            end

        end

        if tonumber(it) ~= index then 

            return true, doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")

        end

    local needCds = false                   --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, "para mega evoluir, os cds do pokemon devem estar carregados.")

                end

            end

        end

        move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0, f = 0, t = "?"}

    end

    

    if isInArray({1,2,3,4,5,6,7,8,9,10,11,12,13}, tonumber(it)) then

        mLevel = move.level

        mCD = move.cd

        mName = move.name

        mTarget = move.target

        mDist = move.dist

    else

        m = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "t"..it.."")

        mLevel = tmList[m].level

        mCD = tmList[m].cd

        mName = m

        mTarget = tmList[m].target

        mDist = tmList[m].dist

    end

    

    if getPlayerLevel(cid) < mLevel then

        return true,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need be atleast level "..mLevel.." to use this move.")

    elseif getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (mCD + 2) then

        return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." seconds to use "..mName.." again.")

    elseif getTileInfo(getThingPos(mypoke)).protection then

        return 0,doPlayerSendCancel(cid, "Your pokemon cannot use moves while in protection zone.")

    elseif getPlayerStorageValue(mypoke, 3894) >= 1 then

        return doPlayerSendCancel(cid, "You can't attack because you is with fear") --alterado v2.3

    elseif (mName == "Team Slice" or mName == "Team Claw") and #getCreatureSummons(cid) < 2 then    --alterado v2.5

        return 0,doPlayerSendCancel(cid, "Your pokemon need be in a team for use this move!")

    end

    

    if isCreature(getCreatureTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getCreatureTarget(cid))) and math.random(1, 100) <= 10 then

    local target = getCreatureTarget(cid)    

        if math.random(1, 100) <= passivesChances["Evasion"][getCreatureName(target)] then 

            if isCreature(getMasterTarget(target)) then

                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

            end    

        end

    end

    

    if mTarget == 1 then

        if not isCreature(getCreatureTarget(cid)) then

            return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don\'t have any targets.")

        elseif getCreatureCondition(getCreatureTarget(cid), CONDITION_INVISIBLE) then

            return 0

        elseif getCreatureHealth(getCreatureTarget(cid)) <= 0 then

            return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your have already defeated your target.")

        elseif not isCreature(getCreatureSummons(cid)[1]) then

            return true

        elseif getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid))) > mDist then

            return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Get closer to the target to use this move.")

        elseif not isSightClear(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid)), false) then

            return 0

        end

    end

    

    local newid = 0

    local spellMessage = msgs[math.random(#msgs)]..""..mName.."!"

    local summons = getCreatureSummons(cid)

    

    if isSleeping(mypoke) or isSilence(mypoke) then 

        return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.")

    else

        newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, mCD)

    end

    

    if mName == "Mega Evolution" then spellMessage = "Mega Evolve!" end

    doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..mName.."!", TALKTYPE_SAY)

    addEvent(doAlertReady, mCD * 1000, cid, newid, mName, it, cdzin)

    for i = 2, #summons do

        if isCreature(summons) and getPlayerStorageValue(cid, 637501) >= 1 then

            docastspell(summons, mName)

        end

    end

    docastspell(mypoke, mName)

    doCreatureAddCondition(cid, playerexhaust)

    if useKpdoDlls then doUpdateCooldowns(cid) end

    return 0

end

 

aee man consegui fazer os 2 funcionar mas ta gerando um erro q pode fazer o server travar pode me ajudar com esse erro?

ERRO

Spoiler

[14/06/2017 01:24:47] [Error - TalkAction Interface] 

[14/06/2017 01:24:47] data/talkactions/scripts/move1.lua:onSay

[14/06/2017 01:24:47] Description: 

[14/06/2017 01:24:47] (luaGetCreatureName) Creature not found

para ele funcionar eu tive que tirar essa parte do script porem eu n tenho ideia de para que essa parte serve e sei q pode interfer em outra coisa

 

Spoiler

if tonumber(it) ~= index then 

            return true, doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")

            

        end

descobri tb que essa parte esta em conflito com essa outra talvez porque ambas tenha  o tonumber(it)

Spoiler

if isInArray({1,2,3,4,5,6,7,8,9,10,11,12}, tonumber(it)) then

        mLevel = move.level

        mCD = move.cd

        mName = move.name

        mTarget = move.target

        mDist = move.dist

    else

        m = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "t"..it.."")

        mLevel = tmList[m].level

        mCD = tmList[m].cd

        mName = m

        mTarget = tmList[m].target

        mDist = tmList[m].dist

    end

vou postar o script sem retirar a parte necessária ao funcionamento dele para q você possa olhar

 

SCRIPT

Spoiler

local msgs = {"use ", ""}

function doAlertReady(cid, id, movename, n, cd)

local myball = getPlayerSlotItem(cid, 8):

local p = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)

    

    if not isCreature(cid) then return true end

    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

    if not p or #p <= 0 then return true end

    for a = 1, #p do

        if getItemAttribute(p[a], cd) == "cd:"..id.."" then

            if isInArray({"m1", "m2", "m3"}, n) then

                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (t"..n..") is ready!")

            else

                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (m"..n..") is ready!")

            end

            return true

        end

    end

end

function onSay(cid, words, param, channel)

    if param ~= "" then return true 

    elseif string.len(words) > 3 then return true

    elseif #getCreatureSummons(cid) == 0 then return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need a pokemon to use moves.")

    elseif getCreatureCondition(cid, CONDITION_EXHAUST) then return true

    elseif getCreatureName(mypoke) == "Evolution" then return true

    end

    

local mypoke = getCreatureSummons(cid)[1]

local name = (getCreatureName(mypoke) == "Ditto" or getCreatureName(mypoke) == "Shiny 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) or (getCreatureName(mypoke) == "Shiny Smeargle" and getItemAttribute(idd, "skt1") and movestable[getItemAttribute(idd, "skt1")].move1 or movestable[name].move1)

local cdzin = (getPlayerStorageValue(mypoke, 212123) >= 1) and "cm_move"..it.."" or "move"..it..""

    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 == "m1" then

move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm1") or false

elseif it == "m2" then

move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm2") or false

elseif it == "m3" then

move = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm3") or false

end

    

    if not move then

    local isMega = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "megaStone")

    local moveTable, index = getNewMoveTable(movestable[name]), 0

        if not isMega or name:find("Mega") then

            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")

            return true

        end

        for i = 1, 12 do

            if not moveTable then

                index = i

                break

            end

        end

        if tonumber(it) ~= index then 

            return true, doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")

            

        end

    local needCds = false                   --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, "para mega evoluir, os cds do pokemon devem estar carregados.")

                end

            end

        end

        move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0, f = 0, t = "?"}

    end

    

    if isInArray({1,2,3,4,5,6,7,8,9,10,11,12}, tonumber(it)) then

        mLevel = move.level

        mCD = move.cd

        mName = move.name

        mTarget = move.target

        mDist = move.dist

    else

        m = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "t"..it.."")

        mLevel = tmList[m].level

        mCD = tmList[m].cd

        mName = m

        mTarget = tmList[m].target

        mDist = tmList[m].dist

    end

    

    if getPlayerLevel(cid) < mLevel then

        return true,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need be atleast level "..mLevel.." to use this move.")

    elseif getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (mCD + 2) then

        return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." seconds to use "..mName.." again.")

    elseif getTileInfo(getThingPos(mypoke)).protection then

        return 0,doPlayerSendCancel(cid, "Your pokemon cannot use moves while in protection zone.")

    elseif getPlayerStorageValue(mypoke, 3894) >= 1 then

        return doPlayerSendCancel(cid, "You can't attack because you is with fear") --alterado v2.3

    elseif (mName == "Team Slice" or mName == "Team Claw") and #getCreatureSummons(cid) < 2 then    --alterado v2.5

        return 0,doPlayerSendCancel(cid, "Your pokemon need be in a team for use this move!")

    end

    

    if isCreature(getCreatureTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getCreatureTarget(cid))) and math.random(1, 100) <= 10 then

    local target = getCreatureTarget(cid)    

        if math.random(1, 100) <= passivesChances["Evasion"][getCreatureName(target)] then 

            if isCreature(getMasterTarget(target)) then

                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

            end    

        end

    end

    

    if mTarget == 1 then

        if not isCreature(getCreatureTarget(cid)) then

            return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don\'t have any targets.")

        elseif getCreatureCondition(getCreatureTarget(cid), CONDITION_INVISIBLE) then

            return 0

        elseif getCreatureHealth(getCreatureTarget(cid)) <= 0 then

            return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your have already defeated your target.")

        elseif not isCreature(getCreatureSummons(cid)[1]) then

            return true

        elseif getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid))) > mDist then

            return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Get closer to the target to use this move.")

        elseif not isSightClear(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid)), false) then

            return 0

        end

    end

    

    local newid = 0

    local spellMessage = msgs[math.random(#msgs)]..""..mName.."!"

    local summons = getCreatureSummons(cid)

    

    if isSleeping(mypoke) or isSilence(mypoke) then 

        return 0,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.")

    else

        newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, mCD)

    end

    

    if mName == "Mega Evolution" then spellMessage = "Mega Evolve!" end

    doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..mName.."!", TALKTYPE_SAY)

    addEvent(doAlertReady, mCD * 1000, cid, newid, mName, it, cdzin)

    for i = 2, #summons do

        if isCreature(summons) and getPlayerStorageValue(cid, 637501) >= 1 then

            docastspell(summons, mName)

        end

    end

    docastspell(mypoke, mName)

    doCreatureAddCondition(cid, playerexhaust)

    if useKpdoDlls then doUpdateCooldowns(cid) end

    return 0

end

 

 

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...