mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Profiler/Statistics
* use spells for skill modifying racials instead of hardcoded values * get baseline statistics from player_levelstats instead of hardcoded values
This commit is contained in:
@@ -561,31 +561,20 @@ class Profiler
|
|||||||
|
|
||||||
|
|
||||||
// known skills (professions only)
|
// known skills (professions only)
|
||||||
$skAllowed = DB::Aowow()->selectCol('SELECT id FROM ?_skillline WHERE typeCat IN (9, 11) AND (cuFlags & ?d) = 0', CUSTOM_EXCLUDE_FOR_LISTVIEW);
|
$skAllowed = DB::Aowow()->selectCol('SELECT `id` FROM ?_skillline WHERE `typeCat` IN (9, 11) AND (`cuFlags` & ?d) = 0', CUSTOM_EXCLUDE_FOR_LISTVIEW);
|
||||||
$skills = DB::Characters($realmId)->select('SELECT ?d AS id, ?d AS `type`, skill AS typeId, `value` AS cur, max FROM character_skills WHERE guid = ?d AND skill IN (?a)', $profileId, Type::SKILL, $char['guid'], $skAllowed);
|
$skills = DB::Characters($realmId)->select('SELECT ?d AS `id`, ?d AS `type`, `skill` AS typeId, `value` AS cur, `max` FROM character_skills WHERE guid = ?d AND `skill` IN (?a)', $profileId, Type::SKILL, $char['guid'], $skAllowed);
|
||||||
|
$racials = DB::Aowow()->select('SELECT `effect1MiscValue` AS ARRAY_KEY, `effect1DieSides` + `effect1BasePoints` AS qty, `reqRaceMask`, `reqClassMask` FROM ?_spell WHERE `typeCat` = -4 AND `effect1Id` = 6 AND `effect1AuraId` = 98');
|
||||||
// manually apply racial profession bonuses
|
// apply racial profession bonuses
|
||||||
foreach ($skills as &$sk)
|
foreach ($skills as &$sk)
|
||||||
{
|
{
|
||||||
// Blood Elves - Arcane Affinity
|
if (!isset($racials[$sk['typeId']]))
|
||||||
if ($sk['typeId'] == 333 && $char['race'] == 10)
|
continue;
|
||||||
|
|
||||||
|
$r = $racials[$sk['typeId']];
|
||||||
|
if ((!$r['reqRaceMask'] || $r['reqRaceMask'] & (1 << ($char['race'] - 1))) && (!$r['reqClassMask'] || $r['reqClassMask'] & (1 << ($char['class'] - 1))))
|
||||||
{
|
{
|
||||||
$sk['cur'] += 10;
|
$sk['cur'] += $r['qty'];
|
||||||
$sk['max'] += 10;
|
$sk['max'] += $r['qty'];
|
||||||
}
|
|
||||||
// Draenei - Gemcutting
|
|
||||||
if ($sk['typeId'] == 755 && $char['race'] == 11)
|
|
||||||
{
|
|
||||||
$sk['cur'] += 5;
|
|
||||||
$sk['max'] += 5;
|
|
||||||
}
|
|
||||||
// Tauren - Cultivation
|
|
||||||
// Gnomes - Engineering Specialization
|
|
||||||
if (($sk['typeId'] == 182 && $char['race'] == 6) ||
|
|
||||||
($sk['typeId'] == 202 && $char['race'] == 7))
|
|
||||||
{
|
|
||||||
$sk['cur'] += 15;
|
|
||||||
$sk['max'] += 15;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($sk);
|
unset($sk);
|
||||||
|
|||||||
@@ -57,20 +57,10 @@ if (!CLI)
|
|||||||
|
|
||||||
$race = function()
|
$race = function()
|
||||||
{
|
{
|
||||||
// where did i get this data again..?
|
|
||||||
// { str, agi, sta, int, spi, raceMod1, raceMod2 }
|
// { str, agi, sta, int, spi, raceMod1, raceMod2 }
|
||||||
$raceData = array(
|
$raceData = DB::World()->select('SELECT `race` AS ARRAY_KEY, MIN(`str`), MIN(`agi`), MIN(`sta`), MIN(`inte`), MIN(`spi`) FROM player_levelstats WHERE `level` = 1 GROUP BY `race` ORDER BY `race` ASC');
|
||||||
1 => [20, 20, 20, 20, 20, [], []],
|
foreach ($raceData as &$rd)
|
||||||
2 => [23, 17, 22, 17, 23, [], []],
|
$rd = array_values($rd + [[], []]);
|
||||||
3 => [22, 16, 23, 19, 19, [], []],
|
|
||||||
4 => [17, 25, 19, 20, 20, [], []],
|
|
||||||
5 => [19, 18, 21, 18, 25, [], []],
|
|
||||||
6 => [25, 15, 22, 15, 22, [], []],
|
|
||||||
7 => [15, 23, 19, 24, 20, [], []],
|
|
||||||
8 => [21, 22, 21, 16, 21, [], []],
|
|
||||||
10 => [17, 22, 18, 24, 19, [], []],
|
|
||||||
11 => [21, 17, 19, 21, 22, [], []]
|
|
||||||
);
|
|
||||||
|
|
||||||
$racials = new SpellList(array(['typeCat', -4], ['reqClassMask', 0]));
|
$racials = new SpellList(array(['typeCat', -4], ['reqClassMask', 0]));
|
||||||
$allMods = $racials->getProfilerMods();
|
$allMods = $racials->getProfilerMods();
|
||||||
@@ -107,16 +97,17 @@ if (!CLI)
|
|||||||
|
|
||||||
// TrinityCore claims, DodgePerAgi per level and class can be constituted from critPerAgi (and level (and class))
|
// TrinityCore claims, DodgePerAgi per level and class can be constituted from critPerAgi (and level (and class))
|
||||||
// who am i to argue
|
// who am i to argue
|
||||||
// rebase stats to a specific race. chosen human as all stats are 20
|
// rebase stats to a specific race. chosen human as all stats are 20 and tauren for hunter, shaman and druid
|
||||||
|
// the stat gain per level is only dependant on the class. The race only determines the initial stats at level 0
|
||||||
// level:{ str, agi, sta, int, spi, hp, mana, mleCrt%Agi, splCrt%Int, dodge%Agi, HealthRegenModToBaseStat, HealthRegenModToBonusStat }
|
// level:{ str, agi, sta, int, spi, hp, mana, mleCrt%Agi, splCrt%Int, dodge%Agi, HealthRegenModToBaseStat, HealthRegenModToBonusStat }
|
||||||
|
|
||||||
foreach ($critToDodge as $class => $mod)
|
foreach ($critToDodge as $class => $mod)
|
||||||
{
|
{
|
||||||
// humans can't be hunter, shaman, druids (use tauren here)
|
// humans can't be hunter, shaman, druids (use tauren here)
|
||||||
if (in_array($class, [3, 7, 11]))
|
if (in_array($class, [3, 7, 11]))
|
||||||
$offset = [25, 15, 22, 15, 22];
|
$offset = array_values(DB::World()->selectRow('SELECT MIN(`str`), MIN(`agi`), MIN(`sta`), MIN(`inte`), MIN(`spi`) FROM player_levelstats WHERE `level` = 1 AND `race` = 6'));
|
||||||
else
|
else
|
||||||
$offset = [20, 20, 20, 20, 20];
|
$offset = array_values(DB::World()->selectRow('SELECT MIN(`str`), MIN(`agi`), MIN(`sta`), MIN(`inte`), MIN(`spi`) FROM player_levelstats WHERE `level` = 1 AND `race` = 1'));
|
||||||
|
|
||||||
$gtData = DB::Aowow()->select('
|
$gtData = DB::Aowow()->select('
|
||||||
SELECT mlecrt.idx - ?d AS ARRAY_KEY, mlecrt.chance * 100, splcrt.chance * 100, mlecrt.chance * 100 * ?f, baseHP5.ratio * 1, extraHP5.ratio * 1
|
SELECT mlecrt.idx - ?d AS ARRAY_KEY, mlecrt.chance * 100, splcrt.chance * 100, mlecrt.chance * 100 * ?f, baseHP5.ratio * 1, extraHP5.ratio * 1
|
||||||
@@ -207,4 +198,4 @@ if (!CLI)
|
|||||||
return $success;
|
return $success;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
1
setup/updates/1683979752_01.sql
Normal file
1
setup/updates/1683979752_01.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
UPDATE `aowow_dbversion` SET `build` = CONCAT(IFNULL(`build`, ''), ' statistics');
|
||||||
Reference in New Issue
Block a user