Script: Immunity

From Ultima Online: The Second Age
Revision as of 21:07, 5 October 2018 by Grimoric (talk | contribs) (Created page with " <span style="color:#0000FF">inherits</span> globals; <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q434(<span style="color:#0000FF...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
inherits globals;
function void Q434(obj Q61K, int Q4NC, int Q65M)
{
  switch (Q65M)
  {
  case 0x00
    setObjVar(Q61K, "poisonImmunity", 0x01);
    if (Q4NC != 0x00)
    {
      callback(Q61K, Q4NC, 0x96)
    }
    ;
    break;
  case 0x01
    setObjVar(Q61K, "coldImmunity", 0x01);
    if (Q4NC != 0x00)
    {
      callback(Q61K, Q4NC, 0x97)
    }
    ;
    break;
  case 0x02
    setObjVar(Q61K, "fireImmunity", 0x01);
    if (Q4NC != 0x00)
    {
      callback(Q61K, Q4NC, 0x98)
    }
    ;
    break;
  default
    bark(Q61K, "Invalid immunity type.");
    break;
  }
  return ();
}
trigger callback(0x96)
{
  removeObjVar(this, "poisonImmunity");
  return (0x01);
}
trigger callback(0x97)
{
  removeObjVar(this, "coldImmunity");
  return (0x01);
}
trigger callback(0x98)
{
  removeObjVar(this, "fireImmunity");
  return (0x01);
}