Ir para conteúdo
  • 0

ajudem CDBAR


leofox97

Pergunta

8 respostass a esta questão

Posts Recomendados

  • 0

 

Tópico Movido

Este tópico foi movido de "OTServSpritingSuporte Spriting"

para "OTServClientsSuporte Clientes".

 

 

Tenta esse


​local backMSG = {"Come back, doka!", "Thanks for helping, doka!", "That's enough, come back!", "You were great, doka!", "Excellent work, doka!", "Well done, doka!"}
local goMSG   = {"Go, doka!", "Let's do it, doka!", "I choose you, doka!", "I need your help, doka!", "Let's fight, doka!", "It's battle time, doka!"}
 
function onUse(cid, item, frompos, item2, topos)
if #getCreatureSummons(cid) >= 1 and getPlayerStorageValue(getCreatureSummons(cid)[1], 33) >= 1 then
return true
end
--------
   msgunicaback =  backMSG[math.random(#backMSG)]
   msgunicago = goMSG[math.random(#goMSG)]
   btype = getPokeballType(item.itemid)
   usando = pokeballs[btype].use
   online = pokeballs[btype].on
   morto  = pokeballs[btype].off
   if isIconeSystem(cid) then
      effect = getItemAttribute(item.uid, "effect")
    else
      effect =  getItemAttribute(item.uid, "effect")
   end
--------
 
if item.itemid == usando then
if #getCreatureSummons(cid) >= 1 then
local z = getCreatureSummons(cid)[1]
local pokename = getCreatureName(z)
local mbk = msgunicaback:gsub("doka", pokename)
if getItemAttribute(item.uid, "poke"):find(getCreatureName(z)) then
doTransformItem(item.uid, item.itemid-1)
doCreatureSay(cid, mbk, TALKTYPE_SAY)
local summom = getCreatureSummons(cid)
local maxh = pokes[getCreatureName(summom[1])].vida
local pct2 = ((getCreatureHealth(summom[1])) / (getCreatureMaxHealth(summom[1])))
local vids = ((getCreatureHealth(summom[1])) - 2)
doCreatureAddHealth(summom[1], -vids)
setCreatureMaxHealth(summom[1], maxh)
doCreatureAddHealth(summom[1], ((maxh) * (pct2)))
if math.random(1,100) <= 35 then
  setPokemonFeed(cid, getPokemonFeed(cid)-15) -- Food system
end
doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")) .. " HP = ["..getCreatureHealth(z).."/"..getCreatureMaxHealth(z).."]")
setPlayerStorageValue(cid, 61204, 0)
setPlayerStorageValue(cid, 2, 0)
doSendMagicEffect(getCreaturePosition(z), effect)
doRemoveCreature(z)
if useOTClient then
   doPlayerSendCancel(cid, '12//,hide') --alterado v1.7
end
if useKpdoDlls then
   doUpdateMoves(cid)
end
if getPlayerStorageValue(cid, 991) >= 1 then  --- Ginasios
   doSendAnimatedText(getThingPos(cid), "POKEOUT", 181)
   setPlayerStorageValue(cid, 991, getPlayerStorageValue(cid, 991) -1)
end
return true
end
end
elseif item.itemid == morto then
       return doPlayerSendCancel(cid, "This pokemon is fainted.")
 
elseif item.itemid == online then
if isZumbie(cid) or isHuman(cid) then
return doPlayerSendCancel(cid, "Sorry, is not possible.")
end
if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
 doPlayerSendCancel(cid, "You must put your pokeball in the correct place!")
 return TRUE
end
 

if not canSummon(cid) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)
end
 
if getPlayerStorageValue(cid, 63215) >= 1 then
return doPlayerSendCancel(cid, "You can't use pokeball while surfing.")
end
 
if getPlayerStorageValue(cid, 62314) >= 1 then
return doPlayerSendCancel(cid, "You can't use pokeball while flying.")
end
 
if #getCreatureSummons(cid) >= 1 then
return doPlayerSendCancel(cid, "You have already summoned a pokemon.")
end
 
for i,x in pairs(pokes) do
if i == getItemAttribute(item.uid, "poke"):sub(9, findLetter(getItemAttribute(item.uid, "poke"), "'")-1) then
 
if getPlayerLevel(cid) < x.level+getPokemonBoostt(item.uid) then
doPlayerSendCancel(cid, "You need level "..x.level+getPokemonBoostt(item.uid).." or higher to use this pokemon.")
return true
end
local removed = doCreateItem(1285, 1, getThingPos(cid))
doSummonMonster(cid, i)
local pk = getCreatureSummons(cid)[1]
doTeleportThing(pk, getClosestFreeTile(pk, getThingPos(cid)), false)
doRemoveItem(removed, 1)
doCreatureSetLookDir(pk, 2)
local maxh = pokes[getCreatureName(pk)].vida
local levellife = ((getPlayerLevel(cid)) *2+ getPokemonBoost(getPlayerSlotItem(cid,8).uid))
local health = tonumber(getItemAttribute(item.uid, "poke"):match("%[(.-)/"))
doConvinceCreature(cid, pk)
doCreatureAddHealth(pk, health-maxh)
local pct = ((getCreatureHealth(pk)) / (getCreatureMaxHealth(pk)))
local vidis = (getCreatureHealth(pk))
setCreatureMaxHealth(pk, ((maxh) + (levellife)))
doCreatureAddHealth(pk, 2)
doCreatureAddHealth(pk, -vidis)
doCreatureAddHealth(pk, ((getCreatureMaxHealth(pk)) * (pct)) - 2)
doTransformItem(item.uid, item.itemid+1)
local pokename = getCreatureName(getCreatureSummons(cid)[1])
local mgo = msgunicago:gsub("doka", pokename)
doCreatureSay(cid, mgo, TALKTYPE_SAY)
if useOTClient then
   doPlayerSendCancel(cid, '12//,show') --alterado v1.7
end
if useKpdoDlls then
   doUpdateMoves(cid)
end
if math.random(1,100) <= 35 then
  setPokemonFeed(cid, getPokemonFeed(cid)-5) -- Food system
end
doSendFeedEffect(cid)
if getItemAttribute(item.uid, "nome") ~= "Ditto" then
for i = 1, 12 do
if not getMoveNamee(cid, i) then
addEvent(doGoBackSetCooldown, 200, cid)
end
end
else
for a = 1, 12 do
  setPokemonCooldown(cid, a, "Don't have this move.")
end
end
----- Burn, venom e ice system ------
getBurn(cid)
getVenom(cid)
getIce(cid)
----- Burn, venom e ice system ------
doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")))
doItemSetAttribute(item.uid, "pokes", ""..pokename.."")
doSendMagicEffect(getCreaturePosition(pk), effect)
setPlayerStorageValue(cid, 61204, 1)
registerCreatureEvent(pk, "DiePoke")
registerCreatureEvent(pk, "Exp")
--ShinyBallSystem\/
isShinyBallOrBoosted(cid, item)
 
if getPlayerStorageValue(cid, 991) >= 1 then  --- Ginasios
   doSendAnimatedText(getThingPos(cid), "POKEIN", TEXTCOLOR_LIGHTBLUE)
end
 
break
end
end
end
return TRUE
end

Aberos

muito obrigado ja conseguir resvolver praticamente ficou igual no seu, vlw voce me ajudo muito.​

Link para o comentário
Compartilhar em outros sites

  • 0

 

se tiver usando a cdbar do pda

 

vai em action/script/goback.lua

 

antes do ultimo return true

adicione:

if useKpdoDlls then
doUpdateMoves(cid)
end

StyloMaldoso ja tem isso na minha goback acho que ta faltando um

doPlayerSendCancel(cid, '12//,hide') ​ mas nao sei como devo colocalo

 

 

da uma olha no meu gobak

 

 

 

local backMSG = {"Come back, doka!", "Thanks for helping, doka!", "That's enough, come back!", "You were great, doka!", "Excellent work, doka!", "Well done, doka!"}

local goMSG = {"Go, doka!", "Let's do it, doka!", "I choose you, doka!", "I need your help, doka!", "Let's fight, doka!", "It's battle time, doka!"}

function onUse(cid, item, frompos, item2, topos)

if #getCreatureSummons(cid) >= 1 and getPlayerStorageValue(getCreatureSummons(cid)[1], 33) >= 1 then

return true

end

--------

msgunicaback = backMSG[math.random(#backMSG)]

msgunicago = goMSG[math.random(#goMSG)]

btype = getPokeballType(item.itemid)

usando = pokeballs[btype].use

online = pokeballs[btype].on

morto = pokeballs[btype].off

if isIconeSystem(cid) then

effect = getItemAttribute(item.uid, "effect")

else

effect = getItemAttribute(item.uid, "effect")

end

--------

if item.itemid == usando then

if #getCreatureSummons(cid) >= 1 then

local z = getCreatureSummons(cid)[1]

local pokename = getCreatureName(z)

local mbk = msgunicaback:gsub("doka", pokename)

if getItemAttribute(item.uid, "poke"):find(getCreatureName(z)) then

doTransformItem(item.uid, item.itemid-1)

doCreatureSay(cid, mbk, TALKTYPE_SAY)

doPlayerSendCancel(cid, '12//,hide')

local summom = getCreatureSummons(cid)

local maxh = pokes[getCreatureName(summom[1])].vida

local pct2 = ((getCreatureHealth(summom[1])) / (getCreatureMaxHealth(summom[1])))

local vids = ((getCreatureHealth(summom[1])) - 2)

doCreatureAddHealth(summom[1], -vids)

setCreatureMaxHealth(summom[1], maxh)

doCreatureAddHealth(summom[1], ((maxh) * (pct2)))

if math.random(1,100) <= 35 then

setPokemonFeed(cid, getPokemonFeed(cid)-15) -- Food system

end

doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")) .. " HP = ["..getCreatureHealth(z).."/"..getCreatureMaxHealth(z).."]")

setPlayerStorageValue(cid, 61204, 0)

setPlayerStorageValue(cid, 2, 0)

doSendMagicEffect(getCreaturePosition(z), effect)

doRemoveCreature(z)

if getPlayerStorageValue(cid, 991) >= 1 then --- Ginasios

doSendAnimatedText(getThingPos(cid), "POKEOUT", 181)

setPlayerStorageValue(cid, 991, getPlayerStorageValue(cid, 991) -1)

end

return true

end

end

elseif item.itemid == morto then

return doPlayerSendCancel(cid, "This pokemon is fainted.")

elseif item.itemid == online then

if isZumbie(cid) or isHuman(cid) then

return doPlayerSendCancel(cid, "Sorry, is not possible.")

end

if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then

doPlayerSendCancel(cid, "You must put your pokeball in the correct place!")

return TRUE

end

if not canSummon(cid) then

return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)

end

if getPlayerStorageValue(cid, 63215) >= 1 then

return doPlayerSendCancel(cid, "You can't use pokeball while surfing.")

end

if getPlayerStorageValue(cid, 62314) >= 1 then

return doPlayerSendCancel(cid, "You can't use pokeball while flying.")

end

if #getCreatureSummons(cid) >= 1 then

return doPlayerSendCancel(cid, "You have already summoned a pokemon.")

end

for i,x in pairs(pokes) do

if i == getItemAttribute(item.uid, "poke"):sub(9, findLetter(getItemAttribute(item.uid, "poke"), "'")-1) then

if getPlayerLevel(cid) < x.level+getPokemonBoostt(item.uid) then

doPlayerSendCancel(cid, "You need level "..x.level+getPokemonBoostt(item.uid).." or higher to use this pokemon.")

return true

end

local removed = doCreateItem(1285, 1, getThingPos(cid))

doSummonMonster(cid, i)

local pk = getCreatureSummons(cid)[1]

doTeleportThing(pk, getClosestFreeTile(pk, getThingPos(cid)), false)

doRemoveItem(removed, 1)

doCreatureSetLookDir(pk, 2)

local maxh = pokes[getCreatureName(pk)].vida

local levellife = ((getPlayerLevel(cid)) *2+ getPokemonBoost(getPlayerSlotItem(cid,8).uid))

local health = tonumber(getItemAttribute(item.uid, "poke"):match("%[(.-)/"))

doConvinceCreature(cid, pk)

doCreatureAddHealth(pk, health-maxh)

local pct = ((getCreatureHealth(pk)) / (getCreatureMaxHealth(pk)))

local vidis = (getCreatureHealth(pk))

setCreatureMaxHealth(pk, ((maxh) + (levellife)))

doCreatureAddHealth(pk, 2)

doCreatureAddHealth(pk, -vidis)

doCreatureAddHealth(pk, ((getCreatureMaxHealth(pk)) * (pct)) - 2)

doTransformItem(item.uid, item.itemid+1)

local pokename = getCreatureName(getCreatureSummons(cid)[1])

local mgo = msgunicago:gsub("doka", pokename)

doCreatureSay(cid, mgo, TALKTYPE_SAY)

if useOTClient then

doPlayerSendCancel(cid, '12//,show') --alterado v1.7

end

if useKpdoDlls then

doUpdateMoves(cid)

end

if math.random(1,100) <= 35 then

setPokemonFeed(cid, getPokemonFeed(cid)-5) -- Food system

end

doSendFeedEffect(cid)

if getItemAttribute(item.uid, "nome") ~= "Ditto" then

for i = 1, 12 do

if not getMoveNamee(cid, i) then

addEvent(doGoBackSetCooldown, 200, cid)

end

end

else

for a = 1, 12 do

setPokemonCooldown(cid, a, "Don't have this move.")

end

end

----- Burn, venom e ice system ------

getBurn(cid)

getVenom(cid)

getIce(cid)

----- Burn, venom e ice system ------

doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")))

doItemSetAttribute(item.uid, "pokes", ""..pokename.."")

doSendMagicEffect(getCreaturePosition(pk), effect)

setPlayerStorageValue(cid, 61204, 1)

registerCreatureEvent(pk, "DiePoke")

registerCreatureEvent(pk, "Exp")

--ShinyBallSystem\/

isShinyBallOrBoosted(cid, item)

if getPlayerStorageValue(cid, 991) >= 1 then --- Ginasios

doSendAnimatedText(getThingPos(cid), "POKEIN", TEXTCOLOR_LIGHTBLUE)

end

break

end

end

end

return TRUE

end

Link para o comentário
Compartilhar em outros sites

  • 0

 

 

local backMSG = {"Come back, doka!", "Thanks for helping, doka!", "That's enough, come back!", "You were great, doka!", "Excellent work, doka!", "Well done, doka!"}
local goMSG   = {"Go, doka!", "Let's do it, doka!", "I choose you, doka!", "I need your help, doka!", "Let's fight, doka!", "It's battle time, doka!"}
 
function onUse(cid, item, frompos, item2, topos)
if #getCreatureSummons(cid) >= 1 and getPlayerStorageValue(getCreatureSummons(cid)[1], 33) >= 1 then
return true
end
--------
   msgunicaback =  backMSG[math.random(#backMSG)]
   msgunicago = goMSG[math.random(#goMSG)]
   btype = getPokeballType(item.itemid)
   usando = pokeballs[btype].use
   online = pokeballs[btype].on
   morto  = pokeballs[btype].off
   if isIconeSystem(cid) then
      effect = getItemAttribute(item.uid, "effect")
    else
      effect =  getItemAttribute(item.uid, "effect")
   end
--------
 
if item.itemid == usando then
if #getCreatureSummons(cid) >= 1 then
local z = getCreatureSummons(cid)[1]
local pokename = getCreatureName(z)
local mbk = msgunicaback:gsub("doka", pokename)
if getItemAttribute(item.uid, "poke"):find(getCreatureName(z)) then
doTransformItem(item.uid, item.itemid-1)
doCreatureSay(cid, mbk, TALKTYPE_SAY)
doPlayerSendCancel(cid, '12//,hide')
local summom = getCreatureSummons(cid)
local maxh = pokes[getCreatureName(summom[1])].vida
local pct2 = ((getCreatureHealth(summom[1])) / (getCreatureMaxHealth(summom[1])))
local vids = ((getCreatureHealth(summom[1])) - 2)
doCreatureAddHealth(summom[1], -vids)
setCreatureMaxHealth(summom[1], maxh)
doCreatureAddHealth(summom[1], ((maxh) * (pct2)))
if math.random(1,100) <= 35 then
  setPokemonFeed(cid, getPokemonFeed(cid)-15) -- Food system
end
doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")) .. " HP = ["..getCreatureHealth(z).."/"..getCreatureMaxHealth(z).."]")
setPlayerStorageValue(cid, 61204, 0)
setPlayerStorageValue(cid, 2, 0)
doSendMagicEffect(getCreaturePosition(z), effect)
doRemoveCreature(z)
if getPlayerStorageValue(cid, 991) >= 1 then  --- Ginasios
   doSendAnimatedText(getThingPos(cid), "POKEOUT", 181)
   setPlayerStorageValue(cid, 991, getPlayerStorageValue(cid, 991) -1)
end
return true
end
end
elseif item.itemid == morto then
       return doPlayerSendCancel(cid, "This pokemon is fainted.")
 
elseif item.itemid == online then
if isZumbie(cid) or isHuman(cid) then
return doPlayerSendCancel(cid, "Sorry, is not possible.")
end
if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
 doPlayerSendCancel(cid, "You must put your pokeball in the correct place!")
 return TRUE
end
 
 
if not canSummon(cid) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)
end
 
if getPlayerStorageValue(cid, 63215) >= 1 then
return doPlayerSendCancel(cid, "You can't use pokeball while surfing.")
end
 
if getPlayerStorageValue(cid, 62314) >= 1 then
return doPlayerSendCancel(cid, "You can't use pokeball while flying.")
end
 
if #getCreatureSummons(cid) >= 1 then
return doPlayerSendCancel(cid, "You have already summoned a pokemon.")
end
 
for i,x in pairs(pokes) do
if i == getItemAttribute(item.uid, "poke"):sub(9, findLetter(getItemAttribute(item.uid, "poke"), "'")-1) then
 
if getPlayerLevel(cid) < x.level+getPokemonBoostt(item.uid) then
doPlayerSendCancel(cid, "You need level "..x.level+getPokemonBoostt(item.uid).." or higher to use this pokemon.")
return true
end
local removed = doCreateItem(1285, 1, getThingPos(cid))
doSummonMonster(cid, i)
local pk = getCreatureSummons(cid)[1]
doTeleportThing(pk, getClosestFreeTile(pk, getThingPos(cid)), false)
doRemoveItem(removed, 1)
doCreatureSetLookDir(pk, 2)
local maxh = pokes[getCreatureName(pk)].vida
local levellife = ((getPlayerLevel(cid)) *2+ getPokemonBoost(getPlayerSlotItem(cid,8).uid))
local health = tonumber(getItemAttribute(item.uid, "poke"):match("%[(.-)/"))
doConvinceCreature(cid, pk)
doCreatureAddHealth(pk, health-maxh)
local pct = ((getCreatureHealth(pk)) / (getCreatureMaxHealth(pk)))
local vidis = (getCreatureHealth(pk))
setCreatureMaxHealth(pk, ((maxh) + (levellife)))
doCreatureAddHealth(pk, 2)
doCreatureAddHealth(pk, -vidis)
doCreatureAddHealth(pk, ((getCreatureMaxHealth(pk)) * (pct)) - 2)
doTransformItem(item.uid, item.itemid+1)
local pokename = getCreatureName(getCreatureSummons(cid)[1])
local mgo = msgunicago:gsub("doka", pokename)
doCreatureSay(cid, mgo, TALKTYPE_SAY)
if useOTClient then
   doPlayerSendCancel(cid, '12//,show') --alterado v1.7
end
if math.random(1,100) <= 35 then
  setPokemonFeed(cid, getPokemonFeed(cid)-5) -- Food system
end
doSendFeedEffect(cid)
if getItemAttribute(item.uid, "nome") ~= "Ditto" then
for i = 1, 12 do
if not getMoveNamee(cid, i) then
addEvent(doGoBackSetCooldown, 200, cid)
end
end
else
for a = 1, 12 do
  setPokemonCooldown(cid, a, "Don't have this move.")
end
end
----- Burn, venom e ice system ------
getBurn(cid)
getVenom(cid)
getIce(cid)
----- Burn, venom e ice system ------
doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")))
doItemSetAttribute(item.uid, "pokes", ""..pokename.."")
doSendMagicEffect(getCreaturePosition(pk), effect)
setPlayerStorageValue(cid, 61204, 1)
registerCreatureEvent(pk, "DiePoke")
registerCreatureEvent(pk, "Exp")
--ShinyBallSystem\/
isShinyBallOrBoosted(cid, item)
 
if getPlayerStorageValue(cid, 991) >= 1 then  --- Ginasios
   doSendAnimatedText(getThingPos(cid), "POKEIN", TEXTCOLOR_LIGHTBLUE)
end
 
break
end
end
end
  if useKpdoDlls then
     doUpdateMoves(cid)
   end
  doPlayerSendCancel(cid, '12//,hide')
return TRUE
end
​

Link para o comentário
Compartilhar em outros sites

  • 0

 

 

 

local backMSG = {"Come back, doka!", "Thanks for helping, doka!", "That's enough, come back!", "You were great, doka!", "Excellent work, doka!", "Well done, doka!"}
local goMSG   = {"Go, doka!", "Let's do it, doka!", "I choose you, doka!", "I need your help, doka!", "Let's fight, doka!", "It's battle time, doka!"}
 
function onUse(cid, item, frompos, item2, topos)
if #getCreatureSummons(cid) >= 1 and getPlayerStorageValue(getCreatureSummons(cid)[1], 33) >= 1 then
return true
end
--------
   msgunicaback =  backMSG[math.random(#backMSG)]
   msgunicago = goMSG[math.random(#goMSG)]
   btype = getPokeballType(item.itemid)
   usando = pokeballs[btype].use
   online = pokeballs[btype].on
   morto  = pokeballs[btype].off
   if isIconeSystem(cid) then
      effect = getItemAttribute(item.uid, "effect")
    else
      effect =  getItemAttribute(item.uid, "effect")
   end
--------
 
if item.itemid == usando then
if #getCreatureSummons(cid) >= 1 then
local z = getCreatureSummons(cid)[1]
local pokename = getCreatureName(z)
local mbk = msgunicaback:gsub("doka", pokename)
if getItemAttribute(item.uid, "poke"):find(getCreatureName(z)) then
doTransformItem(item.uid, item.itemid-1)
doCreatureSay(cid, mbk, TALKTYPE_SAY)
doPlayerSendCancel(cid, '12//,hide')
local summom = getCreatureSummons(cid)
local maxh = pokes[getCreatureName(summom[1])].vida
local pct2 = ((getCreatureHealth(summom[1])) / (getCreatureMaxHealth(summom[1])))
local vids = ((getCreatureHealth(summom[1])) - 2)
doCreatureAddHealth(summom[1], -vids)
setCreatureMaxHealth(summom[1], maxh)
doCreatureAddHealth(summom[1], ((maxh) * (pct2)))
if math.random(1,100) <= 35 then
  setPokemonFeed(cid, getPokemonFeed(cid)-15) -- Food system
end
doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")) .. " HP = ["..getCreatureHealth(z).."/"..getCreatureMaxHealth(z).."]")
setPlayerStorageValue(cid, 61204, 0)
setPlayerStorageValue(cid, 2, 0)
doSendMagicEffect(getCreaturePosition(z), effect)
doRemoveCreature(z)
if getPlayerStorageValue(cid, 991) >= 1 then  --- Ginasios
   doSendAnimatedText(getThingPos(cid), "POKEOUT", 181)
   setPlayerStorageValue(cid, 991, getPlayerStorageValue(cid, 991) -1)
end
return true
end
end
elseif item.itemid == morto then
       return doPlayerSendCancel(cid, "This pokemon is fainted.")
 
elseif item.itemid == online then
if isZumbie(cid) or isHuman(cid) then
return doPlayerSendCancel(cid, "Sorry, is not possible.")
end
if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
 doPlayerSendCancel(cid, "You must put your pokeball in the correct place!")
 return TRUE
end
 
 
if not canSummon(cid) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)
end
 
if getPlayerStorageValue(cid, 63215) >= 1 then
return doPlayerSendCancel(cid, "You can't use pokeball while surfing.")
end
 
if getPlayerStorageValue(cid, 62314) >= 1 then
return doPlayerSendCancel(cid, "You can't use pokeball while flying.")
end
 
if #getCreatureSummons(cid) >= 1 then
return doPlayerSendCancel(cid, "You have already summoned a pokemon.")
end
 
for i,x in pairs(pokes) do
if i == getItemAttribute(item.uid, "poke"):sub(9, findLetter(getItemAttribute(item.uid, "poke"), "'")-1) then
 
if getPlayerLevel(cid) < x.level+getPokemonBoostt(item.uid) then
doPlayerSendCancel(cid, "You need level "..x.level+getPokemonBoostt(item.uid).." or higher to use this pokemon.")
return true
end
local removed = doCreateItem(1285, 1, getThingPos(cid))
doSummonMonster(cid, i)
local pk = getCreatureSummons(cid)[1]
doTeleportThing(pk, getClosestFreeTile(pk, getThingPos(cid)), false)
doRemoveItem(removed, 1)
doCreatureSetLookDir(pk, 2)
local maxh = pokes[getCreatureName(pk)].vida
local levellife = ((getPlayerLevel(cid)) *2+ getPokemonBoost(getPlayerSlotItem(cid,8).uid))
local health = tonumber(getItemAttribute(item.uid, "poke"):match("%[(.-)/"))
doConvinceCreature(cid, pk)
doCreatureAddHealth(pk, health-maxh)
local pct = ((getCreatureHealth(pk)) / (getCreatureMaxHealth(pk)))
local vidis = (getCreatureHealth(pk))
setCreatureMaxHealth(pk, ((maxh) + (levellife)))
doCreatureAddHealth(pk, 2)
doCreatureAddHealth(pk, -vidis)
doCreatureAddHealth(pk, ((getCreatureMaxHealth(pk)) * (pct)) - 2)
doTransformItem(item.uid, item.itemid+1)
local pokename = getCreatureName(getCreatureSummons(cid)[1])
local mgo = msgunicago:gsub("doka", pokename)
doCreatureSay(cid, mgo, TALKTYPE_SAY)
if useOTClient then
   doPlayerSendCancel(cid, '12//,show') --alterado v1.7
end
if math.random(1,100) <= 35 then
  setPokemonFeed(cid, getPokemonFeed(cid)-5) -- Food system
end
doSendFeedEffect(cid)
if getItemAttribute(item.uid, "nome") ~= "Ditto" then
for i = 1, 12 do
if not getMoveNamee(cid, i) then
addEvent(doGoBackSetCooldown, 200, cid)
end
end
else
for a = 1, 12 do
  setPokemonCooldown(cid, a, "Don't have this move.")
end
end
----- Burn, venom e ice system ------
getBurn(cid)
getVenom(cid)
getIce(cid)
----- Burn, venom e ice system ------
doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")))
doItemSetAttribute(item.uid, "pokes", ""..pokename.."")
doSendMagicEffect(getCreaturePosition(pk), effect)
setPlayerStorageValue(cid, 61204, 1)
registerCreatureEvent(pk, "DiePoke")
registerCreatureEvent(pk, "Exp")
--ShinyBallSystem\/
isShinyBallOrBoosted(cid, item)
 
if getPlayerStorageValue(cid, 991) >= 1 then  --- Ginasios
   doSendAnimatedText(getThingPos(cid), "POKEIN", TEXTCOLOR_LIGHTBLUE)
end
 
break
end
end
end
  if useKpdoDlls then
     doUpdateMoves(cid)
   end
  doPlayerSendCancel(cid, '12//,hide')
return TRUE
end
​

 

tentei isso antes de voce mencionar , mas quando solto o pokemon nao abre mas a cd bar ate pensei que tava fazendo algo errado por isso vim pedir ajuda aqui no forum.

 

obs nao da nenhum erro no console

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

  • 0

Tópico Movido
Este tópico foi movido de "OTServSpritingSuporte Spriting"
para "OTServClientsSuporte Clientes".

 

 


Tenta esse


​local backMSG = {"Come back, doka!", "Thanks for helping, doka!", "That's enough, come back!", "You were great, doka!", "Excellent work, doka!", "Well done, doka!"}
local goMSG   = {"Go, doka!", "Let's do it, doka!", "I choose you, doka!", "I need your help, doka!", "Let's fight, doka!", "It's battle time, doka!"}
 
function onUse(cid, item, frompos, item2, topos)
if #getCreatureSummons(cid) >= 1 and getPlayerStorageValue(getCreatureSummons(cid)[1], 33) >= 1 then
return true
end
--------
   msgunicaback =  backMSG[math.random(#backMSG)]
   msgunicago = goMSG[math.random(#goMSG)]
   btype = getPokeballType(item.itemid)
   usando = pokeballs[btype].use
   online = pokeballs[btype].on
   morto  = pokeballs[btype].off
   if isIconeSystem(cid) then
      effect = getItemAttribute(item.uid, "effect")
    else
      effect =  getItemAttribute(item.uid, "effect")
   end
--------
 
if item.itemid == usando then
if #getCreatureSummons(cid) >= 1 then
local z = getCreatureSummons(cid)[1]
local pokename = getCreatureName(z)
local mbk = msgunicaback:gsub("doka", pokename)
if getItemAttribute(item.uid, "poke"):find(getCreatureName(z)) then
doTransformItem(item.uid, item.itemid-1)
doCreatureSay(cid, mbk, TALKTYPE_SAY)
local summom = getCreatureSummons(cid)
local maxh = pokes[getCreatureName(summom[1])].vida
local pct2 = ((getCreatureHealth(summom[1])) / (getCreatureMaxHealth(summom[1])))
local vids = ((getCreatureHealth(summom[1])) - 2)
doCreatureAddHealth(summom[1], -vids)
setCreatureMaxHealth(summom[1], maxh)
doCreatureAddHealth(summom[1], ((maxh) * (pct2)))
if math.random(1,100) <= 35 then
  setPokemonFeed(cid, getPokemonFeed(cid)-15) -- Food system
end
doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")) .. " HP = ["..getCreatureHealth(z).."/"..getCreatureMaxHealth(z).."]")
setPlayerStorageValue(cid, 61204, 0)
setPlayerStorageValue(cid, 2, 0)
doSendMagicEffect(getCreaturePosition(z), effect)
doRemoveCreature(z)
if useOTClient then
   doPlayerSendCancel(cid, '12//,hide') --alterado v1.7
end
if useKpdoDlls then
   doUpdateMoves(cid)
end
if getPlayerStorageValue(cid, 991) >= 1 then  --- Ginasios
   doSendAnimatedText(getThingPos(cid), "POKEOUT", 181)
   setPlayerStorageValue(cid, 991, getPlayerStorageValue(cid, 991) -1)
end
return true
end
end
elseif item.itemid == morto then
       return doPlayerSendCancel(cid, "This pokemon is fainted.")
 
elseif item.itemid == online then
if isZumbie(cid) or isHuman(cid) then
return doPlayerSendCancel(cid, "Sorry, is not possible.")
end
if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
 doPlayerSendCancel(cid, "You must put your pokeball in the correct place!")
 return TRUE
end
 

if not canSummon(cid) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)
end
 
if getPlayerStorageValue(cid, 63215) >= 1 then
return doPlayerSendCancel(cid, "You can't use pokeball while surfing.")
end
 
if getPlayerStorageValue(cid, 62314) >= 1 then
return doPlayerSendCancel(cid, "You can't use pokeball while flying.")
end
 
if #getCreatureSummons(cid) >= 1 then
return doPlayerSendCancel(cid, "You have already summoned a pokemon.")
end
 
for i,x in pairs(pokes) do
if i == getItemAttribute(item.uid, "poke"):sub(9, findLetter(getItemAttribute(item.uid, "poke"), "'")-1) then
 
if getPlayerLevel(cid) < x.level+getPokemonBoostt(item.uid) then
doPlayerSendCancel(cid, "You need level "..x.level+getPokemonBoostt(item.uid).." or higher to use this pokemon.")
return true
end
local removed = doCreateItem(1285, 1, getThingPos(cid))
doSummonMonster(cid, i)
local pk = getCreatureSummons(cid)[1]
doTeleportThing(pk, getClosestFreeTile(pk, getThingPos(cid)), false)
doRemoveItem(removed, 1)
doCreatureSetLookDir(pk, 2)
local maxh = pokes[getCreatureName(pk)].vida
local levellife = ((getPlayerLevel(cid)) *2+ getPokemonBoost(getPlayerSlotItem(cid,8).uid))
local health = tonumber(getItemAttribute(item.uid, "poke"):match("%[(.-)/"))
doConvinceCreature(cid, pk)
doCreatureAddHealth(pk, health-maxh)
local pct = ((getCreatureHealth(pk)) / (getCreatureMaxHealth(pk)))
local vidis = (getCreatureHealth(pk))
setCreatureMaxHealth(pk, ((maxh) + (levellife)))
doCreatureAddHealth(pk, 2)
doCreatureAddHealth(pk, -vidis)
doCreatureAddHealth(pk, ((getCreatureMaxHealth(pk)) * (pct)) - 2)
doTransformItem(item.uid, item.itemid+1)
local pokename = getCreatureName(getCreatureSummons(cid)[1])
local mgo = msgunicago:gsub("doka", pokename)
doCreatureSay(cid, mgo, TALKTYPE_SAY)
if useOTClient then
   doPlayerSendCancel(cid, '12//,show') --alterado v1.7
end
if useKpdoDlls then
   doUpdateMoves(cid)
end
if math.random(1,100) <= 35 then
  setPokemonFeed(cid, getPokemonFeed(cid)-5) -- Food system
end
doSendFeedEffect(cid)
if getItemAttribute(item.uid, "nome") ~= "Ditto" then
for i = 1, 12 do
if not getMoveNamee(cid, i) then
addEvent(doGoBackSetCooldown, 200, cid)
end
end
else
for a = 1, 12 do
  setPokemonCooldown(cid, a, "Don't have this move.")
end
end
----- Burn, venom e ice system ------
getBurn(cid)
getVenom(cid)
getIce(cid)
----- Burn, venom e ice system ------
doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")))
doItemSetAttribute(item.uid, "pokes", ""..pokename.."")
doSendMagicEffect(getCreaturePosition(pk), effect)
setPlayerStorageValue(cid, 61204, 1)
registerCreatureEvent(pk, "DiePoke")
registerCreatureEvent(pk, "Exp")
--ShinyBallSystem\/
isShinyBallOrBoosted(cid, item)
 
if getPlayerStorageValue(cid, 991) >= 1 then  --- Ginasios
   doSendAnimatedText(getThingPos(cid), "POKEIN", TEXTCOLOR_LIGHTBLUE)
end
 
break
end
end
end
return TRUE
end

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...