Script Function: Q4OV

From Ultima Online: The Second Age
Revision as of 04:17, 10 October 2018 by Grimoric (talk | contribs) (Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q4OV() { <span style="color:#0000FF">obj</span> Q64V; <span style="color:#0000F...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 function void Q4OV()
 {
   obj Q64V;
   int Q66X;
   int Q5TD;
   int Q5HM;
   int Q52N;
   list Q5NK;
   int Q55R = Q55M - Q55S;
   int Q4Q1;
   obj Q47F = getBackpack(Q62D);
   loc location = getLocation(Q62D);
   string Q615;
   Q615 = "cloth";
   Q66X = (getSkillLevelReal(Q62D, 0x22) / 0x64);
   switch (Q66X)
   {
   case 0x0A
   case 0x09
   case 0x08
     Q5TD = 0x04;
     break;
   case 0x07
   case 0x06
   case 0x05
   case 0x04
     Q5TD = 0x02;
     break;
   default
     Q5TD = 0x01;
     break;
   }
   Q5HM = (Q55S / Q5TD) - (random(0x00, (Q55S / Q5TD)));
   if (hasObjVar(this, "inUse"))
   {
     removeObjVar(this, "inUse");
   }
   switch (getObjType(Q5UC))
   {
   case 0x0F95
   case 0x0F96
   case 0x0F97
   case 0x0F98
   case 0x0F99
   case 0x0F9A
   case 0x0F9B
   case 0x0F9C
     Q52N = 0x32 - Q5HM;
     Q64V = createNoResObjectAt(0x1766, getLocation(Q62D));
     transferResources(Q64V, Q5UC, Q52N, "cloth");
     setHue(Q64V, Q5UA);
     if (canHold(Q47F, Q64V))
     {
       int Q4Q3 = putObjContainer(Q64V, Q47F);
       systemMessage(Q62D, "You place the left-over cloth pieces into your backpack");
     }
     else
     {
       systemMessage(Q62D, "You place the left over cloth pieces at your feet.");
     }
     systemMessage(Q62D, "Tailoring failed. Some of the cloth is ruined.");
     int Q5MS;
     Q4Q1 = getResource(Q5MS, Q5UC, "cloth", 0x03, 0x02);
     if ((getQuantity(Q5UC) == 0x01) && (Q5MS < 0x32))
     {
       deleteObject(Q5UC);
     }
     break;
   case 0x175D
   case 0x175E
   case 0x175F
   case 0x1760
   case 0x1761
   case 0x1762
   case 0x1763
   case 0x1764
   case 0x1765
   case 0x1766
   case 0x1767
   case 0x1768
     systemMessage(Q62D, "Tailoring failed. Some of the cloth is ruined.");
     returnResourcesToBank(Q5UC, Q5HM, "cloth");
     break;
   case 0x1067
   case 0x1068
   case 0x1081
   case 0x1082
   case 0x1078
   case 0x1079
     systemMessage(Q62D, "Tailoring failed. Some of the leather is ruined.");
     returnResourcesToBank(Q5UC, Q5HM, "leather");
     break;
   }
   Q4Q1 = getResource(Q5MS, Q5UC, Q615, 0x03, 0x02);
   if ((getQuantity(Q5UC) == 0x01) && (Q5MS < 0x01))
   {
     deleteObject(Q5UC);
   }
   return ();
 }