Difference between revisions of "Script Function: Q4RJ"

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> Q4RJ(<span style="color:#0000FF">string</span> description, <span style="color:#0000FF">i...")
 
 
Line 1: Line 1:
 
   <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q4RJ(<span style="color:#0000FF">string</span> description, <span style="color:#0000FF">int</span> Q4IE)
 
   <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q4RJ(<span style="color:#0000FF">string</span> description, <span style="color:#0000FF">int</span> Q4IE)
 
   {
 
   {
 +
    <span style="color:#0000FF">switch</span> (Q4IE)
 +
    {
 +
    <span style="color:#0000FF">case</span> 0x00
 +
      description = description + <span style="color:#800000">"to the North."</span>;
 +
      <span style="color:#0000FF">break</span>;
 +
    <span style="color:#0000FF">case</span> 0x01
 +
      description = description + <span style="color:#800000">"to the Northeast."</span>;
 +
      <span style="color:#0000FF">break</span>;
 +
    <span style="color:#0000FF">case</span> 0x02
 +
      description = description + <span style="color:#800000">"to the East."</span>;
 +
      <span style="color:#0000FF">break</span>;
 +
    <span style="color:#0000FF">case</span> 0x03
 +
      description = description + <span style="color:#800000">"to the Southeast."</span>;
 +
      <span style="color:#0000FF">break</span>;
 +
    <span style="color:#0000FF">case</span> 0x04
 +
      description = description + <span style="color:#800000">"to the South."</span>;
 +
      <span style="color:#0000FF">break</span>;
 +
    <span style="color:#0000FF">case</span> 0x05
 +
      description = description + <span style="color:#800000">"to the Southwest."</span>;
 +
      <span style="color:#0000FF">break</span>;
 +
    <span style="color:#0000FF">case</span> 0x06
 +
      description = description + <span style="color:#800000">"to the West."</span>;
 +
      <span style="color:#0000FF">break</span>;
 +
    <span style="color:#0000FF">case</span> 0x07
 +
      description = description + <span style="color:#800000">"to the Northwest."</span>;
 +
      <span style="color:#0000FF">break</span>;
 +
    <span style="color:#0000FF">default</span>
 +
      debugMessage(<span style="color:#800000">"getDirection: invalid direction returned."</span>);
 +
      description = description + <span style="color:#800000">" in some direction."</span>;
 +
      <span style="color:#0000FF">break</span>;
 +
    }
 +
    <span style="color:#0000FF">return</span> ();
 +
  }
 +
 +
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q4RJ(<span style="color:#0000FF">string</span> description, <span style="color:#0000FF">loc</span> Q4VS, <span style="color:#0000FF">loc</span> there)
 +
  {
 +
    <span style="color:#0000FF">int</span> Q4IE = [[Engine Function:_getDirectionInternal|<span style="color:#FF0000;font-weight:bold">getDirectionInternal</span>]](Q4VS, there);
 
     <span style="color:#0000FF">switch</span> (Q4IE)
 
     <span style="color:#0000FF">switch</span> (Q4IE)
 
     {
 
     {

Latest revision as of 04:09, 10 October 2018

 function void Q4RJ(string description, int Q4IE)
 {
   switch (Q4IE)
   {
   case 0x00
     description = description + "to the North.";
     break;
   case 0x01
     description = description + "to the Northeast.";
     break;
   case 0x02
     description = description + "to the East.";
     break;
   case 0x03
     description = description + "to the Southeast.";
     break;
   case 0x04
     description = description + "to the South.";
     break;
   case 0x05
     description = description + "to the Southwest.";
     break;
   case 0x06
     description = description + "to the West.";
     break;
   case 0x07
     description = description + "to the Northwest.";
     break;
   default
     debugMessage("getDirection: invalid direction returned.");
     description = description + " in some direction.";
     break;
   }
   return ();
 }
 function void Q4RJ(string description, loc Q4VS, loc there)
 {
   int Q4IE = getDirectionInternal(Q4VS, there);
   switch (Q4IE)
   {
   case 0x00
     description = description + "to the North.";
     break;
   case 0x01
     description = description + "to the Northeast.";
     break;
   case 0x02
     description = description + "to the East.";
     break;
   case 0x03
     description = description + "to the Southeast.";
     break;
   case 0x04
     description = description + "to the South.";
     break;
   case 0x05
     description = description + "to the Southwest.";
     break;
   case 0x06
     description = description + "to the West.";
     break;
   case 0x07
     description = description + "to the Northwest.";
     break;
   default
     debugMessage("getDirection: invalid direction returned.");
     description = description + " in some direction.";
     break;
   }
   return ();
 }