Difference between revisions of "Script: Hidesk"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">inherits</span> spelskil; <span style="color:#0000FF">member</span> <span style="color:#0000FF">loc</span> where; <span style="color:#0000...")
 
 
(2 intermediate revisions by the same user not shown)
Line 10: Line 10:
 
  <span style="color:#0000FF">trigger</span> callback(0x4D)
 
  <span style="color:#0000FF">trigger</span> callback(0x4D)
 
  {
 
  {
   [[Engine Function:_detachScript|<span style="color:#FF0000;font-weight:bold">detachScript</span>]](this, <span style="color:#800000">"[[hide|<span style="color:#2B91AF">hide</span>]]sk"</span>);
+
   [[Engine Function:_detachScript|<span style="color:#FF0000;font-weight:bold">detachScript</span>]](this, <span style="color:#800000">"hidesk"</span>);
 
   <span style="color:#0000FF">return</span> (0x00);
 
   <span style="color:#0000FF">return</span> (0x00);
 
  }
 
  }
Line 70: Line 70:
 
   <span style="color:#0000FF">if</span> (![[Script_Function:_Q49Y|<span style="color:#2B91AF">Q49Y</span>]](this))
 
   <span style="color:#0000FF">if</span> (![[Script_Function:_Q49Y|<span style="color:#2B91AF">Q49Y</span>]](this))
 
   {
 
   {
     [[Engine Function:_barkToHued|<span style="color:#FF0000;font-weight:bold">barkToHued</span>]](this, this, 0x22, <span style="color:#800000">"You can't seem to [[hide|<span style="color:#2B91AF">hide</span>]] right now."</span>);
+
     [[Engine Function:_barkToHued|<span style="color:#FF0000;font-weight:bold">barkToHued</span>]](this, this, 0x22, <span style="color:#800000">"You can't seem to hide right now."</span>);
 
     <span style="color:#0000FF">return</span> (0x00);
 
     <span style="color:#0000FF">return</span> (0x00);
 
   }
 
   }
Line 84: Line 84:
 
     where = [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this);
 
     where = [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this);
 
     [[Engine Function:_callback|<span style="color:#FF0000;font-weight:bold">callback</span>]](this, 0x01, 0x94);
 
     [[Engine Function:_callback|<span style="color:#FF0000;font-weight:bold">callback</span>]](this, 0x01, 0x94);
     [[hide|<span style="color:#2B91AF">hide</span>]](this);
+
     [[Script Function:_hide|<span style="color:#2B91AF">hide</span>]](this);
 
     [[Engine Function:_barkToHued|<span style="color:#FF0000;font-weight:bold">barkToHued</span>]](this, this, 0x01F4, <span style="color:#800000">"You have hidden yourself well."</span>);
 
     [[Engine Function:_barkToHued|<span style="color:#FF0000;font-weight:bold">barkToHued</span>]](this, this, 0x01F4, <span style="color:#800000">"You have hidden yourself well."</span>);
 
   }
 
   }
 
   <span style="color:#0000FF">else</span>
 
   <span style="color:#0000FF">else</span>
 
   {
 
   {
     [[Engine Function:_barkToHued|<span style="color:#FF0000;font-weight:bold">barkToHued</span>]](this, this, 0x22, <span style="color:#800000">"You can't seem to [[hide|<span style="color:#2B91AF">hide</span>]] here."</span>);
+
     [[Engine Function:_barkToHued|<span style="color:#FF0000;font-weight:bold">barkToHued</span>]](this, this, 0x22, <span style="color:#800000">"You can't seem to hide here."</span>);
 
   }
 
   }
 
   <span style="color:#0000FF">int</span> test = [[Engine Function:_testSkill|<span style="color:#FF0000;font-weight:bold">testSkill</span>]](this, 0x15);
 
   <span style="color:#0000FF">int</span> test = [[Engine Function:_testSkill|<span style="color:#FF0000;font-weight:bold">testSkill</span>]](this, 0x15);

Latest revision as of 17:49, 19 October 2018

inherits spelskil;
member loc where;
trigger message("canUseSkill")
{
  return (0x00);
}
trigger callback(0x4D)
{
  detachScript(this, "hidesk");
  return (0x00);
}
trigger callback(0x54)
{
  Q661(this);
  return (0x00);
}
trigger callback(0x94)
{
  if (getLocation(this) != where)
  {
    Q662(this, 0x00);
  }
  else
  {
    callback(this, 0x01, 0x94);
  }
  return (0x01);
}
function int Q4V8(list them, obj it)
{
  int num = numInList(them);
  for(int i = 0x00; i < num; i++)
  {
    obj Q4CZ = them[i];
    if (canSeeObj(it, Q4CZ))
    {
      return (0x01);
    }
  }
  return (0x00);
}
function int Q49Y(obj it)
{
  int Q5ES = getNumTargets(it) + getNumAttackers(it);
  list Q475;
  list Q473;
  getTargets(Q475, it);
  getAttackers(Q473, it);
  if (Q4V8(Q475, it))
  {
    return (0x00);
  }
  if (Q4V8(Q473, it))
  {
    return (0x00);
  }
  return (0x01);
}
trigger message("useSkill")
{
  callback(this, 0x0A, 0x4D);
  if (!Q49Y(this))
  {
    barkToHued(this, this, 0x22, "You can't seem to hide right now.");
    return (0x00);
  }
  loc Q4VS = getLocation(this);
  int Q5KA = getSkillLevel(this, 0x15);
  list Q5FP;
  getObjectsInRangeWithFlags(Q5FP, Q4VS, 0x02, 0x40);
  int Q5FO = numInList(Q5FP);
  int Q4VY = Q5KA + Q5FO;
  int Q4B2 = random(0x01, 0x64);
  if (Q4B2 <= Q4VY)
  {
    where = getLocation(this);
    callback(this, 0x01, 0x94);
    hide(this);
    barkToHued(this, this, 0x01F4, "You have hidden yourself well.");
  }
  else
  {
    barkToHued(this, this, 0x22, "You can't seem to hide here.");
  }
  int test = testSkill(this, 0x15);
  callback(this, 0x012C, 0x54);
  return (0x00);
}
trigger message("uninvis")
{
  Q662(this, 0x00);
  return (0x01);
}