Difference between revisions of "Script: Santa"

From Ultima Online: The Second Age
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
  {
 
  {
 
   <span style="color:#0000FF">list</span> Q5JT = <span style="color:#800000">"Ho ho ho!"</span>, <span style="color:#800000">"Happy holidays!"</span>, <span style="color:#800000">"A merry season to thee!"</span>, <span style="color:#800000">"Enjoy the holidays!"</span>, <span style="color:#800000">"Ho ho ho! Happy holidays!"</span>, <span style="color:#800000">"May thy holidays be joyful!"</span>, <span style="color:#800000">"Enjoy the season!"</span>, <span style="color:#800000">"I wish thee the joy of the season!"</span>, <span style="color:#800000">"I wish thee joy! Ho ho ho!"</span>, <span style="color:#800000">"Naughty or nice? Hmm."</span>, <span style="color:#800000">"Where IS Rudolph? He's never this late."</span>, <span style="color:#800000">"Dancer, Prancer, don't wander off."</span>, <span style="color:#800000">"If I only had a sleigh..."</span>, <span style="color:#800000">"I think I'm going to cause a worldwide shortage of coal this year."</span>, <span style="color:#800000">"British? Coal or a fruitcake? Hmm."</span>, <span style="color:#800000">"Hmm, coal, or a fruitcake for Blackthorn?"</span>, <span style="color:#800000">"Hmm, I seem to have lost some weight."</span>;
 
   <span style="color:#0000FF">list</span> Q5JT = <span style="color:#800000">"Ho ho ho!"</span>, <span style="color:#800000">"Happy holidays!"</span>, <span style="color:#800000">"A merry season to thee!"</span>, <span style="color:#800000">"Enjoy the holidays!"</span>, <span style="color:#800000">"Ho ho ho! Happy holidays!"</span>, <span style="color:#800000">"May thy holidays be joyful!"</span>, <span style="color:#800000">"Enjoy the season!"</span>, <span style="color:#800000">"I wish thee the joy of the season!"</span>, <span style="color:#800000">"I wish thee joy! Ho ho ho!"</span>, <span style="color:#800000">"Naughty or nice? Hmm."</span>, <span style="color:#800000">"Where IS Rudolph? He's never this late."</span>, <span style="color:#800000">"Dancer, Prancer, don't wander off."</span>, <span style="color:#800000">"If I only had a sleigh..."</span>, <span style="color:#800000">"I think I'm going to cause a worldwide shortage of coal this year."</span>, <span style="color:#800000">"British? Coal or a fruitcake? Hmm."</span>, <span style="color:#800000">"Hmm, coal, or a fruitcake for Blackthorn?"</span>, <span style="color:#800000">"Hmm, I seem to have lost some weight."</span>;
   <span style="color:#0000FF">string</span> Q58D = Q5JT[[Engine Function:_random|<span style="color:#FF0000;font-weight:bold">random</span>]](0x00, [[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q5JT) - 0x01)];
+
   <span style="color:#0000FF">string</span> Q58D = Q5JT<nowiki>[</nowiki>[[Engine Function:_random|<span style="color:#FF0000;font-weight:bold">random</span>]](0x00, [[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q5JT) - 0x01)];
 
   [[Engine Function:_faceHere|<span style="color:#FF0000;font-weight:bold">faceHere</span>]](this, [[Engine Function:_getDirectionInternal|<span style="color:#FF0000;font-weight:bold">getDirectionInternal</span>]]([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this), [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](target)));
 
   [[Engine Function:_faceHere|<span style="color:#FF0000;font-weight:bold">faceHere</span>]](this, [[Engine Function:_getDirectionInternal|<span style="color:#FF0000;font-weight:bold">getDirectionInternal</span>]]([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this), [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](target)));
 
   [[Engine Function:_animateMobile|<span style="color:#FF0000;font-weight:bold">animateMobile</span>]](this, 0x21, 0x05, 0x01, 0x00, 0x01);
 
   [[Engine Function:_animateMobile|<span style="color:#FF0000;font-weight:bold">animateMobile</span>]](this, 0x21, 0x05, 0x01, 0x00, 0x01);
Line 90: Line 90:
 
       <span style="color:#0000FF">if</span> (!Q4Q1)
 
       <span style="color:#0000FF">if</span> (!Q4Q1)
 
       {
 
       {
         Q4Q1 = [[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](givenobj, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this));
+
         Q4Q1 = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](givenobj, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this));
 
         [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, <span style="color:#800000">"Oops, I dropped it."</span>);
 
         [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, <span style="color:#800000">"Oops, I dropped it."</span>);
 
       }
 
       }
Line 97: Line 97:
 
         [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, <span style="color:#800000">"This tasteth good."</span>);
 
         [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, <span style="color:#800000">"This tasteth good."</span>);
 
         <span style="color:#0000FF">list</span> Q5TW = 0x3C, 0x3B, 0x3A;
 
         <span style="color:#0000FF">list</span> Q5TW = 0x3C, 0x3B, 0x3A;
         sfx([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this), Q5TW[[[Engine Function:_random|<span style="color:#FF0000;font-weight:bold">random</span>]](0x00, 0x02)], 0x00);
+
         sfx([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this), Q5TW<nowiki>[</nowiki>[[Engine Function:_random|<span style="color:#FF0000;font-weight:bold">random</span>]](0x00, 0x02)], 0x00);
 
       }
 
       }
 
       <span style="color:#0000FF">if</span> (![[Engine Function:_getCompileFlag|<span style="color:#FF0000;font-weight:bold">getCompileFlag</span>]](0x01))
 
       <span style="color:#0000FF">if</span> (![[Engine Function:_getCompileFlag|<span style="color:#FF0000;font-weight:bold">getCompileFlag</span>]](0x01))
