Script Function: Q5MO

From Ultima Online: The Second Age
Jump to: navigation, search
 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 ();
 }