- enabled minimap in listviews for premium users & staff

- NPCs: display information about mechImmune and extraFlags to staff
This commit is contained in:
Sarjuuk
2015-03-28 23:14:37 +01:00
parent c7fe84b7e0
commit d47fa93806
4 changed files with 60 additions and 3 deletions

View File

@@ -174,6 +174,57 @@ class NpcPage extends GenericPage
$infobox[] = 'AI'.Lang::$main['colon'].$_; $infobox[] = 'AI'.Lang::$main['colon'].$_;
} }
if (User::isInGroup(U_GROUP_STAFF))
{
// Mechanic immune
if ($immuneMask = $this->subject->getField('mechanicImmuneMask'))
{
$buff = [];
for ($i = 0; $i < 31; $i++)
if ($immuneMask & (1 << $i))
$buff[] = (!fMod(count($buff), 3) ? "\n" : null).'[url=?spells&filter=me='.($i + 1).']'.Lang::game('me', $i + 1).'[/url]';
$infobox[] = 'Not affected by mechanic'.Lang::main('colon').implode(', ', $buff);
}
// extra flags
if ($flagsExtra = $this->subject->getField('flagsExtra'))
{
$buff = [];
if ($flagsExtra & 0x000001)
$buff[] = 'Binds attacker to instance on death';
if ($flagsExtra & 0x000002)
$buff[] = '[tooltip name=civilian]does not aggro[/tooltip][span class=tip tooltip=civilian]Civilian[/span]';
if ($flagsExtra & 0x000004)
$buff[] = 'Cannot parry';
if ($flagsExtra & 0x000008)
$buff[] = 'Has no parry haste';
if ($flagsExtra & 0x000010)
$buff[] = 'Cannot block';
if ($flagsExtra & 0x000020)
$buff[] = 'Cannot deal Crushing Blows';
if ($flagsExtra & 0x000040)
$buff[] = 'Rewards no experience';
if ($flagsExtra & 0x000080)
$buff[] = 'Trigger-Creature';
if ($flagsExtra & 0x000100)
$buff[] = 'Immune to Taunt';
if ($flagsExtra & 0x008000)
$buff[] = '[tooltip name=guard]ignores enemy stealth, invisibility and Feign Death[/tooltip][span class=tip tooltip=guard]Guard[/span]';
if ($flagsExtra & 0x020000)
$buff[] = 'Cannot deal Critical Hits';
if ($flagsExtra & 0x040000)
$buff[] = 'Attacker does not gain weapon skill';
if ($flagsExtra & 0x080000)
$buff[] = 'Taunt has diminishing returns';
if ($flagsExtra & 0x100000)
$buff[] = 'Is subject to diminishing returns';
if ($buff)
$infobox[] = 'Extra Flags'.Lang::main('colon').'[ul][li]'.implode('[/li][li]', $buff).'[/li][/ul]';
}
}
// > Stats // > Stats
$_nf = function ($num) { return number_format($num, 0, '', '.'); }; $_nf = function ($num) { return number_format($num, 0, '', '.'); };
$stats = []; $stats = [];
@@ -735,7 +786,7 @@ class NpcPage extends GenericPage
$x = '$WowheadPower.registerNpc('.$this->typeId.', '.User::$localeId.", {\n"; $x = '$WowheadPower.registerNpc('.$this->typeId.', '.User::$localeId.", {\n";
$x .= "\tname_".User::$localeString.": '".Util::jsEscape($this->subject->getField('name', true))."',\n"; $x .= "\tname_".User::$localeString.": '".Util::jsEscape($this->subject->getField('name', true))."',\n";
$x .= "\ttooltip_".User::$localeString.": '".Util::jsEscape($this->subject->renderTooltip())."',\n"; $x .= "\ttooltip_".User::$localeString.": '".Util::jsEscape($this->subject->renderTooltip())."',\n";
$x .= "\tmap: ".($s ? Util::toJSON(['zone' => $s[0], 'coords' => [$s[1] => $s[2]]]) : '{}')."\n"; $x .= "\tmap: ".($s ? "{zone: ".$s[0].", coords: {".$s[1].":".Util::toJSON($s[2])."}}" : '{}')."\n";
$x .= "});"; $x .= "});";
return $x; return $x;

View File

@@ -465,7 +465,7 @@ class ObjectPage extends GenericPage
$x = '$WowheadPower.registerObject('.$this->typeId.', '.User::$localeId.", {\n"; $x = '$WowheadPower.registerObject('.$this->typeId.', '.User::$localeId.", {\n";
$x .= "\tname_".User::$localeString.": '".Util::jsEscape($this->subject->getField('name', true))."',\n"; $x .= "\tname_".User::$localeString.": '".Util::jsEscape($this->subject->getField('name', true))."',\n";
$x .= "\ttooltip_".User::$localeString.": '".Util::jsEscape($this->subject->renderTooltip())."',\n"; $x .= "\ttooltip_".User::$localeString.": '".Util::jsEscape($this->subject->renderTooltip())."',\n";
$x .= "\tmap: ".($s ? Util::toJSON(['zone' => $s[0], 'coords' => [$s[1] => $s[2]]]) : '{}')."\n"; $x .= "\tmap: ".($s ? "{zone: ".$s[0].", coords: {".$s[1].":".Util::toJSON($s[2])."}}" : '{}')."\n";
$x .= "});"; $x .= "});";
return $x; return $x;

View File

@@ -666,7 +666,7 @@ if (typeof $WowheadPower == "undefined") {
arr[id].timer = null; arr[id].timer = null;
} }
if (!$WH.wowheadRemote && json.map) { if (!$WH.wowheadRemote && !$.isEmptyObject(json.map)) {
if (arr[id].map == null) { if (arr[id].map == null) {
arr[id].map = new Mapper({ arr[id].map = new Mapper({
parent: $WH.ce("div"), parent: $WH.ce("div"),

View File

@@ -10493,6 +10493,9 @@ Listview.templates = {
a.style.backgroundImage = "url(" + g_staticUrl + "/images/wow/icons/tiny/quest_start.gif)"; a.style.backgroundImage = "url(" + g_staticUrl + "/images/wow/icons/tiny/quest_start.gif)";
} }
if (g_user.roles & U_GROUP_PREMIUM_PERMISSIONS)
a.rel = 'map';
$WH.ae(wrapper, a); $WH.ae(wrapper, a);
if (npc.tag != null) { if (npc.tag != null) {
@@ -10731,6 +10734,9 @@ Listview.templates = {
a.style.backgroundImage = "url(" + g_staticUrl + "/images/wow/icons/tiny/quest_start.gif)"; a.style.backgroundImage = "url(" + g_staticUrl + "/images/wow/icons/tiny/quest_start.gif)";
} }
if (g_user.roles & U_GROUP_PREMIUM_PERMISSIONS)
a.rel = 'map';
$WH.ae(wrapper, a); $WH.ae(wrapper, a);
if (object.method != null) { if (object.method != null) {