Jump to content
  • 0

Npc Protect town


Question

Posted

Hi guys, is may possible to make that the guard protect the city if characters come inside with weapons? Ineed that for a king of server. like uppen in Monastry of Silence that if you have a weapon mobs attacks you... i hope for a prompt reply.  :)

3 answers to this question

Recommended Posts

  • 0
Posted

Moved to the correct section.

 

I guess you can add something like:

 

### Eclipse Workspace Patch 1.0
#P L2J_Server
Index: java/com/l2jserver/gameserver/ai/L2AttackableAI.java
===================================================================
--- java/com/l2jserver/gameserver/ai/L2AttackableAI.java	(revision 5822)
+++ java/com/l2jserver/gameserver/ai/L2AttackableAI.java	(working copy)
@@ -49,6 +49,7 @@
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate.AIType;
import com.l2jserver.gameserver.model.effects.L2EffectType;
+import com.l2jserver.gameserver.model.itemcontainer.Inventory;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.Quest.QuestEventType;
import com.l2jserver.gameserver.model.skills.L2Skill;
@@ -208,7 +209,7 @@
		if (me instanceof L2GuardInstance)
		{
			// Check if the L2PcInstance target has karma (=PK)
-			if ((player != null) && player.getKarma() > 0)
+			if ((player != null) && (player.getKarma() > 0 || player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) != null))
			{
				return GeoData.getInstance().canSeeTarget(me, player); // Los Check
			}

  • 0
Posted

i think that is for pk player, but i need it for a non flagged player also

Nope, it shouldn't be. Could u just test it? >_<

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


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