SpellDetailPage

* attempted cleanup in effect generation and template
 * display summon properties
 * display unit of effect value
 * fix spell effect layout, typos, missing tools, ...
This commit is contained in:
Sarjuuk
2024-08-15 03:49:04 +02:00
parent dab110475c
commit d2e109d818
17 changed files with 767 additions and 671 deletions

View File

@@ -3,7 +3,7 @@
mb_internal_encoding('UTF-8');
mysqli_report(MYSQLI_REPORT_ERROR);
define('AOWOW_REVISION', 38);
define('AOWOW_REVISION', 39);
define('OS_WIN', substr(PHP_OS, 0, 3) == 'WIN'); // OS_WIN as per compile info of php
define('CLI', PHP_SAPI === 'cli');
define('CLI_HAS_E', CLI && // WIN10 and later usually support ANSI escape sequences

View File

@@ -187,8 +187,10 @@ class SpellList extends BaseType
// use if you JUST need the name
public static function getName($id)
{
$n = DB::Aowow()->SelectRow('SELECT name_loc0, name_loc2, name_loc3, name_loc4, name_loc6, name_loc8 FROM ?_spell WHERE id = ?d', $id );
if ($n = DB::Aowow()->SelectRow('SELECT name_loc0, name_loc2, name_loc3, name_loc4, name_loc6, name_loc8 FROM ?_spell WHERE id = ?d', $id))
return Util::localizedString($n, 'name');
return '';
}
// end static use
@@ -484,9 +486,10 @@ class SpellList extends BaseType
return $this->tools;
}
public function getModelInfo($spellId = 0, $effIdx = 0)
public function getModelInfo(int $spellId = 0, int $effIdx = 0) : array
{
$displays = [0 => []];
$displays = $results = [];
foreach ($this->iterate() as $id => $__)
{
if ($spellId && $spellId != $id)
@@ -494,6 +497,9 @@ class SpellList extends BaseType
for ($i = 1; $i < 4; $i++)
{
if ($spellId && $effIdx && $effIdx != $i)
continue;
$effMV = $this->curTpl['effect'.$i.'MiscValue'];
if (!$effMV)
continue;
@@ -524,16 +530,16 @@ class SpellList extends BaseType
2289 => [2289, 29415, 29418, 29419, 29420, 29421] // Bear - Tauren
);
if ($st = DB::Aowow()->selectRow('SELECT *, displayIdA as model1, displayIdH as model2 FROM ?_shapeshiftforms WHERE id = ?d', $effMV))
if ($st = DB::Aowow()->selectRow('SELECT *, `displayIdA` AS `model1`, `displayIdH` AS `model2` FROM ?_shapeshiftforms WHERE `id` = ?d', $effMV))
{
foreach ([1, 2] as $j)
if (isset($subForms[$st['model'.$j]]))
$st['model'.$j] = $subForms[$st['model'.$j]][array_rand($subForms[$st['model'.$j]])];
$displays[0][$id][$i] = array(
'typeId' => 0,
'displayId' => $st['model2'] ? $st['model'.rand(1, 2)] : $st['model1'],
$results[$id][$i] = array(
'type' => Type::NPC,
'creatureType' => $st['creatureType'],
'displayId' => $st['model2'] ? $st['model'.rand(1, 2)] : $st['model1'],
'displayName' => Lang::game('st', $effMV)
);
}
@@ -541,8 +547,6 @@ class SpellList extends BaseType
}
}
$results = $displays[0];
if (!empty($displays[Type::NPC]))
{
$nModels = new CreatureList(array(['id', array_column($displays[Type::NPC], 1)]));
@@ -555,6 +559,7 @@ class SpellList extends BaseType
foreach ($indizes as $idx)
{
$res = array(
'type' => Type::NPC,
'typeId' => $nId,
'displayId' => $nModels->getRandomModelId(),
'displayName' => $nModels->getField('name', true)
@@ -582,6 +587,7 @@ class SpellList extends BaseType
foreach ($indizes as $idx)
{
$results[$srcId][$idx] = array(
'type' => Type::OBJECT,
'typeId' => $oId,
'displayId' => $oModels->getField('displayId'),
'displayName' => $oModels->getField('name', true)
@@ -593,12 +599,15 @@ class SpellList extends BaseType
}
if ($spellId && $effIdx)
return !empty($results[$spellId][$effIdx]) ? $results[$spellId][$effIdx] : 0;
return $results[$spellId][$effIdx] ?? [];
if ($spellId)
return $results[$spellId] ?? [];
return $results;
}
private function createRangesForCurrent()
private function createRangesForCurrent() : string
{
if (!$this->curTpl['rangeMaxHostile'])
return '';
@@ -620,7 +629,7 @@ class SpellList extends BaseType
return sprintf(Lang::spell('range'), $this->curTpl['rangeMaxHostile']);
}
public function createPowerCostForCurrent()
public function createPowerCostForCurrent() : string
{
$str = '';
@@ -664,7 +673,7 @@ class SpellList extends BaseType
return $str;
}
public function createCastTimeForCurrent($short = true, $noInstant = true)
public function createCastTimeForCurrent(bool $short = true, bool $noInstant = true) : string
{
if (!$this->curTpl['castTime'] && $this->isChanneledSpell())
return Lang::spell('channeled');
@@ -678,7 +687,7 @@ class SpellList extends BaseType
return $short ? Lang::formatTime($this->curTpl['castTime'] * 1000, 'spell', 'castTime') : Util::formatTime($this->curTpl['castTime'] * 1000);
}
private function createCooldownForCurrent()
private function createCooldownForCurrent() : string
{
if ($this->curTpl['recoveryTime'])
return Lang::formatTime($this->curTpl['recoveryTime'], 'spell', 'cooldown');
@@ -689,16 +698,15 @@ class SpellList extends BaseType
}
// formulae base from TC
private function calculateAmountForCurrent(int $effIdx, ?SpellList $altTpl = null, int $nTicks = 1) : array
private function calculateAmountForCurrent(int $effIdx, int $nTicks = 1) : array
{
$ref = $altTpl ?: $this;
$level = $this->charLevel;
$maxBase = 0;
$rppl = $ref->getField('effect'.$effIdx.'RealPointsPerLevel');
$base = $ref->getField('effect'.$effIdx.'BasePoints');
$add = $ref->getField('effect'.$effIdx.'DieSides');
$maxLvl = $ref->getField('maxLevel');
$baseLvl = $ref->getField('baseLevel');
$rppl = $this->getField('effect'.$effIdx.'RealPointsPerLevel');
$base = $this->getField('effect'.$effIdx.'BasePoints');
$add = $this->getField('effect'.$effIdx.'DieSides');
$maxLvl = $this->getField('maxLevel');
$baseLvl = $this->getField('baseLevel');
if ($rppl)
{
@@ -707,8 +715,8 @@ class SpellList extends BaseType
else if ($level < $baseLvl)
$level = $baseLvl;
if (!$ref->getField('atributes0') & SPELL_ATTR0_PASSIVE)
$level -= $ref->getField('spellLevel');
if (!$this->getField('atributes0') & SPELL_ATTR0_PASSIVE)
$level -= $this->getField('spellLevel');
$maxBase += (int)(($level - $baseLvl) * $rppl);
$maxBase *= $nTicks;
@@ -1060,7 +1068,7 @@ class SpellList extends BaseType
break;
case 'm': // BasePoints (minValue)
case 'M': // BasePoints (maxValue)
[$min, $max, $modStrMin, $modStrMax] = $this->calculateAmountForCurrent($effIdx, $srcSpell);
[$min, $max, $modStrMin, $modStrMax] = $srcSpell->calculateAmountForCurrent($effIdx);
$mv = $srcSpell->getField('effect'.$effIdx.'MiscValue');
$aura = $srcSpell->getField('effect'.$effIdx.'AuraId');
@@ -1116,7 +1124,7 @@ class SpellList extends BaseType
$periode = 3000;
}
[$min, $max, $modStrMin, $modStrMax] = $this->calculateAmountForCurrent($effIdx, $srcSpell, intVal($duration / $periode));
[$min, $max, $modStrMin, $modStrMax] = $srcSpell->calculateAmountForCurrent($effIdx, intVal($duration / $periode));
if (in_array($op, $signs) && is_numeric($oparg))
{
@@ -1155,7 +1163,7 @@ class SpellList extends BaseType
break;
case 's': // BasePoints (with variance)
case 'S':
[$min, $max, $modStrMin, $modStrMax] = $this->calculateAmountForCurrent($effIdx, $srcSpell);
[$min, $max, $modStrMin, $modStrMax] = $srcSpell->calculateAmountForCurrent($effIdx);
$mv = $srcSpell->getField('effect'.$effIdx.'MiscValue');
$aura = $srcSpell->getField('effect'.$effIdx.'AuraId');

View File

@@ -399,12 +399,17 @@ class Lang
return implode(', ', $tmp);
}
public static function getMagicSchools(int $schoolMask) : string
public static function getMagicSchools(int $schoolMask, bool $short = false) : string
{
$schoolMask &= SPELL_ALL_SCHOOLS; // clamp to available schools..
$tmp = [];
$i = 0;
if ($short && $schoolMask == SPELL_ALL_SCHOOLS)
return self::main('all');
if ($short && $schoolMask == SPELL_MAGIC_SCHOOLS)
return self::main('all').' ('.self::game('dt', 1).')';
while ($schoolMask)
{
if ($schoolMask & (1 << $i))

View File

@@ -57,6 +57,8 @@ $lang = array(
'status' => "Status",
'yes' => "Ja",
'no' => "Nein",
'any' => "Beliebig",
'all' => "Alle",
// filter
'extSearch' => "Erweiterte Suche",
@@ -1577,7 +1579,7 @@ $lang = array(
),
'spellModOp' => array(
"Schaden", "Dauer", "Bedrohung", "Effekt 1", "Aufladungen",
"Reichweite", "Radius", "kritische Trefferchance", "Alle Effekte", "Zauberzeitverlust",
"Reichweite", "Radius", "Kritische Trefferchance", "Alle Effekte", "Zauberzeitverlust",
"Zauberzeit", "Abklingzeit", "Effekt 2", "Ignoriere Rüstung", "Kosten",
"Kritischer Bonusschaden", "Trefferchance", "Sprung-Ziele", "Chance auf Auslösung", "Intervall",
"Multiplikator (Schaden)", "Globale Abklingzeit", "Schaden über Zeit", "Effekt 3", "Multiplikator (Bonus)",
@@ -1591,6 +1593,9 @@ $lang = array(
"erhaltene kritische Fernkampftreffer", "erhaltene kritische Zaubertreffer", "Nahkampftempo", "Fernkampftempo", "Zaubertempo",
"Waffenfertigkeit Haupthand", "Waffenfertigkeit Nebenhand", "Waffenfertigkeit Fernkampf", "Waffenkunde", "Rüstungsdurchschlag"
),
'combatRatingMask' => array(
0xE0 => "Trefferchance", 0x700 => "Kritische Trefferchance", 0x1C000 => "Abhärtung"
),
'lockType' => array(
null, "Schlossknacken", "Kräuterkunde", "Bergbau", "Falle entschärfen",
"Öffnen", "Schatz (DND)", "Verkalkte Elfenedelsteine (DND)", "Schließen", "Falle scharf machen",
@@ -1659,6 +1664,8 @@ $lang = array(
89 => "Verwendbar, während Ihr verängstigt seid",
65 => "Braucht alle Ressourcen auf"
),
'summonControl' => ["Ungesteuert", "Wächter", "Begleiter", "Bezaubert", "Gesteuertes Fahrzeug", "Ungesteuertes Fahrzeug"],
'summonSlot' => ["Begleiter", "Feuertotem", "Erdtotem", "Wassertotem", "Lufttotem", "Haustier", "Quest"],
'unkEffect' => 'Unknown Effect (%1$d)',
'effects' => array(
/*0-5 */ 'None', 'Instakill', 'School Damage', 'Dummy', 'Portal Teleport', 'Teleport Units',
@@ -1687,7 +1694,7 @@ $lang = array(
/*138+ */ 'Leap Back', 'Abandon Quest', 'Force Cast', 'Force Spell Cast with Value','Trigger Spell with Value','Apply Area Aura - Pet Owner',
/*144+ */ 'Knockback to Dest.', 'Pull Towards Dest.', 'Activate Rune', 'Fail Quest', null, 'Charge to Dest',
/*150+ */ 'Start Quest', 'Trigger Spell 2', 'Summon - Refer-A-Friend', 'Create Tamed Pet', 'Discover Flight Path', 'Dual Wield 2H Weapons',
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', null, 'Change Talent Spec. Count',
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', 'Force Cast 2', 'Change Talent Spec. Count',
/*162-167*/ 'Activate Talent Spec.', null, 'Remove Aura', null, null, 'Update Player Phase'
),
'unkAura' => 'Unknown Aura (%1$d)',

View File

@@ -58,6 +58,8 @@ $lang = array(
'status' => "Status",
'yes' => "Yes",
'no' => "No",
'any' => "Any",
'all' => "All",
// filter
'extSearch' => "Extended search",
@@ -1592,6 +1594,9 @@ $lang = array(
"Taken Critical Ranged Hit Chance", "Taken Critical Spell Hit Chance", "Melee Haste", "Ranged Haste", "Spell Haste",
"Mainhand Weapon Skill", "Offhand Weapon Skill", "Ranged Weapon Skill", "Expertise", "Armor Penetration"
),
'combatRatingMask' => array(
0xE0 => "Hit Chance", 0x700 => "Critical Hit Chance", 0x1C000 => "Resilience"
),
'lockType' => array( // lockType.dbc
null, "Lockpicking", "Herbalism", "Mining", "Disarm Trap",
"Open", "Treasure (DND)", "Calcified Elven Gems (DND)", "Close", "Arm Trap",
@@ -1660,6 +1665,8 @@ $lang = array(
89 => "Usable while feared",
65 => "Uses all power"
),
'summonControl' => ["Uncontrolled", "Guardian", "Pet", "Possessed", "Possessed Vehicle", "Uncontrolled Vehicle"],
'summonSlot' => ["Pet", "Fire Totem", "Earth Totem", "Water Totem", "Air Totem", "Non-combat Pet", "Quest"],
'unkEffect' => 'Unknown Effect (%1$d)',
'effects' => array(
/*0-5 */ 'None', 'Instakill', 'School Damage', 'Dummy', 'Portal Teleport', 'Teleport Units',
@@ -1688,7 +1695,7 @@ $lang = array(
/*138+ */ 'Leap Back', 'Abandon Quest', 'Force Cast', 'Force Spell Cast with Value','Trigger Spell with Value','Apply Area Aura - Pet Owner',
/*144+ */ 'Knockback to Dest.', 'Pull Towards Dest.', 'Activate Rune', 'Fail Quest', null, 'Charge to Dest',
/*150+ */ 'Start Quest', 'Trigger Spell 2', 'Summon - Refer-A-Friend', 'Create Tamed Pet', 'Discover Flight Path', 'Dual Wield 2H Weapons',
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', null, 'Change Talent Spec. Count',
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', 'Force Cast 2', 'Change Talent Spec. Count',
/*162-167*/ 'Activate Talent Spec.', null, 'Remove Aura', null, null, 'Update Player Phase'
),
'unkAura' => 'Unknown Aura (%1$d)',

View File

@@ -57,6 +57,8 @@ $lang = array(
'status' => "Estado",
'yes' => "",
'no' => "No",
'any' => "Cualquiera",
'all' => "Todo",
// filter
'extSearch' => "Extender búsqueda",
@@ -1591,6 +1593,9 @@ $lang = array(
"CRIT_TAKEN_RANGED", "CRIT_TAKEN_SPELL", "HASTE_MELEE", "HASTE_RANGED", "HASTE_SPELL",
"WEAPON_SKILL_MAINHAND", "WEAPON_SKILL_OFFHAND", "WEAPON_SKILL_RANGED", "EXPERTISE", "ARMOR_PENETRATION"
),
'combatRatingMask' => array(
0xE0 => "[Hit Chance]", 0x700 => "[Critical Hit Chance]", 0x1C000 => "Temple"
),
'lockType' => array(
null, "Forzar cerradura", "Herboristería", "Minería", "Desactivar trampa",
"Abrir", "Tesoro (DND)", "Gemas cálcicas elfas (DND)", "Cerrar", "Activar trampa",
@@ -1659,6 +1664,8 @@ $lang = array(
89 => "Utilizable mientras se esta aterrorizado",
65 => "Utiliza todo el poder"
),
'summonControl' => ["[Uncontrolled]", "Guardián", "Mascota", "Embelesado", "[Possessed Vehicle]", "[Uncontrolled Vehicle]"],
'summonSlot' => ["Mascota", "Tótem de Fuego", "Tótem de Tierra", "Tótem de Agua", "Tótem de Aire", "Mascota mansa", "Misión"],
'unkEffect' => 'Unknown Effect (%1$d)',
'effects' => array(
/*0-5 */ 'None', 'Instakill', 'School Damage', 'Dummy', 'Portal Teleport', 'Teleport Units',
@@ -1687,7 +1694,7 @@ $lang = array(
/*138+ */ 'Leap Back', 'Abandon Quest', 'Force Cast', 'Force Spell Cast with Value','Trigger Spell with Value','Apply Area Aura - Pet Owner',
/*144+ */ 'Knockback to Dest.', 'Pull Towards Dest.', 'Activate Rune', 'Fail Quest', null, 'Charge to Dest',
/*150+ */ 'Start Quest', 'Trigger Spell 2', 'Summon - Refer-A-Friend', 'Create Tamed Pet', 'Discover Flight Path', 'Dual Wield 2H Weapons',
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', null, 'Change Talent Spec. Count',
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', 'Force Cast 2', 'Change Talent Spec. Count',
/*162-167*/ 'Activate Talent Spec.', null, 'Remove Aura', null, null, 'Update Player Phase'
),
'unkAura' => 'Unknown Aura (%1$d)',

View File

@@ -57,6 +57,8 @@ $lang = array(
'status' => "Statut",
'yes' => "Oui",
'no' => "Non",
'any' => "N'importe quelle",
'all' => "Tous",
// filter
'extSearch' => "Recherche avancée",
@@ -1591,6 +1593,9 @@ $lang = array(
"CRIT_TAKEN_RANGED", "CRIT_TAKEN_SPELL", "HASTE_MELEE", "HASTE_RANGED", "HASTE_SPELL",
"WEAPON_SKILL_MAINHAND", "WEAPON_SKILL_OFFHAND", "WEAPON_SKILL_RANGED", "EXPERTISE", "ARMOR_PENETRATION"
),
'combatRatingMask' => array(
0xE0 => "[Hit Chance]", 0x700 => "[Critical Hit Chance]", 0x1C000 => "Résilience JcJ"
),
'lockType' => array(
null, "Crochetage", "Herboristerie", "Minage", "Désarmement de piège",
"Ouverture", "Trésor (DND)", "Gemmes elfiques calcifiées (DND)", "Fermeture", "Pose de piège",
@@ -1659,6 +1664,8 @@ $lang = array(
89 => "Utilisable sous l'effet de peur",
65 => "Utilise toute la puissance"
),
'summonControl' => ["[Uncontrolled]", "Gardiens", "Familier", "Charmé", "[Possessed Vehicle]", "[Uncontrolled Vehicle]"],
'summonSlot' => ["Familier", "Totem de Feu", "Totem de Terre", "Totem d'Eau", "Totem d'Air", "Familier pacifique", "Quête"],
'unkEffect' => 'Unknown Effect (%1$d)',
'effects' => array(
/*0-5 */ 'None', 'Instakill', 'School Damage', 'Dummy', 'Portal Teleport', 'Teleport Units',
@@ -1687,7 +1694,7 @@ $lang = array(
/*138+ */ 'Leap Back', 'Abandon Quest', 'Force Cast', 'Force Spell Cast with Value','Trigger Spell with Value','Apply Area Aura - Pet Owner',
/*144+ */ 'Knockback to Dest.', 'Pull Towards Dest.', 'Activate Rune', 'Fail Quest', null, 'Charge to Dest',
/*150+ */ 'Start Quest', 'Trigger Spell 2', 'Summon - Refer-A-Friend', 'Create Tamed Pet', 'Discover Flight Path', 'Dual Wield 2H Weapons',
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', null, 'Change Talent Spec. Count',
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', 'Force Cast 2', 'Change Talent Spec. Count',
/*162-167*/ 'Activate Talent Spec.', null, 'Remove Aura', null, null, 'Update Player Phase'
),
'unkAura' => 'Unknown Aura (%1$d)',

View File

@@ -57,6 +57,8 @@ $lang = array(
'status' => "Статус",
'yes' => "Да",
'no' => "Нет",
'any' => "Любой", // Any[one] of X => "Любой из"
'all' => "Все",
// filter
'extSearch' => "Расширенный поиск",
@@ -1591,6 +1593,9 @@ $lang = array(
"CRIT_TAKEN_RANGED", "CRIT_TAKEN_SPELL", "HASTE_MELEE", "HASTE_RANGED", "HASTE_SPELL",
"WEAPON_SKILL_MAINHAND", "WEAPON_SKILL_OFFHAND", "WEAPON_SKILL_RANGED", "EXPERTISE", "ARMOR_PENETRATION"
),
'combatRatingMask' => array(
0xE0 => "[Hit Chance]", 0x700 => "[Critical Hit Chance]", 0x1C000 => "Устойчивость"
),
'lockType' => array(
null, "Взлом замков", "Травничество", "Горное дело", "Обезвреживание ловушки",
"Открытие", "Клад (DND)", "Эльфийские самоцветы (DND)", "Закрытие", "Установка",
@@ -1659,6 +1664,8 @@ $lang = array(
89 => "usablefearedМожет быть использовано, пока наложен Страх",
65 => "Использует ресурс полностью"
),
'summonControl' => ['[Uncontrolled]', "Стражи", "Питомец", "Подчинённый", '[Possessed Vehicle]', '[Uncontrolled Vehicle]'],
'summonSlot' => ["Питомец", "Тотем огня", "Тотем земли", "Тотем воды", "Тотем воздуха", "Спутник", "Задание"],
'unkEffect' => 'Unknown Effect (%1$d)',
'effects' => array(
/*0-5 */ 'None', 'Instakill', 'School Damage', 'Dummy', 'Portal Teleport', 'Teleport Units',
@@ -1687,7 +1694,7 @@ $lang = array(
/*138+ */ 'Leap Back', 'Abandon Quest', 'Force Cast', 'Force Spell Cast with Value','Trigger Spell with Value','Apply Area Aura - Pet Owner',
/*144+ */ 'Knockback to Dest.', 'Pull Towards Dest.', 'Activate Rune', 'Fail Quest', null, 'Charge to Dest',
/*150+ */ 'Start Quest', 'Trigger Spell 2', 'Summon - Refer-A-Friend', 'Create Tamed Pet', 'Discover Flight Path', 'Dual Wield 2H Weapons',
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', null, 'Change Talent Spec. Count',
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', 'Force Cast 2', 'Change Talent Spec. Count',
/*162-167*/ 'Activate Talent Spec.', null, 'Remove Aura', null, null, 'Update Player Phase'
),
'unkAura' => 'Unknown Aura (%1$d)',

View File

@@ -58,6 +58,8 @@ $lang = array(
'status' => "状态",
'yes' => "",
'no' => "",
'any' => "任意",
'all' => "全部",
// filter
'extSearch' => "扩展搜索",
@@ -1591,6 +1593,9 @@ $lang = array(
"受到远程暴击几率", "受到法术暴击几率", "急速(近战)", "急速(远程)", "急速(法术)",
"主手武器技能", "副手武器技能", "远程武器技能", "精准", "护甲穿透"
),
'combatRatingMask' => array(
0xE0 => "[Hit Chance]", 0x700 => "[Critical Hit Chance]", 0x1C000 => "韧性"
),
'lockType' => array(
null, "锁上的物品", "药草", "矿点", "陷阱",
"未锁上的物品", "宝物", "钙化精灵宝石", "未锁上的物品", "陷阱",
@@ -1659,6 +1664,8 @@ $lang = array(
89 => "恐惧时可用",
65 => "消耗所有力量"
),
'summonControl' => ['[Uncontrolled]', "守护者", "宠物", "被魅惑", '[Possessed Vehicle]', '[Uncontrolled Vehicle]'],
'summonSlot' => ["宠物", "火焰图腾", "大地图腾", "水图腾", "空气图腾", "非战斗宠物", "任务"],
'unkEffect' => '未知效果 (%1$d)',
'effects' => array(
/*0-5 */ '无', '杀死', '类型伤害', 'Dummy', '传送门', '传送单位',
@@ -1687,7 +1694,7 @@ $lang = array(
/*138+ */ 'Leap Back', 'Abandon Quest', 'Force Cast', 'Force Spell Cast with Value','Trigger Spell with Value','Apply Area Aura - Pet Owner',
/*144+ */ 'Knockback to Dest.', 'Pull Towards Dest.', 'Activate Rune', 'Fail Quest', null, 'Charge to Dest',
/*150+ */ 'Start Quest', 'Trigger Spell 2', 'Summon - Refer-A-Friend', 'Create Tamed Pet', 'Discover Flight Path', 'Dual Wield 2H Weapons',
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', null, 'Change Talent Spec. Count',
/*156+ */ 'Add Socket to Item', 'Create Tradeskill Item', 'Milling', 'Rename Pet', 'Force Cast 2', 'Change Talent Spec. Count',
/*162-167*/ 'Activate Talent Spec.', null, 'Remove Aura', null, null, 'Update Player Phase'
),
'unkAura' => '未知光环 (%1$d)',

View File

@@ -861,8 +861,44 @@ class GenericPage
return $buff;
}
protected function fmtCreateIcon(int $iconIdx, int $type, int $typeId, int $pad = 0, string $element = 'icontab-icon', int $size = 1, int $num = 0, int $qty = 0) : string
{
// $element, $iconTabIdx, [typeId, size, num, qty]
$createIconString = "\$WH.ge('%s%d').appendChild(%s.createIcon(%s));\n";
if ($size < 0 || $size > 3)
{
trigger_error('GenericPage::fmtCreateIcon - invalid icon size '.$size.'. Normalied to 1 [small]', E_USER_WARNING);
$size = 1;
}
$jsg = Type::getJSGlobalString($type);
if (!$jsg)
{
trigger_error('GenericPage::fmtCreateIcon - invalid type '.$type.'. Assumed '.Type::SPELL.' [spell]', E_USER_WARNING);
$jsg = Type::getJSGlobalString(Type::SPELL);
}
$params = [$typeId, $size];
if ($num || $qty)
$params[] = is_numeric($num) ? $num : "'".$num."'";
if ($qty)
$params[] = is_numeric($qty) ? $qty : "'".$qty."'";
// $WH.ge('icontab-icon1').appendChild(g_spells.createIcon(40120, 1, '1-4', 0));
return str_repeat(' ', $pad) . sprintf($createIconString, $element, $iconIdx, $jsg, implode(', ', $params));
}
protected function fmtStaffTip(string $text, string $tip) : string
{
if (User::isInGroup(U_GROUP_EMPLOYEE))
return sprintf(Util::$dfnString, $tip, $text);
else
return $text;
}
// load brick
public function brick(string $file, array $localVars = []) : void
protected function brick(string $file, array $localVars = []) : void
{
foreach ($localVars as $n => $v)
$$n = $v;
@@ -874,7 +910,7 @@ class GenericPage
}
// load listview addIns
public function lvBrick(string $file) : void
protected function lvBrick(string $file) : void
{
if (!$this->isSaneInclude('template/listviews/', $file))
trigger_error('Nonexistant Listview addin requested: template/listviews/'.$file.'.tpl.php', E_USER_ERROR);
@@ -883,7 +919,7 @@ class GenericPage
}
// load brick with more text then vars
public function localizedBrick(string $file, int $loc = LOCALE_EN) : void
protected function localizedBrick(string $file, int $loc = LOCALE_EN) : void
{
if (!$this->isSaneInclude('template/localized/', $file.'_'.$loc))
{

File diff suppressed because it is too large Load Diff

View File

@@ -3321,7 +3321,7 @@ UNLOCK TABLES;
LOCK TABLES `aowow_dbversion` WRITE;
/*!40000 ALTER TABLE `aowow_dbversion` DISABLE KEYS */;
INSERT INTO `aowow_dbversion` VALUES (1720969086,0,NULL,NULL);
INSERT INTO `aowow_dbversion` VALUES (1724095917,0,NULL,NULL);
/*!40000 ALTER TABLE `aowow_dbversion` ENABLE KEYS */;
UNLOCK TABLES;

View File

@@ -155,7 +155,7 @@ CLISetup::registerUtility(new class extends UtilityScript
if ($this->startStep)
{
CLI::write();
CLI::write(' You are currently on step '.($this->startStep + 1).' / '.count($this->steps).' ('.($this->steps[$this->startStep][1] ?: $this->steps[$this->startStep][0][1]).'). You can resume or restart the setup process.', -1, false);
CLI::write(' You are currently on step '.($this->startStep + 1).' / '.count($this->steps).' ('.($this->steps[$this->startStep][1] ?: $this->steps[$this->startStep][0]).'). You can resume or restart the setup process.', -1, false);
}
CLI::write();

View File

@@ -1345,6 +1345,14 @@ UNUSED19 = x
UNUSED20 = x
UNUSED21 = x
[summonproperties]
id = n
control = u
faction = x
title = x
slot = u
flags = x
[talent]
id = n
tabId = i

View File

@@ -0,0 +1,18 @@
<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
if (!CLI)
die('not in cli mode');
CLISetup::registerSetup("sql", new class extends SetupScript
{
use TrDBCcopy;
protected $command = 'summonproperties';
protected $dbcSourceFiles = ['summonproperties'];
});
?>

View File

@@ -0,0 +1 @@
UPDATE `aowow_dbversion` SET `sql` = CONCAT(IFNULL(`sql`, ''), ' summonproperties');

View File

@@ -21,12 +21,13 @@
<?php
$this->brick('tooltip');
if ($this->reagents[1]):
if ($this->tools):
echo " <div style=\"float: left; margin-right: 75px\">\n";
endif;
if ($this->reagents[1]):
$this->brick('reagentList', ['reagents' => $this->reagents[1], 'enhanced' => $this->reagents[0]]);
endif;
if ($this->tools):
echo " </div>\n";
@@ -47,7 +48,7 @@ if ($this->reagents[1]):
<?php
foreach ($this->tools as $i => $t):
if (isset($t['itemId'])):
echo " \$WH.ge('iconlist-icon.".($i + 1)."').appendChild(g_items.createIcon(".$t['itemId'].", 0, 1));\n";
echo $this->fmtCreateIcon($i + 1, Type::ITEM, $t['itemId'], 20, 'iconlist-icon', size: 0);
endif;
endforeach;
?>
@@ -57,7 +58,6 @@ if ($this->reagents[1]):
echo " </div>\n";
endif;
endif;
endif;
?>
<div class="clear"></div>
@@ -86,23 +86,23 @@ endif;
</tr>
<tr>
<th style="border-left: 0; border-top: 0"><?=Lang::game('duration');?></th>
<td width="100%" style="border-top: 0"><?=(!empty($this->duration) ? $this->duration : '<span class="q0">'.Lang::main('n_a').'</span>');?></td>
<td width="100%" style="border-top: 0"><?=($this->duration ?: '<span class="q0">'.Lang::main('n_a').'</span>');?></td>
</tr>
<tr>
<th style="border-left: 0"><?=Lang::game('school'); ?></th>
<td width="100%" style="border-top: 0"><?=(!empty($this->school[1]) ? (User::isInGroup(U_GROUP_STAFF) ? sprintf(Util::$dfnString, $this->school[0], $this->school[1]) : $this->school[1]) : '<span class="q0">'.Lang::main('n_a').'</span>');?></td>
<td width="100%" style="border-top: 0"><?=($this->school ?: '<span class="q0">'.Lang::main('n_a').'</span>');?></td>
</tr>
<tr>
<th style="border-left: 0"><?=Lang::game('mechanic');?></th>
<td width="100%" style="border-top: 0"><?=(!empty($this->mechanic) ? $this->mechanic : '<span class="q0">'.Lang::main('n_a').'</span>');?></td>
<td width="100%" style="border-top: 0"><?=($this->mechanic ?:'<span class="q0">'.Lang::main('n_a').'</span>');?></td>
</tr>
<tr>
<th style="border-left: 0"><?=Lang::game('dispelType');?></th>
<td width="100%" style="border-top: 0"><?=(!empty($this->dispel) ? $this->dispel : '<span class="q0">'.Lang::main('n_a').'</span>');?></td>
<td width="100%" style="border-top: 0"><?=($this->dispel ?: '<span class="q0">'.Lang::main('n_a').'</span>');?></td>
</tr>
<tr>
<th style="border-bottom: 0; border-left: 0"><?=Lang::spell('_gcdCategory');?></th>
<td style="border-bottom: 0"><?=(!empty($this->gcdCat) ? $this->gcdCat : '<span class="q0">'.Lang::main('n_a').'</span>');?></td>
<td style="border-bottom: 0"><?=($this->gcdCat ?: '<span class="q0">'.Lang::main('n_a').'</span>');?></td>
</tr>
</table>
</td>
@@ -113,7 +113,7 @@ endif;
</tr>
<tr>
<th><?=Lang::spell('_range');?></th>
<td><?=$this->range.' '.Lang::spell('_distUnit').' <small>('.$this->rangeName;?>)</small></td>
<td><?=$this->range.' '.Lang::spell('_distUnit').' <small>('.$this->rangeName.')</small>';?></td>
</tr>
<tr>
<th><?=Lang::spell('_castTime');?></th>
@@ -121,7 +121,7 @@ endif;
</tr>
<tr>
<th><?=Lang::spell('_cooldown');?></th>
<td><?=(!empty($this->cooldown) ? $this->cooldown : '<span class="q0">'.Lang::main('n_a').'</span>');?></td>
<td><?=($this->cooldown ?: '<span class="q0">'.Lang::main('n_a').'</span>');?></td>
</tr>
<tr>
<th><dfn title="<?=Lang::spell('_globCD').'">'.Lang::spell('_gcd');?></dfn></th>
@@ -138,7 +138,7 @@ if (!in_array(array_values($this->scaling), [[-1, -1, 0, 0], [0, 0, 0, 0]])):
<?php
foreach ($this->scaling as $k => $s):
if ($s > 0):
echo ' '.sprintf(Lang::spell('scaling', $k), $s * 100)."<br>\n";
echo ' '.Lang::spell('scaling', $k, [$s * 100])."<br>\n";
endif;
endforeach;
?>
@@ -147,7 +147,7 @@ if (!in_array(array_values($this->scaling), [[-1, -1, 0, 0], [0, 0, 0, 0]])):
<?php
endif;
if (!empty($this->stances)):
if ($this->stances):
?>
<tr>
<th><?=Lang::spell('_forms');?></th>
@@ -156,16 +156,16 @@ if (!empty($this->stances)):
<?php
endif;
if (!empty($this->items)):
if ($this->items):
?>
<tr>
<th><?=Lang::game('requires2');?></th>
<td colspan="3"><?=(User::isInGroup(U_GROUP_STAFF) ? sprintf(Util::$dfnString, implode('<br />', $this->items[0]), $this->items[1]) : $this->items[1]);?></td>
<td colspan="3"><?=$this->items;?></td>
</tr>
<?php
endif;
$iconTabIdx = -1;
$iconTabIdx = 0;
foreach ($this->effects as $i => $e):
?>
<tr>
@@ -174,42 +174,8 @@ foreach ($this->effects as $i => $e):
<?php
echo ' '.$e['name'];
$smallBuf = '';
if (isset($e['value'])):
$smallBuf .= '<br>'.Lang::spell('_value').Lang::main('colon').$e['value'];
endif;
if (isset($e['radius'])):
$smallBuf .= '<br>'.Lang::spell('_radius').Lang::main('colon').$e['radius'].' '.Lang::spell('_distUnit');
endif;
if (isset($e['interval'])):
$smallBuf .= '<br>'.Lang::spell('_interval').Lang::main('colon').$e['interval'];
endif;
if (isset($e['mechanic'])):
$smallBuf .= '<br>'.Lang::game('mechanic') .Lang::main('colon').$e['mechanic'];
endif;
if (isset($e['procData'])):
$smallBuf .= '<br>';
if ($e['procData'][0] < 0):
$smallBuf .= sprintf(Lang::spell('ppm'), Lang::nf(-$e['procData'][0], 1));
elseif ($e['procData'][0] < 100.0):
$smallBuf .= Lang::spell('procChance').Lang::main('colon').$e['procData'][0].'%';
endif;
if ($e['procData'][1]):
if ($e['procData'][0] < 100.0):
$smallBuf .= '<br>';
endif;
$smallBuf .= sprintf(Lang::game('cooldown'), $e['procData'][1]);
endif;
endif;
if ($smallBuf):
echo "<small>".$smallBuf."</small>\n";
if ($e['footer']):
echo "<small><br>".implode("<br>", $e['footer'])."</small>\n";
endif;
if (isset($e['markup'])):
@@ -218,35 +184,37 @@ $WH.aE(window,\'load\',function(){$WH.ge(\'spelleffectmarkup-'.$i.'\').innerHTML
//]]></script>';
endif;
if (isset($e['icon'])):
if ($e['icon']):
['type' => $ty, 'typeId' => $ti, 'name' => $na, 'quality' => $qu, 'count' => $co] = $e['icon'];
?>
<table class="icontab">
<tr>
<th id="icontab-icon<?=++$iconTabIdx;?>"></th>
<?php
if (isset($e['icon']['quality'])):
echo ' <td><span class="q'.$e['icon']['quality'].'"><a href="?item='.$e['icon']['id'].'">'.$e['icon']['name']."</a></span></td>\n";
if ($qu):
echo ' <td><span class="q'.$qu.'">'.($na ? sprintf('<a href="?item=%d">%s</a>', $ti, $na) : Util::ucFirst(Lang::game('item')).' #'.$ti)."</span></td>\n";
else:
echo ' <td>'.(strpos($e['icon']['name'], '#') ? $e['icon']['name'] : sprintf('<a href="?spell=%d">%s</a>', $e['icon']['id'], $e['icon']['name']))."</td>\n";
echo ' <td>'.($na ? sprintf('<a href="?spell=%d">%s</a>', $ti, $na) : Util::ucFirst(Lang::game('spell')).' #'.$ti)."</td>\n";
endif;
?>
<th></th><td></td>
</tr>
</table>
<script type="text/javascript">
<?='$WH.ge(\'icontab-icon'.$iconTabIdx.'\').appendChild('.(isset($e['icon']['quality']) ? 'g_items' : 'g_spells').'.createIcon('.$e['icon']['id'].', 1, '.$e['icon']['count']."));\n";?>
<?=$this->fmtCreateIcon($iconTabIdx, $ty, $ti, num: $co);?>
</script>
<?php
endif;
if (isset($e['perfItem'])):
if ($e['perfectItem']):
['spellId' => $si, 'spellName' => $sn, 'itemId' => $ii, 'itemName' => $in, 'quality' => $qu, 'icon' => $ic, 'chance' => $ch] = $e['perfectItem'];
?>
<small><a href="?spell=<?=$e['perfItem']['cndSpellId'];?>" class="icontiny"><img src="<?=Cfg::get('STATIC_URL');?>/images/wow/icons/tiny/<?=$e['perfItem']['icon'];?>.gif" align="absmiddle">
<span class="tinyicontxt"><?=$e['perfItem']['cndSpellName'];?></span></a><?=Lang::main('colon').' '.$e['perfItem']['chance'].'%';?></small><table class="icontab">
<tr><th id="icontab-icon<?=++$iconTabIdx;?>"></th><td><small><a href="?item=<?=$e['perfItem']['itemId'];?>" class="q<?=$e['perfItem']['quality'];?>"><?=$e['perfItem']['itemName'];?></a></small></td></tr></table>
<small><a href="?spell=<?=$si;?>" class="icontiny"><img src="<?=Cfg::get('STATIC_URL');?>/images/wow/icons/tiny/<?=$ic;?>.gif" align="absmiddle">
<span class="tinyicontxt"><?=$sn;?></span></a><?=Lang::main('colon').' '.$ch.'%';?></small><table class="icontab">
<tr><th id="icontab-icon<?=++$iconTabIdx;?>"></th><td><small><a href="?item=<?=$ii;?>" class="q<?=$qu;?>"><?=$in;?></a></small></td></tr></table>
<script type="text/javascript">//<![CDATA[
$WH.ge('icontab-icon<?=$iconTabIdx;?>').appendChild(g_items.createIcon(<?=$e['perfItem']['itemId'];?>, 0, "0"));
<?=$this->fmtCreateIcon($iconTabIdx, Type::ITEM, $ii);?>
//]]></script>
<?php
@@ -263,8 +231,8 @@ $WH.aE(window,\'load\',function(){$WH.ge(\'spelleffectmarkup-'.$i.'\').innerHTML
$folded = false;
$iconData = [];
if ($type && count($e['modifies'][0]))
echo '<a href="javascript:" class="disclosure-off" onclick="return g_disclose($(\'#effectspells-85645'.($i - 1).'\')[0], this);">'.Lang::spell('_seeMore').'</a><div id="effectspells-85645'.($i - 1).'" style="display: none">';
if ($type && count($e['modifies'][0])) // #effectspells-856451 < the number is ID from SpellEffect.db2 (not available in 3.3.5a, use effectIdx instead)
echo '<a href="javascript:" class="disclosure-off" onclick="return g_disclose($(\'#effectspells-'.$i.'\')[0], this);">'.Lang::spell('_seeMore').'</a><div id="effectspells-'.$i.'" style="display: none">';
echo '<table class="icontab">';
@@ -297,8 +265,8 @@ $WH.aE(window,\'load\',function(){$WH.ge(\'spelleffectmarkup-'.$i.'\').innerHTML
<script type="text/javascript">//<![CDATA[
<?php
foreach ($iconData as [$icon, $spell])
echo sprintf(" \$WH.ge('icontab-icon%d').appendChild(g_spells.createIcon(%d, 0, \"0\"));\n", $icon, $spell);
foreach ($iconData as [$idx, $spell])
echo $this->fmtCreateIcon($idx, Type::SPELL, $spell, 32, size: 0);
?>
//]]></script>