Advertisement
thezer0th

STZ rewards code

Apr 17th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. finalScore = _root.areaDamage;
  2.       if (finalScore > 999999999999999.0) {
  3.         finalScore = 0;
  4.       }
  5.       num = finalScore;
  6.       div = 0;
  7.       prim = true;
  8.       if (num < 2 || num >= 9999999968.0) {
  9.         prim = false;
  10.       } else {
  11.         i = 2;
  12.         while (i <= Math.sqrt(num) + 1) {
  13.           if (num % i == 0) {
  14.             prim = false;
  15.             div = i;
  16.             i = num;
  17.           }
  18.           ++i;
  19.         }
  20.       }
  21.       digArray = new Array();
  22.       digCount = new Array();
  23.       totalDig = 0;
  24.       i = 0;
  25.       while (i <= 9) {
  26.         digCount[i] = 0;
  27.         ++i;
  28.       }
  29.       if (num == 0) {
  30.         digArray.push(0);
  31.         digCount[0] = 1;
  32.       }
  33.       num = finalScore;
  34.       palinum = 0;
  35.       pali = false;
  36.       while (num > 0) {
  37.         totalDig += 1;
  38.         palinum = palinum * 10 + num % 10;
  39.         digArray.push(num % 10);
  40.         digCount[num % 10] += 1;
  41.         num = Math.floor(num / 10);
  42.       }
  43.       if (finalScore == palinum) {
  44.         pali = true;
  45.       }
  46.       curConsec = -1;
  47.       curConsecL = 0;
  48.       maxConsec = -1;
  49.       maxConsecL = 0;
  50.       i = 0;
  51.       while (i < digArray.length) {
  52.         if (curConsec != digArray[i]) {
  53.           curConsec = digArray[i];
  54.           curConsecL = 1;
  55.         } else {
  56.           curConsecL += 1;
  57.           if (maxConsecL <= curConsecL) {
  58.             maxConsecL = curConsecL;
  59.             maxConsec = curConsec;
  60.           }
  61.         }
  62.         ++i;
  63.       }
  64.       uniqueCount = 0;
  65.       allUnique = true;
  66.       i = 0;
  67.       while (i <= 9) {
  68.         if (digCount[i] >= 1) {
  69.           uniqueCount += 1;
  70.         }
  71.         if (digCount[i] >= 2) {
  72.           allUnique = false;
  73.         }
  74.         ++i;
  75.       }
  76.       bonList = new Array();
  77.       bonMult = new Array();
  78.       bonList.push('No Bonus');
  79.       bonMult.push(0);
  80.       bonList.push('No Bonus');
  81.       bonMult.push(0);
  82.       if (finalScore > 0) {
  83.         if (totalDig >= 2) {
  84.           bonList.push(totalDig + ' Digits');
  85.           bonMult.push(totalDig * 5);
  86.         }
  87.         if (finalScore % 100000000 == 0) {
  88.           bonList.push('Divisible by 100,000,000');
  89.           bonMult.push(400);
  90.         } else {
  91.           if (finalScore % 50000000 == 0) {
  92.             bonList.push('Divisible by 50,000,000');
  93.             bonMult.push(350);
  94.           } else {
  95.             if (finalScore % 25000000 == 0) {
  96.               bonList.push('Divisible by 25,000,000');
  97.               bonMult.push(325);
  98.             } else {
  99.               if (finalScore % 10000000 == 0) {
  100.                 bonList.push('Divisible by 10,000,000');
  101.                 bonMult.push(300);
  102.               } else {
  103.                 if (finalScore % 5000000 == 0) {
  104.                   bonList.push('Divisible by 5,000,000');
  105.                   bonMult.push(275);
  106.                 } else {
  107.                   if (finalScore % 2500000 == 0) {
  108.                     bonList.push('Divisible by 2,500,000');
  109.                     bonMult.push(250);
  110.                   } else {
  111.                     if (finalScore % 1000000 == 0) {
  112.                       bonList.push('Divisible by 1,000,000');
  113.                       bonMult.push(225);
  114.                     } else {
  115.                       if (finalScore % 500000 == 0) {
  116.                         bonList.push('Divisible by 500,000');
  117.                         bonMult.push(200);
  118.                       } else {
  119.                         if (finalScore % 250000 == 0) {
  120.                           bonList.push('Divisible by 250,000');
  121.                           bonMult.push(175);
  122.                         } else {
  123.                           if (finalScore % 100000 == 0) {
  124.                             bonList.push('Divisible by 100,000');
  125.                             bonMult.push(150);
  126.                           } else {
  127.                             if (finalScore % 50000 == 0) {
  128.                               bonList.push('Divisible by 50,000');
  129.                               bonMult.push(125);
  130.                             } else {
  131.                               if (finalScore % 25000 == 0) {
  132.                                 bonList.push('Divisible by 25,000');
  133.                                 bonMult.push(100);
  134.                               } else {
  135.                                 if (finalScore % 10000 == 0) {
  136.                                   bonList.push('Divisible by 10,000');
  137.                                   bonMult.push(90);
  138.                                 } else {
  139.                                   if (finalScore % 5000 == 0) {
  140.                                     bonList.push('Divisible by 5,000');
  141.                                     bonMult.push(80);
  142.                                   } else {
  143.                                     if (finalScore % 2500 == 0) {
  144.                                       bonList.push('Divisible by 2,500');
  145.                                       bonMult.push(70);
  146.                                     } else {
  147.                                       if (finalScore % 1000 == 0) {
  148.                                         bonList.push('Divisible by 1,000');
  149.                                         bonMult.push(60);
  150.                                       } else {
  151.                                         if (finalScore % 500 == 0) {
  152.                                           bonList.push('Divisible by 500');
  153.                                           bonMult.push(50);
  154.                                         } else {
  155.                                           if (finalScore % 250 == 0) {
  156.                                             bonList.push('Divisible by 250');
  157.                                             bonMult.push(40);
  158.                                           } else {
  159.                                             if (finalScore % 100 == 0) {
  160.                                               bonList.push('Divisible by 100');
  161.                                               bonMult.push(30);
  162.                                             } else {
  163.                                               if (finalScore % 50 == 0) {
  164.                                                 bonList.push('Divisible by 50');
  165.                                                 bonMult.push(25);
  166.                                               } else {
  167.                                                 if (finalScore % 25 == 0) {
  168.                                                   bonList.push('Divisible by 25');
  169.                                                   bonMult.push(20);
  170.                                                 } else {
  171.                                                   if (finalScore % 10 == 0) {
  172.                                                     bonList.push('Divisible by 10');
  173.                                                     bonMult.push(15);
  174.                                                   } else {
  175.                                                     if (finalScore % 5 == 0) {
  176.                                                       bonList.push('Divisible by 5');
  177.                                                       bonMult.push(10);
  178.                                                     } else {
  179.                                                       if (finalScore % 2 == 0) {
  180.                                                         bonList.push('Divisible by 2');
  181.                                                         bonMult.push(5);
  182.                                                       }
  183.                                                     }
  184.                                                   }
  185.                                                 }
  186.                                               }
  187.                                             }
  188.                                           }
  189.                                         }
  190.                                       }
  191.                                     }
  192.                                   }
  193.                                 }
  194.                               }
  195.                             }
  196.                           }
  197.                         }
  198.                       }
  199.                     }
  200.                   }
  201.                 }
  202.               }
  203.             }
  204.           }
  205.         }
  206.         if (prim == true) {
  207.           bonList.push('Prime');
  208.           bonMult.push(50);
  209.         }
  210.         if (uniqueCount == 1) {
  211.           bonList.push('Repdigit');
  212.           bonMult.push(totalDig * 100);
  213.         }
  214.         if (pali == true) {
  215.           bonList.push('Palindrome');
  216.           bonMult.push(totalDig * 50 + uniqueCount * 50);
  217.         }
  218.         if (uniqueCount > 1 && allUnique == true) {
  219.           bonList.push('All Unique Digits');
  220.           bonMult.push(uniqueCount * 10);
  221.         }
  222.         if (maxConsecL >= 2) {
  223.           bonList.push(maxConsecL + ' Consecutive ' + maxConsec + '\'s');
  224.           bonMult.push(maxConsecL * 10);
  225.         }
  226.       }
  227.       bon1ID = 0;
  228.       bon2ID = 0;
  229.       i = 1;
  230.       while (i < bonMult.length) {
  231.         if (bonMult[i] >= bonMult[bon1ID]) {
  232.           bon1ID = i;
  233.         }
  234.         ++i;
  235.       }
  236.       i = 1;
  237.       while (i < bonMult.length) {
  238.         if (bonMult[i] >= bonMult[bon2ID] && i != bon1ID) {
  239.           bon2ID = i;
  240.         }
  241.         ++i;
  242.       }
  243.       a1 = Math.floor(Math.pow(finalScore, 0.4) * 12.5 * _root.save.boost / 100) * 5000;
  244.       b1 = Math.floor(Math.pow(finalScore, 0.4) * 0.125 + 1);
  245.       t4.text = bonList[bon1ID] + ':';
  246.       a2 = Math.ceil(a1 * bonMult[bon1ID] / 100);
  247.       b2 = Math.ceil(b1 * bonMult[bon1ID] / 100);
  248.       t7.text = bonList[bon2ID] + ':';
  249.       a3 = Math.ceil(a1 * bonMult[bon2ID] / 100);
  250.       b3 = Math.ceil(b1 * bonMult[bon2ID] / 100);
  251.       if (_root.worstMoon == true) {
  252.         a1 = Math.floor(a1 * 5);
  253.         a2 = Math.floor(a2 * 5);
  254.         a3 = Math.floor(a3 * 5);
  255.         b1 = Math.floor(b1 * 5);
  256.         b2 = Math.floor(b2 * 5);
  257.         b3 = Math.floor(b3 * 5);
  258.       }
  259.       if (_root.apocalypse == true) {
  260.         a1 = Math.floor(a1 * 2);
  261.         a2 = Math.floor(a2 * 2);
  262.         a3 = Math.floor(a3 * 2);
  263.         b1 = Math.floor(b1 * 2);
  264.         b2 = Math.floor(b2 * 2);
  265.         b3 = Math.floor(b3 * 2);
  266.       }
  267.       if (_root.areaPract == true) {
  268.         a1 = Math.floor(a1 * 0.001);
  269.         a2 = Math.floor(a2 * 0.001);
  270.         a3 = Math.floor(a3 * 0.001);
  271.         b1 = 0;
  272.         b2 = 0;
  273.         b3 = 0;
  274.       }
  275.       a4 = a1 + a2 + a3;
  276.       b4 = b1 + b2 + b3;
  277.       t1.text = _root.withComma(finalScore);
  278.       t2.text = '+' + _root.withComma(a1);
  279.       t3.text = '+' + _root.withComma(b1);
  280.       t5.text = '+' + _root.withComma(a2);
  281.       t6.text = '+' + _root.withComma(b2);
  282.       t8.text = '+' + _root.withComma(a3);
  283.       t9.text = '+' + _root.withComma(b3);
  284.       t10.text = '+' + _root.withComma(a4);
  285.       t11.text = '+' + _root.withComma(b4);
  286.       if (isNaN(a4)) {
  287.         a4 = 0;
  288.       }
  289.       if (isNaN(b4)) {
  290.         b4 = 0;
  291.       }
  292.       _root.gainEXP(a4);
  293.       _root.save.battlePoint += b4;
  294.       if (_root.save.raidSpecial < finalScore) {
  295.         _root.save.raidSpecial = finalScore;
  296.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement