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.
 
 
 

113 lines
2.5 KiB

  1. module.exports = {
  2. name: 'Soul\'s Moor',
  3. description: 'The Pumpkin Sailor has returned to the shores of the living.',
  4. distance: -1,
  5. cron: '* * 1-31 9 *',
  6. durationEvent: true,
  7. disabled: false,
  8. events: {
  9. },
  10. helpers: {
  11. },
  12. phases: [{
  13. type: 'hookEvents',
  14. events: {
  15. beforeGatherResource: function (gatherResult, gatherer) {
  16. let itemName = gatherResult.blueprint.itemName;
  17. if ((!itemName) || (itemName.toLowerCase() !== 'candy corn'))
  18. return;
  19. gatherer.reputation.getReputation('pumpkinSailor', 40);
  20. //Spawn a Nibbler?
  21. let roll = Math.random();
  22. if (roll < 0.15) {
  23. let obj = gatherResult.obj;
  24. let spellbook = obj.spellbook;
  25. if (!spellbook) {
  26. spellbook = obj.addComponent('spellbook');
  27. spellbook.addSpell('summonSkeleton');
  28. let spell = spellbook.spells[0];
  29. spell.killMinionsOnDeath = false;
  30. spell.hpPercent = 100;
  31. spell.damagePercent = 100;
  32. let level = gatherer.stats.values.level;
  33. let hp = ((level * 15) + level) * 2;
  34. let str = ((level * 14.9) + ((level - 1) * 31.49));
  35. if (level < 10)
  36. str *= [0.1, 0.2, 0.4, 0.7, 1, 1, 1, 1, 1][level - 1];
  37. obj.addComponent('stats', {
  38. values: {
  39. hpMax: hp,
  40. hp: hp,
  41. str: str * 1.2,
  42. level: level
  43. }
  44. });
  45. obj.addComponent('aggro', {
  46. faction: 'lordSquash'
  47. });
  48. }
  49. let pos = obj.instance.physics.getClosestPos(obj.x, obj.y, obj.x, obj.y);
  50. spellbook.spells[0].cast({
  51. target: {
  52. x: pos.x,
  53. y: pos.y
  54. }
  55. });
  56. let summoned = spellbook.spells[0].minions[0];
  57. summoned.name = 'Soul Nibbler';
  58. summoned.aggro.list.push({
  59. obj: gatherer,
  60. threat: 1
  61. });
  62. summoned.sheetName = 'server/mods/event-halloween/images/mobs.png';
  63. summoned.cell = 0;
  64. summoned.inventory.blueprint = {
  65. noRandom: true,
  66. rolls: 2,
  67. chance: 100,
  68. blueprints: [{
  69. chance: 3,
  70. name: 'Summon Pumpkin Skeleton',
  71. type: 'mtx',
  72. effects: [{
  73. mtx: 'summonPumpkinSkeleton'
  74. }],
  75. spritesheet: 'server/mods/event-halloween/images/items.png',
  76. sprite: [3, 0],
  77. noSpell: true,
  78. noDrop: true,
  79. noDestroy: true,
  80. noSalvage: true
  81. }, {
  82. chance: 100,
  83. name: 'Candy Corn',
  84. spritesheet: 'server/mods/event-halloween/images/items.png',
  85. material: true,
  86. noSpell: true,
  87. sprite: [3, 3],
  88. quantity: [1, 5]
  89. }]
  90. };
  91. }
  92. },
  93. beforeCompleteAutoquest: function (quest, character) {
  94. }
  95. }
  96. }]
  97. };