mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
- Error handling:
* replaced error-suppressions with proper checks * log php errors to db * use __callStatic() to access localization and thus handle erronous keys - Setup: * fixed some erronous filenames when generating icons * increased alpha threshold for spawn maps (should improve spawn points) - disentangled DB::Aowow and DB::World. Aowow should now be able to run with DB::World being on a different server - added missing faction transfer pendants (title/quest/faction/..) - fixed extended costs for specific vendors
This commit is contained in:
@@ -51,6 +51,7 @@ if (!defined('AOWOW_REVISION'))
|
||||
|
||||
$mapWidth = 1002;
|
||||
$mapHeight = 668;
|
||||
$threshold = 95; // alpha threshold to define subZones: set it too low and you have unspawnable areas inside a zone; set it too high and the border regions overlap
|
||||
$runTime = ini_get('max_execution_time');
|
||||
$locStr = null;
|
||||
$dbcPath = FileGen::$srcDir.'%sDBFilesClient/';
|
||||
@@ -69,10 +70,12 @@ if (!defined('AOWOW_REVISION'))
|
||||
|
||||
$bgColor = imagecolorallocatealpha($img, 0, 0, 0, 127);
|
||||
imagefilledrectangle($img, 0, 0, imagesx($img) - 1, imagesy($img) - 1, $bgColor);
|
||||
imagecolordeallocate($img, $bgColor);
|
||||
|
||||
imagecolortransparent($img, $bgColor);
|
||||
imagealphablending($img, true);
|
||||
|
||||
imagecolordeallocate($img, $bgColor);
|
||||
|
||||
return $img;
|
||||
};
|
||||
|
||||
@@ -161,7 +164,7 @@ if (!defined('AOWOW_REVISION'))
|
||||
return $ok;
|
||||
};
|
||||
|
||||
$createSpawnMap = function($img, $zoneId) use ($mapHeight, $mapWidth)
|
||||
$createSpawnMap = function($img, $zoneId) use ($mapHeight, $mapWidth, $threshold)
|
||||
{
|
||||
FileGen::status(' - creating spawn map');
|
||||
|
||||
@@ -174,7 +177,7 @@ if (!defined('AOWOW_REVISION'))
|
||||
for ($x = 0; $x < 1000; $x++)
|
||||
{
|
||||
$a = imagecolorat($img, ($x * $mapWidth) / 1000, ($y * $mapHeight) / 1000) >> 24;
|
||||
imagesetpixel($tmp, $x, $y, $a < 30 ? $cfg : $cbg);
|
||||
imagesetpixel($tmp, $x, $y, $a < $threshold ? $cfg : $cbg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -480,7 +483,7 @@ if (!defined('AOWOW_REVISION'))
|
||||
|
||||
for ($my = 0; $my < imagesy($img); $my++)
|
||||
for ($mx = 0; $mx < imagesx($img); $mx++)
|
||||
if ((imagecolorat($img, $mx, $my) >> 24) < 30)
|
||||
if ((imagecolorat($img, $mx, $my) >> 24) < $threshold)
|
||||
imagesetpixel($row['maskimage'], $x + $mx, $y + $my, $row['maskcolor']);
|
||||
}
|
||||
|
||||
@@ -566,7 +569,6 @@ if (!defined('AOWOW_REVISION'))
|
||||
|
||||
if (!$multiLeveled)
|
||||
{
|
||||
imagecolortransparent($overlay, imagecolorat($overlay, imagesx($overlay)-1, imagesy($overlay)-1));
|
||||
imagecopymerge($map, $overlay, 0, 0, 0, 0, imagesx($overlay), imagesy($overlay), 100);
|
||||
imagedestroy($overlay);
|
||||
}
|
||||
@@ -635,7 +637,7 @@ if (!defined('AOWOW_REVISION'))
|
||||
|
||||
if ($modeMask & 0x08) // optional tidbits (not used by default)
|
||||
{
|
||||
if (FileGen::writeDir($destDir.'interface/Glues/Credits/'))
|
||||
if (FileGen::writeDir($destDir.'Interface/Glues/Credits/'))
|
||||
{
|
||||
// tile ordering
|
||||
$order = array(
|
||||
@@ -692,7 +694,7 @@ if (!defined('AOWOW_REVISION'))
|
||||
|
||||
$sum++;
|
||||
$done = ' - '.str_pad($sum.'/'.$total, 8).str_pad('('.number_format($sum * 100 / $total, 2).'%)', 9);
|
||||
$name = $destDir.'interface/Glues/Credits/'.$file;
|
||||
$name = $destDir.'Interface/Glues/Credits/'.$file;
|
||||
|
||||
if (!isset(FileGen::$cliOpts['force']) && file_exists($name.'.png'))
|
||||
{
|
||||
|
||||
@@ -95,13 +95,13 @@ if (!defined('AOWOW_REVISION'))
|
||||
'ui-paperdoll-slot-waist' => 'inventoryslot_waist',
|
||||
'ui-paperdoll-slot-wrists' => 'inventoryslot_wrists'
|
||||
),
|
||||
3 => array(
|
||||
['race_human_male', 'race_dwarf_male', 'race_gnome_male', 'race_nightelf_male', 'race_draenai_male' ],
|
||||
['race_tauren_male', 'race_undead_male', 'race_troll_male', 'race_orc_male', 'race_bloodelf_male' ],
|
||||
['race_human_female', 'race_dwarf_female', 'race_gnome_female', 'race_nightelf_female', 'race_draenai_female' ],
|
||||
['race_tauren_female', 'race_undead_female', 'race_troll_female', 'race_orc_female', 'race_bloodelf_female']
|
||||
3 => array( // uses nameINT from ChrRaces.dbc
|
||||
['race_human_male', 'race_dwarf_male', 'race_gnome_male', 'race_nightelf_male', 'race_draenei_male' ],
|
||||
['race_tauren_male', 'race_scourge_male', 'race_troll_male', 'race_orc_male', 'race_bloodelf_male' ],
|
||||
['race_human_female', 'race_dwarf_female', 'race_gnome_female', 'race_nightelf_female', 'race_draenei_female' ],
|
||||
['race_tauren_female', 'race_scourge_female', 'race_troll_female', 'race_orc_female', 'race_bloodelf_female']
|
||||
),
|
||||
4 => array(
|
||||
4 => array( // uses nameINT from ChrClasses.dbc
|
||||
['class_warrior', 'class_mage', 'class_rogue', 'class_druid' ],
|
||||
['class_hunter', 'class_shaman', 'class_priest', 'class_warlock'],
|
||||
['class_paladin', 'class_deathknight' ]
|
||||
|
||||
@@ -673,9 +673,9 @@ if (typeof $WowheadPower == "undefined") {
|
||||
zoom: 3,
|
||||
zoomable: false,
|
||||
buttons: false
|
||||
});
|
||||
}, true);
|
||||
}
|
||||
arr[id].map.update(json.map);
|
||||
arr[id].map.update(json.map, true);
|
||||
delete json.map;
|
||||
}
|
||||
|
||||
|
||||
52
setup/updates/06_creature.sql
Normal file
52
setup/updates/06_creature.sql
Normal file
@@ -0,0 +1,52 @@
|
||||
ALTER TABLE `aowow_creature`
|
||||
ADD COLUMN `dmgMin` FLOAT UNSIGNED NOT NULL DEFAULT '0' AFTER `trainerRace`,
|
||||
ADD COLUMN `dmgMax` FLOAT UNSIGNED NOT NULL DEFAULT '0' AFTER `dmgMin`,
|
||||
ADD COLUMN `mleAtkPwrMin` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `dmgMax`,
|
||||
ADD COLUMN `mleAtkPwrMax` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `mleAtkPwrMin`,
|
||||
ADD COLUMN `rngAtkPwrMin` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `mleAtkPwrMax`,
|
||||
ADD COLUMN `rngAtkPwrMax` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `rngAtkPwrMin`
|
||||
ADD COLUMN `healthMin` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `aiName`
|
||||
ADD COLUMN `healthMax` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `healthMin`
|
||||
ADD COLUMN `manaMin` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `healthMax`
|
||||
ADD COLUMN `manaMax` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `manaMin`
|
||||
ADD COLUMN `armorMin` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `manaMax`
|
||||
ADD COLUMN `armorMax` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `armorMin`
|
||||
;
|
||||
|
||||
-- merge creature_classlevelstats into ?_creature to be searchable
|
||||
-- edit the table names to fit
|
||||
-- for min stats
|
||||
/*
|
||||
UPDATE
|
||||
aowow.aowow_creature ac,
|
||||
world.creature_template ct,
|
||||
world.creature_classlevelstats cls
|
||||
SET
|
||||
ac.healthMin = (CASE ct.exp WHEN 0 THEN cls.basehp0 WHEN 1 THEN cls.basehp1 ELSE cls.basehp2 END) * ct.Health_mod,
|
||||
ac.manaMin = cls.basemana * ct.Mana_mod,
|
||||
ac.armorMin = cls.basearmor * ct.Armor_mod,
|
||||
ac.rngAtkPwrMin = cls.rangedattackpower,
|
||||
ac.mleAtkPwrMin = cls.attackpower,
|
||||
ac.dmgMin = (CASE ct.exp WHEN 0 THEN cls.damage_base WHEN 1 THEN cls.damage_exp1 ELSE cls.damage_exp2 END)
|
||||
WHERE
|
||||
ac.id = ct.entry AND
|
||||
ct.unit_class = cls.class AND
|
||||
ct.minlevel = cls.level;
|
||||
|
||||
-- for max stats
|
||||
UPDATE
|
||||
aowow.aowow_creature ac,
|
||||
world.creature_template ct,
|
||||
world.creature_classlevelstats cls
|
||||
SET
|
||||
ac.healthMax = (CASE ct.exp WHEN 0 THEN cls.basehp0 WHEN 1 THEN cls.basehp1 ELSE cls.basehp2 END) * ct.Health_mod,
|
||||
ac.manaMax = cls.basemana * ct.Mana_mod,
|
||||
ac.armorMax = cls.basearmor * ct.Armor_mod,
|
||||
ac.rngAtkPwrMax = cls.rangedattackpower,
|
||||
ac.mleAtkPwrMax = cls.attackpower,
|
||||
ac.dmgMax = (CASE ct.exp WHEN 0 THEN cls.damage_base WHEN 1 THEN cls.damage_exp1 ELSE cls.damage_exp2 END)
|
||||
WHERE
|
||||
ac.id = ct.entry AND
|
||||
ct.unit_class = cls.class AND
|
||||
ct.maxlevel = cls.level;
|
||||
*/
|
||||
11
setup/updates/06_errors.sql
Normal file
11
setup/updates/06_errors.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
CREATE TABLE `aowow_errors` (
|
||||
`date` INT(10) UNSIGNED NULL DEFAULT NULL,
|
||||
`version` SMALLINT(5) UNSIGNED NOT NULL,
|
||||
`phpError` SMALLINT(5) UNSIGNED NOT NULL,
|
||||
`file` VARCHAR(250) NOT NULL,
|
||||
`line` SMALLINT(5) UNSIGNED NOT NULL,
|
||||
`query` VARCHAR(250) NOT NULL,
|
||||
`userGroups` SMALLINT(5) UNSIGNED NOT NULL,
|
||||
`message` TEXT NULL,
|
||||
PRIMARY KEY (`file`, `line`, `phpError`, `version`, `userGroups`)
|
||||
) COLLATE='utf8_general_ci' ENGINE=MyISAM;
|
||||
Reference in New Issue
Block a user