mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
fixed problems with case-sensitivety on different systems
- table-names are now lowercase - includes from spl_autolaod_regsiter() are now lowercase
This commit is contained in:
@@ -963,7 +963,7 @@ class AjaxHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
// hey, still here? you're not a Tauren/Nelf as bear or cat, are you?
|
// hey, still here? you're not a Tauren/Nelf as bear or cat, are you?
|
||||||
return DB::Aowow()->selectCell('SELECT IF(?d == 1, IFNULL(displayIdA, displayIdH), IFNULL(displayIdH, displayIdA)) FROM ?_shapeshiftForm WHERE id = ?d', Util::sideByRaceMask(1 << ($char['race'] - 1)), $form);
|
return DB::Aowow()->selectCell('SELECT IF(?d == 1, IFNULL(displayIdA, displayIdH), IFNULL(displayIdH, displayIdA)) FROM ?_shapeshiftform WHERE id = ?d', Util::sideByRaceMask(1 << ($char['race'] - 1)), $form);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ require 'pages/genericPage.class.php';
|
|||||||
|
|
||||||
// autoload List-classes, associated filters and pages
|
// autoload List-classes, associated filters and pages
|
||||||
spl_autoload_register(function ($class) {
|
spl_autoload_register(function ($class) {
|
||||||
$class = str_replace('Filter', '', $class);
|
$class = strtolower(str_replace('Filter', '', $class));
|
||||||
|
|
||||||
if (class_exists($class)) // already registered
|
if (class_exists($class)) // already registered
|
||||||
return;
|
return;
|
||||||
@@ -30,19 +30,19 @@ spl_autoload_register(function ($class) {
|
|||||||
if (preg_match('/[^\w]/i', $class)) // name should contain only letters
|
if (preg_match('/[^\w]/i', $class)) // name should contain only letters
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (strpos($class, 'List'))
|
if (strpos($class, 'list'))
|
||||||
{
|
{
|
||||||
if (!class_exists('BaseType'))
|
if (!class_exists('BaseType'))
|
||||||
require 'includes/types/basetype.class.php';
|
require 'includes/types/basetype.class.php';
|
||||||
|
|
||||||
if (file_exists(CWD.'includes/types/'.strtr($class, ['List' => '']).'.class.php'))
|
if (file_exists(CWD.'includes/types/'.strtr($class, ['list' => '']).'.class.php'))
|
||||||
require 'includes/types/'.strtr($class, ['List' => '']).'.class.php';
|
require 'includes/types/'.strtr($class, ['list' => '']).'.class.php';
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists('pages/'.strtr($class, ['Page' => '']).'.php'))
|
if (file_exists('pages/'.strtr($class, ['page' => '']).'.php'))
|
||||||
require 'pages/'.strtr($class, ['Page' => '']).'.php';
|
require 'pages/'.strtr($class, ['page' => '']).'.php';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class Loot
|
|||||||
|
|
||||||
private function createStack($l) // issue: TC always has an equal distribution between min/max
|
private function createStack($l) // issue: TC always has an equal distribution between min/max
|
||||||
{
|
{
|
||||||
if (empty($l['min']) || empty($l['max']) || $l['min'] <= $l['max'])
|
if (empty($l['min']) || empty($l['max']) || $l['max'] <= $l['min'])
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
$stack = [];
|
$stack = [];
|
||||||
|
|||||||
@@ -849,7 +849,7 @@ class ItemList extends BaseType
|
|||||||
{
|
{
|
||||||
$pieces = DB::Aowow()->select('
|
$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
|
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 aowow_items a, aowow_items b
|
FROM ?_items a, ?_items b
|
||||||
WHERE a.slotBak = b.slotBak AND a.itemset = b.itemset AND b.id IN (?a)
|
WHERE a.slotBak = b.slotBak AND a.itemset = b.itemset AND b.id IN (?a)
|
||||||
GROUP BY b.id;',
|
GROUP BY b.id;',
|
||||||
array_keys($itemset->pieceToSet)
|
array_keys($itemset->pieceToSet)
|
||||||
@@ -1015,7 +1015,7 @@ class ItemList extends BaseType
|
|||||||
// from Trinity
|
// from Trinity
|
||||||
public function generateEnchSuffixFactor()
|
public function generateEnchSuffixFactor()
|
||||||
{
|
{
|
||||||
$rpp = DB::Aowow()->selectRow('SELECT * FROM ?_itemRandomPropPoints WHERE Id = ?', $this->curTpl['itemLevel']);
|
$rpp = DB::Aowow()->selectRow('SELECT * FROM ?_itemrandomproppoints WHERE Id = ?', $this->curTpl['itemLevel']);
|
||||||
if (!$rpp)
|
if (!$rpp)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -1291,9 +1291,9 @@ class ItemList extends BaseType
|
|||||||
|
|
||||||
$ire = DB::Aowow()->select('
|
$ire = DB::Aowow()->select('
|
||||||
SELECT i.id AS ARRAY_KEY_1, ire.id AS ARRAY_KEY_2, iet.chance, ire.*
|
SELECT i.id AS ARRAY_KEY_1, ire.id AS ARRAY_KEY_2, iet.chance, ire.*
|
||||||
FROM aowow_items i
|
FROM ?_items i
|
||||||
JOIN item_enchantment_template iet ON iet.entry = ABS(i.randomEnchant)
|
JOIN item_enchantment_template iet ON iet.entry = ABS(i.randomEnchant)
|
||||||
JOIN aowow_itemRandomEnchant ire ON IF(i.randomEnchant > 0, ire.id = iet.ench, ire.id = -iet.ench)
|
JOIN ?_itemRandomEnchant ire ON IF(i.randomEnchant > 0, ire.id = iet.ench, ire.id = -iet.ench)
|
||||||
WHERE i.id IN (?a)',
|
WHERE i.id IN (?a)',
|
||||||
array_keys($this->templates)
|
array_keys($this->templates)
|
||||||
);
|
);
|
||||||
@@ -1444,8 +1444,8 @@ class ItemList extends BaseType
|
|||||||
class ItemListFilter extends Filter
|
class ItemListFilter extends Filter
|
||||||
{
|
{
|
||||||
private $ubFilter = []; // usable-by - limit weapon/armor selection per CharClass - itemClass => available itemsubclasses
|
private $ubFilter = []; // usable-by - limit weapon/armor selection per CharClass - itemClass => available itemsubclasses
|
||||||
private $extCostQuery = 'SELECT item FROM npc_vendor nv JOIN ?_itemExtendedCost iec ON iec.id = nv.extendedCost WHERE %s UNION
|
private $extCostQuery = 'SELECT item FROM npc_vendor nv JOIN ?_itemextendedcost iec ON iec.id = nv.extendedCost WHERE %s UNION
|
||||||
SELECT item FROM game_event_npc_vendor genv JOIN ?_itemExtendedCost iec ON iec.id = genv.extendedCost WHERE %1$s';
|
SELECT item FROM game_event_npc_vendor genv JOIN ?_itemextendedcost iec ON iec.id = genv.extendedCost WHERE %1$s';
|
||||||
|
|
||||||
public $extraOpts = []; // score for statWeights
|
public $extraOpts = []; // score for statWeights
|
||||||
public $wtCnd = [];
|
public $wtCnd = [];
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class SkillList extends BaseType
|
|||||||
public static $type = TYPE_SKILL;
|
public static $type = TYPE_SKILL;
|
||||||
public static $brickFile = 'skill';
|
public static $brickFile = 'skill';
|
||||||
|
|
||||||
protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_skillLine sl';
|
protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_skillline sl';
|
||||||
|
|
||||||
public function __construct($conditions = [])
|
public function __construct($conditions = [])
|
||||||
{
|
{
|
||||||
@@ -40,7 +40,7 @@ class SkillList extends BaseType
|
|||||||
name_loc6,
|
name_loc6,
|
||||||
name_loc8
|
name_loc8
|
||||||
FROM
|
FROM
|
||||||
?_skillLine
|
?_skillline
|
||||||
WHERE
|
WHERE
|
||||||
id = ?d',
|
id = ?d',
|
||||||
$id
|
$id
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ class SpellList extends BaseType
|
|||||||
2289 => [2289, 29415, 29418, 29419, 29420, 29421] // Bear - Tauren
|
2289 => [2289, 29415, 29418, 29419, 29420, 29421] // Bear - Tauren
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($st = DB::Aowow()->selectRow('SELECT *, displayIdA as model1, displayIdH as model2 FROM ?_shapeshiftForms WHERE id = ?d', $effMV))
|
if ($st = DB::Aowow()->selectRow('SELECT *, displayIdA as model1, displayIdH as model2 FROM ?_shapeshiftforms WHERE id = ?d', $effMV))
|
||||||
{
|
{
|
||||||
foreach ([1, 2] as $i)
|
foreach ([1, 2] as $i)
|
||||||
if (isset($subForms[$st['model'.$i]]))
|
if (isset($subForms[$st['model'.$i]]))
|
||||||
@@ -1228,7 +1228,7 @@ class SpellList extends BaseType
|
|||||||
{
|
{
|
||||||
if (empty($this->spellVars[$this->id]))
|
if (empty($this->spellVars[$this->id]))
|
||||||
{
|
{
|
||||||
$spellVars = DB::Aowow()->SelectCell('SELECT vars FROM ?_spellVariables WHERE id = ?d', $this->curTpl['spellDescriptionVariableId']);
|
$spellVars = DB::Aowow()->SelectCell('SELECT vars FROM ?_spellvariables WHERE id = ?d', $this->curTpl['spellDescriptionVariableId']);
|
||||||
$spellVars = explode("\n", $spellVars);
|
$spellVars = explode("\n", $spellVars);
|
||||||
foreach ($spellVars as $sv)
|
foreach ($spellVars as $sv)
|
||||||
if (preg_match('/\$(\w*\d*)=(.*)/i', trim($sv), $matches))
|
if (preg_match('/\$(\w*\d*)=(.*)/i', trim($sv), $matches))
|
||||||
@@ -1811,7 +1811,7 @@ spells / buffspells = {
|
|||||||
$extra[$id] = array(
|
$extra[$id] = array(
|
||||||
'id' => $id,
|
'id' => $id,
|
||||||
'tooltip' => $tTip[0],
|
'tooltip' => $tTip[0],
|
||||||
'buff' => $buff[0],
|
'buff' => @$buff[0],
|
||||||
'spells' => $tTip[1],
|
'spells' => $tTip[1],
|
||||||
'buffspells' => @$buff[1]
|
'buffspells' => @$buff[1]
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ class TitleList extends BaseType
|
|||||||
$sources[12] = (new AchievementList(array(['id', $sources[12]])))->getSourceData();
|
$sources[12] = (new AchievementList(array(['id', $sources[12]])))->getSourceData();
|
||||||
|
|
||||||
if (!empty($sources[13]))
|
if (!empty($sources[13]))
|
||||||
$sources[13] = DB::Aowow()->SELECT('SELECT *, Id AS ARRAY_KEY FROM ?_sourceStrings WHERE Id IN (?a)', $sources[13]);
|
$sources[13] = DB::Aowow()->SELECT('SELECT *, Id AS ARRAY_KEY FROM ?_sourcestrings WHERE Id IN (?a)', $sources[13]);
|
||||||
|
|
||||||
foreach ($this->sources as $Id => $src)
|
foreach ($this->sources as $Id => $src)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class ZoneList extends BaseType
|
|||||||
{
|
{
|
||||||
$data = [];
|
$data = [];
|
||||||
/*
|
/*
|
||||||
UPDATE dbc.worldmaparea a, world.aowow_zones z SET yMax = `left`, xMax = top, yMin = `right`, xMin = bottom WHERE a.areaId = z.id;
|
UPDATE dbc.worldmaparea a, world.?_zones z SET yMax = `left`, xMax = top, yMin = `right`, xMin = bottom WHERE a.areaId = z.id;
|
||||||
|
|
||||||
LFG_TYPE_NONE = 0, // Internal use only
|
LFG_TYPE_NONE = 0, // Internal use only
|
||||||
LFG_TYPE_DUNGEON = 1,
|
LFG_TYPE_DUNGEON = 1,
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ class User
|
|||||||
self::$dataKey = $_SESSION['dataKey'];
|
self::$dataKey = $_SESSION['dataKey'];
|
||||||
|
|
||||||
// check IP bans
|
// check IP bans
|
||||||
if ($ipBan = DB::Aowow()->selectRow('SELECT count, unbanDate FROM ?_account_bannedIPs WHERE ip = ? AND type = 0', $_SERVER['REMOTE_ADDR']))
|
if ($ipBan = DB::Aowow()->selectRow('SELECT count, unbanDate FROM ?_account_bannedips WHERE ip = ? AND type = 0', $_SERVER['REMOTE_ADDR']))
|
||||||
{
|
{
|
||||||
if ($ipBan['count'] > CFG_FAILED_AUTH_COUNT && $ipBan['unbanDate'] > time())
|
if ($ipBan['count'] > CFG_FAILED_AUTH_COUNT && $ipBan['unbanDate'] > time())
|
||||||
return false;
|
return false;
|
||||||
else if ($ipBan['unbanDate'] <= time())
|
else if ($ipBan['unbanDate'] <= time())
|
||||||
DB::Aowow()->query('DELETE FROM ?_account_bannedIPs WHERE ip = ?', $_SERVER['REMOTE_ADDR']);
|
DB::Aowow()->query('DELETE FROM ?_account_bannedips WHERE ip = ?', $_SERVER['REMOTE_ADDR']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// try to restore session
|
// try to restore session
|
||||||
@@ -186,11 +186,11 @@ class User
|
|||||||
case AUTH_MODE_SELF:
|
case AUTH_MODE_SELF:
|
||||||
{
|
{
|
||||||
// handle login try limitation
|
// handle login try limitation
|
||||||
$ip = DB::Aowow()->selectRow('SELECT ip, count, unbanDate FROM ?_account_bannedIPs WHERE type = 0 AND ip = ?', $_SERVER['REMOTE_ADDR']);
|
$ip = DB::Aowow()->selectRow('SELECT ip, count, unbanDate FROM ?_account_bannedips WHERE type = 0 AND ip = ?', $_SERVER['REMOTE_ADDR']);
|
||||||
if (!$ip || $ip['unbanDate'] < time()) // no entry exists or time expired; set count to 1
|
if (!$ip || $ip['unbanDate'] < time()) // no entry exists or time expired; set count to 1
|
||||||
DB::Aowow()->query('REPLACE INTO ?_account_bannedIPs (ip, type, count, unbanDate) VALUES (?, 0, 1, UNIX_TIMESTAMP() + ?d)', $_SERVER['REMOTE_ADDR'], CFG_FAILED_AUTH_EXCLUSION);
|
DB::Aowow()->query('REPLACE INTO ?_account_bannedips (ip, type, count, unbanDate) VALUES (?, 0, 1, UNIX_TIMESTAMP() + ?d)', $_SERVER['REMOTE_ADDR'], CFG_FAILED_AUTH_EXCLUSION);
|
||||||
else // entry already exists; increment count
|
else // entry already exists; increment count
|
||||||
DB::Aowow()->query('UPDATE ?_account_bannedIPs SET count = count + 1, unbanDate = UNIX_TIMESTAMP() + ?d WHERE ip = ?', CFG_FAILED_AUTH_EXCLUSION, $_SERVER['REMOTE_ADDR']);
|
DB::Aowow()->query('UPDATE ?_account_bannedips SET count = count + 1, unbanDate = UNIX_TIMESTAMP() + ?d WHERE ip = ?', CFG_FAILED_AUTH_EXCLUSION, $_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
if ($ip && $ip['count'] >= CFG_FAILED_AUTH_COUNT && $ip['unbanDate'] >= time())
|
if ($ip && $ip['count'] >= CFG_FAILED_AUTH_COUNT && $ip['unbanDate'] >= time())
|
||||||
return AUTH_IPBANNED;
|
return AUTH_IPBANNED;
|
||||||
@@ -214,7 +214,7 @@ class User
|
|||||||
return AUTH_ACC_INACTIVE;
|
return AUTH_ACC_INACTIVE;
|
||||||
|
|
||||||
// successfull auth; clear bans for this IP
|
// successfull auth; clear bans for this IP
|
||||||
DB::Aowow()->query('DELETE FROM ?_account_bannedIPs WHERE type = 0 AND ip = ?', $_SERVER['REMOTE_ADDR']);
|
DB::Aowow()->query('DELETE FROM ?_account_bannedips WHERE type = 0 AND ip = ?', $_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
if ($query['bans'] & (ACC_BAN_PERM | ACC_BAN_TEMP))
|
if ($query['bans'] & (ACC_BAN_PERM | ACC_BAN_TEMP))
|
||||||
return AUTH_BANNED;
|
return AUTH_BANNED;
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ class Util
|
|||||||
);
|
);
|
||||||
|
|
||||||
/* why:
|
/* why:
|
||||||
Because petSkills (and ranged weapon skills) are the only ones with more than two skillLines attached. Because Left Joining ?_spell with ?_skillLineAbility causes more trouble than it has uses.
|
Because petSkills (and ranged weapon skills) are the only ones with more than two skillLines attached. Because Left Joining ?_spell with ?_skillLineability causes more trouble than it has uses.
|
||||||
Because this is more or less the only reaonable way to fit all that information into one database field, so..
|
Because this is more or less the only reaonable way to fit all that information into one database field, so..
|
||||||
.. the indizes of this array are bits of skillLine2OrMask in ?_spell if skillLineId1 is negative
|
.. the indizes of this array are bits of skillLine2OrMask in ?_spell if skillLineId1 is negative
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -382,7 +382,7 @@ Markup.printHtml("description text here", "description-generic", { allow: Markup
|
|||||||
return Lang::$account['emailInvalid'];
|
return Lang::$account['emailInvalid'];
|
||||||
|
|
||||||
// limit account creation
|
// limit account creation
|
||||||
$ip = DB::Aowow()->selectRow('SELECT ip, count, unbanDate FROM ?_account_bannedIPs WHERE type = 1 AND ip = ?', $_SERVER['REMOTE_ADDR']);
|
$ip = DB::Aowow()->selectRow('SELECT ip, count, unbanDate FROM ?_account_bannedips WHERE type = 1 AND ip = ?', $_SERVER['REMOTE_ADDR']);
|
||||||
if ($ip && $ip['count'] >= CFG_FAILED_AUTH_COUNT && $ip['unbanDate'] >= time())
|
if ($ip && $ip['count'] >= CFG_FAILED_AUTH_COUNT && $ip['unbanDate'] >= time())
|
||||||
{
|
{
|
||||||
DB::Aowow()->query('UPDATE ?_account_bannedips SET count = count + 1, unbanDate = UNIX_TIMESTAMP() + ?d WHERE ip = ? AND type = 1', CFG_FAILED_AUTH_EXCLUSION, $_SERVER['REMOTE_ADDR']);
|
DB::Aowow()->query('UPDATE ?_account_bannedips SET count = count + 1, unbanDate = UNIX_TIMESTAMP() + ?d WHERE ip = ? AND type = 1', CFG_FAILED_AUTH_EXCLUSION, $_SERVER['REMOTE_ADDR']);
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class AchievementsPage extends GenericPage
|
|||||||
$curCats = $catList = [!empty($this->category) ? (int)end($this->category) : 0];
|
$curCats = $catList = [!empty($this->category) ? (int)end($this->category) : 0];
|
||||||
while ($curCats)
|
while ($curCats)
|
||||||
{
|
{
|
||||||
$curCats = DB::Aowow()->SelectCol('SELECT Id FROM ?_achievementCategory WHERE parentCategory IN (?a)', $curCats);
|
$curCats = DB::Aowow()->SelectCol('SELECT Id FROM ?_achievementcategory WHERE parentCategory IN (?a)', $curCats);
|
||||||
$catList = array_merge($catList, $curCats);
|
$catList = array_merge($catList, $curCats);
|
||||||
}
|
}
|
||||||
$conditions = [];
|
$conditions = [];
|
||||||
|
|||||||
@@ -215,9 +215,9 @@ class CurrencyPage extends GenericPage
|
|||||||
}
|
}
|
||||||
|
|
||||||
$boughtBy = DB::Aowow()->selectCol('
|
$boughtBy = DB::Aowow()->selectCol('
|
||||||
SELECT item FROM npc_vendor nv JOIN ?_itemExtendedCost iec ON iec.id = nv.extendedCost WHERE '.$w.'
|
SELECT item FROM npc_vendor nv JOIN ?_itemextendedcost iec ON iec.id = nv.extendedCost WHERE '.$w.'
|
||||||
UNION
|
UNION
|
||||||
SELECT item FROM game_event_npc_vendor genv JOIN ?_itemExtendedCost iec ON iec.id = genv.extendedCost WHERE '.$w
|
SELECT item FROM game_event_npc_vendor genv JOIN ?_itemextendedcost iec ON iec.id = genv.extendedCost WHERE '.$w
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($boughtBy)
|
if ($boughtBy)
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ class ItemPage extends genericPage
|
|||||||
|
|
||||||
// tool
|
// tool
|
||||||
if ($tId = $this->subject->getField('totemCategory'))
|
if ($tId = $this->subject->getField('totemCategory'))
|
||||||
if ($tName = DB::Aowow()->selectRow('SELECT * FROM ?_totemCategory WHERE id = ?d', $tId))
|
if ($tName = DB::Aowow()->selectRow('SELECT * FROM ?_totemcategory WHERE id = ?d', $tId))
|
||||||
$infobox[] = Lang::$item['tool'].Lang::$main['colon'].'[url=?items&filter=cr=91;crs='.$tId.';crv=0]'.Util::localizedString($tName, 'name').'[/url]';
|
$infobox[] = Lang::$item['tool'].Lang::$main['colon'].'[url=?items&filter=cr=91;crs='.$tId.';crv=0]'.Util::localizedString($tName, 'name').'[/url]';
|
||||||
|
|
||||||
// extendedCost
|
// extendedCost
|
||||||
@@ -825,9 +825,9 @@ class ItemPage extends genericPage
|
|||||||
$w = 'iec.reqItemId1 = '.$this->typeId.' OR iec.reqItemId2 = '.$this->typeId.' OR iec.reqItemId3 = '.$this->typeId.' OR iec.reqItemId4 = '.$this->typeId.' OR iec.reqItemId5 = '.$this->typeId;
|
$w = 'iec.reqItemId1 = '.$this->typeId.' OR iec.reqItemId2 = '.$this->typeId.' OR iec.reqItemId3 = '.$this->typeId.' OR iec.reqItemId4 = '.$this->typeId.' OR iec.reqItemId5 = '.$this->typeId;
|
||||||
|
|
||||||
$boughtBy = DB::Aowow()->selectCol('
|
$boughtBy = DB::Aowow()->selectCol('
|
||||||
SELECT item FROM npc_vendor nv JOIN ?_itemExtendedCost iec ON iec.id = nv.extendedCost WHERE '.$w.'
|
SELECT item FROM npc_vendor nv JOIN ?_itemextendedcost iec ON iec.id = nv.extendedCost WHERE '.$w.'
|
||||||
UNION
|
UNION
|
||||||
SELECT item FROM game_event_npc_vendor genv JOIN ?_itemExtendedCost iec ON iec.id = genv.extendedCost WHERE '.$w
|
SELECT item FROM game_event_npc_vendor genv JOIN ?_itemextendedcost iec ON iec.id = genv.extendedCost WHERE '.$w
|
||||||
);
|
);
|
||||||
if ($boughtBy)
|
if ($boughtBy)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -342,9 +342,16 @@ class NpcPage extends GenericPage
|
|||||||
// tab: teaches
|
// tab: teaches
|
||||||
if ($this->subject->getField('npcflag') & NPC_FLAG_TRAINER)
|
if ($this->subject->getField('npcflag') & NPC_FLAG_TRAINER)
|
||||||
{
|
{
|
||||||
$teachQuery = 'SELECT IFNULL(t2.spell, t1.spell) AS ARRAY_KEY, IFNULL(t2.spellcost, t1.spellcost) AS cost, IFNULL(t2.reqskill, t1.reqskill) AS reqSkillId,
|
$teachQuery = '
|
||||||
IFNULL(t2.reqskillvalue, t1.reqskillvalue) AS reqSkillValue, IFNULL(t2.reqlevel, t1.reqlevel) AS reqLevel
|
SELECT IFNULL(t2.spell, t1.spell) AS ARRAY_KEY,
|
||||||
FROM npc_trainer t1 LEFT JOIN npc_trainer t2 ON t2.entry = IF(t1.spell < 0, -t1.spell, null) WHERE t1.entry = ?d';
|
IFNULL(t2.spellcost, t1.spellcost) AS cost,
|
||||||
|
IFNULL(t2.reqskill, t1.reqskill) AS reqSkillId,
|
||||||
|
IFNULL(t2.reqskillvalue, t1.reqskillvalue) AS reqSkillValue,
|
||||||
|
IFNULL(t2.reqlevel, t1.reqlevel) AS reqLevel
|
||||||
|
FROM npc_trainer t1
|
||||||
|
LEFT JOIN npc_trainer t2 ON t2.entry = IF(t1.spell < 0, -t1.spell, null)
|
||||||
|
WHERE t1.entry = ?d
|
||||||
|
';
|
||||||
|
|
||||||
if ($tSpells = DB::Aowow()->select($teachQuery, $this->typeId))
|
if ($tSpells = DB::Aowow()->select($teachQuery, $this->typeId))
|
||||||
{
|
{
|
||||||
@@ -658,7 +665,7 @@ class NpcPage extends GenericPage
|
|||||||
IF(f.id = RewOnKillRepFaction1, RewOnKillRepValue1, RewOnKillRepValue2) AS qty,
|
IF(f.id = RewOnKillRepFaction1, RewOnKillRepValue1, RewOnKillRepValue2) AS qty,
|
||||||
IF(f.id = RewOnKillRepFaction1, MaxStanding1, MaxStanding2) AS maxRank,
|
IF(f.id = RewOnKillRepFaction1, MaxStanding1, MaxStanding2) AS maxRank,
|
||||||
IF(f.id = RewOnKillRepFaction1, isTeamAward1, isTeamAward2) AS spillover
|
IF(f.id = RewOnKillRepFaction1, isTeamAward1, isTeamAward2) AS spillover
|
||||||
FROM aowow_factions f JOIN creature_onkill_reputation cor ON f.Id = cor.RewOnKillRepFaction1 OR f.Id = cor.RewOnKillRepFaction2 WHERE cor.creature_id IN (?a)';
|
FROM ?_factions f JOIN creature_onkill_reputation cor ON f.Id = cor.RewOnKillRepFaction1 OR f.Id = cor.RewOnKillRepFaction2 WHERE cor.creature_id IN (?a)';
|
||||||
|
|
||||||
foreach (DB::Aowow()->select($q, (array)$entries) as $_)
|
foreach (DB::Aowow()->select($q, (array)$entries) as $_)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -133,7 +133,8 @@ class ObjectPage extends GenericPage
|
|||||||
|
|
||||||
// SpellFocus
|
// SpellFocus
|
||||||
if ($_ = $this->subject->getField('spellFocusId'))
|
if ($_ = $this->subject->getField('spellFocusId'))
|
||||||
$infobox[] = '[tooltip name=focus]'.Lang::$gameObject['focusDesc'].'[/tooltip][span class=tip tooltip=focus]'.Lang::$gameObject['focus'].Lang::$main['colon'].Util::localizedString(DB::Aowow()->selectRow('SELECT * FROM ?_spellFocusObject WHERE id = ?d', $_), 'name').'[/span]';
|
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]
|
// lootinfo: [min, max, restock]
|
||||||
if (($_ = $this->subject->getField('lootStack')) && $_[0])
|
if (($_ = $this->subject->getField('lootStack')) && $_[0])
|
||||||
|
|||||||
@@ -805,7 +805,7 @@ class QuestPage extends GenericPage
|
|||||||
if ($_ = $this->subject->getField('rewardMailTemplateId'))
|
if ($_ = $this->subject->getField('rewardMailTemplateId'))
|
||||||
{
|
{
|
||||||
$delay = $this->subject->getField('rewardMailDelay');
|
$delay = $this->subject->getField('rewardMailDelay');
|
||||||
$letter = DB::Aowow()->selectRow('SELECT * FROM ?_mailTemplate WHERE id = ?d', $_);
|
$letter = DB::Aowow()->selectRow('SELECT * FROM ?_mailtemplate WHERE id = ?d', $_);
|
||||||
|
|
||||||
$mail = array(
|
$mail = array(
|
||||||
'delay' => $delay ? sprintf(Lang::$quest['mailIn'], Util::formatTime($delay * 1000)) : null,
|
'delay' => $delay ? sprintf(Lang::$quest['mailIn'], Util::formatTime($delay * 1000)) : null,
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ class SkillPage extends GenericPage
|
|||||||
$list = DB::Aowow()->selectCol('
|
$list = DB::Aowow()->selectCol('
|
||||||
SELECT IF(t1.entry > 200000, t2.entry, t1.entry)
|
SELECT IF(t1.entry > 200000, t2.entry, t1.entry)
|
||||||
FROM npc_trainer t1
|
FROM npc_trainer t1
|
||||||
JOIN aowow_spell s ON s.id = t1.spell
|
JOIN ?_spell s ON s.id = t1.spell
|
||||||
LEFT JOIN npc_trainer t2 ON t2.spell = -t1.entry
|
LEFT JOIN npc_trainer t2 ON t2.spell = -t1.entry
|
||||||
WHERE s.typeCat IN (-11, 9) AND (s.skillLine1 = ?d OR (s.skillLine1 > 0 AND s.skillLine2OrMask = ?d) '.($mask ? ' OR (s.skilllIne1 = -3 AND s.skillLine2OrMask = '.$mask.')' : null).')',
|
WHERE s.typeCat IN (-11, 9) AND (s.skillLine1 = ?d OR (s.skillLine1 > 0 AND s.skillLine2OrMask = ?d) '.($mask ? ' OR (s.skilllIne1 = -3 AND s.skillLine2OrMask = '.$mask.')' : null).')',
|
||||||
$this->typeId,
|
$this->typeId,
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ class SpellPage extends GenericPage
|
|||||||
// spell focus
|
// spell focus
|
||||||
if ($_ = $this->subject->getField('spellFocusObject'))
|
if ($_ = $this->subject->getField('spellFocusObject'))
|
||||||
{
|
{
|
||||||
$bar = DB::Aowow()->selectRow('SELECT * FROM ?_spellFocusObject WHERE id = ?d', $_);
|
$bar = DB::Aowow()->selectRow('SELECT * FROM ?_spellfocusobject WHERE id = ?d', $_);
|
||||||
$focus = new GameObjectList(array(['spellFocusId', $_], 1));
|
$focus = new GameObjectList(array(['spellFocusId', $_], 1));
|
||||||
$infobox[] = '[li]'.Lang::$game['requires2'].' '.($focus->error ? Util::localizedString($bar, 'name') : '[url=?object='.$focus->id.']'.Util::localizedString($bar, 'name').'[/url]').'[/li]';
|
$infobox[] = '[li]'.Lang::$game['requires2'].' '.($focus->error ? Util::localizedString($bar, 'name') : '[url=?object='.$focus->id.']'.Util::localizedString($bar, 'name').'[/url]').'[/li]';
|
||||||
}
|
}
|
||||||
@@ -1430,7 +1430,7 @@ class SpellPage extends GenericPage
|
|||||||
private function createEffects(&$infobox, &$redButtons)
|
private function createEffects(&$infobox, &$redButtons)
|
||||||
{
|
{
|
||||||
// proc data .. maybe use more information..?
|
// proc data .. maybe use more information..?
|
||||||
$procData = DB::Aowow()->selectRow('SELECT IF(ppmRate > 0, -ppmRate, customChance) AS chance, cooldown FROM world.spell_proc_event WHERE entry = ?d', $this->typeId);
|
$procData = DB::Aowow()->selectRow('SELECT IF(ppmRate > 0, -ppmRate, customChance) AS chance, cooldown FROM spell_proc_event WHERE entry = ?d', $this->typeId);
|
||||||
if (!isset($procData['cooldown']))
|
if (!isset($procData['cooldown']))
|
||||||
$procData['cooldown'] = 0;
|
$procData['cooldown'] = 0;
|
||||||
|
|
||||||
@@ -1569,7 +1569,7 @@ class SpellPage extends GenericPage
|
|||||||
case 53: // Enchant Item Perm
|
case 53: // Enchant Item Perm
|
||||||
case 54: // Enchant Item Temp
|
case 54: // Enchant Item Temp
|
||||||
case 156: // Enchant Item Prismatic
|
case 156: // Enchant Item Prismatic
|
||||||
if ($_ = DB::Aowow()->selectRow('SELECT * FROM ?_itemEnchantment WHERE id = ?d', $effMV))
|
if ($_ = DB::Aowow()->selectRow('SELECT * FROM ?_itemenchantment WHERE id = ?d', $effMV))
|
||||||
$foo['name'] .= ' <span class="q2">'.Util::localizedString($_, 'text').'</span> ('.$effMV.')';
|
$foo['name'] .= ' <span class="q2">'.Util::localizedString($_, 'text').'</span> ('.$effMV.')';
|
||||||
else
|
else
|
||||||
$foo['name'] .= ' #'.$effMV;
|
$foo['name'] .= ' #'.$effMV;
|
||||||
@@ -1611,7 +1611,7 @@ class SpellPage extends GenericPage
|
|||||||
$foo['name'] .= Lang::$main['colon'].$_;
|
$foo['name'] .= Lang::$main['colon'].$_;
|
||||||
break;
|
break;
|
||||||
case 74: // Apply Glyph
|
case 74: // Apply Glyph
|
||||||
if ($_ = DB::Aowow()->selectCell('SELECT spellId FROM ?_glyphProperties WHERE id = ?d', $effMV))
|
if ($_ = DB::Aowow()->selectCell('SELECT spellId FROM ?_glyphproperties WHERE id = ?d', $effMV))
|
||||||
{
|
{
|
||||||
if ($n = SpellList::getName($_))
|
if ($n = SpellList::getName($_))
|
||||||
$foo['name'] .= Lang::$main['colon'].'(<a href="?spell='.$_.'">'.$n.'</a>)';
|
$foo['name'] .= Lang::$main['colon'].'(<a href="?spell='.$_.'">'.$n.'</a>)';
|
||||||
|
|||||||
@@ -76,8 +76,22 @@ class ZonesPage extends GenericPage
|
|||||||
if ($mapFile)
|
if ($mapFile)
|
||||||
{
|
{
|
||||||
$somData = ['flightmaster' => []];
|
$somData = ['flightmaster' => []];
|
||||||
$nodes = DB::Aowow()->select('SELECT id AS ARRAY_KEY, tn.* FROM ?_taxiNodes tn WHERE mapId = ?d ', $spawnMap);
|
$nodes = DB::Aowow()->select('SELECT id AS ARRAY_KEY, tn.* FROM ?_taxinodes tn WHERE mapId = ?d ', $spawnMap);
|
||||||
$paths = DB::Aowow()->select('SELECT IF(tn1.reactA = tn1.reactH AND tn2.reactA = tn2.reactH, 1, 0) AS neutral, tp.startNodeId AS startId, tn1.posX AS startPosX, tn1.posY AS startPosY, tp.endNodeId AS endId, tn2.posX AS endPosX, tn2.posY AS endPosY FROM ?_taxiPath tp, ?_taxiNodes tn1 , ?_taxiNodes tn2 WHERE tn1.Id = tp.endNodeId AND tn2.Id = tp.startNodeId AND (tp.startNodeId IN (?a) OR tp.EndNodeId IN (?a))', array_keys($nodes), array_keys($nodes));
|
$paths = DB::Aowow()->select('
|
||||||
|
SELECT IF(tn1.reactA = tn1.reactH AND tn2.reactA = tn2.reactH, 1, 0) AS neutral,
|
||||||
|
tp.startNodeId AS startId,
|
||||||
|
tn1.posX AS startPosX,
|
||||||
|
tn1.posY AS startPosY,
|
||||||
|
tp.endNodeId AS endId,
|
||||||
|
tn2.posX AS endPosX,
|
||||||
|
tn2.posY AS endPosY
|
||||||
|
FROM ?_taxipath tp,
|
||||||
|
?_taxinodes tn1,
|
||||||
|
?_taxinodes tn2
|
||||||
|
WHERE tn1.Id = tp.endNodeId AND
|
||||||
|
tn2.Id = tp.startNodeId AND
|
||||||
|
(tp.startNodeId IN (?a) OR tp.EndNodeId IN (?a))
|
||||||
|
', array_keys($nodes), array_keys($nodes));
|
||||||
|
|
||||||
foreach ($nodes as $i => $n)
|
foreach ($nodes as $i => $n)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user