Script: Sha lever two

From Ultima Online: The Second Age
Revision as of 14:13, 5 October 2018 by Grimoric (talk | contribs) (Created page with " <span style="color:#0000FF">inherits</span> globals; <span style="color:#0000FF">trigger</span> use { <span style="color:#0000FF">loc</span> Q4N2 = 0x158D, 0xB2, 0x...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
inherits globals;
trigger use
{
  loc Q4N2 = 0x158D, 0xB2, 0x00;
  list Q5DQ;
  if (!hasObjVar(this, "working"))
  {
    setObjVar(this, "working", 0x01);
    [[messageToRange|messageToRange]](Q4N2, 0x0A, "unlock", Q5DQ);
    setType(this, 0x108D);
    callback(this, 0x01, 0x24);
  }
  return (0x00);
}
trigger callback(0x24)
{
  int Q5A2 = getObjType(this);
  int newType;
  loc Q4N2 = 0x158D, 0xB2, 0x00;
  list Q5DQ;
  switch (Q5A2)
  {
  case 0x108D
    newType = 0x108C;
    callback(this, 0x01, 0x24);
    break;
  case 0x108C
    newType = 0x108E;
    callback(this, 0x3C, 0x24);
    break;
  case 0x108E
    newType = Q5A2;
    removeObjVar(this, "working");
    [[messageToRange|messageToRange]](Q4N2, 0x01, "reset", Q5DQ);
    break;
  }
  setType(this, newType);
  return (0x00);
}