From 061449686d4f5ea1b91a300d2e27c11044b3b4ce Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sun, 21 Nov 2021 09:50:59 +0100 Subject: [PATCH] Revert "[WIP] Conditions" This reverts commit a1f0f3d30dd7b4d44a25c8594f9d974efc6222c2. --- includes/defines.php | 96 +++++++++++++------------------- includes/utilities.php | 3 - static/js/global.js | 116 ++++++++++++--------------------------- static/js/locale_dede.js | 2 +- static/js/locale_enus.js | 24 +------- 5 files changed, 76 insertions(+), 165 deletions(-) diff --git a/includes/defines.php b/includes/defines.php index c751d775..3864c540 100644 --- a/includes/defines.php +++ b/includes/defines.php @@ -628,13 +628,6 @@ define('QUEST_FLAG_SPECIAL_DUNGEON_FINDER', 0x08); define('QUEST_FLAG_SPECIAL_MONTHLY', 0x10); define('QUEST_FLAG_SPECIAL_SPELLCAST', 0x20); // not documented in wiki! :[ -define('QUEST_STATE_NOT_TAKEN', 0x01); -define('QUEST_STATE_COMPLETED', 0x02); -define('QUEST_STATE_IN_PROGRESS', 0x08); -define('QUEST_STATE_FAILED', 0x10); -define('QUEST_STATE_REWARDED', 0x20); - - // GameObject define('OBJECT_DOOR', 0); define('OBJECT_BUTTON', 1); @@ -1291,57 +1284,44 @@ define('CND_SRC_SMART_EVENT', 22); define('CND_SRC_NPC_VENDOR', 23); define('CND_SRC_SPELL_PROC', 24); -define('CND_AURA', 1); // aura is applied: spellId, UNUSED, NULL -define('CND_ITEM', 2); // owns item: itemId, count, UNUSED -define('CND_ITEM_EQUIPPED', 3); // has item equipped: itemId, NULL, NULL -define('CND_ZONEID', 4); // is in zone: areaId, NULL, NULL -define('CND_REPUTATION_RANK', 5); // reputation status: factionId, rankMask, NULL -define('CND_TEAM', 6); // is on team: teamId, NULL, NULL -define('CND_SKILL', 7); // has skill: skillId, value, NULL -define('CND_QUESTREWARDED', 8); // has finished quest: questId, NULL, NULL -define('CND_QUESTTAKEN', 9); // has accepted quest: questId, NULL, NULL -define('CND_DRUNKENSTATE', 10); // has drunken status: stateId, NULL, NULL -define('CND_WORLD_STATE', 11); -define('CND_ACTIVE_EVENT', 12); // world event is active: eventId, NULL, NULL -define('CND_INSTANCE_INFO', 13); -define('CND_QUEST_NONE', 14); // never seen quest: questId, NULL, NULL -define('CND_CLASS', 15); // belongs to classes: classMask, NULL, NULL -define('CND_RACE', 16); // belongs to races: raceMask, NULL, NULL -define('CND_ACHIEVEMENT', 17); // obtained achievement: achievementId, NULL, NULL -define('CND_TITLE', 18); // obtained title: titleId, NULL, NULL -define('CND_SPAWNMASK', 19); -define('CND_GENDER', 20); // has gender: genderId, NULL, NULL -define('CND_UNIT_STATE', 21); -define('CND_MAPID', 22); // is on map: mapId, NULL, NULL -define('CND_AREAID', 23); // is in area: areaId, NULL, NULL -define('CND_UNUSED_24', 24); -define('CND_SPELL', 25); // knows spell: spellId, NULL, NULL -define('CND_PHASEMASK', 26); // is in phase: phaseMask, NULL, NULL -define('CND_LEVEL', 27); // player level is..: level, operator, NULL -define('CND_QUEST_COMPLETE', 28); // has completed quest: questId, NULL, NULL -define('CND_NEAR_CREATURE', 29); // is near creature: creatureId, dist, NULL -define('CND_NEAR_GAMEOBJECT', 30); // is near gameObject: gameObjectId, dist, NULL -define('CND_OBJECT_ENTRY', 31); // target is ???: objectType, id, NULL -define('CND_TYPE_MASK', 32); // target is type: typeMask, NULL, NULL -define('CND_RELATION_TO', 33); -define('CND_REACTION_TO', 34); -define('CND_DISTANCE_TO', 35); // distance to target targetType, dist, operator -define('CND_ALIVE', 36); // target is alive: NULL, NULL, NULL -define('CND_HP_VAL', 37); // targets absolute health: amount, operator, NULL -define('CND_HP_PCT', 38); // targets relative health: amount, operator, NULL -define('CND_REALM_ACHIEVEMENT', 39); // target has achieved: achievementId, NULL, NULL -define('CND_IN_WATER', 40); // target is in water: NULL, NULL, NULL - NegativeCondition: 0 - land; 1 - water -// define('CND_TERRAIN_SWAP', 41); // not used in 3.3.5 -define('CND_STAND_STATE', 42); // target has stateType: isExact, 0:standing;1:sitting, NULL -define('CND_DAILY_QUEST_DONE', 43); // target has done Quest: questId, NULL, NULL -define('CND_CHARMED', 44); // target is charmed: NULL, NULL, NULL -define('CND_PET_TYPE', 45); // target has pet of type: petTypeMask NULL, NULL -define('CND_TAXI', 46); // target is using tyxi: NULL, NULL, NULL -define('CND_QUESTSTATE', 47); // target has questState: questId, stateMask, NULL -define('CND_QUEST_OBJECTIVE_COMPLETE', 48); // target has quest status: questId, objectiveIdx, counter -define('CND_DIFFICULTY_ID', 49); // difficulty mode of map: mode, NULL, NULL -define('CND_OBJECT_ENTRY_GUID', 51); // target object is of..: typeId, orEntry, orGuid -define('CND_TYPE_MASK', 52); // target object has: typeMask, NULL, NULL +define('CND_AURA', 1); // aura is applied: spellId, UNUSED, NULL +define('CND_ITEM', 2); // owns item: itemId, count, UNUSED +define('CND_ITEM_EQUIPPED', 3); // has item equipped: itemId, NULL, NULL +define('CND_ZONEID', 4); // is in zone: areaId, NULL, NULL +define('CND_REPUTATION_RANK', 5); // reputation status: factionId, rankMask, NULL +define('CND_TEAM', 6); // is on team: teamId, NULL, NULL +define('CND_SKILL', 7); // has skill: skillId, value, NULL +define('CND_QUESTREWARDED', 8); // has finished quest: questId, NULL, NULL +define('CND_QUESTTAKEN', 9); // has accepted quest: questId, NULL, NULL +define('CND_DRUNKENSTATE', 10); // has drunken status: stateId, NULL, NULL +define('CND_WORLD_STATE', 11); +define('CND_ACTIVE_EVENT', 12); // world event is active: eventId, NULL, NULL +define('CND_INSTANCE_INFO', 13); +define('CND_QUEST_NONE', 14); // never seen quest: questId, NULL, NULL +define('CND_CLASS', 15); // belongs to classes: classMask, NULL, NULL +define('CND_RACE', 16); // belongs to races: raceMask, NULL, NULL +define('CND_ACHIEVEMENT', 17); // obtained achievement: achievementId, NULL, NULL +define('CND_TITLE', 18); // obtained title: titleId, NULL, NULL +define('CND_SPAWNMASK', 19); +define('CND_GENDER', 20); // has gender: genderId, NULL, NULL +define('CND_UNIT_STATE', 21); +define('CND_MAPID', 22); // is on map: mapId, NULL, NULL +define('CND_AREAID', 23); // is in area: areaId, NULL, NULL +define('CND_UNUSED_24', 24); +define('CND_SPELL', 25); // knows spell: spellId, NULL, NULL +define('CND_PHASEMASK', 26); // is in phase: phaseMask, NULL, NULL +define('CND_LEVEL', 27); // player level is..: level, operator, NULL +define('CND_QUEST_COMPLETE', 28); // has completed quest: questId, NULL, NULL +define('CND_NEAR_CREATURE', 29); // is near creature: creatureId, dist, NULL +define('CND_NEAR_GAMEOBJECT', 30); // is near gameObject: gameObjectId, dist, NULL +define('CND_OBJECT_ENTRY', 31); // target is ???: objectType, id, NULL +define('CND_TYPE_MASK', 32); // target is type: typeMask, NULL, NULL +define('CND_RELATION_TO', 33); +define('CND_REACTION_TO', 34); +define('CND_DISTANCE_TO', 35); // distance to target targetType, dist, operator +define('CND_ALIVE', 36); // target is alive: NULL, NULL, NULL +define('CND_HP_VAL', 37); // targets absolute health: amount, operator, NULL +define('CND_HP_PCT', 38); // targets relative health: amount, operator, NULL // TrinityCore - SmartAI define('SAI_SRC_TYPE_CREATURE', 0); diff --git a/includes/utilities.php b/includes/utilities.php index 75933d54..6f557664 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -1135,9 +1135,6 @@ class Util $c['ConditionValue1'] = 2; else continue 2; - case CND_QUESTSTATE: // 47 - $jsGlobals[TYPE_QUEST][] = $c['ConditionValue1']; - break; } $res = [$c['NegativeCondition'] ? -$c['ConditionTypeOrReference'] : $c['ConditionTypeOrReference']]; diff --git a/static/js/global.js b/static/js/global.js index 19853679..72aab2c8 100644 --- a/static/js/global.js +++ b/static/js/global.js @@ -22860,51 +22860,24 @@ 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; @@ -22926,12 +22899,10 @@ 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) { @@ -22944,46 +22915,31 @@ 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 32: param[0] = _listing(entry[1], g_world_object_types, '$2'); break; + case 36: 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); + param[0] += pIndex + 1; + entry[1] &= ~(1 << pIndex); + } + 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]; diff --git a/static/js/locale_dede.js b/static/js/locale_dede.js index e740e7ca..80f44f59 100644 --- a/static/js/locale_dede.js +++ b/static/js/locale_dede.js @@ -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', - 38: 'Die Gesundheit des Ziels ist$: nicht; $2 $1%' + 37: 'Die Gesundheit des Ziels ist$: nicht; $2 $1%' }; /* end aowow custom */ diff --git a/static/js/locale_enus.js b/static/js/locale_enus.js index ddee05de..d15db3ba 100644 --- a/static/js/locale_enus.js +++ b/static/js/locale_enus.js @@ -2418,16 +2418,6 @@ 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 @@ -2487,19 +2477,7 @@ 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', - 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 + 37: 'The target\'s health is$: not; $2 $1%' }; /* end aowow custom */