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.
 
 
 

73 rindas
1.4 KiB

  1. define([
  2. ], function(
  3. ) {
  4. return {
  5. init: function(hideMessage) {
  6. if (!this.build())
  7. return false;
  8. this.obj.syncer.setArray(true, 'quests', 'obtainQuests', this.simplify(true));
  9. if (!hideMessage) {
  10. this.obj.instance.syncer.queue('onGetMessages', {
  11. id: this.obj.id,
  12. messages: [{
  13. class: 'q0',
  14. message: 'quest obtained (' + this.name + ')'
  15. }]
  16. }, [this.obj.serverId]);
  17. }
  18. return true;
  19. },
  20. ready: function() {
  21. this.isReady = true;
  22. if (this.oReady)
  23. this.oReady();
  24. this.obj.instance.syncer.queue('onGetMessages', {
  25. id: this.obj.id,
  26. messages: [{
  27. class: 'q0',
  28. message: 'quest ready for turn-in (' + this.name + ')'
  29. }]
  30. }, [this.obj.serverId]);
  31. this.obj.syncer.setArray(true, 'quests', 'updateQuests', this.simplify(true));
  32. },
  33. complete: function() {
  34. if (this.oComplete)
  35. this.oComplete();
  36. this.obj.instance.syncer.queue('onGetMessages', {
  37. id: this.obj.id,
  38. messages: [{
  39. class: 'q0',
  40. message: 'quest completed (' + this.name + ')'
  41. }]
  42. }, [this.obj.serverId]);
  43. this.obj.syncer.setArray(true, 'quests', 'completeQuests', this.id);
  44. this.obj.stats.getXp(this.xp || 10);
  45. },
  46. simplify: function(self) {
  47. var values = {};
  48. for (var p in this) {
  49. var value = this[p];
  50. if ((typeof(value) == 'function') || (p == 'obj'))
  51. continue;
  52. values[p] = value;
  53. }
  54. return values;
  55. }
  56. };
  57. });