Difference between revisions of "Script Function: Q4CG"
From Ultima Online: The Second Age
(Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q4CG(<span style="color:#0000FF">obj</span> owner) { <span style="color:#0000FF">if...") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
{ | { | ||
<span style="color:#0000FF">int</span> ownerMurderCount = 0x00; | <span style="color:#0000FF">int</span> ownerMurderCount = 0x00; | ||
− | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, | + | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"ownerMurderCount"</span>)) |
{ | { | ||
− | ownerMurderCount = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, | + | ownerMurderCount = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"ownerMurderCount"</span>); |
} | } | ||
<span style="color:#0000FF">int</span> murderCount = [[Engine Function:_getMurderCount|<span style="color:#FF0000;font-weight:bold">getMurderCount</span>]](owner); | <span style="color:#0000FF">int</span> murderCount = [[Engine Function:_getMurderCount|<span style="color:#FF0000;font-weight:bold">getMurderCount</span>]](owner); | ||
<span style="color:#0000FF">if</span> (murderCount > ownerMurderCount) | <span style="color:#0000FF">if</span> (murderCount > ownerMurderCount) | ||
{ | { | ||
− | [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](this, | + | [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](this, <span style="color:#800000">"ownerMurderCount"</span>, murderCount); |
} | } | ||
} | } | ||
<span style="color:#0000FF">return</span> (); | <span style="color:#0000FF">return</span> (); | ||
} | } |
Latest revision as of 13:29, 14 October 2018
function void Q4CG(obj owner) { if (isMurderer(owner)) { int ownerMurderCount = 0x00; if (hasObjVar(this, "ownerMurderCount")) { ownerMurderCount = getObjVar(this, "ownerMurderCount"); } int murderCount = getMurderCount(owner); if (murderCount > ownerMurderCount) { setObjVar(this, "ownerMurderCount", murderCount); } } return (); }