Script: Sha tele new

From Ultima Online: The Second Age
Jump to: navigation, search
inherits globals;
trigger creation
{
  setType(this, 0x01);
  return (0x00);
}
trigger enterrange(0x01)
{
  if (!hasObjVar(this, "working"))
  {
    obj Q5YN = target;
    setObjVar(this, "working", Q5YN);
    setType(this, 0x373A);
    callBack(this, 0x05, 0x24);
  }
  return (0x01);
}
trigger callback(0x24)
{
  obj Q5YN;
  list Q67G;
  loc Q648;
  int Q4QI = 0x01;
  loc Q59R = getLocation(this);
  if (!hasObjVar(this, "working"))
  {
    Q4QI = 0x00;
  }
  Q5YN = getObjVar(this, "working");
  removeObjVar(this, "working");
  clearList(Q67G);
  getMobsInRange(Q67G, Q59R, 0x02);
  if (!isInList(Q67G, Q5YN))
  {
    Q4QI = 0x00;
  }
  if (!hasObjVar(this, "toLocation"))
  {
    Q4QI = 0x00;
  }
  if (Q4QI)
  {
    Q648 = getObjVar(this, "toLocation");
    if (!teleport(Q5YN, Q648))
    {
      setType(this, 0x01);
      return (0x01);
    }
    setType(this, 0x01);
    return (0x00);
  }
  setType(this, 0x01);
  return (0x00);
}