Script Function: Q5YK

From Ultima Online: The Second Age
Revision as of 10:01, 7 October 2018 by Grimoric (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 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 ();
 }