Script Function: Q4CL

From Ultima Online: The Second Age
Revision as of 16:27, 12 October 2018 by Grimoric (talk | contribs) (Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q4CL(<span style="color:#0000FF">obj</span> it, <span style="color:#0000FF">obj</span> use...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 function int Q4CL(obj it, obj user)
 {
   obj Q4E2 = getTopmostContainer(it);
   if ((Q4E2 != NULL()) && (Q4E2 != user))
   {
     return (0x00);
   }
   int power;
   power = Q4SO(it);
   if (power <= 0x00)
   {
     return (0x00);
   }
   if (Q42M() < 0x00)
   {
     systemMessage(user, "This crystal can not be recharged.");
     return (0x00);
   }
   if (Q42M() >= Q55T)
   {
     systemMessage(user, "This crystal is already fully charged.");
     return (0x00);
   }
   int num = charges + power;
   if (num >= Q55T)
   {
     num = Q55T;
     systemMessage(user, "You completely recharge the crystal.");
   }
   else
   {
     systemMessage(user, "You recharge the crystal.");
   }
   Q43X(num);
   Q442(it);
   Q5RE();
   return (0x01);
 }