Jump to content
  • 0

[Help] Java Same ip pvp


Nitzamc

Question

hello guys as you see this topic is made for java code that dont allow you to get pvp if the char u killed is same ip , i made the same topic on greek section but there was no answer for my question so can some 1 tell me if there excist any code like this? i found 2 codes that look like the code that i want but its not what im looking for , if some1 has seen something like the code that im looking for i will be happy if you share it with me ! thanks

Link to comment
Share on other sites

Recommended Posts

  • 0

even if u add this code to the server ,remember there are pepole playing from net cafe which wont be able to fight others ....

u better find good anti feed which doesnt includ IP connection inside...

Link to comment
Share on other sites

  • 0

Solved By Myself :) and im gonna tell you how maybe some1 need it too!

go to

src/main/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java

found this line

  // Check if it's pvp

start telleting from here until

return;

}

 

and then added this code by osiris

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

u can lock it acis :)

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...