Difference between revisions of "Script Function: Q4M5"
From Ultima Online: The Second Age
(Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q4M5(<span style="color:#0000FF">obj</span> this) { <span style="color:#0000FF">lis...") |
|||
Line 22: | Line 22: | ||
} | } | ||
<span style="color:#0000FF">if</span> ([[Engine Function:_getObjType|<span style="color:#FF0000;font-weight:bold">getObjType</span>]](Q61K) == 0x00) | <span style="color:#0000FF">if</span> ([[Engine Function:_getObjType|<span style="color:#FF0000;font-weight:bold">getObjType</span>]](Q61K) == 0x00) | ||
+ | { | ||
+ | <span style="color:#0000FF">return</span> (); | ||
+ | } | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"ScavengeLastItemGotten"</span>)) | ||
+ | { | ||
+ | <span style="color:#0000FF">obj</span> Q63H = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"ScavengeLastItemGotten"</span>); | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObj|<span style="color:#FF0000;font-weight:bold">hasObj</span>]](this, Q63H)) | ||
+ | { | ||
+ | [[Engine Function:_deleteObject|<span style="color:#FF0000;font-weight:bold">deleteObject</span>]](Q63H); | ||
+ | } | ||
+ | } | ||
+ | <span style="color:#0000FF">member</span> <span style="color:#0000FF">obj</span> Q5OI = Q61K; | ||
+ | [[Engine Function:_walkTo|<span style="color:#FF0000;font-weight:bold">walkTo</span>]](this, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q61K), 0x08); | ||
+ | <span style="color:#0000FF">return</span> (); | ||
+ | } | ||
+ | |||
+ | <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q4M5(<span style="color:#0000FF">obj</span> this) | ||
+ | { | ||
+ | <span style="color:#0000FF">list</span> Q5XE; | ||
+ | [[Engine Function:_getObjectsInRange|<span style="color:#FF0000;font-weight:bold">getObjectsInRange</span>]](Q5XE, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this), 0x04); | ||
+ | <span style="color:#0000FF">int</span> Q60R = [[Engine Function:_random|<span style="color:#FF0000;font-weight:bold">random</span>]](0x00, [[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q5XE) - 0x01); | ||
+ | <span style="color:#0000FF">obj</span> Q61K = Q5XE[Q60R]; | ||
+ | <span style="color:#0000FF">if</span> (![[Script_Function:_Q5W3|<span style="color:#2B91AF">Q5W3</span>]](this, Q61K)) | ||
+ | { | ||
+ | <span style="color:#0000FF">return</span> (); | ||
+ | } | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_getWeight|<span style="color:#FF0000;font-weight:bold">getWeight</span>]](Q61K) > 0x14) | ||
+ | { | ||
+ | <span style="color:#0000FF">if</span> (0x00) | ||
+ | { | ||
+ | [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, <span style="color:#800000">"Tried to scavenge something too heavy. :P"</span>); | ||
+ | } | ||
+ | <span style="color:#0000FF">return</span> (); | ||
+ | } | ||
+ | <span style="color:#0000FF">if</span> (![[Engine Function:_isMoveable|<span style="color:#FF0000;font-weight:bold">isMoveable</span>]](Q61K, this)) | ||
+ | { | ||
+ | <span style="color:#0000FF">return</span> (); | ||
+ | } | ||
+ | <span style="color:#0000FF">if</span> ([[Script_Function:_Q4Z8|<span style="color:#2B91AF">Q4Z8</span>]](this, Q61K)) | ||
+ | { | ||
+ | <span style="color:#0000FF">return</span> (); | ||
+ | } | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_getObjType|<span style="color:#FF0000;font-weight:bold">getObjType</span>]](Q61K) < 0x03) | ||
{ | { | ||
<span style="color:#0000FF">return</span> (); | <span style="color:#0000FF">return</span> (); |
Latest revision as of 14:45, 12 October 2018
function void Q4M5(obj this) { list Q5XE; getObjectsInRange(Q5XE, getLocation(this), 0x0A); int Q60R = random(0x00, numInList(Q5XE) - 0x01); obj Q61K = Q5XE[Q60R]; if (!Q5W3(this, Q61K)) { return (); } if (getWeight(Q61K) > 0x14) { if (0x00) { bark(this, "Tried to scavenge something too heavy. :P"); } return (); } if (Q4Z8(this, Q61K)) { return (); } if (getObjType(Q61K) == 0x00) { return (); } if (hasObjVar(this, "ScavengeLastItemGotten")) { obj Q63H = getObjVar(this, "ScavengeLastItemGotten"); if (hasObj(this, Q63H)) { deleteObject(Q63H); } } member obj Q5OI = Q61K; walkTo(this, getLocation(Q61K), 0x08); return (); }
function void Q4M5(obj this) { list Q5XE; getObjectsInRange(Q5XE, getLocation(this), 0x04); int Q60R = random(0x00, numInList(Q5XE) - 0x01); obj Q61K = Q5XE[Q60R]; if (!Q5W3(this, Q61K)) { return (); } if (getWeight(Q61K) > 0x14) { if (0x00) { bark(this, "Tried to scavenge something too heavy. :P"); } return (); } if (!isMoveable(Q61K, this)) { return (); } if (Q4Z8(this, Q61K)) { return (); } if (getObjType(Q61K) < 0x03) { return (); } if (hasObjVar(this, "ScavengeLastItemGotten")) { obj Q63H = getObjVar(this, "ScavengeLastItemGotten"); if (hasObj(this, Q63H)) { deleteObject(Q63H); } } member obj Q5OI = Q61K; walkTo(this, getLocation(Q61K), 0x08); return (); }