Script Function: Q4IH

From Ultima Online: The Second Age
Jump to: navigation, search
 function void Q4IH(obj this)
 {
   string Q58D;
   obj Q5ZW = getTopmostContainer(this);
   if (Q5ZW != NULL())
   {
     int Q4Q1 = teleport(this, getLocation(Q5ZW));
     obj Q4WM = getItemAtSlot(Q5ZW, 0x19);
     if (Q4WM != NULL())
     {
       deleteObject(Q4WM);
     }
   }
   setObjVar(this, "defensive", 0x01);
   setObjVar(this, "controllerTimeout", 0x02 * 0x3C * 0x04);
   callbackAdvanced(this, 0x02 * 0x3C * 0x04, 0x14, 0x00);
   if (!isPet(this))
   {
     bark(this, "I quit.");
   }
   else
   {
     Q4LP(this);
     Q58D = getName(this) + " appears to have decided that it is better off without a master!";
     toUpper(Q58D, 0x00, 0x01);
     bark(this, Q58D);
   }
   if (hasObjListVar(this, "myBoss"))
   {
     removeObjVar(this, "myBoss");
   }
   if (hasObjVar(this, "myLoyalty"))
   {
     removeObjVar(this, "myLoyalty");
   }
   if (hasObjVar(this, "petWhoFollow"))
   {
     removeObjVar(this, "petWhoFollow");
   }
   stopFollowing(this);
   Q4DG(this);
   enableBehaviors(this);
   if (!getCompileFlag(0x01))
   {
     setNotoriety(this, 0x00);
   }
   if (isPet(this))
   {
     detachScript(this, "pet");
   }
   return;
 }