Script: 2540

From Ultima Online: The Second Age
Revision as of 06:16, 7 October 2018 by Grimoric (talk | contribs) (Created page with " <span style="color:#0000FF">inherits</span> globals; <span style="color:#0000FF">trigger</span> use { targetObj|<span style="color:#FF0000;font-weight:bold">targe...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
inherits globals;
trigger use
{
  targetObj(user, this);
  return (0x01);
}
trigger targetobj
{
  if (usedon == NULL())
  {
    return (0x00);
  }
  int Q66P = getObjType(usedon);
  switch (Q66P)
  {
  case 0x103D
    string name;
    if (hasObjVar(usedon, "NAME"))
    {
      name = getObjVar(usedon, "NAME");
    }
    if (name == "sweet dough")
    {
      setType(usedon, 0x103F);
      attachScript(usedon, "4159");
      removeObjVar(usedon, "NAME");
      detachScript(usedon, "4157");
    }
    else
    {
      removeObjVar(usedon, "NAME");
      setObjVar(usedon, "NAME", "sweet dough");
      deleteObject(this);
    }
    break;
  }
  return (0x00);
}