Script Function: Q4P5

From Ultima Online: The Second Age
Jump to: navigation, search
 function void Q4P5(obj Q4NO, obj user)
 {
   int Q4Q1;
   Q4R3 = 0x00;
   obj Q47F = getBackpack(user);
   int Q5K1 = Q5K3[0x00];
   string Q5ZC = Q5K3[0x01];
   string Q5JZ;
   if (Q50N(Q5ZC[0x00]))
   {
     Q5JZ = "an ";
   }
   else
   {
     Q5JZ = "a ";
   }
   concat(Q5JZ, Q5ZC);
   concat(Q5JZ, " potion");
   obj Q5C7 = createGlobalObjectOn(Q4NO, Q5K1);
   if ((getQuantity(Q4NO) > 0x01) && (!isInContainer(Q4NO)))
   {
     if (canHold(Q47F, Q4NO))
     {
       Q4Q1 = putObjContainer(Q4NO, Q47F);
       systemMessage(user, "You put the remaining empty bottles in to your backpack.");
     }
     else
     {
       Q4Q1 = teleport(Q4NO, getLocation(user));
       systemMessage(user, "You put the remaining empty bottles at your feet.");
     }
   }
   int Q5K0 = Q5JY[0x02];
   setObjVar(Q5C7, "power", Q5K0);
   Q5RE(Q5C7, Q5JZ);
   string Q5OM = Q5JY[0x03];
   if (Q5OM == "")
   {
     Q5OM = Q5K1;
   }
   attachScript(Q5C7, Q5OM);
   destroyOne(Q4NO);
   return ();
 }