Script Function: Q4Y8

From Ultima Online: The Second Age
Revision as of 17:42, 12 October 2018 by Grimoric (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 function void Q4Y8()
 {
   deleteArray(0x01);
   if (isArrayInit(0x01))
   {
     return ();
   }
   list Q4DS = 0x00, "COL_NAME", 0x02, 0x03, "COL_ACTION";
   initArray(0x01, 0x05, 0x05, Q4DS);
   setArrayIntElem(0x01, 0x00, 0x00, 0x0DE1);
   setArrayIntElem(0x01, 0x02, 0x00, 0x00 - 0x03E8);
   setArrayIntElem(0x01, 0x00, 0x01, 0x1BD4);
   setArrayIntElem(0x01, 0x02, 0x01, 0x00);
   setArrayStrElem(0x01, 0x01, 0x01, "Arrow shafts using all wood");
   setArrayStrElem(0x01, 0x04, 0x01, "shafts");
   setArrayIntElem(0x01, 0x00, 0x02, 0x13B2);
   setArrayIntElem(0x01, 0x02, 0x02, 0x012C);
   setArrayIntElem(0x01, 0x00, 0x03, 0x0F4F);
   setArrayIntElem(0x01, 0x02, 0x03, 0x0258);
   setArrayIntElem(0x01, 0x00, 0x04, 0x13FD);
   setArrayIntElem(0x01, 0x02, 0x04, 0x0384);
   for(int i = 0x00; i < 0x05; i++)
   {
     int Q65M = getArrayIntElem(0x01, 0x00, i);
     obj Q61Z = createNoResObjectAt(Q65M, getLocation(this));
     int wood = 0x00;
     int Q4Q1 = getResource(wood, Q61Z, "wood", 0x03, 0x00);
     setArrayIntElem(0x01, 0x03, i, wood);
     deleteObject(Q61Z);
   }
   return ();
 }
 function void Q4Y8()
 {
   if (hasObjVar(this, "debugSkillInfo"))
   {
     deleteArray(0x00);
   }
   if (isArrayInit(0x00))
   {
     return ();
   }
   list Q4Y9 = 0x00, 0x01, "COL_NAME", 0x03, 0x04, 0x05;
   initArray(0x00, 0x06, 0x3D, Q4Y9);
   int Q5NY = 0x00;
   Q4Y9 = 0x0FAF, 0x00, "Repair an Item", 0x00;
   setArrayElems(0x00, 0x00, Q5NY, Q4Y9);
   Q5NY++;
   Q4Y9 = 0x13ED, 0x36, "Build Armor", 0x01;
   setArrayElems(0x00, 0x00, Q5NY, Q4Y9);
   Q5NY++;
   Q4Y9 = 0x13EC, 0x36, "Build Ring Armor", 0x02;
   setArrayElems(0x00, 0x00, Q5NY, Q4Y9);
   Q5NY++;
   Q4Y9 = 0x13EB, 0x13EF, 0x13F0, 0x13EC;
   Q5NY = Q4Y7(Q5NY, 0x02, Q4Y9);
   Q4Y9 = 0x13BF, 0x36, "Build Chain Armor", 0x02;
   setArrayElems(0x00, 0x00, Q5NY, Q4Y9);
   Q5NY++;
   Q4Y9 = 0x13BB, 0x13BE, 0x13BF;
   Q5NY = Q4Y7(Q5NY, 0x02, Q4Y9);
   Q4Y9 = 0x1415, 0x36, "Build Plate Armor", 0x02;
   setArrayElems(0x00, 0x00, Q5NY, Q4Y9);
   Q5NY++;
   Q4Y9 = 0x1408, 0x36, "Build Helmets", 0x03;
   setArrayElems(0x00, 0x00, Q5NY, Q4Y9);
   Q5NY++;
   Q4Y9 = 0x140A, 0x140C, 0x140E, 0x1408, 0x1412;
   Q5NY = Q4Y7(Q5NY, 0x03, Q4Y9);
   Q4Y9 = 0x1413, 0x1414, 0x1410, 0x1411, 0x1415, 0x1C04;
   Q5NY = Q4Y7(Q5NY, 0x02, Q4Y9);
   Q4Y9 = 0x1B74, 0x36, "Build Shields", 0x01;
   setArrayElems(0x00, 0x00, Q5NY, Q4Y9);
   Q5NY++;
   Q4Y9 = 0x1B73, 0x1B72, 0x1B7B, 0x1B78, 0x1B74, 0x1B76;
   Q5NY = Q4Y7(Q5NY, 0x01, Q4Y9);
   Q4Y9 = 0x0F45, 0x36, "Build Weapons", 0x01;
   setArrayElems(0x00, 0x00, Q5NY, Q4Y9);
   Q5NY++;
   Q4Y9 = 0x0F61, 0x36, "Build Blades", 0x02;
   setArrayElems(0x00, 0x00, Q5NY, Q4Y9);
   Q5NY++;
   Q4Y9 = 0x0F51, 0x1441, 0x13FF, 0x1401, 0x13B6, 0x0F5E, 0x0F61, 0x13B9;
   Q5NY = Q4Y7(Q5NY, 0x02, Q4Y9);
   Q4Y9 = 0x13FB, 0x36, "Build Axes", 0x02;
   setArrayElems(0x00, 0x00, Q5NY, Q4Y9);
   Q5NY++;
   Q4Y9 = 0x0F47, 0x0F49, 0x0F45, 0x1443, 0x0F4B, 0x13FB, 0x13B0;
   Q5NY = Q4Y7(Q5NY, 0x02, Q4Y9);
   Q4Y9 = 0x0F4D, 0x36, "Build Pole Arms", 0x02;
   setArrayElems(0x00, 0x00, Q5NY, Q4Y9);
   Q5NY++;
   Q4Y9 = 0x1403, 0x0F62, 0x1405, 0x0F4D, 0x143F;
   Q5NY = Q4Y7(Q5NY, 0x02, Q4Y9);
   Q4Y9 = 0x1407, 0x36, "Build Bludgeoning Weapons", 0x02;
   setArrayElems(0x00, 0x00, Q5NY, Q4Y9);
   Q5NY++;
   Q4Y9 = 0x0F5C, 0x143B, 0x1407, 0x1439, 0x143D;
   Q5NY = Q4Y7(Q5NY, 0x02, Q4Y9);
   debugMessage("BlackSmithing Loaded:  Allocated Rows= " + 0x3D + " Computed Rows:" + Q5NY);
   int Q576 = 0x000F4240;
   int Q55T = 0x00;
   int i;
   int val;
   int Q577;
   int Q567;
   for(i = 0x01; i < Q5NY; i++)
   {
     if (getArrayIntElem(0x00, 0x01, i) != 0x36)
     {
       val = getArrayIntElem(0x00, 0x05, i);
       if (Q55T < val)
       {
         Q55T = val;
         Q567 = getArrayIntElem(0x00, 0x00, i);
       }
       if (Q576 > val)
       {
         Q576 = val;
         Q577 = getArrayIntElem(0x00, 0x00, i);
       }
     }
   }
   debugMessage("Min Value=" + Q576 + " (" + Q577 + ") Max Value=" + Q55T + " (" + Q567 + ")");
   int range = Q55T - Q576;
   for(i = 0x01; i < Q5NY; i++)
   {
     if (getArrayIntElem(0x00, 0x01, i) != 0x36)
     {
       val = getArrayIntElem(0x00, 0x05, i);
       int Q4IA = (val - Q576) * 0x03E8 / range;
       setArrayIntElem(0x00, 0x05, i, Q4IA);
     }
   }
   return ();
 }