mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Filters:
- make offset optional, when converting list to mask Items: - fixed display of inventory type for robes and ranged weapons Spells: - parsing: $charLevel and $interactive are now properties of spell. - parsing: fixed durations, passing the time-unit seperately to allow for evaluation of the actual value - parsing: fixed gender-specific formating [ >male/female< to <male/female>] - parsing: usage of is_numeric() instead of (float) as 0 is a fucking valid numeric (caused some formulas to not be evaluated *grrr*) - parsing: lastValue-references now skip to the next previous \d instead of being stopped by random \w (like time units) - implemented forgotten display of runes for spellCost - fixed castTimes for most hunter shots (they are -1000 for some reason) - fixed display of required stances (sometimes they are not actually required but show, when you are _allowed_ to use a spell in certain forms) - improved formating of tooltips-js (no visual change) ListViews: - pass '_truncated' separately. there are nough cases in which 'note' gets send without truncated results misc changes here and there
This commit is contained in:
@@ -206,17 +206,18 @@ abstract class Filter
|
||||
}
|
||||
}
|
||||
|
||||
protected function list2Mask($list)
|
||||
protected function list2Mask($list, $noOffset = false)
|
||||
{
|
||||
$mask = 0x0;
|
||||
$o = $noOffset ? 0 : 1; // schoolMask requires this..?
|
||||
|
||||
if (is_array($list))
|
||||
{
|
||||
foreach ($list as $itm)
|
||||
$mask += (1 << intVal($itm));
|
||||
$mask += (1 << (intVal($itm) - $o));
|
||||
}
|
||||
else
|
||||
$mask = (1 << intVal($list));
|
||||
$mask = (1 << (intVal($list) - $o));
|
||||
|
||||
return $mask;
|
||||
}
|
||||
@@ -233,6 +234,9 @@ abstract class Filter
|
||||
header('Location: http://'.$_SERVER['SERVER_NAME'].str_replace('index.php', '', $_SERVER['PHP_SELF']).'?'.$_SERVER['QUERY_STRING'].'='.$get);
|
||||
}
|
||||
|
||||
|
||||
// TODO: wrong wrong wrong!!
|
||||
// 1) filter-Ids are different for each type; 2) (NOT) IN - subqueries will eat the mysql-server alive!
|
||||
protected function createSQLForCommunity($cr)
|
||||
{
|
||||
switch ($cr[0])
|
||||
|
||||
@@ -558,7 +558,7 @@ class ItemList extends BaseType
|
||||
|
||||
if ($itemSpellsAndTrigger)
|
||||
{
|
||||
$itemSpells = new SpellList(array(['id', array_keys($itemSpellsAndTrigger)]));
|
||||
$itemSpells = new SpellList(array(['s.id', array_keys($itemSpellsAndTrigger)]));
|
||||
while ($itemSpells->iterate())
|
||||
if ($parsed = $itemSpells->parseText('description', $this->curTpl['RequiredLevel']))
|
||||
$green[] = Lang::$item['trigger'][$itemSpellsAndTrigger[$itemSpells->id]].$parsed;
|
||||
@@ -622,7 +622,7 @@ class ItemList extends BaseType
|
||||
// todo: get from static prop?
|
||||
if ($setSpellsAndIdx)
|
||||
{
|
||||
$boni = new SpellList(array(['id', array_keys($setSpellsAndIdx)]));
|
||||
$boni = new SpellList(array(['s.id', array_keys($setSpellsAndIdx)]));
|
||||
while ($boni->iterate())
|
||||
{
|
||||
$itemset['spells'][] = array(
|
||||
@@ -656,7 +656,7 @@ class ItemList extends BaseType
|
||||
// recipe handling (some stray Techniques have subclass == 0), place at bottom of tooltipp
|
||||
if ($this->curTpl['class'] == ITEM_CLASS_RECIPE && ($this->curTpl['subclass'] || $this->curTpl['BagFamily'] == 16))
|
||||
{
|
||||
$craftSpell = new SpellList(array(['id', (int)$this->curTpl['spellid_2']]));
|
||||
$craftSpell = new SpellList(array(['s.id', (int)$this->curTpl['spellid_2']]));
|
||||
$craftItem = new ItemList(array(['i.entry', (int)$craftSpell->curTpl["effect1CreateItemId"]]));
|
||||
$reagentItems = [];
|
||||
|
||||
@@ -830,7 +830,7 @@ class ItemList extends BaseType
|
||||
|
||||
if ($equipSpells)
|
||||
{
|
||||
$eqpSplList = new SpellList(array(['id', $equipSpells]));
|
||||
$eqpSplList = new SpellList(array(['s.id', $equipSpells]));
|
||||
$stats = $eqpSplList->getStatGain();
|
||||
|
||||
foreach ($stats as $stat)
|
||||
@@ -1008,7 +1008,7 @@ class ItemList extends BaseType
|
||||
// 'subsubclass' => $this->curTpl['subsubclass'],
|
||||
'heroic' => (string)($this->curTpl['Flags'] & 0x8),
|
||||
'side' => Util::sideByRaceMask($this->curTpl['AllowableRace']), // check for FlagsExtra? 0:both; 1: Horde; 2:Alliance
|
||||
'slot' => $this->curTpl['InventoryType'],
|
||||
'slot' => $this->curTpl['InventoryType'] == 26 ? 15 : $this->curTpl['InventoryType'] == 20 ? 5 : $this->curTpl['InventoryType'],
|
||||
'slotbak' => $this->curTpl['InventoryType'],
|
||||
'level' => $this->curTpl['ItemLevel'],
|
||||
'reqlevel' => $this->curTpl['RequiredLevel'],
|
||||
|
||||
@@ -7,7 +7,7 @@ class PetList extends BaseType
|
||||
{
|
||||
use ListviewHelper;
|
||||
|
||||
protected $setupQuery = 'SELECT *, type as category, id AS ARRAY_KEY FROM ?_pet WHERE [cond] ORDER BY Id ASC';
|
||||
protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM ?_pet WHERE [cond] ORDER BY Id ASC';
|
||||
protected $matchQuery = 'SELECT COUNT(1) FROM ?_pet WHERE [cond]';
|
||||
|
||||
public function getListviewData()
|
||||
@@ -53,7 +53,7 @@ class PetList extends BaseType
|
||||
$gathered[] = (int)$this->curTpl['spellId'.$i];
|
||||
|
||||
if ($gathered)
|
||||
(new SpellList(array(['id', $gathered])))->addGlobalsToJscript($refs);
|
||||
(new SpellList(array(['s.id', $gathered])))->addGlobalsToJscript($refs);
|
||||
}
|
||||
|
||||
public function addRewardsToJScript(&$ref) { }
|
||||
|
||||
@@ -161,7 +161,7 @@ class QuestList extends BaseType
|
||||
(new ItemList(array(['i.entry', $items])))->addGlobalsToJscript($refs);
|
||||
|
||||
if ($spells)
|
||||
(new SpellList(array(['id', $spells])))->addGlobalsToJscript($refs);
|
||||
(new SpellList(array(['s.id', $spells])))->addGlobalsToJscript($refs);
|
||||
|
||||
if ($titles)
|
||||
(new TitleList(array(['id', $titles])))->addGlobalsToJscript($refs);
|
||||
|
||||
@@ -5,14 +5,16 @@ if (!defined('AOWOW_REVISION'))
|
||||
|
||||
class SpellList extends BaseType
|
||||
{
|
||||
public $tooltips = [];
|
||||
public $buffs = [];
|
||||
public $tooltips = [];
|
||||
public $buffs = [];
|
||||
|
||||
private $spellVars = [];
|
||||
private $refSpells = [];
|
||||
private $spellVars = [];
|
||||
private $refSpells = [];
|
||||
private $interactive = false;
|
||||
private $charLevel = MAX_LEVEL;
|
||||
|
||||
protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM ?_spell WHERE [filter] [cond] GROUP BY Id ORDER BY Id ASC';
|
||||
protected $matchQuery = 'SELECT COUNT(1) FROM ?_spell WHERE [filter] [cond]';
|
||||
protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM ?_spell s WHERE [filter] [cond] GROUP BY Id ORDER BY Id ASC';
|
||||
protected $matchQuery = 'SELECT COUNT(1) FROM ?_spell s WHERE [filter] [cond]';
|
||||
|
||||
public function __construct($conditions, $applyFilter = false)
|
||||
{
|
||||
@@ -226,11 +228,11 @@ class SpellList extends BaseType
|
||||
}
|
||||
|
||||
// description-, buff-parsing component
|
||||
private function resolveEvaluation($formula, $level)
|
||||
private function resolveEvaluation($formula)
|
||||
{
|
||||
// todo: define unresolvable texts like AP, MHW, ect
|
||||
|
||||
$pl = $PL = $level;
|
||||
$pl = $PL = $this->charLevel;
|
||||
$PlayerName = Lang::$main['name'];
|
||||
$cond = $COND = function($a, $b, $c) { return $a ? $b : $c; };
|
||||
$eq = $EQ = function($a, $b) { return $a == $b; };
|
||||
@@ -251,7 +253,7 @@ class SpellList extends BaseType
|
||||
}
|
||||
|
||||
// description-, buff-parsing component
|
||||
private function resolveVariableString($variable, $level, $interactive)
|
||||
private function resolveVariableString($variable)
|
||||
{
|
||||
$signs = ['+', '-', '/', '*', '%', '^'];
|
||||
|
||||
@@ -270,7 +272,7 @@ class SpellList extends BaseType
|
||||
|
||||
// cache at least some lookups.. should be moved to single spellList :/
|
||||
if ($lookup && !isset($this->refSpells[$lookup]))
|
||||
$this->refSpells[$lookup] = new SpellList(array(['id', $lookup]));
|
||||
$this->refSpells[$lookup] = new SpellList(array(['s.id', $lookup]));
|
||||
|
||||
switch ($var)
|
||||
{
|
||||
@@ -296,45 +298,6 @@ class SpellList extends BaseType
|
||||
eval("\$base = $base $op $oparg;");
|
||||
|
||||
return $base;
|
||||
/* where the heck is this var...?
|
||||
case 'c': // BasePoints (raw)
|
||||
if ($lookup > 0 && $exprData[0])
|
||||
$spell = DB::Aowow()->selectRow('SELECT effect'.$exprData[0].'BasePoints, effect'.$exprData[0].'AuraId, effect'.$exprData[0].'MiscValue FROM ?_spell WHERE id=? LIMIT 1', $lookup);
|
||||
else
|
||||
$spell = $this->curTpl;
|
||||
|
||||
$base = $spell['effect'.$exprData[0].'BasePoints'] + 1;
|
||||
|
||||
if (in_array($op, $signs) && is_numeric($oparg) && is_numeric($base))
|
||||
eval("\$base = $base $op $oparg;");
|
||||
|
||||
// Aura giving combat ratings (click-interactive)
|
||||
$rType = 0;
|
||||
if ($spell['effect'.$exprData[0].'AuraId'] == 189)
|
||||
{
|
||||
$mv = $spell['effect'.$exprData[0].'MiscValue'];
|
||||
for ($j = 0; $j < count(Util::$combatRatingToItemMod); $j++)
|
||||
{
|
||||
if (!Util::$combatRatingToItemMod[$j])
|
||||
continue;
|
||||
|
||||
if (($mv & (1 << $j)) == 0)
|
||||
continue;
|
||||
|
||||
$rType = Util::$combatRatingToItemMod[$j];
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Aura end
|
||||
|
||||
if ($rType && $interactive)
|
||||
$str .= '<!--rtg'.$rType.'-->'.$base." <small>(".Util::setRatingLevel($level, $rType, $base).")</small>";
|
||||
else
|
||||
$str .= $base;
|
||||
|
||||
$lastvalue = $base;
|
||||
break;
|
||||
*/
|
||||
case 'd': // SpellDuration
|
||||
case 'D': // todo: min/max?
|
||||
if ($lookup)
|
||||
@@ -348,7 +311,7 @@ class SpellList extends BaseType
|
||||
if ($op && is_numeric($oparg) && is_numeric($base))
|
||||
eval("\$base = $base $op $oparg;");
|
||||
|
||||
return Util::formatTime(abs($base), true);
|
||||
return explode(' ', Util::formatTime(abs($base), true));
|
||||
case 'e': // EffectValueMultiplier
|
||||
case 'E':
|
||||
if ($lookup)
|
||||
@@ -373,7 +336,7 @@ class SpellList extends BaseType
|
||||
return $base;
|
||||
case 'g': // boolean choice with casters gender as condition $gX:Y;
|
||||
case 'G':
|
||||
return '>'.$switch[0].'/'.$switch[1].'<';
|
||||
return '<'.$switch[0].'/'.$switch[1].'>';
|
||||
case 'h': // ProcChance
|
||||
case 'H':
|
||||
if ($lookup)
|
||||
@@ -443,8 +406,8 @@ class SpellList extends BaseType
|
||||
}
|
||||
// Aura end
|
||||
|
||||
if ($rType && $interactive)
|
||||
return '<!--rtg'.$rType.'-->'.abs($base)." <small>(".Util::setRatingLevel($level, $rType, abs($base)).")</small>";
|
||||
if ($rType && $this->interactive)
|
||||
return '<!--rtg'.$rType.'-->'.abs($base)." <small>(".Util::setRatingLevel($this->charLevel, $rType, abs($base)).")</small>";
|
||||
else
|
||||
return $base;
|
||||
case 'n': // ProcCharges
|
||||
@@ -553,8 +516,8 @@ class SpellList extends BaseType
|
||||
}
|
||||
// Aura end
|
||||
|
||||
if ($rType && $equal && $interactive)
|
||||
return '<!--rtg'.$rType.'-->'.$min." <small>(".Util::setRatingLevel($level, $rType, $min).")</small>";
|
||||
if ($rType && $equal && $this->interactive)
|
||||
return '<!--rtg'.$rType.'-->'.$min." <small>(".Util::setRatingLevel($this->charLevel, $rType, $min).")</small>";
|
||||
else
|
||||
return $min . (!$equal ? Lang::$game['valueDelim'] . $max : null);
|
||||
case 't': // Periode
|
||||
@@ -607,7 +570,7 @@ class SpellList extends BaseType
|
||||
}
|
||||
|
||||
// description-, buff-parsing component
|
||||
private function resolveFormulaString($formula, $precision = 0, $level, $interactive)
|
||||
private function resolveFormulaString($formula, $precision = 0)
|
||||
{
|
||||
// step 1: formula unpacking redux
|
||||
while (($formStartPos = strpos($formula, '${')) !== false)
|
||||
@@ -643,14 +606,15 @@ class SpellList extends BaseType
|
||||
++$formCurPos; // for some odd reason the precision decimal survives if wo dont increment further..
|
||||
}
|
||||
|
||||
$formOutStr = $this->resolveFormulaString($formOutStr, $formPrecision, $level, $interactive);
|
||||
$formOutStr = $this->resolveFormulaString($formOutStr, $formPrecision)
|
||||
|
||||
$formula = substr_replace($formula, $formOutStr, $formStartPos, ($formCurPos - $formStartPos));
|
||||
}
|
||||
|
||||
// step 2: resolve variables
|
||||
$pos = 0; // continue strpos-search from this offset
|
||||
$str = '';
|
||||
$pos = 0; // continue strpos-search from this offset
|
||||
$str = '';
|
||||
$suffix = '';
|
||||
while (($npos = strpos($formula, '$', $pos)) !== false)
|
||||
{
|
||||
if ($npos != $pos)
|
||||
@@ -667,15 +631,24 @@ class SpellList extends BaseType
|
||||
continue;
|
||||
}
|
||||
$pos += strlen($result[0]);
|
||||
$str .= $this->resolveVariableString($result, $level, $interactive);
|
||||
|
||||
$var = $this->resolveVariableString($result);
|
||||
if (is_array($var))
|
||||
{
|
||||
$str .= $var[0];
|
||||
$suffix = $var[1];
|
||||
}
|
||||
else
|
||||
$str .= $var;
|
||||
}
|
||||
$str .= substr($formula, $pos);
|
||||
$str = str_replace('#', '$', $str); // reset marks
|
||||
|
||||
// step 3: try to evaluate result
|
||||
$evaled = $this->resolveEvaluation($str, $level);
|
||||
$evaled = $this->resolveEvaluation($str);
|
||||
|
||||
return (float)$evaled ? number_format($evaled, $precision) : $evaled;
|
||||
$return = is_numeric($evaled) ? number_format($evaled, $precision) : $evaled;
|
||||
return $return.' '.$suffix;
|
||||
}
|
||||
|
||||
// should probably used only once to create ?_spell. come to think of it, it yields the same results every time.. it absolutely has to!
|
||||
@@ -755,6 +728,8 @@ class SpellList extends BaseType
|
||||
$gt(a, b) - a > b
|
||||
*/
|
||||
|
||||
$this->interactive = $interactive;
|
||||
$this->charLevel = $level;
|
||||
|
||||
// step 0: get text
|
||||
$data = Util::localizedString($this->curTpl, $type);
|
||||
@@ -898,15 +873,15 @@ class SpellList extends BaseType
|
||||
$formCurPos++;
|
||||
}
|
||||
|
||||
// check for precision-modifiers .. yes, the precrements fullfill a role!
|
||||
if ($formCurPos + 2 < strlen($data) && $data[++$formCurPos] == '.')
|
||||
if ($prec = $data[++$formCurPos])
|
||||
{
|
||||
$formPrecision = (int)$prec;
|
||||
++$formCurPos; // for some odd reason the precision decimal survives if wo dont increment further..
|
||||
}
|
||||
$formCurPos++;
|
||||
|
||||
$formOutStr = $this->resolveFormulaString($formOutStr, $formPrecision, $level, $interactive);
|
||||
// check for precision-modifiers
|
||||
if ($formCurPos + 1 < strlen($data) && $data[$formCurPos] == '.' && is_numeric($data[$formCurPos + 1]))
|
||||
{
|
||||
$formPrecision = $data[$formCurPos + 1];
|
||||
$formCurPos += 2;
|
||||
}
|
||||
$formOutStr = $this->resolveFormulaString($formOutStr, $formPrecision);
|
||||
|
||||
$data = substr_replace($data, $formOutStr, $formStartPos, ($formCurPos - $formStartPos));
|
||||
}
|
||||
@@ -933,16 +908,19 @@ class SpellList extends BaseType
|
||||
|
||||
$pos += strlen($result[0]);
|
||||
|
||||
$resolved = $this->resolveVariableString($result, $level, $interactive);
|
||||
$var = $this->resolveVariableString($result);
|
||||
$resolved = is_array($var) ? $var[0] : $var;
|
||||
$str .= is_numeric($resolved) ? abs($resolved) : $resolved;
|
||||
if (is_array($var))
|
||||
$str .= ' '.$var[1];
|
||||
}
|
||||
$str .= substr($data, $pos);
|
||||
$str = str_replace('#', '$', $str); // reset marks
|
||||
|
||||
// step 5: variable-depentant variable-text
|
||||
// special case $lONE:ELSE;
|
||||
while (preg_match('/([\d\.]+) \$l([\w\s]*):([\w\s]*);/i', $str, $m))
|
||||
$str = str_replace($m[1].' $l'.$m[2].':'.$m[3].';', $m[1].' '.($m[1] == 1 ? $m[2] : $m[3]), $str);
|
||||
while (preg_match('/([\d\.]+)([^\d]*)\$l([\w\s]*):([\w\s]*);/i', $str, $m))
|
||||
$str = str_replace($m[1].$m[2].'$l'.$m[3].':'.$m[4].';', $m[1].$m[2].($m[1] == 1 ? $m[3] : $m[4]), $str);
|
||||
|
||||
// step 6: HTMLize
|
||||
// colors
|
||||
@@ -1035,7 +1013,7 @@ class SpellList extends BaseType
|
||||
// get description
|
||||
$desc = $this->parseText('description');
|
||||
|
||||
$reqWrapper = $this->curTpl['rangeMaxHostile'] && ($this->curTpl['powerCost'] > 0 || $this->curTpl['powerCostPercent'] > 0);
|
||||
$reqWrapper = $this->curTpl['rangeMaxHostile'] && ($this->curTpl['powerCost'] > 0 || $this->curTpl['powerCostPercent'] > 0 || ($this->curTpl['powerCostRunes'] & 0x333));
|
||||
$reqWrapper2 = $reagents ||$tools || $desc;
|
||||
|
||||
$x = '';
|
||||
@@ -1052,7 +1030,8 @@ class SpellList extends BaseType
|
||||
// rank
|
||||
if (!empty($rankText))
|
||||
$x .= '<br /></td><th><b class="q0">'.$rankText.'</b></th></tr></table>';
|
||||
|
||||
else
|
||||
$x .= '<br>';
|
||||
|
||||
if ($reqWrapper)
|
||||
$x .= '<table width="100%"><tr><td>';
|
||||
@@ -1064,7 +1043,19 @@ class SpellList extends BaseType
|
||||
if ($this->curTpl['powerCostPercent'] > 0)
|
||||
$x .= $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)
|
||||
$x .= ($pt == 1 ? $this->curTpl['powerCost'] / 10 : $this->curTpl['powerCost']).' '.ucFirst(Lang::$spell['powerTypes'][$pt]);
|
||||
$x .= ($pt == 1 || $pt == 6 ? $this->curTpl['powerCost'] / 10 : $this->curTpl['powerCost']).' '.ucFirst(Lang::$spell['powerTypes'][$pt]);
|
||||
else if ($rCost = ($this->curTpl['powerCostRunes'] & 0x333))
|
||||
{ // Blood 2|1 - Unholy 2|1 - Frost 2|1
|
||||
$runes = [];
|
||||
if ($_ = (($rCost & 0x300) >> 8))
|
||||
$runes[] = $_." ".Lang::$spell['powerRunes'][2];
|
||||
if ($_ = (($rCost & 0x030) >> 4))
|
||||
$runes[] = $_." ".Lang::$spell['powerRunes'][1];
|
||||
if ($_ = ($rCost & 0x003))
|
||||
$runes[] = $_." ".Lang::$spell['powerRunes'][0];
|
||||
|
||||
$x .= implode(', ', $runes);
|
||||
}
|
||||
|
||||
// append periodic cost
|
||||
if ($this->curTpl['powerPerSecond'] > 0)
|
||||
@@ -1102,7 +1093,7 @@ class SpellList extends BaseType
|
||||
// cast times
|
||||
if ($this->curTpl['interruptFlagsChannel'])
|
||||
$x .= Lang::$spell['channeled'];
|
||||
else if ($this->curTpl['castTime'])
|
||||
else if ($this->curTpl['castTime'] > 0)
|
||||
$x .= sprintf(Lang::$spell['castIn'], $this->curTpl['castTime'] / 1000);
|
||||
else if ($this->curTpl['attributes0'] & 0x10) // SPELL_ATTR0_ABILITY instant ability.. yeah, wording thing only
|
||||
$x .= Lang::$spell['instantPhys'];
|
||||
@@ -1119,7 +1110,8 @@ class SpellList extends BaseType
|
||||
|
||||
$x .= '</tr>';
|
||||
|
||||
if ($this->curTpl['stanceMask'])
|
||||
// SPELL_ATTR2_NOT_NEED_SHAPESHIFT
|
||||
if ($this->curTpl['stanceMask'] && ($this->curTpl['attributes2'] & 0x80000) == 0)
|
||||
$x.= '<tr><td colspan="2">'.Lang::$game['requires'].' '.Lang::getStances($this->curTpl['stanceMask']).'</td></tr>';
|
||||
|
||||
$x .= '</table>';
|
||||
|
||||
@@ -33,7 +33,7 @@ define('CACHETYPE_SEARCH', 3);
|
||||
define('SEARCH_TYPE_REGULAR', 0x10000000);
|
||||
define('SEARCH_TYPE_OPEN', 0x20000000);
|
||||
define('SEARCH_TYPE_JSON', 0x40000000);
|
||||
define('SEARCH_MASK_OPEN', 0x007DC0FF); // open search
|
||||
define('SEARCH_MASK_OPEN', 0x007DC1FF); // open search
|
||||
define('SEARCH_MASK_ALL', 0x07FFFFFF); // normal search
|
||||
|
||||
// Databases
|
||||
@@ -112,27 +112,27 @@ define('SIDE_HORDE', 2);
|
||||
define('SIDE_BOTH', 3);
|
||||
|
||||
// ClassMask
|
||||
define('CLASS_WARRIOR', 0x1);
|
||||
define('CLASS_PALADIN', 0x2);
|
||||
define('CLASS_HUNTER', 0x4);
|
||||
define('CLASS_ROGUE', 0x8);
|
||||
define('CLASS_PRIEST', 0x10);
|
||||
define('CLASS_DEATHKNIGHT', 0x20);
|
||||
define('CLASS_SHAMAN', 0x40);
|
||||
define('CLASS_MAGE', 0x80);
|
||||
define('CLASS_WARRIOR', 0x001);
|
||||
define('CLASS_PALADIN', 0x002);
|
||||
define('CLASS_HUNTER', 0x004);
|
||||
define('CLASS_ROGUE', 0x008);
|
||||
define('CLASS_PRIEST', 0x010);
|
||||
define('CLASS_DEATHKNIGHT', 0x020);
|
||||
define('CLASS_SHAMAN', 0x040);
|
||||
define('CLASS_MAGE', 0x080);
|
||||
define('CLASS_WARLOCK', 0x100);
|
||||
define('CLASS_DRUID', 0x400);
|
||||
define('CLASS_MASK_ALL', 0x5FF);
|
||||
|
||||
// RaceMask
|
||||
define('RACE_HUMAN', 0x1);
|
||||
define('RACE_ORC', 0x2);
|
||||
define('RACE_DWARF', 0x4);
|
||||
define('RACE_NIGHTELF', 0x8);
|
||||
define('RACE_UNDEAD', 0x10);
|
||||
define('RACE_TAUREN', 0x20);
|
||||
define('RACE_GNOME', 0x40);
|
||||
define('RACE_TROLL', 0x80);
|
||||
define('RACE_HUMAN', 0x001);
|
||||
define('RACE_ORC', 0x002);
|
||||
define('RACE_DWARF', 0x004);
|
||||
define('RACE_NIGHTELF', 0x008);
|
||||
define('RACE_UNDEAD', 0x010);
|
||||
define('RACE_TAUREN', 0x020);
|
||||
define('RACE_GNOME', 0x040);
|
||||
define('RACE_TROLL', 0x080);
|
||||
define('RACE_BLOODELF', 0x200);
|
||||
define('RACE_DRAENEI', 0x400);
|
||||
define('RACE_MASK_ALLIANCE', 0x44D);
|
||||
|
||||
@@ -1311,7 +1311,9 @@ class Util
|
||||
if (!is_array($data))
|
||||
return mysql_real_escape_string(trim($data));
|
||||
|
||||
array_walk($data, function(&$item, $key) { $item = Util::sqlEscape($item); });
|
||||
array_walk($data, function(&$item, $key) {
|
||||
$item = Util::sqlEscape($item);
|
||||
});
|
||||
|
||||
return $data;
|
||||
}
|
||||
@@ -1368,8 +1370,7 @@ class Util
|
||||
$arr = explode('.', $str);
|
||||
|
||||
foreach ($arr as $i => $a)
|
||||
if (!is_numeric($a))
|
||||
$arr[$i] = null;
|
||||
$arr[$i] = is_numeric($a) ? (int)$a : null;
|
||||
|
||||
return $arr;
|
||||
}
|
||||
@@ -1443,11 +1444,11 @@ class Util
|
||||
switch ($enchant['type'.$h])
|
||||
{
|
||||
case 2:
|
||||
@$jsonStats[2] += $enchant['amount'.$h];
|
||||
@$jsonStats[ITEM_MOD_WEAPON_DMG] += $enchant['amount'.$h];
|
||||
break;
|
||||
case 3:
|
||||
case 7:
|
||||
$spl = new SpellList(array(['id', (int)$enchant['object'.$h]]));
|
||||
$spl = new SpellList(array(['s.id', (int)$enchant['object'.$h]]));
|
||||
$gains = $spl->getStatGain();
|
||||
|
||||
foreach ($gains as $gain)
|
||||
@@ -1458,25 +1459,25 @@ class Util
|
||||
switch ($enchant['object'.$h])
|
||||
{
|
||||
case 0: // Physical
|
||||
@$jsonStats[50] += $enchant['amount'.$h];
|
||||
@$jsonStats[ITEM_MOD_ARMOR] += $enchant['amount'.$h];
|
||||
break;
|
||||
case 1: // Holy
|
||||
@$jsonStats[53] += $enchant['amount'.$h];
|
||||
@$jsonStats[ITEM_MOD_HOLY_RESISTANCE] += $enchant['amount'.$h];
|
||||
break;
|
||||
case 2: // Fire
|
||||
@$jsonStats[51] += $enchant['amount'.$h];
|
||||
@$jsonStats[ITEM_MOD_FIRE_RESISTANCE] += $enchant['amount'.$h];
|
||||
break;
|
||||
case 3: // Nature
|
||||
@$jsonStats[55] += $enchant['amount'.$h];
|
||||
@$jsonStats[ITEM_MOD_NATURE_RESISTANCE] += $enchant['amount'.$h];
|
||||
break;
|
||||
case 4: // Frost
|
||||
@$jsonStats[52] += $enchant['amount'.$h];
|
||||
@$jsonStats[ITEM_MOD_FROST_RESISTANCE] += $enchant['amount'.$h];
|
||||
break;
|
||||
case 5: // Shadow
|
||||
@$jsonStats[54] += $enchant['amount'.$h];
|
||||
@$jsonStats[ITEM_MOD_SHADOW_RESISTANCE] += $enchant['amount'.$h];
|
||||
break;
|
||||
case 6: // Arcane
|
||||
@$jsonStats[56] += $enchant['amount'.$h];
|
||||
@$jsonStats[ITEM_MOD_ARCANE_RESISTANCE] += $enchant['amount'.$h];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -255,7 +255,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2:
|
||||
$crtSpl = new SpellList(array(['id', $obj]));
|
||||
$crtSpl = new SpellList(array(['s.id', $obj]));
|
||||
$crtSpl->addGlobalsToJscript($pageData);
|
||||
$text = $crtName ? $crtName : $crtSpl->names[$crtSpl->id];
|
||||
$tmp['link'] = array(
|
||||
|
||||
@@ -46,13 +46,13 @@ if (!$smarty->loadCache($cacheKey, $pageData))
|
||||
$acvList = new AchievementList($condition ? [['category', $condition]] : [], true);
|
||||
if (!$acvList->matches)
|
||||
{
|
||||
$curCats = $catList = [$condition];
|
||||
$curCats = $catList = [$condition ? $condition : 0];
|
||||
while ($curCats)
|
||||
{
|
||||
$curCats = DB::Aowow()->SelectCol('SELECT Id FROM ?_achievementCategory WHERE parentCategory IN (?a)', $curCats);
|
||||
$catList = array_merge($catList, $curCats);
|
||||
}
|
||||
$acvList = new AchievementList($catList ? [['category', $catList]] : [], true);
|
||||
$acvList = new AchievementList($catList ? [['category', $catList]] : [], true);
|
||||
}
|
||||
|
||||
// recreate form selection
|
||||
@@ -89,7 +89,10 @@ if (!$smarty->loadCache($cacheKey, $pageData))
|
||||
|
||||
// create note if search limit was exceeded
|
||||
if ($acvList->matches > $AoWoWconf['sqlLimit'])
|
||||
{
|
||||
$pageData['params']['note'] = '$'.sprintf(Util::$filterResultString, 'LANG.lvnote_achievementsfound', $acvList->matches, $AoWoWconf['sqlLimit']);
|
||||
$pageData['params']['_truncated'] = 1;
|
||||
}
|
||||
|
||||
if ($acvList->filterGetError())
|
||||
$pageData['params']['_errors'] = '$1';
|
||||
|
||||
@@ -31,7 +31,10 @@ if (!$smarty->loadCache($cacheKey, $pageData))
|
||||
|
||||
// create note if search limit was exceeded
|
||||
if ($itemsets->matches > $AoWoWconf['sqlLimit'])
|
||||
{
|
||||
$pageData['params']['note'] = '$'.sprintf(Util::$filterResultString, 'LANG.lvnote_itemsetsfound', $itemsets->matches, $AoWoWconf['sqlLimit']);
|
||||
$pageData['params']['_truncated'] = 1;
|
||||
}
|
||||
|
||||
if ($itemsets->filterGetError())
|
||||
$pageData['params']['_errors'] = '$1';
|
||||
|
||||
@@ -21,35 +21,37 @@ if (isset($_GET['power']))
|
||||
|
||||
if (!$smarty->loadCache($cacheKeyTooltip, $x))
|
||||
{
|
||||
$spell = new SpellList(array(['id', $id]));
|
||||
$spell = new SpellList(array(['s.id', $id]));
|
||||
|
||||
if ($spell->error)
|
||||
die('$WowheadPower.registerSpell('.$id.', '.User::$localeId.', {});');
|
||||
|
||||
$x = '$WowheadPower.registerSpell('.$id.', '.User::$localeId.", {\n";
|
||||
$x = '$WowheadPower.registerSpell('.$id.', '.User::$localeId.", {\n";
|
||||
$pt = [];
|
||||
if ($n = $spell->names[$id])
|
||||
$x .= "\tname_".User::$localeString.": '".Util::jsEscape($n)."',\n";
|
||||
$pt[] = "\tname_".User::$localeString.": '".Util::jsEscape($n)."'";
|
||||
if ($i = $spell->getField('iconString'))
|
||||
$x .= "\ticon: '".Util::jsEscape($i)."',\n";
|
||||
$pt[] = "\ticon: '".Util::jsEscape($i)."'";
|
||||
if ($t = $spell->renderTooltip($id))
|
||||
$x .= "\ttooltip_".User::$localeString.": '".Util::jsEscape($t)."'";
|
||||
$pt[] = "\ttooltip_".User::$localeString.": '".Util::jsEscape($t)."'";
|
||||
if ($b = $spell->renderBuff($id))
|
||||
$x .= ",\n\tbuff_".User::$localeString.": '".Util::jsEscape($b)."'\n";
|
||||
$x .= '});';
|
||||
$pt[] = "\tbuff_".User::$localeString.": '".Util::jsEscape($b)."'";
|
||||
$x .= implode(",\n", $pt)."\n});";
|
||||
|
||||
$smarty->saveCache($cacheKeyTooltip, $x);
|
||||
}
|
||||
|
||||
die($x);
|
||||
}
|
||||
|
||||
if (!$smarty->loadCache($cacheKeyPage, $pageData))
|
||||
{
|
||||
$spell = new SpellList(array(['id', $id]));
|
||||
$spell = new SpellList(array(['s.id', $id]));
|
||||
|
||||
// v there be dragons v
|
||||
|
||||
// Spelldata
|
||||
if ($spellObj = new SpellList(array(['id', $id])))
|
||||
if ($spellObj = new SpellList(array(['s.id', $id])))
|
||||
{
|
||||
$row = $spellObj->template; // equivalent to 5 layers of panzertape
|
||||
|
||||
|
||||
15
search.php
15
search.php
@@ -243,7 +243,10 @@ if ($searchMask & 0x10)
|
||||
);
|
||||
|
||||
if ($money->matches > $maxResults)
|
||||
{
|
||||
$found['currency']['params']['note'] = '$'.sprintf(Util::$narrowResultString, 'LANG.lvnote_currenciesfound', $money->matches, $maxResults);
|
||||
$found['currency']['params']['_truncated'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +271,10 @@ if ($searchMask & 0x20)
|
||||
);
|
||||
|
||||
if ($sets->matches > $maxResults)
|
||||
{
|
||||
$found['itemset']['params']['note'] = '$'.sprintf(Util::$narrowResultString, 'LANG.lvnote_itemsetsfound', $sets->matches, $maxResults);
|
||||
$found['itemset']['params']['_truncated'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,7 +311,10 @@ if ($searchMask & 0x40)
|
||||
);
|
||||
|
||||
if ($items->matches > $maxResults)
|
||||
{
|
||||
$found['item']['params']['note'] = '$'.sprintf(Util::$narrowResultString, 'LANG.lvnote_itemsfound', $items->matches, $maxResults);
|
||||
$found['item']['params']['_truncated'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -360,7 +369,10 @@ if ($searchMask & 0x10000)
|
||||
);
|
||||
|
||||
if ($acvs->matches > $maxResults)
|
||||
{
|
||||
$found['achievement']['params']['note'] = '$'.sprintf(Util::$narrowResultString, 'LANG.lvnote_achievementsfound', $acvs->matches, $maxResults);
|
||||
$found['achievement']['params']['_truncated'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -387,7 +399,10 @@ if ($searchMask & 0x20000)
|
||||
);
|
||||
|
||||
if ($stats->matches > $maxResults)
|
||||
{
|
||||
$found['statistic']['params']['note'] = '$'.sprintf(Util::$narrowResultString, 'LANG.lvnote_statisticsfound', $stats->matches, $maxResults);
|
||||
$found['statistic']['params']['_truncated'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ if (!defined('AOWOW_REVISION'))
|
||||
if ($pop['glyphEffect'])
|
||||
$glyphSpells[] = $pop['glyphEffect'];
|
||||
|
||||
$glyphSpells = new SpellList(array(['id', $glyphSpells]));
|
||||
$glyphSpells = new SpellList(array(['s.id', $glyphSpells]));
|
||||
|
||||
foreach ($locales as $lId)
|
||||
{
|
||||
|
||||
@@ -113,7 +113,7 @@ if (!defined('AOWOW_REVISION'))
|
||||
// costy and locale-independant -> cache
|
||||
if (!isset($jsonBonus[$set['spell'.$i]]))
|
||||
{
|
||||
$bSpell = new SpellList(array(['id', $set['spell'.$i]]));
|
||||
$bSpell = new SpellList(array(['s.id', $set['spell'.$i]]));
|
||||
$jsonBonus[$set['spell'.$i]] = $bSpell->getStatGain();
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ if (!defined('AOWOW_REVISION'))
|
||||
|
||||
for ($k = 0; $k <= ($m - 1); $k++)
|
||||
{
|
||||
$tSpell = new SpellList(array(['id', $talents[$j]['rank'.($k + 1)]]));
|
||||
$tSpell = new SpellList(array(['s.id', $talents[$j]['rank'.($k + 1)]]));
|
||||
$d[] = $tSpell->parseText();
|
||||
$s[] = $talents[$j]['rank'.($k + 1)];
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ for ($i = 1; $i < 9; $i++)
|
||||
if ($set['spellId'.$i] > 0)
|
||||
$spells[] = (int)$set['spellId'.$i];
|
||||
|
||||
$bonusSpells = new SpellList(array(['id', $spells]));
|
||||
$bonusSpells = new SpellList(array(['s.id', $spells]));
|
||||
|
||||
$mods = $bonusSpells->getStatGain();
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
{if !isset($params.tabs)}tabs:tabsRelated,{/if}
|
||||
{if !isset($params.name)}name:LANG.tab_achievements,{/if}
|
||||
{if !isset($params.parent)}parent:'listview-generic',{/if}
|
||||
{if isset($params.note)}_truncated: 1,{/if}
|
||||
{foreach from=$params key=k item=v}
|
||||
{if $v[0] == '$'}
|
||||
{$k}:{$v|substr:1},
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
{if !isset($params.tabs)}tabs:tabsRelated,{/if}
|
||||
{if !isset($params.name)}name:LANG.tab_calendar,{/if}
|
||||
{if !isset($params.parent)}parent:'listview-generic',{/if}
|
||||
{if isset($params.note)}_truncated: 1,{/if}
|
||||
{foreach from=$params key=k item=v}
|
||||
{if $v[0] == '$'}
|
||||
{$k}:{$v|substr:1},
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
{if !isset($params.tabs)}tabs:'listview-generic',{/if}
|
||||
{if !isset($params.name)}name:LANG.tab_classes,{/if}
|
||||
{if !isset($params.parent)}parent:'listview-generic',{/if}
|
||||
{if isset($params.note)}_truncated: 1,{/if}
|
||||
{foreach from=$params key=k item=v}
|
||||
{if $v[0] == '$'}
|
||||
{$k}:{$v|substr:1},
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
{if !isset($params.tabs)}tabs:'listview-generic',{/if}
|
||||
{if !isset($params.name)}name:LANG.tab_currencies,{/if}
|
||||
{if !isset($params.parent)}parent:'listview-generic',{/if}
|
||||
{if isset($params.note)}_truncated: 1,{/if}
|
||||
{foreach from=$params key=k item=v}
|
||||
{if $v[0] == '$'}
|
||||
{$k}:{$v|substr:1},
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
{if !isset($params.tabs)}tabs:tabsRelated,{/if}
|
||||
{if !isset($params.name)}name:LANG.tab_holidays,{/if}
|
||||
{if !isset($params.parent)}parent:'listview-generic',{/if}
|
||||
{if isset($params.note)}_truncated: 1,{/if}
|
||||
{foreach from=$params key=k item=v}
|
||||
{if $v[0] == '$'}
|
||||
{$k}:{$v|substr:1},
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
{if !isset($params.tabs)}tabs:'listview-generic',{/if}
|
||||
{if !isset($params.name)}name:LANG.tab_items,{/if}
|
||||
{if !isset($params.parent)}parent:'listview-generic',{/if}
|
||||
{if isset($params.note)}_truncated: 1,{/if}
|
||||
{foreach from=$params key=k item=v}
|
||||
{if $v[0] == '$'}
|
||||
{$k}:{$v|substr:1},
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
{if !isset($params.tabs)}tabs:'listview-generic',{/if}
|
||||
{if !isset($params.name)}name:LANG.tab_itemsets,{/if}
|
||||
{if !isset($params.parent)}parent:'listview-generic',{/if}
|
||||
{if isset($params.note)}_truncated: 1,{/if}
|
||||
{foreach from=$params key=k item=v}
|
||||
{if $v[0] == '$'}
|
||||
{$k}:{$v|substr:1},
|
||||
|
||||
@@ -23,7 +23,6 @@ var _ = function(family)
|
||||
{if !isset($params.tabs)}tabs:'tabs-generic',{/if}
|
||||
{if !isset($params.name)}name:LANG.tab_pets,{/if}
|
||||
{if !isset($params.parent)}parent:'listview-generic',{/if}
|
||||
{if isset($params.note)}_truncated: 1,{/if}
|
||||
{foreach from=$params key=k item=v}
|
||||
{if $v[0] == '$'}
|
||||
{$k}:{$v|substr:1},
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
{if !isset($params.tabs)}tabs:tabsRelated,{/if}
|
||||
{if !isset($params.name)}name:LANG.tab_quests,{/if}
|
||||
{if !isset($params.parent)}parent:'listview-generic',{/if}
|
||||
{if isset($params.note)}_truncated: 1,{/if}
|
||||
{foreach from=$params key=k item=v}
|
||||
{if $v[0] == '$'}
|
||||
{$k}:{$v|substr:1},
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
{if !isset($params.tabs)}tabs:'listview-generic',{/if}
|
||||
{if !isset($params.name)}name:LANG.tab_races,{/if}
|
||||
{if !isset($params.parent)}parent:'listview-generic',{/if}
|
||||
{if isset($params.note)}_truncated: 1,{/if}
|
||||
{foreach from=$params key=k item=v}
|
||||
{if $v[0] == '$'}
|
||||
{$k}:{$v|substr:1},
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
{if !isset($params.tabs)}tabs:'listview-generic',{/if}
|
||||
{if !isset($params.name)}name:LANG.tab_titles,{/if}
|
||||
{if !isset($params.parent)}parent:'listview-generic',{/if}
|
||||
{if isset($params.note)}_truncated: 1,{/if}
|
||||
{foreach from=$params key=k item=v}
|
||||
{if $v[0] == '$'}
|
||||
{$k}:{$v|substr:1},
|
||||
|
||||
@@ -422,7 +422,7 @@ Mapper.prototype = {
|
||||
setZones: function(div, zones)
|
||||
{
|
||||
// div = $('#'+div);
|
||||
div = ge('#'+div);
|
||||
div = ge(div);
|
||||
if(!div || !zones || zones.length == 0 || !this.objectives)
|
||||
return;
|
||||
|
||||
@@ -971,12 +971,22 @@ Mapper.prototype = {
|
||||
if(this.sToggle)
|
||||
this.sToggle.style.display = (this.toggle && this.nCoords ? '' : 'none');
|
||||
|
||||
//if(!noScroll)
|
||||
// g_scrollTo(this.parent, 3);
|
||||
if(!noScroll)
|
||||
g_scrollTo(this.parent, 3);
|
||||
|
||||
// qhat the heck did this do..?
|
||||
// replacement start
|
||||
// $('.line', this.floorPins[level]).hide();
|
||||
// $('.line.' + Mapper.sizes[this.zoom][2], this.floorPins[level]).show();
|
||||
if (this.floorPins[level]) {
|
||||
var lines = this.floorPins[level].getElementsByClassName('line');
|
||||
for (i in lines)
|
||||
lines[i].display = 'none';
|
||||
|
||||
lines = this.floorPins[level].getElementsByClassName('line ' + Mapper.sizes[this.zoom][2]);
|
||||
for (i in lines)
|
||||
lines[i].display = 'block';
|
||||
}
|
||||
// end of replacement
|
||||
|
||||
this.onMapUpdate && this.onMapUpdate(this);
|
||||
},
|
||||
|
||||
@@ -448,6 +448,11 @@ function eO(b) {
|
||||
delete b[a]
|
||||
}
|
||||
}
|
||||
function dO(s) {
|
||||
function f(){};
|
||||
f.prototype = s;
|
||||
return new f;
|
||||
}
|
||||
function cO(c, a) {
|
||||
for (var b in a) {
|
||||
if (a[b] !== null && typeof a[b] == "object" && a[b].length) {
|
||||
|
||||
Reference in New Issue
Block a user