Ir para conteúdo
  • 0

poke passivo DXP - pokemaster


malwarebr

Pergunta

Ola, gostaria de saber qual dos 2 scripts de passivo seria mais funcional. o da base "DxP" ou a da base "DxP pokemaster". 

 

Base DxP

function isPokePassive(cid)
if not isCreature(cid) then return false end
	if isWild(cid) and isInArray(passivepokemons, doCorrectString(getCreatureName(cid)))  then
	   return true 
	end
	return false
end

function doSetPokemonAgressiveToPlayer(cid, target)
if not isCreature(cid) or not isCreature(target) then return false end
	setPokemonPassive(cid, false)
	setPlayerStorageValue(cid, 505, getCreatureName(target))
if getCreatureTarget(cid) >= 1 then return false end
	if #getCreatureSummons(target) > 0 then
	   doMonsterSetTarget(cid, getCreatureSummons(target)[1])
	else
	   doMonsterSetTarget(cid, target)
	end
end

function getPokemonAttackedPassive(cid)
if not isCreature(cid) then return false end
local stor = getPlayerStorageValue(cid, 505)
    if stor ~= 0 then
       return stor
	else
	   return ""
	end
end

function setPokemonPassive(cid, passive)
if not isCreature(cid) then return false end
	if passive then 
		setPlayerStorageValue(cid, 504, 0)-- passivo
		setPlayerStorageValue(cid, 505, -1)		
	else 
		setPlayerStorageValue(cid, 504, 1) -- agressivo
		setPlayerStorageValue(cid, 505, -1)
	end
end

function onWalkSetTargetPassive(cid)
if not isCreature(cid) then return false end
if getCreatureTarget(cid) >= 1 then return false end
local rangeX, rangeY = 7, 7
local spectators = getSpectators(getCreaturePosition(cid), rangeX, rangeY, false)
local attackerName = getPokemonAttackedPassive(cid)
local playerID = getPlayerByName(attackerName)
local isEqualsDificult = false

if not isCreature(playerID) then
	return false
end
if getCreatureTarget(cid) ~= playerID and attackerName ~= "" then
	return false
end

if spectators then
        for _, spectator in ipairs(spectators) do
            if isPlayer(spectator) and spectator ~= cid and (attackerName ~= "" and attackerName == getCreatureName(spectator)) and isWalkable(getThingPos(spectator), false, true, true, true) or (isWildTrainerNPC(cid) and getNPCNivel(cid) == getPlayerRankNivel(spectator)) then
				setPlayerStorageValue(cid, 504, 1)
				local attacker = spectator

				if #getCreatureSummons(spectator) > 0 then
				   attacker = getCreatureSummons(spectator)[1]
				end

				doMonsterSetTarget(cid, attacker)
				break
			else
				setPlayerStorageValue(cid, 504, 0)
				doPokemonSetNoTarget(cid)
            end
        end
    end
end

function onWalkSetTargetPassiveWildNPC(cid)
if not isCreature(cid) then return false end
if getCreatureTarget(cid) >= 1 then return false end
if isCreature(getWildNPCPokemon(cid)) then	
   doMovePokeToPos(getWildNPCPokemon(cid), getThingPos(cid))
end
local rangeX, rangeY = 7, 7
local spectators = getSpectators(getCreaturePosition(cid), rangeX, rangeY, false)
if spectators then
        for _, spectator in ipairs(spectators) do
            if isPlayer(spectator)  and getNPCNivel(cid) == getPlayerRankNivel(spectator) then
				setPlayerStorageValue(cid, 504, 1)
				doSetPokemonAgressiveToPlayer(cid, spectator)
				
				if #getCreatureSummons(spectator) > 0 then
				   doMonsterSetTarget(cid, getCreatureSummons(spectator)[1])
				else
				   doMonsterSetTarget(cid, spectator)
				end

				if isWildTrainerNPC(cid) then
				   local mySummon = tonumber(getPlayerStorageValue(cid, storages.WILDNPCMYSUMMON))
				   doSetPokemonAgressiveToPlayer(mySummon, spectator)
				end
				break
	    else
				setPlayerStorageValue(cid, 504, 0)
				doPokemonSetNoTarget(cid)
				 if getCreatureTarget(cid) <= 0 then
				   local mySummon = tonumber(getPlayerStorageValue(cid, storages.WILDNPCMYSUMMON))
				   setPlayerStorageValue(mySummon, 504, 0)
				   doPokemonSetNoTarget(mySummon)
			         end
            end
        end
    end
