Big Bad Waffle преди 6 години
родител
ревизия
018b8681a3
променени са 2 файла, в които са добавени 20 реда и са изтрити 9 реда
  1. +7
    -8
      src/server/config/eventPhases/phaseEventChain.js
  2. +13
    -1
      src/server/items/generators/stats.js

+ 7
- 8
src/server/config/eventPhases/phaseEventChain.js Целия файл

@@ -1,6 +1,6 @@
define([

], function(
], function (

) {
return {
@@ -9,11 +9,11 @@ define([
cd: 0,
repeat: 0,

init: function() {
init: function () {
this.update();
},

update: function() {
update: function () {
if (this.cd == 0) {
if (this.state < this.config.length - 1) {
this.state++;
@@ -45,10 +45,9 @@ define([
},

events: {
mobTalk: function(config) {
mobTalk: function (config) {
var mob = this.instance.objects.objects.find(o => (o.id == config.id));
var text = (config.text instanceof Array) ? config.text[config.oldRepeat - config.repeat - 1] : config.text;
console.log(text);

if (config.zone) {
this.instance.syncer.queue('onGetMessages', {
@@ -62,7 +61,7 @@ define([
mob.syncer.set(false, 'chatter', 'msg', text);
}
},
addComponents: function(config) {
addComponents: function (config) {
var objects = this.instance.objects.objects;

var components = config.components;
@@ -83,7 +82,7 @@ define([
}
}
},
removeComponents: function(config) {
removeComponents: function (config) {
var objects = this.instance.objects.objects;

var components = config.components;
@@ -105,4 +104,4 @@ define([
}
}
};
});
});

+ 13
- 1
src/server/items/generators/stats.js Целия файл

@@ -74,6 +74,9 @@ define([
},

lvlRequire: {
level: {
min: 2
},
generator: 'lvlRequire'
},

@@ -318,7 +321,16 @@ define([
}

if ((!stat) || (!statOptions[stat])) {
var options = Object.keys(statOptions).filter(s => !statOptions[s].ignore);
var options = Object.keys(statOptions).filter(function (s) {
var o = statOptions[s];
if (o.ignore)
return false;
else if ((o.level) && (o.level.min) && (item.level < o.level.min))
return false;
else
return true;
});

stat = options[~~(Math.random() * options.length)];
statBlueprint = statOptions[stat];
} else


Зареждане…
Отказ
Запис