Package npc.model

Source Code of npc.model.SpezionNpcInstance

package npc.model;

import instances.SpezionNormal;

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 cruel
*/
public final class SpezionNpcInstance extends NpcInstance
{
  /**
   *
   */
  private static final long serialVersionUID = 1L;

  public SpezionNpcInstance(int objectId, NpcTemplate template)
  {
    super(objectId, template);
  }

  @Override
  public void onBypassFeedback(Player player, String command)
  {
    if(!canBypassCheck(player, this))
      return;

    if(command.equalsIgnoreCase("normal_spezion"))
    {
      Reflection r = player.getActiveReflection();
      if(r != null)
      {
        if(player.canReenterInstance(159))
          player.teleToLocation(r.getTeleportLoc(), r);
      }
      else if(player.canEnterInstance(159))
        ReflectionUtils.enterReflection(player, new SpezionNormal(), 159);
    }
    else
      super.onBypassFeedback(player, command);
  }
}
TOP

Related Classes of npc.model.SpezionNpcInstance

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.