Ir para conteúdo

Mega Evolution System (PxG)


zipter98

Posts Recomendados

Meu sistema de mega evolução foi escrito para servidores sem o sistema de ícones. Logo, eles provavelmente estão conflitando. Talvez seja necessária alguma mudança em portrait.lua (data/movements/scripts). Se possível, poste aqui o conteúdo deste arquivo.

Link para o comentário
Compartilhar em outros sites

 

 

function onEquip (cid, item, slot)

	if not cid then return true end
	if item.uid <= 0 then return true end

	if not getItemAttribute(item.uid, "poke") then
	return true
	end
    
	for i, x in pairs(fotos) do
		if string.lower(getItemAttribute(item.uid, "poke")) == string.lower(i) then
			doTransformItem(getPlayerSlotItem(cid, 7).uid, fotos[i])
		return true
		end
	end
end

function onDeEquip(cid, item, slot)

	if not cid then return true end
	if item.uid <= 0 then return true end

	if not getItemAttribute(item.uid, "poke") then
	return true
	end

	doTransformItem(getPlayerSlotItem(cid, CONST_SLOT_LEGS).uid, 2395)
end 

 

 

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

OK, o problema não está aí. Talvez esteja no próprio goback, não sei. Nunca li os códigos de um sistema de ícone.

Aparece alguma mensagem quando você tenta equipar o ícone? Se necessário, eu posso modificar algumas coisas no seu sistema de mega evolução para que o pokémon volte à forma normal ao voltar para a pokébola, e não o contrário (que, aparentemente, é o motivo do erro).

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

1° - CreatureScripts>

 

function onLogout(cid)
    if not isCreature(cid) then return true end    
	local thisitem = getPlayerSlotItem(cid, 8)
	
	if thisitem.uid <= 0 then return true end
	
	local ballName = getItemAttribute(thisitem.uid, "poke")
    local btype = getPokeballType(thisitem.itemid)
    
    ---------------------------------------------------------------
    if #getCreatureSummons(cid) > 1 and getPlayerStorageValue(cid, 212124) <= 0 then    --alterado v1.6
       if getPlayerStorageValue(cid, 637501) == -2 or getPlayerStorageValue(cid, 637501) >= 1 then  
          BackTeam(cid)       
       end
    end
    --////////////////////////////////////////////////////////////////////////////////////////--
    if getPlayerStorageValue(cid, 52480) >= 1 and getPlayerStorageValue(cid, 52481) >= 0 then 
       doEndDuel(cid)
    end
    --////////////////////////////////////////////////////////////////////////////////////////--
    if #getCreatureSummons(cid) == 2 and getPlayerStorageValue(cid, 212124) >= 1 then
       local cmed2 = getCreatureSummons(cid)[1]
	   local poscmed = getThingPos(cmed2)
	   local cmeddir = getCreatureLookDir(cmed2)
	   local namecmed = getCreatureName(cmed2)
	   local hp, maxHp = getCreatureHealth(getCreatureSummons(cid)[1]), getCreatureMaxHealth(getCreatureSummons(cid)[1])
	   local gender = getPokemonGender(cmed2) 
       doRemoveCreature(getCreatureSummons(cid)[1])
	   local back = doCreateMonster(namecmed, poscmed)
	   addEvent(doCreatureSetSkullType, 150, back, gender)
	   doCreatureSetLookDir(back, cmeddir)
	   addEvent(doCreatureAddHealth, 100, back, hp-maxHp)
                                                                            
       -- pokemon controlador	
       local ball2 = getPlayerSlotItem(cid, 8)
       local mynewpos = getThingPos(getCreatureSummons(cid)[1])
       doRemoveCreature(getCreatureSummons(cid)[1])
       local pk2 = doSummonCreature(getItemAttribute(ball2.uid, "poke"), mynewpos) 
       doConvinceCreature(cid, pk2)
       addEvent(doAdjustWithDelay, 100, cid, pk2, true, true, false)
       setPlayerStorageValue(cid, 888, -1)    
       cleanCMcds(ball2.uid)
       doCreatureSetLookDir(getCreatureSummons(cid)[1], 2)
       registerCreatureEvent(pk2, "SummonDeath")   
    end
    
    ----------------------------------------------------------------------
    local summon = getCreatureSummons(cid)[1]      
      
	if #getCreatureSummons(cid) >= 1 and thisitem.uid > 1 then
	    if getPlayerStorageValue(cid, 212124) <= 0 then
		   doItemSetAttribute(thisitem.uid, "hp", (getCreatureHealth(summon) / getCreatureMaxHealth(summon)))
        end                                                          
        setPlayerStorageValue(cid, 212124, 0)
        doTransformItem(thisitem.uid, pokeballs[btype].on)
		doSendMagicEffect(getThingPos(summon), pokeballs[btype].effect)
		doRemoveCreature(summon)
	end

	if getCreatureOutfit(cid).lookType == 814 then
		doPlayerStopWatching(cid)
	end

	if tonumber(getPlayerStorageValue(cid, 17000)) and getPlayerStorageValue(cid, 17000) >= 1 then  
		markFlyingPos(cid, getThingPos(cid))
	end
	
	if getPlayerStorageValue(cid, 22545) == 1 then     
	   setGlobalStorageValue(22550, getGlobalStorageValue(22550)-1)
	   if getGlobalStorageValue(22550) <= 0 then
          endGoldenArena()          
       end 
    end

