Skip to content

Faction Engine + Guardgve

Featured Replies

Edited: Becouse of Prexix.

Here is one more useful code:

Index: C:/Eclipse/workspace/L2_GameServer/java/net/sf/l2j/gameserver/ai/L2AttackableAI.java
===================================================================
--- C:/Eclipse/workspace/L2_GameServer/java/net/sf/l2j/gameserver/ai/L2AttackableAI.java	(revision 3278)
+++ C:/Eclipse/workspace/L2_GameServer/java/net/sf/l2j/gameserver/ai/L2AttackableAI.java	(working copy)
@@ -47,6 +47,8 @@
 import net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2RiftInvaderInstance;
+import net.sf.l2j.gameserver.model.actor.instance.L2GoodGuardInstance;
+import net.sf.l2j.gameserver.model.actor.instance.L2EvilGuardInstance;
 import net.sf.l2j.gameserver.model.quest.Quest;
 import net.sf.l2j.gameserver.taskmanager.DecayTaskManager;
 import net.sf.l2j.gameserver.util.Util;
@@ -234,6 +236,42 @@
 			
 			return false;
 		}
+		// Check if the actor is a L2GuardInstance
+		else if (_actor instanceof L2GoodGuardInstance)
+		{
+			
+			// Check if the L2PcInstance target has karma (=PK)
+			if (target instanceof L2PcInstance && ((L2PcInstance) target).isevil())
+				// Los Check
+				return GeoData.getInstance().canSeeTarget(me, target);
+			
+			//if (target instanceof L2Summon)
+			//    return ((L2Summon)target).getKarma() > 0;
+			
+			// Check if the L2MonsterInstance target is aggressive
+			if (target instanceof L2MonsterInstance)
+				return (((L2MonsterInstance) target).isAggressive() && GeoData.getInstance().canSeeTarget(me, target));
+			
+			return false;
+		}
+		// Check if the actor is a L2GuardInstance
+		else if (_actor instanceof L2EvilGuardInstance)
+		{
+			
+			// Check if the L2PcInstance target has karma (=PK)
+			if (target instanceof L2PcInstance && ((L2PcInstance) target).isgood())
+				// Los Check
+				return GeoData.getInstance().canSeeTarget(me, target);
+			
+			//if (target instanceof L2Summon)
+			//    return ((L2Summon)target).getKarma() > 0;
+			
+			// Check if the L2MonsterInstance target is aggressive
+			if (target instanceof L2MonsterInstance)
+				return (((L2MonsterInstance) target).isAggressive() && GeoData.getInstance().canSeeTarget(me, target));
+			
+			return false;
+		}
 		else if (_actor instanceof L2FriendlyMobInstance)
 		{ // the actor is a L2FriendlyMobInstance
 		
 

Edited by GODLike™

Dublicate!

This is a check? or a info?

 

 

+   //if (target instanceof L2Summon)
+   //    return ((L2Summon)target).getKarma() > 0;
  • Author

 

This is a check? or a info?

+   //if (target instanceof L2Summon)
+   //    return ((L2Summon)target).getKarma() > 0;

It's info, but if you will get any error, try to add it...on of those methods working.

It's info, but if you will get any error, try to add it...on of those methods working.

There is no reason for error in this line, just i say..

Nice work..

Edited by 'Baggos'

  • Author

There is no reason for error in this line, just i say..

Nice work..

Yeah, i know.

Thank you :)

  • 1 month later...

for h5?

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.