You can only attack pokemons if they are in party, can someone make if they get this storage then they can attack each other pokemons if not then it will come the cancel you need party.
Else if its possible to make that if they are in pvp zone it will ignore party cancel if they are not on pvp zone it will not ignore the party cancel!
Rep! will be earned!
Else if its possible to make that if they are in pvp zone it will ignore party cancel if they are not on pvp zone it will not ignore the party cancel!
Rep! will be earned!
Code:
local fightcondition = createConditionObject(CONDITION_INFIGHT)
setConditionParam(fightcondition, CONDITION_PARAM_TICKS, 18 * 1000)
function fightCondic(cid)
if not isCreature(cid) then return true end
if not isCreature(getCreatureTarget(cid)) then return true end
doAddCondition(cid, fightcondition)
addEvent(fightCondic, 1000, cid)
end
function onTarget(cid, target)
if isPlayer(target) then return true end
if getPlayerStorageValue(target, 201) ~= -1 then
for a, b in pairs(ginasios) do
if getPlayerStorageValue(target, ginasios[getPlayerStorageValue(target, 201)].storage) == 1 then
if getPlayerStorageValue(cid, ginasios[getPlayerStorageValue(target, 201)].storage) ~= 1 then
doPlayerSendCancel(cid, "You can't attack this pokemon.")
return false
end
end
end
end
if isSummon(target) then
local duel = getCreatureMaster(target)
if not isInParty(cid) or not isInParty(duel) then
doPlayerSendCancel(cid, "You have to join a party to duel.")
return false
end
if not getPlayerParty(cid) == getPlayerParty(duel) then
doPlayerSendCancel(cid, "You have to join a party to duel.")
return false
end
end
if false then -- desativado
if not isPlayerInAgressiveList(target, cid) then
addPlayerToAgressiveList(target, cid)
end
if isPassive(target) then
setAgressive(target)
if #getCreatureSummons(cid) >= 1 then
doMonsterSetTarget(target, getCreatureSummons(cid)[1])
else
doMonsterSetTarget(target, cid)
end
else
local histarget = getCreatureTarget(target)
if isCreature(histarget) and isPlayer(getCreatureMaster(histarget)) and #getCreatureSummons(cid) >= 1 and #getCreatureSummons(getCreatureMaster(histarget)) <= 0 then
doMonsterSetTarget(target, getCreatureSummons(cid)[1])
end
end
end
return TRUE
end