return TRUE
end

local deathtexts = {"Oh no! POKENAME, come back!", "Come back, POKENAME!", "That's enough, POKENAME!", "You did well, POKENAME!",
		    "You need to rest, POKENAME!", "Nice job, POKENAME!", "POKENAME, you are too hurt!"}

function onDeath(cid, deathList)

	local owner = getCreatureMaster(cid)

        if getPlayerStorageValue(cid, 637500) >= 1 then
           doSendMagicEffect(getThingPos(cid), 211)
           doRemoveCreature(cid)
           return true
        end
        
        if getPlayerStorageValue(cid, 212123) >= 1 then
           return true
        end
        
        --////////////////////////////////////////////////////////////////////////////////////////--
        checkDuel(owner)                                                                          
        --////////////////////////////////////////////////////////////////////////////////////////--
        
	local thisball = getPlayerSlotItem(owner, 8)
	local ballName = getItemAttribute(thisball.uid, "poke")
	
    btype = getPokeballType(thisball.itemid)

        if #getCreatureSummons(owner) > 1 then
           BackTeam(owner, getCreatureSummons(owner))      
        end

		doSendMagicEffect(getThingPos(cid), pokeballs[btype].effect)
        doTransformItem(thisball.uid, pokeballs[btype].off)

		doPlayerSendTextMessage(owner, 22, "Your pokemon fainted.")

	local say = deathtexts[math.random(#deathtexts)]
		say = string.gsub(say, "POKENAME", getCreatureName(cid))

	if getPlayerStorageValue(cid, 33) <= 0 then
		doCreatureSay(owner, say, TALKTYPE_SAY)
	end

	doItemSetAttribute(thisball.uid, "hp", 0)
	if ehMonstro(deathList[1]) then
	   doItemSetAttribute(thisball.uid, "happy", getPlayerStorageValue(cid, 1008) - happyLostOnDeath)
    end
	doItemSetAttribute(thisball.uid, "hunger", getPlayerStorageValue(cid, 1009))

    if useOTClient then
       doPlayerSendCancel(owner, '12//,hide')      --alterado v1.7
    end

	doRemoveCreature(cid)

return false
end 

 

 

 

2° -Actions -

 

local EFFECTS = {
	--[OutfitID] = {Effect}
	["Magmar"] = 35,   
	["Shiny Magmar"] = 35,
    ["Shiny Magmortar"] = 35,
    ["Shiny Electivire"] = 48,
    ["Magmortar"] = 35,
    ["Electivire"] = 48,	
	["Jynx"] = 17,          --alterado v1.5
	["Shiny Jynx"] = 17, 
    ["Piloswine"] = 205,  --alterado v1.8
    ["Swinub"] = 205,   
}

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

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

if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 
or getPlayerStorageValue(cid, 75846) >= 1 or getPlayerStorageValue(cid, 5700) >= 1  then    --alterado v1.9 <<
   return true                                                                                                                        
end

local ballName = getItemAttribute(item.uid, "poke")
local btype = getPokeballType(item.itemid)
local usando = pokeballs[btype].use

local effect = pokeballs[btype].effect
	if not effect then
		effect = 21
	end
	
unLock(item.uid) --alterado v1.8

if item.itemid == usando then                           

	if getPlayerStorageValue(cid, 990) == 1 then -- GYM
		doPlayerSendCancel(cid, "You can't return your pokemon during gym battles.")
	return true
	end
	if #getCreatureSummons(cid) > 1 and getPlayerStorageValue(cid, 212124) <= 0 then     --alterado v1.6
       if getPlayerStorageValue(cid, 637501) == -2 or getPlayerStorageValue(cid, 637501) >= 1 then  
          BackTeam(cid)       
       end
    end   
    if #getCreatureSummons(cid) == 2 and getPlayerStorageValue(cid, 212124) >= 1 then
       doPlayerSendCancel(cid, "You can't do that while is controling a mind")
       return true     --alterado v1.5
    end
    if #getCreatureSummons(cid) <= 0 then
		if isInArray(pokeballs[btype].all, item.itemid) then
			doTransformItem(item.uid, pokeballs[btype].off)
			doItemSetAttribute(item.uid, "hp", 0)
			doPlayerSendCancel(cid, "This pokemon is fainted.")
		    return true
		end
	end

    local cd = getCD(item.uid, "blink", 30)
    if cd > 0 then
       setCD(item.uid, "blink", 0)
    end
    
	local z = getCreatureSummons(cid)[1]

	if getCreatureCondition(z, CONDITION_INVISIBLE) and not isGhostPokemon(z) then
	   return true
	end
	doReturnPokemon(cid, z, item, effect)

elseif item.itemid == pokeballs[btype].on then

	if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
		doPlayerSendCancel(cid, "You must put your pokeball in the correct place!")
	return TRUE
	end

	local thishp = getItemAttribute(item.uid, "hp")

	if thishp <= 0 then
		if isInArray(pokeballs[btype].all, item.itemid) then
			doTransformItem(item.uid, pokeballs[btype].off)
			doItemSetAttribute(item.uid, "hp", 0)
			doPlayerSendCancel(cid, "This pokemon is fainted.")
		    return true
		end
	end

	local pokemon = getItemAttribute(item.uid, "poke")

	if not pokes[pokemon] then
	return true
	end

 if pokemon:find("Mega") then
        local normalPoke = megaEvolutions[getItemAttribute(item.uid, "megaStone")][1]
        if normalPoke then
            doItemSetAttribute(item.uid, "poke", normalPoke)
            pokemon = normalPoke
        end
    end
----------------------- Sistema de nao poder carregar mais que 3 pokes lvl baixo e + q 1 poke de lvl medio/alto ---------------------------------
if not isInArray({5, 6}, getPlayerGroupId(cid)) then
   local balls = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)
   local low = {}
   local lowPokes = {"Rattata", "Caterpie", "Weedle", "Oddish", "Pidgey", "Paras", "Poliwag", "Bellsprout", "Magikarp", "Hoppip", "Sunkern"}
   if #balls >= 1 then
      for _, uid in ipairs(balls) do
          local nome = getItemAttribute(uid, "poke")
          if not isInArray(lowPokes, pokemon) and nome == pokemon then
             return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry two pokemons equals!")
          else
             if nome == pokemon then
                table.insert(low, nome)
             end
          end
      end
   end
if #low >= 3 then
   return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry more than three pokemons equals of low level!")
end   
end
---------------------------------------------------------------------------------------------------------------------------------------------------

	local x = pokes[pokemon]
	local boost = getItemAttribute(item.uid, "boost") or 0

	if getPlayerLevel(cid) < (x.level+boost) then
	   doPlayerSendCancel(cid, "You need level "..(x.level+boost).." to use this pokemon.")
	   return true
	end
	
	---------------------------- Sistema pokes de clan --------------------------------------
	local shinysClan = {
	["Shiny Fearow"] = {4, "Wingeon"},
	["Shiny Flareon"] = {1, "Volcanic"},
	["Shiny Vaporeon"] = {2, "Seavel"}, 
	["Shiny Jolteon"] = {9, "Raibolt"},
	["Shiny Hypno"] = {7, "Psycraft"},           
	["Shiny Golem"] = {3, "Orebound"},
	["Shiny Vileplume"] = {8, "Naturia"},
	["Shiny Nidoking"] = {5, "Malefic"},
	["Shiny Hitmontop"] = {6, "Gardestrike"},   --alterado v1.4
	}
	
	if shinysClan[pokemon] and (getPlayerGroupId(cid) < 4 or getPlayerGroupId(cid) > 6) then  --alterado v1.9 \/
	   if getPlayerClanNum(cid) ~= shinysClan[pokemon][1] then
	      doPlayerSendCancel(cid, "You need be a member of the clan "..shinysClan[pokemon][2].." to use this pokemon!")
	      return true   
       elseif getPlayerClanRank(cid) ~= 5 then
          doPlayerSendCancel(cid, "You need be atleast rank 5 to use this pokemon!")
	      return true
       end
    end
    --------------------------------------------------------------------------------------

	doSummonMonster(cid, pokemon)

	local pk = getCreatureSummons(cid)[1]
	if not isCreature(pk) then return true end

	if outfits_order[getCreatureName(pk)] then
    doTradeOutfit(pk, 1)
end
	
	------------------------passiva hitmonchan------------------------------
	if isSummon(pk) then                                                  --alterado v1.8 \/
       if pokemon == "Shiny Hitmonchan" or pokemon == "Hitmonchan" then
          if not getItemAttribute(item.uid, "hands") then
             doSetItemAttribute(item.uid, "hands", 0)
          end
          local hands = getItemAttribute(item.uid, "hands")
          doSetCreatureOutfit(pk, {lookType = hitmonchans[pokemon][hands].out}, -1)
       end
    end
	-------------------------------------------------------------------------
    ---------movement magmar, jynx-------------
    if EFFECTS[getCreatureName(pk)] then             
       markPosEff(pk, getThingPos(pk))
       sendMovementEffect(pk, EFFECTS[getCreatureName(pk)], getThingPos(pk))  
    end
    --------------------------------------------------------------------------      

	---if getCreatureName(pk) == "Ditto" or getCreatureName(pk) == "Shiny Ditto" then --edited

	--	local left = getItemAttribute(item.uid, "transLeft")
	--	local name = getItemAttribute(item.uid, "transName")

	--	if left and left > 0 then
	--		setPlayerStorageValue(pk, 1010, name)
		--	doSetCreatureOutfit(pk, {lookType = getItemAttribute(item.uid, "transOutfit")}, -1)
		--	addEvent(deTransform, left * 1000, pk, getItemAttribute(item.uid, "transTurn"))
		--	doItemSetAttribute(item.uid, "transBegin", os.clock())
	--	else
	--		setPlayerStorageValue(pk, 1010, getCreatureName(pk) == "Ditto" and "Ditto" or "Shiny Ditto")     --edited
	--	end
--	end

	if isGhostPokemon(pk) then doTeleportThing(pk, getPosByDir(getThingPos(cid), math.random(0, 7)), false) end

	doCreatureSetLookDir(pk, 2)

	adjustStatus(pk, item.uid, true, true, true)
	doRegenerateWithY(getCreatureMaster(pk), pk)
	doCureWithY(getCreatureMaster(pk), pk)

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

	local pokename = getPokeName(pk) --alterado v1.7 

	local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)
	doCreatureSay(cid, mgo, TALKTYPE_SAY)
    
	doSendMagicEffect(getCreaturePosition(pk), effect)
	
	if useOTClient then
	   doPlayerSendCancel(cid, '12//,show') --alterado v1.7
    end    
