Script: 3852

From Ultima Online: The Second Age
Revision as of 04:20, 7 October 2018 by Grimoric (talk | contribs) (Created page with " <span style="color:#0000FF">inherits</span> potion; <span style="color:#0000FF">trigger</span> creation { <span style="color:#0000FF">return</span> (0x00); } <sp...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
inherits potion;
trigger creation
{
  return (0x00);
}
trigger use
{
  if (hasObjVar(user, "potionHealed"))
  {
    barkToHued(user, user, 0x22, "You must wait 10 seconds before using another healing potion.");
    return (0x00);
  }
  if (!Q4H6(user))
  {
    return (0x00);
  }
  if (Q4NQ(user) == 0x00)
  {
    return (0x00);
  }
  setInvisible(user, 0x00);
  int power = 0x64;
  if (hasObjVar(this, "power"))
  {
    power = getObjVar(this, "power");
  }
  int Q5MJ = random(power / 0x1E, power / 0x0A);
  addHP(user, Q5MJ);
  systemMessage(user, "" + Q5MJ + " points of damage have been healed.");
  obj Q4NN = createGlobalObjectAt(0x0F0E, getLocation(this));
  setObjVar(user, "potionHealed", 0x01);
  attachScript(user, "potiontime");
  callback(user, 0x0A, 0x57);
  deleteObject(this);
  return (0x00);
}