Difference between revisions of "Script Function: Q4P7"
From Ultima Online: The Second Age
(Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q4P7(<span style="color:#0000FF">list</span> Q57R) { <span style="color:#0000FF">int...") |
|||
Line 28: | Line 28: | ||
[[Engine Function:_removeItem|<span style="color:#FF0000;font-weight:bold">removeItem</span>]](Q57R, 0x00); | [[Engine Function:_removeItem|<span style="color:#FF0000;font-weight:bold">removeItem</span>]](Q57R, 0x00); | ||
<span style="color:#0000FF">if</span> ([[Engine Function:_getTemplate|<span style="color:#FF0000;font-weight:bold">getTemplate</span>]](Q57Q) == Q5ZB) | <span style="color:#0000FF">if</span> ([[Engine Function:_getTemplate|<span style="color:#FF0000;font-weight:bold">getTemplate</span>]](Q57Q) == Q5ZB) | ||
+ | { | ||
+ | Q5T8++; | ||
+ | [[Engine Function:_append|<span style="color:#FF0000;font-weight:bold">append</span>]](Q57R, Q57Q); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | <span style="color:#0000FF">return</span> (Q5T8); | ||
+ | } | ||
+ | |||
+ | <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q4P7(<span style="color:#0000FF">list</span> Q57R) | ||
+ | { | ||
+ | <span style="color:#0000FF">int</span> Q5T8 = [[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q57R); | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"findScript"</span>)) | ||
+ | { | ||
+ | <span style="color:#0000FF">int</span> Q5VU = Q5T8; | ||
+ | Q5T8 = 0x00; | ||
+ | <span style="color:#0000FF">string</span> Q5OM = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"findScript"</span>); | ||
+ | for(<span style="color:#0000FF">int</span> i = 0x00; i < Q5VU; i++) | ||
+ | { | ||
+ | <span style="color:#0000FF">obj</span> Q57Q = Q57R[0x00]; | ||
+ | [[Engine Function:_removeItem|<span style="color:#FF0000;font-weight:bold">removeItem</span>]](Q57R, 0x00); | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_hasScript|<span style="color:#FF0000;font-weight:bold">hasScript</span>]](Q57Q, Q5OM)) | ||
+ | { | ||
+ | Q5T8++; | ||
+ | [[Engine Function:_append|<span style="color:#FF0000;font-weight:bold">append</span>]](Q57R, Q57Q); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"findTemplate"</span>)) | ||
+ | { | ||
+ | Q5VU = Q5T8; | ||
+ | Q5T8 = 0x00; | ||
+ | <span style="color:#0000FF">int</span> Q5ZB = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"findTemplate"</span>); | ||
+ | for(i = 0x00; i < Q5VU; i++) | ||
+ | { | ||
+ | Q57Q = Q57R[0x00]; | ||
+ | [[Engine Function:_removeItem|<span style="color:#FF0000;font-weight:bold">removeItem</span>]](Q57R, 0x00); | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_getTemplate|<span style="color:#FF0000;font-weight:bold">getTemplate</span>]](Q57Q) == Q5ZB) | ||
+ | { | ||
+ | Q5T8++; | ||
+ | [[Engine Function:_append|<span style="color:#FF0000;font-weight:bold">append</span>]](Q57R, Q57Q); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"findObjVarInt"</span>)) | ||
+ | { | ||
+ | Q5VU = Q5T8; | ||
+ | Q5T8 = 0x00; | ||
+ | <span style="color:#0000FF">string</span> Q5FA = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"findObjVarInt"</span>); | ||
+ | <span style="color:#0000FF">int</span> Q578 = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"minValue"</span>); | ||
+ | <span style="color:#0000FF">int</span> Q568 = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"maxValue"</span>); | ||
+ | for(i = 0x00; i < Q5VU; i++) | ||
+ | { | ||
+ | Q57Q = Q57R[0x00]; | ||
+ | [[Engine Function:_removeItem|<span style="color:#FF0000;font-weight:bold">removeItem</span>]](Q57R, 0x00); | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](Q57Q, Q5FA)) | ||
+ | { | ||
+ | <span style="color:#0000FF">int</span> val = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](Q57Q, Q5FA); | ||
+ | <span style="color:#0000FF">if</span> ((val >= Q578) && (val <= Q568)) | ||
+ | { | ||
+ | Q5T8++; | ||
+ | [[Engine Function:_append|<span style="color:#FF0000;font-weight:bold">append</span>]](Q57R, Q57Q); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"findObjVarObj"</span>)) | ||
+ | { | ||
+ | Q5VU = Q5T8; | ||
+ | Q5T8 = 0x00; | ||
+ | Q5FA = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"findObjVarObj"</span>); | ||
+ | <span style="color:#0000FF">obj</span> Q5F9 = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"objValue"</span>); | ||
+ | for(i = 0x00; i < Q5VU; i++) | ||
+ | { | ||
+ | Q57Q = Q57R[0x00]; | ||
+ | [[Engine Function:_removeItem|<span style="color:#FF0000;font-weight:bold">removeItem</span>]](Q57R, 0x00); | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](Q57Q, Q5FA)) | ||
+ | { | ||
+ | <span style="color:#0000FF">if</span> (Q5F9 == [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](Q57Q, Q5FA)) | ||
+ | { | ||
+ | Q5T8++; | ||
+ | [[Engine Function:_append|<span style="color:#FF0000;font-weight:bold">append</span>]](Q57R, Q57Q); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"findFame"</span>)) | ||
+ | { | ||
+ | Q5VU = Q5T8; | ||
+ | Q5T8 = 0x00; | ||
+ | <span style="color:#0000FF">int</span> Q4OW = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"findFame"</span>); | ||
+ | for(i = 0x00; i < Q5VU; i++) | ||
+ | { | ||
+ | Q57Q = Q57R[0x00]; | ||
+ | [[Engine Function:_removeItem|<span style="color:#FF0000;font-weight:bold">removeItem</span>]](Q57R, 0x00); | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_getFame|<span style="color:#FF0000;font-weight:bold">getFame</span>]](Q57Q) >= Q4OW) | ||
{ | { | ||
Q5T8++; | Q5T8++; |
Latest revision as of 15:48, 12 October 2018
function int Q4P7(list Q57R) { int Q5T8 = numInList(Q57R); if (hasObjVar(this, "findScript")) { int Q5VU = Q5T8; Q5T8 = 0x00; string Q5OM = getObjVar(this, "findScript"); for(int i = 0x00; i < Q5VU; i++) { obj Q57Q = Q57R[0x00]; removeItem(Q57R, 0x00); if (hasScript(Q57Q, Q5OM)) { Q5T8++; append(Q57R, Q57Q); } } } if (hasObjVar(this, "findTemplate")) { Q5VU = Q5T8; Q5T8 = 0x00; int Q5ZB = getObjVar(this, "findTemplate"); for(i = 0x00; i < Q5VU; i++) { Q57Q = Q57R[0x00]; removeItem(Q57R, 0x00); if (getTemplate(Q57Q) == Q5ZB) { Q5T8++; append(Q57R, Q57Q); } } } return (Q5T8); }
function int Q4P7(list Q57R) { int Q5T8 = numInList(Q57R); if (hasObjVar(this, "findScript")) { int Q5VU = Q5T8; Q5T8 = 0x00; string Q5OM = getObjVar(this, "findScript"); for(int i = 0x00; i < Q5VU; i++) { obj Q57Q = Q57R[0x00]; removeItem(Q57R, 0x00); if (hasScript(Q57Q, Q5OM)) { Q5T8++; append(Q57R, Q57Q); } } } if (hasObjVar(this, "findTemplate")) { Q5VU = Q5T8; Q5T8 = 0x00; int Q5ZB = getObjVar(this, "findTemplate"); for(i = 0x00; i < Q5VU; i++) { Q57Q = Q57R[0x00]; removeItem(Q57R, 0x00); if (getTemplate(Q57Q) == Q5ZB) { Q5T8++; append(Q57R, Q57Q); } } } if (hasObjVar(this, "findObjVarInt")) { Q5VU = Q5T8; Q5T8 = 0x00; string Q5FA = getObjVar(this, "findObjVarInt"); int Q578 = getObjVar(this, "minValue"); int Q568 = getObjVar(this, "maxValue"); for(i = 0x00; i < Q5VU; i++) { Q57Q = Q57R[0x00]; removeItem(Q57R, 0x00); if (hasObjVar(Q57Q, Q5FA)) { int val = getObjVar(Q57Q, Q5FA); if ((val >= Q578) && (val <= Q568)) { Q5T8++; append(Q57R, Q57Q); } } } } if (hasObjVar(this, "findObjVarObj")) { Q5VU = Q5T8; Q5T8 = 0x00; Q5FA = getObjVar(this, "findObjVarObj"); obj Q5F9 = getObjVar(this, "objValue"); for(i = 0x00; i < Q5VU; i++) { Q57Q = Q57R[0x00]; removeItem(Q57R, 0x00); if (hasObjVar(Q57Q, Q5FA)) { if (Q5F9 == getObjVar(Q57Q, Q5FA)) { Q5T8++; append(Q57R, Q57Q); } } } } if (hasObjVar(this, "findFame")) { Q5VU = Q5T8; Q5T8 = 0x00; int Q4OW = getObjVar(this, "findFame"); for(i = 0x00; i < Q5VU; i++) { Q57Q = Q57R[0x00]; removeItem(Q57R, 0x00); if (getFame(Q57Q) >= Q4OW) { Q5T8++; append(Q57R, Q57Q); } } } return (Q5T8); }