You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

182 lines
3.1 KiB

  1. const spellsConfig = require('../../../src/server/config/spellsConfig');
  2. const combat = require('../../../src/server/combat/combat');
  3. let spells = spellsConfig.spells;
  4. let max = true;
  5. let maxTarget = false;
  6. spells['harvest life'] = {
  7. statType: ['str', 'int'],
  8. statMult: 1,
  9. cdMax: 10,
  10. castTimeMax: 3,
  11. manaCost: 5,
  12. isAttack: true,
  13. range: 1,
  14. random: {
  15. damage: [4, 14],
  16. healPercent: [10, 30]
  17. }
  18. };
  19. /*let bloodBarrierMult = 1.25;
  20. spells['skeleton melee'] = {
  21. statType: ['str', 'int'],
  22. statMult: 1 * bloodBarrierMult,
  23. auto: true,
  24. cdMax: 5,
  25. manaCost: 0,
  26. range: 1,
  27. random: {
  28. damage: [1, 3.8]
  29. }
  30. };*/
  31. let level = 20;
  32. let hp = [
  33. 32.70,
  34. 65.40,
  35. 98.10,
  36. 130.80,
  37. 163.50,
  38. 196.20,
  39. 228.90,
  40. 261.60,
  41. 294.30,
  42. 327.00,
  43. 359.70,
  44. 392.40,
  45. 425.10,
  46. 457.80,
  47. 490.50,
  48. 523.20,
  49. 555.90,
  50. 588.60,
  51. 621.30,
  52. 654.00
  53. ];
  54. let hpMax = [
  55. 160.48,
  56. 324.53,
  57. 489.90,
  58. 660.79,
  59. 841.44,
  60. 1036.21,
  61. 1249.50,
  62. 1485.85,
  63. 1749.87,
  64. 2046.32,
  65. 2380.05,
  66. 2756.08,
  67. 3179.54,
  68. 3655.72,
  69. 4190.09,
  70. 4788.27,
  71. 5456.08,
  72. 6199.50,
  73. 7024.73,
  74. 7938.17
  75. ];
  76. module.exports = function () {
  77. let res = [];
  78. for (let s in spells) {
  79. let c = spells[s];
  80. c.statType = c.statType || 'int';
  81. let d = c.random.damage || c.random.healing;
  82. if (!d)
  83. continue;
  84. let damage = d[0];
  85. if (max)
  86. damage = d[1];
  87. var config = {
  88. statType: c.statType,
  89. statMult: c.statMult,
  90. element: c.element,
  91. cd: c.cdMax,
  92. damage: damage,
  93. noCrit: true,
  94. noMitigate: true,
  95. source: {
  96. stats: {
  97. values: {
  98. level: level,
  99. elementArcanePercent: 0,
  100. elementFrostPercent: 0,
  101. elementPoisonPercent: 0,
  102. elementHolyPercent: 0,
  103. elementFirePercent: 0
  104. }
  105. }
  106. },
  107. target: {
  108. stats: {
  109. values: {
  110. armor: maxTarget ? (level * 50) : (level * 20),
  111. elementAllResist: maxTarget ? 100 : 0,
  112. elementArcaneResist: 0,
  113. elementFrostResist: 0,
  114. elementPoisonResist: 0,
  115. elementHolyResist: 0,
  116. elementFireResist: 0
  117. }
  118. }
  119. }
  120. };
  121. let stat = c.statType;
  122. if (!stat.push)
  123. stat = [stat];
  124. const minStat = level;
  125. const maxStat = level * 10;
  126. stat.forEach(ss => {
  127. config.source.stats.values[ss] = (max ? maxStat : minStat);
  128. });
  129. let amount = combat.getDamage(config).amount;
  130. let critChance = max ? 0.5 : 0.05;
  131. let critMult = max ? 3 : 1.5;
  132. let castTimeMax = c.castTimeMax;
  133. amount = (((amount / 100) * (100 - critChance)) + (((amount / 100) * critChance) * (critMult / 100)));
  134. let duration = c.random.i_duration;
  135. if (duration)
  136. amount *= max ? duration[1] : duration[0];
  137. const div = (c.cdMax + castTimeMax) || 1;
  138. amount /= div;
  139. res.push({
  140. name: s,
  141. dpt: ~~(~~(amount * 10) / 10),
  142. cd: c.cdMax,
  143. mana: c.manaCost || '',
  144. tpk: ~~((maxTarget ? hpMax : hp)[level - 1] / amount),
  145. amount: amount
  146. });
  147. }
  148. res = res.sort((a, b) => (b.dpt - a.dpt));
  149. console.log();
  150. console.log('ability dpt');
  151. console.log();
  152. res.forEach(function (r) {
  153. let gap = new Array(20 - r.name.length);
  154. console.log(r.name + ': ' + gap.join(' ') + r.dpt + ' ' + r.tpk + ' ticks ' + (~~((r.tpk / 2.85) * 10) / 10) + ' seconds');
  155. });
  156. console.log();
  157. };