Script Function: Q5SF

From Ultima Online: The Second Age
Revision as of 22:02, 11 October 2018 by Grimoric (talk | contribs) (Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q5SF(<span style="color:#0000FF">obj</span> Q4H5, <span style="color:#0000FF">obj</span> u...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 function int Q5SF(obj Q4H5, obj user, obj Q5AO, int bank)
 {
   loc Q4VS = getLocation(user);
   list Q51X = 0x100E, 0x100F, 0x1010, 0x1013;
   int num = random(0x00, (numInList(Q51X) - 0x01));
   int Q51W = Q51X[num];
   obj Q47G = NULL();
   if (bank)
   {
     fixBank(user);
     Q47G = getItemAtSlot(user, 0x1D);
     if (Q47G == NULL())
     {
       Q47G = getBackpack(user);
       bank = 0x00;
     }
   }
   else
   {
     Q47G = getBackpack(user);
   }
   obj key = NULL();
   if (Q47G == NULL())
   {
     key = createGlobalObjectAt(Q51W, Q4VS);
     barkTo(user, user, "A ship's key is now at my feet.");
   }
   else
   {
     key = createGlobalObjectIn(Q51W, Q47G);
     if (bank)
     {
       barkTo(user, user, "A ship's key is now in my safety deposit box.");
     }
     else
     {
       barkTo(user, user, "A ship's key is now in my backpack.");
     }
   }
   if (key == NULL())
   {
     barkTo(user, user, "Ack, a key could not be created!");
     return (0x00);
   }
   attachScript(key, "key");
   attachScript(key, "shipkey");
   list Q5Z5;
   if (hasObjVar(Q5AO, "myhousedoors"))
   {
     getObjListVar(Q5Z5, Q5AO, "myhousedoors");
   }
   obj Q5AB;
   int Q55T = numInList(Q5Z5);
   for(int Q4EJ = 0x00; Q4EJ < Q55T; Q4EJ++)
   {
     Q5AB = Q5Z5[Q4EJ];
     Q45B(Q5AB, key);
   }
   return (0x01);
 }