Script: L1trig4trap

From Ultima Online: The Second Age
Revision as of 21:22, 18 October 2018 by Grimoric (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
trigger message("trapCheck")
{
  list Q5IT;
  int damage;
  if (!hasObjVar(this, "disarmed"))
  {
    getPlayersInRange(Q5IT, getLocation(this), 0x03);
    for(int i = 0x00; i < numInList(Q5IT); i++)
    {
      damage = dice(0x03, 0x05);
      setCurHP(Q5IT[i], getCurHP(Q5IT[i]) - damage);
    }
  }
  return (0x00);
}
trigger message("PPdisarm")
{
  int Q5DQ;
  if (!hasObjVar(this, "disarmed"))
  {
    setObjVar(this, "disarmed", Q5DQ);
  }
  return (0x00);
}
trigger message("PPreload")
{
  if (hasObjVar(this, "disarmed"))
  {
    removeObjVar(this, "disarmed");
  }
  return (0x00);
}