else

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

end

	if useKpdoDlls then
		doUpdateMoves(cid)
	end
return true
end 

 

 

Link para o comentário
Compartilhar em outros sites

No creaturescript, abaixo de:

local ballName = getItemAttribute(thisball.uid, "poke")

coloque:

if ballName:find("Mega") then
    ballName = megaEvolutions[getItemAttribute(thisball.uid, "megaStone")][1]
    doItemSetAttribute(thisball.uid, "poke", ballName)
end
Na action, remova:
if pokemon:find("Mega") then
    local normalPoke = megaEvolutions[getItemAttribute(item.uid, "megaStone")][1]
    if normalPoke then
        doItemSetAttribute(item.uid, "poke", normalPoke)
        pokemon = normalPoke
    end
end
Depois, abaixo de:
if cd > 0 then
    setCD(item.uid, "blink", 0)
end
coloque:
if getItemAttribute(item.uid, "poke"):find("Mega") then
    local normalPoke = megaEvolutions[getItemAttribute(item.uid, "megaStone")][1]
    if normalPoke then
        doItemSetAttribute(item.uid, "poke", normalPoke)
    end
end
Editado por zipter98
Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...

O meu quando tento sumonar ou clicar com o item mega no poke da esse erro

 

[01/10/2015 04:33:01] [Error - Action Interface]
[01/10/2015 04:33:02] data/actions/scripts/goback.lua:onUse
[01/10/2015 04:33:02] Description:
[01/10/2015 04:33:02] data/lib/level system.lua:486: attempt to index global 'nick' (a nil value)
[01/10/2015 04:33:02] stack traceback:
[01/10/2015 04:33:02] data/lib/level system.lua:486: in function 'getPokeName'
[01/10/2015 04:33:02] data/actions/scripts/goback.lua:237: in function <data/actions/scripts/goback.lua:11>
Link para o comentário
Compartilhar em outros sites

