Jump to content
  • 0

Java problem..


Question

Posted

Hello everybody

 

Before all, i use aCis rev 185

I make some restrictions about pvp like these modifications :

 

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 = targetPlayer.getClient().getConnection().getInetAddress().getHostAddress();

 

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

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

 

if (isCursedWeaponEquipped())

{

CursedWeaponsManager.getInstance().increaseKills(_cursedWeaponEquippedId);

return;

}

 

// If in duel and you kill (only can kill l2summon), do nothing

if (isInDuel() && targetPlayer.isInDuel()) return;

 

        // If in Arena, do nothing

if (isInsideZone(ZONE_PVP) || targetPlayer.isInsideZone(ZONE_PVP))

return;

 

        // Check if it's pvp

if ((checkIfPvP(target) && targetPlayer.getPvpFlag() != 0 && (ip != ip2) && (getParty() != targetPlayer.getParty()) && (getClanId() != targetPlayer.getClanId()))

|| (isInsideZone(ZONE_PVP) && targetPlayer.isInsideZone(ZONE_PVP))

&& (ip != ip2)

&& (getParty() != targetPlayer.getParty())

&& (getClanId() != targetPlayer.getClanId()))

            increasePvpKills();

// Target player doesn't have pvp flag set

else

{

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

&& (ip != ip2)

&& (getParty() != targetPlayer.getParty())

&& (getClanId() != targetPlayer.getClanId()))

{

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

increasePvpKills();

}

 

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

            if (targetPlayer.getKarma() > 0)

{

if (Config.KARMA_AWARD_PK_KILL && (ip != ip2) && (getParty() != targetPlayer.getParty()) && (getClanId() != targetPlayer.getClanId()))

                    increasePvpKills();

}

else if (targetPlayer.getPvpFlag() == 0)

                increasePkKillsAndKarma(targetPlayer.getLevel());

}

}

 

But when restriction aren't respected (so when players are in party, or same ip, or same clan), anti feed work. But when all restriction are respected, i don't get any pvp points .. Why?

 

Cordially,

Gara

5 answers to this question

Recommended Posts

  • 0
Posted

if ((checkIfPvP(target) && targetPlayer.getPvpFlag() != 0 && (ip != ip2) && (getParty() != targetPlayer.getParty()) && (getClanId() != targetPlayer.getClanId()))

            || (isInsideZone(ZONE_PVP) && targetPlayer.isInsideZone(ZONE_PVP))

              && (ip != ip2)

              && (getParty() != targetPlayer.getParty())

              && (getClanId() != targetPlayer.getClanId()))

 

this is all false.. you dont need it on check pvp ..

  • 0
Posted

