Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* 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 l2jfrozen.game.model.zone.type;
- import l2jfrozen.game.datatables.csv.MapRegionTable.TeleportWhereType;
- import l2jfrozen.game.model.L2Character;
- import l2jfrozen.game.model.actor.instance.L2PcInstance;
- import l2jfrozen.game.model.zone.L2ZoneType;
- import l2jfrozen.game.network.SystemMessageId;
- import l2jfrozen.game.network.serverpackets.SystemMessage;
- public class L2OlympiadStadiumZone extends L2ZoneType
- {
- private int _stadiumId;
- public L2OlympiadStadiumZone(final int id)
- {
- super(id);
- }
- @Override
- public void setParameter(final String name, final String value)
- {
- if (name.equals("stadiumId"))
- {
- _stadiumId = Integer.parseInt(value);
- }
- else
- super.setParameter(name, value);
- }
- @Override
- public void onEnter(final L2Character character)
- {
- character.setInsideZone(L2Character.ZONE_PVP, true);
- if (character instanceof L2PcInstance)
- {
- final L2PcInstance player = character.getActingPlayer();
- if (player.getOlympiadGameId() + 1 == getStadiumId() || player.isArenaProtection() || player.isGM())
- player.sendPacket(new SystemMessage(SystemMessageId.ENTERED_COMBAT_ZONE));
- else
- player.teleToLocation(TeleportWhereType.Town);
- }
- }
- /*public void onEnter(final L2Character character)
- {
- character.setInsideZone(L2Character.ZONE_PVP, true);
- character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, true);
- character.setInsideZone(L2Character.ZONE_NOLANDING, true);
- if (character instanceof L2PcInstance)
- {
- final L2PcInstance player = character.getActingPlayer();
- if (player.getOlympiadGameId() + 1 == getStadiumId() || player.isArenaProtection() || player.isGM())
- player.sendPacket(new SystemMessage(SystemMessageId.ENTERED_COMBAT_ZONE));
- // ((L2PcInstance) character).sendPacket(new SystemMessage(SystemMessageId.ENTERED_COMBAT_ZONE));
- if (character.charIsGM())
- {
- ((L2PcInstance) character).sendMessage("You entered to OLYMPIAD STADIUM - ID:"+getId());
- return;
- }
- }
- if (character instanceof L2PlayableInstance)
- {
- final L2PcInstance player = character.getActingPlayer();
- if (player != null)
- {
- // only participants, observers and GMs allowed
- if (!player.isGM() && !player.isInOlympiadMode())
- {
- if (character instanceof L2Summon)
- {
- ((L2Summon)character).unSummon(player);
- }
- player.teleToLocation(MapRegionTable.TeleportWhereType.Town);
- }
- }
- }
- }*/
- @Override
- protected void onExit(L2Character character)
- {
- character.setInsideZone(L2Character.ZONE_PVP, false);
- character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, false);
- character.setInsideZone(L2Character.ZONE_NOLANDING, false);
- if (character instanceof L2PcInstance)
- {
- ((L2PcInstance) character).sendPacket(new SystemMessage(SystemMessageId.LEFT_COMBAT_ZONE));
- if (character.charIsGM())
- {
- ((L2PcInstance) character).sendMessage("You left OLYMPIAD STADIUM - ID:"+getId());
- return;
- }
- }
- }
- @Override
- public void onDieInside(final L2Character character)
- {
- }
- @Override
- public void onReviveInside(final L2Character character)
- {
- }
- /**
- * Returns this zones stadium id (if any)
- * @return
- */
- public int getStadiumId()
- {
- return _stadiumId;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement