Package ai

Source Code of ai.CaughtMystic

package ai;

import l2p.gameserver.ai.Mystic;
import l2p.gameserver.model.L2Character;
import l2p.gameserver.model.instances.L2NpcInstance;

public class CaughtMystic extends Mystic
{
  private static final int TIME_TO_LIVE = 60000;
  private final long TIME_TO_DIE = System.currentTimeMillis() + TIME_TO_LIVE;

  public CaughtMystic(L2Character actor)
  {
    super(actor);
  }

  @Override
  public boolean isGlobalAI()
  {
    return true;
  }

  @Override
  protected boolean thinkActive()
  {
    L2NpcInstance actor = getActor();
    if(actor != null && System.currentTimeMillis() >= TIME_TO_DIE)
    {
      actor.deleteMe();
      return false;
    }
    return super.thinkActive();
  }
}
TOP

Related Classes of ai.CaughtMystic

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.