Difference between revisions of "Script Function: Q4DP"

From Ultima Online: The Second Age
Jump to: navigation, search
 
Line 4: Line 4:
 
     <span style="color:#0000FF">if</span> (Q4TX <= 0x00)
 
     <span style="color:#0000FF">if</span> (Q4TX <= 0x00)
 
     {
 
     {
       [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, <span style="color:#800000">"color:#800000">"You are overloaded already."</span>);
+
       [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, <span style="color:#800000">"You are overloaded already."</span>);
 
       <span style="color:#0000FF">return</span> ();
 
       <span style="color:#0000FF">return</span> ();
 
     }
 
     }
Line 10: Line 10:
 
     <span style="color:#0000FF">if</span> (gold == [[Engine Function:_NULL|<span style="color:#FF0000;font-weight:bold">NULL</span>]]())
 
     <span style="color:#0000FF">if</span> (gold == [[Engine Function:_NULL|<span style="color:#FF0000;font-weight:bold">NULL</span>]]())
 
     {
 
     {
       [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, <span style="color:#800000">"color:#800000">"I am holding no gold for you."</span>);
+
       [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, <span style="color:#800000">"I am holding no gold for you."</span>);
 
       <span style="color:#0000FF">return</span> ();
 
       <span style="color:#0000FF">return</span> ();
 
     }
 
     }
Line 16: Line 16:
 
     <span style="color:#0000FF">if</span> (quantity >= Q4TX)
 
     <span style="color:#0000FF">if</span> (quantity >= Q4TX)
 
     {
 
     {
       [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, <span style="color:#800000">"color:#800000">"Here is "</span> + quantity + <span style="color:#800000">"color:#800000">" gold, all you can carry."</span>);
+
       [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, <span style="color:#800000">"Here is "</span> + quantity + <span style="color:#800000">" gold, all you can carry."</span>);
 
     }
 
     }
 
     <span style="color:#0000FF">else</span>
 
     <span style="color:#0000FF">else</span>
 
     {
 
     {
       [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, <span style="color:#800000">"color:#800000">"Here is "</span> + quantity + <span style="color:#800000">"color:#800000">" gold, all I've collected."</span>);
+
       [[Engine Function:_barkTo|<span style="color:#FF0000;font-weight:bold">barkTo</span>]](this, user, <span style="color:#800000">"Here is "</span> + quantity + <span style="color:#800000">" gold, all I've collected."</span>);
 
     }
 
     }
 
     <span style="color:#0000FF">return</span> ();
 
     <span style="color:#0000FF">return</span> ();
 
   }
 
   }

Latest revision as of 19:17, 7 October 2018

 function void Q4DP(obj user)
 {
   int Q4TX = (getCanCarry(user) - getWeight(user)) * 0x32;
   if (Q4TX <= 0x00)
   {
     barkTo(this, user, "You are overloaded already.");
     return ();
   }
   obj gold = Q64F(user, user, Q4TX);
   if (gold == NULL())
   {
     barkTo(this, user, "I am holding no gold for you.");
     return ();
   }
   int quantity = getQuantity(gold);
   if (quantity >= Q4TX)
   {
     barkTo(this, user, "Here is " + quantity + " gold, all you can carry.");
   }
   else
   {
     barkTo(this, user, "Here is " + quantity + " gold, all I've collected.");
   }
   return ();
 }