Script Function: Q42R

From Ultima Online: The Second Age
Jump to: navigation, search
 function int Q42R(int Q52T)
 {
   int num;
   int die;
   int Q5J6;
   switch (Q52T)
   {
   case 0x01
     num = 0x01;
     die = 0x03;
     Q5J6 = 0x03;
     break;
   case 0x02
     num = 0x01;
     die = 0x08;
     Q5J6 = 0x04;
     break;
   case 0x03
     num = 0x04;
     die = 0x04;
     Q5J6 = 0x04;
     break;
   case 0x04
     num = 0x03;
     die = 0x08;
     Q5J6 = 0x05;
     break;
   case 0x05
     num = 0x05;
     die = 0x08;
     Q5J6 = 0x06;
     break;
   case 0x06
     num = 0x06;
     die = 0x08;
     Q5J6 = 0x08;
     break;
   case 0x07
     num = 0x07;
     die = 0x08;
     Q5J6 = 0x0A;
     break;
   case 0x08
     num = 0x07;
     die = 0x08;
     Q5J6 = 0x0A;
     break;
   default
     return (0x00);
     break;
   }
   int damage = (num * random(0x01, die)) + Q5J6;
   return (damage);
 }