Script Function: Q4Z0

From Ultima Online: The Second Age
Revision as of 17:46, 7 October 2018 by Grimoric (talk | contribs) (Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q4Z0(<span style="color:#0000FF">obj</span> t) { <span style="color:#0000FF">if</spa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 function int Q4Z0(obj t)
 {
   if (hasObjVar(t, <span style="color:#800000">"isLocked"</span>))
   {
     barkTo(Q4SD(), Q4SD(), <span style="color:#800000">"Locked items may not be made not-for-sale."</span>);
     return (0x01);
   }
   if (isContainer(t))
   {
     if (!isRealContainer(t))
     {
       switch (getObjType(t))
       {
       case 0x0EFA
       case 0x0E3B
         break;
       default
         return (0x01);
       }
     }
     else
     {
       list Q4E4;
       getContents(Q4E4, t);
       for(int i = numInList(Q4E4); i; i--)
       {
         if ((!hasScript(Q4E4[0x00], <span style="color:#800000">"vended"</span>)) || ((!hasObjVar(Q4E4[0x00], <span style="color:#800000">"vendedPrice"</span>))))
         {
           if (!Q4Z0(Q4E4[0x00]))
           {
             barkTo(Q4SD(), Q4SD(), <span style="color:#800000">"To be not for sale, all contents of a container must be for sale."</span>);
             return (0x00);
           }
         }
         removeItem(Q4E4, 0x00);
       }
     }
     return (0x01);
   }
   if (Q4YS(t))
   {
     return (0x01);
   }
   obj Q47J = containedBy(t);
   if (!isValid(Q47J))
   {
     bark(Q4SD(), <span style="color:#800000">"It's not in a container."</span>);
     return (0x00);
   }
   if (hasObjVar(Q47J, <span style="color:#800000">"vendedPrice"</span>))
   {
     return (0x01);
   }
   barkTo(Q4SD(), Q4SD(), <span style="color:#800000">"Only the following items may be made not-for-sale: books, containers, keyrings, and items in a for-sale container."</span>);
   return (0x00);
 }