Script: Trap locklevel one

From Ultima Online: The Second Age
Revision as of 08:09, 5 October 2018 by Grimoric (talk | contribs) (Created page with " <span style="color:#0000FF">inherits</span> globals; <span style="color:#0000FF">member</span> <span style="color:#0000FF">int</span> lockLevel; <span style="color:#0...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
inherits globals;
member int lockLevel;
trigger creation
{
  if (!hasObjVar(this, "isLocked"))
  {
    attachScript(this, "locked");
    lockLevel = random(0x00, 0x19);
    setObjVar(this, "isLocked", lockLevel);
    setObjVar(this, "lockLevel", lockLevel);
  }
  return (0x00);
}
trigger callback(0x25)
{
  if (!hasObjVar(this, "isLocked"))
  {
    setObjVar(this, "isLocked", lockLevel);
  }
  return (0x00);
}
trigger use
{
  if (!hasObjVar(this, "isLocked"))
  {
    callback(this, 0x3C, 0x25);
  }
  return (0x01);
}