Script: Dec1 floor blade

From Ultima Online: The Second Age
Revision as of 22:58, 5 October 2018 by Grimoric (talk | contribs) (Created page with " <span style="color:#0000FF">inherits</span> globals; <span style="color:#0000FF">trigger</span> message(<span style="color:#800000">"saws_on"</span>) { <span style=...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
inherits globals;
trigger message("saws_on")
{
  if (!hasObjVar(this, "armed"))
  {
    setType(this, 0x11B2);
    setObjVar(this, "armed", 0x01);
    callback(this, 0x01, 0x24);
  }
  return (0x00);
}
trigger enterrange(0x01)
{
  if (hasObjVar(this, "armed"))
  {
    loseHP(target, dice(0x0A, 0x14));
  }
  return (0x01);
}
trigger callback(0x24)
{
  list Q67G;
  getPlayersInRange(Q67G, getLocation(this), 0x01);
  if (!numInList(Q67G) == 0x00)
  {
    for(int i = 0x00; i < numInList(Q67G); i++)
    {
      if (hasObjVar(this, "armed"))
      {
        loseHP(Q67G[i], dice(0x0A, 0x14));
      }
    }
    callback(this, 0x01, 0x24);
    return (0x00);
  }
  clearList(Q67G);
  getPlayersInRange(Q67G, getLocation(this), 0x1E);
  if (numInList(Q67G) == 0x00)
  {
    setType(this, 0x11B1);
    if (hasObjVar(this, "armed"))
    {
      removeObjVar(this, "armed");
    }
  }
  else
  {
    callback(this, 0x01, 0x24);
  }
  return (0x00);
}