How allow skill only in pease zone?

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
surskis
Posts: 101
Joined: Sun Jul 12, 2009 6:24 pm
Location: Lithuania

How allow skill only in pease zone?

Post by surskis »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:4425
L2JDP Revision Number:7669

I have no ideas how to make it...

Thanks in advice
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: How allow skill only in pease zone?

Post by _DS_ »

Create new condition.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
surskis
Posts: 101
Joined: Sun Jul 12, 2009 6:24 pm
Location: Lithuania

Re: How allow skill only in pease zone?

Post by surskis »

And how i can make it?
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: How allow skill only in pease zone?

Post by jurchiks »

here's one good example:
viewtopic.php?p=106310#p106310
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
surskis
Posts: 101
Joined: Sun Jul 12, 2009 6:24 pm
Location: Lithuania

Re: How allow skill only in pease zone?

Post by surskis »

Thanks jurchiks for exaple. :)
surskis
Posts: 101
Joined: Sun Jul 12, 2009 6:24 pm
Location: Lithuania

Re: How allow skill only in pease zone?

Post by surskis »

Maybe is posible make as

Code: Select all

        <cond msgId="113" addName="1">            <and>                <player SiegeZone="126" />            </and>        </cond>
but with pease zone ?
komara_23
Posts: 16
Joined: Fri Jul 16, 2010 6:15 pm

Re: How allow skill only in pease zone?

Post by komara_23 »

surskis wrote:Maybe is posible make as

Code: Select all

        <cond msgId="113" addName="1">            <and>                <player SiegeZone="126" />            </and>        </cond>
but with pease zone ?
SiegeZone="126"
change whit ID of zone where you want and you are done! ;)
surskis
Posts: 101
Joined: Sun Jul 12, 2009 6:24 pm
Location: Lithuania

Re: How allow skill only in pease zone?

Post by surskis »

what mean 126?
surskis
Posts: 101
Joined: Sun Jul 12, 2009 6:24 pm
Location: Lithuania

Re: How allow skill only in pease zone?

Post by surskis »

Who can explain to me, what 126 mean in

Code: Select all

        <cond msgId="113" addName="1">            <and>                <player SiegeZone="126" />            </and>        </cond>
User avatar
SolidSnake
Posts: 865
Joined: Wed Jan 20, 2010 6:54 pm
Location: Italy

Re: How allow skill only in pease zone?

Post by SolidSnake »

Try this patch (untested)

Code: Select all

Index: java/com/l2jserver/gameserver/model/base/PlayerState.java===================================================================--- java/com/l2jserver/gameserver/model/base/PlayerState.java   (revision 4425)+++ java/com/l2jserver/gameserver/model/base/PlayerState.java   (working copy)@@ -23,5 +23,6 @@    BEHIND,    FRONT,    CHAOTIC,-   OLYMPIAD+   OLYMPIAD,+   PEACEZONE }Index: java/com/l2jserver/gameserver/skills/DocumentBase.java===================================================================--- java/com/l2jserver/gameserver/skills/DocumentBase.java  (revision 4425)+++ java/com/l2jserver/gameserver/skills/DocumentBase.java  (working copy)@@ -534,6 +534,11 @@                boolean val = Boolean.valueOf(a.getNodeValue());                cond = joinAnd(cond, new ConditionPlayerState(PlayerState.OLYMPIAD, val));            }+           else if ("peacezone".equalsIgnoreCase(a.getNodeName()))+           {+               boolean val = Boolean.valueOf(a.getNodeValue());+               cond = joinAnd(cond, new ConditionPlayerState(PlayerState.PEACEZONE, val));+           }            else if ("ishero".equalsIgnoreCase(a.getNodeName()))            {                boolean val = Boolean.valueOf(a.getNodeValue());Index: java/com/l2jserver/gameserver/skills/conditions/ConditionPlayerState.java===================================================================--- java/com/l2jserver/gameserver/skills/conditions/ConditionPlayerState.java   (revision 4425)+++ java/com/l2jserver/gameserver/skills/conditions/ConditionPlayerState.java   (working copy)@@ -74,6 +74,11 @@                if (player != null)                    return player.isInOlympiadMode() == _required;                return !_required;+           case PEACEZONE:+               player = env.player.getActingPlayer();+               if (player != null)+                   return isInsidePeaceZone(player) == _required;+               return !_required;        }        return !_required;    }
Then add this

Code: Select all

       <cond>           <player peacezone="true" />       </cond>
Should allow your skills only in peace zone..
Image
surskis
Posts: 101
Joined: Sun Jul 12, 2009 6:24 pm
Location: Lithuania

Re: How allow skill only in pease zone?

Post by surskis »

Not works :(
User avatar
SolidSnake
Posts: 865
Joined: Wed Jan 20, 2010 6:54 pm
Location: Italy

Re: How allow skill only in pease zone?

Post by SolidSnake »

Ops, my fault.. here the right patch

Code: Select all

Index: java/com/l2jserver/gameserver/model/base/PlayerState.java===================================================================--- java/com/l2jserver/gameserver/model/base/PlayerState.java   (revision 4425)+++ java/com/l2jserver/gameserver/model/base/PlayerState.java   (working copy)@@ -23,5 +23,6 @@    BEHIND,    FRONT,    CHAOTIC,-   OLYMPIAD+   OLYMPIAD,+   PEACEZONE }Index: java/com/l2jserver/gameserver/skills/DocumentBase.java===================================================================--- java/com/l2jserver/gameserver/skills/DocumentBase.java  (revision 4425)+++ java/com/l2jserver/gameserver/skills/DocumentBase.java  (working copy)@@ -534,6 +534,11 @@                boolean val = Boolean.valueOf(a.getNodeValue());                cond = joinAnd(cond, new ConditionPlayerState(PlayerState.OLYMPIAD, val));            }+           else if ("peacezone".equalsIgnoreCase(a.getNodeName()))+           {+               boolean val = Boolean.valueOf(a.getNodeValue());+               cond = joinAnd(cond, new ConditionPlayerState(PlayerState.PEACEZONE, val));+           }            else if ("ishero".equalsIgnoreCase(a.getNodeName()))            {                boolean val = Boolean.valueOf(a.getNodeValue());Index: java/com/l2jserver/gameserver/skills/conditions/ConditionPlayerState.java===================================================================--- java/com/l2jserver/gameserver/skills/conditions/ConditionPlayerState.java   (revision 4425)+++ java/com/l2jserver/gameserver/skills/conditions/ConditionPlayerState.java   (working copy)@@ -14,6 +14,7 @@  */ package com.l2jserver.gameserver.skills.conditions; +import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.base.PlayerState; import com.l2jserver.gameserver.skills.Env;@@ -74,6 +75,11 @@                if (player != null)                    return player.isInOlympiadMode() == _required;                return !_required;+           case PEACEZONE:+               player = env.player.getActingPlayer();+               if (player != null)+                   return player.isInsideZone(L2Character.ZONE_PEACE) == _required;+               return !_required;        }        return !_required;    }
Then add this

Code: Select all

        <cond msgId="2208">            <player peacezone="true" />        </cond>
Image
surskis
Posts: 101
Joined: Sun Jul 12, 2009 6:24 pm
Location: Lithuania

Re: How allow skill only in pease zone?

Post by surskis »

Thanks! all works fine :)
darknessneo
Posts: 196
Joined: Mon Apr 26, 2010 11:00 pm

Re: How allow skill only in pease zone?

Post by darknessneo »

wow, exactly what i needed. Thx alot :P
Post Reply