Script Function: Q5VO

From Ultima Online: The Second Age
Jump to: navigation, search
 function void Q5VO(obj Q5KS)
 {
   obj Q4WD;
   int Q511;
   obj Q4P1;
   int Q5D9 = random(0x00, 0x03);
   Q511 = Q4SJ(Q5KS);
   switch (Q5D9)
   {
   default
   case 0x00
   case 0x01
     break;
   case 0x02
   case 0x03
     if (0x00)
     {
       debugMessage("Specific item fetch attempted.");
     }
     Q4WD = Q4SI();
     if (Q4WD == NULL())
     {
       if (0x00)
       {
         debugMessage("Specific item fetch aborted.");
       }
       Q5VO(Q5KS);
       return ();
     }
     Q4P1 = requestCreateObjectIn(Q511, getBackpack(Q4WD));
     if (Q4P1 == NULL())
     {
       if (0x00)
       {
         debugMessage("Specific item fetch aborted.");
       }
       Q5VO(Q5KS);
     }
     setObjVar(Q4WD, "questReward", Q4P1);
     setObjVar(Q5KS, "questItemHolder", Q4WD);
     if (0x00)
     {
       debugMessage("Adding next leg of quest.");
     }
     Q45C(Q4WD);
     break;
   }
   list Q5LW = "'Tis an odd hobby, but I collect ", "I cannot tell thee why, but I need ", "I have need of ", "I need to get ", "I could really use ", "I have great need of ", "I could use ", "'Tis my fondest hope to own ", "I wish to own ", "I would like ", "I badly need to get ", "I dearly wish to get ", "I dearly wish to obtain ", "I wish to obtain ", "I collect ", "I would like to have ", "I collect", "'Tis my life's work to obtain ", "I have always wished ", "I have always wanted ", "I have always desired ", "I have always dreamed of getting ";
   string Q59W = Q5LW[random(0x00, numInList(Q5LW) - 0x01)];
   Q4ET(Q5KS, Q5D9);
   setObjVar(Q5KS, "questFetchReason", Q59W);
   if (0x00)
   {
     debugMessage("Item type fetch quest activated.");
   }
   setObjVar(Q5KS, "questFetchObjType", Q511);
   if (Q4P1 != NULL())
   {
     if (0x00)
     {
       debugMessage("Specific item fetch quest activated.");
     }
     setObjVar(Q5KS, "questFetchObject", Q4P1);
   }
   if (Q5KS == NULL())
   {
     return ();
   }
   attachScript(Q5KS, "quest_fetch_asker");
   return ();
 }