Jump to content
  • 0

[Help] Java Same ip pvp


Question

Posted

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

Recommended Posts

  • 0
Posted

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

  • 0
Posted

what the ... you are saying man and what if they play from netcafe they will kill each other for thousands of times stop the idiot posts

  • 0
Posted

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 :)

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...