Já tenho eles criado monsters corpses etc .

 

No código da função doUpdateMoves(cid), troque o segundo:
table.insert(ret, "n/n,")
por:
local mEvolve
if not getCreatureName(summon):find("Mega") and getItemAttribute(getPlayerSlotItem(cid, 8).uid, "megaStone") then
    if not isInArray(ret, "Mega Evolution,") then
        table.insert(ret, "Mega Evolution,")
        mEvolve = true
    end
end
if not mEvolve then
    table.insert(ret, "n/n,")
end

Alguem me explica certinho essa parte?

 

Minha Coowndon bar/lib

 

function getPlayerPokeballs(cid)                                   --alterado v1.9 \/
local ret = {}
local container = 0


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


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


function doUpdatePokemonsBar(cid)
if not isCreature(cid) then return true end
if getPlayerStorageValue(cid, 656494) > 0 then
return true
end
setPlayerStorageValue(cid, 656494, 1000)
addEvent(setPlayerStorageValue, 100, cid, 656494, -1)


local ret = {}
table.insert(ret, "p#,")
local balls = getPlayerPokeballs(cid)
local times = 0
for a = 1, #balls do
    local item = balls[a]
    local hp = math.ceil(getItemAttribute(item.uid, "hp") * 100)
    local name = getItemAttribute(item.uid, "poke")
    local port = getPlayerSlotItem(cid, CONST_SLOT_LEGS) 
    if fotos[name] >= 11137 and fotos[name] <= 11387 then
       times = times + 1
       local foto = fotos[name] - 911
       doItemSetAttribute(item.uid, "ballorder", times)
       table.insert(ret, foto..","..name..""..times..","..hp..",")                
    elseif fotos[name] >= 12605 then                                           
       times = times + 1                                                      
       local foto = fotos[name] - 1178  --alterado v1.9 
       doItemSetAttribute(item.uid, "ballorder", times)
       table.insert(ret, foto..","..name..""..times..","..hp..",")
    else
       times = times + 1
       local foto = fotos[name] - 928
       doItemSetAttribute(item.uid, "ballorder", times)
       table.insert(ret, foto..","..name..""..times..","..hp..",")
    end
end
doPlayerSendCancel(cid, table.concat(ret))
end


