Jump to content
  • 0

Log the PvP Points & Anti-PvP Farming System


Question

Posted

Hello MxCs Again,

 

I searched over the forum but I couldn't found anything. What do I need is an anti-PvP Farm System which prevents the player from farming PvPs constantly between two players, in detail:

 

If someone kills somebody else for the first time he will earn a PvP Point, if he kills the same person again he won't earn any PvP Points, we can also add a time like 5 minutes delay after that he could earn a pvp point again.

 

Thanks in advance,

Static

 

Okay, as I see no-one can or wants to help me so I'll ask for something else...

Can someone tell me how can I log the PvP Kills from the players, just when a player kills someone this should be logged in a file in the logs folder with time and date.

 

Okay because the topic was edited many times here is the last request:

 

 

 

Anti-PvP Farming System:

 

When a player (ex PlayerA) kills another Player (ex PlayerB) for a first time, he will take a PVP Point if he tries to kill again the same Player (PlayerB) he won't take pvp point but he has to kill a different player (PlayerC) in order to get a PvP from the second player (PlayerB) again.

 

Simply:

If Static kills George for a first time he'll take a pvp point.

If Static kills George for a second time he wont take a pvp point.

If Static kills George for a first time and then kills John he will take the PVP from John but if he tries to kill John he won't take the PVP Point however if he kills George again he'll earn the pvp point.

 

Log PvP Points:

 

Some kind of code that will log the PvP Points of the players like

Time and Date Player1 Killed Player2.

Example:

[08 Mar 17:40:18] Static Killed George.

Recommended Posts

  • 0
Posted

I understood what u want.The only system I know is the one that prevents pvp farming from the same IP(bots)..if that isn't what are u looking for,u should ask someone who know java that could write a code for u:) example:Coyote,Intrepid,Setekh

  • 0
Posted

the pvp from same ip protection will be more useful ...

 

But if two players does not have the same IP and arrange in-game to farm PvPs from different places they could still do it, this way they won't be able to do so.

If someone can code this I would really appreciate it, if it's possible I will award him with +1 Karma for  his work.

  • 0
Posted

Open the net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java

See code (Made by Mentor):

 

