Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

33 linhas
611 B

  1. define([
  2. ], function(
  3. ) {
  4. return {
  5. type: 'chatter',
  6. chats: null,
  7. cdMax: 50,
  8. cd: 0,
  9. chance: 0.035,
  10. init: function(blueprint) {
  11. this.chats = extend(true, [], blueprint.chats);
  12. this.cd = ~~(Math.random() * this.cdMax);
  13. },
  14. update: function() {
  15. if ((this.obj.aggro) && (this.obj.aggro.list.length > 0))
  16. return;
  17. if ((this.cd == 0) && (Math.random() < this.chance)) {
  18. this.cd = this.cdMax;
  19. var pick = this.chats[~~(Math.random() * this.chats.length)];
  20. this.obj.syncer.set(false, 'chatter', 'msg', pick.msg);
  21. }
  22. else if (this.cd > 0)
  23. this.cd--;
  24. }
  25. };
  26. });