sorry for double post but try this is more easy to add and effective.

 

  private void addItemReword(L2PcInstance targetPlayer)
  {
+
+
+	    //Anti feed Clan - Ally
+        if((getClanId() > 0 && targetPlayer.getClanId() > 0 && getClanId() == targetPlayer.getClanId()) || (getAllyId() > 0 && targetPlayer.getAllyId() > 0 && getAllyId() == targetPlayer.getAllyId()))
+        {
+        this.sendMessage("You are not allowed to farm pvp/pk points!");
+         _log.warning("PVP POINT FARM ATTEMPT: " + this.getName() + " and" + targetPlayer.getName() +". CLAN or ALLY.");
+        return;
+        }
+
+        //Anti Feed if player is under level 40
+        if(targetPlayer.getLevel() < 40)
+        {
+        this.sendMessage("You are not allowed to farm pvp/pk points!");
+        _log.warning("PVP POINT FARM ATTEMPT: " + this.getName() + " and" + targetPlayer.getName() +". NEWBIE PG.");
+        return;
+        }
+
+        //Anti Feed on Party   
+        if(this.getParty() != null && targetPlayer.getParty() != null)
+        {
+          if(this.getParty().equals(targetPlayer.getParty()))
+          {
+           this.sendMessage("Farm is punishable with Ban! Don't kill your party!");
+           _log.warning("PVP POINT FARM ATTEMPT: " + this.getName() + " and" + targetPlayer.getName() +". PARTY.");
+           return;
+          }        
+        }
+
+        //Anti Feed Same IP 
+        String ip1 = this.getClient().getConnection().getSocketChannel().socket().getInetAddress().getHostAddress();
+        String ip2 = targetPlayer.getClient().getConnection().getSocketChannel().socket().getInetAddress().getHostAddress();
+
+        if (ip1.equals(ip2))
+        {
+        this.sendMessage("Farm is punishable with Ban! Don't kill your party!");
+        _log.warning("PVP POINT FARM ATTEMPT: " + this.getName() + " and " + targetPlayer.getName() +". SAME IP.");
+        return;
+        }
+		
+	

credits to akken on gp paradise topic

  • 0
Posted

And where i call addItemReword(targetPlayer); ?

 

Edit : i've found the solution, i'm waiting a friend, to see the pvp with different ip. For the moment, antifeed work.

  • 0
Posted

And where i call addItemReword(targetPlayer); ?

 

Edit : i've found the solution, i'm waiting a friend, to see the pvp with different ip. For the moment, antifeed work.

 

on my pack i had additemreword , so possibility is to find by you own the possition , anyway ok

  • 0
Posted

My antifeed work.

 

I had remplace all increasepvpkills(); by addItemReword(TargetPlayer);

 

And at the end of AddItemReword class, i add increasepvpkillst();

 

Works fine, can lock.

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

    • Short version: took Vanganth's classic Interlude pack as the starting point and rebuilt the rest on top of the Classic Secret of Empire client (protocol 166).   Stuff that got reworked, but not limited to: The AI is the one I'm proudest of. ~600 individual NPC behavior scripts, all parsed and verified against retail. Aggro range, follow logic, target switching, idle pattern, social actions. All behaving the way they do on the official server, not the way "close enough" L2J packs usually do. ~2,5k skills loaded, full enchant tree, soul crystal absorption rules. Every formula in Formulas.java and StatFunctions.java got rewritten to match retail. Geodata is not excluded. NPCs/spawns, 6k+ templates, 28k+ spawns, all raid bosses, all the standard event content (Olympiad, Seven Signs with Festival of Darkness, Castle Sieges, Clan Hall stuff, Fortress sieges, Dimensional Rift, Four Sepulchers, Cardiff Invasion). all quest scripts. The engine itself runs both Interlude (protocol 740–770) and Secret of Empire (166) off the same codebase, opcode-mapped. The thing I want to be clear about: this is as close to PTS as L2J realistically gets. Most, not all, L2J packs out there have approximated formulas, stub AI, patchy geodata, hardcoded raid scripts. We didn't take that route.   When can you actually play it:   Server most likely opens next year. If I get more dev time over the coming months a beta by end of this year is realistic, possibly earlier. No promises, depends on how much time I can put in.   The server is already playable since the most important work is done. So if you'd like to collaborate, you'll be able to test it fairly soon. The server files are really good. You might even want to use them for your own server if we decide to go that route.   Server tiers being considered: Low-rate retail - the flagship, most likely first server. Strict PTS. Mid-to-high rate, minimal customs - almost certainly happening as a second server. More accessible but the engine integrity stays. Old L2Finest pride-style (high-rate, heavy customs, the original flavor some of you remember) - very low chance and definitely not soon. It's on the list but well behind the first two.   That's where we are. More updates as open beta gets closer.
    • Maybe some NPC is causing the problem for you, if you don't have a custom map, keep a backup of the database and remove the npc 1-1 to see where the problem is coming from. A custom npc is probably the problem. I had this problem before and searched a lot to find it.
    • 🔥 L2 REDMOON – INTERLUDE 🔥 🆕 Newly opened – Full players joining!   🌐 Discord: https://discord.gg/5PvP5BrGg 💬 Website: https://L2Redmoon.com   ⚔️ Progressive Server • Classic • No Pay To Win   📊 Stage System (Progressive): 🔹 Stage 1: Lv 1–42 | XP x3 | 2 weeks 🔹 Stage 2: Lv 43–60 | XP x4 | 2 weeks 🔹 Stage 3: Lv 61–75 | XP x5 | 10 days 🔹 Endgame: Lv 75–80 | XP x10   💰 General Rates: 💰 Adena x8 💎 Spoil x3 📦 Drop x3 📜 Quest x3   🚫 NO PAY TO WIN ⭐ Premium +30% (Optional) 🛡️ Safe +3 ⚔️ Max +16   🏆 Auto reward max for clans   🔥 ENDGAME – Final competitive phase   @everyone
    • @SkyLordwhats so funny nigga
  • 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..