Ir para conteúdo

[Encerrado] [Pokemon] Dúvidas? - Pda


lucashgas

Posts Recomendados

@brun123 Eu testei aqui Charmeleon x Ivysaur, ambos com o mesmo level e o ivysaur quase ganho ... Os danos de fogo não estão tão fortes,

 

acho que essa fórmula de defesa está "prejudicando" a super efetividade por isso quero mexer aqui na super efetividade :p

 

Você está de parabéns, ótimo trabalho cara.

Link para o comentário
Compartilhar em outros sites

@DrMasters

soluçao... arrumando akilo aparece os CDs na barra... -mas aki ta demorando pra muda a barra hehe-

 

@Brun123

aki ainda ta errado o alerta q tem cd ready..

18:46 Snorlax - Twister (m2) is ready!

18:46 Snorlax - Dragon Pulse (m3) is ready!

18:46 Snorlax - Dragon Breath (m4) is ready!

sai isso ms eu tanto com o Dragonite... ;x

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

Com o cliente que ele postou agora aparece a barra com os portfoil dos poke pra trocar..mas a barra com o Cooldowns não apareçe..

E quando cliko na foto do poke e ele sai da ball aparece esse erro o mesmo erro:

 

 

[17/01/2012 18:43:03] [Error - TalkAction Interface]

[17/01/2012 18:43:03] In a timer event called from:

[17/01/2012 18:43:03] data/talkactions/scripts/cdbar.lua:onSay

[17/01/2012 18:43:03] Description:

[17/01/2012 18:43:03] data/lib/some functions.lua:722: attempt to index a number value

[17/01/2012 18:43:03] stack traceback:

[17/01/2012 18:43:03] data/lib/some functions.lua:722: in function 'getCD'

[17/01/2012 18:43:03] data/lib/cooldown bar.lua:118: in function <data/lib/cooldown bar.lua:105>

Link para o comentário
Compartilhar em outros sites

Bom Subistitua sua Cooldown bar por essa que arrumei!

 

 

function getPlayerPokeballs(cid)
local ret = {}
local container = 0

if isCreature(cid) then
	container = getPlayerSlotItem(cid, 3).uid
	local myball = getPlayerSlotItem(cid, 8)
	if myball.uid > 0 then
		table.insert(ret, myball)
	end
else
	container = cid
end

if isContainer(container) and getContainerSize(container) > 0 then
	for slot = 0, (getContainerSize(container) - 1) do
		local item = getContainerItem(container, slot)
		if isContainer(item.uid) then
			local itemsbag = getPlayerPokeballs(item.uid)
			if itemsbag and #itemsbag > 0 then
				for i = 0, #itemsbag do
					table.insert(ret, itemsbag[i])
				end
			end
		elseif isPokeball(item.itemid) then
			table.insert(ret, item)
		end
	end
end
return ret
end

function doUpdatePokemonsBar(cid)
local ret = "p#,"
local balls = getPlayerPokeballs(cid)
local times = 0
for a = 1, #balls do
	times = times + 1
	local item = balls[a]
	local hp = math.ceil(getItemAttribute(item.uid, "hp") * 100)
	local name = getItemAttribute(item.uid, "poke")
	local foto = fotos[name] - 928
	doItemSetAttribute(item.uid, "ballorder", times)
	ret = ret..""..foto..","..name..""..times..","..hp..","
end
doPlayerSendCancel(cid, ret)
end

function getNewMoveTable(table, n)
if n == 1 and table.move1 then
	return table.move1
elseif n == 2 and table.move2 then
	return table.move2
elseif n == 3 and table.move3 then
	return table.move3
elseif n == 4 and table.move4 then
	return table.move4
elseif n == 5 and table.move5 then
	return table.move5
elseif n == 6 and table.move6 then
	return table.move6
elseif n == 7 and table.move7 then
	return table.move7
elseif n == 8 and table.move8 then
	return table.move8
elseif n == 9 and table.move9 then
	return table.move9
elseif n == 10 and table.move10 then
	return table.move10
elseif n == 11 and table.move11 then
	return table.move11
elseif n == 12 and table.move12 then
	return table.move12
else
	return false
end
end


