Script: Trap pressure plate temp

From Ultima Online: The Second Age
Revision as of 09:08, 5 October 2018 by Grimoric (talk | contribs) (Created page with " <span style="color:#0000FF">inherits</span> globals; <span style="color:#0000FF">trigger</span> creation { setType|<span style="color:#FF0000;font-weight:bold">se...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
inherits globals;
trigger creation
{
  setType(this, 0x01);
  return (0x00);
}
trigger enterrange(0x00)
{
  if (isDead(target))
  {
    return (0x01);
  }
  if (!hasObjVar(this, "working"))
  {
    setObjVar(this, "working", 0x01);
    setType(this, 0x1122);
    shortCallback(this, 0x02, 0x26);
  }
  return (0x01);
}
trigger callback(0x26)
{
  int Q61Y = getObjType(this);
  if (Q61Y == 0x1122)
  {
    setType(this, 0x1123);
    shortCallback(this, 0x02, 0x26);
    return (0x01);
  }
  if (Q61Y == 0x1123)
  {
    setType(this, 0x1124);
    shortCallback(this, 0x02, 0x26);
    return (0x01);
  }
  if (Q61Y == 0x1124)
  {
    setType(this, 0x01);
    if (hasObjVar(this, "working"))
    {
      removeObjVar(this, "working");
    }
    return (0x01);
  }
  return (0x01);
}