Jump to content

Recommended Posts

Posted (edited)

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™
Posted

 

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.

Posted (edited)

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'
  • 1 month later...
Guest
This topic is now closed to further replies.


  • Posts

    • Upgrade your Telegram Gifts to NFT level with SOCNET! Buy Telegram Stars quickly, conveniently, and at the best prices — maybe you’ll be lucky enough to get a rare black-background model! Active SOCNET Store Links: Digital goods store (Website): Go Store Telegram bot: Go – convenient access to the store through the Telegram messenger. Telegram bot for purchasing Telegram Stars: Go – fast and profitable way to buy Telegram Stars. SMM Panel: Go – promote your social media accounts. We would like to present you with the current list of promotions and special offers for purchasing products and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website or Bot) during September! You can also use the first-time promo code SOCNET (15% discount). 2. Get $1 credited to your store balance or a 10–20% discount — just post your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — simply open a support ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly giveaways of Telegram Stars in our Telegram channel and in our Telegram bot for Star purchases! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Upgrade your Telegram Gifts to NFT level with SOCNET! Buy Telegram Stars quickly, conveniently, and at the best prices — maybe you’ll be lucky enough to get a rare black-background model! Active SOCNET Store Links: Digital goods store (Website): Go Store Telegram bot: Go – convenient access to the store through the Telegram messenger. Telegram bot for purchasing Telegram Stars: Go – fast and profitable way to buy Telegram Stars. SMM Panel: Go – promote your social media accounts. We would like to present you with the current list of promotions and special offers for purchasing products and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website or Bot) during September! You can also use the first-time promo code SOCNET (15% discount). 2. Get $1 credited to your store balance or a 10–20% discount — just post your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — simply open a support ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly giveaways of Telegram Stars in our Telegram channel and in our Telegram bot for Star purchases! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Upgrade your Telegram Gifts to NFT level with SOCNET! Buy Telegram Stars quickly, conveniently, and at the best prices — maybe you’ll be lucky enough to get a rare black-background model! Active SOCNET Store Links: Digital goods store (Website): Go Store Telegram bot: Go – convenient access to the store through the Telegram messenger. Telegram bot for purchasing Telegram Stars: Go – fast and profitable way to buy Telegram Stars. SMM Panel: Go – promote your social media accounts. We would like to present you with the current list of promotions and special offers for purchasing products and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website or Bot) during September! You can also use the first-time promo code SOCNET (15% discount). 2. Get $1 credited to your store balance or a 10–20% discount — just post your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — simply open a support ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly giveaways of Telegram Stars in our Telegram channel and in our Telegram bot for Star purchases! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock