Difference between revisions of "Script: Statbase"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">inherits</span> spelskil; <span id="Q4MA" style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q4MA(<span style="col...")
 
 
Line 1: Line 1:
 
  <span style="color:#0000FF">inherits</span> [[Script:_Spelskil|spelskil]];
 
  <span style="color:#0000FF">inherits</span> [[Script:_Spelskil|spelskil]];
  
  <span id="Q4MA" style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q4MA(<span style="color:#0000FF">obj</span> user, <span style="color:#0000FF">obj</span> usedon, <span style="color:#0000FF">int</span> Q5VX, <span style="color:#0000FF">int</span> Q4ID, <span style="color:#0000FF">int</span> Q5NM)
+
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q4MA(<span style="color:#0000FF">obj</span> user, <span style="color:#0000FF">obj</span> usedon, <span style="color:#0000FF">int</span> Q5VX, <span style="color:#0000FF">int</span> Q4ID, <span style="color:#0000FF">int</span> Q5NM)
 
  {
 
  {
 
   <span style="color:#0000FF">int</span> Q5NC = 0x00;
 
   <span style="color:#0000FF">int</span> Q5NC = 0x00;

Latest revision as of 06:44, 5 October 2018

inherits spelskil;
function int Q4MA(obj user, obj usedon, int Q5VX, int Q4ID, int Q5NM)
{
  int Q5NC = 0x00;
  int Q463;
  int Q4NC;
  if (Q50G(usedon))
  {
    loc Q4VS = getLocation(user);
    loc there = getLocation(usedon);
    faceHere(user, getDirectionInternal(Q4VS, there));
    if (hasObjVar(this, "magicItemModifier"))
    {
      int Q52W = getObjVar(this, "magicItemModifier");
      Q4NC = 0x06 * Q52W;
      Q463 = Q52W;
    }
    else
    {
      Q4NC = 0x06 * getSkillLevel(user, 0x19) / 0x05 + 0x01;
      Q463 = getSkillLevel(user, 0x19) / 0x0A + 0x01;
    }
    if (!Q4ID)
    {
      Q463 = 0x00 - Q463;
    }
    if (!Q41Q(usedon, Q5VX, Q463, Q4NC))
    {
      Q5NC = 0x01;
      Q4RD(user);
    }
    else
    {
      doMobAnimation(usedon, Q4T7(Q5VX, Q4ID), 0x0A, 0x0F, 0x00, 0x00);
      sfx(there, Q4TA(Q5VX, Q4ID), 0x00);
    }
    if (!Q4ID)
    {
      Q422(user, usedon, 0x00, Q5NM);
      Q5UK(user, usedon, 0x02, Q5NM);
      Q41C(user, usedon, Q5NM);
      receiveUnhealthyActionFrom(usedon, user);
    }
  }
  Q5UQ(this);
  return (Q5NC);
}