Returns character direction(0-7) Total we have 8 directions in UO: North, NorthEast, East,SouthEast, South, SouthWest, West,NorthWest. NB: Keep in mind, than 0 can be real direction, but also can be default value for non-conected character

Pascal Syntax:

function GetDirection(ObjID : Cardinal) : Byte;

Pascal Example:

Procedure PreslPet;
  If Dpet=0 then newmoveXY((getX(Pet)+1),(gety(Pet)+1),True,1,True);
  If Dpet=1 then newmoveXY(getX(Pet),(gety(Pet)+1),True,1,True);
  If Dpet=2 then newmoveXY((getX(Pet)-1),(gety(Pet)+1),True,1,True);
  If Dpet=3 then newmoveXY((getX(Pet)-1),gety(Pet),True,1,True);
  If Dpet=4 then newmoveXY((getX(Pet)-1),(gety(Pet)-1),True,1,True);
  If Dpet=5 then newmoveXY(getX(Pet),(gety(Pet)-1),True,1,True);
  If Dpet=6 then newmoveXY((getX(Pet)+1),(gety(Pet)-1),True,1,True);
  If Dpet=7 then newmoveXY(getX(Pet),(gety(Pet)+1),True,1,True);  

Python Syntax:

def GetDirection(ObjID): --> ubyte