if someone kill the some character more than 1 time dont take pvp point
Index: src/main/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- src/main/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 7252)
+++ src/main/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -731,7 +731,9 @@
private boolean _IsWearingFormalWear = false;
// Current force buff this caster is casting to a target
- protected ForceBuff _forceBuff;
+ protected ForceBuff _forceBuff;
+
+ private int _lastKillerId = 0;
/** Skill casting information (used to queue when several skills are cast in a short time) **/
public class SkillDat
@@ -4498,7 +4500,8 @@
)
)
{
- increasePvpKills();
+ if (targetPlayer.getLastKillerId() != getObjectId())
+ increasePvpKills();
// give faction pvp points
if (Config.FACTION_ENABLED
&& targetPlayer.getSide() != getSide()
@@ -4533,7 +4536,8 @@
if (clanWarKill)
{
// 'Both way war' -> 'PvP Kill'
- increasePvpKills();
+ if (targetPlayer.getLastKillerId() != getObjectId())
+ increasePvpKills();
return;
}
@@ -4550,6 +4554,7 @@
increasePkKillsAndKarma(targetPlayer.getLevel());
}
}
+ targetPlayer.setLastKillerId(getObjectId());
}
/**
@@ -11194,4 +11199,14 @@
public void updateFOSTitleFlag(){
FortressSiege.setTitleSiegeFlags(this);
}
+
+ public final int getLastKillerId()
+ {
+ return _lastKillerId;
+ }
+
+ public final void setLastKillerId(int id)
+ {
+ _lastKillerId = id;
+ }
}
credits Savormix
// Check if it's pvp
String attacker = getClient().getConnection().getInetAddress().getHostAddress();
String attacked = targetPlayer.getClient().getConnection().getInetAddress().getHostAddress();
if (attacker.equals(attacked))
{
sendMessage("What you though? You cannot use dumb exploit's NOOB!");
return;
}
if (
(
checkIfPvP(target) && // Can pvp and
targetPlayer.getPvpFlag() != 0 // Target player has pvp flag set
) || // or
(
isInsideZone(ZONE_PVP) && // Player is inside pvp zone and
targetPlayer.isInsideZone(ZONE_PVP) // Target player is inside pvp zone
)
)
{
increasePvpKills();
}
else // Target player doesn't have pvp flag set
{
// check about wars
if (targetPlayer.getClan() != null && getClan() != null)
{
if (getClan().isAtWarWith(targetPlayer.getClanId()))
{
if (targetPlayer.getClan().isAtWarWith(getClanId()))
{
// 'Both way war' -> 'PvP Kill'
increasePvpKills();
return;
}
}
}
// 'No war' or 'One way war' -> 'Normal PK'
if (attacker.equals(attacked))
{
sendMessage("What you though? You cannot use dumb exploit's NOOB!");
return;
}
else if (targetPlayer.getKarma() > 0) // Target player has karma
{
if ( Config.KARMA_AWARD_PK_KILL )
{
increasePvpKills();
}
}
else if (targetPlayer.getPvpFlag() == 0) // Target player doesn't have karma
{
if (attacker.equals(attacked))
{
sendMessage("What you though? You cannot use dumb exploit's NOOB!");
return;
}
Osiris Code