Package npc.model

Source Code of npc.model.SnonePortalInstance

package npc.model;

import instances.AltarShilen;
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 Awakeninger
*/

public final class SnonePortalInstance extends NpcInstance {
    /**
   *
   */
  private static final long serialVersionUID = 1L;
  private static final int VullockInstance = 193;

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

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

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

Related Classes of npc.model.SnonePortalInstance

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.