end

function doPokemonSetNoTargets(cid)
if not isCreature(cid) then return false end
	local name = getCreatureName(cid)
	local monsterT = doCreateMonsterNick(cid, name, name, getThingPos(cid), false)
	doRemoveCreature(cid)
end
----

Base Pokemaster

function isPokePassive(cid)
if not isCreature(cid) then return false end
	if isWild(cid) and isInArray(passivepokemons, doCorrectString(getCreatureName(cid)))  then
	   return true 
	end
	return false
end

function doSetPokemonAgressiveToPlayer(cid, target)
if not isCreature(cid) or not isCreature(target) then return false end
	setPokemonPassive(cid, false)
	setPlayerStorageValue(cid, 505, getCreatureName(target))
if getCreatureTarget(cid) >= 1 then return false end
	if #getCreatureSummons(target) > 0 then
	   doMonsterSetTarget(cid, getCreatureSummons(target)[1])
	else
	   doMonsterSetTarget(cid, target)
	end
end

function getPokemonAttackedPassive(cid)
if not isCreature(cid) then return false end
local stor = getPlayerStorageValue(cid, 505)
    if stor ~= 0 then
       return stor
	else
	   return ""
	end
end

function setPokemonPassive(cid, passive)
if not isCreature(cid) then return false end
	if passive then 
		setPlayerStorageValue(cid, 504, 0)
		setPlayerStorageValue(cid, 505, 0)		
	else 
		setPlayerStorageValue(cid, 504, 1) 
	end
end

function onWalkSetTargetPassive(cid)
if not isCreature(cid) then return false end
if getCreatureTarget(cid) >= 1 then return false end
local rangeX, rangeY = 7, 7
local spectators = getSpectators(getCreaturePosition(cid), rangeX, rangeY, false)
local attackerName = getPokemonAttackedPassive(cid)
local playerID = getPlayerByName(attackerName)

if not isCreature(playerID) then
	return false
end
if getCreatureTarget(cid) ~= playerID and attackerName ~= "" then
	return false
end

if spectators then
        for _, spectator in ipairs(spectators) do
            if isPlayer(spectator) and spectator ~= cid and (attackerName ~= "" and attackerName == getCreatureName(spectator)) and isWalkable(getThingPos(spectator), false, true, true, true) then
				setPlayerStorageValue(cid, 504, 1)
				if #getCreatureSummons(spectator) > 0 then
				   doMonsterSetTarget(cid, getCreatureSummons(spectator)[1])
				else
				   doMonsterSetTarget(cid, spectator)
				end
				break
			else
				setPlayerStorageValue(cid, 504, 0)
				doPokemonSetNoTarget(cid)
            end
        end
    end
end


function doPokemonSetNoTargets(cid)
if not isCreature(cid) then return false end
	local name = getCreatureName(cid)
	local monsterT = doCreateMonsterNick(cid, name, name, getThingPos(cid), false)
	doRemoveCreature(cid)
end
----

 

Obs. Os Pokes não pegam a passiva! kkk porem queria saber qua la mais funcional para deixar ativa.

Obs2. Desculpem se fiz algo errado! sou Meio novo aqui e tambem na area de script(brinquei bem antigamente na epoca da svke quando estavam começando a fazer modificações para poketibia)

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

  • Quem Está Navegando   0 membros estão online

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