// If object requested does not exist, add warn msg into logs
if (obj == null)
{
// pressing e.g. pickup many times quickly would get you here
// _log.warning("Character: " + activeChar.getName() + " request action with non existent ObjectID:" + _objectId);
getClient().sendPacket(new ActionFailed());
return;
}
// Check if the target is valid, if the player haven't a shop or isn't the requester of a transaction (ex : FriendInvite, JoinAlly, JoinParty...)
if (activeChar.getPrivateStoreType()==0 && activeChar.getActiveRequester()==null)
{
switch (_actionId)
{
case 0:
obj.onAction(activeChar);
break;
case 1:
if (obj instanceof L2Character && ((L2Character)obj).isAlikeDead())
obj.onAction(activeChar);
else
obj.onActionShift(getClient());
break;
default:
// Ivalid action detected (probably client cheating), log this
_log.warning("Character: " + activeChar.getName() + " requested invalid action: " + _actionId);
getClient().sendPacket(new ActionFailed());
break;
}
}
else
// Actions prohibited when in trade
getClient().sendPacket(new ActionFailed());
}