Difference between revisions of "Script Function: Q5SA"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q5SA(<span style="color:#0000FF">int</span> Q5T4, <span style="color:#0000FF">obj</span> Q...")
 
 
Line 29: Line 29:
 
       <span style="color:#0000FF">if</span> ((!Q5GC) && ([[Engine Function:_getDistanceInTiles|<span style="color:#FF0000;font-weight:bold">getDistanceInTiles</span>]](Q5J4, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](user)) > 0x01) && [[Engine Function:_canSeeLoc|<span style="color:#FF0000;font-weight:bold">canSeeLoc</span>]](user, Q5CP))
 
       <span style="color:#0000FF">if</span> ((!Q5GC) && ([[Engine Function:_getDistanceInTiles|<span style="color:#FF0000;font-weight:bold">getDistanceInTiles</span>]](Q5J4, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](user)) > 0x01) && [[Engine Function:_canSeeLoc|<span style="color:#FF0000;font-weight:bold">canSeeLoc</span>]](user, Q5CP))
 
       {
 
       {
         <span style="color:#0000FF">int</span> Q5NC = [[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](user, Q5CP);
+
         <span style="color:#0000FF">int</span> Q5NC = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](user, Q5CP);
 
         <span style="color:#0000FF">return</span> (0x00 - 0x01);
 
         <span style="color:#0000FF">return</span> (0x00 - 0x01);
 
       }
 
       }

Latest revision as of 08:43, 19 October 2018

 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);
 }