Попробуй поставить сюда-
Код:
@Override
public void onAction(L2Player player, boolean shift)
{
if(player.getTarget() != this)
{
player.setTarget(this);
if(player.getTarget() == this)
{
player.sendPacket(new MyTargetSelected(getObjectId(), player.getLevel() - getLevel()));
if(isAutoAttackable(player))
{
player.teleToLocation(147451, 46728, -3410, 0);
player.sendPacket(makeStatusUpdate(StatusUpdate.CUR_HP, StatusUpdate.MAX_HP));
}
}
player.sendPacket(new ValidateLocation(this), Msg.ActionFail);
return;
}
if(Events.onAction(player, this, shift))
{
player.sendActionFailed();
return;
}
if(isAutoAttackable(player))
{
player.teleToLocation(147451, 46728, -3410, 0);
player.getAI().Attack(this, false, shift);
return;
}
if(!isInRange(player, INTERACTION_DISTANCE))
{
if(player.getAI().getIntention() != CtrlIntention.AI_INTENTION_INTERACT)
player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this, null);
return;
}
if(!Config.ALT_GAME_KARMA_PLAYER_CAN_SHOP && player.getKarma() < 0 && !player.isGM() && !(this instanceof L2WarehouseInstance || this instanceof L2ResidenceManager || this instanceof L2ClanHallDoormenInstance || this instanceof L2CastleDoormenInstance || this instanceof L2FortressDoormenInstance))
{
player.sendActionFailed();
return;
}
// С NPC нельзя разговаривать мертвым и сидя
if(!Config.ALLOW_TALK_WHILE_SITTING && player.isSitting() || player.isAlikeDead())
return;
if(System.currentTimeMillis() - _lastSocialAction > 10000 && !getTemplate().getAIParams().getBool("randomAnimationDisabled", false))
{
broadcastPacket(new SocialAction(getObjectId(), 2));
_lastSocialAction = System.currentTimeMillis();
}
player.sendActionFailed();
player.stopMove(false);
if(isAutoAttackable(player))
{
player.teleToLocation(147451, 46728, -3410, 0);
}
if(_isBusy)
showBusyWindow(player);
else if(hasChatWindow)
{
boolean flag = false;
Quest[] qlst = getTemplate().getEventQuests(QuestEventType.NPC_FIRST_TALK);
if(qlst != null && qlst.length > 0)
for(Quest element : qlst)
{
QuestState qs = player.getQuestState(element.getName());
if((qs == null || !qs.isCompleted()) && element.notifyFirstTalk(this, player))
flag = true;
}
if(!flag)
showChatWindow(player, 0);
}
}