Jump to content
  • 0

How to forbid to heal from a peace zone?


Question

Posted

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?

5 answers to this question

Recommended Posts

  • 0
Posted

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;
			}
		}

  • 0
Posted

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;

  • 0
Posted

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

Guest
This topic is now closed to further replies.


×
×
  • Create New...