Difference between revisions of "Script Function: Q4YH"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q4YH(<span style="color:#0000FF">int</span> Q5UT) { <span style="color:#0000FF">lis...")
 
 
Line 51: Line 51:
 
         <span style="color:#0000FF">if</span> ([[Engine Function:_isValid|<span style="color:#FF0000;font-weight:bold">isValid</span>]](Q56M))
 
         <span style="color:#0000FF">if</span> ([[Engine Function:_isValid|<span style="color:#FF0000;font-weight:bold">isValid</span>]](Q56M))
 
         {
 
         {
           Q4Q1 = [[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](Q56M, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q62D));
+
           Q4Q1 = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](Q56M, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q62D));
 
         }
 
         }
 
         sfx([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q62D), 0x0249, 0x00);
 
         sfx([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](Q62D), 0x0249, 0x00);

Latest revision as of 08:45, 19 October 2018

 function void Q4YH(int Q5UT)
 {
   list Q5MR;
   Q4SL(Q5MR, Q5UT);
   loc Q66U = getLocation(Q62D);
   if (!Q5YB(Q62D, Q5MR))
   {
     systemMessage(Q62D, "You lack the necessary reagents to inscribe this spell.");
     return ();
   }
   int Q5US = Q4SY(Q5UT);
   int Q55B = Q4SX(Q5US);
   if (Q49R(Q62D, Q66U, Q55B))
   {
     loseMana(Q62D, Q55B);
     int Q4OU = 0x00;
     int Q4IA = Q4SW(Q4T1(Q5UT));
     if (!Q4A8(Q62D, Q4T1(Q5UT)))
     {
       Q4OU = 0x01;
     }
     if (!Q4OU)
     {
       if (testAndLearnSkill(Q62D, 0x17, Q4IA, 0x32) <= 0x00)
       {
         Q4OU = 0x01;
       }
     }
     if (Q4OU)
     {
       systemMessage(Q62D, "You fail to inscribe the scroll, and the scroll is ruined.");
       destroyOne(Q56M);
       return ();
     }
     int Q5AL = Q4T3(Q5UT);
     Q43Q = requestCreateObjectAt(Q5AL, getLocation(Q62D));
     destroyOne(Q56M);
     string Q5WZ;
     Q5WZ = Q5AL;
     attachscript(Q43Q, Q5WZ);
     int Q4Q1;
     obj Q47G = getBackpack(Q62D);
     if (canHold(Q47G, Q43Q))
     {
       Q4Q1 = putObjContainer(Q43Q, Q47G);
       sfx(getLocation(Q62D), 0x0249, 0x00);
       systemMessage(Q62D, "You inscribe the spell and put the scroll in your backpack.");
     }
     else
     {
       if (isValid(Q56M))
       {
         Q4Q1 = teleport(Q56M, getLocation(Q62D));
       }
       sfx(getLocation(Q62D), 0x0249, 0x00);
       systemMessage(Q62D, "You inscribe the spell and put the scroll at your feet.");
     }
     if (isValid(Q56M))
     {
       if (hasObjVar(Q56M, "inUse"))
       {
         removeObjVar(Q56M, "inUse");
       }
       if (hasScript(Q56M, "removeinuse"))
       {
         detachScript(Q56M, "removeinuse");
       }
     }
   }
   else
   {
     systemMessage(Q62D, "You fail to inscribe the scroll, and the scroll is ruined.");
     destroyOne(Q56M);
     return ();
   }
   return ();
 }