本文整理汇总了PHP中ItemList::getFoundIDs方法的典型用法代码示例。如果您正苦于以下问题:PHP ItemList::getFoundIDs方法的具体用法?PHP ItemList::getFoundIDs怎么用?PHP ItemList::getFoundIDs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemList
的用法示例。
在下文中一共展示了ItemList::getFoundIDs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateContent
//.........这里部分代码省略.........
$n = $list->getField('name', true);
$chain[] = array(array('side' => Util::sideByRaceMask($list->getField('reqRaceMask')), 'typeStr' => Util::$typeStrings[TYPE_QUEST], 'typeId' => $id, 'name' => strlen($n) > 40 ? substr($n, 0, 40) . '…' : $n));
}
return $chain;
};
$extraLists = array(['reqQ', array('OR', ['AND', ['nextQuestId', $this->typeId], ['exclusiveGroup', 0, '<']], ['AND', ['id', $this->subject->getField('prevQuestId')], ['nextQuestIdChain', $this->typeId, '!']])], ['reqOneQ', array(['exclusiveGroup', 0, '>'], ['nextQuestId', $this->typeId])], ['opensQ', array('OR', ['AND', ['prevQuestId', $this->typeId], ['id', $this->subject->getField('nextQuestIdChain'), '!']], ['id', $this->subject->getField('nextQuestId')])], ['closesQ', array(['exclusiveGroup', 0, '!'], ['exclusiveGroup', $this->subject->getField('exclusiveGroup')], ['id', $this->typeId, '!'])], ['enablesQ', array(['prevQuestId', -$this->typeId])], ['enabledByQ', array(['id', -$this->subject->getField('prevQuestId')])]);
foreach ($extraLists as $el) {
if ($_ = $listGen($el[1])) {
$this->series[] = [$_, sprintf(Util::$dfnString, Lang::quest($el[0] . 'Desc'), Lang::quest($el[0]))];
}
}
/*******************/
/* Objectives List */
/*******************/
$this->objectiveList = [];
$this->providedItem = [];
// gather ids for lookup
$olItems = $olNPCs = $olGOs = $olFactions = [];
// items
$olItems[0] = array($this->subject->getField('sourceItemId'), $this->subject->getField('sourceItemCount'), false);
for ($i = 1; $i < 7; $i++) {
$id = $this->subject->getField('reqItemId' . $i);
$qty = $this->subject->getField('reqItemCount' . $i);
if (!$id || !$qty) {
continue;
}
$olItems[$i] = [$id, $qty, $id == $olItems[0][0]];
}
if ($ids = array_column($olItems, 0)) {
$olItemData = new ItemList(array(['id', $ids]));
$this->extendGlobalData($olItemData->getJSGlobals(GLOBALINFO_SELF));
$providedRequired = false;
foreach ($olItems as $i => list($itemId, $qty, $provided)) {
if (!$i || !$itemId || !in_array($itemId, $olItemData->getFoundIDs())) {
continue;
}
if ($provided) {
$providedRequired = true;
}
$this->objectiveList[] = array('typeStr' => Util::$typeStrings[TYPE_ITEM], 'id' => $itemId, 'name' => $olItemData->json[$itemId]['name'], 'qty' => $qty > 1 ? $qty : 0, 'quality' => 7 - $olItemData->json[$itemId]['quality'], 'extraText' => $provided ? ' (' . Lang::quest('provided') . ')' : '');
}
// if providd item is not required by quest, list it below other requirements
if (!$providedRequired && $olItems[0][0] && in_array($olItems[0][0], $olItemData->getFoundIDs())) {
$this->providedItem = array('id' => $olItems[0][0], 'name' => $olItemData->json[$olItems[0][0]]['name'], 'qty' => $olItems[0][1] > 1 ? $olItems[0][1] : 0, 'quality' => 7 - $olItemData->json[$olItems[0][0]]['quality']);
}
}
// creature or GO...
for ($i = 1; $i < 5; $i++) {
$id = $this->subject->getField('reqNpcOrGo' . $i);
$qty = $this->subject->getField('reqNpcOrGoCount' . $i);
$altTxt = $this->subject->getField('objectiveText' . $i, true);
if ($id > 0 && $qty) {
$olNPCs[$id] = [$qty, $altTxt, []];
} else {
if ($id < 0 && $qty) {
$olGOs[-$id] = [$qty, $altTxt];
}
}
}
// .. creature kills
if ($ids = array_keys($olNPCs)) {
$olNPCData = new CreatureList(array('OR', ['id', $ids], ['killCredit1', $ids], ['killCredit2', $ids]));
$this->extendGlobalData($olNPCData->getJSGlobals(GLOBALINFO_SELF));
// create proxy-references
foreach ($olNPCData->iterate() as $id => $__) {
if ($p = $olNPCData->getField('KillCredit1')) {