Script Function: Q4M6

From Ultima Online: The Second Age
Jump to: navigation, search
 function void Q4M6(loc place)
 {
   int Q63M;
   int Q52M;
   int Q5NS;
   int Q48W;
   list t;
   t = 0x022C, 0x022D, 0x022E, 0x022F;
   Q63M = getElevation(place);
   loc Q52P = getX(place), getY(place) + 0x01, 0x00;
   Q52M = getElevation(Q52P);
   loc Q5NU = getX(place) + 0x01, getY(place), 0x00;
   Q5NS = getElevation(Q5NU);
   loc Q48X = getX(place) + 0x01, getY(place) + 0x01, 0x00;
   Q48W = getElevation(Q48X);
   if (Q4Z3(place))
   {
     t = 0x0230;
     setTile(place, t[random(0x00, numInList(t) - 0x01)]);
     return ();
   }
   if ((Q63M > Q52M) && (Q48W == Q52M) && (Q63M > Q5NS))
   {
     t = 0x0229;
     setTile(place, t[random(0x00, numInList(t) - 0x01)]);
     return ();
   }
   if ((Q52M > Q63M) && (Q52M > Q48W) && (Q5NS > Q63M) && (Q5NS > Q48W))
   {
     t = 0x0227;
     setTile(place, t[random(0x00, numInList(t) - 0x01)]);
     return ();
   }
   if (Q52M > Q5NS)
   {
     t = 0x022B, 0x021F, 0x0220, 0x0221, 0x0222, 0x0223, 0x0224, 0x0225, 0x0226;
     setTile(place, t[random(0x00, numInList(t) - 0x01)]);
     return ();
   }
   if (getTile(place) != 0x022B)
   {
     if (getTile(Q5NU) == 0x022B)
     {
       t = 0x0220;
       setTile(place, t[random(0x00, numInList(t) - 0x01)]);
       return ();
     }
   }
   setTile(place, t[random(0x00, numInList(t) - 0x01)]);
   return ();
 }