function doUpdateMoves(cid)
local summon = getCreatureSummons(cid)[1]
local ret = "12&,"
if not summon then
	for a = 1, 12 do
		ret = ret.."n/n,"
	end
doPlayerSendCancel(cid, ret)
addEvent(doUpdateCooldowns, 100, cid)
return true
end
local ret = "12&,"
local moves = movestable[getCreatureName(summon)]
for a = 1, 12 do
	local b = getNewMoveTable(moves, a)
	if b then
		ret = ret..""..b.name..","
	else
		ret = ret.."n/n,"
	end
end
doPlayerSendCancel(cid, ret)
addEvent(doUpdateCooldowns, 100, cid)
end

function doUpdateCooldowns(cid)
local a = getPlayerSlotItem(cid, 8)
local ret = "12|,"
if a.uid <= 0 or #getCreatureSummons(cid) <= 0 then
	for cds = 1, 12 do
		ret = ret.."-1,"
	end
doPlayerSendCancel(cid, ret)
return true
end
for cds = 1, 12 do
	local cdzin = "moves"..cds

	if getCD(a.uid, cdzin) > 0 then
		ret = ret..""..(getCD(a.uid, cdzin) - 1)..","
	else
		ret = ret.."0,"
	end
end
doPlayerSendCancel(cid, ret)
doPlayerSendCancel(cid, " ")
end

function getBallsAttributes(item)
local t = {"boffense", "bdefense", "bagility", "bsattack",
	   "offense", "defense", "speed", "level", "specialattack",
	   "poke", "gender", "vitality", "nick", "boost", "happy", "hunger",
	   "burn", "burndmg", "poison", "poisondmg", "confuse", "blind",
	   "sleep", "hp", "description", "exp", "nextlevelexp", "transBegin",
	   "transLeft", "transTurn", "transOutfit", "transName", "trans",
	   "light", "blink", "move1", "move2", "move3", "move4", "move5",
	   "move6", "move7", "move8", "move9", "move10", "move11", "move12",
	   "ballorder", "firstpoke"}
local ret = {}
for a = 1, #t do
	ret[t[a]] = getItemAttribute(item, t[a])
end
return ret
end

function doChangeBalls(cid, item1, item2)
if not isCreature(cid) then return true end
if item1.uid == item2.uid then
	if #getCreatureSummons(cid) <= 0 then
		doGoPokemon(cid, getPlayerSlotItem(cid, 8))
	else
		doReturnPokemon(cid, getCreatureSummons(cid)[1], getPlayerSlotItem(cid, 8), pokeballs[getPokeballType(getPlayerSlotItem(cid, 8).itemid)].effect)
	end
return true
end

	if item1.uid > 0 and item2.uid > 0 then
		local io = getBallsAttributes(item1.uid)
		local it = getBallsAttributes(item2.uid)	
		for a, b in pairs (io) do
			if b then
				doItemSetAttribute(item2.uid, a, b)
			end
		end
		for a, b in pairs (it) do
			if b then
				doItemSetAttribute(item1.uid, a, b)
			end
		end
		local id = item2.itemid
		doTransformItem(item2.uid, item1.itemid)
		doTransformItem(item1.uid, id)
		doGoPokemon(cid, getPlayerSlotItem(cid, 8))
	else
		local a = doPlayerAddItem(cid, item2.itemid, true)
		local b = getBallsAttributes(item2.uid)	
		for c, d in pairs (b) do
			if d then
				doItemSetAttribute(a, c, d)
			end
		end
		doGoPokemon(cid, getPlayerSlotItem(cid, 8))
		doRemoveItem(item2.uid, 1)
	end
end

 

 

 

 

 

seu move1 por esse!

 

 

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

if getCreatureCondition(getCreatureSummons(cid)[1], CONDITION_INVISIBLE) and not isGhostPokemon(getCreatureSummons(cid)[1]) then
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 cdzin = "moves"..it..""

if it == "2" then
	move = movestable[name].move2
elseif it == "3" then
	move = movestable[name].move3
elseif it == "4" then
	move = movestable[name].move4
elseif it == "5" then
	move = movestable[name].move5
elseif it == "6" then
	move = movestable[name].move6
elseif it == "7" then
	move = movestable[name].move7
elseif it == "8" then
	move = movestable[name].move8
elseif it == "9" then
	move = movestable[name].move9
