本文整理汇总了PHP中Lang::spell方法的典型用法代码示例。如果您正苦于以下问题:PHP Lang::spell方法的具体用法?PHP Lang::spell怎么用?PHP Lang::spell使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lang
的用法示例。
在下文中一共展示了Lang::spell方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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, '!'];
//.........这里部分代码省略.........
示例2: createEffects
private function createEffects(&$infobox, &$redButtons)
{
// proc data .. maybe use more information..?
$procData = DB::World()->selectRow('SELECT IF(ppmRate > 0, -ppmRate, customChance) AS chance, cooldown FROM spell_proc_event WHERE entry = ?d', $this->typeId);
if (!isset($procData['cooldown'])) {
$procData['cooldown'] = 0;
}
$effects = [];
$spellIdx = array_unique(array_merge($this->subject->canTriggerSpell(), $this->subject->canTeachSpell()));
$itemIdx = $this->subject->canCreateItem();
// Iterate through all effects:
for ($i = 1; $i < 4; $i++) {
if ($this->subject->getField('effect' . $i . 'Id') <= 0) {
continue;
}
$effId = (int) $this->subject->getField('effect' . $i . 'Id');
$effMV = (int) $this->subject->getField('effect' . $i . 'MiscValue');
$effBP = (int) $this->subject->getField('effect' . $i . 'BasePoints');
$effDS = (int) $this->subject->getField('effect' . $i . 'DieSides');
$effRPPL = $this->subject->getField('effect' . $i . 'RealPointsPerLevel');
$effAura = (int) $this->subject->getField('effect' . $i . 'AuraId');
$foo =& $effects[];
// Icons:
// .. from item
if (in_array($i, $itemIdx)) {
$_ = $this->subject->getField('effect' . $i . 'CreateItemId');
foreach ($this->subject->relItems->iterate() as $itemId => $__) {
if ($itemId != $_) {
continue;
}
$foo['icon'] = array('id' => $this->subject->relItems->id, 'name' => $this->subject->relItems->getField('name', true), 'quality' => $this->subject->relItems->getField('quality'), 'count' => $effDS + $effBP, 'icon' => $this->subject->relItems->getField('iconString'));
break;
}
if ($effDS > 1) {
$foo['icon']['count'] = "'" . ($effBP + 1) . '-' . $foo['icon']['count'] . "'";
}
} else {
if (in_array($i, $spellIdx) || $effId == 133) {
$_ = $this->subject->getField('effect' . $i . 'TriggerSpell');
if (!$_) {
$_ = $this->subject->getField('effect' . $i . 'MiscValue');
}
$trig = new SpellList(array(['s.id', (int) $_]));
$foo['icon'] = array('id' => $_, 'name' => $trig->error ? Util::ucFirst(Lang::game('spell')) . ' #' . $_ : $trig->getField('name', true), 'count' => 0);
$this->extendGlobalData($trig->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
}
}
// Effect Name
$foo['name'] = (User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'EffectId: ' . $effId, Util::$spellEffectStrings[$effId]) : Util::$spellEffectStrings[$effId]) . Lang::main('colon');
if ($this->subject->getField('effect' . $i . 'RadiusMax') > 0) {
$foo['radius'] = $this->subject->getField('effect' . $i . 'RadiusMax');
}
if (!in_array($i, $itemIdx) && !in_array($i, $spellIdx) && !in_array($effAura, [225, 227])) {
$foo['value'] = ($effDS && $effDS != 1 ? $effBP + 1 . Lang::game('valueDelim') : null) . ($effBP + $effDS);
}
if ($effRPPL != 0) {
$foo['value'] = (isset($foo['value']) ? $foo['value'] : '0') . sprintf(Lang::spell('costPerLevel'), $effRPPL);
}
if ($this->subject->getField('effect' . $i . 'Periode') > 0) {
$foo['interval'] = Util::formatTime($this->subject->getField('effect' . $i . 'Periode'));
}
if ($_ = $this->subject->getField('effect' . $i . 'Mechanic')) {
$foo['mechanic'] = Lang::game('me', $_);
}
if (!empty($procData['chance'])) {
$foo['procData'] = array($procData['chance'], $procData['cooldown'] ? Util::formatTime($procData['cooldown'] * 1000, true) : null);
} else {
if (in_array($i, $this->subject->canTriggerSpell()) && $this->subject->getField('procChance')) {
$foo['procData'] = array($this->subject->getField('procChance'), $procData['cooldown'] ? Util::formatTime($procData['cooldown'] * 1000, true) : null);
}
}
// parse masks and indizes
switch ($effId) {
case 8:
// Power Drain
// Power Drain
case 30:
// Energize
// Energize
case 137:
// Energize Pct
$_ = Lang::spell('powerTypes', $effMV);
if ($_ && User::isInGroup(U_GROUP_EMPLOYEE)) {
$_ = sprintf(Util::$dfnString, Lang::spell('_value') . Lang::main('colon') . $effMV, $_);
} else {
if (!$_) {
$_ = $effMV;
}
}
if ($effMV == POWER_RAGE || $effMV == POWER_RUNIC_POWER) {
$foo['value'] = ($effDS && $effDS != 1 ? ($effBP + 1) / 10 . Lang::game('valueDelim') : null) . ($effBP + $effDS) / 10;
}
$foo['name'] .= ' (' . $_ . ')';
break;
case 16:
// QuestComplete
if ($_ = QuestList::getName($effMV)) {
$foo['name'] .= '(<a href="?quest=' . $effMV . '">' . $_ . '</a>)';
} else {
$foo['name'] .= Util::ucFirst(Lang::game('quest')) . ' #' . $effMV;
//.........这里部分代码省略.........
示例3: generateContent
protected function generateContent()
{
$this->addJS('?data=zones&locale=' . User::$localeId . '&t=' . $_SESSION['dataKey']);
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// Event (ignore events, where the object only gets removed)
if ($_ = DB::World()->selectCol('SELECT DISTINCT IF(ge.holiday, ge.holiday, -ge.eventEntry) FROM game_event ge, game_event_gameobject geg, gameobject g WHERE ge.eventEntry = geg.eventEntry AND g.guid = geg.guid AND g.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);
}
// 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]';
// reqSkill
switch ($this->subject->getField('typeCat')) {
case -3:
// Herbalism
$infobox[] = sprintf(Lang::game('requires'), Lang::spell('lockType', 2) . ' (' . $this->subject->getField('reqSkill') . ')');
break;
case -4:
// Mining
$infobox[] = sprintf(Lang::game('requires'), Lang::spell('lockType', 3) . ' (' . $this->subject->getField('reqSkill') . ')');
break;
case -5:
// Lockpicking
$infobox[] = sprintf(Lang::game('requires'), Lang::spell('lockType', 1) . ' (' . $this->subject->getField('reqSkill') . ')');
break;
default:
$locks = Lang::getLocks($this->subject->getField('lockId'));
$l = '';
foreach ($locks as $idx => $_) {
if ($idx < 0) {
continue;
}
$this->extendGlobalIds(TYPE_ITEM, $idx);
$l = Lang::gameObject('key') . Lang::main('colon') . '[item=' . $idx . ']';
}
// if no propper item is found use a skill
if ($locks) {
$infobox[] = $l ? $l : array_pop($locks);
}
}
// linked trap
if ($_ = $this->subject->getField('linkedTrap')) {
$this->extendGlobalIds(TYPE_OBJECT, $_);
$infobox[] = Lang::gameObject('trap') . Lang::main('colon') . '[object=' . $_ . ']';
}
// trap for
$trigger = new GameObjectList(array(['linkedTrap', $this->typeId]));
if (!$trigger->error) {
$this->extendGlobalData($trigger->getJSGlobals());
$infobox[] = Lang::gameObject('triggeredBy') . Lang::main('colon') . '[object=' . $trigger->id . ']';
}
// SpellFocus
if ($_ = $this->subject->getField('spellFocusId')) {
if ($sfo = DB::Aowow()->selectRow('SELECT * FROM ?_spellfocusobject WHERE id = ?d', $_)) {
$infobox[] = '[tooltip name=focus]' . Lang::gameObject('focusDesc') . '[/tooltip][span class=tip tooltip=focus]' . Lang::gameObject('focus') . Lang::main('colon') . Util::localizedString($sfo, 'name') . '[/span]';
}
}
// lootinfo: [min, max, restock]
if (($_ = $this->subject->getField('lootStack')) && $_[0]) {
$buff = Lang::item('charges') . Lang::main('colon') . $_[0];
if ($_[0] < $_[1]) {
$buff .= Lang::game('valueDelim') . $_[1];
}
// since Veins don't have charges anymore, the timer is questionable
$infobox[] = $_[2] > 1 ? '[tooltip name=restock]' . sprintf(Lang::gameObject('restock'), Util::formatTime($_[2] * 1000)) . '[/tooltip][span class=tip tooltip=restock]' . $buff . '[/span]' : $buff;
}
// meeting stone [minLevel, maxLevel, zone]
if ($this->subject->getField('type') == OBJECT_MEETINGSTONE) {
if ($_ = $this->subject->getField('mStone')) {
$this->extendGlobalIds(TYPE_ZONE, $_[2]);
$m = Lang::game('meetingStone') . Lang::main('colon') . '[zone=' . $_[2] . ']';
$l = $_[0];
if ($_[0] > 1 && $_[1] > $_[0]) {
$l .= Lang::game('valueDelim') . min($_[1], MAX_LEVEL);
}
$infobox[] = $l ? '[tooltip name=meetingstone]' . sprintf(Lang::game('reqLevel'), $l) . '[/tooltip][span class=tip tooltip=meetingstone]' . $m . '[/span]' : $m;
}
}
// capture area [minPlayer, maxPlayer, minTime, maxTime, radius]
if ($this->subject->getField('type') == OBJECT_CAPTURE_POINT) {
if ($_ = $this->subject->getField('capture')) {
$buff = Lang::gameObject('capturePoint');
if ($_[2] > 1 || $_[0]) {
$buff .= Lang::main('colon') . '[ul]';
//.........这里部分代码省略.........
示例4: 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));
}
//.........这里部分代码省略.........
示例5: createExtraMenus
private function createExtraMenus()
{
$menu = array('type' => [[], null], 'slot' => [[], null]);
if (!$this->category) {
$menu['slot'] = [Lang::item('inventoryType'), null];
asort($menu['slot'][0]);
} else {
if (isset($this->category[2]) && is_array(Lang::item('cat', $this->category[0], 1, $this->category[1]))) {
$catList = Lang::item('cat', $this->category[0], 1, $this->category[1], 1, $this->category[2]);
} else {
if (isset($this->category[1]) && is_array(Lang::item('cat', $this->category[0]))) {
$catList = Lang::item('cat', $this->category[0], 1, $this->category[1]);
} else {
$catList = Lang::item('cat', $this->category[0]);
}
}
switch ($this->category[0]) {
case 0:
if (!isset($this->category[1])) {
$menu['type'] = [Lang::item('cat', 0, 1), null];
}
if (!isset($this->category[1]) || in_array($this->category[1], [6, -3])) {
$menu['slot'] = [Lang::item('inventoryType'), 0x63efea];
asort($menu['slot'][0]);
}
break;
case 2:
if (!isset($this->category[1])) {
$menu['type'] = [Lang::spell('weaponSubClass'), null];
}
$menu['slot'] = [Lang::item('inventoryType'), 0x262a000];
asort($menu['slot'][0]);
break;
case 4:
if (!isset($this->category[1])) {
$menu['slot'] = [Lang::item('inventoryType'), 0x10895ffe];
$menu['type'] = [Lang::item('cat', 4, 1), null];
} else {
if (in_array($this->category[1], [1, 2, 3, 4])) {
$menu['slot'] = [Lang::item('inventoryType'), 0x7ea];
}
}
asort($menu['slot'][0]);
break;
case 16:
if (!isset($this->category[2])) {
$this->sharedLV['visibleCols'][] = 'glyph';
}
case 1:
if ($this->category[0] == 1) {
$this->sharedLV['visibleCols'][] = 'slots';
}
case 3:
if (!isset($this->category[1])) {
asort($catList[1]);
}
case 7:
case 9:
$this->sharedLV['hiddenCols'][] = 'slot';
case 15:
if (!isset($this->category[1])) {
$menu['type'] = [$catList[1], null];
}
break;
}
}
return $menu;
}
示例6: renderTooltip
public function renderTooltip($level = MAX_LEVEL, $interactive = false)
{
if (!$this->curTpl) {
return ['', []];
}
$this->interactive = $interactive;
// fetch needed texts
$name = $this->getField('name', true);
$rank = $this->getField('rank', true);
$desc = $this->parseText('description', $level, $this->interactive, $scaling);
$tools = $this->getToolsForCurrent();
$cool = $this->createCooldownForCurrent();
$cast = $this->createCastTimeForCurrent();
$cost = $this->createPowerCostForCurrent();
$range = $this->createRangesForCurrent();
// get reagents
$reagents = $this->getReagentsForCurrent();
foreach ($reagents as &$r) {
$r[2] = ItemList::getName($r[0]);
}
$reagents = array_reverse($reagents);
// get stances (check: SPELL_ATTR2_NOT_NEED_SHAPESHIFT)
$stances = '';
if ($this->curTpl['stanceMask'] && !($this->curTpl['attributes2'] & 0x80000)) {
$stances = Lang::game('requires2') . ' ' . Lang::getStances($this->curTpl['stanceMask']);
}
// get item requirement (skip for professions)
$reqItems = '';
if ($this->curTpl['typeCat'] != 11) {
$class = $this->getField('equippedItemClass');
$mask = $this->getField('equippedItemSubClassMask');
$reqItems = Lang::getRequiredItems($class, $mask);
}
// get created items (may need improvement)
$createItem = '';
if (in_array($this->curTpl['typeCat'], [9, 11])) {
foreach ($this->canCreateItem() as $idx) {
if ($this->curTpl['effect' . $idx . 'Id'] == 53) {
// Enchantment (has createItem Scroll of Enchantment)
continue;
}
foreach ($this->relItems->iterate() as $cId => $__) {
if ($cId != $this->curTpl['effect' . $idx . 'CreateItemId']) {
continue;
}
$createItem = $this->relItems->renderTooltip(true, $this->id);
break 2;
}
}
}
$x = '';
$x .= '<table><tr><td>';
// name & rank
if ($rank) {
$x .= '<table width="100%"><tr><td><b>' . $name . '</b></td><th><b class="q0">' . $rank . '</b></th></tr></table>';
} else {
$x .= '<b>' . $name . '</b><br />';
}
// powerCost & ranges
if ($range && $cost) {
$x .= '<table width="100%"><tr><td>' . $cost . '</td><th>' . $range . '</th></tr></table>';
} else {
if ($cost || $range) {
$x .= $range . $cost . '<br />';
}
}
// castTime & cooldown
if ($cast && $cool) {
$x .= '<table width="100%">';
$x .= '<tr><td>' . $cast . '</td><th>' . $cool . '</th></tr>';
if ($stances) {
$x .= '<tr><td colspan="2">' . $stances . '</td></tr>';
}
$x .= '</table>';
} else {
if ($cast || $cool) {
$x .= $cast . $cool;
if ($stances) {
$x .= '<br />' . $stances;
}
}
}
$x .= '</td></tr></table>';
$xTmp = [];
if ($tools) {
$_ = Lang::spell('tools') . ':<br/><div class="indent q1">';
while ($tool = array_pop($tools)) {
if (isset($tool['itemId'])) {
$_ .= '<a href="?item=' . $tool['itemId'] . '">' . $tool['name'] . '</a>';
} else {
if (isset($tool['id'])) {
$_ .= '<a href="?items&filter=cr=91;crs=' . $tool['id'] . ';crv=0">' . $tool['name'] . '</a>';
} else {
$_ .= $tool['name'];
}
}
if (!empty($tools)) {
$_ .= ', ';
} else {
$_ .= '<br />';
//.........这里部分代码省略.........
示例7: generateTitle
protected function generateTitle()
{
$foo = [];
$c = $this->category;
// shothand
if (isset($c[2]) && $c[0] == 11) {
array_unshift($foo, Lang::spell('cat', $c[0], $c[1], $c[2]));
} else {
if (isset($c[1])) {
$_ = in_array($c[0], [-2, -13, 7]) ? Lang::game('cl') : Lang::spell('cat', $c[0]);
array_unshift($foo, is_array($_[$c[1]]) ? $_[$c[1]][0] : $_[$c[1]]);
}
}
if (isset($c[0]) && count($foo) < 2) {
$_ = Lang::spell('cat', $c[0]);
array_unshift($foo, is_array($_) ? $_[0] : $_);
}
if (count($foo) < 2) {
array_unshift($foo, $this->name);
}
foreach ($foo as $bar) {
array_unshift($this->title, $bar);
}
}
示例8: 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) {
//.........这里部分代码省略.........
示例9: generateContent
//.........这里部分代码省略.........
// 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) {
if ($_ = $this->subject->getField('family')) {
$infobox[] = sprintf(Lang::npc('tameable'), '[url=pet=' . $_ . ']' . Lang::game('fa', $_) . '[/url]');
}
}
// Wealth
if ($_ = intVal(($this->subject->getField('minGold') + $this->subject->getField('maxGold')) / 2)) {
$infobox[] = Lang::npc('worth') . Lang::main('colon') . '[tooltip=tooltip_avgmoneydropped][money=' . $_ . '][/tooltip]';
}
// is Vehicle
if ($this->subject->getField('vehicleId')) {
$infobox[] = Lang::npc('vehicle');
}
// AI
if (User::isInGroup(U_GROUP_EMPLOYEE)) {
if ($_ = $this->subject->getField('scriptName')) {
$infobox[] = 'Script' . Lang::main('colon') . $_;
} else {
if ($_ = $this->subject->getField('aiName')) {
$infobox[] = 'AI' . Lang::main('colon') . $_;
}
}
}
if (User::isInGroup(U_GROUP_STAFF)) {
// Mechanic immune
if ($immuneMask = $this->subject->getField('mechanicImmuneMask')) {
$buff = [];
for ($i = 0; $i < 31; $i++) {
if ($immuneMask & 1 << $i) {
$buff[] = (!fMod(count($buff), 3) ? "\n" : null) . '[url=?spells&filter=me=' . ($i + 1) . ']' . Lang::game('me', $i + 1) . '[/url]';
}
}
$infobox[] = 'Not affected by mechanic' . Lang::main('colon') . implode(', ', $buff);
}
// extra flags
if ($flagsExtra = $this->subject->getField('flagsExtra')) {
$buff = [];
if ($flagsExtra & 0x1) {
$buff[] = 'Binds attacker to instance on death';
}
if ($flagsExtra & 0x2) {
$buff[] = "[tooltip name=civilian]- does not aggro\n- death costs Honor[/tooltip][span class=tip tooltip=civilian]Civilian[/span]";
}
if ($flagsExtra & 0x4) {
$buff[] = 'Cannot parry';
}
if ($flagsExtra & 0x8) {
$buff[] = 'Has no parry haste';
}
if ($flagsExtra & 0x10) {
$buff[] = 'Cannot block';
}
if ($flagsExtra & 0x20) {
$buff[] = 'Cannot deal Crushing Blows';
}
if ($flagsExtra & 0x40) {
$buff[] = 'Rewards no experience';
}
if ($flagsExtra & 0x80) {
$buff[] = 'Trigger-Creature';
}
if ($flagsExtra & 0x100) {
示例10:
<div id="sl<?php
echo $this->typeId;
?>
" style="margin-left: 70px; margin-top: 4px;"></div>
<div id="ks<?php
echo $this->typeId;
?>
" style="margin-left: 70px; margin-top: 4px;"></div>
<?php
$hasBuff = !empty($this->jsGlobals[6][2][$this->typeId]['buff']);
// not set with items
if ($hasBuff) {
?>
<h3><?php
echo Lang::spell('_aura');
?>
</h3>
<div id="btt<?php
echo $this->typeId;
?>
" class="wowhead-tooltip"></div>
<?php
}
/*
tt: Tooltip
btt: Buff-Tooltip
sl: Slider for CharLevel
ks: Known Spells
*/
?>
示例11: generateXML
protected function generateXML($asError = false)
{
$root = new SimpleXML('<aowow />');
if ($asError) {
$root->addChild('error', 'Item not found!');
} else {
// item root
$xml = $root->addChild('item');
$xml->addAttribute('id', $this->subject->id);
// name
$xml->addChild('name')->addCData($this->subject->getField('name', true));
// itemlevel
$xml->addChild('level', $this->subject->getField('itemLevel'));
// quality
$xml->addChild('quality', Lang::item('quality', $this->subject->getField('quality')))->addAttribute('id', $this->subject->getField('quality'));
// class
$x = Lang::item('cat', $this->subject->getField('class'));
$xml->addChild('class')->addCData(is_array($x) ? $x[0] : $x)->addAttribute('id', $this->subject->getField('class'));
// subclass
$x = $this->subject->getField('class') == 2 ? Lang::spell('weaponSubClass') : Lang::item('cat', $this->subject->getField('class'), 1);
$xml->addChild('subclass')->addCData(is_array($x) ? is_array($x[$this->subject->getField('subClass')]) ? $x[$this->subject->getField('subClass')][0] : $x[$this->subject->getField('subClass')] : null)->addAttribute('id', $this->subject->getField('subClass'));
// icon + displayId
$xml->addChild('icon', $this->subject->getField('iconString'))->addAttribute('displayId', $this->subject->getField('displayId'));
// inventorySlot
$xml->addChild('inventorySlot', Lang::item('inventoryType', $this->subject->getField('slot')))->addAttribute('id', $this->subject->getField('slot'));
// tooltip
$xml->addChild('htmlTooltip')->addCData($this->subject->renderTooltip());
$this->subject->extendJsonStats();
// json
$fields = ["classs", "displayid", "dps", "id", "level", "name", "reqlevel", "slot", "slotbak", "source", "sourcemore", "speed", "subclass"];
$json = '';
foreach ($fields as $f) {
if (isset($this->subject->json[$this->subject->id][$f])) {
$_ = $this->subject->json[$this->subject->id][$f];
if ($f == 'name') {
$_ = 7 - $this->subject->getField('quality') . $_;
}
$json .= ',"' . $f . '":' . $_;
}
}
$xml->addChild('json')->addCData(substr($json, 1));
// jsonEquip missing: avgbuyout, cooldown, source, sourcemore
$json = '';
if ($_ = $this->subject->getField('sellPrice')) {
// sellprice
$json .= ',"sellprice":' . $_;
}
if ($_ = $this->subject->getField('requiredLevel')) {
// reqlevel
$json .= ',"reqlevel":' . $_;
}
if ($_ = $this->subject->getField('requiredSkill')) {
// reqskill
$json .= ',"reqskill":' . $_;
}
if ($_ = $this->subject->getField('requiredSkillRank')) {
// reqskillrank
$json .= ',"reqskillrank":' . $_;
}
foreach ($this->subject->itemMods[$this->subject->id] as $mod => $qty) {
$json .= ',"' . $mod . '":' . $qty;
}
foreach ($_ = $this->subject->json[$this->subject->id] as $name => $qty) {
if (in_array($name, Util::$itemFilter)) {
$json .= ',"' . $name . '":' . $qty;
}
}
$xml->addChild('jsonEquip')->addCData(substr($json, 1));
// jsonUse
if ($onUse = $this->subject->getOnUseStats()) {
$j = '';
foreach ($onUse as $idx => $qty) {
$j .= ',"' . Util::$itemMods[$idx] . '":' . $qty;
}
$xml->addChild('jsonUse')->addCData(substr($j, 1));
}
// reagents
$cnd = array('OR', ['AND', ['effect1CreateItemId', $this->subject->id], ['OR', ['effect1Id', SpellList::$effects['itemCreate']], ['effect1AuraId', SpellList::$auras['itemCreate']]]], ['AND', ['effect2CreateItemId', $this->subject->id], ['OR', ['effect2Id', SpellList::$effects['itemCreate']], ['effect2AuraId', SpellList::$auras['itemCreate']]]], ['AND', ['effect3CreateItemId', $this->subject->id], ['OR', ['effect3Id', SpellList::$effects['itemCreate']], ['effect3AuraId', SpellList::$auras['itemCreate']]]]);
$spellSource = new SpellList($cnd);
if (!$spellSource->error) {
$cbNode = $xml->addChild('createdBy');
foreach ($spellSource->iterate() as $sId => $__) {
foreach ($spellSource->canCreateItem() as $idx) {
if ($spellSource->getField('effect' . $idx . 'CreateItemId') != $this->subject->id) {
continue;
}
$splNode = $cbNode->addChild('spell');
$splNode->addAttribute('id', $sId);
$splNode->addAttribute('name', $spellSource->getField('name', true));
$splNode->addAttribute('icon', $this->subject->getField('iconString'));
$splNode->addAttribute('minCount', $spellSource->getField('effect' . $idx . 'BasePoints') + 1);
$splNode->addAttribute('maxCount', $spellSource->getField('effect' . $idx . 'BasePoints') + $spellSource->getField('effect' . $idx . 'DieSides'));
foreach ($spellSource->getReagentsForCurrent() as $rId => $qty) {
if ($reagent = $spellSource->relItems->getEntry($rId)) {
$rgtNode = $splNode->addChild('reagent');
$rgtNode->addAttribute('id', $rId);
$rgtNode->addAttribute('name', Util::localizedString($reagent, 'name'));
$rgtNode->addAttribute('quality', $reagent['quality']);
$rgtNode->addAttribute('icon', $reagent['iconString']);
$rgtNode->addAttribute('count', $qty[1]);
//.........这里部分代码省略.........
示例12: elseif
}
?>
<table class="iconlist" id="reagent-list-generic">
<?php
if ($enhanced) {
?>
<tr>
<th></th>
<th align="left">
<input type="button" style="font-size: 11px; margin-right: 0.5em" onclick="iconlist_expandall('reagent-list-generic',true);" value="<?php
echo Lang::spell('_expandAll');
?>
">
<input type="button" style="font-size: 11px; margin-right: 0.5em" onclick="iconlist_expandall('reagent-list-generic',false);" value="<?php
echo Lang::spell('_collapseAll');
?>
">
</th>
</tr>
<?php
}
foreach ($reagents as $k => $itr) {
echo '<tr id="reagent-list-generic.' . $itr['path'] . '"' . ($itr['level'] ? ' style="display: none"' : null) . '><th align="right" id="iconlist-icon' . $k . '"></th>' . '<td' . ($itr['level'] ? ' style="padding-left: ' . $itr['level'] . 'em"' : null) . '>';
if (!empty($itr['final']) && $enhanced) {
echo '<div class="iconlist-tree" style="width: 15px; float: left"> </div>';
} elseif ($enhanced) {
echo '<div class="iconlist-tree disclosure-off" onclick="iconlist_showhide(this);" style="padding-left: 0; cursor: pointer; width: 15px; float: left" id="spn.reagent-list-generic.' . $itr['path'] . '"> </div>';
}
echo '<span class="q' . ($itr['type'] == TYPE_ITEM ? $itr['quality'] : null) . '"><a href="?' . $itr['typeStr'] . '=' . $itr['typeId'] . '">' . $itr['name'] . '</a></span>' . ($itr['qty'] > 1 ? ' (' . $itr['qty'] . ')' : null) . "</td></tr>\n";
}
示例13: foreach
foreach ($this->effects as $i => $e) {
?>
<tr>
<th><?php
echo Lang::spell('_effect') . ' #' . ($i + 1);
?>
</th>
<td colspan="3" style="line-height: 17px">
<?php
echo ' ' . $e['name'] . '<small>' . (isset($e['value']) ? '<br>' . Lang::spell('_value') . Lang::main('colon') . $e['value'] : null) . (isset($e['radius']) ? '<br>' . Lang::spell('_radius') . Lang::main('colon') . $e['radius'] . ' ' . Lang::spell('_distUnit') : null) . (isset($e['interval']) ? '<br>' . Lang::spell('_interval') . Lang::main('colon') . $e['interval'] : null) . (isset($e['mechanic']) ? '<br>' . Lang::game('mechanic') . Lang::main('colon') . $e['mechanic'] : null);
if (isset($e['procData'])) {
echo '<br>';
if ($e['procData'][0] < 0) {
echo sprintf(Lang::spell('ppm'), -$e['procData'][0]);
} elseif ($e['procData'][0] < 100.0) {
echo Lang::spell('procChance') . Lang::main('colon') . $e['procData'][0] . '%';
}
if ($e['procData'][1]) {
if ($e['procData'][0] < 100.0) {
echo '<br>';
}
echo sprintf(Lang::game('cooldown'), $e['procData'][1]);
}
}
echo "</small>\n";
if (isset($e['icon'])) {
?>
<table class="icontab">
<tr>
<th id="icontab-icon<?php
echo $i;