Difference between revisions of "Script Function: Q4IH"

From Ultima Online: The Second Age
Jump to: navigation, search
 
Line 15: Line 15:
 
     [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](this, <span style="color:#800000">"controllerTimeout"</span>, 0x02 * 0x3C * 0x04);
 
     [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](this, <span style="color:#800000">"controllerTimeout"</span>, 0x02 * 0x3C * 0x04);
 
     [[Engine Function:_callbackAdvanced|<span style="color:#FF0000;font-weight:bold">callbackAdvanced</span>]](this, 0x02 * 0x3C * 0x04, 0x14, 0x00);
 
     [[Engine Function:_callbackAdvanced|<span style="color:#FF0000;font-weight:bold">callbackAdvanced</span>]](this, 0x02 * 0x3C * 0x04, 0x14, 0x00);
     <span style="color:#0000FF">if</span> (![[isPet|<span style="color:#2B91AF">isPet</span>]](this))
+
     <span style="color:#0000FF">if</span> (![[Script_Function:_isPet|<span style="color:#2B91AF">isPet</span>]](this))
 
     {
 
     {
 
       [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, <span style="color:#800000">"I quit."</span>);
 
       [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, <span style="color:#800000">"I quit."</span>);
Line 45: Line 45:
 
       [[Engine Function:_setNotoriety|<span style="color:#FF0000;font-weight:bold">setNotoriety</span>]](this, 0x00);
 
       [[Engine Function:_setNotoriety|<span style="color:#FF0000;font-weight:bold">setNotoriety</span>]](this, 0x00);
 
     }
 
     }
     <span style="color:#0000FF">if</span> ([[isPet|<span style="color:#2B91AF">isPet</span>]](this))
+
     <span style="color:#0000FF">if</span> ([[Script_Function:_isPet|<span style="color:#2B91AF">isPet</span>]](this))
 
     {
 
     {
 
       [[Engine Function:_detachScript|<span style="color:#FF0000;font-weight:bold">detachScript</span>]](this, <span style="color:#800000">"pet"</span>);
 
       [[Engine Function:_detachScript|<span style="color:#FF0000;font-weight:bold">detachScript</span>]](this, <span style="color:#800000">"pet"</span>);

Latest revision as of 00:50, 21 October 2018

 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;
 }