Difference between revisions of "Script: Placehld"

From Ultima Online: The Second Age
Jump to: navigation, search
Line 16: Line 16:
 
   <span style="color:#0000FF">if</span> (![[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"dontDelete"</span>))
 
   <span style="color:#0000FF">if</span> (![[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"dontDelete"</span>))
 
   {
 
   {
     de[[activate|<span style="color:#2B91AF">activate</span>]](this);
+
     deactivate(this);
 
   }
 
   }
 
   [[Engine Function:_createPlaceHolder|<span style="color:#FF0000;font-weight:bold">createPlaceHolder</span>]](this);
 
   [[Engine Function:_createPlaceHolder|<span style="color:#FF0000;font-weight:bold">createPlaceHolder</span>]](this);
Line 25: Line 25:
 
  <span style="color:#0000FF">trigger</span> message(<span style="color:#800000">"deactivate"</span>)
 
  <span style="color:#0000FF">trigger</span> message(<span style="color:#800000">"deactivate"</span>)
 
  {
 
  {
   de[[activate|<span style="color:#2B91AF">activate</span>]](this);
+
   deactivate(this);
 
   <span style="color:#0000FF">return</span> (0x00);
 
   <span style="color:#0000FF">return</span> (0x00);
 
  }
 
  }

Revision as of 02:00, 21 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;
}
trigger message("activate")
{
  if (!hasObjVar(this, "dontDelete"))
  {
    deactivate(this);
  }
  createPlaceHolder(this);
  processTriggerCmds(this, "a");
  return (0x00);
}
trigger message("deactivate")
{
  deactivate(this);
  return (0x00);
}