示例#1
0
        public override void run()
        {
            L2Player player = getClient().CurrentPlayer;

            if (player._p_block_act == 1)
            {
                player.sendActionFailed();
                return;
            }

            L2Object obj = null;

            if (_objectId == player.ObjID)
            {
                player.sendSystemMessage(51);//You cannot use this on yourself.
                player.sendActionFailed();
                return;
            }
            else
            {
                obj = player.knownObjects[_objectId];
            }

            if (obj == null)
            {
                player.sendActionFailed();
                return;
            }

            //if (obj is L2Citizen)
            //{
            //    if (((L2Citizen)obj).Template._can_be_attacked == 0)
            //    {
            //        player.sendSystemMessage(144);//That is the incorrect target.
            //        player.sendActionFailed();
            //        return;
            //    }
            //}

            obj.onForcedAttack(player);
        }