Difference between revisions of "Script: Markbase"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">inherits</span> spelskil; <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q4A2(<span style="color:#0000FF...")
 
 
Line 40: Line 40:
 
     <span style="color:#0000FF">return</span> (0x00);
 
     <span style="color:#0000FF">return</span> (0x00);
 
   }
 
   }
   <span style="color:#0000FF">if</span> ([[isOnAnyMulti|<span style="color:#2B91AF">isOnAnyMulti</span>]](user))
+
   <span style="color:#0000FF">if</span> ([[Script Function:_isOnAnyMulti|<span style="color:#2B91AF">isOnAnyMulti</span>]](user))
 
   {
 
   {
 
     [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](user, <span style="color:#800000">"You can not mark an object at that location."</span>);
 
     [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](user, <span style="color:#800000">"You can not mark an object at that location."</span>);

Latest revision as of 13:55, 19 October 2018

inherits spelskil;
function int Q4A2(obj it)
{
  int objtype = getObjType(it);
  switch (objtype)
  {
  case 0x1F14
  case 0x1F15
  case 0x1F16
  case 0x1F17
    return (0x01);
    break;
  default
    return (0x00);
    break;
  }
  return (0x00);
}
function int Q43D(obj user, obj usedon)
{
  if (usedon == NULL())
  {
    return (0x00);
  }
  if (!isValid(usedon))
  {
    bark(user, "I cannot mark that object.");
    return (0x00);
  }
  if ((containedBy(usedon) == NULL()) && (canSeeObj(user, usedon) != 0x01))
  {
    bark(user, "I cannot see that object.");
    return (0x00);
  }
  if (isMobile(usedon) || (!Q4A2(usedon)))
  {
    bark(user, "I cannot mark that object.");
    return (0x00);
  }
  if (isOnAnyMulti(user))
  {
    bark(user, "You can not mark an object at that location.");
    return (0x00);
  }
  return (0x01);
}
function int Q4KT(obj user, obj usedon)
{
  int Q5NC = 0x00;
  if (Q43D(user, usedon))
  {
    loc Q4VS = getLocation(user);
    if (Q50L(Q4VS))
    {
      Q5NC = 0x01;
      setObjVar(usedon, "markLoc", Q4VS);
      list Q5DR;
      message(usedon, "marked", Q5DR);
      doLocAnimation(getLocation(usedon), 0x3779, 0x0A, 0x0F, 0x00, 0x00);
      sfx(Q4VS, 0x01FA, 0x00);
    }
    else
    {
      systemMessage(user, "Thy spell doth not appear to work...");
    }
  }
  Q5UQ(this);
  return (Q5NC);
}