Spells/Scaling

* implement tooltip scaling calculation for spells with attribute
   SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION
 * I don't know why i loaded item scales as spell scales a decade ago.
   Lets hope removing that didn't break stuff.
This commit is contained in:
Sarjuuk 2026-02-05 17:47:41 +01:00
parent 55f599bbb8
commit 3510c8211c
10 changed files with 165 additions and 24 deletions

View file

@ -0,0 +1 @@
UPDATE `aowow_dbversion` SET `build` = CONCAT(IFNULL(`build`, ''), ' spellscaling itemscaling');

View file

@ -476,6 +476,9 @@ chance = f
[gtcombatratings]
ratio = f
[gtnpcmanacostscaler]
factor = f
[gtoctclasscombatratingscalar]
idx = n
ratio = f

View file

@ -0,0 +1,42 @@
<?php
namespace Aowow;
if (!defined('AOWOW_REVISION'))
die('illegal access');
if (!CLI)
die('not in cli mode');
CLISetup::registerSetup("build", new class extends SetupScript
{
use TrTemplateFile;
protected $info = array(
'spellscaling' => [[], CLISetup::ARGV_PARAM, 'Compiles spell scaling data to file for spells with attribute SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION.']
);
protected $fileTemplateDest = ['datasets/spell-scaling'];
protected $fileTemplateSrc = ['spell-scaling.in'];
protected $dbcSourceFiles = ['gtnpcmanacostscaler'];
private function debugify(array $data) : string
{
$buff = [];
foreach ($data as $id => $row)
$buff[] = str_pad($id, 7, " ", STR_PAD_LEFT).": ".$row;
return "{\r\n".implode(",\r\n", $buff)."\r\n}";
}
private function spellScalingSV() : string
{
$data = DB::Aowow()->selectCol('SELECT `idx` + 1 AS ARRAY_KEY, `factor` FROM dbc_gtnpcmanacostscaler');
return Cfg::get('DEBUG') ? $this->debugify($data) : Util::toJSON($data);
}
})
?>

View file

@ -6,5 +6,4 @@ $WH.g_convertScalingFactor.SD = /*setup:itemScalingSD*/;
if ($WH.isset('$WowheadPower')) {
$WowheadPower.loadScales(3);
$WowheadPower.loadScales(6);
}

View file

@ -90,7 +90,7 @@ if (typeof $WowheadPower == "undefined") {
},
SCALES = {
3: { url: "?data=item-scaling" },
6: { url: "?data=item-scaling" }
6: { url: "?data=spell-scaling" }
},
LOCALES = {
0: "enus",

View file

@ -0,0 +1,5 @@
$WH.g_convertScalingSpell.SV = /*setup:spellScalingSV*/;
if ($WH.isset('$WowheadPower')) {
$WowheadPower.loadScales(6);
}