Jump to content
  • 0

Log the PvP Points & Anti-PvP Farming System


Statique

Question

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.

Link to comment
Share on other sites

Recommended Posts

  • 0

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

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0

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 *********/

Link to comment
Share on other sites

  • 0

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());
   }         


   }

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hood-services https://campsite.bio/utchihaamkt  
    • Server Rates: » Xp 500x. » Sp 500x. » Aden 500x. » Drop 1x. » PartyXp 2x. » PartySp 2x. » Starting character level -61. Enchant rates: » Safe enchant +4. » Blessed and simple scrolls max enchant (+16). » Crystal scrolls max enchant (+20). » Simple enchant scrolls chance – 65%. » Blessed enchant scrolls chance – 100%. » Crystal enchant scrolls chance – 50% Augmentations: » Mid life stone skill chance – 5%. » High life stone skill chance – 10%. » Top life stone skill chance – 20%. » Augments 1+1 Unique features: » Main town – Giran » Automatic-Manual Potions. » Working 2 castle sieges. (Giran-Aden) » SPS cancel lasts 10 seconds and than buffs come back. » Stackable scrolls, lifestones, book of giants. » Unique pvp zone » More then 11 active raid bosses. » Wedding system. » Unique farming areas. » Npc skill enchanter. » Full npc buffer with auto buff. » Max count of buffs – 55. » Max subclasses – 4. » Free and no quest class change. » Free and no quest sub class. » Raid boss drop nobless item. » No weight limit. » Unique protection anti-hwy armor for archers/daggers etc. » Ingame password change. » Top pvp/pk/online ranks NPC. » Unique monsters & NPC. » Interlude retail skills. » Server up-time [24/7] [99]%. » Perfect class balance (all class can kill all class depending on players skill and setup knowledge,gear,augmentations). » Announcements on double kills triple kills etc. » Announcements on Grand Boss death , with the name of the killer as well as clan name of the player. » Information Npc in game with all servers infromations. Custom server gear : 1). Titanium Armor Lv.1 2). Epic Armor Lv.2 3). Epic Weapons-Kamikaze-Black S grade (Same Stats) 4). Demonic-Angelic Wings-Baium Hair-Custom Accessories (SameStats) 5). Custom Fighter/Mage tattoo Lv1-Lv2-Lv3 6). Shirt (STR,CON,INT +1) 7). Custom Shields Server Commands: .tvtjoin .tvtleave – Join or leave tvt event. .ctfjoin .ctfleave – Join or leave ctf event. .dmjoin .dmleave – Join of leave dm event. .online – current online players count. .repair – repairs stuck character in world. .menu – opens online menu panel. .exit – PVP zone exit in case you are bullied. .changepassword - Opens online menu then u can change ur password in game. .farm - Enable/disable autofarm Event system: » TVT event » CTF event » DM event » Tournament Event » Party Zone » Unique event shop. Olympiad game: » Retail olympiad game. » Competition period [1] week. » Olympiad start time [18:00] end [00:00] GMT+2. » New Heroes every Sunday.
    • Tomorrow grand opening lests go 🙂 
    • New season of Warfire X150 has been postponed to September 28th.
  • Topics

×
×
  • Create New...