Difference between revisions of "Script: Findunderground"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">trigger</span> use { <span style="color:#0000FF">list</span> Q4QI; clearList|<span style="color:#FF0000;font-weight:bold">clearList</span...")
 
 
Line 13: Line 13:
 
       <span style="color:#0000FF">loc</span> Q5Z6 = Q4FH;
 
       <span style="color:#0000FF">loc</span> Q5Z6 = Q4FH;
 
       [[Engine Function:_setZ|<span style="color:#FF0000;font-weight:bold">setZ</span>]](Q5Z6, Q4FU + 0x10);
 
       [[Engine Function:_setZ|<span style="color:#FF0000;font-weight:bold">setZ</span>]](Q5Z6, Q4FU + 0x10);
       <span style="color:#0000FF">int</span> Q5NC = [[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](Q4QI[i], Q5Z6);
+
       <span style="color:#0000FF">int</span> Q5NC = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](Q4QI[i], Q5Z6);
 
       <span style="color:#0000FF">int</span> Q4QU = [[Engine Function:_findGoodZ|<span style="color:#FF0000;font-weight:bold">findGoodZ</span>]](Q4FH, Q4FU, Q4FU, 0x10, 0x02);
 
       <span style="color:#0000FF">int</span> Q4QU = [[Engine Function:_findGoodZ|<span style="color:#FF0000;font-weight:bold">findGoodZ</span>]](Q4FH, Q4FU, Q4FU, 0x10, 0x02);
       Q5NC = [[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](Q4QI[i], Q4FH);
+
       Q5NC = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](Q4QI[i], Q4FH);
 
       <span style="color:#0000FF">if</span> ((Q4QU == (0x00 - 0x80)) || (Q4QU > Q4FU))
 
       <span style="color:#0000FF">if</span> ((Q4QU == (0x00 - 0x80)) || (Q4QU > Q4FU))
 
       {
 
       {
 
         [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"FoundZ="</span> + Q4QU + <span style="color:#800000">" Currently at:"</span> + Q4FU);
 
         [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"FoundZ="</span> + Q4QU + <span style="color:#800000">" Currently at:"</span> + Q4FU);
 
         [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"'"</span> + [[Engine Function:_getName|<span style="color:#FF0000;font-weight:bold">getName</span>]](Q4FK) + <span style="color:#800000">"' was not in a valid position"</span>);
 
         [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"'"</span> + [[Engine Function:_getName|<span style="color:#FF0000;font-weight:bold">getName</span>]](Q4FK) + <span style="color:#800000">"' was not in a valid position"</span>);
         Q5NC = [[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](user, Q4FH);
+
         Q5NC = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](user, Q4FH);
 
         <span style="color:#0000FF">return</span> (0x00);
 
         <span style="color:#0000FF">return</span> (0x00);
 
       }
 
       }

Latest revision as of 07:38, 19 October 2018

trigger use
{
  list Q4QI;
  clearList(Q4QI);
  getMobsInRange(Q4QI, getLocation(this), 0x14);
  for(int i = (numInList(Q4QI) - 0x01); i >= 0x00; i--)
  {
    obj Q4FK = Q4QI[i];
    if (!isPlayer(Q4FK))
    {
      loc Q4FH = getLocation(Q4FK);
      int Q4FU = getZ(Q4FH);
      loc Q5Z6 = Q4FH;
      setZ(Q5Z6, Q4FU + 0x10);
      int Q5NC = teleport(Q4QI[i], Q5Z6);
      int Q4QU = findGoodZ(Q4FH, Q4FU, Q4FU, 0x10, 0x02);
      Q5NC = teleport(Q4QI[i], Q4FH);
      if ((Q4QU == (0x00 - 0x80)) || (Q4QU > Q4FU))
      {
        systemMessage(user, "FoundZ=" + Q4QU + " Currently at:" + Q4FU);
        systemMessage(user, "'" + getName(Q4FK) + "' was not in a valid position");
        Q5NC = teleport(user, Q4FH);
        return (0x00);
      }
    }
  }
  systemMessage(user, "All mobiles were in valid positions (for flying creatures)");
  return (0x01);
}