Script Function: Q4CC

From Ultima Online: The Second Age
Jump to: navigation, search
 function int Q4CC(obj user, obj key, obj usedon)
 {
   if (!isEditing(user))
   {
     return (0x00);
   }
   list Q45K;
   if (hasObjListVar(usedon, "myhousedoors"))
   {
     getObjListVar(Q45K, usedon, "myhousedoors");
   }
   else
   {
     if (isMultiComp(usedon))
     {
       obj Q5TP = getMultiSlaveId(usedon);
       if (hasObjListVar(Q5TP, "myhousedoors"))
       {
         getObjListVar(Q45K, Q5TP, "myhousedoors");
       }
       else
       {
         Q45K = usedon;
       }
     }
     else
     {
       Q45K = usedon;
     }
   }
   setObjVar(this, "whatIUnlock", Q45K);
   string Q65V;
   barkTo(this, user, "This key now unlocks:");
   int Q669 = numInList(Q45K);
   for(int Q6A0 = 0x00; Q6A0 < Q669; Q6A0++)
   {
     obj Q65U = Q45K[Q6A0];
     Q65V = objToStr(Q65U);
     if (isValid(Q65U))
     {
       concat(Q65V, " ");
       concat(Q65V, getName(Q65U));
     }
     barkTo(this, user, Q65V);
   }
   return (0x01);
 }