Skip to content

How to forbid to heal from a peace zone?

Featured Replies

Hello,

 

anybody knows, How to forbid to heal (If a player attempts to heal a player who is outside of a peace zone) from a peace zone?

Search in L2PcInstance

 

@Override

public void doCast(L2Skill skill)

{

 

and add after {

        	L2Object tar = L2PcInstance.this.getTarget();
        	L2PcInstance tplayer = null;
        	if (tar instanceof L2PcInstance)
        		tplayer = (L2PcInstance)tar;
		if(skill.getSkillType() == SkillType.HEAL)
		{
			if(L2PcInstance.this.isInsideZone(L2Character.ZONE_PEACE) && !tplayer.isInsideZone(L2Character.ZONE_PEACE))
			{
				L2PcInstance.this.sendMessage("Message");
				return;
			}
		}

Search in L2PcInstance

 

@Override

public void doCast(L2Skill skill)

{

 

and add after {

        	L2Object tar = L2PcInstance.this.getTarget();
        	L2PcInstance tplayer = null;
        	if (tar instanceof L2PcInstance)
        		tplayer = (L2PcInstance)tar;
		if(skill.getSkillType() == SkillType.HEAL)
		{
			if(L2PcInstance.this.isInsideZone(L2Character.ZONE_PEACE) && !tplayer.isInsideZone(L2Character.ZONE_PEACE))
			{
				L2PcInstance.this.sendMessage("Message");
				return;
			}
		}

 

I think thats better.

 

Heal.java

for (L2Character target: (L2Character[]) targets)
        {
            // We should not heal if char is dead
            if (target == null || target.isDead())
                continue;

            // We should not heal walls and door
            if(target instanceof L2DoorInstance)
            	continue;
+
+          if(activeChar.isInsideZone(L2Character.ZONE_PEACE) && !target.isInsideZone(L2Character.ZONE_PEACE))
+		continue;

I think thats better.

 

Heal.java

for (L2Character target: (L2Character[]) targets)
        {
            // We should not heal if char is dead
            if (target == null || target.isDead())
                continue;

            // We should not heal walls and door
            if(target instanceof L2DoorInstance)
            	continue;
+
+          if(activeChar.isInsideZone(L2Character.ZONE_PEACE) && !target.isInsideZone(L2Character.ZONE_PEACE))
+		continue;

Yeah..

  • Author

Thanks.

Thanks.

locked. if you have any question pm a moderator to unlock it.
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.