Difference between revisions of "Script Function: Q4CG"

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> Q4CG(<span style="color:#0000FF">obj</span> owner) { <span style="color:#0000FF">if...")
 
Line 4: Line 4:
 
     {
 
     {
 
       <span style="color:#0000FF">int</span> ownerMurderCount = 0x00;
 
       <span style="color:#0000FF">int</span> ownerMurderCount = 0x00;
       <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style=<span style="color:#800000">"color:#800000"</span>><span style="color:#800000">"ownerMurderCount"</span></span>))
+
       <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"color:#800000">"ownerMurderCount">))
 
       {
 
       {
         ownerMurderCount = [[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">"ownerMurderCount"</span></span>);
+
         ownerMurderCount = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"color:#800000">"ownerMurderCount">);
 
       }
 
       }
 
       <span style="color:#0000FF">int</span> murderCount = [[Engine Function:_getMurderCount|<span style="color:#FF0000;font-weight:bold">getMurderCount</span>]](owner);
 
       <span style="color:#0000FF">int</span> murderCount = [[Engine Function:_getMurderCount|<span style="color:#FF0000;font-weight:bold">getMurderCount</span>]](owner);
 
       <span style="color:#0000FF">if</span> (murderCount > ownerMurderCount)
 
       <span style="color:#0000FF">if</span> (murderCount > ownerMurderCount)
 
       {
 
       {
         [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](this, <span style=<span style="color:#800000">"color:#800000"</span>><span style="color:#800000">"ownerMurderCount"</span></span>, murderCount);
+
         [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](this, <span style="color:#800000">"color:#800000">"ownerMurderCount">, murderCount);
 
       }
 
       }
 
     }
 
     }
 
     <span style="color:#0000FF">return</span> ();
 
     <span style="color:#0000FF">return</span> ();
 
   }
 
   }

Revision as of 18:14, 7 October 2018

 function void Q4CG(obj owner)
 {
   if (isMurderer(owner))
   {
     int ownerMurderCount = 0x00;
     if (hasObjVar(this, "color:#800000">"ownerMurderCount">))
     {
       ownerMurderCount = getObjVar(this, "color:#800000">"ownerMurderCount">);
     }
     int murderCount = getMurderCount(owner);
     if (murderCount > ownerMurderCount)
     {
       setObjVar(this, "color:#800000">"ownerMurderCount">, murderCount);
     }
   }
   return ();
 }