Difference between revisions of "Script Function: Q4IH"
From Ultima Online: The Second Age
(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...") |
|||
(One intermediate revision by the same user not shown) | |||
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 = [[ | + | <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>]]()) | ||
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> (![[ | + | <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> ([[ | + | <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; }