Advertisement
Rapptz

MapleDPS

Feb 21st, 2012
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var pdRate = Number(prompt("What is the monster PDR?"));
  2. var speed = Number(prompt("What is the speed of the weapon?"));
  3.  
  4. function Character(skill, delay, hits, mobs, critRate, critMin, critMax, ignoreDEF, damageInc,
  5.     faRate, faDmg, base, mastery, summDmg, summDelay) {
  6.     this.skill = skill;
  7.     this.delay = delay;
  8.     this.hits = hits;
  9.     this.mobs = mobs;
  10.         this.skillDelay = function () {
  11.         if (speed != 6) {
  12.             var dela3 = ((10 + speed) / 16) * this.delay;
  13.             var dela2 = dela3 % 30;
  14.             return dela3 - dela2;
  15.         } else {
  16.             return this.delay;
  17.         }
  18.        
  19.     };
  20.     this.skillPerSecond = function () {
  21.         return (1000 / (this.skillDelay(this.delay))) * this.skill * this.hits * this.mobs;
  22.     };
  23.     this.critRate = critRate;
  24.     this.critMin = critMin;
  25.     this.critMax = critMax;
  26.     this.critDmg = function () {
  27.         var critRate1 = this.critRate / 100;
  28.         var critMin1 = this.critMin / 100;
  29.         var critMax1 = this.critMax / 100;
  30.         return 1 + (critRate1 * ((critMin1 + critMax1) / 2));
  31.     };
  32.     this.ignoreDEF = ignoreDEF;
  33.     this.damageInc = damageInc;
  34.     this.physicalDEF = function () {
  35.         var ignoreDef1 = this.ignoreDEF / 100;
  36.         var pdrate1 = pdRate / 100;
  37.         if (ignoreDef1 != 1) {
  38.             return ((1 - pdrate1) + (pdrate1 * ignoreDef1));
  39.         } else {
  40.             return 1;
  41.         }
  42.     };
  43.     this.faRate = faRate;
  44.     this.faDmg = faDmg;
  45.     this.faCalc = function () {
  46.         var faRate1 = this.faRate / 100;
  47.         return faRate1 * this.faDmg;
  48.     };
  49.     this.mastery = mastery;
  50.     this.base = base;
  51.     this.adjMastery = function () {
  52.         if (this.mastery !== 0) {
  53.             var mastery1 = this.mastery / 100;
  54.             var base1 = this.base/100;
  55.             var mastery2 =  ((mastery1 + 1) / 2);
  56.             var base2 =  ((base1 + 1) / 2);
  57.             return mastery2/base2;
  58.         } else {
  59.             return 0;
  60.         }
  61.     };
  62.     this.summDmg = summDmg;
  63.     this.summDelay = summDelay;
  64.     this.summonDamage = function () {
  65.         if (this.summDmg !== 0) {
  66.             var summDelay1 = this.summDelay / 1000;
  67.             return this.summDmg / summDelay1;
  68.         } else {
  69.             return 0;
  70.         }
  71.     };
  72.     this.addSE = function () {
  73.         this.critRate += 20;
  74.         this.critMax += 30;
  75.     };
  76.     this.addThreaten = function () {
  77.         this.ignoreDEF += 30;
  78.     };
  79.     this.addLegendarySpear = function () {
  80.         this.ignoreDEF += 20;
  81.     };
  82.     this.addDamageInc = function () {
  83.         var x = Number(prompt("How much damage increase?"));
  84.         this.damageInc += x;
  85.     };
  86.     this.setSkill = function (newSkill) {
  87.         this.skill = newSkill;
  88.     };
  89.     this.setDelay = function (newDelay) {
  90.         this.delay = newDelay;
  91.     };
  92.     this.setHits = function (newHits) {
  93.         this.hits = newHits;
  94.     };
  95.     this.setMobs = function (newMobs) {
  96.         this.mobs = newMobs;
  97.     };
  98.     this.setSkill = function () {
  99.         this.skill += this.faCalc();
  100.         };
  101.     this.totalDPS = function () {
  102.         return Math.floor(this.skillPerSecond() * this.critDmg() * this.physicalDEF() * this.adjMastery() * ((this.damageInc / 100) + 1) + this.summonDamage());
  103.     };
  104. }
  105. var bowmaster = new Character(250, 120, 1, 1, 65, 35, 80, 25, 15, 70, 210, 65, 85, 390, 3030); //100% crit with dodge change(65)
  106.     bowmaster.setSkill();
  107.     bowmaster.totalDPS();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement