Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

81 Zeilen
2.0 KiB

  1. define([
  2. ], function (
  3. ) {
  4. return {
  5. need: 10,
  6. have: 0,
  7. mobType: null,
  8. type: 'killX',
  9. build: function () {
  10. //If we're not in the correct zone, don't do this check, it'll just crash the server
  11. // since the mob won't be available (most likely) in the zoneFile
  12. if (this.obj.zoneName == this.zoneName) {
  13. var mobTypes = this.obj.instance.spawners.zone.mobs;
  14. if (this.mobName) {
  15. var mobType = mobTypes[this.mobName.toLowerCase()];
  16. //Maybe the zoneFile changed in the meantime. If so, regenerate
  17. if ((!mobType) || (mobType.attackable == false))
  18. this.mobName = null;
  19. }
  20. if (!this.mobName) {
  21. var mobCounts = this.obj.instance.spawners.mobTypes;
  22. var keys = Object.keys(mobTypes).filter(function (m) {
  23. var mobBlueprint = mobTypes[m];
  24. return (
  25. (m != 'default') &&
  26. (
  27. (mobBlueprint.attackable) ||
  28. (mobBlueprint.attackable == null)
  29. ) &&
  30. (mobBlueprint.level <= ~~(this.obj.stats.values.level * 1.35)) &&
  31. (mobCounts[m] > 1)
  32. );
  33. }, this);
  34. //No level appropriate mobs found
  35. if (keys.length == 0)
  36. return false;
  37. this.mobType = keys[~~(Math.random() * keys.length)];
  38. var needMax = 8;
  39. this.mobName = this.mobType.replace(/\w\S*/g, function (txt) {
  40. return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
  41. });
  42. this.need = Math.max(1, ~~((needMax * 0.2) + (Math.random() * needMax * 0.8)));
  43. }
  44. }
  45. this.description = 'Kill ' + this.have + '/' + this.need + ' ' + this.mobName;
  46. return true;
  47. },
  48. getXpMultiplier: function () {
  49. return this.need;
  50. },
  51. events: {
  52. afterKillMob: function (mob) {
  53. if ((mob.name.toLowerCase() != this.mobName.toLowerCase()) || (this.have >= this.need))
  54. return;
  55. this.have++;
  56. this.description = 'Kill ' + this.have + '/' + this.need + ' ' + this.mobName;
  57. if (this.have >= this.need)
  58. this.ready();
  59. this.obj.syncer.setArray(true, 'quests', 'updateQuests', this.simplify(true));
  60. }
  61. }
  62. };
  63. });