skaraz Posted September 26, 2012 Posted September 26, 2012 PVP REWARD In this code i want to add an extra line with //Dont reward if target kill time < 240 sec.. with simlpy words if char1 kills char2 second time before 240 seconds have passed he get no reward...i pay 10 eyros for that line via paypal after pm me ..and if someone give this for free the 10 eyros will go to forum as donation!!!The code must be tested l2j hi5. ========================================================================================================== 2) Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 4425) +++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -5790,7 +5790,7 @@ targetPlayer.isInsideZone(ZONE_PVP) // Target player is inside pvp zone ) ) - increasePvpKills(target); + increasePvpKills(targetPlayer); else // Target player doesn't have pvp flag set { @@ -5802,7 +5802,7 @@ && getPledgeType() != L2Clan.SUBUNIT_ACADEMY) { // 'Both way war' -> 'PvP Kill' - increasePvpKills(target); + increasePvpKills(targetPlayer); return; } @@ -5810,7 +5810,7 @@ if (targetPlayer.getKarma() > 0) // Target player has karma { if (Config.KARMA_AWARD_PK_KILL) - increasePvpKills(target); + increasePvpKills(targetPlayer); } else if (targetPlayer.getPvpFlag() == 0) // Target player doesn't have karma { @@ -5825,17 +5825,79 @@ * Increase the pvp kills count and send the info to the player * */ - public void increasePvpKills(L2Character target) + public void increasePvpKills(L2PcInstance target) { if (target instanceof L2PcInstance && AntiFeedManager.getInstance().check(this, target)) { // Add karma to attacker and increase its PK counter setPvpKills(getPvpKills() + 1); - + // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter sendPacket(new UserInfo(this)); sendPacket(new ExBrExtraUserInfo(this)); + + //Dont reward if same clan + if(getClan() != null && target.getClan() != null && getClan() == target.getClan()) + + { + return; + } + + //Dont reward if same alliance + if(getAllyId() > 0 && target.getAllyId() > 0 && getAllyId() == target.getAllyId()) + + { + return; + } + + //Dont reward if target level < 76 + if(target.getLevel() < 76) + + { + return; + } + + //Dont reward if pdef < 500 + if(target.getPDef(getLockedTarget()) < 500) + + { + return; + } + + + + //Dont reward if same party + if(this.getParty() != null && target.getParty() != null) + + { + if(this.getParty().equals(target.getParty())) + + { + return; + } + + } + + //Dont reward if same ip + String ip1 = this.getClient().getConnection().getInetAddress().getHostAddress(); + String ip2 = target.getClient().getConnection().getInetAddress().getHostAddress(); + + if (ip1.equals(ip2)) + + { + return; + } + + //Reward every PvP win + addItem("Loot", 4037, 1, this, true); } }
^Wyatt Posted September 27, 2012 Posted September 27, 2012 Lol it's already coded in your pack... if (target instanceof L2PcInstance && AntiFeedManager.getInstance().check(this, target)) l2jmods.properties -> control + F -> AntiFeedInterval
skaraz Posted September 27, 2012 Author Posted September 27, 2012 yes you are right ...well am new in hi5 and i speak with many devs about this before i make this topic and nobody knew it...so reward goes to forum ..locked
Mhoska Posted September 27, 2012 Posted September 27, 2012 yes you are right ...well am new in hi5 and i speak with many devs about this before i make this topic and nobody knew it...so reward goes to forum ..locked kk done.
Recommended Posts