(a) The court shall grant appropriate relief upon affidavit that a complaint containing a notice to defend has been served and that the defendant has not filed an answer, or after a hearing or trial on the pleadings or merits.(b) Upon granting relief to the plaintiff, the court
(1) shall order that the defendant be forever barred from asserting any right, lien, title or interest in the land inconsistent with the interest or claim of the plaintiff set forth in the complaint, unless the defendant takes such action as the order directs within thirty days thereafter. If such action is not taken within the thirty-day period, the prothonotary on praecipe of the plaintiff shall enter final judgment;(2) shall enter a final judgment that a document, obligation or deed affecting a right, lien, title or interest in the land is cancelled or is valid, invalid or discharged or that a copy of a lost plan, document, obligation or deed is an authentic copy;(3) shall enter a final judgment ordering the defendant, the prothonotary, or the recorder of deeds to file, record, cancel, surrender or satisfy of record, as the case may be, any plan, document, obligation or deed determined to be valid, invalid, satisfied or discharged, and to execute and deliver any document, obligation or deed necessary to make the order effective; or(4) shall enter any other order necessary for the granting of proper relief.