Script Function: Q4M5

From Ultima Online: The Second Age
Revision as of 14:45, 12 October 2018 by Grimoric (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 function void Q4M5(obj this)
 {
   list Q5XE;
   getObjectsInRange(Q5XE, getLocation(this), 0x0A);
   int Q60R = random(0x00, numInList(Q5XE) - 0x01);
   obj Q61K = Q5XE[Q60R];
   if (!Q5W3(this, Q61K))
   {
     return ();
   }
   if (getWeight(Q61K) > 0x14)
   {
     if (0x00)
     {
       bark(this, "Tried to scavenge something too heavy. :P");
     }
     return ();
   }
   if (Q4Z8(this, Q61K))
   {
     return ();
   }
   if (getObjType(Q61K) == 0x00)
   {
     return ();
   }
   if (hasObjVar(this, "ScavengeLastItemGotten"))
   {
     obj Q63H = getObjVar(this, "ScavengeLastItemGotten");
     if (hasObj(this, Q63H))
     {
       deleteObject(Q63H);
     }
   }
   member obj Q5OI = Q61K;
   walkTo(this, getLocation(Q61K), 0x08);
   return ();
 }
 function void Q4M5(obj this)
 {
   list Q5XE;
   getObjectsInRange(Q5XE, getLocation(this), 0x04);
   int Q60R = random(0x00, numInList(Q5XE) - 0x01);
   obj Q61K = Q5XE[Q60R];
   if (!Q5W3(this, Q61K))
   {
     return ();
   }
   if (getWeight(Q61K) > 0x14)
   {
     if (0x00)
     {
       bark(this, "Tried to scavenge something too heavy. :P");
     }
     return ();
   }
   if (!isMoveable(Q61K, this))
   {
     return ();
   }
   if (Q4Z8(this, Q61K))
   {
     return ();
   }
   if (getObjType(Q61K) < 0x03)
   {
     return ();
   }
   if (hasObjVar(this, "ScavengeLastItemGotten"))
   {
     obj Q63H = getObjVar(this, "ScavengeLastItemGotten");
     if (hasObj(this, Q63H))
     {
       deleteObject(Q63H);
     }
   }
   member obj Q5OI = Q61K;
   walkTo(this, getLocation(Q61K), 0x08);
   return ();
 }