diff --git a/includes/defines.php b/includes/defines.php index cd393cf4..ca61e674 100644 --- a/includes/defines.php +++ b/includes/defines.php @@ -754,4 +754,68 @@ define('ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE', 112); // define('ACHIEVEMENT_CRITERIA_TYPE_DISENCHANT_ROLLS', 117); // define('ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS', 119); +// TrinityCore - Condition System +define('CND_SRC_CREATURE_LOOT_TEMPLATE', 1); +define('CND_SRC_DISENCHANT_LOOT_TEMPLATE', 2); +define('CND_SRC_FISHING_LOOT_TEMPLATE', 3); +define('CND_SRC_GAMEOBJECT_LOOT_TEMPLATE', 4); +define('CND_SRC_ITEM_LOOT_TEMPLATE', 5); +define('CND_SRC_MAIL_LOOT_TEMPLATE', 6); +define('CND_SRC_MILLING_LOOT_TEMPLATE', 7); +define('CND_SRC_PICKPOCKETING_LOOT_TEMPLATE', 8); +define('CND_SRC_PROSPECTING_LOOT_TEMPLATE', 9); +define('CND_SRC_REFERENCE_LOOT_TEMPLATE', 10); +define('CND_SRC_SKINNING_LOOT_TEMPLATE', 11); +define('CND_SRC_SPELL_LOOT_TEMPLATE', 12); +define('CND_SRC_SPELL_IMPLICIT_TARGET', 13); +define('CND_SRC_GOSSIP_MENU', 14); +define('CND_SRC_GOSSIP_MENU_OPTION', 15); +define('CND_SRC_CREATURE_TEMPLATE_VEHICLE', 16); +define('CND_SRC_SPELL', 17); +define('CND_SRC_SPELL_CLICK_EVENT', 18); +define('CND_SRC_QUEST_ACCEPT', 19); +define('CND_SRC_QUEST_SHOW_MARK', 20); +define('CND_SRC_VEHICLE_SPELL', 21); +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 ?> diff --git a/includes/kernel.php b/includes/kernel.php index 72bf6636..6288a435 100644 --- a/includes/kernel.php +++ b/includes/kernel.php @@ -92,8 +92,11 @@ session_start(); if (User::init()) User::save(); // save user-variables in session - +// hard-override locale for this call (should this be here..?) // all strings attached.. +if (isset($_GET['locale']) && (CFG_LOCALES & (1 << (int)$_GET['locale']))) + User::useLocale($_GET['locale']); + Lang::load(User::$localeString); diff --git a/includes/types/item.class.php b/includes/types/item.class.php index 9b45a9c0..08c241e7 100644 --- a/includes/types/item.class.php +++ b/includes/types/item.class.php @@ -93,9 +93,9 @@ class ItemList extends BaseType { $ids = array_keys($this->templates); $itemz = DB::Aowow()->select(' - SELECT nv.item AS ARRAY_KEY1, nv.entry AS ARRAY_KEY2, 0 AS eventId, nv.maxcount, iec.* FROM npc_vendor nv LEFT JOIN ?_itemextendedcost iec ON nv.extendedCost = iec.id WHERE {nv.entry IN (?a) AND} nv.item IN (?a) + SELECT nv.item AS ARRAY_KEY1, nv.entry AS ARRAY_KEY2, 0 AS eventId, nv.maxcount, iec.* FROM npc_vendor nv LEFT JOIN ?_itemextendedcost iec ON nv.extendedCost = iec.id WHERE {nv.entry IN (?a) AND} nv.item IN (?a) UNION - SELECT genv.item AS ARRAY_KEY1, c.id AS ARRAY_KEY2, genv.eventEntry AS eventId, genv.maxcount, iec.* FROM game_event_npc_vendor genv JOIN creature c ON c.guid = genv.guid LEFT JOIN ?_itemextendedcost iec ON genv.extendedCost = iec.id {JOIN creature c ON c.guid = genv.guid AND 1= ?d} WHERE {c.id IN (?a) AND} genv.item IN (?a)', + SELECT genv.item AS ARRAY_KEY1, c.id AS ARRAY_KEY2, IFNULL(IF(e.holidayId, e.holidayId, -e.id), 0) AS eventId, genv.maxcount, iec.* FROM game_event_npc_vendor genv JOIN creature c ON c.guid = genv.guid LEFT JOIN ?_events e ON genv.eventEntry = e.id LEFT JOIN ?_itemextendedcost iec ON genv.extendedCost = iec.id {JOIN creature c ON c.guid = genv.guid AND 1= ?d} WHERE {c.id IN (?a) AND} genv.item IN (?a)', empty($filter[TYPE_NPC]) || !is_array($filter[TYPE_NPC]) ? DBSIMPLE_SKIP : $filter[TYPE_NPC], $ids, empty($filter[TYPE_NPC]) || !is_array($filter[TYPE_NPC]) ? DBSIMPLE_SKIP : 1, @@ -308,14 +308,10 @@ class ItemList extends BaseType $data[$this->id]['avail'] = $cost['stock']; // display as number on icon $data[$this->id]['cost'] = [$this->getField('buyPrice')]; - if ($e = $cost['event']) + if ($cost['event']) { - $this->jsGlobals[TYPE_WORLDEVENT][$e] = $e; - $data[$this->id]['condition'] = array( - 'type' => TYPE_WORLDEVENT, - 'typeId' => -$e, - 'status' => 1 - ); + $this->jsGlobals[TYPE_WORLDEVENT][$cost['event']] = $cost['event']; + $row['condition'][0][$this->typeId][] = [[CND_ACTIVE_EVENT, $cost['event']]]; } if ($currency || $tokens) // fill idx:3 if required diff --git a/includes/types/spell.class.php b/includes/types/spell.class.php index 3082a631..ef01200a 100644 --- a/includes/types/spell.class.php +++ b/includes/types/spell.class.php @@ -426,7 +426,7 @@ class SpellList extends BaseType break; } // NPC Model from MiscVal - else if (in_array($this->curTpl['effect'.$i.'Id'], [28, 90]) || in_array($this->curTpl['effect'.$i.'AuraId'], [56, 78])) + else if (in_array($this->curTpl['effect'.$i.'Id'], [28, 90, 134]) || in_array($this->curTpl['effect'.$i.'AuraId'], [56, 78])) { $displays[TYPE_NPC][$id] = $effMV; break; diff --git a/includes/user.class.php b/includes/user.class.php index 6f93abdd..18b95262 100644 --- a/includes/user.class.php +++ b/includes/user.class.php @@ -152,19 +152,16 @@ class User $loc = LOCALE_EN; // set - if ($loc != self::$localeId) - { - if (self::$id) - DB::Aowow()->query('UPDATE ?_account SET locale = ? WHERE id = ?', $loc, self::$id); + if (self::$id) + DB::Aowow()->query('UPDATE ?_account SET locale = ? WHERE id = ?', $loc, self::$id); - self::useLocale($loc); - } + self::useLocale($loc); } // only use once public static function useLocale($use) { - self::$localeId = isset(Util::$localeStrings[$use]) ? $use : 0; + self::$localeId = isset(Util::$localeStrings[$use]) ? $use : LOCALE_EN; self::$localeString = self::localeString(self::$localeId); } diff --git a/includes/utilities.php b/includes/utilities.php index 8324db0f..7c96a132 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -1558,6 +1558,149 @@ class Util return $coords ? true : false; } + + public static function getServerConditions($srcType, $srcGroup = null, $srcEntry = null) + { + if (!$srcGroup && !$srcEntry) + return []; + + $result = []; + $jsGlobals = []; + + $conditions = DB::Aowow()->select( + 'SELECT SourceTypeOrReferenceId, SourceEntry, SourceGroup, ElseGroup, + ConditionTypeOrReference, ConditionTarget, ConditionValue1, ConditionValue2, ConditionValue3, NegativeCondition + FROM conditions + WHERE SourceTypeOrReferenceId IN (?a) AND ?# = ?d + ORDER BY SourceTypeOrReferenceId, SourceEntry, SourceGroup, ElseGroup ASC', + is_array($srcType) ? $srcType : [$srcType], + $srcGroup ? 'SourceGroup' : 'SourceEntry', + $srcGroup ?: $srcEntry + ); + + foreach ($conditions as $c) + { + switch ($c['SourceTypeOrReferenceId']) + { + case CND_SRC_SPELL_CLICK_EVENT: // 18 + case CND_SRC_VEHICLE_SPELL: // 21 + case CND_SRC_NPC_VENDOR: // 23 + $jsGlobals[TYPE_NPC][] = $c['SourceGroup']; + break; + } + + switch ($c['ConditionTypeOrReference']) + { + case CND_AURA: // 1 + $c['ConditionValue2'] = NULL; // do not use his param + case CND_SPELL: // 25 + $jsGlobals[TYPE_SPELL][] = $c['ConditionValue1']; + break; + case CND_ITEM: // 2 + $c['ConditionValue3'] = NULL; // do not use his param + case CND_ITEM_EQUIPPED: // 3 + $jsGlobals[TYPE_ITEM][] = $c['ConditionValue1']; + break; + case CND_MAPID: // 22 - break down to area or remap for use with g_zone_categories + switch ($c['ConditionValue1']) + { + case 530: // outland + $c['ConditionValue1'] = 8; + break; + case 571: // northrend + $c['ConditionValue1'] = 10; + break; + case 0: // old world is fine + case 1: + break; + default: // remap for area + $cnd = array( + ['mapId', (int)$c['ConditionValue1']], + ['parentArea', 0], // not child zones + [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0], + 1 // only one result + ); + $zone = new ZoneList($cnd); + if (!$zone->error) + { + $jsGlobals[TYPE_ZONE][] = $zone->getField('id'); + $c['ConditionTypeOrReference'] = CND_ZONEID; + $c['ConditionValue1'] = $zone->getField('id'); + break; + } + else + continue; + } + case CND_ZONEID: // 4 + case CND_AREAID: // 23 + $jsGlobals[TYPE_ZONE][] = $c['ConditionValue1']; + break; + case CND_REPUTATION_RANK: // 5 + $jsGlobals[TYPE_FACTION][] = $c['ConditionValue1']; + break; + case CND_SKILL: // 7 + $jsGlobals[TYPE_SKILL][] = $c['ConditionValue1']; + break; + case CND_QUESTREWARDED: // 8 + case CND_QUESTTAKEN: // 9 + case CND_QUEST_NONE: // 14 + case CND_QUEST_COMPLETE: // 28 + $jsGlobals[TYPE_QUEST][] = $c['ConditionValue1']; + break; + case CND_ACTIVE_EVENT: // 12 + $jsGlobals[TYPE_WORLDEVENT][] = $c['ConditionValue1']; + break; + case CND_ACHIEVEMENT: // 17 + $jsGlobals[TYPE_ACHIEVEMENT][] = $c['ConditionValue1']; + break; + case CND_TITLE: // 18 + $jsGlobals[TYPE_TITLE][] = $c['ConditionValue1']; + break; + case CND_NEAR_CREATURE: // 29 + $jsGlobals[TYPE_NPC][] = $c['ConditionValue1']; + break; + case CND_NEAR_GAMEOBJECT: // 30 + $jsGlobals[TYPE_OBJECT][] = $c['ConditionValue1']; + break; + case CND_CLASS: // 15 + for ($i = 0; $i < 11; $i++) + if ($c['ConditionValue1'] & (1 << $i)) + $jsGlobals[TYPE_CLASS][] = $i + 1; + break; + case CND_RACE: // 16 + for ($i = 0; $i < 11; $i++) + if ($c['ConditionValue1'] & (1 << $i)) + $jsGlobals[TYPE_RACE][] = $i + 1; + break; + case CND_OBJECT_ENTRY: // 31 + if ($c['ConditionValue1'] == 3) + $jsGlobals[TYPE_NPC][] = $c['ConditionValue2']; + else if ($c['ConditionValue1'] == 5) + $jsGlobals[TYPE_OBJECT][] = $c['ConditionValue2']; + break; + case CND_TEAM: // 6 + if ($c['ConditionValue1'] == 469) // Alliance + $c['ConditionValue1'] = 1; + else if ($c['ConditionValue1'] == 67) // Horde + $c['ConditionValue1'] = 2; + else + continue; + } + + $res = [$c['NegativeCondition'] ? -$c['ConditionTypeOrReference'] : $c['ConditionTypeOrReference']]; + foreach ([1, 2, 3] as $i) + if (($_ = $c['ConditionValue'.$i]) || $c['ConditionTypeOrReference'] = CND_DISTANCE_TO) + $res[] = $_; + + $group = $c['SourceEntry']; + if (!in_array($c['SourceTypeOrReferenceId'], [CND_SRC_CREATURE_TEMPLATE_VEHICLE, CND_SRC_SPELL, CND_SRC_QUEST_ACCEPT, CND_SRC_QUEST_SHOW_MARK, CND_SRC_SPELL_PROC])) + $group = $c['SourceEntry'] . ':' . $c['SourceGroup']; + + $result[$c['SourceTypeOrReferenceId']] [$group] [$c['ElseGroup']] [] = $res; + } + + return [$result, $jsGlobals]; + } } ?> diff --git a/localization/locale_dede.php b/localization/locale_dede.php index ba5d5eb5..41d0b463 100644 --- a/localization/locale_dede.php +++ b/localization/locale_dede.php @@ -362,7 +362,7 @@ $lang = array( 'quotes' => "Zitate", 'gainsDesc' => "Nach dem Töten dieses NPCs erhaltet Ihr", 'repWith' => "Ruf mit der Fraktion", - 'stopsAt' => "Stoppt bei %s", + 'stopsAt' => "Endet bei %s", 'vehicle' => "Fahrzeug", 'stats' => "Werte", 'melee' => "Nahkampf", diff --git a/pages/currency.php b/pages/currency.php index 13178185..e6e394e1 100644 --- a/pages/currency.php +++ b/pages/currency.php @@ -42,7 +42,7 @@ class CurrencyPage extends GenericPage protected function generateContent() { - $_itemId = $this->subject->getField('itemId'); + $_itemId = $this->subject->getField('itemId'); /***********/ /* Infobox */ @@ -111,8 +111,8 @@ class CurrencyPage extends GenericPage foreach ($sbData as $k => &$row) { - $this->subject = []; - $tokens = []; + $items = []; + $tokens = []; foreach ($vendors[$k] as $id => $qty) { if (is_string($id)) @@ -121,45 +121,27 @@ class CurrencyPage extends GenericPage if ($id > 0) $tokens[] = [$id, $qty]; else if ($id < 0) - $this->subject[] = [-$id, $qty]; + $items[] = [-$id, $qty]; } - if ($_ = $vendors[$k]['event']) + if ($vendors[$k]['event']) { if (count($extraCols) == 3) // not already pushed $extraCols[] = 'Listview.extraCols.condition'; - $holidays[$_] = 0; // applied as back ref. - - $row['condition'][] = array( - 'type' => TYPE_WORLDEVENT, - 'typeId' => &$holidays[$_], - 'status' => 1 - ); + $this->extendGlobalIds(TYPE_WORLDEVENT, $vendors[$k]['event']); + $row['condition'][0][$this->typeId][] = [[CND_ACTIVE_EVENT, $vendors[$k]['event']]]; } $row['stock'] = $vendors[$k]['stock']; $row['stack'] = $itemObj->getField('buyCount'); $row['cost'] = array( $itemObj->getField('buyPrice'), - $this->subject ? $this->subject : null, - $tokens ? $tokens : null + $items ? $items : null, + $tokens ? $tokens : null ); } - if ($holidays) - { - $hObj = new WorldEventList(array(['id', array_keys($holidays)])); - $this->extendGlobalData($hObj->getJSGlobals()); - foreach ($hObj->iterate() as $id => $tpl) - { - if ($_ = $tpl['holidayId']) - $holidays[$tpl['eventBak']] = $_; - else - $holidays[-$id] = $id; - } - } - $this->lvTabs[] = array( 'file' => 'creature', 'data' => $sbData, @@ -231,7 +213,7 @@ class CurrencyPage extends GenericPage 'params' => [ 'name' => '$LANG.tab_currencyfor', 'id' => 'currency-for', - 'extraCols' => "$[Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack'), Listview.extraCols.cost]", + 'extraCols' => "$[Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack')]", 'note' => $n ? '$$WH.sprintf(LANG.lvnote_filterresults, \''.$n.'\')' : null ] ); diff --git a/pages/event.php b/pages/event.php index 619f8d93..bd6266da 100644 --- a/pages/event.php +++ b/pages/event.php @@ -226,14 +226,8 @@ class EventPage extends GenericPage $relEvents = new WorldEventList(array(['id', $list])); $this->extendGlobalData($relEvents->getJSGlobals()); $relData = $relEvents->getListviewData(); - foreach ($relEvents->iterate() as $id => $__) - { - $relData[$id]['condition'][] = array( - 'type' => TYPE_WORLDEVENT, - 'typeId' => -$this->eId, - 'status' => 2 - ); - } + foreach ($relEvents->getFoundIDs() as $id) + $relData[$id]['condition'][0][$this->typeId][] = [[-CND_ACTIVE_EVENT, -$this->eId]]; $this->extendGlobalData($this->subject->getJSGlobals()); foreach ($rel as $r) @@ -241,14 +235,10 @@ class EventPage extends GenericPage if ($r >= 0) continue; - $this->extendGlobalIds(TYPE_WORLDEVENT, -$r); + $this->extendGlobalIds(TYPE_WORLDEVENT, $r); $d = $this->subject->getListviewData(); - $d[-$this->eId]['condition'][] = array( - 'type' => TYPE_WORLDEVENT, - 'typeId' => $r, - 'status' => 2 - ); + $d[-$this->eId]['condition'][0][$this->typeId][] = [[-CND_ACTIVE_EVENT, $r]]; $relData = array_merge($relData, $d); } diff --git a/pages/genericPage.class.php b/pages/genericPage.class.php index 87ae4908..5b9874f1 100644 --- a/pages/genericPage.class.php +++ b/pages/genericPage.class.php @@ -31,7 +31,6 @@ trait DetailPage trait ListPage { protected $category = null; - protected $typeId = 0; protected $filter = []; protected $lvTabs = []; // most pages have this @@ -247,7 +246,7 @@ class GenericPage private function addArticle() // get article & static infobox (run before processing jsGlobals) { - if (empty($this->type) && !isset($this->typeId)) + if (empty($this->type) || !isset($this->typeId)) return; $article = DB::Aowow()->selectRow( @@ -577,7 +576,10 @@ class GenericPage $cnd[] = ['holidayId', array_unique($hIds, SORT_NUMERIC)]; if ($eIds) - $cnd[] = ['id', array_unique($eIds, SORT_NUMERIC)]; + { + array_walk($eIds, function(&$v) { $v = abs($v);}); + $cnd[] = ['e.id', array_unique($eIds, SORT_NUMERIC)]; + } if ($eIds && $hIds) $cnd[] = 'OR'; diff --git a/pages/item.php b/pages/item.php index 36f0358c..affdac2c 100644 --- a/pages/item.php +++ b/pages/item.php @@ -467,7 +467,7 @@ class ItemPage extends genericPage $reqQuest[$lv['id']] = 0; - $lv['condition'][] = ['type' => TYPE_QUEST, 'typeId' => &$reqQuest[$lv['id']], 'status' => 1]; + $lv['condition'][0][$this->typeId][] = [[CND_QUESTTAKEN, &$reqQuest[$lv['id']]]]; } $this->lvTabs[] = array( @@ -801,11 +801,7 @@ class ItemPage extends genericPage $extraCols[] = 'Listview.extraCols.condition'; $this->extendGlobalIds(TYPE_WORLDEVENT, $e); - $row['condition'][] = array( - 'type' => TYPE_WORLDEVENT, - 'typeId' => -$e, - 'status' => 1 - ); + $row['condition'][0][$this->typeId][] = [[CND_ACTIVE_EVENT, $e]]; } if ($currency || $tokens) // fill idx:3 if required diff --git a/pages/more.php b/pages/more.php index d7e4ce7e..8a7abf39 100644 --- a/pages/more.php +++ b/pages/more.php @@ -22,7 +22,7 @@ class MorePage extends GenericPage 'searchbox' => [-16, 0, 'Search Box'], 'tooltips' => [-10, 0, 'Tooltips'], 'faq' => [ -3, 0, 'Frequently Asked Questions'], - 'aboutus' => [ 0, 0, 'What is AoWoW?'], + 'aboutus' => [ -1, 0, 'What is AoWoW?'], 'searchplugins' => [ -8, 0, 'Search Plugins'], 'help' => [-13, null, ''] ); diff --git a/pages/npc.php b/pages/npc.php index bdd5a144..75b006d1 100644 --- a/pages/npc.php +++ b/pages/npc.php @@ -406,7 +406,7 @@ class NpcPage extends GenericPage if (!isset($extra[0])) $extra[0] = 'Listview.extraCols.condition'; - $data[$sId]['condition'][] = ['type' => TYPE_SKILL, 'typeId' => $_, 'status' => 1, 'reqSkillLvl' => $train['reqSkillValue']]; + $data[$sId]['condition'][0][$this->typeId][] = [[CND_SKILL, $_, $train['reqSkillValue']]]; } if ($_ = $train['reqLevel']) @@ -438,7 +438,7 @@ class NpcPage extends GenericPage } // tab: sells - if ($sells = DB::Aowow()->selectCol('SELECT item FROM npc_vendor nv WHERE entry = ?d UNION SELECT item FROM game_event_npc_vendor genv JOIN creature c ON genv.guid = c.guid WHERE c.id = ?d', $this->typeId, $this->typeId)) + if ($sells = DB::Aowow()->selectCol('SELECT item FROM npc_vendor nv WHERE entry = ?d UNION SELECT item FROM game_event_npc_vendor genv JOIN creature c ON genv.guid = c.guid WHERE c.id = ?d', $this->typeId, $this->typeId)) { $soldItems = new ItemList(array(['id', $sells])); if (!$soldItems->error) @@ -447,9 +447,25 @@ class NpcPage extends GenericPage if ($soldItems->hasSetFields(['condition'])) $extraCols[] = 'Listview.extraCols.condition'; + $lvData = $soldItems->getListviewData(ITEMINFO_VENDOR, [TYPE_NPC => $this->typeId]); + + $sc = Util::getServerConditions(CND_SRC_NPC_VENDOR, $this->typeId); + if ($sc[0]) + { + $this->extendGlobalData($sc[1]); + + if (!array_search('Listview.extraCols.condition', $extraCols)) + $extraCols[] = 'Listview.extraCols.condition'; + + foreach ($lvData as $id => &$row) + foreach ($sc[0] as $srcType => $cndData) + if (!empty($cndData[$id.':'.$this->typeId])) + $row['condition'][0][$id.':'.$this->typeId] = $cndData[$id.':'.$this->typeId]; + } + $this->lvTabs[] = array( 'file' => 'item', - 'data' => $soldItems->getListviewData(ITEMINFO_VENDOR, [TYPE_NPC => $this->typeId]), + 'data' => $lvData, 'params' => array( 'name' => '$LANG.tab_sells', 'id' => 'currency-for', diff --git a/pages/object.php b/pages/object.php index fb50303a..8a5e761e 100644 --- a/pages/object.php +++ b/pages/object.php @@ -67,13 +67,10 @@ class ObjectPage extends GenericPage $infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags')); // Event - if ($_ = DB::Aowow()->selectRow('SELECT e.id, holidayId FROM ?_events e, game_event_gameobject geg, gameobject g WHERE e.id = ABS(geg.eventEntry) AND g.guid = geg.guid AND g.id = ?d', $this->typeId)) + if ($_ = DB::Aowow()->selectCell('SELECT IF(holidayId, holidayId, -e.id) FROM ?_events e, game_event_gameobject geg, gameobject g WHERE e.id = ABS(geg.eventEntry) AND g.guid = geg.guid AND g.id = ?d', $this->typeId)) { - if ($h = $_['holidayId']) - { - $this->extendGlobalIds(TYPE_WORLDEVENT, $_['id']); - $infobox[] = Util::ucFirst(Lang::$game['eventShort']).Lang::$main['colon'].'[event='.$h.']'; - } + $this->extendGlobalIds(TYPE_WORLDEVENT, $_); + $infobox[] = Util::ucFirst(Lang::$game['eventShort']).Lang::$main['colon'].'[event='.$_.']'; } // Reaction @@ -409,7 +406,7 @@ class ObjectPage extends GenericPage $reqQuest[$lv['id']] = 0; - $lv['condition'][] = ['type' => TYPE_QUEST, 'typeId' => &$reqQuest[$lv['id']], 'status' => 1]; + $lv['condition'][0][$this->typeId][] = [[CND_QUESTTAKEN, &$reqQuest[$lv['id']]]]; } $extraCols[] = 'Listview.extraCols.percent'; diff --git a/pages/quest.php b/pages/quest.php index a98dc681..042b4a56 100644 --- a/pages/quest.php +++ b/pages/quest.php @@ -597,6 +597,29 @@ class QuestPage extends GenericPage ) ); } + + // tab: conditions + $sc = Util::getServerConditions([CND_SRC_QUEST_ACCEPT, CND_SRC_QUEST_SHOW_MARK], null, $this->typeId); + if ($sc[0]) + { + if (!empty($sc[0])) + { + $this->extendGlobalData($sc[1]); + $tab = ""; + + $this->lvTabs[] = array( + 'file' => null, + 'data' => $tab, + 'params' => array( + 'id' => 'conditions', + 'name' => '$LANG.requires' + ) + ); + } + } } protected function generateTooltip($asError = false) diff --git a/pages/spell.php b/pages/spell.php index 013f1f68..f02e8bfe 100644 --- a/pages/spell.php +++ b/pages/spell.php @@ -266,8 +266,6 @@ class SpellPage extends GenericPage if (($_ = $this->subject->getField('duration')) && $_ > 0) $this->duration = Util::formatTime($_); - - // factionchange-equivalent /* nyi $pendant = DB::Aowow()->selectCell('SELECT IF(hordethis->typeId = ?d, alliancethis->typeId, -hordethis->typeId) FROM player_factionchange_spells WHERE alliancethis->typeId = ?d OR hordethis->typeId = ?d', $this->typeId, $this->typeId, $this->typeId); @@ -570,10 +568,9 @@ class SpellPage extends GenericPage if (($bar = $this->subject->getField('effect'.$i.'CreateItemId')) && isset($foo[$bar])) { $lv[$bar] = $foo[$bar]; - $lv[$bar]['percent'] = $extraItem['additionalCreateChance']; - $lv[$bar]['condition'][] = ['type' => TYPE_SPELL, 'typeId' => $extraItem['requiredSpecialization'], 'status' => 2]; + $lv[$bar]['percent'] = $extraItem['additionalCreateChance']; + $lv[$bar]['condition'][0][$this->typeId][] = [[CND_SPELL, $extraItem['requiredSpecialization']]]; $this->extendGlobalIds(TYPE_SPELL, $extraItem['requiredSpecialization']); - $extraCols[] = 'Listview.extraCols.condition'; if ($max = $extraItem['additionalMaxNum']) { @@ -777,60 +774,80 @@ class SpellPage extends GenericPage if (empty($lvZones[$a['area']])) continue; - $_ = ['condition' => []]; + $condition = []; $extra = false; if ($a['aura_spell']) { - $this->extendGlobalIds(TYPE_SPELL, $a['aura_spell']); - $_['condition'][] = array( - 'type' => TYPE_SPELL, - 'typeId' => abs($a['aura_spell']), - 'status' => $a['aura_spell'] > 0 ? 1 : 0 - ); + $this->extendGlobalIds(TYPE_SPELL, abs($a['aura_spell'])); + $condition[0][$this->typeId][] = [[$a['aura_spell'] > 0 ? CND_AURA : -CND_AURA, abs($a['aura_spell'])]]; } if ($a['quest_start']) // status for quests needs work { $this->extendGlobalIds(TYPE_QUEST, $a['quest_start']); - $_['condition'][] = array( - 'type' => TYPE_QUEST, - 'typeId' => $a['quest_start'], - 'status' => $a['quest_start_status'] & 0x8 ? 1 : 2 - ); + $group = []; + for ($i = 0; $i < 7; $i++) + { + if (!($a['quest_start_status'] & (1 << $i))) + continue; + + if ($i == 0) + $group[] = [CND_QUEST_NONE, $a['quest_start']]; + else if ($i == 1) + $group[] = [CND_QUEST_COMPLETE, $a['quest_start']]; + else if ($i == 3) + $group[] = [CND_QUESTTAKEN, $a['quest_start']]; + else if ($i == 6) + $group[] = [CND_QUESTREWARDED, $a['quest_start']]; + } + + if ($group) + $condition[0][$this->typeId][] = $group; } if ($a['quest_end'] && $a['quest_end'] != $a['quest_start']) { $this->extendGlobalIds(TYPE_QUEST, $a['quest_end']); - $_['condition'][] = array( - 'type' => TYPE_QUEST, - 'typeId' => $a['quest_end'], - 'status' => $a['quest_start_status'] & 0x8 ? 1 : 0 - ); + $group = []; + for ($i = 0; $i < 7; $i++) + { + if (!($a['quest_end_status'] & (1 << $i))) + continue; + + if ($i == 0) + $group[] = [-CND_QUEST_NONE, $a['quest_end']]; + else if ($i == 1) + $group[] = [-CND_QUEST_COMPLETE, $a['quest_end']]; + else if ($i == 3) + $group[] = [-CND_QUESTTAKEN, $a['quest_end']]; + else if ($i == 6) + $group[] = [-CND_QUESTREWARDED, $a['quest_end']]; + } + + if ($group) + $condition[0][$this->typeId][] = $group; } if ($a['racemask']) { $foo = []; - for ($i = 0; $i < 10; $i++) - if ($a['racemask'] & $i) + for ($i = 0; $i < 11; $i++) + if ($a['racemask'] & (1 << $i)) $foo[] = $i + 1; $this->extendGlobalIds(TYPE_RACE, $foo); - $_['condition'][] = array( - 'type' => TYPE_RACE, - 'typeId' => $a['racemask'], - 'status' => 1 - ); + $condition[0][$this->typeId][] = [[CND_RACE, $a['racemask']]]; } if ($a['gender'] != 2) // 2: both - $_['condition'][] = ['gender' => $a['gender'] + 1]; + $condition[0][$this->typeId][] = [[CND_GENDER, $a['gender'] + 1]]; - if ($_['condition']) + $row = $lvZones[$a['area']]; + if ($condition) + { $extra = true; - - $row = array_merge($_, $lvZones[$a['area']]); + $row = array_merge($row, ['condition' => $condition]); + } // merge subzones, into one row, if: conditions match && parentZone is shared if ($p = $zones->getEntry($a['area'])['parentArea']) @@ -845,7 +862,13 @@ class SpellPage extends GenericPage $set = false; foreach ($lv as &$v) { - if ($v['condition'] != $row['condition'] || ($v['parentArea'] != $row['parentArea'] && $v['id'] != $row['parentArea'])) + if ($v['parentArea'] != $row['parentArea'] && $v['id'] != $row['parentArea']) + continue; + + if (empty($v['condition']) xor empty($row['condition'])) + continue; + + if (!empty($row['condition']) && !empty($v['condition']) && $v['condition'] != $row['condition']) continue; if (!$row['parentArea'] && $v['id'] != $row['parentArea']) @@ -1058,11 +1081,28 @@ class SpellPage extends GenericPage // taughtbytrainers // taughtbyitem + // tab: conditions + $sc = Util::getServerConditions([CND_SRC_SPELL_LOOT_TEMPLATE, CND_SRC_SPELL_IMPLICIT_TARGET, CND_SRC_SPELL, CND_SRC_SPELL_CLICK_EVENT, CND_SRC_VEHICLE_SPELL, CND_SRC_SPELL_PROC], null, $this->typeId); + if ($sc[0]) + { + if (!empty($sc[0])) + { + $this->extendGlobalData($sc[1]); + $tab = ""; - /* NEW - conditions - */ - + $this->lvTabs[] = array( + 'file' => null, + 'data' => $tab, + 'params' => array( + 'id' => 'conditions', + 'name' => '$LANG.requires' + ) + ); + } + } } protected function generateTooltip($asError = false) @@ -1550,6 +1590,7 @@ class SpellPage extends GenericPage break; case 28: // Summon case 90: // Kill Credit + case 134: // Kill Credit2 $_ = Lang::$game['npc'].' #'.$effMV; if ($summon = $this->subject->getModelInfo($this->typeId)) { @@ -1609,7 +1650,6 @@ class SpellPage extends GenericPage $redButtons[BUTTON_VIEW3D] = ['type' => TYPE_OBJECT, 'displayId' => $summon['displayId']]; } - $foo['name'] .= Lang::$main['colon'].$_; break; case 74: // Apply Glyph diff --git a/setup/updates/10_articles.sql b/setup/updates/10_articles.sql new file mode 100644 index 00000000..33785a54 --- /dev/null +++ b/setup/updates/10_articles.sql @@ -0,0 +1,2 @@ +-- type 0 causes trouble with g_pageInfo +UPDATE aowow_articles SET `type` = -1 WHERE `type` = 0; diff --git a/static/css/aowow.css b/static/css/aowow.css index eba0da8b..f89f4060 100644 --- a/static/css/aowow.css +++ b/static/css/aowow.css @@ -1374,6 +1374,12 @@ Variations: padding: 0; } +.listview ul { + text-align: left; + margin: 0 0 0 15px; + padding: 0; +} + .listview th a:hover { background-color: #606060; } diff --git a/static/js/Markup.js b/static/js/Markup.js index 8ee2c587..3e8b82b6 100644 --- a/static/js/Markup.js +++ b/static/js/Markup.js @@ -576,7 +576,7 @@ var Markup = { allowInReplies: true, attr: { - unnamed: { req: true, valid: /^[0-9]+$/ }, + unnamed: { req: true, valid: /^-?[0-9]+$/ }, domain: { req: false, valid: /^(beta|mop|ptr|www|de|es|fr|ru|pt)$/ }, site: { req: false, valid: /^(beta|mop|ptr|www|de|es|fr|ru|pt)$/ } }, @@ -2428,7 +2428,8 @@ var Markup = { return str; } }, - tr: { + tr: + { empty: false, itrim: true, allowedChildren: { td: 1 }, diff --git a/static/js/global.js b/static/js/global.js index 7d435219..0759237f 100644 --- a/static/js/global.js +++ b/static/js/global.js @@ -6824,7 +6824,7 @@ Listview.headerFilter = function(col, res) { } if (res == null) { - var res = prompt($WH.sprintf(LANG.prompt_colfilter1 + (col.type == 'text' ? LANG.prompt_colfilter2: LANG.prompt_colfilter3), col.name), prefilled); + var res = prompt($WH.sprintf(LANG.prompt_colfilter1 + (col.type == 'text' ? LANG.prompt_colfilter2 : LANG.prompt_colfilter3), col.name), prefilled); } if (res != null) { @@ -7428,282 +7428,45 @@ Listview.extraCols = { }, condition: { - /* - condition.status: [ - 0: missing - 1: active - 2: done / obtained - ] - - LANG.completed - LANG.earned - LANG.progress - - probably also zones, skill, faction, .. - */ - id: 'condition', name: LANG.requires, + type: 'text', width: '25%', compute: function(row, td) { - if (!row.condition || !$WH.is_array(row.condition)) { + if (!row.condition) return; - } td.className = 'small'; td.style.lineHeight = '18px'; - for (i in row.condition) { - if (cnd = Listview.extraCols.condition.getState(row.condition[i])) { - if (td.innerHTML) - $WH.ae(td, $WH.ce('br')); + var mText = ConditionList.createCell(row.condition); + Markup.printHtml(mText, td); - var span = $WH.ce('span'); - span.className = cnd.color; - $WH.ae(span, cnd.state); - $WH.ae(td, span); + return; - for (j in cnd.links) { - if (j > 0) { - $WH.ae(td, $WH.ct(LANG.comma)); - } - - var - l = cnd.links[j], - a = $WH.ce('a'); - - a.href = l.url; - a.style.whiteSpace = 'nowrap'; - - // points to self - if (g_pageInfo.type == row.condition[i].type && g_pageInfo.typeId == row.condition[i].typeId) { - a.className = 'q1'; - $WH.st(a, 'This'); - } - else { - $WH.ae(a, $WH.ct(l.name)); - - if (l.icon) { - a.className = 'icontiny tinyspecial'; - a.style.backgroundImage = 'url(' + g_staticUrl + '/images/wow/icons/tiny/' + l.icon + '.gif)'; - } - - if (l.color) { - a.className += ' ' + l.color; - } - } - - $WH.ae(td, a); - } - } - else if ('gender' in row.condition[i]) { - var - gender = g_file_genders[row.condition[i].gender - 1], - sp = $WH.ce('span'); - - sp.className = 'icon-' + gender; - sp.style.position = 'absolute'; - sp.style.right = '0px'; - sp.style.top = '3px'; - sp.innerHTML = ' '; - g_addTooltip(sp, LANG[gender]); - - td.style.position = 'relative'; - - $WH.ae(td, sp); - } - } }, getVisibleText: function(row) { - var buff = ''; + var + buff = '', + mText; - if (!row.condition || !$WH.is_array(row.condition)) { + if (!row.condition) return buff; - } - for (i in row.condition) { - var cnd = Listview.extraCols.condition.getState(row.condition[i]); - if (!cnd) { - continue; - } + mText = ConditionList.createCell(row.condition); - for (j in cnd) { - buff += cnd[j].name + ' ' + cnd.state; - } - } - - return buff; - }, - getState: function(cond) { - switch (g_types[cond.type]) { - case 'skill': - return Listview.extraCols.condition.getSkillState(cond); - case 'spell': - return Listview.extraCols.condition.getSpellState(cond); - case 'item': - return Listview.extraCols.condition.getItemState(cond); - case 'achievement': - return Listview.extraCols.condition.getAchievementState(cond); - case 'quest': - return Listview.extraCols.condition.getQuestState(cond); - case 'event': - return Listview.extraCols.condition.getEventState(cond); - case 'race': - return Listview.extraCols.condition.getRaceState(cond); - default: - return null; - } - }, - getSkillState: function(cond) { - if (!cond.typeId || !g_skills[cond.typeId]) { - return; - } - - var - cnd = {}, - item = g_skills[cond.typeId]; - - cnd.state = $WH.ct((cond.status ? LANG.pr_note_known : LANG.pr_note_missing) + LANG.colon); - cnd.color = cond.status ? 'q2' : 'q10'; - cnd.links = [{ - icon: item.icon.toLowerCase(), - name: item['name_' + Locale.getName()], - url : '?skill=' + cond.typeId - }]; - - if (cond.reqSkillLvl) - cnd.l.name += ' (' + cond.reqSkillLvl + ')'; - - return cnd; - }, - getSpellState: function(cond) { - if (!cond.typeId || !g_spells[cond.typeId]) { - return; - } - - var - cnd = {}, - item = g_spells[cond.typeId]; - - cnd.state = $WH.ct((cond.status ? LANG.pr_note_known : LANG.pr_note_missing) + LANG.colon); - cnd.color = cond.status ? 'q2' : 'q10'; - cnd.links = [{ - icon: item.icon.toLowerCase(), - name: item['name_' + Locale.getName()], - url : '?spell=' + cond.typeId - }]; - - return cnd; - }, - getItemState: function(cond) { - if (!cond.typeId || !g_items[cond.typeId]) { - return; - } - - var - cnd = {}, - item = g_items[cond.typeId]; - - cnd.state = $WH.ct((cond.status ? LANG.pr_note_earned : LANG.pr_note_missing) + LANG.colon); - cnd.color = cond.status ? 'q2' : 'q10'; - cnd.links = [{ - icon : item.icon.toLowerCase(), - name : item['name_' + Locale.getName()], - url : '?item=' + cond.typeId, - color: 'q' + item.quality - }]; - - return cnd; - }, - getAchievementState: function(cond) { - if (!cond.typeId || !g_achievements[cond.typeId]) { - return; - } - - var - cnd = {}, - item = g_achievements[cond.typeId]; - - cnd.state = $WH.ct((cond.status ? LANG.pr_note_earned : LANG.pr_note_incomplete) + LANG.colon); - cnd.color = cond.status ? 'q2' : 'q10'; - cnd.links = [{ - icon: item.icon.toLowerCase(), - name: item['name_' + Locale.getName()], - url : '?achievement=' + cond.typeId - }]; - - return cnd; - }, - getQuestState: function(cond) { - if (!cond.typeId || !g_quests[cond.typeId]) { - return; - } - - var - cnd = {}, - item = g_quests[cond.typeId]; - - cnd.state = $WH.ct((cond.status == 1 ? LANG.progress : (cond.status == 2 ? LANG.pr_note_complete : LANG.pr_note_incomplete)) + LANG.colon); - cnd.color = cond.status == 1 ? 'q1' : cond.status == 2 ? 'q2' : 'q10'; - cnd.links = [{ - name: item['name_' + Locale.getName()], - url : '?quest=' + cond.typeId - }]; - - return cnd; - }, - getRaceState: function(cond) { - if (!cond.typeId) { - return; - } - - var - cnd = {}, - name = $WH.ce('div'), - races = Listview.funcBox.assocBinFlags(cond.typeId, g_chr_races); - - cnd.state = $WH.ct((cond.status ? 'Player is' : 'Player is not') + LANG.colon); - cnd.color = 'q1'; - cnd.links = []; - - for (var i = 0, len = races.length; i < len; ++i) { - cnd.links.push({ - name: g_chr_races[races[i]], - url : '?class=' + races[i] - }); - } - - return cnd; - }, - getEventState: function(cond) { - if (!cond.typeId || !g_holidays[cond.typeId]) { - return; - } - - var - cnd = {}, - item = g_holidays[cond.typeId]; - - cnd.state = $WH.ct((cond.status == 1 ? 'active' : (cond.status == 2 ? LANG.pr_note_complete : 'inactive')) + LANG.colon); - cnd.color = cond.status == 1 ? 'q1' : cond.status == 2 ? 'q2' : 'q10'; - cnd.links = [{ - icon: item.icon.toLowerCase(), - name: item['name_' + Locale.getName()], - url :'?event=' + cond.typeId - }]; - - return cnd; + return Markup.removeTags(mText); }, sortFunc: function(a, b, col) { - var text1 = this.getVisibleText(a); - var text2 = this.getVisibleText(b); + var + text1 = this.getVisibleText(a), + text2 = this.getVisibleText(b); - if (text1 != '' && text2 == '') { + if (text1 != '' && text2 == '') return -1; - } - if (text2 != '' && text1 == '') { + + if (text2 != '' && text1 == '') return 1; - } return $WH.strcmp(text1, text2); } @@ -20100,3 +19863,277 @@ function g_getIngameLink(color, id, name) { * Wowhead Site Achievements (WSA) * which i intend to ignore */ + +/* custom */ +var ConditionList = new function() { + var + self = this, + _conditions = null; + + self.createCell = function(conditions) { + if (!conditions) + return null; + + _conditions = conditions; + + return _createCell(); + }; + self.createTab = function(conditions) { + if (!conditions) + return null; + + _conditions = conditions; + + return _createTab(); + }; + + function _listing(mask, src, tpl) { + var + arr = Listview.funcBox.assocBinFlags(mask, src).sort(), + buff = ''; + + for (var i = 0, len = arr.length; i < len; ++i) { + if (len > 1 && i == len - 1) + buff += LANG.or; + else if (i > 0) + buff += ', '; + + buff += $WH.sprintf(tpl, arr[i], src[arr[i]]);; + } + + return buff; + } + + function _parseEntry(entry) { + var + cnd = entry, + str = '', + param = ['', null]; + strIdx = Math.abs(entry[0]); + + if (strIdx == 22 || strIdx == 23) + strIdx = 4; + else if (strIdx == 16 || strIdx == 30 || strIdx == 32) + strIdx--;; + + if (!g_conditions[strIdx]) + return 'unknown condition index ' + strIdx; + + // these cases are not (yet) handled in detail + if ($WH.in_array([11, 13, 21, 24, 33, 34], strIdx) != -1) + return g_conditions[strIdx].replace(/\$([^\$:;]*):([^\$:;]*);/, '$' + (entry[0] > 0 ? 1 : 2)); + + 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 4: + 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] + ']'; + if (entry[2]) + param[0] += $WH.sprintf(LANG.qty, entry[2]); + break; + case 5: var standings = {}; + for (i in g_reputation_standings) + standings[i * 1 + 1] = g_reputation_standings[i]; + + param[0] = '[faction=' + entry[1] + ']'; + param[1] = _listing(entry[2], standings, '$2'); + break; + case 20: if (entry[1] == 0) { + param[0] = LANG.male; + param[1] = g_file_genders[0]; + } + else if (entry[1] == 1) { + param[0] = LANG.female; + param[1] = g_file_genders[1]; + } + else + param[0] = g_npc_types[10]; + break; + case 29: param[0] = '[npc=' + entry[1] + ']'; + param[1] = entry[2]; + break; + case 30: param[0] = '[object=' + entry[1] + ']'; + param[1] = entry[2]; + break; + case 31: if (entry[2] && entry[1] == 3) { + param[0] = '[npc=' + entry[2] + ']'; + break; + } + else if (entry[2] && entry[1] == 5) { + param[0] = '[object=' + entry[2] + ']'; + break; + } + 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, '$1'); 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 26: + 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++; + } + } + + str = g_conditions[strIdx]; + + // resolve nagation + str = str.replace(/\$([^\$:;]*):([^\$:;]*);/, '$' + (entry[0] > 0 ? 1 : 2)); + + // resolve params + return $WH.sprintf(str, param[0], param[1]); + } + + function _createTab() { + var + nTabs = Object.keys(_conditions).length, + nSubTabs = [], + buff = ''; + + for (g in _conditions) { + nSubTabs[g] = Object.keys(_conditions[g]).length; + if (nSubTabs[g] > 1) + nTabs += nSubTabs[g]; + } + + if (nTabs > 1) + buff += '[tabs name=conditionSource]'; + + // tabs for conditionsTypes + for (g in _conditions) { + if (!g_condition_types[g]) + continue; + + var nSubTypes = Object.keys(_conditions[g]).length; + + for (h in _conditions[g]) { + var + srcGrp = h.split(':'); + nGroups = Object.keys(_conditions[g][h]).length, + curGroup = 1; + + if (nTabs > 1) { + if (nSubTabs[g] > 1) { + // only set for NPCs + var sName = srcGrp[1]; + if ($WH.in_array([18, 21, 23], g) != -1) + sName = g_npcs[srcGrp[1]]['name_' + Locale.getName()]; + buff += '[tab name="' + g_condition_types[g][0] + ' (' + sName + ')"]'; + } + else + buff += '[tab name="' + g_condition_types[g][0] + '"]'; + } + + buff += '[h3]' + $WH.sprintf(g_condition_types[g][1], srcGrp[0], srcGrp[1] || '') + '[/h3]'; + + if (nGroups > 1) { + buff += LANG.note_condition_group + '[br][br]'; + buff += '[table class=grid]'; + } + + // table for elseGroups + for (i in _conditions[g][h]) { + var + group = _conditions[g][h][i], + nEntries = Object.keys(_conditions[g][h][i]).length; + + if (nGroups <= 1 && nEntries > 1) + buff += LANG.note_condition + '[br][br]'; + if (nGroups > 1) + buff += '[tr][td width=70px valign=middle align=center]' + LANG.group + ' ' + (curGroup++) + LANG.colon + '[/td][td]'; + + // individual conditions + for (j in group) + buff += _parseEntry(group[j]) + '[br]'; + + if (nGroups > 1) + buff += '[/td][/tr]'; + } + + if (nGroups > 1) + buff += '[/tr][/table]'; + + if (nTabs > 1) + buff += '[/tab]'; + } + } + + if (nTabs > 1) + buff += '[/tabs]'; + + return buff; + } + + function _createCell() { + var rows = []; + + // tabs for conditionsTypes + for (g in _conditions) { + for (h in _conditions[g]) { + + // table for elseGroups + for (i in _conditions[g][h]) { + var + subGroup = [], + group = _conditions[g][h][i], + nEntries = Object.keys(_conditions[g][h][i]).length; + + // individual conditions + for (j in group) { + if (nEntries > 1) + subGroup.push(_parseEntry(group[j])); + else + rows.push(_parseEntry(group[j])); + } + + if (subGroup.length) { + var buff = ''; + for (j in subGroup) { + if (j > 0 && j == subGroup.length - 1) + buff += LANG.and; + else if (j > 0) + buff += ', '; + + buff += subGroup[j]; + } + + rows.push(buff); + } + } + } + } + + return rows.length > 1 ? '[ul][li]' + rows.join('[/li][li]') + '[/li][/ul]' : rows[0]; + } + +} +/* end custom */ diff --git a/static/js/locale_dede.js b/static/js/locale_dede.js index 7b92dd0f..95fb4efe 100644 --- a/static/js/locale_dede.js +++ b/static/js/locale_dede.js @@ -2217,8 +2217,95 @@ var g_socket_names = { 14: 'Prismatischer Sockel' }; +/* custom */ +var g_drunk_states = { + 0: 'nüchtern', + 1: 'beschwipst', + 2: 'betrunken', + 3: 'sternhagelvoll' +}; + +var g_operators = { + 0: 'genau', + 1: 'mehr als', + 2: 'weniger als', + 3: 'mehr als oder genau', + 4: 'weniger als oder genau' +}; + +var g_world_object_types = { + 3: 'Kreatur', + 4: 'Spieler', + 5: 'Gameobject', + 7: 'Spielerleiche' +}; + +var g_condition_types = { + 1: ['Plündern', 'If the conditions are met, this item can be dropped by [npc=$1].'], // CND_SRC_CREATURE_LOOT_TEMPLATE + 2: ['Entzaubern', 'If the conditions are met, this item can be found when disenchanting [item=$1].'], // CND_SRC_DISENCHANT_LOOT_TEMPLATE + 3: ['Angeln', 'If the conditions are met, fishing in [zone=$1] can yield this item.'], // CND_SRC_FISHING_LOOT_TEMPLATE + 4: ['Objekt Öffnen', 'If the conditions are met, this item can be found in [object=$1].'], // CND_SRC_GAMEOBJECT_LOOT_TEMPLATE + 5: ['Gegenst. Öffnen', 'If the conditions are met, this item can be found in [item=$1].'], // CND_SRC_ITEM_LOOT_TEMPLATE + 6: ['Brief Anhang.', 'If the conditions are met, this item can be attached to this mail.'], // CND_SRC_MAIL_LOOT_TEMPLATE + 7: ['Mahlen', 'If the conditions are met, this item can be milled from [item=$1].'], // CND_SRC_MILLING_LOOT_TEMPLATE + 8: ['Stehlen', 'If the conditions are met, this item can be picked from [npc=$1].'], // CND_SRC_PICKPOCKETING_LOOT_TEMPLATE + 9: ['Sondieren', 'If the conditions are met, this item can be prospected from [item=$1].'], // CND_SRC_PROSPECTING_LOOT_TEMPLATE + 10: ['Ref. Plündern', ''], // CND_SRC_REFERENCE_LOOT_TEMPLATE + 11: ['Kürschnern', 'If the conditions are met, this item can be skinned (salvaged, (mined, (herbed))) from [npc=$1].'], // CND_SRC_SKINNING_LOOT_TEMPLATE + 12: ['Herstellen', 'If the conditions are met, casting [spell=$1] may also create this item.'], // CND_SRC_SPELL_LOOT_TEMPLATE + 13: ['Autom. Zielwahl', 'Nur Ziele, welche diese Bedinungen erfüllen, können von diesem Zauber betroffen sein.'], // CND_SRC_SPELL_IMPLICIT_TARGET + 14: ['Dialog', 'Zeige den verwandten Dialog, wenn die Bedingungen erfüllt sind.'], // CND_SRC_GOSSIP_MENU + 15: ['Dialog Menü', 'Zeige das verwandte Dialogmenü, wenn die Bedingungen erfüllt sind.'], // CND_SRC_GOSSIP_MENU_OPTION + 16: ['Vehicle', 'Diese Kreatur kann als Fahrzeug benutzt werden, wenn die Bedingungen erfüllt sind.'], // CND_SRC_CREATURE_TEMPLATE_VEHICLE + 17: ['Zauber', 'Der Zauber kann nur gewirkt werden, wenn die Bedingungen erfüllt sind.'], // CND_SRC_SPELL + 18: ['Klick', 'Wenn die Bedingung erfüllt ist, wirkt [npc=$2] [spell=$1], wenn man darauf klickt.'], // CND_SRC_SPELL_CLICK_EVENT + 19: ['Quest Symbol', 'Ein [icon name=quest_startend] [/icon] wird für dieses Quest angezeigt, wenn die Bedingungen erfüllt sind.'], // CND_SRC_QUEST_ACCEPT + 20: ['Quest Annahme', 'Der Spieler kann dieses Quest annehmen, wenn die Bedingungen erfüllt sind.'], // CND_SRC_QUEST_SHOW_MARK + 21: ['Fahrzeug Fähigk.', 'Wenn die Bedingung erfüllt ist, ist im Fahrzeug [npc=$2] [spell=$1] verfügbar'], // CND_SRC_VEHICLE_SPELL + 22: ['SmartKI', 'If the conditions are met, the creatures AI may perform additional actions.'], // CND_SRC_SMART_EVENT + 23: ['Händler', 'If the conditions are met, the vendor will have this item available.'], // CND_SRC_NPC_VENDOR + 24: ['Zauberauslösung', 'If the conditions are met, the spell is allowed to proc.'] // CND_SRC_SPELL_PROC +}; + +var g_conditions = { + 1: 'Der Spieler hat $eine:keine; Aura von $1', + 2: 'Der Spieler besitzt$: nicht; $1', + 3: 'Der Spieler hat$: nicht; $1 ausgerüstet', + 4: 'Der Spieler befindet sich$: nicht; in $1', // also used by 22, 23 + 5: 'Der Ruf bei $1 ist$: nicht; $2', + 6: 'Der Spieler ist$: nicht; $1', + 7: 'Der Spieler beherrscht $1$: nicht;', + 8: 'Der Spieler hat $1$: nicht; beendet', + 9: 'Der Spieler hat $1$: nicht; angenommen', + 10: 'Der Spieler ist$: nicht; $1', + 11: 'Die Spielwelt hat einen bestimmten Zustand$: nicht;',// nyi + 12: '$1 ist$: nicht; aktiv', + 13: 'Die Instanz hat einen bestimmten Zustand$: nicht;',// nyi + 14: 'Der Spieler hat $nie :;mit $1 interagiert', + 15: 'Der Spieler ist$: nicht; ein $1', // also used by 16 + 17: 'Der Spieler hat $1$: nicht; erlangt', + 18: 'Der Spieler hat $1$: nicht; erhalten', + 20: 'Des Spielers Geschlecht is$: nicht; [span class=icon-$2]$1[/span]', + 21: 'Das Ziel hat einen bestimmten Zustand$: nicht;', // nyi + 24: '', // not used + 25: 'Der Spieler kennt$: nicht; $1', + 26: 'Die Kreatur befindet sich$: nicht; in Phase $1', + 27: 'Die Stufe des Ziels ist$: nicht; $2 $1', + 28: 'Der Spieler hat $1$: nicht; abgeschlossen', + 29: 'Der Spieler befindet sich$: nicht; in $2m zu $1', // also used by 30 + 31: 'Das Ziel des Zaubers ist$: nicht;: $1', // also used by 32 + 33: 'Der Spieler hat eine bestimmte Beziehung mit dem Ziel$: nicht;', // nyi + 34: 'Der Spieler hat eine bestimmte Ruf-Reaktion mit dem Ziel$: nicht;', // nyi + 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%' +}; +/* end custom */ + var LANG = { and: " und ", + or: " oder ", // custom comma: ", ", ellipsis: "…", dash: " – ", @@ -4252,5 +4339,10 @@ var LANG = { added: "Hinzugefügt", build: "Version", calculators: "Rechner", - patch: "Patch" + patch: "Patch", + + /* custom */ + note_condition: "Jede einzelne, der hier aufgeführte Bedingungen, muss erfüllt sein um die Gesamtbedingung zu erfüllen.", + note_condition_group: "Eine beliebige, der hier aufgeführte Gruppen, muss vollständig erfüllt sein um die Gesamtbedingung zu erfüllen." + /* end custom */ }; diff --git a/static/js/locale_enus.js b/static/js/locale_enus.js index cd66eb71..1e481343 100644 --- a/static/js/locale_enus.js +++ b/static/js/locale_enus.js @@ -2263,8 +2263,96 @@ var g_socket_names = { 14: 'Prismatic Socket' }; +/* custom */ +// DRUNK_MESSAGE_* +var g_drunk_states = { + 0: 'sober', + 1: 'tipsy', + 2: 'drunk', + 3: 'smashed' +}; + +var g_operators = { + 0: 'exact', + 1: 'more than', + 2: 'less than', + 3: 'more than or exact', + 4: 'less than or exact' +}; + +var g_world_object_types = { + 3: 'Creature', + 4: 'Player', + 5: 'Gameobject', + 7: 'Player Corpse' +}; + +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 + 3: ['Fishing', 'If the conditions are met, fishing in [zone=$1] can yield this item.'], // CND_SRC_FISHING_LOOT_TEMPLATE + 4: ['Object Opening', 'If the conditions are met, this item can be found in [object=$1].'], // CND_SRC_GAMEOBJECT_LOOT_TEMPLATE + 5: ['Item Opening', 'If the conditions are met, this item can be found in [item=$1].'], // CND_SRC_ITEM_LOOT_TEMPLATE + 6: ['Mail Attachm.', 'If the conditions are met, this item can be attached to this mail.'], // CND_SRC_MAIL_LOOT_TEMPLATE + 7: ['Milling', 'If the conditions are met, this item can be milled from [item=$1].'], // CND_SRC_MILLING_LOOT_TEMPLATE + 8: ['Pickpocketing', 'If the conditions are met, this item can be picked from [npc=$1].'], // CND_SRC_PICKPOCKETING_LOOT_TEMPLATE + 9: ['Prospecting', 'If the conditions are met, this item can be prospected from [item=$1].'], // CND_SRC_PROSPECTING_LOOT_TEMPLATE + 10: ['Ref. Looting', ''], // CND_SRC_REFERENCE_LOOT_TEMPLATE + 11: ['Skinning', 'If the conditions are met, this item can be skinned (salvaged, (mined, (herbed))) from [npc=$1].'], // CND_SRC_SKINNING_LOOT_TEMPLATE + 12: ['Crafting', 'If the conditions are met, casting [spell=$1] may also create this item.'], // CND_SRC_SPELL_LOOT_TEMPLATE + 13: ['Auto Target', 'Only targets matching the conditions can be affected by the spell.'], // CND_SRC_SPELL_IMPLICIT_TARGET + 14: ['Gossip', 'Display the related Gossip entry on [npc=$2], if the conditions are met.'], // CND_SRC_GOSSIP_MENU + 15: ['Gossip Menu', 'Display the related Gossip menu, if the conditions are met.'], // CND_SRC_GOSSIP_MENU_OPTION + 16: ['Vehicle', 'This Creature can be used as a vehicle, if the conditions are met.'], // CND_SRC_CREATURE_TEMPLATE_VEHICLE + 17: ['Spell', 'This Spell can only be cast, if the conditions are met.'], // CND_SRC_SPELL + 18: ['Spell Click', 'If the conditions are met, [npc=$2] casts [spell=$1] if clicked on.'], // CND_SRC_SPELL_CLICK_EVENT + 19: ['Quest Sign', 'A [icon name=quest_startend] [/icon] will be shown for this quest, if the condition is met.'], // CND_SRC_QUEST_ACCEPT + 20: ['Quest Accept', 'The Player can accept this quest, if the condition is met.'], // CND_SRC_QUEST_SHOW_MARK + 21: ['Vehicle Spell', 'If the conditions are met, vehicle [npc=$2] has [spell=$1] available.'], // CND_SRC_VEHICLE_SPELL + 22: ['SmartAI', 'If the conditions are met, the creatures AI may perform additional actions.'], // CND_SRC_SMART_EVENT + 23: ['Vendor', 'If the conditions are met, the vendor will have this item available.'], // CND_SRC_NPC_VENDOR + 24: ['Spell Proc', 'If the conditions are met, the spell is allowed to proc.'] // CND_SRC_SPELL_PROC +}; + +var g_conditions = { + 1: 'The Player $has:does not have; an aura of $1', + 2: 'The Player $owns: does not own; $1', + 3: 'The Player $has:does not have; $1 equipped', + 4: 'The Player is$: not; in $1', // also used by 22, 23 + 5: 'The Player\'s standing with $1 is$: not; $2', + 6: 'The Player is$: not; $1', + 7: 'The Player $knows: does not know; $1', + 8: 'The Player has$: not; finished $1', + 9: 'The Player has$: not; accepted $1', + 10: 'The Player is$: not; $1', + 11: 'The game word is$: not; in a certain state', // nyi + 12: '$1 must$: not; be active', + 13: 'The instance $has:does not have; a certain state', // nyi + 14: 'The Player has $never:; interacted with $1', + 15: 'The Player is$: not; a $1', // also used by 16 + 17: 'The Player has$: not; achieved $1', + 18: 'The Player has$: not; obtained $1', + 20: 'The Player\'s gender is$: not; [span class=icon-$2]$1[/span]', + 21: 'The target $has:does not have; a certain state', // nyi + 24: '', // not used + 25: 'The Player $knows: does not know; $1', + 26: 'The Creature is$: not; in phase $1', + 27: 'The target\'s level is$: not; $2 $1', + 28: 'The Player has$: not; completed $1', + 29: 'The Player is$: not; within $2yd of $1', // also used by 30 + 31: 'Casters\'s target is$: not; $1', // also used by 32 + 33: 'The Player $has:does not have; a certain relation to the target', // nyi + 34: 'The target $has:does not have; a certain reaction to the Player', // nyi + 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%' +}; +/* end custom */ + var LANG = { and: " and ", + or: " or ", // custom comma: ", ", ellipsis: "…", dash: " – ", @@ -4298,5 +4386,10 @@ var LANG = { added: "Added", build: "Build", calculators: "Calculators", - patch: "Patch" + patch: "Patch", + + /* custom */ + note_condition: "Every one of these conditions must be met to satisfy the requirement.", + note_condition_group: "Any one of these groups must be met in full to satisfy the requirement." + /* end custom */ }; diff --git a/static/js/locale_eses.js b/static/js/locale_eses.js index 23c600c5..35b31ace 100644 --- a/static/js/locale_eses.js +++ b/static/js/locale_eses.js @@ -2219,8 +2219,96 @@ var g_socket_names = { 14: 'Ranura prismática' }; +/* custom */ +// DRUNK_MESSAGE_* +var g_drunk_states = { + 0: 'sober', + 1: 'tipsy', + 2: 'drunk', + 3: 'smashed' +}; + +var g_operators = { + 0: 'exact', + 1: 'more than', + 2: 'less than', + 3: 'more than or exact', + 4: 'less than or exact' +}; + +var g_world_object_types = { + 3: 'Creature', + 4: 'Player', + 5: 'Gameobject', + 7: 'Player Corpse' +}; + +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 + 3: ['Fishing', 'If the conditions are met, fishing in [zone=$1] can yield this item.'], // CND_SRC_FISHING_LOOT_TEMPLATE + 4: ['Object Opening', 'If the conditions are met, this item can be found in [object=$1].'], // CND_SRC_GAMEOBJECT_LOOT_TEMPLATE + 5: ['Item Opening', 'If the conditions are met, this item can be found in [item=$1].'], // CND_SRC_ITEM_LOOT_TEMPLATE + 6: ['Mail Attachm.', 'If the conditions are met, this item can be attached to this mail.'], // CND_SRC_MAIL_LOOT_TEMPLATE + 7: ['Milling', 'If the conditions are met, this item can be milled from [item=$1].'], // CND_SRC_MILLING_LOOT_TEMPLATE + 8: ['Pickpocketing', 'If the conditions are met, this item can be picked from [npc=$1].'], // CND_SRC_PICKPOCKETING_LOOT_TEMPLATE + 9: ['Prospecting', 'If the conditions are met, this item can be prospected from [item=$1].'], // CND_SRC_PROSPECTING_LOOT_TEMPLATE + 10: ['Ref. Looting', ''], // CND_SRC_REFERENCE_LOOT_TEMPLATE + 11: ['Skinning', 'If the conditions are met, this item can be skinned (salvaged, (mined, (herbed))) from [npc=$1].'], // CND_SRC_SKINNING_LOOT_TEMPLATE + 12: ['Crafting', 'If the conditions are met, casting [spell=$1] may also create this item.'], // CND_SRC_SPELL_LOOT_TEMPLATE + 13: ['Auto Target', 'Only targets matching the conditions can be affected by the spell.'], // CND_SRC_SPELL_IMPLICIT_TARGET + 14: ['Gossip', 'Display the related Gossip entry on [npc=$2], if the conditions are met.'], // CND_SRC_GOSSIP_MENU + 15: ['Gossip Menu', 'Display the related Gossip menu, if the conditions are met.'], // CND_SRC_GOSSIP_MENU_OPTION + 16: ['Vehicle', 'This Creature can be used as a vehicle, if the conditions are met.'], // CND_SRC_CREATURE_TEMPLATE_VEHICLE + 17: ['Spell', 'This Spell can only be cast, if the conditions are met.'], // CND_SRC_SPELL + 18: ['Spell Click', 'If the conditions are met, [npc=$2] casts [spell=$1] if clicked on.'], // CND_SRC_SPELL_CLICK_EVENT + 19: ['Quest Sign', 'A [icon name=quest_startend] [/icon] will be shown for this quest, if the condition is met.'], // CND_SRC_QUEST_ACCEPT + 20: ['Quest Accept', 'The Player can accept this quest, if the condition is met.'], // CND_SRC_QUEST_SHOW_MARK + 21: ['Vehicle Spell', 'If the conditions are met, vehicle [npc=$2] has [spell=$1] available.'], // CND_SRC_VEHICLE_SPELL + 22: ['SmartAI', 'If the conditions are met, the creatures AI may perform additional actions.'], // CND_SRC_SMART_EVENT + 23: ['Vendor', 'If the conditions are met, the vendor will have this item available.'], // CND_SRC_NPC_VENDOR + 24: ['Spell Proc', 'If the conditions are met, the spell is allowed to proc.'] // CND_SRC_SPELL_PROC +}; + +var g_conditions = { + 1: 'The Player $has:does not have; an aura of $1', + 2: 'The Player $owns: does not own; $1', + 3: 'The Player $has:does not have; $1 equipped', + 4: 'The Player is$: not; in $1', // also used by 22, 23 + 5: 'The Player\'s standing with $1 is$: not; $2', + 6: 'The Player is$: not; $1', + 7: 'The Player $knows: does not know; $1', + 8: 'The Player has$: not; finished $1', + 9: 'The Player has$: not; accepted $1', + 10: 'The Player is$: not; $1', + 11: 'The game word is$: not; in a certain state', // nyi + 12: '$1 must$: not; be active', + 13: 'The instance $has:does not have; a certain state', // nyi + 14: 'The Player has $never:; interacted with $1', + 15: 'The Player is$: not; a $1', // also used by 16 + 17: 'The Player has$: not; achieved $1', + 18: 'The Player has$: not; obtained $1', + 20: 'The Player\'s gender is$: not; [span class=icon-$2]$1[/span]', + 21: 'The target $has:does not have; a certain state', // nyi + 24: '', // not used + 25: 'The Player $knows: does not know; $1', + 26: 'The Creature is$: not; in phase $1', + 27: 'The target\'s level is$: not; $2 $1', + 28: 'The Player has$: not; completed $1', + 29: 'The Player is$: not; within $2yd of $1', // also used by 30 + 31: 'Casters\'s target is$: not; $1', // also used by 32 + 33: 'The Player $has:does not have; a certain relation to the target', // nyi + 34: 'The target $has:does not have; a certain reaction to the Player', // nyi + 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%' +}; +/* end custom */ + var LANG = { and: " y ", + or: " o ", comma: ", ", ellipsis: "…", dash: " – ", @@ -4212,5 +4300,10 @@ var LANG = { added: "Añadido", build: "Versión", calculators: "Calculadoras", - patch: "Parche" + patch: "Parche", + + /* custom */ + note_condition: "Every one of these conditions must be met to satisfy the requirement.", + note_condition_group: "Any one of these groups must be met in full to satisfy the requirement." + /* end custom */ }; diff --git a/static/js/locale_frfr.js b/static/js/locale_frfr.js index c886aa19..97577e9b 100644 --- a/static/js/locale_frfr.js +++ b/static/js/locale_frfr.js @@ -2206,8 +2206,96 @@ var g_socket_names = { 14: 'Châsse prismatique' }; +/* custom */ +// DRUNK_MESSAGE_* +var g_drunk_states = { + 0: 'sober', + 1: 'tipsy', + 2: 'drunk', + 3: 'smashed' +}; + +var g_operators = { + 0: 'exact', + 1: 'more than', + 2: 'less than', + 3: 'more than or exact', + 4: 'less than or exact' +}; + +var g_world_object_types = { + 3: 'Creature', + 4: 'Player', + 5: 'Gameobject', + 7: 'Player Corpse' +}; + +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 + 3: ['Fishing', 'If the conditions are met, fishing in [zone=$1] can yield this item.'], // CND_SRC_FISHING_LOOT_TEMPLATE + 4: ['Object Opening', 'If the conditions are met, this item can be found in [object=$1].'], // CND_SRC_GAMEOBJECT_LOOT_TEMPLATE + 5: ['Item Opening', 'If the conditions are met, this item can be found in [item=$1].'], // CND_SRC_ITEM_LOOT_TEMPLATE + 6: ['Mail Attachm.', 'If the conditions are met, this item can be attached to this mail.'], // CND_SRC_MAIL_LOOT_TEMPLATE + 7: ['Milling', 'If the conditions are met, this item can be milled from [item=$1].'], // CND_SRC_MILLING_LOOT_TEMPLATE + 8: ['Pickpocketing', 'If the conditions are met, this item can be picked from [npc=$1].'], // CND_SRC_PICKPOCKETING_LOOT_TEMPLATE + 9: ['Prospecting', 'If the conditions are met, this item can be prospected from [item=$1].'], // CND_SRC_PROSPECTING_LOOT_TEMPLATE + 10: ['Ref. Looting', ''], // CND_SRC_REFERENCE_LOOT_TEMPLATE + 11: ['Skinning', 'If the conditions are met, this item can be skinned (salvaged, (mined, (herbed))) from [npc=$1].'], // CND_SRC_SKINNING_LOOT_TEMPLATE + 12: ['Crafting', 'If the conditions are met, casting [spell=$1] may also create this item.'], // CND_SRC_SPELL_LOOT_TEMPLATE + 13: ['Auto Target', 'Only targets matching the conditions can be affected by the spell.'], // CND_SRC_SPELL_IMPLICIT_TARGET + 14: ['Gossip', 'Display the related Gossip entry on [npc=$2], if the conditions are met.'], // CND_SRC_GOSSIP_MENU + 15: ['Gossip Menu', 'Display the related Gossip menu, if the conditions are met.'], // CND_SRC_GOSSIP_MENU_OPTION + 16: ['Vehicle', 'This Creature can be used as a vehicle, if the conditions are met.'], // CND_SRC_CREATURE_TEMPLATE_VEHICLE + 17: ['Spell', 'This Spell can only be cast, if the conditions are met.'], // CND_SRC_SPELL + 18: ['Spell Click', 'If the conditions are met, [npc=$2] casts [spell=$1] if clicked on.'], // CND_SRC_SPELL_CLICK_EVENT + 19: ['Quest Sign', 'A [icon name=quest_startend] [/icon] will be shown for this quest, if the condition is met.'], // CND_SRC_QUEST_ACCEPT + 20: ['Quest Accept', 'The Player can accept this quest, if the condition is met.'], // CND_SRC_QUEST_SHOW_MARK + 21: ['Vehicle Spell', 'If the conditions are met, vehicle [npc=$2] has [spell=$1] available.'], // CND_SRC_VEHICLE_SPELL + 22: ['SmartAI', 'If the conditions are met, the creatures AI may perform additional actions.'], // CND_SRC_SMART_EVENT + 23: ['Vendor', 'If the conditions are met, the vendor will have this item available.'], // CND_SRC_NPC_VENDOR + 24: ['Spell Proc', 'If the conditions are met, the spell is allowed to proc.'] // CND_SRC_SPELL_PROC +}; + +var g_conditions = { + 1: 'The Player $has:does not have; an aura of $1', + 2: 'The Player $owns: does not own; $1', + 3: 'The Player $has:does not have; $1 equipped', + 4: 'The Player is$: not; in $1', // also used by 22, 23 + 5: 'The Player\'s standing with $1 is$: not; $2', + 6: 'The Player is$: not; $1', + 7: 'The Player $knows: does not know; $1', + 8: 'The Player has$: not; finished $1', + 9: 'The Player has$: not; accepted $1', + 10: 'The Player is$: not; $1', + 11: 'The game word is$: not; in a certain state', // nyi + 12: '$1 must$: not; be active', + 13: 'The instance $has:does not have; a certain state', // nyi + 14: 'The Player has $never:; interacted with $1', + 15: 'The Player is$: not; a $1', // also used by 16 + 17: 'The Player has$: not; achieved $1', + 18: 'The Player has$: not; obtained $1', + 20: 'The Player\'s gender is$: not; [span class=icon-$2]$1[/span]', + 21: 'The target $has:does not have; a certain state', // nyi + 24: '', // not used + 25: 'The Player $knows: does not know; $1', + 26: 'The Creature is$: not; in phase $1', + 27: 'The target\'s level is$: not; $2 $1', + 28: 'The Player has$: not; completed $1', + 29: 'The Player is$: not; within $2yd of $1', // also used by 30 + 31: 'Casters\'s target is$: not; $1', // also used by 32 + 33: 'The Player $has:does not have; a certain relation to the target', // nyi + 34: 'The target $has:does not have; a certain reaction to the Player', // nyi + 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%' +}; +/* end custom */ + var LANG = { and: " et ", + or: " ou ", comma: ", ", ellipsis: "…", dash: " – ", @@ -4202,5 +4290,10 @@ var LANG = { added: "Ajouté", build: "Version", calculators: "Calculateurs", - patch: "Patch" + patch: "Patch", + + /* custom */ + note_condition: "Every one of these conditions must be met to satisfy the requirement.", + note_condition_group: "Any one of these groups must be met in full to satisfy the requirement." + /* end custom */ }; \ No newline at end of file diff --git a/static/js/locale_ruru.js b/static/js/locale_ruru.js index 6e8cb7a7..af96622f 100644 --- a/static/js/locale_ruru.js +++ b/static/js/locale_ruru.js @@ -2206,8 +2206,96 @@ var g_socket_names = { 14: 'Бесцветное гнездо' }; +/* custom */ +// DRUNK_MESSAGE_* +var g_drunk_states = { + 0: 'sober', + 1: 'tipsy', + 2: 'drunk', + 3: 'smashed' +}; + +var g_operators = { + 0: 'exact', + 1: 'more than', + 2: 'less than', + 3: 'more than or exact', + 4: 'less than or exact' +}; + +var g_world_object_types = { + 3: 'Creature', + 4: 'Player', + 5: 'Gameobject', + 7: 'Player Corpse' +}; + +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 + 3: ['Fishing', 'If the conditions are met, fishing in [zone=$1] can yield this item.'], // CND_SRC_FISHING_LOOT_TEMPLATE + 4: ['Object Opening', 'If the conditions are met, this item can be found in [object=$1].'], // CND_SRC_GAMEOBJECT_LOOT_TEMPLATE + 5: ['Item Opening', 'If the conditions are met, this item can be found in [item=$1].'], // CND_SRC_ITEM_LOOT_TEMPLATE + 6: ['Mail Attachm.', 'If the conditions are met, this item can be attached to this mail.'], // CND_SRC_MAIL_LOOT_TEMPLATE + 7: ['Milling', 'If the conditions are met, this item can be milled from [item=$1].'], // CND_SRC_MILLING_LOOT_TEMPLATE + 8: ['Pickpocketing', 'If the conditions are met, this item can be picked from [npc=$1].'], // CND_SRC_PICKPOCKETING_LOOT_TEMPLATE + 9: ['Prospecting', 'If the conditions are met, this item can be prospected from [item=$1].'], // CND_SRC_PROSPECTING_LOOT_TEMPLATE + 10: ['Ref. Looting', ''], // CND_SRC_REFERENCE_LOOT_TEMPLATE + 11: ['Skinning', 'If the conditions are met, this item can be skinned (salvaged, (mined, (herbed))) from [npc=$1].'], // CND_SRC_SKINNING_LOOT_TEMPLATE + 12: ['Crafting', 'If the conditions are met, casting [spell=$1] may also create this item.'], // CND_SRC_SPELL_LOOT_TEMPLATE + 13: ['Auto Target', 'Only targets matching the conditions can be affected by the spell.'], // CND_SRC_SPELL_IMPLICIT_TARGET + 14: ['Gossip', 'Display the related Gossip entry on [npc=$2], if the conditions are met.'], // CND_SRC_GOSSIP_MENU + 15: ['Gossip Menu', 'Display the related Gossip menu, if the conditions are met.'], // CND_SRC_GOSSIP_MENU_OPTION + 16: ['Vehicle', 'This Creature can be used as a vehicle, if the conditions are met.'], // CND_SRC_CREATURE_TEMPLATE_VEHICLE + 17: ['Spell', 'This Spell can only be cast, if the conditions are met.'], // CND_SRC_SPELL + 18: ['Spell Click', 'If the conditions are met, [npc=$2] casts [spell=$1] if clicked on.'], // CND_SRC_SPELL_CLICK_EVENT + 19: ['Quest Sign', 'A [icon name=quest_startend] [/icon] will be shown for this quest, if the condition is met.'], // CND_SRC_QUEST_ACCEPT + 20: ['Quest Accept', 'The Player can accept this quest, if the condition is met.'], // CND_SRC_QUEST_SHOW_MARK + 21: ['Vehicle Spell', 'If the conditions are met, vehicle [npc=$2] has [spell=$1] available.'], // CND_SRC_VEHICLE_SPELL + 22: ['SmartAI', 'If the conditions are met, the creatures AI may perform additional actions.'], // CND_SRC_SMART_EVENT + 23: ['Vendor', 'If the conditions are met, the vendor will have this item available.'], // CND_SRC_NPC_VENDOR + 24: ['Spell Proc', 'If the conditions are met, the spell is allowed to proc.'] // CND_SRC_SPELL_PROC +}; + +var g_conditions = { + 1: 'The Player $has:does not have; an aura of $1', + 2: 'The Player $owns: does not own; $1', + 3: 'The Player $has:does not have; $1 equipped', + 4: 'The Player is$: not; in $1', // also used by 22, 23 + 5: 'The Player\'s standing with $1 is$: not; $2', + 6: 'The Player is$: not; $1', + 7: 'The Player $knows: does not know; $1', + 8: 'The Player has$: not; finished $1', + 9: 'The Player has$: not; accepted $1', + 10: 'The Player is$: not; $1', + 11: 'The game word is$: not; in a certain state', // nyi + 12: '$1 must$: not; be active', + 13: 'The instance $has:does not have; a certain state', // nyi + 14: 'The Player has $never:; interacted with $1', + 15: 'The Player is$: not; a $1', // also used by 16 + 17: 'The Player has$: not; achieved $1', + 18: 'The Player has$: not; obtained $1', + 20: 'The Player\'s gender is$: not; [span class=icon-$2]$1[/span]', + 21: 'The target $has:does not have; a certain state', // nyi + 24: '', // not used + 25: 'The Player $knows: does not know; $1', + 26: 'The Creature is$: not; in phase $1', + 27: 'The target\'s level is$: not; $2 $1', + 28: 'The Player has$: not; completed $1', + 29: 'The Player is$: not; within $2yd of $1', // also used by 30 + 31: 'Casters\'s target is$: not; $1', // also used by 32 + 33: 'The Player $has:does not have; a certain relation to the target', // nyi + 34: 'The target $has:does not have; a certain reaction to the Player', // nyi + 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%' +}; +/* end custom */ + var LANG = { and: " и ", + or: " или ", comma: ", ", ellipsis: "…", dash: " – ", @@ -4203,5 +4291,10 @@ var LANG = { added: "Добавлено", build: "Версия", calculators: "Калькуляторы", - patch: "Обновление" + patch: "Обновление", + + /* custom */ + note_condition: "Every one of these conditions must be met to satisfy the requirement.", + note_condition_group: "Any one of these groups must be met in full to satisfy the requirement." + /* end custom */ }; diff --git a/template/bricks/lvTabs.tpl.php b/template/bricks/lvTabs.tpl.php index 662368a1..ab43fe0c 100644 --- a/template/bricks/lvTabs.tpl.php +++ b/template/bricks/lvTabs.tpl.php @@ -8,7 +8,15 @@ if ($isTabbed): - + lvTabs as $lv): + if ($lv['file']): + continue; + endif; + + echo ''.$lv['data'].''; +endforeach; + ?>