Difference between revisions of "Script: Spiritual"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">inherits</span> sndfx; <span style="color:#0000FF">member</span> <span style="color:#0000FF">obj</span> Q5Z3; <span style="color:#0000FF">...")
 
 
Line 69: Line 69:
 
  {
 
  {
 
   <span style="color:#0000FF">loc</span> destination = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"dest"</span>);
 
   <span style="color:#0000FF">loc</span> destination = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"dest"</span>);
   <span style="color:#0000FF">if</span> ([[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](Q5Z3, destination))
+
   <span style="color:#0000FF">if</span> ([[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](Q5Z3, destination))
 
   {
 
   {
 
     [[Engine Function:_doLocAnimation|<span style="color:#FF0000;font-weight:bold">doLocAnimation</span>]]([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this), 0x3728, 0x0A, 0x0A, 0x00, 0x00);
 
     [[Engine Function:_doLocAnimation|<span style="color:#FF0000;font-weight:bold">doLocAnimation</span>]]([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this), 0x3728, 0x0A, 0x0A, 0x00, 0x00);

Latest revision as of 07:15, 19 October 2018

inherits sndfx;
member obj Q5Z3;
trigger speech("Om Om Om")
{
  list Q5HT;
  setObjVar(speaker, "spokeMantra", 0x01);
  getMobsAt(Q5HT, getLocation(this));
  for(int i = 0x00; i < numInList(Q5HT); i++)
  {
    if (hasObjVar(Q5HT[i], "spokeMantra"))
    {
      removeObjVar(Q5HT[i], "spokeMantra");
      Q5Z3 = Q5HT[i];
      callback(this, 0x01, 0x2F);
    }
  }
  if (isValid(speaker))
  {
    removeObjVar(speaker, "spokeMantra");
  }
  return (0x00);
}
trigger speech("om om om")
{
  list Q5HT;
  setObjVar(speaker, "spokeMantra", 0x01);
  getMobsAt(Q5HT, getLocation(this));
  for(int i = 0x00; i < numInList(Q5HT); i++)
  {
    if (hasObjVar(Q5HT[i], "spokeMantra"))
    {
      removeObjVar(Q5HT[i], "spokeMantra");
      Q5Z3 = Q5HT[i];
      callback(this, 0x01, 0x2F);
    }
  }
  if (isValid(speaker))
  {
    removeObjVar(speaker, "spokeMantra");
  }
  return (0x00);
}
trigger speech("OM OM OM")
{
  list Q5HT;
  setObjVar(speaker, "spokeMantra", 0x01);
  getMobsAt(Q5HT, getLocation(this));
  for(int i = 0x00; i < numInList(Q5HT); i++)
  {
    if (hasObjVar(Q5HT[i], "spokeMantra"))
    {
      removeObjVar(Q5HT[i], "spokeMantra");
      Q5Z3 = Q5HT[i];
      callback(this, 0x01, 0x2F);
    }
  }
  if (isValid(speaker))
  {
    removeObjVar(speaker, "spokeMantra");
  }
  return (0x00);
}
trigger callback(0x2F)
{
  loc destination = getObjVar(this, "dest");
  if (teleport(Q5Z3, destination))
  {
    doLocAnimation(getLocation(this), 0x3728, 0x0A, 0x0A, 0x00, 0x00);
    doLocAnimation(destination, 0x3728, 0x0A, 0x0A, 0x00, 0x00);
    sfx(destination, 0x01FE, 0x00);
  }
  else
  {
    bark(Q5Z3, "The spirits are not intune to your desires as of yet.");
  }
  return (0x00);
}