mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Zones/QuickFacts
* unlink quick facts from articles and store per-row * new system allows generic and manual QuickFacts to coexist * fill new table with data for zones * if someone used static quickFacts .. uh .. good luck?
This commit is contained in:
@@ -411,7 +411,7 @@ class SmartAction
|
||||
$buff[] = '[emote='.$this->param[$i].']';
|
||||
$this->jsGlobals[Type::EMOTE][$this->param[$i]] = $this->param[$i];
|
||||
}
|
||||
$this->param[10] = Lang::concat($buff, false);
|
||||
$this->param[10] = Lang::concat($buff, Lang::CONCAT_OR);
|
||||
break;
|
||||
case self::ACTION_SET_FACTION: // 2 -> any target
|
||||
if ($this->param[0])
|
||||
@@ -592,7 +592,7 @@ class SmartAction
|
||||
foreach ($tal->getTabs() as $guid => $tt)
|
||||
$this->smartAI->addTab($guid, $tt);
|
||||
}
|
||||
$this->param[10] = Lang::concat($talBuff, false);
|
||||
$this->param[10] = Lang::concat($talBuff, Lang::CONCAT_OR);
|
||||
break;
|
||||
case self::ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST:// 88 -> self
|
||||
$talBuff = [];
|
||||
@@ -608,7 +608,7 @@ class SmartAction
|
||||
foreach ($tal->getTabs() as $guid => $tt)
|
||||
$this->smartAI->addTab($guid, $tt);
|
||||
}
|
||||
$this->param[10] = Lang::concat($talBuff, false);
|
||||
$this->param[10] = Lang::concat($talBuff, Lang::CONCAT_OR);
|
||||
break;
|
||||
case self::ACTION_SET_HOME_POS: // 101 -> self
|
||||
if ($this->smartAI->getTarget()?->type == Smarttarget::TARGET_SELF)
|
||||
@@ -636,7 +636,7 @@ class SmartAction
|
||||
$this->param[10] = Lang::concat($buff);
|
||||
break;
|
||||
case self::ACTION_START_CLOSEST_WAYPOINT: // 113 -> any target
|
||||
$this->param[10] = Lang::concat(array_filter($this->param), false, fn($x) => '#[b]'.$x.'[/b]');
|
||||
$this->param[10] = Lang::concat(array_filter($this->param), Lang::CONCAT_OR, fn($x) => '#[b]'.$x.'[/b]');
|
||||
break;
|
||||
case self::ACTION_RANDOM_SOUND: // 115 -> self
|
||||
for ($i = 0; $i < 4; $i++)
|
||||
|
||||
@@ -282,7 +282,7 @@ class SmartEvent
|
||||
break;
|
||||
case self::EVENT_LINK: // 61 - Used to link together multiple events as a chain of events.
|
||||
if ($links = DB::World()->selectCol('SELECT `id` FROM smart_scripts WHERE `link` = ?d AND `entryorguid` = ?d AND `source_type` = ?d', $this->id, $this->smartAI->entry, $this->smartAI->srcType))
|
||||
$this->param[10] = LANG::concat($links, false, fn($x) => "#[b]".$x."[/b]");
|
||||
$this->param[10] = Lang::concat($links, Lang::CONCAT_OR, fn($x) => "#[b]".$x."[/b]");
|
||||
break;
|
||||
case self::EVENT_GOSSIP_SELECT: // 62 - On gossip clicked (gossip_menu_option335).
|
||||
$gmo = DB::World()->selectRow(
|
||||
@@ -323,7 +323,7 @@ class SmartEvent
|
||||
trigger_error('SmartAI::event - entity for event #'.$this->type.' not defined');
|
||||
break;
|
||||
case self::EVENT_EVENT_PHASE_CHANGE: // 66 - On event phase mask set
|
||||
$this->param[10] = Lang::concat(Util::mask2bits($this->param[0]), false);
|
||||
$this->param[10] = Lang::concat(Util::mask2bits($this->param[0]), Lang::CONCAT_OR);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,10 @@ class Lang
|
||||
public const FMT_HTML = 1;
|
||||
public const FMT_MARKUP = 2;
|
||||
|
||||
public const CONCAT_NONE = 0;
|
||||
public const CONCAT_AND = 1;
|
||||
public const CONCAT_OR = 2;
|
||||
|
||||
public static function load(Locale $loc) : void
|
||||
{
|
||||
if (self::$locale == $loc)
|
||||
@@ -117,27 +121,28 @@ class Lang
|
||||
return $ref;
|
||||
}
|
||||
|
||||
public static function concat(array $args, bool $useAnd = true, ?callable $callback = null) : string
|
||||
public static function concat(array $args, int $concat = self::CONCAT_AND, ?callable $callback = null) : string
|
||||
{
|
||||
$b = '';
|
||||
$i = 0;
|
||||
$n = count($args);
|
||||
|
||||
$buff = '';
|
||||
$callback ??= fn($x) => $x;
|
||||
|
||||
foreach ($args as $k => $arg)
|
||||
reset($args);
|
||||
|
||||
do
|
||||
{
|
||||
$b .= $callback($arg, $k);
|
||||
$item = $callback(current($args), key($args));
|
||||
$arg = next($args);
|
||||
|
||||
if ($n > 1 && $i < ($n - 2))
|
||||
$b .= ', ';
|
||||
else if ($n > 1 && $i == $n - 2)
|
||||
$b .= self::main($useAnd ? 'and' : 'or');
|
||||
|
||||
$i++;
|
||||
if ($arg !== false || $concat == self::CONCAT_NONE)
|
||||
$buff .= ', '.$item;
|
||||
else if ($concat == self::CONCAT_AND)
|
||||
$buff .= self::main('and').' '.$item;
|
||||
else
|
||||
$buff .= self::main('or').' '.$item;
|
||||
}
|
||||
while ($arg !== false);
|
||||
|
||||
return $b;
|
||||
return substr($buff, 2);
|
||||
}
|
||||
|
||||
// truncate string after X chars. If X is inside a word truncate behind it.
|
||||
|
||||
@@ -1210,19 +1210,23 @@ $lang = array(
|
||||
),
|
||||
'zone' => array(
|
||||
'notFound' => "Dieses Gebiet existiert nicht.",
|
||||
'attunement' => ["Einstimmung", "Heroische Einstimmung"],
|
||||
'key' => ["Schlüssel", "Heroischer Schlüssel"],
|
||||
'location' => "Ort",
|
||||
'raidFaction' => "Schlachtzugsfraktion",
|
||||
'boss' => "Endboss",
|
||||
'attunement' => ["Einstimmung: ", "Heroische Einstimmung: "],
|
||||
'key' => ["Schlüssel: ", "Heroischer Schlüssel: "],
|
||||
'location' => "Ort: ",
|
||||
'faction' => "Fraktion: ",
|
||||
'factions' => "Fraktionen: ",
|
||||
'raidFaction' => "Schlachtzugsfraktion: ",
|
||||
'reputationHub' => "Reputation Hub: ",
|
||||
'boss' => "Endboss: ",
|
||||
'reqLevels' => "Mindeststufe: [tooltip=instancereqlevel_tip]%d[/tooltip], [tooltip=lfgreqlevel_tip]%d[/tooltip]",
|
||||
'zonePartOf' => "Diese Zone ist Teil von [zone=%d].",
|
||||
'autoRez' => "Automatische Wiederbelebung",
|
||||
'city' => "Stadt",
|
||||
'territory' => "Territorium",
|
||||
'instanceType' => "Instanzart",
|
||||
'territory' => "Territorium: ",
|
||||
'instanceType' => "Instanzart: ",
|
||||
'hcAvailable' => "Heroischer Modus verfügbar (%d)",
|
||||
'numPlayers' => "Anzahl an Spielern",
|
||||
'numPlayers' => 'Anzahl an Spielern: %1$s',
|
||||
'numPlayersVs' => 'Anzahl an Spielern: %1$dv%1$d',
|
||||
'noMap' => "Für dieses Gebiet steht keine Karte zur Verfügung.",
|
||||
'fishingSkill' => "25 – 100% Chance einen gelisteten Fisch zu fangen.",
|
||||
'instanceTypes' => ["Zone", "Durchgang", "Dungeon", "Schlachtzug", "Battleground", "Dungeon", "Arena", "Schlachtzug", "Schlachtzug"],
|
||||
|
||||
@@ -1210,19 +1210,23 @@ $lang = array(
|
||||
),
|
||||
'zone' => array(
|
||||
'notFound' => "This zone doesn't exist.",
|
||||
'attunement' => ["Attunement", "Heroic attunement"],
|
||||
'key' => ["Key", "Heroic key"],
|
||||
'location' => "Location",
|
||||
'raidFaction' => "Raid faction",
|
||||
'boss' => "Final boss",
|
||||
'attunement' => ["Attunement: ", "Heroic attunement: "],
|
||||
'key' => ["Key: ", "Heroic key: "],
|
||||
'location' => "Location: ",
|
||||
'faction' => "Faction: ",
|
||||
'factions' => "Factions: ",
|
||||
'raidFaction' => "Raid faction: ",
|
||||
'reputationHub' => "Reputation Hub: ",
|
||||
'boss' => "Final boss: ",
|
||||
'reqLevels' => "Required levels: [tooltip=instancereqlevel_tip]%d[/tooltip], [tooltip=lfgreqlevel_tip]%d[/tooltip]",
|
||||
'zonePartOf' => "This zone is part of [zone=%s].",
|
||||
'autoRez' => "Automatic resurrection",
|
||||
'city' => "City",
|
||||
'territory' => "Territory",
|
||||
'instanceType' => "Instance type",
|
||||
'territory' => "Territory: ",
|
||||
'instanceType' => "Instance type: ",
|
||||
'hcAvailable' => "Heroic mode available (%d)",
|
||||
'numPlayers' => "Number of players",
|
||||
'numPlayers' => 'Number of players: %1$s',
|
||||
'numPlayersVs' => 'Number of players: %1$dv%1$d',
|
||||
'noMap' => "There is no map available for this zone.",
|
||||
'fishingSkill' => "25 – 100% chance to catch a listed fish.",
|
||||
'instanceTypes' => ["Zone", "Transit", "Dungeon", "Raid", "Battleground", "Dungeon", "Arena", "Raid", "Raid"],
|
||||
|
||||
@@ -1210,19 +1210,23 @@ $lang = array(
|
||||
),
|
||||
'zone' => array(
|
||||
'notFound' => "Esta zona no existe.",
|
||||
'attunement' => ["Requisito", "Requisito heroica"],
|
||||
'key' => ["Llave", "Llave heroica"],
|
||||
'location' => "Ubicación",
|
||||
'raidFaction' => "Facción de la banda",
|
||||
'boss' => "Jefe Final",
|
||||
'attunement' => ["Requisito: ", "Requisito heroica: "],
|
||||
'key' => ["Llave: ", "Llave heroica: "],
|
||||
'location' => "Ubicación: ",
|
||||
'faction' => "Facción: ",
|
||||
'factions' => "Facciones: ",
|
||||
'raidFaction' => "Facción de la banda: ",
|
||||
'reputationHub' => "[Reputation Hub]: ",
|
||||
'boss' => "Jefe Final: ",
|
||||
'reqLevels' => "Niveles requeridos: [tooltip=instancereqlevel_tip]%d[/tooltip], [tooltip=lfgreqlevel_tip]%d[/tooltip]",
|
||||
'zonePartOf' => "Este campo es parte de la zona [zone=%d].",
|
||||
'autoRez' => "Resurrección automática",
|
||||
'city' => "Ciudad",
|
||||
'territory' => "Territorio",
|
||||
'instanceType' => "Tipo de instancia",
|
||||
'territory' => "Territorio: ",
|
||||
'instanceType' => "Tipo de instancia: ",
|
||||
'hcAvailable' => "Modo heroico disponible (%di)",
|
||||
'numPlayers' => "Número de jugadores",
|
||||
'numPlayers' => 'Número de jugadores: %1$s',
|
||||
'numPlayersVs' => 'Número de jugadores: %1$dc%1$d',
|
||||
'noMap' => "No hay mapa disponible para esta zona.",
|
||||
'fishingSkill' => "25 – 100% de probabilidad de pescar un pez listado.",
|
||||
'instanceTypes' => ["Zona", "Tránsito", "Mazmorra", "Banda", "Campo de batalla", "Mazmorra", "Arena", "Banda", "Banda"],
|
||||
|
||||
@@ -1210,19 +1210,23 @@ $lang = array(
|
||||
),
|
||||
'zone' => array(
|
||||
'notFound' => "Cette zone n'existe pas.",
|
||||
'attunement' => ["Accès", "Accès Héroïque"],
|
||||
'key' => ["Clef", "Clef Héroïque"],
|
||||
'location' => "Localisation",
|
||||
'raidFaction' => "Faction de raid",
|
||||
'boss' => "Boss final",
|
||||
'attunement' => ["Accès : ", "Accès Héroïque : "],
|
||||
'key' => ["Clef : ", "Clef Héroïque : "],
|
||||
'location' => "Localisation : ",
|
||||
'faction' => "Faction : ",
|
||||
'factions' => "Factions : ",
|
||||
'raidFaction' => "Faction de raid : ",
|
||||
'reputationHub' => "[Reputation Hub] : ",
|
||||
'boss' => "Boss final : ",
|
||||
'reqLevels' => "Niveaux requis : [tooltip=instancereqlevel_tip]%d[/tooltip], [tooltip=lfgreqlevel_tip]%d[/tooltip]",
|
||||
'zonePartOf' => "Cette zone fait partie de la zone [zone=%d].",
|
||||
'autoRez' => "Résurrection automatique",
|
||||
'city' => "Ville",
|
||||
'territory' => "Territoire",
|
||||
'instanceType' => "Type d'instance",
|
||||
'territory' => "Territoire : ",
|
||||
'instanceType' => "Type d'instance : ",
|
||||
'hcAvailable' => "Mode héroïque disponible (%d)",
|
||||
'numPlayers' => "Nombre de joueurs",
|
||||
'numPlayers' => 'Nombre de joueurs: %1$s',
|
||||
'numPlayersVs' => 'Nombre de joueurs: %1$dc%1$d',
|
||||
'noMap' => "Il n'y a aucune carte disponible pour cette zone.",
|
||||
'fishingSkill' => "[25 – 100% chance to catch a listed fish.]",
|
||||
'instanceTypes' => ["Zone", "Transit", "Donjon", "Raid", "Champ de bataille", "Donjon", "Arène", "Raid", "Raid"],
|
||||
|
||||
@@ -1210,19 +1210,23 @@ $lang = array(
|
||||
),
|
||||
'zone' => array(
|
||||
'notFound' => "Такая местность не существует.",
|
||||
'attunement' => ["[Attunement]", "[Heroic attunement]"],
|
||||
'key' => ["[Key]", "[Heroic key]"],
|
||||
'location' => "Местоположение",
|
||||
'raidFaction' => "Фракция рейда",
|
||||
'boss' => "Последний босс",
|
||||
'attunement' => ["[Attunement]: ", "[Heroic attunement]: "],
|
||||
'key' => ["[Key]: ", "[Heroic key]: "],
|
||||
'location' => "Местоположение: ",
|
||||
'faction' => "Фракция: ",
|
||||
'factions' => "Фракции: ",
|
||||
'raidFaction' => "Фракция рейда: ",
|
||||
'reputationHub' => "Reputation Hub: ",
|
||||
'boss' => "Последний босс: ",
|
||||
'reqLevels' => "Требуемые уровни: [tooltip=instancereqlevel_tip]%d[/tooltip], [tooltip=lfgreqlevel_tip]%d[/tooltip]",
|
||||
'zonePartOf' => "Эта игровая локация является частью локации [zone=%d].",
|
||||
'autoRez' => "Автоматическое воскрешение",
|
||||
'city' => "Город",
|
||||
'territory' => "Территория",
|
||||
'instanceType' => "Тип подземелья",
|
||||
'territory' => "Территория: ",
|
||||
'instanceType' => "Тип подземелья: ",
|
||||
'hcAvailable' => "Доступен героический режим (%d)",
|
||||
'numPlayers' => "Количество игроков",
|
||||
'numPlayers' => 'Количество игроков: %1$s',
|
||||
'numPlayersVs' => 'Количество игроков: %1$dv%1$d',
|
||||
'noMap' => "Для данной местности нет доступной карты.",
|
||||
'fishingSkill' => "[25 – 100% chance to catch a listed fish.]",
|
||||
'instanceTypes' => ["Игровая зона", "Транзит", "Подземелье", "Рейд", "Поле боя", "Подземелье", "Арена", "Рейд", "Рейд"],
|
||||
|
||||
@@ -1210,19 +1210,23 @@ $lang = array(
|
||||
),
|
||||
'zone' => array(
|
||||
'notFound' => "这个区域不存在。",
|
||||
'attunement' => ["调整", "英雄调整"],
|
||||
'key' => ["钥匙", "英雄钥匙"],
|
||||
'location' => "位置",
|
||||
'raidFaction' => "团队副本阵营",
|
||||
'boss' => "最终首领",
|
||||
'attunement' => ["调整:", "英雄调整:"],
|
||||
'key' => ["钥匙:", "英雄钥匙:"],
|
||||
'location' => "位置:",
|
||||
'faction' => "阵营:",
|
||||
'factions' => "阵营:",
|
||||
'raidFaction' => "团队副本阵营:",
|
||||
'reputationHub' => "[Reputation Hub]:",
|
||||
'boss' => "最终首领:",
|
||||
'reqLevels' => "要求等级: [tooltip=instancereqlevel_tip]%d[/tooltip], [tooltip=lfgreqlevel_tip]%d[/tooltip]",
|
||||
'zonePartOf' => "这个区域是[zone=%s]的一部分。",
|
||||
'autoRez' => "自动复活",
|
||||
'city' => "城市",
|
||||
'territory' => "领地",
|
||||
'instanceType' => "副本类型",
|
||||
'territory' => "领地:",
|
||||
'instanceType' => "副本类型:",
|
||||
'hcAvailable' => "英雄模式可用 (%d)",
|
||||
'numPlayers' => "玩家人数",
|
||||
'numPlayers' => '玩家人数:%1$s',
|
||||
'numPlayersVs' => '玩家人数:%1$dv%1$d',
|
||||
'noMap' => "这个区域没有可用地图。",
|
||||
'fishingSkill' => "[25 – 100% chance to catch a listed fish.]",
|
||||
'instanceTypes' => ["区域", "运送", "地下城", "团队副本", "战场", "地下城", "竞技场", "团队副本", "团队副本"],
|
||||
|
||||
@@ -547,21 +547,19 @@ class GenericPage
|
||||
|
||||
$article = [];
|
||||
if (isset($this->guideRevision))
|
||||
$article = DB::Aowow()->selectRow('SELECT `article`, `quickInfo`, `locale`, `editAccess` FROM ?_articles WHERE `type` = ?d AND `typeId` = ?d AND `rev` = ?d',
|
||||
$article = DB::Aowow()->selectRow('SELECT `article`, `locale`, `editAccess` FROM ?_articles WHERE `type` = ?d AND `typeId` = ?d AND `rev` = ?d',
|
||||
Type::GUIDE, $this->typeId, $this->guideRevision);
|
||||
else if (!empty($this->articleUrl))
|
||||
$article = DB::Aowow()->selectRow('SELECT `article`, `quickInfo`, `locale`, `editAccess` FROM ?_articles WHERE `url` = ? AND `locale` IN (?a) ORDER BY `locale` DESC, `rev` DESC LIMIT 1',
|
||||
$article = DB::Aowow()->selectRow('SELECT `article`, `locale`, `editAccess` FROM ?_articles WHERE `url` = ? AND `locale` IN (?a) ORDER BY `locale` DESC, `rev` DESC LIMIT 1',
|
||||
$this->articleUrl, [Lang::getLocale()->value, Locale::EN->value]);
|
||||
else if (!empty($this->type) && isset($this->typeId))
|
||||
$article = DB::Aowow()->selectRow('SELECT `article`, `quickInfo`, `locale`, `editAccess` FROM ?_articles WHERE `type` = ?d AND `typeId` = ?d AND `locale` IN (?a) ORDER BY `locale` DESC, `rev` DESC LIMIT 1',
|
||||
$article = DB::Aowow()->selectRow('SELECT `article`, `locale`, `editAccess` FROM ?_articles WHERE `type` = ?d AND `typeId` = ?d AND `locale` IN (?a) ORDER BY `locale` DESC, `rev` DESC LIMIT 1',
|
||||
$this->type, $this->typeId, [Lang::getLocale()->value, Locale::EN->value]);
|
||||
|
||||
if ($article)
|
||||
{
|
||||
if ($article['article'])
|
||||
Markup::parseTags($article['article'], $this->jsgBuffer);
|
||||
if ($article['quickInfo'])
|
||||
Markup::parseTags($article['quickInfo'], $this->jsgBuffer);
|
||||
|
||||
$this->article = array(
|
||||
'text' => Util::jsEscape(Util::defStatic($article['article'])),
|
||||
@@ -585,9 +583,6 @@ class GenericPage
|
||||
|
||||
$this->editAccess = $article['editAccess'];
|
||||
|
||||
if (empty($this->infobox) && !empty($article['quickInfo']))
|
||||
$this->infobox = $article['quickInfo'];
|
||||
|
||||
if ($article['locale'] != Lang::getLocale()->value)
|
||||
$this->article['params']['prepend'] = '<div class="notice-box"><span class="icon-bubble">'.Lang::main('langOnly', [Lang::lang($article['locale'])]).'</span></div>';
|
||||
|
||||
|
||||
@@ -298,7 +298,7 @@ class ItemPage extends genericPage
|
||||
if ($_reqRating && $_reqRating[0])
|
||||
{
|
||||
$text = str_replace('<br />', ' ', Lang::item('reqRating', $_reqRating[1], [$_reqRating[0]]));
|
||||
$infobox[] = Lang::breakTextClean($text, 30, LANG::FMT_MARKUP);
|
||||
$infobox[] = Lang::breakTextClean($text, 30, Lang::FMT_MARKUP);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,8 +45,23 @@ class ZonePage extends GenericPage
|
||||
/* Infobox */
|
||||
/***********/
|
||||
|
||||
$quickFactsRows = DB::Aowow()->selectCol('SELECT `orderIdx` AS ARRAY_KEY, `row` FROM ?_quickfacts WHERE `type` = ?d AND `typeId` = ?d ORDER BY `orderIdx` ASC', $this->type, $this->typeId);
|
||||
$quickFactsRows = preg_replace_callback('/\|L:(\w+)((:\w+)+)\|/i', function ($m)
|
||||
{
|
||||
[, $grp, $args] = $m;
|
||||
$args = array_filter(explode(':', $args), fn($x) => $x != '');
|
||||
|
||||
return Lang::$grp(...$args);
|
||||
}, $quickFactsRows);
|
||||
|
||||
foreach ($quickFactsRows as $er)
|
||||
$this->extendGlobalData(Markup::parseTags($er));
|
||||
|
||||
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
|
||||
|
||||
if ($topRows = array_filter($quickFactsRows, fn($x) => $x < 0, ARRAY_FILTER_USE_KEY))
|
||||
$infobox = array_merge($infobox, $topRows);
|
||||
|
||||
// City
|
||||
if ($this->subject->getField('flags') & 0x8 && !$parentArea)
|
||||
$infobox[] = Lang::zone('city');
|
||||
@@ -76,27 +91,55 @@ class ZonePage extends GenericPage
|
||||
}
|
||||
|
||||
// Territory
|
||||
$_ = $this->subject->getField('faction');
|
||||
$__ = '%s';
|
||||
if ($_ == 0)
|
||||
$__ = '[span class=icon-alliance]%s[/span]';
|
||||
else if ($_ == 1)
|
||||
$__ = '[span class=icon-horde]%s[/span]';
|
||||
else if ($_ == 4)
|
||||
$__ = '[span class=icon-ffa]%s[/span]';
|
||||
$faction = $this->subject->getField('faction');
|
||||
$wrap = match ((int)$faction)
|
||||
{
|
||||
0 => '[span class=icon-alliance]%s[/span]',
|
||||
1 => '[span class=icon-horde]%s[/span]',
|
||||
4, 5 => '[span class=icon-ffa]%s[/span]',
|
||||
default => '%s'
|
||||
};
|
||||
|
||||
$infobox[] = Lang::zone('territory').Lang::main('colon').sprintf($__, Lang::zone('territories', $_));
|
||||
$infobox[] = Lang::zone('territory').sprintf($wrap, Lang::zone('territories', $faction));
|
||||
|
||||
// Instance Type
|
||||
$infobox[] = Lang::zone('instanceType').Lang::main('colon').'[span class=icon-instance'.$this->subject->getField('type').']'.Lang::zone('instanceTypes', $this->subject->getField('type')).'[/span]';
|
||||
$infobox[] = Lang::zone('instanceType').'[span class=icon-instance'.$this->subject->getField('type').']'.Lang::zone('instanceTypes', $this->subject->getField('type')).'[/span]';
|
||||
|
||||
// Heroic mode
|
||||
if ($_ = $this->subject->getField('levelHeroic'))
|
||||
$infobox[] = '[icon preset=heroic]'.sprintf(Lang::zone('hcAvailable'), $_).'[/icon]';
|
||||
$infobox[] = '[icon preset=heroic]'.Lang::zone('hcAvailable', [$_]).'[/icon]';
|
||||
|
||||
// number of players
|
||||
if ($_ = $this->subject->getField('maxPlayer'))
|
||||
$infobox[] = Lang::zone('numPlayers').Lang::main('colon').($_ == -2 ? '10/25' : $_);
|
||||
{
|
||||
if (in_array($this->subject->getField('category'), [6, 9]))
|
||||
$infobox[] = Lang::zone('numPlayersVs', [$_]);
|
||||
else
|
||||
$infobox[] = Lang::zone('numPlayers', [$_ == -2 ? '10/25' : $_]);
|
||||
}
|
||||
|
||||
// Instances
|
||||
if ($_ = DB::Aowow()->selectCol('SELECT `typeId` FROM ?_spawns WHERE `type`= ?d AND `areaId` = ?d ', Type::ZONE, $this->typeId))
|
||||
{
|
||||
$this->extendGlobalIds(Type::ZONE, ...$_);
|
||||
$infobox[] = Lang::maps('Instances').Lang::main('colon').Lang::concat($_, Lang::CONCAT_NONE, fn($x) => "\n[zone=".$x."]");
|
||||
}
|
||||
|
||||
// start area
|
||||
if ($_ = DB::Aowow()->selectCol('SELECT `id` FROM ?_races WHERE `startAreaId` = ?d', $this->typeId))
|
||||
{
|
||||
$this->extendGlobalIds(Type::CHR_RACE, ...$_);
|
||||
$infobox[] = Lang::concat($_, Lang::CONCAT_NONE, fn($x) => '[race='.$x.']').' '.Lang::race('startZone');
|
||||
}
|
||||
|
||||
// location (if instance)
|
||||
if ($pa = DB::Aowow()->selectRow('SELECT `areaId`, `posX`, `posY`, `floor` FROM ?_spawns WHERE `type`= ?d AND `typeId` = ?d ', Type::ZONE, $this->typeId))
|
||||
{
|
||||
$this->addMoveLocationMenu($pa['areaId'], $pa['floor']);
|
||||
|
||||
$pins = str_pad($pa['posX'] * 10, 3, '0', STR_PAD_LEFT) . str_pad($pa['posY'] * 10, 3, '0', STR_PAD_LEFT);
|
||||
$infobox[] = Lang::zone('location').'[lightbox=map zone='.$pa['areaId'].' '.($pa['floor'] > 1 ? 'floor='.--$pa['floor'] : '').' pins='.$pins.']'.ZoneList::getName($pa['areaId']).'[/lightbox]';
|
||||
}
|
||||
|
||||
// Attunement Quest/Achievements & Keys
|
||||
if ($attmnt = $this->subject->getField('attunes'))
|
||||
@@ -107,37 +150,16 @@ class ZonePage extends GenericPage
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
if ($type == Type::ITEM)
|
||||
$infobox[] = Lang::zone('key', (int)($id < 0)).Lang::main('colon').'[item='.abs($id).']';
|
||||
$infobox[] = Lang::zone('key', (int)($id < 0)).'[item='.abs($id).']';
|
||||
else
|
||||
$infobox[] = Lang::zone('attunement', (int)($id < 0)).Lang::main('colon').'['.Type::getFileString($type).'='.abs($id).']';
|
||||
$infobox[] = Lang::zone('attunement', (int)($id < 0)).'['.Type::getFileString($type).'='.abs($id).']';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Instances
|
||||
if ($_ = DB::Aowow()->selectCol('SELECT `typeId` FROM ?_spawns WHERE `type`= ?d AND `areaId` = ?d ', Type::ZONE, $this->typeId))
|
||||
{
|
||||
$this->extendGlobalIds(Type::ZONE, ...$_);
|
||||
$infobox[] = Lang::maps('Instances').Lang::main('colon')."\n[zone=".implode("], \n[zone=", $_).']';
|
||||
}
|
||||
if ($botRows = array_filter($quickFactsRows, fn($x) => $x > 0, ARRAY_FILTER_USE_KEY))
|
||||
$infobox = array_merge($infobox, $botRows);
|
||||
|
||||
// location (if instance)
|
||||
if ($pa = DB::Aowow()->selectRow('SELECT `areaId`, `posX`, `posY`, `floor` FROM ?_spawns WHERE `type`= ?d AND `typeId` = ?d ', Type::ZONE, $this->typeId))
|
||||
{
|
||||
$this->addMoveLocationMenu($pa['areaId'], $pa['floor']);
|
||||
|
||||
$pins = str_pad($pa['posX'] * 10, 3, '0', STR_PAD_LEFT) . str_pad($pa['posY'] * 10, 3, '0', STR_PAD_LEFT);
|
||||
$infobox[] = Lang::zone('location').Lang::main('colon').'[lightbox=map zone='.$pa['areaId'].' '.($pa['floor'] > 1 ? 'floor='.--$pa['floor'] : '').' pins='.$pins.']'.ZoneList::getName($pa['areaId']).'[/lightbox]';
|
||||
}
|
||||
|
||||
/* has to be defined in an article, i think
|
||||
|
||||
// faction(s) / Reputation Hub / Raid Faction
|
||||
// [li]Raid faction: [faction=1156][/li] || [li]Factions: [faction=1156]/[faction=1156][/li]
|
||||
|
||||
// final boss
|
||||
// [li]Final boss: [icon preset=boss][npc=37226][/icon][/li]
|
||||
*/
|
||||
|
||||
/****************/
|
||||
/* Main Content */
|
||||
|
||||
File diff suppressed because one or more lines are too long
160
setup/updates/1753635510_01.sql
Normal file
160
setup/updates/1753635510_01.sql
Normal file
@@ -0,0 +1,160 @@
|
||||
ALTER TABLE `aowow_articles`
|
||||
DROP COLUMN `quickInfo`;
|
||||
|
||||
DROP TABLE IF EXISTS `aowow_quickfacts`;
|
||||
CREATE TABLE `aowow_quickfacts` (
|
||||
`type` smallint unsigned NOT NULL,
|
||||
`typeId` mediumint signed NOT NULL,
|
||||
`orderIdx` tinyint signed NOT NULL COMMENT '<0: prepend to generic list; >0: append to generic list',
|
||||
`row` varchar(200) NOT NULL COMMENT 'Markdown formated',
|
||||
UNIQUE KEY `row` (`type`, `typeId`, `orderIdx`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;
|
||||
|
||||
INSERT INTO `aowow_quickfacts` VALUES
|
||||
-- Dungeons
|
||||
(7, 206, 1, '|L:zone:boss|[icon preset=boss][npc=23954][/icon]'),
|
||||
(7, 209, 1, '|L:zone:boss|[icon preset=boss][npc=4275][/icon]'),
|
||||
(7, 491, 1, '|L:zone:boss|[icon preset=boss][npc=4421][/icon]'),
|
||||
(7, 717, 1, '|L:zone:boss|[icon preset=boss][npc=1716][/icon]'),
|
||||
(7, 718, 1, '|L:zone:boss|[icon preset=boss][npc=5775][/icon]'),
|
||||
(7, 719, 1, '|L:zone:boss|[icon preset=boss][npc=4829][/icon]'),
|
||||
(7, 721, 1, '|L:zone:boss|[icon preset=boss][npc=7800][/icon]'),
|
||||
(7, 722, 1, '|L:zone:boss|[icon preset=boss][npc=7358][/icon]'),
|
||||
(7, 796, 1, '|L:zone:key:0|[item=7146]'),
|
||||
(7, 796, 2, '|L:zone:boss|[icon preset=boss][npc=3976][/icon]'),
|
||||
(7, 1176, 1, '|L:zone:boss|[icon preset=boss][npc=7267][/icon]'),
|
||||
(7, 1196, 1, '|L:zone:boss|[icon preset=boss][npc=26861][/icon]'),
|
||||
(7, 1337, 1, '|L:zone:boss|[icon preset=boss][npc=2748][/icon]'),
|
||||
(7, 1477, 1, '|L:zone:boss|[icon preset=boss][npc=5709][/icon]'),
|
||||
(7, 1581, 1, '|L:zone:boss|[icon preset=boss][npc=639][/icon]'),
|
||||
(7, 1583, 1, '|L:zone:boss|[icon preset=boss][npc=10363][/icon]'),
|
||||
(7, 1584, 1, '|L:zone:boss|[icon preset=boss][npc=9019][/icon]'),
|
||||
(7, 2017, 1, '|L:zone:boss|[icon preset=boss][npc=10440][/icon]'),
|
||||
(7, 2057, 1, '|L:zone:key:0|[item=13704]'),
|
||||
(7, 2057, 2, '|L:zone:boss|[icon preset=boss][npc=1853][/icon]'),
|
||||
(7, 2100, 1, '|L:zone:boss|[icon preset=boss][npc=12201][/icon]'),
|
||||
(7, 2366, 1, '|L:zone:faction|[faction=989]'),
|
||||
(7, 2366, 2, '|L:zone:boss|[icon preset=boss][npc=17881][/icon]'),
|
||||
(7, 2367, 1, '|L:zone:faction|[faction=989]'),
|
||||
(7, 2367, 2, '|L:zone:boss|[icon preset=boss][npc=18096][/icon]'),
|
||||
(7, 2437, 1, '|L:zone:boss|[icon preset=boss][npc=11520][/icon]'),
|
||||
(7, 3562, 1, '|L:zone:faction|[icon name=side_alliance][faction=946][/icon] / [icon name=side_horde][faction=947][/icon]'),
|
||||
(7, 3562, 2, '|L:zone:boss|[icon preset=boss][npc=17536][/icon]'),
|
||||
(7, 3713, 1, '|L:zone:faction|[icon name=side_alliance][faction=946][/icon] / [icon name=side_horde][faction=947][/icon]'),
|
||||
(7, 3713, 2, '|L:zone:boss|[icon preset=boss][npc=17377][/icon]'),
|
||||
(7, 3714, 1, '|L:zone:key:0|[item=28395]'),
|
||||
(7, 3714, 2, '|L:zone:faction|[icon name=side_alliance][faction=946][/icon] / [icon name=side_horde][faction=947][/icon]'),
|
||||
(7, 3714, 3, '|L:zone:boss|[icon preset=boss][npc=16808][/icon]'),
|
||||
(7, 3715, 1, '|L:zone:faction|[faction=942]'),
|
||||
(7, 3715, 2, '|L:zone:boss|[icon preset=boss][npc=17798][/icon]'),
|
||||
(7, 3716, 1, '|L:zone:faction|[faction=942]'),
|
||||
(7, 3716, 2, '|L:zone:boss|[icon preset=boss][npc=17882][/icon]'),
|
||||
(7, 3717, 1, '|L:zone:faction|[faction=942]'),
|
||||
(7, 3717, 2, '|L:zone:boss|[icon preset=boss][npc=17942][/icon]'),
|
||||
(7, 3789, 1, '|L:zone:key:0|[item=27991]'),
|
||||
(7, 3789, 2, '|L:zone:faction|[faction=1011]'),
|
||||
(7, 3789, 3, '|L:zone:boss|[icon preset=boss][npc=18708][/icon]'),
|
||||
(7, 3790, 1, '|L:zone:faction|[faction=1011]'),
|
||||
(7, 3790, 2, '|L:zone:boss|[icon preset=boss][npc=18373][/icon]'),
|
||||
(7, 3791, 1, '|L:zone:faction|[faction=1011]'),
|
||||
(7, 3791, 2, '|L:zone:boss|[icon preset=boss][npc=18473][/icon]'),
|
||||
(7, 3792, 1, '|L:zone:faction|[faction=933]'),
|
||||
(7, 3792, 2, '|L:zone:boss|[icon preset=boss][npc=18344][/icon]'),
|
||||
(7, 3847, 1, '|L:zone:faction|[faction=935]'),
|
||||
(7, 3847, 2, '|L:zone:boss|[icon preset=boss][npc=17977][/icon]'),
|
||||
(7, 3848, 1, '|L:zone:key:0|[item=31084]'),
|
||||
(7, 3848, 2, '|L:zone:faction|[faction=935]'),
|
||||
(7, 3848, 3, '|L:zone:boss|[icon preset=boss][npc=20912][/icon]'),
|
||||
(7, 3849, 1, '|L:zone:faction|[faction=935]'),
|
||||
(7, 3849, 2, '|L:zone:boss|[icon preset=boss][npc=19220][/icon]'),
|
||||
(7, 4100, 1, '|L:zone:boss|[icon preset=boss][npc=26533][/icon]'),
|
||||
(7, 4131, 1, '|L:zone:faction|[faction=1077]'),
|
||||
(7, 4131, 2, '|L:zone:boss|[icon preset=boss][npc=24664][/icon]'),
|
||||
(7, 4196, 1, '|L:zone:boss|[icon preset=boss][npc=26632][/icon]'),
|
||||
(7, 4228, 1, '|L:zone:boss|[icon preset=boss][npc=27656][/icon]'),
|
||||
(7, 4264, 1, '|L:zone:boss|[icon preset=boss][npc=27978][/icon]'),
|
||||
(7, 4265, 1, '|L:zone:boss|[icon preset=boss][npc=26723][/icon]'),
|
||||
(7, 4272, 1, '|L:zone:boss|[icon preset=boss][npc=28923][/icon]'),
|
||||
(7, 4277, 1, '|L:zone:boss|[icon preset=boss][npc=29120][/icon]'),
|
||||
(7, 4415, 1, '|L:zone:boss|[icon preset=boss][npc=31134][/icon]'),
|
||||
(7, 4416, 1, '|L:zone:boss|[icon preset=boss][npc=29306][/icon]'),
|
||||
(7, 4494, 1, '|L:zone:boss|[icon preset=boss][npc=29311][/icon]'),
|
||||
(7, 4723, 1, '|L:zone:boss|[icon preset=boss][npc=35451][/icon]'),
|
||||
(7, 4809, 1, '|L:zone:boss|[icon preset=boss][npc=36502][/icon]'),
|
||||
(7, 4813, 1, '|L:zone:boss|[icon preset=boss][npc=36658][/icon]'),
|
||||
(7, 4820, 1, '|L:zone:boss|[icon preset=boss][npc=36954][/icon]'),
|
||||
-- Raids
|
||||
(7, 1977, 1, '|L:zone:raidFaction|[faction=270]'),
|
||||
(7, 1977, 2, '|L:zone:boss|[icon preset=boss][npc=14834][/icon]'),
|
||||
(7, 2677, 1, '|L:zone:attunement:0|[quest=7761]'),
|
||||
(7, 2677, 2, '|L:zone:boss|[icon preset=boss][npc=11583][/icon]'),
|
||||
(7, 2717, 1, '|L:zone:attunement:0|[quest=7487]'),
|
||||
(7, 2717, 2, '|L:zone:raidFaction|[faction=749]'),
|
||||
(7, 2717, 3, '|L:zone:boss|[icon preset=boss][npc=11502][/icon]'),
|
||||
(7, 3428, 1, '|L:zone:raidFaction|[faction=910]'),
|
||||
(7, 3428, 2, '|L:zone:boss|[icon preset=boss][npc=15727][/icon]'),
|
||||
(7, 3429, 1, '|L:zone:raidFaction|[faction=609]'),
|
||||
(7, 3429, 2, '|L:zone:boss|[icon preset=boss][npc=15339][/icon]'),
|
||||
(7, 3457, 1, '|L:zone:attunement:0|[quest=9837]'),
|
||||
(7, 3457, 2, '|L:zone:key:0|[item=24490]'),
|
||||
(7, 3457, 3, '|L:zone:raidFaction|[faction=967]'),
|
||||
(7, 3457, 4, '|L:zone:boss|[icon preset=boss][npc=15690][/icon]'),
|
||||
(7, 3606, 1, '|L:zone:raidFaction|[faction=990]'),
|
||||
(7, 3606, 2, '|L:zone:boss|[icon preset=boss][npc=17968][/icon]'),
|
||||
(7, 3607, 1, '|L:zone:boss|[icon preset=boss][npc=21212][/icon]'),
|
||||
(7, 3805, 1, '|L:zone:boss|[icon preset=boss][npc=23863][/icon]'),
|
||||
(7, 3836, 1, '|L:zone:boss|[icon preset=boss][npc=17257][/icon]'),
|
||||
(7, 3845, 1, '|L:zone:boss|[icon preset=boss][npc=19622][/icon]'),
|
||||
(7, 3923, 1, '|L:zone:boss|[icon preset=boss][npc=19044][/icon]'),
|
||||
(7, 3959, 1, '|L:zone:raidFaction|[faction=1012]'),
|
||||
(7, 3959, 2, '|L:zone:boss|[icon preset=boss][npc=22917][/icon]'),
|
||||
(7, 4075, 1, '|L:zone:boss|[icon preset=boss][npc=25315][/icon]'),
|
||||
-- Zones
|
||||
(7, 1, 1, '|L:zone:city||L:main:colon|[zone=1537]'),
|
||||
(7, 12, 1, '|L:zone:city||L:main:colon|[zone=1519]'),
|
||||
(7, 14, 1, '|L:zone:city||L:main:colon|[zone=1637]'),
|
||||
(7, 65, 1, '|L:zone:reputationHub|[faction=1091]'),
|
||||
(7, 67, 1, '|L:zone:reputationHub|[faction=1119]'),
|
||||
(7, 85, 1, '|L:zone:city||L:main:colon|[zone=1497]'),
|
||||
(7, 139, 1, '|L:zone:reputationHub|[faction=529]'),
|
||||
(7, 141, 1, '|L:zone:city||L:main:colon|[zone=1657]'),
|
||||
(7, 210, 1, '|L:zone:reputationHub|[faction=1106]\n[faction=1098]'),
|
||||
(7, 215, 1, '|L:zone:city||L:main:colon|[zone=1638]'),
|
||||
(7, 361, 1, '|L:zone:reputationHub|[faction=576]'),
|
||||
(7, 405, 1, '|L:zone:reputationHub|[faction=92]\n[faction=93]'),
|
||||
(7, 440, 1, '|L:zone:reputationHub|[faction=989]'),
|
||||
(7, 493, 1, '|L:game:class||L:main:colon|[class=11]'),
|
||||
(7, 618, 1, '|L:zone:reputationHub|[faction=589]'),
|
||||
(7, 1377, 1, '|L:zone:reputationHub|[faction=609]'),
|
||||
(7, 1497, 1, '|L:zone:location|[zone=85]'),
|
||||
(7, 1497, 2, '|L:zone:reputationHub|[faction=68]'),
|
||||
(7, 1519, 1, '|L:zone:location|[zone=12]'),
|
||||
(7, 1519, 2, '|L:zone:reputationHub|[faction=72]'),
|
||||
(7, 1537, 1, '|L:zone:location|[zone=1]'),
|
||||
(7, 1537, 2, '|L:zone:reputationHub|[faction=47]\n[faction=54]'),
|
||||
(7, 1637, 1, '|L:zone:location|[zone=14]'),
|
||||
(7, 1637, 2, '|L:zone:reputationHub|[faction=76]'),
|
||||
(7, 1638, 1, '|L:zone:location|[zone=215]'),
|
||||
(7, 1638, 2, '|L:zone:reputationHub|[faction=81]'),
|
||||
(7, 1657, 1, '|L:zone:location|[zone=141]'),
|
||||
(7, 1657, 2, '|L:zone:reputationHub|[faction=69]'),
|
||||
(7, 3430, 1, '|L:zone:city||L:main:colon|[zone=3487]'),
|
||||
(7, 3433, 1, '|L:zone:reputationHub|[faction=922]'),
|
||||
(7, 3483, 1, '|L:zone:reputationHub|[icon name=side_alliance][faction=946][/icon]\n[icon name=side_horde][faction=947][/icon]'),
|
||||
(7, 3487, 1, '|L:zone:location|[zone=3430]'),
|
||||
(7, 3487, 2, '|L:zone:reputationHub|[faction=911]'),
|
||||
(7, 3518, 1, '|L:zone:reputationHub|[icon name=side_alliance][faction=978][/icon]\n[icon name=side_horde][faction=941][/icon]'),
|
||||
(7, 3519, 1, '|L:zone:reputationHub|[faction=1031]'),
|
||||
(7, 3519, 2, '|L:zone:city||L:main:colon|[zone=3703]'),
|
||||
(7, 3520, 1, '|L:zone:reputationHub|[faction=1015]'),
|
||||
(7, 3521, 1, '|L:zone:reputationHub|[faction=942]\n[faction=970]'),
|
||||
(7, 3522, 1, '|L:zone:reputationHub|[faction=1038]'),
|
||||
(7, 3523, 1, '|L:zone:reputationHub|[faction=933]'),
|
||||
(7, 3557, 1, '|L:zone:location|[zone=3524]'),
|
||||
(7, 3557, 2, '|L:zone:reputationHub|[faction=930]'),
|
||||
(7, 3711, 1, '|L:zone:reputationHub|[faction=1105]\n[faction=1104]'),
|
||||
(7, 3703, 1, '|L:zone:location|[zone=3519]'),
|
||||
(7, 3703, 2, '|L:zone:reputationHub|[faction=932]\n[faction=934]\n[faction=1011]'),
|
||||
(7, 4080, 1, '|L:zone:reputationHub|[faction=1077]'),
|
||||
(7, 4395, 1, '|L:zone:location|[zone=2817]'),
|
||||
(7, 4395, 2, '|L:zone:reputationHub|[faction=1090]');
|
||||
Reference in New Issue
Block a user