Difference between revisions of "Script Function: Q53Z"

From Ultima Online: The Second Age
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
   {
 
   {
 
     <span style="color:#0000FF">int</span> charges = 0x00;
 
     <span style="color:#0000FF">int</span> charges = 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">"charges"</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">"charges"</span>))
 
     {
 
     {
       charges = [[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">"charges"</span></span>);
+
       charges = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"charges"</span>);
 
     }
 
     }
 
     <span style="color:#0000FF">if</span> (charges <= 0x00)
 
     <span style="color:#0000FF">if</span> (charges <= 0x00)
 
     {
 
     {
       [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style=<span style="color:#800000">"color:#800000"</span>><span style="color:#800000">"charges"</span></span>);
+
       [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"charges"</span>);
 
     }
 
     }
 
     <span style="color:#0000FF">else</span>
 
     <span style="color:#0000FF">else</span>
 
     {
 
     {
       [[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">"charges"</span></span>, charges - 0x01);
+
       [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](this, <span style="color:#800000">"charges"</span>, charges - 0x01);
       [[Engine Function:_returnResourcesToBank|<span style="color:#FF0000;font-weight:bold">returnResourcesToBank</span>]](this, 0x03, <span style=<span style="color:#800000">"color:#800000"</span>><span style="color:#800000">"magic"</span></span>);
+
       [[Engine Function:_returnResourcesToBank|<span style="color:#FF0000;font-weight:bold">returnResourcesToBank</span>]](this, 0x03, <span style="color:#800000">"magic"</span>);
 
     }
 
     }
 
     <span style="color:#0000FF">return</span> (charges);
 
     <span style="color:#0000FF">return</span> (charges);
Line 20: Line 20:
 
   <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q53Z()
 
   <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q53Z()
 
   {
 
   {
     <span style="color:#0000FF">int</span> charges = [[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">"charges"</span></span>);
+
     <span style="color:#0000FF">int</span> charges = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"charges"</span>);
     [[Engine Function:_returnResourcesToBank|<span style="color:#FF0000;font-weight:bold">returnResourcesToBank</span>]](this, 0x03, <span style=<span style="color:#800000">"color:#800000"</span>><span style="color:#800000">"magic"</span></span>);
+
     [[Engine Function:_returnResourcesToBank|<span style="color:#FF0000;font-weight:bold">returnResourcesToBank</span>]](this, 0x03, <span style="color:#800000">"magic"</span>);
 
     <span style="color:#0000FF">if</span> (charges <= 0x00)
 
     <span style="color:#0000FF">if</span> (charges <= 0x00)
 
     {
 
     {
       [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style=<span style="color:#800000">"color:#800000"</span>><span style="color:#800000">"charges"</span></span>);
+
       [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"charges"</span>);
 
     }
 
     }
 
     <span style="color:#0000FF">else</span>
 
     <span style="color:#0000FF">else</span>
 
     {
 
     {
       [[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">"charges"</span></span>, charges - 0x01);
+
       [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](this, <span style="color:#800000">"charges"</span>, charges - 0x01);
 
     }
 
     }
 
     <span style="color:#0000FF">return</span> (charges);
 
     <span style="color:#0000FF">return</span> (charges);
Line 35: Line 35:
 
   <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q53Z()
 
   <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q53Z()
 
   {
 
   {
     <span style="color:#0000FF">int</span> charges = [[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">"charges"</span></span>);
+
     <span style="color:#0000FF">int</span> charges = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"charges"</span>);
     [[Engine Function:_returnResourcesToBank|<span style="color:#FF0000;font-weight:bold">returnResourcesToBank</span>]](this, 0x03, <span style=<span style="color:#800000">"color:#800000"</span>><span style="color:#800000">"magic"</span></span>);
+
     [[Engine Function:_returnResourcesToBank|<span style="color:#FF0000;font-weight:bold">returnResourcesToBank</span>]](this, 0x03, <span style="color:#800000">"magic"</span>);
 
     <span style="color:#0000FF">if</span> (charges <= 0x00)
 
     <span style="color:#0000FF">if</span> (charges <= 0x00)
 
     {
 
     {
       [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style=<span style="color:#800000">"color:#800000"</span>><span style="color:#800000">"charges"</span></span>);
+
       [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"charges"</span>);
 
     }
 
     }
 
     <span style="color:#0000FF">else</span>
 
     <span style="color:#0000FF">else</span>
 
     {
 
     {
       [[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">"charges"</span></span>, charges - 0x01);
+
       [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](this, <span style="color:#800000">"charges"</span>, charges - 0x01);
 +
    }
 +
    <span style="color:#0000FF">return</span> (charges);
 +
  }
 +
 
 +
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q53Z()
 +
  {
 +
    <span style="color:#0000FF">int</span> charges = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"charges"</span>);
 +
    [[Engine Function:_returnResourcesToBank|<span style="color:#FF0000;font-weight:bold">returnResourcesToBank</span>]](this, 0x03, <span style="color:#800000">"magic"</span>);
 +
    <span style="color:#0000FF">if</span> (charges <= 0x00)
 +
    {
 +
      [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"charges"</span>);
 +
    }
 +
    <span style="color:#0000FF">else</span>
 +
    {
 +
      [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](this, <span style="color:#800000">"charges"</span>, charges - 0x01);
 +
    }
 +
    <span style="color:#0000FF">return</span> (charges);
 +
  }
 +
 
 +
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q53Z()
 +
  {
 +
    <span style="color:#0000FF">int</span> charges = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"charges"</span>);
 +
    [[Engine Function:_returnResourcesToBank|<span style="color:#FF0000;font-weight:bold">returnResourcesToBank</span>]](this, 0x03, <span style="color:#800000">"magic"</span>);
 +
    <span style="color:#0000FF">if</span> (charges <= 0x00)
 +
    {
 +
      [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"charges"</span>);
 +
    }
 +
    <span style="color:#0000FF">else</span>
 +
    {
 +
      [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](this, <span style="color:#800000">"charges"</span>, charges - 0x01);
 
     }
 
     }
 
     <span style="color:#0000FF">return</span> (charges);
 
     <span style="color:#0000FF">return</span> (charges);
 
   }
 
   }

Latest revision as of 02:34, 8 October 2018

 function int Q53Z()
 {
   int charges = 0x00;
   if (hasObjVar(this, "charges"))
   {
     charges = getObjVar(this, "charges");
   }
   if (charges <= 0x00)
   {
     removeObjVar(this, "charges");
   }
   else
   {
     setObjVar(this, "charges", charges - 0x01);
     returnResourcesToBank(this, 0x03, "magic");
   }
   return (charges);
 }
 function int Q53Z()
 {
   int charges = getObjVar(this, "charges");
   returnResourcesToBank(this, 0x03, "magic");
   if (charges <= 0x00)
   {
     removeObjVar(this, "charges");
   }
   else
   {
     setObjVar(this, "charges", charges - 0x01);
   }
   return (charges);
 }
 function int Q53Z()
 {
   int charges = getObjVar(this, "charges");
   returnResourcesToBank(this, 0x03, "magic");
   if (charges <= 0x00)
   {
     removeObjVar(this, "charges");
   }
   else
   {
     setObjVar(this, "charges", charges - 0x01);
   }
   return (charges);
 }
 function int Q53Z()
 {
   int charges = getObjVar(this, "charges");
   returnResourcesToBank(this, 0x03, "magic");
   if (charges <= 0x00)
   {
     removeObjVar(this, "charges");
   }
   else
   {
     setObjVar(this, "charges", charges - 0x01);
   }
   return (charges);
 }
 function int Q53Z()
 {
   int charges = getObjVar(this, "charges");
   returnResourcesToBank(this, 0x03, "magic");
   if (charges <= 0x00)
   {
     removeObjVar(this, "charges");
   }
   else
   {
     setObjVar(this, "charges", charges - 0x01);
   }
   return (charges);
 }