Script Function: Q49V

From Ultima Online: The Second Age
Jump to: navigation, search
 function int Q49V(obj Q5KD, obj Q5KC, int Q5NM)
 {
   obj user = Q5KD;
   obj usedon = Q5KC;
   if (Q5NM)
   {
     user = Q5KC;
     usedon = Q5KD;
   }
   if (usedon == NULL())
   {
     return (0x00);
   }
   if (Q5KC != NULL())
   {
     if (getTopmostContainer(Q5KC) != Q5KD)
     {
       if (!canSeeObj(user, usedon))
       {
         systemMessage(user, "Target can not be seen.");
         return (0x00);
       }
       if (getDistanceInTiles(getLocation(user), getLocation(usedon)) > 0x0C)
       {
         systemMessage(user, "Target is too far away.");
         return (0x00);
       }
     }
   }
   return (0x01);
 }