diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Playable.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Playable.java index 10ad419ea4..f8c2d43180 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Playable.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Playable.java @@ -203,20 +203,12 @@ public abstract class L2Playable extends L2Character { final L2PcInstance player = getActingPlayer(); - if ((player == null) || (target == null) || (player == target)) - { - return true; - } - - if (target.isOnDarkSide()) - { - return true; - } - else if (target.getReputation() < 0) - { - return true; - } - else if ((player.getPvpFlag() > 0) && (target.getPvpFlag() > 0)) + if ((player == null) // + || (target == null) // + || (player == target) // + || (target.getReputation() < 0) // + || (target.getPvpFlag() > 0) // + || target.isOnDarkSide()) { return true; } diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 88e3f6c013..3b3b94d540 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -5296,11 +5296,10 @@ public final class L2PcInstance extends L2Playable return; } - if ((isInDuel() && (player_target.getDuelId() == getDuelId()))) + if (isInDuel() && (player_target.getDuelId() == getDuelId())) { return; } - if ((!isInsideZone(ZoneId.PVP) || !player_target.isInsideZone(ZoneId.PVP)) && (player_target.getReputation() >= 0)) { if (checkIfPvP(player_target)) @@ -5311,7 +5310,6 @@ public final class L2PcInstance extends L2Playable { setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME); } - if (getPvpFlag() == 0) { startPvPFlag(); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Playable.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Playable.java index 10ad419ea4..f8c2d43180 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Playable.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Playable.java @@ -203,20 +203,12 @@ public abstract class L2Playable extends L2Character { final L2PcInstance player = getActingPlayer(); - if ((player == null) || (target == null) || (player == target)) - { - return true; - } - - if (target.isOnDarkSide()) - { - return true; - } - else if (target.getReputation() < 0) - { - return true; - } - else if ((player.getPvpFlag() > 0) && (target.getPvpFlag() > 0)) + if ((player == null) // + || (target == null) // + || (player == target) // + || (target.getReputation() < 0) // + || (target.getPvpFlag() > 0) // + || target.isOnDarkSide()) { return true; } diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index d8975e3b91..bf7e988d0a 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -5302,11 +5302,10 @@ public final class L2PcInstance extends L2Playable return; } - if ((isInDuel() && (player_target.getDuelId() == getDuelId()))) + if (isInDuel() && (player_target.getDuelId() == getDuelId())) { return; } - if ((!isInsideZone(ZoneId.PVP) || !player_target.isInsideZone(ZoneId.PVP)) && (player_target.getReputation() >= 0)) { if (checkIfPvP(player_target)) @@ -5317,7 +5316,6 @@ public final class L2PcInstance extends L2Playable { setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME); } - if (getPvpFlag() == 0) { startPvPFlag(); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Playable.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Playable.java index 10ad419ea4..f8c2d43180 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Playable.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Playable.java @@ -203,20 +203,12 @@ public abstract class L2Playable extends L2Character { final L2PcInstance player = getActingPlayer(); - if ((player == null) || (target == null) || (player == target)) - { - return true; - } - - if (target.isOnDarkSide()) - { - return true; - } - else if (target.getReputation() < 0) - { - return true; - } - else if ((player.getPvpFlag() > 0) && (target.getPvpFlag() > 0)) + if ((player == null) // + || (target == null) // + || (player == target) // + || (target.getReputation() < 0) // + || (target.getPvpFlag() > 0) // + || target.isOnDarkSide()) { return true; } diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 7e23c01876..f657faf777 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -5304,11 +5304,10 @@ public final class L2PcInstance extends L2Playable return; } - if ((isInDuel() && (player_target.getDuelId() == getDuelId()))) + if (isInDuel() && (player_target.getDuelId() == getDuelId())) { return; } - if ((!isInsideZone(ZoneId.PVP) || !player_target.isInsideZone(ZoneId.PVP)) && (player_target.getReputation() >= 0)) { if (checkIfPvP(player_target)) @@ -5319,7 +5318,6 @@ public final class L2PcInstance extends L2Playable { setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME); } - if (getPvpFlag() == 0) { startPvPFlag(); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Playable.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Playable.java index 10ad419ea4..f8c2d43180 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Playable.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Playable.java @@ -203,20 +203,12 @@ public abstract class L2Playable extends L2Character { final L2PcInstance player = getActingPlayer(); - if ((player == null) || (target == null) || (player == target)) - { - return true; - } - - if (target.isOnDarkSide()) - { - return true; - } - else if (target.getReputation() < 0) - { - return true; - } - else if ((player.getPvpFlag() > 0) && (target.getPvpFlag() > 0)) + if ((player == null) // + || (target == null) // + || (player == target) // + || (target.getReputation() < 0) // + || (target.getPvpFlag() > 0) // + || target.isOnDarkSide()) { return true; } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 9eea2cf36a..05c9380a04 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -5301,11 +5301,10 @@ public final class L2PcInstance extends L2Playable return; } - if ((isInDuel() && (player_target.getDuelId() == getDuelId()))) + if (isInDuel() && (player_target.getDuelId() == getDuelId())) { return; } - if ((!isInsideZone(ZoneId.PVP) || !player_target.isInsideZone(ZoneId.PVP)) && (player_target.getReputation() >= 0)) { if (checkIfPvP(player_target)) @@ -5316,7 +5315,6 @@ public final class L2PcInstance extends L2Playable { setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME); } - if (getPvpFlag() == 0) { startPvPFlag(); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Playable.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Playable.java index cdf4b8c2fa..739e47d458 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Playable.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Playable.java @@ -200,10 +200,12 @@ public abstract class L2Playable extends L2Character { return false; // Target is null } + if (target == this) { return false; // Target is self } + if (!target.isPlayable()) { return false; // Target is not a L2Playable @@ -230,30 +232,18 @@ public abstract class L2Playable extends L2Character { return false; // Target player is self } + if (targetPlayer.getKarma() != 0) { return false; // Target player has karma } + if (targetPlayer.getPvpFlag() == 0) { - return false; + return false; // Target player is not flagged } return true; - // Even at war, there should be PvP flag - // if( - // player.getClan() == null || - // targetPlayer.getClan() == null || - // ( - // !targetPlayer.getClan().isAtWarWith(player.getClanId()) && - // targetPlayer.getWantsPeace() == 0 && - // player.getWantsPeace() == 0 - // ) - // ) - // { - // return true; - // } - // return false; } /** diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index f9a9d733a8..9a64a39de0 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -5450,7 +5450,6 @@ public final class L2PcInstance extends L2Playable public void updatePvPStatus(L2Character target) { final L2PcInstance player_target = target.getActingPlayer(); - if (player_target == null) { return; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Playable.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Playable.java index 10ad419ea4..f8c2d43180 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Playable.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Playable.java @@ -203,20 +203,12 @@ public abstract class L2Playable extends L2Character { final L2PcInstance player = getActingPlayer(); - if ((player == null) || (target == null) || (player == target)) - { - return true; - } - - if (target.isOnDarkSide()) - { - return true; - } - else if (target.getReputation() < 0) - { - return true; - } - else if ((player.getPvpFlag() > 0) && (target.getPvpFlag() > 0)) + if ((player == null) // + || (target == null) // + || (player == target) // + || (target.getReputation() < 0) // + || (target.getPvpFlag() > 0) // + || target.isOnDarkSide()) { return true; } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 2fb8207aff..6e7dcbf28b 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -5269,11 +5269,10 @@ public final class L2PcInstance extends L2Playable return; } - if ((isInDuel() && (player_target.getDuelId() == getDuelId()))) + if (isInDuel() && (player_target.getDuelId() == getDuelId())) { return; } - if ((!isInsideZone(ZoneId.PVP) || !player_target.isInsideZone(ZoneId.PVP)) && (player_target.getReputation() >= 0)) { if (checkIfPvP(player_target)) @@ -5284,7 +5283,6 @@ public final class L2PcInstance extends L2Playable { setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME); } - if (getPvpFlag() == 0) { startPvPFlag(); diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Playable.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Playable.java index 10ad419ea4..f8c2d43180 100644 --- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Playable.java +++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Playable.java @@ -203,20 +203,12 @@ public abstract class L2Playable extends L2Character { final L2PcInstance player = getActingPlayer(); - if ((player == null) || (target == null) || (player == target)) - { - return true; - } - - if (target.isOnDarkSide()) - { - return true; - } - else if (target.getReputation() < 0) - { - return true; - } - else if ((player.getPvpFlag() > 0) && (target.getPvpFlag() > 0)) + if ((player == null) // + || (target == null) // + || (player == target) // + || (target.getReputation() < 0) // + || (target.getPvpFlag() > 0) // + || target.isOnDarkSide()) { return true; } diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 175dccc56f..d6a1ba44e2 100644 --- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -5269,11 +5269,10 @@ public final class L2PcInstance extends L2Playable return; } - if ((isInDuel() && (player_target.getDuelId() == getDuelId()))) + if (isInDuel() && (player_target.getDuelId() == getDuelId())) { return; } - if ((!isInsideZone(ZoneId.PVP) || !player_target.isInsideZone(ZoneId.PVP)) && (player_target.getReputation() >= 0)) { if (checkIfPvP(player_target)) @@ -5284,7 +5283,6 @@ public final class L2PcInstance extends L2Playable { setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME); } - if (getPvpFlag() == 0) { startPvPFlag();