Difference between revisions of "Script Function: Q4IH"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q4IH(<span style="color:#0000FF">obj</span> this) { <span style="color:#0000FF">str...")
 
Line 5: Line 5:
 
     <span style="color:#0000FF">if</span> (Q5ZW != [[Engine Function:_NULL|<span style="color:#FF0000;font-weight:bold">NULL</span>]]())
 
     <span style="color:#0000FF">if</span> (Q5ZW != [[Engine Function:_NULL|<span style="color:#FF0000;font-weight:bold">NULL</span>]]())
 
     {
 
     {
       <span style="color:#0000FF">int</span> Q4Q1 = [[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](this, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q5ZW));
+
       <span style="color:#0000FF">int</span> Q4Q1 = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](this, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q5ZW));
 
       <span style="color:#0000FF">obj</span> Q4WM = [[Engine Function:_getItemAtSlot|<span style="color:#FF0000;font-weight:bold">getItemAtSlot</span>]](Q5ZW, 0x19);
 
       <span style="color:#0000FF">obj</span> Q4WM = [[Engine Function:_getItemAtSlot|<span style="color:#FF0000;font-weight:bold">getItemAtSlot</span>]](Q5ZW, 0x19);
 
       <span style="color:#0000FF">if</span> (Q4WM != [[Engine Function:_NULL|<span style="color:#FF0000;font-weight:bold">NULL</span>]]())
 
       <span style="color:#0000FF">if</span> (Q4WM != [[Engine Function:_NULL|<span style="color:#FF0000;font-weight:bold">NULL</span>]]())

Revision as of 07:40, 19 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;
 }