Difference between revisions of "Script Function: Q5YK"

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> Q5YK() { <span style="color:#0000FF">loc</span> Q4VS = getLocation|<span style="c...")
 
 
Line 22: Line 22:
 
         <span style="color:#0000FF">int</span> skill = [[Engine Function:_getSkillLevel|<span style="color:#FF0000;font-weight:bold">getSkillLevel</span>]](Q67L[Q629], 0x19);
 
         <span style="color:#0000FF">int</span> skill = [[Engine Function:_getSkillLevel|<span style="color:#FF0000;font-weight:bold">getSkillLevel</span>]](Q67L[Q629], 0x19);
 
         <span style="color:#0000FF">int</span> Q5XO = (intelligence + skill) / Q4IK;
 
         <span style="color:#0000FF">int</span> Q5XO = (intelligence + skill) / Q4IK;
 +
        [[Engine Function:_setItem|<span style="color:#FF0000;font-weight:bold">setItem</span>]](Q67K, Q5XO, Q629);
 +
      }
 +
      <span style="color:#0000FF">else</span>
 +
      {
 +
        [[Engine Function:_removeItem|<span style="color:#FF0000;font-weight:bold">removeItem</span>]](Q67K, Q629);
 +
        [[Engine Function:_removeItem|<span style="color:#FF0000;font-weight:bold">removeItem</span>]](Q67L, Q629);
 +
      }
 +
    }
 +
    <span style="color:#0000FF">obj</span> Q5KH;
 +
    <span style="color:#0000FF">int</span> Q5KI;
 +
    <span style="color:#0000FF">int</span> Q5KG;
 +
    <span style="color:#0000FF">int</span> Q5KF;
 +
    <span style="color:#0000FF">obj</span> Q5D6;
 +
    <span style="color:#0000FF">int</span> Q5D7;
 +
    <span style="color:#0000FF">int</span> Q5D5;
 +
    <span style="color:#0000FF">int</span> Q5D1 = [[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q67K);
 +
    <span style="color:#0000FF">string</span> Q5BB = Q5D1;
 +
    for(<span style="color:#0000FF">int</span> Q4CW; Q4CW < [[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q67K); Q4CW++)
 +
    {
 +
      for(<span style="color:#0000FF">int</span> Q5D4 = 0x00; Q5D4 < Q5D1; Q5D4++)
 +
      {
 +
        <span style="color:#0000FF">if</span> (Q4CW < Q5D4)
 +
        {
 +
          <span style="color:#0000FF">if</span> ((Q67K[Q4CW]) < (Q67K[Q5D4]))
 +
          {
 +
            <span style="color:#0000FF">if</span> ([[Engine Function:_isValid|<span style="color:#FF0000;font-weight:bold">isValid</span>]](Q67L[Q4CW]))
 +
            {
 +
              Q5KI = Q67K[Q4CW];
 +
              Q5KH = Q67L[Q4CW];
 +
              Q5D7 = Q67K[Q5D4];
 +
              Q5D6 = Q67L[Q5D4];
 +
              [[Engine Function:_setItem|<span style="color:#FF0000;font-weight:bold">setItem</span>]](Q67K, Q5D7, Q4CW);
 +
              [[Engine Function:_setItem|<span style="color:#FF0000;font-weight:bold">setItem</span>]](Q67L, Q5D6, Q4CW);
 +
              [[Engine Function:_setItem|<span style="color:#FF0000;font-weight:bold">setItem</span>]](Q67K, Q5KI, Q5D4);
 +
              [[Engine Function:_setItem|<span style="color:#FF0000;font-weight:bold">setItem</span>]](Q67L, Q5KH, Q5D4);
 +
            }
 +
          }
 +
          <span style="color:#0000FF">if</span> ((Q67K[Q4CW]) == (Q67K[Q5D4]))
 +
          {
 +
            <span style="color:#0000FF">if</span> ([[Engine Function:_isValid|<span style="color:#FF0000;font-weight:bold">isValid</span>]](Q67L[Q4CW]))
 +
            {
 +
              <span style="color:#0000FF">loc</span> Q5JP = [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q67L[Q4CW]);
 +
              <span style="color:#0000FF">loc</span> Q5JQ = [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q67L[Q5D4]);
 +
              <span style="color:#0000FF">int</span> Q4IM = [[Engine Function:_getDistance|<span style="color:#FF0000;font-weight:bold">getDistance</span>]](Q4VS, Q5JP);
 +
              <span style="color:#0000FF">int</span> Q4IN = [[Engine Function:_getDistance|<span style="color:#FF0000;font-weight:bold">getDistance</span>]](Q4VS, Q5JQ);
 +
              <span style="color:#0000FF">if</span> (Q4IM > Q4IN)
 +
              {
 +
                Q5KI = Q67K[Q4CW];
 +
                Q5KH = Q67L[Q4CW];
 +
                Q5D7 = Q67K[Q5D4];
 +
                Q5D6 = Q67L[Q5D4];
 +
                [[Engine Function:_setItem|<span style="color:#FF0000;font-weight:bold">setItem</span>]](Q67K, Q5D7, Q4CW);
 +
                [[Engine Function:_setItem|<span style="color:#FF0000;font-weight:bold">setItem</span>]](Q67L, Q5D6, Q4CW);
 +
                [[Engine Function:_setItem|<span style="color:#FF0000;font-weight:bold">setItem</span>]](Q67K, Q5KI, Q5D4);
 +
                [[Engine Function:_setItem|<span style="color:#FF0000;font-weight:bold">setItem</span>]](Q67L, Q5KH, Q5D4);
 +
              }
 +
            }
 +
          }
 +
        }
 +
      }
 +
    }
 +
    Q4G9 = [[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q67L);
 +
    <span style="color:#0000FF">obj</span> Q455 = Q67L[0x00];
 +
    [[Script_Function:_Q4TV|<span style="color:#2B91AF">Q4TV</span>]](Q455);
 +
    <span style="color:#0000FF">return</span> ();
 +
  }
 +
 +
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q5YK()
 +
  {
 +
    <span style="color:#0000FF">loc</span> Q4VS = [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this);
 +
    <span style="color:#0000FF">int</span> Q4IK;
 +
    <span style="color:#0000FF">loc</span> there;
 +
    [[Script_Function:_Q4BQ|<span style="color:#2B91AF">Q4BQ</span>]]();
 +
    <span style="color:#0000FF">if</span> (0x00 == [[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q67L))
 +
    {
 +
      [[Engine Function:_shortcallback|<span style="color:#FF0000;font-weight:bold">shortcallback</span>]](this, 0x01, 0x35);
 +
    }
 +
    for(<span style="color:#0000FF">int</span> Q629 = 0x00; Q629 < [[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q67L); Q629++)
 +
    {
 +
      <span style="color:#0000FF">if</span> ([[Engine Function:_isValid|<span style="color:#FF0000;font-weight:bold">isValid</span>]](Q67L[Q629]))
 +
      {
 +
        there = [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q67L[Q629]);
 +
        Q4IK = [[Engine Function:_getDistanceInTiles|<span style="color:#FF0000;font-weight:bold">getDistanceInTiles</span>]](Q4VS, there);
 +
        <span style="color:#0000FF">if</span> (Q4IK == 0x00)
 +
        {
 +
          Q4IK = 0x01;
 +
        }
 +
        <span style="color:#0000FF">int</span> strength = [[Engine Function:_getStrength|<span style="color:#FF0000;font-weight:bold">getStrength</span>]](Q67L[Q629]);
 +
        <span style="color:#0000FF">int</span> skill = ([[Engine Function:_getSkillLevel|<span style="color:#FF0000;font-weight:bold">getSkillLevel</span>]](Q67L[Q629], 0x1B) + [[Engine Function:_getSkillLevel|<span style="color:#FF0000;font-weight:bold">getSkillLevel</span>]](Q67L[Q629], 0x1F));
 +
        <span style="color:#0000FF">int</span> Q5XO = (strength + skill) / Q4IK;
 
         [[Engine Function:_setItem|<span style="color:#FF0000;font-weight:bold">setItem</span>]](Q67K, Q5XO, Q629);
 
         [[Engine Function:_setItem|<span style="color:#FF0000;font-weight:bold">setItem</span>]](Q67K, Q5XO, Q629);
 
       }
 
       }

Latest revision as of 18:25, 12 October 2018

 function void Q5YK()
 {
   loc Q4VS = getLocation(Q67S);
   int Q4IK;
   loc there;
   Q4BQ();
   if (0x00 == numInList(Q67L))
   {
     shortcallback(Q67S, 0x01, 0x35);
   }
   for(int Q629 = 0x00; Q629 < numInList(Q67L); Q629++)
   {
     if (isValid(Q67L[Q629]))
     {
       there = getLocation(Q67L[Q629]);
       Q4IK = getDistanceInTiles(Q4VS, there);
       if (Q4IK == 0x00)
       {
         Q4IK = 0x01;
       }
       int intelligence = getIntelligence(Q67L[Q629]);
       int skill = getSkillLevel(Q67L[Q629], 0x19);
       int Q5XO = (intelligence + skill) / Q4IK;
       setItem(Q67K, Q5XO, Q629);
     }
     else
     {
       removeItem(Q67K, Q629);
       removeItem(Q67L, Q629);
     }
   }
   obj Q5KH;
   int Q5KI;
   int Q5KG;
   int Q5KF;
   obj Q5D6;
   int Q5D7;
   int Q5D5;
   int Q5D1 = numInList(Q67K);
   string Q5BB = Q5D1;
   for(int Q4CW; Q4CW < numInList(Q67K); Q4CW++)
   {
     for(int Q5D4 = 0x00; Q5D4 < Q5D1; Q5D4++)
     {
       if (Q4CW < Q5D4)
       {
         if ((Q67K[Q4CW]) < (Q67K[Q5D4]))
         {
           if (isValid(Q67L[Q4CW]))
           {
             Q5KI = Q67K[Q4CW];
             Q5KH = Q67L[Q4CW];
             Q5D7 = Q67K[Q5D4];
             Q5D6 = Q67L[Q5D4];
             setItem(Q67K, Q5D7, Q4CW);
             setItem(Q67L, Q5D6, Q4CW);
             setItem(Q67K, Q5KI, Q5D4);
             setItem(Q67L, Q5KH, Q5D4);
           }
         }
         if ((Q67K[Q4CW]) == (Q67K[Q5D4]))
         {
           if (isValid(Q67L[Q4CW]))
           {
             loc Q5JP = getLocation(Q67L[Q4CW]);
             loc Q5JQ = getLocation(Q67L[Q5D4]);
             int Q4IM = getDistance(Q4VS, Q5JP);
             int Q4IN = getDistance(Q4VS, Q5JQ);
             if (Q4IM > Q4IN)
             {
               Q5KI = Q67K[Q4CW];
               Q5KH = Q67L[Q4CW];
               Q5D7 = Q67K[Q5D4];
               Q5D6 = Q67L[Q5D4];
               setItem(Q67K, Q5D7, Q4CW);
               setItem(Q67L, Q5D6, Q4CW);
               setItem(Q67K, Q5KI, Q5D4);
               setItem(Q67L, Q5KH, Q5D4);
             }
           }
         }
       }
     }
   }
   Q4G9 = numInList(Q67L);
   obj Q455 = Q67L[0x00];
   Q4TV(Q455);
   return ();
 }
 function void Q5YK()
 {
   loc Q4VS = getLocation(this);
   int Q4IK;
   loc there;
   Q4BQ();
   if (0x00 == numInList(Q67L))
   {
     shortcallback(this, 0x01, 0x35);
   }
   for(int Q629 = 0x00; Q629 < numInList(Q67L); Q629++)
   {
     if (isValid(Q67L[Q629]))
     {
       there = getLocation(Q67L[Q629]);
       Q4IK = getDistanceInTiles(Q4VS, there);
       if (Q4IK == 0x00)
       {
         Q4IK = 0x01;
       }
       int strength = getStrength(Q67L[Q629]);
       int skill = (getSkillLevel(Q67L[Q629], 0x1B) + getSkillLevel(Q67L[Q629], 0x1F));
       int Q5XO = (strength + skill) / Q4IK;
       setItem(Q67K, Q5XO, Q629);
     }
     else
     {
       removeItem(Q67K, Q629);
       removeItem(Q67L, Q629);
     }
   }
   obj Q5KH;
   int Q5KI;
   int Q5KG;
   int Q5KF;
   obj Q5D6;
   int Q5D7;
   int Q5D5;
   int Q5D1 = numInList(Q67K);
   string Q5BB = Q5D1;
   for(int Q4CW; Q4CW < numInList(Q67K); Q4CW++)
   {
     for(int Q5D4 = 0x00; Q5D4 < Q5D1; Q5D4++)
     {
       if (Q4CW < Q5D4)
       {
         if ((Q67K[Q4CW]) < (Q67K[Q5D4]))
         {
           if (isValid(Q67L[Q4CW]))
           {
             Q5KI = Q67K[Q4CW];
             Q5KH = Q67L[Q4CW];
             Q5D7 = Q67K[Q5D4];
             Q5D6 = Q67L[Q5D4];
             setItem(Q67K, Q5D7, Q4CW);
             setItem(Q67L, Q5D6, Q4CW);
             setItem(Q67K, Q5KI, Q5D4);
             setItem(Q67L, Q5KH, Q5D4);
           }
         }
         if ((Q67K[Q4CW]) == (Q67K[Q5D4]))
         {
           if (isValid(Q67L[Q4CW]))
           {
             loc Q5JP = getLocation(Q67L[Q4CW]);
             loc Q5JQ = getLocation(Q67L[Q5D4]);
             int Q4IM = getDistance(Q4VS, Q5JP);
             int Q4IN = getDistance(Q4VS, Q5JQ);
             if (Q4IM > Q4IN)
             {
               Q5KI = Q67K[Q4CW];
               Q5KH = Q67L[Q4CW];
               Q5D7 = Q67K[Q5D4];
               Q5D6 = Q67L[Q5D4];
               setItem(Q67K, Q5D7, Q4CW);
               setItem(Q67L, Q5D6, Q4CW);
               setItem(Q67K, Q5KI, Q5D4);
               setItem(Q67L, Q5KH, Q5D4);
             }
           }
         }
       }
     }
   }
   Q4G9 = numInList(Q67L);
   obj Q455 = Q67L[0x00];
   Q4TV(Q455);
   return ();
 }