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.
 
 
 

37 rivejä
696 B

  1. define([
  2. 'items/generators/slots'
  3. ], function(
  4. slots
  5. ) {
  6. return {
  7. type: 'gatherResource',
  8. need: null,
  9. have: 0,
  10. build: function() {
  11. if (!this.need) {
  12. this.need = 2 + ~~(Math.random() * 3);
  13. }
  14. this.description = 'Gather ' + this.have + '/' + this.need + ' herbs';
  15. return true;
  16. },
  17. events: {
  18. afterGatherResource: function(item) {
  19. if ((this.obj.zoneName != this.zoneName) || (this.have >= this.need))
  20. return;
  21. this.have++;
  22. this.description = 'Gather ' + this.have + '/' + this.need + ' herbs';
  23. this.obj.syncer.setArray(true, 'quests', 'updateQuests', this.simplify(true));
  24. if (this.have >= this.need)
  25. this.ready();
  26. }
  27. }
  28. };
  29. });