Difference between revisions of "Script Function: Q5VF"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q5VF(<span style="color:#0000FF">obj</span> this, <span style="color:#0000FF">obj</span> s...")
 
 
Line 1: Line 1:
 +
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q5VF(<span style="color:#0000FF">obj</span> this, <span style="color:#0000FF">obj</span> speaker, <span style="color:#0000FF">string</span> arg)
 +
  {
 +
    <span style="color:#0000FF">list</span> args;
 +
    [[Engine Function:_split|<span style="color:#FF0000;font-weight:bold">split</span>]](args, arg);
 +
    <span style="color:#0000FF">int</span> Q4QI = 0x00;
 +
    <span style="color:#0000FF">int</span> Q4Q1;
 +
    <span style="color:#0000FF">string</span> bar;
 +
    <span style="color:#0000FF">list</span> Q4BC;
 +
    <span style="color:#0000FF">list</span> Q5Z4;
 +
    <span style="color:#0000FF">string</span> Q4QS;
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_getResourcesOnObj|<span style="color:#FF0000;font-weight:bold">getResourcesOnObj</span>]](this, 0x00, Q5Z4))
 +
    {
 +
      [[Engine Function:_copyList|<span style="color:#FF0000;font-weight:bold">copyList</span>]](Q4BC, Q5Z4);
 +
    }
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_getResourcesOnObj|<span style="color:#FF0000;font-weight:bold">getResourcesOnObj</span>]](this, 0x02, Q5Z4))
 +
    {
 +
      for(<span style="color:#0000FF">int</span> i = 0x00; i < ([[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q5Z4) - 0x01); i++)
 +
      {
 +
        bar = Q5Z4[i];
 +
        [[Engine Function:_appendToList|<span style="color:#FF0000;font-weight:bold">appendToList</span>]](Q4BC, bar);
 +
      }
 +
    }
 +
    <span style="color:#0000FF">string</span> Q47Y;
 +
    for(i = 0x00; i < [[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q4BC); i++)
 +
    {
 +
      for(<span style="color:#0000FF">int</span> Q518 = 0x00; Q518 < [[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](args); Q518++)
 +
      {
 +
        bar = Q4BC[i];
 +
        Q47Y = args[Q518];
 +
        <span style="color:#0000FF">if</span> (bar == Q47Y)
 +
        {
 +
          Q4QI = 0x01;
 +
          Q4QS = Q4BC[i];
 +
        }
 +
      }
 +
    }
 +
    <span style="color:#0000FF">if</span> (Q4QI)
 +
    {
 +
      <span style="color:#0000FF">if</span> (0x00)
 +
      {
 +
        [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, <span style="color:#800000">"Found something!"</span>);
 +
        [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, Q4QS);
 +
      }
 +
      bar = Q4QS;
 +
      <span style="color:#0000FF">if</span> ([[Engine Function:_getResource|<span style="color:#FF0000;font-weight:bold">getResource</span>]](Q4Q1, this, Q4QS, 0x00, 0x02))
 +
      {
 +
        bar = [[Engine Function:_getResourceName|<span style="color:#FF0000;font-weight:bold">getResourceName</span>]](Q4QS, 0x00);
 +
      }
 +
      <span style="color:#0000FF">else</span>
 +
      {
 +
        <span style="color:#0000FF">if</span> ([[Engine Function:_getResource|<span style="color:#FF0000;font-weight:bold">getResource</span>]](Q4Q1, this, Q4QS, 0x02, 0x02))
 +
        {
 +
          bar = [[Engine Function:_getResourceName|<span style="color:#FF0000;font-weight:bold">getResourceName</span>]](Q4QS, 0x02);
 +
        }
 +
      }
 +
      [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](this, <span style="color:#800000">"CurrentNeedString"</span>, bar);
 +
      [[Engine Function:_replyTo|<span style="color:#FF0000;font-weight:bold">replyTo</span>]](this, speaker, <span style="color:#800000">"@InternalNeedResponse"</span>);
 +
      [[Script_Function:_Q4J9|<span style="color:#2B91AF">Q4J9</span>]](this);
 +
      <span style="color:#0000FF">return</span> (0x00);
 +
    }
 +
    <span style="color:#0000FF">return</span> (0x01);
 +
  }
 +
 
   <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q5VF(<span style="color:#0000FF">obj</span> this, <span style="color:#0000FF">obj</span> speaker, <span style="color:#0000FF">string</span> arg)
 
   <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q5VF(<span style="color:#0000FF">obj</span> this, <span style="color:#0000FF">obj</span> speaker, <span style="color:#0000FF">string</span> arg)
 
   {
 
   {

Latest revision as of 15:42, 12 October 2018

 function int Q5VF(obj this, obj speaker, string arg)
 {
   list args;
   split(args, arg);
   int Q4QI = 0x00;
   int Q4Q1;
   string bar;
   list Q4BC;
   list Q5Z4;
   string Q4QS;
   if (getResourcesOnObj(this, 0x00, Q5Z4))
   {
     copyList(Q4BC, Q5Z4);
   }
   if (getResourcesOnObj(this, 0x02, Q5Z4))
   {
     for(int i = 0x00; i < (numInList(Q5Z4) - 0x01); i++)
     {
       bar = Q5Z4[i];
       appendToList(Q4BC, bar);
     }
   }
   string Q47Y;
   for(i = 0x00; i < numInList(Q4BC); i++)
   {
     for(int Q518 = 0x00; Q518 < numInList(args); Q518++)
     {
       bar = Q4BC[i];
       Q47Y = args[Q518];
       if (bar == Q47Y)
       {
         Q4QI = 0x01;
         Q4QS = Q4BC[i];
       }
     }
   }
   if (Q4QI)
   {
     if (0x00)
     {
       bark(this, "Found something!");
       bark(this, Q4QS);
     }
     bar = Q4QS;
     if (getResource(Q4Q1, this, Q4QS, 0x00, 0x02))
     {
       bar = getResourceName(Q4QS, 0x00);
     }
     else
     {
       if (getResource(Q4Q1, this, Q4QS, 0x02, 0x02))
       {
         bar = getResourceName(Q4QS, 0x02);
       }
     }
     setObjVar(this, "CurrentNeedString", bar);
     replyTo(this, speaker, "@InternalNeedResponse");
     Q4J9(this);
     return (0x00);
   }
   return (0x01);
 }
 function int Q5VF(obj this, obj speaker, string arg)
 {
   list args;
   split(args, arg);
   int Q4QI = 0x00;
   int Q4Q1;
   string bar;
   list Q4BC;
   list Q5Z4;
   string Q4QS;
   if (getResourcesOnObj(this, 0x00, Q5Z4))
   {
     copyList(Q4BC, Q5Z4);
   }
   if (getResourcesOnObj(this, 0x02, Q5Z4))
   {
     for(int i = 0x00; i < (numInList(Q5Z4) - 0x01); i++)
     {
       bar = Q5Z4[i];
       appendToList(Q4BC, bar);
     }
   }
   string Q47Y;
   for(i = 0x00; i < numInList(Q4BC); i++)
   {
     for(int Q518 = 0x00; Q518 < numInList(args); Q518++)
     {
       bar = Q4BC[i];
       Q47Y = args[Q518];
       if (bar == Q47Y)
       {
         Q4QI = 0x01;
         Q4QS = Q4BC[i];
       }
     }
   }
   if (Q4QI)
   {
     if (0x00)
     {
       bark(this, "Found something!");
       bark(this, Q4QS);
     }
     bar = Q4QS;
     if (getResource(Q4Q1, this, Q4QS, 0x00, 0x02))
     {
       bar = getResourceName(Q4QS, 0x00);
     }
     else
     {
       if (getResource(Q4Q1, this, Q4QS, 0x02, 0x02))
       {
         bar = getResourceName(Q4QS, 0x02);
       }
     }
     setObjVar(this, "CurrentNeedString", bar);
     replyTo(this, speaker, "@InternalNeedResponse");
     Q4J9(this);
     return (0x00);
   }
   return (0x01);
 }