Script: Axe trap switch

From Ultima Online: The Second Age
Revision as of 01:19, 6 October 2018 by Grimoric (talk | contribs) (Created page with " <span style="color:#0000FF">trigger</span> creation { <span style="color:#0000FF">int</span> switchState = 0x00; setType|<span style="color:#FF0000;font-weight:bold"...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
trigger creation
{
  int switchState = 0x00;
  setType(this, 0x1092);
  setObjVar(this, "switchState", switchState);
  return (0x00);
}
trigger use
{
  loc Q47E = 0x1458, 0x022D, (0x00 - 0x14);
  list Q5DQ;
  int switchState = getObjVar(this, "switchState");
  if (switchState == 0x00)
  {
    setObjVar(this, "switchState", 0x01);
    callback(this, 0x1E, 0x01);
    setType(this, 0x1091);
    messageToRange(Q47E, 0x01, "axe_disarm", Q5DQ);
    return (0x00);
  }
  else
  {
    setObjVar(this, "switchState", 0x00);
    setType(this, 0x1092);
    messageToRange(Q47E, 0x01, "axe_reload", Q5DQ);
    return (0x00);
  }
  return (0x00);
}
trigger callback(0x01)
{
  loc Q47E = 0x1458, 0x022D, (0x00 - 0x14);
  list Q5DQ;
  setObjVar(this, "switchState", 0x00);
  setType(this, 0x1092);
  messageToRange(Q47E, 0x01, "axe_reload", Q5DQ);
  return (0x00);
}