Script Function: Q4ER

From Ultima Online: The Second Age
Revision as of 04:18, 10 October 2018 by Grimoric (talk | contribs)
Jump to: navigation, search
 function void Q4ER()
 {
   Q512 = 0x00;
   obj Q4F0;
   list Q5NK;
   int Q55R;
   int Q55Q;
   int Q4Q1;
   obj Q47G = getBackpack(Q62D);
   string name;
   string Q5M0 = "it";
   if (Q55O)
   {
     Q55O = 0x00;
     Q4F0 = createNoResObjectAt(Q5C5, getLocation(Q62D));
     transferResources(Q4F0, Q5UC, Q55S, "metal");
     name = getName(Q4F0);
     switch (Q5C5)
     {
     case 0x1053
     case 0x105D
     case 0x0F9E
     case 0x0FBC
       Q5M0 = "them";
       break;
     default
       break;
     }
     Q5IH(Q62D, Q4F0, "You create " + name + " and put " + Q5M0);
     Q4Q1 = getResource(Q55R, Q5UC, "metal", 0x03, 0x02);
   }
   else
   {
     Q4F0 = createNoResObjectAt(Q5C5, getLocation(Q62D));
     transferResources(Q4F0, Q5UC, Q55S, "wood");
     name = getName(Q4F0);
     Q5IH(Q62D, Q4F0, "You create " + name + " and put it");
     Q4Q1 = getResource(Q55R, Q5UC, "wood", 0x03, 0x02);
   }
   if (hasObjVar(this, "inUse"))
   {
     removeObjVar(this, "inUse");
   }
   if (Q55R < 0x01)
   {
     deleteObject(Q5UC);
   }
   if (Q46J(Q62D, this))
   {
     deleteObject(this);
   }
   return ();
 }
 function void Q4ER()
 {
   obj Q4F0;
   int Q52O = 0x32 - Q55S;
   obj Q64V;
   list Q5NK;
   int Q55R = Q55M - Q55S;
   int Q4Q1;
   obj Q47F = getBackpack(Q62D);
   loc location = getLocation(Q62D);
   string name = getNameByType(Q5C5);
   if (Q55N)
   {
     Q55N = 0x00;
     switch (getObjType(Q5UC))
     {
     case 0x0F95
     case 0x0F96
     case 0x0F97
     case 0x0F98
     case 0x0F99
     case 0x0F9A
     case 0x0F9B
     case 0x0F9C
       Q64V = createNoResObjectAt(0x1766, getLocation(Q62D));
       Q4F0 = createNoResObjectAt(Q5C5, getLocation(Q62D));
       sfx(location, 0x0248, 0x00);
       transferResources(Q64V, Q5UC, 0x32, "cloth");
       transferResources(Q4F0, Q64V, Q55S, "cloth");
       setHue(Q64V, Q5UA);
       setHue(Q4F0, 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.");
       }
       int Q5MS;
       int Q5MU;
       Q4Q1 = getResource(Q5MU, Q64V, "cloth", 0x03, 0x02);
       Q4Q1 = getResource(Q5MS, Q5UC, "cloth", 0x03, 0x02);
       if ((getQuantity(Q5UC) == 0x01) && (Q5MS < 0x32))
       {
         deleteObject(Q5UC);
       }
       if ((getQuantity(Q64V) == 0x01) && (Q5MU < 0x01))
       {
         deleteObject(Q64V);
       }
       break;
     default
       Q4F0 = createNoResObjectAt(Q5C5, getLocation(Q62D));
       sfx(location, 0x0248, 0x00);
       transferResources(Q4F0, Q5UC, Q55S, "cloth");
       setHue(Q4F0, Q5UA);
       if ((getQuantity(Q5UC) == 0x01) && (Q55R < 0x01))
       {
         deleteObject(Q5UC);
       }
       break;
     }
   }
   else
   {
     Q4F0 = createNoResObjectAt(Q5C5, getLocation(Q62D));
     sfx(location, 0x0248, 0x00);
     transferResources(Q4F0, Q5UC, Q55S, "leather");
     if ((getQuantity(Q5UC) == 0x01) && (Q55R < 0x01))
     {
       deleteObject(Q5UC);
     }
   }
   if (canHold(Q47F, Q4F0))
   {
     Q4Q3 = putObjContainer(Q4F0, Q47F);
     systemMessage(Q62D, "You create the " + name + " and put it in your backpack.");
   }
   else
   {
     systemMessage(Q62D, "You create the " + name + " and put it at your feet.");
   }
   if (hasObjVar(Q5UC, "inUse"))
   {
     removeObjVar(Q5UC, "inUse");
   }
   if (hasObjVar(this, "inUse"))
   {
     removeObjVar(this, "inUse");
   }
   if (Q46J(Q62D, this))
   {
     deleteObject(this);
   }
   return ();
 }