Jump to content

Recommended Posts

Posted

hello all... before my post i have search on forum about like that.. but i don't have find anything like that.

-----------------------------

1)Is easy Code!

2)Work!

 

go to: net.sf.l2j.gameserver.model.clientpackets

open file attackrequest.java

 

after that:

protected void runImpl()
{
	L2PcInstance activeChar = getClient().getActiveChar();
	if (activeChar == null) return;

 

add that:


+		// Peace Zone Attack Exploit Fix
+		//player can hit mobs(etc) but no players
+		L2PcInstance ptarget = (L2PcInstance)activeChar.getTarget();
+      	if (ptarget.isInsideZone(L2Character.ZONE_PEACE))
+       	{
+      		activeChar.sendMessage("[Guard]: You cant attack player in Peace Zone");
+			activeChar.sendPacket(new ActionFailed());
+			return;
+       }
+
	// avoid using expensive operations if not needed

 

i know is easy code but work fine :)

 

Posted

This is the code that dont allows to players hit NPCs in towns?

with that code don't allow hit players if players is in peace zone..

 

check the trick:

 

(trick: Stun one mob and change fast target you start attack with normal hit you new target..)

 

  • 2 months later...
Posted

hello all... before my post i have search on forum about like that.. but i don't have find anything like that.

-----------------------------

1)Is easy Code!

2)Work!

 

go to: net.sf.l2j.gameserver.model.clientpackets

open file attackrequest.java

 

after that:

protected void runImpl()
{
	L2PcInstance activeChar = getClient().getActiveChar();
	if (activeChar == null) return;

 

add that:


+		// Peace Zone Attack Exploit Fix
+		//player can hit mobs(etc) but no players
+		L2PcInstance ptarget = (L2PcInstance)activeChar.getTarget();
+      	if (ptarget.isInsideZone(L2Character.ZONE_PEACE))
+       	{
+      		activeChar.sendMessage("[Guard]: You cant attack player in Peace Zone");
+			activeChar.sendPacket(new ActionFailed());
+			return;
+       }
+
	// avoid using expensive operations if not needed

 

i know is easy code but work fine :)

 

working???? yes its working but its bugged... if someone have townwar event  or a event in town... and the pet Bug: you can leave your pet in peace zone with out getting damage the pet... half damage  goes to nobody and you will getting the half damage in game the mage will be like a super man with half damage... here is the fix:

 

if (ptarget.isInsideZone(L2Character.ZONE_PEACE))

                {

                L2PetInstance pet = (L2PetInstance)getPet();

                if (!activeChar.isInFunEvent() || !ptarget.isInFunEvent() || !(pet !=null))

                {

                activeChar.sendMessage("[Guard]: You cant attack player in Peace Zone");

                activeChar.sendPacket(new ActionFailed());

                return;

                }

my oppinion: you can add it in l2pcinstance doAttack its better...

if i am wrong correct me... :P

 

 

Posted

If you 're open to few suggestions,i can provide you with the most suitable fix.

First of all,attack is caused by skill intention.There are several skills that force the character to attack when the casting is finished.

 

I believe the problem is in L2Character/void onMagicFinalizer

Just change this line:

	if (skill.getSkillType() == SkillType.PDAM || skill.getSkillType() == SkillType.BLOW 
			|| skill.getSkillType() == SkillType.DRAIN_SOUL || skill.getSkillType() == SkillType.SOW 
			|| skill.getSkillType() == SkillType.SPOIL)
	{
-			if ((getTarget() != null) && (getTarget() instanceof L2Character))
+                       if ((getTarget() != null) && (getTarget() instanceof L2Character) && targets[0] == getTarget())
			getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, getTarget());
	}

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
Reply to this topic...

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



×
×
  • Create New...