mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
- implemented use of itemExtendedCost and fueled some more item-tabs with it
- tinkering with learned spells and added teach-tabs to item.php - required arenaRating in item tooltips - updated js-functions handling currencies - updated Markup with correct links - i probably forgot to add sql
This commit is contained in:
@@ -105,7 +105,7 @@ define('GLOBALINFO_ANY', 0xF);
|
|||||||
define('ITEMINFO_JSON', 0x01);
|
define('ITEMINFO_JSON', 0x01);
|
||||||
define('ITEMINFO_SUBITEMS', 0x02);
|
define('ITEMINFO_SUBITEMS', 0x02);
|
||||||
define('ITEMINFO_VENDOR', 0x04);
|
define('ITEMINFO_VENDOR', 0x04);
|
||||||
// define('ITEMINFO_LOOT', 0x08); // get these infos from dedicatd loot function [count, stack, pctstack, modes]
|
// define('ITEMINFO_LOOT', 0x08); // get these infos from dedicatd loot function [count, stack, pctstack, modes]
|
||||||
define('ITEMINFO_GEM', 0x10);
|
define('ITEMINFO_GEM', 0x10);
|
||||||
define('ITEMINFO_MODEL', 0x20);
|
define('ITEMINFO_MODEL', 0x20);
|
||||||
|
|
||||||
|
|||||||
@@ -151,15 +151,17 @@ class CreatureList extends BaseType
|
|||||||
'minlevel' => $this->curTpl['minlevel'],
|
'minlevel' => $this->curTpl['minlevel'],
|
||||||
'maxlevel' => $this->curTpl['maxlevel'],
|
'maxlevel' => $this->curTpl['maxlevel'],
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'boss' => $this->curTpl['type_flags'] & 0x4,
|
'boss' => $this->curTpl['type_flags'] & 0x4 ? 1 : 0,
|
||||||
'rank' => $this->curTpl['rank'],
|
'rank' => $this->curTpl['rank'], // classification(?)
|
||||||
'location' => json_encode($this->getSpawns(SPAWNINFO_ZONES), JSON_NUMERIC_CHECK),
|
'location' => $this->getSpawns(SPAWNINFO_ZONES),
|
||||||
'name' => $this->getField('name', true),
|
'name' => $this->getField('name', true),
|
||||||
'tag' => $this->getField('subname', true),
|
|
||||||
'type' => $this->curTpl['type'],
|
'type' => $this->curTpl['type'],
|
||||||
'react' => '['.$this->curTpl['A'].', '.$this->curTpl['H'].']'
|
'react' => '['.$this->curTpl['A'].', '.$this->curTpl['H'].']'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($_ = $this->getField('subname', true))
|
||||||
|
$data[$this->id]['tag'] = $_;
|
||||||
|
|
||||||
if ($addInfoMask & NPCINFO_TAMEABLE) // only first skin of first model ... we're omitting potentially 11 skins here .. but the lv accepts only one .. w/e
|
if ($addInfoMask & NPCINFO_TAMEABLE) // only first skin of first model ... we're omitting potentially 11 skins here .. but the lv accepts only one .. w/e
|
||||||
$data[$this->id]['skin'] = $this->curTpl['textureString'];
|
$data[$this->id]['skin'] = $this->curTpl['textureString'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,9 +31,16 @@ class CurrencyList extends BaseType
|
|||||||
{
|
{
|
||||||
foreach ($this->iterate() as $__)
|
foreach ($this->iterate() as $__)
|
||||||
{
|
{
|
||||||
|
if ($this->id == 104) // in case of honor commit sebbuku
|
||||||
|
$icon = ['alliance-icon', 'horde-icon'];
|
||||||
|
else if ($this->id == 103) // also arena-icon diffs from item-icon
|
||||||
|
$icon = ['money_arena', 'money_arena'];
|
||||||
|
else
|
||||||
|
$icon = [$this->curTpl['iconString'], $this->curTpl['iconString']];
|
||||||
|
|
||||||
$template->extendGlobalData(self::$type, [$this->id => array(
|
$template->extendGlobalData(self::$type, [$this->id => array(
|
||||||
'name' => $this->getField('name', true),
|
'name' => $this->getField('name', true),
|
||||||
'icon' => $this->curTpl['iconString']
|
'icon' => $icon
|
||||||
)]);
|
)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ class ItemList extends BaseType
|
|||||||
public $subItems = [];
|
public $subItems = [];
|
||||||
|
|
||||||
private $ssd = [];
|
private $ssd = [];
|
||||||
|
private $vendors = [];
|
||||||
|
|
||||||
protected $queryBase = 'SELECT i.*, i.id AS ARRAY_KEY FROM ?_items i';
|
protected $queryBase = 'SELECT i.*, i.id AS ARRAY_KEY FROM ?_items i';
|
||||||
protected $queryOpts = array(
|
protected $queryOpts = array(
|
||||||
@@ -74,10 +75,102 @@ class ItemList extends BaseType
|
|||||||
return Util::localizedString($n, 'name');
|
return Util::localizedString($n, 'name');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getExtendedCost()
|
// todo (high): there are cases, where the same items has different extendedCosts attached (through different vendors)
|
||||||
|
// needs a way to filter for a specific currency/token to accomodate currencyFor-Tabs
|
||||||
|
// needs a way to filter for a specific vendor to accomodate soldBy-Tabs
|
||||||
|
|
||||||
|
public function getExtendedCost(&$reqRating = 0)
|
||||||
{
|
{
|
||||||
// placeholder
|
if (!empty($this->vendors))
|
||||||
return []; // [id => qty]
|
return $this->vendors;
|
||||||
|
|
||||||
|
$ids = array_keys($this->templates);
|
||||||
|
$itemz = DB::Aowow()->select('
|
||||||
|
SELECT nv.item AS ARRAY_KEY1, nv.entry AS ARRAY_KEY2, 0 AS eventId, nv.maxcount, iec.* FROM npc_vendor nv LEFT JOIN ?_itemextendedcost iec ON nv.extendedCost = iec.id WHERE nv.item IN (?a)
|
||||||
|
UNION
|
||||||
|
SELECT genv.item AS ARRAY_KEY1, c.id AS ARRAY_KEY2, genv.eventEntry AS eventId, genv.maxcount, iec.* FROM game_event_npc_vendor genv JOIN creature c ON c.guid = genv.guid LEFT JOIN ?_itemextendedcost iec ON genv.extendedCost = iec.id WHERE genv.item IN (?a)',
|
||||||
|
$ids,
|
||||||
|
$ids
|
||||||
|
);
|
||||||
|
|
||||||
|
$cItems = [];
|
||||||
|
foreach ($itemz as &$vendors)
|
||||||
|
{
|
||||||
|
foreach ($vendors as $k => $costs)
|
||||||
|
{
|
||||||
|
$data = array(
|
||||||
|
'stock' => $costs['maxcount'] ? $costs['maxcount'] : -1,
|
||||||
|
'event' => $costs['eventId']
|
||||||
|
);
|
||||||
|
|
||||||
|
// reqRating ins't really a cost .. so pass it by ref instead of return
|
||||||
|
// note: how to distinguish between brackets .. or team/pers-rating?
|
||||||
|
if ($_ = @$costs['reqPersonalRating'])
|
||||||
|
$reqRating = $_;
|
||||||
|
|
||||||
|
if ($_ = $this->getField('buyPrice')) // somewhat nonsense.. is identical for all vendors (obviously)
|
||||||
|
$data[0] = $_;
|
||||||
|
|
||||||
|
// hardcode arena(103) & honor(104)
|
||||||
|
if ($_ = @$costs['reqArenaPoints'])
|
||||||
|
{
|
||||||
|
$data[-103] = $_;
|
||||||
|
Util::$pageTemplate->extendGlobalIds(TYPE_CURRENCY, 103);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_ = @$costs['reqHonorPoints'])
|
||||||
|
{
|
||||||
|
$data[-104] = $_;
|
||||||
|
Util::$pageTemplate->extendGlobalIds(TYPE_CURRENCY, 104);
|
||||||
|
}
|
||||||
|
|
||||||
|
for ($i = 1; $i < 6; $i++)
|
||||||
|
{
|
||||||
|
if (($_ = @$costs['reqItemId'.$i]) && $costs['itemCount'.$i] > 0)
|
||||||
|
{
|
||||||
|
$data[$_] = $costs['itemCount'.$i];
|
||||||
|
$cItems[] = $_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$vendors[$k] = $data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// convert items to currency if possible
|
||||||
|
$moneyItems = new CurrencyList(array(['itemId', $cItems]));
|
||||||
|
$moneyItems->addGlobalsToJscript(Util::$pageTemplate);
|
||||||
|
|
||||||
|
foreach ($itemz as $id => &$vendors)
|
||||||
|
{
|
||||||
|
foreach ($vendors as &$costs)
|
||||||
|
{
|
||||||
|
foreach ($costs as $k => $v)
|
||||||
|
{
|
||||||
|
if (in_array($k, $cItems))
|
||||||
|
{
|
||||||
|
$found = false;
|
||||||
|
foreach ($moneyItems->iterate() as $__)
|
||||||
|
{
|
||||||
|
if ($moneyItems->getField('itemId') == $k)
|
||||||
|
{
|
||||||
|
unset($costs[$k]);
|
||||||
|
$costs[-$moneyItems->id] = $v;
|
||||||
|
$found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$found)
|
||||||
|
Util::$pageTemplate->extendGlobalIds(TYPE_ITEM, $k);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->vendors[$id] = $vendors;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->vendors;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getListviewData($addInfoMask = 0x0)
|
public function getListviewData($addInfoMask = 0x0)
|
||||||
@@ -131,18 +224,37 @@ class ItemList extends BaseType
|
|||||||
|
|
||||||
if ($addInfoMask & ITEMINFO_VENDOR)
|
if ($addInfoMask & ITEMINFO_VENDOR)
|
||||||
{
|
{
|
||||||
$data[$this->id]['cost'] = []; // [money, honor (>0:ally; <0:horde), arena, [items?]]
|
// just use the first reseults
|
||||||
|
if ($cost = @reset($this->getExtendedCost()[$this->id]));
|
||||||
|
{
|
||||||
|
$currency = [];
|
||||||
|
$tokens = [];
|
||||||
|
foreach ($cost as $k => $qty)
|
||||||
|
{
|
||||||
|
if (is_string($k))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ($k > 0)
|
||||||
|
$tokens[] = [$k, $qty];
|
||||||
|
else if ($k < 0)
|
||||||
|
$currency[] = [-$k, $qty];
|
||||||
|
}
|
||||||
|
$data[$this->id]['stock'] = $cost['stock'];
|
||||||
|
$data[$this->id]['cost'] = array(
|
||||||
|
$this->getField('buyPrice'),
|
||||||
|
$currency ? $currency : null,
|
||||||
|
$tokens ? $tokens : null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if ($x = $this->curTpl['buyPrice'])
|
if ($x = $this->curTpl['buyPrice'])
|
||||||
{
|
|
||||||
$data[$this->id]['buyprice'] = $x;
|
$data[$this->id]['buyprice'] = $x;
|
||||||
$data[$this->id]['cost'][0] = $x;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($x = $this->curTpl['sellPrice'])
|
if ($x = $this->curTpl['sellPrice'])
|
||||||
$data[$this->id]['sellprice'] = $x;
|
$data[$this->id]['sellprice'] = $x;
|
||||||
|
|
||||||
// todo (med): use extended cost table to fill arena points ect
|
if ($x = $this->curTpl['buyCount'])
|
||||||
|
$data[$this->id]['stack'] = $x;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->curTpl['class'] == ITEM_CLASS_GLYPH)
|
if ($this->curTpl['class'] == ITEM_CLASS_GLYPH)
|
||||||
@@ -171,7 +283,7 @@ class ItemList extends BaseType
|
|||||||
$data[$this->id]['reqrace'] = $_;
|
$data[$this->id]['reqrace'] = $_;
|
||||||
|
|
||||||
if ($_ = $this->curTpl['requiredClass'])
|
if ($_ = $this->curTpl['requiredClass'])
|
||||||
$data[$this->id]['reqclass'] = $_; // $data[$this->id]['classes'] ??
|
$data[$this->id]['reqclass'] = $_; // $data[$this->id]['classes'] ??
|
||||||
|
|
||||||
if ($this->curTpl['flags'] & ITEM_FLAG_HEROIC)
|
if ($this->curTpl['flags'] & ITEM_FLAG_HEROIC)
|
||||||
$data[$this->id]['heroic'] = true;
|
$data[$this->id]['heroic'] = true;
|
||||||
@@ -182,17 +294,10 @@ class ItemList extends BaseType
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* even more complicated crap
|
/* even more complicated crap
|
||||||
"source":[5],
|
"source":[5],"sourcemore":[{"n":"Commander Oxheart","t":1,"ti":64606,"z":5842}],
|
||||||
"sourcemore":[{"z":3703}],
|
|
||||||
|
|
||||||
{"source":[5],"sourcemore":[{"n":"Commander Oxheart","t":1,"ti":64606,"z":5842}],
|
|
||||||
|
|
||||||
cost:[] format unk 0:copper, 1:[items]? 2, 3, 4, 5
|
|
||||||
avail unk
|
avail unk
|
||||||
rel unk
|
rel unk
|
||||||
modelviewer {type:X, displayid:Y, slot:z} .. not sure, when to set
|
modelviewer {type:X, displayid:Y, slot:z} .. not sure, when to set
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
@@ -572,6 +677,10 @@ class ItemList extends BaseType
|
|||||||
else if ($_reqLvl > 1)
|
else if ($_reqLvl > 1)
|
||||||
$x .= sprintf(Lang::$game['reqLevel'], $_reqLvl).'<br />';
|
$x .= sprintf(Lang::$game['reqLevel'], $_reqLvl).'<br />';
|
||||||
|
|
||||||
|
// required arena team raing / perosnal rating / todo (low): sort out what kind of rating
|
||||||
|
if (@$this->getExtendedCost($reqRating)[$this->id] && $reqRating)
|
||||||
|
$x .= sprintf(Lang::$item['reqRating'], $reqRating);
|
||||||
|
|
||||||
// item level
|
// item level
|
||||||
if (in_array($_class, [ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON]))
|
if (in_array($_class, [ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON]))
|
||||||
$x .= Lang::$item['itemLevel'].' '.$this->curTpl['itemLevel'].'<br />';
|
$x .= Lang::$item['itemLevel'].' '.$this->curTpl['itemLevel'].'<br />';
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ class WorldEventList extends BaseType
|
|||||||
{
|
{
|
||||||
public static $type = TYPE_WORLDEVENT;
|
public static $type = TYPE_WORLDEVENT;
|
||||||
|
|
||||||
protected $queryBase = 'SELECT *, -e.id AS ARRAY_KEY, -e.id as id FROM ?_events e LEFT JOIN ?_holidays h ON e.holidayId = h.id';
|
protected $queryBase = 'SELECT *, -e.id AS ARRAY_KEY, -e.id as id FROM ?_events e';
|
||||||
protected $queryOpts = ['e' => ['o' => '-e.id ASC']];
|
protected $queryOpts = ['e' => ['j' => ['?_holidays h ON e.holidayId = h.id', true], 'o' => '-e.id ASC']];
|
||||||
|
|
||||||
public function __construct($conditions = [])
|
public function __construct($conditions = [])
|
||||||
{
|
{
|
||||||
@@ -36,6 +36,8 @@ class WorldEventList extends BaseType
|
|||||||
if ($this->curTpl['requires'])
|
if ($this->curTpl['requires'])
|
||||||
$this->curTpl['requires'] = explode(' ', $this->curTpl['requires']);
|
$this->curTpl['requires'] = explode(' ', $this->curTpl['requires']);
|
||||||
|
|
||||||
|
$this->curTpl['eventBak'] = -$this->curTpl['id'];
|
||||||
|
|
||||||
// change Ids if holiday is set
|
// change Ids if holiday is set
|
||||||
if ($this->curTpl['holidayId'] > 0)
|
if ($this->curTpl['holidayId'] > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1767,7 +1767,7 @@ class Util
|
|||||||
return false; // always false for passed arrays
|
return false; // always false for passed arrays
|
||||||
}
|
}
|
||||||
|
|
||||||
public function arraySumByKey(&$ref)
|
public static function arraySumByKey(&$ref)
|
||||||
{
|
{
|
||||||
$nArgs = func_num_args();
|
$nArgs = func_num_args();
|
||||||
if (!is_array($ref) || $nArgs < 2)
|
if (!is_array($ref) || $nArgs < 2)
|
||||||
@@ -1789,6 +1789,45 @@ class Util
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getTaughtSpells(&$spell)
|
||||||
|
{
|
||||||
|
$extraIds = [-1]; // init with -1 to prevent empty-array errors
|
||||||
|
$lookup = [-1];
|
||||||
|
switch (gettype($spell))
|
||||||
|
{
|
||||||
|
case 'object':
|
||||||
|
if (get_class($spell) != 'SpellList')
|
||||||
|
return [];
|
||||||
|
|
||||||
|
$lookup[] = $spell->id;
|
||||||
|
foreach ($spell->canTeachSpell() as $idx)
|
||||||
|
$extraIds[] = $spell->getField('effect'.$idx.'TriggerSpell');
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 'integer':
|
||||||
|
$lookup[] = $spell;
|
||||||
|
break;
|
||||||
|
case 'array':
|
||||||
|
$lookup = $spell;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = array_merge(
|
||||||
|
DB::Aowow()->selectCol('SELECT spellId FROM spell_learn_spell WHERE entry IN (?a)', $lookup),
|
||||||
|
DB::Aowow()->selectCol('SELECT spellId FROM skill_discovery_template WHERE reqSpell IN (?a)', $lookup), // note: omits required spell and chance
|
||||||
|
$extraIds
|
||||||
|
);
|
||||||
|
|
||||||
|
// return list of integers, not strings
|
||||||
|
array_walk($data, function (&$v, $k) {
|
||||||
|
$v = intVal($v);
|
||||||
|
});
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
/* from TC wiki
|
/* from TC wiki
|
||||||
fishing_loot_template no relation entry is linked with ID of the fishing zone or area
|
fishing_loot_template no relation entry is linked with ID of the fishing zone or area
|
||||||
creature_loot_template entry many <- many creature_template lootid
|
creature_loot_template entry many <- many creature_template lootid
|
||||||
@@ -2085,12 +2124,12 @@ class Util
|
|||||||
{
|
{
|
||||||
$data = array(
|
$data = array(
|
||||||
'percent' => $chance,
|
'percent' => $chance,
|
||||||
'stack' => [$ref['multiplier'], $ref['multiplier']],
|
'stack' => [$ref['min'], $ref['max']],
|
||||||
'count' => 1 // ..and one for the sort script
|
'count' => 1 // ..and one for the sort script
|
||||||
);
|
);
|
||||||
|
|
||||||
$stack = []; // equal distribution between min/max .. not blizzlike, but hey, TC-issue
|
$stack = []; // equal distribution between min/max .. not blizzlike, but hey, TC-issue
|
||||||
if ($ref['max'] > $ref['min'])
|
if ($ref['max'] > 1)
|
||||||
for ($i = $ref['min']; $i <= $ref['max']; $i++)
|
for ($i = $ref['min']; $i <= $ref['max']; $i++)
|
||||||
$stack[$i] = round(100 / (1 + $ref['max'] - $ref['min']), 3);
|
$stack[$i] = round(100 / (1 + $ref['max'] - $ref['min']), 3);
|
||||||
|
|
||||||
|
|||||||
@@ -543,6 +543,7 @@ $lang = array(
|
|||||||
'_rndEnchants' => "Zufällige Verzauberungen",
|
'_rndEnchants' => "Zufällige Verzauberungen",
|
||||||
'_chance' => "(Chance von %s%%)",
|
'_chance' => "(Chance von %s%%)",
|
||||||
'_reqLevel' => "Mindeststufe",
|
'_reqLevel' => "Mindeststufe",
|
||||||
|
'reqRating' => "Benötigt eine persönliche Arenawertung und Teamwertung von %d.",
|
||||||
'slot' => "Platz",
|
'slot' => "Platz",
|
||||||
'_quality' => "Qualität",
|
'_quality' => "Qualität",
|
||||||
'usableBy' => "Benutzbar von",
|
'usableBy' => "Benutzbar von",
|
||||||
|
|||||||
@@ -530,6 +530,7 @@ $lang = array(
|
|||||||
'_rndEnchants' => "Random Enchantments",
|
'_rndEnchants' => "Random Enchantments",
|
||||||
'_chance' => "(%s%% chance)",
|
'_chance' => "(%s%% chance)",
|
||||||
'_reqLevel' => "Required level",
|
'_reqLevel' => "Required level",
|
||||||
|
'reqRating' => "Requires personal and team arena rating of %d<br />in 3v3 or 5v5 brackets",
|
||||||
'slot' => "Slot",
|
'slot' => "Slot",
|
||||||
'_quality' => "Quality",
|
'_quality' => "Quality",
|
||||||
'usableBy' => "Usable by",
|
'usableBy' => "Usable by",
|
||||||
|
|||||||
@@ -501,6 +501,7 @@ $lang = array(
|
|||||||
'_rndEnchants' => "Encantamientos aleatorios",
|
'_rndEnchants' => "Encantamientos aleatorios",
|
||||||
'_chance' => "(probabilidad %s%%)",
|
'_chance' => "(probabilidad %s%%)",
|
||||||
'_reqLevel' => "Nivel requerido",
|
'_reqLevel' => "Nivel requerido",
|
||||||
|
'reqRating' => "Requiere un índice de arena personal y de equipo de %d",
|
||||||
'slot' => "Casilla",
|
'slot' => "Casilla",
|
||||||
'_quality' => "Calidad",
|
'_quality' => "Calidad",
|
||||||
'usableBy' => "Usable por",
|
'usableBy' => "Usable por",
|
||||||
|
|||||||
@@ -501,6 +501,7 @@ $lang = array(
|
|||||||
'_rndEnchants' => "Enchantements aléatoires",
|
'_rndEnchants' => "Enchantements aléatoires",
|
||||||
'_chance' => "(%s%% de chance)",
|
'_chance' => "(%s%% de chance)",
|
||||||
'_reqLevel' => "Niveau requis",
|
'_reqLevel' => "Niveau requis",
|
||||||
|
'reqRating' => "Nécessite une cote d'arène personnelle et en équipe de %d<br />en arène de 3c3 ou 5c5.",
|
||||||
'slot' => "Emplacement",
|
'slot' => "Emplacement",
|
||||||
'_quality' => "Qualité",
|
'_quality' => "Qualité",
|
||||||
'usableBy' => "Utilisable par",
|
'usableBy' => "Utilisable par",
|
||||||
|
|||||||
@@ -501,6 +501,7 @@ $lang = array(
|
|||||||
'_rndEnchants' => "Случайные улучшения",
|
'_rndEnchants' => "Случайные улучшения",
|
||||||
'_chance' => "(шанс %s%%)",
|
'_chance' => "(шанс %s%%)",
|
||||||
'_reqLevel' => "Требуется уровень",
|
'_reqLevel' => "Требуется уровень",
|
||||||
|
'reqRating' => "Требуется личный и командный рейтинг на арене не ниже %d",
|
||||||
'slot' => "Слот",
|
'slot' => "Слот",
|
||||||
'_quality' => "Качество",
|
'_quality' => "Качество",
|
||||||
'usableBy' => "Используется (кем)",
|
'usableBy' => "Используется (кем)",
|
||||||
@@ -561,8 +562,8 @@ $lang = array(
|
|||||||
)),
|
)),
|
||||||
1 => array("Контейнеры", array(
|
1 => array("Контейнеры", array(
|
||||||
0 => "Сумки", 1 => "Сумки душ", 3 => "Сумки зачаровывателя", 4 => "Сумки инженера", 7 => "Сумки кожевника", 8 => "Сумки начертателя",
|
0 => "Сумки", 1 => "Сумки душ", 3 => "Сумки зачаровывателя", 4 => "Сумки инженера", 7 => "Сумки кожевника", 8 => "Сумки начертателя",
|
||||||
2 => "Сумки травника", 6 => "Сумки шахтера", 5 => "Сумки ювелира",
|
2 => "Сумки травника", 6 => "Сумки шахтера", 5 => "Сумки ювелира",
|
||||||
|
|
||||||
)),
|
)),
|
||||||
0 => array("Расходуемые", array(
|
0 => array("Расходуемые", array(
|
||||||
7 => "Бинты", 5 => "Еда и напитки", 1 => "Зелья", 0 => "Расходуемые", 4 => "Свитки", -3 => "Улучшения (временные)",
|
7 => "Бинты", 5 => "Еда и напитки", 1 => "Зелья", 0 => "Расходуемые", 4 => "Свитки", -3 => "Улучшения (временные)",
|
||||||
|
|||||||
260
pages/item.php
260
pages/item.php
@@ -77,9 +77,12 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
|
|||||||
|
|
||||||
$_flags = $item->getField('flags');
|
$_flags = $item->getField('flags');
|
||||||
$_slot = $item->getField('slot');
|
$_slot = $item->getField('slot');
|
||||||
$_subClass = $item->getField('subClass');
|
|
||||||
$_class = $item->getField('class');
|
$_class = $item->getField('class');
|
||||||
|
$_subClass = $item->getField('subClass');
|
||||||
$_bagFamily = $item->getField('bagFamily');
|
$_bagFamily = $item->getField('bagFamily');
|
||||||
|
$_extCost = [];
|
||||||
|
if ($_ = @$item->getExtendedCost($_reqRating)[$item->id])
|
||||||
|
$_extCost = $_;
|
||||||
|
|
||||||
/***********/
|
/***********/
|
||||||
/* Infobox */
|
/* Infobox */
|
||||||
@@ -127,17 +130,37 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
|
|||||||
if ($tName = DB::Aowow()->selectRow('SELECT * FROM ?_totemCategory WHERE id = ?d', $tId))
|
if ($tName = DB::Aowow()->selectRow('SELECT * FROM ?_totemCategory WHERE id = ?d', $tId))
|
||||||
$quickInfo[] = Lang::$item['tool'].Lang::$colon.'[url=?items&filter=cr=91;crs='.$tId.';crv=0]'.Util::localizedString($tName, 'name').'[/url]';
|
$quickInfo[] = Lang::$item['tool'].Lang::$colon.'[url=?items&filter=cr=91;crs='.$tId.';crv=0]'.Util::localizedString($tName, 'name').'[/url]';
|
||||||
|
|
||||||
$each = $item->getField('stackable') > 1 ? '[color=q0] ('.Lang::$item['each'].')[/color]' : null;
|
$each = $item->getField('stackable') > 1 ? '[color=q0] ('.Lang::$item['each'].')[/color]' : null;
|
||||||
$cost = '';
|
$tokens = $currency = [];
|
||||||
if ($_ = $item->getField('buyPrice'))
|
if ($_ = reset($_extCost))
|
||||||
$cost .= '[money='.$_.']';
|
{
|
||||||
|
|
||||||
if ($_ = $item->getExtendedCost())
|
|
||||||
foreach ($_ as $c => $qty)
|
foreach ($_ as $c => $qty)
|
||||||
$cost .= '[currency='.$c.' amount='.$qty.']';
|
{
|
||||||
|
if (is_string($c))
|
||||||
|
continue;
|
||||||
|
|
||||||
if ($cost)
|
if ($c < 0) // currency items (and honor or arena)
|
||||||
$quickInfo[] = Lang::$item['cost'].Lang::$colon.$cost.$each;
|
$currency[] = -$c.','.$qty;
|
||||||
|
else if ($c > 0) // plain items (item1,count1,item2,count2,...)
|
||||||
|
$tokens[$c] = $c.','.$qty;
|
||||||
|
}
|
||||||
|
|
||||||
|
$cost = isset($_[0]) ? '[money='.$_[0] : '[money';
|
||||||
|
|
||||||
|
if ($tokens)
|
||||||
|
$cost .= ' items='.implode(',', $tokens);
|
||||||
|
|
||||||
|
if ($currency)
|
||||||
|
$cost .= ' currency='.implode(',', $currency);
|
||||||
|
|
||||||
|
$cost .= ']';
|
||||||
|
|
||||||
|
if ($cost)
|
||||||
|
$quickInfo[] = Lang::$item['cost'].Lang::$colon.$cost.$each;
|
||||||
|
|
||||||
|
if ($_reqRating)
|
||||||
|
$quickInfo[] = sprintf(Lang::$item['reqRating'], $_reqRating);
|
||||||
|
}
|
||||||
|
|
||||||
if ($_ = $item->getField('repairPrice'))
|
if ($_ = $item->getField('repairPrice'))
|
||||||
$quickInfo[] = Lang::$item['repairCost'].Lang::$colon.'[money='.$_.']';
|
$quickInfo[] = Lang::$item['repairCost'].Lang::$colon.'[money='.$_.']';
|
||||||
@@ -274,7 +297,7 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
|
|||||||
{
|
{
|
||||||
for ($i = 1; $i < count($pageData['page']['subItems']); $i++)
|
for ($i = 1; $i < count($pageData['page']['subItems']); $i++)
|
||||||
{
|
{
|
||||||
$prev = &$pageData['page']['subItems'][$i-1];
|
$prev = &$pageData['page']['subItems'][$i - 1];
|
||||||
$cur = &$pageData['page']['subItems'][$i];
|
$cur = &$pageData['page']['subItems'][$i];
|
||||||
if ($prev['jsonequip'] == $cur['jsonequip'] && $prev['name'] == $cur['name'])
|
if ($prev['jsonequip'] == $cur['jsonequip'] && $prev['name'] == $cur['name'])
|
||||||
{
|
{
|
||||||
@@ -290,21 +313,20 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
|
|||||||
$pendant = DB::Aowow()->selectCell('SELECT IF(horde_id = ?d, alliance_id, -horde_id) FROM player_factionchange_items WHERE alliance_id = ?d OR horde_id = ?d', $_id, $_id, $_id);
|
$pendant = DB::Aowow()->selectCell('SELECT IF(horde_id = ?d, alliance_id, -horde_id) FROM player_factionchange_items WHERE alliance_id = ?d OR horde_id = ?d', $_id, $_id, $_id);
|
||||||
if ($pendant)
|
if ($pendant)
|
||||||
{
|
{
|
||||||
$altItem = new ItemList(array(['id', abs($pendant)])); // todo (med): include this item in tab: "see also"
|
$altItem = new ItemList(array(['id', abs($pendant)]));
|
||||||
if (!$altItem->error)
|
if (!$altItem->error)
|
||||||
{
|
{
|
||||||
$pageData['page']['transfer'] = array(
|
$pageData['page']['transfer'] = array(
|
||||||
'id' => $altItem->id,
|
'id' => $altItem->id,
|
||||||
'quality' => $altItem->getField('quality'),
|
'quality' => $altItem->getField('quality'),
|
||||||
'icon' => $altItem->getField('iconString'),
|
'icon' => $altItem->getField('iconString'),
|
||||||
'name' => $altItem->getField('name', true),
|
'name' => $altItem->getField('name', true),
|
||||||
'facInt' => $pendant > 0 ? 'alliance' : 'horde',
|
'facInt' => $pendant > 0 ? 'alliance' : 'horde',
|
||||||
'facName' => $pendant > 0 ? Lang::$game['si'][1] : Lang::$game['si'][2]
|
'facName' => $pendant > 0 ? Lang::$game['si'][1] : Lang::$game['si'][2]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
/**************/
|
/**************/
|
||||||
/* Extra Tabs */
|
/* Extra Tabs */
|
||||||
/**************/
|
/**************/
|
||||||
@@ -728,7 +750,24 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// tab: see also
|
// tab: see also
|
||||||
$saItems = new ItemList(array(['id', $_id, '!'], ['name_loc'.User::$localeId, $item->getField('name', true)]));
|
$conditions = array(
|
||||||
|
['id', $_id, '!'],
|
||||||
|
[
|
||||||
|
'OR',
|
||||||
|
['name_loc'.User::$localeId, $item->getField('name', true)],
|
||||||
|
[
|
||||||
|
'AND',
|
||||||
|
['class', $_class],
|
||||||
|
['subClass', $_subClass],
|
||||||
|
['itemLevel', $item->getField('itemLevel') - 15, '>'],
|
||||||
|
['itemLevel', $item->getField('itemLevel') + 15, '<'],
|
||||||
|
['quality', $item->getField('quality')],
|
||||||
|
['requiredClass', $item->getField('requiredClass')]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
$saItems = new ItemList($conditions);
|
||||||
if (!$saItems->error)
|
if (!$saItems->error)
|
||||||
{
|
{
|
||||||
$saItems->addGlobalsToJscript($smarty, GLOBALINFO_SELF);
|
$saItems->addGlobalsToJscript($smarty, GLOBALINFO_SELF);
|
||||||
@@ -744,7 +783,25 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// tab: starts (quest) [omited, because the questlink IS ALREADY in the item tooltip]
|
// tab: starts (quest)
|
||||||
|
if ($qId = $item->getField('startQuest'))
|
||||||
|
{
|
||||||
|
$starts = new QuestList(array(['qt.id', $qId]));
|
||||||
|
if (!$starts->error)
|
||||||
|
{
|
||||||
|
$starts->addGlobalsToJscript($stmarty);
|
||||||
|
|
||||||
|
$pageData['relTabs'][] = array(
|
||||||
|
'file' => 'item',
|
||||||
|
'data' => $starts->getListviewData(),
|
||||||
|
'params' => [
|
||||||
|
'tabs' => '$tabsRelated',
|
||||||
|
'name' => '$LANG.tab_starts',
|
||||||
|
'id' => 'starts-quest'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// tab: objective of (quest)
|
// tab: objective of (quest)
|
||||||
$conditions = array(
|
$conditions = array(
|
||||||
@@ -791,7 +848,7 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// tab: same model as
|
// tab: same model as
|
||||||
if ($model = $item->getField('model'))
|
if (($model = $item->getField('model')) && $_slot)
|
||||||
{
|
{
|
||||||
$sameModel = new ItemList(array(['model', $model], ['id', $_id, '!']));
|
$sameModel = new ItemList(array(['model', $model], ['id', $_id, '!']));
|
||||||
if (!$sameModel->error)
|
if (!$sameModel->error)
|
||||||
@@ -811,11 +868,164 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// sold by [consult itemExtendedCost]
|
// tab: sold by
|
||||||
|
if ($vendors = $_extCost)
|
||||||
|
{
|
||||||
|
$soldBy = new CreatureList(array(['id', array_keys($vendors)]));
|
||||||
|
if (!$soldBy->error)
|
||||||
|
{
|
||||||
|
$soldBy->addGlobalsToJscript($smarty, GLOBALINFO_SELF);
|
||||||
|
$sbData = $soldBy->getListviewData();
|
||||||
|
|
||||||
// currency for
|
$extraCols = ['Listview.extraCols.stock', "Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack')", 'Listview.extraCols.cost'];
|
||||||
|
|
||||||
// teaches
|
$holidays = [];
|
||||||
|
foreach ($sbData as $k => &$row)
|
||||||
|
{
|
||||||
|
$currency = [];
|
||||||
|
$tokens = [];
|
||||||
|
foreach ($vendors[$k] as $id => $qty)
|
||||||
|
{
|
||||||
|
if (is_string($id))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ($id > 0)
|
||||||
|
$tokens[] = [$id, $qty];
|
||||||
|
else if ($id < 0)
|
||||||
|
$currency[] = [-$id, $qty];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_ = $vendors[$k]['event'])
|
||||||
|
{
|
||||||
|
if (count($extraCols) == 3) // not already pushed
|
||||||
|
$extraCols[] = 'Listview.extraCols.condition';
|
||||||
|
|
||||||
|
$holidays[$_] = 0; // applied as back ref.
|
||||||
|
|
||||||
|
$row['condition'] = array(
|
||||||
|
'type' => TYPE_WORLDEVENT,
|
||||||
|
'typeId' => &$holidays[$_],
|
||||||
|
'status' => 1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$row['stock'] = $vendors[$k]['stock'];
|
||||||
|
$row['stack'] = $item->getField('buyCount');
|
||||||
|
$row['cost'] = array(
|
||||||
|
$item->getField('buyPrice'),
|
||||||
|
$currency ? $currency : null,
|
||||||
|
$tokens ? $tokens : null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($holidays)
|
||||||
|
{
|
||||||
|
$hObj = new WorldEventList(array(['id', array_keys($holidays)]));
|
||||||
|
$hObj->addGlobalsToJscript($smarty);
|
||||||
|
foreach ($hObj->iterate() as $id => $tpl)
|
||||||
|
{
|
||||||
|
if ($_ = $tpl['holidayId'])
|
||||||
|
$holidays[$tpl['eventBak']] = $_;
|
||||||
|
else
|
||||||
|
$holidays[-$id] = $id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$pageData['relTabs'][] = array(
|
||||||
|
'file' => 'creature',
|
||||||
|
'data' => $sbData,
|
||||||
|
'params' => [
|
||||||
|
'tabs' => '$tabsRelated',
|
||||||
|
'name' => '$LANG.tab_soldby',
|
||||||
|
'id' => 'sold-by-npc',
|
||||||
|
'extraCols' => '$['.implode(', ', $extraCols).']',
|
||||||
|
'hiddenCols' => "$['level', 'type']"
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// tab: currency for
|
||||||
|
// some minor trickery: get arenaPoints(43307) and honorPoints(43308) directly
|
||||||
|
if ($_id == 43307)
|
||||||
|
$w = 'iec.reqArenaPoints > 0';
|
||||||
|
else if ($_id == 43308)
|
||||||
|
$w = 'iec.reqHonorPoints > 0';
|
||||||
|
else
|
||||||
|
$w = 'iec.reqItemId1 = '.$_id.' OR iec.reqItemId2 = '.$_id.' OR iec.reqItemId3 = '.$_id.' OR iec.reqItemId4 = '.$_id.' OR iec.reqItemId5 = '.$_id;
|
||||||
|
|
||||||
|
$baughtBy = DB::Aowow()->selectCol('
|
||||||
|
SELECT item FROM npc_vendor nv JOIN ?_itemExtendedCost iec ON iec.id = nv.extendedCost WHERE '.$w.'
|
||||||
|
UNION
|
||||||
|
SELECT item FROM game_event_npc_vendor genv JOIN ?_itemExtendedCost iec ON iec.id = genv.extendedCost WHERE '.$w
|
||||||
|
);
|
||||||
|
if ($baughtBy)
|
||||||
|
{
|
||||||
|
$baughtBy = new ItemList(array(['id', $baughtBy]));
|
||||||
|
if (!$baughtBy->error)
|
||||||
|
{
|
||||||
|
$baughtBy->addGlobalsToJscript($smarty);
|
||||||
|
|
||||||
|
$pageData['relTabs'][] = array(
|
||||||
|
'file' => 'item',
|
||||||
|
'data' => $baughtBy->getListviewData(ITEMINFO_VENDOR),
|
||||||
|
'params' => [
|
||||||
|
'tabs' => '$tabsRelated',
|
||||||
|
'name' => '$LANG.tab_currencyfor',
|
||||||
|
'id' => 'currency-for',
|
||||||
|
'extraCols' => "$[Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack'), Listview.extraCols.cost]"
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// tab: teaches
|
||||||
|
$ids = $indirect = [];
|
||||||
|
for ($i = 1; $i < 6; $i++)
|
||||||
|
{
|
||||||
|
if ($item->getField('spellTrigger'.$i) == 6)
|
||||||
|
$ids[] = $item->getField('spellId'.$i);
|
||||||
|
else if ($item->getField('spellTrigger'.$i) == 0 && $item->getField('spellId'.$i) > 0)
|
||||||
|
$indirect[] = $item->getField('spellId'.$i);
|
||||||
|
}
|
||||||
|
|
||||||
|
// taught indirectly
|
||||||
|
if ($indirect)
|
||||||
|
{
|
||||||
|
$indirectSpells = new SpellList(array(['id', $indirect]));
|
||||||
|
foreach ($indirectSpells->iterate() as $__)
|
||||||
|
if ($_ = $indirectSpells->canTeachSpell())
|
||||||
|
foreach ($_ as $idx)
|
||||||
|
$ids[] = $indirectSpells->getField('effect'.$idx.'TriggerSpell');
|
||||||
|
|
||||||
|
$ids = array_merge($ids, Util::getTaughtSpells($indirect));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($ids)
|
||||||
|
{
|
||||||
|
$taughtSpells = new SpellList(array(['id', $ids]));
|
||||||
|
if (!$taughtSpells->error)
|
||||||
|
{
|
||||||
|
$taughtSpells->addGlobalsToJscript($smarty, GLOBALINFO_SELF | GLOBALINFO_RELATED);
|
||||||
|
|
||||||
|
$visCols = ['level', 'schools'];
|
||||||
|
if ($taughtSpells->hasSetFields(['reagent1']))
|
||||||
|
$visCols[] = 'reagents';
|
||||||
|
|
||||||
|
$pageData['relTabs'][] = array(
|
||||||
|
'file' => 'spell',
|
||||||
|
'data' => $taughtSpells->getListviewData(),
|
||||||
|
'params' => [
|
||||||
|
'tabs' => '$tabsRelated',
|
||||||
|
'name' => '$LANG.tab_teaches',
|
||||||
|
'id' => 'teaches',
|
||||||
|
'visibleCols' => '$'.json_encode($visCols),
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// taught by (req. workaround over the spell taught)
|
||||||
|
|
||||||
// Shared cooldown
|
// Shared cooldown
|
||||||
|
|
||||||
|
|||||||
@@ -1416,17 +1416,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// tab: teaches
|
// tab: teaches
|
||||||
$_ = [];
|
if ($ids = Util::getTaughtSpells($spell))
|
||||||
foreach ($spell->canTeachSpell() as $idx)
|
|
||||||
$_[] = $spell->getField('effect'.$idx.'TriggerSpell');
|
|
||||||
|
|
||||||
$ids = array_merge(
|
|
||||||
DB::Aowow()->selectCol('SELECT spellId FROM spell_learn_spell WHERE entry = ?d', $_id),
|
|
||||||
DB::Aowow()->selectCol('SELECT spellId FROM skill_discovery_template WHERE reqSpell = ?d', $_id), // note: omits required spell and chance
|
|
||||||
$_
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($ids)
|
|
||||||
{
|
{
|
||||||
$teaches = new SpellList(array(['id', $ids]));
|
$teaches = new SpellList(array(['id', $ids]));
|
||||||
if (!$teaches->error)
|
if (!$teaches->error)
|
||||||
|
|||||||
@@ -375,9 +375,11 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
|
|||||||
|
|
||||||
if ($cats[0] !== null) // !any Spell (php loose comparison: (null == 0) is true)
|
if ($cats[0] !== null) // !any Spell (php loose comparison: (null == 0) is true)
|
||||||
{
|
{
|
||||||
$conditions[] = 'OR';
|
$conditions[] = array(
|
||||||
$conditions[] = ['s.typeCat', 0];
|
'OR',
|
||||||
$conditions[] = ['s.cuFlags', SPELL_CU_EXCLUDE_CATEGORY_SEARCH, '&'];
|
['s.typeCat', 0],
|
||||||
|
['s.cuFlags', SPELL_CU_EXCLUDE_CATEGORY_SEARCH, '&']
|
||||||
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ var _ = g_gatheredcurrencies;
|
|||||||
{foreach from=$data key=id item=item}
|
{foreach from=$data key=id item=item}
|
||||||
_[{$id}]={ldelim}
|
_[{$id}]={ldelim}
|
||||||
name_{$user.language}:'{$item.name|escape:"javascript"}',
|
name_{$user.language}:'{$item.name|escape:"javascript"}',
|
||||||
icon:'{$item.icon|escape:"javascript"}'
|
icon:{$item.icon|@json_encode}
|
||||||
{rdelim};
|
{rdelim};
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/strip}
|
{/strip}
|
||||||
|
|||||||
@@ -14,51 +14,11 @@
|
|||||||
data:[
|
data:[
|
||||||
{foreach name=i from=$data item=curr}
|
{foreach name=i from=$data item=curr}
|
||||||
{ldelim}
|
{ldelim}
|
||||||
name:'{$curr.name|escape:"quotes"}',
|
{foreach from=$curr key='name' item=val}
|
||||||
{if $curr.tag}
|
{if $name != 'id'}
|
||||||
tag:'{$curr.tag|escape:"quotes"}',
|
{$name}:{$val|@json_encode:$smarty.const.JSON_NUMERIC_CHECK},
|
||||||
{/if}
|
|
||||||
minlevel:{$curr.minlevel},
|
|
||||||
maxlevel:{$curr.maxlevel},
|
|
||||||
type:{$curr.type},
|
|
||||||
classification:{$curr.rank},
|
|
||||||
{if $curr.boss}
|
|
||||||
boss: 1,
|
|
||||||
{/if}
|
|
||||||
react:{$curr.react},
|
|
||||||
location:{$curr.location},
|
|
||||||
{if isset($curr.skin)}
|
|
||||||
skin: '{$curr.skin}',
|
|
||||||
{/if}
|
|
||||||
{if isset($curr.percent)}
|
|
||||||
percent:{$curr.percent},
|
|
||||||
{/if}
|
|
||||||
{if isset($curr.count)}
|
|
||||||
count:{$curr.count},
|
|
||||||
{/if}
|
|
||||||
{if isset($curr.cost)}
|
|
||||||
stock:{$curr.stock},
|
|
||||||
{if isset($curr.stack)}
|
|
||||||
stack:{$curr.stack},
|
|
||||||
{/if}
|
{/if}
|
||||||
cost:[
|
{/foreach}
|
||||||
{if isset($curr.cost.money)}{$curr.cost.money}{/if}
|
|
||||||
{if isset($curr.cost.honor) or isset($curr.cost.arena) or isset($curr.cost.items)}
|
|
||||||
,{if isset($curr.cost.honor)}{$curr.cost.honor}{/if}
|
|
||||||
{if isset($curr.cost.arena) or isset($curr.cost.items)}
|
|
||||||
,{if isset($curr.cost.arena)}{$curr.cost.arena}{/if}
|
|
||||||
{if isset($curr.cost.items)}
|
|
||||||
,[
|
|
||||||
{foreach from=$curr.cost.items item=curitem name=c}
|
|
||||||
[{$curitem.item},{$curitem.count}]
|
|
||||||
{if $smarty.foreach.c.last}{else},{/if}
|
|
||||||
{/foreach}
|
|
||||||
]
|
|
||||||
{/if}
|
|
||||||
{/if}
|
|
||||||
{/if}
|
|
||||||
],
|
|
||||||
{/if}
|
|
||||||
id:{$curr.id}
|
id:{$curr.id}
|
||||||
{rdelim}
|
{rdelim}
|
||||||
{if $smarty.foreach.i.last}{else},{/if}
|
{if $smarty.foreach.i.last}{else},{/if}
|
||||||
|
|||||||
@@ -187,9 +187,9 @@ var Markup = {
|
|||||||
if(g_achievements[id] && g_achievements[id][nameCol])
|
if(g_achievements[id] && g_achievements[id][nameCol])
|
||||||
{
|
{
|
||||||
var ach = g_achievements[id];
|
var ach = g_achievements[id];
|
||||||
return '<a href="' + url + '/achievement=' + id + '"' + (rel.length ? ' rel="' + rel.join('&') + '"' : '') + (!attr.icon ? ' class="icontiny"><img src="' + g_staticUrl + '/images/icons/tiny/' + ach.icon.toLowerCase() + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(ach[nameCol]) + '</span></a>';
|
return '<a href="' + url + '?achievement=' + id + '"' + (rel.length ? ' rel="' + rel.join('&') + '"' : '') + (!attr.icon ? ' class="icontiny"><img src="' + g_staticUrl + '/images/icons/tiny/' + ach.icon.toLowerCase() + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(ach[nameCol]) + '</span></a>';
|
||||||
}
|
}
|
||||||
return '<a href="' + url + '/achievement=' + id + '"' + (rel.length ? ' rel="' + rel.join('&') + '"' : '') + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[10][0] + ' #' + id + ')</a>';
|
return '<a href="' + url + '?achievement=' + id + '"' + (rel.length ? ' rel="' + rel.join('&') + '"' : '') + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[10][0] + ' #' + id + ')</a>';
|
||||||
},
|
},
|
||||||
toText: function(attr)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
@@ -334,9 +334,9 @@ var Markup = {
|
|||||||
if(g_classes[id] && g_classes[id][nameCol])
|
if(g_classes[id] && g_classes[id][nameCol])
|
||||||
{
|
{
|
||||||
var cls = g_classes[id];
|
var cls = g_classes[id];
|
||||||
return '<a href="' + url + '/class=' + id + '"' + (!attr.icon ? ' class="icontiny c' + id + '"><img src="' + g_staticUrl + '/images/icons/tiny/' + g_classes.getIcon(id) + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(cls[nameCol]) + '</span></a>';
|
return '<a href="' + url + '?class=' + id + '"' + (!attr.icon ? ' class="icontiny c' + id + '"><img src="' + g_staticUrl + '/images/icons/tiny/' + g_classes.getIcon(id) + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(cls[nameCol]) + '</span></a>';
|
||||||
}
|
}
|
||||||
return '<a href="' + url + '/class=' + id + '" class="c' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[13][0] + ' #' + id + ')</a>';
|
return '<a href="' + url + '?class=' + id + '" class="c' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[13][0] + ' #' + id + ')</a>';
|
||||||
},
|
},
|
||||||
toText: function(attr)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
@@ -431,12 +431,12 @@ var Markup = {
|
|||||||
{
|
{
|
||||||
var curr = g_gatheredcurrencies[id];
|
var curr = g_gatheredcurrencies[id];
|
||||||
if(attr.amount)
|
if(attr.amount)
|
||||||
return '<a href="' + url + '/currency=' + id + '"' + (!attr.icon ? ' class="icontinyr tip q1" onmouseover="$WH.Tooltip.showAtCursor(event, \'' + Markup._safeHtml(curr[nameCol]) + '\', 0, 0, \'q1\');" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()" style="background-image:url(' + g_staticUrl + '/images/icons/tiny/' + curr.icon[0].toLowerCase() + '.gif)' : '') + Markup._addGlobalAttributes(attr) + '"> <span class="tinyicontxt">' + attr.amount.split(':').join(' - ') + '</span></a>';
|
return '<a href="' + url + '?currency=' + id + '"' + (!attr.icon ? ' class="icontinyr tip q1" onmouseover="$WH.Tooltip.showAtCursor(event, \'' + Markup._safeHtml(curr[nameCol]) + '\', 0, 0, \'q1\');" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()" style="background-image:url(' + g_staticUrl + '/images/icons/tiny/' + curr.icon[0].toLowerCase() + '.gif)' : '') + Markup._addGlobalAttributes(attr) + '"> <span class="tinyicontxt">' + attr.amount.split(':').join(' - ') + '</span></a>';
|
||||||
else
|
else
|
||||||
return '<a href="' + url + '/currency=' + id + '"' + (!attr.icon ? ' class="icontiny q1"><span><img src="' + g_staticUrl + '/images/icons/tiny/' + curr.icon[0].toLowerCase() + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(curr[nameCol]) + '</a>';
|
return '<a href="' + url + '?currency=' + id + '"' + (!attr.icon ? ' class="icontiny q1"><span><img src="' + g_staticUrl + '/images/icons/tiny/' + curr.icon[0].toLowerCase() + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(curr[nameCol]) + '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return '<a href="' + url + '/currency=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[17][0] + ' #' + id + ')</a>' + (attr.amount > 0 ? ' x' + attr.amount : '');
|
return '<a href="' + url + '?currency=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[17][0] + ' #' + id + ')</a>' + (attr.amount > 0 ? ' x' + attr.amount : '');
|
||||||
},
|
},
|
||||||
toText: function(attr)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
@@ -597,9 +597,9 @@ var Markup = {
|
|||||||
if(g_holidays[id] && g_holidays[id][nameCol])
|
if(g_holidays[id] && g_holidays[id][nameCol])
|
||||||
{
|
{
|
||||||
var evt = g_holidays[id];
|
var evt = g_holidays[id];
|
||||||
return '<a href="' + url + '/event=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + Markup._safeHtml(evt[nameCol]) + '</a>';
|
return '<a href="' + url + '?event=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + Markup._safeHtml(evt[nameCol]) + '</a>';
|
||||||
}
|
}
|
||||||
return '<a href="' + url + '/event=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[12][0] + ' #' + id + ')</a>';
|
return '<a href="' + url + '?event=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[12][0] + ' #' + id + ')</a>';
|
||||||
},
|
},
|
||||||
toText: function(attr)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
@@ -638,9 +638,9 @@ var Markup = {
|
|||||||
if(g_factions[id] && g_factions[id][nameCol])
|
if(g_factions[id] && g_factions[id][nameCol])
|
||||||
{
|
{
|
||||||
var fac = g_factions[id];
|
var fac = g_factions[id];
|
||||||
return '<a href="' + url + '/faction=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + Markup._safeHtml(fac[nameCol]) + '</a>';
|
return '<a href="' + url + '?faction=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + Markup._safeHtml(fac[nameCol]) + '</a>';
|
||||||
}
|
}
|
||||||
return '<a href="' + url + '/faction=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[8][0] + ' #' + id + ')</a>';
|
return '<a href="' + url + '?faction=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[8][0] + ' #' + id + ')</a>';
|
||||||
},
|
},
|
||||||
toText: function(attr)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
@@ -1065,11 +1065,11 @@ var Markup = {
|
|||||||
if(g_items[id] && g_items[id][nameCol])
|
if(g_items[id] && g_items[id][nameCol])
|
||||||
{
|
{
|
||||||
var item = g_items[id];
|
var item = g_items[id];
|
||||||
var str = '<a' + Markup._addGlobalAttributes(attr) + ' href="' + url + '/item=' + id + '" class="q' + item.quality + (!attr.icon ? ' icontiny"><img src="' + g_staticUrl + '/images/icons/tiny/' + item.icon.toLowerCase() + '.gif"' : '') + ' align="absmiddle" /> <span class="tinyicontxt">';
|
var str = '<a' + Markup._addGlobalAttributes(attr) + ' href="' + url + '?item=' + id + '" class="q' + item.quality + (!attr.icon ? ' icontiny"><img src="' + g_staticUrl + '/images/icons/tiny/' + item.icon.toLowerCase() + '.gif"' : '') + ' align="absmiddle" /> <span class="tinyicontxt">';
|
||||||
str += Markup._safeHtml(item[nameCol]) + '</span></a>';
|
str += Markup._safeHtml(item[nameCol]) + '</span></a>';
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
return '<a href="' + url + '/item=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[3][0] + ' #' + id + ')</a>';
|
return '<a href="' + url + '?item=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[3][0] + ' #' + id + ')</a>';
|
||||||
},
|
},
|
||||||
toText: function(attr)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
@@ -1108,9 +1108,9 @@ var Markup = {
|
|||||||
if(g_itemsets[id] && g_itemsets[id][nameCol])
|
if(g_itemsets[id] && g_itemsets[id][nameCol])
|
||||||
{
|
{
|
||||||
var set = g_itemsets[id];
|
var set = g_itemsets[id];
|
||||||
return '<a href="' + url + '/itemset=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + Markup._safeHtml(set[nameCol]) + '</a>';
|
return '<a href="' + url + '?itemset=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + Markup._safeHtml(set[nameCol]) + '</a>';
|
||||||
}
|
}
|
||||||
return '<a href="' + url + '/itemset=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[4][0] + ' #' + id + ')</a>';
|
return '<a href="' + url + '?itemset=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[4][0] + ' #' + id + ')</a>';
|
||||||
},
|
},
|
||||||
toText: function(attr)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
@@ -1454,12 +1454,8 @@ var Markup = {
|
|||||||
items: { req: false, valid: /^[0-9,]+$/ },
|
items: { req: false, valid: /^[0-9,]+$/ },
|
||||||
currency: { req: false, valid: /^[0-9,]+$/ },
|
currency: { req: false, valid: /^[0-9,]+$/ },
|
||||||
achievement: { req: false, valid: /\S+/ },
|
achievement: { req: false, valid: /\S+/ },
|
||||||
// DEPRECATED
|
|
||||||
arena: { req: false, valid: /^[0-9]+$/ },
|
arena: { req: false, valid: /^[0-9]+$/ },
|
||||||
honor: { req: false, valid: /^[0-9]+$/ },
|
honor: { req: false, valid: /^[0-9]+$/ },
|
||||||
conquest: { req: false, valid: /^[0-9]+$/ },
|
|
||||||
justice: { req: false, valid: /^[0-9]+$/ },
|
|
||||||
valor: { req: false, valid: /^[0-9]+$/ }
|
|
||||||
},
|
},
|
||||||
allowedClass: MARKUP_CLASS_STAFF,
|
allowedClass: MARKUP_CLASS_STAFF,
|
||||||
toHtml: function(attr)
|
toHtml: function(attr)
|
||||||
@@ -1484,16 +1480,10 @@ var Markup = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Backwards compatability
|
// Backwards compatability
|
||||||
if(attr.arena && !attr.conquest)
|
|
||||||
attr.conquest = attr.arena;
|
|
||||||
if(attr.honor)
|
if(attr.honor)
|
||||||
currency.push([392, attr.honor]);
|
currency.push([104, attr.honor]);
|
||||||
if(attr.conquest)
|
if(attr.arena)
|
||||||
currency.push([390, attr.conquest]);
|
currency.push([103, attr.arena]);
|
||||||
if(attr.justice)
|
|
||||||
currency.push([395, attr.justice]);
|
|
||||||
if(attr.valor)
|
|
||||||
currency.push([396, attr.valor]);
|
|
||||||
|
|
||||||
return g_getMoneyHtml(attr.unnamed, attr.side, items, currency, attr.achievement);
|
return g_getMoneyHtml(attr.unnamed, attr.side, items, currency, attr.achievement);
|
||||||
}
|
}
|
||||||
@@ -1524,9 +1514,9 @@ var Markup = {
|
|||||||
if(g_npcs[id] && g_npcs[id][nameCol])
|
if(g_npcs[id] && g_npcs[id][nameCol])
|
||||||
{
|
{
|
||||||
var npc = g_npcs[id];
|
var npc = g_npcs[id];
|
||||||
return '<a href="' + url + '/npc=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + Markup._safeHtml(npc[nameCol]) + '</a>';
|
return '<a href="' + url + '?npc=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + Markup._safeHtml(npc[nameCol]) + '</a>';
|
||||||
}
|
}
|
||||||
return '<a href="' + url + '/npc=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[1][0] + ' #' + id + ')</a>';
|
return '<a href="' + url + '?npc=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[1][0] + ' #' + id + ')</a>';
|
||||||
},
|
},
|
||||||
toText: function(attr)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
@@ -1539,47 +1529,6 @@ var Markup = {
|
|||||||
return LANG.types[1][0] + ' #' + id;
|
return LANG.types[1][0] + ' #' + id;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
petability:
|
|
||||||
{
|
|
||||||
empty: true,
|
|
||||||
allowInReplies: true,
|
|
||||||
attr:
|
|
||||||
{
|
|
||||||
unnamed: { req: true, valid: /^[0-9]+$/ },
|
|
||||||
domain: { req: false, valid: /^(beta|mop|ptr|www|de|es|fr|ru|pt)$/ },
|
|
||||||
site: { req: false, valid: /^(beta|mop|ptr|www|de|es|fr|ru|pt)$/ }
|
|
||||||
},
|
|
||||||
validate: function(attr)
|
|
||||||
{
|
|
||||||
if((attr.domain || attr.site) && Markup.dbpage)
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
toHtml: function(attr)
|
|
||||||
{
|
|
||||||
var id = attr.unnamed;
|
|
||||||
var domainInfo = Markup._getDatabaseDomainInfo(attr);
|
|
||||||
var url = domainInfo[0];
|
|
||||||
var nameCol = domainInfo[1];
|
|
||||||
|
|
||||||
if(g_petabilities[id] && g_petabilities[id][nameCol])
|
|
||||||
{
|
|
||||||
var ability = g_petabilities[id];
|
|
||||||
return '<a href="' + url + '/petability=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + Markup._safeHtml(ability[nameCol]) + '</a>';
|
|
||||||
}
|
|
||||||
return '<a href="' + url + '/petability=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[200][0] + ' #' + id + ')</a>';
|
|
||||||
},
|
|
||||||
toText: function(attr)
|
|
||||||
{
|
|
||||||
var id = attr.unnamed;
|
|
||||||
var domainInfo = Markup._getDatabaseDomainInfo(attr);
|
|
||||||
var nameCol = domainInfo[1];
|
|
||||||
|
|
||||||
if(g_petabilities[id] && g_petabilities[id][nameCol])
|
|
||||||
return Markup._safeHtml(g_petabilities[id][nameCol]);
|
|
||||||
return LANG.types[200][0] + ' #' + id;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
object:
|
object:
|
||||||
{
|
{
|
||||||
empty: true,
|
empty: true,
|
||||||
@@ -1606,9 +1555,9 @@ var Markup = {
|
|||||||
if(g_objects[id] && g_objects[id][nameCol])
|
if(g_objects[id] && g_objects[id][nameCol])
|
||||||
{
|
{
|
||||||
var obj = g_objects[id];
|
var obj = g_objects[id];
|
||||||
return '<a href="' + url + '/object=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + Markup._safeHtml(obj[nameCol]) + '</a>';
|
return '<a href="' + url + '?object=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + Markup._safeHtml(obj[nameCol]) + '</a>';
|
||||||
}
|
}
|
||||||
return '<a href="' + url + '/object=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[2][0] + ' #' + id + ')</a>';
|
return '<a href="' + url + '?object=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[2][0] + ' #' + id + ')</a>';
|
||||||
},
|
},
|
||||||
toText: function(attr)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
@@ -1729,10 +1678,10 @@ var Markup = {
|
|||||||
if(g_pet_families && g_pet_families[id] && g_pets && g_pets[id])
|
if(g_pet_families && g_pet_families[id] && g_pets && g_pets[id])
|
||||||
{
|
{
|
||||||
var str = '<span' + (!attr.icon ? ' class="icontiny" style="background-image: url(' + g_staticUrl + '/images/icons/tiny/' + g_pets[id]['icon'].toLowerCase() + '.gif)' : '') + '">';
|
var str = '<span' + (!attr.icon ? ' class="icontiny" style="background-image: url(' + g_staticUrl + '/images/icons/tiny/' + g_pets[id]['icon'].toLowerCase() + '.gif)' : '') + '">';
|
||||||
str += '<a href="' + url + '/pet=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + Markup._safeHtml(g_pet_families[id]) + '</a></span>';
|
str += '<a href="' + url + '?pet=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + Markup._safeHtml(g_pet_families[id]) + '</a></span>';
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
return '<a href="' + url + '/pet=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[9][0] + ' #' + id + ')</a>';
|
return '<a href="' + url + '?pet=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[9][0] + ' #' + id + ')</a>';
|
||||||
},
|
},
|
||||||
toText: function(attr)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
@@ -1790,9 +1739,9 @@ var Markup = {
|
|||||||
if(g_quests[id] && g_quests[id][nameCol])
|
if(g_quests[id] && g_quests[id][nameCol])
|
||||||
{
|
{
|
||||||
var quest = g_quests[id];
|
var quest = g_quests[id];
|
||||||
return '<a href="' + url + '/quest=' + id + '"' + (!attr.icon ? ' class="icontiny"><img src="' + g_staticUrl + '/images/icons/tiny/' + (quest.daily ? 'quest_start_daily' : 'quest_start') + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(quest[nameCol]) + '</span></a>';
|
return '<a href="' + url + '?quest=' + id + '"' + (!attr.icon ? ' class="icontiny"><img src="' + g_staticUrl + '/images/icons/tiny/' + (quest.daily ? 'quest_start_daily' : 'quest_start') + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(quest[nameCol]) + '</span></a>';
|
||||||
}
|
}
|
||||||
return '<a href="' + url + '/quest=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[5][0] + ' #' + id + ')</a>';
|
return '<a href="' + url + '?quest=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[5][0] + ' #' + id + ')</a>';
|
||||||
},
|
},
|
||||||
toText: function(attr)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
@@ -1951,9 +1900,9 @@ var Markup = {
|
|||||||
if(g_races[id] && g_races[id][nameCol])
|
if(g_races[id] && g_races[id][nameCol])
|
||||||
{
|
{
|
||||||
var race = g_races[id];
|
var race = g_races[id];
|
||||||
return '<a href="' + url + '/race=' + id + '"' + (!attr.icon ? ' class="icontiny"><img src="' + g_staticUrl + '/images/icons/tiny/' + g_races.getIcon(id, gender) + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(race[nameCol]) + '</span></a>';
|
return '<a href="' + url + '?race=' + id + '"' + (!attr.icon ? ' class="icontiny"><img src="' + g_staticUrl + '/images/icons/tiny/' + g_races.getIcon(id, gender) + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(race[nameCol]) + '</span></a>';
|
||||||
}
|
}
|
||||||
return '<a href="' + url + '/race=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[14][0] + ' #' + id + ')</a>';
|
return '<a href="' + url + '?race=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[14][0] + ' #' + id + ')</a>';
|
||||||
},
|
},
|
||||||
toText: function(attr)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
@@ -2149,9 +2098,9 @@ var Markup = {
|
|||||||
if(g_skills[id] && g_skills[id][nameCol])
|
if(g_skills[id] && g_skills[id][nameCol])
|
||||||
{
|
{
|
||||||
var skill = g_skills[id];
|
var skill = g_skills[id];
|
||||||
return '<a href="' + url + '/skill=' + id + '"' + (!attr.icon ? ' class="icontiny"><img src="' + g_staticUrl + '/images/icons/tiny/' + g_skills.getIcon(id) + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(skill[nameCol]) + '</span></a>';
|
return '<a href="' + url + '?skill=' + id + '"' + (!attr.icon ? ' class="icontiny"><img src="' + g_staticUrl + '/images/icons/tiny/' + g_skills.getIcon(id) + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(skill[nameCol]) + '</span></a>';
|
||||||
}
|
}
|
||||||
return '<a href="' + url + '/skill=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[15][0] + ' #' + id + ')</a>';
|
return '<a href="' + url + '?skill=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[15][0] + ' #' + id + ')</a>';
|
||||||
},
|
},
|
||||||
toText: function(attr)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
@@ -2261,11 +2210,11 @@ var Markup = {
|
|||||||
if(g_spells[id] && g_spells[id][nameCol])
|
if(g_spells[id] && g_spells[id][nameCol])
|
||||||
{
|
{
|
||||||
var spell = g_spells[id];
|
var spell = g_spells[id];
|
||||||
return '<a href="' + url + '/spell=' + id + '"' + (rel.length ? ' rel="' + rel.join('&') + '"' : '') + (!attr.icon ? ' class="icontiny"><img src="' + g_staticUrl + '/images/icons/tiny/' + spell.icon.toLowerCase() + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(spell[nameCol]) + '</span></a>';
|
return '<a href="' + url + '?spell=' + id + '"' + (rel.length ? ' rel="' + rel.join('&') + '"' : '') + (!attr.icon ? ' class="icontiny"><img src="' + g_staticUrl + '/images/icons/tiny/' + spell.icon.toLowerCase() + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(spell[nameCol]) + '</span></a>';
|
||||||
}
|
}
|
||||||
if(attr.mop && attr.mopname && attr.mopicon && attr.mopicon.indexOf('.jpg', attr.mopicon.length - 4) !== -1)
|
if(attr.mop && attr.mopname && attr.mopicon && attr.mopicon.indexOf('.jpg', attr.mopicon.length - 4) !== -1)
|
||||||
return '<span class="tooltip-inside-icon" style="background:url(' + g_staticUrl + 'images/icons/mop-talents/18/' + Markup._safeHtml(attr.mopicon) + ')"></span> <a href="' + url + '/spell=' + id + '"' + (rel.length ? ' rel="' + rel.join('&') + '"' : '') + ' ><span class="tinyicontxt">' + Markup._safeHtml(attr.mopname) + '</span></a>';
|
return '<span class="tooltip-inside-icon" style="background:url(' + g_staticUrl + 'images/icons/mop-talents/18/' + Markup._safeHtml(attr.mopicon) + ')"></span> <a href="' + url + '?spell=' + id + '"' + (rel.length ? ' rel="' + rel.join('&') + '"' : '') + ' ><span class="tinyicontxt">' + Markup._safeHtml(attr.mopname) + '</span></a>';
|
||||||
return '<a href="' + url + '/spell=' + id + '"' + (rel.length ? ' rel="' + rel.join('&') + '"' : '') + '>(' + LANG.types[6][0] + ' #' + id + ')</a>';
|
return '<a href="' + url + '?spell=' + id + '"' + (rel.length ? ' rel="' + rel.join('&') + '"' : '') + '>(' + LANG.types[6][0] + ' #' + id + ')</a>';
|
||||||
},
|
},
|
||||||
toText: function(attr)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
@@ -2316,9 +2265,9 @@ var Markup = {
|
|||||||
if(g_achievements[id] && g_achievements[id][nameCol])
|
if(g_achievements[id] && g_achievements[id][nameCol])
|
||||||
{
|
{
|
||||||
var ach = g_achievements[id];
|
var ach = g_achievements[id];
|
||||||
return '<a href="' + url + '/achievement=' + id + '"' + (!attr.icon ? ' class="icontiny"><img src="' + g_staticUrl + '/images/icons/tiny/' + ach.icon.toLowerCase() + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(ach[nameCol]) + '</span></a>';
|
return '<a href="' + url + '?achievement=' + id + '"' + (!attr.icon ? ' class="icontiny"><img src="' + g_staticUrl + '/images/icons/tiny/' + ach.icon.toLowerCase() + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(ach[nameCol]) + '</span></a>';
|
||||||
}
|
}
|
||||||
return '<a href="' + url + '/achievement=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[10][0] + ' #' + id + ')</a>';
|
return '<a href="' + url + '?achievement=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[10][0] + ' #' + id + ')</a>';
|
||||||
},
|
},
|
||||||
toText: function(attr)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
@@ -3058,9 +3007,9 @@ var Markup = {
|
|||||||
|
|
||||||
if(g_titles[id] && g_titles[id][nameCol])
|
if(g_titles[id] && g_titles[id][nameCol])
|
||||||
{
|
{
|
||||||
return '<a href="' + url + '/title=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + Markup._safeHtml(g_titles[id][nameCol]) + '</a>';
|
return '<a href="' + url + '?title=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + Markup._safeHtml(g_titles[id][nameCol]) + '</a>';
|
||||||
}
|
}
|
||||||
return '<a href="' + url + '/title=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[11][0] + ' #' + id + ')</a>';
|
return '<a href="' + url + '?title=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[11][0] + ' #' + id + ')</a>';
|
||||||
},
|
},
|
||||||
toText: function(attr)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
@@ -3098,9 +3047,9 @@ var Markup = {
|
|||||||
|
|
||||||
if(g_gatheredzones[id] && g_gatheredzones[id][nameCol])
|
if(g_gatheredzones[id] && g_gatheredzones[id][nameCol])
|
||||||
{
|
{
|
||||||
return '<a href="' + url + '/zone=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + Markup._safeHtml(g_gatheredzones[id][nameCol]) + '</a>';
|
return '<a href="' + url + '?zone=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + Markup._safeHtml(g_gatheredzones[id][nameCol]) + '</a>';
|
||||||
}
|
}
|
||||||
return '<a href="' + url + '/zone=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[7][0] + ' #' + id + ')</a>';
|
return '<a href="' + url + '?zone=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[7][0] + ' #' + id + ')</a>';
|
||||||
},
|
},
|
||||||
toText: function(attr)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -953,59 +953,116 @@ function g_createAchievementBar(b, d, a) {
|
|||||||
return g_createProgressBar(c)
|
return g_createProgressBar(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
function g_getMoneyHtml(c) {
|
function g_getMoneyHtml(money, side, costItems, costCurrency, achievementPoints) {
|
||||||
var b = 0,
|
var
|
||||||
a = "";
|
ns = 0,
|
||||||
if (c >= 10000) {
|
html = '';
|
||||||
b = 1;
|
|
||||||
a += '<span class="moneygold">' + Math.floor(c / 10000) + "</span>";
|
if (side == 1 || side == 'alliance') {
|
||||||
c %= 10000
|
side = 1;
|
||||||
}
|
}
|
||||||
if (c >= 100) {
|
else if (side == 2 || side == 'horde') {
|
||||||
if (b) {
|
side = 2;
|
||||||
a += " "
|
}
|
||||||
} else {
|
else {
|
||||||
b = 1
|
side = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (money >= 10000) {
|
||||||
|
ns = 1;
|
||||||
|
|
||||||
|
var display = Math.floor(money / 10000);
|
||||||
|
html += '<span class="moneygold">' + $WH.number_format(display) + '</span>';
|
||||||
|
money %= 10000;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (money >= 100) {
|
||||||
|
if (ns) {
|
||||||
|
html += ' ';
|
||||||
}
|
}
|
||||||
a += '<span class="moneysilver">' + Math.floor(c / 100) + "</span>";
|
else {
|
||||||
c %= 100
|
ns = 1;
|
||||||
}
|
|
||||||
if (c >= 1) {
|
|
||||||
if (b) {
|
|
||||||
a += " "
|
|
||||||
} else {
|
|
||||||
b = 1
|
|
||||||
}
|
}
|
||||||
a += '<span class="moneycopper">' + c + "</span>"
|
|
||||||
|
var display = Math.floor(money / 100);
|
||||||
|
html += '<span class="moneysilver">' + display + '</span>';
|
||||||
|
money %= 100;
|
||||||
}
|
}
|
||||||
return a
|
|
||||||
}
|
if (money >= 1) {
|
||||||
function g_getMoneyHtml2(f, c, b, a) {
|
if (ns) {
|
||||||
var e = g_getMoneyHtml(f);
|
html += ' ';
|
||||||
if (c !== undefined && c !== null && c != 0) {
|
|
||||||
if (e.length > 0) {
|
|
||||||
e += " "
|
|
||||||
}
|
}
|
||||||
e += '<span class="money' + (c < 0 ? "horde": "alliance") + ' tip" onmouseover="Listview.funcBox.moneyHonorOver(event)" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">' + g_numberFormat(Math.abs(c)) + "</span>"
|
else {
|
||||||
}
|
ns = 1;
|
||||||
if (b !== undefined && b !== null && b > 0) {
|
|
||||||
if (e.length > 0) {
|
|
||||||
e += " "
|
|
||||||
}
|
}
|
||||||
e += '<span class="moneyarena tip" onmouseover="Listview.funcBox.moneyArenaOver(event)" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">' + g_numberFormat(b) + "</span>"
|
|
||||||
|
html += '<span class="moneycopper">' + money + '</span>';
|
||||||
}
|
}
|
||||||
if (a !== undefined && a !== null && a.length > 0) {
|
|
||||||
for (var d = 0; d < a.length; ++d) {
|
if (costItems != null) {
|
||||||
if (e.length > 0) {
|
for (var i = 0; i < costItems.length; ++i) {
|
||||||
e += " "
|
if (ns) {
|
||||||
|
html += ' ';
|
||||||
}
|
}
|
||||||
var h = a[d][0];
|
else {
|
||||||
var g = a[d][1];
|
ns = 1;
|
||||||
e += '<a href="?item=' + h + '" class="moneyitem" style="background-image: url(images/icons/tiny/' + (g_items[h] && g_items[h]["icon"] ? g_items[h]["icon"] : "inv_misc_questionmark").toLowerCase() + '.gif)">' + g + "</a>"
|
}
|
||||||
|
|
||||||
|
var itemId = costItems[i][0];
|
||||||
|
var count = costItems[i][1];
|
||||||
|
var icon = (g_items[itemId] && g_items[itemId].icon ? g_items[itemId].icon : 'inv_misc_questionmark');
|
||||||
|
|
||||||
|
html += '<a href="?item=' + itemId + '" class="moneyitem" style="background-image: url(' + g_staticUrl + '/images/icons/tiny/' + icon.toLowerCase() + '.gif)">' + count + '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return e
|
|
||||||
|
if (costCurrency != null) {
|
||||||
|
for (var i = 0; i < costCurrency.length; ++i) {
|
||||||
|
if (ns) {
|
||||||
|
html += ' ';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ns = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
var currencyId = costCurrency[i][0];
|
||||||
|
var count = costCurrency[i][1];
|
||||||
|
var icon = (g_gatheredcurrencies[currencyId] && g_gatheredcurrencies[currencyId].icon ? g_gatheredcurrencies[currencyId].icon : ['inv_misc_questionmark', 'inv_misc_questionmark']);
|
||||||
|
|
||||||
|
if (side == 3 && icon[0] == icon[1]) {
|
||||||
|
side = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// sarjuuk: custom start
|
||||||
|
if (currencyId == 103) { // arena
|
||||||
|
html += '<a href="?currency=' + currencyId + '" class="moneyarena tip" onmouseover="Listview.funcBox.moneyArenaOver(event)" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">' + $WH.number_format(count) + '</a>';
|
||||||
|
}
|
||||||
|
else if (currencyId == 104) { // honor
|
||||||
|
html += '<a href="?currency=' + currencyId + '" class="money' + (side == 1 ? 'alliance' : 'horde') + ' tip" onmouseover="Listview.funcBox.moneyHonorOver(event)" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">' + $WH.number_format(count) + '</a>';
|
||||||
|
}
|
||||||
|
else { // tokens
|
||||||
|
html += '<a href="?currency=' + currencyId + '" class="icontinyr tip q1" onmouseover="Listview.funcBox.moneyCurrencyOver(' + currencyId + ', ' + count + ', event)" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()" style="background-image: url(' + g_staticUrl + '/images/icons/tiny/' + icon[0].toLowerCase() + '.gif)">' + count + '</a>';
|
||||||
|
}
|
||||||
|
// sarjuuk: custom end
|
||||||
|
// html += '<a href="?currency=' + currencyId + '" class="icontinyr tip q1" onmouseover="Listview.funcBox.moneyCurrencyOver(' + currencyId + ', ' + count + ', event)" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()" style="background-image: url(' + g_staticUrl + '/images/icons/tiny/' + icon[(side == 3 ? 1 : side - 1)].toLowerCase() + '.gif)">' + (side == 3 ? '<span class="icontinyr" style="background-image: url(' + g_staticUrl + '/images/icons/tiny/' + icon[0].toLowerCase() + '.gif)">' : '') + count + (side == 3 ? '</span>' : '') + '</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (achievementPoints > 0) {
|
||||||
|
if (ns) {
|
||||||
|
html += ' ';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ns = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '<span class="moneyachievement tip" onmouseover="Listview.funcBox.moneyAchievementOver(event)" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">' + $WH.number_format(achievementPoints) + '</span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
function g_numberFormat(f, b, l, h) {
|
function g_numberFormat(f, b, l, h) {
|
||||||
var c = f,
|
var c = f,
|
||||||
a = b;
|
a = b;
|
||||||
@@ -5085,8 +5142,7 @@ Listview.extraCols = {
|
|||||||
name: LANG.cost,
|
name: LANG.cost,
|
||||||
getValue: function(row) {
|
getValue: function(row) {
|
||||||
if (row.cost) {
|
if (row.cost) {
|
||||||
return (row.cost[3] && row.cost[3][0] ? row.cost[3][0][1] : 0) || (row.cost[2] || row.cost[1] || row.cost[0])
|
return (row.cost[2] && row.cost[2][0] ? row.cost[2][0][1] : 0) || (row.cost[1] && row.cost[1][0] ? row.cost[1][0][1] : 0) || row.cost[0];
|
||||||
// 5.0 return (row.cost[2] && row.cost[2][0] ? row.cost[2][0][1] : 0) || (row.cost[1] && row.cost[1][0] ? row.cost[1][0][1] : 0) || row.cost[0];
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
compute: function(row, td) {
|
compute: function(row, td) {
|
||||||
@@ -5109,9 +5165,7 @@ Listview.extraCols = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Listview.funcBox.appendMoney(td, money, side, currency, items, row.cost[3]/*achievementPoints*/)
|
Listview.funcBox.appendMoney(td, money, side, items, currency, achievementPoints);
|
||||||
// 5.0 Listview.funcBox.appendMoney(td, money, side, items, currency, achievementPoints);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sortFunc: function(a, b, col) {
|
sortFunc: function(a, b, col) {
|
||||||
@@ -5429,7 +5483,7 @@ Listview.extraCols = {
|
|||||||
var a = $WH.ce('a');
|
var a = $WH.ce('a');
|
||||||
a.href = '?achievement=' + item.achievement;
|
a.href = '?achievement=' + item.achievement;
|
||||||
a.className = 'icontiny tinyspecial';
|
a.className = 'icontiny tinyspecial';
|
||||||
a.style.backgroundImage = 'url(' + g_staticUrl + '/images/wow/icons/tiny/' + g_achievements[item.achievement].icon.toLowerCase() + '.gif)';
|
a.style.backgroundImage = 'url(' + g_staticUrl + '/images/icons/tiny/' + g_achievements[item.achievement].icon.toLowerCase() + '.gif)';
|
||||||
a.style.whiteSpace = 'nowrap';
|
a.style.whiteSpace = 'nowrap';
|
||||||
|
|
||||||
$WH.st(a, g_achievements[item.achievement]['name_' + g_locale.name]);
|
$WH.st(a, g_achievements[item.achievement]['name_' + g_locale.name]);
|
||||||
@@ -5509,7 +5563,7 @@ Listview.extraCols = {
|
|||||||
LANG.earned
|
LANG.earned
|
||||||
LANG.progress
|
LANG.progress
|
||||||
|
|
||||||
probably also events, zones, skill, faction, ..
|
probably also zones, skill, faction, ..
|
||||||
*/
|
*/
|
||||||
|
|
||||||
id: 'condition',
|
id: 'condition',
|
||||||
@@ -5572,6 +5626,8 @@ Listview.extraCols = {
|
|||||||
return Listview.extraCols.condition.getAchievementState(cond);
|
return Listview.extraCols.condition.getAchievementState(cond);
|
||||||
case 'quest':
|
case 'quest':
|
||||||
return Listview.extraCols.condition.getQuestState(cond);
|
return Listview.extraCols.condition.getQuestState(cond);
|
||||||
|
case 'event':
|
||||||
|
return Listview.extraCols.condition.getEventState(cond);
|
||||||
default:
|
default:
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@@ -5645,6 +5701,23 @@ Listview.extraCols = {
|
|||||||
|
|
||||||
return cnd;
|
return cnd;
|
||||||
},
|
},
|
||||||
|
getEventState: function(cond) {
|
||||||
|
if (!cond.typeId || !g_holidays[cond.typeId]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var
|
||||||
|
cnd = {},
|
||||||
|
item = g_holidays[cond.typeId];
|
||||||
|
|
||||||
|
cnd.icon = item.icon.toLowerCase();
|
||||||
|
cnd.state = cond.status ? $WH.ct('active') : $WH.ct('inactive');
|
||||||
|
cnd.color = cond.status ? 'q2' : 'q10';
|
||||||
|
cnd.name = item['name_' + g_locale.name];
|
||||||
|
cnd.url = '?event=' + cond.typeId;
|
||||||
|
|
||||||
|
return cnd;
|
||||||
|
},
|
||||||
sortFunc: function(a, b, col) {
|
sortFunc: function(a, b, col) {
|
||||||
if (a.condition.status && b.condition.status) {
|
if (a.condition.status && b.condition.status) {
|
||||||
return $WH.strcmp(a.condition.status, b.condition.status);
|
return $WH.strcmp(a.condition.status, b.condition.status);
|
||||||
@@ -7582,104 +7655,180 @@ Listview.funcBox = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
moneyCurrencyOver: function(currencyId, count, e) {
|
moneyCurrencyOver: function(currencyId, count, e) {
|
||||||
var buff = g_gatheredcurrencies[currencyId]['name_' + Locale.getName()];
|
var buff = g_gatheredcurrencies[currencyId]['name_' + g_locale.name /*g_loc.getName()*/];
|
||||||
|
|
||||||
// justice / valor points handling removed
|
// justice / valor points handling removed
|
||||||
|
|
||||||
$WH.Tooltip.showAtCursor(e, buff, 0, 0, 'q1');
|
$WH.Tooltip.showAtCursor(e, buff, 0, 0, 'q1');
|
||||||
},
|
},
|
||||||
|
|
||||||
appendMoney: function(g, a, f, m, j, c, l) { // todo: understand and adapt
|
appendMoney: function(d, money, side, costItems, costCurrency, achievementPoints) {
|
||||||
var k, h = 0;
|
var
|
||||||
if (a >= 10000) {
|
_,
|
||||||
h = 1;
|
__,
|
||||||
k = $WH.ce("span");
|
ns = 0;
|
||||||
k.className = "moneygold";
|
|
||||||
$WH.ae(k, $WH.ct(Math.floor(a / 10000)));
|
if (side == 1 || side == 'alliance') {
|
||||||
$WH.ae(g, k);
|
side = 1;
|
||||||
a %= 10000
|
|
||||||
}
|
}
|
||||||
if (a >= 100) {
|
else if (side == 2 || side == 'horde') {
|
||||||
if (h) {
|
side = 2;
|
||||||
$WH.ae(g, $WH.ct(" "))
|
}
|
||||||
} else {
|
else {
|
||||||
h = 1
|
side = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (money >= 10000) {
|
||||||
|
ns = 1;
|
||||||
|
|
||||||
|
_ = $WH.ce('span');
|
||||||
|
_.className = 'moneygold';
|
||||||
|
$WH.ae(_, $WH.ct($WH.number_format(Math.floor(money / 10000))));
|
||||||
|
$WH.ae(d, _);
|
||||||
|
money %= 10000;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (money >= 100) {
|
||||||
|
if (ns) {
|
||||||
|
$WH.ae(d, $WH.ct(' '));
|
||||||
}
|
}
|
||||||
k = $WH.ce("span");
|
else {
|
||||||
k.className = "moneysilver";
|
ns = 1;
|
||||||
$WH.ae(k, $WH.ct(Math.floor(a / 100)));
|
|
||||||
$WH.ae(g, k);
|
|
||||||
a %= 100
|
|
||||||
}
|
|
||||||
if (a >= 1 || f != null) {
|
|
||||||
if (h) {
|
|
||||||
$WH.ae(g, $WH.ct(" "))
|
|
||||||
} else {
|
|
||||||
h = 1
|
|
||||||
}
|
}
|
||||||
k = $WH.ce("span");
|
|
||||||
k.className = "moneycopper";
|
_ = $WH.ce('span');
|
||||||
$WH.ae(k, $WH.ct(a));
|
_.className = 'moneysilver';
|
||||||
$WH.ae(g, k)
|
$WH.ae(_, $WH.ct(Math.floor(money / 100)));
|
||||||
|
$WH.ae(d, _);
|
||||||
|
money %= 100;
|
||||||
}
|
}
|
||||||
if (m != null && m != 0) {
|
|
||||||
if (h) {
|
if (money >= 1) {
|
||||||
$WH.ae(g, $WH.ct(" "))
|
if (ns) {
|
||||||
} else {
|
$WH.ae(d, $WH.ct(' '));
|
||||||
h = 1
|
|
||||||
}
|
}
|
||||||
k = $WH.ce("span");
|
else {
|
||||||
k.className = "money" + (m < 0 ? "horde": "alliance") + " tip";
|
ns = 1;
|
||||||
k.onmouseover = Listview.funcBox.moneyHonorOver;
|
|
||||||
k.onmousemove = $WH.Tooltip.cursorUpdate;
|
|
||||||
k.onmouseout = $WH.Tooltip.hide;
|
|
||||||
$WH.ae(k, $WH.ct($WH.number_format(Math.abs(m))));
|
|
||||||
$WH.ae(g, k)
|
|
||||||
}
|
|
||||||
if (j >= 1) {
|
|
||||||
if (h) {
|
|
||||||
$WH.ae(g, $WH.ct(" "))
|
|
||||||
} else {
|
|
||||||
h = 1
|
|
||||||
}
|
}
|
||||||
k = $WH.ce("span");
|
|
||||||
k.className = "moneyarena tip";
|
_ = $WH.ce('span');
|
||||||
k.onmouseover = Listview.funcBox.moneyArenaOver;
|
_.className = 'moneycopper';
|
||||||
k.onmousemove = $WH.Tooltip.cursorUpdate;
|
$WH.ae(_, $WH.ct(money));
|
||||||
k.onmouseout = $WH.Tooltip.hide;
|
$WH.ae(d, _);
|
||||||
$WH.ae(k, $WH.ct($WH.number_format(j)));
|
|
||||||
$WH.ae(g, k)
|
|
||||||
}
|
}
|
||||||
if (c != null) {
|
|
||||||
for (var b = 0; b < c.length; ++b) {
|
if (costItems != null) {
|
||||||
if (h) {
|
for (var i = 0; i < costItems.length; ++i) {
|
||||||
$WH.ae(g, $WH.ct(" "))
|
if (ns) {
|
||||||
} else {
|
$WH.ae(d, $WH.ct(' '));
|
||||||
h = 1
|
|
||||||
}
|
}
|
||||||
var o = c[b][0];
|
else {
|
||||||
var e = c[b][1];
|
ns = 1;
|
||||||
k = $WH.ce("a");
|
}
|
||||||
k.href = "?item=" + o;
|
|
||||||
k.className = "moneyitem";
|
var itemId = costItems[i][0];
|
||||||
k.style.backgroundImage = "url(images/icons/tiny/" + g_items.getIcon(o).toLowerCase() + ".gif)";
|
var count = costItems[i][1];
|
||||||
$WH.ae(k, $WH.ct(e));
|
var icon = g_items.getIcon(itemId);
|
||||||
$WH.ae(g, k)
|
|
||||||
|
_ = $WH.ce('a');
|
||||||
|
_.href = '?item=' + itemId;
|
||||||
|
_.className = 'moneyitem';
|
||||||
|
_.style.backgroundImage = 'url(' + g_staticUrl + '/images/icons/tiny/' + icon.toLowerCase() + '.gif)';
|
||||||
|
$WH.ae(_, $WH.ct(count));
|
||||||
|
$WH.ae(d, _);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (l != null) {
|
|
||||||
if (h) {
|
if (costCurrency != null) {
|
||||||
$WH.ae(g, $WH.ct(" "))
|
for (var i = 0; i < costCurrency.length; ++i) {
|
||||||
} else {
|
if (ns) {
|
||||||
h = 1
|
$WH.ae(d, $WH.ct(' '));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ns = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
var currencyId = costCurrency[i][0];
|
||||||
|
var count = costCurrency[i][1];
|
||||||
|
var icon = ['inv_misc_questionmark', 'inv_misc_questionmark'];
|
||||||
|
if (g_gatheredcurrencies[currencyId]) {
|
||||||
|
icon = g_gatheredcurrencies[currencyId].icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
// sarjuuk: replacement
|
||||||
|
_ = $WH.ce('a');
|
||||||
|
_.href = '?currency=' + currencyId;
|
||||||
|
_.onmousemove = $WH.Tooltip.cursorUpdate;
|
||||||
|
_.onmouseout = $WH.Tooltip.hide;
|
||||||
|
if (currencyId == 103) { // arena
|
||||||
|
_.className = 'moneyarena tip';
|
||||||
|
_.onmouseover = Listview.funcBox.moneyArenaOver;
|
||||||
|
$WH.ae(_, $WH.ct($WH.number_format(count)));
|
||||||
|
}
|
||||||
|
else if (currencyId == 104) { // honor
|
||||||
|
if (side == 3 && icon[0] == icon[1]) {
|
||||||
|
side = 1;
|
||||||
|
}
|
||||||
|
_.className = 'money' + (side == 1 ? 'alliance' : 'horde') + ' tip';
|
||||||
|
_.onmouseover = Listview.funcBox.moneyHonorOver;
|
||||||
|
|
||||||
|
if (side == 3) {
|
||||||
|
__ = $WH.ce('span');
|
||||||
|
__.className = 'moneyalliance';
|
||||||
|
$WH.ae(__, $WH.ct($WH.number_format(count)));
|
||||||
|
$WH.ae(_, __);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$WH.ae(_, $WH.ct($WH.number_format(count)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else { // tokens
|
||||||
|
_.className = 'icontinyr tip q1';
|
||||||
|
_.style.backgroundImage = 'url(' + g_staticUrl + '/images/icons/tiny/' + icon[0].toLowerCase() + '.gif)';
|
||||||
|
_.onmouseover = Listview.funcBox.moneyCurrencyOver.bind(_, currencyId, count);
|
||||||
|
$WH.ae(_, $WH.ct($WH.number_format(count)));
|
||||||
|
}
|
||||||
|
/* sarjuuk: original
|
||||||
|
if (side == 3 && icon[0] == icon[1]) {
|
||||||
|
side = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
_ = $WH.ce('a');
|
||||||
|
_.href = '?currency=' + currencyId;
|
||||||
|
_.className = 'icontinyr tip q1';
|
||||||
|
_.style.backgroundImage = 'url(' + g_staticUrl + '/images/icons/tiny/' + icon[(side == 3 ? 1 : side - 1)].toLowerCase() + '.gif)';
|
||||||
|
_.onmouseover = Listview.funcBox.moneyCurrencyOver.bind(_, currencyId, count);
|
||||||
|
_.onmousemove = $WH.Tooltip.cursorUpdate;
|
||||||
|
_.onmouseout = $WH.Tooltip.hide;
|
||||||
|
$WH.ae(d, _);
|
||||||
|
|
||||||
|
if (side == 3) {
|
||||||
|
__ = $WH.ce('span');
|
||||||
|
__.className = 'icontinyr';
|
||||||
|
__.style.backgroundImage = 'url(' + g_staticUrl + '/images/icons/tiny/' + icon[0].toLowerCase() + '.gif)';
|
||||||
|
$WH.ae(_, __);
|
||||||
|
_ = __;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
$WH.ae(d, _);
|
||||||
}
|
}
|
||||||
k = $WH.ce("span");
|
}
|
||||||
k.className = "moneyachievement tip";
|
|
||||||
k.onmouseover = Listview.funcBox.moneyAchievementOver;
|
if (achievementPoints > 0) {
|
||||||
k.onmousemove = $WH.Tooltip.cursorUpdate;
|
if (ns) {
|
||||||
k.onmouseout = $WH.Tooltip.hide;
|
$WH.ae(d, $WH.ct(' '));
|
||||||
$WH.ae(k, $WH.ct($WH.number_format(l)));
|
}
|
||||||
$WH.ae(g, k)
|
else {
|
||||||
|
ns = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
_ = $WH.ce('span');
|
||||||
|
_.className = 'moneyachievement tip';
|
||||||
|
_.onmouseover = Listview.funcBox.moneyAchievementOver;
|
||||||
|
_.onmousemove = $WH.Tooltip.cursorUpdate;
|
||||||
|
_.onmouseout = $WH.Tooltip.hide;
|
||||||
|
$WH.ae(_, $WH.ct($WH.number_format(achievementPoints)));
|
||||||
|
$WH.ae(d, _);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -9283,7 +9432,7 @@ Listview.templates = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (quest.currencyrewards != null) {
|
if (quest.currencyrewards != null) {
|
||||||
Listview.funcBox.appendMoney(td, null, null, quest.side, null, quest.currencyrewards); // todo: update appendMoney ..!important!
|
Listview.funcBox.appendMoney(td, null, quest.side, null, quest.currencyrewards);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -12113,7 +12262,7 @@ Listview.templates = {
|
|||||||
value: 'points',
|
value: 'points',
|
||||||
compute: function(achievement, td) {
|
compute: function(achievement, td) {
|
||||||
if (achievement.points) {
|
if (achievement.points) {
|
||||||
Listview.funcBox.appendMoney(td, 0, null, 0, 0, 0, achievement.points);
|
Listview.funcBox.appendMoney(td, 0, null, 0, 0, achievement.points);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -12761,7 +12910,7 @@ Listview.templates = {
|
|||||||
tooltip: LANG.tooltip_achievementpoints,
|
tooltip: LANG.tooltip_achievementpoints,
|
||||||
compute: function(profile, td) {
|
compute: function(profile, td) {
|
||||||
if (profile.achievementpoints) {
|
if (profile.achievementpoints) {
|
||||||
Listview.funcBox.appendMoney(td, 0, null, 0, 0, 0, profile.achievementpoints);
|
Listview.funcBox.appendMoney(td, 0, null, 0, 0, profile.achievementpoints);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hidden: 1
|
hidden: 1
|
||||||
|
|||||||
Reference in New Issue
Block a user