Difference between revisions of "Script Function: Q4RW"
From Ultima Online: The Second Age
(Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">string</span> Q4RW(<span style="color:#0000FF">int</span> Q4XG) { <span style="color:#0000FF">i...") |
|||
Line 11: | Line 11: | ||
<span style="color:#0000FF">return</span> (<span style="color:#800000">"indeterminate color"</span>); | <span style="color:#0000FF">return</span> (<span style="color:#800000">"indeterminate color"</span>); | ||
<span style="color:#0000FF">break</span>; | <span style="color:#0000FF">break</span>; | ||
+ | <span style="color:#0000FF">case</span> 0x01 | ||
+ | <span style="color:#0000FF">case</span> 0x02 | ||
+ | <span style="color:#0000FF">case</span> 0x03 | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"white"</span>); | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | <span style="color:#0000FF">case</span> 0x04 | ||
+ | <span style="color:#0000FF">case</span> 0x05 | ||
+ | <span style="color:#0000FF">case</span> 0x06 | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"graying"</span>); | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | <span style="color:#0000FF">case</span> 0x07 | ||
+ | <span style="color:#0000FF">case</span> 0x08 | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"black hair"</span>); | ||
+ | <span style="color:#0000FF">case</span> 0x09 | ||
+ | <span style="color:#0000FF">case</span> 0x0A | ||
+ | <span style="color:#0000FF">case</span> 0x0B | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"copper"</span>); | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | <span style="color:#0000FF">case</span> 0x0C | ||
+ | <span style="color:#0000FF">case</span> 0x0D | ||
+ | <span style="color:#0000FF">case</span> 0x0E | ||
+ | <span style="color:#0000FF">case</span> 0x0F | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"brown"</span>); | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | <span style="color:#0000FF">case</span> 0x10 | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"reddish brown"</span>); | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | <span style="color:#0000FF">case</span> 0x11 | ||
+ | <span style="color:#0000FF">case</span> 0x12 | ||
+ | <span style="color:#0000FF">case</span> 0x13 | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"blonde"</span>); | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | <span style="color:#0000FF">case</span> 0x14 | ||
+ | <span style="color:#0000FF">case</span> 0x15 | ||
+ | <span style="color:#0000FF">case</span> 0x16 | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"light brown"</span>); | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | <span style="color:#0000FF">case</span> 0x17 | ||
+ | <span style="color:#0000FF">case</span> 0x18 | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"golden brown"</span>); | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | <span style="color:#0000FF">case</span> 0x19 | ||
+ | <span style="color:#0000FF">case</span> 0x1A | ||
+ | <span style="color:#0000FF">case</span> 0x1B | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"golden"</span>); | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | <span style="color:#0000FF">case</span> 0x1C | ||
+ | <span style="color:#0000FF">case</span> 0x1D | ||
+ | <span style="color:#0000FF">case</span> 0x1E | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"bronze"</span>); | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | <span style="color:#0000FF">case</span> 0x1F | ||
+ | <span style="color:#0000FF">case</span> 0x20 | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"dark brown"</span>); | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | <span style="color:#0000FF">case</span> 0x21 | ||
+ | <span style="color:#0000FF">case</span> 0x22 | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"sandy"</span>); | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | <span style="color:#0000FF">case</span> 0x23 | ||
+ | <span style="color:#0000FF">case</span> 0x24 | ||
+ | <span style="color:#0000FF">case</span> 0x25 | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"honey-colored"</span>); | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | <span style="color:#0000FF">case</span> 0x26 | ||
+ | <span style="color:#0000FF">case</span> 0x27 | ||
+ | <span style="color:#0000FF">case</span> 0x28 | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"red"</span>); | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | <span style="color:#0000FF">case</span> 0x29 | ||
+ | <span style="color:#0000FF">case</span> 0x2A | ||
+ | <span style="color:#0000FF">case</span> 0x2B | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"nut brown"</span>); | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | <span style="color:#0000FF">case</span> 0x2C | ||
+ | <span style="color:#0000FF">case</span> 0x2D | ||
+ | <span style="color:#0000FF">case</span> 0x2E | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"rich brown"</span>); | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | <span style="color:#0000FF">case</span> 0x2F | ||
+ | <span style="color:#0000FF">case</span> 0x30 | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"very dark brown"</span>); | ||
+ | <span style="color:#0000FF">break</span>; | ||
+ | } | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"outlandishly colored"</span>); | ||
+ | } | ||
+ | |||
+ | <span style="color:#0000FF">function</span> <span style="color:#0000FF">string</span> Q4RW(<span style="color:#0000FF">obj</span> killer) | ||
+ | { | ||
+ | <span style="color:#0000FF">obj</span> Q4UP = [[Engine Function:_getItemAtSlot|<span style="color:#FF0000;font-weight:bold">getItemAtSlot</span>]](killer, 0x0B); | ||
+ | <span style="color:#0000FF">if</span> (Q4UP == [[Engine Function:_NULL|<span style="color:#FF0000;font-weight:bold">NULL</span>]]()) | ||
+ | { | ||
+ | <span style="color:#0000FF">return</span> (<span style="color:#800000">"indeterminate color"</span>); | ||
+ | } | ||
+ | <span style="color:#0000FF">int</span> Q4XG = [[Engine Function:_getHue|<span style="color:#FF0000;font-weight:bold">getHue</span>]](Q4UP); | ||
+ | Q4XG = Q4XG - 0x044C; | ||
+ | <span style="color:#0000FF">switch</span> (Q4XG) | ||
+ | { | ||
<span style="color:#0000FF">case</span> 0x01 | <span style="color:#0000FF">case</span> 0x01 | ||
<span style="color:#0000FF">case</span> 0x02 | <span style="color:#0000FF">case</span> 0x02 |
Latest revision as of 17:37, 12 October 2018
function string Q4RW(int Q4XG) { if (!Q4XG) { return (""); } Q4XG = Q4XG - 0x044C; switch (Q4XG) { case 0x00 return ("indeterminate color"); break; case 0x01 case 0x02 case 0x03 return ("white"); break; case 0x04 case 0x05 case 0x06 return ("graying"); break; case 0x07 case 0x08 return ("black hair"); case 0x09 case 0x0A case 0x0B return ("copper"); break; case 0x0C case 0x0D case 0x0E case 0x0F return ("brown"); break; case 0x10 return ("reddish brown"); break; case 0x11 case 0x12 case 0x13 return ("blonde"); break; case 0x14 case 0x15 case 0x16 return ("light brown"); break; case 0x17 case 0x18 return ("golden brown"); break; case 0x19 case 0x1A case 0x1B return ("golden"); break; case 0x1C case 0x1D case 0x1E return ("bronze"); break; case 0x1F case 0x20 return ("dark brown"); break; case 0x21 case 0x22 return ("sandy"); break; case 0x23 case 0x24 case 0x25 return ("honey-colored"); break; case 0x26 case 0x27 case 0x28 return ("red"); break; case 0x29 case 0x2A case 0x2B return ("nut brown"); break; case 0x2C case 0x2D case 0x2E return ("rich brown"); break; case 0x2F case 0x30 return ("very dark brown"); break; } return ("outlandishly colored"); }
function string Q4RW(obj killer) { obj Q4UP = getItemAtSlot(killer, 0x0B); if (Q4UP == NULL()) { return ("indeterminate color"); } int Q4XG = getHue(Q4UP); Q4XG = Q4XG - 0x044C; switch (Q4XG) { case 0x01 case 0x02 case 0x03 return ("white"); break; case 0x04 case 0x05 case 0x06 return ("graying"); break; case 0x07 case 0x08 return ("black hair"); case 0x09 case 0x0A case 0x0B return ("copper"); break; case 0x0C case 0x0D case 0x0E case 0x0F return ("brown"); break; case 0x10 return ("reddish brown"); break; case 0x11 case 0x12 case 0x13 return ("blonde"); break; case 0x14 case 0x15 case 0x16 return ("light brown"); break; case 0x17 case 0x18 return ("golden brown"); break; case 0x19 case 0x1A case 0x1B return ("golden"); break; case 0x1C case 0x1D case 0x1E return ("bronze"); break; case 0x1F case 0x20 return ("dark brown"); break; case 0x21 case 0x22 return ("sandy"); break; case 0x23 case 0x24 case 0x25 return ("honey-colored"); break; case 0x26 case 0x27 case 0x28 return ("red"); break; case 0x29 case 0x2A case 0x2B return ("nut brown"); break; case 0x2C case 0x2D case 0x2E return ("rich brown"); break; case 0x2F case 0x30 return ("very dark brown"); break; } return ("outlandishly colored"); }