Difference between revisions of "Script Function: Deactivate"

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> deactivate(<span style="color:#0000FF">obj</span> this) { <span style="color:#0000F...")
 
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
 
     <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"_objectId"</span>) && [[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"_objectType"</span>))
 
     <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"_objectId"</span>) && [[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"_objectType"</span>))
 
     {
 
     {
       <span style="color:#0000FF">obj</span> objectId = [[getobjvar_obj|<span style="color:#FF0000;font-weight:bold">getobjvar_obj</span>]](this, <span style="color:#800000">"_objectId"</span>);
+
       <span style="color:#0000FF">obj</span> objectId = [[Engine Function:_getobjvar_obj|<span style="color:#FF0000;font-weight:bold">getobjvar_obj</span>]](this, <span style="color:#800000">"_objectId"</span>);
       <span style="color:#0000FF">int</span> objectType = [[getobjvar_int|<span style="color:#FF0000;font-weight:bold">getobjvar_int</span>]](this, <span style="color:#800000">"_objectType"</span>);
+
       <span style="color:#0000FF">int</span> objectType = [[Engine Function:_getobjvar_int|<span style="color:#FF0000;font-weight:bold">getobjvar_int</span>]](this, <span style="color:#800000">"_objectType"</span>);
 
       [[Engine Function:_deleteIfValid|<span style="color:#FF0000;font-weight:bold">deleteIfValid</span>]](objectId, objectType);
 
       [[Engine Function:_deleteIfValid|<span style="color:#FF0000;font-weight:bold">deleteIfValid</span>]](objectId, objectType);
 
       [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"_objectId"</span>);
 
       [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"_objectId"</span>);
 +
      [[Engine Function:_processTriggerCmds|<span style="color:#FF0000;font-weight:bold">processTriggerCmds</span>]](this, <span style="color:#800000">"d"</span>);
 +
    }
 +
    return;
 +
  }
 +
 +
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> deactivate(<span style="color:#0000FF">obj</span> this)
 +
  {
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"objectId"</span>) && [[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"objectType"</span>))
 +
    {
 +
      <span style="color:#0000FF">obj</span> objectId = [[Engine Function:_getobjvar_obj|<span style="color:#FF0000;font-weight:bold">getobjvar_obj</span>]](this, <span style="color:#800000">"objectId"</span>);
 +
      <span style="color:#0000FF">int</span> objectType = [[Engine Function:_getobjvar_int|<span style="color:#FF0000;font-weight:bold">getobjvar_int</span>]](this, <span style="color:#800000">"objectType"</span>);
 +
      [[Engine Function:_deleteIfValid|<span style="color:#FF0000;font-weight:bold">deleteIfValid</span>]](objectId, objectType);
 +
      [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"objectId"</span>);
 +
      [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"objectType"</span>);
 
       [[Engine Function:_processTriggerCmds|<span style="color:#FF0000;font-weight:bold">processTriggerCmds</span>]](this, <span style="color:#800000">"d"</span>);
 
       [[Engine Function:_processTriggerCmds|<span style="color:#FF0000;font-weight:bold">processTriggerCmds</span>]](this, <span style="color:#800000">"d"</span>);
 
     }
 
     }
 
     return;
 
     return;
 
   }
 
   }

Latest revision as of 09:02, 19 October 2018

 function void deactivate(obj this)
 {
   if (hasObjVar(this, "_objectId") && hasObjVar(this, "_objectType"))
   {
     obj objectId = getobjvar_obj(this, "_objectId");
     int objectType = getobjvar_int(this, "_objectType");
     deleteIfValid(objectId, objectType);
     removeObjVar(this, "_objectId");
     processTriggerCmds(this, "d");
   }
   return;
 }
 function void deactivate(obj this)
 {
   if (hasObjVar(this, "objectId") && hasObjVar(this, "objectType"))
   {
     obj objectId = getobjvar_obj(this, "objectId");
     int objectType = getobjvar_int(this, "objectType");
     deleteIfValid(objectId, objectType);
     removeObjVar(this, "objectId");
     removeObjVar(this, "objectType");
     processTriggerCmds(this, "d");
   }
   return;
 }