Difference between revisions of "Script: Armoire"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">inherits</span> furniture; <span style="color:#0000FF">trigger</span> use { <span style="color:#0000FF">int</span> Q5A2 = getObjType|<...")
 
 
Line 33: Line 33:
 
   <span style="color:#0000FF">case</span> 0x0A52
 
   <span style="color:#0000FF">case</span> 0x0A52
 
     [[Engine Function:_setType|<span style="color:#FF0000;font-weight:bold">setType</span>]](this, 0x0A53);
 
     [[Engine Function:_setType|<span style="color:#FF0000;font-weight:bold">setType</span>]](this, 0x0A53);
     Q4Q1 = [[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](this, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this));
+
     Q4Q1 = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](this, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this));
 
     <span style="color:#0000FF">break</span>;
 
     <span style="color:#0000FF">break</span>;
 
   <span style="color:#0000FF">case</span> 0x0A4E
 
   <span style="color:#0000FF">case</span> 0x0A4E
 
     [[Engine Function:_setType|<span style="color:#FF0000;font-weight:bold">setType</span>]](this, 0x0A4F);
 
     [[Engine Function:_setType|<span style="color:#FF0000;font-weight:bold">setType</span>]](this, 0x0A4F);
     Q4Q1 = [[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](this, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this));
+
     Q4Q1 = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](this, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this));
 
     <span style="color:#0000FF">break</span>;
 
     <span style="color:#0000FF">break</span>;
 
   <span style="color:#0000FF">case</span> 0x0A50
 
   <span style="color:#0000FF">case</span> 0x0A50
 
     [[Engine Function:_setType|<span style="color:#FF0000;font-weight:bold">setType</span>]](this, 0x0A51);
 
     [[Engine Function:_setType|<span style="color:#FF0000;font-weight:bold">setType</span>]](this, 0x0A51);
     Q4Q1 = [[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](this, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this));
+
     Q4Q1 = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](this, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this));
 
     <span style="color:#0000FF">break</span>;
 
     <span style="color:#0000FF">break</span>;
 
   <span style="color:#0000FF">case</span> 0x0A4C
 
   <span style="color:#0000FF">case</span> 0x0A4C
 
     [[Engine Function:_setType|<span style="color:#FF0000;font-weight:bold">setType</span>]](this, 0x0A4D);
 
     [[Engine Function:_setType|<span style="color:#FF0000;font-weight:bold">setType</span>]](this, 0x0A4D);
     Q4Q1 = [[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](this, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this));
+
     Q4Q1 = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](this, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this));
 
     <span style="color:#0000FF">break</span>;
 
     <span style="color:#0000FF">break</span>;
 
   <span style="color:#0000FF">default</span>
 
   <span style="color:#0000FF">default</span>

Latest revision as of 08:21, 19 October 2018

inherits furniture;
trigger use
{
  int Q5A2 = getObjType(this);
  loc Q4VS = getLocation(user);
  loc there = getLocation(this);
  int Q4IL = getDistanceInTiles(Q4VS, there);
  if (Q4IL > 0x02)
  {
    bark(user, "I am too far away to do that.");
    return (0x00);
  }
  int Q4Q1;
  switch (Q5A2)
  {
  case 0x0A53
    setType(this, 0x0A52);
    callback(this, 0x0A, 0x26);
    break;
  case 0x0A4F
    setType(this, 0x0A4E);
    callback(this, 0x0A, 0x26);
    break;
  case 0x0A51
    setType(this, 0x0A50);
    callback(this, 0x0A, 0x26);
    break;
  case 0x0A4D
    setType(this, 0x0A4C);
    callback(this, 0x0A, 0x26);
    break;
  case 0x0A52
    setType(this, 0x0A53);
    Q4Q1 = teleport(this, getLocation(this));
    break;
  case 0x0A4E
    setType(this, 0x0A4F);
    Q4Q1 = teleport(this, getLocation(this));
    break;
  case 0x0A50
    setType(this, 0x0A51);
    Q4Q1 = teleport(this, getLocation(this));
    break;
  case 0x0A4C
    setType(this, 0x0A4D);
    Q4Q1 = teleport(this, getLocation(this));
    break;
  default
    break;
  }
  return (0x01);
}
trigger callback(0x26)
{
  int Q5A2 = getObjType(this);
  switch (Q5A2)
  {
  case 0x0A52
    setType(this, 0x0A53);
    break;
  case 0x0A4E
    setType(this, 0x0A4F);
    break;
  case 0x0A50
    setType(this, 0x0A51);
    break;
  case 0x0A4C
    setType(this, 0x0A4D);
    break;
  default
    break;
  }
  return (0x00);
}
trigger wasdropped
{
  int Q62A = getObjType(this);
  switch (Q62A)
  {
  case 0x0A4C
    Q5J8(0x0A4C, 0x0A50, 0x0A4C, 0x0A50);
    break;
  case 0x0A4D
    Q5J8(0x0A4D, 0x0A51, 0x0A4D, 0x0A51);
    break;
  case 0x0A4E
    Q5J8(0x0A4E, 0x0A52, 0x0A4E, 0x0A52);
    break;
  case 0x0A4F
    Q5J8(0x0A4F, 0x0A53, 0x0A4F, 0x0A53);
    break;
  case 0x0A50
    Q5J8(0x0A4C, 0x0A50, 0x0A4C, 0x0A50);
    break;
  case 0x0A51
    Q5J8(0x0A4D, 0x0A51, 0x0A4D, 0x0A51);
    break;
  case 0x0A52
    Q5J8(0x0A4E, 0x0A52, 0x0A4E, 0x0A52);
    break;
  case 0x0A53
    Q5J8(0x0A4F, 0x0A53, 0x0A4F, 0x0A53);
    break;
  }
  return (0x01);
}