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.
 
 
 

320 lines
6.9 KiB

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