function getNewMoveTable(table, n)
    if table == nil then
        return false
    end
    local moves = {table.move1, table.move2, table.move3, table.move4, table.move5, table.move6, table.move7, table.move8, table.move9, table.move10, table.move11, table.move12}
    local returnValue = moves
    if n then
        returnValue = moves[n]
    end
    return returnValue
end




function doUpdateMoves(cid)
if not isCreature(cid) then return true end
local summon = getCreatureSummons(cid)[1]
local ret = {}
table.insert(ret, "12&,")
if not summon then
   for a = 1, 12 do
       table.insert(ret, "n/n,")
   end
   doPlayerSendCancel(cid, table.concat(ret))
   addEvent(doUpdateCooldowns, 100, cid)
return true
end
if isTransformed(summon) then  --alterado v1.9
   moves = movestable[getPlayerStorageValue(summon, 1010)]
else                                                       
   moves = movestable[getCreatureName(summon)]
end
for a = 1, 12 do
    local b = getNewMoveTable(moves, a)


    if b then
       table.insert(ret, b.name..",")
    else
       table.insert(ret, "n/n,")
    end
end
doPlayerSendCancel(cid, table.concat(ret))
addEvent(doUpdateCooldowns, 100, cid)
end


function doUpdateCooldowns(cid)
if not isCreature(cid) then return true end
local a = getPlayerSlotItem(cid, 8)
local ret = {}
table.insert(ret, "12|,")
if a.uid <= 0 or #getCreatureSummons(cid) <= 0 then
   for cds = 1, 12 do
       if useOTClient then table.insert(ret, "-1|0,") else table.insert(ret, "-1,") end  
   end
   doPlayerSendCancel(cid, table.concat(ret))
return true
end
for cds = 1, 12 do                                                         
    ----
    local summon = getCreatureSummons(cid)[1]
    if summon and getPlayerStorageValue(summon, 212123) >= 1 then
       cdzin = "cm_move"..cds
    else                       
       cdzin = "move"..cds
    end
    ----
    if isTransformed(summon) then  --alterado v1.9
       moves = movestable[getPlayerStorageValue(summon, 1010)]
    else                                                       
       moves = movestable[getCreatureName(summon)]
    end
    local b = getNewMoveTable(moves, cds)
    if not b then
       for cds = 1, 12 do
           if useOTClient then table.insert(ret, "-1|0,") else table.insert(ret, "-1,") end   --alterado v1.9
       end
       doPlayerSendCancel(cid, table.concat(ret))
    return true
    end
    ----
    if getCD(a.uid, cdzin) > 0 then
       if (useOTClient and b) then table.insert(ret, (getCD(a.uid, cdzin)).."|"..b.level..",") else table.insert(ret, (getCD(a.uid, cdzin))..",") end
    else
       if (useOTClient and b) then table.insert(ret, "0|"..b.level..",") else table.insert(ret, "0,") end  
    end
end
doPlayerSendCancel(cid, table.concat(ret))                                             
end


function getBallsAttributes(item)
local t = {"poke", "gender", "nick", "boost", "happy", "hp", "description", "transBegin", "hunger", "transLeft", "transTurn", "transOutfit", "transName", 
"trans", "light", "blink", "move1", "move2", "move3", "move4", "move5", "move6", "move7", "move8", "move9", "move10", "move11", "move12", "ballorder", 
"hands", "aura", "burn", "burndmg", "poison", "poisondmg", "confuse", "sleep", "miss", "missSpell", "missEff", "fear", "fearSkill", "silence", 
"silenceEff", "stun", "stunEff", "stunSpell", "paralyze", "paralyzeEff", "slow", "slowEff", "leech", "leechdmg", "Buff1", "Buff2", "Buff3", "Buff1skill",
"Buff2skill", "Buff3skill", "control", "unique", "task", "lock"} 
local ret = {}
for a = 1, #t do
if getItemAttribute(item, t[a]) == "hands" then
return
end
ret[t[a]] = getItemAttribute(item, t[a]) or false
end
return ret
end


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


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

 

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

Não Sei Edita Esse Não To Conseguindo Edita.

 

Cooldown.Lua

function getPlayerPokeballs(cid)                                   --alterado v1.9 \/
local ret = {}
local container = 0

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

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

function doUpdatePokemonsBar(cid)
if not isCreature(cid) then return true end
if getPlayerStorageValue(cid, 656494) > 0 then
return true
end
setPlayerStorageValue(cid, 656494, 1000)
addEvent(setPlayerStorageValue, 100, cid, 656494, -1)

local ret = {}
table.insert(ret, "p#,")
local balls = getPlayerPokeballs(cid)
local times = 0
for a = 1, #balls do
    local item = balls[a]
    local hp = math.ceil(getItemAttribute(item.uid, "hp") * 100)
    local name = getItemAttribute(item.uid, "poke")
    local port = getPlayerSlotItem(cid, CONST_SLOT_LEGS) 
    if fotos[name] >= 11137 and fotos[name] <= 11387 then
       times = times + 1
       local foto = fotos[name] - 911
       doItemSetAttribute(item.uid, "ballorder", times)
       table.insert(ret, foto..","..name..""..times..","..hp..",")                
    elseif fotos[name] >= 12605 then                                           
       times = times + 1                                                      
       local foto = fotos[name] - 1178  --alterado v1.9 
       doItemSetAttribute(item.uid, "ballorder", times)
       table.insert(ret, foto..","..name..""..times..","..hp..",")
    else
       times = times + 1
       local foto = fotos[name] - 928
       doItemSetAttribute(item.uid, "ballorder", times)
       table.insert(ret, foto..","..name..""..times..","..hp..",")
    end
