Difference between revisions of "Script Function: Q659"

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> Q659(<span style="color:#0000FF">obj</span> user) { <span style="color:#0000FF">int<...")
 
 
Line 46: Line 46:
 
       <span style="color:#0000FF">if</span> (![[Engine Function:_isInContainer|<span style="color:#FF0000;font-weight:bold">isInContainer</span>]](this))
 
       <span style="color:#0000FF">if</span> (![[Engine Function:_isInContainer|<span style="color:#FF0000;font-weight:bold">isInContainer</span>]](this))
 
       {
 
       {
         Q527 = [[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](Q5BO, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this));
+
         Q527 = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](Q5BO, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this));
 
         <span style="color:#0000FF">if</span> ([[Engine Function:_getQuantity|<span style="color:#FF0000;font-weight:bold">getQuantity</span>]](this) > 0x01)
 
         <span style="color:#0000FF">if</span> ([[Engine Function:_getQuantity|<span style="color:#FF0000;font-weight:bold">getQuantity</span>]](this) > 0x01)
 
         {
 
         {
Line 58: Line 58:
 
           {
 
           {
 
             [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"You put the remaining unlit candles at your feet."</span>);
 
             [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"You put the remaining unlit candles at your feet."</span>);
             Q527 = [[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](this, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](user));
+
             Q527 = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](this, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](user));
 
           }
 
           }
 
         }
 
         }
Line 90: Line 90:
 
       <span style="color:#0000FF">if</span> (![[Engine Function:_isInContainer|<span style="color:#FF0000;font-weight:bold">isInContainer</span>]](this))
 
       <span style="color:#0000FF">if</span> (![[Engine Function:_isInContainer|<span style="color:#FF0000;font-weight:bold">isInContainer</span>]](this))
 
       {
 
       {
         Q527 = [[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](Q5CB, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this));
+
         Q527 = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](Q5CB, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this));
 
         <span style="color:#0000FF">if</span> ([[Engine Function:_getQuantity|<span style="color:#FF0000;font-weight:bold">getQuantity</span>]](this) > 0x01)
 
         <span style="color:#0000FF">if</span> ([[Engine Function:_getQuantity|<span style="color:#FF0000;font-weight:bold">getQuantity</span>]](this) > 0x01)
 
         {
 
         {
Line 102: Line 102:
 
           {
 
           {
 
             [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"You put the remaining unlit torches at your feet."</span>);
 
             [[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"You put the remaining unlit torches at your feet."</span>);
             Q527 = [[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](this, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](user));
+
             Q527 = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](this, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](user));
 
           }
 
           }
 
         }
 
         }

Latest revision as of 08:43, 19 October 2018

 function int Q659(obj user)
 {
   int Q62A = getObjType(this);
   if (hasObjVar(this, "fuel"))
   {
     int fuel = getObjVar(this, "fuel");
   }
   switch (Q62A)
   {
   case 0x0A26
     setObjVar(this, "burning", 0x01);
     setType(this, 0x0B1A);
     break;
   case 0x0A27
     setObjVar(this, "burning", 0x01);
     setType(this, 0x0B1D);
     break;
   case 0x0A29
     setObjVar(this, "burning", 0x01);
     setType(this, 0x0B26);
     break;
   case 0x1853
     setObjVar(this, "burning", 0x01);
     setType(this, 0x1854);
     break;
   case 0x1857
     setObjVar(this, "burning", 0x01);
     setType(this, 0x1858);
     break;
   case 0x1849
     setObjVar(this, "burning", 0x01);
     setType(this, 0x184A);
     break;
   case 0x184D
     setObjVar(this, "burning", 0x01);
     setType(this, 0x184E);
     break;
   case 0x0A28
     int Q527;
     obj Q47F = getBackpack(user);
     obj Q5BO = requestCreateObjectAt(0x0A0F, getLocation(user));
     setObjVar(this, "fuel", 0x64);
     setObjVar(Q5BO, "burning", 0x01);
     attachscript(Q5BO, "torch");
     callback(Q5BO, 0x1E, 0x39);
     if (!isInContainer(this))
     {
       Q527 = teleport(Q5BO, getLocation(this));
       if (getQuantity(this) > 0x01)
       {
         destroyOne(this);
         if (canHold(Q47F, this))
         {
           systemMessage(user, "You put the remaining unlit candles into your backpack.");
           Q527 = putObjContainer(this, Q47F);
         }
         else
         {
           systemMessage(user, "You put the remaining unlit candles at your feet.");
           Q527 = teleport(this, getLocation(user));
         }
       }
     }
     else
     {
       destroyOne(this);
       if (getItemAtSlot(user, 0x02) != NULL())
       {
         systemMessage(user, "You cannot hold the candle, so it has been placed at your feet.");
       }
       else
       {
         Q527 = equipObj(Q5BO, user, 0x02);
         systemMessage(user, "You put the candle in your left hand.");
       }
     }
     if (getQuantity(this) == 0x01)
     {
       destroyOne(this);
     }
     break;
   case 0x0F64
   case 0x0F6B
     Q47F = getBackpack(user);
     obj Q5CB = requestCreateObjectAt(0x0A12, getLocation(user));
     setObjVar(this, "fuel", 0x64);
     setObjVar(Q5CB, "burning", 0x01);
     attachscript(Q5CB, "torch");
     callback(Q5CB, 0x1E, 0x39);
     if (!isInContainer(this))
     {
       Q527 = teleport(Q5CB, getLocation(this));
       if (getQuantity(this) > 0x01)
       {
         destroyOne(this);
         if (canHold(Q47F, this))
         {
           systemMessage(user, "You put the remaining unlit torches into your backpack.");
           Q527 = putObjContainer(this, Q47F);
         }
         else
         {
           systemMessage(user, "You put the remaining unlit torches at your feet.");
           Q527 = teleport(this, getLocation(user));
         }
       }
     }
     else
     {
       destroyOne(this);
       if (getItemAtSlot(user, 0x02) != NULL())
       {
         systemMessage(user, "You cannot hold the torch, so it has been placed at your feet.");
       }
       else
       {
         Q527 = equipObj(Q5CB, user, 0x02);
         systemMessage(user, "You put the torch in your left hand.");
       }
     }
     if (getQuantity(this) == 0x01)
     {
       destroyOne(this);
     }
     break;
   case 0x0A18
   case 0x0A1D
   case 0x0A25
     if (fuel > 0x00)
     {
       setObjVar(this, "burning", 0x01);
       callback(this, 0x1E, 0x39);
       setType(this, Q62A - 0x03);
     }
     else
     {
       systemMessage(user, "The lantern is out of fuel.");
     }
     break;
   default
     return (0x00);
     break;
   }
   sfx(getLocation(this), 0x47, 0x00);
   return (0x01);
 }