Difference between revisions of "Script: Sparkler"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">inherits</span> globals; <span style="color:#0000FF">member</span> <span style="color:#0000FF">int</span> state; <span style="color:#0000FF...")
 
 
Line 18: Line 18:
 
   dest = Q5U8;
 
   dest = Q5U8;
 
   [[Engine Function:_changeLoc|<span style="color:#FF0000;font-weight:bold">changeLoc</span>]](dest, [[Engine Function:_random|<span style="color:#FF0000;font-weight:bold">random</span>]](0x00 - 0x02, 0x02), [[Engine Function:_random|<span style="color:#FF0000;font-weight:bold">random</span>]](0x00 - 0x02, 0x02), 0x20);
 
   [[Engine Function:_changeLoc|<span style="color:#FF0000;font-weight:bold">changeLoc</span>]](dest, [[Engine Function:_random|<span style="color:#FF0000;font-weight:bold">random</span>]](0x00 - 0x02, 0x02), [[Engine Function:_random|<span style="color:#FF0000;font-weight:bold">random</span>]](0x00 - 0x02, 0x02), 0x20);
   [[doMissile_Loc2Loc|<span style="color:#FF0000;font-weight:bold">doMissile_Loc2Loc</span>]](Q5U8, dest, 0x36E4, 0x05, 0x00, 0x00);
+
   [[Engine Function:_doMissile_Loc2Loc|<span style="color:#FF0000;font-weight:bold">doMissile_Loc2Loc</span>]](Q5U8, dest, 0x36E4, 0x05, 0x00, 0x00);
 
   shortCallback(this, 0x03, 0x2F);
 
   shortCallback(this, 0x03, 0x2F);
 
   state = 0x01;
 
   state = 0x01;

Latest revision as of 16:17, 19 October 2018

inherits globals;
member int state;
member int fuel;
member loc dest;
trigger creation
{
  state = 0x00;
  fuel = 0x64;
  return (0x00);
}
function void Q52B()
{
  loc Q5U8 = getLocation(this);
  changeLoc(Q5U8, 0x00, 0x00, 0x0A);
  dest = Q5U8;
  changeLoc(dest, random(0x00 - 0x02, 0x02), random(0x00 - 0x02, 0x02), 0x20);
  doMissile_Loc2Loc(Q5U8, dest, 0x36E4, 0x05, 0x00, 0x00);
  shortCallback(this, 0x03, 0x2F);
  state = 0x01;
  return ();
}
trigger use
{
  if (state == 0x00)
  {
    systemMessage(user, "You launch a firework!");
    state = 0x01;
    Q52B();
    return (0x00);
  }
  systemMessage(user, "Wait until the one in the air has exploded first.");
  return (0x00);
}
trigger callback(0x2F)
{
  state = 0x00;
  int Q465 = 0x373A + (0x10 * random(0x00, 0x03));
  doLocAnimation(dest, Q465, 0x0A, 0x10, 0x00, 0x00);
  fuel--;
  string Q58D = fuel;
  Q58D = "a fireworks wand with " + Q58D + " charges.";
  setObjVar(this, "lookAtText", Q58D);
  if (fuel < 0x00)
  {
    deleteObject(this);
    return (0x00);
  }
  return (0x00);
}