, ▁and ▁the ▁presence ▁of ▁other ▁princes ▁might ▁have ▁prevent ed ▁the ▁crown ▁prince ▁from ▁f aking ▁the ▁battle . ▁After ▁a ▁long ▁wa ver ing , ▁the ▁prince ▁ordered ▁an ▁attack ▁on ▁ 1 3 ▁October . ▁Tr un aj aya ▁offered ▁a ▁real ▁battle , ▁which ▁went ▁badly ▁for ▁the ▁royal ▁army . ▁In ▁a ▁des perate ▁effort , ▁the ▁aged ▁P anger an ▁P urb aya ▁r al lied ▁the ▁troops ▁and ▁led ▁a ▁final ▁charge . ▁According ▁to ▁Thomas ▁St am ford ▁R aff les , ▁he ▁" per formed ▁extraordinary ▁fe ats ▁of ▁val our ", ▁had ▁his ▁horse ▁shot ▁under ▁him ▁and ▁continued ▁to ▁fight ▁on ▁foot , ▁before ▁he ▁was ▁over power ed ▁and ▁s lain . ▁The ▁charge ▁failed , ▁and ▁the ▁battle ▁ended ▁in ▁a ▁decis ive ▁victory ▁for ▁the ▁reb els . ▁Mat aram ▁troops ▁dis integr ated ▁and ▁retre ated , ▁along ▁with ▁the ▁Crown ▁Prince ▁and ▁other ▁princes , ▁towards ▁the ▁capital . ▁ ▁After math ▁▁ ▁After ▁the ▁re bel ▁victory , ▁J avan ese ▁defe ction ▁into ▁Tr un aj aya ' s ▁side ▁acceler ated , ▁and ▁Tr un aj aya ▁followed ▁up ▁his ▁victory ▁by ▁further ▁con quest s ▁of ▁Mat aram ' s ▁territ ories . ▁His ▁forces ▁advanced ▁west ward ▁along ▁the ▁northern ▁coast , ▁and ▁by ▁January ▁ 1 6 7 7 ▁nearly ▁all ▁of ▁Mat aram ' s ▁northern ▁coast , ▁with ▁the ▁notable ▁exception ▁of ▁Je para , ▁fell ▁into ▁his ▁hands