Difference between revisions of "Script Function: Q49H"

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> Q49H() { <span style="color:#0000FF">loc</span> Q4F5 = getObjVar|<span style="col...")
 
Line 1: Line 1:
 
   <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q49H()
 
   <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q49H()
 
   {
 
   {
     <span style="color:#0000FF">loc</span> Q4F5 = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style=<span style="color:#800000">"color:#800000"</span>><span style="color:#800000">"crimeLocation"</span></span>);
+
     <span style="color:#0000FF">loc</span> Q4F5 = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"crimeLocation"</span>);
     <span style="color:#0000FF">obj</span> criminal = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style=<span style="color:#800000">"color:#800000"</span>><span style="color:#800000">"lastCriminal"</span></span>);
+
     <span style="color:#0000FF">obj</span> criminal = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"lastCriminal"</span>);
 
     <span style="color:#0000FF">if</span> ([[Engine Function:_getDistanceInTiles|<span style="color:#FF0000;font-weight:bold">getDistanceInTiles</span>]]([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this), Q4F5) > 0x19)
 
     <span style="color:#0000FF">if</span> ([[Engine Function:_getDistanceInTiles|<span style="color:#FF0000;font-weight:bold">getDistanceInTiles</span>]]([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this), Q4F5) > 0x19)
 
     {
 
     {
Line 15: Line 15:
 
     <span style="color:#0000FF">if</span> ([[Engine Function:_isValid|<span style="color:#FF0000;font-weight:bold">isValid</span>]](criminal))
 
     <span style="color:#0000FF">if</span> ([[Engine Function:_isValid|<span style="color:#FF0000;font-weight:bold">isValid</span>]](criminal))
 
     {
 
     {
       <span style="color:#0000FF">obj</span> victim = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style=<span style="color:#800000">"color:#800000"</span>><span style="color:#800000">"lastVictim"</span></span>);
+
       <span style="color:#0000FF">obj</span> victim = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"lastVictim"</span>);
       <span style="color:#0000FF">int</span> Q5RN = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style=<span style="color:#800000">"color:#800000"</span>><span style="color:#800000">"crimeSeverity"</span></span>);
+
       <span style="color:#0000FF">int</span> Q5RN = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"crimeSeverity"</span>);
 
       [[Engine Function:_callGuards|<span style="color:#FF0000;font-weight:bold">callGuards</span>]](criminal, victim, Q5RN);
 
       [[Engine Function:_callGuards|<span style="color:#FF0000;font-weight:bold">callGuards</span>]](criminal, victim, Q5RN);
 
     }
 
     }

Revision as of 18:11, 7 October 2018

 function void Q49H()
 {
   loc Q4F5 = getObjVar(this, "crimeLocation");
   obj criminal = getObjVar(this, "lastCriminal");
   if (getDistanceInTiles(getLocation(this), Q4F5) > 0x19)
   {
     if (isValid(criminal))
     {
       if (getDistanceInTiles(getLocation(this), getLocation(criminal)) > 0x19)
       {
         return ();
       }
     }
   }
   if (isValid(criminal))
   {
     obj victim = getObjVar(this, "lastVictim");
     int Q5RN = getObjVar(this, "crimeSeverity");
     callGuards(criminal, victim, Q5RN);
   }
   cleanup();
   return ();
 }