Misc/Fixes

* resolve more spellEffects/Auras
 * fixed item filter with multiple upgrade items
 * localized unknown spellAura/Effects text
 * remove unreferenced error code from image setup
This commit is contained in:
Sarjuuk
2023-03-09 17:13:34 +01:00
parent ca26955ac2
commit ffa4cf5b29
13 changed files with 51 additions and 62 deletions

View File

@@ -165,9 +165,9 @@ class SmartAI
if ($q)
{
$owner = DB::Aowow()->select(sprintf('SELECT `type` AS "0", `typeId` AS "1" FROM ?_spawns WHERE (%s)', implode(') OR (', $q)));
foreach ($owner as [$ty, $id])
$result[$ty][] = $id;
$owner = DB::Aowow()->select(sprintf('SELECT `type`, `typeId` FROM ?_spawns WHERE (%s)', implode(') OR (', $q)));
foreach ($owner as $o)
$result[$o['type']][] = $o['typeId'];
}
}

View File

@@ -1995,7 +1995,7 @@ class ItemListFilter extends Filter
'cr' => [FILTER_V_RANGE, [1, 177], true ], // criteria ids
'crs' => [FILTER_V_LIST, [FILTER_ENUM_NONE, FILTER_ENUM_ANY, [0, 99999]], true ], // criteria operators
'crv' => [FILTER_V_REGEX, '/[\p{C};:%\\\\]/ui', true ], // criteria values - only printable chars, no delimiters
'upg' => [FILTER_V_RANGE, [1, 999999], true ], // upgrade item ids
'upg' => [FILTER_V_REGEX, '/[^\d:]/ui', false], // upgrade item ids
'gb' => [FILTER_V_LIST, [0, 1, 2, 3], false], // search result grouping
'na' => [FILTER_V_REGEX, '/[\p{C};%\\\\]/ui', false], // name - only printable chars, no delimiter
'ma' => [FILTER_V_EQUAL, 1, false], // match any / all filter
@@ -2103,7 +2103,7 @@ class ItemListFilter extends Filter
// upgrade for [form only]
if (isset($_v['upg']))
{
$_ = DB::Aowow()->selectCol('SELECT id as ARRAY_KEY, slot FROM ?_items WHERE class IN (2, 3, 4) AND id IN (?a)', (array)$_v['upg']);
$_ = DB::Aowow()->selectCol('SELECT id as ARRAY_KEY, slot FROM ?_items WHERE class IN (2, 3, 4) AND id IN (?a)', explode(':', $_v['upg']));
if ($_ === null)
{
unset($_v['upg']);

View File

@@ -1092,10 +1092,10 @@ class SpellList extends BaseType
$effIdx = 1;
// cache at least some lookups.. should be moved to single spellList :/
if ($lookup && !isset($this->refSpells[$lookup]))
if ($lookup && $lookup != $this->id && !isset($this->refSpells[$lookup]))
$this->refSpells[$lookup] = new SpellList(array(['s.id', $lookup]));
$srcSpell = $lookup ? $this->refSpells[$lookup] : $this;
$srcSpell = $lookup && $lookup != $this->id ? $this->refSpells[$lookup] : $this;
if ($srcSpell->error)
return $result;

View File

@@ -96,15 +96,6 @@ class Lang
$var = $var[$arg];
}
// meh :x
if ($var === null && $prop == 'spell' && count($args) == 1)
{
if ($args[0] == 'effects')
$var = self::$$prop['unkEffect'];
else if ($args[0] == 'auras')
$var = self::$$prop['unkAura'];
}
return self::vspf($var, $vspfArgs);
}

View File

