Core/DataStores: Updated opcodes and db2 to 7.0.3.21414
This commit is contained in:
@@ -2132,7 +2132,7 @@ ALTER TABLE `spell_power`
|
||||
-- Table structure for table `spell_power_difficulty`
|
||||
--
|
||||
ALTER TABLE `spell_power_difficulty` DROP PRIMARY KEY;
|
||||
ALTER TABLE `spell_power_difficulty` ADD `ID` int(10) unsigned NOT NULL DEFAULT '0' FIRST,
|
||||
ALTER TABLE `spell_power_difficulty`
|
||||
MODIFY `DifficultyID` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `SpellPowerID`,
|
||||
MODIFY `PowerIndex` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `DifficultyID`;
|
||||
ALTER TABLE `spell_power_difficulty` ADD PRIMARY KEY (`ID`);
|
||||
|
||||
@@ -0,0 +1,801 @@
|
||||
--
|
||||
-- Table structure for table `area_table`
|
||||
--
|
||||
ALTER TABLE `area_table` CHANGE `UWIntroMusic` `UWIntroMusic` smallint(5) unsigned NOT NULL DEFAULT '0' AFTER `LiquidTypeID4`;
|
||||
|
||||
--
|
||||
-- Table structure for table `banned_addons`
|
||||
--
|
||||
DROP TABLE IF EXISTS `banned_addons`;
|
||||
CREATE TABLE `banned_addons` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Name` text,
|
||||
`Version` text,
|
||||
`Flags` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `battlemaster_list`
|
||||
--
|
||||
DROP TABLE IF EXISTS `battlemaster_list`;
|
||||
CREATE TABLE `battlemaster_list` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Name` text,
|
||||
`IconFileDataID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`GameType` text,
|
||||
`MapID1` smallint(6) NOT NULL DEFAULT '0',
|
||||
`MapID2` smallint(6) NOT NULL DEFAULT '0',
|
||||
`MapID3` smallint(6) NOT NULL DEFAULT '0',
|
||||
`MapID4` smallint(6) NOT NULL DEFAULT '0',
|
||||
`MapID5` smallint(6) NOT NULL DEFAULT '0',
|
||||
`MapID6` smallint(6) NOT NULL DEFAULT '0',
|
||||
`MapID7` smallint(6) NOT NULL DEFAULT '0',
|
||||
`MapID8` smallint(6) NOT NULL DEFAULT '0',
|
||||
`MapID9` smallint(6) NOT NULL DEFAULT '0',
|
||||
`MapID10` smallint(6) NOT NULL DEFAULT '0',
|
||||
`MapID11` smallint(6) NOT NULL DEFAULT '0',
|
||||
`MapID12` smallint(6) NOT NULL DEFAULT '0',
|
||||
`MapID13` smallint(6) NOT NULL DEFAULT '0',
|
||||
`MapID14` smallint(6) NOT NULL DEFAULT '0',
|
||||
`MapID15` smallint(6) NOT NULL DEFAULT '0',
|
||||
`MapID16` smallint(6) NOT NULL DEFAULT '0',
|
||||
`HolidayWorldState` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`PlayerConditionID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`InstanceType` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`GroupsAllowed` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`MaxGroupSize` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`MinLevel` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`MaxLevel` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`RatedPlayers` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`MinPlayers` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`MaxPlayers` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`Flags` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `battlemaster_list_locale`
|
||||
--
|
||||
DROP TABLE IF EXISTS `battlemaster_list_locale`;
|
||||
CREATE TABLE `battlemaster_list_locale` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`locale` varchar(4) NOT NULL,
|
||||
`Name_lang` text,
|
||||
`GameType_lang` text,
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`,`locale`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `char_sections`
|
||||
--
|
||||
DROP TABLE IF EXISTS `char_sections`;
|
||||
CREATE TABLE `char_sections` (
|
||||
`Id` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`TextureFileDataID1` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`TextureFileDataID2` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`TextureFileDataID3` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Flags` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`Race` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`Gender` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`GenType` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`Type` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`Color` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`Id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `chr_classes`
|
||||
--
|
||||
DROP TABLE IF EXISTS `chr_classes`;
|
||||
CREATE TABLE `chr_classes` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`PowerType` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`PetNameToken` text,
|
||||
`Name` text,
|
||||
`NameFemale` text,
|
||||
`NameMale` text,
|
||||
`Filename` text,
|
||||
`CreateScreenFileDataID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`SelectScreenFileDataID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`LowResScreenFileDataID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Flags` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`CinematicSequenceID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`DefaultSpec` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`SpellClassSet` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`AttackPowerPerStrength` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`AttackPowerPerAgility` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`RangedAttackPowerPerAgility` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`IconFileDataID` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`Unk1` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `chr_classes_locale`
|
||||
--
|
||||
DROP TABLE IF EXISTS `chr_classes_locale`;
|
||||
CREATE TABLE `chr_classes_locale` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`locale` varchar(4) NOT NULL,
|
||||
`Name_lang` text,
|
||||
`NameFemale_lang` text,
|
||||
`NameMale_lang` text,
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`,`locale`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `chr_races`
|
||||
--
|
||||
ALTER TABLE `chr_races` ADD `ItemAppearanceFrameRaceID` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `NeutralRaceID`;
|
||||
|
||||
--
|
||||
-- Table structure for table `creature_display_info`
|
||||
--
|
||||
ALTER TABLE `creature_display_info` ADD `InstanceOtherPlayerPetScale` float NOT NULL DEFAULT '0' AFTER `StateSpellVisualKitID`;
|
||||
|
||||
--
|
||||
-- Table structure for table `creature_model_data`
|
||||
--
|
||||
DROP TABLE IF EXISTS `creature_model_data`;
|
||||
CREATE TABLE `creature_model_data` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Flags` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`FileDataID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`ModelScale` float NOT NULL DEFAULT '0',
|
||||
`FootprintTextureLength` float NOT NULL DEFAULT '0',
|
||||
`FootprintTextureWidth` float NOT NULL DEFAULT '0',
|
||||
`FootprintParticleScale` float NOT NULL DEFAULT '0',
|
||||
`CollisionWidth` float NOT NULL DEFAULT '0',
|
||||
`CollisionHeight` float NOT NULL DEFAULT '0',
|
||||
`MountHeight` float NOT NULL DEFAULT '0',
|
||||
`GeoBoxMin1` float NOT NULL DEFAULT '0',
|
||||
`GeoBoxMin2` float NOT NULL DEFAULT '0',
|
||||
`GeoBoxMin3` float NOT NULL DEFAULT '0',
|
||||
`GeoBoxMax1` float NOT NULL DEFAULT '0',
|
||||
`GeoBoxMax2` float NOT NULL DEFAULT '0',
|
||||
`GeoBoxMax3` float NOT NULL DEFAULT '0',
|
||||
`WorldEffectScale` float NOT NULL DEFAULT '0',
|
||||
`AttachedEffectScale` float NOT NULL DEFAULT '0',
|
||||
`MissileCollisionRadius` float NOT NULL DEFAULT '0',
|
||||
`MissileCollisionPush` float NOT NULL DEFAULT '0',
|
||||
`MissileCollisionRaise` float NOT NULL DEFAULT '0',
|
||||
`OverrideLootEffectScale` float NOT NULL DEFAULT '0',
|
||||
`OverrideNameScale` float NOT NULL DEFAULT '0',
|
||||
`OverrideSelectionRadius` float NOT NULL DEFAULT '0',
|
||||
`TamedPetBaseScale` float NOT NULL DEFAULT '0',
|
||||
`HoverHeight` float NOT NULL DEFAULT '0',
|
||||
`SoundID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`CreatureGeosetDataID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`SizeClass` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`BloodID` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`FootprintTextureID` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`FoleyMaterialID` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`Unk700_1` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`Unk700_2` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`FootstepShakeSize` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`DeathThudShakeSize` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `emotes`
|
||||
--
|
||||
ALTER TABLE `emotes`
|
||||
ADD `Unk703_1` int(10) unsigned NOT NULL DEFAULT '0' AFTER `EmoteFlags`,
|
||||
ADD `Unk703_2` int(10) unsigned NOT NULL DEFAULT '0' AFTER `Unk703_1`,
|
||||
CHANGE `EmoteSpecProcParam` `EmoteSpecProcParam` smallint(5) unsigned NOT NULL DEFAULT '0' AFTER `AnimID`;
|
||||
|
||||
--
|
||||
-- Table structure for table `faction`
|
||||
--
|
||||
DROP TABLE IF EXISTS `faction`;
|
||||
CREATE TABLE `faction` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`ReputationRaceMask1` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`ReputationRaceMask2` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`ReputationRaceMask3` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`ReputationRaceMask4` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`ReputationBase1` int(11) NOT NULL DEFAULT '0',
|
||||
`ReputationBase2` int(11) NOT NULL DEFAULT '0',
|
||||
`ReputationBase3` int(11) NOT NULL DEFAULT '0',
|
||||
`ReputationBase4` int(11) NOT NULL DEFAULT '0',
|
||||
`ParentFactionModIn` float NOT NULL DEFAULT '0',
|
||||
`ParentFactionModOut` float NOT NULL DEFAULT '0',
|
||||
`Name` text,
|
||||
`Description` text,
|
||||
`ReputationIndex` smallint(6) NOT NULL DEFAULT '0',
|
||||
`ReputationClassMask1` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`ReputationClassMask2` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`ReputationClassMask3` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`ReputationClassMask4` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`ReputationFlags1` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`ReputationFlags2` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`ReputationFlags3` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`ReputationFlags4` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`ParentFactionID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`ParentFactionCapIn` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`ParentFactionCapOut` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`Expansion` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`Flags` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`FriendshipRepID` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `faction_locale`
|
||||
--
|
||||
DROP TABLE IF EXISTS `faction_locale`;
|
||||
CREATE TABLE `faction_locale` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`locale` varchar(4) NOT NULL,
|
||||
`Name_lang` text,
|
||||
`Description_lang` text,
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`,`locale`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `faction_template`
|
||||
--
|
||||
DROP TABLE IF EXISTS `faction_template`;
|
||||
CREATE TABLE `faction_template` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Faction` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`Flags` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`Enemies1` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`Enemies2` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`Enemies3` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`Enemies4` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`Friends1` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`Friends2` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`Friends3` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`Friends4` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`Mask` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`FriendMask` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`EnemyMask` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `garr_ability`
|
||||
--
|
||||
ALTER TABLE `garr_ability` CHANGE `Flags` `Flags` smallint(5) unsigned NOT NULL DEFAULT '0' AFTER `IconFileDataID`;
|
||||
|
||||
--
|
||||
-- Table structure for table `garr_ability`
|
||||
--
|
||||
ALTER TABLE `garr_class_spec`
|
||||
ADD `Limit` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `GarrFollItemSetID`,
|
||||
CHANGE `Unknown700` `Flags` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `Limit`;
|
||||
|
||||
--
|
||||
-- Table structure for table `garr_follower`
|
||||
--
|
||||
ALTER TABLE `garr_follower`
|
||||
ADD `MaxDurability` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `GarrTypeID`,
|
||||
ADD `Class` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `MaxDurability`;
|
||||
|
||||
--
|
||||
-- Table structure for table `garr_plot`
|
||||
--
|
||||
ALTER TABLE `garr_plot` CHANGE `MinCount` `MinCount` smallint(5) unsigned NOT NULL DEFAULT '0' AFTER `HordeConstructionGameObjectID`;
|
||||
ALTER TABLE `garr_plot` CHANGE `MaxCount` `MaxCount` smallint(5) unsigned NOT NULL DEFAULT '0' AFTER `MinCount`;
|
||||
|
||||
--
|
||||
-- Table structure for table `gem_properties`
|
||||
--
|
||||
ALTER TABLE `gem_properties`
|
||||
DROP `MaxCountInv`,
|
||||
DROP COLUMN `MaxCountItem`;
|
||||
|
||||
--
|
||||
-- Table structure for table `glyph_slot`
|
||||
--
|
||||
ALTER TABLE `glyph_slot` MODIFY COLUMN `Tooltip` smallint(5) unsigned NOT NULL DEFAULT '0' AFTER `ID`;
|
||||
|
||||
--
|
||||
-- Table structure for table `guild_perk_spells`
|
||||
--
|
||||
ALTER TABLE `guild_perk_spells` DROP COLUMN `GuildLevel`;
|
||||
|
||||
--
|
||||
-- Table structure for table `item_appearance`
|
||||
--
|
||||
ALTER TABLE `item_appearance` ADD COLUMN `UIOrder` int(10) unsigned NOT NULL DEFAULT '0' AFTER `IconFileDataID`;
|
||||
|
||||
--
|
||||
-- Table structure for table `item_modified_appearance`
|
||||
--
|
||||
ALTER TABLE `item_modified_appearance` ADD COLUMN `SourceType` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `Index`;
|
||||
|
||||
--
|
||||
-- Table structure for table `item_set`
|
||||
--
|
||||
ALTER TABLE `item_set` ADD COLUMN `Unknown703` int(10) unsigned NOT NULL DEFAULT '0' AFTER `ItemID17`;
|
||||
|
||||
--
|
||||
-- Table structure for table `item_sparse`
|
||||
--
|
||||
ALTER TABLE `item_sparse` ADD COLUMN `RequiredExpansion` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `ArtifactID`;
|
||||
|
||||
--
|
||||
-- Table structure for table `lfg_dungeons`
|
||||
--
|
||||
DROP TABLE IF EXISTS `lfg_dungeons`;
|
||||
CREATE TABLE `lfg_dungeons` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Name` text,
|
||||
`Flags` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`TextureFilename` text,
|
||||
`Description` text,
|
||||
`MaxLevel` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`TargetLevelMax` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`MapID` smallint(6) NOT NULL DEFAULT '0',
|
||||
`RandomID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`ScenarioID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`LastBossJournalEncounterID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`BonusReputationAmount` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`MentorItemLevel` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`MinLevel` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`TargetLevel` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`TargetLevelMin` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`DifficultyID` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`Type` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`Faction` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`Expansion` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`OrderIndex` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`GroupID` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`CountTank` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`CountHealer` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`CountDamage` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`MinCountTank` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`MinCountHealer` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`MinCountDamage` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`SubType` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`MentorCharLevel` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `lfg_dungeons_locale`
|
||||
--
|
||||
DROP TABLE IF EXISTS `lfg_dungeons_locale`;
|
||||
CREATE TABLE `lfg_dungeons_locale` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`locale` varchar(4) NOT NULL,
|
||||
`Name_lang` text,
|
||||
`Description_lang` text,
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`,`locale`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `light`
|
||||
--
|
||||
DROP TABLE IF EXISTS `light`;
|
||||
CREATE TABLE `light` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`PosX` float NOT NULL DEFAULT '0',
|
||||
`PosY` float NOT NULL DEFAULT '0',
|
||||
`PosZ` float NOT NULL DEFAULT '0',
|
||||
`FalloffStart` float NOT NULL DEFAULT '0',
|
||||
`FalloffEnd` float NOT NULL DEFAULT '0',
|
||||
`MapID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`LightParamsID1` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`LightParamsID2` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`LightParamsID3` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`LightParamsID4` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`LightParamsID5` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`LightParamsID6` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`LightParamsID7` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`LightParamsID8` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `liquid_type`
|
||||
--
|
||||
DROP TABLE IF EXISTS `liquid_type`;
|
||||
CREATE TABLE `liquid_type` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Name` text,
|
||||
`SpellID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`MaxDarkenDepth` float NOT NULL DEFAULT '0',
|
||||
`FogDarkenIntensity` float NOT NULL DEFAULT '0',
|
||||
`AmbDarkenIntensity` float NOT NULL DEFAULT '0',
|
||||
`DirDarkenIntensity` float NOT NULL DEFAULT '0',
|
||||
`ParticleScale` float NOT NULL DEFAULT '0',
|
||||
`Texture1` text,
|
||||
`Texture2` text,
|
||||
`Texture3` text,
|
||||
`Texture4` text,
|
||||
`Texture5` text,
|
||||
`Texture6` text,
|
||||
`Color1` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Color2` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Float1` float NOT NULL DEFAULT '0',
|
||||
`Float2` float NOT NULL DEFAULT '0',
|
||||
`Float3` float NOT NULL DEFAULT '0',
|
||||
`Float4` float NOT NULL DEFAULT '0',
|
||||
`Float5` float NOT NULL DEFAULT '0',
|
||||
`Float6` float NOT NULL DEFAULT '0',
|
||||
`Float7` float NOT NULL DEFAULT '0',
|
||||
`Float8` float NOT NULL DEFAULT '0',
|
||||
`Float9` float NOT NULL DEFAULT '0',
|
||||
`Float10` float NOT NULL DEFAULT '0',
|
||||
`Float11` float NOT NULL DEFAULT '0',
|
||||
`Float12` float NOT NULL DEFAULT '0',
|
||||
`Float13` float NOT NULL DEFAULT '0',
|
||||
`Float14` float NOT NULL DEFAULT '0',
|
||||
`Float15` float NOT NULL DEFAULT '0',
|
||||
`Float16` float NOT NULL DEFAULT '0',
|
||||
`Float17` float NOT NULL DEFAULT '0',
|
||||
`Float18` float NOT NULL DEFAULT '0',
|
||||
`Int1` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Int2` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Int3` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Int4` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Flags` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`SoundID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`Type` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`LightID` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`ParticleMovement` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`ParticleTexSlots` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`MaterialID` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`DepthTexCount1` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`DepthTexCount2` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`DepthTexCount3` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`DepthTexCount4` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`DepthTexCount5` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`DepthTexCount6` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `liquid_type_locale`
|
||||
--
|
||||
DROP TABLE IF EXISTS `liquid_type_locale`;
|
||||
CREATE TABLE `liquid_type_locale` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`locale` varchar(4) NOT NULL,
|
||||
`Name_lang` text,
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`,`locale`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `map`
|
||||
--
|
||||
ALTER TABLE `map` DROP `RaidOffset`;
|
||||
|
||||
--
|
||||
-- Table structure for table `map_difficulty`
|
||||
--
|
||||
DROP TABLE IF EXISTS `map_difficulty`;
|
||||
CREATE TABLE `map_difficulty` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Message` text,
|
||||
`Context` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`MapID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`DifficultyID` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`RaidDurationType` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`MaxPlayers` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`LockID` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`ItemBonusTreeModID` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `map_difficulty_locale`
|
||||
--
|
||||
DROP TABLE IF EXISTS `map_difficulty_locale`;
|
||||
CREATE TABLE `map_difficulty_locale` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`locale` varchar(4) NOT NULL,
|
||||
`Message_lang` text,
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`,`locale`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `mount_capability`
|
||||
--
|
||||
ALTER TABLE `mount_capability` MODIFY COLUMN `RequiredAura` int(10) unsigned NOT NULL DEFAULT '0' AFTER `ID`;
|
||||
|
||||
--
|
||||
-- Table structure for table `quest_sort`
|
||||
--
|
||||
ALTER TABLE `quest_sort` ADD COLUMN `SortOrder` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `SortName`;
|
||||
|
||||
--
|
||||
-- Table structure for table `rand_prop_points`
|
||||
--
|
||||
ALTER TABLE `rand_prop_points`
|
||||
CHANGE `EpicPropertiesPoints1` `EpicPropertiesPoints1` int(10) unsigned NOT NULL DEFAULT '0' AFTER `ID`,
|
||||
CHANGE `EpicPropertiesPoints2` `EpicPropertiesPoints2` int(10) unsigned NOT NULL DEFAULT '0' AFTER `EpicPropertiesPoints1`,
|
||||
CHANGE `EpicPropertiesPoints3` `EpicPropertiesPoints3` int(10) unsigned NOT NULL DEFAULT '0' AFTER `EpicPropertiesPoints2`,
|
||||
CHANGE `EpicPropertiesPoints4` `EpicPropertiesPoints4` int(10) unsigned NOT NULL DEFAULT '0' AFTER `EpicPropertiesPoints3`,
|
||||
CHANGE `EpicPropertiesPoints5` `EpicPropertiesPoints5` int(10) unsigned NOT NULL DEFAULT '0' AFTER `EpicPropertiesPoints4`,
|
||||
CHANGE `RarePropertiesPoints1` `RarePropertiesPoints1` int(10) unsigned NOT NULL DEFAULT '0' AFTER `EpicPropertiesPoints5`,
|
||||
CHANGE `RarePropertiesPoints2` `RarePropertiesPoints2` int(10) unsigned NOT NULL DEFAULT '0' AFTER `RarePropertiesPoints1`,
|
||||
CHANGE `RarePropertiesPoints3` `RarePropertiesPoints3` int(10) unsigned NOT NULL DEFAULT '0' AFTER `RarePropertiesPoints2`,
|
||||
CHANGE `RarePropertiesPoints4` `RarePropertiesPoints4` int(10) unsigned NOT NULL DEFAULT '0' AFTER `RarePropertiesPoints3`,
|
||||
CHANGE `RarePropertiesPoints5` `RarePropertiesPoints5` int(10) unsigned NOT NULL DEFAULT '0' AFTER `RarePropertiesPoints4`,
|
||||
CHANGE `UncommonPropertiesPoints1` `UncommonPropertiesPoints1` int(10) unsigned NOT NULL DEFAULT '0' AFTER `RarePropertiesPoints5`,
|
||||
CHANGE `UncommonPropertiesPoints2` `UncommonPropertiesPoints2` int(10) unsigned NOT NULL DEFAULT '0' AFTER `UncommonPropertiesPoints1`,
|
||||
CHANGE `UncommonPropertiesPoints3` `UncommonPropertiesPoints3` int(10) unsigned NOT NULL DEFAULT '0' AFTER `UncommonPropertiesPoints2`,
|
||||
CHANGE `UncommonPropertiesPoints4` `UncommonPropertiesPoints4` int(10) unsigned NOT NULL DEFAULT '0' AFTER `UncommonPropertiesPoints3`,
|
||||
CHANGE `UncommonPropertiesPoints5` `UncommonPropertiesPoints5` int(10) unsigned NOT NULL DEFAULT '0' AFTER `UncommonPropertiesPoints4`;
|
||||
|
||||
--
|
||||
-- Table structure for table `skill_race_class_info`
|
||||
--
|
||||
ALTER TABLE `skill_race_class_info` MODIFY COLUMN `ClassMask` int(11) NOT NULL DEFAULT '0' AFTER `RaceMask`;
|
||||
|
||||
--
|
||||
-- Table structure for table `sound_kit`
|
||||
--
|
||||
ALTER TABLE `sound_kit`
|
||||
CHANGE `BusOverwriteID` `BusOverwriteID` smallint(5) unsigned NOT NULL DEFAULT '0' AFTER `SoundEntriesAdvancedID`,
|
||||
CHANGE `SoundType` `SoundType` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `BusOverwriteID`;
|
||||
|
||||
--
|
||||
-- Table structure for table `spell_category`
|
||||
--
|
||||
ALTER TABLE `spell_category` ADD COLUMN `Unk703` int(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `ChargeRecoveryTime`;
|
||||
|
||||
--
|
||||
-- Table structure for table `spell_item_enchantment`
|
||||
--
|
||||
DROP TABLE IF EXISTS `spell_item_enchantment`;
|
||||
CREATE TABLE `spell_item_enchantment` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`EffectSpellID1` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`EffectSpellID2` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`EffectSpellID3` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Name` text,
|
||||
`EffectScalingPoints1` float NOT NULL DEFAULT '0',
|
||||
`EffectScalingPoints2` float NOT NULL DEFAULT '0',
|
||||
`EffectScalingPoints3` float NOT NULL DEFAULT '0',
|
||||
`PlayerConditionID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`TransmogCost` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`TextureFileDataID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`EffectPointsMin1` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`EffectPointsMin2` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`EffectPointsMin3` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`ItemVisual` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`Flags` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`RequiredSkillID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`RequiredSkillRank` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`ItemLevel` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`Charges` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`Effect1` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`Effect2` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`Effect3` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`ConditionID` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`MinLevel` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`MaxLevel` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`ScalingClass` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`ScalingClassRestricted` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `spell_item_enchantment_locale`
|
||||
--
|
||||
DROP TABLE IF EXISTS `spell_item_enchantment_locale`;
|
||||
CREATE TABLE `spell_item_enchantment_locale` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`locale` varchar(4) NOT NULL,
|
||||
`Name_lang` text,
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`,`locale`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `spell_scaling`
|
||||
--
|
||||
ALTER TABLE `spell_scaling` ADD COLUMN `MinScalingLevel` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `ScalingClass`;
|
||||
|
||||
--
|
||||
-- Table structure for table `talent`
|
||||
--
|
||||
DROP TABLE IF EXISTS `talent`;
|
||||
CREATE TABLE `talent` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`SpellID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`OverridesSpellID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Description` text,
|
||||
`SpecID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`TierID` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`ColumnIndex` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`Flags` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`CategoryMask1` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`CategoryMask2` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`ClassID` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `talent_locale`
|
||||
--
|
||||
DROP TABLE IF EXISTS `talent_locale`;
|
||||
CREATE TABLE `talent_locale` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`locale` varchar(4) NOT NULL,
|
||||
`Description_lang` text,
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`,`locale`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `vehicle`
|
||||
--
|
||||
DROP TABLE IF EXISTS `vehicle`;
|
||||
CREATE TABLE `vehicle` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Flags` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`TurnSpeed` float NOT NULL DEFAULT '0',
|
||||
`PitchSpeed` float NOT NULL DEFAULT '0',
|
||||
`PitchMin` float NOT NULL DEFAULT '0',
|
||||
`PitchMax` float NOT NULL DEFAULT '0',
|
||||
`MouseLookOffsetPitch` float NOT NULL DEFAULT '0',
|
||||
`CameraFadeDistScalarMin` float NOT NULL DEFAULT '0',
|
||||
`CameraFadeDistScalarMax` float NOT NULL DEFAULT '0',
|
||||
`CameraPitchOffset` float NOT NULL DEFAULT '0',
|
||||
`FacingLimitRight` float NOT NULL DEFAULT '0',
|
||||
`FacingLimitLeft` float NOT NULL DEFAULT '0',
|
||||
`MsslTrgtTurnLingering` float NOT NULL DEFAULT '0',
|
||||
`MsslTrgtPitchLingering` float NOT NULL DEFAULT '0',
|
||||
`MsslTrgtMouseLingering` float NOT NULL DEFAULT '0',
|
||||
`MsslTrgtEndOpacity` float NOT NULL DEFAULT '0',
|
||||
`MsslTrgtArcSpeed` float NOT NULL DEFAULT '0',
|
||||
`MsslTrgtArcRepeat` float NOT NULL DEFAULT '0',
|
||||
`MsslTrgtArcWidth` float NOT NULL DEFAULT '0',
|
||||
`MsslTrgtImpactRadius1` float NOT NULL DEFAULT '0',
|
||||
`MsslTrgtImpactRadius2` float NOT NULL DEFAULT '0',
|
||||
`MsslTrgtArcTexture` text,
|
||||
`MsslTrgtImpactTexture` text,
|
||||
`MsslTrgtImpactModel1` text,
|
||||
`MsslTrgtImpactModel2` text,
|
||||
`CameraYawOffset` float NOT NULL DEFAULT '0',
|
||||
`MsslTrgtImpactTexRadius` float NOT NULL DEFAULT '0',
|
||||
`SeatID1` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`SeatID2` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`SeatID3` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`SeatID4` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`SeatID5` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`SeatID6` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`SeatID7` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`SeatID8` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`VehicleUIIndicatorID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`PowerDisplayID1` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`PowerDisplayID2` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`PowerDisplayID3` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`FlagsB` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`UILocomotionType` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `vehicle_seat`
|
||||
--
|
||||
ALTER TABLE `vehicle_seat`
|
||||
CHANGE `EnterUISoundID` `EnterUISoundID` int(10) unsigned NOT NULL DEFAULT '0' AFTER `VehicleExitAnimDelay`,
|
||||
CHANGE `ExitUISoundID` `ExitUISoundID` int(10) unsigned NOT NULL DEFAULT '0' AFTER `EnterUISoundID`;
|
||||
|
||||
--
|
||||
-- Table structure for table `wmo_area_table`
|
||||
--
|
||||
DROP TABLE IF EXISTS `wmo_area_table`;
|
||||
CREATE TABLE `wmo_area_table` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`WMOGroupID` int(11) NOT NULL DEFAULT '0',
|
||||
`AreaName` text,
|
||||
`WMOID` smallint(6) NOT NULL DEFAULT '0',
|
||||
`AmbienceID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`ZoneMusic` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`IntroSound` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`AreaTableID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`UWIntroSound` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`UWAmbience` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`NameSet` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`SoundProviderPref` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`SoundProviderPrefUnderwater` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`Flags` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`UWZoneMusic` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `wmo_area_table_locale`
|
||||
--
|
||||
DROP TABLE IF EXISTS `wmo_area_table_locale`;
|
||||
CREATE TABLE `wmo_area_table_locale` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`locale` varchar(4) NOT NULL,
|
||||
`AreaName_lang` text,
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`,`locale`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `world_map_area`
|
||||
--
|
||||
DROP TABLE IF EXISTS `world_map_area`;
|
||||
CREATE TABLE `world_map_area` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`AreaName` text,
|
||||
`LocLeft` float NOT NULL DEFAULT '0',
|
||||
`LocRight` float NOT NULL DEFAULT '0',
|
||||
`LocTop` float NOT NULL DEFAULT '0',
|
||||
`LocBottom` float NOT NULL DEFAULT '0',
|
||||
`MapID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`AreaID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`DisplayMapID` smallint(6) NOT NULL DEFAULT '0',
|
||||
`DefaultDungeonFloor` smallint(6) NOT NULL DEFAULT '0',
|
||||
`ParentWorldMapID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`Flags` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`PlayerConditionID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`LevelRangeMin` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`LevelRangeMax` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`BountySetID` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`BountyBoardLocation` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `world_map_overlay`
|
||||
--
|
||||
ALTER TABLE `world_map_overlay` ADD `Flags` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `PlayerConditionID`;
|
||||
|
||||
--
|
||||
-- Table structure for table `world_safe_locs`
|
||||
--
|
||||
DROP TABLE IF EXISTS `world_safe_locs`;
|
||||
CREATE TABLE `world_safe_locs` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`LocX` float NOT NULL DEFAULT '0',
|
||||
`LocY` float NOT NULL DEFAULT '0',
|
||||
`LocZ` float NOT NULL DEFAULT '0',
|
||||
`Facing` float NOT NULL DEFAULT '0',
|
||||
`AreaName` text,
|
||||
`MapID` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `world_safe_locs_locale`
|
||||
--
|
||||
DROP TABLE IF EXISTS `world_safe_locs_locale`;
|
||||
CREATE TABLE `world_safe_locs_locale` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`locale` varchar(4) NOT NULL,
|
||||
`AreaName_lang` text,
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`,`locale`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
DROP TABLE `game_tables`;
|
||||
DROP TABLE `game_tables_locale`;
|
||||
DROP TABLE `item_to_battle_pet_species`;
|
||||
+9
-13
@@ -159,19 +159,15 @@ typedef uint8_t uint8;
|
||||
|
||||
enum DBCFormer
|
||||
{
|
||||
FT_NA = 'x', //not used or unknown, 4 byte size
|
||||
FT_NA_BYTE = 'X', //not used or unknown, byte
|
||||
FT_STRING = 's', //char*
|
||||
FT_STRING_NOT_LOCALIZED = 'S', //char* but without locale in DB2
|
||||
FT_FLOAT = 'f', //float
|
||||
FT_INT = 'i', //uint32
|
||||
FT_BYTE = 'b', //uint8
|
||||
FT_LONG = 'l', //uint64
|
||||
FT_SHORT = 'h', //uint16
|
||||
FT_SORT = 'd', //sorted by this field, field is not included
|
||||
FT_IND = 'n', //the same, but parsed to data
|
||||
FT_SQL_PRESENT = 'p', //Used in sql format to mark column present in sql dbc
|
||||
FT_SQL_ABSENT = 'a' //Used in sql format to mark column absent in sql dbc
|
||||
FT_STRING = 's', // LocalizedString*
|
||||
FT_STRING_NOT_LOCALIZED = 'S', // char*
|
||||
FT_FLOAT = 'f', // float
|
||||
FT_INT = 'i', // uint32
|
||||
FT_BYTE = 'b', // uint8
|
||||
FT_LONG = 'l', // uint64
|
||||
FT_SHORT = 'h', // uint16
|
||||
FT_SORT = 'd', // sorted by this field but not present in DB2 data block (calculated)
|
||||
FT_IND = 'n' // sorted by this field
|
||||
};
|
||||
|
||||
#endif //TRINITY_DEFINE_H
|
||||
|
||||
@@ -43,8 +43,8 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
|
||||
// AreaTable.db2
|
||||
PrepareStatement(HOTFIX_SEL_AREA_TABLE, "SELECT ID, Flags1, Flags2, ZoneName, AmbientMultiplier, AreaName, MapID, ParentAreaID, AreaBit, "
|
||||
"AmbienceID, ZoneMusic, IntroSound, LiquidTypeID1, LiquidTypeID2, LiquidTypeID3, LiquidTypeID4, UWZoneMusic, UWAmbience, "
|
||||
"PvPCombastWorldStateID, SoundProviderPref, SoundProviderPrefUnderwater, ExplorationLevel, FactionGroupMask, MountFlags, UWIntroMusic, "
|
||||
"AmbienceID, ZoneMusic, IntroSound, LiquidTypeID1, LiquidTypeID2, LiquidTypeID3, LiquidTypeID4, UWIntroMusic, UWZoneMusic, UWAmbience, "
|
||||
"PvPCombastWorldStateID, SoundProviderPref, SoundProviderPrefUnderwater, ExplorationLevel, FactionGroupMask, MountFlags, "
|
||||
"WildBattlePetLevelMin, WildBattlePetLevelMax, WindSettingsID FROM area_table ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_AREA_TABLE, "SELECT ID, AreaName_lang FROM area_table_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
@@ -62,6 +62,9 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
// BankBagSlotPrices.db2
|
||||
PrepareStatement(HOTFIX_SEL_BANK_BAG_SLOT_PRICES, "SELECT ID, Cost FROM bank_bag_slot_prices ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// BannedAddons.db2
|
||||
PrepareStatement(HOTFIX_SEL_BANNED_ADDONS, "SELECT ID, Name, Version, Flags FROM banned_addons ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// BarberShopStyle.db2
|
||||
PrepareStatement(HOTFIX_SEL_BARBER_SHOP_STYLE, "SELECT ID, DisplayName, Description, CostModifier, Type, Race, Sex, Data FROM barber_shop_style"
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
@@ -81,11 +84,21 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
// BattlePetSpeciesState.db2
|
||||
PrepareStatement(HOTFIX_SEL_BATTLE_PET_SPECIES_STATE, "SELECT ID, Value, SpeciesID, State FROM battle_pet_species_state ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// BattlemasterList.db2
|
||||
PrepareStatement(HOTFIX_SEL_BATTLEMASTER_LIST, "SELECT ID, Name, IconFileDataID, GameType, MapID1, MapID2, MapID3, MapID4, MapID5, MapID6, "
|
||||
"MapID7, MapID8, MapID9, MapID10, MapID11, MapID12, MapID13, MapID14, MapID15, MapID16, HolidayWorldState, PlayerConditionID, InstanceType, "
|
||||
"GroupsAllowed, MaxGroupSize, MinLevel, MaxLevel, RatedPlayers, MinPlayers, MaxPlayers, Flags FROM battlemaster_list ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_BATTLEMASTER_LIST, "SELECT ID, Name_lang, GameType_lang FROM battlemaster_list_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// BroadcastText.db2
|
||||
PrepareStatement(HOTFIX_SEL_BROADCAST_TEXT, "SELECT ID, MaleText, FemaleText, EmoteID1, EmoteID2, EmoteID3, EmoteDelay1, EmoteDelay2, "
|
||||
"EmoteDelay3, SoundID, UnkEmoteID, Language, Type FROM broadcast_text ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_BROADCAST_TEXT, "SELECT ID, MaleText_lang, FemaleText_lang FROM broadcast_text_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// CharSections.db2
|
||||
PrepareStatement(HOTFIX_SEL_CHAR_SECTIONS, "SELECT Id, TextureFileDataID1, TextureFileDataID2, TextureFileDataID3, Flags, Race, Gender, GenType, "
|
||||
"Type, Color FROM char_sections ORDER BY Id DESC", CONNECTION_SYNCH);
|
||||
|
||||
// CharStartOutfit.db2
|
||||
PrepareStatement(HOTFIX_SEL_CHAR_START_OUTFIT, "SELECT ID, ItemID1, ItemID2, ItemID3, ItemID4, ItemID5, ItemID6, ItemID7, ItemID8, ItemID9, "
|
||||
"ItemID10, ItemID11, ItemID12, ItemID13, ItemID14, ItemID15, ItemID16, ItemID17, ItemID18, ItemID19, ItemID20, ItemID21, ItemID22, ItemID23, "
|
||||
@@ -99,6 +112,12 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(HOTFIX_SEL_CHAT_CHANNELS, "SELECT ID, Flags, Name, Shortcut, FactionGroup FROM chat_channels ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_CHAT_CHANNELS, "SELECT ID, Name_lang, Shortcut_lang FROM chat_channels_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// ChrClasses.db2
|
||||
PrepareStatement(HOTFIX_SEL_CHR_CLASSES, "SELECT ID, PowerType, PetNameToken, Name, NameFemale, NameMale, Filename, CreateScreenFileDataID, "
|
||||
"SelectScreenFileDataID, LowResScreenFileDataID, Flags, CinematicSequenceID, DefaultSpec, SpellClassSet, AttackPowerPerStrength, "
|
||||
"AttackPowerPerAgility, RangedAttackPowerPerAgility, IconFileDataID, Unk1 FROM chr_classes ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_CHR_CLASSES, "SELECT ID, Name_lang, NameFemale_lang, NameMale_lang FROM chr_classes_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// ChrClassesXPowerTypes.db2
|
||||
PrepareStatement(HOTFIX_SEL_CHR_CLASSES_X_POWER_TYPES, "SELECT ID, ClassID, PowerType FROM chr_classes_x_power_types ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
@@ -108,8 +127,8 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
"MaleCustomizeOffset3, FemaleCustomizeOffset1, FemaleCustomizeOffset2, FemaleCustomizeOffset3, LowResScreenFileDataID, FactionID, "
|
||||
"ExplorationSoundID, MaleDisplayID, FemaleDisplayID, ResSicknessSpellID, SplashSoundID, CinematicSequenceID, UAMaleCreatureSoundDataID, "
|
||||
"UAFemaleCreatureSoundDataID, HighResMaleDisplayID, HighResFemaleDisplayID, Unk, BaseLanguage, CreatureType, TeamID, RaceRelated, "
|
||||
"UnalteredVisualRaceID, CharComponentTextureLayoutID, DefaultClassID, NeutralRaceID, CharComponentTexLayoutHiResID FROM chr_races"
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
"UnalteredVisualRaceID, CharComponentTextureLayoutID, DefaultClassID, NeutralRaceID, ItemAppearanceFrameRaceID, "
|
||||
"CharComponentTexLayoutHiResID FROM chr_races ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_CHR_RACES, "SELECT ID, Name_lang, NameFemale_lang, NameMale_lang FROM chr_races_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// ChrSpecialization.db2
|
||||
@@ -125,8 +144,8 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
// CreatureDisplayInfo.db2
|
||||
PrepareStatement(HOTFIX_SEL_CREATURE_DISPLAY_INFO, "SELECT ID, ExtendedDisplayInfoID, CreatureModelScale, PlayerModelScale, TextureVariation1, "
|
||||
"TextureVariation2, TextureVariation3, PortraitTextureName, PortraitCreatureDisplayInfoID, CreatureGeosetData, StateSpellVisualKitID, "
|
||||
"ModelID, SoundID, NPCSoundID, ParticleColorID, ObjectEffectPackageID, AnimReplacementSetID, CreatureModelAlpha, SizeClass, BloodID, Flags, "
|
||||
"Gender, Unk700 FROM creature_display_info ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
"InstanceOtherPlayerPetScale, ModelID, SoundID, NPCSoundID, ParticleColorID, ObjectEffectPackageID, AnimReplacementSetID, CreatureModelAlpha, "
|
||||
"SizeClass, BloodID, Flags, Gender, Unk700 FROM creature_display_info ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// CreatureDisplayInfoExtra.db2
|
||||
PrepareStatement(HOTFIX_SEL_CREATURE_DISPLAY_INFO_EXTRA, "SELECT ID, FileDataID, HDFileDataID, DisplayRaceID, DisplaySexID, DisplayClassID, "
|
||||
@@ -138,6 +157,14 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
"MaxScaleLevel, PetTalentType, CategoryEnumID FROM creature_family ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_CREATURE_FAMILY, "SELECT ID, Name_lang FROM creature_family_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// CreatureModelData.db2
|
||||
PrepareStatement(HOTFIX_SEL_CREATURE_MODEL_DATA, "SELECT ID, Flags, FileDataID, ModelScale, FootprintTextureLength, FootprintTextureWidth, "
|
||||
"FootprintParticleScale, CollisionWidth, CollisionHeight, MountHeight, GeoBoxMin1, GeoBoxMin2, GeoBoxMin3, GeoBoxMax1, GeoBoxMax2, "
|
||||
"GeoBoxMax3, WorldEffectScale, AttachedEffectScale, MissileCollisionRadius, MissileCollisionPush, MissileCollisionRaise, "
|
||||
"OverrideLootEffectScale, OverrideNameScale, OverrideSelectionRadius, TamedPetBaseScale, HoverHeight, SoundID, CreatureGeosetDataID, "
|
||||
"SizeClass, BloodID, FootprintTextureID, FoleyMaterialID, Unk700_1, Unk700_2, FootstepShakeSize, DeathThudShakeSize FROM creature_model_data"
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// CreatureType.db2
|
||||
PrepareStatement(HOTFIX_SEL_CREATURE_TYPE, "SELECT ID, Name, Flags FROM creature_type ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_CREATURE_TYPE, "SELECT ID, Name_lang FROM creature_type_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
@@ -190,8 +217,8 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(HOTFIX_SEL_DURABILITY_QUALITY, "SELECT ID, QualityMod FROM durability_quality ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// Emotes.db2
|
||||
PrepareStatement(HOTFIX_SEL_EMOTES, "SELECT ID, EmoteSlashCommand, SpellVisualKitID, EmoteFlags, AnimID, EmoteSoundID, EmoteSpecProc, "
|
||||
"EmoteSpecProcParam FROM emotes ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PrepareStatement(HOTFIX_SEL_EMOTES, "SELECT ID, EmoteSlashCommand, SpellVisualKitID, EmoteFlags, Unk703_1, Unk703_2, AnimID, EmoteSpecProcParam, "
|
||||
"EmoteSoundID, EmoteSpecProc FROM emotes ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// EmotesText.db2
|
||||
PrepareStatement(HOTFIX_SEL_EMOTES_TEXT, "SELECT ID, Name, EmoteID FROM emotes_text ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
@@ -200,6 +227,18 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
// EmotesTextSound.db2
|
||||
PrepareStatement(HOTFIX_SEL_EMOTES_TEXT_SOUND, "SELECT ID, EmotesTextId, SoundId, RaceId, SexId, ClassId FROM emotes_text_sound ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// Faction.db2
|
||||
PrepareStatement(HOTFIX_SEL_FACTION, "SELECT ID, ReputationRaceMask1, ReputationRaceMask2, ReputationRaceMask3, ReputationRaceMask4, "
|
||||
"ReputationBase1, ReputationBase2, ReputationBase3, ReputationBase4, ParentFactionModIn, ParentFactionModOut, Name, Description, "
|
||||
"ReputationIndex, ReputationClassMask1, ReputationClassMask2, ReputationClassMask3, ReputationClassMask4, ReputationFlags1, ReputationFlags2, "
|
||||
"ReputationFlags3, ReputationFlags4, ParentFactionID, ParentFactionCapIn, ParentFactionCapOut, Expansion, Flags, FriendshipRepID FROM faction"
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_FACTION, "SELECT ID, Name_lang, Description_lang FROM faction_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// FactionTemplate.db2
|
||||
PrepareStatement(HOTFIX_SEL_FACTION_TEMPLATE, "SELECT ID, Faction, Flags, Enemies1, Enemies2, Enemies3, Enemies4, Friends1, Friends2, Friends3, "
|
||||
"Friends4, Mask, FriendMask, EnemyMask FROM faction_template ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// Gameobjects.db2
|
||||
PrepareStatement(HOTFIX_SEL_GAMEOBJECTS, "SELECT ID, PositionX, PositionY, PositionZ, RotationX, RotationY, RotationZ, RotationW, Size, Data1, "
|
||||
"Data2, Data3, Data4, Data5, Data6, Data7, Data8, Name, MapID, DisplayID, PhaseID, PhaseGroupID, PhaseUseFlags, Type FROM gameobjects"
|
||||
@@ -210,12 +249,8 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(HOTFIX_SEL_GAMEOBJECT_DISPLAY_INFO, "SELECT ID, FileDataID, GeoBoxMinX, GeoBoxMinY, GeoBoxMinZ, GeoBoxMaxX, GeoBoxMaxY, "
|
||||
"GeoBoxMaxZ, OverrideLootEffectScale, OverrideNameScale, ObjectEffectPackageID FROM gameobject_display_info ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// GameTables.db2
|
||||
PrepareStatement(HOTFIX_SEL_GAME_TABLES, "SELECT ID, Name, NumRows, NumColumns FROM game_tables ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_GAME_TABLES, "SELECT ID, Name_lang FROM game_tables_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// GarrAbility.db2
|
||||
PrepareStatement(HOTFIX_SEL_GARR_ABILITY, "SELECT ID, Name, Description, IconFileDataID, OtherFactionGarrAbilityID, Flags, GarrAbilityCategoryID, "
|
||||
PrepareStatement(HOTFIX_SEL_GARR_ABILITY, "SELECT ID, Name, Description, IconFileDataID, Flags, OtherFactionGarrAbilityID, GarrAbilityCategoryID, "
|
||||
"FollowerTypeID FROM garr_ability ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_GARR_ABILITY, "SELECT ID, Name_lang, Description_lang FROM garr_ability_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
@@ -232,7 +267,7 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
"GarrSiteLevelPlotInstID, GarrBuildingID FROM garr_building_plot_inst ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// GarrClassSpec.db2
|
||||
PrepareStatement(HOTFIX_SEL_GARR_CLASS_SPEC, "SELECT ID, NameMale, NameFemale, NameGenderless, ClassAtlasID, GarrFollItemSetID, Unknown700"
|
||||
PrepareStatement(HOTFIX_SEL_GARR_CLASS_SPEC, "SELECT ID, NameMale, NameFemale, NameGenderless, ClassAtlasID, GarrFollItemSetID, `Limit`, Flags"
|
||||
" FROM garr_class_spec ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_GARR_CLASS_SPEC, "SELECT ID, NameMale_lang, NameFemale_lang, NameGenderless_lang FROM garr_class_spec_locale"
|
||||
" WHERE locale = ?", CONNECTION_SYNCH);
|
||||
@@ -241,8 +276,8 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(HOTFIX_SEL_GARR_FOLLOWER, "SELECT ID, HordeCreatureID, AllianceCreatureID, HordeSourceText, AllianceSourceText, "
|
||||
"HordePortraitIconID, AlliancePortraitIconID, ItemLevelWeapon, ItemLevelArmor, FollowerTypeID, HordeUiAnimRaceInfoID, "
|
||||
"AllianceUiAnimRaceInfoID, Quality, HordeGarrClassSpecID, AllianceGarrClassSpecID, HordeGarrFollItemSetID, AllianceGarrFollItemSetID, Level, "
|
||||
"Unknown1, Flags, Unknown2, Unknown3, HordeListPortraitTextureKitID, AllianceListPortraitTextureKitID, GarrTypeID FROM garr_follower"
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
"Unknown1, Flags, Unknown2, Unknown3, HordeListPortraitTextureKitID, AllianceListPortraitTextureKitID, GarrTypeID, MaxDurability, Class"
|
||||
" FROM garr_follower ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_GARR_FOLLOWER, "SELECT ID, HordeSourceText_lang, AllianceSourceText_lang FROM garr_follower_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// GarrFollowerXAbility.db2
|
||||
@@ -250,8 +285,8 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// GarrPlot.db2
|
||||
PrepareStatement(HOTFIX_SEL_GARR_PLOT, "SELECT ID, Name, AllianceConstructionGameObjectID, HordeConstructionGameObjectID, GarrPlotUICategoryID, "
|
||||
"PlotType, Flags, MinCount, MaxCount FROM garr_plot ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PrepareStatement(HOTFIX_SEL_GARR_PLOT, "SELECT ID, Name, AllianceConstructionGameObjectID, HordeConstructionGameObjectID, MinCount, MaxCount, "
|
||||
"GarrPlotUICategoryID, PlotType, Flags FROM garr_plot ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_GARR_PLOT, "SELECT ID, Name_lang FROM garr_plot_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// GarrPlotBuilding.db2
|
||||
@@ -270,15 +305,14 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
" FROM garr_site_level_plot_inst ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// GemProperties.db2
|
||||
PrepareStatement(HOTFIX_SEL_GEM_PROPERTIES, "SELECT ID, Type, EnchantID, MinItemLevel, MaxCountInv, MaxCountItem FROM gem_properties"
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PrepareStatement(HOTFIX_SEL_GEM_PROPERTIES, "SELECT ID, Type, EnchantID, MinItemLevel FROM gem_properties ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// GlyphProperties.db2
|
||||
PrepareStatement(HOTFIX_SEL_GLYPH_PROPERTIES, "SELECT ID, SpellID, SpellIconID, Type, GlyphExclusiveCategoryID FROM glyph_properties"
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// GlyphSlot.db2
|
||||
PrepareStatement(HOTFIX_SEL_GLYPH_SLOT, "SELECT ID, Type, Tooltip FROM glyph_slot ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PrepareStatement(HOTFIX_SEL_GLYPH_SLOT, "SELECT ID, Tooltip, Type FROM glyph_slot ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// GuildColorBackground.db2
|
||||
PrepareStatement(HOTFIX_SEL_GUILD_COLOR_BACKGROUND, "SELECT ID, Red, Green, Blue FROM guild_color_background ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
@@ -290,7 +324,7 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(HOTFIX_SEL_GUILD_COLOR_EMBLEM, "SELECT ID, Red, Green, Blue FROM guild_color_emblem ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// GuildPerkSpells.db2
|
||||
PrepareStatement(HOTFIX_SEL_GUILD_PERK_SPELLS, "SELECT ID, SpellID, GuildLevel FROM guild_perk_spells ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PrepareStatement(HOTFIX_SEL_GUILD_PERK_SPELLS, "SELECT ID, SpellID FROM guild_perk_spells ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// Heirloom.db2
|
||||
PrepareStatement(HOTFIX_SEL_HEIRLOOM, "SELECT ID, ItemID, SourceText, OldItem1, OldItem2, NextDifficultyItemID, UpgradeItemID1, UpgradeItemID2, "
|
||||
@@ -322,7 +356,8 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
" FROM item ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// ItemAppearance.db2
|
||||
PrepareStatement(HOTFIX_SEL_ITEM_APPEARANCE, "SELECT ID, DisplayID, IconFileDataID, ObjectComponentSlot FROM item_appearance ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PrepareStatement(HOTFIX_SEL_ITEM_APPEARANCE, "SELECT ID, DisplayID, IconFileDataID, UIOrder, ObjectComponentSlot FROM item_appearance"
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// ItemArmorQuality.db2
|
||||
PrepareStatement(HOTFIX_SEL_ITEM_ARMOR_QUALITY, "SELECT ID, QualityMod1, QualityMod2, QualityMod3, QualityMod4, QualityMod5, QualityMod6, "
|
||||
@@ -393,8 +428,8 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_ITEM_LIMIT_CATEGORY, "SELECT ID, Name_lang FROM item_limit_category_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// ItemModifiedAppearance.db2
|
||||
PrepareStatement(HOTFIX_SEL_ITEM_MODIFIED_APPEARANCE, "SELECT ID, ItemID, AppearanceID, AppearanceModID, `Index` FROM item_modified_appearance"
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PrepareStatement(HOTFIX_SEL_ITEM_MODIFIED_APPEARANCE, "SELECT ID, ItemID, AppearanceID, AppearanceModID, `Index`, SourceType"
|
||||
" FROM item_modified_appearance ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// ItemPriceBase.db2
|
||||
PrepareStatement(HOTFIX_SEL_ITEM_PRICE_BASE, "SELECT ID, ArmorFactor, WeaponFactor, ItemLevel FROM item_price_base ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
@@ -411,7 +446,7 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
|
||||
// ItemSet.db2
|
||||
PrepareStatement(HOTFIX_SEL_ITEM_SET, "SELECT ID, Name, ItemID1, ItemID2, ItemID3, ItemID4, ItemID5, ItemID6, ItemID7, ItemID8, ItemID9, "
|
||||
"ItemID10, ItemID11, ItemID12, ItemID13, ItemID14, ItemID15, ItemID16, ItemID17, RequiredSkillRank, RequiredSkill FROM item_set"
|
||||
"ItemID10, ItemID11, ItemID12, ItemID13, ItemID14, ItemID15, ItemID16, ItemID17, Unknown703, RequiredSkillRank, RequiredSkill FROM item_set"
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_ITEM_SET, "SELECT ID, Name_lang FROM item_set_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
@@ -431,7 +466,8 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
"HolidayID, ItemNameDescriptionID, Quality, BuyCount, InventoryType, RequiredLevel, RequiredHonorRank, RequiredCityRank, "
|
||||
"RequiredReputationRank, ContainerSlots, ItemStatType1, ItemStatType2, ItemStatType3, ItemStatType4, ItemStatType5, ItemStatType6, "
|
||||
"ItemStatType7, ItemStatType8, ItemStatType9, ItemStatType10, DamageType, Bonding, LanguageID, PageMaterial, Material, Sheath, TotemCategory, "
|
||||
"SocketColor1, SocketColor2, SocketColor3, CurrencySubstitutionID, CurrencySubstitutionCount, ArtifactID FROM item_sparse ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
"SocketColor1, SocketColor2, SocketColor3, CurrencySubstitutionID, CurrencySubstitutionCount, ArtifactID, RequiredExpansion FROM item_sparse"
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_ITEM_SPARSE, "SELECT ID, Name_lang, Name2_lang, Name3_lang, Name4_lang, Description_lang FROM item_sparse_locale"
|
||||
" WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
@@ -442,9 +478,6 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
// ItemSpecOverride.db2
|
||||
PrepareStatement(HOTFIX_SEL_ITEM_SPEC_OVERRIDE, "SELECT ID, ItemID, SpecID FROM item_spec_override ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// ItemToBattlePetSpecies.db2
|
||||
PrepareStatement(HOTFIX_SEL_ITEM_TO_BATTLE_PET_SPECIES, "SELECT ID, BattlePetSpeciesID FROM item_to_battle_pet_species ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// ItemXBonusTree.db2
|
||||
PrepareStatement(HOTFIX_SEL_ITEM_X_BONUS_TREE, "SELECT ID, ItemID, BonusTreeID FROM item_x_bonus_tree ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
@@ -453,6 +486,25 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
"Key15, Key16, Key17, Key18, Key19, Key20, Key21, Key22, Key23, Key24, Key25, Key26, Key27, Key28, Key29, Key30, Key31, Key32 FROM key_chain"
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// LfgDungeons.db2
|
||||
PrepareStatement(HOTFIX_SEL_LFG_DUNGEONS, "SELECT ID, Name, Flags, TextureFilename, Description, MaxLevel, TargetLevelMax, MapID, RandomID, "
|
||||
"ScenarioID, LastBossJournalEncounterID, BonusReputationAmount, MentorItemLevel, MinLevel, TargetLevel, TargetLevelMin, DifficultyID, Type, "
|
||||
"Faction, Expansion, OrderIndex, GroupID, CountTank, CountHealer, CountDamage, MinCountTank, MinCountHealer, MinCountDamage, SubType, "
|
||||
"MentorCharLevel FROM lfg_dungeons ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_LFG_DUNGEONS, "SELECT ID, Name_lang, Description_lang FROM lfg_dungeons_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// Light.db2
|
||||
PrepareStatement(HOTFIX_SEL_LIGHT, "SELECT ID, PosX, PosY, PosZ, FalloffStart, FalloffEnd, MapID, LightParamsID1, LightParamsID2, LightParamsID3, "
|
||||
"LightParamsID4, LightParamsID5, LightParamsID6, LightParamsID7, LightParamsID8 FROM light ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// LiquidType.db2
|
||||
PrepareStatement(HOTFIX_SEL_LIQUID_TYPE, "SELECT ID, Name, SpellID, MaxDarkenDepth, FogDarkenIntensity, AmbDarkenIntensity, DirDarkenIntensity, "
|
||||
"ParticleScale, Texture1, Texture2, Texture3, Texture4, Texture5, Texture6, Color1, Color2, Float1, Float2, Float3, `Float4`, Float5, Float6, "
|
||||
"Float7, `Float8`, Float9, Float10, Float11, Float12, Float13, Float14, Float15, Float16, Float17, Float18, `Int1`, `Int2`, `Int3`, `Int4`, Flags, "
|
||||
"SoundID, Type, LightID, ParticleMovement, ParticleTexSlots, MaterialID, DepthTexCount1, DepthTexCount2, DepthTexCount3, DepthTexCount4, "
|
||||
"DepthTexCount5, DepthTexCount6 FROM liquid_type ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_LIQUID_TYPE, "SELECT ID, Name_lang FROM liquid_type_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// Lock.db2
|
||||
PrepareStatement(HOTFIX_SEL_LOCK, "SELECT ID, Index1, Index2, Index3, Index4, Index5, Index6, Index7, Index8, Skill1, Skill2, Skill3, Skill4, "
|
||||
"Skill5, Skill6, Skill7, Skill8, Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Action1, Action2, Action3, Action4, Action5, "
|
||||
@@ -463,11 +515,16 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_MAIL_TEMPLATE, "SELECT ID, Body_lang FROM mail_template_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// Map.db2
|
||||
PrepareStatement(HOTFIX_SEL_MAP, "SELECT ID, Directory, Flags, MapType, MinimapIconScale, CorpsePosX, CorpsePosY, RaidOffset, MapName, "
|
||||
"MapDescription0, MapDescription1, AreaTableID, LoadingScreenID, CorpseMapID, TimeOfDayOverride, ParentMapID, CosmeticParentMapID, "
|
||||
"InstanceType, unk5, ExpansionID, MaxPlayers, TimeOffset FROM map ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PrepareStatement(HOTFIX_SEL_MAP, "SELECT ID, Directory, Flags, MapType, MinimapIconScale, CorpsePosX, CorpsePosY, MapName, MapDescription0, "
|
||||
"MapDescription1, AreaTableID, LoadingScreenID, CorpseMapID, TimeOfDayOverride, ParentMapID, CosmeticParentMapID, InstanceType, unk5, "
|
||||
"ExpansionID, MaxPlayers, TimeOffset FROM map ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_MAP, "SELECT ID, MapName_lang, MapDescription0_lang, MapDescription1_lang FROM map_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// MapDifficulty.db2
|
||||
PrepareStatement(HOTFIX_SEL_MAP_DIFFICULTY, "SELECT ID, Message, Context, MapID, DifficultyID, RaidDurationType, MaxPlayers, LockID, "
|
||||
"ItemBonusTreeModID FROM map_difficulty ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_MAP_DIFFICULTY, "SELECT ID, Message_lang FROM map_difficulty_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// ModifierTree.db2
|
||||
PrepareStatement(HOTFIX_SEL_MODIFIER_TREE, "SELECT ID, Asset1, Asset2, Parent, Type, Unk700, Operator, Amount FROM modifier_tree ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
@@ -477,8 +534,8 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_MOUNT, "SELECT ID, Name_lang, Description_lang, SourceDescription_lang FROM mount_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// MountCapability.db2
|
||||
PrepareStatement(HOTFIX_SEL_MOUNT_CAPABILITY, "SELECT ID, RequiredSpell, SpeedModSpell, RequiredRidingSkill, RequiredArea, RequiredMap, Flags, "
|
||||
"RequiredAura FROM mount_capability ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PrepareStatement(HOTFIX_SEL_MOUNT_CAPABILITY, "SELECT ID, RequiredAura, RequiredSpell, SpeedModSpell, RequiredRidingSkill, RequiredArea, "
|
||||
"RequiredMap, Flags FROM mount_capability ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// MountTypeXCapability.db2
|
||||
PrepareStatement(HOTFIX_SEL_MOUNT_TYPE_X_CAPABILITY, "SELECT ID, MountTypeID, MountCapabilityID, OrderIndex FROM mount_type_x_capability"
|
||||
@@ -548,7 +605,7 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(HOTFIX_SEL_QUEST_PACKAGE_ITEM, "SELECT ID, ItemID, QuestPackageID, ItemCount, FilterType FROM quest_package_item ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// QuestSort.db2
|
||||
PrepareStatement(HOTFIX_SEL_QUEST_SORT, "SELECT ID, SortName FROM quest_sort ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PrepareStatement(HOTFIX_SEL_QUEST_SORT, "SELECT ID, SortName, SortOrder FROM quest_sort ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_QUEST_SORT, "SELECT ID, SortName_lang FROM quest_sort_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// QuestV2.db2
|
||||
@@ -579,13 +636,13 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// SkillRaceClassInfo.db2
|
||||
PrepareStatement(HOTFIX_SEL_SKILL_RACE_CLASS_INFO, "SELECT ID, RaceMask, SkillID, ClassMask, Flags, SkillTierID, Availability, MinLevel"
|
||||
PrepareStatement(HOTFIX_SEL_SKILL_RACE_CLASS_INFO, "SELECT ID, RaceMask, ClassMask, SkillID, Flags, SkillTierID, Availability, MinLevel"
|
||||
" FROM skill_race_class_info ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// SoundKit.db2
|
||||
PrepareStatement(HOTFIX_SEL_SOUND_KIT, "SELECT ID, SoundType, Name, VolumeFloat, MinDistance, DistanceCutoff, VolumeVariationPlus, "
|
||||
"VolumeVariationMinus, PitchVariationPlus, PitchVariationMinus, PitchAdjust, Flags, SoundEntriesAdvancedID, EAXDef, DialogType, "
|
||||
"BusOverwriteID, Unk700 FROM sound_kit ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PrepareStatement(HOTFIX_SEL_SOUND_KIT, "SELECT ID, Name, VolumeFloat, MinDistance, DistanceCutoff, VolumeVariationPlus, VolumeVariationMinus, "
|
||||
"PitchVariationPlus, PitchVariationMinus, PitchAdjust, Flags, SoundEntriesAdvancedID, BusOverwriteID, SoundType, EAXDef, DialogType, Unk700"
|
||||
" FROM sound_kit ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_SOUND_KIT, "SELECT ID, Name_lang FROM sound_kit_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// SpecializationSpells.db2
|
||||
@@ -620,7 +677,7 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
"DispelType, Mechanic, PreventionType FROM spell_categories ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// SpellCategory.db2
|
||||
PrepareStatement(HOTFIX_SEL_SPELL_CATEGORY, "SELECT ID, Name, ChargeRecoveryTime, Flags, UsesPerWeek, MaxCharges FROM spell_category"
|
||||
PrepareStatement(HOTFIX_SEL_SPELL_CATEGORY, "SELECT ID, Name, ChargeRecoveryTime, Unk703, Flags, UsesPerWeek, MaxCharges FROM spell_category"
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_SPELL_CATEGORY, "SELECT ID, Name_lang FROM spell_category_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
@@ -658,6 +715,13 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(HOTFIX_SEL_SPELL_INTERRUPTS, "SELECT ID, SpellID, AuraInterruptFlags1, AuraInterruptFlags2, ChannelInterruptFlags1, "
|
||||
"ChannelInterruptFlags2, InterruptFlags, DifficultyID FROM spell_interrupts ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// SpellItemEnchantment.db2
|
||||
PrepareStatement(HOTFIX_SEL_SPELL_ITEM_ENCHANTMENT, "SELECT ID, EffectSpellID1, EffectSpellID2, EffectSpellID3, Name, EffectScalingPoints1, "
|
||||
"EffectScalingPoints2, EffectScalingPoints3, PlayerConditionID, TransmogCost, TextureFileDataID, EffectPointsMin1, EffectPointsMin2, "
|
||||
"EffectPointsMin3, ItemVisual, Flags, RequiredSkillID, RequiredSkillRank, ItemLevel, Charges, Effect1, Effect2, Effect3, ConditionID, "
|
||||
"MinLevel, MaxLevel, ScalingClass, ScalingClassRestricted FROM spell_item_enchantment ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_SPELL_ITEM_ENCHANTMENT, "SELECT ID, Name_lang FROM spell_item_enchantment_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// SpellItemEnchantmentCondition.db2
|
||||
PrepareStatement(HOTFIX_SEL_SPELL_ITEM_ENCHANTMENT_CONDITION, "SELECT ID, LTOperandType1, LTOperandType2, LTOperandType3, LTOperandType4, "
|
||||
"LTOperandType5, LTOperand1, LTOperand2, LTOperand3, LTOperand4, LTOperand5, Operator1, Operator2, Operator3, Operator4, Operator5, "
|
||||
@@ -682,8 +746,8 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
" FROM spell_power ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// SpellPowerDifficulty.db2
|
||||
PrepareStatement(HOTFIX_SEL_SPELL_POWER_DIFFICULTY, "SELECT ID, SpellPowerID, DifficultyID, PowerIndex FROM spell_power_difficulty"
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PrepareStatement(HOTFIX_SEL_SPELL_POWER_DIFFICULTY, "SELECT SpellPowerID, DifficultyID, PowerIndex FROM spell_power_difficulty"
|
||||
" ORDER BY SpellPowerID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// SpellProcsPerMinute.db2
|
||||
PrepareStatement(HOTFIX_SEL_SPELL_PROCS_PER_MINUTE, "SELECT ID, BaseProcRate, Flags FROM spell_procs_per_minute ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
@@ -706,8 +770,8 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// SpellScaling.db2
|
||||
PrepareStatement(HOTFIX_SEL_SPELL_SCALING, "SELECT ID, SpellID, ScalesFromItemLevel, ScalingClass, MaxScalingLevel FROM spell_scaling"
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PrepareStatement(HOTFIX_SEL_SPELL_SCALING, "SELECT ID, SpellID, ScalesFromItemLevel, ScalingClass, MinScalingLevel, MaxScalingLevel"
|
||||
" FROM spell_scaling ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// SpellShapeshift.db2
|
||||
PrepareStatement(HOTFIX_SEL_SPELL_SHAPESHIFT, "SELECT ID, SpellID, ShapeshiftExclude1, ShapeshiftExclude2, ShapeshiftMask1, ShapeshiftMask2, "
|
||||
@@ -735,6 +799,11 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
// SummonProperties.db2
|
||||
PrepareStatement(HOTFIX_SEL_SUMMON_PROPERTIES, "SELECT ID, Category, Faction, Type, Slot, Flags FROM summon_properties ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// Talent.db2
|
||||
PrepareStatement(HOTFIX_SEL_TALENT, "SELECT ID, SpellID, OverridesSpellID, Description, SpecID, TierID, ColumnIndex, Flags, CategoryMask1, "
|
||||
"CategoryMask2, ClassID FROM talent ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_TALENT, "SELECT ID, Description_lang FROM talent_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// TaxiNodes.db2
|
||||
PrepareStatement(HOTFIX_SEL_TAXI_NODES, "SELECT ID, PosX, PosY, PosZ, Name, MountCreatureID1, MountCreatureID2, MapOffsetX, MapOffsetY, MapID, "
|
||||
"ConditionID, LearnableIndex, Flags FROM taxi_nodes ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
@@ -769,24 +838,45 @@ void HotfixDatabaseConnection::DoPrepareStatements()
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_UNIT_POWER_BAR, "SELECT ID, Name_lang, Cost_lang, OutOfError_lang, ToolTip_lang FROM unit_power_bar_locale"
|
||||
" WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// Vehicle.db2
|
||||
PrepareStatement(HOTFIX_SEL_VEHICLE, "SELECT ID, Flags, TurnSpeed, PitchSpeed, PitchMin, PitchMax, MouseLookOffsetPitch, CameraFadeDistScalarMin, "
|
||||
"CameraFadeDistScalarMax, CameraPitchOffset, FacingLimitRight, FacingLimitLeft, MsslTrgtTurnLingering, MsslTrgtPitchLingering, "
|
||||
"MsslTrgtMouseLingering, MsslTrgtEndOpacity, MsslTrgtArcSpeed, MsslTrgtArcRepeat, MsslTrgtArcWidth, MsslTrgtImpactRadius1, "
|
||||
"MsslTrgtImpactRadius2, MsslTrgtArcTexture, MsslTrgtImpactTexture, MsslTrgtImpactModel1, MsslTrgtImpactModel2, CameraYawOffset, "
|
||||
"MsslTrgtImpactTexRadius, SeatID1, SeatID2, SeatID3, SeatID4, SeatID5, SeatID6, SeatID7, SeatID8, VehicleUIIndicatorID, PowerDisplayID1, "
|
||||
"PowerDisplayID2, PowerDisplayID3, FlagsB, UILocomotionType FROM vehicle ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// VehicleSeat.db2
|
||||
PrepareStatement(HOTFIX_SEL_VEHICLE_SEAT, "SELECT ID, Flags1, Flags2, Flags3, AttachmentOffsetX, AttachmentOffsetY, AttachmentOffsetZ, "
|
||||
"EnterPreDelay, EnterSpeed, EnterGravity, EnterMinDuration, EnterMaxDuration, EnterMinArcHeight, EnterMaxArcHeight, ExitPreDelay, ExitSpeed, "
|
||||
"ExitGravity, ExitMinDuration, ExitMaxDuration, ExitMinArcHeight, ExitMaxArcHeight, PassengerYaw, PassengerPitch, PassengerRoll, "
|
||||
"VehicleEnterAnimDelay, VehicleExitAnimDelay, CameraEnteringDelay, CameraEnteringDuration, CameraExitingDelay, CameraExitingDuration, "
|
||||
"CameraOffsetX, CameraOffsetY, CameraOffsetZ, CameraPosChaseRate, CameraFacingChaseRate, CameraEnteringZoom, CameraSeatZoomMin, "
|
||||
"CameraSeatZoomMax, UISkinFileDataID, EnterAnimStart, EnterAnimLoop, RideAnimStart, RideAnimLoop, RideUpperAnimStart, RideUpperAnimLoop, "
|
||||
"ExitAnimStart, ExitAnimLoop, ExitAnimEnd, VehicleEnterAnim, VehicleExitAnim, VehicleRideAnimLoop, EnterUISoundID, ExitUISoundID, "
|
||||
"EnterAnimKitID, RideAnimKitID, ExitAnimKitID, VehicleEnterAnimKitID, VehicleRideAnimKitID, VehicleExitAnimKitID, CameraModeID, AttachmentID, "
|
||||
"VehicleEnterAnimDelay, VehicleExitAnimDelay, EnterUISoundID, ExitUISoundID, CameraEnteringDelay, CameraEnteringDuration, CameraExitingDelay, "
|
||||
"CameraExitingDuration, CameraOffsetX, CameraOffsetY, CameraOffsetZ, CameraPosChaseRate, CameraFacingChaseRate, CameraEnteringZoom, "
|
||||
"CameraSeatZoomMin, CameraSeatZoomMax, UISkinFileDataID, EnterAnimStart, EnterAnimLoop, RideAnimStart, RideAnimLoop, RideUpperAnimStart, "
|
||||
"RideUpperAnimLoop, ExitAnimStart, ExitAnimLoop, ExitAnimEnd, VehicleEnterAnim, VehicleExitAnim, VehicleRideAnimLoop, EnterAnimKitID, "
|
||||
"RideAnimKitID, ExitAnimKitID, VehicleEnterAnimKitID, VehicleRideAnimKitID, VehicleExitAnimKitID, CameraModeID, AttachmentID, "
|
||||
"PassengerAttachmentID, VehicleEnterAnimBone, VehicleExitAnimBone, VehicleRideAnimLoopBone, VehicleAbilityDisplay FROM vehicle_seat"
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// WmoAreaTable.db2
|
||||
PrepareStatement(HOTFIX_SEL_WMO_AREA_TABLE, "SELECT ID, WMOGroupID, AreaName, WMOID, AmbienceID, ZoneMusic, IntroSound, AreaTableID, "
|
||||
"UWIntroSound, UWAmbience, NameSet, SoundProviderPref, SoundProviderPrefUnderwater, Flags, UWZoneMusic FROM wmo_area_table ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_WMO_AREA_TABLE, "SELECT ID, AreaName_lang FROM wmo_area_table_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
|
||||
// WorldMapArea.db2
|
||||
PrepareStatement(HOTFIX_SEL_WORLD_MAP_AREA, "SELECT ID, AreaName, LocLeft, LocRight, LocTop, LocBottom, MapID, AreaID, DisplayMapID, "
|
||||
"DefaultDungeonFloor, ParentWorldMapID, Flags, PlayerConditionID, LevelRangeMin, LevelRangeMax FROM world_map_area ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// WorldMapOverlay.db2
|
||||
PrepareStatement(HOTFIX_SEL_WORLD_MAP_OVERLAY, "SELECT ID, TextureName, MapAreaID, AreaID1, AreaID2, AreaID3, AreaID4, TextureWidth, "
|
||||
"TextureHeight, OffsetX, OffsetY, HitRectTop, HitRectLeft, HitRectBottom, HitRectRight, PlayerConditionID FROM world_map_overlay"
|
||||
"TextureHeight, OffsetX, OffsetY, HitRectTop, HitRectLeft, HitRectBottom, HitRectRight, PlayerConditionID, Flags FROM world_map_overlay"
|
||||
" ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// WorldMapTransforms.db2
|
||||
PrepareStatement(HOTFIX_SEL_WORLD_MAP_TRANSFORMS, "SELECT ID, RegionMinX, RegionMinY, RegionMinZ, RegionMaxX, RegionMaxY, RegionMaxZ, "
|
||||
"RegionOffsetX, RegionOffsetY, RegionScale, MapID, NewMapID, NewDungeonMapID, NewAreaID, Flags FROM world_map_transforms ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
|
||||
// WorldSafeLocs.db2
|
||||
PrepareStatement(HOTFIX_SEL_WORLD_SAFE_LOCS, "SELECT ID, LocX, LocY, LocZ, Facing, AreaName, MapID FROM world_safe_locs ORDER BY ID DESC", CONNECTION_SYNCH);
|
||||
PREPARE_LOCALE_STMT(HOTFIX_SEL_WORLD_SAFE_LOCS, "SELECT ID, AreaName_lang FROM world_safe_locs_locale WHERE locale = ?", CONNECTION_SYNCH);
|
||||
}
|
||||
|
||||
@@ -51,6 +51,8 @@ enum HotfixDatabaseStatements
|
||||
|
||||
HOTFIX_SEL_BANK_BAG_SLOT_PRICES,
|
||||
|
||||
HOTFIX_SEL_BANNED_ADDONS,
|
||||
|
||||
HOTFIX_SEL_BARBER_SHOP_STYLE,
|
||||
HOTFIX_SEL_BARBER_SHOP_STYLE_LOCALE,
|
||||
|
||||
@@ -63,9 +65,14 @@ enum HotfixDatabaseStatements
|
||||
|
||||
HOTFIX_SEL_BATTLE_PET_SPECIES_STATE,
|
||||
|
||||
HOTFIX_SEL_BATTLEMASTER_LIST,
|
||||
HOTFIX_SEL_BATTLEMASTER_LIST_LOCALE,
|
||||
|
||||
HOTFIX_SEL_BROADCAST_TEXT,
|
||||
HOTFIX_SEL_BROADCAST_TEXT_LOCALE,
|
||||
|
||||
HOTFIX_SEL_CHAR_SECTIONS,
|
||||
|
||||
HOTFIX_SEL_CHAR_START_OUTFIT,
|
||||
|
||||
HOTFIX_SEL_CHAR_TITLES,
|
||||
@@ -74,6 +81,9 @@ enum HotfixDatabaseStatements
|
||||
HOTFIX_SEL_CHAT_CHANNELS,
|
||||
HOTFIX_SEL_CHAT_CHANNELS_LOCALE,
|
||||
|
||||
HOTFIX_SEL_CHR_CLASSES,
|
||||
HOTFIX_SEL_CHR_CLASSES_LOCALE,
|
||||
|
||||
HOTFIX_SEL_CHR_CLASSES_X_POWER_TYPES,
|
||||
|
||||
HOTFIX_SEL_CHR_RACES,
|
||||
@@ -91,6 +101,8 @@ enum HotfixDatabaseStatements
|
||||
HOTFIX_SEL_CREATURE_FAMILY,
|
||||
HOTFIX_SEL_CREATURE_FAMILY_LOCALE,
|
||||
|
||||
HOTFIX_SEL_CREATURE_MODEL_DATA,
|
||||
|
||||
HOTFIX_SEL_CREATURE_TYPE,
|
||||
HOTFIX_SEL_CREATURE_TYPE_LOCALE,
|
||||
|
||||
@@ -123,14 +135,16 @@ enum HotfixDatabaseStatements
|
||||
|
||||
HOTFIX_SEL_EMOTES_TEXT_SOUND,
|
||||
|
||||
HOTFIX_SEL_FACTION,
|
||||
HOTFIX_SEL_FACTION_LOCALE,
|
||||
|
||||
HOTFIX_SEL_FACTION_TEMPLATE,
|
||||
|
||||
HOTFIX_SEL_GAMEOBJECTS,
|
||||
HOTFIX_SEL_GAMEOBJECTS_LOCALE,
|
||||
|
||||
HOTFIX_SEL_GAMEOBJECT_DISPLAY_INFO,
|
||||
|
||||
HOTFIX_SEL_GAME_TABLES,
|
||||
HOTFIX_SEL_GAME_TABLES_LOCALE,
|
||||
|
||||
HOTFIX_SEL_GARR_ABILITY,
|
||||
HOTFIX_SEL_GARR_ABILITY_LOCALE,
|
||||
|
||||
@@ -249,12 +263,18 @@ enum HotfixDatabaseStatements
|
||||
|
||||
HOTFIX_SEL_ITEM_SPEC_OVERRIDE,
|
||||
|
||||
HOTFIX_SEL_ITEM_TO_BATTLE_PET_SPECIES,
|
||||
|
||||
HOTFIX_SEL_ITEM_X_BONUS_TREE,
|
||||
|
||||
HOTFIX_SEL_KEY_CHAIN,
|
||||
|
||||
HOTFIX_SEL_LFG_DUNGEONS,
|
||||
HOTFIX_SEL_LFG_DUNGEONS_LOCALE,
|
||||
|
||||
HOTFIX_SEL_LIGHT,
|
||||
|
||||
HOTFIX_SEL_LIQUID_TYPE,
|
||||
HOTFIX_SEL_LIQUID_TYPE_LOCALE,
|
||||
|
||||
HOTFIX_SEL_LOCK,
|
||||
|
||||
HOTFIX_SEL_MAIL_TEMPLATE,
|
||||
@@ -263,6 +283,9 @@ enum HotfixDatabaseStatements
|
||||
HOTFIX_SEL_MAP,
|
||||
HOTFIX_SEL_MAP_LOCALE,
|
||||
|
||||
HOTFIX_SEL_MAP_DIFFICULTY,
|
||||
HOTFIX_SEL_MAP_DIFFICULTY_LOCALE,
|
||||
|
||||
HOTFIX_SEL_MODIFIER_TREE,
|
||||
|
||||
HOTFIX_SEL_MOUNT,
|
||||
@@ -359,6 +382,9 @@ enum HotfixDatabaseStatements
|
||||
|
||||
HOTFIX_SEL_SPELL_INTERRUPTS,
|
||||
|
||||
HOTFIX_SEL_SPELL_ITEM_ENCHANTMENT,
|
||||
HOTFIX_SEL_SPELL_ITEM_ENCHANTMENT_LOCALE,
|
||||
|
||||
HOTFIX_SEL_SPELL_ITEM_ENCHANTMENT_CONDITION,
|
||||
|
||||
HOTFIX_SEL_SPELL_LEARN_SPELL,
|
||||
@@ -397,6 +423,9 @@ enum HotfixDatabaseStatements
|
||||
|
||||
HOTFIX_SEL_SUMMON_PROPERTIES,
|
||||
|
||||
HOTFIX_SEL_TALENT,
|
||||
HOTFIX_SEL_TALENT_LOCALE,
|
||||
|
||||
HOTFIX_SEL_TAXI_NODES,
|
||||
HOTFIX_SEL_TAXI_NODES_LOCALE,
|
||||
|
||||
@@ -417,12 +446,22 @@ enum HotfixDatabaseStatements
|
||||
HOTFIX_SEL_UNIT_POWER_BAR,
|
||||
HOTFIX_SEL_UNIT_POWER_BAR_LOCALE,
|
||||
|
||||
HOTFIX_SEL_VEHICLE,
|
||||
|
||||
HOTFIX_SEL_VEHICLE_SEAT,
|
||||
|
||||
HOTFIX_SEL_WMO_AREA_TABLE,
|
||||
HOTFIX_SEL_WMO_AREA_TABLE_LOCALE,
|
||||
|
||||
HOTFIX_SEL_WORLD_MAP_AREA,
|
||||
|
||||
HOTFIX_SEL_WORLD_MAP_OVERLAY,
|
||||
|
||||
HOTFIX_SEL_WORLD_MAP_TRANSFORMS,
|
||||
|
||||
HOTFIX_SEL_WORLD_SAFE_LOCS,
|
||||
HOTFIX_SEL_WORLD_SAFE_LOCS_LOCALE,
|
||||
|
||||
MAX_HOTFIXDATABASE_STATEMENTS
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "AddonMgr.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCStores.h"
|
||||
#include "DB2Stores.h"
|
||||
#include "Log.h"
|
||||
#include "Timer.h"
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCStores.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "AuctionHouseMgr.h"
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCStructure.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include "AuctionHousePackets.h"
|
||||
#include <set>
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
#include "Log.h"
|
||||
#include "DBCStores.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "AuctionHouseMgr.h"
|
||||
#include "AuctionHouseBotSeller.h"
|
||||
|
||||
@@ -446,7 +446,7 @@ bool BattlegroundMgr::CreateBattleground(BattlegroundTemplate const* bgTemplate)
|
||||
}
|
||||
|
||||
bg->SetMapId(bgTemplate->BattlemasterEntry->MapID[0]);
|
||||
bg->SetName(bgTemplate->BattlemasterEntry->Name_lang);
|
||||
bg->SetName(bgTemplate->BattlemasterEntry->Name->Str[sWorld->GetDefaultDbcLocale()]);
|
||||
bg->SetInstanceID(0);
|
||||
bg->SetArenaorBGType(bgTemplate->IsArena());
|
||||
bg->SetMinPlayersPerTeam(bgTemplate->MinPlayersPerTeam);
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "SpellMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "DBCStores.h"
|
||||
#include "AchievementMgr.h"
|
||||
|
||||
// Supported shift-links (client generated and server side)
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "HostileRefManager.h"
|
||||
#include "ThreatManager.h"
|
||||
#include "Unit.h"
|
||||
#include "DBCStructure.h"
|
||||
#include "SpellInfo.h"
|
||||
|
||||
HostileRefManager::~HostileRefManager()
|
||||
|
||||
@@ -144,11 +144,11 @@ void LoadDisables()
|
||||
break;
|
||||
case MAP_INSTANCE:
|
||||
case MAP_RAID:
|
||||
if (flags & DUNGEON_STATUSFLAG_HEROIC && !GetMapDifficultyData(entry, DIFFICULTY_HEROIC))
|
||||
if (flags & DUNGEON_STATUSFLAG_HEROIC && !sDB2Manager.GetMapDifficultyData(entry, DIFFICULTY_HEROIC))
|
||||
flags -= DUNGEON_STATUSFLAG_HEROIC;
|
||||
if (flags & RAID_STATUSFLAG_10MAN_HEROIC && !GetMapDifficultyData(entry, DIFFICULTY_10_HC))
|
||||
if (flags & RAID_STATUSFLAG_10MAN_HEROIC && !sDB2Manager.GetMapDifficultyData(entry, DIFFICULTY_10_HC))
|
||||
flags -= RAID_STATUSFLAG_10MAN_HEROIC;
|
||||
if (flags & RAID_STATUSFLAG_25MAN_HEROIC && !GetMapDifficultyData(entry, DIFFICULTY_25_HC))
|
||||
if (flags & RAID_STATUSFLAG_25MAN_HEROIC && !sDB2Manager.GetMapDifficultyData(entry, DIFFICULTY_25_HC))
|
||||
flags -= RAID_STATUSFLAG_25MAN_HEROIC;
|
||||
if (!flags)
|
||||
isFlagInvalid = true;
|
||||
@@ -334,7 +334,7 @@ bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags
|
||||
{
|
||||
uint8 disabledModes = itr->second.flags;
|
||||
Difficulty targetDifficulty = player->GetDifficultyID(mapEntry);
|
||||
GetDownscaledMapDifficultyData(entry, targetDifficulty);
|
||||
sDB2Manager.GetDownscaledMapDifficultyData(entry, targetDifficulty);
|
||||
switch (targetDifficulty)
|
||||
{
|
||||
case DIFFICULTY_NORMAL:
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
#include "DB2Stores.h"
|
||||
#include "Common.h"
|
||||
#include "Containers.h"
|
||||
#include "DBCStores.h"
|
||||
#include "DB2fmt.h"
|
||||
#include "HotfixDatabase.h"
|
||||
#include "Log.h"
|
||||
#include "TransportMgr.h"
|
||||
#include "World.h"
|
||||
@@ -32,15 +32,19 @@ DB2Storage<AreaTriggerEntry> sAreaTriggerStore("AreaTrigger.d
|
||||
DB2Storage<ArmorLocationEntry> sArmorLocationStore("ArmorLocation.db2", ArmorLocationFormat, HOTFIX_SEL_ARMOR_LOCATION);
|
||||
DB2Storage<AuctionHouseEntry> sAuctionHouseStore("AuctionHouse.db2", AuctionHouseFormat, HOTFIX_SEL_AUCTION_HOUSE);
|
||||
DB2Storage<BankBagSlotPricesEntry> sBankBagSlotPricesStore("BankBagSlotPrices.db2", BankBagSlotPricesFormat, HOTFIX_SEL_BANK_BAG_SLOT_PRICES);
|
||||
DB2Storage<BannedAddOnsEntry> sBannedAddOnsStore("BannedAddOns.db2", BannedAddOnsFormat, HOTFIX_SEL_BANNED_ADDONS);
|
||||
DB2Storage<BarberShopStyleEntry> sBarberShopStyleStore("BarberShopStyle.db2", BarberShopStyleFormat, HOTFIX_SEL_BARBER_SHOP_STYLE);
|
||||
DB2Storage<BattlePetBreedQualityEntry> sBattlePetBreedQualityStore("BattlePetBreedQuality.db2", BattlePetBreedQualityFormat, HOTFIX_SEL_BATTLE_PET_BREED_QUALITY);
|
||||
DB2Storage<BattlePetBreedStateEntry> sBattlePetBreedStateStore("BattlePetBreedState.db2", BattlePetBreedStateFormat, HOTFIX_SEL_BATTLE_PET_BREED_STATE);
|
||||
DB2Storage<BattlePetSpeciesEntry> sBattlePetSpeciesStore("BattlePetSpecies.db2", BattlePetSpeciesFormat, HOTFIX_SEL_BATTLE_PET_SPECIES);
|
||||
DB2Storage<BattlePetSpeciesStateEntry> sBattlePetSpeciesStateStore("BattlePetSpeciesState.db2", BattlePetSpeciesStateFormat, HOTFIX_SEL_BATTLE_PET_SPECIES_STATE);
|
||||
DB2Storage<BattlemasterListEntry> sBattlemasterListStore("BattlemasterList.db2", BattlemasterListFormat, HOTFIX_SEL_BATTLEMASTER_LIST);
|
||||
DB2Storage<BroadcastTextEntry> sBroadcastTextStore("BroadcastText.db2", BroadcastTextFormat, HOTFIX_SEL_BROADCAST_TEXT);
|
||||
DB2Storage<ChatChannelsEntry> sChatChannelsStore("ChatChannels.db2", ChatChannelsFormat, HOTFIX_SEL_CHAT_CHANNELS);
|
||||
DB2Storage<CharSectionsEntry> sCharSectionsStore("CharSections.db2", CharSectionsFormat, HOTFIX_SEL_CHAR_SECTIONS);
|
||||
DB2Storage<CharStartOutfitEntry> sCharStartOutfitStore("CharStartOutfit.db2", CharStartOutfitFormat, HOTFIX_SEL_CHAR_START_OUTFIT);
|
||||
DB2Storage<CharTitlesEntry> sCharTitlesStore("CharTitles.db2", CharTitlesFormat, HOTFIX_SEL_CHAR_TITLES);
|
||||
DB2Storage<ChatChannelsEntry> sChatChannelsStore("ChatChannels.db2", ChatChannelsFormat, HOTFIX_SEL_CHAT_CHANNELS);
|
||||
DB2Storage<ChrClassesEntry> sChrClassesStore("ChrClasses.db2", ChrClassesFormat, HOTFIX_SEL_CHR_CLASSES);
|
||||
DB2Storage<ChrClassesXPowerTypesEntry> sChrClassesXPowerTypesStore("ChrClassesXPowerTypes.db2", ChrClassesXPowerTypesFormat, HOTFIX_SEL_CHR_CLASSES_X_POWER_TYPES);
|
||||
DB2Storage<ChrRacesEntry> sChrRacesStore("ChrRaces.db2", ChrRacesFormat, HOTFIX_SEL_CHR_RACES);
|
||||
DB2Storage<ChrSpecializationEntry> sChrSpecializationStore("ChrSpecialization.db2", ChrSpecializationFormat, HOTFIX_SEL_CHR_SPECIALIZATION);
|
||||
@@ -48,6 +52,7 @@ DB2Storage<CinematicSequencesEntry> sCinematicSequencesStore("Cinema
|
||||
DB2Storage<CreatureDisplayInfoEntry> sCreatureDisplayInfoStore("CreatureDisplayInfo.db2", CreatureDisplayInfoFormat, HOTFIX_SEL_CREATURE_DISPLAY_INFO);
|
||||
DB2Storage<CreatureDisplayInfoExtraEntry> sCreatureDisplayInfoExtraStore("CreatureDisplayInfoExtra.db2", CreatureDisplayInfoExtraFormat, HOTFIX_SEL_CREATURE_DISPLAY_INFO_EXTRA);
|
||||
DB2Storage<CreatureFamilyEntry> sCreatureFamilyStore("CreatureFamily.db2", CreatureFamilyFormat, HOTFIX_SEL_CREATURE_FAMILY);
|
||||
DB2Storage<CreatureModelDataEntry> sCreatureModelDataStore("CreatureModelData.db2", CreatureModelDataFormat, HOTFIX_SEL_CREATURE_MODEL_DATA);
|
||||
DB2Storage<CreatureTypeEntry> sCreatureTypeStore("CreatureType.db2", CreatureTypeFormat, HOTFIX_SEL_CREATURE_TYPE);
|
||||
DB2Storage<CriteriaEntry> sCriteriaStore("Criteria.db2", CriteriaFormat, HOTFIX_SEL_CRITERIA);
|
||||
DB2Storage<CriteriaTreeEntry> sCriteriaTreeStore("CriteriaTree.db2", CriteriaTreeFormat, HOTFIX_SEL_CRITERIA_TREE);
|
||||
@@ -61,9 +66,10 @@ DB2Storage<DurabilityQualityEntry> sDurabilityQualityStore("Durabil
|
||||
DB2Storage<EmotesEntry> sEmotesStore("Emotes.db2", EmotesFormat, HOTFIX_SEL_EMOTES);
|
||||
DB2Storage<EmotesTextEntry> sEmotesTextStore("EmotesText.db2", EmotesTextFormat, HOTFIX_SEL_EMOTES_TEXT);
|
||||
DB2Storage<EmotesTextSoundEntry> sEmotesTextSoundStore("EmotesTextSound.db2", EmotesTextSoundFormat, HOTFIX_SEL_EMOTES_TEXT_SOUND);
|
||||
DB2Storage<FactionEntry> sFactionStore("Faction.db2", FactionFormat, HOTFIX_SEL_FACTION);
|
||||
DB2Storage<FactionTemplateEntry> sFactionTemplateStore("FactionTemplate.db2", FactionTemplateFormat, HOTFIX_SEL_FACTION_TEMPLATE);
|
||||
DB2Storage<GameObjectsEntry> sGameObjectsStore("GameObjects.db2", GameObjectsFormat, HOTFIX_SEL_GAMEOBJECTS);
|
||||
DB2Storage<GameObjectDisplayInfoEntry> sGameObjectDisplayInfoStore("GameObjectDisplayInfo.db2", GameObjectDisplayInfoFormat, HOTFIX_SEL_GAMEOBJECT_DISPLAY_INFO);
|
||||
DB2Storage<GameTablesEntry> sGameTablesStore("GameTables.db2", GameTablesFormat, HOTFIX_SEL_GAME_TABLES);
|
||||
DB2Storage<GarrAbilityEntry> sGarrAbilityStore("GarrAbility.db2", GarrAbilityFormat, HOTFIX_SEL_GARR_ABILITY);
|
||||
DB2Storage<GarrBuildingEntry> sGarrBuildingStore("GarrBuilding.db2", GarrBuildingFormat, HOTFIX_SEL_GARR_BUILDING);
|
||||
DB2Storage<GarrBuildingPlotInstEntry> sGarrBuildingPlotInstStore("GarrBuildingPlotInst.db2", GarrBuildingPlotInstFormat, HOTFIX_SEL_GARR_BUILDING_PLOT_INST);
|
||||
@@ -116,12 +122,15 @@ DB2Storage<ItemSetSpellEntry> sItemSetSpellStore("ItemSetSpell
|
||||
DB2SparseStorage<ItemSparseEntry> sItemSparseStore("Item-sparse.db2", ItemSparseFormat, HOTFIX_SEL_ITEM_SPARSE);
|
||||
DB2Storage<ItemSpecEntry> sItemSpecStore("ItemSpec.db2", ItemSpecFormat, HOTFIX_SEL_ITEM_SPEC);
|
||||
DB2Storage<ItemSpecOverrideEntry> sItemSpecOverrideStore("ItemSpecOverride.db2", ItemSpecOverrideFormat, HOTFIX_SEL_ITEM_SPEC_OVERRIDE);
|
||||
DB2Storage<ItemToBattlePetSpeciesEntry> sItemToBattlePetSpeciesStore("ItemToBattlePetSpecies.db2", ItemToBattlePetSpeciesFormat, HOTFIX_SEL_ITEM_TO_BATTLE_PET_SPECIES);
|
||||
DB2Storage<ItemXBonusTreeEntry> sItemXBonusTreeStore("ItemXBonusTree.db2", ItemXBonusTreeFormat, HOTFIX_SEL_ITEM_X_BONUS_TREE);
|
||||
DB2Storage<KeyChainEntry> sKeyChainStore("KeyChain.db2", KeyChainFormat, HOTFIX_SEL_KEY_CHAIN);
|
||||
DB2Storage<LfgDungeonsEntry> sLfgDungeonsStore("LfgDungeons.db2", LfgDungeonsFormat, HOTFIX_SEL_LFG_DUNGEONS);
|
||||
DB2Storage<LightEntry> sLightStore("Light.db2", LightFormat, HOTFIX_SEL_LIGHT);
|
||||
DB2Storage<LiquidTypeEntry> sLiquidTypeStore("LiquidType.db2", LiquidTypeFormat, HOTFIX_SEL_LIQUID_TYPE);
|
||||
DB2Storage<LockEntry> sLockStore("Lock.db2", LockFormat, HOTFIX_SEL_LOCK);
|
||||
DB2Storage<MailTemplateEntry> sMailTemplateStore("MailTemplate.db2", MailTemplateFormat, HOTFIX_SEL_MAIL_TEMPLATE);
|
||||
DB2Storage<MapEntry> sMapStore("Map.db2", MapFormat, HOTFIX_SEL_MAP);
|
||||
DB2Storage<MapDifficultyEntry> sMapDifficultyStore("MapDifficulty.db2", MapDifficultyFormat, HOTFIX_SEL_MAP_DIFFICULTY);
|
||||
DB2Storage<ModifierTreeEntry> sModifierTreeStore("ModifierTree.db2", ModifierTreeFormat, HOTFIX_SEL_MODIFIER_TREE);
|
||||
DB2Storage<MountCapabilityEntry> sMountCapabilityStore("MountCapability.db2", MountCapabilityFormat, HOTFIX_SEL_MOUNT_CAPABILITY);
|
||||
DB2Storage<MountEntry> sMountStore("Mount.db2", MountFormat, HOTFIX_SEL_MOUNT);
|
||||
@@ -165,6 +174,7 @@ DB2Storage<SpellEffectScalingEntry> sSpellEffectScalingStore("SpellE
|
||||
DB2Storage<SpellEquippedItemsEntry> sSpellEquippedItemsStore("SpellEquippedItems.db2", SpellEquippedItemsFormat, HOTFIX_SEL_SPELL_EQUIPPED_ITEMS);
|
||||
DB2Storage<SpellFocusObjectEntry> sSpellFocusObjectStore("SpellFocusObject.db2", SpellFocusObjectFormat, HOTFIX_SEL_SPELL_FOCUS_OBJECT);
|
||||
DB2Storage<SpellInterruptsEntry> sSpellInterruptsStore("SpellInterrupts.db2", SpellInterruptsFormat, HOTFIX_SEL_SPELL_INTERRUPTS);
|
||||
DB2Storage<SpellItemEnchantmentEntry> sSpellItemEnchantmentStore("SpellItemEnchantment.db2", SpellItemEnchantmentFormat, HOTFIX_SEL_SPELL_ITEM_ENCHANTMENT);
|
||||
DB2Storage<SpellItemEnchantmentConditionEntry> sSpellItemEnchantmentConditionStore("SpellItemEnchantmentCondition.db2", SpellItemEnchantmentConditionFormat, HOTFIX_SEL_SPELL_ITEM_ENCHANTMENT_CONDITION);
|
||||
DB2Storage<SpellLearnSpellEntry> sSpellLearnSpellStore("SpellLearnSpell.db2", SpellLearnSpellFormat, HOTFIX_SEL_SPELL_LEARN_SPELL);
|
||||
DB2Storage<SpellLevelsEntry> sSpellLevelsStore("SpellLevels.db2", SpellLevelsFormat, HOTFIX_SEL_SPELL_LEVELS);
|
||||
@@ -183,6 +193,7 @@ DB2Storage<SpellTargetRestrictionsEntry> sSpellTargetRestrictionsStore("S
|
||||
DB2Storage<SpellTotemsEntry> sSpellTotemsStore("SpellTotems.db2", SpellTotemsFormat, HOTFIX_SEL_SPELL_TOTEMS);
|
||||
DB2Storage<SpellXSpellVisualEntry> sSpellXSpellVisualStore("SpellXSpellVisual.db2", SpellXSpellVisualFormat, HOTFIX_SEL_SPELL_X_SPELL_VISUAL);
|
||||
DB2Storage<SummonPropertiesEntry> sSummonPropertiesStore("SummonProperties.db2", SummonPropertiesFormat, HOTFIX_SEL_SUMMON_PROPERTIES);
|
||||
DB2Storage<TalentEntry> sTalentStore("Talent.db2", TalentFormat, HOTFIX_SEL_TALENT);
|
||||
DB2Storage<TaxiNodesEntry> sTaxiNodesStore("TaxiNodes.db2", TaxiNodesFormat, HOTFIX_SEL_TAXI_NODES);
|
||||
DB2Storage<TaxiPathEntry> sTaxiPathStore("TaxiPath.db2", TaxiPathFormat, HOTFIX_SEL_TAXI_PATH);
|
||||
DB2Storage<TaxiPathNodeEntry> sTaxiPathNodeStore("TaxiPathNode.db2", TaxiPathNodeFormat, HOTFIX_SEL_TAXI_PATH_NODE);
|
||||
@@ -191,9 +202,13 @@ DB2Storage<ToyEntry> sToyStore("Toy.db2", ToyFormat,
|
||||
DB2Storage<TransportAnimationEntry> sTransportAnimationStore("TransportAnimation.db2", TransportAnimationFormat, HOTFIX_SEL_TRANSPORT_ANIMATION);
|
||||
DB2Storage<TransportRotationEntry> sTransportRotationStore("TransportRotation.db2", TransportRotationFormat, HOTFIX_SEL_TRANSPORT_ROTATION);
|
||||
DB2Storage<UnitPowerBarEntry> sUnitPowerBarStore("UnitPowerBar.db2", UnitPowerBarFormat, HOTFIX_SEL_UNIT_POWER_BAR);
|
||||
DB2Storage<VehicleEntry> sVehicleStore("Vehicle.db2", VehicleFormat, HOTFIX_SEL_VEHICLE);
|
||||
DB2Storage<VehicleSeatEntry> sVehicleSeatStore("VehicleSeat.db2", VehicleSeatFormat, HOTFIX_SEL_VEHICLE_SEAT);
|
||||
DB2Storage<WMOAreaTableEntry> sWMOAreaTableStore("WMOAreaTable.db2", WMOAreaTableFormat, HOTFIX_SEL_WMO_AREA_TABLE);
|
||||
DB2Storage<WorldMapAreaEntry> sWorldMapAreaStore("WorldMapArea.db2", WorldMapAreaFormat, HOTFIX_SEL_WORLD_MAP_AREA);
|
||||
DB2Storage<WorldMapOverlayEntry> sWorldMapOverlayStore("WorldMapOverlay.db2", WorldMapOverlayFormat, HOTFIX_SEL_WORLD_MAP_OVERLAY);
|
||||
DB2Storage<WorldMapTransformsEntry> sWorldMapTransformsStore("WorldMapTransforms.db2", WorldMapTransformsFormat, HOTFIX_SEL_WORLD_MAP_TRANSFORMS);
|
||||
DB2Storage<WorldSafeLocsEntry> sWorldSafeLocsStore("WorldSafeLocs.db2", WorldSafeLocsFormat, HOTFIX_SEL_WORLD_SAFE_LOCS);
|
||||
|
||||
TaxiMask sTaxiNodesMask;
|
||||
TaxiMask sOldContinentsNodesMask;
|
||||
@@ -216,7 +231,7 @@ inline void LoadDB2(uint32& availableDb2Locales, DB2StoreProblemList& errlist, D
|
||||
|
||||
++DB2FilesCount;
|
||||
|
||||
#define EXPECTED_DB2_BUILD 20950
|
||||
#define EXPECTED_DB2_BUILD 21414
|
||||
|
||||
if (storage->Load(db2Path + localeNames[defaultLocale] + '/', defaultLocale))
|
||||
{
|
||||
@@ -243,7 +258,7 @@ inline void LoadDB2(uint32& availableDb2Locales, DB2StoreProblemList& errlist, D
|
||||
else
|
||||
{
|
||||
// sort problematic db2 to (1) non compatible and (2) nonexistent
|
||||
if (FILE* f = fopen((db2Path + storage->GetFileName()).c_str(), "rb"))
|
||||
if (FILE* f = fopen((db2Path + localeNames[defaultLocale] + '/' + storage->GetFileName()).c_str(), "rb"))
|
||||
{
|
||||
std::ostringstream stream;
|
||||
stream << storage->GetFileName() << " exists, and has " << storage->GetFieldCount() << " field(s) (expected " << strlen(storage->GetFormat())
|
||||
@@ -278,21 +293,25 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
|
||||
LOAD_DB2(sAchievementStore);
|
||||
LOAD_DB2(sAnimKitStore);
|
||||
LOAD_DB2(sArmorLocationStore);
|
||||
LOAD_DB2(sAreaGroupMemberStore);
|
||||
LOAD_DB2(sAreaTableStore);
|
||||
LOAD_DB2(sAreaTriggerStore);
|
||||
LOAD_DB2(sArmorLocationStore);
|
||||
LOAD_DB2(sAuctionHouseStore);
|
||||
LOAD_DB2(sBankBagSlotPricesStore);
|
||||
LOAD_DB2(sBannedAddOnsStore);
|
||||
LOAD_DB2(sBarberShopStyleStore);
|
||||
LOAD_DB2(sBattlePetBreedQualityStore);
|
||||
LOAD_DB2(sBattlePetBreedStateStore);
|
||||
LOAD_DB2(sAuctionHouseStore);
|
||||
LOAD_DB2(sBarberShopStyleStore);
|
||||
LOAD_DB2(sBattlePetSpeciesStore);
|
||||
LOAD_DB2(sBattlePetSpeciesStateStore);
|
||||
LOAD_DB2(sBattlemasterListStore);
|
||||
LOAD_DB2(sBroadcastTextStore);
|
||||
LOAD_DB2(sCharSectionsStore);
|
||||
LOAD_DB2(sCharStartOutfitStore);
|
||||
LOAD_DB2(sCharTitlesStore);
|
||||
LOAD_DB2(sChatChannelsStore);
|
||||
LOAD_DB2(sChrClassesStore);
|
||||
LOAD_DB2(sChrClassesXPowerTypesStore);
|
||||
LOAD_DB2(sChrRacesStore);
|
||||
LOAD_DB2(sChrSpecializationStore);
|
||||
@@ -300,6 +319,7 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
LOAD_DB2(sCreatureDisplayInfoStore);
|
||||
LOAD_DB2(sCreatureDisplayInfoExtraStore);
|
||||
LOAD_DB2(sCreatureFamilyStore);
|
||||
LOAD_DB2(sCreatureModelDataStore);
|
||||
LOAD_DB2(sCreatureTypeStore);
|
||||
LOAD_DB2(sCriteriaStore);
|
||||
LOAD_DB2(sCriteriaTreeStore);
|
||||
@@ -313,20 +333,21 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
LOAD_DB2(sEmotesStore);
|
||||
LOAD_DB2(sEmotesTextStore);
|
||||
LOAD_DB2(sEmotesTextSoundStore);
|
||||
LOAD_DB2(sFactionStore);
|
||||
LOAD_DB2(sFactionTemplateStore);
|
||||
LOAD_DB2(sGameObjectsStore);
|
||||
LOAD_DB2(sGameObjectDisplayInfoStore);
|
||||
LOAD_DB2(sGameTablesStore);
|
||||
LOAD_DB2(sGarrAbilityStore);
|
||||
LOAD_DB2(sGarrBuildingPlotInstStore);
|
||||
LOAD_DB2(sGarrBuildingStore);
|
||||
LOAD_DB2(sGarrBuildingPlotInstStore);
|
||||
LOAD_DB2(sGarrClassSpecStore);
|
||||
LOAD_DB2(sGarrFollowerStore);
|
||||
LOAD_DB2(sGarrFollowerXAbilityStore);
|
||||
LOAD_DB2(sGarrPlotBuildingStore);
|
||||
LOAD_DB2(sGarrPlotInstanceStore);
|
||||
LOAD_DB2(sGarrPlotStore);
|
||||
LOAD_DB2(sGarrSiteLevelPlotInstStore);
|
||||
LOAD_DB2(sGarrPlotInstanceStore);
|
||||
LOAD_DB2(sGarrSiteLevelStore);
|
||||
LOAD_DB2(sGarrSiteLevelPlotInstStore);
|
||||
LOAD_DB2(sGemPropertiesStore);
|
||||
LOAD_DB2(sGlyphPropertiesStore);
|
||||
LOAD_DB2(sGlyphSlotStore);
|
||||
@@ -350,12 +371,13 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
LOAD_DB2(sItemClassStore);
|
||||
LOAD_DB2(sItemCurrencyCostStore);
|
||||
LOAD_DB2(sItemDamageAmmoStore);
|
||||
LOAD_DB2(sItemDamageOneHandCasterStore);
|
||||
LOAD_DB2(sItemDamageOneHandStore);
|
||||
LOAD_DB2(sItemDamageTwoHandCasterStore);
|
||||
LOAD_DB2(sItemDamageOneHandCasterStore);
|
||||
LOAD_DB2(sItemDamageTwoHandStore);
|
||||
LOAD_DB2(sItemDamageTwoHandCasterStore);
|
||||
LOAD_DB2(sItemDisenchantLootStore);
|
||||
LOAD_DB2(sItemEffectStore);
|
||||
LOAD_DB2(sItemStore);
|
||||
LOAD_DB2(sItemExtendedCostStore);
|
||||
LOAD_DB2(sItemLimitCategoryStore);
|
||||
LOAD_DB2(sItemModifiedAppearanceStore);
|
||||
@@ -365,15 +387,17 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
LOAD_DB2(sItemSetStore);
|
||||
LOAD_DB2(sItemSetSpellStore);
|
||||
LOAD_DB2(sItemSparseStore);
|
||||
LOAD_DB2(sItemSpecOverrideStore);
|
||||
LOAD_DB2(sItemSpecStore);
|
||||
LOAD_DB2(sItemStore);
|
||||
LOAD_DB2(sItemToBattlePetSpeciesStore);
|
||||
LOAD_DB2(sItemSpecOverrideStore);
|
||||
LOAD_DB2(sItemXBonusTreeStore);
|
||||
LOAD_DB2(sKeyChainStore);
|
||||
LOAD_DB2(sLfgDungeonsStore);
|
||||
LOAD_DB2(sLightStore);
|
||||
LOAD_DB2(sLiquidTypeStore);
|
||||
LOAD_DB2(sLockStore);
|
||||
LOAD_DB2(sMailTemplateStore);
|
||||
LOAD_DB2(sMapStore);
|
||||
LOAD_DB2(sMapDifficultyStore);
|
||||
LOAD_DB2(sModifierTreeStore);
|
||||
LOAD_DB2(sMountCapabilityStore);
|
||||
LOAD_DB2(sMountStore);
|
||||
@@ -395,6 +419,7 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
LOAD_DB2(sQuestSortStore);
|
||||
LOAD_DB2(sQuestV2Store);
|
||||
LOAD_DB2(sQuestXPStore);
|
||||
LOAD_DB2(sRandPropPointsStore);
|
||||
LOAD_DB2(sScalingStatDistributionStore);
|
||||
LOAD_DB2(sSkillLineStore);
|
||||
LOAD_DB2(sSkillLineAbilityStore);
|
||||
@@ -411,11 +436,12 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
LOAD_DB2(sSpellClassOptionsStore);
|
||||
LOAD_DB2(sSpellCooldownsStore);
|
||||
LOAD_DB2(sSpellDurationStore);
|
||||
LOAD_DB2(sSpellEffectScalingStore);
|
||||
LOAD_DB2(sSpellEffectStore);
|
||||
LOAD_DB2(sSpellEffectScalingStore);
|
||||
LOAD_DB2(sSpellEquippedItemsStore);
|
||||
LOAD_DB2(sSpellFocusObjectStore);
|
||||
LOAD_DB2(sSpellInterruptsStore);
|
||||
LOAD_DB2(sSpellItemEnchantmentStore);
|
||||
LOAD_DB2(sSpellItemEnchantmentConditionStore);
|
||||
LOAD_DB2(sSpellLearnSpellStore);
|
||||
LOAD_DB2(sSpellLevelsStore);
|
||||
@@ -428,29 +454,38 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
LOAD_DB2(sSpellRangeStore);
|
||||
LOAD_DB2(sSpellReagentsStore);
|
||||
LOAD_DB2(sSpellScalingStore);
|
||||
LOAD_DB2(sSpellShapeshiftFormStore);
|
||||
LOAD_DB2(sSpellShapeshiftStore);
|
||||
LOAD_DB2(sSpellShapeshiftFormStore);
|
||||
LOAD_DB2(sSpellTargetRestrictionsStore);
|
||||
LOAD_DB2(sSpellTotemsStore);
|
||||
LOAD_DB2(sSpellXSpellVisualStore);
|
||||
LOAD_DB2(sSummonPropertiesStore);
|
||||
LOAD_DB2(sTalentStore);
|
||||
LOAD_DB2(sTaxiNodesStore);
|
||||
LOAD_DB2(sTaxiPathNodeStore);
|
||||
LOAD_DB2(sTaxiPathStore);
|
||||
LOAD_DB2(sTaxiPathNodeStore);
|
||||
LOAD_DB2(sTotemCategoryStore);
|
||||
LOAD_DB2(sToyStore);
|
||||
LOAD_DB2(sTransportAnimationStore);
|
||||
LOAD_DB2(sTransportRotationStore);
|
||||
LOAD_DB2(sUnitPowerBarStore);
|
||||
LOAD_DB2(sVehicleStore);
|
||||
LOAD_DB2(sVehicleSeatStore);
|
||||
LOAD_DB2(sWMOAreaTableStore);
|
||||
LOAD_DB2(sWorldMapAreaStore);
|
||||
LOAD_DB2(sWorldMapOverlayStore);
|
||||
LOAD_DB2(sWorldMapTransformsStore);
|
||||
LOAD_DB2(sWorldSafeLocsStore);
|
||||
|
||||
#undef LOAD_DB2
|
||||
|
||||
for (AreaGroupMemberEntry const* areaGroupMember : sAreaGroupMemberStore)
|
||||
_areaGroupMembers[areaGroupMember->AreaGroupID].push_back(areaGroupMember->AreaID);
|
||||
|
||||
for (CharSectionsEntry const* charSection : sCharSectionsStore)
|
||||
if (charSection->Race && ((1 << (charSection->Race - 1)) & RACEMASK_ALL_PLAYABLE) != 0) //ignore Nonplayable races
|
||||
_charSections.insert({ charSection->GenType | (charSection->Gender << 8) | (charSection->Race << 16), charSection });
|
||||
|
||||
for (CharStartOutfitEntry const* outfit : sCharStartOutfitStore)
|
||||
_charStartOutfits[outfit->RaceID | (outfit->ClassID << 8) | (outfit->GenderID << 16)] = outfit;
|
||||
|
||||
@@ -476,14 +511,11 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
}
|
||||
|
||||
memset(_chrSpecializationsByIndex, 0, sizeof(_chrSpecializationsByIndex));
|
||||
for (uint32 i = 0; i < sChrSpecializationStore.GetNumRows(); ++i)
|
||||
for (ChrSpecializationEntry const* chrSpec : sChrSpecializationStore)
|
||||
{
|
||||
if (ChrSpecializationEntry const* chrSpec = sChrSpecializationStore.LookupEntry(i))
|
||||
{
|
||||
ASSERT(chrSpec->ClassID < MAX_CLASSES);
|
||||
ASSERT(chrSpec->OrderIndex < MAX_SPECIALIZATIONS);
|
||||
_chrSpecializationsByIndex[chrSpec->ClassID][chrSpec->OrderIndex] = chrSpec;
|
||||
}
|
||||
ASSERT(chrSpec->ClassID < MAX_CLASSES);
|
||||
ASSERT(chrSpec->OrderIndex < MAX_SPECIALIZATIONS);
|
||||
_chrSpecializationsByIndex[chrSpec->ClassID][chrSpec->OrderIndex] = chrSpec;
|
||||
}
|
||||
|
||||
ASSERT(MAX_DIFFICULTY >= sDifficultyStore.GetNumRows(),
|
||||
@@ -493,6 +525,10 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
for (EmotesTextSoundEntry const* emoteTextSound : sEmotesTextSoundStore)
|
||||
_emoteTextSounds[EmotesTextSoundContainer::key_type(emoteTextSound->EmotesTextId, emoteTextSound->RaceId, emoteTextSound->SexId, emoteTextSound->ClassId)] = emoteTextSound;
|
||||
|
||||
for (FactionEntry const* faction : sFactionStore)
|
||||
if (faction->ParentFactionID)
|
||||
_factionTeams[faction->ParentFactionID].push_back(faction->ID);
|
||||
|
||||
for (GameObjectDisplayInfoEntry const* gameObjectDisplayInfo : sGameObjectDisplayInfoStore)
|
||||
{
|
||||
if (gameObjectDisplayInfo->GeoBoxMax.X < gameObjectDisplayInfo->GeoBoxMin.X)
|
||||
@@ -530,11 +566,11 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
if (ItemAppearanceEntry const* appearance = sItemAppearanceStore.LookupEntry(appearanceMod->AppearanceID))
|
||||
_itemDisplayIDs[appearanceMod->ItemID | (appearanceMod->AppearanceModID << 24)] = appearance->DisplayID;
|
||||
|
||||
for (ItemSetSpellEntry const* entry : sItemSetSpellStore)
|
||||
_itemSetSpells[entry->ItemSetID].push_back(entry);
|
||||
for (ItemSetSpellEntry const* itemSetSpell : sItemSetSpellStore)
|
||||
_itemSetSpells[itemSetSpell->ItemSetID].push_back(itemSetSpell);
|
||||
|
||||
for (ItemSpecOverrideEntry const* entry : sItemSpecOverrideStore)
|
||||
_itemSpecOverrides[entry->ItemID].push_back(entry);
|
||||
for (ItemSpecOverrideEntry const* itemSpecOverride : sItemSpecOverrideStore)
|
||||
_itemSpecOverrides[itemSpecOverride->ItemID].push_back(itemSpecOverride);
|
||||
|
||||
for (ItemXBonusTreeEntry const* itemBonusTreeAssignment : sItemXBonusTreeStore)
|
||||
_itemToBonusTree.insert({ itemBonusTreeAssignment->ItemID, itemBonusTreeAssignment->BonusTreeID });
|
||||
@@ -549,14 +585,18 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
_heirloomCurvePoints[curvePoint->CurveID][curvePoint->Index] = curvePoint;
|
||||
}
|
||||
|
||||
for (MapDifficultyEntry const* entry : sMapDifficultyStore)
|
||||
_mapDifficulties[entry->MapID][entry->DifficultyID] = entry;
|
||||
_mapDifficulties[0][0] = _mapDifficulties[1][0]; // map 0 is missing from MapDifficulty.dbc so we cheat a bit
|
||||
|
||||
for (MountEntry const* mount : sMountStore)
|
||||
_mountsBySpellId[mount->SpellId] = mount;
|
||||
|
||||
for (MountTypeXCapabilityEntry const* mount : sMountTypeXCapabilityStore)
|
||||
_mountCapabilitiesByType[mount->MountTypeID].insert(mount);
|
||||
for (MountTypeXCapabilityEntry const* mountTypeCapability : sMountTypeXCapabilityStore)
|
||||
_mountCapabilitiesByType[mountTypeCapability->MountTypeID].insert(mountTypeCapability);
|
||||
|
||||
for (NameGenEntry const* entry : sNameGenStore)
|
||||
_nameGenData[entry->Race][entry->Sex].push_back(entry);
|
||||
for (NameGenEntry const* nameGen : sNameGenStore)
|
||||
_nameGenData[nameGen->Race][nameGen->Sex].push_back(nameGen);
|
||||
|
||||
for (NamesProfanityEntry const* namesProfanity : sNamesProfanityStore)
|
||||
{
|
||||
@@ -633,6 +673,15 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
for (SpellProcsPerMinuteModEntry const* ppmMod : sSpellProcsPerMinuteModStore)
|
||||
_spellProcsPerMinuteMods[ppmMod->SpellProcsPerMinuteID].push_back(ppmMod);
|
||||
|
||||
for (TalentEntry const* talentInfo : sTalentStore)
|
||||
{
|
||||
ASSERT(talentInfo->ClassID < MAX_CLASSES);
|
||||
ASSERT(talentInfo->TierID < MAX_TALENT_TIERS, "MAX_TALENT_TIERS must be at least %u", MAX_TALENT_TIERS);
|
||||
ASSERT(talentInfo->ColumnIndex < MAX_TALENT_COLUMNS, "MAX_TALENT_COLUMNS must be at least %u", MAX_TALENT_COLUMNS);
|
||||
|
||||
_talentsByPosition[talentInfo->ClassID][talentInfo->TierID][talentInfo->ColumnIndex].push_back(talentInfo);
|
||||
}
|
||||
|
||||
for (TaxiPathEntry const* entry : sTaxiPathStore)
|
||||
sTaxiPathSetBySource[entry->From][entry->To] = TaxiPathBySourceAndDestination(entry->ID, entry->Cost);
|
||||
|
||||
@@ -699,6 +748,12 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
for (ToyEntry const* toy : sToyStore)
|
||||
_toys.insert(toy->ItemID);
|
||||
|
||||
for (WMOAreaTableEntry const* entry : sWMOAreaTableStore)
|
||||
_wmoAreaTableLookup[WMOAreaTableKey(entry->WMOID, entry->NameSet, entry->WMOGroupID)] = entry;
|
||||
|
||||
for (WorldMapAreaEntry const* worldMapArea : sWorldMapAreaStore)
|
||||
_worldMapAreaByAreaID[worldMapArea->AreaID] = worldMapArea;
|
||||
|
||||
// error checks
|
||||
if (bad_db2_files.size() >= DB2FilesCount)
|
||||
{
|
||||
@@ -716,13 +771,13 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
|
||||
}
|
||||
|
||||
// Check loaded DB2 files proper version
|
||||
if (!sAreaTableStore.LookupEntry(6719) || // last area (areaflag) added in 7.0.1 (20810)
|
||||
!sCharTitlesStore.LookupEntry(469) || // last char title added in 7.0.1 (20810)
|
||||
!sGemPropertiesStore.LookupEntry(2960) || // last gem property added in 7.0.1 (20914)
|
||||
!sItemStore.LookupEntry(136350) || // last item added in 7.0.1 (20810)
|
||||
!sItemExtendedCostStore.LookupEntry(5951) || // last item extended cost added in 7.0.1 (20810)
|
||||
!sMapStore.LookupEntry(1602) || // last map added in 7.0.1 (20810)
|
||||
!sSpellStore.LookupEntry(207511)) // last spell added in 7.0.1 (20810)
|
||||
if (!sAreaTableStore.LookupEntry(8343) || // last area (areaflag) added in 7.0.3 (21414)
|
||||
!sCharTitlesStore.LookupEntry(480) || // last char title added in 7.0.3 (21414)
|
||||
!sGemPropertiesStore.LookupEntry(3217) || // last gem property added in 7.0.3 (21414)
|
||||
!sItemStore.LookupEntry(139410) || // last item added in 7.0.3 (21414)
|
||||
!sItemExtendedCostStore.LookupEntry(6038) || // last item extended cost added in 7.0.3 (21414)
|
||||
!sMapStore.LookupEntry(1632) || // last map added in 7.0.3 (21414)
|
||||
!sSpellStore.LookupEntry(220019)) // last spell added in 7.0.3 (21414)
|
||||
{
|
||||
TC_LOG_ERROR("misc", "You have _outdated_ DB2 files. Please extract correct versions from current using client.");
|
||||
exit(1);
|
||||
@@ -815,6 +870,16 @@ char const* DB2Manager::GetBroadcastTextValue(BroadcastTextEntry const* broadcas
|
||||
return broadcastText->MaleText->Str[DEFAULT_LOCALE];
|
||||
}
|
||||
|
||||
CharSectionsEntry const* DB2Manager::GetCharSectionEntry(uint8 race, CharSectionType genType, uint8 gender, uint8 type, uint8 color) const
|
||||
{
|
||||
auto eqr = _charSections.equal_range(uint32(genType) | uint32(gender << 8) | uint32(race << 16));
|
||||
for (auto itr = eqr.first; itr != eqr.second; ++itr)
|
||||
if (itr->second->Type == type && itr->second->Color == color)
|
||||
return itr->second;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CharStartOutfitEntry const* DB2Manager::GetCharStartOutfitEntry(uint8 race, uint8 class_, uint8 gender) const
|
||||
{
|
||||
auto itr = _charStartOutfits.find(race | (class_ << 8) | (gender << 16));
|
||||
@@ -824,9 +889,16 @@ CharStartOutfitEntry const* DB2Manager::GetCharStartOutfitEntry(uint8 race, uint
|
||||
return itr->second;
|
||||
}
|
||||
|
||||
ChrSpecializationEntry const* DB2Manager::GetChrSpecializationByIndex(uint32 class_, uint32 index) const
|
||||
char const* DB2Manager::GetClassName(uint8 class_, LocaleConstant locale /*= DEFAULT_LOCALE*/)
|
||||
{
|
||||
return _chrSpecializationsByIndex[class_][index];
|
||||
ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(class_);
|
||||
if (!classEntry)
|
||||
return "";
|
||||
|
||||
if (classEntry->Name->Str[locale][0] != '\0')
|
||||
return classEntry->Name->Str[locale];
|
||||
|
||||
return classEntry->Name->Str[DEFAULT_LOCALE];
|
||||
}
|
||||
|
||||
uint32 DB2Manager::GetPowerIndexByClass(uint32 powerType, uint32 classId) const
|
||||
@@ -846,6 +918,11 @@ char const* DB2Manager::GetChrRaceName(uint8 race, LocaleConstant locale /*= DEF
|
||||
return raceEntry->Name->Str[DEFAULT_LOCALE];
|
||||
}
|
||||
|
||||
ChrSpecializationEntry const* DB2Manager::GetChrSpecializationByIndex(uint32 class_, uint32 index) const
|
||||
{
|
||||
return _chrSpecializationsByIndex[class_][index];
|
||||
}
|
||||
|
||||
char const* DB2Manager::GetCreatureFamilyPetName(uint32 petfamily, uint32 locale)
|
||||
{
|
||||
if (!petfamily)
|
||||
@@ -871,6 +948,15 @@ EmotesTextSoundEntry const* DB2Manager::GetTextSoundEmoteFor(uint32 emote, uint8
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector<uint32> const* DB2Manager::GetFactionTeamList(uint32 faction) const
|
||||
{
|
||||
auto itr = _factionTeams.find(faction);
|
||||
if (itr != _factionTeams.end())
|
||||
return &itr->second;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32 DB2Manager::GetHeirloomItemLevel(uint32 curveId, uint32 level) const
|
||||
{
|
||||
// Assuming linear item level scaling for heirlooms
|
||||
@@ -964,21 +1050,102 @@ std::vector<ItemSpecOverrideEntry const*> const* DB2Manager::GetItemSpecOverride
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::string DB2Manager::GetNameGenEntry(uint8 race, uint8 gender, LocaleConstant locale) const
|
||||
LfgDungeonsEntry const* DB2Manager::GetLfgDungeon(uint32 mapId, Difficulty difficulty)
|
||||
{
|
||||
ASSERT(gender < GENDER_NONE);
|
||||
auto ritr = _nameGenData.find(race);
|
||||
if (ritr == _nameGenData.end())
|
||||
return "";
|
||||
for (LfgDungeonsEntry const* dungeon : sLfgDungeonsStore)
|
||||
if (dungeon->MapID == int32(mapId) && Difficulty(dungeon->DifficultyID) == difficulty)
|
||||
return dungeon;
|
||||
|
||||
if (ritr->second[gender].empty())
|
||||
return "";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
LocalizedString* data = Trinity::Containers::SelectRandomContainerElement(ritr->second[gender])->Name;
|
||||
if (*data->Str[locale] != '\0')
|
||||
return data->Str[locale];
|
||||
uint32 DB2Manager::GetDefaultMapLight(uint32 mapId)
|
||||
{
|
||||
for (int32 i = sLightStore.GetNumRows(); i >= 0; --i)
|
||||
{
|
||||
LightEntry const* light = sLightStore.LookupEntry(uint32(i));
|
||||
if (!light)
|
||||
continue;
|
||||
|
||||
return data->Str[sWorld->GetDefaultDbcLocale()];
|
||||
if (light->MapID == mapId && light->Pos.X == 0.0f && light->Pos.Y == 0.0f && light->Pos.Z == 0.0f)
|
||||
return uint32(i);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32 DB2Manager::GetLiquidFlags(uint32 liquidType)
|
||||
{
|
||||
if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquidType))
|
||||
return 1 << liq->Type;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
MapDifficultyEntry const* DB2Manager::GetDefaultMapDifficulty(uint32 mapId, Difficulty* difficulty /*= nullptr*/) const
|
||||
{
|
||||
auto itr = _mapDifficulties.find(mapId);
|
||||
if (itr == _mapDifficulties.end())
|
||||
return nullptr;
|
||||
|
||||
if (itr->second.empty())
|
||||
return nullptr;
|
||||
|
||||
for (auto& p : itr->second)
|
||||
{
|
||||
DifficultyEntry const* difficultyEntry = sDifficultyStore.LookupEntry(p.first);
|
||||
if (!difficultyEntry)
|
||||
continue;
|
||||
|
||||
if (difficultyEntry->Flags & DIFFICULTY_FLAG_DEFAULT)
|
||||
{
|
||||
if (difficulty)
|
||||
*difficulty = Difficulty(p.first);
|
||||
|
||||
return p.second;
|
||||
}
|
||||
}
|
||||
|
||||
if (difficulty)
|
||||
*difficulty = Difficulty(itr->second.begin()->first);
|
||||
|
||||
return itr->second.begin()->second;
|
||||
}
|
||||
|
||||
MapDifficultyEntry const* DB2Manager::GetMapDifficultyData(uint32 mapId, Difficulty difficulty) const
|
||||
{
|
||||
auto itr = _mapDifficulties.find(mapId);
|
||||
if (itr == _mapDifficulties.end())
|
||||
return nullptr;
|
||||
|
||||
auto diffItr = itr->second.find(difficulty);
|
||||
if (diffItr == itr->second.end())
|
||||
return nullptr;
|
||||
|
||||
return diffItr->second;
|
||||
}
|
||||
|
||||
MapDifficultyEntry const* DB2Manager::GetDownscaledMapDifficultyData(uint32 mapId, Difficulty& difficulty) const
|
||||
{
|
||||
DifficultyEntry const* diffEntry = sDifficultyStore.LookupEntry(difficulty);
|
||||
if (!diffEntry)
|
||||
return GetDefaultMapDifficulty(mapId, &difficulty);
|
||||
|
||||
uint32 tmpDiff = difficulty;
|
||||
MapDifficultyEntry const* mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff));
|
||||
while (!mapDiff)
|
||||
{
|
||||
tmpDiff = diffEntry->FallbackDifficultyID;
|
||||
diffEntry = sDifficultyStore.LookupEntry(tmpDiff);
|
||||
if (!diffEntry)
|
||||
return GetDefaultMapDifficulty(mapId, &difficulty);
|
||||
|
||||
// pull new data
|
||||
mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff)); // we are 10 normal or 25 normal
|
||||
}
|
||||
|
||||
difficulty = Difficulty(tmpDiff);
|
||||
return mapDiff;
|
||||
}
|
||||
|
||||
MountEntry const* DB2Manager::GetMount(uint32 spellId) const
|
||||
@@ -1004,6 +1171,23 @@ DB2Manager::MountTypeXCapabilitySet const* DB2Manager::GetMountCapabilities(uint
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::string DB2Manager::GetNameGenEntry(uint8 race, uint8 gender, LocaleConstant locale) const
|
||||
{
|
||||
ASSERT(gender < GENDER_NONE);
|
||||
auto ritr = _nameGenData.find(race);
|
||||
if (ritr == _nameGenData.end())
|
||||
return "";
|
||||
|
||||
if (ritr->second[gender].empty())
|
||||
return "";
|
||||
|
||||
LocalizedString* data = Trinity::Containers::SelectRandomContainerElement(ritr->second[gender])->Name;
|
||||
if (*data->Str[locale] != '\0')
|
||||
return data->Str[locale];
|
||||
|
||||
return data->Str[sWorld->GetDefaultDbcLocale()];
|
||||
}
|
||||
|
||||
ResponseCodes DB2Manager::ValidateName(std::string const& name, LocaleConstant locale) const
|
||||
{
|
||||
for (boost::regex const& regex : _nameValidators[locale])
|
||||
@@ -1155,6 +1339,11 @@ std::vector<SpellProcsPerMinuteModEntry const*> DB2Manager::GetSpellProcsPerMinu
|
||||
return std::vector<SpellProcsPerMinuteModEntry const*>();
|
||||
}
|
||||
|
||||
std::vector<TalentEntry const*> const& DB2Manager::GetTalentsByPosition(uint32 class_, uint32 tier, uint32 column) const
|
||||
{
|
||||
return _talentsByPosition[class_][tier][column];
|
||||
}
|
||||
|
||||
bool DB2Manager::IsTotemCategoryCompatibleWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId)
|
||||
{
|
||||
if (requiredTotemCategoryId == 0)
|
||||
@@ -1180,6 +1369,49 @@ bool DB2Manager::IsToyItem(uint32 toy) const
|
||||
return _toys.count(toy) > 0;
|
||||
}
|
||||
|
||||
WMOAreaTableEntry const* DB2Manager::GetWMOAreaTable(int32 rootId, int32 adtId, int32 groupId) const
|
||||
{
|
||||
auto i = _wmoAreaTableLookup.find(WMOAreaTableKey(int8(rootId), int16(adtId), groupId));
|
||||
if (i != _wmoAreaTableLookup.end())
|
||||
return i->second;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32 DB2Manager::GetVirtualMapForMapAndZone(uint32 mapId, uint32 zoneId) const
|
||||
{
|
||||
if (mapId != 530 && mapId != 571 && mapId != 732) // speed for most cases
|
||||
return mapId;
|
||||
|
||||
auto itr = _worldMapAreaByAreaID.find(zoneId);
|
||||
if (itr != _worldMapAreaByAreaID.end())
|
||||
return itr->second->DisplayMapID >= 0 ? itr->second->DisplayMapID : itr->second->MapID;
|
||||
|
||||
return mapId;
|
||||
}
|
||||
|
||||
void DB2Manager::Zone2MapCoordinates(uint32 areaId, float& x, float& y) const
|
||||
{
|
||||
auto itr = _worldMapAreaByAreaID.find(areaId);
|
||||
if (itr == _worldMapAreaByAreaID.end())
|
||||
return;
|
||||
|
||||
std::swap(x, y); // at client map coords swapped
|
||||
x = x*((itr->second->LocBottom - itr->second->LocTop) / 100) + itr->second->LocTop;
|
||||
y = y*((itr->second->LocRight - itr->second->LocLeft) / 100) + itr->second->LocLeft; // client y coord from top to down
|
||||
}
|
||||
|
||||
void DB2Manager::Map2ZoneCoordinates(uint32 areaId, float& x, float& y) const
|
||||
{
|
||||
auto itr = _worldMapAreaByAreaID.find(areaId);
|
||||
if (itr == _worldMapAreaByAreaID.end())
|
||||
return;
|
||||
|
||||
x = (x - itr->second->LocTop) / ((itr->second->LocBottom - itr->second->LocTop) / 100);
|
||||
y = (y - itr->second->LocLeft) / ((itr->second->LocRight - itr->second->LocLeft) / 100); // client y coord from top to down
|
||||
std::swap(x, y); // client have map coords swapped
|
||||
}
|
||||
|
||||
void DB2Manager::DeterminaAlternateMapPosition(uint32 mapId, float x, float y, float z, uint32* newMapId /*= nullptr*/, DBCPosition2D* newPos /*= nullptr*/)
|
||||
{
|
||||
ASSERT(newMapId || newPos);
|
||||
|
||||
@@ -31,21 +31,25 @@ TC_GAME_API extern DB2Storage<AreaTriggerEntry> sAreaTrigger
|
||||
TC_GAME_API extern DB2Storage<ArmorLocationEntry> sArmorLocationStore;
|
||||
TC_GAME_API extern DB2Storage<AuctionHouseEntry> sAuctionHouseStore;
|
||||
TC_GAME_API extern DB2Storage<BankBagSlotPricesEntry> sBankBagSlotPricesStore;
|
||||
TC_GAME_API extern DB2Storage<BannedAddOnsEntry> sBannedAddOnsStore;
|
||||
TC_GAME_API extern DB2Storage<BarberShopStyleEntry> sBarberShopStyleStore;
|
||||
TC_GAME_API extern DB2Storage<BattlePetBreedQualityEntry> sBattlePetBreedQualityStore;
|
||||
TC_GAME_API extern DB2Storage<BattlePetBreedStateEntry> sBattlePetBreedStateStore;
|
||||
TC_GAME_API extern DB2Storage<BattlePetSpeciesEntry> sBattlePetSpeciesStore;
|
||||
TC_GAME_API extern DB2Storage<BattlePetSpeciesStateEntry> sBattlePetSpeciesStateStore;
|
||||
TC_GAME_API extern DB2Storage<BattlemasterListEntry> sBattlemasterListStore;
|
||||
TC_GAME_API extern DB2Storage<BroadcastTextEntry> sBroadcastTextStore;
|
||||
TC_GAME_API extern DB2Storage<CharStartOutfitEntry> sCharStartOutfitStore;
|
||||
TC_GAME_API extern DB2Storage<CharTitlesEntry> sCharTitlesStore;
|
||||
TC_GAME_API extern DB2Storage<ChatChannelsEntry> sChatChannelsStore;
|
||||
TC_GAME_API extern DB2Storage<ChrClassesEntry> sChrClassesStore;
|
||||
TC_GAME_API extern DB2Storage<ChrRacesEntry> sChrRacesStore;
|
||||
TC_GAME_API extern DB2Storage<ChrSpecializationEntry> sChrSpecializationStore;
|
||||
TC_GAME_API extern DB2Storage<CinematicSequencesEntry> sCinematicSequencesStore;
|
||||
TC_GAME_API extern DB2Storage<CreatureDisplayInfoEntry> sCreatureDisplayInfoStore;
|
||||
TC_GAME_API extern DB2Storage<CreatureDisplayInfoExtraEntry> sCreatureDisplayInfoExtraStore;
|
||||
TC_GAME_API extern DB2Storage<CreatureFamilyEntry> sCreatureFamilyStore;
|
||||
TC_GAME_API extern DB2Storage<CreatureModelDataEntry> sCreatureModelDataStore;
|
||||
TC_GAME_API extern DB2Storage<CreatureTypeEntry> sCreatureTypeStore;
|
||||
TC_GAME_API extern DB2Storage<CriteriaEntry> sCriteriaStore;
|
||||
TC_GAME_API extern DB2Storage<CriteriaTreeEntry> sCriteriaTreeStore;
|
||||
@@ -57,9 +61,10 @@ TC_GAME_API extern DB2Storage<DurabilityCostsEntry> sDurabilityC
|
||||
TC_GAME_API extern DB2Storage<DurabilityQualityEntry> sDurabilityQualityStore;
|
||||
TC_GAME_API extern DB2Storage<EmotesEntry> sEmotesStore;
|
||||
TC_GAME_API extern DB2Storage<EmotesTextEntry> sEmotesTextStore;
|
||||
TC_GAME_API extern DB2Storage<FactionEntry> sFactionStore;
|
||||
TC_GAME_API extern DB2Storage<FactionTemplateEntry> sFactionTemplateStore;
|
||||
TC_GAME_API extern DB2Storage<GameObjectsEntry> sGameObjectsStore;
|
||||
TC_GAME_API extern DB2Storage<GameObjectDisplayInfoEntry> sGameObjectDisplayInfoStore;
|
||||
TC_GAME_API extern DB2Storage<GameTablesEntry> sGameTablesStore;
|
||||
TC_GAME_API extern DB2Storage<GarrAbilityEntry> sGarrAbilityStore;
|
||||
TC_GAME_API extern DB2Storage<GarrBuildingEntry> sGarrBuildingStore;
|
||||
TC_GAME_API extern DB2Storage<GarrBuildingPlotInstEntry> sGarrBuildingPlotInstStore;
|
||||
@@ -106,7 +111,8 @@ TC_GAME_API extern DB2Storage<ItemSetSpellEntry> sItemSetSpel
|
||||
TC_GAME_API extern DB2SparseStorage<ItemSparseEntry> sItemSparseStore;
|
||||
TC_GAME_API extern DB2Storage<ItemSpecEntry> sItemSpecStore;
|
||||
TC_GAME_API extern DB2Storage<ItemSpecOverrideEntry> sItemSpecOverrideStore;
|
||||
TC_GAME_API extern DB2Storage<ItemToBattlePetSpeciesEntry> sItemToBattlePetSpeciesStore;
|
||||
TC_GAME_API extern DB2Storage<LfgDungeonsEntry> sLfgDungeonsStore;
|
||||
TC_GAME_API extern DB2Storage<LiquidTypeEntry> sLiquidTypeStore;
|
||||
TC_GAME_API extern DB2Storage<LockEntry> sLockStore;
|
||||
TC_GAME_API extern DB2Storage<MailTemplateEntry> sMailTemplateStore;
|
||||
TC_GAME_API extern DB2Storage<MapEntry> sMapStore;
|
||||
@@ -142,6 +148,7 @@ TC_GAME_API extern DB2Storage<SpellEffectScalingEntry> sSpellEffect
|
||||
TC_GAME_API extern DB2Storage<SpellEquippedItemsEntry> sSpellEquippedItemsStore;
|
||||
TC_GAME_API extern DB2Storage<SpellFocusObjectEntry> sSpellFocusObjectStore;
|
||||
TC_GAME_API extern DB2Storage<SpellInterruptsEntry> sSpellInterruptsStore;
|
||||
TC_GAME_API extern DB2Storage<SpellItemEnchantmentEntry> sSpellItemEnchantmentStore;
|
||||
TC_GAME_API extern DB2Storage<SpellItemEnchantmentConditionEntry> sSpellItemEnchantmentConditionStore;
|
||||
TC_GAME_API extern DB2Storage<SpellLearnSpellEntry> sSpellLearnSpellStore;
|
||||
TC_GAME_API extern DB2Storage<SpellLevelsEntry> sSpellLevelsStore;
|
||||
@@ -158,11 +165,32 @@ TC_GAME_API extern DB2Storage<SpellTargetRestrictionsEntry> sSpellTarget
|
||||
TC_GAME_API extern DB2Storage<SpellTotemsEntry> sSpellTotemsStore;
|
||||
TC_GAME_API extern DB2Storage<SpellXSpellVisualEntry> sSpellXSpellVisualStore;
|
||||
TC_GAME_API extern DB2Storage<SummonPropertiesEntry> sSummonPropertiesStore;
|
||||
TC_GAME_API extern DB2Storage<TalentEntry> sTalentStore;
|
||||
TC_GAME_API extern DB2Storage<TaxiNodesEntry> sTaxiNodesStore;
|
||||
TC_GAME_API extern DB2Storage<TaxiPathEntry> sTaxiPathStore;
|
||||
TC_GAME_API extern DB2Storage<UnitPowerBarEntry> sUnitPowerBarStore;
|
||||
TC_GAME_API extern DB2Storage<VehicleEntry> sVehicleStore;
|
||||
TC_GAME_API extern DB2Storage<VehicleSeatEntry> sVehicleSeatStore;
|
||||
TC_GAME_API extern DB2Storage<WorldMapOverlayEntry> sWorldMapOverlayStore;
|
||||
TC_GAME_API extern DB2Storage<WorldSafeLocsEntry> sWorldSafeLocsStore;
|
||||
|
||||
struct TaxiPathBySourceAndDestination
|
||||
{
|
||||
TaxiPathBySourceAndDestination() : ID(0), price(0) { }
|
||||
TaxiPathBySourceAndDestination(uint32 _id, uint32 _price) : ID(_id), price(_price) { }
|
||||
|
||||
uint32 ID;
|
||||
uint32 price;
|
||||
};
|
||||
|
||||
typedef std::map<uint32, TaxiPathBySourceAndDestination> TaxiPathSetForSource;
|
||||
typedef std::map<uint32, TaxiPathSetForSource> TaxiPathSetBySource;
|
||||
|
||||
typedef std::vector<TaxiPathNodeEntry const*> TaxiPathNodeList;
|
||||
typedef std::vector<TaxiPathNodeList> TaxiPathNodesByPath;
|
||||
|
||||
#define TaxiMaskSize 232
|
||||
typedef std::array<uint8, TaxiMaskSize> TaxiMask;
|
||||
|
||||
TC_GAME_API extern TaxiMask sTaxiNodesMask;
|
||||
TC_GAME_API extern TaxiMask sOldContinentsNodesMask;
|
||||
@@ -196,9 +224,11 @@ public:
|
||||
|
||||
typedef std::map<uint32 /*hash*/, DB2StorageBase*> StorageMap;
|
||||
typedef std::unordered_map<uint32 /*areaGroupId*/, std::vector<uint32/*areaId*/>> AreaGroupMemberContainer;
|
||||
typedef std::unordered_multimap<uint32, CharSectionsEntry const*> CharSectionsContainer;
|
||||
typedef std::unordered_map<uint32, CharStartOutfitEntry const*> CharStartOutfitContainer;
|
||||
typedef ChrSpecializationEntry const* ChrSpecializationByIndexContainer[MAX_CLASSES][MAX_SPECIALIZATIONS];
|
||||
typedef std::map<std::tuple<uint32, uint8, uint8, uint8>, EmotesTextSoundEntry const*> EmotesTextSoundContainer;
|
||||
typedef std::unordered_map<uint32, std::vector<uint32>> FactionTeamContainer;
|
||||
typedef std::set<GlyphSlotEntry const*, GlyphSlotEntryComparator> GlyphSlotContainer;
|
||||
typedef std::map<uint32 /*curveID*/, std::map<uint32/*index*/, CurvePointEntry const*, std::greater<uint32>>> HeirloomCurvesContainer;
|
||||
typedef std::unordered_map<uint32, HeirloomEntry const*> HeirloomItemsContainer;
|
||||
@@ -209,6 +239,7 @@ public:
|
||||
typedef std::unordered_map<uint32, std::set<ItemBonusTreeNodeEntry const*>> ItemBonusTreeContainer;
|
||||
typedef std::unordered_map<uint32, std::vector<ItemSetSpellEntry const*>> ItemSetSpellContainer;
|
||||
typedef std::unordered_map<uint32, std::vector<ItemSpecOverrideEntry const*>> ItemSpecOverridesContainer;
|
||||
typedef std::unordered_map<uint32, std::unordered_map<uint32, MapDifficultyEntry const*>> MapDifficultyContainer;
|
||||
typedef std::unordered_map<uint32, MountEntry const*> MountContainer;
|
||||
typedef std::set<MountTypeXCapabilityEntry const*, MountTypeXCapabilityEntryComparator> MountTypeXCapabilitySet;
|
||||
typedef std::unordered_map<uint32, MountTypeXCapabilitySet> MountCapabilitiesByTypeContainer;
|
||||
@@ -221,7 +252,11 @@ public:
|
||||
typedef std::unordered_map<uint32, std::vector<SpellPowerEntry const*>> SpellPowerContainer;
|
||||
typedef std::unordered_map<uint32, std::unordered_map<uint32, std::vector<SpellPowerEntry const*>>> SpellPowerDifficultyContainer;
|
||||
typedef std::unordered_map<uint32, std::vector<SpellProcsPerMinuteModEntry const*>> SpellProcsPerMinuteModContainer;
|
||||
typedef std::vector<TalentEntry const*> TalentsByPosition[MAX_CLASSES][MAX_TALENT_TIERS][MAX_TALENT_COLUMNS];
|
||||
typedef std::unordered_set<uint32> ToyItemIdsContainer;
|
||||
typedef std::tuple<int16, int8, int32> WMOAreaTableKey;
|
||||
typedef std::map<WMOAreaTableKey, WMOAreaTableEntry const*> WMOAreaTableLookupContainer;
|
||||
typedef std::unordered_map<uint32, WorldMapAreaEntry const*> WorldMapAreaByAreaIDContainer;
|
||||
|
||||
static DB2Manager& Instance();
|
||||
|
||||
@@ -234,12 +269,15 @@ public:
|
||||
|
||||
std::vector<uint32> GetAreasForGroup(uint32 areaGroupId) const;
|
||||
static char const* GetBroadcastTextValue(BroadcastTextEntry const* broadcastText, LocaleConstant locale = DEFAULT_LOCALE, uint8 gender = GENDER_MALE, bool forceGender = false);
|
||||
CharSectionsEntry const* GetCharSectionEntry(uint8 race, CharSectionType genType, uint8 gender, uint8 type, uint8 color) const;
|
||||
CharStartOutfitEntry const* GetCharStartOutfitEntry(uint8 race, uint8 class_, uint8 gender) const;
|
||||
ChrSpecializationEntry const* GetChrSpecializationByIndex(uint32 class_, uint32 index) const;
|
||||
static char const* GetClassName(uint8 class_, LocaleConstant locale = DEFAULT_LOCALE);
|
||||
uint32 GetPowerIndexByClass(uint32 powerType, uint32 classId) const;
|
||||
static char const* GetChrRaceName(uint8 race, LocaleConstant locale = DEFAULT_LOCALE);
|
||||
ChrSpecializationEntry const* GetChrSpecializationByIndex(uint32 class_, uint32 index) const;
|
||||
static char const* GetCreatureFamilyPetName(uint32 petfamily, uint32 locale);
|
||||
EmotesTextSoundEntry const* GetTextSoundEmoteFor(uint32 emote, uint8 race, uint8 gender, uint8 class_) const;
|
||||
std::vector<uint32> const* GetFactionTeamList(uint32 faction) const;
|
||||
GlyphSlotContainer const& GetGlyphSlots() const { return _glyphSlots; }
|
||||
uint32 GetHeirloomItemLevel(uint32 curveId, uint32 level) const;
|
||||
HeirloomEntry const* GetHeirloomByItemId(uint32 itemId) const;
|
||||
@@ -249,6 +287,13 @@ public:
|
||||
uint32 GetItemDisplayId(uint32 itemId, uint32 appearanceModId) const;
|
||||
std::vector<ItemSetSpellEntry const*> const* GetItemSetSpells(uint32 itemSetId) const;
|
||||
std::vector<ItemSpecOverrideEntry const*> const* GetItemSpecOverrides(uint32 itemId) const;
|
||||
static LfgDungeonsEntry const* GetLfgDungeon(uint32 mapId, Difficulty difficulty);
|
||||
static uint32 GetDefaultMapLight(uint32 mapId);
|
||||
static uint32 GetLiquidFlags(uint32 liquidType);
|
||||
MapDifficultyContainer const& GetMapDifficulties() const { return _mapDifficulties; }
|
||||
MapDifficultyEntry const* GetDefaultMapDifficulty(uint32 mapId, Difficulty* difficulty = nullptr) const;
|
||||
MapDifficultyEntry const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty) const;
|
||||
MapDifficultyEntry const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty) const;
|
||||
std::string GetNameGenEntry(uint8 race, uint8 gender, LocaleConstant locale) const;
|
||||
MountEntry const* GetMount(uint32 spellId) const;
|
||||
MountEntry const* GetMountById(uint32 id) const;
|
||||
@@ -263,8 +308,13 @@ public:
|
||||
std::vector<SpecializationSpellsEntry const*> const* GetSpecializationSpells(uint32 specId) const;
|
||||
std::vector<SpellPowerEntry const*> GetSpellPowers(uint32 spellId, Difficulty difficulty = DIFFICULTY_NONE, bool* hasDifficultyPowers = nullptr) const;
|
||||
std::vector<SpellProcsPerMinuteModEntry const*> GetSpellProcsPerMinuteMods(uint32 spellprocsPerMinuteId) const;
|
||||
std::vector<TalentEntry const*> const& GetTalentsByPosition(uint32 class_, uint32 tier, uint32 column) const;
|
||||
static bool IsTotemCategoryCompatibleWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId);
|
||||
bool IsToyItem(uint32 toy) const;
|
||||
WMOAreaTableEntry const* GetWMOAreaTable(int32 rootId, int32 adtId, int32 groupId) const;
|
||||
uint32 GetVirtualMapForMapAndZone(uint32 mapId, uint32 zoneId) const;
|
||||
void Zone2MapCoordinates(uint32 areaId, float& x, float& y) const;
|
||||
void Map2ZoneCoordinates(uint32 areaId, float& x, float& y) const;
|
||||
static void DeterminaAlternateMapPosition(uint32 mapId, float x, float y, float z, uint32* newMapId = nullptr, DBCPosition2D* newPos = nullptr);
|
||||
|
||||
private:
|
||||
@@ -272,10 +322,12 @@ private:
|
||||
HotfixData _hotfixData;
|
||||
|
||||
AreaGroupMemberContainer _areaGroupMembers;
|
||||
CharSectionsContainer _charSections;
|
||||
CharStartOutfitContainer _charStartOutfits;
|
||||
uint32 _powersByClass[MAX_CLASSES][MAX_POWERS];
|
||||
ChrSpecializationByIndexContainer _chrSpecializationsByIndex;
|
||||
EmotesTextSoundContainer _emoteTextSounds;
|
||||
FactionTeamContainer _factionTeams;
|
||||
GlyphSlotContainer _glyphSlots;
|
||||
HeirloomItemsContainer _heirlooms;
|
||||
HeirloomCurvesContainer _heirloomCurvePoints;
|
||||
@@ -286,6 +338,7 @@ private:
|
||||
ItemToBonusTreeContainer _itemToBonusTree;
|
||||
ItemSetSpellContainer _itemSetSpells;
|
||||
ItemSpecOverridesContainer _itemSpecOverrides;
|
||||
MapDifficultyContainer _mapDifficulties;
|
||||
MountContainer _mountsBySpellId;
|
||||
MountCapabilitiesByTypeContainer _mountCapabilitiesByType;
|
||||
NameGenContainer _nameGenData;
|
||||
@@ -297,7 +350,10 @@ private:
|
||||
SpellPowerContainer _spellPowers;
|
||||
SpellPowerDifficultyContainer _spellPowerDifficulties;
|
||||
SpellProcsPerMinuteModContainer _spellProcsPerMinuteMods;
|
||||
TalentsByPosition _talentsByPosition;
|
||||
ToyItemIdsContainer _toys;
|
||||
WMOAreaTableLookupContainer _wmoAreaTableLookup;
|
||||
WorldMapAreaByAreaIDContainer _worldMapAreaByAreaID;
|
||||
};
|
||||
|
||||
#define sDB2Manager DB2Manager::Instance()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -21,27 +21,32 @@
|
||||
char const AchievementFormat[] = "nssishhhhhhhbbb";
|
||||
char const AnimKitFormat[] = "dihh";
|
||||
char const AreaGroupMemberFormat[] = "dhh";
|
||||
char const AreaTableFormat[] = "diiSfshhhhhhhhhhhhhbbbbbbbbb";
|
||||
char const AreaTableFormat[] = "diiSfshhhhhhhhhhhhhhbbbbbbbb";
|
||||
char const AreaTriggerFormat[] = "nffffffffhhhhhbbb";
|
||||
char const ArmorLocationFormat[] = "dfffff";
|
||||
char const AuctionHouseFormat[] = "dshbb";
|
||||
char const BankBagSlotPricesFormat[] = "di";
|
||||
char const BannedAddOnsFormat[] = "dSSb";
|
||||
char const BarberShopStyleFormat[] = "nssfbbbb";
|
||||
char const BattlePetBreedQualityFormat[] = "dfb";
|
||||
char const BattlePetBreedStateFormat[] = "nhbb";
|
||||
char const BattlePetSpeciesFormat[] = "niiisshbb";
|
||||
char const BattlePetSpeciesStateFormat[] = "nihb";
|
||||
char const BattlemasterListFormat[] = "nsishhhhhhhhhhhhhhhhhhbbbbbbbbb";
|
||||
char const BroadcastTextFormat[] = "dsshhhhhhhhbb";
|
||||
char const CharStartOutfitFormat[] = "diiiiiiiiiiiiiiiiiiiiiiiiibbbbb";
|
||||
char const CharSectionsFormat[] = "niiihbbbbb";
|
||||
char const CharTitlesFormat[] = "dsshhb";
|
||||
char const ChatChannelsFormat[] = "dissb";
|
||||
char const ChrClassesFormat[] = "nSsssSiiihhhbbbbbbb";
|
||||
char const ChrClassesXPowerTypesFormat[] = "dbb";
|
||||
char const ChrRacesFormat[] = "niSSsssSSSiiffffffihhhhhhhhhhhhbbbbbbbbb";
|
||||
char const ChrRacesFormat[] = "niSSsssSSSiiffffffihhhhhhhhhhhhbbbbbbbbbb";
|
||||
char const ChrSpecializationFormat[] = "niiiisssShbbbbb";
|
||||
char const CinematicSequencesFormat[] = "dhhhhhhhhh";
|
||||
char const CreatureDisplayInfoFormat[] = "niffiiiSiiihhhhhhbbbbbb";
|
||||
char const CreatureDisplayInfoFormat[] = "diffiiiSiiifhhhhhhbbbbbb";
|
||||
char const CreatureDisplayInfoExtraFormat[] = "diibbbbbbbbbbbb";
|
||||
char const CreatureFamilyFormat[] = "dffsshhhbbbb";
|
||||
char const CreatureModelDataFormat[] = "diifffffffffffffffffffffffhhbbbbbbbb";
|
||||
char const CreatureTypeFormat[] = "dsb";
|
||||
char const CriteriaFormat[] = "diiihhhbbbbb";
|
||||
char const CriteriaTreeFormat[] = "dishhhhb";
|
||||
@@ -52,30 +57,31 @@ char const DifficultyFormat[] = "nsbbbbbbbbbbbb";
|
||||
char const DungeonEncounterFormat[] = "dsihhhbbb";
|
||||
char const DurabilityCostsFormat[] = "dhhhhhhhhhhhhhhhhhhhhhhhhhhhhh";
|
||||
char const DurabilityQualityFormat[] = "df";
|
||||
char const EmotesFormat[] = "dSiihhbb";
|
||||
char const EmotesFormat[] = "dSiiiihhhb";
|
||||
char const EmotesTextFormat[] = "dsh";
|
||||
char const EmotesTextSoundFormat[] = "dhhbbb";
|
||||
char const FactionFormat[] = "diiiiiiiiffsshhhhhhhhhhbbbbb";
|
||||
char const FactionTemplateFormat[] = "dhhhhhhhhhhbbb";
|
||||
char const GameObjectsFormat[] = "nffffffffiiiiiiiishhhhbb";
|
||||
char const GameObjectDisplayInfoFormat[] = "diffffffffh";
|
||||
char const GameTablesFormat[] = "dshb";
|
||||
char const GarrAbilityFormat[] = "nssihbbb";
|
||||
char const GarrAbilityFormat[] = "nssihhbb";
|
||||
char const GarrBuildingFormat[] = "diissssihhhhhhbbbbbbbbbbb";
|
||||
char const GarrBuildingPlotInstFormat[] = "nffhhb";
|
||||
char const GarrClassSpecFormat[] = "nssshbb";
|
||||
char const GarrFollowerFormat[] = "diissiihhbbbbbbbbbbbbbbbb";
|
||||
char const GarrClassSpecFormat[] = "nssshbbb";
|
||||
char const GarrFollowerFormat[] = "niissiihhbbbbbbbbbbbbbbbbbb";
|
||||
char const GarrFollowerXAbilityFormat[] = "dhhb";
|
||||
char const GarrPlotFormat[] = "dsiibbbbb";
|
||||
char const GarrPlotFormat[] = "dsiihhbbb";
|
||||
char const GarrPlotBuildingFormat[] = "dbb";
|
||||
char const GarrPlotInstanceFormat[] = "dsb";
|
||||
char const GarrSiteLevelFormat[] = "dffhhhbbbbb";
|
||||
char const GarrSiteLevelPlotInstFormat[] = "dffhbb";
|
||||
char const GemPropertiesFormat[] = "dihhbb";
|
||||
char const GemPropertiesFormat[] = "dihh";
|
||||
char const GlyphPropertiesFormat[] = "dihbb";
|
||||
char const GlyphSlotFormat[] = "dbb";
|
||||
char const GlyphSlotFormat[] = "dhb";
|
||||
char const GuildColorBackgroundFormat[] = "dbbb";
|
||||
char const GuildColorBorderFormat[] = "dbbb";
|
||||
char const GuildColorEmblemFormat[] = "dbbb";
|
||||
char const GuildPerkSpellsFormat[] = "dib";
|
||||
char const GuildPerkSpellsFormat[] = "di";
|
||||
char const HeirloomFormat[] = "nisiiiiihhbb";
|
||||
char const HolidaysEntryFormat[] = "diiiiiiiiiiiiiiiiShhhhhhhhhhhbbbbbbbbbbbbbbbb";
|
||||
char const ImportPriceArmorFormat[] = "dffff";
|
||||
@@ -83,7 +89,7 @@ char const ImportPriceQualityFormat[] = "df";
|
||||
char const ImportPriceShieldFormat[] = "df";
|
||||
char const ImportPriceWeaponFormat[] = "df";
|
||||
char const ItemFormat[] = "dibbbbbbb";
|
||||
char const ItemAppearanceFormat[] = "diib";
|
||||
char const ItemAppearanceFormat[] = "diiib";
|
||||
char const ItemArmorQualityFormat[] = "dfffffffh";
|
||||
char const ItemArmorShieldFormat[] = "dfffffffh";
|
||||
char const ItemArmorTotalFormat[] = "dffffh";
|
||||
@@ -101,24 +107,27 @@ char const ItemDisenchantLootFormat[] = "dhhhbbb";
|
||||
char const ItemEffectFormat[] = "diiiihhhbb";
|
||||
char const ItemExtendedCostFormat[] = "diiiiiiiiiiihhhhhhhhhhhbbbbb";
|
||||
char const ItemLimitCategoryFormat[] = "dsbb";
|
||||
char const ItemModifiedAppearanceFormat[] = "nihbb";
|
||||
char const ItemModifiedAppearanceFormat[] = "nihbbb";
|
||||
char const ItemPriceBaseFormat[] = "dffh";
|
||||
char const ItemRandomPropertiesFormat[] = "dshhhhh";
|
||||
char const ItemRandomSuffixFormat[] = "dsshhhhhhhhhh";
|
||||
char const ItemSetFormat[] = "dsiiiiiiiiiiiiiiiiihb";
|
||||
char const ItemSetFormat[] = "dsiiiiiiiiiiiiiiiiiihb";
|
||||
char const ItemSetSpellFormat[] = "dihhb";
|
||||
char const ItemSparseFormat[] = "iiiffiiiiiiiiiiiiiiiiifffffffffffsssssififhhhhhhhhhhhhhhhhhhhhhhhhhhhhhbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
||||
char const ItemSparseFormat[] = "diiiffiiiiiiiiiiiiiiiiifffffffffffsssssififhhhhhhhhhhhhhhhhhhhhhhhhhhhhhbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
||||
char const ItemSpecFormat[] = "dhbbbbb";
|
||||
char const ItemSpecOverrideFormat[] = "dih";
|
||||
char const ItemToBattlePetSpeciesFormat[] = "dh";
|
||||
char const ItemXBonusTreeFormat[] = "dih";
|
||||
char const KeyChainFormat[] = "dbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
||||
char const LfgDungeonsFormat[] = "nsiSshhhhhhhhbbbbbbbbbbbbbbbbb";
|
||||
char const LightFormat[] = "dfffffhhhhhhhhh";
|
||||
char const LiquidTypeFormat[] = "dsifffffssssssiiffffffffffffffffffiiiihhbbbbbbbbbbb";
|
||||
char const LockFormat[] = "diiiiiiiihhhhhhhhbbbbbbbbbbbbbbbb";
|
||||
char const MailTemplateFormat[] = "ds";
|
||||
char const MapFormat[] = "nsiifffissshhhhhhbbbbb";
|
||||
char const MapFormat[] = "dsiifffssshhhhhhbbbbb";
|
||||
char const MapDifficultyFormat[] = "dsihbbbbb";
|
||||
char const ModifierTreeFormat[] = "diihbbbb";
|
||||
char const MountFormat[] = "niissshhhb";
|
||||
char const MountCapabilityFormat[] = "niihhhbb";
|
||||
char const MountCapabilityFormat[] = "niiihhhb";
|
||||
char const MountTypeXCapabilityFormat[] = "dhhb";
|
||||
char const MovieFormat[] = "diibb";
|
||||
char const NameGenFormat[] = "dsbb";
|
||||
@@ -134,15 +143,15 @@ char const PvpDifficultyFormat[] = "dhbbb";
|
||||
char const QuestFactionRewardFormat[] = "dhhhhhhhhhh";
|
||||
char const QuestMoneyRewardFormat[] = "diiiiiiiiii";
|
||||
char const QuestPackageItemFormat[] = "dihbb";
|
||||
char const QuestSortFormat[] = "ds";
|
||||
char const QuestSortFormat[] = "dsb";
|
||||
char const QuestV2Format[] = "dh";
|
||||
char const QuestXPFormat[] = "dhhhhhhhhhh";
|
||||
char const RandPropPointsFormat[] = "dhhhhhhhhhhhhhhh";
|
||||
char const RandPropPointsFormat[] = "diiiiiiiiiiiiiii";
|
||||
char const ScalingStatDistributionFormat[] = "dhbb";
|
||||
char const SkillLineFormat[] = "dssshhbbb";
|
||||
char const SkillLineAbilityFormat[] = "diiiihhhhhhbb";
|
||||
char const SkillRaceClassInfoFormat[] = "dihhhhbb";
|
||||
char const SoundKitFormat[] = "nsffffffffhhbbbbb";
|
||||
char const SkillRaceClassInfoFormat[] = "diihhhbb";
|
||||
char const SoundKitFormat[] = "nsffffffffhhhbbbb";
|
||||
char const SpecializationSpellsFormat[] = "niishb";
|
||||
char const SpellFormat[] = "nssssih";
|
||||
char const SpellAuraOptionsFormat[] = "diiiihbbb";
|
||||
@@ -150,7 +159,7 @@ char const SpellAuraRestrictionsFormat[] = "diiiiibbbbb";
|
||||
char const SpellCastTimesFormat[] = "diih";
|
||||
char const SpellCastingRequirementsFormat[] = "dihhhbbb";
|
||||
char const SpellCategoriesFormat[] = "dihhhbbbbb";
|
||||
char const SpellCategoryFormat[] = "dsibbb";
|
||||
char const SpellCategoryFormat[] = "dsiibbb";
|
||||
char const SpellClassOptionsFormat[] = "diiiiihb";
|
||||
char const SpellCooldownsFormat[] = "diiiib";
|
||||
char const SpellDurationFormat[] = "diih";
|
||||
@@ -159,6 +168,7 @@ char const SpellEffectScalingFormat[] = "dfffi";
|
||||
char const SpellEquippedItemsFormat[] = "diiib";
|
||||
char const SpellFocusObjectFormat[] = "ds";
|
||||
char const SpellInterruptsFormat[] = "diiiiihb";
|
||||
char const SpellItemEnchantmentFormat[] = "diiisfffiiihhhhhhhhbbbbbbbbb";
|
||||
char const SpellItemEnchantmentConditionFormat[] = "dbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
||||
char const SpellLearnSpellFormat[] = "diii";
|
||||
char const SpellLevelsFormat[] = "dihhhbb";
|
||||
@@ -168,13 +178,14 @@ char const SpellPowerDifficultyFormat[] = "nbb";
|
||||
char const SpellRadiusFormat[] = "dffff";
|
||||
char const SpellRangeFormat[] = "dffffssb";
|
||||
char const SpellReagentsFormat[] = "diiiiiiiiihhhhhhhh";
|
||||
char const SpellScalingFormat[] = "dihbb";
|
||||
char const SpellScalingFormat[] = "dihbbb";
|
||||
char const SpellShapeshiftFormat[] = "diiiiib";
|
||||
char const SpellShapeshiftFormFormat[] = "dsfihhhhhhhhhhhhhhbbb";
|
||||
char const SpellTargetRestrictionsFormat[] = "diffihhbb";
|
||||
char const SpellTotemsFormat[] = "diiibb";
|
||||
char const SpellXSpellVisualFormat[] = "nifhhhbb";
|
||||
char const SummonPropertiesFormat[] = "diiiii";
|
||||
char const TalentFormat[] = "diishbbbbbb";
|
||||
char const TaxiNodesFormat[] = "nfffsiiffhhhb";
|
||||
char const TaxiPathFormat[] = "nhhh";
|
||||
char const TaxiPathNodeFormat[] = "nfffihhhhbb";
|
||||
@@ -183,8 +194,12 @@ char const ToyFormat[] = "nisbb";
|
||||
char const TransportAnimationFormat[] = "diifffb";
|
||||
char const TransportRotationFormat[] = "diiffff";
|
||||
char const UnitPowerBarFormat[] = "diffiiiiiiiiiiiissssffhhbbb";
|
||||
char const VehicleSeatFormat[] = "diiiffffffffffffffffffffffffffffffffffihhhhhhhhhhhhhhhhhhhhhbbbbbb";
|
||||
char const WorldMapOverlayFormat[] = "dShhhhhhhhhhhhhh";
|
||||
char const VehicleFormat[] = "difffffffffffffffffffSSSSffhhhhhhhhhhhhbb";
|
||||
char const VehicleSeatFormat[] = "diiiffffffffffffffffffffffiiffffffffffffihhhhhhhhhhhhhhhhhhhbbbbbb";
|
||||
char const WMOAreaTableFormat[] = "nishhhhhhhbbbbb";
|
||||
char const WorldMapAreaFormat[] = "nSffffhhhhhhhbbbb";
|
||||
char const WorldMapOverlayFormat[] = "dShhhhhhhhhhhhhhb";
|
||||
char const WorldMapTransformsFormat[] = "dfffffffffhhhhb";
|
||||
char const WorldSafeLocsFormat[] = "dffffsh";
|
||||
|
||||
#endif
|
||||
|
||||
@@ -57,7 +57,7 @@ enum LevelLimit
|
||||
enum BattlegroundBracketId // bracketId for level ranges
|
||||
{
|
||||
BG_BRACKET_ID_FIRST = 0,
|
||||
BG_BRACKET_ID_LAST = 10,
|
||||
BG_BRACKET_ID_LAST = 11,
|
||||
|
||||
// must be max value in PvPDificulty slot + 1
|
||||
MAX_BATTLEGROUND_BRACKETS
|
||||
@@ -413,6 +413,25 @@ enum CriteriaTreeOperator
|
||||
CRITERIA_TREE_OPERATOR_ANY = 8
|
||||
};
|
||||
|
||||
enum CharSectionFlags
|
||||
{
|
||||
SECTION_FLAG_PLAYER = 0x01,
|
||||
SECTION_FLAG_DEATH_KNIGHT = 0x04,
|
||||
SECTION_FLAG_DEMON_HUNTER = 0x40
|
||||
};
|
||||
|
||||
enum CharSectionType
|
||||
{
|
||||
SECTION_TYPE_SKIN = 0,
|
||||
SECTION_TYPE_FACE = 1,
|
||||
SECTION_TYPE_FACIAL_HAIR = 2,
|
||||
SECTION_TYPE_HAIR = 3,
|
||||
SECTION_TYPE_UNDERWEAR = 4,
|
||||
SECTION_TYPE_CUSTOM_DISPLAY_1 = 10,
|
||||
SECTION_TYPE_CUSTOM_DISPLAY_2 = 12,
|
||||
SECTION_TYPE_CUSTOM_DISPLAY_3 = 14
|
||||
};
|
||||
|
||||
enum Difficulty : uint8
|
||||
{
|
||||
DIFFICULTY_NONE = 0,
|
||||
|
||||
@@ -1,564 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "DBCStores.h"
|
||||
#include "Log.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "DBCfmt.h"
|
||||
#include "Timer.h"
|
||||
#include "DB2Stores.h"
|
||||
#include <map>
|
||||
|
||||
struct WMOAreaTableTripple
|
||||
{
|
||||
WMOAreaTableTripple(int32 r, int32 a, int32 g) : groupId(g), rootId(r), adtId(a)
|
||||
{
|
||||
}
|
||||
|
||||
bool operator <(const WMOAreaTableTripple& b) const
|
||||
{
|
||||
return memcmp(this, &b, sizeof(WMOAreaTableTripple))<0;
|
||||
}
|
||||
|
||||
// ordered by entropy; that way memcmp will have a minimal medium runtime
|
||||
int32 groupId;
|
||||
int32 rootId;
|
||||
int32 adtId;
|
||||
};
|
||||
|
||||
typedef std::multimap<uint32, CharSectionsEntry const*> CharSectionsMap;
|
||||
typedef std::map<uint32, std::vector<uint32>> FactionTeamMap;
|
||||
typedef std::map<WMOAreaTableTripple, WMOAreaTableEntry const*> WMOAreaInfoByTripple;
|
||||
|
||||
DBCStorage<BannedAddOnsEntry> sBannedAddOnsStore(BannedAddOnsfmt);
|
||||
DBCStorage<BattlemasterListEntry> sBattlemasterListStore(BattlemasterListfmt);
|
||||
|
||||
DBCStorage<CharSectionsEntry> sCharSectionsStore(CharSectionsfmt);
|
||||
CharSectionsMap sCharSectionMap;
|
||||
DBCStorage<ChrClassesEntry> sChrClassesStore(ChrClassesfmt);
|
||||
DBCStorage<CreatureModelDataEntry> sCreatureModelDataStore(CreatureModelDatafmt);
|
||||
|
||||
DBCStorage<FactionEntry> sFactionStore(Factionfmt);
|
||||
static FactionTeamMap sFactionTeamMap;
|
||||
DBCStorage<FactionTemplateEntry> sFactionTemplateStore(FactionTemplatefmt);
|
||||
|
||||
DBCStorage<LFGDungeonEntry> sLFGDungeonStore(LFGDungeonfmt);
|
||||
DBCStorage<LightEntry> sLightStore(Lightfmt);
|
||||
DBCStorage<LiquidTypeEntry> sLiquidTypeStore(LiquidTypefmt);
|
||||
|
||||
DBCStorage<MapDifficultyEntry> sMapDifficultyStore(MapDifficultyfmt); // only for loading
|
||||
MapDifficultyMap sMapDifficultyMap;
|
||||
|
||||
DBCStorage<SpellItemEnchantmentEntry> sSpellItemEnchantmentStore(SpellItemEnchantmentfmt);
|
||||
|
||||
DBCStorage<TalentEntry> sTalentStore(Talentfmt);
|
||||
TalentsByPosition sTalentByPos;
|
||||
|
||||
DBCStorage<VehicleEntry> sVehicleStore(Vehiclefmt);
|
||||
|
||||
DBCStorage<WMOAreaTableEntry> sWMOAreaTableStore(WMOAreaTablefmt);
|
||||
static WMOAreaInfoByTripple sWMOAreaInfoByTripple;
|
||||
DBCStorage<WorldMapAreaEntry> sWorldMapAreaStore(WorldMapAreafmt);
|
||||
DBCStorage<WorldSafeLocsEntry> sWorldSafeLocsStore(WorldSafeLocsfmt);
|
||||
|
||||
GameTable<GtBarberShopCostBaseEntry> sGtBarberShopCostBaseStore;
|
||||
GameTable<GtChanceToMeleeCritBaseEntry> sGtChanceToMeleeCritBaseStore;
|
||||
GameTable<GtChanceToMeleeCritEntry> sGtChanceToMeleeCritStore;
|
||||
GameTable<GtChanceToSpellCritBaseEntry> sGtChanceToSpellCritBaseStore;
|
||||
GameTable<GtChanceToSpellCritEntry> sGtChanceToSpellCritStore;
|
||||
GameTable<GtCombatRatingsEntry> sGtCombatRatingsStore;
|
||||
GameTable<GtItemSocketCostPerLevelEntry> sGtItemSocketCostPerLevelStore;
|
||||
GameTable<GtNPCManaCostScalerEntry> sGtNPCManaCostScalerStore;
|
||||
GameTable<GtNpcTotalHpEntry> sGtNpcTotalHpStore[MAX_EXPANSIONS];
|
||||
GameTable<GtNpcDamageByClassEntry> sGtNpcDamageByClassStore[MAX_EXPANSIONS];
|
||||
GameTable<GtOCTBaseHPByClassEntry> sGtOCTBaseHPByClassStore;
|
||||
GameTable<GtOCTBaseMPByClassEntry> sGtOCTBaseMPByClassStore;
|
||||
GameTable<GtOCTHpPerStaminaEntry> sGtOCTHpPerStaminaStore;
|
||||
GameTable<GtOCTLevelExperienceEntry> sGtOCTLevelExperienceStore;
|
||||
GameTable<GtRegenMPPerSptEntry> sGtRegenMPPerSptStore;
|
||||
GameTable<GtSpellScalingEntry> sGtSpellScalingStore;
|
||||
|
||||
typedef std::list<std::string> StoreProblemList;
|
||||
|
||||
uint32 DBCFileCount = 0;
|
||||
uint32 GameTableCount = 0;
|
||||
|
||||
template<class T>
|
||||
inline void LoadDBC(uint32& availableDbcLocales, StoreProblemList& errors, DBCStorage<T>& storage, std::string const& dbcPath, std::string const& filename, uint32 defaultLocale, std::string const* customFormat = NULL, std::string const* customIndexName = NULL)
|
||||
{
|
||||
// compatibility format and C++ structure sizes
|
||||
ASSERT(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T),
|
||||
"Size of '%s' set by format string (%u) not equal size of C++ structure (%u).",
|
||||
filename.c_str(), DBCFileLoader::GetFormatRecordSize(storage.GetFormat()), uint32(sizeof(T)));
|
||||
|
||||
++DBCFileCount;
|
||||
std::string dbcFilename = dbcPath + localeNames[defaultLocale] + '/' + filename;
|
||||
SqlDbc * sql = NULL;
|
||||
if (customFormat)
|
||||
sql = new SqlDbc(&filename, customFormat, customIndexName, storage.GetFormat());
|
||||
|
||||
if (storage.Load(dbcFilename.c_str(), sql))
|
||||
{
|
||||
for (uint8 i = 0; i < TOTAL_LOCALES; ++i)
|
||||
{
|
||||
if (i == LOCALE_none || !(availableDbcLocales & (1 << i)))
|
||||
continue;
|
||||
|
||||
std::string localizedName(dbcPath);
|
||||
localizedName.append(localeNames[i]);
|
||||
localizedName.push_back('/');
|
||||
localizedName.append(filename);
|
||||
|
||||
if (!storage.LoadStringsFrom(localizedName.c_str()))
|
||||
availableDbcLocales &= ~(1<<i); // mark as not available for speedup next checks
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// sort problematic dbc to (1) non compatible and (2) non-existed
|
||||
if (FILE* f = fopen(dbcFilename.c_str(), "rb"))
|
||||
{
|
||||
std::ostringstream stream;
|
||||
stream << dbcFilename << " exists, and has " << storage.GetFieldCount() << " field(s) (expected " << strlen(storage.GetFormat()) << "). Extracted file might be from wrong client version or a database-update has been forgotten.";
|
||||
std::string buf = stream.str();
|
||||
errors.push_back(buf);
|
||||
fclose(f);
|
||||
}
|
||||
else
|
||||
errors.push_back(dbcFilename);
|
||||
}
|
||||
|
||||
delete sql;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void LoadGameTable(StoreProblemList& errors, std::string const& tableName, GameTable<T>& storage, std::string const& dbcPath, std::string const& filename)
|
||||
{
|
||||
// compatibility format and C++ structure sizes
|
||||
ASSERT(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T),
|
||||
"Size of '%s' set by format string (%u) not equal size of C++ structure (%u).",
|
||||
filename.c_str(), DBCFileLoader::GetFormatRecordSize(storage.GetFormat()), uint32(sizeof(T)));
|
||||
|
||||
++GameTableCount;
|
||||
std::string dbcFilename = dbcPath + filename;
|
||||
|
||||
if (storage.Load(dbcFilename.c_str()))
|
||||
{
|
||||
bool found = false;
|
||||
// Find table definition in GameTables.db2
|
||||
for (uint32 i = 0; i < sGameTablesStore.GetNumRows(); ++i)
|
||||
{
|
||||
GameTablesEntry const* gt = sGameTablesStore.LookupEntry(i);
|
||||
if (!gt)
|
||||
continue;
|
||||
|
||||
for (uint32 l = 0; l < TOTAL_LOCALES; ++l)
|
||||
{
|
||||
if (l != LOCALE_none && tableName == gt->Name->Str[l])
|
||||
{
|
||||
found = true;
|
||||
storage.SetGameTableEntry(gt);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found)
|
||||
break;
|
||||
}
|
||||
|
||||
ASSERT(found, "Game table %s definition not found in GameTables.db2", tableName.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
// sort problematic dbc to (1) non compatible and (2) non-existed
|
||||
if (FILE* f = fopen(dbcFilename.c_str(), "rb"))
|
||||
{
|
||||
std::ostringstream stream;
|
||||
stream << dbcFilename << " exists, and has " << storage.GetFieldCount() << " field(s) (expected " << strlen(storage.GetFormat()) << "). Extracted file might be from wrong client version or a database-update has been forgotten.";
|
||||
std::string buf = stream.str();
|
||||
errors.push_back(buf);
|
||||
fclose(f);
|
||||
}
|
||||
else
|
||||
errors.push_back(dbcFilename);
|
||||
}
|
||||
}
|
||||
|
||||
void LoadDBCStores(const std::string& dataPath, uint32 defaultLocale)
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
std::string dbcPath = dataPath + "dbc/";
|
||||
|
||||
StoreProblemList bad_dbc_files;
|
||||
uint32 availableDbcLocales = 0xFFFFFFFF;
|
||||
|
||||
#define LOAD_DBC(store, file) LoadDBC(availableDbcLocales, bad_dbc_files, store, dbcPath, file, defaultLocale)
|
||||
|
||||
LOAD_DBC(sBannedAddOnsStore, "BannedAddOns.dbc");//20810
|
||||
LOAD_DBC(sBattlemasterListStore, "BattlemasterList.dbc");//20810
|
||||
LOAD_DBC(sCharSectionsStore, "CharSections.dbc");//20810
|
||||
LOAD_DBC(sChrClassesStore, "ChrClasses.dbc");//20810
|
||||
LOAD_DBC(sCreatureModelDataStore, "CreatureModelData.dbc");//20810
|
||||
LOAD_DBC(sFactionStore, "Faction.dbc");//20810
|
||||
LOAD_DBC(sFactionTemplateStore, "FactionTemplate.dbc");//20810
|
||||
LOAD_DBC(sLFGDungeonStore, "LfgDungeons.dbc");//20810
|
||||
LOAD_DBC(sLightStore, "Light.dbc"); //20810
|
||||
LOAD_DBC(sLiquidTypeStore, "LiquidType.dbc");//20810
|
||||
LOAD_DBC(sMapDifficultyStore, "MapDifficulty.dbc");//20810
|
||||
LOAD_DBC(sSpellItemEnchantmentStore, "SpellItemEnchantment.dbc");//20810
|
||||
LOAD_DBC(sTalentStore, "Talent.dbc");//20810
|
||||
LOAD_DBC(sVehicleStore, "Vehicle.dbc");//20810
|
||||
LOAD_DBC(sWMOAreaTableStore, "WMOAreaTable.dbc");//20810
|
||||
LOAD_DBC(sWorldMapAreaStore, "WorldMapArea.dbc");//20810
|
||||
LOAD_DBC(sWorldSafeLocsStore, "WorldSafeLocs.dbc"); // 20810
|
||||
|
||||
#undef LOAD_DBC
|
||||
|
||||
for (uint32 i = 0; i < sCharSectionsStore.GetNumRows(); ++i)
|
||||
if (CharSectionsEntry const* entry = sCharSectionsStore.LookupEntry(i))
|
||||
if (entry->Race && ((1 << (entry->Race - 1)) & RACEMASK_ALL_PLAYABLE) != 0) //ignore Nonplayable races
|
||||
sCharSectionMap.insert({ entry->GenType | (entry->Gender << 8) | (entry->Race << 16), entry });
|
||||
|
||||
for (uint32 i = 0; i < sFactionStore.GetNumRows(); ++i)
|
||||
{
|
||||
FactionEntry const* faction = sFactionStore.LookupEntry(i);
|
||||
if (faction && faction->ParentFactionID)
|
||||
sFactionTeamMap[faction->ParentFactionID].push_back(i);
|
||||
}
|
||||
|
||||
// fill data
|
||||
for (uint32 i = 0; i < sMapDifficultyStore.GetNumRows(); ++i)
|
||||
if (MapDifficultyEntry const* entry = sMapDifficultyStore.LookupEntry(i))
|
||||
sMapDifficultyMap[entry->MapID][entry->DifficultyID] = entry;
|
||||
sMapDifficultyMap[0][0] = sMapDifficultyMap[1][0]; //map 0 is missing from MapDifficulty.dbc use this till its ported to sql
|
||||
|
||||
for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
|
||||
{
|
||||
if (TalentEntry const* talentInfo = sTalentStore.LookupEntry(i))
|
||||
{
|
||||
if (talentInfo->ClassID < MAX_CLASSES && talentInfo->TierID < MAX_TALENT_TIERS && talentInfo->ColumnIndex < MAX_TALENT_COLUMNS)
|
||||
sTalentByPos[talentInfo->ClassID][talentInfo->TierID][talentInfo->ColumnIndex].push_back(talentInfo);
|
||||
else
|
||||
TC_LOG_ERROR("server.loading", "Value of class (found: %u, max allowed %u) or (found: %u, max allowed %u) tier or column (found: %u, max allowed %u) is invalid.",
|
||||
talentInfo->ClassID, MAX_CLASSES, talentInfo->TierID, MAX_TALENT_TIERS, talentInfo->ColumnIndex, MAX_TALENT_COLUMNS);
|
||||
}
|
||||
}
|
||||
|
||||
for (uint32 i = 0; i < sWMOAreaTableStore.GetNumRows(); ++i)
|
||||
if (WMOAreaTableEntry const* entry = sWMOAreaTableStore.LookupEntry(i))
|
||||
sWMOAreaInfoByTripple.insert(WMOAreaInfoByTripple::value_type(WMOAreaTableTripple(entry->WMOID, entry->NameSet, entry->WMOGroupID), entry));
|
||||
|
||||
// error checks
|
||||
if (bad_dbc_files.size() >= DBCFileCount)
|
||||
{
|
||||
TC_LOG_ERROR("misc", "Incorrect DataDir value in worldserver.conf or ALL required *.dbc files (%d) not found by path: %sdbc/%s/", DBCFileCount, dataPath.c_str(), localeNames[defaultLocale]);
|
||||
exit(1);
|
||||
}
|
||||
else if (!bad_dbc_files.empty())
|
||||
{
|
||||
std::string str;
|
||||
for (StoreProblemList::iterator i = bad_dbc_files.begin(); i != bad_dbc_files.end(); ++i)
|
||||
str += *i + "\n";
|
||||
|
||||
TC_LOG_ERROR("misc", "Some required *.dbc files (%u from %d) not found or not compatible:\n%s", (uint32)bad_dbc_files.size(), DBCFileCount, str.c_str());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
TC_LOG_INFO("server.loading", ">> Initialized %d DBC data stores in %u ms", DBCFileCount, GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
|
||||
void LoadGameTables(const std::string& dataPath, uint32 defaultLocale)
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
std::string dbcPath = dataPath + "dbc/" + localeNames[defaultLocale] + '/';
|
||||
|
||||
StoreProblemList bad_dbc_files;
|
||||
|
||||
#define LOAD_GT(tableName, store, file) LoadGameTable(bad_dbc_files, tableName, store, dbcPath, file)
|
||||
|
||||
LOAD_GT("BarberShopCostBase", sGtBarberShopCostBaseStore, "gtBarberShopCostBase.dbc"); // 20810
|
||||
LOAD_GT("CombatRatings", sGtCombatRatingsStore, "gtCombatRatings.dbc"); // 20810
|
||||
LOAD_GT("ChanceToMeleeCritBase", sGtChanceToMeleeCritBaseStore, "gtChanceToMeleeCritBase.dbc"); // 20810
|
||||
LOAD_GT("ChanceToMeleeCrit", sGtChanceToMeleeCritStore, "gtChanceToMeleeCrit.dbc"); // 20810
|
||||
LOAD_GT("ChanceToSpellCritBase", sGtChanceToSpellCritBaseStore, "gtChanceToSpellCritBase.dbc"); // 20810
|
||||
LOAD_GT("ChanceToSpellCrit", sGtChanceToSpellCritStore, "gtChanceToSpellCrit.dbc"); // 20810
|
||||
LOAD_GT("ItemSocketCostPerLevel", sGtItemSocketCostPerLevelStore, "gtItemSocketCostPerLevel.dbc"); // 20810
|
||||
LOAD_GT("NPCManaCostScaler", sGtNPCManaCostScalerStore, "gtNPCManaCostScaler.dbc"); // 20810
|
||||
LOAD_GT("NpcTotalHp", sGtNpcTotalHpStore[0], "gtNpcTotalHp.dbc"); // 20810
|
||||
LOAD_GT("NpcTotalHpExp1", sGtNpcTotalHpStore[1], "gtNpcTotalHpExp1.dbc"); // 20810
|
||||
LOAD_GT("NpcTotalHpExp2", sGtNpcTotalHpStore[2], "gtNpcTotalHpExp2.dbc"); // 20810
|
||||
LOAD_GT("NpcTotalHpExp3", sGtNpcTotalHpStore[3], "gtNpcTotalHpExp3.dbc"); // 20810
|
||||
LOAD_GT("NpcTotalHpExp4", sGtNpcTotalHpStore[4], "gtNpcTotalHpExp4.dbc"); // 20810
|
||||
LOAD_GT("NpcTotalHpExp5", sGtNpcTotalHpStore[5], "gtNpcTotalHpExp5.dbc"); // 20810
|
||||
LOAD_GT("NpcTotalHpExp6", sGtNpcTotalHpStore[6], "gtNpcTotalHpExp6.dbc"); // 20810
|
||||
LOAD_GT("NpcDamageByClass", sGtNpcDamageByClassStore[0], "gtNpcDamageByClass.dbc"); // 20810
|
||||
LOAD_GT("NpcDamageByClassExp1", sGtNpcDamageByClassStore[1], "gtNpcDamageByClassExp1.dbc"); // 20810
|
||||
LOAD_GT("NpcDamageByClassExp2", sGtNpcDamageByClassStore[2], "gtNpcDamageByClassExp2.dbc"); // 20810
|
||||
LOAD_GT("NpcDamageByClassExp3", sGtNpcDamageByClassStore[3], "gtNpcDamageByClassExp3.dbc"); // 20810
|
||||
LOAD_GT("NpcDamageByClassExp4", sGtNpcDamageByClassStore[4], "gtNpcDamageByClassExp4.dbc"); // 20810
|
||||
LOAD_GT("NpcDamageByClassExp5", sGtNpcDamageByClassStore[5], "gtNpcDamageByClassExp5.dbc"); // 20810
|
||||
LOAD_GT("NpcDamageByClassExp6", sGtNpcDamageByClassStore[6], "gtNpcDamageByClassExp6.dbc"); // 20810
|
||||
LOAD_GT("OCTHPPerStamina", sGtOCTHpPerStaminaStore, "gtOCTHpPerStamina.dbc"); // 20810
|
||||
LOAD_GT("OCTLevelExperience", sGtOCTLevelExperienceStore, "gtOCTLevelExperience.dbc"); // 20810
|
||||
LOAD_GT("RegenMPPerSpt", sGtRegenMPPerSptStore, "gtRegenMPPerSpt.dbc"); // 20810
|
||||
LOAD_GT("SpellScaling", sGtSpellScalingStore, "gtSpellScaling.dbc"); // 20810
|
||||
LOAD_GT("OCTBaseHPByClass", sGtOCTBaseHPByClassStore, "gtOCTBaseHPByClass.dbc"); // 20810
|
||||
LOAD_GT("OCTBaseMPByClass", sGtOCTBaseMPByClassStore, "gtOCTBaseMPByClass.dbc"); // 20810
|
||||
|
||||
#undef LOAD_GT
|
||||
|
||||
// error checks
|
||||
if (bad_dbc_files.size() >= GameTableCount)
|
||||
{
|
||||
TC_LOG_ERROR("misc", "Incorrect DataDir value in worldserver.conf or ALL required *.dbc GameTable files (%d) not found by path: %sdbc/%s/", DBCFileCount, dataPath.c_str(), localeNames[defaultLocale]);
|
||||
exit(1);
|
||||
}
|
||||
else if (!bad_dbc_files.empty())
|
||||
{
|
||||
std::string str;
|
||||
for (StoreProblemList::iterator i = bad_dbc_files.begin(); i != bad_dbc_files.end(); ++i)
|
||||
str += *i + "\n";
|
||||
|
||||
TC_LOG_ERROR("misc", "Some required *.dbc GameTable files (%u from %d) not found or not compatible:\n%s", (uint32)bad_dbc_files.size(), GameTableCount, str.c_str());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
TC_LOG_INFO("server.loading", ">> Initialized %d DBC GameTables data stores in %u ms", GameTableCount, GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
|
||||
std::vector<uint32> const* GetFactionTeamList(uint32 faction)
|
||||
{
|
||||
FactionTeamMap::const_iterator itr = sFactionTeamMap.find(faction);
|
||||
if (itr != sFactionTeamMap.end())
|
||||
return &itr->second;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
WMOAreaTableEntry const* GetWMOAreaTableEntryByTripple(int32 rootid, int32 adtid, int32 groupid)
|
||||
{
|
||||
WMOAreaInfoByTripple::iterator i = sWMOAreaInfoByTripple.find(WMOAreaTableTripple(rootid, adtid, groupid));
|
||||
if (i == sWMOAreaInfoByTripple.end())
|
||||
return NULL;
|
||||
return i->second;
|
||||
}
|
||||
|
||||
char const* GetClassName(uint8 class_, uint8 /*locale*/)
|
||||
{
|
||||
ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(class_);
|
||||
return classEntry ? classEntry->Name_lang : NULL;
|
||||
}
|
||||
|
||||
uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId)
|
||||
{
|
||||
if (mapid != 530 && mapid != 571 && mapid != 732) // speed for most cases
|
||||
return mapid;
|
||||
|
||||
if (WorldMapAreaEntry const* wma = sWorldMapAreaStore.LookupEntry(zoneId))
|
||||
return wma->DisplayMapID >= 0 ? wma->DisplayMapID : wma->MapID;
|
||||
|
||||
return mapid;
|
||||
}
|
||||
|
||||
uint32 GetMaxLevelForExpansion(uint32 expansion)
|
||||
{
|
||||
switch (expansion)
|
||||
{
|
||||
case EXPANSION_CLASSIC:
|
||||
return 60;
|
||||
case EXPANSION_THE_BURNING_CRUSADE:
|
||||
return 70;
|
||||
case EXPANSION_WRATH_OF_THE_LICH_KING:
|
||||
return 80;
|
||||
case EXPANSION_CATACLYSM:
|
||||
return 85;
|
||||
case EXPANSION_MISTS_OF_PANDARIA:
|
||||
return 90;
|
||||
case EXPANSION_WARLORDS_OF_DRAENOR:
|
||||
return 100;
|
||||
case EXPANSION_LEGION:
|
||||
return 110;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32 GetExpansionForLevel(uint32 level)
|
||||
{
|
||||
if (level < 60)
|
||||
return EXPANSION_CLASSIC;
|
||||
else if (level < 70)
|
||||
return EXPANSION_THE_BURNING_CRUSADE;
|
||||
else if (level < 80)
|
||||
return EXPANSION_WRATH_OF_THE_LICH_KING;
|
||||
else if (level < 85)
|
||||
return EXPANSION_CATACLYSM;
|
||||
else if (level < 90)
|
||||
return EXPANSION_MISTS_OF_PANDARIA;
|
||||
else if (level < 100)
|
||||
return EXPANSION_WARLORDS_OF_DRAENOR;
|
||||
else
|
||||
return CURRENT_EXPANSION;
|
||||
}
|
||||
|
||||
void Zone2MapCoordinates(float& x, float& y, uint32 worldMapAreaId)
|
||||
{
|
||||
WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(worldMapAreaId);
|
||||
|
||||
// if not listed then map coordinates (instance)
|
||||
if (!maEntry)
|
||||
return;
|
||||
|
||||
std::swap(x, y); // at client map coords swapped
|
||||
x = x*((maEntry->LocBottom-maEntry->LocTop)/100)+maEntry->LocTop;
|
||||
y = y*((maEntry->LocRight-maEntry->LocLeft)/100)+maEntry->LocLeft; // client y coord from top to down
|
||||
}
|
||||
|
||||
void Map2ZoneCoordinates(float& x, float& y, uint32 worldMapAreaId)
|
||||
{
|
||||
WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(worldMapAreaId);
|
||||
|
||||
// if not listed then map coordinates (instance)
|
||||
if (!maEntry)
|
||||
return;
|
||||
|
||||
x = (x - maEntry->LocTop) / ((maEntry->LocBottom - maEntry->LocTop) / 100);
|
||||
y = (y - maEntry->LocLeft) / ((maEntry->LocRight - maEntry->LocLeft) / 100); // client y coord from top to down
|
||||
std::swap(x, y); // client have map coords swapped
|
||||
}
|
||||
|
||||
MapDifficultyEntry const* GetDefaultMapDifficulty(uint32 mapId, Difficulty* difficulty /*= nullptr*/)
|
||||
{
|
||||
auto itr = sMapDifficultyMap.find(mapId);
|
||||
if (itr == sMapDifficultyMap.end())
|
||||
return nullptr;
|
||||
|
||||
if (itr->second.empty())
|
||||
return nullptr;
|
||||
|
||||
for (auto& p : itr->second)
|
||||
{
|
||||
DifficultyEntry const* difficultyEntry = sDifficultyStore.LookupEntry(p.first);
|
||||
if (!difficultyEntry)
|
||||
continue;
|
||||
|
||||
if (difficultyEntry->Flags & DIFFICULTY_FLAG_DEFAULT)
|
||||
{
|
||||
if (difficulty)
|
||||
*difficulty = Difficulty(p.first);
|
||||
|
||||
return p.second;
|
||||
}
|
||||
}
|
||||
|
||||
if (difficulty)
|
||||
*difficulty = Difficulty(itr->second.begin()->first);
|
||||
|
||||
return itr->second.begin()->second;
|
||||
}
|
||||
|
||||
MapDifficultyEntry const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty)
|
||||
{
|
||||
auto itr = sMapDifficultyMap.find(mapId);
|
||||
if (itr == sMapDifficultyMap.end())
|
||||
return nullptr;
|
||||
|
||||
auto diffItr = itr->second.find(difficulty);
|
||||
if (diffItr == itr->second.end())
|
||||
return nullptr;
|
||||
|
||||
return diffItr->second;
|
||||
}
|
||||
|
||||
MapDifficultyEntry const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty)
|
||||
{
|
||||
DifficultyEntry const* diffEntry = sDifficultyStore.LookupEntry(difficulty);
|
||||
if (!diffEntry)
|
||||
return GetDefaultMapDifficulty(mapId, &difficulty);
|
||||
|
||||
uint32 tmpDiff = difficulty;
|
||||
MapDifficultyEntry const* mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff));
|
||||
while (!mapDiff)
|
||||
{
|
||||
tmpDiff = diffEntry->FallbackDifficultyID;
|
||||
diffEntry = sDifficultyStore.LookupEntry(tmpDiff);
|
||||
if (!diffEntry)
|
||||
return GetDefaultMapDifficulty(mapId, &difficulty);
|
||||
|
||||
// pull new data
|
||||
mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff)); // we are 10 normal or 25 normal
|
||||
}
|
||||
|
||||
difficulty = Difficulty(tmpDiff);
|
||||
return mapDiff;
|
||||
}
|
||||
|
||||
uint32 GetLiquidFlags(uint32 liquidType)
|
||||
{
|
||||
if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquidType))
|
||||
return 1 << liq->Type;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
CharSectionsEntry const* GetCharSectionEntry(uint8 race, CharSectionType genType, uint8 gender, uint8 type, uint8 color)
|
||||
{
|
||||
std::pair<CharSectionsMap::const_iterator, CharSectionsMap::const_iterator> eqr = sCharSectionMap.equal_range(uint32(genType) | uint32(gender << 8) | uint32(race << 16));
|
||||
for (CharSectionsMap::const_iterator itr = eqr.first; itr != eqr.second; ++itr)
|
||||
{
|
||||
if (itr->second->Type == type && itr->second->Color == color)
|
||||
return itr->second;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/// Returns LFGDungeonEntry for a specific map and difficulty. Will return first found entry if multiple dungeons use the same map (such as Scarlet Monastery)
|
||||
LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty)
|
||||
{
|
||||
for (uint32 i = 0; i < sLFGDungeonStore.GetNumRows(); ++i)
|
||||
{
|
||||
LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(i);
|
||||
if (!dungeon)
|
||||
continue;
|
||||
|
||||
if (dungeon->MapID == int32(mapId) && Difficulty(dungeon->DifficultyID) == difficulty)
|
||||
return dungeon;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint32 GetDefaultMapLight(uint32 mapId)
|
||||
{
|
||||
for (int32 i = sLightStore.GetNumRows(); i >= 0; --i)
|
||||
{
|
||||
LightEntry const* light = sLightStore.LookupEntry(uint32(i));
|
||||
if (!light)
|
||||
continue;
|
||||
|
||||
if (light->MapID == mapId && light->Pos.X == 0.0f && light->Pos.Y == 0.0f && light->Pos.Z == 0.0f)
|
||||
return light->ID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_DBCSTORES_H
|
||||
#define TRINITY_DBCSTORES_H
|
||||
|
||||
#include "DBCStore.h"
|
||||
#include "DBCStructure.h"
|
||||
#include "DB2Structure.h"
|
||||
#include "SharedDefines.h"
|
||||
|
||||
// CharSections
|
||||
TC_GAME_API CharSectionsEntry const* GetCharSectionEntry(uint8 race, CharSectionType genType, uint8 gender, uint8 type, uint8 color);
|
||||
|
||||
// ChrClasses
|
||||
TC_GAME_API char const* GetClassName(uint8 class_, uint8 locale);
|
||||
|
||||
// Faction
|
||||
TC_GAME_API std::vector<uint32> const* GetFactionTeamList(uint32 faction);
|
||||
|
||||
// LfgDungeons
|
||||
TC_GAME_API LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty);
|
||||
|
||||
// Light
|
||||
TC_GAME_API uint32 GetDefaultMapLight(uint32 mapId);
|
||||
|
||||
// LiquidType
|
||||
TC_GAME_API uint32 GetLiquidFlags(uint32 liquidType);
|
||||
|
||||
// MapDifficulty
|
||||
typedef std::unordered_map<uint32, std::unordered_map<uint32, MapDifficultyEntry const*>> MapDifficultyMap;
|
||||
TC_GAME_API MapDifficultyEntry const* GetDefaultMapDifficulty(uint32 mapId, Difficulty* difficulty = nullptr);
|
||||
TC_GAME_API MapDifficultyEntry const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty);
|
||||
TC_GAME_API MapDifficultyEntry const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty);
|
||||
|
||||
// Talent
|
||||
typedef std::vector<TalentEntry const*> TalentsByPosition[MAX_CLASSES][MAX_TALENT_TIERS][MAX_TALENT_COLUMNS];
|
||||
|
||||
// WMOAreaTable
|
||||
TC_GAME_API WMOAreaTableEntry const* GetWMOAreaTableEntryByTripple(int32 rootid, int32 adtid, int32 groupid);
|
||||
|
||||
// WorldMapArea
|
||||
TC_GAME_API uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId);
|
||||
TC_GAME_API void Zone2MapCoordinates(float &x, float &y, uint32 worldMapAreaId);
|
||||
TC_GAME_API void Map2ZoneCoordinates(float &x, float &y, uint32 worldMapAreaId);
|
||||
|
||||
TC_GAME_API uint32 GetMaxLevelForExpansion(uint32 expansion);
|
||||
TC_GAME_API uint32 GetExpansionForLevel(uint32 level);
|
||||
|
||||
template<class T>
|
||||
class GameTable
|
||||
{
|
||||
public:
|
||||
GameTable() : _storage("df"), _gtEntry(nullptr) { }
|
||||
|
||||
void SetGameTableEntry(GameTablesEntry const* gtEntry) { _gtEntry = gtEntry; }
|
||||
|
||||
T const* EvaluateTable(uint32 row, uint32 column) const
|
||||
{
|
||||
ASSERT(row < _gtEntry->NumRows, "Requested row %u from GameTable %s but there are only %u rows!", row, _gtEntry->Name->Str[0], _gtEntry->NumRows);
|
||||
ASSERT(column < _gtEntry->NumColumns, "Requested column %u from GameTable %s but there are only %u columns!", column, _gtEntry->Name->Str[0], _gtEntry->NumColumns);
|
||||
|
||||
return _storage.LookupEntry(_gtEntry->NumRows * column + row);
|
||||
}
|
||||
|
||||
char const* GetFormat() const { return _storage.GetFormat(); }
|
||||
uint32 GetFieldCount() const { return _storage.GetFieldCount(); }
|
||||
bool Load(char const* fileName) { return _storage.Load(fileName, nullptr); }
|
||||
|
||||
uint32 GetTableRowCount() const { return _gtEntry->NumRows; }
|
||||
uint32 GetTableColumnCount() const { return _gtEntry->NumColumns; }
|
||||
|
||||
private:
|
||||
DBCStorage<T> _storage;
|
||||
GameTablesEntry const* _gtEntry;
|
||||
};
|
||||
|
||||
TC_GAME_API extern DBCStorage<BannedAddOnsEntry> sBannedAddOnsStore;
|
||||
TC_GAME_API extern DBCStorage<BattlemasterListEntry> sBattlemasterListStore;
|
||||
TC_GAME_API extern DBCStorage<CharSectionsEntry> sCharSectionsStore;
|
||||
TC_GAME_API extern DBCStorage<ChrClassesEntry> sChrClassesStore;
|
||||
TC_GAME_API extern DBCStorage<CreatureModelDataEntry> sCreatureModelDataStore;
|
||||
TC_GAME_API extern DBCStorage<FactionEntry> sFactionStore;
|
||||
TC_GAME_API extern DBCStorage<FactionTemplateEntry> sFactionTemplateStore;
|
||||
TC_GAME_API extern DBCStorage<LFGDungeonEntry> sLFGDungeonStore;
|
||||
TC_GAME_API extern DBCStorage<LiquidTypeEntry> sLiquidTypeStore;
|
||||
TC_GAME_API extern MapDifficultyMap sMapDifficultyMap;
|
||||
TC_GAME_API extern DBCStorage<SpellItemEnchantmentEntry> sSpellItemEnchantmentStore;
|
||||
TC_GAME_API extern DBCStorage<TalentEntry> sTalentStore;
|
||||
TC_GAME_API extern TalentsByPosition sTalentByPos;
|
||||
TC_GAME_API extern DBCStorage<VehicleEntry> sVehicleStore;
|
||||
TC_GAME_API extern DBCStorage<WMOAreaTableEntry> sWMOAreaTableStore;
|
||||
TC_GAME_API extern DBCStorage<WorldSafeLocsEntry> sWorldSafeLocsStore;
|
||||
|
||||
TC_GAME_API extern GameTable<GtArmorMitigationByLvlEntry> sGtArmorMitigationByLvlStore;
|
||||
TC_GAME_API extern GameTable<GtBarberShopCostBaseEntry> sGtBarberShopCostBaseStore;
|
||||
TC_GAME_API extern GameTable<GtChanceToMeleeCritBaseEntry> sGtChanceToMeleeCritBaseStore;
|
||||
TC_GAME_API extern GameTable<GtChanceToMeleeCritEntry> sGtChanceToMeleeCritStore;
|
||||
TC_GAME_API extern GameTable<GtChanceToSpellCritBaseEntry> sGtChanceToSpellCritBaseStore;
|
||||
TC_GAME_API extern GameTable<GtChanceToSpellCritEntry> sGtChanceToSpellCritStore;
|
||||
TC_GAME_API extern GameTable<GtCombatRatingsEntry> sGtCombatRatingsStore;
|
||||
TC_GAME_API extern GameTable<GtItemSocketCostPerLevelEntry> sGtItemSocketCostPerLevelStore;
|
||||
TC_GAME_API extern GameTable<GtNPCManaCostScalerEntry> sGtNPCManaCostScalerStore;
|
||||
TC_GAME_API extern GameTable<GtNpcTotalHpEntry> sGtNpcTotalHpStore[MAX_EXPANSIONS];
|
||||
TC_GAME_API extern GameTable<GtNpcDamageByClassEntry> sGtNpcDamageByClassStore[MAX_EXPANSIONS];
|
||||
TC_GAME_API extern GameTable<GtOCTBaseHPByClassEntry> sGtOCTBaseHPByClassStore;
|
||||
TC_GAME_API extern GameTable<GtOCTBaseMPByClassEntry> sGtOCTBaseMPByClassStore;
|
||||
TC_GAME_API extern GameTable<GtOCTLevelExperienceEntry> sGtOCTLevelExperienceStore;
|
||||
TC_GAME_API extern GameTable<GtRegenMPPerSptEntry> sGtRegenMPPerSptStore;
|
||||
TC_GAME_API extern GameTable<GtSpellScalingEntry> sGtSpellScalingStore;
|
||||
TC_GAME_API extern GameTable<GtOCTHpPerStaminaEntry> sGtOCTHpPerStaminaStore;
|
||||
|
||||
TC_GAME_API void LoadDBCStores(const std::string& dataPath, uint32 defaultLocale);
|
||||
TC_GAME_API void LoadGameTables(const std::string& dataPath, uint32 defaultLocale);
|
||||
|
||||
#endif
|
||||
@@ -1,614 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_DBCSTRUCTURE_H
|
||||
#define TRINITY_DBCSTRUCTURE_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "DBCEnums.h"
|
||||
#include "Util.h"
|
||||
|
||||
// Structures using to access raw DBC data and required packing to portability
|
||||
#pragma pack(push, 1)
|
||||
|
||||
struct BannedAddOnsEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
//uint32 NameMD5[4]; // 1
|
||||
//uint32 VersionMD5[4]; // 2
|
||||
//uint32 LastModified; // 3
|
||||
//uint32 Flags; // 4
|
||||
};
|
||||
|
||||
struct BattlemasterListEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
int32 MapID[16]; // 1-16 mapid
|
||||
uint32 InstanceType; // 17 map type (3 - BG, 4 - arena)
|
||||
//uint32 GroupsAllowed; // 18 (0 or 1)
|
||||
char* Name_lang; // 19
|
||||
uint32 MaxGroupSize; // 20 maxGroupSize, used for checking if queue as group
|
||||
uint32 HolidayWorldState; // 21 new 3.1
|
||||
uint32 MinLevel; // 22, min level (sync with PvPDifficulty.dbc content)
|
||||
uint32 MaxLevel; // 23, max level (sync with PvPDifficulty.dbc content)
|
||||
//uint32 RatedPlayers; // 24 4.0.1
|
||||
//uint32 MinPlayers; // 25 - 4.0.6.13596
|
||||
//uint32 MaxPlayers; // 26 4.0.1
|
||||
//uint32 Flags; // 27 4.0.3, value 2 for Rated Battlegrounds
|
||||
//uint32 IconFileDataID; // 28
|
||||
//char* GameType_lang; // 29
|
||||
//uint32 PlayerConditionID; // 30
|
||||
};
|
||||
|
||||
enum CharSectionFlags
|
||||
{
|
||||
SECTION_FLAG_PLAYER = 0x01,
|
||||
SECTION_FLAG_DEATH_KNIGHT = 0x04,
|
||||
SECTION_FLAG_DEMON_HUNTER = 0x40
|
||||
};
|
||||
|
||||
enum CharSectionType
|
||||
{
|
||||
SECTION_TYPE_SKIN = 0,
|
||||
SECTION_TYPE_FACE = 1,
|
||||
SECTION_TYPE_FACIAL_HAIR = 2,
|
||||
SECTION_TYPE_HAIR = 3,
|
||||
SECTION_TYPE_UNDERWEAR = 4,
|
||||
SECTION_TYPE_CUSTOM_DISPLAY_1 = 10,
|
||||
SECTION_TYPE_CUSTOM_DISPLAY_2 = 12,
|
||||
SECTION_TYPE_CUSTOM_DISPLAY_3 = 14
|
||||
};
|
||||
|
||||
struct CharSectionsEntry
|
||||
{
|
||||
//uint32 Id;
|
||||
uint32 Race;
|
||||
uint32 Gender;
|
||||
uint32 GenType;
|
||||
//uint32 TextureFileDataID[3];
|
||||
uint32 Flags;
|
||||
uint32 Type;
|
||||
uint32 Color;
|
||||
};
|
||||
|
||||
struct ChrClassesEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
uint32 PowerType; // 1
|
||||
//char* PetNameToken // 2
|
||||
char* Name_lang; // 3
|
||||
//char* NameFemale_lang; // 4
|
||||
//char* NameMale_lang; // 5
|
||||
//char* Filename; // 6
|
||||
uint32 SpellClassSet; // 7
|
||||
//uint32 Flags; // 8
|
||||
uint32 CinematicSequenceID; // 9
|
||||
uint32 AttackPowerPerStrength; // 10 Attack Power bonus per point of strength
|
||||
uint32 AttackPowerPerAgility; // 11 Attack Power bonus per point of agility
|
||||
uint32 RangedAttackPowerPerAgility; // 12 Ranged Attack Power bonus per point of agility
|
||||
uint32 DefaultSpec; // 13
|
||||
//uint32 CreateScreenFileDataID; // 14
|
||||
//uint32 SelectScreenFileDataID; // 15
|
||||
//uint32 LowResScreenFileDataID; // 16
|
||||
//uint32 IconFileDataID; // 17
|
||||
//uint32 Unk1; // 18
|
||||
};
|
||||
|
||||
struct CreatureModelDataEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
uint32 Flags; // 1
|
||||
uint32 FileDataID; // 2
|
||||
//uint32 SizeClass; // 3
|
||||
//float ModelScale; // 4
|
||||
//uint32 BloodID; // 5
|
||||
//uint32 FootprintTextureID; // 6
|
||||
//float FootprintTextureLength; // 7
|
||||
//float FootprintTextureWidth; // 8
|
||||
//float FootprintParticleScale; // 9
|
||||
//uint32 FoleyMaterialID; // 10
|
||||
//uint32 Unk700_1; // 11
|
||||
//uint32 Unk700_2; // 12
|
||||
//uint32 FootstepShakeSize; // 13
|
||||
//uint32 DeathThudShakeSize; // 14
|
||||
//uint32 SoundID; // 15
|
||||
//float CollisionWidth; // 16
|
||||
float CollisionHeight; // 17
|
||||
float MountHeight; // 18
|
||||
//float GeoBoxMin[3]; // 19-21
|
||||
//float GeoBoxMax[3]; // 22-24
|
||||
//float WorldEffectScale; // 25
|
||||
//float AttachedEffectScale; // 26
|
||||
//float MissileCollisionRadius; // 27
|
||||
//float MissileCollisionPush; // 28
|
||||
//float MissileCollisionRaise; // 29
|
||||
//float OverrideLootEffectScale; // 30
|
||||
//float OverrideNameScale; // 31
|
||||
//float OverrideSelectionRadius; // 32
|
||||
//float TamedPetBaseScale; // 33
|
||||
//uint32 CreatureGeosetDataID; // 34
|
||||
//float HoverHeight; // 35
|
||||
};
|
||||
|
||||
/* not used
|
||||
struct CurrencyCategoryEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
uint32 Unk1; // 1 0 for known categories and 3 for unknown one (3.0.9)
|
||||
char* Name[16]; // 2-17 name
|
||||
// // 18 string flags
|
||||
};
|
||||
*/
|
||||
|
||||
struct FactionEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
int32 ReputationIndex; // 1
|
||||
uint32 ReputationRaceMask[4]; // 2-5
|
||||
uint32 ReputationClassMask[4]; // 6-9
|
||||
int32 ReputationBase[4]; // 10-13
|
||||
uint32 ReputationFlags[4]; // 14-17
|
||||
uint32 ParentFactionID; // 18
|
||||
float ParentFactionModIn; // 19 Faction gains incoming rep * ParentFactionModIn
|
||||
float ParentFactionModOut; // 20 Faction outputs rep * ParentFactionModOut as spillover reputation
|
||||
uint32 ParentFactionCapIn; // 21 The highest rank the faction will profit from incoming spillover
|
||||
//uint32 ParentFactionCapOut; // 22
|
||||
char* Name_lang; // 23
|
||||
//char* Description_lang; // 24
|
||||
uint32 Expansion; // 25
|
||||
//uint32 Flags; // 26
|
||||
//uint32 FriendshipRepID; // 27
|
||||
|
||||
// helpers
|
||||
bool CanHaveReputation() const
|
||||
{
|
||||
return ReputationIndex >= 0;
|
||||
}
|
||||
};
|
||||
|
||||
#define MAX_FACTION_RELATIONS 4
|
||||
|
||||
struct FactionTemplateEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
uint32 Faction; // 1
|
||||
uint32 Flags; // 2
|
||||
uint32 Mask; // 3 m_factionGroup
|
||||
uint32 FriendMask; // 4 m_friendGroup
|
||||
uint32 EnemyMask; // 5 m_enemyGroup
|
||||
uint32 Enemies[MAX_FACTION_RELATIONS]; // 6
|
||||
uint32 Friends[MAX_FACTION_RELATIONS]; // 10
|
||||
//------------------------------------------------------- end structure
|
||||
|
||||
// helpers
|
||||
bool IsFriendlyTo(FactionTemplateEntry const& entry) const
|
||||
{
|
||||
if (ID == entry.ID)
|
||||
return true;
|
||||
if (entry.Faction)
|
||||
{
|
||||
for (int i = 0; i < MAX_FACTION_RELATIONS; ++i)
|
||||
if (Enemies[i] == entry.Faction)
|
||||
return false;
|
||||
for (int i = 0; i < MAX_FACTION_RELATIONS; ++i)
|
||||
if (Friends[i] == entry.Faction)
|
||||
return true;
|
||||
}
|
||||
return (FriendMask & entry.Mask) || (Mask & entry.FriendMask);
|
||||
}
|
||||
bool IsHostileTo(FactionTemplateEntry const& entry) const
|
||||
{
|
||||
if (ID == entry.ID)
|
||||
return false;
|
||||
if (entry.Faction)
|
||||
{
|
||||
for (int i = 0; i < MAX_FACTION_RELATIONS; ++i)
|
||||
if (Enemies[i] == entry.Faction)
|
||||
return true;
|
||||
for (int i = 0; i < MAX_FACTION_RELATIONS; ++i)
|
||||
if (Friends[i] == entry.Faction)
|
||||
return false;
|
||||
}
|
||||
return (EnemyMask & entry.Mask) != 0;
|
||||
}
|
||||
bool IsHostileToPlayers() const { return (EnemyMask & FACTION_MASK_PLAYER) !=0; }
|
||||
bool IsNeutralToAll() const
|
||||
{
|
||||
for (int i = 0; i < MAX_FACTION_RELATIONS; ++i)
|
||||
if (Enemies[i] != 0)
|
||||
return false;
|
||||
return EnemyMask == 0 && FriendMask == 0;
|
||||
}
|
||||
bool IsContestedGuardFaction() const { return (Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) != 0; }
|
||||
};
|
||||
|
||||
struct GtArmorMitigationByLvlEntry
|
||||
{
|
||||
//uint32 level;
|
||||
float KFactor;
|
||||
};
|
||||
|
||||
struct GtBarberShopCostBaseEntry
|
||||
{
|
||||
//uint32 level;
|
||||
float cost;
|
||||
};
|
||||
|
||||
struct GtCombatRatingsEntry
|
||||
{
|
||||
//uint32 level;
|
||||
float ratio;
|
||||
};
|
||||
|
||||
struct GtChanceToMeleeCritBaseEntry
|
||||
{
|
||||
//uint32 level;
|
||||
float base;
|
||||
};
|
||||
|
||||
struct GtChanceToMeleeCritEntry
|
||||
{
|
||||
//uint32 level;
|
||||
float ratio;
|
||||
};
|
||||
|
||||
struct GtChanceToSpellCritBaseEntry
|
||||
{
|
||||
float base;
|
||||
};
|
||||
|
||||
struct GtItemSocketCostPerLevelEntry
|
||||
{
|
||||
float ratio;
|
||||
};
|
||||
|
||||
struct GtNPCManaCostScalerEntry
|
||||
{
|
||||
float ratio;
|
||||
};
|
||||
|
||||
struct GtNpcDamageByClassEntry
|
||||
{
|
||||
float Damage;
|
||||
};
|
||||
|
||||
struct GtNpcTotalHpEntry
|
||||
{
|
||||
float HP;
|
||||
};
|
||||
|
||||
struct GtChanceToSpellCritEntry
|
||||
{
|
||||
float ratio;
|
||||
};
|
||||
|
||||
struct GtOCTLevelExperienceEntry
|
||||
{
|
||||
float Data;
|
||||
};
|
||||
|
||||
struct GtOCTRegenHPEntry
|
||||
{
|
||||
float ratio;
|
||||
};
|
||||
|
||||
struct GtOCTRegenMPEntry
|
||||
{
|
||||
float ratio;
|
||||
};
|
||||
|
||||
struct GtOCTHpPerStaminaEntry
|
||||
{
|
||||
float ratio;
|
||||
};
|
||||
|
||||
struct GtRegenHPPerSptEntry
|
||||
{
|
||||
float ratio;
|
||||
};
|
||||
|
||||
struct GtRegenMPPerSptEntry
|
||||
{
|
||||
float ratio;
|
||||
};
|
||||
|
||||
struct GtSpellScalingEntry
|
||||
{
|
||||
float value;
|
||||
};
|
||||
|
||||
struct GtOCTBaseHPByClassEntry
|
||||
{
|
||||
float ratio;
|
||||
};
|
||||
|
||||
struct GtOCTBaseMPByClassEntry
|
||||
{
|
||||
float ratio;
|
||||
};
|
||||
|
||||
struct ItemDisplayInfoEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
//char* ModelName[2]; // 1-2
|
||||
//char* ModelTexture[2]; // 3-4
|
||||
//uint32 GeoSetGroup[3]; // 5-7
|
||||
//uint32 Flags; // 8
|
||||
//uint32 SpellVisualID; // 9
|
||||
//uint32 HelmetGeosetVis[2]; // 10-11
|
||||
//char* Texture[9]; // 12-20
|
||||
//uint32 ItemVisual; // 21
|
||||
//uint32 ParticleColorID; // 22
|
||||
};
|
||||
|
||||
struct LFGDungeonEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
char* Name_lang; // 1
|
||||
uint32 MinLevel; // 2
|
||||
uint32 MaxLevel; // 3
|
||||
uint32 TargetLevel; // 4
|
||||
//uint32 TargetLevelMin; // 5
|
||||
//uint32 TargetLevelMax; // 6
|
||||
int32 MapID; // 7
|
||||
uint32 DifficultyID; // 8
|
||||
uint32 Flags; // 9
|
||||
uint32 Type; // 10
|
||||
//uint32 Faction; // 11
|
||||
//char* TextureFilename; // 12
|
||||
uint32 Expansion; // 13
|
||||
//uint32 OrderIndex; // 14
|
||||
uint32 GroupID; // 15
|
||||
//char* Description_lang; // 16
|
||||
//uint32 RandomID; // 17
|
||||
//uint32 CountTank; // 18
|
||||
//uint32 CountHealer; // 19
|
||||
//uint32 CountDamage; // 20
|
||||
//uint32 MinCountTank; // 21
|
||||
//uint32 MinCountHealer; // 22
|
||||
//uint32 MinCountDamage; // 23
|
||||
//uint32 ScenarioID; // 24
|
||||
//uint32 SubType; // 25
|
||||
//uint32 LastBossJournalEncounterID; // 26
|
||||
//uint32 BonusReputationAmount; // 27
|
||||
//uint32 MentorCharLevel; // 28
|
||||
//uint32 MentorItemLevel; // 29
|
||||
|
||||
// Helpers
|
||||
uint32 Entry() const { return ID + (Type << 24); }
|
||||
};
|
||||
|
||||
struct LightEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
uint32 MapID; // 1
|
||||
DBCPosition3D Pos; // 2-4
|
||||
//float FalloffStart; // 5
|
||||
//float FalloffEnd; // 6
|
||||
//uint32 LightParamsID[8]; // 7-14
|
||||
};
|
||||
|
||||
struct LiquidTypeEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
//char* Name; // 1
|
||||
//uint32 Flags; // 2
|
||||
uint32 Type; // 3 m_soundBank
|
||||
//uint32 SoundID; // 4
|
||||
uint32 SpellID; // 5
|
||||
//float MaxDarkenDepth; // 6
|
||||
//float FogDarkenIntensity; // 7
|
||||
//float AmbDarkenIntensity; // 8
|
||||
//float DirDarkenIntensity; // 9
|
||||
//uint32 LightID; // 10
|
||||
//float ParticleScale; // 11
|
||||
//uint32 ParticleMovement; // 12
|
||||
//uint32 ParticleTexSlots; // 13
|
||||
//uint32 MaterialID; // 14
|
||||
//char* Texture[6]; // 15-20
|
||||
//uint32 DepthTexCount[6] // 21-26
|
||||
//uint32 Color[2]; // 27-28
|
||||
//float Float[18]; // 29-46
|
||||
//uint32 Int[4]; // 47-50
|
||||
};
|
||||
|
||||
struct MapDifficultyEntry
|
||||
{
|
||||
//uint32 ID; // 0
|
||||
uint32 MapID; // 1
|
||||
uint32 DifficultyID; // 2 (for arenas: arena slot)
|
||||
char* Message_lang; // 3 m_message_lang (text showed when transfer to map failed)
|
||||
uint32 RaidDuration; // 4 m_raidDuration in secs, 0 if no fixed reset time
|
||||
uint32 MaxPlayers; // 5 m_maxPlayers some heroic versions have 0 when expected same amount as in normal version
|
||||
uint32 LockID; // 6
|
||||
uint32 ItemBonusTreeModID; // 7
|
||||
|
||||
bool HasMessage() const { return Message_lang[0] != '\0'; }
|
||||
};
|
||||
|
||||
#define MAX_ITEM_ENCHANTMENT_EFFECTS 3
|
||||
|
||||
struct SpellItemEnchantmentEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
uint32 Charges; // 1
|
||||
uint32 Effect[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 2-4
|
||||
uint32 EffectPointsMin[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 5-7
|
||||
uint32 EffectSpellID[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 8-10
|
||||
//char* Name_lang // 11
|
||||
uint32 ItemVisual; // 12
|
||||
uint32 Flags; // 13
|
||||
uint32 ConditionID; // 14
|
||||
uint32 RequiredSkillID; // 15
|
||||
uint32 RequiredSkillRank; // 16
|
||||
uint32 MinLevel; // 17
|
||||
uint32 MaxLevel; // 18
|
||||
uint32 ItemLevel; // 19
|
||||
int32 ScalingClass; // 20
|
||||
int32 ScalingClassRestricted; // 21
|
||||
float EffectScalingPoints[MAX_ITEM_ENCHANTMENT_EFFECTS];//22-24
|
||||
//uint32 PlayerConditionID; // 25
|
||||
//uint32 TransmogCost; // 26
|
||||
//uint32 TextureFileDataID; // 27
|
||||
};
|
||||
|
||||
struct StableSlotPricesEntry
|
||||
{
|
||||
uint32 Slot;
|
||||
uint32 Price;
|
||||
};
|
||||
|
||||
#define MAX_TALENT_TIERS 7
|
||||
#define MAX_TALENT_COLUMNS 3
|
||||
|
||||
struct TalentEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
uint32 SpecID; // 1 0 - any specialization
|
||||
uint32 TierID; // 2 0-6
|
||||
uint32 ColumnIndex; // 3 0-2
|
||||
uint32 SpellID; // 4
|
||||
uint32 Flags; // 5 All 0
|
||||
uint32 CategoryMask[2]; // 6 All 0
|
||||
uint32 ClassID; // 7
|
||||
uint32 OverridesSpellID; // 8 spellid that is replaced by talent
|
||||
//char* Description_lang
|
||||
};
|
||||
|
||||
#define MAX_VEHICLE_SEATS 8
|
||||
|
||||
struct VehicleEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
uint32 Flags; // 1
|
||||
uint32 FlagsB; // 2
|
||||
float TurnSpeed; // 3
|
||||
float PitchSpeed; // 4
|
||||
float PitchMin; // 5
|
||||
float PitchMax; // 6
|
||||
uint32 SeatID[MAX_VEHICLE_SEATS]; // 7-14
|
||||
float MouseLookOffsetPitch; // 15
|
||||
float CameraFadeDistScalarMin; // 16
|
||||
float CameraFadeDistScalarMax; // 17
|
||||
float CameraPitchOffset; // 18
|
||||
float FacingLimitRight; // 19
|
||||
float FacingLimitLeft; // 20
|
||||
float MsslTrgtTurnLingering; // 21
|
||||
float MsslTrgtPitchLingering; // 22
|
||||
float MsslTrgtMouseLingering; // 23
|
||||
float MsslTrgtEndOpacity; // 24
|
||||
float MsslTrgtArcSpeed; // 25
|
||||
float MsslTrgtArcRepeat; // 26
|
||||
float MsslTrgtArcWidth; // 27
|
||||
float MsslTrgtImpactRadius[2]; // 28-29
|
||||
//char* MsslTrgtArcTexture; // 30
|
||||
//char* MsslTrgtImpactTexture; // 31
|
||||
//char* MsslTrgtImpactModel; // 32-33
|
||||
float CameraYawOffset; // 34
|
||||
uint32 UILocomotionType; // 35
|
||||
float MsslTrgtImpactTexRadius; // 36
|
||||
uint32 VehicleUIIndicatorID; // 37
|
||||
uint32 PowerDisplayID[3]; // 38-40
|
||||
};
|
||||
|
||||
struct WMOAreaTableEntry
|
||||
{
|
||||
uint32 ID; // 0 index
|
||||
int32 WMOID; // 1 used in root WMO
|
||||
int32 NameSet; // 2 used in adt file
|
||||
int32 WMOGroupID; // 3 used in group WMO
|
||||
//uint32 SoundProviderPref; // 4
|
||||
//uint32 SoundProviderPrefUnderwater; // 5
|
||||
//uint32 AmbienceID; // 6
|
||||
//uint32 ZoneMusic; // 7
|
||||
//uint32 IntroSound; // 8
|
||||
uint32 Flags; // 9 used for indoor/outdoor determination
|
||||
uint32 AreaTableID; // 10 link to AreaTableEntry.ID
|
||||
//char* AreaName_lang; // 11 m_AreaName_lang
|
||||
//uint32 UWIntroSound; // 12
|
||||
//uint32 UWZoneMusic; // 13
|
||||
//uint32 UWAmbience; // 14
|
||||
};
|
||||
|
||||
struct WorldMapAreaEntry
|
||||
{
|
||||
//uint32 ID; // 0
|
||||
uint32 MapID; // 1
|
||||
uint32 AreaID; // 2 index (continent 0 areas ignored)
|
||||
//char* AreaName // 3
|
||||
float LocLeft; // 4
|
||||
float LocRight; // 5
|
||||
float LocTop; // 6
|
||||
float LocBottom; // 7
|
||||
int32 DisplayMapID; // 8 -1 (map_id have correct map) other: virtual map where zone show (map_id - where zone in fact internally)
|
||||
//int32 DefaultDungeonFloor; // 9 pointer to DungeonMap.dbc (owerride loc coordinates)
|
||||
//uint32 ParentWorldMapID; // 10
|
||||
//uint32 Flags; // 11
|
||||
//uint32 LevelRangeMin; // 12 Minimum recommended level displayed on world map
|
||||
//uint32 LevelRangeMax; // 13 Maximum recommended level displayed on world map
|
||||
};
|
||||
|
||||
struct WorldSafeLocsEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
uint32 MapID; // 1
|
||||
DBCPosition3D Loc; // 2-4
|
||||
float Facing; // 5 values are in degrees
|
||||
//char* AreaName_lang; // 6
|
||||
};
|
||||
|
||||
/*
|
||||
struct WorldStateSounds
|
||||
{
|
||||
uint32 ID; // 0 Worldstate
|
||||
uint32 unk; // 1
|
||||
uint32 areaTable; // 2
|
||||
uint32 WMOAreaTable; // 3
|
||||
uint32 zoneIntroMusicTable; // 4
|
||||
uint32 zoneIntroMusic; // 5
|
||||
uint32 zoneMusic; // 6
|
||||
uint32 soundAmbience; // 7
|
||||
uint32 soundProviderPreferences; // 8
|
||||
};
|
||||
*/
|
||||
|
||||
/*
|
||||
struct WorldStateUI
|
||||
{
|
||||
uint32 ID; // 0
|
||||
uint32 map_id; // 1 Can be -1 to show up everywhere.
|
||||
uint32 zone; // 2 Can be zero for "everywhere".
|
||||
uint32 phaseMask; // 3 Phase this WorldState is avaliable in
|
||||
uint32 icon; // 4 The icon that is used in the interface.
|
||||
char* textureFilename; // 5
|
||||
char* text; // 6-21 The worldstate text
|
||||
char* description; // 22-38 Text shown when hovering mouse on icon
|
||||
uint32 worldstateID; // 39 This is the actual ID used
|
||||
uint32 type; // 40 0 = unknown, 1 = unknown, 2 = not shown in ui, 3 = wintergrasp
|
||||
uint32 unk1; // 41
|
||||
uint32 unk2; // 43
|
||||
uint32 unk3; // 44-58
|
||||
uint32 unk4; // 59-61 Used for some progress bars.
|
||||
uint32 unk7; // 62 Unused in 3.3.5a
|
||||
};
|
||||
*/
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
typedef std::map<uint32, uint32> TalentSpellPosMap;
|
||||
#endif
|
||||
@@ -22,23 +22,5 @@
|
||||
// x - skip<uint32>, X - skip<uint8>, s - char*, f - float, i - uint32, b - uint8, d - index (not included)
|
||||
// n - index (included), l - uint64, p - field present in sql dbc, a - field absent in sql dbc
|
||||
|
||||
char const BannedAddOnsfmt[] = "nxxxxxxxxxx";
|
||||
char const BattlemasterListfmt[] = "niiiiiiiiiiiiiiiiixsiiiixxxxxxx";
|
||||
char const CharSectionsfmt[] = "diiixxxiii";
|
||||
char const ChrClassesfmt[] = "nixsxxxixiiiiixxxxx";
|
||||
char const CreatureModelDatafmt[] = "niixxxxxxxxxxxxxxffxxxxxxxxxxxxxxxxx";
|
||||
char const EmotesTextSoundEntryfmt[] = "niiii";
|
||||
char const Factionfmt[] = "niiiiiiiiiiiiiiiiiiffixsxixx";
|
||||
char const FactionTemplatefmt[] = "niiiiiiiiiiiii";
|
||||
char const LFGDungeonfmt[] = "nsiiixxiiiixxixixxxxxxxxxxxxxx";
|
||||
char const Lightfmt[] = "nifffxxxxxxxxxx";
|
||||
char const LiquidTypefmt[] = "nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
char const MapDifficultyfmt[] = "diisiiii";
|
||||
char const SpellItemEnchantmentfmt[] = "niiiiiiiiiixiiiiiiiiiifffxxx";
|
||||
char const Talentfmt[] = "niiiiiiiiix";
|
||||
char const Vehiclefmt[] = "niiffffiiiiiiiifffffffffffffffxxxxfifiiii";
|
||||
char const WMOAreaTablefmt[] = "niiixxxxxiixxxx";
|
||||
char const WorldMapAreafmt[] = "xinxffffixxxxx";
|
||||
char const WorldSafeLocsfmt[] = "niffffx";
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "GameTables.h"
|
||||
#include "Timer.h"
|
||||
#include "Log.h"
|
||||
#include "Util.h"
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <fstream>
|
||||
|
||||
GameTable<GtBarberShopCostBaseEntry> sBarberShopCostBaseGameTable;
|
||||
GameTable<GtBaseMPEntry> sBaseMPGameTable;
|
||||
GameTable<GtCombatRatingsEntry> sCombatRatingsGameTable;
|
||||
GameTable<GtHpPerStaEntry> sHpPerStaGameTable;
|
||||
GameTable<GtItemSocketCostPerLevelEntry> sItemSocketCostPerLevelGameTable;
|
||||
GameTable<GtNpcDamageByClassEntry> sNpcDamageByClassGameTable[MAX_EXPANSIONS];
|
||||
GameTable<GtNpcManaCostScalerEntry> sNpcManaCostScalerGameTable;
|
||||
GameTable<GtNpcTotalHpEntry> sNpcTotalHpGameTable[MAX_EXPANSIONS];
|
||||
GameTable<GtSpellScalingEntry> sSpellScalingGameTable;
|
||||
GameTable<GtXpEntry> sXpGameTable;
|
||||
|
||||
template<class T>
|
||||
inline uint32 LoadGameTable(std::vector<std::string>& errors, GameTable<T>& storage, boost::filesystem::path const& path)
|
||||
{
|
||||
std::ifstream stream(path.string());
|
||||
if (!stream)
|
||||
{
|
||||
errors.push_back(Trinity::StringFormat("GameTable file %s cannot be opened.", path.string().c_str()));
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string headers;
|
||||
if (!std::getline(stream, headers))
|
||||
{
|
||||
errors.push_back(Trinity::StringFormat("GameTable file %s is empty.", path.string().c_str()));
|
||||
return 0;
|
||||
}
|
||||
|
||||
Tokenizer columnDefs(headers, '\t');
|
||||
|
||||
ASSERT(columnDefs.size() - 1 == sizeof(T) / sizeof(float),
|
||||
"GameTable '%s' has different count of columns " SZFMTD " than expected by size of C++ structure (" SZFMTD ").",
|
||||
path.string().c_str(), columnDefs.size() - 1, sizeof(T) / sizeof(float));
|
||||
|
||||
std::vector<T> data;
|
||||
data.emplace_back(); // row id 0, unused
|
||||
|
||||
std::string line;
|
||||
while (std::getline(stream, line))
|
||||
{
|
||||
if (line.empty())
|
||||
break;
|
||||
|
||||
Tokenizer values(line, '\t', columnDefs.size());
|
||||
ASSERT(values.size() == columnDefs.size());
|
||||
|
||||
ASSERT(strtol(values[0], nullptr, 10) == data.size(),
|
||||
"Unexpected row identifier %u at row " SZFMTD " (expected " SZFMTD ")",
|
||||
strtol(values[0], nullptr, 10), data.size(), data.size());
|
||||
|
||||
data.emplace_back();
|
||||
float* row = reinterpret_cast<float*>(&data.back());
|
||||
for (std::size_t col = 1; col < columnDefs.size(); ++col)
|
||||
*row++ = strtof(values[col], nullptr);
|
||||
}
|
||||
|
||||
storage.SetData(std::move(data));
|
||||
return 1;
|
||||
}
|
||||
|
||||
void LoadGameTables(std::string const& dataPath)
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
boost::filesystem::path gtPath(dataPath);
|
||||
gtPath /= "gt";
|
||||
|
||||
std::vector<std::string> bad_gt_files;
|
||||
uint32 gameTableCount = 0;
|
||||
|
||||
#define LOAD_GT(store, file) gameTableCount += LoadGameTable(bad_gt_files, store, gtPath / file)
|
||||
|
||||
LOAD_GT(sBarberShopCostBaseGameTable, "BarberShopCostBase.txt");
|
||||
LOAD_GT(sBaseMPGameTable, "BaseMp.txt");
|
||||
LOAD_GT(sCombatRatingsGameTable, "CombatRatings.txt");
|
||||
LOAD_GT(sItemSocketCostPerLevelGameTable, "ItemSocketCostPerLevel.txt");
|
||||
LOAD_GT(sHpPerStaGameTable, "HpPerSta.txt");
|
||||
LOAD_GT(sNpcDamageByClassGameTable[0], "NpcDamageByClass.txt");
|
||||
LOAD_GT(sNpcDamageByClassGameTable[1], "NpcDamageByClassExp1.txt");
|
||||
LOAD_GT(sNpcDamageByClassGameTable[2], "NpcDamageByClassExp2.txt");
|
||||
LOAD_GT(sNpcDamageByClassGameTable[3], "NpcDamageByClassExp3.txt");
|
||||
LOAD_GT(sNpcDamageByClassGameTable[4], "NpcDamageByClassExp4.txt");
|
||||
LOAD_GT(sNpcDamageByClassGameTable[5], "NpcDamageByClassExp5.txt");
|
||||
LOAD_GT(sNpcDamageByClassGameTable[6], "NpcDamageByClassExp6.txt");
|
||||
LOAD_GT(sNpcManaCostScalerGameTable, "NpcManaCostScaler.txt");
|
||||
LOAD_GT(sNpcTotalHpGameTable[0], "NpcTotalHp.txt");
|
||||
LOAD_GT(sNpcTotalHpGameTable[1], "NpcTotalHpExp1.txt");
|
||||
LOAD_GT(sNpcTotalHpGameTable[2], "NpcTotalHpExp2.txt");
|
||||
LOAD_GT(sNpcTotalHpGameTable[3], "NpcTotalHpExp3.txt");
|
||||
LOAD_GT(sNpcTotalHpGameTable[4], "NpcTotalHpExp4.txt");
|
||||
LOAD_GT(sNpcTotalHpGameTable[5], "NpcTotalHpExp5.txt");
|
||||
LOAD_GT(sNpcTotalHpGameTable[6], "NpcTotalHpExp6.txt");
|
||||
LOAD_GT(sSpellScalingGameTable, "SpellScaling.txt");
|
||||
LOAD_GT(sXpGameTable, "xp.txt");
|
||||
|
||||
#undef LOAD_GT
|
||||
|
||||
// error checks
|
||||
if (!bad_gt_files.empty())
|
||||
{
|
||||
std::ostringstream str;
|
||||
for (std::string const& err : bad_gt_files)
|
||||
str << err << std::endl;
|
||||
|
||||
WPFatal("misc", "Some required *.txt GameTable files (" SZFMTD ") not found or not compatible:\n%s", bad_gt_files.size(), str.str().c_str());
|
||||
}
|
||||
|
||||
TC_LOG_INFO("server.loading", ">> Initialized %d GameTables in %u ms", gameTableCount, GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
@@ -0,0 +1,228 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GameTables_h__
|
||||
#define GameTables_h__
|
||||
|
||||
#include "SharedDefines.h"
|
||||
#include "Common.h"
|
||||
|
||||
struct GtBarberShopCostBaseEntry
|
||||
{
|
||||
float Cost = 0.0f;
|
||||
};
|
||||
|
||||
struct GtBaseMPEntry
|
||||
{
|
||||
float Rogue = 0.0f;
|
||||
float Druid = 0.0f;
|
||||
float Hunter = 0.0f;
|
||||
float Mage = 0.0f;
|
||||
float Paladin = 0.0f;
|
||||
float Priest = 0.0f;
|
||||
float Shaman = 0.0f;
|
||||
float Warlock = 0.0f;
|
||||
float Warrior = 0.0f;
|
||||
float DeathKnight = 0.0f;
|
||||
float Monk = 0.0f;
|
||||
float DemonHunter = 0.0f;
|
||||
};
|
||||
|
||||
struct GtCombatRatingsEntry
|
||||
{
|
||||
float Amplify = 0.0f;
|
||||
float DefenseSkill = 0.0f;
|
||||
float Dodge = 0.0f;
|
||||
float Parry = 0.0f;
|
||||
float Block = 0.0f;
|
||||
float HitMelee = 0.0f;
|
||||
float HitRanged = 0.0f;
|
||||
float HitSpell = 0.0f;
|
||||
float CritMelee = 0.0f;
|
||||
float CritRanged = 0.0f;
|
||||
float CritSpell = 0.0f;
|
||||
float MultiStrike = 0.0f;
|
||||
float Readiness = 0.0f;
|
||||
float Speed = 0.0f;
|
||||
float ResilienceCritTaken = 0.0f;
|
||||
float ResiliencePlayerDamage = 0.0f;
|
||||
float Lifesteal = 0.0f;
|
||||
float HasteMelee = 0.0f;
|
||||
float HasteRanged = 0.0f;
|
||||
float HasteSpell = 0.0f;
|
||||
float Avoidance = 0.0f;
|
||||
float Sturdiness = 0.0f;
|
||||
float Unused7 = 0.0f;
|
||||
float Expertise = 0.0f;
|
||||
float ArmorPenetration = 0.0f;
|
||||
float Mastery = 0.0f;
|
||||
float PvPPower = 0.0f;
|
||||
float Cleave = 0.0f;
|
||||
float VersatilityDamageDone = 0.0f;
|
||||
float VersatilityHealingDone = 0.0f;
|
||||
float VersatilityDamageTaken = 0.0f;
|
||||
float Unused12 = 0.0f;
|
||||
};
|
||||
|
||||
struct GtHpPerStaEntry
|
||||
{
|
||||
float Health = 0.0f;
|
||||
};
|
||||
|
||||
struct GtItemSocketCostPerLevelEntry
|
||||
{
|
||||
float SocketCost = 0.0f;
|
||||
};
|
||||
|
||||
struct GtNpcDamageByClassEntry
|
||||
{
|
||||
float Rogue = 0.0f;
|
||||
float Druid = 0.0f;
|
||||
float Hunter = 0.0f;
|
||||
float Mage = 0.0f;
|
||||
float Paladin = 0.0f;
|
||||
float Priest = 0.0f;
|
||||
float Shaman = 0.0f;
|
||||
float Warlock = 0.0f;
|
||||
float Warrior = 0.0f;
|
||||
float DeathKnight = 0.0f;
|
||||
float Monk = 0.0f;
|
||||
float DemonHunter = 0.0f;
|
||||
};
|
||||
|
||||
struct GtNpcManaCostScalerEntry
|
||||
{
|
||||
float Scaler = 0.0f;
|
||||
};
|
||||
|
||||
struct GtNpcTotalHpEntry
|
||||
{
|
||||
float Rogue = 0.0f;
|
||||
float Druid = 0.0f;
|
||||
float Hunter = 0.0f;
|
||||
float Mage = 0.0f;
|
||||
float Paladin = 0.0f;
|
||||
float Priest = 0.0f;
|
||||
float Shaman = 0.0f;
|
||||
float Warlock = 0.0f;
|
||||
float Warrior = 0.0f;
|
||||
float DeathKnight = 0.0f;
|
||||
float Monk = 0.0f;
|
||||
float DemonHunter = 0.0f;
|
||||
};
|
||||
|
||||
struct GtSpellScalingEntry
|
||||
{
|
||||
float Rogue = 0.0f;
|
||||
float Druid = 0.0f;
|
||||
float Hunter = 0.0f;
|
||||
float Mage = 0.0f;
|
||||
float Paladin = 0.0f;
|
||||
float Priest = 0.0f;
|
||||
float Shaman = 0.0f;
|
||||
float Warlock = 0.0f;
|
||||
float Warrior = 0.0f;
|
||||
float DeathKnight = 0.0f;
|
||||
float Monk = 0.0f;
|
||||
float DemonHunter = 0.0f;
|
||||
float Item = 0.0f;
|
||||
float Consumable = 0.0f;
|
||||
float Gem1 = 0.0f;
|
||||
float Gem2 = 0.0f;
|
||||
float Gem3 = 0.0f;
|
||||
float Health = 0.0f;
|
||||
};
|
||||
|
||||
struct GtXpEntry
|
||||
{
|
||||
float Total = 0.0f;
|
||||
float PerKill = 0.0f;
|
||||
float Junk = 0.0f;
|
||||
float Stats = 0.0f;
|
||||
float Divisor = 0.0f;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
class GameTable
|
||||
{
|
||||
public:
|
||||
T const* GetRow(uint32 row) const
|
||||
{
|
||||
if (row >= _data.size())
|
||||
return nullptr;
|
||||
|
||||
return &_data[row];
|
||||
}
|
||||
|
||||
std::size_t GetTableRowCount() const { return _data.size(); }
|
||||
|
||||
void SetData(std::vector<T> data) { _data = std::move(data); }
|
||||
|
||||
private:
|
||||
std::vector<T> _data;
|
||||
};
|
||||
|
||||
TC_GAME_API extern GameTable<GtBarberShopCostBaseEntry> sBarberShopCostBaseGameTable;
|
||||
TC_GAME_API extern GameTable<GtBaseMPEntry> sBaseMPGameTable;
|
||||
TC_GAME_API extern GameTable<GtCombatRatingsEntry> sCombatRatingsGameTable;
|
||||
TC_GAME_API extern GameTable<GtHpPerStaEntry> sHpPerStaGameTable;
|
||||
TC_GAME_API extern GameTable<GtItemSocketCostPerLevelEntry> sItemSocketCostPerLevelGameTable;
|
||||
TC_GAME_API extern GameTable<GtNpcDamageByClassEntry> sNpcDamageByClassGameTable[MAX_EXPANSIONS];
|
||||
TC_GAME_API extern GameTable<GtNpcManaCostScalerEntry> sNpcManaCostScalerGameTable;
|
||||
TC_GAME_API extern GameTable<GtNpcTotalHpEntry> sNpcTotalHpGameTable[MAX_EXPANSIONS];
|
||||
TC_GAME_API extern GameTable<GtSpellScalingEntry> sSpellScalingGameTable;
|
||||
TC_GAME_API extern GameTable<GtXpEntry> sXpGameTable;
|
||||
|
||||
TC_GAME_API void LoadGameTables(std::string const& dataPath);
|
||||
|
||||
template<class T>
|
||||
inline float GetGameTableColumnForClass(T const* row, uint32 class_)
|
||||
{
|
||||
switch (class_)
|
||||
{
|
||||
case CLASS_WARRIOR:
|
||||
return row->Warrior;
|
||||
case CLASS_PALADIN:
|
||||
return row->Paladin;
|
||||
case CLASS_HUNTER:
|
||||
return row->Hunter;
|
||||
case CLASS_ROGUE:
|
||||
return row->Rogue;
|
||||
case CLASS_PRIEST:
|
||||
return row->Priest;
|
||||
case CLASS_DEATH_KNIGHT:
|
||||
return row->DeathKnight;
|
||||
case CLASS_SHAMAN:
|
||||
return row->Shaman;
|
||||
case CLASS_MAGE:
|
||||
return row->Mage;
|
||||
case CLASS_WARLOCK:
|
||||
return row->Warlock;
|
||||
case CLASS_MONK:
|
||||
return row->Monk;
|
||||
case CLASS_DRUID:
|
||||
return row->Druid;
|
||||
case CLASS_DEMON_HUNTER:
|
||||
return row->DemonHunter;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
#endif // GameTables_h__
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include "Common.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "DBCStores.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "SocialMgr.h"
|
||||
@@ -37,7 +36,21 @@
|
||||
namespace lfg
|
||||
{
|
||||
|
||||
LFGMgr::LFGMgr(): m_QueueTimer(0), m_lfgProposalId(1),
|
||||
LFGDungeonData::LFGDungeonData() : id(0), name(""), map(0), type(0), expansion(0), group(0), minlevel(0),
|
||||
maxlevel(0), difficulty(DIFFICULTY_NONE), seasonal(false), x(0.0f), y(0.0f), z(0.0f), o(0.0f),
|
||||
requiredItemLevel(0)
|
||||
{
|
||||
}
|
||||
|
||||
LFGDungeonData::LFGDungeonData(LfgDungeonsEntry const* dbc) : id(dbc->ID), name(dbc->Name->Str[sWorld->GetDefaultDbcLocale()]), map(dbc->MapID),
|
||||
type(uint8(dbc->Type)), expansion(uint8(dbc->Expansion)), group(uint8(dbc->GroupID)),
|
||||
minlevel(uint8(dbc->MinLevel)), maxlevel(uint8(dbc->MaxLevel)), difficulty(Difficulty(dbc->DifficultyID)),
|
||||
seasonal((dbc->Flags & LFG_FLAG_SEASONAL) != 0), x(0.0f), y(0.0f), z(0.0f), o(0.0f),
|
||||
requiredItemLevel(0)
|
||||
{
|
||||
}
|
||||
|
||||
LFGMgr::LFGMgr() : m_QueueTimer(0), m_lfgProposalId(1),
|
||||
m_options(sWorld->getIntConfig(CONFIG_LFG_OPTIONSMASK))
|
||||
{
|
||||
}
|
||||
@@ -174,9 +187,9 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
|
||||
LfgDungeonStore.clear();
|
||||
|
||||
// Initialize Dungeon map with data from dbcs
|
||||
for (uint32 i = 0; i < sLFGDungeonStore.GetNumRows(); ++i)
|
||||
for (uint32 i = 0; i < sLfgDungeonsStore.GetNumRows(); ++i)
|
||||
{
|
||||
LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(i);
|
||||
LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(i);
|
||||
if (!dungeon)
|
||||
continue;
|
||||
|
||||
@@ -1597,7 +1610,7 @@ LfgLockMap const LFGMgr::GetLockedDungeons(ObjectGuid guid)
|
||||
for (LfgDungeonSet::const_iterator it = dungeons.begin(); it != dungeons.end(); ++it)
|
||||
{
|
||||
LFGDungeonData const* dungeon = GetLFGDungeon(*it);
|
||||
if (!dungeon) // should never happen - We provide a list from sLFGDungeonStore
|
||||
if (!dungeon) // should never happen - We provide a list from sLfgDungeonsStore
|
||||
continue;
|
||||
|
||||
uint32 lockStatus = 0;
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#ifndef _LFGMGR_H
|
||||
#define _LFGMGR_H
|
||||
|
||||
#include "DBCStructure.h"
|
||||
#include "Field.h"
|
||||
#include "LFG.h"
|
||||
#include "LFGQueue.h"
|
||||
@@ -267,16 +266,8 @@ struct LfgPlayerBoot
|
||||
|
||||
struct LFGDungeonData
|
||||
{
|
||||
LFGDungeonData(): id(0), name(""), map(0), type(0), expansion(0), group(0), minlevel(0),
|
||||
maxlevel(0), difficulty(DIFFICULTY_NONE), seasonal(false), x(0.0f), y(0.0f), z(0.0f), o(0.0f),
|
||||
requiredItemLevel(0)
|
||||
{ }
|
||||
LFGDungeonData(LFGDungeonEntry const* dbc): id(dbc->ID), name(dbc->Name_lang), map(dbc->MapID),
|
||||
type(uint8(dbc->Type)), expansion(uint8(dbc->Expansion)), group(uint8(dbc->GroupID)),
|
||||
minlevel(uint8(dbc->MinLevel)), maxlevel(uint8(dbc->MaxLevel)), difficulty(Difficulty(dbc->DifficultyID)),
|
||||
seasonal((dbc->Flags & LFG_FLAG_SEASONAL) != 0), x(0.0f), y(0.0f), z(0.0f), o(0.0f),
|
||||
requiredItemLevel(0)
|
||||
{ }
|
||||
LFGDungeonData();
|
||||
LFGDungeonData(LfgDungeonsEntry const* dbc);
|
||||
|
||||
uint32 id;
|
||||
std::string name;
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
|
||||
#include "ObjectDefines.h"
|
||||
#include "Containers.h"
|
||||
#include "DBCStructure.h"
|
||||
#include "DBCStores.h"
|
||||
#include "Group.h"
|
||||
#include "LFGQueue.h"
|
||||
#include "LFGMgr.h"
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "WorldSession.h"
|
||||
#include "ItemPackets.h"
|
||||
#include "TradeData.h"
|
||||
#include "GameTables.h"
|
||||
|
||||
void AddItemsSetItem(Player* player, Item* item)
|
||||
{
|
||||
@@ -1856,8 +1857,8 @@ int32 Item::GetItemStatValue(uint32 index, Player const* owner) const
|
||||
if (uint32 randomPropPoints = GetRandomPropertyPoints(itemLevel, GetQuality(), GetTemplate()->GetInventoryType(), GetTemplate()->GetSubClass()))
|
||||
{
|
||||
float statValue = float(_bonusData.ItemStatAllocation[index] * randomPropPoints) * 0.0001f;
|
||||
if (GtItemSocketCostPerLevelEntry const* gtCost = sGtItemSocketCostPerLevelStore.EvaluateTable(itemLevel - 1, 0))
|
||||
statValue -= float(int32(_bonusData.ItemStatSocketCostMultiplier[index] * gtCost->ratio));
|
||||
if (GtItemSocketCostPerLevelEntry const* gtCost = sItemSocketCostPerLevelGameTable.GetRow(itemLevel))
|
||||
statValue -= float(int32(_bonusData.ItemStatSocketCostMultiplier[index] * gtCost->SocketCost));
|
||||
|
||||
return int32(std::floor(statValue + 0.5f));
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "Log.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Util.h"
|
||||
#include "DBCStores.h"
|
||||
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "DBCStores.h"
|
||||
#include "DB2Stores.h"
|
||||
#include "World.h"
|
||||
#include "ItemTemplate.h"
|
||||
|
||||
@@ -660,11 +660,10 @@ class Player;
|
||||
|
||||
struct TC_GAME_API ItemTemplate
|
||||
{
|
||||
uint32 Id;
|
||||
ItemEntry const* BasicData;
|
||||
ItemSparseEntry const* ExtendedData;
|
||||
|
||||
uint32 GetId() const { return Id; }
|
||||
uint32 GetId() const { return BasicData->ID; }
|
||||
uint32 GetClass() const { return BasicData->Class; }
|
||||
uint32 GetSubClass() const { return BasicData->SubClass; }
|
||||
uint32 GetQuality() const { return ExtendedData->Quality; }
|
||||
|
||||
@@ -101,7 +101,6 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "WorldStatePackets.h"
|
||||
#include "DBCStructure.h"
|
||||
|
||||
#define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS)
|
||||
|
||||
@@ -2402,12 +2401,12 @@ void Player::GiveLevel(uint8 level)
|
||||
PlayerLevelInfo info;
|
||||
sObjectMgr->GetPlayerLevelInfo(getRace(), getClass(), level, &info);
|
||||
|
||||
uint32 basehp = 0, basemana = 0;
|
||||
sObjectMgr->GetPlayerClassLevelInfo(getClass(), level, basehp, basemana);
|
||||
uint32 basemana = 0;
|
||||
sObjectMgr->GetPlayerClassLevelInfo(getClass(), level, basemana);
|
||||
|
||||
WorldPackets::Misc::LevelUpInfo packet;
|
||||
packet.Level = level;
|
||||
packet.HealthDelta = int32(basehp) - int32(GetCreateHealth());
|
||||
packet.HealthDelta = 0;
|
||||
|
||||
/// @todo find some better solution
|
||||
// for (int i = 0; i < MAX_STORED_POWERS; ++i)
|
||||
@@ -2444,7 +2443,7 @@ void Player::GiveLevel(uint8 level)
|
||||
for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i)
|
||||
SetCreateStat(Stats(i), info.stats[i]);
|
||||
|
||||
SetCreateHealth(basehp);
|
||||
SetCreateHealth(0);
|
||||
SetCreateMana(basemana);
|
||||
|
||||
InitTalentForLevel();
|
||||
@@ -2522,7 +2521,7 @@ void Player::InitTalentForLevel()
|
||||
if (!GetSession()->HasPermission(rbac::RBAC_PERM_SKIP_CHECK_MORE_TALENTS_THAN_ALLOWED))
|
||||
for (uint32 t = talentTiers; t < MAX_TALENT_TIERS; ++t)
|
||||
for (uint32 c = 0; c < MAX_TALENT_COLUMNS; ++c)
|
||||
for (TalentEntry const* talent : sTalentByPos[getClass()][t][c])
|
||||
for (TalentEntry const* talent : sDB2Manager.GetTalentsByPosition(getClass(), t, c))
|
||||
RemoveTalent(talent);
|
||||
}
|
||||
|
||||
@@ -2537,8 +2536,8 @@ void Player::InitStatsForLevel(bool reapplyMods)
|
||||
if (reapplyMods) //reapply stats values only on .reset stats (level) command
|
||||
_RemoveAllStatBonuses();
|
||||
|
||||
uint32 basehp = 0, basemana = 0;
|
||||
sObjectMgr->GetPlayerClassLevelInfo(getClass(), getLevel(), basehp, basemana);
|
||||
uint32 basemana = 0;
|
||||
sObjectMgr->GetPlayerClassLevelInfo(getClass(), getLevel(), basemana);
|
||||
|
||||
PlayerLevelInfo info;
|
||||
sObjectMgr->GetPlayerLevelInfo(getRace(), getClass(), getLevel(), &info);
|
||||
@@ -2568,7 +2567,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
|
||||
for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i)
|
||||
SetStat(Stats(i), info.stats[i]);
|
||||
|
||||
SetCreateHealth(basehp);
|
||||
SetCreateHealth(0);
|
||||
|
||||
//set create powers
|
||||
SetCreateMana(basemana);
|
||||
@@ -2662,7 +2661,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
|
||||
for (uint8 i = POWER_MANA; i < MAX_POWERS; ++i)
|
||||
SetMaxPower(Powers(i), GetCreatePowers(Powers(i)));
|
||||
|
||||
SetMaxHealth(basehp); // stamina bonus will applied later
|
||||
SetMaxHealth(0); // stamina bonus will applied later
|
||||
|
||||
// cleanup mounted state (it will set correctly at aura loading if player saved at mount.
|
||||
SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0);
|
||||
@@ -4831,111 +4830,151 @@ float Player::GetTotalBaseModValue(BaseModGroup modGroup) const
|
||||
return m_auraBaseMod[modGroup][FLAT_MOD] * m_auraBaseMod[modGroup][PCT_MOD];
|
||||
}
|
||||
|
||||
float Player::GetMeleeCritFromAgility() const
|
||||
{
|
||||
uint8 level = getLevel();
|
||||
uint32 pclass = getClass();
|
||||
|
||||
if (level >= sGtChanceToMeleeCritStore.GetTableRowCount())
|
||||
level = sGtChanceToMeleeCritStore.GetTableRowCount() - 1;
|
||||
|
||||
GtChanceToMeleeCritBaseEntry const* critBase = sGtChanceToMeleeCritBaseStore.EvaluateTable(pclass - 1, 0);
|
||||
GtChanceToMeleeCritEntry const* critRatio = sGtChanceToMeleeCritStore.EvaluateTable(level - 1, pclass - 1);
|
||||
if (critBase == nullptr || critRatio == nullptr)
|
||||
return 0.0f;
|
||||
|
||||
float crit = critBase->base + GetStat(STAT_AGILITY)*critRatio->ratio;
|
||||
return crit*100.0f;
|
||||
}
|
||||
|
||||
void Player::GetDodgeFromAgility(float &diminishing, float &nondiminishing) const
|
||||
{
|
||||
// Table for base dodge values
|
||||
const float dodge_base[MAX_CLASSES] =
|
||||
{
|
||||
0.037580f, // Warrior
|
||||
0.036520f, // Paladin
|
||||
-0.054500f, // Hunter
|
||||
-0.005900f, // Rogue
|
||||
0.031830f, // Priest
|
||||
0.036640f, // DK
|
||||
0.016750f, // Shaman
|
||||
0.034575f, // Mage
|
||||
0.020350f, // Warlock
|
||||
0.0f, // ??
|
||||
0.049510f // Druid
|
||||
};
|
||||
// Crit/agility to dodge/agility coefficient multipliers; 3.2.0 increased required agility by 15%
|
||||
const float crit_to_dodge[MAX_CLASSES] =
|
||||
{
|
||||
0.85f/1.15f, // Warrior
|
||||
1.00f/1.15f, // Paladin
|
||||
1.11f/1.15f, // Hunter
|
||||
2.00f/1.15f, // Rogue
|
||||
1.00f/1.15f, // Priest
|
||||
0.85f/1.15f, // DK
|
||||
1.60f/1.15f, // Shaman
|
||||
1.00f/1.15f, // Mage
|
||||
0.97f/1.15f, // Warlock (?)
|
||||
0.0f, // ??
|
||||
2.00f/1.15f // Druid
|
||||
};
|
||||
//// Table for base dodge values
|
||||
//const float dodge_base[MAX_CLASSES] =
|
||||
//{
|
||||
// 0.037580f, // Warrior
|
||||
// 0.036520f, // Paladin
|
||||
// -0.054500f, // Hunter
|
||||
// -0.005900f, // Rogue
|
||||
// 0.031830f, // Priest
|
||||
// 0.036640f, // DK
|
||||
// 0.016750f, // Shaman
|
||||
// 0.034575f, // Mage
|
||||
// 0.020350f, // Warlock
|
||||
// 0.0f, // ??
|
||||
// 0.049510f // Druid
|
||||
//};
|
||||
//// Crit/agility to dodge/agility coefficient multipliers; 3.2.0 increased required agility by 15%
|
||||
//const float crit_to_dodge[MAX_CLASSES] =
|
||||
//{
|
||||
// 0.85f/1.15f, // Warrior
|
||||
// 1.00f/1.15f, // Paladin
|
||||
// 1.11f/1.15f, // Hunter
|
||||
// 2.00f/1.15f, // Rogue
|
||||
// 1.00f/1.15f, // Priest
|
||||
// 0.85f/1.15f, // DK
|
||||
// 1.60f/1.15f, // Shaman
|
||||
// 1.00f/1.15f, // Mage
|
||||
// 0.97f/1.15f, // Warlock (?)
|
||||
// 0.0f, // ??
|
||||
// 2.00f/1.15f // Druid
|
||||
//};
|
||||
|
||||
uint8 level = getLevel();
|
||||
uint32 pclass = getClass();
|
||||
//uint8 level = getLevel();
|
||||
//uint32 pclass = getClass();
|
||||
|
||||
if (level >= sGtChanceToMeleeCritStore.GetTableRowCount())
|
||||
level = sGtChanceToMeleeCritStore.GetTableRowCount() - 1;
|
||||
//if (level >= sGtChanceToMeleeCritStore.GetTableRowCount())
|
||||
// level = sGtChanceToMeleeCritStore.GetTableRowCount() - 1;
|
||||
|
||||
// Dodge per agility is proportional to crit per agility, which is available from DBC files
|
||||
GtChanceToMeleeCritEntry const* dodgeRatio = sGtChanceToMeleeCritStore.EvaluateTable(level - 1, pclass - 1);
|
||||
if (dodgeRatio == nullptr || pclass > MAX_CLASSES)
|
||||
return;
|
||||
//// Dodge per agility is proportional to crit per agility, which is available from DBC files
|
||||
//GtChanceToMeleeCritEntry const* dodgeRatio = sGtChanceToMeleeCritStore.EvaluateTable(level - 1, pclass - 1);
|
||||
//if (dodgeRatio == nullptr || pclass > MAX_CLASSES)
|
||||
// return;
|
||||
|
||||
/// @todo research if talents/effects that increase total agility by x% should increase non-diminishing part
|
||||
float base_agility = GetCreateStat(STAT_AGILITY) * m_auraModifiersGroup[UNIT_MOD_STAT_START + STAT_AGILITY][BASE_PCT];
|
||||
float bonus_agility = GetStat(STAT_AGILITY) - base_agility;
|
||||
///// @todo research if talents/effects that increase total agility by x% should increase non-diminishing part
|
||||
//float base_agility = GetCreateStat(STAT_AGILITY) * m_auraModifiersGroup[UNIT_MOD_STAT_START + STAT_AGILITY][BASE_PCT];
|
||||
//float bonus_agility = GetStat(STAT_AGILITY) - base_agility;
|
||||
|
||||
// calculate diminishing (green in char screen) and non-diminishing (white) contribution
|
||||
diminishing = 100.0f * bonus_agility * dodgeRatio->ratio * crit_to_dodge[pclass-1];
|
||||
nondiminishing = 100.0f * (dodge_base[pclass-1] + base_agility * dodgeRatio->ratio * crit_to_dodge[pclass-1]);
|
||||
//// calculate diminishing (green in char screen) and non-diminishing (white) contribution
|
||||
//diminishing = 100.0f * bonus_agility * dodgeRatio->ratio * crit_to_dodge[pclass-1];
|
||||
//nondiminishing = 100.0f * (dodge_base[pclass-1] + base_agility * dodgeRatio->ratio * crit_to_dodge[pclass-1]);
|
||||
}
|
||||
|
||||
float Player::GetSpellCritFromIntellect() const
|
||||
inline float GetGameTableColumnForCombatRating(GtCombatRatingsEntry const* row, uint32 rating)
|
||||
{
|
||||
uint8 level = getLevel();
|
||||
uint32 pclass = getClass();
|
||||
switch (rating)
|
||||
{
|
||||
case CR_AMPLIFY:
|
||||
return row->Amplify;
|
||||
case CR_DEFENSE_SKILL:
|
||||
return row->DefenseSkill;
|
||||
case CR_DODGE:
|
||||
return row->Dodge;
|
||||
case CR_PARRY:
|
||||
return row->Parry;
|
||||
case CR_BLOCK:
|
||||
return row->Block;
|
||||
case CR_HIT_MELEE:
|
||||
return row->HitMelee;
|
||||
case CR_HIT_RANGED:
|
||||
return row->HitRanged;
|
||||
case CR_HIT_SPELL:
|
||||
return row->HitSpell;
|
||||
case CR_CRIT_MELEE:
|
||||
return row->CritMelee;
|
||||
case CR_CRIT_RANGED:
|
||||
return row->CritRanged;
|
||||
case CR_CRIT_SPELL:
|
||||
return row->CritSpell;
|
||||
case CR_MULTISTRIKE:
|
||||
return row->MultiStrike;
|
||||
case CR_READINESS:
|
||||
return row->Readiness;
|
||||
case CR_SPEED:
|
||||
return row->Speed;
|
||||
case CR_RESILIENCE_CRIT_TAKEN:
|
||||
return row->ResilienceCritTaken;
|
||||
case CR_RESILIENCE_PLAYER_DAMAGE:
|
||||
return row->ResiliencePlayerDamage;
|
||||
case CR_LIFESTEAL:
|
||||
return row->Lifesteal;
|
||||
case CR_HASTE_MELEE:
|
||||
return row->HasteMelee;
|
||||
case CR_HASTE_RANGED:
|
||||
return row->HasteRanged;
|
||||
case CR_HASTE_SPELL:
|
||||
return row->HasteSpell;
|
||||
case CR_AVOIDANCE:
|
||||
return row->Avoidance;
|
||||
case CR_STURDINESS:
|
||||
return row->Sturdiness;
|
||||
case CR_UNUSED_7:
|
||||
return row->Unused7;
|
||||
case CR_EXPERTISE:
|
||||
return row->Expertise;
|
||||
case CR_ARMOR_PENETRATION:
|
||||
return row->ArmorPenetration;
|
||||
case CR_MASTERY:
|
||||
return row->Mastery;
|
||||
case CR_PVP_POWER:
|
||||
return row->PvPPower;
|
||||
case CR_CLEAVE:
|
||||
return row->Cleave;
|
||||
case CR_VERSATILITY_DAMAGE_DONE:
|
||||
return row->VersatilityDamageDone;
|
||||
case CR_VERSATILITY_HEALING_DONE:
|
||||
return row->VersatilityHealingDone;
|
||||
case CR_VERSATILITY_DAMAGE_TAKEN:
|
||||
return row->VersatilityDamageTaken;
|
||||
case CR_UNUSED_12:
|
||||
return row->Unused12;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (level >= sGtChanceToSpellCritStore.GetTableRowCount())
|
||||
level = sGtChanceToSpellCritStore.GetTableRowCount() - 1;
|
||||
|
||||
GtChanceToSpellCritBaseEntry const* critBase = sGtChanceToSpellCritBaseStore.EvaluateTable(pclass - 1, 0);
|
||||
GtChanceToSpellCritEntry const* critRatio = sGtChanceToSpellCritStore.EvaluateTable(level - 1, pclass - 1);
|
||||
if (critBase == nullptr || critRatio == nullptr)
|
||||
return 0.0f;
|
||||
|
||||
float crit = critBase->base + GetStat(STAT_INTELLECT) * critRatio->ratio;
|
||||
return crit * 100.0f;
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
float Player::GetRatingMultiplier(CombatRating cr) const
|
||||
{
|
||||
uint8 level = getLevel();
|
||||
GtCombatRatingsEntry const* Rating = sCombatRatingsGameTable.GetRow(getLevel());
|
||||
if (!Rating)
|
||||
return 1.0f;
|
||||
|
||||
if (level >= sGtCombatRatingsStore.GetTableRowCount())
|
||||
level = sGtCombatRatingsStore.GetTableRowCount() - 1;
|
||||
|
||||
GtCombatRatingsEntry const* Rating = sGtCombatRatingsStore.EvaluateTable(level - 1, cr);
|
||||
if (!Rating || !Rating->ratio)
|
||||
float value = GetGameTableColumnForCombatRating(Rating, cr);
|
||||
if (!value)
|
||||
return 1.0f; // By default use minimum coefficient (not must be called)
|
||||
|
||||
return 1.0f / Rating->ratio;
|
||||
return 1.0f / value;
|
||||
}
|
||||
|
||||
float Player::GetRatingBonusValue(CombatRating cr) const
|
||||
{
|
||||
float baseResult = float(GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr)) * GetRatingMultiplier(cr);
|
||||
if (cr != CR_RESILIENCE_PLAYER_DAMAGE_TAKEN)
|
||||
if (cr != CR_RESILIENCE_PLAYER_DAMAGE)
|
||||
return baseResult;
|
||||
return float(1.0f - pow(0.99f, baseResult)) * 100.0f;
|
||||
}
|
||||
@@ -4955,24 +4994,6 @@ float Player::GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
float Player::OCTRegenMPPerSpirit() const
|
||||
{
|
||||
uint8 level = getLevel();
|
||||
uint32 pclass = getClass();
|
||||
|
||||
if (level >= sGtRegenMPPerSptStore.GetTableRowCount())
|
||||
level = sGtRegenMPPerSptStore.GetTableRowCount() - 1;
|
||||
|
||||
GtRegenMPPerSptEntry const* moreRatio = sGtRegenMPPerSptStore.EvaluateTable(level - 1, pclass - 1);
|
||||
if (moreRatio == nullptr)
|
||||
return 0.0f;
|
||||
|
||||
// Formula get from PaperDollFrame script
|
||||
float spirit = GetStat(STAT_SPIRIT);
|
||||
float regen = spirit * moreRatio->ratio;
|
||||
return regen;
|
||||
}
|
||||
|
||||
void Player::ApplyRatingMod(CombatRating combatRating, int32 value, bool apply)
|
||||
{
|
||||
float oldRating = m_baseRatingValue[combatRating];
|
||||
@@ -5024,7 +5045,7 @@ void Player::UpdateRating(CombatRating cr)
|
||||
|
||||
switch (cr)
|
||||
{
|
||||
case CR_UNUSED_1:
|
||||
case CR_AMPLIFY:
|
||||
case CR_DEFENSE_SKILL:
|
||||
break;
|
||||
case CR_DODGE:
|
||||
@@ -5063,7 +5084,7 @@ void Player::UpdateRating(CombatRating cr)
|
||||
case CR_MULTISTRIKE:
|
||||
case CR_READINESS:
|
||||
case CR_SPEED:
|
||||
case CR_RESILIENCE_PLAYER_DAMAGE_TAKEN:
|
||||
case CR_RESILIENCE_PLAYER_DAMAGE:
|
||||
case CR_RESILIENCE_CRIT_TAKEN:
|
||||
case CR_LIFESTEAL:
|
||||
break;
|
||||
@@ -5072,8 +5093,8 @@ void Player::UpdateRating(CombatRating cr)
|
||||
case CR_HASTE_SPELL:
|
||||
break;
|
||||
case CR_AVOIDANCE:
|
||||
case CR_UNUSED_2:
|
||||
case CR_WEAPON_SKILL_RANGED:
|
||||
case CR_STURDINESS:
|
||||
case CR_UNUSED_7:
|
||||
break;
|
||||
case CR_EXPERTISE:
|
||||
if (affectStats)
|
||||
@@ -5089,8 +5110,8 @@ void Player::UpdateRating(CombatRating cr)
|
||||
case CR_MASTERY:
|
||||
UpdateMastery();
|
||||
break;
|
||||
case CR_UNUSED_3:
|
||||
case CR_UNUSED_4:
|
||||
case CR_PVP_POWER:
|
||||
case CR_CLEAVE:
|
||||
case CR_VERSATILITY_DAMAGE_DONE:
|
||||
case CR_VERSATILITY_DAMAGE_TAKEN:
|
||||
break;
|
||||
@@ -6085,7 +6106,7 @@ void Player::RewardReputation(Unit* victim, float rate)
|
||||
// support for: Championing - http://www.wowwiki.com/Championing
|
||||
Map const* map = GetMap();
|
||||
if (map->IsNonRaidDungeon())
|
||||
if (LFGDungeonEntry const* dungeon = GetLFGDungeon(map->GetId(), map->GetDifficultyID()))
|
||||
if (LfgDungeonsEntry const* dungeon = DB2Manager::GetLfgDungeon(map->GetId(), map->GetDifficultyID()))
|
||||
if (dungeon->TargetLevel == 80)
|
||||
ChampioningFaction = GetChampioningFaction();
|
||||
}
|
||||
@@ -7235,7 +7256,7 @@ void Player::_ApplyItemBonuses(Item* item, uint8 slot, bool apply)
|
||||
// ApplyRatingMod(CR_CRIT_TAKEN_MELEE, int32(val), apply);
|
||||
// break;
|
||||
case ITEM_MOD_CRIT_TAKEN_RANGED_RATING:
|
||||
ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN, int32(val), apply);
|
||||
ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE, int32(val), apply);
|
||||
break;
|
||||
// case ITEM_MOD_CRIT_TAKEN_SPELL_RATING:
|
||||
// ApplyRatingMod(CR_CRIT_TAKEN_SPELL, int32(val), apply);
|
||||
@@ -7270,7 +7291,7 @@ void Player::_ApplyItemBonuses(Item* item, uint8 slot, bool apply)
|
||||
// ApplyRatingMod(CR_CRIT_TAKEN_SPELL, int32(val), apply);
|
||||
// break;
|
||||
case ITEM_MOD_RESILIENCE_RATING:
|
||||
ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN, int32(val), apply);
|
||||
ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE, int32(val), apply);
|
||||
break;
|
||||
case ITEM_MOD_HASTE_RATING:
|
||||
ApplyRatingMod(CR_HASTE_MELEE, int32(val), apply);
|
||||
@@ -7723,7 +7744,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
|
||||
if (!spellInfo)
|
||||
{
|
||||
TC_LOG_ERROR("entities.player.items", "Player::CastItemCombatSpell: Player '%s' (%s) cast unknown spell (EnchantID: %u, SpellID: %i), ignoring",
|
||||
GetName().c_str(), GetGUID().ToString().c_str(), pEnchant->ID, pEnchant->EffectSpellID[s]);
|
||||
GetName().c_str(), GetGUID().ToString().c_str(), enchant_id, pEnchant->EffectSpellID[s]);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -7823,7 +7844,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->EffectSpellID[s]);
|
||||
if (!spellInfo)
|
||||
{
|
||||
TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell: Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->EffectSpellID[s]);
|
||||
TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell: Enchant %i, cast unknown spell %i", enchant_id, pEnchant->EffectSpellID[s]);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -13011,7 +13032,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
|
||||
// ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply);
|
||||
// break;
|
||||
case ITEM_MOD_RESILIENCE_RATING:
|
||||
ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN, enchant_amount, apply);
|
||||
ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE, enchant_amount, apply);
|
||||
TC_LOG_DEBUG("entities.player.items", "+ %u RESILIENCE", enchant_amount);
|
||||
break;
|
||||
case ITEM_MOD_HASTE_RATING:
|
||||
@@ -18076,7 +18097,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
|
||||
}
|
||||
else
|
||||
{
|
||||
MapDifficultyEntry const* mapDiff = GetMapDifficultyData(mapId, Difficulty(difficulty));
|
||||
MapDifficultyEntry const* mapDiff = sDB2Manager.GetMapDifficultyData(mapId, Difficulty(difficulty));
|
||||
if (!mapDiff)
|
||||
{
|
||||
TC_LOG_ERROR("entities.player", "Player::_LoadBoundInstances: player '%s' (%s) has bind to not existed difficulty %d instance for map %u (%s)",
|
||||
@@ -18114,7 +18135,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
|
||||
InstancePlayerBind* Player::GetBoundInstance(uint32 mapid, Difficulty difficulty, bool withExpired)
|
||||
{
|
||||
// some instances only have one difficulty
|
||||
MapDifficultyEntry const* mapDiff = GetDownscaledMapDifficultyData(mapid, difficulty);
|
||||
MapDifficultyEntry const* mapDiff = sDB2Manager.GetDownscaledMapDifficultyData(mapid, difficulty);
|
||||
if (!mapDiff)
|
||||
return nullptr;
|
||||
|
||||
@@ -18128,7 +18149,7 @@ InstancePlayerBind* Player::GetBoundInstance(uint32 mapid, Difficulty difficulty
|
||||
InstancePlayerBind const* Player::GetBoundInstance(uint32 mapid, Difficulty difficulty) const
|
||||
{
|
||||
// some instances only have one difficulty
|
||||
MapDifficultyEntry const* mapDiff = GetDownscaledMapDifficultyData(mapid, difficulty);
|
||||
MapDifficultyEntry const* mapDiff = sDB2Manager.GetDownscaledMapDifficultyData(mapid, difficulty);
|
||||
if (!mapDiff)
|
||||
return nullptr;
|
||||
|
||||
@@ -18360,14 +18381,14 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report
|
||||
missingAchievement = ar->achievement;
|
||||
|
||||
Difficulty target_difficulty = GetDifficultyID(mapEntry);
|
||||
MapDifficultyEntry const* mapDiff = GetDownscaledMapDifficultyData(target_map, target_difficulty);
|
||||
MapDifficultyEntry const* mapDiff = sDB2Manager.GetDownscaledMapDifficultyData(target_map, target_difficulty);
|
||||
if (LevelMin || LevelMax || missingItem || missingQuest || missingAchievement)
|
||||
{
|
||||
if (report)
|
||||
{
|
||||
if (missingQuest && !ar->questFailedText.empty())
|
||||
ChatHandler(GetSession()).PSendSysMessage("%s", ar->questFailedText.c_str());
|
||||
else if (mapDiff->HasMessage()) // if (missingAchievement) covered by this case
|
||||
else if (mapDiff->Message_lang->Str[sWorld->GetDefaultDbcLocale()][0] != '\0') // if (missingAchievement) covered by this case
|
||||
SendTransferAborted(target_map, TRANSFER_ABORT_DIFFICULTY, target_difficulty);
|
||||
else if (missingItem)
|
||||
GetSession()->SendNotification(GetSession()->GetTrinityString(LANG_LEVEL_MINREQUIRED_AND_ITEM), LevelMin, ASSERT_NOTNULL(sObjectMgr->GetItemTemplate(missingItem))->GetName(GetSession()->GetSessionDbcLocale()));
|
||||
@@ -19608,7 +19629,7 @@ void Player::_SaveStats(SQLTransaction& trans) const
|
||||
stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_ATTACK_POWER));
|
||||
stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER));
|
||||
stmt->setUInt32(index++, GetBaseSpellPowerBonus());
|
||||
stmt->setUInt32(index, GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_RESILIENCE_PLAYER_DAMAGE_TAKEN));
|
||||
stmt->setUInt32(index, GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_RESILIENCE_PLAYER_DAMAGE));
|
||||
|
||||
trans->Append(stmt);
|
||||
}
|
||||
@@ -23789,7 +23810,7 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z)
|
||||
if (uint32 liqEntry = liquid_status.entry)
|
||||
{
|
||||
LiquidTypeEntry const* liquid = sLiquidTypeStore.LookupEntry(liqEntry);
|
||||
if (_lastLiquid && _lastLiquid->SpellID && _lastLiquid->ID != liqEntry)
|
||||
if (_lastLiquid && _lastLiquid->SpellID && _lastLiquid != liquid)
|
||||
RemoveAurasDueToSpell(_lastLiquid->SpellID);
|
||||
|
||||
if (liquid && liquid->SpellID)
|
||||
@@ -23940,7 +23961,7 @@ bool Player::CanUseBattlegroundObject(GameObject* gameobject) const
|
||||
FactionTemplateEntry const* playerFaction = GetFactionTemplateEntry();
|
||||
FactionTemplateEntry const* faction = sFactionTemplateStore.LookupEntry(gameobject->GetUInt32Value(GAMEOBJECT_FACTION));
|
||||
|
||||
if (playerFaction && faction && !playerFaction->IsFriendlyTo(*faction))
|
||||
if (playerFaction && faction && !playerFaction->IsFriendlyTo(faction))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -23960,11 +23981,6 @@ bool Player::CanCaptureTowerPoint() const
|
||||
|
||||
uint32 Player::GetBarberShopCost(BarberShopStyleEntry const* newHairStyle, uint8 newHairColor, BarberShopStyleEntry const* newFacialHair, BarberShopStyleEntry const* newSkin /*= nullptr*/, BarberShopStyleEntry const* newFace /*= nullptr*/) const
|
||||
{
|
||||
uint8 level = getLevel();
|
||||
|
||||
if (level >= sGtBarberShopCostBaseStore.GetTableRowCount())
|
||||
level = sGtBarberShopCostBaseStore.GetTableRowCount() - 1;
|
||||
|
||||
uint8 hairstyle = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID);
|
||||
uint8 haircolor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID);
|
||||
uint8 facialhair = GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE);
|
||||
@@ -23974,26 +23990,26 @@ uint32 Player::GetBarberShopCost(BarberShopStyleEntry const* newHairStyle, uint8
|
||||
if ((hairstyle == newHairStyle->Data) && (haircolor == newHairColor) && (facialhair == newFacialHair->Data) && (!newSkin || (newSkin->Data == skincolor)) && (!newFace || (newFace->Data == face)))
|
||||
return 0;
|
||||
|
||||
GtBarberShopCostBaseEntry const* bsc = sGtBarberShopCostBaseStore.EvaluateTable(level - 1, 0);
|
||||
GtBarberShopCostBaseEntry const* bsc = sBarberShopCostBaseGameTable.GetRow(getLevel());
|
||||
if (!bsc) // shouldn't happen
|
||||
return 0xFFFFFFFF;
|
||||
|
||||
uint32 cost = 0;
|
||||
|
||||
if (hairstyle != newHairStyle->Data)
|
||||
cost += uint32(bsc->cost * newHairStyle->CostModifier);
|
||||
cost += uint32(bsc->Cost * newHairStyle->CostModifier);
|
||||
|
||||
if ((haircolor != newHairColor) && (hairstyle == newHairStyle->Data))
|
||||
cost += uint32(bsc->cost * 0.5f); // +1/2 of price
|
||||
cost += uint32(bsc->Cost * 0.5f); // +1/2 of price
|
||||
|
||||
if (facialhair != newFacialHair->Data)
|
||||
cost += uint32(bsc->cost * newFacialHair->CostModifier);
|
||||
cost += uint32(bsc->Cost * newFacialHair->CostModifier);
|
||||
|
||||
if (newSkin && skincolor != newSkin->Data)
|
||||
cost += uint32(bsc->cost * newSkin->CostModifier);
|
||||
cost += uint32(bsc->Cost * newSkin->CostModifier);
|
||||
|
||||
if (newFace && face != newFace->Data)
|
||||
cost += uint32(bsc->cost * newFace->CostModifier);
|
||||
cost += uint32(bsc->Cost * newFace->CostModifier);
|
||||
|
||||
return cost;
|
||||
}
|
||||
@@ -24302,7 +24318,7 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot)
|
||||
bool Player::CanFlyInZone(uint32 mapid, uint32 zone) const
|
||||
{
|
||||
// continent checked in SpellInfo::CheckLocation at cast and area update
|
||||
uint32 v_map = GetVirtualMapForMapAndZone(mapid, zone);
|
||||
uint32 v_map = sDB2Manager.GetVirtualMapForMapAndZone(mapid, zone);
|
||||
return v_map != 571 || HasSpell(54197); // 54197 = Cold Weather Flying
|
||||
}
|
||||
|
||||
@@ -24632,7 +24648,7 @@ bool Player::LearnTalent(uint32 talentId)
|
||||
// but only 2 out of 3 have SpecID != 0
|
||||
// We need to make sure that if player is in one of these defined specs he will not learn the other choice
|
||||
TalentEntry const* bestSlotMatch = nullptr;
|
||||
for (TalentEntry const* talent : sTalentByPos[getClass()][talentInfo->TierID][talentInfo->ColumnIndex])
|
||||
for (TalentEntry const* talent : sDB2Manager.GetTalentsByPosition(getClass(), talentInfo->TierID, talentInfo->ColumnIndex))
|
||||
{
|
||||
if (!talent->SpecID)
|
||||
bestSlotMatch = talent;
|
||||
@@ -24648,7 +24664,7 @@ bool Player::LearnTalent(uint32 talentId)
|
||||
|
||||
// Check if player doesn't have any talent in current tier
|
||||
for (uint32 c = 0; c < MAX_TALENT_COLUMNS; ++c)
|
||||
for (TalentEntry const* talent : sTalentByPos[getClass()][talentInfo->TierID][c])
|
||||
for (TalentEntry const* talent : sDB2Manager.GetTalentsByPosition(getClass(), talentInfo->TierID, c))
|
||||
if (HasTalent(talent->ID, GetActiveTalentGroup()))
|
||||
return false;
|
||||
|
||||
@@ -24686,8 +24702,8 @@ void Player::LearnTalentSpecialization(uint32 talentSpec)
|
||||
uint32 class_ = getClass();
|
||||
for (uint32 t = 0; t < MAX_TALENT_TIERS; ++t)
|
||||
for (uint32 c = 0; c < MAX_TALENT_COLUMNS; ++c)
|
||||
if (sTalentByPos[class_][t][c].size() > 1)
|
||||
for (TalentEntry const* talent : sTalentByPos[class_][t][c])
|
||||
if (sDB2Manager.GetTalentsByPosition(class_, t, c).size() > 1)
|
||||
for (TalentEntry const* talent : sDB2Manager.GetTalentsByPosition(class_, t, c))
|
||||
RemoveTalent(talent);
|
||||
|
||||
LearnSpecializationSpells();
|
||||
@@ -24707,8 +24723,8 @@ void Player::ResetTalentSpecialization()
|
||||
uint32 class_ = getClass();
|
||||
for (uint32 t = 0; t < MAX_TALENT_TIERS; ++t)
|
||||
for (uint32 c = 0; c < MAX_TALENT_COLUMNS; ++c)
|
||||
if (sTalentByPos[class_][t][c].size() > 1)
|
||||
for (TalentEntry const* talent : sTalentByPos[class_][t][c])
|
||||
if (sDB2Manager.GetTalentsByPosition(class_, t, c).size() > 1)
|
||||
for (TalentEntry const* talent : sDB2Manager.GetTalentsByPosition(class_, t, c))
|
||||
RemoveTalent(talent);
|
||||
|
||||
RemoveSpecializationSpells();
|
||||
@@ -26042,7 +26058,7 @@ Difficulty Player::GetDifficultyID(MapEntry const* mapEntry) const
|
||||
if (!mapEntry->IsRaid())
|
||||
return m_dungeonDifficulty;
|
||||
|
||||
MapDifficultyEntry const* defaultDifficulty = GetDefaultMapDifficulty(mapEntry->ID);
|
||||
MapDifficultyEntry const* defaultDifficulty = sDB2Manager.GetDefaultMapDifficulty(mapEntry->ID);
|
||||
if (!defaultDifficulty)
|
||||
return m_legacyRaidDifficulty;
|
||||
|
||||
@@ -26191,9 +26207,9 @@ bool Player::ValidateAppearance(uint8 race, uint8 class_, uint8 gender, uint8 ha
|
||||
{
|
||||
// Check skin color
|
||||
// For Skin type is always 0
|
||||
if (CharSectionsEntry const* entry = GetCharSectionEntry(race, SECTION_TYPE_SKIN, gender, 0, skinColor))
|
||||
if (CharSectionsEntry const* entry = sDB2Manager.GetCharSectionEntry(race, SECTION_TYPE_SKIN, gender, 0, skinColor))
|
||||
{ // Skin Color defined as Face color, too, we check skin & face in one pass
|
||||
if (CharSectionsEntry const* entry2 = GetCharSectionEntry(race, SECTION_TYPE_FACE, gender, faceID, skinColor))
|
||||
if (CharSectionsEntry const* entry2 = sDB2Manager.GetCharSectionEntry(race, SECTION_TYPE_FACE, gender, faceID, skinColor))
|
||||
{
|
||||
if (!IsSectionFlagValid(entry, class_, create))
|
||||
return false;
|
||||
@@ -26210,14 +26226,14 @@ bool Player::ValidateAppearance(uint8 race, uint8 class_, uint8 gender, uint8 ha
|
||||
bool excludeCheck = (race == RACE_TAUREN) || (race == RACE_DRAENEI) || (gender == GENDER_FEMALE && race != RACE_NIGHTELF && race != RACE_UNDEAD_PLAYER);
|
||||
|
||||
// Check Hair
|
||||
if (CharSectionsEntry const* entry = GetCharSectionEntry(race, SECTION_TYPE_HAIR, gender, hairID, hairColor))
|
||||
if (CharSectionsEntry const* entry = sDB2Manager.GetCharSectionEntry(race, SECTION_TYPE_HAIR, gender, hairID, hairColor))
|
||||
{
|
||||
if (!IsSectionFlagValid(entry, class_, create))
|
||||
return false;
|
||||
|
||||
if (!excludeCheck)
|
||||
{
|
||||
if (CharSectionsEntry const* entry2 = GetCharSectionEntry(race, SECTION_TYPE_FACIAL_HAIR, gender, facialHair, hairColor))
|
||||
if (CharSectionsEntry const* entry2 = sDB2Manager.GetCharSectionEntry(race, SECTION_TYPE_FACIAL_HAIR, gender, facialHair, hairColor))
|
||||
{
|
||||
if (!IsSectionFlagValid(entry2, class_, create))
|
||||
return false;
|
||||
@@ -26235,7 +26251,7 @@ bool Player::ValidateAppearance(uint8 race, uint8 class_, uint8 gender, uint8 ha
|
||||
return false;
|
||||
|
||||
for (uint32 i = 0; i < PLAYER_CUSTOM_DISPLAY_SIZE; ++i)
|
||||
if (CharSectionsEntry const* entry = GetCharSectionEntry(race, CharSectionType(SECTION_TYPE_CUSTOM_DISPLAY_1 + i * 2), gender, customDisplay[i], 0))
|
||||
if (CharSectionsEntry const* entry = sDB2Manager.GetCharSectionEntry(race, CharSectionType(SECTION_TYPE_CUSTOM_DISPLAY_1 + i * 2), gender, customDisplay[i], 0))
|
||||
if (!IsSectionFlagValid(entry, class_, create))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#ifndef _PLAYER_H
|
||||
#define _PLAYER_H
|
||||
|
||||
#include "DBCStores.h"
|
||||
#include "DB2Stores.h"
|
||||
#include "GroupReference.h"
|
||||
#include "MapReference.h"
|
||||
@@ -1940,10 +1939,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage) override;
|
||||
|
||||
void RecalculateRating(CombatRating cr) { ApplyRatingMod(cr, 0, true);}
|
||||
float GetMeleeCritFromAgility() const;
|
||||
void GetDodgeFromAgility(float &diminishing, float &nondiminishing) const;
|
||||
float GetSpellCritFromIntellect() const;
|
||||
float OCTRegenMPPerSpirit() const;
|
||||
float GetRatingMultiplier(CombatRating cr) const;
|
||||
float GetRatingBonusValue(CombatRating cr) const;
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "TaxiPathGraph.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "DBCStores.h"
|
||||
#include "DB2Stores.h"
|
||||
#include "Config.h"
|
||||
#include "Util.h"
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "MapManager.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "DBCStores.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "Vehicle.h"
|
||||
#include "Player.h"
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "Player.h"
|
||||
#include "Pet.h"
|
||||
#include "Creature.h"
|
||||
#include "GameTables.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
@@ -265,8 +266,8 @@ float Player::GetHealthBonusFromStamina()
|
||||
{
|
||||
// Taken from PaperDollFrame.lua - 6.0.3.19085
|
||||
float ratio = 10.0f;
|
||||
if (GtOCTHpPerStaminaEntry const* hpBase = sGtOCTHpPerStaminaStore.EvaluateTable(getLevel() - 1, 0))
|
||||
ratio = hpBase->ratio;
|
||||
if (GtHpPerStaEntry const* hpBase = sHpPerStaGameTable.GetRow(getLevel()))
|
||||
ratio = hpBase->Health;
|
||||
|
||||
float stamina = GetStat(STAT_STAMINA);
|
||||
|
||||
@@ -512,7 +513,7 @@ void Player::UpdateCritPercentage(WeaponAttackType attType)
|
||||
|
||||
void Player::UpdateAllCritPercentages()
|
||||
{
|
||||
float value = GetMeleeCritFromAgility();
|
||||
float value = 5.0f;
|
||||
|
||||
SetBaseModValue(CRIT_PERCENTAGE, PCT_MOD, value);
|
||||
SetBaseModValue(OFFHAND_CRIT_PERCENTAGE, PCT_MOD, value);
|
||||
@@ -654,9 +655,7 @@ void Player::UpdateSpellCritChance(uint32 school)
|
||||
return;
|
||||
}
|
||||
// For others recalculate it from:
|
||||
float crit = 0.0f;
|
||||
// Crit from Intellect
|
||||
crit += GetSpellCritFromIntellect();
|
||||
float crit = 5.0f;
|
||||
// Increase crit from SPELL_AURA_MOD_SPELL_CRIT_CHANCE
|
||||
crit += GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
|
||||
// Increase crit from SPELL_AURA_MOD_CRIT_PCT
|
||||
@@ -754,7 +753,7 @@ void Player::UpdateManaRegen()
|
||||
return;
|
||||
|
||||
// Mana regen from spirit
|
||||
float spirit_regen = OCTRegenMPPerSpirit();
|
||||
float spirit_regen = 0.0f;
|
||||
// Apply PCT bonus from SPELL_AURA_MOD_POWER_REGEN_PERCENT aura on spirit base regen
|
||||
spirit_regen *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, POWER_MANA);
|
||||
|
||||
|
||||
@@ -1430,7 +1430,7 @@ void Unit::HandleEmoteCommand(uint32 anim_id)
|
||||
SendMessageToSet(packet.Write(), true);
|
||||
}
|
||||
|
||||
bool Unit::IsDamageReducedByArmor(SpellSchoolMask schoolMask, SpellInfo const* spellInfo, uint8 effIndex)
|
||||
bool Unit::IsDamageReducedByArmor(SpellSchoolMask schoolMask, SpellInfo const* spellInfo /*= nullptr*/, int8 effIndex /*= -1*/)
|
||||
{
|
||||
// only physical spells damage gets reduced by armor
|
||||
if ((schoolMask & SPELL_SCHOOL_MASK_NORMAL) == 0)
|
||||
@@ -1441,13 +1441,16 @@ bool Unit::IsDamageReducedByArmor(SpellSchoolMask schoolMask, SpellInfo const* s
|
||||
if (spellInfo->HasAttribute(SPELL_ATTR0_CU_IGNORE_ARMOR))
|
||||
return false;
|
||||
|
||||
// bleeding effects are not reduced by armor
|
||||
if (SpellEffectInfo const* effect = spellInfo->GetEffect(GetMap()->GetDifficultyID(), effIndex))
|
||||
if (effIndex != -1)
|
||||
{
|
||||
if (effect->ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE ||
|
||||
effect->Effect == SPELL_EFFECT_SCHOOL_DAMAGE)
|
||||
if (spellInfo->GetEffectMechanicMask(effIndex) & (1<<MECHANIC_BLEED))
|
||||
return false;
|
||||
// bleeding effects are not reduced by armor
|
||||
if (SpellEffectInfo const* effect = spellInfo->GetEffect(GetMap()->GetDifficultyID(), effIndex))
|
||||
{
|
||||
if (effect->ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE ||
|
||||
effect->Effect == SPELL_EFFECT_SCHOOL_DAMAGE)
|
||||
if (spellInfo->GetEffectMechanicMask(effIndex) & (1 << MECHANIC_BLEED))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -6733,11 +6736,11 @@ ReputationRank Unit::GetFactionReactionTo(FactionTemplateEntry const* factionTem
|
||||
}
|
||||
|
||||
// common faction based check
|
||||
if (factionTemplateEntry->IsHostileTo(*targetFactionTemplateEntry))
|
||||
if (factionTemplateEntry->IsHostileTo(targetFactionTemplateEntry))
|
||||
return REP_HOSTILE;
|
||||
if (factionTemplateEntry->IsFriendlyTo(*targetFactionTemplateEntry))
|
||||
if (factionTemplateEntry->IsFriendlyTo(targetFactionTemplateEntry))
|
||||
return REP_FRIENDLY;
|
||||
if (targetFactionTemplateEntry->IsFriendlyTo(*factionTemplateEntry))
|
||||
if (targetFactionTemplateEntry->IsFriendlyTo(factionTemplateEntry))
|
||||
return REP_FRIENDLY;
|
||||
if (factionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT)
|
||||
return REP_HOSTILE;
|
||||
@@ -8952,7 +8955,7 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT
|
||||
{
|
||||
if (Player* player = ToPlayer())
|
||||
{
|
||||
float mod = player->GetRatingBonusValue(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN) * (-8.0f);
|
||||
float mod = player->GetRatingBonusValue(CR_RESILIENCE_PLAYER_DAMAGE) * (-8.0f);
|
||||
AddPct(TakenTotalMod, std::max(mod, float((*i)->GetAmount())));
|
||||
}
|
||||
}
|
||||
@@ -15739,7 +15742,7 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
|
||||
{
|
||||
FactionTemplateEntry const* ft1 = GetFactionTemplateEntry();
|
||||
FactionTemplateEntry const* ft2 = target->GetFactionTemplateEntry();
|
||||
if (ft1 && ft2 && !ft1->IsFriendlyTo(*ft2))
|
||||
if (ft1 && ft2 && !ft1->IsFriendlyTo(ft2))
|
||||
{
|
||||
if (index == UNIT_FIELD_BYTES_2)
|
||||
// Allow targetting opposite faction in party when enabled in config
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#ifndef __UNIT_H
|
||||
#define __UNIT_H
|
||||
|
||||
#include "DBCStructure.h"
|
||||
#include "EventProcessor.h"
|
||||
#include "FollowerReference.h"
|
||||
#include "FollowerRefManager.h"
|
||||
@@ -381,6 +380,7 @@ enum InventorySlot
|
||||
};
|
||||
|
||||
struct FactionTemplateEntry;
|
||||
struct LiquidTypeEntry;
|
||||
struct MountCapabilityEntry;
|
||||
struct SpellValue;
|
||||
|
||||
@@ -623,8 +623,8 @@ enum WeaponAttackType : uint8
|
||||
|
||||
enum CombatRating
|
||||
{
|
||||
CR_UNUSED_1 = 0,
|
||||
CR_DEFENSE_SKILL = 1, // Removed in 4.0.1
|
||||
CR_AMPLIFY = 0,
|
||||
CR_DEFENSE_SKILL = 1,
|
||||
CR_DODGE = 2,
|
||||
CR_PARRY = 3,
|
||||
CR_BLOCK = 4,
|
||||
@@ -638,22 +638,23 @@ enum CombatRating
|
||||
CR_READINESS = 12,
|
||||
CR_SPEED = 13,
|
||||
CR_RESILIENCE_CRIT_TAKEN = 14,
|
||||
CR_RESILIENCE_PLAYER_DAMAGE_TAKEN = 15,
|
||||
CR_RESILIENCE_PLAYER_DAMAGE = 15,
|
||||
CR_LIFESTEAL = 16,
|
||||
CR_HASTE_MELEE = 17,
|
||||
CR_HASTE_RANGED = 18,
|
||||
CR_HASTE_SPELL = 19,
|
||||
CR_AVOIDANCE = 20,
|
||||
CR_UNUSED_2 = 21,
|
||||
CR_WEAPON_SKILL_RANGED = 22,
|
||||
CR_STURDINESS = 21,
|
||||
CR_UNUSED_7 = 22,
|
||||
CR_EXPERTISE = 23,
|
||||
CR_ARMOR_PENETRATION = 24,
|
||||
CR_MASTERY = 25,
|
||||
CR_UNUSED_3 = 26,
|
||||
CR_UNUSED_4 = 27,
|
||||
CR_PVP_POWER = 26,
|
||||
CR_CLEAVE = 27,
|
||||
CR_VERSATILITY_DAMAGE_DONE = 28,
|
||||
// placeholder = 29,
|
||||
CR_VERSATILITY_DAMAGE_TAKEN = 30
|
||||
CR_VERSATILITY_HEALING_DONE = 29,
|
||||
CR_VERSATILITY_DAMAGE_TAKEN = 30,
|
||||
CR_UNUSED_12 = 31
|
||||
};
|
||||
|
||||
#define MAX_COMBAT_RATING 31
|
||||
@@ -1539,7 +1540,7 @@ class TC_GAME_API Unit : public WorldObject
|
||||
void DealSpellDamage(SpellNonMeleeDamage const* damageInfo, bool durabilityLoss);
|
||||
|
||||
// player or player's pet resilience (-1%)
|
||||
uint32 GetDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN, 1.0f, 100.0f, damage); }
|
||||
uint32 GetDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_RESILIENCE_PLAYER_DAMAGE, 1.0f, 100.0f, damage); }
|
||||
|
||||
void ApplyResilience(Unit const* victim, int32* damage) const;
|
||||
|
||||
@@ -2079,7 +2080,7 @@ class TC_GAME_API Unit : public WorldObject
|
||||
bool IsImmunedToDamage(SpellInfo const* spellInfo) const;
|
||||
virtual bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const; // redefined in Creature
|
||||
|
||||
bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const* spellInfo = NULL, uint8 effIndex = MAX_SPELL_EFFECTS);
|
||||
bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const* spellInfo = nullptr, int8 effIndex = -1);
|
||||
uint32 CalcArmorReducedDamage(Unit* attacker, Unit* victim, const uint32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType = MAX_ATTACK);
|
||||
uint32 CalcSpellResistance(Unit* victim, SpellSchoolMask schoolMask, SpellInfo const* spellInfo) const;
|
||||
void CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, uint32 const damage, uint32* absorb, uint32* resist, SpellInfo const* spellInfo = NULL);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "VehicleDefines.h"
|
||||
|
||||
Garrison::Garrison(Player* owner) : _owner(owner), _siteLevelId(0), _siteLevel(nullptr), _followerActivationsRemainingToday(1)
|
||||
Garrison::Garrison(Player* owner) : _owner(owner), _siteLevel(nullptr), _followerActivationsRemainingToday(1)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -34,8 +34,7 @@ bool Garrison::LoadFromDB(PreparedQueryResult garrison, PreparedQueryResult blue
|
||||
return false;
|
||||
|
||||
Field* fields = garrison->Fetch();
|
||||
_siteLevelId = fields[0].GetUInt32();
|
||||
_siteLevel = sGarrSiteLevelStore.LookupEntry(_siteLevelId);
|
||||
_siteLevel = sGarrSiteLevelStore.LookupEntry(_siteLevel->ID);
|
||||
_followerActivationsRemainingToday = fields[1].GetUInt32();
|
||||
if (!_siteLevel)
|
||||
return false;
|
||||
@@ -142,7 +141,7 @@ void Garrison::SaveToDB(SQLTransaction trans)
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_GARRISON);
|
||||
stmt->setUInt64(0, _owner->GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, _siteLevelId);
|
||||
stmt->setUInt32(1, _siteLevel->ID);
|
||||
stmt->setUInt32(2, _followerActivationsRemainingToday);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -220,17 +219,16 @@ void Garrison::DeleteFromDB(ObjectGuid::LowType ownerGuid, SQLTransaction trans)
|
||||
|
||||
bool Garrison::Create(uint32 garrSiteId)
|
||||
{
|
||||
DBStorageIterator<GarrSiteLevelEntry> siteLevelItr = sGarrisonMgr.GetGarrSiteLevelEntry(garrSiteId, 1);
|
||||
if (siteLevelItr == sGarrSiteLevelStore.end())
|
||||
GarrSiteLevelEntry const* siteLevel = sGarrisonMgr.GetGarrSiteLevelEntry(garrSiteId, 1);
|
||||
if (!siteLevel)
|
||||
return false;
|
||||
|
||||
_siteLevelId = siteLevelItr.ID();
|
||||
_siteLevel = siteLevelItr.Data();
|
||||
_siteLevel = siteLevel;
|
||||
|
||||
InitializePlots();
|
||||
|
||||
WorldPackets::Garrison::GarrisonCreateResult garrisonCreateResult;
|
||||
garrisonCreateResult.GarrSiteLevelID = _siteLevelId;
|
||||
garrisonCreateResult.GarrSiteLevelID = _siteLevel->ID;
|
||||
_owner->SendDirectMessage(garrisonCreateResult.Write());
|
||||
_owner->SendUpdatePhasing();
|
||||
SendRemoteInfo();
|
||||
@@ -251,11 +249,11 @@ void Garrison::Delete()
|
||||
|
||||
void Garrison::InitializePlots()
|
||||
{
|
||||
if (std::vector<std::pair<uint32, GarrSiteLevelPlotInstEntry const*>> const* plots = sGarrisonMgr.GetGarrPlotInstForSiteLevel(_siteLevelId))
|
||||
if (std::vector<GarrSiteLevelPlotInstEntry const*> const* plots = sGarrisonMgr.GetGarrPlotInstForSiteLevel(_siteLevel->ID))
|
||||
{
|
||||
for (std::size_t i = 0; i < plots->size(); ++i)
|
||||
{
|
||||
uint32 garrPlotInstanceId = plots->at(i).second->GarrPlotInstanceID;
|
||||
uint32 garrPlotInstanceId = plots->at(i)->GarrPlotInstanceID;
|
||||
GarrPlotInstanceEntry const* plotInstance = sGarrPlotInstanceStore.LookupEntry(garrPlotInstanceId);
|
||||
GameObjectsEntry const* gameObject = sGarrisonMgr.GetPlotGameObject(_siteLevel->MapID, garrPlotInstanceId);
|
||||
if (!plotInstance || !gameObject)
|
||||
@@ -270,7 +268,7 @@ void Garrison::InitializePlots()
|
||||
plotInfo.PacketInfo.PlotPos.Relocate(gameObject->Position.X, gameObject->Position.Y, gameObject->Position.Z, 2 * std::acos(gameObject->RotationW));
|
||||
plotInfo.PacketInfo.PlotType = plot->PlotType;
|
||||
plotInfo.EmptyGameObjectId = gameObject->ID;
|
||||
plotInfo.GarrSiteLevelPlotInstId = plots->at(i).first;
|
||||
plotInfo.GarrSiteLevelPlotInstId = plots->at(i)->ID;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -531,7 +529,7 @@ void Garrison::SendInfo()
|
||||
{
|
||||
WorldPackets::Garrison::GetGarrisonInfoResult garrisonInfo;
|
||||
garrisonInfo.GarrSiteID = _siteLevel->SiteID;
|
||||
garrisonInfo.GarrSiteLevelID = _siteLevelId;
|
||||
garrisonInfo.GarrSiteLevelID = _siteLevel->ID;
|
||||
garrisonInfo.FactionIndex = GetFaction();
|
||||
garrisonInfo.NumFollowerActivationsRemaining = _followerActivationsRemainingToday;
|
||||
for (auto& p : _plots)
|
||||
@@ -558,7 +556,7 @@ void Garrison::SendRemoteInfo() const
|
||||
remoteInfo.Sites.resize(1);
|
||||
|
||||
WorldPackets::Garrison::GarrisonRemoteSiteInfo& remoteSiteInfo = remoteInfo.Sites[0];
|
||||
remoteSiteInfo.GarrSiteLevelID = _siteLevelId;
|
||||
remoteSiteInfo.GarrSiteLevelID = _siteLevel->ID;
|
||||
for (auto const& p : _plots)
|
||||
if (p.second.BuildingInfo.PacketInfo)
|
||||
remoteSiteInfo.Buildings.emplace_back(p.first, p.second.BuildingInfo.PacketInfo->GarrBuildingID);
|
||||
|
||||
@@ -157,7 +157,6 @@ private:
|
||||
GarrisonError CheckBuildingPlacement(uint32 garrPlotInstanceId, uint32 garrBuildingId) const;
|
||||
GarrisonError CheckBuildingRemoval(uint32 garrPlotInstanceId) const;
|
||||
Player* _owner;
|
||||
uint32 _siteLevelId;
|
||||
GarrSiteLevelEntry const* _siteLevel;
|
||||
uint32 _followerActivationsRemainingToday;
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ GarrisonMgr& GarrisonMgr::Instance()
|
||||
|
||||
void GarrisonMgr::Initialize()
|
||||
{
|
||||
for (auto itr = sGarrSiteLevelPlotInstStore.begin(); itr != sGarrSiteLevelPlotInstStore.end(); ++itr)
|
||||
_garrisonPlotInstBySiteLevel[itr->GarrSiteLevelID].push_back(std::make_pair(itr.ID(), itr.Data()));
|
||||
for (GarrSiteLevelPlotInstEntry const* siteLevelPlotInst : sGarrSiteLevelPlotInstStore)
|
||||
_garrisonPlotInstBySiteLevel[siteLevelPlotInst->GarrSiteLevelID].push_back(siteLevelPlotInst);
|
||||
|
||||
for (GameObjectsEntry const* gameObject : sGameObjectsStore)
|
||||
if (gameObject->Type == GAMEOBJECT_TYPE_GARRISON_PLOT)
|
||||
@@ -45,8 +45,8 @@ void GarrisonMgr::Initialize()
|
||||
for (GarrBuildingPlotInstEntry const* buildingPlotInst : sGarrBuildingPlotInstStore)
|
||||
_garrisonBuildingPlotInstances[MAKE_PAIR64(buildingPlotInst->GarrBuildingID, buildingPlotInst->GarrSiteLevelPlotInstID)] = buildingPlotInst->ID;
|
||||
|
||||
for (auto itr = sGarrBuildingStore.begin(); itr != sGarrBuildingStore.end(); ++itr)
|
||||
_garrisonBuildingsByType[itr->Type].push_back(itr.ID());
|
||||
for (GarrBuildingEntry const* building : sGarrBuildingStore)
|
||||
_garrisonBuildingsByType[building->Type].push_back(building->ID);
|
||||
|
||||
for (GarrFollowerXAbilityEntry const* followerAbility : sGarrFollowerXAbilityStore)
|
||||
{
|
||||
@@ -73,16 +73,16 @@ void GarrisonMgr::Initialize()
|
||||
LoadFollowerClassSpecAbilities();
|
||||
}
|
||||
|
||||
DBStorageIterator<GarrSiteLevelEntry> GarrisonMgr::GetGarrSiteLevelEntry(uint32 garrSiteId, uint32 level) const
|
||||
GarrSiteLevelEntry const* GarrisonMgr::GetGarrSiteLevelEntry(uint32 garrSiteId, uint32 level) const
|
||||
{
|
||||
for (auto itr = sGarrSiteLevelStore.begin(); itr != sGarrSiteLevelStore.end(); ++itr)
|
||||
if (itr->SiteID == garrSiteId && itr->Level == level)
|
||||
return itr;
|
||||
for (GarrSiteLevelEntry const* siteLevel : sGarrSiteLevelStore)
|
||||
if (siteLevel->SiteID == garrSiteId && siteLevel->Level == level)
|
||||
return siteLevel;
|
||||
|
||||
return sGarrSiteLevelStore.end();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector<std::pair<uint32, GarrSiteLevelPlotInstEntry const*>> const* GarrisonMgr::GetGarrPlotInstForSiteLevel(uint32 garrSiteLevelId) const
|
||||
std::vector<GarrSiteLevelPlotInstEntry const*> const* GarrisonMgr::GetGarrPlotInstForSiteLevel(uint32 garrSiteLevelId) const
|
||||
{
|
||||
auto itr = _garrisonPlotInstBySiteLevel.find(garrSiteLevelId);
|
||||
if (itr != _garrisonPlotInstBySiteLevel.end())
|
||||
|
||||
@@ -45,8 +45,8 @@ public:
|
||||
|
||||
void Initialize();
|
||||
|
||||
DBStorageIterator<GarrSiteLevelEntry> GetGarrSiteLevelEntry(uint32 garrSiteId, uint32 level) const;
|
||||
std::vector<std::pair<uint32, GarrSiteLevelPlotInstEntry const*>> const* GetGarrPlotInstForSiteLevel(uint32 garrSiteLevelId) const;
|
||||
GarrSiteLevelEntry const* GetGarrSiteLevelEntry(uint32 garrSiteId, uint32 level) const;
|
||||
std::vector<GarrSiteLevelPlotInstEntry const*> const* GetGarrPlotInstForSiteLevel(uint32 garrSiteLevelId) const;
|
||||
GameObjectsEntry const* GetPlotGameObject(uint32 mapId, uint32 garrPlotInstanceId) const;
|
||||
bool IsPlotMatchingBuilding(uint32 garrPlotId, uint32 garrBuildingId) const;
|
||||
uint32 GetGarrBuildingPlotInst(uint32 garrBuildingId, uint32 garrSiteLevelPlotInstId) const;
|
||||
@@ -61,7 +61,7 @@ private:
|
||||
void LoadPlotFinalizeGOInfo();
|
||||
void LoadFollowerClassSpecAbilities();
|
||||
|
||||
std::unordered_map<uint32 /*garrSiteId*/, std::vector<std::pair<uint32, GarrSiteLevelPlotInstEntry const*>>> _garrisonPlotInstBySiteLevel;
|
||||
std::unordered_map<uint32 /*garrSiteId*/, std::vector<GarrSiteLevelPlotInstEntry const*>> _garrisonPlotInstBySiteLevel;
|
||||
std::unordered_map<uint32 /*mapId*/, std::unordered_map<uint32 /*garrPlotId*/, GameObjectsEntry const*>> _garrisonPlots;
|
||||
std::unordered_map<uint32 /*garrPlotId*/, std::unordered_set<uint32/*garrBuildingId*/>> _garrisonBuildingsByPlot;
|
||||
std::unordered_map<uint64 /*garrBuildingId | garrSiteLevelPlotInstId << 32*/, uint32 /*garrBuildingPlotInstId*/> _garrisonBuildingPlotInstances;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ObjectMgr.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "AchievementMgr.h"
|
||||
#include "ArenaTeam.h"
|
||||
@@ -24,9 +25,9 @@
|
||||
#include "Chat.h"
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DB2Structure.h"
|
||||
#include "DB2Stores.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "GameTables.h"
|
||||
#include "GossipDef.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "GuildMgr.h"
|
||||
@@ -36,7 +37,6 @@
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "Object.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PoolMgr.h"
|
||||
#include "ReputationMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
@@ -1734,7 +1734,7 @@ void ObjectMgr::LoadCreatures()
|
||||
|
||||
// Build single time for check spawnmask
|
||||
std::map<uint32, uint32> spawnMasks;
|
||||
for (auto& mapDifficultyPair : sMapDifficultyMap)
|
||||
for (auto& mapDifficultyPair : sDB2Manager.GetMapDifficulties())
|
||||
for (auto& difficultyPair : mapDifficultyPair.second)
|
||||
spawnMasks[mapDifficultyPair.first] |= (1 << difficultyPair.first);
|
||||
|
||||
@@ -2046,7 +2046,7 @@ void ObjectMgr::LoadGameobjects()
|
||||
|
||||
// build single time for check spawnmask
|
||||
std::map<uint32, uint32> spawnMasks;
|
||||
for (auto& mapDifficultyPair : sMapDifficultyMap)
|
||||
for (auto& mapDifficultyPair : sDB2Manager.GetMapDifficulties())
|
||||
for (auto& difficultyPair : mapDifficultyPair.second)
|
||||
spawnMasks[mapDifficultyPair.first] |= (1 << difficultyPair.first);
|
||||
|
||||
@@ -2622,15 +2622,13 @@ void ObjectMgr::LoadItemTemplates()
|
||||
uint32 oldMSTime = getMSTime();
|
||||
uint32 sparseCount = 0;
|
||||
|
||||
for (auto itr = sItemSparseStore.begin(); itr != sItemSparseStore.end(); ++itr)
|
||||
for (ItemSparseEntry const* sparse : sItemSparseStore)
|
||||
{
|
||||
ItemSparseEntry const* sparse = itr.Data();
|
||||
ItemEntry const* db2Data = sItemStore.LookupEntry(itr.ID());
|
||||
ItemEntry const* db2Data = sItemStore.LookupEntry(sparse->ID);
|
||||
if (!db2Data)
|
||||
continue;
|
||||
|
||||
ItemTemplate& itemTemplate = _itemTemplateStore[itr.ID()];
|
||||
itemTemplate.Id = itr.ID();
|
||||
ItemTemplate& itemTemplate = _itemTemplateStore[sparse->ID];
|
||||
|
||||
itemTemplate.BasicData = db2Data;
|
||||
itemTemplate.ExtendedData = sparse;
|
||||
@@ -2644,7 +2642,7 @@ void ObjectMgr::LoadItemTemplates()
|
||||
itemTemplate.FlagsCu = 0;
|
||||
itemTemplate.SpellPPMRate = 0.0f;
|
||||
|
||||
if (std::vector<ItemSpecOverrideEntry const*> const* itemSpecOverrides = sDB2Manager.GetItemSpecOverrides(itemTemplate.Id))
|
||||
if (std::vector<ItemSpecOverrideEntry const*> const* itemSpecOverrides = sDB2Manager.GetItemSpecOverrides(sparse->ID))
|
||||
{
|
||||
for (ItemSpecOverrideEntry const* itemSpecOverride : *itemSpecOverrides)
|
||||
itemTemplate.Specializations[0].insert(itemSpecOverride->SpecID);
|
||||
@@ -3481,18 +3479,14 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
_playerXPperLevel.resize(sGtOCTLevelExperienceStore.GetTableRowCount() + 1, 0);
|
||||
_playerXPperLevel.resize(sXpGameTable.GetTableRowCount() + 1, 0);
|
||||
|
||||
// 0 1
|
||||
QueryResult result = WorldDatabase.Query("SELECT Level, Experience FROM player_xp_for_level");
|
||||
|
||||
// load the DBC's levels at first...
|
||||
GtOCTLevelExperienceEntry const* exp;
|
||||
for (uint32 level = 0; level < sGtOCTLevelExperienceStore.GetTableRowCount(); ++level)
|
||||
{
|
||||
exp = sGtOCTLevelExperienceStore.EvaluateTable(level, 0);
|
||||
_playerXPperLevel[level + 1] = exp->Data;
|
||||
}
|
||||
for (uint32 level = 0; level < sXpGameTable.GetTableRowCount(); ++level)
|
||||
_playerXPperLevel[level + 1] = sXpGameTable.GetRow(level)->Total;
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
@@ -3537,7 +3531,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectMgr::GetPlayerClassLevelInfo(uint32 class_, uint8 level, uint32& baseHP, uint32& baseMana) const
|
||||
void ObjectMgr::GetPlayerClassLevelInfo(uint32 class_, uint8 level, uint32& baseMana) const
|
||||
{
|
||||
if (level < 1 || class_ >= MAX_CLASSES)
|
||||
return;
|
||||
@@ -3545,17 +3539,14 @@ void ObjectMgr::GetPlayerClassLevelInfo(uint32 class_, uint8 level, uint32& base
|
||||
if (level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
level = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||
|
||||
GtOCTBaseHPByClassEntry const* hp = sGtOCTBaseHPByClassStore.EvaluateTable(level - 1, class_ - 1);
|
||||
GtOCTBaseMPByClassEntry const* mp = sGtOCTBaseMPByClassStore.EvaluateTable(level - 1, class_ - 1);
|
||||
|
||||
if (!hp || !mp)
|
||||
GtBaseMPEntry const* mp = sBaseMPGameTable.GetRow(level);
|
||||
if (!mp)
|
||||
{
|
||||
TC_LOG_ERROR("misc", "Tried to get non-existant Class-Level combination data for base hp/mp. Class %u Level %u", class_, level);
|
||||
return;
|
||||
}
|
||||
|
||||
baseHP = uint32(hp->ratio);
|
||||
baseMana = uint32(mp->ratio);
|
||||
baseMana = uint32(GetGameTableColumnForClass(mp, class_));
|
||||
}
|
||||
|
||||
void ObjectMgr::GetPlayerLevelInfo(uint32 race, uint32 class_, uint8 level, PlayerLevelInfo* info) const
|
||||
@@ -5349,7 +5340,7 @@ void ObjectMgr::LoadInstanceEncounters()
|
||||
{
|
||||
for (uint32 i = 0; i < MAX_DIFFICULTY; ++i)
|
||||
{
|
||||
if (GetMapDifficultyData(dungeonEncounter->MapID, Difficulty(i)))
|
||||
if (sDB2Manager.GetMapDifficultyData(dungeonEncounter->MapID, Difficulty(i)))
|
||||
{
|
||||
DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR64(dungeonEncounter->MapID, i)];
|
||||
encounters.push_back(new DungeonEncounter(dungeonEncounter, EncounterCreditType(creditType), creditEntry, lastEncounterDungeon));
|
||||
@@ -6242,7 +6233,7 @@ void ObjectMgr::LoadAccessRequirements()
|
||||
}
|
||||
|
||||
uint32 difficulty = fields[1].GetUInt8();
|
||||
if (!GetMapDifficultyData(mapid, Difficulty(difficulty)))
|
||||
if (!sDB2Manager.GetMapDifficultyData(mapid, Difficulty(difficulty)))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Map %u referenced in `access_requirement` does not have difficulty %u, skipped", mapid, difficulty);
|
||||
continue;
|
||||
@@ -8718,8 +8709,8 @@ void ObjectMgr::LoadCreatureClassLevelStats()
|
||||
|
||||
for (uint8 i = 0; i < MAX_EXPANSIONS; ++i)
|
||||
{
|
||||
stats.BaseHealth[0] = sGtNpcTotalHpStore[i].EvaluateTable(Level - 1, Class - 1)->HP;
|
||||
stats.BaseDamage[0] = sGtNpcDamageByClassStore[i].EvaluateTable(Level - 1, Class - 1)->Damage;
|
||||
stats.BaseHealth[i] = GetGameTableColumnForClass(sNpcTotalHpGameTable[i].GetRow(Level), Class);
|
||||
stats.BaseDamage[i] = GetGameTableColumnForClass(sNpcDamageByClassGameTable[i].GetRow(Level), Class);
|
||||
if (stats.BaseDamage[i] < 0.0f)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature base stats for class %u, level %u has invalid negative base damage[%u] - set to 0.0", Class, Level, i);
|
||||
|
||||
@@ -762,7 +762,7 @@ class TC_GAME_API ObjectMgr
|
||||
|
||||
PetLevelInfo const* GetPetLevelInfo(uint32 creature_id, uint8 level) const;
|
||||
|
||||
void GetPlayerClassLevelInfo(uint32 class_, uint8 level, uint32& baseHP, uint32& baseMana) const;
|
||||
void GetPlayerClassLevelInfo(uint32 class_, uint8 level, uint32& baseMana) const;
|
||||
|
||||
PlayerInfo const* GetPlayerInfo(uint32 race, uint32 class_) const;
|
||||
|
||||
|
||||
@@ -2082,7 +2082,7 @@ Difficulty Group::GetDifficultyID(MapEntry const* mapEntry) const
|
||||
if (!mapEntry->IsRaid())
|
||||
return m_dungeonDifficulty;
|
||||
|
||||
MapDifficultyEntry const* defaultDifficulty = GetDefaultMapDifficulty(mapEntry->ID);
|
||||
MapDifficultyEntry const* defaultDifficulty = sDB2Manager.GetDefaultMapDifficulty(mapEntry->ID);
|
||||
if (!defaultDifficulty)
|
||||
return m_legacyRaidDifficulty;
|
||||
|
||||
@@ -2212,7 +2212,7 @@ InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry)
|
||||
InstanceGroupBind* Group::GetBoundInstance(Difficulty difficulty, uint32 mapId)
|
||||
{
|
||||
// some instances only have one difficulty
|
||||
GetDownscaledMapDifficultyData(mapId, difficulty);
|
||||
sDB2Manager.GetDownscaledMapDifficultyData(mapId, difficulty);
|
||||
|
||||
BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapId);
|
||||
if (itr != m_boundInstances[difficulty].end())
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "GroupMgr.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "World.h"
|
||||
#include "DBCStores.h"
|
||||
|
||||
GroupMgr::GroupMgr()
|
||||
{
|
||||
|
||||
@@ -2159,8 +2159,7 @@ void Guild::SendLoginInfo(WorldSession* session)
|
||||
}
|
||||
|
||||
for (GuildPerkSpellsEntry const* entry : sGuildPerkSpellsStore)
|
||||
if (entry->GuildLevel <= GetLevel())
|
||||
player->LearnSpell(entry->SpellID, true);
|
||||
player->LearnSpell(entry->SpellID, true);
|
||||
|
||||
m_achievementMgr.SendAllData(player);
|
||||
|
||||
@@ -2696,8 +2695,7 @@ void Guild::DeleteMember(ObjectGuid guid, bool isDisbanding, bool isKicked, bool
|
||||
player->SetGuildLevel(0);
|
||||
|
||||
for (GuildPerkSpellsEntry const* entry : sGuildPerkSpellsStore)
|
||||
if (entry->GuildLevel <= GetLevel())
|
||||
player->RemoveSpell(entry->SpellID, false, false);
|
||||
player->RemoveSpell(entry->SpellID, false, false);
|
||||
}
|
||||
|
||||
_DeleteMemberFromDB(guid.GetCounter());
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "DBCStore.h"
|
||||
|
||||
class Item;
|
||||
|
||||
|
||||
@@ -1243,22 +1243,6 @@ void WorldSession::HandleRequestForcedReactionsOpcode(WorldPackets::Reputation::
|
||||
_player->GetReputationMgr().SendForceReactions();
|
||||
}
|
||||
|
||||
void WorldSession::HandleShowingHelmOpcode(WorldPackets::Character::ShowingHelm& packet)
|
||||
{
|
||||
if (packet.ShowHelm)
|
||||
_player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM);
|
||||
else
|
||||
_player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM);
|
||||
}
|
||||
|
||||
void WorldSession::HandleShowingCloakOpcode(WorldPackets::Character::ShowingCloak& packet)
|
||||
{
|
||||
if (packet.ShowCloak)
|
||||
_player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK);
|
||||
else
|
||||
_player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK);
|
||||
}
|
||||
|
||||
void WorldSession::HandleCharRenameOpcode(WorldPackets::Character::CharacterRenameRequest& request)
|
||||
{
|
||||
if (!IsLegitCharacterForAccount(request.RenameInfo->Guid))
|
||||
|
||||
@@ -1278,14 +1278,19 @@ void WorldSession::HandleUseCritterItem(WorldPackets::Item::UseCritterItem& useC
|
||||
if (!item)
|
||||
return;
|
||||
|
||||
ItemToBattlePetSpeciesEntry const* itemToBattlePetSpecies = sItemToBattlePetSpeciesStore.LookupEntry(item->GetEntry());
|
||||
if (!itemToBattlePetSpecies)
|
||||
if (item->GetTemplate()->Effects.size() < 2)
|
||||
return;
|
||||
|
||||
BattlePetSpeciesEntry const* battlePetSpecies = sBattlePetSpeciesStore.LookupEntry(itemToBattlePetSpecies->BattlePetSpeciesID);
|
||||
if (!battlePetSpecies)
|
||||
return;
|
||||
uint32 spellToLearn = item->GetTemplate()->Effects[1]->SpellID;
|
||||
for (BattlePetSpeciesEntry const* entry : sBattlePetSpeciesStore)
|
||||
{
|
||||
if (entry->SummonSpellID == spellToLearn)
|
||||
{
|
||||
GetBattlePetMgr()->AddPet(entry->ID, entry->CreatureID, BattlePetMgr::RollPetBreed(entry->ID), BattlePetMgr::GetDefaultPetQuality(entry->ID));
|
||||
_player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_BATTLE_PET_COUNT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
GetBattlePetMgr()->AddPet(battlePetSpecies->ID, battlePetSpecies->CreatureID, BattlePetMgr::RollPetBreed(battlePetSpecies->ID), BattlePetMgr::GetDefaultPetQuality(battlePetSpecies->ID));
|
||||
_player->DestroyItem(item->GetBagSlot(), item->GetSlot(), true);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "Player.h"
|
||||
#include "MailPackets.h"
|
||||
#include "Language.h"
|
||||
#include "DBCStores.h"
|
||||
#include "Item.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "BattlenetAccountMgr.h"
|
||||
|
||||
@@ -577,7 +577,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPackets::Misc::AreaTrigger& pack
|
||||
case Map::CANNOT_ENTER_INSTANCE_BIND_MISMATCH:
|
||||
if (MapEntry const* entry = sMapStore.LookupEntry(at->target_mapId))
|
||||
{
|
||||
char const* mapName = entry->MapName_lang;
|
||||
char const* mapName = entry->MapName->Str[player->GetSession()->GetSessionDbcLocale()];
|
||||
TC_LOG_DEBUG("maps", "MAP: Player '%s' cannot enter instance map '%s' because their permanent bind is incompatible with their group's", player->GetName().c_str(), mapName);
|
||||
// is there a special opcode for this?
|
||||
// @todo figure out how to get player localized difficulty string (e.g. "10 player", "Heroic" etc)
|
||||
|
||||
@@ -170,9 +170,9 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
||||
{
|
||||
// check if this instance has a reset time and send it to player if so
|
||||
Difficulty diff = GetPlayer()->GetDifficultyID(mEntry);
|
||||
if (MapDifficultyEntry const* mapDiff = GetMapDifficultyData(mEntry->ID, diff))
|
||||
if (MapDifficultyEntry const* mapDiff = sDB2Manager.GetMapDifficultyData(mEntry->ID, diff))
|
||||
{
|
||||
if (mapDiff->RaidDuration)
|
||||
if (mapDiff->GetRaidDuration())
|
||||
{
|
||||
if (time_t timeReset = sInstanceSaveMgr->GetResetTimeFor(mEntry->ID, diff))
|
||||
{
|
||||
|
||||
@@ -21,6 +21,30 @@
|
||||
#include "Log.h"
|
||||
#include "ReferAFriendPackets.h"
|
||||
|
||||
inline uint32 GetMaxLevelForExpansion(uint32 expansion)
|
||||
{
|
||||
switch (expansion)
|
||||
{
|
||||
case EXPANSION_CLASSIC:
|
||||
return 60;
|
||||
case EXPANSION_THE_BURNING_CRUSADE:
|
||||
return 70;
|
||||
case EXPANSION_WRATH_OF_THE_LICH_KING:
|
||||
return 80;
|
||||
case EXPANSION_CATACLYSM:
|
||||
return 85;
|
||||
case EXPANSION_MISTS_OF_PANDARIA:
|
||||
return 90;
|
||||
case EXPANSION_WARLORDS_OF_DRAENOR:
|
||||
return 100;
|
||||
case EXPANSION_LEGION:
|
||||
return 110;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void WorldSession::HandleGrantLevel(WorldPackets::RaF::GrantLevel& grantLevel)
|
||||
{
|
||||
Player* target = ObjectAccessor::GetPlayer(*_player, grantLevel.Target);
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "WorldSession.h"
|
||||
#include "Common.h"
|
||||
#include "Config.h"
|
||||
#include "DBCStores.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "GameObjectPackets.h"
|
||||
#include "GuildMgr.h"
|
||||
|
||||
@@ -376,7 +376,7 @@ void InstanceSaveManager::LoadResetTimes()
|
||||
Difficulty difficulty = Difficulty(fields[1].GetUInt8());
|
||||
uint64 oldresettime = fields[2].GetUInt32();
|
||||
|
||||
MapDifficultyEntry const* mapDiff = GetMapDifficultyData(mapid, difficulty);
|
||||
MapDifficultyEntry const* mapDiff = sDB2Manager.GetMapDifficultyData(mapid, difficulty);
|
||||
if (!mapDiff)
|
||||
{
|
||||
TC_LOG_ERROR("misc", "InstanceSaveManager::LoadResetTimes: invalid mapid(%u)/difficulty(%u) pair in instance_reset!", mapid, difficulty);
|
||||
@@ -395,7 +395,7 @@ void InstanceSaveManager::LoadResetTimes()
|
||||
|
||||
// calculate new global reset times for expired instances and those that have never been reset yet
|
||||
// add the global reset times to the priority queue
|
||||
for (auto& mapDifficultyPair : sMapDifficultyMap)
|
||||
for (auto& mapDifficultyPair : sDB2Manager.GetMapDifficulties())
|
||||
{
|
||||
uint32 mapid = mapDifficultyPair.first;
|
||||
|
||||
@@ -403,11 +403,11 @@ void InstanceSaveManager::LoadResetTimes()
|
||||
{
|
||||
Difficulty difficulty = Difficulty(difficultyPair.first);
|
||||
MapDifficultyEntry const* mapDiff = difficultyPair.second;
|
||||
if (!mapDiff->RaidDuration)
|
||||
if (!mapDiff->GetRaidDuration())
|
||||
continue;
|
||||
|
||||
// the reset_delay must be at least one day
|
||||
uint32 period = uint32(((mapDiff->RaidDuration * sWorld->getRate(RATE_INSTANCE_RESET_TIME)) / DAY) * DAY);
|
||||
uint32 period = uint32(((mapDiff->GetRaidDuration() * sWorld->getRate(RATE_INSTANCE_RESET_TIME)) / DAY) * DAY);
|
||||
if (period < DAY)
|
||||
period = DAY;
|
||||
|
||||
@@ -447,15 +447,15 @@ void InstanceSaveManager::LoadResetTimes()
|
||||
|
||||
time_t InstanceSaveManager::GetSubsequentResetTime(uint32 mapid, Difficulty difficulty, time_t resetTime) const
|
||||
{
|
||||
MapDifficultyEntry const* mapDiff = GetMapDifficultyData(mapid, difficulty);
|
||||
if (!mapDiff || !mapDiff->RaidDuration)
|
||||
MapDifficultyEntry const* mapDiff = sDB2Manager.GetMapDifficultyData(mapid, difficulty);
|
||||
if (!mapDiff || !mapDiff->GetRaidDuration())
|
||||
{
|
||||
TC_LOG_ERROR("misc", "InstanceSaveManager::GetSubsequentResetTime: not valid difficulty or no reset delay for map %u", mapid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
time_t diff = sWorld->getIntConfig(CONFIG_INSTANCE_RESET_TIME_HOUR) * HOUR;
|
||||
time_t period = uint32(((mapDiff->RaidDuration * sWorld->getRate(RATE_INSTANCE_RESET_TIME)) / DAY) * DAY);
|
||||
time_t period = uint32(((mapDiff->GetRaidDuration() * sWorld->getRate(RATE_INSTANCE_RESET_TIME)) / DAY) * DAY);
|
||||
if (period < DAY)
|
||||
period = DAY;
|
||||
|
||||
@@ -501,7 +501,7 @@ void InstanceSaveManager::ScheduleReset(bool add, time_t time, InstResetEvent ev
|
||||
|
||||
void InstanceSaveManager::ForceGlobalReset(uint32 mapId, Difficulty difficulty)
|
||||
{
|
||||
if (!GetDownscaledMapDifficultyData(mapId, difficulty))
|
||||
if (!sDB2Manager.GetDownscaledMapDifficultyData(mapId, difficulty))
|
||||
return;
|
||||
// remove currently scheduled reset times
|
||||
ScheduleReset(false, 0, InstResetEvent(1, mapId, difficulty, 0));
|
||||
@@ -627,7 +627,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
|
||||
MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
|
||||
if (!mapEntry->Instanceable())
|
||||
return;
|
||||
TC_LOG_DEBUG("misc", "InstanceSaveManager::ResetOrWarnAll: Processing map %s (%u) on difficulty %u (warn? %u)", mapEntry->MapName_lang, mapid, uint8(difficulty), warn);
|
||||
TC_LOG_DEBUG("misc", "InstanceSaveManager::ResetOrWarnAll: Processing map %s (%u) on difficulty %u (warn? %u)", mapEntry->MapName->Str[sWorld->GetDefaultDbcLocale()], mapid, uint8(difficulty), warn);
|
||||
|
||||
time_t now = time(NULL);
|
||||
|
||||
|
||||
@@ -1586,9 +1586,9 @@ void LoadLootTemplates_Fishing()
|
||||
uint32 count = LootTemplates_Fishing.LoadAndCollectLootIds(lootIdSet);
|
||||
|
||||
// remove real entries and check existence loot
|
||||
for (auto itr = sAreaTableStore.begin(); itr != sAreaTableStore.end(); ++itr)
|
||||
if (lootIdSet.find(itr.ID()) != lootIdSet.end())
|
||||
lootIdSet.erase(itr.ID());
|
||||
for (AreaTableEntry const* areaTable : sAreaTableStore)
|
||||
if (lootIdSet.find(areaTable->ID) != lootIdSet.end())
|
||||
lootIdSet.erase(areaTable->ID);
|
||||
|
||||
// output error for any still listed (not referenced from appropriate table) ids
|
||||
LootTemplates_Fishing.ReportUnusedIds(lootIdSet);
|
||||
|
||||
@@ -239,7 +239,7 @@ m_unloadTimer(0), m_VisibleDistance(DEFAULT_VISIBILITY_DISTANCE),
|
||||
m_VisibilityNotifyPeriod(DEFAULT_VISIBILITY_NOTIFY_PERIOD),
|
||||
m_activeNonPlayersIter(m_activeNonPlayers.end()), _transportsUpdateIter(_transports.end()),
|
||||
i_gridExpiry(expiry),
|
||||
i_scriptLock(false), _defaultLight(GetDefaultMapLight(id))
|
||||
i_scriptLock(false), _defaultLight(DB2Manager::GetDefaultMapLight(id))
|
||||
{
|
||||
m_parentMap = (_parent ? _parent : this);
|
||||
for (unsigned int idx=0; idx < MAX_NUMBER_OF_GRIDS; ++idx)
|
||||
@@ -2403,7 +2403,7 @@ bool Map::IsOutdoors(float x, float y, float z) const
|
||||
return true;
|
||||
|
||||
AreaTableEntry const* atEntry = nullptr;
|
||||
WMOAreaTableEntry const* wmoEntry= GetWMOAreaTableEntryByTripple(rootId, adtId, groupId);
|
||||
WMOAreaTableEntry const* wmoEntry= sDB2Manager.GetWMOAreaTable(rootId, adtId, groupId);
|
||||
if (wmoEntry)
|
||||
{
|
||||
TC_LOG_DEBUG("maps", "Got WMOAreaTableEntry! flag %u, areaid %u", wmoEntry->Flags, wmoEntry->AreaTableID);
|
||||
@@ -2443,7 +2443,7 @@ uint32 Map::GetAreaId(float x, float y, float z, bool *isOutdoors) const
|
||||
if (GetAreaInfo(x, y, z, mogpFlags, adtId, rootId, groupId))
|
||||
{
|
||||
haveAreaInfo = true;
|
||||
wmoEntry = GetWMOAreaTableEntryByTripple(rootId, adtId, groupId);
|
||||
wmoEntry = sDB2Manager.GetWMOAreaTable(rootId, adtId, groupId);
|
||||
if (wmoEntry)
|
||||
{
|
||||
areaId = wmoEntry->AreaTableID;
|
||||
@@ -3413,7 +3413,7 @@ void InstanceMap::SetResetSchedule(bool on)
|
||||
|
||||
MapDifficultyEntry const* Map::GetMapDifficulty() const
|
||||
{
|
||||
return GetMapDifficultyData(GetId(), GetDifficultyID());
|
||||
return sDB2Manager.GetMapDifficultyData(GetId(), GetDifficultyID());
|
||||
}
|
||||
|
||||
uint32 Map::GetDifficultyLootBonusTreeMod() const
|
||||
@@ -3428,6 +3428,36 @@ uint32 Map::GetDifficultyLootBonusTreeMod() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32 Map::GetId() const
|
||||
{
|
||||
return i_mapEntry->ID;
|
||||
}
|
||||
|
||||
bool Map::Instanceable() const
|
||||
{
|
||||
return i_mapEntry && i_mapEntry->Instanceable();
|
||||
}
|
||||
|
||||
bool Map::IsDungeon() const
|
||||
{
|
||||
return i_mapEntry && i_mapEntry->IsDungeon();
|
||||
}
|
||||
|
||||
bool Map::IsNonRaidDungeon() const
|
||||
{
|
||||
return i_mapEntry && i_mapEntry->IsNonRaidDungeon();
|
||||
}
|
||||
|
||||
bool Map::IsRaid() const
|
||||
{
|
||||
return i_mapEntry && i_mapEntry->IsRaid();
|
||||
}
|
||||
|
||||
bool Map::IsRaidOrHeroicDungeon() const
|
||||
{
|
||||
return IsRaid() || IsHeroic();
|
||||
}
|
||||
|
||||
bool Map::IsHeroic() const
|
||||
{
|
||||
if (DifficultyEntry const* difficulty = sDifficultyStore.LookupEntry(i_spawnMode))
|
||||
@@ -3435,6 +3465,38 @@ bool Map::IsHeroic() const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Map::Is25ManRaid() const
|
||||
{
|
||||
return IsRaid() && (i_spawnMode == DIFFICULTY_25_N || i_spawnMode == DIFFICULTY_25_HC);
|
||||
}
|
||||
|
||||
bool Map::IsBattleground() const
|
||||
{
|
||||
return i_mapEntry && i_mapEntry->IsBattleground();
|
||||
}
|
||||
|
||||
bool Map::IsBattleArena() const
|
||||
{
|
||||
return i_mapEntry && i_mapEntry->IsBattleArena();
|
||||
}
|
||||
|
||||
bool Map::IsBattlegroundOrArena() const
|
||||
{
|
||||
return i_mapEntry && i_mapEntry->IsBattlegroundOrArena();
|
||||
}
|
||||
|
||||
bool Map::IsGarrison() const
|
||||
{
|
||||
return i_mapEntry && i_mapEntry->IsGarrison();
|
||||
}
|
||||
|
||||
bool Map::GetEntrancePos(int32 &mapid, float &x, float &y)
|
||||
{
|
||||
if (!i_mapEntry)
|
||||
return false;
|
||||
return i_mapEntry->GetEntrancePos(mapid, x, y);
|
||||
}
|
||||
|
||||
bool InstanceMap::HasPermBoundPlayers() const
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PERM_BIND_BY_INSTANCE);
|
||||
@@ -3454,7 +3516,7 @@ uint32 InstanceMap::GetMaxPlayers() const
|
||||
uint32 InstanceMap::GetMaxResetDelay() const
|
||||
{
|
||||
MapDifficultyEntry const* mapDiff = GetMapDifficulty();
|
||||
return mapDiff ? mapDiff->RaidDuration : 0;
|
||||
return mapDiff ? mapDiff->GetRaidDuration() : 0;
|
||||
}
|
||||
|
||||
/* ******* Battleground Instance Maps ******* */
|
||||
|
||||
+31
-34
@@ -21,8 +21,6 @@
|
||||
|
||||
#include "Define.h"
|
||||
|
||||
#include "DBCStructure.h"
|
||||
#include "DB2Structure.h"
|
||||
#include "GridDefines.h"
|
||||
#include "Cell.h"
|
||||
#include "Timer.h"
|
||||
@@ -37,24 +35,28 @@
|
||||
#include <list>
|
||||
#include <memory>
|
||||
|
||||
class Unit;
|
||||
class WorldPacket;
|
||||
class InstanceScript;
|
||||
class Group;
|
||||
class InstanceSave;
|
||||
class Object;
|
||||
class WorldObject;
|
||||
class TempSummon;
|
||||
class Player;
|
||||
class CreatureGroup;
|
||||
struct ScriptInfo;
|
||||
struct ScriptAction;
|
||||
struct Position;
|
||||
class Battleground;
|
||||
class MapInstanced;
|
||||
class BattlegroundMap;
|
||||
class CreatureGroup;
|
||||
class Group;
|
||||
class InstanceMap;
|
||||
class InstanceSave;
|
||||
class InstanceScript;
|
||||
class MapInstanced;
|
||||
class Object;
|
||||
class Player;
|
||||
class TempSummon;
|
||||
class Unit;
|
||||
class WorldObject;
|
||||
class WorldPacket;
|
||||
struct MapDifficultyEntry;
|
||||
struct MapEntry;
|
||||
struct Position;
|
||||
struct ScriptAction;
|
||||
struct ScriptInfo;
|
||||
struct SummonPropertiesEntry;
|
||||
class Transport;
|
||||
enum Difficulty : uint8;
|
||||
enum WeatherState : uint32;
|
||||
|
||||
namespace Trinity { struct ObjectUpdater; }
|
||||
@@ -323,8 +325,7 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
|
||||
grid.ResetTimeTracker(time_t(float(i_gridExpiry)*factor));
|
||||
}
|
||||
|
||||
time_t GetGridExpiry(void) const { return i_gridExpiry; }
|
||||
uint32 GetId(void) const { return i_mapEntry->ID; }
|
||||
time_t GetGridExpiry() const { return i_gridExpiry; }
|
||||
|
||||
static bool ExistMap(uint32 mapid, int gx, int gy);
|
||||
static bool ExistVMap(uint32 mapid, int gx, int gy);
|
||||
@@ -393,23 +394,19 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
|
||||
MapDifficultyEntry const* GetMapDifficulty() const;
|
||||
uint32 GetDifficultyLootBonusTreeMod() const;
|
||||
|
||||
bool Instanceable() const { return i_mapEntry && i_mapEntry->Instanceable(); }
|
||||
bool IsDungeon() const { return i_mapEntry && i_mapEntry->IsDungeon(); }
|
||||
bool IsNonRaidDungeon() const { return i_mapEntry && i_mapEntry->IsNonRaidDungeon(); }
|
||||
bool IsRaid() const { return i_mapEntry && i_mapEntry->IsRaid(); }
|
||||
bool IsRaidOrHeroicDungeon() const { return IsRaid() || IsHeroic(); }
|
||||
uint32 GetId() const;
|
||||
bool Instanceable() const;
|
||||
bool IsDungeon() const;
|
||||
bool IsNonRaidDungeon() const;
|
||||
bool IsRaid() const;
|
||||
bool IsRaidOrHeroicDungeon() const;
|
||||
bool IsHeroic() const;
|
||||
bool Is25ManRaid() const { return IsRaid() && (i_spawnMode == DIFFICULTY_25_N || i_spawnMode == DIFFICULTY_25_HC); } // since 25man difficulties are 1 and 3, we can check them like that
|
||||
bool IsBattleground() const { return i_mapEntry && i_mapEntry->IsBattleground(); }
|
||||
bool IsBattleArena() const { return i_mapEntry && i_mapEntry->IsBattleArena(); }
|
||||
bool IsBattlegroundOrArena() const { return i_mapEntry && i_mapEntry->IsBattlegroundOrArena(); }
|
||||
bool IsGarrison() const { return i_mapEntry && i_mapEntry->IsGarrison(); }
|
||||
bool GetEntrancePos(int32 &mapid, float &x, float &y)
|
||||
{
|
||||
if (!i_mapEntry)
|
||||
return false;
|
||||
return i_mapEntry->GetEntrancePos(mapid, x, y);
|
||||
}
|
||||
bool Is25ManRaid() const; // since 25man difficulties are 1 and 3, we can check them like that
|
||||
bool IsBattleground() const;
|
||||
bool IsBattleArena() const;
|
||||
bool IsBattlegroundOrArena() const;
|
||||
bool IsGarrison() const;
|
||||
bool GetEntrancePos(int32 &mapid, float &x, float &y);
|
||||
|
||||
void AddObjectToRemoveList(WorldObject* obj);
|
||||
void AddObjectToSwitchList(WorldObject* obj, bool on);
|
||||
|
||||
@@ -225,7 +225,7 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save,
|
||||
}
|
||||
|
||||
// some instances only have one difficulty
|
||||
GetDownscaledMapDifficultyData(GetId(), difficulty);
|
||||
sDB2Manager.GetDownscaledMapDifficultyData(GetId(), difficulty);
|
||||
|
||||
TC_LOG_DEBUG("maps", "MapInstanced::CreateInstance: %s map instance %d for %d created with difficulty %s", save ? "" : "new ", InstanceId, GetId(), difficulty ? "heroic" : "normal");
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ Map::EnterState MapManager::PlayerCannotEnter(uint32 mapid, Player* player, bool
|
||||
Difficulty targetDifficulty, requestedDifficulty;
|
||||
targetDifficulty = requestedDifficulty = player->GetDifficultyID(entry);
|
||||
// Get the highest available difficulty if current setting is higher than the instance allows
|
||||
MapDifficultyEntry const* mapDiff = GetDownscaledMapDifficultyData(entry->ID, targetDifficulty);
|
||||
MapDifficultyEntry const* mapDiff = sDB2Manager.GetDownscaledMapDifficultyData(mapid, targetDifficulty);
|
||||
if (!mapDiff)
|
||||
return Map::CANNOT_ENTER_DIFFICULTY_UNAVAILABLE;
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include <G3D/Quat.h>
|
||||
#include "Spline.h"
|
||||
#include "DBCStores.h"
|
||||
#include "DB2Stores.h"
|
||||
#include "ObjectGuid.h"
|
||||
|
||||
|
||||
@@ -23,9 +23,28 @@
|
||||
#include "SharedDefines.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Player.h"
|
||||
#include "GameTables.h"
|
||||
|
||||
namespace Trinity
|
||||
{
|
||||
inline uint32 GetExpansionForLevel(uint32 level)
|
||||
{
|
||||
if (level < 60)
|
||||
return EXPANSION_CLASSIC;
|
||||
else if (level < 70)
|
||||
return EXPANSION_THE_BURNING_CRUSADE;
|
||||
else if (level < 80)
|
||||
return EXPANSION_WRATH_OF_THE_LICH_KING;
|
||||
else if (level < 85)
|
||||
return EXPANSION_CATACLYSM;
|
||||
else if (level < 90)
|
||||
return EXPANSION_MISTS_OF_PANDARIA;
|
||||
else if (level < 100)
|
||||
return EXPANSION_WARLORDS_OF_DRAENOR;
|
||||
else
|
||||
return CURRENT_EXPANSION;
|
||||
}
|
||||
|
||||
namespace Honor
|
||||
{
|
||||
inline float hk_honor_at_level_f(uint8 level, float multiplier = 1.0f)
|
||||
@@ -120,11 +139,8 @@ namespace Trinity
|
||||
{
|
||||
uint32 baseGain;
|
||||
|
||||
GtOCTLevelExperienceEntry const* BaseExpPlayer = sGtOCTLevelExperienceStore.EvaluateTable(pl_level - 1, 1);
|
||||
GtOCTLevelExperienceEntry const* BaseExpMob = sGtOCTLevelExperienceStore.EvaluateTable(mob_level - 1, 1);
|
||||
|
||||
GtOCTLevelExperienceEntry const* CoefPlayer = sGtOCTLevelExperienceStore.EvaluateTable(pl_level - 1, 4);
|
||||
GtOCTLevelExperienceEntry const* CoefMob = sGtOCTLevelExperienceStore.EvaluateTable(mob_level - 1, 4);
|
||||
GtXpEntry const* xpPlayer = sXpGameTable.GetRow(pl_level);
|
||||
GtXpEntry const* xpMob = sXpGameTable.GetRow(mob_level);
|
||||
|
||||
if (mob_level >= pl_level)
|
||||
{
|
||||
@@ -132,7 +148,7 @@ namespace Trinity
|
||||
if (nLevelDiff > 4)
|
||||
nLevelDiff = 4;
|
||||
|
||||
baseGain = uint32(round(BaseExpPlayer->Data * (1 + 0.05f * nLevelDiff)));
|
||||
baseGain = uint32(round(xpPlayer->PerKill * (1 + 0.05f * nLevelDiff)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -140,7 +156,7 @@ namespace Trinity
|
||||
if (mob_level > gray_level)
|
||||
{
|
||||
uint8 ZD = GetZeroDifference(pl_level);
|
||||
baseGain = uint32(round(BaseExpMob->Data * ((1 - ((pl_level - mob_level) / float(ZD))) * (CoefMob->Data / CoefPlayer->Data))));
|
||||
baseGain = uint32(round(xpMob->PerKill * ((1 - ((pl_level - mob_level) / float(ZD))) * (xpMob->Divisor / xpPlayer->Divisor))));
|
||||
}
|
||||
else
|
||||
baseGain = 0;
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "DatabaseEnv.h"
|
||||
#include "ReputationMgr.h"
|
||||
#include "ReputationPackets.h"
|
||||
#include "DBCStores.h"
|
||||
#include "Player.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "World.h"
|
||||
@@ -235,11 +234,9 @@ void ReputationMgr::Initialize()
|
||||
_exaltedFactionCount = 0;
|
||||
_sendFactionIncreased = false;
|
||||
|
||||
for (unsigned int i = 1; i < sFactionStore.GetNumRows(); i++)
|
||||
for (FactionEntry const* factionEntry : sFactionStore)
|
||||
{
|
||||
FactionEntry const* factionEntry = sFactionStore.LookupEntry(i);
|
||||
|
||||
if (factionEntry && factionEntry->CanHaveReputation())
|
||||
if (factionEntry->CanHaveReputation())
|
||||
{
|
||||
FactionState newFaction;
|
||||
newFaction.ID = factionEntry->ID;
|
||||
@@ -283,7 +280,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
|
||||
{
|
||||
float spillOverRepOut = float(standing);
|
||||
// check for sub-factions that receive spillover
|
||||
std::vector<uint32> const* flist = GetFactionTeamList(factionEntry->ID);
|
||||
std::vector<uint32> const* flist = sDB2Manager.GetFactionTeamList(factionEntry->ID);
|
||||
// if has no sub-factions, check for factions with same parent
|
||||
if (!flist && factionEntry->ParentFactionID && factionEntry->ParentFactionModOut != 0.0f)
|
||||
{
|
||||
@@ -298,7 +295,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
|
||||
}
|
||||
else // spill to "sister" factions
|
||||
{
|
||||
flist = GetFactionTeamList(factionEntry->ParentFactionID);
|
||||
flist = sDB2Manager.GetFactionTeamList(factionEntry->ParentFactionID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "Common.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "Language.h"
|
||||
#include "DBCStructure.h"
|
||||
#include "QueryResult.h"
|
||||
#include <map>
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "ScriptReloadMgr.h"
|
||||
#include "Config.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCStores.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "ScriptSystem.h"
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
#include "Common.h"
|
||||
#include <atomic>
|
||||
#include "DBCStores.h"
|
||||
#include "QuestDef.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "World.h"
|
||||
@@ -62,10 +61,12 @@ class WorldSocket;
|
||||
class WorldObject;
|
||||
class WorldSession;
|
||||
|
||||
struct AreaTriggerEntry;
|
||||
struct AuctionEntry;
|
||||
struct ConditionSourceInfo;
|
||||
struct Condition;
|
||||
struct ItemTemplate;
|
||||
struct MapEntry;
|
||||
struct OutdoorPvPData;
|
||||
|
||||
#define VISIBLE_RANGE 166.0f //MAX visible range (size of grid)
|
||||
|
||||
@@ -434,16 +434,6 @@ WorldPacket const* WorldPackets::Character::PlayedTime::Write()
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
void WorldPackets::Character::ShowingCloak::Read()
|
||||
{
|
||||
ShowCloak = _worldPacket.ReadBit();
|
||||
}
|
||||
|
||||
void WorldPackets::Character::ShowingHelm::Read()
|
||||
{
|
||||
ShowHelm = _worldPacket.ReadBit();
|
||||
}
|
||||
|
||||
void WorldPackets::Character::SetTitle::Read()
|
||||
{
|
||||
_worldPacket >> TitleID;
|
||||
|
||||
@@ -570,26 +570,6 @@ namespace WorldPackets
|
||||
bool TriggerEvent = false;
|
||||
};
|
||||
|
||||
class ShowingCloak final : public ClientPacket
|
||||
{
|
||||
public:
|
||||
ShowingCloak(WorldPacket&& packet) : ClientPacket(CMSG_SHOWING_CLOAK, std::move(packet)) { }
|
||||
|
||||
void Read() override;
|
||||
|
||||
bool ShowCloak = false;
|
||||
};
|
||||
|
||||
class ShowingHelm final : public ClientPacket
|
||||
{
|
||||
public:
|
||||
ShowingHelm(WorldPacket&& packet) : ClientPacket(CMSG_SHOWING_HELM, std::move(packet)) { }
|
||||
|
||||
void Read() override;
|
||||
|
||||
bool ShowHelm = false;
|
||||
};
|
||||
|
||||
class SetTitle final : public ClientPacket
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
#include "ObjectGuid.h"
|
||||
#include "Position.h"
|
||||
#include "PacketUtilities.h"
|
||||
#include "DB2Structure.h"
|
||||
|
||||
struct GarrAbilityEntry;
|
||||
|
||||
namespace WorldPackets
|
||||
{
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include "Packet.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include "DB2Structure.h"
|
||||
|
||||
namespace WorldPackets
|
||||
{
|
||||
|
||||
@@ -710,8 +710,6 @@ void OpcodeTable::Initialize()
|
||||
DEFINE_HANDLER(CMSG_SET_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Trade::SetTradeItem, &WorldSession::HandleSetTradeItemOpcode);
|
||||
DEFINE_HANDLER(CMSG_SET_USING_PARTY_GARRISON, STATUS_UNHANDLED, PROCESS_INPLACE, WorldPackets::Null, &WorldSession::Handle_NULL);
|
||||
DEFINE_HANDLER(CMSG_SET_WATCHED_FACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Character::SetWatchedFaction, &WorldSession::HandleSetWatchedFactionOpcode);
|
||||
DEFINE_HANDLER(CMSG_SHOWING_CLOAK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Character::ShowingCloak, &WorldSession::HandleShowingCloakOpcode);
|
||||
DEFINE_HANDLER(CMSG_SHOWING_HELM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Character::ShowingHelm, &WorldSession::HandleShowingHelmOpcode);
|
||||
DEFINE_HANDLER(CMSG_SHOW_TRADE_SKILL, STATUS_UNHANDLED, PROCESS_INPLACE, WorldPackets::Null, &WorldSession::Handle_NULL);
|
||||
DEFINE_HANDLER(CMSG_SIGN_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Petition::SignPetition, &WorldSession::HandleSignPetition);
|
||||
DEFINE_HANDLER(CMSG_SILENCE_PARTY_TALKER, STATUS_UNHANDLED, PROCESS_INPLACE, WorldPackets::Null, &WorldSession::Handle_NULL);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -201,8 +201,6 @@ namespace WorldPackets
|
||||
class LoadingScreenNotify;
|
||||
class SetActionBarToggles;
|
||||
class RequestPlayedTime;
|
||||
class ShowingCloak;
|
||||
class ShowingHelm;
|
||||
class SetTitle;
|
||||
class SetFactionAtWar;
|
||||
class SetFactionNotAtWar;
|
||||
@@ -1162,10 +1160,6 @@ class TC_GAME_API WorldSession
|
||||
|
||||
void HandleMountSpecialAnimOpcode(WorldPackets::Misc::MountSpecial& mountSpecial);
|
||||
|
||||
// character view
|
||||
void HandleShowingHelmOpcode(WorldPackets::Character::ShowingHelm& packet);
|
||||
void HandleShowingCloakOpcode(WorldPackets::Character::ShowingCloak& packet);
|
||||
|
||||
// repair
|
||||
void HandleRepairItemOpcode(WorldPackets::Item::RepairItem& packet);
|
||||
|
||||
|
||||
@@ -5291,7 +5291,7 @@ void Spell::EffectGameObjectDamage(SpellEffIndex /*effIndex*/)
|
||||
FactionTemplateEntry const* casterFaction = caster->GetFactionTemplateEntry();
|
||||
FactionTemplateEntry const* targetFaction = sFactionTemplateStore.LookupEntry(gameObjTarget->GetUInt32Value(GAMEOBJECT_FACTION));
|
||||
// Do not allow to damage GO's of friendly factions (ie: Wintergrasp Walls/Ulduar Storm Beacons)
|
||||
if (!targetFaction || (casterFaction && targetFaction && !casterFaction->IsFriendlyTo(*targetFaction)))
|
||||
if (!targetFaction || (casterFaction && targetFaction && !casterFaction->IsFriendlyTo(targetFaction)))
|
||||
gameObjTarget->ModifyHealth(-damage, caster, GetSpellInfo()->Id);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "Spell.h"
|
||||
#include "DBCStores.h"
|
||||
#include "ConditionMgr.h"
|
||||
#include "GameTables.h"
|
||||
#include "Player.h"
|
||||
#include "Battleground.h"
|
||||
#include "Vehicle.h"
|
||||
@@ -468,6 +468,9 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster /*= nullptr*/, int32 const*
|
||||
if (!_spellInfo->HasAttribute(SPELL_ATTR11_SCALES_WITH_ITEM_LEVEL) && _spellInfo->HasAttribute(SPELL_ATTR10_USE_SPELL_BASE_LEVEL_FOR_SCALING))
|
||||
level = _spellInfo->BaseLevel;
|
||||
|
||||
if (_spellInfo->Scaling.MinScalingLevel && _spellInfo->Scaling.MinScalingLevel > level)
|
||||
level = _spellInfo->Scaling.MinScalingLevel;
|
||||
|
||||
if (_spellInfo->Scaling.MaxScalingLevel && _spellInfo->Scaling.MaxScalingLevel < level)
|
||||
level = _spellInfo->Scaling.MaxScalingLevel;
|
||||
|
||||
@@ -481,8 +484,11 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster /*= nullptr*/, int32 const*
|
||||
{
|
||||
if (!_spellInfo->HasAttribute(SPELL_ATTR11_SCALES_WITH_ITEM_LEVEL))
|
||||
{
|
||||
if (GtSpellScalingEntry const* gtScaling = sGtSpellScalingStore.EvaluateTable(level - 1, (_spellInfo->Scaling.Class > 0 ? _spellInfo->Scaling.Class : ((MAX_CLASSES - 1 /*last class*/) - _spellInfo->Scaling.Class)) - 1))
|
||||
value = gtScaling->value;
|
||||
GtSpellScalingEntry const* gtScaling = sSpellScalingGameTable.GetRow(level);
|
||||
if (_spellInfo->Scaling.Class > 0)
|
||||
value = GetGameTableColumnForClass(gtScaling, _spellInfo->Scaling.Class);
|
||||
else
|
||||
value = gtScaling->Item;
|
||||
}
|
||||
else
|
||||
value = GetRandomPropertyPoints(itemLevel != -1 ? uint32(itemLevel) : 1u, ITEM_QUALITY_RARE, INVTYPE_CHEST, 0);
|
||||
@@ -600,10 +606,10 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster /*= nullptr*/, int32 const*
|
||||
|
||||
if (canEffectScale)
|
||||
{
|
||||
GtNPCManaCostScalerEntry const* spellScaler = sGtNPCManaCostScalerStore.EvaluateTable(_spellInfo->SpellLevel - 1, 0);
|
||||
GtNPCManaCostScalerEntry const* casterScaler = sGtNPCManaCostScalerStore.EvaluateTable(caster->getLevel() - 1, 0);
|
||||
GtNpcManaCostScalerEntry const* spellScaler = sNpcManaCostScalerGameTable.GetRow(_spellInfo->SpellLevel);
|
||||
GtNpcManaCostScalerEntry const* casterScaler = sNpcManaCostScalerGameTable.GetRow(caster->getLevel());
|
||||
if (spellScaler && casterScaler)
|
||||
value *= casterScaler->ratio / spellScaler->ratio;
|
||||
value *= casterScaler->Scaler / spellScaler->Scaler;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1729,7 +1735,7 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a
|
||||
// continent limitation (virtual continent)
|
||||
if (AttributesEx4 & SPELL_ATTR4_CAST_ONLY_IN_OUTLAND)
|
||||
{
|
||||
uint32 v_map = GetVirtualMapForMapAndZone(map_id, zone_id);
|
||||
uint32 v_map = sDB2Manager.GetVirtualMapForMapAndZone(map_id, zone_id);
|
||||
MapEntry const* mapEntry = sMapStore.LookupEntry(v_map);
|
||||
if (!mapEntry || mapEntry->ExpansionID < 1 || !mapEntry->IsContinent())
|
||||
return SPELL_FAILED_INCORRECT_AREA;
|
||||
@@ -2676,10 +2682,10 @@ std::vector<SpellInfo::CostData> SpellInfo::CalcPowerCost(Unit const* caster, Sp
|
||||
{
|
||||
if (Attributes & SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION)
|
||||
{
|
||||
GtNPCManaCostScalerEntry const* spellScaler = sGtNPCManaCostScalerStore.EvaluateTable(SpellLevel - 1, 0);
|
||||
GtNPCManaCostScalerEntry const* casterScaler = sGtNPCManaCostScalerStore.EvaluateTable(caster->getLevel() - 1, 0);
|
||||
GtNpcManaCostScalerEntry const* spellScaler = sNpcManaCostScalerGameTable.GetRow(SpellLevel);
|
||||
GtNpcManaCostScalerEntry const* casterScaler = sNpcManaCostScalerGameTable.GetRow(caster->getLevel());
|
||||
if (spellScaler && casterScaler)
|
||||
powerCost *= casterScaler->ratio / spellScaler->ratio;
|
||||
powerCost *= casterScaler->Scaler / spellScaler->Scaler;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
|
||||
#include "SharedDefines.h"
|
||||
#include "Util.h"
|
||||
#include "DBCStructure.h"
|
||||
#include "DB2Structure.h"
|
||||
#include "Object.h"
|
||||
#include "SpellAuraDefines.h"
|
||||
|
||||
@@ -409,6 +407,7 @@ public:
|
||||
struct ScalingInfo
|
||||
{
|
||||
int32 Class;
|
||||
uint32 MinScalingLevel;
|
||||
uint32 MaxScalingLevel;
|
||||
uint32 ScalesFromItemLevel;
|
||||
} Scaling;
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "SpellAuraDefines.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "DBCStores.h"
|
||||
#include "Chat.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "BattlefieldWG.h"
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
// For static or at-server-startup loaded spell data
|
||||
|
||||
#include "Define.h"
|
||||
#include "DBCStructure.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "Util.h"
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "DBCStores.h"
|
||||
|
||||
void CharacterDatabaseCleaner::CleanDatabase()
|
||||
{
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "GameTables.h"
|
||||
#include "GarrisonMgr.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "GroupMgr.h"
|
||||
@@ -1468,7 +1469,7 @@ void World::SetInitialWorldSettings()
|
||||
///- Initialize VMapManager function pointers (to untangle game/collision circular deps)
|
||||
if (VMAP::VMapManager2* vmmgr2 = dynamic_cast<VMAP::VMapManager2*>(VMAP::VMapFactory::createOrGetVMapManager()))
|
||||
{
|
||||
vmmgr2->GetLiquidFlagsPtr = &GetLiquidFlags;
|
||||
vmmgr2->GetLiquidFlagsPtr = &DB2Manager::GetLiquidFlags;
|
||||
vmmgr2->IsVMAPDisabledForPtr = &DisableMgr::IsVMAPDisabledFor;
|
||||
}
|
||||
|
||||
@@ -1518,8 +1519,6 @@ void World::SetInitialWorldSettings()
|
||||
LoginDatabase.PExecute("UPDATE realmlist SET icon = %u, timezone = %u WHERE id = '%d'", server_type, realm_zone, realm.Id.Realm); // One-time query
|
||||
|
||||
TC_LOG_INFO("server.loading", "Initialize data stores...");
|
||||
///- Load DBCs
|
||||
LoadDBCStores(m_dataPath, m_defaultDbcLocale);
|
||||
///- Load DB2s
|
||||
sDB2Manager.LoadStores(m_dataPath, m_defaultDbcLocale);
|
||||
TC_LOG_INFO("misc", "Loading hotfix info...");
|
||||
@@ -1527,7 +1526,7 @@ void World::SetInitialWorldSettings()
|
||||
///- Close hotfix database - it is only used during DB2 loading
|
||||
HotfixDatabase.Close();
|
||||
///- Load GameTables
|
||||
LoadGameTables(m_dataPath, m_defaultDbcLocale);
|
||||
LoadGameTables(m_dataPath);
|
||||
|
||||
//Load weighted graph on taxi nodes path
|
||||
sTaxiPathGraph.Initialize();
|
||||
|
||||
@@ -559,7 +559,7 @@ public:
|
||||
{
|
||||
FactionState const& faction = itr->second;
|
||||
FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID);
|
||||
char const* factionName = factionEntry ? factionEntry->Name_lang : "#Not found#";
|
||||
char const* factionName = factionEntry ? factionEntry->Name->Str[loc] : "#Not found#";
|
||||
ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry);
|
||||
std::string rankName = handler->GetTrinityString(ReputationRankStrIndex[rank]);
|
||||
std::ostringstream ss;
|
||||
|
||||
@@ -1540,11 +1540,11 @@ public:
|
||||
if (difficulty == -1)
|
||||
for (uint8 diff = 0; diff < MAX_DIFFICULTY; ++diff)
|
||||
{
|
||||
if (GetMapDifficultyData(mEntry->ID, Difficulty(diff)))
|
||||
sInstanceSaveMgr->ForceGlobalReset(mEntry->ID, Difficulty(diff));
|
||||
if (sDB2Manager.GetMapDifficultyData(map, Difficulty(diff)))
|
||||
sInstanceSaveMgr->ForceGlobalReset(map, Difficulty(diff));
|
||||
}
|
||||
else
|
||||
sInstanceSaveMgr->ForceGlobalReset(mEntry->ID, Difficulty(difficulty));
|
||||
sInstanceSaveMgr->ForceGlobalReset(map, Difficulty(difficulty));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -509,7 +509,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
Zone2MapCoordinates(x, y, areaEntry->ParentAreaID ? uint32(areaEntry->ParentAreaID) : areaId);
|
||||
sDB2Manager.Zone2MapCoordinates(areaEntry->ParentAreaID ? uint32(areaEntry->ParentAreaID) : areaId, x, y);
|
||||
|
||||
if (!MapManager::IsValidMapCoord(zoneEntry->MapID, x, y))
|
||||
{
|
||||
|
||||
@@ -309,58 +309,77 @@ public:
|
||||
|
||||
for (uint32 id = 0; id < sFactionStore.GetNumRows(); ++id)
|
||||
{
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(id))
|
||||
FactionEntry const* factionEntry = sFactionStore.LookupEntry(id);
|
||||
if (factionEntry)
|
||||
{
|
||||
FactionState const* factionState = target ? target->GetReputationMgr().GetState(factionEntry) : NULL;
|
||||
|
||||
std::string name = factionEntry->Name_lang;
|
||||
int locale = handler->GetSessionDbcLocale();
|
||||
std::string name = factionEntry->Name->Str[locale];
|
||||
if (name.empty())
|
||||
continue;
|
||||
|
||||
if (!Utf8FitTo(name, wNamePart))
|
||||
continue;
|
||||
|
||||
if (maxResults && count++ == maxResults)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
|
||||
return true;
|
||||
locale = 0;
|
||||
for (; locale < TOTAL_LOCALES; ++locale)
|
||||
{
|
||||
if (locale == handler->GetSessionDbcLocale())
|
||||
continue;
|
||||
|
||||
name = factionEntry->Name->Str[locale];
|
||||
if (name.empty())
|
||||
continue;
|
||||
|
||||
if (Utf8FitTo(name, wNamePart))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// send faction in "id - [faction] rank reputation [visible] [at war] [own team] [unknown] [invisible] [inactive]" format
|
||||
// or "id - [faction] [no reputation]" format
|
||||
std::ostringstream ss;
|
||||
if (handler->GetSession())
|
||||
ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << "]|h|r";
|
||||
else
|
||||
ss << id << " - " << name;
|
||||
|
||||
if (factionState) // and then target != NULL also
|
||||
if (locale < TOTAL_LOCALES)
|
||||
{
|
||||
uint32 index = target->GetReputationMgr().GetReputationRankStrIndex(factionEntry);
|
||||
std::string rankName = handler->GetTrinityString(index);
|
||||
if (maxResults && count++ == maxResults)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
|
||||
return true;
|
||||
}
|
||||
|
||||
ss << ' ' << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ')';
|
||||
// send faction in "id - [faction] rank reputation [visible] [at war] [own team] [unknown] [invisible] [inactive]" format
|
||||
// or "id - [faction] [no reputation]" format
|
||||
std::ostringstream ss;
|
||||
if (handler->GetSession())
|
||||
ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << ' ' << localeNames[locale] << "]|h|r";
|
||||
else
|
||||
ss << id << " - " << name << ' ' << localeNames[locale];
|
||||
|
||||
if (factionState->Flags & FACTION_FLAG_VISIBLE)
|
||||
ss << handler->GetTrinityString(LANG_FACTION_VISIBLE);
|
||||
if (factionState->Flags & FACTION_FLAG_AT_WAR)
|
||||
ss << handler->GetTrinityString(LANG_FACTION_ATWAR);
|
||||
if (factionState->Flags & FACTION_FLAG_PEACE_FORCED)
|
||||
ss << handler->GetTrinityString(LANG_FACTION_PEACE_FORCED);
|
||||
if (factionState->Flags & FACTION_FLAG_HIDDEN)
|
||||
ss << handler->GetTrinityString(LANG_FACTION_HIDDEN);
|
||||
if (factionState->Flags & FACTION_FLAG_INVISIBLE_FORCED)
|
||||
ss << handler->GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
|
||||
if (factionState->Flags & FACTION_FLAG_INACTIVE)
|
||||
ss << handler->GetTrinityString(LANG_FACTION_INACTIVE);
|
||||
if (factionState) // and then target != NULL also
|
||||
{
|
||||
uint32 index = target->GetReputationMgr().GetReputationRankStrIndex(factionEntry);
|
||||
std::string rankName = handler->GetTrinityString(index);
|
||||
|
||||
ss << ' ' << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ')';
|
||||
|
||||
if (factionState->Flags & FACTION_FLAG_VISIBLE)
|
||||
ss << handler->GetTrinityString(LANG_FACTION_VISIBLE);
|
||||
if (factionState->Flags & FACTION_FLAG_AT_WAR)
|
||||
ss << handler->GetTrinityString(LANG_FACTION_ATWAR);
|
||||
if (factionState->Flags & FACTION_FLAG_PEACE_FORCED)
|
||||
ss << handler->GetTrinityString(LANG_FACTION_PEACE_FORCED);
|
||||
if (factionState->Flags & FACTION_FLAG_HIDDEN)
|
||||
ss << handler->GetTrinityString(LANG_FACTION_HIDDEN);
|
||||
if (factionState->Flags & FACTION_FLAG_INVISIBLE_FORCED)
|
||||
ss << handler->GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
|
||||
if (factionState->Flags & FACTION_FLAG_INACTIVE)
|
||||
ss << handler->GetTrinityString(LANG_FACTION_INACTIVE);
|
||||
}
|
||||
else
|
||||
ss << handler->GetTrinityString(LANG_FACTION_NOREPUTATION);
|
||||
|
||||
handler->SendSysMessage(ss.str().c_str());
|
||||
|
||||
if (!found)
|
||||
found = true;
|
||||
}
|
||||
else
|
||||
ss << handler->GetTrinityString(LANG_FACTION_NOREPUTATION);
|
||||
|
||||
handler->SendSysMessage(ss.str().c_str());
|
||||
|
||||
if (!found)
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ public:
|
||||
float zoneX = object->GetPositionX();
|
||||
float zoneY = object->GetPositionY();
|
||||
|
||||
Map2ZoneCoordinates(zoneX, zoneY, zoneId);
|
||||
sDB2Manager.Map2ZoneCoordinates(zoneId, zoneX, zoneY);
|
||||
|
||||
Map const* map = object->GetMap();
|
||||
float groundZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT);
|
||||
@@ -1168,10 +1168,10 @@ public:
|
||||
if (itemNameStr && itemNameStr[0])
|
||||
{
|
||||
std::string itemName = itemNameStr+1;
|
||||
auto itr = std::find_if(sItemSparseStore.begin(), sItemSparseStore.end(), [&itemName](std::pair<uint32, ItemSparseEntry const*> kv)
|
||||
auto itr = std::find_if(sItemSparseStore.begin(), sItemSparseStore.end(), [&itemName](ItemSparseEntry const* sparse)
|
||||
{
|
||||
for (uint32 i = 0; i < MAX_LOCALES; ++i)
|
||||
if (itemName == kv.second->Name->Str[i])
|
||||
if (itemName == sparse->Name->Str[i])
|
||||
return true;
|
||||
return false;
|
||||
});
|
||||
@@ -1183,7 +1183,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
itemId = itr->first;
|
||||
itemId = itr->ID;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
@@ -1795,7 +1795,7 @@ public:
|
||||
|
||||
// Output XI. LANG_PINFO_CHR_RACE
|
||||
raceStr = DB2Manager::GetChrRaceName(raceid, locale);
|
||||
classStr = GetClassName(classid, locale);
|
||||
classStr = DB2Manager::GetClassName(classid, locale);
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_RACE, (gender == 0 ? handler->GetTrinityString(LANG_CHARACTER_GENDER_MALE) : handler->GetTrinityString(LANG_CHARACTER_GENDER_FEMALE)), raceStr.c_str(), classStr.c_str());
|
||||
|
||||
// Output XII. LANG_PINFO_CHR_ALIVE
|
||||
|
||||
@@ -1008,14 +1008,14 @@ public:
|
||||
|
||||
if (factionEntry->ReputationIndex < 0)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->Name_lang, factionId);
|
||||
handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->Name->Str[handler->GetSessionDbcLocale()], factionId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false);
|
||||
target->GetReputationMgr().SendState(target->GetReputationMgr().GetState(factionEntry));
|
||||
handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->Name_lang, factionId,
|
||||
handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->Name->Str[handler->GetSessionDbcLocale()], factionId,
|
||||
handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,7 @@
|
||||
#include "CombatAI.h"
|
||||
#include "PassiveAI.h"
|
||||
#include "Chat.h"
|
||||
#include "DBCStructure.h"
|
||||
#include "DBCStores.h"
|
||||
#include "DB2Stores.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "SpellHistory.h"
|
||||
#include "SkillDiscovery.h"
|
||||
#include "Battleground.h"
|
||||
#include "DBCStores.h"
|
||||
|
||||
// Generic script for handling item dummy effects which trigger another spell.
|
||||
class spell_item_trigger_spell : public SpellScriptLoader
|
||||
|
||||
@@ -745,6 +745,8 @@ class spell_mage_living_bomb : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (!spellInfo->GetEffect(EFFECT_1))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(uint32(spellInfo->GetEffect(EFFECT_1)->CalcValue())))
|
||||
return false;
|
||||
return true;
|
||||
|
||||
@@ -107,9 +107,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader
|
||||
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
|
||||
{
|
||||
// For others recalculate it from:
|
||||
float CritSpell = 0.0f;
|
||||
// Crit from Intellect
|
||||
CritSpell += owner->GetSpellCritFromIntellect();
|
||||
float CritSpell = 5.0f;
|
||||
// Increase crit from SPELL_AURA_MOD_SPELL_CRIT_CHANCE
|
||||
CritSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
|
||||
// Increase crit from SPELL_AURA_MOD_CRIT_PCT
|
||||
@@ -126,9 +124,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader
|
||||
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
|
||||
{
|
||||
// For others recalculate it from:
|
||||
float CritMelee = 0.0f;
|
||||
// Crit from Agility
|
||||
CritMelee += owner->GetMeleeCritFromAgility();
|
||||
float CritMelee = 5.0f;
|
||||
// Increase crit from SPELL_AURA_MOD_WEAPON_CRIT_PERCENT
|
||||
CritMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT);
|
||||
// Increase crit from SPELL_AURA_MOD_CRIT_PCT
|
||||
@@ -676,9 +672,7 @@ public:
|
||||
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
|
||||
{
|
||||
// For others recalculate it from:
|
||||
float CritSpell = 0.0f;
|
||||
// Crit from Intellect
|
||||
CritSpell += owner->GetSpellCritFromIntellect();
|
||||
float CritSpell = 5.0f;
|
||||
// Increase crit from SPELL_AURA_MOD_SPELL_CRIT_CHANCE
|
||||
CritSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
|
||||
// Increase crit from SPELL_AURA_MOD_CRIT_PCT
|
||||
@@ -698,9 +692,7 @@ public:
|
||||
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
|
||||
{
|
||||
// For others recalculate it from:
|
||||
float CritMelee = 0.0f;
|
||||
// Crit from Agility
|
||||
CritMelee += owner->GetMeleeCritFromAgility();
|
||||
float CritMelee = 5.0f;
|
||||
// Increase crit from SPELL_AURA_MOD_WEAPON_CRIT_PERCENT
|
||||
CritMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT);
|
||||
// Increase crit from SPELL_AURA_MOD_CRIT_PCT
|
||||
@@ -1266,9 +1258,7 @@ public:
|
||||
if (GetCaster()->GetOwner()->ToPlayer())
|
||||
{
|
||||
// For others recalculate it from:
|
||||
float CritSpell = 0.0f;
|
||||
// Crit from Intellect
|
||||
// CritSpell += owner->GetSpellCritFromIntellect();
|
||||
float CritSpell = 5.0f;
|
||||
// Increase crit from SPELL_AURA_MOD_SPELL_CRIT_CHANCE
|
||||
// CritSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
|
||||
// Increase crit from SPELL_AURA_MOD_CRIT_PCT
|
||||
@@ -1287,9 +1277,7 @@ public:
|
||||
if (GetCaster()->GetOwner()->ToPlayer())
|
||||
{
|
||||
// For others recalculate it from:
|
||||
float CritMelee = 0.0f;
|
||||
// Crit from Agility
|
||||
// CritMelee += owner->GetMeleeCritFromAgility();
|
||||
float CritMelee = 5.0f;
|
||||
// Increase crit from SPELL_AURA_MOD_WEAPON_CRIT_PERCENT
|
||||
// CritMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT);
|
||||
// Increase crit from SPELL_AURA_MOD_CRIT_PCT
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "Common.h"
|
||||
#include "DB2SparseStorageLoader.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Log.h"
|
||||
|
||||
DB2SparseFileLoader::DB2SparseFileLoader()
|
||||
@@ -201,6 +201,7 @@ uint32 DB2SparseFileLoader::GetFormatRecordSize(const char * format)
|
||||
{
|
||||
case FT_FLOAT:
|
||||
case FT_INT:
|
||||
case FT_SORT:
|
||||
recordsize += 4;
|
||||
break;
|
||||
case FT_STRING:
|
||||
@@ -247,7 +248,7 @@ static char const* const nullStr = "";
|
||||
char* DB2SparseFileLoader::AutoProduceData(const char* format, IndexTable const& indexTable, uint32 locale, std::vector<char*>& stringPool)
|
||||
{
|
||||
typedef char* ptr;
|
||||
if (strlen(format) != fieldCount)
|
||||
if (strlen(format) != fieldCount + (format[0] == FT_SORT ? 1 : 0))
|
||||
return NULL;
|
||||
|
||||
//get struct size and index pos
|
||||
@@ -283,8 +284,8 @@ char* DB2SparseFileLoader::AutoProduceData(const char* format, IndexTable const&
|
||||
for (std::size_t i = 0; i < stringHoldersPoolSize / sizeof(char*); ++i)
|
||||
((char const**)stringHoldersPool)[i] = nullStr;
|
||||
|
||||
char* stringTable = new char[expandedDataSize - records * (recordsize - stringFields * sizeof(char*))];
|
||||
memset(stringTable, 0, expandedDataSize - records * (recordsize - stringFields * sizeof(char*)));
|
||||
char* stringTable = new char[expandedDataSize - records * ((recordsize - (format[0] == FT_SORT ? 4 : 0)) - stringFields * sizeof(char*))];
|
||||
memset(stringTable, 0, expandedDataSize - records * ((recordsize - (format[0] == FT_SORT ? 4 : 0)) - stringFields * sizeof(char*)));
|
||||
stringPool.push_back(stringTable);
|
||||
char* stringPtr = stringTable;
|
||||
|
||||
@@ -298,7 +299,7 @@ char* DB2SparseFileLoader::AutoProduceData(const char* format, IndexTable const&
|
||||
indexTable.Insert(y + minIndex, &dataTable[offset]);
|
||||
uint32 fieldOffset = 0;
|
||||
uint32 stringFieldOffset = 0;
|
||||
for (uint32 x = 0; x < fieldCount; x++)
|
||||
for (uint32 x = 0; x < (fieldCount + (format[0] == FT_SORT ? 1 : 0)); x++)
|
||||
{
|
||||
switch (format[x])
|
||||
{
|
||||
@@ -352,6 +353,10 @@ char* DB2SparseFileLoader::AutoProduceData(const char* format, IndexTable const&
|
||||
offset += sizeof(char*);
|
||||
break;
|
||||
}
|
||||
case FT_SORT:
|
||||
*((uint32*)(&dataTable[offset])) = y + minIndex;
|
||||
offset += 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,7 +368,7 @@ char* DB2SparseFileLoader::AutoProduceData(const char* format, IndexTable const&
|
||||
|
||||
char* DB2SparseFileLoader::AutoProduceStrings(const char* format, char* dataTable, uint32 locale)
|
||||
{
|
||||
if (strlen(format) != fieldCount)
|
||||
if (strlen(format) != fieldCount + (format[0] == FT_SORT ? 1 : 0))
|
||||
return nullptr;
|
||||
|
||||
if (!(localeMask & (1 << locale)))
|
||||
@@ -513,6 +518,7 @@ char* DB2SparseDatabaseLoader::Load(const char* format, HotfixDatabaseStatements
|
||||
break;
|
||||
case FT_IND:
|
||||
case FT_INT:
|
||||
case FT_SORT:
|
||||
*((int32*)(&dataValue[offset])) = fields[f].GetInt32();
|
||||
offset += 4;
|
||||
break;
|
||||
@@ -617,6 +623,7 @@ void DB2SparseDatabaseLoader::LoadStrings(const char* format, HotfixDatabaseStat
|
||||
case FT_FLOAT:
|
||||
case FT_IND:
|
||||
case FT_INT:
|
||||
case FT_SORT:
|
||||
offset += 4;
|
||||
break;
|
||||
case FT_BYTE:
|
||||
|
||||
@@ -253,8 +253,6 @@ uint32 DB2FileLoader::GetFormatRecordSize(const char * format, int32* index_pos)
|
||||
recordsize += sizeof(char*);
|
||||
break;
|
||||
case FT_SORT:
|
||||
i = x;
|
||||
break;
|
||||
case FT_IND:
|
||||
i = x;
|
||||
recordsize += 4;
|
||||
@@ -322,7 +320,6 @@ char* DB2FileLoader::AutoProduceData(const char* format, uint32& records, char**
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSERT(indexField == 0);
|
||||
for (uint32 y = 0; y < recordCount; ++y)
|
||||
{
|
||||
uint32 ind = ((uint32*)idTable)[y];
|
||||
@@ -353,48 +350,51 @@ char* DB2FileLoader::AutoProduceData(const char* format, uint32& records, char**
|
||||
|
||||
uint32 offset = 0;
|
||||
|
||||
if (idTableSize)
|
||||
{
|
||||
ASSERT(format[0] == 'd');
|
||||
++format;
|
||||
}
|
||||
|
||||
for (uint32 y = 0; y < recordCount; y++)
|
||||
{
|
||||
uint32 indexVal;
|
||||
if (indexField >= 0)
|
||||
indexTable[!idTableSize ? getRecord(y).getUInt(indexField) : ((uint32*)idTable)[y]] = &dataTable[offset];
|
||||
indexVal = !idTableSize ? getRecord(y).getUInt(indexField) : ((uint32*)idTable)[y];
|
||||
else
|
||||
indexTable[y] = &dataTable[offset];
|
||||
indexVal = y;
|
||||
|
||||
for (uint32 x = 0; x < fieldCount; x++)
|
||||
indexTable[indexVal] = &dataTable[offset];
|
||||
|
||||
uint32 x = 0;
|
||||
for (char const* fmt = format; *fmt != '\0'; ++fmt)
|
||||
{
|
||||
switch (format[x])
|
||||
switch (*fmt)
|
||||
{
|
||||
case FT_FLOAT:
|
||||
*((float*)(&dataTable[offset])) = getRecord(y).getFloat(x);
|
||||
*((float*)(&dataTable[offset])) = getRecord(y).getFloat(x++);
|
||||
offset += 4;
|
||||
break;
|
||||
case FT_IND:
|
||||
case FT_INT:
|
||||
*((uint32*)(&dataTable[offset])) = getRecord(y).getUInt(x);
|
||||
*((uint32*)(&dataTable[offset])) = getRecord(y).getUInt(x++);
|
||||
offset += 4;
|
||||
break;
|
||||
case FT_BYTE:
|
||||
*((uint8*)(&dataTable[offset])) = getRecord(y).getUInt8(x);
|
||||
*((uint8*)(&dataTable[offset])) = getRecord(y).getUInt8(x++);
|
||||
offset += 1;
|
||||
break;
|
||||
case FT_LONG:
|
||||
*((uint64*)(&dataTable[offset])) = getRecord(y).getUInt64(x);
|
||||
*((uint64*)(&dataTable[offset])) = getRecord(y).getUInt64(x++);
|
||||
offset += 8;
|
||||
break;
|
||||
case FT_SHORT:
|
||||
*((uint16*)(&dataTable[offset])) = getRecord(y).getUInt16(x);
|
||||
*((uint16*)(&dataTable[offset])) = getRecord(y).getUInt16(x++);
|
||||
offset += 2;
|
||||
break;
|
||||
case FT_STRING:
|
||||
case FT_STRING_NOT_LOCALIZED:
|
||||
*((char**)(&dataTable[offset])) = nullptr; // will be replaces non-empty or "" strings in AutoProduceStrings
|
||||
offset += sizeof(char*);
|
||||
++x;
|
||||
break;
|
||||
case FT_SORT:
|
||||
*((uint32*)(&dataTable[offset])) = indexVal;
|
||||
offset += 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -444,21 +444,19 @@ char* DB2FileLoader::AutoProduceStringsArrayHolders(const char* format, char* da
|
||||
|
||||
uint32 offset = 0;
|
||||
|
||||
if (idTableSize)
|
||||
++format;
|
||||
|
||||
// assign string holders to string field slots
|
||||
for (uint32 y = 0; y < recordCount; y++)
|
||||
{
|
||||
uint32 stringFieldOffset = 0;
|
||||
|
||||
for (uint32 x = 0; x < fieldCount; x++)
|
||||
for (char const* fmt = format; *fmt != '\0'; ++fmt)
|
||||
{
|
||||
switch (format[x])
|
||||
switch (*fmt)
|
||||
{
|
||||
case FT_FLOAT:
|
||||
case FT_IND:
|
||||
case FT_INT:
|
||||
case FT_SORT:
|
||||
offset += 4;
|
||||
break;
|
||||
case FT_BYTE:
|
||||
@@ -476,7 +474,7 @@ char* DB2FileLoader::AutoProduceStringsArrayHolders(const char* format, char* da
|
||||
// init db2 string field slots by pointers to string holders
|
||||
char const*** slot = (char const***)(&dataTable[offset]);
|
||||
*slot = (char const**)(&stringHoldersPool[stringHoldersRecordPoolSize * y + stringFieldOffset]);
|
||||
if (format[x] == FT_STRING)
|
||||
if (*fmt == FT_STRING)
|
||||
stringFieldOffset += stringHolderSize;
|
||||
else
|
||||
++stringFieldOffset;
|
||||
@@ -485,7 +483,7 @@ char* DB2FileLoader::AutoProduceStringsArrayHolders(const char* format, char* da
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ASSERT(false, "unknown format character %c", format[x]);
|
||||
ASSERT(false, "unknown format character %c", *fmt);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -521,18 +519,17 @@ char* DB2FileLoader::AutoProduceStrings(const char* format, char* dataTable, uin
|
||||
|
||||
uint32 offset = 0;
|
||||
|
||||
if (idTableSize)
|
||||
++format;
|
||||
|
||||
for (uint32 y = 0; y < recordCount; y++)
|
||||
{
|
||||
for (uint32 x = 0; x < fieldCount; x++)
|
||||
uint32 x = 0;
|
||||
for (char const* fmt = format; *fmt != '\0'; ++fmt)
|
||||
{
|
||||
switch (format[x])
|
||||
switch (*fmt)
|
||||
{
|
||||
case FT_FLOAT:
|
||||
case FT_IND:
|
||||
case FT_INT:
|
||||
case FT_SORT:
|
||||
offset += 4;
|
||||
break;
|
||||
case FT_BYTE:
|
||||
@@ -566,6 +563,9 @@ char* DB2FileLoader::AutoProduceStrings(const char* format, char* dataTable, uin
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (*fmt != FT_SORT)
|
||||
++x;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -705,6 +705,10 @@ char* DB2DatabaseLoader::Load(const char* format, HotfixDatabaseStatements prepa
|
||||
offset += sizeof(char*);
|
||||
break;
|
||||
}
|
||||
case FT_SORT:
|
||||
*((int32*)(&dataValue[offset])) = indexValue;
|
||||
offset += 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -769,6 +773,7 @@ void DB2DatabaseLoader::LoadStrings(const char* format, HotfixDatabaseStatements
|
||||
case FT_FLOAT:
|
||||
case FT_IND:
|
||||
case FT_INT:
|
||||
case FT_SORT:
|
||||
offset += 4;
|
||||
break;
|
||||
case FT_BYTE:
|
||||
|
||||
@@ -245,8 +245,8 @@ public:
|
||||
iterator_wrapper(iterator_wrapper const& right) = default;
|
||||
iterator_wrapper(Base const& baseItr) : Base(baseItr) { }
|
||||
|
||||
uint32 ID() const { return (*this)->first; }
|
||||
T const* Data() const { return (*this)->second; }
|
||||
T const* operator->() const { return Base::operator->()->second; }
|
||||
T const* operator*() const { return Base::operator*().second; }
|
||||
} iterator;
|
||||
|
||||
DB2SparseStorage(char const* fileName, char const* format, HotfixDatabaseStatements preparedStmtIndex)
|
||||
|
||||
@@ -1,314 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "DBCFileLoader.h"
|
||||
#include "Errors.h"
|
||||
|
||||
DBCFileLoader::DBCFileLoader() : recordSize(0), recordCount(0), fieldCount(0), stringSize(0), fieldsOffset(NULL), data(NULL), stringTable(NULL) { }
|
||||
|
||||
bool DBCFileLoader::Load(const char* filename, const char* fmt)
|
||||
{
|
||||
uint32 header;
|
||||
if (data)
|
||||
{
|
||||
delete [] data;
|
||||
data = NULL;
|
||||
}
|
||||
|
||||
FILE* f = fopen(filename, "rb");
|
||||
if (!f)
|
||||
return false;
|
||||
|
||||
if (fread(&header, 4, 1, f) != 1) // Number of records
|
||||
{
|
||||
fclose(f);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
EndianConvert(header);
|
||||
|
||||
if (header != 0x43424457) //'WDBC'
|
||||
{
|
||||
fclose(f);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (fread(&recordCount, 4, 1, f) != 1) // Number of records
|
||||
{
|
||||
fclose(f);
|
||||
return false;
|
||||
}
|
||||
|
||||
EndianConvert(recordCount);
|
||||
|
||||
if (fread(&fieldCount, 4, 1, f) != 1) // Number of fields
|
||||
{
|
||||
fclose(f);
|
||||
return false;
|
||||
}
|
||||
|
||||
EndianConvert(fieldCount);
|
||||
|
||||
if (fread(&recordSize, 4, 1, f) != 1) // Size of a record
|
||||
{
|
||||
fclose(f);
|
||||
return false;
|
||||
}
|
||||
|
||||
EndianConvert(recordSize);
|
||||
|
||||
if (fread(&stringSize, 4, 1, f) != 1) // String size
|
||||
{
|
||||
fclose(f);
|
||||
return false;
|
||||
}
|
||||
|
||||
EndianConvert(stringSize);
|
||||
|
||||
fieldsOffset = new uint32[fieldCount];
|
||||
fieldsOffset[0] = 0;
|
||||
for (uint32 i = 1; i < fieldCount; ++i)
|
||||
{
|
||||
fieldsOffset[i] = fieldsOffset[i - 1];
|
||||
if (fmt[i - 1] == FT_BYTE || fmt[i - 1] == FT_NA_BYTE) // byte fields
|
||||
fieldsOffset[i] += sizeof(uint8);
|
||||
else if (fmt[i - 1] == FT_LONG)
|
||||
fieldsOffset[i] += sizeof(uint64);
|
||||
else // 4 byte fields (int32/float/strings)
|
||||
fieldsOffset[i] += sizeof(uint32);
|
||||
}
|
||||
|
||||
data = new unsigned char[recordSize * recordCount + stringSize];
|
||||
stringTable = data + recordSize*recordCount;
|
||||
|
||||
if (fread(data, recordSize * recordCount + stringSize, 1, f) != 1)
|
||||
{
|
||||
fclose(f);
|
||||
return false;
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
DBCFileLoader::~DBCFileLoader()
|
||||
{
|
||||
delete[] data;
|
||||
|
||||
delete[] fieldsOffset;
|
||||
}
|
||||
|
||||
DBCFileLoader::Record DBCFileLoader::getRecord(size_t id)
|
||||
{
|
||||
assert(data);
|
||||
return Record(*this, data + id * recordSize);
|
||||
}
|
||||
|
||||
uint32 DBCFileLoader::GetFormatRecordSize(const char* format, int32* index_pos)
|
||||
{
|
||||
uint32 recordsize = 0;
|
||||
int32 i = -1;
|
||||
for (uint32 x = 0; format[x]; ++x)
|
||||
{
|
||||
switch (format[x])
|
||||
{
|
||||
case FT_FLOAT:
|
||||
recordsize += sizeof(float);
|
||||
break;
|
||||
case FT_INT:
|
||||
recordsize += sizeof(uint32);
|
||||
break;
|
||||
case FT_STRING:
|
||||
recordsize += sizeof(char*);
|
||||
break;
|
||||
case FT_SORT:
|
||||
i = x;
|
||||
break;
|
||||
case FT_IND:
|
||||
i = x;
|
||||
recordsize += sizeof(uint32);
|
||||
break;
|
||||
case FT_BYTE:
|
||||
recordsize += sizeof(uint8);
|
||||
break;
|
||||
case FT_LONG:
|
||||
recordsize += sizeof(uint64);
|
||||
break;
|
||||
case FT_NA:
|
||||
case FT_NA_BYTE:
|
||||
break;
|
||||
default:
|
||||
ASSERT(false && "Unknown field format character in DBCfmt.h");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (index_pos)
|
||||
*index_pos = i;
|
||||
|
||||
return recordsize;
|
||||
}
|
||||
|
||||
char* DBCFileLoader::AutoProduceData(const char* format, uint32& records, char**& indexTable, uint32 sqlRecordCount, uint32 sqlHighestIndex, char*& sqlDataTable)
|
||||
{
|
||||
typedef char* ptr;
|
||||
if (strlen(format) != fieldCount)
|
||||
return NULL;
|
||||
|
||||
//get struct size and index pos
|
||||
int32 i;
|
||||
uint32 recordsize = GetFormatRecordSize(format, &i);
|
||||
|
||||
if (i >= 0)
|
||||
{
|
||||
uint32 maxi = 0;
|
||||
//find max index
|
||||
for (uint32 y = 0; y < recordCount; ++y)
|
||||
{
|
||||
uint32 ind = getRecord(y).getUInt(i);
|
||||
if (ind > maxi)
|
||||
maxi = ind;
|
||||
}
|
||||
|
||||
// If higher index avalible from sql - use it instead of dbcs
|
||||
if (sqlHighestIndex > maxi)
|
||||
maxi = sqlHighestIndex;
|
||||
|
||||
++maxi;
|
||||
records = maxi;
|
||||
indexTable = new ptr[maxi];
|
||||
memset(indexTable, 0, maxi * sizeof(ptr));
|
||||
}
|
||||
else
|
||||
{
|
||||
records = recordCount + sqlRecordCount;
|
||||
indexTable = new ptr[recordCount + sqlRecordCount];
|
||||
}
|
||||
|
||||
char* dataTable = new char[(recordCount + sqlRecordCount) * recordsize];
|
||||
|
||||
uint32 offset = 0;
|
||||
|
||||
for (uint32 y = 0; y < recordCount; ++y)
|
||||
{
|
||||
if (i >= 0)
|
||||
indexTable[getRecord(y).getUInt(i)] = &dataTable[offset];
|
||||
else
|
||||
indexTable[y] = &dataTable[offset];
|
||||
|
||||
for (uint32 x=0; x < fieldCount; ++x)
|
||||
{
|
||||
switch (format[x])
|
||||
{
|
||||
case FT_FLOAT:
|
||||
*((float*)(&dataTable[offset])) = getRecord(y).getFloat(x);
|
||||
offset += sizeof(float);
|
||||
break;
|
||||
case FT_IND:
|
||||
case FT_INT:
|
||||
*((uint32*)(&dataTable[offset])) = getRecord(y).getUInt(x);
|
||||
offset += sizeof(uint32);
|
||||
break;
|
||||
case FT_BYTE:
|
||||
*((uint8*)(&dataTable[offset])) = getRecord(y).getUInt8(x);
|
||||
offset += sizeof(uint8);
|
||||
break;
|
||||
case FT_LONG:
|
||||
*((uint64*)(&dataTable[offset])) = getRecord(y).getUInt64(x);
|
||||
offset += sizeof(uint64);
|
||||
break;
|
||||
case FT_STRING:
|
||||
*((char**)(&dataTable[offset])) = NULL; // will replace non-empty or "" strings in AutoProduceStrings
|
||||
offset += sizeof(char*);
|
||||
break;
|
||||
case FT_NA:
|
||||
case FT_NA_BYTE:
|
||||
case FT_SORT:
|
||||
break;
|
||||
default:
|
||||
ASSERT(false && "Unknown field format character in DBCfmt.h");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sqlDataTable = dataTable + offset;
|
||||
|
||||
return dataTable;
|
||||
}
|
||||
|
||||
char* DBCFileLoader::AutoProduceStrings(const char* format, char* dataTable)
|
||||
{
|
||||
if (strlen(format) != fieldCount)
|
||||
return NULL;
|
||||
|
||||
char* stringPool = new char[stringSize];
|
||||
memcpy(stringPool, stringTable, stringSize);
|
||||
|
||||
uint32 offset = 0;
|
||||
|
||||
for (uint32 y = 0; y < recordCount; ++y)
|
||||
{
|
||||
for (uint32 x = 0; x < fieldCount; ++x)
|
||||
{
|
||||
switch (format[x])
|
||||
{
|
||||
case FT_FLOAT:
|
||||
offset += sizeof(float);
|
||||
break;
|
||||
case FT_IND:
|
||||
case FT_INT:
|
||||
offset += sizeof(uint32);
|
||||
break;
|
||||
case FT_BYTE:
|
||||
offset += sizeof(uint8);
|
||||
break;
|
||||
case FT_LONG:
|
||||
offset += sizeof(uint64);
|
||||
break;
|
||||
case FT_STRING:
|
||||
{
|
||||
// fill only not filled entries
|
||||
char** slot = (char**)(&dataTable[offset]);
|
||||
if (!*slot || !**slot)
|
||||
{
|
||||
const char * st = getRecord(y).getString(x);
|
||||
*slot=stringPool+(st-(const char*)stringTable);
|
||||
}
|
||||
offset += sizeof(char*);
|
||||
break;
|
||||
}
|
||||
case FT_NA:
|
||||
case FT_NA_BYTE:
|
||||
case FT_SORT:
|
||||
break;
|
||||
default:
|
||||
ASSERT(false && "Unknown field format character in DBCfmt.h");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return stringPool;
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef DBC_FILE_LOADER_H
|
||||
#define DBC_FILE_LOADER_H
|
||||
|
||||
#include "Define.h"
|
||||
#include "Utilities/ByteConverter.h"
|
||||
#include <cassert>
|
||||
|
||||
class TC_SHARED_API DBCFileLoader
|
||||
{
|
||||
public:
|
||||
DBCFileLoader();
|
||||
~DBCFileLoader();
|
||||
|
||||
bool Load(const char *filename, const char *fmt);
|
||||
|
||||
class Record
|
||||
{
|
||||
public:
|
||||
float getFloat(size_t field) const
|
||||
{
|
||||
assert(field < file.fieldCount);
|
||||
float val = *reinterpret_cast<float*>(offset + file.GetOffset(field));
|
||||
EndianConvert(val);
|
||||
return val;
|
||||
}
|
||||
uint32 getUInt(size_t field) const
|
||||
{
|
||||
assert(field < file.fieldCount);
|
||||
uint32 val = *reinterpret_cast<uint32*>(offset + file.GetOffset(field));
|
||||
EndianConvert(val);
|
||||
return val;
|
||||
}
|
||||
uint8 getUInt8(size_t field) const
|
||||
{
|
||||
assert(field < file.fieldCount);
|
||||
return *reinterpret_cast<uint8*>(offset + file.GetOffset(field));
|
||||
}
|
||||
uint64 getUInt64(size_t field) const
|
||||
{
|
||||
assert(field < file.fieldCount);
|
||||
uint64 val = *reinterpret_cast<uint64*>(offset + file.GetOffset(field));
|
||||
EndianConvert(val);
|
||||
return val;
|
||||
}
|
||||
const char *getString(size_t field) const
|
||||
{
|
||||
assert(field < file.fieldCount);
|
||||
size_t stringOffset = getUInt(field);
|
||||
assert(stringOffset < file.stringSize);
|
||||
return reinterpret_cast<char*>(file.stringTable + stringOffset);
|
||||
}
|
||||
|
||||
private:
|
||||
Record(DBCFileLoader &file_, unsigned char *offset_): offset(offset_), file(file_) { }
|
||||
unsigned char* offset;
|
||||
DBCFileLoader& file;
|
||||
|
||||
friend class DBCFileLoader;
|
||||
|
||||
};
|
||||
|
||||
// Get record by id
|
||||
Record getRecord(size_t id);
|
||||
/// Get begin iterator over records
|
||||
|
||||
uint32 GetNumRows() const { return recordCount; }
|
||||
uint32 GetRowSize() const { return recordSize; }
|
||||
uint32 GetCols() const { return fieldCount; }
|
||||
uint32 GetOffset(size_t id) const { return (fieldsOffset != NULL && id < fieldCount) ? fieldsOffset[id] : 0; }
|
||||
bool IsLoaded() const { return data != NULL; }
|
||||
char* AutoProduceData(const char* fmt, uint32& count, char**& indexTable, uint32 sqlRecordCount, uint32 sqlHighestIndex, char *& sqlDataTable);
|
||||
char* AutoProduceStrings(const char* fmt, char* dataTable);
|
||||
static uint32 GetFormatRecordSize(const char * format, int32 * index_pos = NULL);
|
||||
private:
|
||||
|
||||
uint32 recordSize;
|
||||
uint32 recordCount;
|
||||
uint32 fieldCount;
|
||||
uint32 stringSize;
|
||||
uint32 *fieldsOffset;
|
||||
unsigned char *data;
|
||||
unsigned char *stringTable;
|
||||
|
||||
DBCFileLoader(DBCFileLoader const& right) = delete;
|
||||
DBCFileLoader& operator=(DBCFileLoader const& right) = delete;
|
||||
};
|
||||
#endif
|
||||
@@ -1,325 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef DBCSTORE_H
|
||||
#define DBCSTORE_H
|
||||
|
||||
#include "DBCFileLoader.h"
|
||||
#include "DBStorageIterator.h"
|
||||
#include "Log.h"
|
||||
#include "Field.h"
|
||||
#include "DatabaseWorkerPool.h"
|
||||
#include "Implementation/WorldDatabase.h"
|
||||
#include "DatabaseEnv.h"
|
||||
|
||||
struct SqlDbc
|
||||
{
|
||||
std::string const* formatString;
|
||||
std::string const* indexName;
|
||||
std::string sqlTableName;
|
||||
int32 indexPos;
|
||||
int32 sqlIndexPos;
|
||||
SqlDbc(std::string const* _filename, std::string const* _format, std::string const* _idname, char const* fmt)
|
||||
: formatString(_format), indexName (_idname), sqlIndexPos(0)
|
||||
{
|
||||
// Convert dbc file name to sql table name
|
||||
sqlTableName = *_filename;
|
||||
for (uint32 i = 0; i< sqlTableName.size(); ++i)
|
||||
{
|
||||
if (isalpha(sqlTableName[i]))
|
||||
sqlTableName[i] = char(tolower(sqlTableName[i]));
|
||||
else if (sqlTableName[i] == '.')
|
||||
sqlTableName[i] = '_';
|
||||
}
|
||||
|
||||
// Get sql index position
|
||||
DBCFileLoader::GetFormatRecordSize(fmt, &indexPos);
|
||||
if (indexPos >= 0)
|
||||
{
|
||||
uint32 uindexPos = uint32(indexPos);
|
||||
for (uint32 x = 0; x < formatString->size(); ++x)
|
||||
{
|
||||
// Count only fields present in sql
|
||||
if ((*formatString)[x] == FT_SQL_PRESENT)
|
||||
{
|
||||
if (x == uindexPos)
|
||||
break;
|
||||
++sqlIndexPos;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
SqlDbc(SqlDbc const& right) = delete;
|
||||
SqlDbc& operator=(SqlDbc const& right) = delete;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
class DBCStorage
|
||||
{
|
||||
typedef std::list<char*> StringPoolList;
|
||||
|
||||
public:
|
||||
typedef DBStorageIterator<T> iterator;
|
||||
|
||||
explicit DBCStorage(char const* f)
|
||||
: fmt(f), nCount(0), fieldCount(0), dataTable(NULL)
|
||||
{
|
||||
indexTable.asT = NULL;
|
||||
}
|
||||
|
||||
~DBCStorage() { Clear(); }
|
||||
|
||||
T const* LookupEntry(uint32 id) const
|
||||
{
|
||||
return (id >= nCount) ? NULL : indexTable.asT[id];
|
||||
}
|
||||
|
||||
T const* AssertEntry(uint32 id) const
|
||||
{
|
||||
T const* entry = LookupEntry(id);
|
||||
ASSERT(entry);
|
||||
return entry;
|
||||
}
|
||||
|
||||
uint32 GetNumRows() const { return nCount; }
|
||||
char const* GetFormat() const { return fmt; }
|
||||
uint32 GetFieldCount() const { return fieldCount; }
|
||||
|
||||
bool Load(char const* fn, SqlDbc* sql)
|
||||
{
|
||||
DBCFileLoader dbc;
|
||||
// Check if load was successful, only then continue
|
||||
if (!dbc.Load(fn, fmt))
|
||||
return false;
|
||||
|
||||
uint32 sqlRecordCount = 0;
|
||||
uint32 sqlHighestIndex = 0;
|
||||
Field* fields = NULL;
|
||||
QueryResult result = QueryResult(NULL);
|
||||
// Load data from sql
|
||||
if (sql)
|
||||
{
|
||||
std::string query = "SELECT * FROM " + sql->sqlTableName;
|
||||
if (sql->indexPos >= 0)
|
||||
query +=" ORDER BY " + *sql->indexName + " DESC";
|
||||
query += ';';
|
||||
|
||||
|
||||
result = WorldDatabase.Query(query.c_str());
|
||||
if (result)
|
||||
{
|
||||
sqlRecordCount = uint32(result->GetRowCount());
|
||||
if (sql->indexPos >= 0)
|
||||
{
|
||||
fields = result->Fetch();
|
||||
sqlHighestIndex = fields[sql->sqlIndexPos].GetUInt32();
|
||||
}
|
||||
|
||||
// Check if sql index pos is valid
|
||||
if (int32(result->GetFieldCount() - 1) < sql->sqlIndexPos)
|
||||
{
|
||||
TC_LOG_ERROR("server.loading", "Invalid index pos for dbc:'%s'", sql->sqlTableName.c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
char* sqlDataTable = NULL;
|
||||
fieldCount = dbc.GetCols();
|
||||
|
||||
dataTable = reinterpret_cast<T*>(dbc.AutoProduceData(fmt, nCount, indexTable.asChar,
|
||||
sqlRecordCount, sqlHighestIndex, sqlDataTable));
|
||||
|
||||
stringPoolList.push_back(dbc.AutoProduceStrings(fmt, reinterpret_cast<char*>(dataTable)));
|
||||
|
||||
// Insert sql data into arrays
|
||||
if (result)
|
||||
{
|
||||
if (indexTable.asT)
|
||||
{
|
||||
uint32 offset = 0;
|
||||
uint32 rowIndex = dbc.GetNumRows();
|
||||
do
|
||||
{
|
||||
if (!fields)
|
||||
fields = result->Fetch();
|
||||
|
||||
if (sql->indexPos >= 0)
|
||||
{
|
||||
uint32 id = fields[sql->sqlIndexPos].GetUInt32();
|
||||
if (indexTable.asT[id])
|
||||
{
|
||||
TC_LOG_ERROR("server.loading", "Index %d already exists in dbc:'%s'", id, sql->sqlTableName.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
indexTable.asT[id] = reinterpret_cast<T*>(&sqlDataTable[offset]);
|
||||
}
|
||||
else
|
||||
indexTable.asT[rowIndex]= reinterpret_cast<T*>(&sqlDataTable[offset]);
|
||||
|
||||
uint32 columnNumber = 0;
|
||||
uint32 sqlColumnNumber = 0;
|
||||
|
||||
for (; columnNumber < sql->formatString->size(); ++columnNumber)
|
||||
{
|
||||
if ((*sql->formatString)[columnNumber] == FT_SQL_ABSENT)
|
||||
{
|
||||
switch (fmt[columnNumber])
|
||||
{
|
||||
case FT_FLOAT:
|
||||
*reinterpret_cast<float*>(&sqlDataTable[offset]) = 0.0f;
|
||||
offset += 4;
|
||||
break;
|
||||
case FT_IND:
|
||||
case FT_INT:
|
||||
*reinterpret_cast<uint32*>(&sqlDataTable[offset]) = uint32(0);
|
||||
offset += 4;
|
||||
break;
|
||||
case FT_BYTE:
|
||||
*reinterpret_cast<uint8*>(&sqlDataTable[offset]) = uint8(0);
|
||||
offset += 1;
|
||||
break;
|
||||
case FT_LONG:
|
||||
*reinterpret_cast<uint64*>(&sqlDataTable[offset]) = uint64(0);
|
||||
offset += 8;
|
||||
break;
|
||||
case FT_STRING:
|
||||
// Beginning of the pool - empty string
|
||||
*reinterpret_cast<char**>(&sqlDataTable[offset]) = stringPoolList.back();
|
||||
offset += sizeof(char*);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if ((*sql->formatString)[columnNumber] == FT_SQL_PRESENT)
|
||||
{
|
||||
bool validSqlColumn = true;
|
||||
switch (fmt[columnNumber])
|
||||
{
|
||||
case FT_FLOAT:
|
||||
*reinterpret_cast<float*>(&sqlDataTable[offset]) = fields[sqlColumnNumber].GetFloat();
|
||||
offset += 4;
|
||||
break;
|
||||
case FT_IND:
|
||||
case FT_INT:
|
||||
*reinterpret_cast<uint32*>(&sqlDataTable[offset]) = fields[sqlColumnNumber].GetUInt32();
|
||||
offset += 4;
|
||||
break;
|
||||
case FT_BYTE:
|
||||
*reinterpret_cast<uint8*>(&sqlDataTable[offset]) = fields[sqlColumnNumber].GetUInt8();
|
||||
offset += 1;
|
||||
break;
|
||||
case FT_LONG:
|
||||
*reinterpret_cast<uint64*>(&sqlDataTable[offset]) = fields[sqlColumnNumber].GetUInt64();
|
||||
offset += 8;
|
||||
break;
|
||||
case FT_STRING:
|
||||
TC_LOG_ERROR("server.loading", "Unsupported data type in table '%s' at char %d", sql->sqlTableName.c_str(), columnNumber);
|
||||
return false;
|
||||
case FT_SORT:
|
||||
break;
|
||||
default:
|
||||
validSqlColumn = false;
|
||||
break;
|
||||
}
|
||||
if (validSqlColumn && (columnNumber != (sql->formatString->size()-1)))
|
||||
sqlColumnNumber++;
|
||||
}
|
||||
else
|
||||
{
|
||||
TC_LOG_ERROR("server.loading", "Incorrect sql format string '%s' at char %d", sql->sqlTableName.c_str(), columnNumber);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (sqlColumnNumber != (result->GetFieldCount() - 1))
|
||||
{
|
||||
TC_LOG_ERROR("server.loading", "SQL and DBC format strings are not matching for table: '%s'", sql->sqlTableName.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
fields = NULL;
|
||||
++rowIndex;
|
||||
} while (result->NextRow());
|
||||
}
|
||||
}
|
||||
|
||||
// error in dbc file at loading if NULL
|
||||
return indexTable.asT != NULL;
|
||||
}
|
||||
|
||||
bool LoadStringsFrom(char const* fn)
|
||||
{
|
||||
// DBC must be already loaded using Load
|
||||
if (!indexTable.asT)
|
||||
return false;
|
||||
|
||||
DBCFileLoader dbc;
|
||||
// Check if load was successful, only then continue
|
||||
if (!dbc.Load(fn, fmt))
|
||||
return false;
|
||||
|
||||
stringPoolList.push_back(dbc.AutoProduceStrings(fmt, reinterpret_cast<char*>(dataTable)));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
if (!indexTable.asT)
|
||||
return;
|
||||
|
||||
delete[] reinterpret_cast<char*>(indexTable.asT);
|
||||
indexTable.asT = NULL;
|
||||
delete[] reinterpret_cast<char*>(dataTable);
|
||||
dataTable = NULL;
|
||||
|
||||
while (!stringPoolList.empty())
|
||||
{
|
||||
delete[] stringPoolList.front();
|
||||
stringPoolList.pop_front();
|
||||
}
|
||||
|
||||
nCount = 0;
|
||||
}
|
||||
|
||||
iterator begin() { return iterator(indexTable.asT, nCount); }
|
||||
iterator end() { return iterator(indexTable.asT, nCount, nCount); }
|
||||
|
||||
private:
|
||||
char const* fmt;
|
||||
uint32 nCount;
|
||||
uint32 fieldCount;
|
||||
|
||||
union
|
||||
{
|
||||
T** asT;
|
||||
char** asChar;
|
||||
}
|
||||
indexTable;
|
||||
|
||||
T* dataTable;
|
||||
StringPoolList stringPoolList;
|
||||
|
||||
DBCStorage(DBCStorage const& right) = delete;
|
||||
DBCStorage& operator=(DBCStorage const& right) = delete;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -35,9 +35,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
uint32 ID() const { return _pos; }
|
||||
T const* Data() const { return _index[_pos]; }
|
||||
|
||||
T const* operator->() { return _index[_pos]; }
|
||||
T const* operator*() { return _index[_pos]; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user