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
			}

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

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