Script: Clumsy

From Ultima Online: The Second Age
Revision as of 06:29, 5 October 2018 by Grimoric (talk | contribs)
Jump to: navigation, search
inherits clumsybase;
trigger use
{
  [[Spelskil#Q4M9Q4M9(this, user);
  return (0x00);
}
trigger message("castspell")
{
  obj user = [[Spelskil#Q4BBQ4BB(this, args);
  if (!isValid(user))
  {
    return (0x00);
  }
  [[Spelskil#Q5RDQ5RD(user, this);
  [[Spelskil#Q4WOQ4WO(user, this);
  return (0x00);
}
trigger targetobj
{
  if (![[Spelskil#Q4C8Q4C8(user, this))
  {
    return (0x01);
  }
  if (usedon == NULL())
  {
    return (0x00);
  }
  if ([[Spelskil#Q49VQ49V(user, usedon, 0x00))
  {
    if (![[Spelskil#Q5YCQ5YC(user, this))
    {
      return (0x00);
    }
    if ([[Spelskil#Q4LTQ4LT(user, getLocation(usedon), this))
    {
      if (hasScript(usedon, "reflctor"))
      {
        doMobAnimation(usedon, 0x37B9, 0x0A, 0x05, 0x00, 0x00);
        [[Clumsybase#Q4J7Q4J7(usedon, user, 0x01);
        detachScript(usedon, "reflctor");
      }
      else
      {
        [[Clumsybase#Q4J7Q4J7(user, usedon, 0x00);
      }
    }
    else
    {
      [[Spelskil#Q4RDQ4RD(user);
    }
  }
  return (0x00);
}
trigger creation
{
  return (0x00);
}
trigger callback(0x49)
{
  obj user = getObjVar(this, "user");
  obj target = getObjVar(this, "target");
  if ([[Spelskil#Q41XQ41X(user, target))
  {
    [[Clumsybase#Q4J7Q4J7(target, user, 0x01);
    [[Spelskil#Q5MFQ5MF(target);
  }
  else
  {
    [[Clumsybase#Q4J7Q4J7(user, target, 0x00);
  }
  return (0x00);
}