Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- L2PartyZone.java
- /* L2jFrozen Project - www.l2jfrozen.com
- *
- * 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.datatables.csv.MapRegionTable;
- import com.l2jfrozen.gameserver.model.L2Character;
- import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- import com.l2jfrozen.gameserver.model.zone.L2ZoneType;
- import javolution.util.FastList;
- import com.l2jfrozen.gameserver.model.L2Party;
- public class L2PartyZone extends L2ZoneType
- {
- public L2PartyZone (int id)
- {
- super (id);
- }
- @Override
- protected void onEnter (L2Character character)
- {
- if (character instanceof L2PcInstance)
- {
- if (character.getParty()!= null)
- {
- ((L2PcInstance) character) .setIsInsidePartyZone (true);
- ((L2PcInstance) character) .sendMessage ("You have entered Party Zone. Prepare for fight.");
- }
- else
- {
- ((L2PcInstance) character) .sendMessage ("This is strict area for Party Members ONLY. You will be teleported at the nearest town.");
- ((L2PcInstance) character) .teleToLocation (MapRegionTable.TeleportWhereType.Town);
- }
- }
- }
- @Override
- protected void onExit (L2Character character)
- {
- if (character instanceof L2PcInstance)
- {
- ((L2PcInstance) character) .setIsInsidePartyZone (false);
- ((L2PcInstance) character) .sendMessage ("You have Left Party Zone.");
- }
- }
- @Override
- public void onDieInside (L2Character character)
- {
- }
- @Override
- public void onReviveInside (L2Character character)
- {
- onEnter (character);
- }
- }
- ====================================
- L2Party.Java
- ===================================
- /**
- * Remove player from party
- * @param player
- */
- public void removePartyMember(final L2PcInstance player)
- {
- removePartyMember(player, true);
- if (player.isInsideZone(L2Character.ZONE_PARTYZONE) && player.isInParty)
- {
- if(player.getPartyMembers() < 5){
- player.sendMessage("Come back when you have the proper party numbers.");
- getPartyMembers().forEach(s -> s.teleToLocation(MapRegionTable.TeleportWhereType.Town));
- return;
- }
- }else if(player.isInParty){
- player.sendMessage("You can't stay inside party zone without party!");
- player.teleToLocation(MapRegionTable.TeleportWhereType.Town);
- return;
- }
- }
Add Comment
Please, Sign In to add comment