Difference between revisions of "Script Function: Q4ER"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q4ER() { Q512 = 0x00; <span style="color:#0000FF">obj</span> Q4F0; <span st...")
 
 
(2 intermediate revisions by the same user not shown)
Line 46: Line 46:
 
       [[Engine Function:_deleteObject|<span style="color:#FF0000;font-weight:bold">deleteObject</span>]](Q5UC);
 
       [[Engine Function:_deleteObject|<span style="color:#FF0000;font-weight:bold">deleteObject</span>]](Q5UC);
 
     }
 
     }
 +
    <span style="color:#0000FF">if</span> ([[Script_Function:_Q46J|<span style="color:#2B91AF">Q46J</span>]](Q62D, this))
 +
    {
 +
      [[Engine Function:_deleteObject|<span style="color:#FF0000;font-weight:bold">deleteObject</span>]](this);
 +
    }
 +
    <span style="color:#0000FF">return</span> ();
 +
  }
 +
 +
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q4ER()
 +
  {
 +
    <span style="color:#0000FF">obj</span> Q4F0;
 +
    <span style="color:#0000FF">int</span> Q52O = 0x32 - Q55S;
 +
    <span style="color:#0000FF">obj</span> Q64V;
 +
    <span style="color:#0000FF">list</span> Q5NK;
 +
    <span style="color:#0000FF">int</span> Q55R = Q55M - Q55S;
 +
    <span style="color:#0000FF">int</span> Q4Q1;
 +
    <span style="color:#0000FF">obj</span> Q47F = [[Engine Function:_getBackpack|<span style="color:#FF0000;font-weight:bold">getBackpack</span>]](Q62D);
 +
    <span style="color:#0000FF">loc</span> location = [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q62D);
 +
    <span style="color:#0000FF">string</span> name = [[Engine Function:_getNameByType|<span style="color:#FF0000;font-weight:bold">getNameByType</span>]](Q5C5);
 +
    <span style="color:#0000FF">if</span> (Q55N)
 +
    {
 +
      Q55N = 0x00;
 +
      <span style="color:#0000FF">switch</span> ([[Engine Function:_getObjType|<span style="color:#FF0000;font-weight:bold">getObjType</span>]](Q5UC))
 +
      {
 +
      <span style="color:#0000FF">case</span> 0x0F95
 +
      <span style="color:#0000FF">case</span> 0x0F96
 +
      <span style="color:#0000FF">case</span> 0x0F97
 +
      <span style="color:#0000FF">case</span> 0x0F98
 +
      <span style="color:#0000FF">case</span> 0x0F99
 +
      <span style="color:#0000FF">case</span> 0x0F9A
 +
      <span style="color:#0000FF">case</span> 0x0F9B
 +
      <span style="color:#0000FF">case</span> 0x0F9C
 +
        Q64V = [[Engine Function:_createNoResObjectAt|<span style="color:#FF0000;font-weight:bold">createNoResObjectAt</span>]](0x1766, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q62D));
 +
        Q4F0 = [[Engine Function:_createNoResObjectAt|<span style="color:#FF0000;font-weight:bold">createNoResObjectAt</span>]](Q5C5, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q62D));
 +
        sfx(location, 0x0248, 0x00);
 +
        [[Engine Function:_transferResources|<span style="color:#FF0000;font-weight:bold">transferResources</span>]](Q64V, Q5UC, 0x32, <span style="color:#800000">"cloth"</span>);
 +
        [[Engine Function:_transferResources|<span style="color:#FF0000;font-weight:bold">transferResources</span>]](Q4F0, Q64V, Q55S, <span style="color:#800000">"cloth"</span>);
 +
        [[Engine Function:_setHue|<span style="color:#FF0000;font-weight:bold">setHue</span>]](Q64V, Q5UA);
 +
        [[Engine Function:_setHue|<span style="color:#FF0000;font-weight:bold">setHue</span>]](Q4F0, Q5UA);
 +
        <span style="color:#0000FF">if</span> ([[Engine Function:_canHold|<span style="color:#FF0000;font-weight:bold">canHold</span>]](Q47F, Q64V))
 +
        {
 +
          <span style="color:#0000FF">int</span> Q4Q3 = [[Engine Function:_putObjContainer|<span style="color:#FF0000;font-weight:bold">putObjContainer</span>]](Q64V, Q47F);
 +
          [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](Q62D, <span style="color:#800000">"You place the left-over cloth pieces into your backpack"</span>);
 +
        }
 +
        <span style="color:#0000FF">else</span>
 +
        {
 +
          [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](Q62D, <span style="color:#800000">"You place the left over cloth pieces at your feet."</span>);
 +
        }
 +
        <span style="color:#0000FF">int</span> Q5MS;
 +
        <span style="color:#0000FF">int</span> Q5MU;
 +
        Q4Q1 = [[Engine Function:_getResource|<span style="color:#FF0000;font-weight:bold">getResource</span>]](Q5MU, Q64V, <span style="color:#800000">"cloth"</span>, 0x03, 0x02);
 +
        Q4Q1 = [[Engine Function:_getResource|<span style="color:#FF0000;font-weight:bold">getResource</span>]](Q5MS, Q5UC, <span style="color:#800000">"cloth"</span>, 0x03, 0x02);
 +
        <span style="color:#0000FF">if</span> (([[Engine Function:_getQuantity|<span style="color:#FF0000;font-weight:bold">getQuantity</span>]](Q5UC) == 0x01) && (Q5MS < 0x32))
 +
        {
 +
          [[Engine Function:_deleteObject|<span style="color:#FF0000;font-weight:bold">deleteObject</span>]](Q5UC);
 +
        }
 +
        <span style="color:#0000FF">if</span> (([[Engine Function:_getQuantity|<span style="color:#FF0000;font-weight:bold">getQuantity</span>]](Q64V) == 0x01) && (Q5MU < 0x01))
 +
        {
 +
          [[Engine Function:_deleteObject|<span style="color:#FF0000;font-weight:bold">deleteObject</span>]](Q64V);
 +
        }
 +
        <span style="color:#0000FF">break</span>;
 +
      <span style="color:#0000FF">default</span>
 +
        Q4F0 = [[Engine Function:_createNoResObjectAt|<span style="color:#FF0000;font-weight:bold">createNoResObjectAt</span>]](Q5C5, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q62D));
 +
        sfx(location, 0x0248, 0x00);
 +
        [[Engine Function:_transferResources|<span style="color:#FF0000;font-weight:bold">transferResources</span>]](Q4F0, Q5UC, Q55S, <span style="color:#800000">"cloth"</span>);
 +
        [[Engine Function:_setHue|<span style="color:#FF0000;font-weight:bold">setHue</span>]](Q4F0, Q5UA);
 +
        <span style="color:#0000FF">if</span> (([[Engine Function:_getQuantity|<span style="color:#FF0000;font-weight:bold">getQuantity</span>]](Q5UC) == 0x01) && (Q55R < 0x01))
 +
        {
 +
          [[Engine Function:_deleteObject|<span style="color:#FF0000;font-weight:bold">deleteObject</span>]](Q5UC);
 +
        }
 +
        <span style="color:#0000FF">break</span>;
 +
      }
 +
    }
 +
    <span style="color:#0000FF">else</span>
 +
    {
 +
      Q4F0 = [[Engine Function:_createNoResObjectAt|<span style="color:#FF0000;font-weight:bold">createNoResObjectAt</span>]](Q5C5, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q62D));
 +
      sfx(location, 0x0248, 0x00);
 +
      [[Engine Function:_transferResources|<span style="color:#FF0000;font-weight:bold">transferResources</span>]](Q4F0, Q5UC, Q55S, <span style="color:#800000">"leather"</span>);
 +
      <span style="color:#0000FF">if</span> (([[Engine Function:_getQuantity|<span style="color:#FF0000;font-weight:bold">getQuantity</span>]](Q5UC) == 0x01) && (Q55R < 0x01))
 +
      {
 +
        [[Engine Function:_deleteObject|<span style="color:#FF0000;font-weight:bold">deleteObject</span>]](Q5UC);
 +
      }
 +
    }
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_canHold|<span style="color:#FF0000;font-weight:bold">canHold</span>]](Q47F, Q4F0))
 +
    {
 +
      Q4Q3 = [[Engine Function:_putObjContainer|<span style="color:#FF0000;font-weight:bold">putObjContainer</span>]](Q4F0, Q47F);
 +
      [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](Q62D, <span style="color:#800000">"You create the "</span> + name + <span style="color:#800000">" and put it in your backpack."</span>);
 +
    }
 +
    <span style="color:#0000FF">else</span>
 +
    {
 +
      [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](Q62D, <span style="color:#800000">"You create the "</span> + name + <span style="color:#800000">" and put it at your feet."</span>);
 +
    }
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](Q5UC, <span style="color:#800000">"inUse"</span>))
 +
    {
 +
      [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](Q5UC, <span style="color:#800000">"inUse"</span>);
 +
    }
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"inUse"</span>))
 +
    {
 +
      [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"inUse"</span>);
 +
    }
 +
    <span style="color:#0000FF">if</span> ([[Script_Function:_Q46J|<span style="color:#2B91AF">Q46J</span>]](Q62D, this))
 +
    {
 +
      [[Engine Function:_deleteObject|<span style="color:#FF0000;font-weight:bold">deleteObject</span>]](this);
 +
    }
 +
    <span style="color:#0000FF">return</span> ();
 +
  }
 +
 +
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q4ER()
 +
  {
 +
    <span style="color:#0000FF">int</span> Q4Q1;
 +
    <span style="color:#0000FF">int</span> Q56Z = [[Script_Function:_Q4TF|<span style="color:#2B91AF">Q4TF</span>]](Q62D);
 +
    <span style="color:#0000FF">int</span> Q5NY = Q5NZ[0x00];
 +
    <span style="color:#0000FF">int</span> Q573 = [[Engine Function:_getArrayIntElem|<span style="color:#FF0000;font-weight:bold">getArrayIntElem</span>]](0x00, 0x04, Q5NY);
 +
    <span style="color:#0000FF">if</span> (Q573 > Q56Z)
 +
    {
 +
      [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](Q62D, <span style="color:#800000">"The amount of metal changed since you started smithing the ingots."</span>);
 +
      [[Script_Function:_Cleanup|<span style="color:#2B91AF">cleanup</span>]]();
 +
      <span style="color:#0000FF">return</span> ();
 +
    }
 +
    <span style="color:#0000FF">int</span> newType = [[Engine Function:_getArrayIntElem|<span style="color:#FF0000;font-weight:bold">getArrayIntElem</span>]](0x00, 0x00, Q5NY);
 +
    <span style="color:#0000FF">int</span> success = [[Engine Function:_testAndLearnSkill|<span style="color:#FF0000;font-weight:bold">testAndLearnSkill</span>]](Q62D, 0x07, [[Engine Function:_getArrayIntElem|<span style="color:#FF0000;font-weight:bold">getArrayIntElem</span>]](0x00, 0x05, Q5NY), 0x32);
 +
    <span style="color:#0000FF">obj</span> Q4F0;
 +
    <span style="color:#0000FF">if</span> (success <= 0x00)
 +
    {
 +
      <span style="color:#0000FF">int</span> Q570 = Q573 * (0x00 - success) / 0x03E8 + 0x01;
 +
      Q56Z = Q56Z - Q570;
 +
      Q4F0 = [[Engine Function:_createNoResObjectIn|<span style="color:#FF0000;font-weight:bold">createNoResObjectIn</span>]](newType, Q62D);
 +
      [[Script_Function:_Q64G|<span style="color:#2B91AF">Q64G</span>]](Q4F0, Q62D, Q570);
 +
      [[Engine Function:_deleteObject|<span style="color:#FF0000;font-weight:bold">deleteObject</span>]](Q4F0);
 +
      [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](Q62D, <span style="color:#800000">"You lost some metal."</span>);
 +
      [[Script_Function:_Cleanup|<span style="color:#2B91AF">cleanup</span>]]();
 +
      <span style="color:#0000FF">return</span> ();
 +
    }
 +
    Q4F0 = [[Engine Function:_createNoResObjectAt|<span style="color:#FF0000;font-weight:bold">createNoResObjectAt</span>]](newType, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q62D));
 +
    [[Script_Function:_Q64G|<span style="color:#2B91AF">Q64G</span>]](Q4F0, Q62D, Q573);
 +
    <span style="color:#0000FF">obj</span> Q47G = [[Engine Function:_getBackpack|<span style="color:#FF0000;font-weight:bold">getBackpack</span>]](Q62D);
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_canHold|<span style="color:#FF0000;font-weight:bold">canHold</span>]](Q47G, Q4F0))
 +
    {
 +
      <span style="color:#0000FF">int</span> Q4Q4 = [[Engine Function:_putObjContainer|<span style="color:#FF0000;font-weight:bold">putObjContainer</span>]](Q4F0, Q47G);
 +
      [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](Q62D, <span style="color:#800000">"You create the item and put it in your backpack."</span>);
 +
    }
 +
    <span style="color:#0000FF">else</span>
 +
    {
 +
      [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](Q62D, <span style="color:#800000">"You create the item and put it at your feet."</span>);
 +
    }
 +
    <span style="color:#0000FF">int</span> Q59A = 0x64;
 +
    <span style="color:#0000FF">if</span> (success >= 0x0258)
 +
    {
 +
      [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](Q62D, <span style="color:#800000">"Due to your exceptional skill, it's quality is higher than average."</span>);
 +
      Q59A = 0x78;
 +
    }
 +
    <span style="color:#0000FF">else</span>
 +
    {
 +
      <span style="color:#0000FF">if</span> (success < 0x012C)
 +
      {
 +
        [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](Q62D, <span style="color:#800000">"You were barely able to make this item.  It's quality is below average."</span>);
 +
        Q59A = 0x50;
 +
      }
 +
    }
 +
    <span style="color:#0000FF">if</span> (Q59A != 0x64)
 +
    {
 +
      Q4Q1 = [[Engine Function:_setWeaponMaxHP|<span style="color:#FF0000;font-weight:bold">setWeaponMaxHP</span>]](Q4F0, [[Engine Function:_getWeaponMaxHP|<span style="color:#FF0000;font-weight:bold">getWeaponMaxHP</span>]](Q4F0) * Q59A / 0x64);
 +
      Q4Q1 = [[Engine Function:_setWeaponCurHP|<span style="color:#FF0000;font-weight:bold">setWeaponCurHP</span>]](Q4F0, [[Engine Function:_getWeaponCurHP|<span style="color:#FF0000;font-weight:bold">getWeaponCurHP</span>]](Q4F0) * Q59A / 0x64);
 +
      Q4Q1 = [[Engine Function:_setMaxArmorClass|<span style="color:#FF0000;font-weight:bold">setMaxArmorClass</span>]](Q4F0, [[Engine Function:_getMaxArmorClass|<span style="color:#FF0000;font-weight:bold">getMaxArmorClass</span>]](Q4F0) * Q59A / 0x64);
 +
      <span style="color:#0000FF">int</span> Q47C = [[Engine Function:_getAverageDamage|<span style="color:#FF0000;font-weight:bold">getAverageDamage</span>]](Q4F0);
 +
      <span style="color:#0000FF">if</span> (Q47C > 0x00)
 +
      {
 +
        <span style="color:#0000FF">int</span> Q48Q = Q47C * (Q59A - 0x64) / 0x64;
 +
        [[Script_Function:_Q581|<span style="color:#2B91AF">Q581</span>]](this, 0x00, 0x00, Q48Q, 0x00);
 +
      }
 +
    }
 +
    [[Script_Function:_Cleanup|<span style="color:#2B91AF">cleanup</span>]]();
 
     <span style="color:#0000FF">if</span> ([[Script_Function:_Q46J|<span style="color:#2B91AF">Q46J</span>]](Q62D, this))
 
     <span style="color:#0000FF">if</span> ([[Script_Function:_Q46J|<span style="color:#2B91AF">Q46J</span>]](Q62D, this))
 
     {
 
     {

Latest revision as of 08:39, 19 October 2018

 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 ();
 }
 function void Q4ER()
 {
   int Q4Q1;
   int Q56Z = Q4TF(Q62D);
   int Q5NY = Q5NZ[0x00];
   int Q573 = getArrayIntElem(0x00, 0x04, Q5NY);
   if (Q573 > Q56Z)
   {
     systemMessage(Q62D, "The amount of metal changed since you started smithing the ingots.");
     cleanup();
     return ();
   }
   int newType = getArrayIntElem(0x00, 0x00, Q5NY);
   int success = testAndLearnSkill(Q62D, 0x07, getArrayIntElem(0x00, 0x05, Q5NY), 0x32);
   obj Q4F0;
   if (success <= 0x00)
   {
     int Q570 = Q573 * (0x00 - success) / 0x03E8 + 0x01;
     Q56Z = Q56Z - Q570;
     Q4F0 = createNoResObjectIn(newType, Q62D);
     Q64G(Q4F0, Q62D, Q570);
     deleteObject(Q4F0);
     systemMessage(Q62D, "You lost some metal.");
     cleanup();
     return ();
   }
   Q4F0 = createNoResObjectAt(newType, getLocation(Q62D));
   Q64G(Q4F0, Q62D, Q573);
   obj Q47G = getBackpack(Q62D);
   if (canHold(Q47G, Q4F0))
   {
     int Q4Q4 = putObjContainer(Q4F0, Q47G);
     systemMessage(Q62D, "You create the item and put it in your backpack.");
   }
   else
   {
     systemMessage(Q62D, "You create the item and put it at your feet.");
   }
   int Q59A = 0x64;
   if (success >= 0x0258)
   {
     systemMessage(Q62D, "Due to your exceptional skill, it's quality is higher than average.");
     Q59A = 0x78;
   }
   else
   {
     if (success < 0x012C)
     {
       systemMessage(Q62D, "You were barely able to make this item.  It's quality is below average.");
       Q59A = 0x50;
     }
   }
   if (Q59A != 0x64)
   {
     Q4Q1 = setWeaponMaxHP(Q4F0, getWeaponMaxHP(Q4F0) * Q59A / 0x64);
     Q4Q1 = setWeaponCurHP(Q4F0, getWeaponCurHP(Q4F0) * Q59A / 0x64);
     Q4Q1 = setMaxArmorClass(Q4F0, getMaxArmorClass(Q4F0) * Q59A / 0x64);
     int Q47C = getAverageDamage(Q4F0);
     if (Q47C > 0x00)
     {
       int Q48Q = Q47C * (Q59A - 0x64) / 0x64;
       Q581(this, 0x00, 0x00, Q48Q, 0x00);
     }
   }
   cleanup();
   if (Q46J(Q62D, this))
   {
     deleteObject(this);
   }
   return ();
 }