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:
parent
55f599bbb8
commit
3510c8211c
10 changed files with 165 additions and 24 deletions
1
setup/sql/updates/1770309983_01.sql
Normal file
1
setup/sql/updates/1770309983_01.sql
Normal file
|
|
@ -0,0 +1 @@
|
|||
UPDATE `aowow_dbversion` SET `build` = CONCAT(IFNULL(`build`, ''), ' spellscaling itemscaling');
|
||||
|
|
@ -476,6 +476,9 @@ chance = f
|
|||
[gtcombatratings]
|
||||
ratio = f
|
||||
|
||||
[gtnpcmanacostscaler]
|
||||
factor = f
|
||||
|
||||
[gtoctclasscombatratingscalar]
|
||||
idx = n
|
||||
ratio = f
|
||||
|
|
|
|||
42
setup/tools/filegen/spellscaling.ss.php
Normal file
42
setup/tools/filegen/spellscaling.ss.php
Normal 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);
|
||||
}
|
||||
})
|
||||
|
||||
?>
|
||||
|
|
@ -6,5 +6,4 @@ $WH.g_convertScalingFactor.SD = /*setup:itemScalingSD*/;
|
|||
|
||||
if ($WH.isset('$WowheadPower')) {
|
||||
$WowheadPower.loadScales(3);
|
||||
$WowheadPower.loadScales(6);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
5
setup/tools/filegen/templates/spell-scaling.in
Normal file
5
setup/tools/filegen/templates/spell-scaling.in
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
$WH.g_convertScalingSpell.SV = /*setup:spellScalingSV*/;
|
||||
|
||||
if ($WH.isset('$WowheadPower')) {
|
||||
$WowheadPower.loadScales(6);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue