Script Function: Q41R

From Ultima Online: The Second Age
Jump to: navigation, search
 function int Q41R(obj user, obj usedon)
 {
   if (usedon == NULL())
   {
     return (0x00);
   }
   if (user == usedon)
   {
     systemMessage(user, "Thou can not resurrect thyself.");
     return (0x00);
   }
   if (isDead(user))
   {
     systemMessage(user, "The resurrecter must be alive.");
     return (0x00);
   }
   if (canSeeObj(user, usedon) == 0x01)
   {
     if (isPlayer(usedon))
     {
       if (!isDead(usedon))
       {
         systemMessage(user, "Target is not dead.");
         return (0x00);
       }
       loc target = getLocation(usedon);
       int Q4XW = getHeight(usedon);
       if (0x07 != canExistAt(target, Q4XW, 0x01))
       {
         systemMessage(user, "Target can not be resurrected at that location.");
         return (0x00);
       }
       loc Q671 = getLocation(user);
       if ((getDistanceInTiles(Q671, target) > 0x01) || (!Q4ZR(user, usedon)))
       {
         systemMessage(user, "Target is not close enough.");
         return (0x00);
       }
       return (0x01);
     }
     else
     {
       systemMessage(user, "Target is not a being.");
       return (0x00);
     }
   }
   else
   {
     systemMessage(user, "Target cannot be seen.");
     return (0x00);
   }
   return (0x00);
 }