A recovery may be had in the action by any party against a defendant personally served or who has appeared, or against the plaintiff, for the value of the use and occupation of the premises and for the value of the property wasted or removed therefrom, in the case of a vendor holding over, or a trespasser, as well as in a case in which the relation of vendor and vendee has existed. If such recovery is desired by the plaintiff, the plaintiff shall allege the fact, stating particularly the value of the use and occupation, the value of the property wasted or removed, and the value of the real property aside from the waste or removal, and shall demand appropriate relief in the complaint. A recovery of possession also may be had by the plaintiff or any defendant asking for affirmative relief.
N.D.C.C. § 32-17-02