Difference between revisions of "Script Function: Cleanup"

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> cleanup() { removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVa...")
 
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
   <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> cleanup()
 
   <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> cleanup()
 
   {
 
   {
     [[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">"lastCriminal"</span></span>);
+
     [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"lastCriminal"</span>);
     [[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">"lastVictim"</span></span>);
+
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"lastVictim"</span>);
     [[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">"crimeSeverity"</span></span>);
+
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"crimeSeverity"</span>);
     [[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">"crimeLocation"</span></span>);
+
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"crimeLocation"</span>);
     [[Engine Function:_detachScript|<span style="color:#FF0000;font-weight:bold">detachScript</span>]](this, <span style=<span style="color:#800000">"color:#800000"</span>><span style="color:#800000">"witness"</span></span>);
+
    [[Engine Function:_detachScript|<span style="color:#FF0000;font-weight:bold">detachScript</span>]](this, <span style="color:#800000">"witness"</span>);
 +
    <span style="color:#0000FF">return</span> ();
 +
  }
 +
 
 +
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> cleanup()
 +
  {
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_isContainer|<span style="color:#FF0000;font-weight:bold">isContainer</span>]](this))
 +
    {
 +
      <span style="color:#0000FF">list</span> Q4E4;
 +
      [[Engine Function:_getContents|<span style="color:#FF0000;font-weight:bold">getContents</span>]](Q4E4, this);
 +
      <span style="color:#0000FF">while</span>([[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q4E4))
 +
      {
 +
        <span style="color:#0000FF">list</span> args;
 +
        [[Engine Function:_message|<span style="color:#FF0000;font-weight:bold">message</span>]](Q4E4[0x00], <span style="color:#800000">"cleanup"</span>, args);
 +
        [[Engine Function:_removeItem|<span style="color:#FF0000;font-weight:bold">removeItem</span>]](Q4E4, 0x00);
 +
      }
 +
    }
 +
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"vendedOwner"</span>);
 +
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"vendedPrice"</span>);
 +
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"description"</span>);
 +
    [[Engine Function:_detachScript|<span style="color:#FF0000;font-weight:bold">detachScript</span>]](this, <span style="color:#800000">"vended"</span>);
 +
    <span style="color:#0000FF">return</span> ();
 +
  }
 +
 
 +
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> cleanup()
 +
  {
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"pole"</span>))
 +
    {
 +
      [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"pole"</span>);
 +
    }
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"targetType"</span>))
 +
    {
 +
      [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"targetType"</span>);
 +
    }
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"there"</span>))
 +
    {
 +
      [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"there"</span>);
 +
     }
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"splash"</span>))
 +
    {
 +
      [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"splash"</span>);
 +
    }
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"rightHand"</span>))
 +
    {
 +
      [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"rightHand"</span>);
 +
    }
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"leftHand"</span>))
 +
    {
 +
      [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"leftHand"</span>);
 +
    }
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"staff"</span>))
 +
    {
 +
      [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"staff"</span>);
 +
    }
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"equipped"</span>))
 +
    {
 +
      [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"equipped"</span>);
 +
    }
 +
    <span style="color:#0000FF">else</span>
 +
    {
 +
      [[Script_Function:_Q5NI|<span style="color:#2B91AF">Q5NI</span>]]();
 +
     }
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"poleID"</span>))
 +
    {
 +
      [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"poleID"</span>);
 +
    }
 +
    [[Engine Function:_detachScript|<span style="color:#FF0000;font-weight:bold">detachScript</span>]](this, <span style="color:#800000">"userisfishing"</span>);
 +
    <span style="color:#0000FF">return</span> ();
 +
  }
 +
 
 +
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> cleanup()
 +
  {
 +
    [[Engine Function:_clearList|<span style="color:#FF0000;font-weight:bold">clearList</span>]](Q5FB);
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_hasScript|<span style="color:#FF0000;font-weight:bold">hasScript</span>]](this, <span style="color:#800000">"useristracking"</span>))
 +
    {
 +
      shortCallback(this, 0x01, 0x51);
 +
    }
 +
    <span style="color:#0000FF">return</span> ();
 +
  }
 +
 
 +
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> cleanup()
 +
  {
 +
    [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](this, <span style="color:#800000">"Guards can no longer be called on you."</span>);
 +
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"crimeWitnessList"</span>);
 +
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"crimeSeverity"</span>);
 +
    [[Engine Function:_detachScript|<span style="color:#FF0000;font-weight:bold">detachScript</span>]](this, <span style="color:#800000">"punishable"</span>);
 +
    <span style="color:#0000FF">return</span> ();
 +
  }
 +
 
 +
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> cleanup(<span style="color:#0000FF">obj</span> this)
 +
  {
 +
     [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"guildName"</span>);
 +
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"guildAbbreviation"</span>);
 +
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"myGuildTitle"</span>);
 +
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"guildstoneId"</span>);
 +
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"displayGuildAbbr"</span>);
 +
     [[Engine Function:_detachScript|<span style="color:#FF0000;font-weight:bold">detachScript</span>]](this, <span style="color:#800000">"guilded"</span>);
 +
    <span style="color:#0000FF">return</span> ();
 +
  }
 +
 
 +
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> cleanup()
 +
  {
 +
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"usedon"</span>);
 +
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"arrayIndex"</span>);
 +
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"user"</span>);
 +
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"actionCount"</span>);
 +
    <span style="color:#0000FF">return</span> ();
 +
  }
 +
 
 +
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> cleanup()
 +
  {
 +
    [[Engine Function:_clearList|<span style="color:#FF0000;font-weight:bold">clearList</span>]](Q5NZ);
 +
    Q62D = [[Engine Function:_NULL|<span style="color:#FF0000;font-weight:bold">NULL</span>]]();
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"inUse"</span>))
 +
    {
 +
      [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"inUse"</span>);
 +
    }
 
     <span style="color:#0000FF">return</span> ();
 
     <span style="color:#0000FF">return</span> ();
 
   }
 
   }

