Difference between revisions of "Script Function: Q4BS"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q4BS(<span style="color:#0000FF">obj</span> this, <span style="color:#0000FF">string</span...")
 
 
Line 7: Line 7:
 
     <span style="color:#0000FF">if</span> ([[Engine Function:_getWeight|<span style="color:#FF0000;font-weight:bold">getWeight</span>]](this) > 0x64)
 
     <span style="color:#0000FF">if</span> ([[Engine Function:_getWeight|<span style="color:#FF0000;font-weight:bold">getWeight</span>]](this) > 0x64)
 
     {
 
     {
       <span style="color:#0000FF">if</span> (![[isPet|<span style="color:#2B91AF">isPet</span>]](this))
+
       <span style="color:#0000FF">if</span> (![[Script_Function:_isPet|<span style="color:#2B91AF">isPet</span>]](this))
 
       {
 
       {
 
         [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, <span style="color:#800000">"I am already carrying too much."</span>);
 
         [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, <span style="color:#800000">"I am already carrying too much."</span>);
Line 18: Line 18:
 
     }
 
     }
 
     [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](this, <span style="color:#800000">"petFetch"</span>, 0x01);
 
     [[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](this, <span style="color:#800000">"petFetch"</span>, 0x01);
     <span style="color:#0000FF">if</span> (![[isPet|<span style="color:#2B91AF">isPet</span>]](this))
+
     <span style="color:#0000FF">if</span> (![[Script_Function:_isPet|<span style="color:#2B91AF">isPet</span>]](this))
 
     {
 
     {
 
       [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, <span style="color:#800000">"What shall I get for you?"</span>);
 
       [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, <span style="color:#800000">"What shall I get for you?"</span>);

Latest revision as of 00:49, 21 October 2018

 function int Q4BS(obj this, string Q698, obj speaker)
 {
   if ((Q698 != "fetch") && (Q698 != "get") && (Q698 != "bring"))
   {
     return (0x00);
   }
   if (getWeight(this) > 0x64)
   {
     if (!isPet(this))
     {
       bark(this, "I am already carrying too much.");
     }
     else
     {
       systemMessage(speaker, "Your pet couldn't possibly carry any more.");
     }
     return (0x00);
   }
   setObjVar(this, "petFetch", 0x01);
   if (!isPet(this))
   {
     bark(this, "What shall I get for you?");
   }
   else
   {
     systemMessage(speaker, "Click on the object to fetch.");
   }
   targetObj(speaker, this);
   return (0x01);
 }