Сообщений: 18
Тем: 5
Зарегистрирован: Apr 2012
Код:
public void onAction(Player player, boolean shift)
{
if(!isTargetable())
{
player.sendActionFailed();
return;
}
if(player.getTarget() != this)
{
player.setTarget(this);
if(player.getTarget() == this)
player.sendPacket(new MyTargetSelected(getObjectId(), player.getLevel() - getLevel()), makeStatusUpdate(StatusUpdate.CUR_HP, StatusUpdate.MAX_HP));
player.sendPacket(new ValidateLocation(this), ActionFail.STATIC);
return;
}
if(Events.onAction(player, this, shift))
{
player.sendActionFailed();
return;
}
if(isAutoAttackable(player))
{
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 WarehouseInstance))
{
player.sendActionFailed();
return;
}
// С NPC нельзя разговаривать мертвым и сидя
if(!Config.ALLOW_TALK_WHILE_SITTING && player.isSitting() || player.isAlikeDead())
return;
if(hasRandomAnimation())
onRandomAnimation();
player.sendActionFailed();
player.stopMove(false);
if(_isBusy)
showBusyWindow(player);
else if(isHasChatWindow())
{
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);
}
}
что мне тут прописать? ставлю пиво кто поможет