mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
- moved shared setup functions from FileGen to new CLISetup
- removed web-setup - new CLI parameters --account : create initial account(s) --siteconfig : edit php/aowow config values --dbconfig : set up db connection --sql : create db content from world/dbc-tables --firstrun : [NYI] step by step initial setup - some fixes by the wayside * display required arena bracket for extendedCost * achievement chains are searchable again * category trees for factions should now be correct * trainer tab on spell detail page reapeared * userMenu item 'Settings' no longer breaks the page * display abilities of shapeshift in tab on spell detail page * corrected reading ?_sourcestrings for titles * fixed error on race detail page * added simple descriptions to skill detail page * fixed tab "reward from" (achievement) on title detail page * fixed alphabetical order of some filter-dropdowns * fixed skill colors for spells * fixed power display for rune-based spells, that also cost mana * added more information to zones * also check mail_loot_template for achivements * fixed bug, where loot_template-ids would be reused for multiple templates * display sourcemore for pvp-sources
This commit is contained in:
@@ -16,7 +16,7 @@ class AchievementList extends BaseType
|
||||
protected $queryBase = 'SELECT `a`.*, `a`.`id` AS ARRAY_KEY FROM ?_achievement a';
|
||||
protected $queryOpts = array(
|
||||
'a' => [['si'], 'o' => 'orderInGroup ASC'],
|
||||
'si' => ['j' => ['?_spellicon si ON si.id = a.iconId', true], 's' => ', si.iconString'],
|
||||
'si' => ['j' => ['?_icons si ON si.id = a.iconId', true], 's' => ', si.iconString'],
|
||||
'ac' => ['j' => ['?_achievementcriteria AS `ac` ON `ac`.`refAchievementId` = `a`.`id`', true], 'g' => '`a`.`id`']
|
||||
);
|
||||
|
||||
@@ -39,11 +39,28 @@ class AchievementList extends BaseType
|
||||
|
||||
foreach ($this->iterate() as $_id => &$_curTpl)
|
||||
{
|
||||
$_curTpl['rewards'] = [];
|
||||
|
||||
if (!empty($rewards[$_id]))
|
||||
{
|
||||
$_curTpl = array_merge($rewards[$_id], $_curTpl);
|
||||
|
||||
if ($rewards[$_id]['mailTemplate'])
|
||||
{
|
||||
// using class Loot creates an inifinite loop cirling between Loot, ItemList and SpellList or something
|
||||
// $mailSrc = new Loot();
|
||||
// $mailSrc->getByContainer(LOOT_MAIL, $rewards[$_id]['mailTemplate']);
|
||||
// foreach ($mailSrc->iterate() as $loot)
|
||||
// $_curTpl['rewards'][] = [TYPE_ITEM, $loot['id']];
|
||||
|
||||
// lets just assume for now, that mailRewards for achievements do not contain references
|
||||
$mailRew = DB::World()->selectCol('SELECT Item FROM mail_loot_template WHERE Reference <= 0 AND entry = ?d', $rewards[$_id]['mailTemplate']);
|
||||
foreach ($mailRew AS $mr)
|
||||
$_curTpl['rewards'][] = [TYPE_ITEM, $mr];
|
||||
}
|
||||
}
|
||||
|
||||
//"rewards":[[11,137],[3,138]] [type, typeId]
|
||||
$_curTpl['rewards'] = [];
|
||||
if (!empty($_curTpl['item']))
|
||||
$_curTpl['rewards'][] = [TYPE_ITEM, $_curTpl['item']];
|
||||
if (!empty($_curTpl['itemExtra']))
|
||||
@@ -264,10 +281,10 @@ class AchievementListFilter extends Filter
|
||||
protected $genericFilter = array( // misc (bool): _NUMERIC => useFloat; _STRING => localized; _FLAG => match Value; _BOOLEAN => stringSet
|
||||
2 => [FILTER_CR_BOOLEAN, 'reward_loc0', true ], // givesreward
|
||||
3 => [FILTER_CR_STRING, 'reward', true ], // rewardtext
|
||||
7 => [FILTER_CR_BOOLEAN, 'series', ], // givesreward
|
||||
7 => [FILTER_CR_BOOLEAN, 'chainId', ], // partseries
|
||||
9 => [FILTER_CR_NUMERIC, 'id', null, true], // id
|
||||
10 => [FILTER_CR_STRING, 'si.iconString', ], // icon
|
||||
18 => [FILTER_CR_STAFFFLAG, 'flags', ], // lastrank
|
||||
18 => [FILTER_CR_STAFFFLAG, 'flags', ], // flags
|
||||
14 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_COMMENT ], // hascomments
|
||||
15 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_SCREENSHOT ], // hasscreenshots
|
||||
16 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_VIDEO ], // hasvideos
|
||||
@@ -290,9 +307,15 @@ class AchievementListFilter extends Filter
|
||||
case 4: // location [enum]
|
||||
/* todo */ return [1]; // no plausible locations parsed yet
|
||||
case 5: // first in series [yn]
|
||||
return $this->int2Bool($cr[1]) ? ['AND', ['series', 0, '!'], [['series', 0xFFFF0000, '&'], 0]] : [['series', 0xFFFF0000, '&'], 0, '!'];
|
||||
if ($this->int2Bool($cr[1]))
|
||||
return $cr[1] ? ['AND', ['chainId', 0, '!'], ['cuFlags', ACHIEVEMENT_CU_FIRST_SERIES, '&']] : ['AND', ['chainId', 0, '!'], [['cuFlags', ACHIEVEMENT_CU_FIRST_SERIES, '&'], 0]];
|
||||
|
||||
break;
|
||||
case 6: // last in series [yn]
|
||||
return $this->int2Bool($cr[1]) ? ['AND', ['series', 0, '!'], [['series', 0xFFFF, '&'], 0]] : [['series', 0xFFFF, '&'], 0, '!'];
|
||||
if ($this->int2Bool($cr[1]))
|
||||
return $cr[1] ? ['AND', ['chainId', 0, '!'], ['cuFlags', ACHIEVEMENT_CU_LAST_SERIES, '&']] : ['AND', ['chainId', 0, '!'], [['cuFlags', ACHIEVEMENT_CU_LAST_SERIES, '&'], 0]];
|
||||
|
||||
break;
|
||||
case 11: // Related Event [enum]
|
||||
$_ = isset($this->enums[$cr[0]][$cr[1]]) ? $this->enums[$cr[0]][$cr[1]] : null;
|
||||
if ($_ !== null)
|
||||
|
||||
@@ -221,7 +221,7 @@ abstract class BaseType
|
||||
|
||||
// insert additional selected fields
|
||||
if ($s = array_column($this->queryOpts, 's'))
|
||||
$this->queryBase = str_replace(' FROM', implode('', $s).' FROM', $this->queryBase);
|
||||
$this->queryBase = str_replace('ARRAY_KEY', 'ARRAY_KEY '.implode('', $s), $this->queryBase);
|
||||
|
||||
// append joins
|
||||
if ($j = array_column($this->queryOpts, 'j'))
|
||||
|
||||
@@ -17,7 +17,7 @@ class CreatureList extends BaseType
|
||||
'ft' => ['j' => '?_factiontemplate ft ON ft.id = ct.faction', 's' => ', ft.A, ft.H, ft.factionId'],
|
||||
'qse' => ['j' => ['?_quests_startend qse ON qse.type = 1 AND qse.typeId = ct.id', true], 's' => ', IF(min(qse.method) = 1 OR max(qse.method) = 3, 1, 0) AS startsQuests, IF(min(qse.method) = 2 OR max(qse.method) = 3, 1, 0) AS endsQuests', 'g' => 'ct.id'],
|
||||
'qt' => ['j' => '?_quests qt ON qse.questId = qt.id'],
|
||||
's' => ['j' => '?_spawns s ON s.type = 1 AND s.typeId = ct.id']
|
||||
's' => ['j' => ['?_spawns s ON s.type = 1 AND s.typeId = ct.id', true]]
|
||||
);
|
||||
|
||||
public function __construct($conditions = [], $miscData = null)
|
||||
|
||||
@@ -9,7 +9,11 @@ class CurrencyList extends BaseType
|
||||
public static $type = TYPE_CURRENCY;
|
||||
public static $brickFile = 'currency';
|
||||
|
||||
protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_currencies c';
|
||||
protected $queryBase = 'SELECT *, c.id AS ARRAY_KEY FROM ?_currencies c';
|
||||
protected $queryOpts = array(
|
||||
'c' => [['ic']],
|
||||
'ic' => ['j' => ['?_icons ic ON ic.id = c.iconId', true], 's' => ', ic.iconString']
|
||||
);
|
||||
|
||||
public function getListviewData()
|
||||
{
|
||||
|
||||
@@ -47,13 +47,23 @@ class FactionList extends BaseType
|
||||
foreach ($this->iterate() as $__)
|
||||
{
|
||||
$data[$this->id] = array(
|
||||
'category' => $this->curTpl['cat'],
|
||||
'category2' => $this->curTpl['cat2'],
|
||||
'expansion' => $this->curTpl['expansion'],
|
||||
'id' => $this->id,
|
||||
'side' => $this->curTpl['side'],
|
||||
'name' => $this->getField('name', true)
|
||||
);
|
||||
|
||||
if ($this->curTpl['cat2'])
|
||||
{
|
||||
$data[$this->id]['category'] = $this->curTpl['cat'];
|
||||
$data[$this->id]['category2'] = $this->curTpl['cat2'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$data[$this->id]['category'] = $this->curTpl['cat2'];
|
||||
$data[$this->id]['category2'] = $this->curTpl['cat'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
||||
@@ -23,11 +23,12 @@ class ItemList extends BaseType
|
||||
private $vendors = [];
|
||||
private $jsGlobals = []; // getExtendedCost creates some and has no access to template
|
||||
|
||||
protected $queryBase = 'SELECT i.*, `is`.*, i.id AS id, i.id AS ARRAY_KEY FROM ?_items i';
|
||||
protected $queryBase = 'SELECT i.*, i.id AS ARRAY_KEY, i.id AS id FROM ?_items i';
|
||||
protected $queryOpts = array(
|
||||
'i' => [['is', 'src'], 'o' => 'i.quality DESC, i.itemLevel DESC'],
|
||||
'is' => ['j' => ['?_item_stats AS `is` ON `is`.`id` = `i`.`id`', true]],
|
||||
's' => ['j' => ['?_spell AS `s` ON s.effect1CreateItemId = i.id', true], 'g' => 'i.id'],
|
||||
'i' => [['is', 'src', 'ic'], 'o' => 'i.quality DESC, i.itemLevel DESC'],
|
||||
'ic' => ['j' => ['?_icons ic ON ic.id = -i.displayId', true], 's' => ', ic.iconString'],
|
||||
'is' => ['j' => ['?_item_stats `is` ON `is`.`id` = `i`.`id`', true], 's' => ', `is`.*'],
|
||||
's' => ['j' => ['?_spell `s` ON s.effect1CreateItemId = i.id', true], 'g' => 'i.id'],
|
||||
'src' => ['j' => ['?_source src ON type = 3 AND typeId = i.id', true], 's' => ', moreType, moreTypeId, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11, src12, src13, src14, src15, src16, src17, src18, src19, src20, src21, src22, src23, src24']
|
||||
);
|
||||
|
||||
@@ -79,8 +80,11 @@ class ItemList extends BaseType
|
||||
|
||||
// todo (med): information will get lost if one vendor sells one item multiple times with different costs (e.g. for item 54637)
|
||||
// wowhead seems to have had the same issues
|
||||
public function getExtendedCost($filter = [], &$reqRating = 0)
|
||||
public function getExtendedCost($filter = [], &$reqRating = [])
|
||||
{
|
||||
if ($this->error)
|
||||
return [];
|
||||
|
||||
if (empty($this->vendors))
|
||||
{
|
||||
$itemz = DB::World()->select('
|
||||
@@ -110,9 +114,10 @@ class ItemList extends BaseType
|
||||
$costs = $xCosts[$vInfo['extendedCost']];
|
||||
|
||||
$data = array(
|
||||
'stock' => $vInfo['maxcount'] ?: -1,
|
||||
'event' => $vInfo['eventId'],
|
||||
'reqRtg' => $costs ? $costs['reqPersonalRating'] : 0
|
||||
'stock' => $vInfo['maxcount'] ?: -1,
|
||||
'event' => $vInfo['eventId'],
|
||||
'reqRating' => $costs ? $costs['reqPersonalRating'] : 0,
|
||||
'reqBracket' => $costs ? $costs['reqArenaSlot'] : 0
|
||||
);
|
||||
|
||||
// hardcode arena(103) & honor(104)
|
||||
@@ -197,7 +202,7 @@ class ItemList extends BaseType
|
||||
|
||||
foreach ($result as $itemId => &$data)
|
||||
{
|
||||
$reqRating = 0;
|
||||
$reqRating = [];
|
||||
foreach ($data as $npcId => $costs)
|
||||
{
|
||||
if ($tok || $cur) // bought with specific token or currency
|
||||
@@ -218,13 +223,12 @@ class ItemList extends BaseType
|
||||
|
||||
// reqRating ins't really a cost .. so pass it by ref instead of return
|
||||
// use highest total value
|
||||
// note: how to distinguish between brackets .. or team/pers-rating?
|
||||
if (isset($data[$npcId]) && ($reqRating < $costs['reqRtg']))
|
||||
$reqRating = $costs['reqRtg'];
|
||||
if (isset($data[$npcId]) && $costs['reqRating'] && (!$reqRating || $reqRating[0] < $costs['reqRating']))
|
||||
$reqRating = [$costs['reqRating'], $costs['reqBracket']];
|
||||
}
|
||||
|
||||
if ($reqRating)
|
||||
$data['reqRating'] = $reqRating;
|
||||
$data['reqRating'] = $reqRating[0];
|
||||
|
||||
if (empty($data))
|
||||
unset($result[$itemId]);
|
||||
@@ -316,7 +320,7 @@ class ItemList extends BaseType
|
||||
if ($cost['event'])
|
||||
{
|
||||
$this->jsGlobals[TYPE_WORLDEVENT][$cost['event']] = $cost['event'];
|
||||
$row['condition'][0][$this->typeId][] = [[CND_ACTIVE_EVENT, $cost['event']]];
|
||||
$row['condition'][0][$this->id][] = [[CND_ACTIVE_EVENT, $cost['event']]];
|
||||
}
|
||||
|
||||
if ($currency || $tokens) // fill idx:3 if required
|
||||
@@ -382,6 +386,8 @@ class ItemList extends BaseType
|
||||
$data[$this->id]['source'] = array_keys($this->sources[$this->id]);
|
||||
if ($this->curTpl['moreType'] && $this->curTpl['moreTypeId'] && !empty($this->sourceMore[$this->curTpl['moreType']][$this->curTpl['moreTypeId']]))
|
||||
$data[$this->id]['sourcemore'] = [$this->sourceMore[$this->curTpl['moreType']][$this->curTpl['moreTypeId']]];
|
||||
else if (!empty($this->sources[$this->id][3]))
|
||||
$data[$this->id]['sourcemore'] = [['p' => $this->sources[$this->id][3][0]]];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -805,7 +811,7 @@ class ItemList extends BaseType
|
||||
|
||||
// required arena team rating / personal rating / todo (low): sort out what kind of rating
|
||||
if (!empty($this->getExtendedCost([], $reqRating)[$this->id]) && $reqRating)
|
||||
$x .= sprintf(Lang::item('reqRating'), $reqRating).'<br />';
|
||||
$x .= sprintf(Lang::item('reqRating', $reqRating[1]), $reqRating[0]).'<br />';
|
||||
|
||||
// item level
|
||||
if (in_array($_class, [ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON]))
|
||||
@@ -895,75 +901,77 @@ class ItemList extends BaseType
|
||||
|
||||
// Item Set
|
||||
$pieces = [];
|
||||
$condition = ['OR', ['item1', $this->id], ['item2', $this->id], ['item3', $this->id], ['item4', $this->id], ['item5', $this->id], ['item6', $this->id], ['item7', $this->id], ['item8', $this->id], ['item9', $this->id], ['item10', $this->id]];
|
||||
$itemset = new ItemsetList($condition);
|
||||
|
||||
if (!$itemset->error)
|
||||
if ($setId = $this->getField('itemset'))
|
||||
{
|
||||
$pieces = DB::Aowow()->select('
|
||||
SELECT b.id AS ARRAY_KEY, b.name_loc0, b.name_loc2, b.name_loc3, b.name_loc6, b.name_loc8, GROUP_CONCAT(a.id SEPARATOR \':\') AS equiv
|
||||
FROM ?_items a, ?_items b
|
||||
WHERE a.slotBak = b.slotBak AND a.itemset = b.itemset AND b.id IN (?a)
|
||||
GROUP BY b.id;',
|
||||
array_keys($itemset->pieceToSet)
|
||||
);
|
||||
|
||||
foreach ($pieces as $k => &$p)
|
||||
$p = '<span><!--si'.$p['equiv'].'--><a href="?item='.$k.'">'.Util::localizedString($p, 'name').'</a></span>';
|
||||
|
||||
$xSet = '<br /><span class="q"><a href="?itemset='.$itemset->id.'" class="q">'.$itemset->getField('name', true).'</a> (0/'.count($pieces).')</span>';
|
||||
|
||||
if ($skId = $itemset->getField('skillId')) // bonus requires skill to activate
|
||||
// while Ids can technically be used multiple times the only difference in data are the items used. So it doesn't matter what we get
|
||||
$itemset = new ItemsetList(array(['id', $setId]));
|
||||
if (!$itemset->error && $itemset->pieceToSet)
|
||||
{
|
||||
$xSet .= '<br />'.sprintf(Lang::game('requires'), '<a href="?skills='.$skId.'" class="q1">'.SkillList::getName($skId).'</a>');
|
||||
$pieces = DB::Aowow()->select('
|
||||
SELECT b.id AS ARRAY_KEY, b.name_loc0, b.name_loc2, b.name_loc3, b.name_loc6, b.name_loc8, GROUP_CONCAT(a.id SEPARATOR \':\') AS equiv
|
||||
FROM ?_items a, ?_items b
|
||||
WHERE a.slotBak = b.slotBak AND a.itemset = b.itemset AND b.id IN (?a)
|
||||
GROUP BY b.id;',
|
||||
array_keys($itemset->pieceToSet)
|
||||
);
|
||||
|
||||
if ($_ = $itemset->getField('skillLevel'))
|
||||
$xSet .= ' ('.$_.')';
|
||||
foreach ($pieces as $k => &$p)
|
||||
$p = '<span><!--si'.$p['equiv'].'--><a href="?item='.$k.'">'.Util::localizedString($p, 'name').'</a></span>';
|
||||
|
||||
$xSet .= '<br />';
|
||||
}
|
||||
$xSet = '<br /><span class="q"><a href="?itemset='.$itemset->id.'" class="q">'.$itemset->getField('name', true).'</a> (0/'.count($pieces).')</span>';
|
||||
|
||||
// list pieces
|
||||
$xSet .= '<div class="q0 indent">'.implode('<br />', $pieces).'</div><br />';
|
||||
|
||||
// get bonuses
|
||||
$setSpellsAndIdx = [];
|
||||
for ($j = 1; $j <= 8; $j++)
|
||||
if ($_ = $itemset->getField('spell'.$j))
|
||||
$setSpellsAndIdx[$_] = $j;
|
||||
|
||||
$setSpells = [];
|
||||
if ($setSpellsAndIdx)
|
||||
{
|
||||
$boni = new SpellList(array(['s.id', array_keys($setSpellsAndIdx)]));
|
||||
foreach ($boni->iterate() as $__)
|
||||
if ($skId = $itemset->getField('skillId')) // bonus requires skill to activate
|
||||
{
|
||||
$setSpells[] = array(
|
||||
'tooltip' => $boni->parseText('description', $_reqLvl > 1 ? $_reqLvl : MAX_LEVEL, false, $causesScaling)[0],
|
||||
'entry' => $itemset->getField('spell'.$setSpellsAndIdx[$boni->id]),
|
||||
'bonus' => $itemset->getField('bonus'.$setSpellsAndIdx[$boni->id])
|
||||
);
|
||||
}
|
||||
}
|
||||
$xSet .= '<br />'.sprintf(Lang::game('requires'), '<a href="?skills='.$skId.'" class="q1">'.SkillList::getName($skId).'</a>');
|
||||
|
||||
// sort and list bonuses
|
||||
$xSet .= '<span class="q0">';
|
||||
for ($i = 0; $i < count($setSpells); $i++)
|
||||
{
|
||||
for ($j = $i; $j < count($setSpells); $j++)
|
||||
{
|
||||
if ($setSpells[$j]['bonus'] >= $setSpells[$i]['bonus'])
|
||||
continue;
|
||||
if ($_ = $itemset->getField('skillLevel'))
|
||||
$xSet .= ' ('.$_.')';
|
||||
|
||||
$tmp = $setSpells[$i];
|
||||
$setSpells[$i] = $setSpells[$j];
|
||||
$setSpells[$j] = $tmp;
|
||||
}
|
||||
$xSet .= '<span>('.$setSpells[$i]['bonus'].') '.Lang::item('set').': <a href="?spell='.$setSpells[$i]['entry'].'">'.$setSpells[$i]['tooltip'].'</a></span>';
|
||||
if ($i < count($setSpells) - 1)
|
||||
$xSet .= '<br />';
|
||||
}
|
||||
|
||||
// list pieces
|
||||
$xSet .= '<div class="q0 indent">'.implode('<br />', $pieces).'</div><br />';
|
||||
|
||||
// get bonuses
|
||||
$setSpellsAndIdx = [];
|
||||
for ($j = 1; $j <= 8; $j++)
|
||||
if ($_ = $itemset->getField('spell'.$j))
|
||||
$setSpellsAndIdx[$_] = $j;
|
||||
|
||||
$setSpells = [];
|
||||
if ($setSpellsAndIdx)
|
||||
{
|
||||
$boni = new SpellList(array(['s.id', array_keys($setSpellsAndIdx)]));
|
||||
foreach ($boni->iterate() as $__)
|
||||
{
|
||||
$setSpells[] = array(
|
||||
'tooltip' => $boni->parseText('description', $_reqLvl > 1 ? $_reqLvl : MAX_LEVEL, false, $causesScaling)[0],
|
||||
'entry' => $itemset->getField('spell'.$setSpellsAndIdx[$boni->id]),
|
||||
'bonus' => $itemset->getField('bonus'.$setSpellsAndIdx[$boni->id])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// sort and list bonuses
|
||||
$xSet .= '<span class="q0">';
|
||||
for ($i = 0; $i < count($setSpells); $i++)
|
||||
{
|
||||
for ($j = $i; $j < count($setSpells); $j++)
|
||||
{
|
||||
if ($setSpells[$j]['bonus'] >= $setSpells[$i]['bonus'])
|
||||
continue;
|
||||
|
||||
$tmp = $setSpells[$i];
|
||||
$setSpells[$i] = $setSpells[$j];
|
||||
$setSpells[$j] = $tmp;
|
||||
}
|
||||
$xSet .= '<span>('.$setSpells[$i]['bonus'].') '.Lang::item('set').': <a href="?spell='.$setSpells[$i]['entry'].'">'.$setSpells[$i]['tooltip'].'</a></span>';
|
||||
if ($i < count($setSpells) - 1)
|
||||
$xSet .= '<br />';
|
||||
}
|
||||
$xSet .= '</span>';
|
||||
}
|
||||
$xSet .= '</span>';
|
||||
}
|
||||
|
||||
// recipes, vanity pets, mounts
|
||||
|
||||
@@ -6,10 +6,14 @@ if (!defined('AOWOW_REVISION'))
|
||||
|
||||
class SkillList extends BaseType
|
||||
{
|
||||
public static $type = TYPE_SKILL;
|
||||
public static $brickFile = 'skill';
|
||||
public static $type = TYPE_SKILL;
|
||||
public static $brickFile = 'skill';
|
||||
|
||||
protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_skillline sl';
|
||||
protected $queryBase = 'SELECT *, sl.id AS ARRAY_KEY FROM ?_skillline sl';
|
||||
protected $queryOpts = array(
|
||||
'sl' => [['si']],
|
||||
'si' => ['j' => '?_icons si ON si.id = sl.iconId', 's' => ', si.iconString'],
|
||||
);
|
||||
|
||||
public function __construct($conditions = [])
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ class SpellList extends BaseType
|
||||
'damage' => [ 0, 2, 3, 9, 62 ], // <no effect>, Dummy, School Damage, Health Leech, Power Burn
|
||||
'itemCreate' => [24, 34, 59, 66, 157 ], // createItem, changeItem, randomItem, createManaGem, createItem2
|
||||
'trigger' => [ 3, 32, 64, 101, 142, 148, 151, 152, 155, 160, 164], // dummy, trigger missile, trigger spell, feed pet, force cast, force cast with value, unk, trigger spell 2, unk, dualwield 2H, unk, remove aura
|
||||
'teach' => [36, 57, 133 ] // learn spell, learn pet spell, unlearn specialization
|
||||
'teach' => [36, 57, /*133*/ ] // learn spell, learn pet spell, /*unlearn specialization*/
|
||||
);
|
||||
public static $auras = array(
|
||||
'heal' => [ 4, 8, 62, 69, 97, 226 ], // Dummy, Periodic Heal, Periodic Health Funnel, School Absorb, Mana Shield, Periodic Dummy
|
||||
@@ -52,7 +52,9 @@ class SpellList extends BaseType
|
||||
|
||||
protected $queryBase = 'SELECT s.*, s.id AS ARRAY_KEY FROM ?_spell s';
|
||||
protected $queryOpts = array(
|
||||
's' => [['src', 'sr']], // 6: TYPE_SPELL
|
||||
's' => [['src', 'sr', 'si', 'si', 'sia']], // 6: TYPE_SPELL
|
||||
'si' => ['j' => ['?_icons si ON si.id = s.iconId', true], 's' => ', IFNULL (si.iconString, "inv_misc_questionmark") AS iconString'],
|
||||
'sia' => ['j' => ['?_icons sia ON sia.id = s.iconIdAlt', true], 's' => ', sia.iconString AS iconStringAlt'],
|
||||
'sr' => ['j' => ['?_spellrange sr ON sr.id = s.rangeId'], 's' => ', sr.rangeMinHostile, sr.rangeMinFriend, sr.rangeMaxHostile, sr.rangeMaxFriend, sr.name_loc0 AS rangeText_loc0, sr.name_loc2 AS rangeText_loc2, sr.name_loc3 AS rangeText_loc3, sr.name_loc6 AS rangeText_loc6, sr.name_loc8 AS rangeText_loc8'],
|
||||
'src' => ['j' => ['?_source src ON type = 6 AND typeId = s.id', true], 's' => ', src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11, src12, src13, src14, src15, src16, src17, src18, src19, src20, src21, src22, src23, src24']
|
||||
);
|
||||
@@ -136,7 +138,7 @@ class SpellList extends BaseType
|
||||
}
|
||||
// end static use
|
||||
|
||||
// required for itemSet-bonuses and socket-bonuses
|
||||
// required for item-comparison
|
||||
public function getStatGain()
|
||||
{
|
||||
$data = [];
|
||||
@@ -154,8 +156,8 @@ class SpellList extends BaseType
|
||||
// Enchant Item Permanent (53) / Temporary (54)
|
||||
if (in_array($this->curTpl['effect'.$i.'Id'], [53, 54]))
|
||||
{
|
||||
if ($mv)
|
||||
Util::arraySumByKey($stats, Util::parseItemEnchantment($mv, true));
|
||||
if ($mv && ($_ = Util::parseItemEnchantment($mv, true)))
|
||||
Util::arraySumByKey($stats, $_[$mv]);
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -523,14 +525,9 @@ class SpellList extends BaseType
|
||||
$str = '';
|
||||
|
||||
// check for custom PowerDisplay
|
||||
$pt = $this->curTpl['powerDisplayString'] ? $this->curTpl['powerDisplayString'] : $this->curTpl['powerType'];
|
||||
$pt = $this->curTpl['powerType'];
|
||||
|
||||
// power cost: pct over static
|
||||
if ($this->curTpl['powerCostPercent'] > 0)
|
||||
$str .= $this->curTpl['powerCostPercent']."% ".sprintf(Lang::spell('pctCostOf'), strtolower(Lang::spell('powerTypes', $pt)));
|
||||
else if ($this->curTpl['powerCost'] > 0 || $this->curTpl['powerPerSecond'] > 0 || $this->curTpl['powerCostPerLevel'] > 0)
|
||||
$str .= ($pt == POWER_RAGE || $pt == POWER_RUNIC_POWER ? $this->curTpl['powerCost'] / 10 : $this->curTpl['powerCost']).' '.Util::ucFirst(Lang::spell('powerTypes', $pt));
|
||||
else if ($rCost = ($this->curTpl['powerCostRunes'] & 0x333))
|
||||
if ($pt == POWER_RUNE && ($rCost = ($this->curTpl['powerCostRunes'] & 0x333)))
|
||||
{ // Blood 2|1 - Unholy 2|1 - Frost 2|1
|
||||
$runes = [];
|
||||
if ($_ = (($rCost & 0x300) >> 8))
|
||||
@@ -542,6 +539,10 @@ class SpellList extends BaseType
|
||||
|
||||
$str .= implode(', ', $runes);
|
||||
}
|
||||
else if ($this->curTpl['powerCostPercent'] > 0) // power cost: pct over static
|
||||
$str .= $this->curTpl['powerCostPercent']."% ".sprintf(Lang::spell('pctCostOf'), strtolower(Lang::spell('powerTypes', $pt)));
|
||||
else if ($this->curTpl['powerCost'] > 0 || $this->curTpl['powerPerSecond'] > 0 || $this->curTpl['powerCostPerLevel'] > 0)
|
||||
$str .= ($pt == POWER_RAGE || $pt == POWER_RUNIC_POWER ? $this->curTpl['powerCost'] / 10 : $this->curTpl['powerCost']).' '.Util::ucFirst(Lang::spell('powerTypes', $pt));
|
||||
|
||||
// append periodic cost
|
||||
if ($this->curTpl['powerPerSecond'] > 0)
|
||||
@@ -556,7 +557,7 @@ class SpellList extends BaseType
|
||||
|
||||
public function createCastTimeForCurrent($short = true, $noInstant = true)
|
||||
{
|
||||
if ($this->curTpl['interruptFlagsChannel'])
|
||||
if ($this->isChanneledSpell())
|
||||
return Lang::spell('channeled');
|
||||
else if ($this->curTpl['castTime'] > 0)
|
||||
return $short ? sprintf(Lang::spell('castIn'), $this->curTpl['castTime'] / 1000) : Util::formatTime($this->curTpl['castTime']);
|
||||
@@ -683,10 +684,8 @@ class SpellList extends BaseType
|
||||
{
|
||||
// see Traits in javascript locales
|
||||
|
||||
// if (character level is set manually (profiler only))
|
||||
// $pl = $PL = $this->charLevel;
|
||||
|
||||
$PlayerName = Lang::main('name');
|
||||
$pl = $PL = /* playerLevel set manually ? $this->charLevel : */ $this->interactive ? sprintf(Util::$dfnString, 'LANG.level', Lang::game('level')) : Lang::game('level');
|
||||
$ap = $AP = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.atkpwr[0]', Lang::spell('traitShort', 'atkpwr')) : Lang::spell('traitShort', 'atkpwr');
|
||||
$rap = $RAP = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.rgdatkpwr[0]', Lang::spell('traitShort', 'rgdatkpwr')) : Lang::spell('traitShort', 'rgdatkpwr');
|
||||
$sp = $SP = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.splpwr[0]', Lang::spell('traitShort', 'splpwr')) : Lang::spell('traitShort', 'splpwr');
|
||||
@@ -698,6 +697,17 @@ class SpellList extends BaseType
|
||||
$sps = $SPS = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.shasplpwr[0]', Lang::spell('traitShort', 'shasplpwr')) : Lang::spell('traitShort', 'shasplpwr');
|
||||
$bh = $BH = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.splheal[0]', Lang::spell('traitShort', 'splheal')) : Lang::spell('traitShort', 'splheal');
|
||||
|
||||
// only 'ron test spell', guess its %-dmg mod; no idea what bc2 might be
|
||||
$pa = '<$PctArcane>'; // %arcane
|
||||
$pfi = '<$PctFire>'; // %fire
|
||||
$pfr = '<$PctFrost>'; // %frost
|
||||
$ph = '<$PctHoly>'; // %holy
|
||||
$pn = '<$PctNature>'; // %nature
|
||||
$ps = '<$PctShadow>'; // %shadow
|
||||
$pbh = '<$PctHeal>'; // %heal
|
||||
$pbhd = '<$PctHealDone>'; // %heal done
|
||||
$bc2 = '<$bc2>'; // bc2
|
||||
|
||||
$HND = $hnd = $this->interactive ? sprintf(Util::$dfnString, '[Hands required by weapon]', 'HND') : 'HND'; // todo (med): localize this one
|
||||
$MWS = $mws = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.mlespeed[0]', 'MWS') : 'MWS';
|
||||
$mw = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.dmgmin1[0]', 'mw') : 'mw';
|
||||
@@ -715,17 +725,25 @@ class SpellList extends BaseType
|
||||
$max = $MAX = function($a, $b) { return max($a, $b); };
|
||||
$min = $MIN = function($a, $b) { return min($a, $b); };
|
||||
|
||||
if (preg_match_all('/\$[a-z]+\b/i', $formula, $vars))
|
||||
if (preg_match_all('/\$\w+\b/i', $formula, $vars))
|
||||
{
|
||||
|
||||
$evalable = true;
|
||||
|
||||
foreach ($vars[0] as $var) // oh lord, forgive me this sin .. but is_callable seems to bug out and function_exists doesn't find lambda-functions >.<
|
||||
{
|
||||
$eval = eval('return @'.$var.';'); // attention: error suppression active here
|
||||
if (getType($eval) == 'object')
|
||||
continue;
|
||||
else if (is_numeric($eval))
|
||||
continue;
|
||||
$var = substr($var, 1);
|
||||
|
||||
if (isset($$var))
|
||||
{
|
||||
$eval = eval('return @$'.$var.';'); // attention: error suppression active here (will be logged anyway)
|
||||
if (getType($eval) == 'object')
|
||||
continue;
|
||||
else if (is_numeric($eval))
|
||||
continue;
|
||||
}
|
||||
else
|
||||
$$var = '<UNK: $'.$var.'>';
|
||||
|
||||
$evalable = false;
|
||||
break;
|
||||
@@ -1456,8 +1474,9 @@ Lasts 5 min. $?$gte($pl,68)[][Cannot be used on items level 138 and higher.]
|
||||
$x .= '<td><b class="q">'.$this->getField('name', true).'</b></td>';
|
||||
|
||||
// dispelType (if applicable)
|
||||
if ($dispel = Lang::game('dt', $this->curTpl['dispelType']))
|
||||
$x .= '<th><b class="q">'.$dispel.'</b></th>';
|
||||
if ($this->curTpl['dispelType'])
|
||||
if ($dispel = Lang::game('dt', $this->curTpl['dispelType']))
|
||||
$x .= '<th><b class="q">'.$dispel.'</b></th>';
|
||||
|
||||
$x .= '</tr></table>';
|
||||
|
||||
@@ -1672,8 +1691,16 @@ Lasts 5 min. $?$gte($pl,68)[][Cannot be used on items level 138 and higher.]
|
||||
$grn = (int)(($ylw + $gry) / 2);
|
||||
$org = $this->curTpl['learnedAt'];
|
||||
|
||||
if ($ylw > 1)
|
||||
return [$org, $ylw, $grn, $gry];
|
||||
if (($org && $ylw < $org) || $ylw >= $gry)
|
||||
$ylw = 0;
|
||||
|
||||
if (($org && $grn < $org) || $grn >= $gry)
|
||||
$grn = 0;
|
||||
|
||||
if (($grn && $org >= $grn) || $org >= $gry)
|
||||
$org = 0;
|
||||
|
||||
return $gry > 1 ? [$org, $ylw, $grn, $gry] : null;
|
||||
}
|
||||
|
||||
public function getListviewData($addInfoMask = 0x0)
|
||||
@@ -1691,7 +1718,7 @@ Lasts 5 min. $?$gte($pl,68)[][Cannot be used on items level 138 and higher.]
|
||||
$data[$this->id] = array(
|
||||
'id' => $this->id,
|
||||
'name' => ($quality ?: '@').$this->getField('name', true),
|
||||
'icon' => $this->curTpl['iconStringAlt'] ? $this->curTpl['iconStringAlt'] : $this->curTpl['iconString'],
|
||||
'icon' => $this->curTpl['iconStringAlt'] ?: $this->curTpl['iconString'],
|
||||
'level' => $talent ? $this->curTpl['talentLevel'] : $this->curTpl['spellLevel'],
|
||||
'school' => $this->curTpl['schoolMask'],
|
||||
'cat' => $this->curTpl['typeCat'],
|
||||
@@ -1703,8 +1730,12 @@ Lasts 5 min. $?$gte($pl,68)[][Cannot be used on items level 138 and higher.]
|
||||
);
|
||||
|
||||
// Sources
|
||||
if (!empty($this->sources[$this->id]) && ($s = $this->sources[$this->id]))
|
||||
$data[$this->id]['source'] = array_keys($s);
|
||||
if (!empty($this->sources[$this->id]))
|
||||
{
|
||||
$data[$this->id]['source'] = array_keys($this->sources[$this->id]);
|
||||
if (!empty($this->sources[$this->id][3]))
|
||||
$data[$this->id]['sourcemore'] = [['p' => $this->sources[$this->id][3][0]]];
|
||||
}
|
||||
|
||||
// Proficiencies
|
||||
if ($this->curTpl['typeCat'] == -11)
|
||||
@@ -1937,9 +1968,9 @@ class SpellListFilter extends Filter
|
||||
5 => [FILTER_CR_BOOLEAN, 'reqSpellId' ], // requiresprofspec
|
||||
10 => [FILTER_CR_FLAG, 'cuFlags', SPELL_CU_FIRST_RANK ], // firstrank
|
||||
12 => [FILTER_CR_FLAG, 'cuFlags', SPELL_CU_LAST_RANK ], // lastrank
|
||||
13 => [FILTER_CR_NUMERIC, 'rankId', ], // rankno
|
||||
13 => [FILTER_CR_NUMERIC, 'rankNo', ], // rankno
|
||||
14 => [FILTER_CR_NUMERIC, 'id', null, true], // id
|
||||
15 => [FILTER_CR_STRING, 'iconString', ], // icon
|
||||
15 => [FILTER_CR_STRING, 'si.iconString', ], // icon
|
||||
19 => [FILTER_CR_FLAG, 'attributes0', 0x80000 ], // scaling
|
||||
25 => [FILTER_CR_BOOLEAN, 'skillLevelYellow' ], // rewardsskillups
|
||||
11 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_COMMENT ], // hascomments
|
||||
|
||||
@@ -16,7 +16,7 @@ class TitleList extends BaseType
|
||||
protected $queryBase = 'SELECT t.*, id AS ARRAY_KEY FROM ?_titles t';
|
||||
protected $queryOpts = array(
|
||||
't' => [['src']], // 11: TYPE_TITLE
|
||||
'src' => ['j' => ['?_source src ON type = 11 AND typeId = t.id', true], 's' => ', src3, moreType, moreTypeId']
|
||||
'src' => ['j' => ['?_source src ON type = 11 AND typeId = t.id', true], 's' => ', src13, moreType, moreTypeId']
|
||||
);
|
||||
|
||||
public function __construct($conditions = [])
|
||||
@@ -31,8 +31,8 @@ class TitleList extends BaseType
|
||||
$this->sources[$this->id][12][] = $_curTpl['moreTypeId'];
|
||||
else if ($_curTpl['moreType'] == TYPE_QUEST)
|
||||
$this->sources[$this->id][4][] = $_curTpl['moreTypeId'];
|
||||
else if ($_curTpl['src3'])
|
||||
$this->sources[$this->id][3][] = $_curTpl['src3'];
|
||||
else if ($_curTpl['src13'])
|
||||
$this->sources[$this->id][13][] = $_curTpl['src13'];
|
||||
|
||||
// titles display up to two achievements at once
|
||||
if ($_curTpl['src12Ext'])
|
||||
@@ -60,7 +60,7 @@ class TitleList extends BaseType
|
||||
$data[$this->id] = array(
|
||||
'id' => $this->id,
|
||||
'name' => $this->getField('male', true),
|
||||
'namefemale' => $this->getField('namefemale', true),
|
||||
'namefemale' => $this->getField('female', true),
|
||||
'side' => $this->curTpl['side'],
|
||||
'gender' => $this->curTpl['gender'],
|
||||
'expansion' => $this->curTpl['expansion'],
|
||||
|
||||
@@ -6,11 +6,50 @@ if (!defined('AOWOW_REVISION'))
|
||||
|
||||
class ZoneList extends BaseType
|
||||
{
|
||||
use listviewHelper;
|
||||
|
||||
public static $type = TYPE_ZONE;
|
||||
public static $brickFile = 'zone';
|
||||
|
||||
protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_zones z';
|
||||
|
||||
public function __construct($conditions = [], $miscData = null)
|
||||
{
|
||||
parent::__construct($conditions, $miscData);
|
||||
|
||||
foreach ($this->iterate() as &$_curTpl)
|
||||
{
|
||||
// unpack attunements
|
||||
$_curTpl['attunes'] = [];
|
||||
|
||||
if ($_curTpl['attunementsN'])
|
||||
{
|
||||
foreach (explode(' ', $_curTpl['attunementsN']) as $req)
|
||||
{
|
||||
$req = explode(':', $req);
|
||||
if (!isset($_curTpl['attunes'][$req[0]]))
|
||||
$_curTpl['attunes'][$req[0]] = [$req[1]];
|
||||
else
|
||||
$_curTpl['attunes'][$req[0]][] = $req[1];
|
||||
}
|
||||
}
|
||||
if ($_curTpl['attunementsH'])
|
||||
{
|
||||
foreach (explode(' ', $_curTpl['attunementsH']) as $req)
|
||||
{
|
||||
$req = explode(':', $req);
|
||||
if (!isset($_curTpl['attunes'][$req[0]]))
|
||||
$_curTpl['attunes'][$req[0]] = [-$req[1]];
|
||||
else
|
||||
$_curTpl['attunes'][$req[0]][] = -$req[1];
|
||||
}
|
||||
}
|
||||
|
||||
unset($_curTpl['attunementsN']);
|
||||
unset($_curTpl['attunementsH']);
|
||||
}
|
||||
}
|
||||
|
||||
// use if you JUST need the name
|
||||
public static function getName($id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user