Jump to content
  • 0

How to forbid to heal from a peace zone?


FewG

Question

5 answers to this question

Recommended Posts

  • 0

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

Link to comment
Share on other sites

  • 0

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;

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...