[WIP] Conditions

* add missing conditionsTypes

todo:
 process params in Util::getServerConditions()
 add locale strings to js
 extend verbose display in global.js ConditionList
This commit is contained in:
Sarjuuk
2021-03-21 22:00:22 +01:00
parent e4b8a8e908
commit a1f0f3d30d
5 changed files with 165 additions and 76 deletions

View File

@@ -22860,24 +22860,51 @@ var ConditionList = new function() {
switch (Math.abs(entry[0])) {
case 1:
case 25: param[0] = '[spell=' + entry[1] + ']'; break;
case 2: param[1] = entry[2]; // do not break
case 3: param[0] = '[item=' + entry[1] + ']'; break;
case 25:
param[0] = '[spell=' + entry[1] + ']';
break;
case 2:
param[1] = entry[2];
// do not break
case 3:
param[0] = '[item=' + entry[1] + ']';
break;
case 4:
case 23: param[0] = '[zone=' + entry[1] + ']'; break;
case 23:
param[0] = '[zone=' + entry[1] + ']';
break;
case 8:
case 9:
case 14:
case 28: param[0] = '[quest=' + entry[1] + ']'; break;
case 12: param[0] = '[event=' + entry[1] + ']'; break;
case 17: param[0] = '[achievement=' + entry[1] + ']'; break;
case 18: param[0] = '[title=' + entry[1] + ']'; break;
case 6: param[0] = g_sides[entry[1]]; break;
case 10: param[0] = g_drunk_states[entry[1]]; break;
case 22: param[0] = g_zone_categories[entry[1]]; break;
case 15: param[0] = _listing(entry[1], g_chr_classes, '[class=$1]'); break;
case 16: param[0] = _listing(entry[1], g_chr_races, '[race=$1]'); break;
case 7: param[0] = '[skill=' + entry[1] + ']';
case 28:
param[0] = '[quest=' + entry[1] + ']';
break;
case 12:
param[0] = '[event=' + entry[1] + ']';
break;
case 17:
param[0] = '[achievement=' + entry[1] + ']';
break;
case 18:
param[0] = '[title=' + entry[1] + ']';
break;
case 6:
param[0] = g_sides[entry[1]];
break;
case 10:
param[0] = g_drunk_states[entry[1]];
break;
case 22:
param[0] = g_zone_categories[entry[1]];
break;
case 15:
param[0] = _listing(entry[1], g_chr_classes, '[class=$1]');
break;
case 16:
param[0] = _listing(entry[1], g_chr_races, '[race=$1]');
break;
case 7:
param[0] = '[skill=' + entry[1] + ']';
if (entry[2])
param[0] += $WH.sprintf(LANG.qty, entry[2]);
break;
@@ -22899,10 +22926,12 @@ var ConditionList = new function() {
else
param[0] = g_npc_types[10];
break;
case 29: param[0] = '[npc=' + entry[1] + ']';
case 29:
param[0] = '[npc=' + entry[1] + ']';
param[1] = entry[2];
break;
case 30: param[0] = '[object=' + entry[1] + ']';
case 30:
param[0] = '[object=' + entry[1] + ']';
param[1] = entry[2];
break;
case 31: if (entry[2] && entry[1] == 3) {
@@ -22915,31 +22944,46 @@ var ConditionList = new function() {
}
else // create mask from id and resolve in case 32
entry[1] = (1 << entry[1]);
case 32: param[0] = _listing(entry[1], g_world_object_types, '$2'); break;
case 36: break;
case 32:
param[0] = _listing(entry[1], g_world_object_types, '$2');
break;
case 27:
case 37:
case 38: param[0] = entry[1];
param[1] = g_operators[entry[2]];
break;
case 35: param[0] = entry[2];
param[1] = g_operators[entry[3]];
break;
case 11: param[0] = entry[1];
param[1] = entry[2];
break;
case 38:
param[0] = entry[1];
param[1] = g_operators[entry[2]];
break;
case 35:
param[0] = entry[2];
param[1] = g_operators[entry[3]];
break;
case 11:
param[0] = entry[1];
param[1] = entry[2];
break;
case 26:
var pIndex = 0;
while (entry[1]) {
if (entry[1] & (1 << pIndex)) {
if (param[0])
param[0] += ', ';
var pIndex = 0;
while (entry[1]) {
if (entry[1] & (1 << pIndex)) {
if (param[0])
param[0] += ', ';
param[0] += pIndex + 1;
entry[1] &= ~(1 << pIndex);
}
pIndex++;
param[0] += pIndex + 1;
entry[1] &= ~(1 << pIndex);
}
pIndex++;
}
case 47:
param[0] = '[quest=' + entry[1] + ']';
param[1] = '';
let _ = Listview.funcBox.assocBinFlags(entry[2], g_quest_states);
for (var i = 0, len = _.length; i < len; ++i) {
if (i > 0)
param[1] += ', ';
param[1] += g_quest_states[_[i]];
}
break;
}
str = g_conditions[strIdx];

View File

@@ -2430,7 +2430,7 @@ var g_conditions = {
35: 'Das Ziel ist$: nicht; $2 $1m entfernt',
36: 'Das Ziel ist$: nicht; am Leben',
37: 'Die Gesundheit des Ziels ist$: nicht; $2 $1',
37: 'Die Gesundheit des Ziels ist$: nicht; $2 $1%'
38: 'Die Gesundheit des Ziels ist$: nicht; $2 $1%'
};
/* end aowow custom */

View File

@@ -2418,6 +2418,16 @@ var g_world_object_types = {
7: 'Player Corpse'
};
var g_quest_states = {
1: 'not taken',
2: 'completed',
// 3: 'unavailable',
4: 'in progress',
// 5: 'available',
6: 'failed',
7: 'rewarded'
};
var g_condition_types = {
1: ['Looting', 'If the conditions are met, this item can be dropped by [npc=$1].'], // CND_SRC_CREATURE_LOOT_TEMPLATE
2: ['Disenchanting', 'If the conditions are met, this item can be found when disenchanting [item=$1].'], // CND_SRC_DISENCHANT_LOOT_TEMPLATE
@@ -2477,7 +2487,19 @@ var g_conditions = {
35: 'The target is$: not; $2 $1yd away',
36: 'The target is$: not; alive',
37: 'The target\'s health is$: not; $2 $1',
37: 'The target\'s health is$: not; $2 $1%'
38: 'The target\'s health is$: not; $2 $1%',
39: 'The player has achieved $1',
40: 'The target is$: not; swimming',
41: '', // not used
42: 'The target is $sitting:standing;', // use param1: exact match
43: 'The player has finished $1',
44: 'The target is charmed',
45: 'The target\'s pet is a $1',
46: 'The player is using a taxi',
47: 'The player is on quest $1 with status $2',
48: 'The player completed $3 objective $2 from $1',
49: 'The difficulty of this map is $1',
51: 'The target object is $1' // also used by 52
};
/* end aowow custom */