Line 128: Line 128:
 
   {
 
   {
 
     [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, <span style="color:#800000">"Thy hands are full, so here 'tis, on the ground."</span>);
 
     [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, <span style="color:#800000">"Thy hands are full, so here 'tis, on the ground."</span>);
     i = [[teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](givenobj, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](giver));
+
     i = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](givenobj, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](giver));
 
   }
 
   }
 
   <span style="color:#0000FF">return</span> (0x00);
 
   <span style="color:#0000FF">return</span> (0x00);

Latest revision as of 08:22, 19 October 2018

inherits sndfx;
trigger 500 enterrange(0x05)
{
  list Q5JT = "Ho ho ho!", "Happy holidays!", "A merry season to thee!", "Enjoy the holidays!", "Ho ho ho! Happy holidays!", "May thy holidays be joyful!", "Enjoy the season!", "I wish thee the joy of the season!", "I wish thee joy! Ho ho ho!", "Naughty or nice? Hmm.", "Where IS Rudolph? He's never this late.", "Dancer, Prancer, don't wander off.", "If I only had a sleigh...", "I think I'm going to cause a worldwide shortage of coal this year.", "British? Coal or a fruitcake? Hmm.", "Hmm, coal, or a fruitcake for Blackthorn?", "Hmm, I seem to have lost some weight.";
  string Q58D = Q5JT[random(0x00, numInList(Q5JT) - 0x01)];
  faceHere(this, getDirectionInternal(getLocation(this), getLocation(target)));
  animateMobile(this, 0x21, 0x05, 0x01, 0x00, 0x01);
  ebarkTo(this, target, Q58D);
  return (0x01);
}
trigger give
{
  list Q50W;
  int Q45Y;
  int i;
  int Q518;
  int Q4Q1;
  int Q4QI;
  list Q68E;
  list Q68F;
  list Q68L;
  string Q605;
  string Q616;
  string Q60A;
  string Q612;
  string Q60X;
  int Q4Z4;
  Q60X = getName(givenobj);
  if (getResourcesOnObj(givenobj, 0x03, Q50W))
  {
    if (getResourcesOnObj(this, 0x00, Q68E))
    {
      for(i = 0x00; i < numInList(Q68E); i++)
      {
        for(Q518 = 0x00; Q518 < numInList(Q50W); Q518++)
        {
          Q605 = Q68E[i];
          Q612 = Q50W[Q518];
          if (Q605 == Q612)
          {
            Q4Z4 = 0x01;
            Q4QI = 0x01;
            Q60X = getResourceName(Q605, 0x00);
          }
        }
      }
    }
    if (getResourcesOnObj(this, 0x02, Q68F))
    {
      for(i = 0x00; i < numInList(Q68F); i++)
      {
        for(Q518 = 0x00; Q518 < numInList(Q50W); Q518++)
        {
          Q616 = Q68F[i];
          Q612 = Q50W[Q518];
          if (Q616 == Q612)
          {
            setDesireLevel(this, 0x64);
            Q4QI = 0x01;
            Q60X = getResourceName(Q616, 0x02);
          }
        }
      }
    }
    string Q58D;
    Q58D = "Thou art giving me " + Q60X + "?";
    bark(this, Q58D);
    obj Q60Y;
    int Q5ZP;
    int Q4NA;
    if (Q4QI)
    {
      if (getObjType(givenobj) == 0x0EED)
      {
        string Q44P;
        Q4NA = getResource(Q5ZP, givenobj, "gold", 0x03, 0x02);
        if (Q5ZP > 0xFA)
        {
          Q44P = "'Tis a noble gift.";
        }
        else
        {
          Q44P = "Money is always welcome.";
        }
        bark(this, Q44P);
      }
      Q4Q1 = putObjContainer(givenobj, this);
      if (!Q4Q1)
      {
        Q4Q1 = teleport(givenobj, getLocation(this));
        bark(this, "Oops, I dropped it.");
      }
      if (Q4Z4)
      {
        bark(this, "This tasteth good.");
        list Q5TW = 0x3C, 0x3B, 0x3A;
        sfx(getLocation(this), Q5TW[random(0x00, 0x02)], 0x00);
      }
      if (!getCompileFlag(0x01))
      {
        if (getNotorietyLevel(giver) <= 0x01)
        {
          addNotoriety(giver, 0x01);
        }
      }
      else
      {
        changeFame(giver, getValue(givenobj));
        if (getKarmaLevel(giver) < 0x00)
        {
          changeKarma(giver, (0x00 - getValue(givenobj)));
        }
        else
        {
          changeKarma(giver, getValue(givenobj));
        }
      }
      deleteObject(givenobj);
      intRet(0x01);
      return (0x00);
    }
  }
  bark(this, "I am not interested in this.");
  replyTo(this, giver, "@InternalRefuseItem");
  if (giveItem(giver, givenobj) == NULL())
  {
    bark(this, "Thy hands are full, so here 'tis, on the ground.");
    i = teleport(givenobj, getLocation(giver));
  }
  return (0x00);
}
trigger convofunc("GetItem")
{
  string theItemGiven;
  if (hasObjVar(this, "theItemGiven"))
  {
    theItemGiven = getObjVar(this, "theItemGiven");
    removeObjVar(this, "theItemGiven");
  }
  else
  {
    theItemGiven = "item";
  }
  setConvoRet(theItemGiven);
  return (0x00);
}