/********** Source code *********/

 

  public void onKillUpdatePvPKarma(L2Character target)

  {

      if (target == null) return;

      if (!(target instanceof L2Playable)) return;

 

      L2PcInstance targetPlayer = target.getActingPlayer();

+    L2PcInstance targetp = (L2PcInstance)getTarget();

+    String ip = getClient().getConnection().getInetAddress().getHostAddress();

+    String ip2 = targetp.getClient().getConnection().getInetAddress().getHostAddress();

 

 

      if (targetPlayer == null) return;                                          // Target player is null

      if (targetPlayer == this) return;                                          // Target player is self

 

/********** Source code *********/

 

                  isInsideZone(ZONE_PVP) &&                //  Player is inside pvp zone and

                  targetPlayer.isInsideZone(ZONE_PVP)    //  Target player is inside pvp zone

            )

      )

      {

        if (target instanceof L2PcInstance)

          increasePvpKills();

+        _log.warning(getName() + "(IP: " + ip + ") hunted " + getTarget().getName() + "(IP: " + ip2 + "). (PvP)");

        return;

      }

      else

      // Target player doesn't have pvp flag set

      {

        // check about wars

        if (targetPlayer.getClan() != null && getClan() != null

              && getClan().isAtWarWith(targetPlayer.getClanId())

              && targetPlayer.getClan().isAtWarWith(getClanId())

              && targetPlayer.getPledgeType() != L2Clan.SUBUNIT_ACADEMY

              && getPledgeType() != L2Clan.SUBUNIT_ACADEMY)

        {

            // 'Both way war' -> 'PvP Kill'

            if (target instanceof L2PcInstance)

            increasePvpKills();

+          _log.warning(getName() + "(IP: " + ip + ") killed " + getTarget().getName() + "(IP: " + ip2 + "). (PvP)");

            return;

        }

 

            // 'No war' or 'One way war' -> 'Normal PK'

        if (targetPlayer.getKarma() > 0)                                        // Target player has karma

        {

            if ( Config.KARMA_AWARD_PK_KILL )

            {

              if (target instanceof L2PcInstance)

                  increasePvpKills();

+              _log.warning(getName() + "(IP: " + ip + ") hunted " + getTarget().getName() + "(IP: " + ip2 + "). (PvP)");

            }

        }

        else if (targetPlayer.getPvpFlag() == 0)                                                                    // Target player doesn't have karma

        {

                increasePkKillsAndKarma(targetPlayer.getLevel(), target instanceof L2PcInstance);

+          _log.warning(getName() + "(IP: " + ip + ") assassinated " + getTarget().getName() + "(IP: " + ip2 + "). (Pk)");

            //Unequip adventurer items

            if(getInventory().getPaperdollItemId(7) >= 7816 && getInventory().getPaperdollItemId(7) <= 7831)

 

/********** Source Kód *********/

  • 0
Posted

Hints are examples hence they are not patches, they were not made through eclipse (hence methods may not exist), like the name says, they are just to guide you.

 

Simply:

If Static kills George for a first time he'll take a pvp point.

If Static kills George for a second time he wont take a pvp point.

If Static kills George for a first time and then kills John he will take the PVP from John but if he tries to kill John he won't take the PVP Point however if he kills George again he'll earn the pvp point.

Hint:

private int _lastKilled = null;
public lala(L2PcInstance killer, int killedId)
{
if(_lastKilled == killedId)
return;
else 
{
_lastKilled = killedId;
increasePvPCount();
}
}

 

Log PvP Points:

 

Some kind of code that will log the PvP Points of the players like

Time and Date Player1 Killed Player2.

Example:

[08 Mar 17:40:18] Static Killed George.

 

Hint:

private int _lastKilled = null;
private final DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
private Date date = null;

public lala(L2PcInstance killer, L2PcInstance target)
{
if(_lastKilled == targetgetObjectId())
return;
else 
{
_lastKilled = killedId;
increasePvPCount();
write(killer.getName(), target.getName());
}
}

private static void write(String killer, String killed) throws IOException{

try{
   date = new Date();

   FileWriter fwriter = new FileWriter("killerLog.txt",true);
   BufferedWriter out = new BufferedWriter(fwriter);
   out.write("[PvP] (" + dateFormat.format(date) + ") :" killed + " killed " + killed);
   out.close();
   }catch (Exception e){
     System.err.println("Error: " + e.getMessage());
   }         


   }

  • 0
Posted

Now you're just pushing it.The hints are pretty easy and in fact, they're nearly the whole work that needs to be done.

Don't be lazy, spend a few hours tweaking with eclipse and you'll do it alone.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Posts

    • The holidays are over and we’re back to work (well… we never really stopped 🙂 ). The server has been online without a single restart since December 26, running smoothly and without issues. That’s because we care, and we’ll keep caring. Many of us remember the old days: helping new players, building clans from zero, catching up together, and having fun without rushing. With that spirit in mind, Newbie Bonuses are now live and we strongly encourage everyone to help newcomers catch up and enjoy the journey. L2Elixir was never about short-term hype. It’s about community, stability, and bringing back what made Lineage II special.   🎁 Newbie Bonuses Characters created since December 25 & all new players receive a Newbie Box (Return Hero) (Rune EXP/SP +50% for 5 days, Random 48-hour Costume) 2nd Class Transfer cost reduced from 3kk to 1kk — join Academies! 3rd Class Transfer enabled, available only for classes already in the Hall of Fame. 🛡️ Anti-Bot Implemented BOT-CHECKER v2, more checks, and general improvements. Added extra checks during PvP. New Auto-Check system for suspicious behavior (penalties apply if third-party software is detected). Fixed Bot Report Button not refreshing. ⚙️ General After critical errors or force disconnects, characters will remain No Carrier for a few minutes. Added Cursed Bone to Helvetia (QoL). Enabled on-screen Clan War kill notifications. Fixed buff store issues when entering characters. Fixed party drop owner calculation (please report any issues). 🧙 NPCs Harit Lizardman, Grunt, and Archer now level up SC up to stage 5. 🎉 Events Fixed trigger skills not working during Events. Fixed Health / Shield packs not disappearing in some cases. Fixed summon remaining time not refreshing after Events. Added a second Team vs Team map to reduce routine. Added another Save the King map. Christmas Event cleanup completed. Players in Observe Mode can no longer register for Events. 📜 Quests Fate’s Whisper Fixed and corrected messages. Enchanted B-grade weapons can now be exchanged as per retail. Added missing Social Victory animation on quest completion. 🗺️ Geodata Fixed falling issues in Castle zones.   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
    • NEW SEASON START 23.01.2026 Get ready for the ultimate High Five adventure on L2Exoplanet.net!   • The last two previous Seasons are now merged into the Core Server. • The Core Server remains our main long-term world. • All future Seasonal Servers will be merged into Core after they end. • No characters or items will be lost – everything stays safe!     GRAND OPENING:  23.01.2026 at 20:00 GMT+1 BETA TEST:    16.01.2026    Client: High Five Rates: x10   Website: https://l2exoplanet.net Facebook: https://www.facebook.com/L2-Exoplanet-106811564103836 Discord: https://discord.gg/4fzhW7ZSPc         Game Rates    Experience: x10  Skill Points: x10  Adena: x5  Drop: x8  Spoil: x8  Quest: x5  Raid Boss Drop: x5  Fame: x2  Epaulette: x8  Manor: x8      Safe Enchant: +3  Maximum Enchant: +16  Normal Scroll Chance: 60%  Blessed Scroll Chance: 63%  Attribute Stone Chance: 50%  Attribute Crystal Chance: 30%      Game Settings    Multibox - 3 game clients per HWID  Autoloot  Autolearn Skills Auto Farm  NPC Buffer   Buff Slots (24+4/12)  Buff Duration (2h)  Olympiad Period 7days (new heroes appear every monday)  Seven Signs Period  Class Transfer for Adena  Max Sub-Class 3  Sub-Class Max Level 85  Essence Interface  Champions System  Vote Reward System  Dayli Reward System  PC Points Reward (500PC = 1 Donate Coin)      Epic Bosses Respawn Times     Queen Ant:  24 Hours +/- 4 Hours   Beleth: 3 Days +/- 8 Hours   Baium: 3 Days +/- 8 Hours   Antharas: 4 Days +/- 8 Hours   Valakas:  5 Days +/- 8 Hours     Instance Info     Normal Freya = 6 Players   Hard Freya = 12 Players   Frintezza = 6 Players   Zaken 83 Day = 6 Players   Zaken 60 Day = 6 Players   Zaken Nightly = 9 Players   Tiat = 6 Players   Beleth = 12 Players
    • when did i say something about mobius files besides what i've said on this post? or you're "calling me out" for saying this when someone says mobius is a better interlude alternative than acis? lol  
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock