Difference between revisions of "Script Function: Q4MG"

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> Q4MG(<span style="color:#0000FF">obj</span> user) { <span style="color:#0000FF">int<...")
 
 
Line 50: Line 50:
 
     [[Script_Function:_Q5UQ|<span style="color:#2B91AF">Q5UQ</span>]](this);
 
     [[Script_Function:_Q5UQ|<span style="color:#2B91AF">Q5UQ</span>]](this);
 
     <span style="color:#0000FF">return</span> (Q5NC);
 
     <span style="color:#0000FF">return</span> (Q5NC);
 +
  }
 +
 +
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q4MG(<span style="color:#0000FF">obj</span> user)
 +
  {
 +
    <span style="color:#0000FF">int</span> Q4NC;
 +
    <span style="color:#0000FF">loc</span> Q4VS = [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this);
 +
    <span style="color:#0000FF">loc</span> there = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"dest2"</span>);
 +
    <span style="color:#0000FF">list</span> Q5DR;
 +
    [[Engine Function:_faceHere|<span style="color:#FF0000;font-weight:bold">faceHere</span>]](user, [[Engine Function:_getDirectionInternal|<span style="color:#FF0000;font-weight:bold">getDirectionInternal</span>]](Q4VS, there));
 +
    <span style="color:#0000FF">list</span> Q5FG;
 +
    [[Engine Function:_getObjectsAt|<span style="color:#FF0000;font-weight:bold">getObjectsAt</span>]](Q5FG, there);
 +
    <span style="color:#0000FF">if</span> ([[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q5FG) == 0x00)
 +
    {
 +
      [[Engine Function:_doLocAnimation|<span style="color:#FF0000;font-weight:bold">doLocAnimation</span>]](there, 0x3728, 0x0A, 0x0A, 0x00, 0x00);
 +
      [[Engine Function:_doLocAnimation|<span style="color:#FF0000;font-weight:bold">doLocAnimation</span>]](there, 0x3728, 0x08, 0x14, 0x00, 0x00);
 +
      <span style="color:#0000FF">obj</span> daemon = [[Engine Function:_createGlobalNPCAt|<span style="color:#FF0000;font-weight:bold">createGlobalNPCAt</span>]](0x022F, there, 0x00);
 +
      sfx(there, 0x0216, 0x00);
 +
      [[Engine Function:_setType|<span style="color:#FF0000;font-weight:bold">setType</span>]](daemon, 0x0A);
 +
      [[Engine Function:_attachScript|<span style="color:#FF0000;font-weight:bold">attachScript</span>]](daemon, <span style="color:#800000">"destcrea"</span>);
 +
      Q4NC = 0x0384;
 +
      [[Engine Function:_callback|<span style="color:#FF0000;font-weight:bold">callback</span>]](daemon, Q4NC, 0x08);
 +
      [[Engine Function:_doDamage|<span style="color:#FF0000;font-weight:bold">doDamage</span>]](victim, daemon, 0x00);
 +
      <span style="color:#0000FF">return</span> ();
 +
    }
 +
    <span style="color:#0000FF">return</span> ();
 
   }
 
   }

Latest revision as of 17:24, 12 October 2018

 function int Q4MG(obj user)
 {
   int Q5NC = 0x00;
   int Q4NC;
   loc Q4VS = getLocation(user);
   loc there = Q5I9(user);
   if (!isInMap(there))
   {
     Q4RD(user);
     systemMessage(user, "There is no room to summon that here.");
   }
   else
   {
     faceHere(user, getDirectionInternal(Q4VS, there));
     if (hasObjVar(this, "magicItemModifier"))
     {
       int Q52W = getObjVar(this, "magicItemModifier");
       Q4NC = 0x06 * Q52W;
     }
     else
     {
       if (getSkillLevel(user, 0x19) < 0x0A)
       {
         Q4NC = 0x14;
       }
       else
       {
         Q4NC = 0x14 * getSkillLevel(user, 0x19) / 0x05;
       }
     }
     obj daemon = createGlobalNPCAt(0x0255, there, 0x00);
     if (daemon != NULL())
     {
       doLocAnimation(there, 0x3728, 0x0A, 0x0A, 0x00, 0x00);
       doLocAnimation(there, 0x3728, 0x08, 0x14, 0x00, 0x00);
       sfx(there, 0x0216, 0x00);
       setType(daemon, 0x0A);
       attachScript(daemon, "destcrea");
       setObjVar(daemon, "summonDifficulty", 0x03B6);
       int Q5ND = Q558(daemon, user, 0x64, 0x01);
       callback(daemon, Q4NC, 0x08);
       changeKarma(user, (0x00 - 0x1B58));
       Q5NC = 0x01;
     }
     else
     {
       barkTo(user, user, "Whoops...something got in the way.");
     }
   }
   Q5UQ(this);
   return (Q5NC);
 }
 function void Q4MG(obj user)
 {
   int Q4NC;
   loc Q4VS = getLocation(this);
   loc there = getObjVar(this, "dest2");
   list Q5DR;
   faceHere(user, getDirectionInternal(Q4VS, there));
   list Q5FG;
   getObjectsAt(Q5FG, there);
   if (numInList(Q5FG) == 0x00)
   {
     doLocAnimation(there, 0x3728, 0x0A, 0x0A, 0x00, 0x00);
     doLocAnimation(there, 0x3728, 0x08, 0x14, 0x00, 0x00);
     obj daemon = createGlobalNPCAt(0x022F, there, 0x00);
     sfx(there, 0x0216, 0x00);
     setType(daemon, 0x0A);
     attachScript(daemon, "destcrea");
     Q4NC = 0x0384;
     callback(daemon, Q4NC, 0x08);
     doDamage(victim, daemon, 0x00);
     return ();
   }
   return ();
 }