Difference between revisions of "Script Function: Q5LX"
From Ultima Online: The Second Age
(Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q5LX(<span style="color:#0000FF">obj</span> this, <span style="color:#0000FF">obj</span> s...") |
|||
Line 1: | Line 1: | ||
+ | <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q5LX(<span style="color:#0000FF">obj</span> this, <span style="color:#0000FF">obj</span> speaker, <span style="color:#0000FF">string</span> arg) | ||
+ | { | ||
+ | <span style="color:#0000FF">list</span> args; | ||
+ | <span style="color:#0000FF">int</span> i; | ||
+ | <span style="color:#0000FF">int</span> Q4QI; | ||
+ | <span style="color:#0000FF">if</span> (![[Script_Function:_Q4J8|<span style="color:#2B91AF">Q4J8</span>]](this, speaker, arg)) | ||
+ | { | ||
+ | <span style="color:#0000FF">return</span> (0x01); | ||
+ | } | ||
+ | [[Engine Function:_split|<span style="color:#FF0000;font-weight:bold">split</span>]](args, arg); | ||
+ | <span style="color:#0000FF">list</span> Q5B5; | ||
+ | <span style="color:#0000FF">list</span> memoryRecent; | ||
+ | <span style="color:#0000FF">list</span> memoryNotoriety; | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"memoryRecent"</span>)) | ||
+ | { | ||
+ | [[Engine Function:_getObjListVar|<span style="color:#FF0000;font-weight:bold">getObjListVar</span>]](memoryRecent, this, <span style="color:#800000">"memoryRecent"</span>); | ||
+ | } | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"memoryNotoriety"</span>)) | ||
+ | { | ||
+ | [[Engine Function:_getObjListVar|<span style="color:#FF0000;font-weight:bold">getObjListVar</span>]](memoryNotoriety, this, <span style="color:#800000">"memoryNotoriety"</span>); | ||
+ | } | ||
+ | [[Engine Function:_copyList|<span style="color:#FF0000;font-weight:bold">copyList</span>]](Q5B5, memoryRecent); | ||
+ | <span style="color:#0000FF">if</span> (0x00) | ||
+ | { | ||
+ | debugMessage(<span style="color:#800000">"Added recent memory to the names check list."</span>); | ||
+ | } | ||
+ | <span style="color:#0000FF">list</span> Q61Q; | ||
+ | <span style="color:#0000FF">obj</span> Q609; | ||
+ | <span style="color:#0000FF">int</span> Q55T = [[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](memoryNotoriety); | ||
+ | for(i = 0x00; i < Q55T; i++) | ||
+ | { | ||
+ | [[Engine Function:_copyList|<span style="color:#FF0000;font-weight:bold">copyList</span>]](Q61Q, memoryNotoriety[i]); | ||
+ | Q609 = Q61Q[0x00]; | ||
+ | [[Engine Function:_appendToList|<span style="color:#FF0000;font-weight:bold">appendToList</span>]](Q5B5, Q609); | ||
+ | <span style="color:#0000FF">if</span> (0x00) | ||
+ | { | ||
+ | debugMessage(<span style="color:#800000">"Added a name from fame memory to the names check list."</span>); | ||
+ | } | ||
+ | } | ||
+ | <span style="color:#0000FF">int</span> Q518; | ||
+ | Q4QI = 0x00; | ||
+ | <span style="color:#0000FF">string</span> Q60L; | ||
+ | <span style="color:#0000FF">string</span> Q4BA; | ||
+ | for(i = 0x00; i < [[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](args); i++) | ||
+ | { | ||
+ | Q60L = args[i]; | ||
+ | for(Q518 = 0x00; Q518 < [[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q5B5); Q518++) | ||
+ | { | ||
+ | Q4BA = [[Engine Function:_getName|<span style="color:#FF0000;font-weight:bold">getName</span>]](Q5B5[Q518]); | ||
+ | <span style="color:#0000FF">if</span> (Q60L == Q4BA) | ||
+ | { | ||
+ | Q4QI = 0x01; | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | <span style="color:#0000FF">if</span> (!Q4QI) | ||
+ | { | ||
+ | Q4QI = [[Script_Function:_Q4CE|<span style="color:#2B91AF">Q4CE</span>]](arg); | ||
+ | } | ||
+ | <span style="color:#0000FF">if</span> (Q4QI) | ||
+ | { | ||
+ | <span style="color:#0000FF">if</span> (0x00) | ||
+ | { | ||
+ | debugMessage(<span style="color:#800000">"Recognized a name in speech."</span>); | ||
+ | } | ||
+ | Q60L = [[Engine Function:_getName|<span style="color:#FF0000;font-weight:bold">getName</span>]](Q5B5[Q518]); | ||
+ | <span style="color:#0000FF">string</span> Q4W7 = [[Engine Function:_getName|<span style="color:#FF0000;font-weight:bold">getName</span>]](speaker); | ||
+ | <span style="color:#0000FF">if</span> (Q60L != Q4W7) | ||
+ | { | ||
+ | [[Engine Function:_replyTo|<span style="color:#FF0000;font-weight:bold">replyTo</span>]](this, Q5B5[Q518], <span style="color:#800000">"@InternalNameRecognition"</span>); | ||
+ | [[Script_Function:_Q4J9|<span style="color:#2B91AF">Q4J9</span>]](this); | ||
+ | <span style="color:#0000FF">if</span> (0x00) | ||
+ | { | ||
+ | debugMessage(<span style="color:#800000">"doing Convo Pause"</span>); | ||
+ | } | ||
+ | <span style="color:#0000FF">obj</span> Q611 = Q5B5[Q518]; | ||
+ | <span style="color:#0000FF">string</span> Q58D = [[Engine Function:_getHeShe|<span style="color:#FF0000;font-weight:bold">getHeShe</span>]](Q611) + <span style="color:#800000">" is "</span> + [[Engine Function:_getDirection|<span style="color:#FF0000;font-weight:bold">getDirection</span>]]([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this), [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q611)) + <span style="color:#800000">"."</span>; | ||
+ | [[Engine Function:_toUpper|<span style="color:#FF0000;font-weight:bold">toUpper</span>]](Q58D, 0x00, 0x01); | ||
+ | [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, Q58D); | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_getDistance|<span style="color:#FF0000;font-weight:bold">getDistance</span>]]([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this), [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q611)) == <span style="color:#800000">"right here"</span>) | ||
+ | { | ||
+ | Q58D = <span style="color:#800000">"Just turn around and look."</span>; | ||
+ | } | ||
+ | <span style="color:#0000FF">else</span> | ||
+ | { | ||
+ | <span style="color:#0000FF">if</span> ([[Engine Function:_getDistance|<span style="color:#FF0000;font-weight:bold">getDistance</span>]]([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this), [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q611)) == <span style="color:#800000">"a long journey"</span>) | ||
+ | { | ||
+ | Q58D = <span style="color:#800000">"Just turn around and look."</span>; | ||
+ | } | ||
+ | <span style="color:#0000FF">else</span> | ||
+ | { | ||
+ | Q58D = [[Engine Function:_getHeShe|<span style="color:#FF0000;font-weight:bold">getHeShe</span>]](Q611) + <span style="color:#800000">" is "</span> + [[Engine Function:_getDistance|<span style="color:#FF0000;font-weight:bold">getDistance</span>]]([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this), [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q611)) + <span style="color:#800000">" from here."</span>; | ||
+ | [[Engine Function:_toUpper|<span style="color:#FF0000;font-weight:bold">toUpper</span>]](Q58D, 0x00, 0x01); | ||
+ | [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, Q58D); | ||
+ | } | ||
+ | } | ||
+ | <span style="color:#0000FF">return</span> (0x00); | ||
+ | } | ||
+ | <span style="color:#0000FF">if</span> (0x00) | ||
+ | { | ||
+ | [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, <span style="color:#800000">"Speaker asked about himself."</span>); | ||
+ | } | ||
+ | } | ||
+ | <span style="color:#0000FF">return</span> (0x01); | ||
+ | } | ||
+ | |||
<span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q5LX(<span style="color:#0000FF">obj</span> this, <span style="color:#0000FF">obj</span> speaker, <span style="color:#0000FF">string</span> arg) | <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q5LX(<span style="color:#0000FF">obj</span> this, <span style="color:#0000FF">obj</span> speaker, <span style="color:#0000FF">string</span> arg) | ||
{ | { |
Latest revision as of 14:44, 12 October 2018
function int Q5LX(obj this, obj speaker, string arg) { list args; int i; int Q4QI; if (!Q4J8(this, speaker, arg)) { return (0x01); } split(args, arg); list Q5B5; list memoryRecent; list memoryNotoriety; if (hasObjVar(this, "memoryRecent")) { getObjListVar(memoryRecent, this, "memoryRecent"); } if (hasObjVar(this, "memoryNotoriety")) { getObjListVar(memoryNotoriety, this, "memoryNotoriety"); } copyList(Q5B5, memoryRecent); if (0x00) { debugMessage("Added recent memory to the names check list."); } list Q61Q; obj Q609; int Q55T = numInList(memoryNotoriety); for(i = 0x00; i < Q55T; i++) { copyList(Q61Q, memoryNotoriety[i]); Q609 = Q61Q[0x00]; appendToList(Q5B5, Q609); if (0x00) { debugMessage("Added a name from fame memory to the names check list."); } } int Q518; Q4QI = 0x00; string Q60L; string Q4BA; for(i = 0x00; i < numInList(args); i++) { Q60L = args[i]; for(Q518 = 0x00; Q518 < numInList(Q5B5); Q518++) { Q4BA = getName(Q5B5[Q518]); if (Q60L == Q4BA) { Q4QI = 0x01; break; } } } if (!Q4QI) { Q4QI = Q4CE(arg); } if (Q4QI) { if (0x00) { debugMessage("Recognized a name in speech."); } Q60L = getName(Q5B5[Q518]); string Q4W7 = getName(speaker); if (Q60L != Q4W7) { replyTo(this, Q5B5[Q518], "@InternalNameRecognition"); Q4J9(this); if (0x00) { debugMessage("doing Convo Pause"); } obj Q611 = Q5B5[Q518]; string Q58D = getHeShe(Q611) + " is " + getDirection(getLocation(this), getLocation(Q611)) + "."; toUpper(Q58D, 0x00, 0x01); bark(this, Q58D); if (getDistance(getLocation(this), getLocation(Q611)) == "right here") { Q58D = "Just turn around and look."; } else { if (getDistance(getLocation(this), getLocation(Q611)) == "a long journey") { Q58D = "Just turn around and look."; } else { Q58D = getHeShe(Q611) + " is " + getDistance(getLocation(this), getLocation(Q611)) + " from here."; toUpper(Q58D, 0x00, 0x01); bark(this, Q58D); } } return (0x00); } if (0x00) { bark(this, "Speaker asked about himself."); } } return (0x01); }
function int Q5LX(obj this, obj speaker, string arg) { list args; int i; int Q4QI; if (!Q4J8(this, speaker, arg)) { return (0x01); } split(args, arg); list Q5B5; list memoryRecent; list memoryNotoriety; if (hasObjVar(this, "memoryRecent")) { getObjListVar(memoryRecent, this, "memoryRecent"); } if (hasObjVar(this, "memoryNotoriety")) { getObjListVar(memoryNotoriety, this, "memoryNotoriety"); } copyList(Q5B5, memoryRecent); if (0x00) { debugMessage("Added recent memory to the names check list."); } list Q61Q; obj Q609; int Q55T = numInList(memoryNotoriety); for(i = 0x00; i < Q55T; i++) { copyList(Q61Q, memoryNotoriety[i]); Q609 = Q61Q[0x00]; appendToList(Q5B5, Q609); if (0x00) { debugMessage("Added a name from fame memory to the names check list."); } } int Q518; Q4QI = 0x00; string Q60L; string Q4BA; for(i = 0x00; i < numInList(args); i++) { Q60L = args[i]; for(Q518 = 0x00; Q518 < numInList(Q5B5); Q518++) { Q4BA = getName(Q5B5[Q518]); if (Q60L == Q4BA) { Q4QI = 0x01; break; } } } if (!Q4QI) { Q4QI = Q4CE(arg); } if (Q4QI) { if (0x00) { debugMessage("Recognized a name in speech."); } Q60L = getName(Q5B5[Q518]); string Q4W7 = getName(speaker); if (Q60L != Q4W7) { replyTo(this, Q5B5[Q518], "@InternalNameRecognition"); Q4J9(this); if (0x00) { debugMessage("doing Convo Pause"); } obj Q611 = Q5B5[Q518]; string Q58D = getHeShe(Q611) + " is " + getDirection(getLocation(this), getLocation(Q611)) + "."; toUpper(Q58D, 0x00, 0x01); bark(this, Q58D); if (getDistance(getLocation(this), getLocation(Q611)) == "right here") { Q58D = "Just turn around and look."; } else { if (getDistance(getLocation(this), getLocation(Q611)) == "a long journey") { Q58D = "Just turn around and look."; } else { Q58D = getHeShe(Q611) + " is " + getDistance(getLocation(this), getLocation(Q611)) + " from here."; toUpper(Q58D, 0x00, 0x01); bark(this, Q58D); } } return (0x00); } if (0x00) { bark(this, "Speaker asked about himself."); } } return (0x01); }