/**
* Method thinkFollow.
*/
protected void thinkFollow()
{
final NpcInstance actor = getActor();
final Creature target = actor.getFollowTarget();
if ((target == null) || target.isAlikeDead() || (actor.getDistance(target) > 4000) || actor.isMovementDisabled())
{
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
return;
}
if (actor.isFollow && (actor.getFollowTarget().equals(target)))
{
clientActionFailed();
return;
}
if (actor.isInRange(target, Config.FOLLOW_RANGE + 20))
{
clientActionFailed();
}
if (_followTask != null)
{
_followTask.cancel(false);
_followTask = null;
}
_followTask = ThreadPoolManager.getInstance().schedule(new ThinkFollow(), 250L);
final Reflection ref = actor.getReflection();
if ((ref != null) && (_chatTimer < System.currentTimeMillis()))
{
_chatTimer = System.currentTimeMillis() + 5000;
final Player masterplayer = target.getPlayer();
final Map<Skill, Integer> d_skill = new HashMap<>();
final double distance = actor.getDistance(target);
switch (ref.getInstancedZoneId())
{
case 156:
final QuestState qs = masterplayer.getQuestState(_10293_SevenSignsForbiddenBook.class);
if ((qs != null) && !qs.isCompleted())