Jump to content
  • 0

How to make the PK-Guard smarter?


Question

3 answers to this question

Recommended Posts

  • 0
Posted

L2GuardInstance...

 

maybe this can help you.

 

Index: L2JEclipse-Game/java/net/sf/l2j/gameserver/model/actor/instance/L2GuardInstance.java
===================================================================
--- L2JEclipse-Game/java/net/sf/l2j/gameserver/model/actor/instance/L2GuardInstance.java	(revision 649)
+++ L2JEclipse-Game/java/net/sf/l2j/gameserver/model/actor/instance/L2GuardInstance.java	(working copy)
@@ -202,11 +203,19 @@
	@Override
	public void onAction(L2PcInstance player)
	{
-		if (!canTarget(player)) return;
+		if (!canTarget(player))
+			return;

		// Check if the L2PcInstance already target the L2GuardInstance
		if (getObjectId() != player.getTargetId())
		{
+			
+			if (!player.isAlikeDead() || player.isFakeDeath())
+				return;
+			
+			if (!player.isSilentMoving())
+				return;
+			
			if (Config.DEBUG) _log.fine(player.getObjectId()+": Targetted guard "+getObjectId());

			// Set the target of the L2PcInstance player

  • 0
Posted

try to add in L2AttackableAI.java

 

find:

if (!(me instanceof L2RaidBossInstance) && player.isSilentMoving() && !player.isCastingNow() && !player.isAttackingNow())
    return false;

 

and make it:

if (!(me instanceof L2RaidBossInstance) && !(me instanceof L2GuardInstance) && player.isSilentMoving() && !player.isCastingNow() && !player.isAttackingNow())
    return false;

 

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.



×
×
  • Create New...