Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

272 rindas
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, textureList }) {
  71. resourceList.push(`${this.folderName}/images/abilityIcons.png`);
  72. textureList.push(`${this.folderName}/images/mobs.png`);
  73. },
  74. beforeGetSpellTemplate: function (spell) {
  75. if (spell.type === 'HarvestLife')
  76. spell.template = require('./spells/spellHarvestLife');
  77. else if (spell.type === 'SummonSkeleton')
  78. spell.template = require('./spells/spellSummonSkeleton');
  79. else if (spell.type === 'BloodBarrier')
  80. spell.template = require('./spells/spellBloodBarrier');
  81. },
  82. beforeGetItemTypes: function (types) {
  83. ['Sickle', 'Jade Sickle', 'Golden Sickle', 'Bone Sickle'].forEach(function (s, i) {
  84. types.oneHanded[s] = {
  85. spritesheet: `${this.folderName}/images/items.png`,
  86. sprite: [i, 0],
  87. spellName: 'melee',
  88. attrRequire: ['int'],
  89. spellConfig: {
  90. statType: ['str', 'int'],
  91. statMult: 1,
  92. cdMax: 4,
  93. castTimeMax: 0,
  94. useWeaponRange: true,
  95. random: {
  96. damage: [1, 7]
  97. }
  98. },
  99. implicitStat: {
  100. stat: 'lifeOnHit',
  101. value: [1, 30]
  102. }
  103. };
  104. }, this);
  105. },
  106. beforeGetSpellsConfig: function (spells) {
  107. spells['harvest life'] = {
  108. statType: ['str', 'int'],
  109. statMult: 1,
  110. cdMax: 10,
  111. castTimeMax: 3,
  112. manaCost: 5,
  113. isAttack: true,
  114. range: 1,
  115. random: {
  116. damage: [4, 14],
  117. healPercent: [2, 15]
  118. }
  119. };
  120. spells['summon skeleton'] = {
  121. statType: ['str', 'int'],
  122. statMult: 0.27,
  123. cdMax: 6,
  124. castTimeMax: 6,
  125. manaCost: 5,
  126. range: 9,
  127. random: {
  128. damagePercent: [20, 76],
  129. hpPercent: [40, 60]
  130. }
  131. };
  132. spells['blood barrier'] = {
  133. statType: ['str', 'int'],
  134. statMult: 0.1,
  135. cdMax: 13,
  136. castTimeMax: 3,
  137. manaCost: 5,
  138. range: 9,
  139. random: {
  140. i_drainPercentage: [10, 50],
  141. shieldMultiplier: [2, 5],
  142. i_frenzyDuration: [5, 15]
  143. }
  144. };
  145. },
  146. beforeGetSpellsInfo: function (spells) {
  147. spells.push({
  148. name: 'Harvest Life',
  149. description: 'Absorbs the life-force of your enemies.',
  150. type: 'harvestLife',
  151. icon: [0, 0],
  152. animation: 'melee',
  153. spritesheet: `${this.folderName}/images/abilityIcons.png`,
  154. particles: {
  155. color: {
  156. start: ['ff4252', 'b34b3a'],
  157. end: ['b34b3a', 'ff4252']
  158. },
  159. scale: {
  160. start: {
  161. min: 2,
  162. max: 14
  163. },
  164. end: {
  165. min: 0,
  166. max: 8
  167. }
  168. },
  169. lifetime: {
  170. min: 1,
  171. max: 3
  172. },
  173. alpha: {
  174. start: 0.7,
  175. end: 0
  176. },
  177. randomScale: true,
  178. randomColor: true,
  179. chance: 0.6
  180. }
  181. });
  182. spells.push({
  183. name: 'Summon Skeleton',
  184. description: 'Summons a skeletal warrior to assist you in combat.',
  185. type: 'summonSkeleton',
  186. icon: [1, 0],
  187. animation: 'magic',
  188. spritesheet: `${this.folderName}/images/abilityIcons.png`,
  189. particles: {
  190. color: {
  191. start: ['ff4252', 'b34b3a'],
  192. end: ['b34b3a', 'ff4252']
  193. },
  194. scale: {
  195. start: {
  196. min: 2,
  197. max: 14
  198. },
  199. end: {
  200. min: 0,
  201. max: 8
  202. }
  203. },
  204. lifetime: {
  205. min: 1,
  206. max: 3
  207. },
  208. alpha: {
  209. start: 0.7,
  210. end: 0
  211. },
  212. randomScale: true,
  213. randomColor: true,
  214. chance: 0.6
  215. }
  216. });
  217. spells.push({
  218. name: 'Blood Barrier',
  219. description: 'Sacrifice some life force to grant an ally a protective barrier and increased attack speed.',
  220. type: 'bloodBarrier',
  221. icon: [2, 0],
  222. animation: 'magic',
  223. spellType: 'buff',
  224. spritesheet: `${this.folderName}/images/abilityIcons.png`,
  225. particles: {
  226. color: {
  227. start: ['ff4252', 'b34b3a'],
  228. end: ['b34b3a', 'ff4252']
  229. },
  230. scale: {
  231. start: {
  232. min: 2,
  233. max: 14
  234. },
  235. end: {
  236. min: 0,
  237. max: 8
  238. }
  239. },
  240. lifetime: {
  241. min: 1,
  242. max: 3
  243. },
  244. alpha: {
  245. start: 0.7,
  246. end: 0
  247. },
  248. randomScale: true,
  249. randomColor: true,
  250. chance: 0.6
  251. }
  252. });
  253. }
  254. };