Latest revision as of 17:41, 12 October 2018

 function void cleanup()
 {
   removeObjVar(this, "lastCriminal");
   removeObjVar(this, "lastVictim");
   removeObjVar(this, "crimeSeverity");
   removeObjVar(this, "crimeLocation");
   detachScript(this, "witness");
   return ();
 }
 function void cleanup()
 {
   if (isContainer(this))
   {
     list Q4E4;
     getContents(Q4E4, this);
     while(numInList(Q4E4))
     {
       list args;
       message(Q4E4[0x00], "cleanup", args);
       removeItem(Q4E4, 0x00);
     }
   }
   removeObjVar(this, "vendedOwner");
   removeObjVar(this, "vendedPrice");
   removeObjVar(this, "description");
   detachScript(this, "vended");
   return ();
 }
 function void cleanup()
 {
   if (hasObjVar(this, "pole"))
   {
     removeObjVar(this, "pole");
   }
   if (hasObjVar(this, "targetType"))
   {
     removeObjVar(this, "targetType");
   }
   if (hasObjVar(this, "there"))
   {
     removeObjVar(this, "there");
   }
   if (hasObjVar(this, "splash"))
   {
     removeObjVar(this, "splash");
   }
   if (hasObjVar(this, "rightHand"))
   {
     removeObjVar(this, "rightHand");
   }
   if (hasObjVar(this, "leftHand"))
   {
     removeObjVar(this, "leftHand");
   }
   if (hasObjVar(this, "staff"))
   {
     removeObjVar(this, "staff");
   }
   if (hasObjVar(this, "equipped"))
   {
     removeObjVar(this, "equipped");
   }
   else
   {
     Q5NI();
   }
   if (hasObjVar(this, "poleID"))
   {
     removeObjVar(this, "poleID");
   }
   detachScript(this, "userisfishing");
   return ();
 }
 function void cleanup()
 {
   clearList(Q5FB);
   if (hasScript(this, "useristracking"))
   {
     shortCallback(this, 0x01, 0x51);
   }
   return ();
 }
 function void cleanup()
 {
   systemMessage(this, "Guards can no longer be called on you.");
   removeObjVar(this, "crimeWitnessList");
   removeObjVar(this, "crimeSeverity");
   detachScript(this, "punishable");
   return ();
 }
 function void cleanup(obj this)
 {
   removeObjVar(this, "guildName");
   removeObjVar(this, "guildAbbreviation");
   removeObjVar(this, "myGuildTitle");
   removeObjVar(this, "guildstoneId");
   removeObjVar(this, "displayGuildAbbr");
   detachScript(this, "guilded");
   return ();
 }
 function void cleanup()
 {
   removeObjVar(this, "usedon");
   removeObjVar(this, "arrayIndex");
   removeObjVar(this, "user");
   removeObjVar(this, "actionCount");
   return ();
 }
 function void cleanup()
 {
   clearList(Q5NZ);
   Q62D = NULL();
   if (hasObjVar(this, "inUse"))
   {
     removeObjVar(this, "inUse");
   }
   return ();
 }