Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2jFrozen_DataPack
- Index: data/zones/zone.xml
- ===================================================================
- --- data/zones/zone.xml (revision 984)
- +++ data/zones/zone.xml (working copy)
- @@ -4488,5 +4488,9 @@
- <node X="-85746" Y="-46374" />
- <node X="-85870" Y="-46233" />
- <node X="-86090" Y="-46061" />
- - </zone>
- + </zone>
- + <zone type="EnchantZone" shape="Cuboid" minZ="-3490" maxZ="-3489">
- + <node X="45500" Y="183500" />
- + <node X="50400" Y="188000" />
- + </zone>
- </list>
- \ No newline at end of file
- #P L2jFrozen_GameServer
- Index: head-src/com/l2jfrozen/gameserver/model/L2Character.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/model/L2Character.java (revision 984)
- +++ head-src/com/l2jfrozen/gameserver/model/L2Character.java (working copy)
- @@ -341,6 +341,9 @@
- /** The Constant ZONE_DANGERAREA. */
- public static final int ZONE_DANGERAREA = 16384;
- + /** The Constant ZONE_ENCHANT. */
- + public static final int ZONE_ENCHANT = 32768;
- +
- /** The _current zones. */
- private int _currentZones = 0;
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (revision 984)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (working copy)
- @@ -21,6 +21,7 @@
- import com.l2jfrozen.Config;
- import com.l2jfrozen.gameserver.model.Inventory;
- +import com.l2jfrozen.gameserver.model.L2Character;
- import com.l2jfrozen.gameserver.model.L2World;
- import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
- import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- @@ -90,6 +91,13 @@
- if(activeChar == null || _objectId == 0)
- return;
- + if (!activeChar.isInsideZone(L2Character.ZONE_ENCHANT))
- + {
- + activeChar.sendPacket(new SystemMessage(SystemMessageId.S1_S2).addString("You cannot enchant in this area."));
- + activeChar.setActiveEnchantItem(null);
- + return;
- + }
- +
- if(activeChar.getActiveTradeList() != null)
- {
- activeChar.cancelActiveTrade();
- Index: head-src/com/l2jfrozen/gameserver/model/zone/type/L2EnchantZone.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/model/zone/type/L2EnchantZone.java (revision 0)
- +++ head-src/com/l2jfrozen/gameserver/model/zone/type/L2EnchantZone.java (working copy)
- @@ -0,0 +1,53 @@
- +/* This program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation; either version 2, or (at your option)
- + * any later version.
- + *
- + * This program is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with this program; if not, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package com.l2jfrozen.gameserver.model.zone.type;
- +
- +import com.l2jfrozen.gameserver.model.L2Character;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.zone.L2ZoneType;
- +
- +public class L2EnchantZone extends L2ZoneType
- +{
- + public L2EnchantZone(final int id)
- + {
- + super(id);
- + }
- +
- + @Override
- + protected void onEnter(final L2Character character)
- + {
- + if (character instanceof L2PcInstance)
- + {
- + character.setInsideZone(L2Character.ZONE_ENCHANT, true);
- + }
- + }
- +
- + @Override
- + protected void onExit(final L2Character character)
- + {
- + if (character instanceof L2PcInstance)
- + {
- + character.setInsideZone(L2Character.ZONE_ENCHANT, false);
- + }
- + }
- +
- + @Override
- + public void onDieInside(final L2Character character) {}
- + @Override
- + public void onReviveInside(final L2Character character) {}
- +}
- Index: head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java (revision 984)
- +++ head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java (working copy)
- @@ -58,6 +58,7 @@
- import com.l2jfrozen.gameserver.model.zone.type.L2FortZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2JailZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2MotherTreeZone;
- +import com.l2jfrozen.gameserver.model.zone.type.L2EnchantZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2NoHqZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2NoLandingZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2OlympiadStadiumZone;
- @@ -278,6 +279,10 @@
- {
- temp = new L2SwampZone(zoneId);
- }
- + else if(zoneType.equals("EnchantZone"))
- + {
- + temp = new L2EnchantZone(zoneId);
- + }
- // Check for unknown type
- if(temp == null)
- Index: head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminZone.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminZone.java (revision 984)
- +++ head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminZone.java (working copy)
- @@ -88,6 +88,15 @@
- activeChar.sendMessage("This is NOT a no landing zone.");
- }
- + if(!activeChar.isInsideZone(L2Character.ZONE_ENCHANT))
- + {
- + activeChar.sendMessage("This is a enchant zone.");
- + }
- + else
- + {
- + activeChar.sendMessage("This is NOT a enchant zone.");
- + }
- +
- activeChar.sendMessage("MapRegion: x:" + MapRegionTable.getInstance().getMapRegionX(activeChar.getX()) + " y:" + MapRegionTable.getInstance().getMapRegionX(activeChar.getY()));
- activeChar.sendMessage("Closest Town: " + MapRegionTable.getInstance().getClosestTownName(activeChar));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement