{
player.setTarget(this);
player.sendPacket(new MyTargetSelected(getObjectId(), 0));
if (player != this)
{
player.sendPacket(new ValidateLocation(this));
// To be sure update also the pvp flag / war tag status
if (!player.inObserverMode())
this.broadcastUserInfo();
}
}
else
{
AdminEditChar.gatherCharacterInfo(player, this, "charinfo.htm");
}
}
else
// Like L2OFF set the target of the L2PcInstance player
{
if (((TvT.is_started() || TvT.is_teleport()) && !Config.TVT_ALLOW_INTERFERENCE) || ((CTF.is_started() || CTF.is_teleport()) && !Config.CTF_ALLOW_INTERFERENCE) || ((DM.is_started() || DM.is_teleport()) && !Config.DM_ALLOW_INTERFERENCE))
{
if ((_inEventTvT && !player._inEventTvT) || (!_inEventTvT && player._inEventTvT))
{
player.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
else if ((_inEventCTF && !player._inEventCTF) || (!_inEventCTF && player._inEventCTF))
{
player.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
else if ((_inEventDM && !player._inEventDM) || (!_inEventDM && player._inEventDM))
{
player.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
}
// Check if the L2PcInstance is confused
if (player.isOutOfControl())
{
// Send a Server->Client packet ActionFailed to the player
player.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
// Check if the player already target this L2PcInstance
if (player.getTarget() != this)
{
// Set the target of the player
player.setTarget(this);
// Send a Server->Client packet MyTargetSelected to the player
// The color to display in the select window is White
player.sendPacket(new MyTargetSelected(getObjectId(), 0));
if (player != this)
{
player.sendPacket(new ValidateLocation(this));
}
}
else
{
if (player != this)
{
player.sendPacket(new ValidateLocation(this));
}
// Check if this L2PcInstance has a Private Store
if (getPrivateStoreType() != 0)
{
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT