Script Function: Q4CP

From Ultima Online: The Second Age
Revision as of 22:23, 11 October 2018 by Grimoric (talk | contribs) (Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">string</span> Q4CP(<span style="color:#0000FF">obj</span> this, <span style="color:#0000FF">list</spa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 function string Q4CP(obj this, list args)
 {
   obj reward;
   string name;
   list Q5B5;
   int Q4QI = 0x00;
   list Q5N5;
   int i;
   string Q58D;
   if (!hasObjVar(this, "questReward"))
   {
     return (Q58D);
   }
   reward = getObjVar(this, "questReward");
   name = getName(reward);
   split(Q5B5, name);
   for(i = 0x00; i < numInList(Q5B5); i++)
   {
     name = Q5B5[i];
     if (isInList(args, name))
     {
       Q4QI = 0x01;
     }
   }
   if (Q4QI)
   {
     Q5N5 = "Ah! I shan't give thee ", "Thou canst not have the ", "I will not simply give thee the ", "I shan't just give thee the ", "What? Nay, I will not just give thee ", "Ah! I will not simply hand thee ";
     Q58D = Q5N5[random(0x00, numInList(Q5N5) - 0x01)];
     Q58D = Q58D + getName(reward) + " lest thou dost as I ask." + " ";
     string Q59W = getObjVar(this, "questFetchReason");
     int Q4HL = getObjVar(this, "questFetchObjType");
     Q58D = Q58D + Q59W + getNameByType(Q4HL) + ". ";
     if (hasObjVar(this, "questItemHolder"))
     {
       obj Q4WD = getObjVar(this, "questItemHolder");
       if (Q4WD != NULL())
       {
         Q58D = Q58D + getName(Q4WD) + " hath one, I hear. ";
       }
     }
   }
   return (Q58D);
 }