Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

270 řádky
5.5 KiB

  1. module.exports = {
  2. name: 'Necromancer Class',
  3. extraScripts: [
  4. 'spells/spellHarvestLife',
  5. 'spells/spellSummonSkeleton',
  6. 'spells/spellBloodBarrier'
  7. ],
  8. init: function () {
  9. this.events.on('onBeforeGetItemTypes', this.beforeGetItemTypes.bind(this));
  10. this.events.on('onBeforeGetSpellsInfo', this.beforeGetSpellsInfo.bind(this));
  11. this.events.on('onBeforeGetSpellsConfig', this.beforeGetSpellsConfig.bind(this));
  12. this.events.on('onBeforeGetSpellTemplate', this.beforeGetSpellTemplate.bind(this));
  13. this.events.on('onBeforeGetClientConfig', this.onBeforeGetClientConfig.bind(this));
  14. this.events.on('onBeforeGetAnimations', this.beforeGetAnimations.bind(this));
  15. this.events.on('onAfterGetZone', this.onAfterGetZone.bind(this));
  16. },
  17. onAfterGetZone: function (zone, config) {
  18. if (zone !== 'fjolgard')
  19. return;
  20. let newRunes = [{
  21. generate: true,
  22. spell: true,
  23. quality: 0,
  24. infinite: true,
  25. spellName: 'harvest life',
  26. worth: 3
  27. }, {
  28. generate: true,
  29. spell: true,
  30. quality: 0,
  31. infinite: true,
  32. spellName: 'summon skeleton',
  33. worth: 3
  34. }];
  35. let asvaldTrade = config.mobs.asvald.properties.cpnTrade;
  36. Array.prototype.push.apply(asvaldTrade.items.extra, newRunes);
  37. },
  38. beforeGetAnimations: function (animations) {
  39. //Skeleton animations
  40. let mobsheet = `${this.folderName}/images/mobs.png`;
  41. if (!animations.mobs[mobsheet])
  42. animations.mobs[mobsheet] = {};
  43. animations.mobs[mobsheet]['0'] = {
  44. melee: {
  45. spritesheet: mobsheet,
  46. row: 1,
  47. col: 0,
  48. frames: 2,
  49. frameDelay: 5
  50. },
  51. spawn: {
  52. spritesheet: mobsheet,
  53. row: 2,
  54. col: 0,
  55. frames: 3,
  56. frameDelay: 4,
  57. hideSprite: true,
  58. type: 'attackAnimation'
  59. },
  60. death: {
  61. spritesheet: mobsheet,
  62. row: 3,
  63. col: 0,
  64. frames: 4,
  65. frameDelay: 4,
  66. type: 'attackAnimation'
  67. }
  68. };
  69. },
  70. onBeforeGetClientConfig: function ({ resourceList }) {
  71. resourceList.push(`${this.folderName}/images/abilityIcons.png`);
  72. },
  73. beforeGetSpellTemplate: function (spell) {
  74. if (spell.type === 'HarvestLife')
  75. spell.template = require('./spells/spellHarvestLife');
  76. else if (spell.type === 'SummonSkeleton')
  77. spell.template = require('./spells/spellSummonSkeleton');
  78. else if (spell.type === 'BloodBarrier')
  79. spell.template = require('./spells/spellBloodBarrier');
  80. },
  81. beforeGetItemTypes: function (types) {
  82. ['Sickle', 'Jade Sickle', 'Golden Sickle', 'Bone Sickle'].forEach(function (s, i) {
  83. types.oneHanded[s] = {
  84. spritesheet: `${this.folderName}/images/items.png`,
  85. sprite: [i, 0],
  86. spellName: 'melee',
  87. attrRequire: ['int'],
  88. spellConfig: {
  89. statType: ['str', 'int'],
  90. statMult: 1,
  91. cdMax: 4,
  92. castTimeMax: 0,
  93. useWeaponRange: true,
  94. random: {
  95. damage: [1, 7]
  96. }
  97. },
  98. implicitStat: {
  99. stat: 'lifeOnHit',
  100. value: [1, 30]
  101. }
  102. };
  103. }, this);
  104. },
  105. beforeGetSpellsConfig: function (spells) {
  106. spells['harvest life'] = {
  107. statType: ['str', 'int'],
  108. statMult: 1,
  109. cdMax: 10,
  110. castTimeMax: 3,
  111. manaCost: 5,
  112. isAttack: true,
  113. range: 1,
  114. random: {
  115. damage: [4, 14],
  116. healPercent: [2, 15]
  117. }
  118. };
  119. spells['summon skeleton'] = {
  120. statType: ['str', 'int'],
  121. statMult: 0.27,
  122. cdMax: 6,
  123. castTimeMax: 6,
  124. manaCost: 5,
  125. range: 9,
  126. random: {
  127. damagePercent: [20, 76],
  128. hpPercent: [40, 60]
  129. }
  130. };
  131. spells['blood barrier'] = {
  132. statType: ['str', 'int'],
  133. statMult: 0.1,
  134. cdMax: 13,
  135. castTimeMax: 3,
  136. manaCost: 5,
  137. range: 9,
  138. random: {
  139. i_drainPercentage: [10, 50],
  140. shieldMultiplier: [2, 5],
  141. i_frenzyDuration: [5, 15]
  142. }
  143. };
  144. },
  145. beforeGetSpellsInfo: function (spells) {
  146. spells.push({
  147. name: 'Harvest Life',
  148. description: 'Absorbs the life-force of your enemies.',
  149. type: 'harvestLife',
  150. icon: [0, 0],
  151. animation: 'melee',
  152. spritesheet: `${this.folderName}/images/abilityIcons.png`,
  153. particles: {
  154. color: {
  155. start: ['ff4252', 'b34b3a'],
  156. end: ['b34b3a', 'ff4252']
  157. },
  158. scale: {
  159. start: {
  160. min: 2,
  161. max: 14
  162. },
  163. end: {
  164. min: 0,
  165. max: 8
  166. }
  167. },
  168. lifetime: {
  169. min: 1,
  170. max: 3
  171. },
  172. alpha: {
  173. start: 0.7,
  174. end: 0
  175. },
  176. randomScale: true,
  177. randomColor: true,
  178. chance: 0.6
  179. }
  180. });
  181. spells.push({
  182. name: 'Summon Skeleton',
  183. description: 'Summons a skeletal warrior to assist you in combat.',
  184. type: 'summonSkeleton',
  185. icon: [1, 0],
  186. animation: 'magic',
  187. spritesheet: `${this.folderName}/images/abilityIcons.png`,
  188. particles: {
  189. color: {
  190. start: ['ff4252', 'b34b3a'],
  191. end: ['b34b3a', 'ff4252']
  192. },
  193. scale: {
  194. start: {
  195. min: 2,
  196. max: 14
  197. },
  198. end: {
  199. min: 0,
  200. max: 8
  201. }
  202. },
  203. lifetime: {
  204. min: 1,
  205. max: 3
  206. },
  207. alpha: {
  208. start: 0.7,
  209. end: 0
  210. },
  211. randomScale: true,
  212. randomColor: true,
  213. chance: 0.6
  214. }
  215. });
  216. spells.push({
  217. name: 'Blood Barrier',
  218. description: 'Sacrifice some life force to grant an ally a protective barrier and increased attack speed.',
  219. type: 'bloodBarrier',
  220. icon: [2, 0],
  221. animation: 'magic',
  222. spellType: 'buff',
  223. spritesheet: `${this.folderName}/images/abilityIcons.png`,
  224. particles: {
  225. color: {
  226. start: ['ff4252', 'b34b3a'],
  227. end: ['b34b3a', 'ff4252']
  228. },
  229. scale: {
  230. start: {
  231. min: 2,
  232. max: 14
  233. },
  234. end: {
  235. min: 0,
  236. max: 8
  237. }
  238. },
  239. lifetime: {
  240. min: 1,
  241. max: 3
  242. },
  243. alpha: {
  244. start: 0.7,
  245. end: 0
  246. },
  247. randomScale: true,
  248. randomColor: true,
  249. chance: 0.6
  250. }
  251. });
  252. }
  253. };