Script: 2540

From Ultima Online: The Second Age
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);
}