Difference between revisions of "Script Function: Q440"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">obj</span> Q440(<span style="color:#0000FF">obj</span> ship, <span style="color:#0000FF">loc</span> w...")
 
 
Line 8: Line 8:
 
     }
 
     }
 
     <span style="color:#0000FF">obj</span> Q62K = [[Engine Function:_createGlobalObjectAt|<span style="color:#FF0000;font-weight:bold">createGlobalObjectAt</span>]](0x0EFA, where);
 
     <span style="color:#0000FF">obj</span> Q62K = [[Engine Function:_createGlobalObjectAt|<span style="color:#FF0000;font-weight:bold">createGlobalObjectAt</span>]](0x0EFA, where);
 +
    <span style="color:#0000FF">if</span> (Q62K == [[Engine Function:_NULL|<span style="color:#FF0000;font-weight:bold">NULL</span>]]())
 +
    {
 +
      <span style="color:#0000FF">return</span> ([[Engine Function:_NULL|<span style="color:#FF0000;font-weight:bold">NULL</span>]]());
 +
    }
 +
    [[Engine Function:_setType|<span style="color:#FF0000;font-weight:bold">setType</span>]](Q62K, 0x14F2);
 +
    [[Engine Function:_setStatus|<span style="color:#FF0000;font-weight:bold">setStatus</span>]](Q62K, 0x80, 0x01);
 +
    <span style="color:#0000FF">int</span> Q5SR = 0x00;
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](ship, <span style="color:#800000">"myshiptype"</span>))
 +
    {
 +
      Q5SR = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](ship, <span style="color:#800000">"myshiptype"</span>);
 +
      [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](Q62K, <span style="color:#800000">"myshiptype"</span>, Q5SR);
 +
    }
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](ship, <span style="color:#800000">"mymultiname"</span>))
 +
    {
 +
      <span style="color:#0000FF">string</span> Q57O = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](ship, <span style="color:#800000">"mymultiname"</span>);
 +
      [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](Q62K, <span style="color:#800000">"mymultiname"</span>, Q57O);
 +
    }
 +
    [[Script_Function:_Q43Y|<span style="color:#2B91AF">Q43Y</span>]](Q62K, ship, where);
 +
    [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](Q62K, <span style="color:#800000">"claimloc"</span>, where);
 +
    [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](Q62K, <span style="color:#800000">"shipobj"</span>, ship);
 +
    [[Engine Function:_attachScript|<span style="color:#FF0000;font-weight:bold">attachScript</span>]](Q62K, <span style="color:#800000">"shipclaim"</span>);
 +
    <span style="color:#0000FF">int</span> Q52Q = [[Engine Function:_putObjContainer|<span style="color:#FF0000;font-weight:bold">putObjContainer</span>]](ship, Q62K);
 +
    <span style="color:#0000FF">return</span> (Q62K);
 +
  }
 +
 +
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">obj</span> Q440(<span style="color:#0000FF">obj</span> ship, <span style="color:#0000FF">loc</span> where)
 +
  {
 +
    <span style="color:#0000FF">list</span> Q5G9;
 +
    [[Engine Function:_getObjectsOnMulti|<span style="color:#FF0000;font-weight:bold">getObjectsOnMulti</span>]](Q5G9, ship);
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q5G9) > 0x00)
 +
    {
 +
      <span style="color:#0000FF">return</span> ([[Engine Function:_NULL|<span style="color:#FF0000;font-weight:bold">NULL</span>]]());
 +
    }
 +
    <span style="color:#0000FF">obj</span> shiphold = [[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>]](ship, <span style="color:#800000">"myshiphold"</span>))
 +
    {
 +
      shiphold = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](ship, <span style="color:#800000">"myshiphold"</span>);
 +
    }
 +
    <span style="color:#0000FF">if</span> (shiphold != [[Engine Function:_NULL|<span style="color:#FF0000;font-weight:bold">NULL</span>]]())
 +
    {
 +
      <span style="color:#0000FF">list</span> Q4E4;
 +
      [[Engine Function:_getContents|<span style="color:#FF0000;font-weight:bold">getContents</span>]](Q4E4, shiphold);
 +
      <span style="color:#0000FF">int</span> Q5EQ = [[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q4E4);
 +
      <span style="color:#0000FF">if</span> (Q5EQ > 0x00)
 +
      {
 +
        <span style="color:#0000FF">return</span> ([[Engine Function:_NULL|<span style="color:#FF0000;font-weight:bold">NULL</span>]]());
 +
      }
 +
    }
 +
    <span style="color:#0000FF">obj</span> Q62K = [[Engine Function:_createGlobalObjectAt|<span style="color:#FF0000;font-weight:bold">createGlobalObjectAt</span>]](0x0E76, where);
 
     <span style="color:#0000FF">if</span> (Q62K == [[Engine Function:_NULL|<span style="color:#FF0000;font-weight:bold">NULL</span>]]())
 
     <span style="color:#0000FF">if</span> (Q62K == [[Engine Function:_NULL|<span style="color:#FF0000;font-weight:bold">NULL</span>]]())
 
     {
 
     {

Latest revision as of 15:06, 12 October 2018

 function obj Q440(obj ship, loc where)
 {
   list Q5G9;
   getObjectsOnMulti(Q5G9, ship);
   if (numInList(Q5G9) > 0x00)
   {
     return (NULL());
   }
   obj Q62K = createGlobalObjectAt(0x0EFA, where);
   if (Q62K == NULL())
   {
     return (NULL());
   }
   setType(Q62K, 0x14F2);
   setStatus(Q62K, 0x80, 0x01);
   int Q5SR = 0x00;
   if (hasObjVar(ship, "myshiptype"))
   {
     Q5SR = getObjVar(ship, "myshiptype");
     setObjVar(Q62K, "myshiptype", Q5SR);
   }
   if (hasObjVar(ship, "mymultiname"))
   {
     string Q57O = getObjVar(ship, "mymultiname");
     setObjVar(Q62K, "mymultiname", Q57O);
   }
   Q43Y(Q62K, ship, where);
   setObjVar(Q62K, "claimloc", where);
   setObjVar(Q62K, "shipobj", ship);
   attachScript(Q62K, "shipclaim");
   int Q52Q = putObjContainer(ship, Q62K);
   return (Q62K);
 }
 function obj Q440(obj ship, loc where)
 {
   list Q5G9;
   getObjectsOnMulti(Q5G9, ship);
   if (numInList(Q5G9) > 0x00)
   {
     return (NULL());
   }
   obj shiphold = NULL();
   if (hasObjVar(ship, "myshiphold"))
   {
     shiphold = getObjVar(ship, "myshiphold");
   }
   if (shiphold != NULL())
   {
     list Q4E4;
     getContents(Q4E4, shiphold);
     int Q5EQ = numInList(Q4E4);
     if (Q5EQ > 0x00)
     {
       return (NULL());
     }
   }
   obj Q62K = createGlobalObjectAt(0x0E76, where);
   if (Q62K == NULL())
   {
     return (NULL());
   }
   setType(Q62K, 0x14F2);
   setStatus(Q62K, 0x80, 0x01);
   int Q5SR = 0x00;
   if (hasObjVar(ship, "myshiptype"))
   {
     Q5SR = getObjVar(ship, "myshiptype");
     setObjVar(Q62K, "myshiptype", Q5SR);
   }
   if (hasObjVar(ship, "mymultiname"))
   {
     string Q57O = getObjVar(ship, "mymultiname");
     setObjVar(Q62K, "mymultiname", Q57O);
   }
   Q43Y(Q62K, ship, where);
   setObjVar(Q62K, "claimloc", where);
   setObjVar(Q62K, "shipobj", ship);
   attachScript(Q62K, "shipclaim");
   int Q52Q = putObjContainer(ship, Q62K);
   return (Q62K);
 }