Script Function: Q51S

From Ultima Online: The Second Age
Jump to: navigation, search
 function void Q51S(obj Q5NV, int add)
 {
   int Q65M = getObjType(Q5NV);
   list Q4E4;
   getContents(Q4E4, Q5NV);
   int num = numInList(Q4E4);
   num = num + add;
   int newtype;
   if (num < 0x00)
   {
     newtype = 0x1011;
   }
   else
   {
     switch (num)
     {
     case 0x00
       newtype = 0x1011;
       break;
     case 0x01
     case 0x02
       newtype = 0x1769;
       break;
     case 0x03
     case 0x04
       newtype = 0x176A;
       break;
     default
       newtype = 0x176B;
       break;
     }
   }
   if (Q65M != newtype)
   {
     setType(Q5NV, newtype);
   }
   return;
 }