Difference between revisions of "Script Function: Q5MO"
From Ultima Online: The Second Age
(Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q5MO(<span style="color:#0000FF">obj</span> user) { <span style="color:#0000FF">if<...") |
|||
Line 5: | Line 5: | ||
<span style="color:#0000FF">if</span> ([[Script_Function:_Q4SD|<span style="color:#2B91AF">Q4SD</span>]]() != user) | <span style="color:#0000FF">if</span> ([[Script_Function:_Q4SD|<span style="color:#2B91AF">Q4SD</span>]]() != user) | ||
{ | { | ||
− | [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, | + | [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, <span style="color:#800000">"Why would you care? You don't run this shop."</span>); |
<span style="color:#0000FF">return</span> (); | <span style="color:#0000FF">return</span> (); | ||
} | } | ||
Line 11: | Line 11: | ||
[[Script_Function:_Q4CG|<span style="color:#2B91AF">Q4CG</span>]](user); | [[Script_Function:_Q4CG|<span style="color:#2B91AF">Q4CG</span>]](user); | ||
<span style="color:#0000FF">int</span> quantity = [[Script_Function:_Q4RQ|<span style="color:#2B91AF">Q4RQ</span>]](user); | <span style="color:#0000FF">int</span> quantity = [[Script_Function:_Q4RQ|<span style="color:#2B91AF">Q4RQ</span>]](user); | ||
− | <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>); |
− | [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, | + | [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, <span style="color:#800000">"I am holding "</span> + quantity + <span style="color:#800000">" gold for you."</span>); |
<span style="color:#0000FF">int</span> Q5MH = [[Script_Function:_Q4SP|<span style="color:#2B91AF">Q4SP</span>]](); | <span style="color:#0000FF">int</span> Q5MH = [[Script_Function:_Q4SP|<span style="color:#2B91AF">Q4SP</span>]](); | ||
− | [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, | + | [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, <span style="color:#800000">"My current charge is "</span> + Q5MH + <span style="color:#800000">" gold per day."</span>); |
<span style="color:#0000FF">int</span> Q5DZ = (quantity + myAccount) / Q5MH; | <span style="color:#0000FF">int</span> Q5DZ = (quantity + myAccount) / Q5MH; | ||
<span style="color:#0000FF">int</span> Q4NF = Q5DZ / 0x0C; | <span style="color:#0000FF">int</span> Q4NF = Q5DZ / 0x0C; | ||
<span style="color:#0000FF">if</span> (Q5DZ > 0x00) | <span style="color:#0000FF">if</span> (Q5DZ > 0x00) | ||
{ | { | ||
− | [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, | + | [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, <span style="color:#800000">"Including your gold I'm holding, I have enough gold to continue working for "</span> + Q5DZ + <span style="color:#800000">" days. ("</span> + Q4NF + <span style="color:#800000">" earth days)"</span>); |
} | } | ||
<span style="color:#0000FF">else</span> | <span style="color:#0000FF">else</span> | ||
{ | { | ||
<span style="color:#0000FF">int</span> Q582 = Q5MH - quantity - myAccount; | <span style="color:#0000FF">int</span> Q582 = Q5MH - quantity - myAccount; | ||
− | [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, | + | [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, <span style="color:#800000">"You need to give me "</span> + Q582 + <span style="color:#800000">" gold by the end of the day to retain my services."</span>); |
} | } | ||
<span style="color:#0000FF">return</span> (); | <span style="color:#0000FF">return</span> (); | ||
} | } |
Latest revision as of 02:50, 8 October 2018
function void Q5MO(obj user) { if (!isEditing(user)) { if (Q4SD() != user) { barkTo(this, user, "Why would you care? You don't run this shop."); return (); } } Q4CG(user); int quantity = Q4RQ(user); int myAccount = getObjVar(this, "myAccount"); barkTo(this, user, "I am holding " + quantity + " gold for you."); int Q5MH = Q4SP(); barkTo(this, user, "My current charge is " + Q5MH + " gold per day."); int Q5DZ = (quantity + myAccount) / Q5MH; int Q4NF = Q5DZ / 0x0C; if (Q5DZ > 0x00) { barkTo(this, user, "Including your gold I'm holding, I have enough gold to continue working for " + Q5DZ + " days. (" + Q4NF + " earth days)"); } else { int Q582 = Q5MH - quantity - myAccount; barkTo(this, user, "You need to give me " + Q582 + " gold by the end of the day to retain my services."); } return (); }