本文整理汇总了PHP中Lang::getInfoBoxForFlags方法的典型用法代码示例。如果您正苦于以下问题:PHP Lang::getInfoBoxForFlags方法的具体用法?PHP Lang::getInfoBoxForFlags怎么用?PHP Lang::getInfoBoxForFlags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lang
的用法示例。
在下文中一共展示了Lang::getInfoBoxForFlags方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateContent
protected function generateContent()
{
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
if ($this->subject->getField('side') == SIDE_ALLIANCE) {
$infobox[] = Lang::main('side') . Lang::main('colon') . '[span class=icon-alliance]' . Lang::game('si', SIDE_ALLIANCE) . '[/span]';
} else {
if ($this->subject->getField('side') == SIDE_HORDE) {
$infobox[] = Lang::main('side') . Lang::main('colon') . '[span class=icon-horde]' . Lang::game('si', SIDE_HORDE) . '[/span]';
} else {
$infobox[] = Lang::main('side') . Lang::main('colon') . Lang::game('si', SIDE_BOTH);
}
}
if ($g = $this->subject->getField('gender')) {
$infobox[] = Lang::main('gender') . Lang::main('colon') . '[span class=icon-' . ($g == 2 ? 'female' : 'male') . ']' . Lang::main('sex', $g) . '[/span]';
}
if ($eId = $this->subject->getField('eventId')) {
$this->extendGlobalIds(TYPE_WORLDEVENT, $eId);
$infobox[] = Lang::game('eventShort') . Lang::main('colon') . '[event=' . $eId . ']';
}
/****************/
/* Main Content */
/****************/
$this->infobox = $infobox ? '[ul][li]' . implode('[/li][li]', $infobox) . '[/li][/ul]' : null;
$this->expansion = Util::$expansionString[$this->subject->getField('expansion')];
$this->redButtons = array(BUTTON_WOWHEAD => true, BUTTON_LINKS => ['name' => $this->nameFixed]);
// factionchange-equivalent
if ($pendant = DB::World()->selectCell('SELECT IF(horde_id = ?d, alliance_id, -horde_id) FROM player_factionchange_titles WHERE alliance_id = ?d OR horde_id = ?d', $this->typeId, $this->typeId, $this->typeId)) {
$altTitle = new TitleList(array(['id', abs($pendant)]));
if (!$altTitle->error) {
$this->transfer = sprintf(Lang::title('_transfer'), $altTitle->id, $altTitle->getHtmlizedName(), $pendant > 0 ? 'alliance' : 'horde', $pendant > 0 ? Lang::game('si', 1) : Lang::game('si', 2));
}
}
/**************/
/* Extra Tabs */
/**************/
// tab: quest source
$quests = new QuestList(array(['rewardTitleId', $this->typeId]));
if (!$quests->error) {
$this->extendGlobalData($quests->getJSGlobals(GLOBALINFO_REWARDS));
$this->lvTabs[] = ['quest', array('data' => array_values($quests->getListviewData()), 'id' => 'reward-from-quest', 'name' => '$LANG.tab_rewardfrom', 'hiddenCols' => ['experience', 'money'], 'visibleCols' => ['category'])];
}
// tab: achievement source
if ($aIds = DB::World()->selectCol('SELECT entry FROM achievement_reward WHERE title_A = ?d OR title_H = ?d', $this->typeId, $this->typeId)) {
$acvs = new AchievementList(array(['id', $aIds]));
if (!$acvs->error) {
$this->extendGlobalData($acvs->getJSGlobals());
$this->lvTabs[] = ['achievement', array('data' => array_values($acvs->getListviewData()), 'id' => 'reward-from-achievement', 'name' => '$LANG.tab_rewardfrom', 'visibleCols' => ['category'], 'sort' => ['reqlevel', 'name'])];
}
}
// tab: criteria of (to be added by TC)
}
示例2: generateContent
protected function generateContent()
{
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// has Animation
if ($this->subject->getField('isAnimated')) {
$infobox[] = Lang::emote('isAnimated');
}
/****************/
/* Main Content */
/****************/
$text = '';
if ($aliasses = DB::Aowow()->selectCol('SELECT command FROM ?_emotes_aliasses WHERE id = ?d AND locales & ?d', $this->typeId, 1 << User::$localeId)) {
$text .= '[h3]' . Lang::emote('aliases') . '[/h3][ul]';
foreach ($aliasses as $a) {
$text .= '[li]/' . $a . '[/li]';
}
$text .= '[/ul][br][br]';
}
$texts = [];
if ($_ = $this->subject->getField('self', true)) {
$texts[Lang::emote('self')] = $_;
}
if ($_ = $this->subject->getField('target', true)) {
$texts[Lang::emote('target')] = $_;
}
if ($_ = $this->subject->getField('noTarget', true)) {
$texts[Lang::emote('noTarget')] = $_;
}
if (!$texts) {
$text .= '[div][i class=q0]' . Lang::emote('noText') . '[/i][/div]';
} else {
foreach ($texts as $h => $t) {
$text .= '[pad][b]' . $h . '[/b][ul][li][span class=s4]' . preg_replace('/%\\d?\\$?s/', '<' . Util::ucFirst(Lang::main('name')) . '>', $t) . '[/span][/li][/ul]';
}
}
$this->extraText = $text;
$this->infobox = $infobox ? '[ul][li]' . implode('[/li][li]', $infobox) . '[/li][/ul]' : null;
/**************/
/* Extra Tabs */
/**************/
// tab: achievement
$condition = array(['ac.type', ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE], ['ac.value1', $this->typeId]);
$acv = new AchievementList($condition);
$this->lvTabs[] = ['achievement', ['data' => array_values($acv->getListviewData())]];
$this->extendGlobalData($acv->getJsGlobals());
}
示例3: generateContent
protected function generateContent()
{
$_level = $this->subject->getField('level');
$_minLevel = $this->subject->getField('minLevel');
$_flags = $this->subject->getField('flags');
$_specialFlags = $this->subject->getField('specialFlags');
$_side = Util::sideByRaceMask($this->subject->getField('reqRaceMask'));
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// event (todo: assign eventData)
if ($_ = $this->subject->getField('eventId')) {
$this->extendGlobalIds(TYPE_WORLDEVENT, $_);
$infobox[] = Lang::game('eventShort') . Lang::main('colon') . '[event=' . $_ . ']';
}
// level
if ($_level > 0) {
$infobox[] = Lang::game('level') . Lang::main('colon') . $_level;
}
// reqlevel
if ($_minLevel) {
$lvl = $_minLevel;
if ($_ = $this->subject->getField('maxLevel')) {
$lvl .= ' - ' . $_;
}
$infobox[] = sprintf(Lang::game('reqLevel'), $lvl);
}
// loremaster (i dearly hope those flags cover every case...)
if ($this->subject->getField('zoneOrSortBak') > 0 && !$this->subject->isRepeatable()) {
$conditions = array(['ac.type', ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE], ['ac.value1', $this->subject->getField('zoneOrSortBak')], ['a.faction', $_side, '&']);
$loremaster = new AchievementList($conditions);
$this->extendGlobalData($loremaster->getJSGlobals(GLOBALINFO_SELF));
switch ($loremaster->getMatches()) {
case 0:
break;
case 1:
$infobox[] = Lang::quest('loremaster') . Lang::main('colon') . '[achievement=' . $loremaster->id . ']';
break;
default:
$lm = Lang::quest('loremaster') . Lang::main('colon') . '[ul]';
foreach ($loremaster->iterate() as $id => $__) {
$lm .= '[li][achievement=' . $id . '][/li]';
}
$infobox[] = $lm . '[/ul]';
break;
}
}
// type (maybe expand uppon?)
$_ = [];
if ($_flags & QUEST_FLAG_DAILY) {
$_[] = Lang::quest('daily');
} else {
if ($_flags & QUEST_FLAG_WEEKLY) {
$_[] = Lang::quest('weekly');
} else {
if ($_specialFlags & QUEST_FLAG_SPECIAL_MONTHLY) {
$_[] = Lang::quest('monthly');
}
}
}
if ($t = $this->subject->getField('type')) {
$_[] = Lang::quest('questInfo', $t);
}
if ($_) {
$infobox[] = Lang::game('type') . Lang::main('colon') . implode(' ', $_);
}
// side
$_ = Lang::main('side') . Lang::main('colon');
switch ($_side) {
case 3:
$infobox[] = $_ . Lang::game('si', 3);
break;
case 2:
$infobox[] = $_ . '[span class=icon-horde]' . Lang::game('si', 2) . '[/span]';
break;
case 1:
$infobox[] = $_ . '[span class=icon-alliance]' . Lang::game('si', 1) . '[/span]';
break;
}
// races
if ($_ = Lang::getRaceString($this->subject->getField('reqRaceMask'), $__, $jsg, $n, false)) {
$this->extendGlobalIds(TYPE_RACE, $jsg);
$t = $n == 1 ? Lang::game('race') : Lang::game('races');
$infobox[] = Util::ucFirst($t) . Lang::main('colon') . $_;
}
// classes
if ($_ = Lang::getClassString($this->subject->getField('reqClassMask'), $jsg, $n, false)) {
$this->extendGlobalIds(TYPE_CLASS, $jsg);
$t = $n == 1 ? Lang::game('class') : Lang::game('classes');
$infobox[] = Util::ucFirst($t) . Lang::main('colon') . $_;
}
// profession / skill
if ($_ = $this->subject->getField('reqSkillId')) {
$this->extendGlobalIds(TYPE_SKILL, $_);
$sk = '[skill=' . $_ . ']';
if ($_ = $this->subject->getField('reqSkillPoints')) {
$sk .= ' (' . $_ . ')';
}
$infobox[] = Lang::quest('profession') . Lang::main('colon') . $sk;
//.........这里部分代码省略.........
示例4: generateContent
protected function generateContent()
{
$this->addJS('?data=zones&locale=' . User::$localeId . '&t=' . $_SESSION['dataKey']);
$_itemId = $this->subject->getField('itemId');
/***********/
/* Infobox */
/**********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
if ($this->typeId == 103) {
// Arena Points
$infobox[] = Lang::currency('cap') . Lang::main('colon') . '10\'000';
} else {
if ($this->typeId == 104) {
// Honor
$infobox[] = Lang::currency('cap') . Lang::main('colon') . '75\'000';
}
}
/****************/
/* Main Content */
/****************/
$this->infobox = $infobox ? '[ul][li]' . implode('[/li][li]', $infobox) . '[/li][/ul]' : null;
$this->name = $this->subject->getField('name', true);
$this->headIcons = $this->typeId == 104 ? ['inv_bannerpvp_02', 'inv_bannerpvp_01'] : [$this->subject->getField('iconString')];
$this->redButtons = array(BUTTON_WOWHEAD => true, BUTTON_LINKS => true);
/**************/
/* Extra Tabs */
/**************/
if ($this->typeId != 103 && $this->typeId != 104) {
// tabs: this currency is contained in..
$lootTabs = new Loot();
if ($lootTabs->getByItem($_itemId)) {
$this->extendGlobalData($lootTabs->jsGlobals);
foreach ($lootTabs->iterate() as $tab) {
$this->lvTabs[] = array('file' => $tab[0], 'data' => $tab[1], 'params' => ['name' => $tab[2], 'id' => $tab[3], 'extraCols' => $tab[4] ? '$[' . implode(', ', array_unique($tab[4])) . ']' : null, 'hiddenCols' => $tab[5] ? '$[' . implode(', ', array_unique($tab[5])) . ']' : null, 'visibleCols' => $tab[6] ? '$' . Util::toJSON(array_unique($tab[6])) : null]);
}
}
// tab: sold by
$itemObj = new ItemList(array(['id', $_itemId]));
if (!empty($itemObj->getExtendedCost()[$_itemId])) {
$vendors = $itemObj->getExtendedCost()[$_itemId];
$this->extendGlobalData($itemObj->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
$soldBy = new CreatureList(array(['id', array_keys($vendors)]));
if (!$soldBy->error) {
$sbData = $soldBy->getListviewData();
$extraCols = ['Listview.extraCols.stock', "Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack')", 'Listview.extraCols.cost'];
$holidays = [];
foreach ($sbData as $k => &$row) {
$items = [];
$tokens = [];
foreach ($vendors[$k] as $id => $qty) {
if (is_string($id)) {
continue;
}
if ($id > 0) {
$tokens[] = [$id, $qty];
} else {
if ($id < 0) {
$items[] = [-$id, $qty];
}
}
}
if ($vendors[$k]['event']) {
if (count($extraCols) == 3) {
// not already pushed
$extraCols[] = 'Listview.extraCols.condition';
}
$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'), $items ? $items : null, $tokens ? $tokens : null);
}
$this->lvTabs[] = array('file' => 'creature', 'data' => $sbData, 'params' => ['name' => '$LANG.tab_soldby', 'id' => 'sold-by-npc', 'extraCols' => '$[' . implode(', ', $extraCols) . ']', 'hiddenCols' => "\$['level', 'type']"]);
}
}
}
// tab: created by (spell) [for items its handled in Loot::getByContainer()]
if ($this->typeId == 104) {
$createdBy = new SpellList(array(['effect1Id', 45], ['effect2Id', 45], ['effect3Id', 45], 'OR'));
if (!$createdBy->error) {
$this->extendGlobalData($createdBy->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
if ($createdBy->hasSetFields(['reagent1'])) {
$visCols = ['reagents'];
}
$this->lvTabs[] = array('file' => 'spell', 'data' => $createdBy->getListviewData(), 'params' => ['name' => '$LANG.tab_createdby', 'id' => 'created-by', 'visibleCols' => isset($visCols) ? '$' . Util::toJSON($visCols) : null]);
}
}
// tab: currency for
if ($this->typeId == 103) {
$n = '?items&filter=cr=145;crs=1;crv=0';
$w = 'reqArenaPoints > 0';
} else {
if ($this->typeId == 104) {
$n = '?items&filter=cr=144;crs=1;crv=0';
$w = 'reqHonorPoints > 0';
} else {
$n = in_array($this->typeId, [42, 61, 81, 241, 121, 122, 123, 125, 126, 161, 201, 101, 102, 221, 301, 341]) ? '?items&filter=cr=158;crs=' . $_itemId . ';crv=0' : null;
$w = 'reqItemId1 = ' . $_itemId . ' OR reqItemId2 = ' . $_itemId . ' OR reqItemId3 = ' . $_itemId . ' OR reqItemId4 = ' . $_itemId . ' OR reqItemId5 = ' . $_itemId;
}
//.........这里部分代码省略.........
示例5: generateContent
protected function generateContent()
{
$_ta = $this->subject->getField('contentGroup');
$_ty = $this->subject->getField('type');
$_cnt = count($this->subject->getField('pieces'));
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// unavailable (todo (low): set data)
if ($this->subject->getField('cuFlags') & CUSTOM_UNAVAILABLE) {
$infobox[] = Lang::main('unavailable');
}
// worldevent
if ($e = $this->subject->getField('eventId')) {
$infobox[] = Lang::game('eventShort') . Lang::main('colon') . '[event=' . $e . ']';
$this->extendGlobalIds(TYPE_WORLDEVENT, $e);
}
// itemLevel
if ($min = $this->subject->getField('minLevel')) {
$foo = Lang::game('level') . Lang::main('colon') . $min;
$max = $this->subject->getField('maxLevel');
if ($min < $max) {
$foo .= ' - ' . $max;
}
$infobox[] = $foo;
}
// class
if ($cl = Lang::getClassString($this->subject->getField('classMask'), $jsg, $qty, false)) {
$this->extendGlobalIds(TYPE_CLASS, $jsg);
$t = $qty == 1 ? Lang::game('class') : Lang::game('classes');
$infobox[] = Util::ucFirst($t) . Lang::main('colon') . $cl;
}
// required level
if ($lvl = $this->subject->getField('reqLevel')) {
$infobox[] = sprintf(Lang::game('reqLevel'), $lvl);
}
// type
if ($_ty) {
$infobox[] = Lang::game('type') . Lang::main('colon') . Lang::itemset('types', $_ty);
}
// tag
if ($_ta) {
$infobox[] = Lang::itemset('_tag') . Lang::main('colon') . '[url=?itemsets&filter=ta=' . $_ta . ']' . Lang::itemset('notes', $_ta) . '[/url]';
}
/****************/
/* Main Content */
/****************/
// pieces + Summary
$pieces = [];
$eqList = [];
$compare = [];
if (!$this->subject->pieceToSet) {
$cnd = [0];
} else {
$cnd = ['i.id', array_keys($this->subject->pieceToSet)];
}
$iList = new ItemList(array($cnd));
$data = $iList->getListviewData(ITEMINFO_SUBITEMS | ITEMINFO_JSON);
foreach ($iList->iterate() as $itemId => $__) {
if (empty($data[$itemId])) {
continue;
}
$slot = $iList->getField('slot');
$disp = $iList->getField('displayId');
if ($slot && $disp) {
$eqList[] = [$slot, $disp];
}
$compare[] = $itemId;
$pieces[] = array('id' => $itemId, 'name' => $iList->getField('name', true), 'quality' => $iList->getField('quality'), 'icon' => $iList->getField('iconString'), 'json' => $data[$itemId]);
}
$skill = '';
if ($_sk = $this->subject->getField('skillId')) {
$spellLink = sprintf('<a href="?spells=11.%s">%s</a> (%s)', $_sk, Lang::spell('cat', 11, $_sk, 0), $this->subject->getField('skillLevel'));
$skill = ' – <small><b>' . sprintf(Lang::game('requires'), $spellLink) . '</b></small>';
}
$this->bonusExt = $skill;
$this->description = $_ta ? sprintf(Lang::itemset('_desc'), $this->name, Lang::itemset('notes', $_ta), $_cnt) : sprintf(Lang::itemset('_descTagless'), $this->name, $_cnt);
$this->unavailable = $this->subject->getField('cuFlags') & CUSTOM_UNAVAILABLE;
$this->infobox = $infobox ? '[ul][li]' . implode('[/li][li]', $infobox) . '[/li][/ul]' : null;
$this->pieces = $pieces;
$this->spells = $this->subject->getBonuses();
$this->expansion = 0;
$this->redButtons = array(BUTTON_WOWHEAD => $this->typeId > 0, BUTTON_LINKS => ['color' => '', 'linkId' => ''], BUTTON_VIEW3D => ['type' => TYPE_ITEMSET, 'typeId' => $this->typeId, 'equipList' => $eqList], BUTTON_COMPARE => ['eqList' => implode(':', $compare), 'qty' => $_cnt]);
$this->compare = array('level' => $this->subject->getField('reqLevel'), 'items' => array_map(function ($v) {
return [[$v]];
}, $compare));
/**************/
/* Extra Tabs */
/**************/
// related sets (priority: 1: similar tag + class; 2: has event; 3: no tag + similar type, 4: similar type + profession)
$rel = [];
if ($_ta && count($this->path) == 3) {
$rel[] = ['id', $this->typeId, '!'];
$rel[] = ['classMask', 1 << end($this->path) - 1, '&'];
$rel[] = ['contentGroup', (int) $_ta];
} else {
if ($this->subject->getField('eventId')) {
$rel[] = ['id', $this->typeId, '!'];
$rel[] = ['eventId', 0, '!'];
//.........这里部分代码省略.........
示例6: generateContent
protected function generateContent()
{
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// points
if ($_ = $this->subject->getField('points')) {
$infobox[] = Lang::achievement('points') . Lang::main('colon') . '[achievementpoints=' . $_ . ']';
}
// location
// todo (low)
// faction
switch ($this->subject->getField('faction')) {
case 1:
$infobox[] = Lang::main('side') . Lang::main('colon') . '[span class=icon-alliance]' . Lang::game('si', SIDE_ALLIANCE) . '[/span]';
break;
case 2:
$infobox[] = Lang::main('side') . Lang::main('colon') . '[span class=icon-horde]' . Lang::game('si', SIDE_HORDE) . '[/span]';
break;
default:
// case 3
$infobox[] = Lang::main('side') . Lang::main('colon') . Lang::game('si', SIDE_BOTH);
}
// realm first available?
if ($this->subject->getField('flags') & 0x100 && DB::isConnectable(DB_AUTH)) {
$avlb = [];
foreach (DB::Auth()->selectCol('SELECT id AS ARRAY_KEY, name FROM realmlist WHERE allowedSecurityLevel = 0 AND gamebuild = ?d', WOW_VERSION) as $rId => $name) {
if (!DB::isConnectable(DB_CHARACTERS . $rId)) {
continue;
}
if (!DB::Characters($rId)->selectCell('SELECT 1 FROM character_achievement WHERE achievement = ?d LIMIT 1', $this->typeId)) {
$avlb[] = $name;
}
}
if ($avlb) {
$infobox[] = Lang::achievement('rfAvailable') . implode(', ', $avlb);
}
}
/**********/
/* Series */
/**********/
$series = [];
if ($c = $this->subject->getField('chainId')) {
$chainAcv = new AchievementList(array(['chainId', $c]));
foreach ($chainAcv->iterate() as $aId => $__) {
$pos = $chainAcv->getField('chainPos');
if (!isset($series[$pos])) {
$series[$pos] = [];
}
$series[$pos][] = array('side' => $chainAcv->getField('faction'), 'typeStr' => Util::$typeStrings[TYPE_ACHIEVEMENT], 'typeId' => $aId, 'name' => $chainAcv->getField('name', true));
}
}
/****************/
/* Main Content */
/****************/
$this->mail = $this->createMail($reqBook);
$this->headIcons = [$this->subject->getField('iconString')];
$this->infobox = $infobox ? '[ul][li]' . implode('[/li][li]', $infobox) . '[/li][/ul]' : null;
$this->series = $series ? [[$series, null]] : null;
$this->description = $this->subject->getField('description', true);
$this->redButtons = array(BUTTON_LINKS => ['color' => 'ffffff00', 'linkId' => Util::$typeStrings[TYPE_ACHIEVEMENT] . ':' . $this->typeId . ':"..UnitGUID("player")..":0:0:0:0:0:0:0:0'], BUTTON_WOWHEAD => !($this->subject->getField('cuFlags') & CUSTOM_SERVERSIDE));
$this->criteria = array('reqQty' => $this->subject->getField('reqCriteriaCount'), 'icons' => [], 'data' => []);
if ($reqBook) {
$this->addCss(['path' => 'Book.css']);
}
// create rewards
if ($foo = $this->subject->getField('rewards')) {
array_walk($foo, function (&$item) {
$item = $item[0] != TYPE_ITEM ? null : $item[1];
});
$bar = new ItemList(array(['i.id', $foo]));
foreach ($bar->iterate() as $id => $__) {
$this->rewards['item'][] = array('name' => $bar->getField('name', true), 'quality' => $bar->getField('quality'), 'typeStr' => Util::$typeStrings[TYPE_ITEM], 'id' => $id, 'globalStr' => 'g_items');
}
}
if ($foo = $this->subject->getField('rewards')) {
array_walk($foo, function (&$item) {
$item = $item[0] != TYPE_TITLE ? null : $item[1];
});
$bar = new TitleList(array(['id', $foo]));
foreach ($bar->iterate() as $__) {
$this->rewards['title'][] = sprintf(Lang::achievement('titleReward'), $bar->id, trim(str_replace('%s', '', $bar->getField('male', true))));
}
}
$this->rewards['text'] = $this->subject->getField('reward', true);
// factionchange-equivalent
if ($pendant = DB::World()->selectCell('SELECT IF(horde_id = ?d, alliance_id, -horde_id) FROM player_factionchange_achievement WHERE alliance_id = ?d OR horde_id = ?d', $this->typeId, $this->typeId, $this->typeId)) {
$altAcv = new AchievementList(array(['id', abs($pendant)]));
if (!$altAcv->error) {
$this->transfer = sprintf(Lang::achievement('_transfer'), $altAcv->id, 1, $altAcv->getField('iconString'), $altAcv->getField('name', true), $pendant > 0 ? 'alliance' : 'horde', $pendant > 0 ? Lang::game('si', 1) : Lang::game('si', 2));
}
}
/**************/
/* Extra Tabs */
/**************/
// tab: see also
$conditions = array(['name_loc' . User::$localeId, $this->subject->getField('name', true)], ['id', $this->typeId, '!']);
$saList = new AchievementList($conditions);
$this->lvTabs[] = array('file' => 'achievement', 'data' => $saList->getListviewData(), 'params' => array('id' => 'see-also', 'name' => '$LANG.tab_seealso', 'visibleCols' => "\$['category']"));
//.........这里部分代码省略.........
示例7: generateContent
protected function generateContent()
{
$this->addJS('?data=zones&locale=' . User::$localeId . '&t=' . $_SESSION['dataKey']);
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// Quartermaster if any
if ($ids = $this->subject->getField('qmNpcIds')) {
$this->extendGlobalIds(TYPE_NPC, $ids);
$qmStr = Lang::faction('quartermaster') . Lang::main('colon');
if (count($ids) == 1) {
$qmStr .= '[npc=' . $ids[0] . ']';
} else {
if (count($ids) > 1) {
$qmStr .= '[ul]';
foreach ($ids as $id) {
$qmStr .= '[li][npc=' . $id . '][/li]';
}
$qmStr .= '[/ul]';
}
}
$infobox[] = $qmStr;
}
// side if any
if ($_ = $this->subject->getField('side')) {
$infobox[] = Lang::main('side') . Lang::main('colon') . '[span class=icon-' . ($_ == 1 ? 'alliance' : 'horde') . ']' . Lang::game('si', $_) . '[/span]';
}
/****************/
/* Main Content */
/****************/
$this->extraText = '';
$this->infobox = $infobox ? '[ul][li]' . implode('[/li][li]', $infobox) . '[/li][/ul]' : null;
$this->redButtons = array(BUTTON_WOWHEAD => true, BUTTON_LINKS => true);
// Spillover Effects
/* todo (low): also check on reputation_spillover_template (but its data is identical to calculation below
$rst = DB::World()->selectRow('SELECT
CONCAT_WS(" ", faction1, faction2, faction3, faction4) AS faction,
CONCAT_WS(" ", rate_1, rate_2, rate_3, rate_4) AS rate,
CONCAT_WS(" ", rank_1, rank_2, rank_3, rank_4) AS rank
FROM reputation_spillover_template WHERE faction = ?d', $this->typeId);
*/
$conditions = array(['id', $this->typeId, '!'], ['repIdx', -1, '!']);
if ($p = $this->subject->getField('parentFactionId')) {
// linked via parent
$conditions[] = ['OR', ['id', $p], ['parentFactionId', $p]];
} else {
// self as parent
$conditions[] = ['parentFactionId', $this->typeId];
}
$spillover = new FactionList($conditions);
$this->extendGlobalData($spillover->getJSGlobals());
$buff = '';
foreach ($spillover->iterate() as $spillId => $__) {
if ($val = $spillover->getField('spilloverRateIn') * $this->subject->getField('spilloverRateOut') * 100) {
$buff .= '[tr][td][faction=' . $spillId . '][/td][td][span class=q' . ($val > 0 ? '2]+' : '10]') . $val . '%[/span][/td][td]' . Lang::game('rep', $spillover->getField('spilloverMaxRank')) . '[/td][/tr]';
}
}
if ($buff) {
$this->extraText .= '[h3 class=clear]' . Lang::faction('spillover') . '[/h3][div margin=15px]' . Lang::faction('spilloverDesc') . '[/div][table class=grid width=400px][tr][td width=150px][b]' . Util::ucFirst(Lang::game('faction')) . '[/b][/td][td width=100px][b]' . Lang::spell('_value') . '[/b][/td][td width=150px][b]' . Lang::faction('maxStanding') . '[/b][/td][/tr]' . $buff . '[/table]';
}
// reward rates (ultimately this should be calculated into each reward display)
if ($rates = DB::World()->selectRow('SELECT * FROM reputation_reward_rate WHERE faction = ?d', $this->typeId)) {
$buff = '';
foreach ($rates as $k => $v) {
if ($v == 1) {
continue;
}
switch ($k) {
case 'quest_rate':
$buff .= '[tr][td]' . Lang::game('quests') . Lang::main('colon') . '[/td]';
break;
case 'quest_daily_rate':
$buff .= '[tr][td]' . Lang::game('quests') . ' (' . Lang::quest('daily') . ')' . Lang::main('colon') . '[/td]';
break;
case 'quest_weekly_rate':
$buff .= '[tr][td]' . Lang::game('quests') . ' (' . Lang::quest('weekly') . ')' . Lang::main('colon') . '[/td]';
break;
case 'quest_monthly_rate':
$buff .= '[tr][td]' . Lang::game('quests') . ' (' . Lang::quest('monthly') . ')' . Lang::main('colon') . '[/td]';
break;
case 'creature_rate':
$buff .= '[tr][td]' . Lang::game('npcs') . Lang::main('colon') . '[/td]';
break;
case 'spell_rate':
$buff .= '[tr][td]' . Lang::game('spells') . Lang::main('colon') . '[/td]';
break;
}
$buff .= '[td width=35px align=right][span class=q' . ($v < 1 ? '10]' : '2]+') . intVal(($v - 1) * 100) . '%[/span][/td][/tr]';
}
if ($buff) {
$this->extraText .= '[h3 class=clear]' . Lang::faction('customRewRate') . '[/h3][table]' . $buff . '[/table]';
}
}
// factionchange-equivalent
if ($pendant = DB::World()->selectCell('SELECT IF(horde_id = ?d, alliance_id, -horde_id) FROM player_factionchange_reputations WHERE alliance_id = ?d OR horde_id = ?d', $this->typeId, $this->typeId, $this->typeId)) {
$altFac = new FactionList(array(['id', abs($pendant)]));
if (!$altFac->error) {
$this->transfer = sprintf(Lang::faction('_transfer'), $altFac->id, $altFac->getField('name', true), $pendant > 0 ? 'alliance' : 'horde', $pendant > 0 ? Lang::game('si', 1) : Lang::game('si', 2));
}
//.........这里部分代码省略.........
示例8: generateContent
protected function generateContent()
{
$this->addJS('?data=zones&locale=' . User::$localeId . '&t=' . $_SESSION['dataKey']);
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// City
if ($this->subject->getField('flags') & 0x8 && !$this->subject->getField('parentArea')) {
$infobox[] = Lang::zone('city');
}
// Auto repop
if ($this->subject->getField('flags') & 0x1000 && !$this->subject->getField('parentArea')) {
$infobox[] = Lang::zone('autoRez');
}
// Level
if ($_ = $this->subject->getField('levelMin')) {
if ($_ < $this->subject->getField('levelMax')) {
$_ .= ' - ' . $this->subject->getField('levelMax');
}
$infobox[] = Lang::game('level') . Lang::main('colon') . $_;
}
// required Level
if ($_ = $this->subject->getField('levelReq')) {
if ($__ = $this->subject->getField('levelReqLFG')) {
$buff = sprintf(Lang::zone('reqLevels'), $_, $__);
} else {
$buff = Lang::main('_reqLevel') . Lang::main('colon') . $_;
}
$infobox[] = $buff;
}
// Territory
$_ = $this->subject->getField('faction');
$__ = '%s';
if ($_ == 0) {
$__ = '[span class=icon-alliance]%s[/span]';
} else {
if ($_ == 1) {
$__ = '[span class=icon-horde]%s[/span]';
} else {
if ($_ == 4) {
$__ = '[span class=icon-ffa]%s[/span]';
}
}
}
$infobox[] = Lang::zone('territory') . Lang::main('colon') . sprintf($__, Lang::zone('territories', $_));
// Instance Type
$infobox[] = Lang::zone('instanceType') . Lang::main('colon') . '[span class=icon-instance' . $this->subject->getField('type') . ']' . Lang::zone('instanceTypes', $this->subject->getField('type')) . '[/span]';
// Heroic mode
if ($_ = $this->subject->getField('levelHeroic')) {
$infobox[] = '[icon preset=heroic]' . sprintf(Lang::zone('hcAvailable'), $_) . '[/icon]';
}
// number of players
if ($_ = $this->subject->getField('maxPlayer')) {
$infobox[] = Lang::zone('numPlayers') . Lang::main('colon') . ($_ == -2 ? '10/25' : $_);
}
// Attunement Quest/Achievements & Keys
if ($attmnt = $this->subject->getField('attunes')) {
foreach ($attmnt as $type => $ids) {
$this->extendGlobalIds($type, array_map('abs', $ids));
foreach ($ids as $id) {
if ($type == TYPE_ITEM) {
$infobox[] = Lang::zone('key', (int) ($id < 0)) . Lang::main('colon') . '[item=' . abs($id) . ']';
} else {
$infobox[] = Lang::zone('attunement', (int) ($id < 0)) . Lang::main('colon') . '[' . Util::$typeStrings[$type] . '=' . abs($id) . ']';
}
}
}
}
// Instances
if ($_ = DB::Aowow()->selectCol('SELECT id FROM ?_zones WHERE parentAreaId = ?d AND (flags & ?d) = 0', $this->typeId, CUSTOM_EXCLUDE_FOR_LISTVIEW)) {
$this->extendGlobalIds(TYPE_ZONE, $_);
$infobox[] = Lang::maps('Instances') . Lang::main('colon') . "\n[zone=" . implode("], \n[zone=", $_) . ']';
}
// location (if instance)
if ($pa = $this->subject->getField('parentAreaId')) {
$paO = new ZoneList(array(['id', $pa]));
if (!$paO->error) {
$pins = str_pad($this->subject->getField('parentX') * 10, 3, '0', STR_PAD_LEFT) . str_pad($this->subject->getField('parentY') * 10, 3, '0', STR_PAD_LEFT);
$infobox[] = Lang::zone('location') . Lang::main('colon') . '[lightbox=map zone=' . $pa . ' pins=' . $pins . ']' . $paO->getField('name', true) . '[/lightbox]';
}
}
/* has to be defined in an article, i think
// faction(s) / Reputation Hub / Raid Faction
// [li]Raid faction: [faction=1156][/li] || [li]Factions: [faction=1156]/[faction=1156][/li]
// final boss
// [li]Final boss: [icon preset=boss][npc=37226][/icon][/li]
*/
/****************/
/* Main Content */
/****************/
$addToMap = function ($what, $entry) use(&$som) {
// entry always contains: type, id, name, level, coords[]
if (!isset($som[$what][$entry['name']])) {
// not found yet
$som[$what][$entry['name']][] = $entry;
} else {
// check for identical floors
//.........这里部分代码省略.........
示例9: generateContent
protected function generateContent()
{
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// reqLevel
if ($_ = $this->subject->getField('requiredLevel')) {
$infobox[] = sprintf(Lang::game('reqLevel'), $_);
}
// reqskill
if ($_ = $this->subject->getField('skillLine')) {
$this->extendGlobalIds(TYPE_SKILL, $_);
$foo = sprintf(Lang::game('requires'), ' [skill=' . $_ . ']');
if ($_ = $this->subject->getField('skillLevel')) {
$foo .= ' (' . $_ . ')';
}
$infobox[] = $foo;
}
/****************/
/* Main Content */
/****************/
$this->infobox = $infobox ? '[ul][li]' . implode('[/li][li]', $infobox) . '[/li][/ul]' : null;
$this->effects = [];
// 3 effects
for ($i = 1; $i < 4; $i++) {
$_ty = $this->subject->getField('type' . $i);
$_qty = $this->subject->getField('amount' . $i);
$_obj = $this->subject->getField('object' . $i);
switch ($_ty) {
case 1:
case 3:
case 7:
$sArr = $this->subject->getField('spells')[$i];
$spl = $this->subject->getRelSpell($sArr[0]);
$this->effects[$i]['name'] = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'Type: ' . $_ty, Lang::item('trigger', $sArr[1])) : Lang::item('trigger', $sArr[1]);
$this->effects[$i]['proc'] = $sArr[3];
$this->effects[$i]['value'] = $_qty ?: null;
$this->effects[$i]['icon'] = array('name' => !$spl ? Util::ucFirst(Lang::game('spell')) . ' #' . $sArr[0] : Util::localizedString($spl, 'name'), 'id' => $sArr[0], 'count' => $sArr[2]);
break;
case 5:
if ($_obj < 2) {
// [mana, health] are on [0, 1] respectively and are expected on [1, 2] ..
$_obj++;
}
// 0 is weaponDmg .. ehh .. i messed up somewhere
$this->effects[$i]['tip'] = [$_obj, Util::$itemMods[$_obj]];
// DO NOT BREAK!
// DO NOT BREAK!
case 2:
case 6:
case 8:
case 4:
$this->effects[$i]['name'] = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'Type: ' . $_ty, Lang::enchantment('types', $_ty)) : Lang::enchantment('types', $_ty);
$this->effects[$i]['value'] = $_qty;
if ($_ty == 4) {
$this->effects[$i]['name'] .= Lang::main('colon') . '(' . (User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'Object: ' . $_obj, Lang::getMagicSchools(1 << $_obj)) : Lang::getMagicSchools(1 << $_obj)) . ')';
}
}
}
// activation conditions
if ($_ = $this->subject->getField('conditionId')) {
$x = '';
if ($gemCnd = DB::Aowow()->selectRow('SELECT * FROM ?_itemenchantmentcondition WHERE id = ?d', $_)) {
for ($i = 1; $i < 6; $i++) {
if (!$gemCnd['color' . $i]) {
continue;
}
$fiColors = function ($idx) {
$foo = '';
switch ($idx) {
case 2:
$foo = '0:3:5';
break;
// red
// red
case 3:
$foo = '2:4:5';
break;
// yellow
// yellow
case 4:
$foo = '1:3:4';
break;
// blue
}
return $foo;
};
$bLink = $gemCnd['color' . $i] ? '<a href="?items=3&filter=ty=' . $fiColors($gemCnd['color' . $i]) . '">' . Lang::item('gemColors', $gemCnd['color' . $i] - 1) . '</a>' : '';
$cLink = $gemCnd['cmpColor' . $i] ? '<a href="?items=3&filter=ty=' . $fiColors($gemCnd['cmpColor' . $i]) . '">' . Lang::item('gemColors', $gemCnd['cmpColor' . $i] - 1) . '</a>' : '';
switch ($gemCnd['comparator' . $i]) {
case 2:
// requires less <color> than (<value> || <comparecolor>) gems
// requires less <color> than (<value> || <comparecolor>) gems
case 5:
// requires at least <color> than (<value> || <comparecolor>) gems
$sp = (int) $gemCnd['value' . $i] > 1;
$x .= '<span class="q0">' . Lang::achievement('reqNumCrt') . ' ' . sprintf(Lang::item('gemConditions', $gemCnd['comparator' . $i], $sp), $gemCnd['value' . $i], $bLink) . '</span><br />';
break;
case 3:
//.........这里部分代码省略.........
示例10: generateContent
protected function generateContent()
{
$this->addJS('?data=zones&locale=' . User::$localeId . '&t=' . $_SESSION['dataKey']);
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
$_mask = 1 << $this->typeId - 1;
$tcClassId = [null, 8, 3, 1, 5, 4, 9, 6, 2, 7, null, 0];
// see TalentCalc.js
/***********/
/* Infobox */
/***********/
// hero class
if ($this->subject->getField('flags') & 0x40) {
$infobox[] = '[tooltip=tooltip_heroclass]' . Lang::game('heroClass') . '[/tooltip]';
}
// resource
if ($this->typeId == 11) {
// special Druid case
$infobox[] = Lang::game('resources') . Lang::main('colon') . '[tooltip name=powertype1]' . Lang::game('st', 0) . ', ' . Lang::game('st', 31) . ', ' . Lang::game('st', 2) . '[/tooltip][span class=tip tooltip=powertype1]' . Util::ucFirst(Lang::spell('powerTypes', 0)) . '[/span], ' . '[tooltip name=powertype2]' . Lang::game('st', 5) . ', ' . Lang::game('st', 8) . '[/tooltip][span class=tip tooltip=powertype2]' . Util::ucFirst(Lang::spell('powerTypes', 1)) . '[/span], ' . '[tooltip name=powertype8]' . Lang::game('st', 1) . '[/tooltip][span class=tip tooltip=powertype8]' . Util::ucFirst(Lang::spell('powerTypes', 3)) . '[/span]';
} else {
if ($this->typeId == 6) {
// special DK case
$infobox[] = Lang::game('resources') . Lang::main('colon') . '[span]' . Util::ucFirst(Lang::spell('powerTypes', 5)) . ', ' . Util::ucFirst(Lang::spell('powerTypes', $this->subject->getField('powerType'))) . '[/span]';
} else {
// regular case
$infobox[] = Lang::game('resource') . Lang::main('colon') . '[span]' . Util::ucFirst(Lang::spell('powerTypes', $this->subject->getField('powerType'))) . '[/span]';
}
}
// roles
$roles = [];
for ($i = 0; $i < 4; $i++) {
if ($this->subject->getField('roles') & 1 << $i) {
$roles[] = (count($roles) == 2 ? "\n" : '') . Lang::game('_roles', $i);
}
}
if ($roles) {
$infobox[] = (count($roles) > 1 ? Lang::game('roles') : Lang::game('role')) . Lang::main('colon') . implode(', ', $roles);
}
// specs
$specList = [];
$skills = new SkillList(array(['id', $this->subject->getField('skills')]));
foreach ($skills->iterate() as $k => $__) {
$specList[$k] = '[icon name=' . $skills->getField('iconString') . '][url=?spells=7.' . $this->typeId . '.' . $k . ']' . $skills->getField('name', true) . '[/url][/icon]';
}
if ($specList) {
$infobox[] = Lang::game('specs') . Lang::main('colon') . '[ul][li]' . implode('[/li][li]', $specList) . '[/li][/ul]';
}
/****************/
/* Main Content */
/****************/
$this->infobox = '[ul][li]' . implode('[/li][li]', $infobox) . '[/li][/ul]';
$this->expansion = Util::$expansionString[$this->subject->getField('expansion')];
$this->headIcons = ['class_' . strtolower($this->subject->getField('fileString'))];
$this->redButtons = array(BUTTON_LINKS => ['color' => '', 'linkId' => ''], BUTTON_WOWHEAD => true, BUTTON_TALENT => ['href' => '?talent#' . Util::$tcEncoding[$tcClassId[$this->typeId] * 3], 'pet' => false], BUTTON_FORUM => false);
/**************/
/* Extra Tabs */
/**************/
// Tab: Spells (grouped)
// '$LANG.tab_armorproficiencies',
// '$LANG.tab_weaponskills',
// '$LANG.tab_glyphs',
// '$LANG.tab_abilities',
// '$LANG.tab_talents',
$conditions = array(['s.typeCat', [-13, -11, -2, 7]], [['s.cuFlags', SPELL_CU_TRIGGERED | CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0], ['OR', ['s.reqClassMask', $_mask, '&'], ['s.skillLine1', $this->subject->getField('skills')], ['AND', ['s.skillLine1', 0, '>'], ['s.skillLine2OrMask', $this->subject->getField('skills')]]], ['OR', ['s.cuFlags', SPELL_CU_LAST_RANK, '&'], ['s.rankNo', 0]]);
$genSpells = new SpellList($conditions);
if (!$genSpells->error) {
$this->extendGlobalData($genSpells->getJSGlobals(GLOBALINFO_SELF));
$this->lvTabs[] = array('file' => 'spell', 'data' => $genSpells->getListviewData(), 'params' => array('id' => 'spells', 'name' => '$LANG.tab_spells', 'visibleCols' => "\$['level', 'schools', 'type', 'classes']", 'hiddenCols' => "\$['reagents', 'skill']", 'sort' => "\$['-level', 'type', 'name']", 'computeDataFunc' => '$Listview.funcBox.initSpellFilter', 'onAfterCreate' => '$Listview.funcBox.addSpellIndicator'));
}
// Tab: Items (grouped)
$conditions = array(['requiredClass', 0, '>'], ['requiredClass', $_mask, '&'], [['requiredClass', CLASS_MASK_ALL, '&'], CLASS_MASK_ALL, '!'], ['itemset', 0], 0);
$items = new ItemList($conditions);
if (!$items->error) {
$this->extendGlobalData($items->getJSGlobals());
if (!$items->hasDiffFields(['requiredRace'])) {
$hidden = "\$['side']";
}
$this->lvTabs[] = array('file' => 'item', 'data' => $items->getListviewData(), 'params' => array('id' => 'items', 'name' => '$LANG.tab_items', 'visibleCols' => "\$['dps', 'armor', 'slot']", 'hiddenCols' => isset($hidden) ? $hidden : null, 'computeDataFunc' => '$Listview.funcBox.initSubclassFilter', 'onAfterCreate' => '$Listview.funcBox.addSubclassIndicator', 'note' => sprintf(Util::$filterResultString, '?items&filter=cr=152;crs=' . $this->typeId . ';crv=0'), '_truncated' => 1));
}
// Tab: Quests
$conditions = array(['reqClassMask', $_mask, '&'], [['reqClassMask', CLASS_MASK_ALL, '&'], CLASS_MASK_ALL, '!']);
$quests = new QuestList($conditions);
if (!$quests->error) {
$this->extendGlobalData($quests->getJSGlobals());
$this->lvTabs[] = array('file' => 'quest', 'data' => $quests->getListviewData(), 'params' => ['sort' => "\$['reqlevel', 'name']"]);
}
// Tab: Itemsets
$sets = new ItemsetList(array(['classMask', $_mask, '&']));
if (!$sets->error) {
$this->extendGlobalData($sets->getJSGlobals(GLOBALINFO_SELF));
$this->lvTabs[] = array('file' => 'itemset', 'data' => $sets->getListviewData(), 'params' => array('note' => sprintf(Util::$filterResultString, '?itemsets&filter=cl=' . $this->typeId), 'hiddenCols' => "\$['classes']", 'sort' => "\$['-level', 'name']"));
}
// Tab: Trainer
$conditions = array(['npcflag', 0x30, '&'], ['trainerType', 0], ['trainerClass', $this->typeId]);
$trainer = new CreatureList($conditions);
if (!$trainer->error) {
$this->lvTabs[] = array('file' => 'creature', 'data' => $trainer->getListviewData(), 'params' => array('id' => 'trainers', 'name' => '$LANG.tab_trainers'));
}
// Tab: Races
$races = new CharRaceList(array(['classMask', $_mask, '&']));
if (!$races->error) {
//.........这里部分代码省略.........
示例11: generateContent
protected function generateContent()
{
$this->addJS('?data=zones&locale=' . User::$localeId . '&t=' . $_SESSION['dataKey']);
$_typeFlags = $this->subject->getField('typeFlags');
$_altIds = [];
$_altNPCs = null;
$placeholder = null;
$accessory = [];
// difficulty entries of self
if ($this->subject->getField('cuFlags') & NPC_CU_DIFFICULTY_DUMMY) {
$placeholder = [$this->subject->getField('parentId'), $this->subject->getField('parent', true)];
} else {
for ($i = 1; $i < 4; $i++) {
if ($_ = $this->subject->getField('difficultyEntry' . $i)) {
$_altIds[$_] = $i;
}
}
if ($_altIds) {
$_altNPCs = new CreatureList(array(['id', array_keys($_altIds)]));
}
}
if ($_ = DB::World()->selectCol('SELECT DISTINCT entry FROM vehicle_template_accessory WHERE accessory_entry = ?d', $this->typeId)) {
$vehicles = new CreatureList(array(['id', $_]));
foreach ($vehicles->iterate() as $id => $__) {
$accessory[] = [$id, $vehicles->getField('name', true)];
}
}
// try to determine, if it's spawned in a dungeon or raid (shaky at best, if spawned by script)
$mapType = 0;
if ($maps = DB::Aowow()->selectCol('SELECT DISTINCT areaId from ?_spawns WHERE type = ?d AND typeId = ?d', TYPE_NPC, $this->typeId)) {
if (count($maps) == 1) {
switch (DB::Aowow()->selectCell('SELECT `type` FROM ?_zones WHERE id = ?d', $maps[0])) {
case 2:
case 5:
$mapType = 1;
break;
case 3:
case 7:
case 8:
$mapType = 2;
break;
}
}
} else {
if ($_altIds) {
if (count($_altIds) > 1) {
// 3 or more version -> definitly raid (10/25 + hc)
$mapType = 2;
} else {
// 2 versions; may be Heroic (use this), but may also be 10/25-raid
$mapType = 1;
}
}
}
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// Event (ignore events, where the object only gets removed)
if ($_ = DB::World()->selectCol('SELECT DISTINCT ge.eventEntry FROM game_event ge, game_event_creature gec, creature c WHERE ge.eventEntry = gec.eventEntry AND c.guid = gec.guid AND c.id = ?d', $this->typeId)) {
$this->extendGlobalIds(TYPE_WORLDEVENT, $_);
$ev = [];
foreach ($_ as $i => $e) {
$ev[] = ($i % 2 ? '[br]' : ' ') . '[event=' . $e . ']';
}
$infobox[] = Util::ucFirst(Lang::game('eventShort')) . Lang::main('colon') . implode(',', $ev);
}
// Level
if ($this->subject->getField('rank') != NPC_RANK_BOSS) {
$level = $this->subject->getField('minLevel');
$maxLvl = $this->subject->getField('maxLevel');
if ($level < $maxLvl) {
$level .= ' - ' . $maxLvl;
}
} else {
// Boss Level
$level = '??';
}
$infobox[] = Lang::game('level') . Lang::main('colon') . $level;
// Classification
if ($_ = $this->subject->getField('rank')) {
$str = $_typeFlags & 0x4 ? '[span class=icon-boss]' . Lang::npc('rank', $_) . '[/span]' : Lang::npc('rank', $_);
$infobox[] = Lang::npc('classification') . Lang::main('colon') . $str;
}
// Reaction
$_ = function ($r) {
if ($r == 1) {
return 2;
}
if ($r == -1) {
return 10;
}
return;
};
$infobox[] = Lang::npc('react') . Lang::main('colon') . '[color=q' . $_($this->subject->getField('A')) . ']A[/color] [color=q' . $_($this->subject->getField('H')) . ']H[/color]';
// Faction
$this->extendGlobalIds(TYPE_FACTION, $this->subject->getField('factionId'));
$infobox[] = Util::ucFirst(Lang::game('faction')) . Lang::main('colon') . '[faction=' . $this->subject->getField('factionId') . ']';
// Tameable
if ($_typeFlags & 0x1) {
//.........这里部分代码省略.........
示例12: generateContent
protected function generateContent()
{
$this->addJS('?data=zones&locale=' . User::$localeId . '&t=' . $_SESSION['dataKey']);
/***********/
/* Infobox */
/***********/
$this->infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// boss
if ($_ = $this->subject->getField('bossCreature')) {
$this->extendGlobalIds(TYPE_NPC, $_);
$this->infobox[] = Lang::npc('rank', 3) . Lang::main('colon') . '[npc=' . $_ . ']';
}
// display internal id to staff
if (User::isInGroup(U_GROUP_STAFF)) {
$this->infobox[] = 'Event-Id' . Lang::main('colon') . $this->eId;
}
/****************/
/* Main Content */
/****************/
// no entry in ?_articles? use default HolidayDescription
if ($this->hId && empty($this->article)) {
$this->article = ['text' => Util::jsEscape($this->subject->getField('description', true)), 'params' => []];
}
$this->headIcons = [$this->subject->getField('iconString')];
$this->redButtons = array(BUTTON_WOWHEAD => $this->hId > 0, BUTTON_LINKS => true);
/**************/
/* Extra Tabs */
/**************/
$hasFilter = in_array($this->hId, [372, 283, 285, 353, 420, 400, 284, 201, 374, 409, 141, 324, 321, 424, 335, 327, 341, 181, 404, 398, 301]);
// tab: npcs
if ($npcIds = DB::World()->selectCol('SELECT id AS ARRAY_KEY, IF(ec.eventEntry > 0, 1, 0) AS added FROM creature c, game_event_creature ec WHERE ec.guid = c.guid AND ABS(ec.eventEntry) = ?d', $this->eId)) {
$creatures = new CreatureList(array(['id', array_keys($npcIds)]));
if (!$creatures->error) {
$data = $creatures->getListviewData();
foreach ($data as &$d) {
$d['method'] = $npcIds[$d['id']];
}
$tabData = ['data' => array_values($data)];
if ($hasFilter) {
$tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=38;crs=' . $this->hId . ';crv=0');
}
$this->lvTabs[] = ['creature', $tabData];
}
}
// tab: objects
if ($objectIds = DB::World()->selectCol('SELECT id AS ARRAY_KEY, IF(eg.eventEntry > 0, 1, 0) AS added FROM gameobject g, game_event_gameobject eg WHERE eg.guid = g.guid AND ABS(eg.eventEntry) = ?d', $this->eId)) {
$objects = new GameObjectList(array(['id', array_keys($objectIds)]));
if (!$objects->error) {
$data = $objects->getListviewData();
foreach ($data as &$d) {
$d['method'] = $objectIds[$d['id']];
}
$tabData = ['data' => array_values($data)];
if ($hasFilter) {
$tabData['note'] = sprintf(Util::$filterResultString, '?objects&filter=cr=16;crs=' . $this->hId . ';crv=0');
}
$this->lvTabs[] = ['object', $tabData];
}
}
// tab: achievements
if ($_ = $this->subject->getField('achievementCatOrId')) {
$condition = $_ > 0 ? [['category', $_]] : [['id', -$_]];
$acvs = new AchievementList($condition);
if (!$acvs->error) {
$this->extendGlobalData($acvs->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
$tabData = array('data' => array_values($acvs->getListviewData()), 'visibleCols' => ['category']);
if ($hasFilter) {
$tabData['note'] = sprintf(Util::$filterResultString, '?achievements&filter=cr=11;crs=' . $this->hId . ';crv=0');
}
$this->lvTabs[] = ['achievement', $tabData];
}
}
$itemCnd = [];
if ($this->hId) {
$itemCnd = array('OR', ['eventId', $this->eId]);
// tab: quests (by table, go & creature)
$quests = new QuestList(array(['eventId', $this->eId]));
if (!$quests->error) {
$this->extendGlobalData($quests->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_REWARDS));
$tabData = ['data' => array_values($quests->getListviewData())];
if ($hasFilter) {
$tabData['note'] = sprintf(Util::$filterResultString, '?quests&filter=cr=33;crs=' . $this->hId . ';crv=0');
}
$this->lvTabs[] = ['quest', $tabData];
$questItems = [];
foreach (array_column($quests->rewards, TYPE_ITEM) as $arr) {
$questItems = array_merge($questItems, $arr);
}
foreach (array_column($quests->requires, TYPE_ITEM) as $arr) {
$questItems = array_merge($questItems, $arr);
}
if ($questItems) {
$itemCnd[] = ['id', $questItems];
}
}
}
// items from creature
if ($npcIds && !$creatures->error) {
// vendor
$cIds = $creatures->getFoundIDs();
//.........这里部分代码省略.........
示例13: generateContent
protected function generateContent()
{
$this->addJS('?data=zones&locale=' . User::$localeId . '&t=' . $_SESSION['dataKey']);
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// level range
$infobox[] = Lang::game('level') . Lang::main('colon') . $this->subject->getField('minLevel') . ' - ' . $this->subject->getField('maxLevel');
// exotic
if ($this->subject->getField('exotic')) {
$infobox[] = '[url=?spell=53270]' . Lang::pet('exotic') . '[/url]';
}
/****************/
/* Main Content */
/****************/
$this->infobox = '[ul][li]' . implode('[/li][li]', $infobox) . '[/li][/ul]';
$this->headIcons = [$this->subject->getField('iconString')];
$this->expansion = Util::$expansionString[$this->subject->getField('expansion')];
$this->redButtons = array(BUTTON_WOWHEAD => true, BUTTON_LINKS => true, BUTTON_TALENT => ['href' => '?petcalc#' . Util::$tcEncoding[(int) ($this->typeId / 10)] . Util::$tcEncoding[2 * ($this->typeId % 10) + ($this->subject->getField('exotic') ? 1 : 0)], 'pet' => true]);
/**************/
/* Extra Tabs */
/**************/
// tab: tameable & gallery
$condition = array(['ct.type', 1], ['ct.typeFlags', 0x1, '&'], ['ct.family', $this->typeId], ['OR', ['ft.A', 1, '<'], ['ft.H', 1, '<']]);
$tng = new CreatureList($condition);
$this->lvTabs[] = array('file' => 'creature', 'data' => $tng->getListviewData(NPCINFO_TAMEABLE), 'params' => array('name' => '$LANG.tab_tameable', 'hiddenCols' => "\$['type']", 'visibleCols' => "\$['skin']", 'note' => sprintf(Util::$filterResultString, '?npcs=1&filter=fa=38'), 'id' => 'tameable'));
$this->lvTabs[] = array('file' => 'model', 'data' => $tng->getListviewData(NPCINFO_MODEL), 'params' => []);
// tab: diet
$list = [];
$mask = $this->subject->getField('foodMask');
for ($i = 1; $i < 7; $i++) {
if ($mask & 1 << $i - 1) {
$list[] = $i;
}
}
$food = new ItemList(array(['i.subClass', [5, 8]], ['i.FoodType', $list], CFG_SQL_LIMIT_NONE));
$this->extendGlobalData($food->getJSGlobals());
$this->lvTabs[] = array('file' => 'item', 'data' => $food->getListviewData(), 'params' => array('name' => '$LANG.diet', 'hiddenCols' => "\$['source', 'slot', 'side']", 'sort' => "\$['level']", 'id' => 'diet'));
// tab: spells
$mask = 0x0;
foreach (Util::$skillLineMask[-1] as $idx => $pair) {
if ($pair[0] == $this->typeId) {
$mask = 1 << $idx;
break;
}
}
$conditions = [['s.typeCat', -3], ['OR', ['skillLine1', $this->subject->getField('skillLineId')], ['AND', ['skillLine1', 0, '>'], ['skillLine2OrMask', $this->subject->getField('skillLineId')]], ['AND', ['skillLine1', -1], ['skillLine2OrMask', $mask, '&']]]];
$spells = new SpellList($conditions);
$this->extendGlobalData($spells->getJSGlobals(GLOBALINFO_SELF));
$this->lvTabs[] = array('file' => 'spell', 'data' => $spells->getListviewData(), 'params' => array('name' => '$LANG.tab_abilities', 'visibleCols' => "\$['schools', 'level']", 'id' => 'abilities'));
// tab: talents
$conditions = array(['s.typeCat', -7], ['OR', ['s.cuFlags', SPELL_CU_LAST_RANK, '&'], ['s.rankNo', 0]]);
switch ($this->subject->getField('type')) {
case 0:
$conditions[] = ['s.cuFlags', SPELL_CU_PET_TALENT_TYPE0, '&'];
break;
case 1:
$conditions[] = ['s.cuFlags', SPELL_CU_PET_TALENT_TYPE1, '&'];
break;
case 2:
$conditions[] = ['s.cuFlags', SPELL_CU_PET_TALENT_TYPE2, '&'];
break;
}
$talents = new SpellList($conditions);
$this->extendGlobalData($talents->getJSGlobals(GLOBALINFO_SELF));
$this->lvTabs[] = array('file' => 'spell', 'data' => $talents->getListviewData(), 'params' => array('visibleCols' => "\$['tier', 'level']", 'name' => '$LANG.tab_talents', 'id' => 'talents', 'sort' => "\$['tier', 'name']", '_petTalents' => 1));
}
示例14: generateContent
protected function generateContent()
{
$this->addJS('?data=weight-presets.zones&locale=' . User::$localeId . '&t=' . $_SESSION['dataKey']);
$_flags = $this->subject->getField('flags');
$_slot = $this->subject->getField('slot');
$_class = $this->subject->getField('class');
$_subClass = $this->subject->getField('subClass');
$_bagFamily = $this->subject->getField('bagFamily');
$_model = $this->subject->getField('displayId');
$_visSlots = array(INVTYPE_HEAD, INVTYPE_SHOULDERS, INVTYPE_BODY, INVTYPE_CHEST, INVTYPE_WAIST, INVTYPE_LEGS, INVTYPE_FEET, INVTYPE_WRISTS, INVTYPE_HANDS, INVTYPE_WEAPON, INVTYPE_SHIELD, INVTYPE_RANGED, INVTYPE_CLOAK, INVTYPE_2HWEAPON, INVTYPE_TABARD, INVTYPE_ROBE, INVTYPE_WEAPONMAINHAND, INVTYPE_WEAPONOFFHAND, INVTYPE_HOLDABLE, INVTYPE_THROWN, INVTYPE_RANGEDRIGHT);
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// itemlevel
if (in_array($_class, [ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON, ITEM_CLASS_AMMUNITION]) || $this->subject->getField('gemEnchantmentId')) {
$infobox[] = Lang::game('level') . Lang::main('colon') . $this->subject->getField('itemLevel');
}
// account-wide
if ($_flags & ITEM_FLAG_ACCOUNTBOUND) {
$infobox[] = Lang::item('accountWide');
}
// side
if ($si = $this->subject->json[$this->typeId]['side']) {
if ($si != 3) {
$infobox[] = Lang::main('side') . Lang::main('colon') . '[span class=icon-' . ($si == 1 ? 'alliance' : 'horde') . ']' . Lang::game('si', $si) . '[/span]';
}
}
// consumable / not consumable
if (!$_slot) {
$hasUse = false;
for ($i = 1; $i < 6; $i++) {
if ($this->subject->getField('spellId' . $i) <= 0 || in_array($this->subject->getField('spellTrigger' . $i), [1, 2])) {
continue;
}
$hasUse = true;
if ($this->subject->getField('spellCharges' . $i) >= 0) {
continue;
}
$tt = '[tooltip=tooltip_consumedonuse]' . Lang::item('consumable') . '[/tooltip]';
break;
}
if ($hasUse) {
$infobox[] = isset($tt) ? $tt : '[tooltip=tooltip_notconsumedonuse]' . Lang::item('nonConsumable') . '[/tooltip]';
}
}
// related holiday
if ($hId = $this->subject->getField('holidayId')) {
if ($hName = DB::Aowow()->selectRow('SELECT * FROM ?_holidays WHERE id = ?d', $hId)) {
$infobox[] = Lang::game('eventShort') . Lang::main('colon') . '[url=?event=' . $hId . ']' . Util::localizedString($hName, 'name') . '[/url]';
}
}
// tool
if ($tId = $this->subject->getField('totemCategory')) {
if ($tName = DB::Aowow()->selectRow('SELECT * FROM ?_totemcategory WHERE id = ?d', $tId)) {
$infobox[] = Lang::item('tool') . Lang::main('colon') . '[url=?items&filter=cr=91;crs=' . $tId . ';crv=0]' . Util::localizedString($tName, 'name') . '[/url]';
}
}
// extendedCost
if (!empty($this->subject->getExtendedCost([], $_reqRating)[$this->subject->id])) {
$vendors = $this->subject->getExtendedCost()[$this->subject->id];
$each = $this->subject->getField('stackable') > 1 ? '[color=q0] (' . Lang::item('each') . ')[/color]' : null;
$handled = [];
$costList = [];
foreach ($vendors as $npcId => $data) {
$tokens = [];
$currency = [];
if (!is_array($data)) {
continue;
}
foreach ($data as $c => $qty) {
if (is_string($c)) {
unset($data[$c]);
// unset miscData to prevent having two vendors /w the same cost being cached, because of different stock or rating-requirements
continue;
}
if ($c < 0) {
// currency items (and honor or arena)
$currency[] = -$c . ',' . $qty;
} else {
if ($c > 0) {
// plain items (item1,count1,item2,count2,...)
$tokens[$c] = $c . ',' . $qty;
}
}
}
// display every cost-combination only once
if (in_array(md5(serialize($data)), $handled)) {
continue;
}
$handled[] = md5(serialize($data));
$cost = isset($data[0]) ? '[money=' . $data[0] : '[money';
if ($tokens) {
$cost .= ' items=' . implode(',', $tokens);
}
if ($currency) {
$cost .= ' currency=' . implode(',', $currency);
}
$cost .= ']';
$costList[] = $cost;
//.........这里部分代码省略.........
示例15: generateContent
protected function generateContent()
{
$this->addJS('?data=zones&locale=' . User::$localeId . '&t=' . $_SESSION['dataKey']);
$_cat = $this->subject->getField('typeCat');
$redButtons = array(BUTTON_LINKS => ['color' => 'ff71d5ff', 'linkId' => Util::$typeStrings[TYPE_SPELL] . ':' . $this->typeId], BUTTON_VIEW3D => false, BUTTON_WOWHEAD => true);
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// level
if (!in_array($_cat, [-5, -6])) {
if ($_ = $this->subject->getField('talentLevel')) {
$infobox[] = in_array($_cat, [-2, 7, -13]) ? sprintf(Lang::game('reqLevel'), $_) : Lang::game('level') . Lang::main('colon') . $_;
} else {
if ($_ = $this->subject->getField('spellLevel')) {
$infobox[] = in_array($_cat, [-2, 7, -13]) ? sprintf(Lang::game('reqLevel'), $_) : Lang::game('level') . Lang::main('colon') . $_;
}
}
}
// races
if ($_ = Lang::getRaceString($this->subject->getField('reqRaceMask'), $__, $jsg, $n, false)) {
if ($_ != Lang::game('ra', 0)) {
$this->extendGlobalIds(TYPE_RACE, $jsg);
$t = $n == 1 ? Lang::game('race') : Lang::game('races');
$infobox[] = Util::ucFirst($t) . Lang::main('colon') . $_;
}
}
// classes
if ($_ = Lang::getClassString($this->subject->getField('reqClassMask'), $jsg, $n, false)) {
$this->extendGlobalIds(TYPE_CLASS, $jsg);
$t = $n == 1 ? Lang::game('class') : Lang::game('classes');
$infobox[] = Util::ucFirst($t) . Lang::main('colon') . $_;
}
// spell focus
if ($_ = $this->subject->getField('spellFocusObject')) {
$bar = DB::Aowow()->selectRow('SELECT * FROM ?_spellfocusobject WHERE id = ?d', $_);
$focus = new GameObjectList(array(['spellFocusId', $_], 1));
$infobox[] = Lang::game('requires2') . ' ' . ($focus->error ? Util::localizedString($bar, 'name') : '[url=?object=' . $focus->id . ']' . Util::localizedString($bar, 'name') . '[/url]');
}
// primary & secondary trades
if (in_array($_cat, [9, 11])) {
// skill
if ($_ = $this->subject->getField('skillLines')[0]) {
$rSkill = new SkillList(array(['id', $_]));
if (!$rSkill->error) {
$this->extendGlobalData($rSkill->getJSGlobals());
$bar = sprintf(Lang::game('requires'), ' [skill=' . $rSkill->id . ']');
if ($_ = $this->subject->getField('learnedAt')) {
$bar .= ' (' . $_ . ')';
}
$infobox[] = $bar;
}
}
// specialization
if ($_ = $this->subject->getField('reqSpellId')) {
$rSpell = new SpellList(array(['id', $_]));
if (!$rSpell->error) {
$this->extendGlobalData($rSpell->getJSGlobals());
$infobox[] = Lang::game('requires2') . ' [spell=' . $rSpell->id . '][/li]';
}
}
// difficulty
if ($_ = $this->subject->getColorsForCurrent()) {
$bar = [];
for ($i = 0; $i < 4; $i++) {
if ($_[$i]) {
$bar[] = '[color=r' . ($i + 1) . ']' . $_[$i] . '[/color]';
}
}
$infobox[] = Lang::game('difficulty') . Lang::main('colon') . implode(' ', $bar);
}
}
// accquisition.. 10: starter spell; 7: discovery
if (isset($this->subject->sources[$this->subject->id][10])) {
$infobox[] = Lang::spell('starter');
} else {
if (isset($this->subject->sources[$this->subject->id][7])) {
$infobox[] = Lang::spell('discovered');
}
}
// training cost
if ($cost = $this->subject->getField('trainingCost')) {
$infobox[] = Lang::spell('trainingCost') . Lang::main('colon') . '[money=' . $cost . '][/li]';
}
// used in mode
foreach ($this->difficulties as $n => $id) {
if ($id == $this->typeId) {
// "Mode" seems to be multilingual acceptable
$infobox[] = 'Mode' . Lang::main('colon') . Lang::game('modes', $n);
}
}
$effects = $this->createEffects($infobox, $redButtons);
// spell script
if (User::isInGroup(U_GROUP_STAFF)) {
if ($_ = DB::World()->selectCell('SELECT ScriptName FROM spell_script_names WHERE ABS(spell_id) = ?d', $this->firstRank)) {
$infobox[] = 'Script' . Lang::main('colon') . $_;
}
}
$infobox = $infobox ? '[ul][li]' . implode('[/li][li]', $infobox) . '[/li][/ul]' : '';
// append glyph symbol if available
//.........这里部分代码省略.........