Script Function: Q4LU

From Ultima Online: The Second Age
Jump to: navigation, search
 function int Q4LU(obj user, loc usedon, int Q5UX, int Q50V)
 {
   if (isPlayer(user))
   {
     if (hasObjVar(user, "spellCastersLevel"))
     {
       removeObjVar(user, "spellCastersLevel");
     }
   }
   Q662(user, 0x00);
   int Q5US = Q4SY(Q5UX);
   int Q55B = Q4SX(Q5US);
   if (!Q49R(user, usedon, Q55B))
   {
     return (0x00);
   }
   int Q5TG = 0x00;
   if (Q50V)
   {
     Q5TG = 0x02;
   }
   int Q4IB = Q4SW(Q5US - Q5TG);
   if (testAndLearnSkill(user, 0x19, Q4IB, 0x28) <= 0x00)
   {
     return (0x00);
   }
   loseMana(user, Q55B);
   return (0x01);
 }