end
doPlayerSendCancel(cid, table.concat(ret))
end

function getNewMoveTable(table, n)
if table == nil or not n then return false end

local moves = {table.move1, table.move2, table.move3, table.move4, table.move5, table.move6, table.move7, table.move8, table.move9,
table.move10, table.move11, table.move12}

return moves[n] or false
end


function doUpdateMoves(cid)
if not isCreature(cid) then return true end
local summon = getCreatureSummons(cid)[1]
local ret = {}
table.insert(ret, "12&,")
if not summon then
   for a = 1, 12 do
       table.insert(ret, "n/n,")
   end
   doPlayerSendCancel(cid, table.concat(ret))
   addEvent(doUpdateCooldowns, 100, cid)
return true
end
if isTransformed(summon) then  --alterado v1.9
   moves = movestable[getPlayerStorageValue(summon, 1010)]
else                                                       
   moves = movestable[getCreatureName(summon)]
end
for a = 1, 12 do
    local b = getNewMoveTable(moves, a)
    if b then
       table.insert(ret, b.name..",")
    else
       table.insert(ret, "n/n,")
    end
end
doPlayerSendCancel(cid, table.concat(ret))
addEvent(doUpdateCooldowns, 100, cid)
end

function doUpdateCooldowns(cid)
if not isCreature(cid) then return true end
local a = getPlayerSlotItem(cid, 8)
local ret = {}
table.insert(ret, "12|,")
if a.uid <= 0 or #getCreatureSummons(cid) <= 0 then
   for cds = 1, 12 do
       if useOTClient then table.insert(ret, "-1|0,") else table.insert(ret, "-1,") end  
   end
   doPlayerSendCancel(cid, table.concat(ret))
return true
end
for cds = 1, 12 do                                                         
    ----
    local summon = getCreatureSummons(cid)[1]
    if summon and getPlayerStorageValue(summon, 212123) >= 1 then
       cdzin = "cm_move"..cds
    else                       
       cdzin = "move"..cds
    end
    ----
    if isTransformed(summon) then  --alterado v1.9
       moves = movestable[getPlayerStorageValue(summon, 1010)]
    else                                                       
       moves = movestable[getCreatureName(summon)]
    end
    local b = getNewMoveTable(moves, cds)
    if not b then
       for cds = 1, 12 do
           if useOTClient then table.insert(ret, "-1|0,") else table.insert(ret, "-1,") end   --alterado v1.9
       end
       doPlayerSendCancel(cid, table.concat(ret))
    return true
    end
    ----
    if getCD(a.uid, cdzin) > 0 then
       if (useOTClient and b) then table.insert(ret, (getCD(a.uid, cdzin)).."|"..b.level..",") else table.insert(ret, (getCD(a.uid, cdzin))..",") end
    else
       if (useOTClient and b) then table.insert(ret, "0|"..b.level..",") else table.insert(ret, "0,") end  
    end
end
doPlayerSendCancel(cid, table.concat(ret))                                             
end

function getBallsAttributes(item)
local t = {"poke", "gender", "nick", "boost", "happy", "hp", "description", "transBegin", "hunger", "transLeft", "transTurn", "transOutfit", "transName", 
"trans", "light", "blink", "move1", "move2", "move3", "move4", "move5", "move6", "move7", "move8", "move9", "move10", "move11", "move12", "ballorder", 
"hands", "aura", "burn", "burndmg", "poison", "poisondmg", "confuse", "sleep", "miss", "missSpell", "missEff", "fear", "fearSkill", "silence", 
"silenceEff", "stun", "stunEff", "stunSpell", "paralyze", "paralyzeEff", "slow", "slowEff", "leech", "leechdmg", "Buff1", "Buff2", "Buff3", "Buff1skill",
"Buff2skill", "Buff3skill", "control", "unique", "task", "lock"} 
local ret = {}
for a = 1, #t do
if getItemAttribute(item, t[a]) == "hands" then
return
end
ret[t[a]] = getItemAttribute(item, t[a]) or false
end
return ret
end

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

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

Me Ajude Nesse Look.lua e Muito Diferente Por que Minha Base e PxCyan Thanks Desde Já

 

Look.lua

local NPCBattle = {
["Brock"] = {artig = "He is", cidbat = "Pewter"},
["Misty"] = {artig = "She is", cidbat = "Cerulean"}, 
["Blaine"] = {artig = "He is", cidbat = "Cinnabar"},
["Sabrina"] = {artig = "She is", cidbat = "Saffron"},         --alterado v1.9 \/ peguem tudo!
["Kira"] = {artig = "She is", cidbat = "Viridian"},
["Koga"] = {artig = "He is", cidbat = "Fushcia"},
["Erika"] = {artig = "She is", cidbat = "Celadon"},
["Surge"] = {artig = "He is", cidbat = "Vermilion"},
}

