Script Function: Q4J4

From Ultima Online: The Second Age
Jump to: navigation, search
 function void Q4J4(obj user)
 {
   list Q5J1;
   list Q5XF;
   getNPCsInRange(Q5XF, getLocation(user), 0x0C);
   getPlayersInRange(Q5J1, getLocation(user), 0x0C);
   int i;
   obj Q5Z4;
   for(i = 0x00; i < numInList(Q5J1); i++)
   {
     Q5Z4 = Q5J1[i];
     appendToList(Q5XF, Q5Z4);
   }
   if (!testSkill(user, 0x1D))
   {
     sfx(getLocation(user), badSound, 0x3C);
     barkTo(user, user, "You play poorly, and there is no effect.");
     return ();
   }
   if (!testSkill(user, 0x09))
   {
     sfx(getLocation(user), badSound, 0x3C);
     for(i = 0x00; i < numInList(Q5XF); i++)
     {
       Q5Z4 = Q5XF[i];
       if (Q5Z4 == user)
       {
         barkTo(user, user, "You attempt to calm everyone, but fail.");
       }
       else
       {
         if (isPlayer(Q5Z4))
         {
           if (getCombatMode(Q5Z4))
           {
             barkTo(Q5Z4, Q5Z4, "You hear music, and for a moment are distracted.");
           }
         }
       }
     }
     return ();
   }
   sfx(getLocation(user), goodSound, 0x3C);
   for(i = 0x00; i < numInList(Q5XF); i++)
   {
     Q5Z4 = Q5XF[i];
     if (Q5Z4 == user)
     {
       systemMessage(user, "You play your hypnotic music, stopping the battle.");
     }
     else
     {
       if (isPlayer(Q5Z4))
       {
         if (getCombatMode(Q5Z4))
         {
           barkTo(Q5Z4, Q5Z4, "You hear lovely music, and forget to continue battling!");
         }
       }
     }
     stopAttack(Q5XF[i]);
   }
   return ();
 }