Script: Badmessage

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">inherits</span> globals; <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q42L(<span style="color:#0000FF...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
inherits globals;
function void Q42L(obj it)
{
  if (hasObjVar(it, "badPerson"))
  {
    removeObjVar(it, "badPerson");
  }
  detachScript(it, "badmessage");
  return ();
}
trigger callback(0x87)
{
  obj Q68S = NULL();
  if (hasObjVar(this, "badPerson"))
  {
    systemMessage(this, "What message do you wish to send to the player?");
    textEntry(this, this, 0x19, 0x00, "");
    callback(this, 0x5A, 0x7B);
  }
  else
  {
    Q42L(this);
  }
  return (0x01);
}
trigger creation
{
  shortcallback(this, 0x00, 0x87);
  return (0x01);
}
trigger textentry(0x19)
{
  removeCallback(this, 0x7B);
  if ((button == 0x00) || (text == "") || (sender != this))
  {
    Q42L(this);
    return (0x00);
  }
  obj Q5HY = getObjVar(this, "badPerson");
  string Q4DW = "dc tell ";
  concat(Q4DW, objToStr(Q5HY));
  concat(Q4DW, " GM ");
  concat(Q4DW, text);
  doSCommand(this, Q4DW);
  string Q4TU = "Sent: ";
  concat(Q4TU, text);
  systemMessage(this, Q4TU);
  Q42L(this);
  return (0x01);
}
trigger callback(0x7B)
{
  systemMessage(this, "Text entry timed out");
  Q42L(this);
  return (0x01);
}