local shinys = {
["Shiny Abra"] = "Dark Abra",
["Shiny Onix"] = "Crystal Onix",
["Shiny Gyarados"] = "Red Gyarados",
["Shiny Charizard"] = "Elder Charizard",
["Shiny Venusaur"] = "Ancient Venusaur",
["Shiny Blastoise"] = "Ancient Blastoise",
["Shiny Farfetch'd"] = "Elite Farfetch'd",
["Shiny Hitmonlee"] = "Elite Hitmonlee",
["Shiny Himonchan"] = "Elite Hitmonchan",
["Shiny Snorlax"] = "Big Snorlax",
}

-- tabela adicionado ao configuration só procura por price = ..--

local xhelds = {
[1] = {name = "X-Defense(Tier: 1)"},
[2] = {name = "X-Defense(Tier: 2)"},
[3] = {name = "X-Defense(Tier: 3)"},
[4] = {name = "X-Defense(Tier: 4)"},
[5] = {name = "X-Defense(Tier: 5)"},
[6] = {name = "X-Defense(Tier: 6)"},
[7] = {name = "X-Defense(Tier: 7)"},
[8] = {name = "X-Attack(Tier : 1)"},
[9] = {name = "X-Attack(Tier : 2)"},
[10] = {name = "X-Attack(Tier: 3)"},
[11] = {name = "X-Attack(Tier: 4)"},
[12] = {name = "X-Attack(Tier: 5)"},
[13] = {name = "X-Attack(Tier: 6)"},
[14] = {name = "X-Attack(Tier: 7)"},
[15] = {name = "X-Return(Tier: 1)"},
[16] = {name = "X-Return(Tier: 2)"},
[17] = {name = "X-Return(Tier: 3)"},
[18] = {name = "X-Return(Tier: 4)"},
[19] = {name = "X-Return(Tier: 5)"},
[20] = {name = "X-Return(Tier: 6)"},
[21] = {name = "X-Return(Tier: 7)"},
[22] = {name = "X-Hellfire(Tier: 1)"},
[23] = {name = "X-Hellfire(Tier: 2)"},
[24] = {name = "X-Hellfire(Tier: 3)"},
[25] = {name = "X-Hellfire(Tier: 4)"},
[26] = {name = "X-Hellfire(Tier: 5)"},
[27] = {name = "X-Hellfire(Tier: 6)"},
[28] = {name = "X-Hellfire(Tier: 7)"},
[29] = {name = "X-Poison(Tier: 1)"},
[30] = {name = "X-Poison(Tier: 2)"},
[31] = {name = "X-Poison(Tier: 3)"},
[32] = {name = "X-Poison(Tier: 4)"},
[33] = {name = "X-Poison(Tier: 5)"},
[34] = {name = "X-Poison(Tier: 6)"},
[35] = {name = "X-Poison(Tier: 7)"},
[36] = {name = "X-Boost(Tier: 1)"},
[37] = {name = "X-Boost(Tier: 2)"},
[38] = {name = "X-Boost(Tier: 3)"},
[39] = {name = "X-Boost(Tier: 4)"},
[40] = {name = "X-Boost(Tier: 5)"},
[41] = {name = "X-Boost(Tier: 6)"},
[42] = {name = "X-Boost(Tier: 7)"},
}

local yhelds = {
[1] = {name = "Y-Regeneration(Tier: 1)"},
[2] = {name = "Y-Regeneration(Tier: 2)"},
[3] = {name = "Y-Regeneration(Tier: 3)"},
[4] = {name = "Y-Regeneration(Tier: 4)"},
[5] = {name = "Y-Regeneration(Tier: 5)"},
[6] = {name = "Y-Regeneration(Tier: 6)"},
[7] = {name = "Y-Regeneration(Tier: 7)"},
[8] = {name = "Y-Cure(Tier: 1)"},
[9] = {name = "Y-Cure(Tier: 2)"},
[10] = {name = "Y-Cure(Tier: 3)"},
[11] = {name = "Y-Cure(Tier: 4)"},
[12] = {name = "Y-Cure(Tier: 5)"},
[13] = {name = "Y-Cure(Tier: 6)"},
[14] = {name = "Y-Cure(Tier: 7)"},
}

function onLook(cid, thing, position, lookDistance)
                                                          
local str = {}
                                              
if not isCreature(thing.uid) then
   local iname = getItemInfo(thing.itemid)
   if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then
      
      unLock(thing.uid)
      local lock = getItemAttribute(thing.uid, "lock")        
      local pokename = getItemAttribute(thing.uid, "poke")
      local heldx = getItemAttribute(thing.uid, "heldx")
local heldy = getItemAttribute(thing.uid, "heldy")
      table.insert(str, "You see "..iname.article.." "..iname.name..".")   
      if getItemAttribute(thing.uid, "unique") then               
         table.insert(str, " It's an unique item.")   
      end
      if getItemAttribute(thing.uid, "ehditto") == 1 then