@@ -378,7 +378,7 @@ $lang = array(
'si' => [1 => "Allianz", -1 => "Nur für Allianz", 2 => "Horde", -2 => "Nur für Horde", 3 => "Beide"],
'resistances' => [null, 'Heiligwiderstand', 'Feuerwiderstand', 'Naturwiderstand', 'Frostwiderstand', 'Schattenwiderstand', 'Arkanwiderstand'],
'sc' => ["Körperlich", "Heilig", "Feuer", "Natur", "Frost", "Schatten", "Arkan"],
'dt' => [null, "Magie", "Fluch", "Krankheit", "Gift", "Verstohlenheit", "Unsichtbarkeit", null, null, "Wut"],
'dt' => [null, "Magie", "Fluch", "Krankheit", "Gift", "Verstohlenheit", "Unsichtbarkeit", "Magie, Fluch, Krankheit, Gift", "Zauber (NSC)", "Wut"],
'cl' => [null, "Krieger", "Paladin", "Jäger", "Schurke", "Priester", "Todesritter", "Schamane", "Magier", "Hexenmeister", null, "Druide"],
'ra' => [-2 => "Horde", -1 => "Allianz", null, "Mensch", "Orc", "Zwerg", "Nachtelf", "Untoter", "Tauren", "Gnom", "Troll", null, "Blutelf", "Draenei"],
'rep' => ["Hasserfüllt", "Feindselig", "Unfreundlich", "Neutral", "Freundlich", "Wohlwollend", "Respektvoll", "Ehrfürchtig"],
@@ -1625,7 +1625,7 @@ $lang = array(
89 => "Verwendbar, während Ihr verängstigt seid",
65 => "Braucht alle Ressourcen auf"
),
'unkEffect' => 'Unknown Effect',
'unkEffect' => 'Unknown Effect (%1$d)',
'effects' => array(
/*0-5 */ 'None', 'Instakill', 'School Damage', 'Dummy', 'Portal Teleport', 'Teleport Units',
/*6+ */ 'Apply Aura', 'Environmental Damage', 'Drain Power', 'Drain Health', 'Heal', 'Bind',
@@ -1656,7 +1656,7 @@ $lang = array(
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', null, 'Change Talent Spec. Count',
/*162-167*/ 'Activate Talent Spec.', null, 'Remove Aura', null, null, 'Update Player Phase'
),
'unkAura' => 'Unknown Aura',
'unkAura' => 'Unknown Aura (%1$d)',
'auras' => array(
/*0- */ 'None', 'Bind Sight', 'Possess', 'Periodic Damage - Flat', 'Dummy',
/*5+ */ 'Confuse', 'Charm', 'Fear', 'Periodic Heal', 'Mod Attack Speed',

View File

@@ -377,7 +377,7 @@ $lang = array(
'gl' => [null, "Major", "Minor"], // MAJOR_GLYPH, MINOR_GLYPH
'si' => [1 => "Alliance", -1 => "Alliance only", 2 => "Horde", -2 => "Horde only", 3 => "Both"],
'resistances' => [null, 'Holy Resistance', 'Fire Resistance', 'Nature Resistance', 'Frost Resistance', 'Shadow Resistance', 'Arcane Resistance'], // RESISTANCE?_NAME
'dt' => [null, "Magic", "Curse", "Disease", "Poison", "Stealth", "Invisibility", null, null, "Enrage"], // SpellDispalType.dbc
'dt' => [null, "Magic", "Curse", "Disease", "Poison", "Stealth", "Invisibility", "Magic, Curse, Disease, Poison", "Spell (NPC)", "Enrage"], // SpellDispalType.dbc
'sc' => ["Physical", "Holy", "Fire", "Nature", "Frost", "Shadow", "Arcane"], // STRING_SCHOOL_*
'cl' => [null, "Warrior", "Paladin", "Hunter", "Rogue", "Priest", "Death Knight", "Shaman", "Mage", "Warlock", null, "Druid"], // ChrClasses.dbc
'ra' => [-2 => "Horde", -1 => "Alliance", null, "Human", "Orc", "Dwarf", "Night Elf", "Undead", "Tauren", "Gnome", "Troll", null, "Blood Elf", "Draenei"], // ChrRaces.dbc
@@ -1625,7 +1625,7 @@ $lang = array(
89 => "Usable while feared",
65 => "Uses all power"
),
'unkEffect' => 'Unknown Effect',
'unkEffect' => 'Unknown Effect (%1$d)',
'effects' => array(
/*0-5 */ 'None', 'Instakill', 'School Damage', 'Dummy', 'Portal Teleport', 'Teleport Units',
/*6+ */ 'Apply Aura', 'Environmental Damage', 'Drain Power', 'Drain Health', 'Heal', 'Bind',
@@ -1656,7 +1656,7 @@ $lang = array(
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', null, 'Change Talent Spec. Count',
/*162-167*/ 'Activate Talent Spec.', null, 'Remove Aura', null, null, 'Update Player Phase'
),
'unkAura' => 'Unknown Aura',
'unkAura' => 'Unknown Aura (%1$d)',
'auras' => array(
/*0- */ 'None', 'Bind Sight', 'Possess', 'Periodic Damage - Flat', 'Dummy',
/*5+ */ 'Confuse', 'Charm', 'Fear', 'Periodic Heal', 'Mod Attack Speed',

View File

@@ -378,7 +378,7 @@ $lang = array(
'si' => [1 => "Alianza", -1 => "Alianza solamente", 2 => "Horda", -2 => "Horda solamente", 3 => "Ambos"],
'resistances' => [null, 'Resistencia a lo Sagrado', 'v', 'Resistencia a la Naturaleza', 'Resistencia a la Escarcha', 'Resistencia a las Sombras', 'Resistencia a lo Arcano'],
'sc' => ["Física", "Sagrado", "Fuego", "Naturaleza", "Escarcha", "Sombras", "Arcano"],
'dt' => [null, "Magia", "Maldición", "Enfermedad", "Veneno", "Sigilo", "Invisibilidad", null, null, "Enfurecer"],
'dt' => [null, "Magia", "Maldición", "Enfermedad", "Veneno", "Sigilo", "Invisibilidad", "Magia, Maldición, Enfermedad, Veneno", "Hechizo (PNJ)", "Enfurecer"],
'cl' => [null, "Guerrero", "Paladín", "Cazador", "Pícaro", "Sacerdote", "Caballero de la Muerte", "Chamán", "Mago", "Brujo", null, "Druida"],
'ra' => [-2 => "Horda", -1 => "Alianza", null, "Humano", "Orco", "Enano", "Elfo de la noche", "No-muerto", "Tauren", "Gnomo", "Trol ", null, "Blood Elf", "Elfo de sangre"],
'rep' => ["Odiado", "Hostil", "Adverso", "Neutral", "Amistoso", "Honorable", "Reverenciado", "Exaltado"],
@@ -1625,7 +1625,7 @@ $lang = array(
89 => "Utilizable mientras se esta aterrorizado",
65 => "Utiliza todo el poder"
),
'unkEffect' => 'Unknown Effect',
'unkEffect' => 'Unknown Effect (%1$d)',
'effects' => array(
/*0-5 */ 'None', 'Instakill', 'School Damage', 'Dummy', 'Portal Teleport', 'Teleport Units',
/*6+ */ 'Apply Aura', 'Environmental Damage', 'Drain Power', 'Drain Health', 'Heal', 'Bind',
@@ -1656,7 +1656,7 @@ $lang = array(
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', null, 'Change Talent Spec. Count',
/*162-167*/ 'Activate Talent Spec.', null, 'Remove Aura', null, null, 'Update Player Phase'
),
'unkAura' => 'Unknown Aura',
'unkAura' => 'Unknown Aura (%1$d)',
'auras' => array(
/*0- */ 'None', 'Bind Sight', 'Possess', 'Periodic Damage - Flat', 'Dummy',
/*5+ */ 'Confuse', 'Charm', 'Fear', 'Periodic Heal', 'Mod Attack Speed',

View File

@@ -377,7 +377,7 @@ $lang = array(
'gl' => [null, "Majeur", "Mineur"],
'si' => [1 => "Alliance", -1 => "Alliance seulement", 2 => "Horde", -2 => "Horde seulement", 3 => "Les deux"],
'resistances' => [null, 'Résistance au Sacré', 'Résistance au Feu', 'Résistance à la Nature', 'Résistance au Givre', 'Résistance à l\'Ombre', 'Résistance aux Arcanes'],
'dt' => [null, "Magie", "Malédiction", "Maladie", "Poison", "Camouflage", "Invisibilité", null, null, "Enrager"],
'dt' => [null, "Magie", "Malédiction", "Maladie", "Poison", "Camouflage", "Invisibilité", "Magie, Malédiction, Maladie, Poison", "Sort (PNJ)", "Enrager"],
'sc' => ["Physique", "Sacré", "Feu", "Nature", "Givre", "Ombre", "Arcane"],
'cl' => [null, "Guerrier", "Paladin", "Chasseur", "Voleur", "Prêtre", "DeathChevalier de la mort", "Chaman", "Mage", "Démoniste", null, "Druide"],
'ra' => [-2 => "Horde", -1 => "Alliance", null, "Humain", "Orc", "Nain", "Elfe de la nuit", "Mort-vivant", "Tauren", "Gnome", "Troll", null, "Elfe de sang", "Draeneï"],
@@ -1625,7 +1625,7 @@ $lang = array(
89 => "Utilisable sous l'effet de peur",
65 => "Utilise toute la puissance"
),
'unkEffect' => 'Unknown Effect',
'unkEffect' => 'Unknown Effect (%1$d)',
'effects' => array(
/*0-5 */ 'None', 'Instakill', 'School Damage', 'Dummy', 'Portal Teleport', 'Teleport Units',
/*6+ */ 'Apply Aura', 'Environmental Damage', 'Drain Power', 'Drain Health', 'Heal', 'Bind',
@@ -1656,7 +1656,7 @@ $lang = array(
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', null, 'Change Talent Spec. Count',
/*162-167*/ 'Activate Talent Spec.', null, 'Remove Aura', null, null, 'Update Player Phase'
),
'unkAura' => 'Unknown Aura',
'unkAura' => 'Unknown Aura (%1$d)',
'auras' => array(
/*0- */ 'None', 'Bind Sight', 'Possess', 'Periodic Damage - Flat', 'Dummy',
/*5+ */ 'Confuse', 'Charm', 'Fear', 'Periodic Heal', 'Mod Attack Speed',

View File

@@ -377,7 +377,7 @@ $lang = array(
'gl' => array(null, "Большой", "Малый"),
'si' => array(1 => "Альянс", -1 => "Альянс только", 2 => "Орда", -2 => "Орда только", null, 3 => "Обе"),
'resistances' => array(null, "Сопротивление светлой магии", "Сопротивление огню", "Сопротивление силам природы", "Сопротивление магии льда", "Сопротивление темной магии", "Сопротивление тайной магии"),
'dt' => array(null, "Магия", "Проклятие", "Болезнь", "Яд", "Незаметность", "Невидимость", null, null, "Исступление"),
'dt' => array(null, "Магия", "Проклятие", "Болезнь", "Яд", "Незаметность", "Невидимость", "Магия, Проклятие, Болезнь, Яд", "Заклинание (НИП)", "Исступление"),
'sc' => array("Физический урон", "Свет", "Огонь", "природа", "Лед", "Тьма", "Тайная магия"),
'cl' => array(null, "Воин", "Паладин", "Охотник", "Разбойник", "Жрец", "Рыцарь смерти", "Шаман", "Маг", "Чернокнижник", null, "Друид"),
'ra' => array(-2 => "Орда", -1 => "Альянс", null, "Человек", "Орк", "Дворф", "Ночной эльф", "Нежить", "Таурен", "Гном", "Тролль", null, "Эльф крови", "Дреней"),
@@ -1625,7 +1625,7 @@ $lang = array(
89 => "usablefearedМожет быть использовано, пока наложен Страх",
65 => "Использует ресурс полностью"
),
'unkEffect' => 'Unknown Effect',
'unkEffect' => 'Unknown Effect (%1$d)',
'effects' => array(
/*0-5 */ 'None', 'Instakill', 'School Damage', 'Dummy', 'Portal Teleport', 'Teleport Units',
/*6+ */ 'Apply Aura', 'Environmental Damage', 'Drain Power', 'Drain Health', 'Heal', 'Bind',
@@ -1656,7 +1656,7 @@ $lang = array(
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', null, 'Change Talent Spec. Count',
/*162-167*/ 'Activate Talent Spec.', null, 'Remove Aura', null, null, 'Update Player Phase'
),
'unkAura' => 'Unknown Aura',
'unkAura' => 'Unknown Aura (%1$d)',
'auras' => array(
/*0- */ 'None', 'Bind Sight', 'Possess', 'Periodic Damage - Flat', 'Dummy',
/*5+ */ 'Confuse', 'Charm', 'Fear', 'Periodic Heal', 'Mod Attack Speed',

View File

@@ -376,7 +376,7 @@ $lang = array(
'gl' => [null, "", ""],
'si' => [1 => "联盟", -1 => "仅限联盟", 2 => "部落", -2 => "仅限部落", 3 => "双方"],
'resistances' => [null, '神圣抗性', '火焰抗性', '自然抗性', '冰霜抗性', '暗影抗性', '奥术抗性'],
'dt' => [null, "魔法", "诅咒", "疾病", "中毒", "潜行", "隐形", null, null, "激怒"],
'dt' => [null, "魔法", "诅咒", "疾病", "中毒", "潜行", "隐形", "魔法, 诅咒, 疾病, 中毒", "法术 (NPC)", "激怒"],
'sc' => ["物理", "神圣", "火焰", "自然", "冰霜", "暗影", "奥术"],
'cl' => [null, "战士", "圣骑士", "猎人", "潜行者", "牧师", "死亡骑士", "萨满祭司", "法师", "术士", null, "德鲁伊"],
'ra' => [-2 => "部落", -1 => "联盟", null, "人类", "兽人", "矮人", "暗夜精灵", "亡灵", "牛头人", "侏儒", "巨魔", null, "血精灵", "德莱尼"],
@@ -1624,7 +1624,7 @@ $lang = array(
89 => "恐惧时可用",
65 => "消耗所有力量"
),
'unkEffect' => '未知效果',
'unkEffect' => '未知效果 (%1$d)',
'effects' => array(
/*0-5 */ '无', '杀死', '类型伤害', 'Dummy', '传送门', '传送单位',
/*6+ */ '应用光环', '环境伤害', 'Drain Power', 'Drain Health', 'Heal', 'Bind',
@@ -1655,7 +1655,7 @@ $lang = array(
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', null, 'Change Talent Spec. Count',
/*162-167*/ 'Activate Talent Spec.', null, 'Remove Aura', null, null, 'Update Player Phase'
),
'unkAura' => '未知光环',
'unkAura' => '未知光环 (%1$d)',
'auras' => array(
/*0- */ '无', 'Bind Sight', 'Possess', 'Periodic Damage - Flat', 'Dummy',
/*5+ */ 'Confuse', 'Charm', 'Fear', 'Periodic Heal', 'Mod Attack Speed',

View File

@@ -1555,6 +1555,14 @@ class SpellPage extends GenericPage
$itemIdx = $this->subject->canCreateItem();
$perfItem = DB::World()->selectRow('SELECT * FROM skill_perfect_item_template WHERE spellId = ?d', $this->typeId);
$fmtStaffTT = function($text, $tip)
{
if (User::isInGroup(U_GROUP_EMPLOYEE))
return sprintf(Util::$dfnString, $tip, $text);
else
return $text;
};
// Iterate through all effects:
for ($i = 1; $i < 4; $i++)
{
@@ -1633,9 +1641,9 @@ class SpellPage extends GenericPage
// Effect Name
if ($_ = Lang::spell('effects', $effId))
$foo['name'] = (User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'EffectId: '.$effId, $_) : Lang::spell('effects', $effId)).Lang::main('colon');
$foo['name'] = $fmtStaffTT($_, 'Effect'.Lang::main('colon').$effId).Lang::main('colon');
else
$foo['name'] = 'Unknow Effect (#'.$effId.')';
$foo['name'] = Lang::spell('unkEffect', [$effId]);
if ($this->subject->getField('effect'.$i.'RadiusMax') > 0)
$foo['radius'] = $this->subject->getField('effect'.$i.'RadiusMax');
@@ -1669,28 +1677,25 @@ class SpellPage extends GenericPage
case 30: // Energize
case 62: // Power Burn
case 137: // Energize Pct
$_ = Lang::spell('powerTypes', $effMV);
if ($_ && User::isInGroup(U_GROUP_EMPLOYEE))
$_ = sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_);
else if (!$_)
$_ = $effMV;
if ($_ = Lang::spell('powerTypes', $effMV))
$foo['name'] .= $fmtStaffTT('('.$_.')', 'MiscValue'.Lang::main('colon').$effMV);
else
$foo['name'] .= '('.$effMV.')';
if ($effMV == POWER_RAGE || $effMV == POWER_RUNIC_POWER)
$foo['value'] = ($effDS && $effDS != 1 ? (($effBP + 1) / 10).Lang::game('valueDelim') : null).(($effBP + $effDS) / 10);
$foo['name'] .= ' ('.$_.')';
break;
case 11: // Bind
if (!$effMV && User::isInGroup(U_GROUP_EMPLOYEE))
$foo['name'] .= sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, '(current zone)');
else if (!$effMV)
$foo['name'] .= '('.Lang::spell('currentArea').')';
if ($effMV <= 0)
$foo['name'] .= $fmtStaffTT('('.Lang::spell('currentArea').')', 'MiscValue'.Lang::main('colon').$effMV);
else if ($_ = ZoneList::getName($effMV))
$foo['name'] .= '(<a href="?zone='.$effMV.'">'.$_.'</a>)';
else
$foo['name'] .= Util::ucFirst(Lang::game('zone')).' #'.$effMV;;
$foo['name'] .= Util::ucFirst(Lang::game('zone')).' #'.$effMV;
break;
case 16: // QuestComplete
case 16: // Complete Quest
case 139: // Abandon Quest
if ($_ = QuestList::getName($effMV))
$foo['name'] .= '(<a href="?quest='.$effMV.'">'.$_.'</a>)';
else
@@ -1711,13 +1716,11 @@ class SpellPage extends GenericPage
$foo['name'] .= $_;
break;
case 33: // Open Lock
$_ = $effMV ? Lang::spell('lockType', $effMV) : $effMV;
if ($_ && User::isInGroup(U_GROUP_EMPLOYEE))
$_ = sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_);
else if (!$_)
$_ = $effMV;
if ($effMV && ($_ = Lang::spell('lockType', $effMV)))
$foo['name'] .= ' ('.$fmtStaffTT($_, 'MiscValue'.Lang::main('colon').$effMV).')';
else
$foo['name'] .= ' ('.$effMV.')';
$foo['name'] .= ' ('.$_.')';
break;
case 53: // Enchant Item Perm
case 54: // Enchant Item Temp
@@ -1990,6 +1993,7 @@ class SpellPage extends GenericPage
case 39: // School Immunity
case 40: // Damage Immunity
case 50: // Mod Critical Healing Amount
case 52: // Mod Physical Crit Chance
case 57: // Mod Spell Crit Chance
case 69: // School Absorb
case 71: // Mod Spell Crit Chance School
@@ -2166,7 +2170,7 @@ class SpellPage extends GenericPage
}
else if ($effAura > 0)
$foo['name'] .= 'Unknown Aura ('.$effAura.')';
$foo['name'] .= Lang::spell('unkAura', [$effAura]);
break;
}

View File

@@ -268,9 +268,6 @@ if (!CLI)
if (count(array_filter(array_column($paths, 2))) != count($paths))
{
CLI::write('one or more required directories are missing:', CLI::LOG_ERROR);
foreach ($missing as $m)
CLI::write(' - '.$m, CLI::LOG_ERROR);
return;
}
else

View File

@@ -245,9 +245,6 @@ if (!CLI)
if (count(array_filter(array_column($paths, 5))) != count($paths))
{
CLI::write('one or more required directories are missing:', CLI::LOG_ERROR);
foreach ($missing as $m)
CLI::write(' - '.$m, CLI::LOG_ERROR);
return;
}
else