Script Function: Q5SA

From Ultima Online: The Second Age
Jump to: navigation, search
 function int Q5SA(int Q5T4, obj Q5IB, obj user)
 {
   Q4D1(Q5IB, user, "ship");
   Q662(user, 0x00);
   int Q5GC = isOnMulti(user, getMultiSlaveId(Q5IB));
   int Q50S = hasObjVar(Q5IB, "isLocked");
   int Q50Q = isEditing(user);
   if (Q50Q && Q50S && !Q5GC)
   {
     barkTo(user, user, "That is locked, but you open it with your godly powers.");
   }
   else
   {
     if (Q50S && !Q5GC)
     {
       barkTo(user, user, "That is locked.");
       return (0x00);
     }
   }
   if (Q5S2(Q5T4, getObjType(Q5IB)))
   {
     loc Q5J4 = getLocation(Q5IB);
     if (getDistanceInTiles(Q5J4, getLocation(user)) > 0x09)
     {
       return (0x00);
     }
     loc Q5CP = getLocation(Q5IB);
     setZ(Q5CP, getZ(Q5CP) + getSurfaceHeight(Q5IB));
     if ((!Q5GC) && (getDistanceInTiles(Q5J4, getLocation(user)) > 0x01) && canSeeLoc(user, Q5CP))
     {
       int Q5NC = teleport(user, Q5CP);
       return (0x00 - 0x01);
     }
     if (areObjectsOn(Q5IB))
     {
       return (0x00);
     }
   }
   Q5RZ(Q5T4, Q5IB, Q50S);
   return (0x01);
 }