table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename.." (Ditto).\n")   
else
table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..".\n") 
end  
      if lock and lock > 0 then
         table.insert(str, "It will unlock in ".. os.date("%d/%m/%y %X", lock)..".\n")  
      end
      local boost = getItemAttribute(thing.uid, "boost") or 0
      if boost > 0 then
         table.insert(str, "Boost level: +"..boost..".\n")
      end
      if getItemAttribute(thing.uid, "nick") then
         table.insert(str, "It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n")
      end
      if heldx and heldy then
table.insert(str, "Holding: "..(xhelds[heldx].name).." and "..(yhelds[heldy].name)..". ")
elseif heldx then
table.insert(str, "Holding: "..(xhelds[heldx].name)..". ")
elseif heldy then
table.insert(str, "Holding: "..(yhelds[heldy].name)..". ")
end
      if getItemAttribute(thing.uid, "gender") == SEX_MALE then
         table.insert(str, "It is male.")
      elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
         table.insert(str, "It is female.")
      else
         table.insert(str, "It is genderless.")
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then     

      table.insert(str, "You see a "..string.lower(iname.name)..". ")     
      if isContainer(thing.uid) then
         table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")")
      end
      table.insert(str, "\n")
      if getItemAttribute(thing.uid, "gender") == SEX_MALE then
         table.insert(str, "It is male.")
      elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
         table.insert(str, "It is female.")
      else
         table.insert(str, "It is genderless.")
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false

   elseif isContainer(thing.uid) then     --containers

      if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then
         table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ")
         table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ")
         table.insert(str, getItemAttribute(thing.uid, "attacker")..".")
      else   
         table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").")
      end
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")     
         local pos = getThingPos(thing.uid)
         table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")  
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   elseif getItemAttribute(thing.uid, "unique") then    
      local p = getThingPos(thing.uid)
   
      table.insert(str, "You see ")
      if thing.type > 1 then
         table.insert(str, thing.type.." "..iname.plural..".")
      else
         table.insert(str, iname.article.." "..iname.name..".")
      end
      table.insert(str, " It's an unique item.\n"..iname.description)
      
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")
         table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]")
      end
   
      sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
   else
      return true
   end
end

local npcname = getCreatureName(thing.uid)
if ehNPC(thing.uid) and NPCBattle[npcname] then    --npcs duel
   table.insert(str, "You see "..npcname..". "..NPCBattle[npcname].artig.." leader of the gym from "..NPCBattle[npcname].cidbat..".")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
end
if getPlayerStorageValue(thing.uid, 697548) ~= -1 then    
   table.insert(str, getPlayerStorageValue(thing.uid, 697548))                                   
   local pos = getThingPos(thing.uid)
   if youAre[getPlayerGroupId(cid)] then
      table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")
   end
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))  
   return false
end

if not isPlayer(thing.uid) and not isMonster(thing.uid) then    --outros npcs
   table.insert(str, "You see "..getCreatureName(thing.uid)..".")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
end

if isPlayer(thing.uid) then     --player
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getPlayerDesc(cid, thing.uid, false))  
return false
end

if getCreatureName(thing.uid) == "Evolution" then return false end

if not isSummon(thing.uid) then   --monstros
   
   table.insert(str, "You see a wild "..string.lower(getCreatureName(thing.uid))..".\n")
   table.insert(str, "Hit Points: "..getCreatureHealth(thing.uid).." / "..getCreatureMaxHealth(thing.uid)..".\n")
   if getPokemonGender(thing.uid) == SEX_MALE then
      table.insert(str, "It is male.")
   elseif getPokemonGender(thing.uid) == SEX_FEMALE then
      table.insert(str, "It is female.")
   else
      table.insert(str, "It is genderless.")
   end
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false

elseif isSummon(thing.uid) and not isPlayer(thing.uid) then  --summons

   local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
   if getCreatureMaster(thing.uid) == cid then
      local myball = getPlayerSlotItem(cid, 8).uid
      table.insert(str, "You see your "..string.lower(getCreatureName(thing.uid))..".")
      if boostlevel > 0 then
         table.insert(str, "\nBoost level: +"..boostlevel..".")
      end
      table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
      table.insert(str, "\n"..getPokemonHappinessDescription(thing.uid))
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   else
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid))..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
   end
   return false
end
return true
end
Editado por 52172664
Link para o comentário
Compartilhar em outros sites

Oi zipter estou testando aki mas já segura meu rep+ , eu queria saber se tenho que criar os megas nos monsters?


outra pergunta se eu for criar os xml dos megas eu coloco como Mega Blastoise exemplo, e no configuration a mesma coisa?

Link para o comentário
Compartilhar em outros sites

Oi zipter estou testando aki mas já segura meu rep+ , eu queria saber se tenho que criar os megas nos monsters?

outra pergunta se eu for criar os xml dos megas eu coloco como Mega Blastoise exemplo, e no configuration a mesma coisa?

Sim precisa criar no Monster.xml e na pasta dos pokemons fazer ele lá tambem e criar no configuration só nao vai precisar editar icon dos mega pq ele tranforma com icon dos poke normais.

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...