/*
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
*/
package npc.model;
import instances.MemoryOfDisaster;
import lineage2.gameserver.model.Player;
import lineage2.gameserver.model.entity.Reflection;
import lineage2.gameserver.model.instances.NpcInstance;
import lineage2.gameserver.templates.npc.NpcTemplate;
import lineage2.gameserver.utils.ReflectionUtils;
/**
* @author Mobius
* @version $Revision: 1.0 $
*/
public class CellphineInstance extends NpcInstance
{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* Field INSTANCE_ID. (value is 200)
*/
private static final int INSTANCE_ID = 200;
/**
* Constructor for CellphineInstance.
* @param objectId int
* @param template NpcTemplate
*/
public CellphineInstance(int objectId, NpcTemplate template)
{
super(objectId, template);
}
/**
* Method onBypassFeedback.
* @param player Player
* @param command String
*/
@Override
public void onBypassFeedback(Player player, String command)
{
if (!canBypassCheck(player, this))
{
return;
}
if (command.equalsIgnoreCase("Call_Hermuncus"))
{
Reflection r = player.getActiveReflection();
if (r != null)
{
if (player.canReenterInstance(INSTANCE_ID))
{
player.teleToLocation(r.getTeleportLoc(), r);
}
}
else if (player.canEnterInstance(INSTANCE_ID))
{
ReflectionUtils.enterReflection(player, new MemoryOfDisaster(player), INSTANCE_ID);
}
else
{
showChatWindow(player, "default/33477-no.htm");
}
}
else
{
super.onBypassFeedback(player, command);
}
}
}