Script: Casting

From Ultima Online: The Second Age
Revision as of 01:04, 6 October 2018 by Grimoric (talk | contribs) (Created page with " <span style="color:#0000FF">inherits</span> spelskil; <span style="color:#0000FF">member</span> <span style="color:#0000FF">obj</span> Q5UY; <span style="color:#0000F...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
inherits spelskil;
member obj Q5UY;
function void Q4AR(obj it)
{
  setMobFlag(this, 0x02, 0x00);
  detachScript(it, "casting");
  return ();
}
trigger creation
{
  Q5UY = getObjVar(this, "spellObj");
  removeObjVar(this, "spellObj");
  setMobFlag(this, 0x02, 0x01);
  return (0x01);
}
trigger callback(0x80)
{
  list Q5A8;
  appendToList(Q5A8, this);
  message(Q5UY, "castspell", Q5A8);
  Q4AR(this);
  return (0x00);
}
trigger callback(0x82)
{
  Q4J5(this, 0x01);
  shortcallback(this, 0x04, 0x82);
  return (0x01);
}
trigger washit
{
  int Q4IB = (Q42S(Q5UY) - 0x01) * 0x03E8 / 0x07;
  Q4IB = Q4IB + damamt * 0x14;
  int Q5NC = getSkillSuccessChance(this, 0x19, Q4IB, 0x28) - random(0x00, 0x03E7);
  if (Q5NC <= 0x00)
  {
    systemMessage(this, "Your concentration is disturbed, thus ruining thy spell.");
    Q4AR(this);
    return (0x01);
  }
  return (0x01);
}