Difference between revisions of "Script Function: Q5HG"
From Ultima Online: The Second Age
(Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q5HG() { <span style="color:#0000FF">int</span> Q5SX = Q4SP|<span style="color:#2B...") |
|||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
{ | { | ||
<span style="color:#0000FF">int</span> Q5SX = [[Script_Function:_Q4SP|<span style="color:#2B91AF">Q4SP</span>]](); | <span style="color:#0000FF">int</span> Q5SX = [[Script_Function:_Q4SP|<span style="color:#2B91AF">Q4SP</span>]](); | ||
− | <span style="color:#0000FF">int</span> myAccount = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, | + | <span style="color:#0000FF">int</span> myAccount = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"myAccount"</span>); |
myAccount = myAccount - Q5SX; | myAccount = myAccount - Q5SX; | ||
<span style="color:#0000FF">if</span> (myAccount < 0x00) | <span style="color:#0000FF">if</span> (myAccount < 0x00) | ||
Line 18: | Line 18: | ||
} | } | ||
} | } | ||
− | [[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">"myAccount"</span>, myAccount); |
<span style="color:#0000FF">return</span> (0x01); | <span style="color:#0000FF">return</span> (0x01); | ||
} | } |
Latest revision as of 02:47, 8 October 2018
function int Q5HG() { int Q5SX = Q4SP(); int myAccount = getObjVar(this, "myAccount"); myAccount = myAccount - Q5SX; if (myAccount < 0x00) { obj gold = Q64F(this, Q4SD(), 0x00 - myAccount); if (gold != NULL()) { myAccount = myAccount + getQuantity(gold); deleteObject(gold); } if (myAccount < 0x00) { Q4DB(); return (0x00); } } setObjVar(this, "myAccount", myAccount); return (0x01); }