mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Util/Game
* cleanup Util 2/2 * move game related functions and variables to new class: Game
This commit is contained in:
@@ -107,7 +107,7 @@ if (!CLI)
|
||||
{
|
||||
foreach ($v as $sk => $sv)
|
||||
{
|
||||
if ($str = Util::$itemMods[$sk])
|
||||
if ($str = Game::$itemMods[$sk])
|
||||
{
|
||||
$setOut['setbonus'][$k][$str] = $sv;
|
||||
unset($setOut['setbonus'][$k][$sk]);
|
||||
|
||||
@@ -128,7 +128,7 @@ class ItemStatSetup extends ItemList
|
||||
{
|
||||
if (!$v)
|
||||
continue;
|
||||
if ($str = Util::$itemMods[$k])
|
||||
if ($str = Game::$itemMods[$k])
|
||||
$updateFields[$str] = number_format($v, 2, '.', '');
|
||||
}
|
||||
}
|
||||
@@ -210,7 +210,7 @@ function enchantment_stats()
|
||||
case 3: // TYPE_EQUIP_SPELL Spells from ObjectX (use of amountX?)
|
||||
if (!empty($spellStats[$obj]))
|
||||
foreach ($spellStats[$obj] as $mod => $val)
|
||||
if ($str = Util::$itemMods[$mod])
|
||||
if ($str = Game::$itemMods[$mod])
|
||||
Util::arraySumByKey($result[$eId], [$str => $val]);
|
||||
|
||||
$obj = null;
|
||||
@@ -255,7 +255,7 @@ function enchantment_stats()
|
||||
}
|
||||
|
||||
if ($obj !== null)
|
||||
if ($str = Util::$itemMods[$obj]) // check if we use these mods
|
||||
if ($str = Game::$itemMods[$obj]) // check if we use these mods
|
||||
Util::arraySumByKey($result[$eId], [$str => $val]);
|
||||
}
|
||||
|
||||
|
||||
@@ -348,9 +348,9 @@ function spell()
|
||||
$update['skillLine1'] = $lines[0];
|
||||
break;
|
||||
default:
|
||||
for ($i = -count(Util::$skillLineMask); $i < 0; $i++)
|
||||
for ($i = -count(Game::$skillLineMask); $i < 0; $i++)
|
||||
{
|
||||
foreach (Util::$skillLineMask[$i] as $k => $pair)
|
||||
foreach (Game::$skillLineMask[$i] as $k => $pair)
|
||||
{
|
||||
if (in_array($pair[1], $lines))
|
||||
{
|
||||
@@ -537,8 +537,8 @@ function spell()
|
||||
// pet spells (-3)
|
||||
DB::Aowow()->query('UPDATE ?_spell s SET s.typeCat = -3 WHERE (s.cuFlags & 0x3) = 0 AND s.skillline1 IN (?a)',
|
||||
array_merge(
|
||||
array_column(Util::$skillLineMask[-1], 1), // hunter pets
|
||||
array_column(Util::$skillLineMask[-2], 1), // warlock pets
|
||||
array_column(Game::$skillLineMask[-1], 1), // hunter pets
|
||||
array_column(Game::$skillLineMask[-2], 1), // warlock pets
|
||||
[270, 782], // hunter generic, DK - Ghoul
|
||||
[-1, -2] // super categories
|
||||
)
|
||||
|
||||
@@ -80,7 +80,7 @@ function titles()
|
||||
if ($data['eventEntry'])
|
||||
DB::Aowow()->query('UPDATE ?_titles SET eventId = ?d WHERE id = ?d', $data['eventEntry'], $tId);
|
||||
|
||||
$side = Util::sideByRaceMask($data['AllowableRaces']);
|
||||
$side = Game::sideByRaceMask($data['AllowableRaces']);
|
||||
if ($side == 3)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user