Added a chat code conversion function. Fixed an issue with target x y.