elseif it == "10" then
	move = movestable[name].move10
elseif it == "11" then
	move = movestable[name].move11
elseif it == "12" then
	move = movestable[name].move12
elseif it == "13" then
	move = movestable[name].move13
end

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

if false and getLevel(mypoke) < move.level then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't have enough level to use this move.")
return 0
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 this move 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 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

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

	if isSleeping(mypoke) then
		setCD(getPlayerSlotItem(cid, 8).uid, cdzin, 8)
		doCreatureSay(mypoke, "zZzZ", TALKTYPE_MONSTER)
		return 0
	else
		setCD(getPlayerSlotItem(cid, 8).uid, cdzin, move.cd)
	end

if move.name ~= "Metronome" then
	doCreatureSay(mypoke, ""..string.upper(move.name).."!", TALKTYPE_MONSTER)
end

addEvent(doAlertReady, move.cd * 1000, cid, newid, move.name, it, cdzin)
docastspell(mypoke, move.name)
doCreatureAddCondition(cid, playerexhaust)

if useKpdoDlls then
	doUpdateCooldowns(cid)
end

return 0
end

 

 

 

 

o unico errinho e que n ta marcando o time do CD mais eu to olhando aki se eu arruma eu edito!

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

/\ ia flar isso agr...ai qnd vc volta os dois..um deles vira um anel.

Depois qnd vc tira o q sobro ele sai da ball e a ball q fica no slot do poke vira uma ultra ball fechada..vc clika nela no slot e vc tira dois pokes iguais mas sem poder usar atk

Link para o comentário
Compartilhar em outros sites

Aqui está como antes.. a Barra.. só arrumou que quando puxavamos poke pela BAR não dava pra atacar pela Barra de cooldown..

mais aqui n conta se tá carregando .. toda hora fika READY

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

O erro está aqui.

 

function getCD(item, tipo, limite)

if not getItemAttribute(item, tipo) then

return 0

end

>>>>> local string = getItemAttribute(item, tipo):gsub("cd:", "")

local number = tonumber(string) - os.time()

if number <= 0 then

return 0

end

if limite and limite < number then

return 0

end

return number

end

 

Em some functions.lua nas libs.

Link para o comentário
Compartilhar em outros sites

pra arruma o problema de sair 2 pokes ao ms tempo... soh q ta bem demorado pra sumonar o poke.. ;x

em talkactions/cdbar.lua muda essa parte...

 

if words == "/goaction" then

if param == "null" then return 0 end

if exhaustion.get(cid, 6666) and exhaustion.get(cid, 6666) > 0 then return true end

if #getCreatureSummons(cid) >= 1 then

addEvent(doReturnPokemon, 100, cid, getCreatureSummons(cid)[1], false, pokeballs[getPokeballType(getPlayerSlotItem(cid, 8).itemid)].effect)

if param ~= getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke") .. getItemAttribute(getPlayerSlotItem(cid, 8).uid, "ballorder") then

addEvent(ChangeBalls, 1200, cid, param, true)

end

else

addEvent(ChangeBalls, 100, cid, param)

end

exhaustion.set(cid, 6666, 20)

return 0

end

 

por isso...

 

if words == "/goaction" then

if param == "null" then return 0 end

if os.time()-getPlayerStorageValue(cid, 64237) <= 2 then

return true

end

setPlayerStorageValue(cid, 64237, os.time())

if #getCreatureSummons(cid) >= 1 then

addEvent(doReturnPokemon, 100, cid, getCreatureSummons(cid)[1], false, pokeballs[getPokeballType(getPlayerSlotItem(cid, 8).itemid)].effect)

if param ~= getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke") .. getItemAttribute(getPlayerSlotItem(cid, 8).uid, "ballorder") then

addEvent(ChangeBalls, 1200, cid, param, true)

end

else

addEvent(ChangeBalls, 100, cid, param)

end

return 0

end

 

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

Quando cliko no atalho varias vezes e lançado mais de um pokemon ao mesmo tempo e quando um ta voltano vira um anel

 

Print

semttulogdi.png

 

 

Alguem sabe se tem como arrumar isso?

E pq pra min não esta aparecendo a barra com o Cd dos poke, somente o atalho de go/back.

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...