Difference between revisions of "Script: Trapped"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">inherits</span> globals; <span style="color:#0000FF">trigger</span> message(<span style="color:#800000">"TRAP"</span>) { <span style="co...")
 
 
Line 48: Line 48:
 
   {
 
   {
 
     <span style="color:#0000FF">loc</span> Q4VS = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"TrapTeleportLoc"</span>);
 
     <span style="color:#0000FF">loc</span> Q4VS = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"TrapTeleportLoc"</span>);
     <span style="color:#0000FF">int</span> Q64U = [[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](victim, Q4VS);
+
     <span style="color:#0000FF">int</span> Q64U = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](victim, Q4VS);
 
   }
 
   }
 
   <span style="color:#0000FF">else</span>
 
   <span style="color:#0000FF">else</span>

Latest revision as of 06:57, 19 October 2018

inherits globals;
trigger message("TRAP")
{
  obj victim = args[0x00];
  string Q58D = args[0x01];
  string me = "blah";
  if (hasObjVar(this, "TrapTheMessage"))
  {
    me = getObjVar(this, "TrapTheMessage");
  }
  if (me != Q58D)
  {
    return (0x00);
  }
  if (hasObjVar(this, "TrapDoesAnim"))
  {
    int Q465 = getObjVar(this, "TrapDoesAnim");
    switch (Q465)
    {
    default
      bark(this, "Nothing visible happens.");
      break;
    case 0x01
      bark(this, "Eerie sparklies hover over " + getName(this) + ".");
      break;
    case 0x02
      bark(this, "A fiery explosion results!");
      break;
    case 0x03
      bark(this, "A puff of smoke goes up!");
      break;
    }
  }
  if (hasObjVar(this, "TrapPoisonLevel"))
  {
    int Q5JA = getObjVar(this, "TrapPoisonLevel");
    barkTo(this, victim, "A tiny needle jabs at your finger!");
    int Q5J9 = getObjVar(this, "TrapPoisonLevel");
    setObjVar(victim, "poison_strength", Q5J9);
  }
  if (hasObjVar(this, "TrapDamage"))
  {
    loseHP(victim, getObjVar(this, "TrapDamage"));
    bark(this, "You are hurt!");
  }
  if (hasObjVar(this, "TrapTeleportLoc"))
  {
    loc Q4VS = getObjVar(this, "TrapTeleportLoc");
    int Q64U = teleport(victim, Q4VS);
  }
  else
  {
    bark(this, "No teleportation set on trap.");
  }
  return (0x00);
}